Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Fix checksum in 48KB ROMS

Reply to topic
Author Message
  • Joined: 21 Oct 2015
  • Posts: 303
Reply with quote
Fix checksum in 48KB ROMS
Post Posted: Tue May 24, 2016 6:32 am
Hello

i am making some cartmods of several SG-1000 games, until yesterday all games tested worked perfectly but i am trying to do a cartmod of The Castle game that ocuppies 48kb and this not work on real hardware. I have an european Master System 2 and i am trying to fix checksum as other SG1000 games but this time it not works.

If i go to the 7ff0 i see that this line is not empty and if change it, it appears garbage on screen on the emulator. Well, i can see that 1ff0 and 3ff0 are empty but the problem is that if i change 1ff0 or 3ff0 i can´t fix the cheksum and the checksum calculated with Header Reader always change and i can't complete it. If i test it on real hardware always says Software error as i expected. I mark the size byte as 64KB.

I test with two games, The Castle MSX version, Knightmare and some others.

Any idea to fix the checksum to make it work on real hardware?

I am searching info but i found nothing about these roms or my problem.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue May 24, 2016 6:59 am
Have you checked their pages?

The Castle SG-1000 is 32-KB but uses extra embedded 8 KB of RAM.
http://www.smspower.org/Games/Castle-SG

The Castle MSX conversion is 48 kb and also use an adapter, it may or may not work on a Master System.
http://www.smspower.org/Games/CastleMsx-SG

