Sunday, May 23, 2021

Ghidra Sega Master System

https://www.smspower.org/Development/MemoryMap says ROM ends at xC000 so Z80 default processor, and select options:

Memory map icon at the top to map ram/ram mirror.

Start at 0xC000, length 0x2000, read/write but probably not execute. Repeat for mirror, start at 0xE000, length 0x2000, (0xFFFC-0xFFFF are special so maybe not those right now I just have labels for them).

Add some IO:

PSG is at 0x007F, VPD Data lines at 0x00BE, VPD Address at 0x00BF, IOPort1 0xDC, IOPort2: 0xDD

Cartridge is likely larger than 0xC000, so add some overlays: Mapper File->Add to program. Select the file again. Options: Overlay✓,Name "Bank#", base Address: 8000, file offset 0x4000 * bankNumber, so for bank 12, 0xC * 0x4000 = 0x30000,

What It should look like after

 

Fixing the JP(some other bank): helpful thing (Search for Reference Manager) keyboard 'r', or right click -> references(bottom of the list) -> add/edit

Bank12 is loaded for Select#2 before jumping to 0x8000.

Other helpful things

Setting a constant to an enum reference is called "Equate" or keyboard 'e'.

All the enums that are 0x3

TODO: do all this automatically with a loader

  1. already started loader
  2. ref1
  3. maybe a better example
  4. more writing
  5. scripts with some more things

No comments:

Post a Comment