From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:PSID and RSID (SID music)" |
|---|
| claim | "For any RSID, libsidplayfp's PSID::tryLoad throws a load error (ERR_INVALID) if the header load address, play address or speed word is non-zero. For an RSID whose flags word does not set the BASIC bit (bit 1, version >= 2), SidTuneBase::checkCompatibility then fails, and the load is refused with ERR_BAD_ADDR, when init's high nibble is A, B, D, E or F, or init lies outside the loaded data, or the (resolved) load address is below $07E8; an RSID with the BASIC bit is instead required to have init 0 (resolveAddrs)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PSID and RSID (SID music)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "RSID file" |
|---|
| effect | "load error for non-zero reserved header fields; load error ERR_BAD_ADDR for a bad init or load address of a non-BASIC RSID" |
|---|
| function | "PSID::tryLoad, SidTuneBase::checkCompatibility" |
|---|
| condition | "id == RSID, version 2-5 only (RSID versions 1 and others throw 'Unsupported RSID version'). The high-nibble test returns false before the init-range test. The load address tested is the one after resolveAddrs (header load must be 0, so it is the first two data bytes). Read: PSID::tryLoad (version switch, flags, reserved check), SidTuneBase::resolveAddrs and checkCompatibility and the caller at SidTuneBase.cpp 318-327 at c855551959; not read: callers outside src/sidtune." |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "reserved-field test; checkCompatibility in SidTuneBase.cpp 534-565 (SIDTUNE_R64_MIN_LOAD_ADDR 0x07e8 at line 108). What happens when checkCompatibility returns false was not read" |
|---|
| repo | "https://github.com/libsidplayfp/libsidplayfp" |
|---|
| commit | "c855551959b74651a800bdc16df1665de21f4e21" |
|---|
| path | "src/sidtune/PSID.cpp" |
|---|
| lines | "685-698" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "RSID restrictions" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T13:07:46.733Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T17:46:46.571Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read PSID.cpp 685-698 (ERR_INVALID for load/play/speed != 0), SidTuneBase.cpp 300-330 (checkRelocInfo, then checkCompatibility -> ERR_BAD_ADDR), resolveAddrs (BASIC needs init 0) and checkCompatibility (high nibble A,B,D,E,F, init range, load >= 0x07E8) at c855551." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T16:38:46.612Z" |
|---|
| summary | "checkCompatibility failure is a load error (ERR_BAD_ADDR), and it only runs for RSID without the BASIC flag; read PSID.cpp tryLoad/load and SidTuneBase.cpp 300-330, 498-565" |
|---|
| changed | | "claim" |
| "data" |
| "confidence" |
|
|---|
|
|
|---|