(It's hard for me to understand why people are bothering making cart mods when 1) the SG-1000 palette looks so wrong on SMS and 2) those games are becoming cheaper and cheaper, whereas cart mods take times and are killing games which may eventually because more scarce.)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14691
  • Location: London
Reply with quote
Post Posted: Tue May 24, 2016 7:43 am
Even if you have an answer for the embedded RAM, it's a general issue to relocate data to make room for the header when hacking an SG game. Even better would be to upgrade it to mode 4, but that's super hard and cart mods seem to still be in the hex editing world.
  View user's profile Send private message Visit poster's website
  • Joined: 21 Oct 2015
  • Posts: 303
Reply with quote
Post Posted: Tue May 24, 2016 7:49 am
Last edited by law81 on Tue May 24, 2016 6:19 pm; edited 1 time in total
Bock wrote
Have you checked their pages?

The Castle SG-1000 is 32-KB but uses extra embedded 8 KB of RAM.
http://www.smspower.org/Games/Castle-SG

The Castle MSX conversion is 48 kb and also use an adapter, it may or may not work on a Master System.
http://www.smspower.org/Games/CastleMsx-SG

(It's hard for me to understand why people are bothering making cart mods when 1) the SG-1000 palette looks so wrong on SMS and 2) those games are becoming cheaper and cheaper, whereas cart mods take times and are killing games which may eventually because more scarce.)


Yes i have checked that pages. No problem for The Castle but similar games (48KB) also not works.

Yes, you are right but i like to play the games on the master system. I think that some games has horrible palette on master system but not all. I have a DIP socket soldered to use one cartridge, one for 4MB,2MB and 1MB and another one for 256KB


Maxim wrote
Even if you have an answer for the embedded RAM, it's a general issue to relocate data to make room for the header when hacking an SG game. Even better would be to upgrade it to mode 4, but that's super hard and cart mods seem to still be in the hex editing world.


So i can forget to fix the cheksum in these games...
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3763
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue May 24, 2016 11:37 am
law81 wrote
Well, i can see that 1ff0 and 3ff0 are empty but the problem is that if i change 1ff0 or 3ff0 i can´t fix the cheksum and the checksum calculated with Header Reader always change and i can't complete it.


I don't get it. Stuff the SEGA header into $3ff0 (if there's empty space there) and calculate checksum. Update checksum and check that now it matches.

edit: oh, maybe I got what you mean. Well, change the ROM size bits in the header so that it's a 16KB ROM.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14691
  • Location: London
Reply with quote
Post Posted: Tue May 24, 2016 11:45 am
There may not be unused space at any header location. More involved hacking is needed to work around this problem, such as relocating the data or applying a fix-up to the corrupted data at runtime. Another option is to page in a different bank on startup.

Header Reader doesn't support the alternative header locations in any released versions. That makes it hard to hex edit.
  View user's profile Send private message Visit poster's website
  • Joined: 27 Jun 2020
  • Posts: 212
Reply with quote
Post Posted: Fri Jun 04, 2021 3:42 am
Old thread but can't he just switch to the Jap BIOS? (or now asyncs M404 V4)
  View user's profile Send private message
  • Joined: 27 Jun 2020
  • Posts: 212
Reply with quote
Post Posted: Sat Jun 05, 2021 7:05 am
Last edited by L10N37 on Sat Jun 05, 2021 9:52 am; edited 2 times in total
I just had a similar issue with hacking "The Three Dragon Story" (Korean unlicensed)

The header area which has being unused in the past 10 or so games I've had working on real hardware/ original BIOS were simple... but this game gets messed up changing this area of the ROM.

You can alternatively try $1FF0 or 3FF0

which alters the corresponding patch locations to either 1Fxx or 3Fxx as oppose to 7Fxx (for reserved space/ checksum/ product code/ version/ region code/ rom size)

Then because the checksum is calculated over the entire ROM you have to lie to the system, so Instead of region and rom size being 4C @ $7FFF, I used 4A @ $1FFF (which header readers shows as 4kb ROM size, not 8?).

Finally with the new checksum being calculated over the range set @ $1FFF's 2nd half a byte we can insert the calculated checksum (from header reader) in @ 1FFA (which is for some reason always byte swapped i.e. 7B CA becomes CA 7B)


Anyway, that's my understanding of it but I have a copy working with so far no glitches.
**actually some of the enemy sprites are wrecked, dammit - doesn't happen on the emulators with the real BIOS used, also kills BG music shortly into level which doesn't happen on emulator using the same BIOS

**Bare minimum @ 0x3Fxx did it, all good on real system/ BIOS


**The taiwan tagged the castle ROM is 48kb, the Japan tagged ROM is 32kb and 0x7FCC to the end of the rom ox8000 is empty for your header - sorry this doesn't work, the emulator spits out a 16kb file and it boot loops or crashes depending on the emulator. I will try again
  View user's profile Send private message
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Sat Jun 05, 2021 9:23 am
L10N37 wrote
**actually some of the enemy sprites are wrecked, dammit - doesn't happen on the emulators with the real BIOS used, also kills BG music shortly into level which doesn't happen on emulator using the same BIOS

What setup did this happen with? What files were used?
  View user's profile Send private message Visit poster's website
  • Joined: 27 Jun 2020
  • Posts: 212
Reply with quote
Post Posted: Sat Jun 05, 2021 9:56 am
Calindro wrote
L10N37 wrote
**actually some of the enemy sprites are wrecked, dammit - doesn't happen on the emulators with the real BIOS used, also kills BG music shortly into level which doesn't happen on emulator using the same BIOS

What setup did this happen with? What files were used?



Version 1 = works perfectly on emulators - destroys most enemy sprites on the real system.

Version 2 = works on emulators and the real system (with regular EU/US BIOS i.e. Alex Kidd etc.)


Also added the castle but it's exactly what Sverx said above, you only had to change the ROM to be treated as 16kb by inserting the header at the 0x3Fxx location, that stops the checksum being impossible to calculate and changing every-time

No luck with the original Japanese version, only the unlicensed Taiwan one - I think it makes writes to the RAM that's included in the cartridge and Emulicious treats that as writing out an additional 16kb file - 32kb + that 16kb = Taiwan version of 48kb but I think the pirates just removed a lot of content and padded the ROM.

  View user's profile Send private message
  • Joined: 22 Apr 2018
  • Posts: 530
Reply with quote
Post Posted: Sun Jun 20, 2021 4:27 am
By the way the "SG2GG" patch for the SG-1000 version of The Castle allows it to be played on a Game Gear in GG-SMS mode with a more appropriate TMS-like color palette and using Sega mapper cartridge SRAM in place of the custom cartridge RAM the original one relied on. However it doesn't add a checksum because that area of the ROM contains important data. I may try to fix that later by using mapper paging but I haven't done so yet
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!