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:31] – [Address space (wswan)] 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.
Line 46: Line 51:
 </code> </code>
  
-ELF addresses ''0x00010000 0x0001FFFF'' currently correspond to SRAM addresses, but this may be changed in a future version (to support >64KB SRAM), so please don't rely on it.+ELF addresses ''0x00n10000 0x00n1FFFF'' currently correspond to SRAM addresses (where ''n'' is the SRAM bank), but this may be changed in a future version, so please don't rely on it.
  
 ===== Address space (wwitch) ===== ===== Address space (wwitch) =====
wswan/guide/elf_quirks.1727001078.txt.gz · Last modified: 2024/09/22 10:31 by asie