sanni / cartreader

A shield for the Arduino Mega that can back up video game cartridges.
GNU General Public License v3.0
2.23k stars 226 forks source link

SMS Updates #1002

Closed andy-miles closed 4 months ago

andy-miles commented 4 months ago
  1. SMS cart size detection algorithm is updated based on bank count instead of multiples of detected cart size from the header.
  2. SMS cart size detection is only invoked if the "TMR SEGA" header is parsed for non-JP carts.
  3. Manual selection of ROM size is now present in the SMS/GG menus to allow for manual override as detection algorithm does not work correctly for Cloud Master and Penguin Land US SMS carts.
  4. SG-1000 Operation menu now allows for reset instead of relying on a power cycle.

Notes:

I think a better long-term solution is to implement a CRC on the first 8 KiB + database lookup for SMS/GG/SG-1000 to determine the correct ROM size (or something similar to how NES/Famicom auto mapper detection works). This is especially true as not all carts have the "TMR SEGA" header value. For now, this update allows for anyone to manually specify the ROM size regardless of the detection algorithm being invoked to address edge cases.

Testing (HW5):

I've tested manual setting of ROM size on the problematic carts:

OSCR HW5 V14.0

[+] SMS/GG/MIII/SG-1000

[+] SMS/MarkIII raphnet

[+] Set ROM Size

[+] 128 KB

Selected Size: 128KB
Press Button...

[+] Read ROM

Saving to SMS/ROM/UNKNOWN/675/...
ROM Size: 128KB
[*******************]
CRC32... F97E9875 -> Penguin Land (USA, Europe).sms
OSCR HW5 V14.0

[+] SMS/GG/MIII/SG-1000

[+] SMS/MarkIII raphnet

[+] Set ROM Size

[+] 256 KB

Selected Size: 256KB
Press Button...

[+] Read ROM

Saving to SMS/ROM/UNKNOWN/667/...
ROM Size: 256KB
[*******************]
CRC32... E7F62E6D -> Cloud Master (USA, Europe, Brazil) (En).sms

Tested working auto-detect US SMS carts:

OSCR HW5 V14.0

[+] SMS/GG/MIII/SG-1000

[+] SMS/MarkIII raphnet

[+] Read ROM

SMS Header:

Name: TMR SEGA
128KB

Press Button...

Saving to SMS/ROM/TMR SEGA/677/...
ROM Size: 128KB
[*******************]
CRC32... 327A0B4C -> Paperboy (USA, Brazil) (En).sms
OSCR HW5 V14.0

[+] SMS/GG/MIII/SG-1000

[+] SMS/MarkIII raphnet

[+] Read ROM

SMS Header:

Name: TMR SEGA
128KB

Press Button...

Saving to SMS/ROM/TMR SEGA/678/...
ROM Size: 128KB
[*******************]
CRC32... B746A6F5 -> Global Defense (USA, Europe, Brazil) (En).sms