User Tools

Site Tools


wswan:guide:elf_quirks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wswan:guide:elf_quirks [2024/09/22 10:32] asiewswan:guide:elf_quirks [2024/09/22 11:58] (current) asie
Line 34: Line 34:
 </code> </code>
  
-To turn this into a physical address in the cartridge ROM's space, you should use the following equation: ''%%((addr & 0xFFFF) | ((addr & 0x7FF00000) >> 16)) & rom_mask%%''.+To turn this into a physical address in the cartridge ROM's space, you should use the following equation: ''%%((addr & 0xFFFF) | ((addr & 0x7FF00000) >> 4)) & rom_mask%%''
 + 
 +The high four bits of the CPU address are ignored for physical ROM address transformations. This is because their purpose is to tell the compiler/linker at what address the CPU accesses the 64KB bank, not where it is physically stored on the cartridge. For example: 
 + 
 +  * The ELF address ''FFFF0000'' means ''ROM bank 7FF, offset 0000, accessed at F0000 by the CPU'', 
 +  * The ELF address ''FFF30000'' means ''ROM bank 7FF, offset 0000, accessed at 30000 by the CPU''.
  
 ELF addresses ''0x00000000 - 0x0000FFFF'' correspond to IRAM addresses. ELF addresses ''0x00000000 - 0x0000FFFF'' correspond to IRAM addresses.
wswan/guide/elf_quirks.1727001155.txt.gz · Last modified: 2024/09/22 10:32 by asie