Sega Genesis

檔頭資訊


Ref. http://www.hacking-cult.org/?r/18/21
Ref. https://github.com/ekeeke/Genesis-Plus-GX

目前司徒知道的檔案副檔名類型,大致上有:*.smd、*.bin兩種,雖然副檔名可以隨意更改,不過一般模擬器還是會檢查檔案內部結構作為對應機制,Binary(*.bin)的檔頭資訊如下:

OffsetDescription
0x00Stack pointer
0x04Code start
0x08Bus error
0x0CAddress error
0x10Illegal instruction
0x14Divistion by zero
0x18CHK exception
0x1CTRAPV exception
0x20Privilege violation
0x24TRACE exeption
0x28LINE 1010 EMULATOR
0x2CLINE 1111 EMULATOR
0x30-0x5FReserved by Motorola
0x60Spurious exception
0x64Interrupt request level 1
0x68Interrupt request level 2
0x6CInterrupt request level 3
0x70Interrupt request level 4 (VDP interrupt / Horizontal blank)
0x74Interrupt request level 5
0x78Interrupt request level 6 (Vertical blank)
0x7CInterrupt request level 7
0x80TRAP #00 exception
0x84TRAP #01 exception
0x88TRAP #02 exception
0x8CTRAP #03 exception
0x90TRAP #04 exception
0x94TRAP #05 exception
0x98TRAP #06 exception
0x9CTRAP #07 exception
0xA0TRAP #08 exception
0xA4TRAP #09 exception
0xA8TRAP #10 exception
0xACTRAP #11 exception
0xB0TRAP #12 exception
0xB4TRAP #13 exception
0xB8TRAP #14 exception
0xBCTRAP #15 exception
0xC0-0xFFReserved by Motorola
0x100-0x10FConsole name (usually 'SEGA MEGA DRIVE ' or 'SEGA GENESIS ')
0x110-0x11FRelease date (usually '(C)XXXX YYYY.MMM' where XXXX is the company code, YYYY is the year and MMM is the month)
0x120-0x14FDomestic name
0x150-0x17FInternational name
0x180-0x18DVersion ('XX YYYYYYYYYYYY' where XX is the game type and YY the game code)
0x18E-0x18FChecksum (for info how to calculate checksum go HERE)
0x190-0x19FI/O support
0x1A0-0x1A3ROM start
0x1A4-0x1A7ROM end
0x1A8-0x1ABRAM start (usually 0x00FF0000)
0x1AC-0x1AFRAM end (usually 0x00FFFFFF)
0x1B0-0x1B2'RA' and 0xF8 enables SRAM.
0x1B3unused (0x20)
0x1B4-0x1B7SRAM start (default 0x00200000)
0x1B8-0x1BBSRAM end (default 0x0020FFFF)
0x1BC-0x1FFNotes (unused)

因此,如果不是這個格式的檔案,基本上是可以看成SMD(*.smd)類型的檔案,但是這樣說明好像有點粗糙,因此,司徒追了一下Genesis-Plus-GX模擬器,並且把載入ROM的步驟列出來:
Step1. 檢查0x100的位置是否為"ESAG",假如是,則必須做Endian交換(byte-swapped),其實就是高低Byte互換的意思
Step2. 檢查0x100的位置是否為"SEGA",假如不是,則代表SMD檔案類型,必須做de-interleave的動作,也就是前後8K Bytes互換
Step3. 接著載入處理完的檔案(Binary)



返回上一頁