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 - Paging and Checksum questions.

Reply to topic
Author Message
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Paging and Checksum questions.
Post Posted: Mon Jul 10, 2000 1:11 am
Two questions:

-From the standpoint of SMS software, do the larger brazillian cartridges (Street Fighter II and Situo...) have to do anything special to access the banks beyond the first 4 megabits, or do you just set the paging registers to the page desired, even if it's beyond the first 32? I seem to recall the dump of SF2 at 6 megabits ran on versions BRSMS released earlier than the date the dump showed up, so I'd guess there's nothing special about paging beyond 32 banks.

-Does anyone know if the (US) SMS BIOS only checks for hte 'TMR SEGA' string to authenticate carts, or if it actually calculates and checks the checksum at the last 4 (or was it 2) bytes of the cart? And if so, does it calculate the full checksum or just first 32k (or 128k or 256k)?
I suppose I could read through the source code to divine an answer but if somebody's worked that out already I won't reinvent that wheel...
  View user's profile Send private message Visit poster's website
vecna
  • Guest
Reply with quote
Post Posted: Mon Jul 10, 2000 1:49 am
Quote
> -From the standpoint of SMS software, do the larger brazillian cartridges (Street Fighter II and Situo...) have to do anything special to access the banks beyond the first 4 megabits, or do you just set the paging registers to the page desired, even if it's beyond the first 32?

There's nothing special. The page registers are bytes, at 16k windows, so theoretically you could have 255pages * 16k = 4Mbyte cartridge. that's nothing new of course. At least, there's nothing special as far as software goes; if you're talking about devcarts I wouldn't really know.

Quote
> -Does anyone know if the (US) SMS BIOS only checks for hte 'TMR SEGA' string to authenticate carts, or if it actually calculates and checks the checksum at the last 4 (or was it 2) bytes of the cart? And if so, does it calculate the full checksum or just first 32k (or 128k or 256k)?

Hrm. I don't really know this, but I'm going to guess that it checks the checksum only of the first 32k, because the 'TMR SEGA' string + the checksum value is actually stored at the end of the 2nd page (regardless of if there are more pages).

- vecna
 
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
Post Posted: Mon Jul 10, 2000 8:47 pm
Quote
> -From the standpoint of SMS software, do the larger brazillian cartridges (Street Fighter II and Situo...) have to do anything special to access the banks beyond the first 4 megabits, or do you just set the paging registers to the page desired, even if it's beyond the first 32? I seem to recall the dump of SF2 at 6 megabits ran on versions BRSMS released earlier than the date the dump showed up, so I'd guess there's nothing special about paging beyond 32 banks.

Nothing special with them.
But those cartridges won't run on a SMS1 because of the BIOS (shows the "Software Error" screen, wonders why).

Quote
> -Does anyone know if the (US) SMS BIOS only checks for hte 'TMR SEGA' string to authenticate carts, or if it actually calculates and checks the checksum at the last 4 (or was it 2) bytes of the cart? And if so, does it calculate the full checksum or just first 32k (or 128k or 256k)?
> I suppose I could read through the source code to divine an answer but if somebody's worked that out already I won't reinvent that wheel...

It's hard to tell since most of the checks could be done inside of the mysterious ports access.
I guess as soon as I will be able to test code on a SMS thanks to MikeG's card design we'll we able to do tests and know.
  View user's profile Send private message Visit poster's website
vecna
  • Guest
Reply with quote
Post Posted: Mon Jul 10, 2000 9:10 pm
Quote
> Hrm. I don't really know this, but I'm going to guess that it checks the checksum only of the first 32k, because the 'TMR SEGA' string + the checksum value is actually stored at the end of the 2nd page (regardless of if there are more pages).

Hmm. After thinking about this some more, I am positive that it can only checksum the first 32k. not only is the checksum at the end of the 32k block, but it has no way of knowing how many pages there are in the cartridge (there's a few bits that describe the size of cartridge, but not all SMS carts fit into those sizes ... hrm. Besides I don't think it pages all the banks in to checksum them, that's a lot of work to do inside a port handler($3F), and the BIOS never accesses the paging registers. Additionally I seem to remember James McKay having said something to the same effect. For the life of me I can't find that doc now, however.

- vecna
 
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
About checksum
Post Posted: Mon Jul 10, 2000 10:20 pm
If you are talking about the usual SMS checksum, it takes account of the data up to 256 kilobytes.
But anyway the BIOS doesn't check it for sure as many games have intentionnal bad checksums (or even 0000 in the field in soem cases).
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Re: About checksum
Post Posted: Tue Jul 11, 2000 4:10 am
Quote
> If you are talking about the usual SMS checksum, it takes account of the data up to 256 kilobytes.
> But anyway the BIOS doesn't check it for sure as many games have intentionnal bad checksums (or even 0000 in the field in soem cases).

...so I -still- wonder why tetracycline didn't run on a real US SMS... even though it ran on the same system with a mark 3 bios, and even a game gear.
Did Mike G ever try the SMSpower demo?
  View user's profile Send private message Visit poster's website
  • Joined: 18 Sep 1999
  • Posts: 498
  • Location: Portland, Oregon USA
Reply with quote
Re: About checksum
Post Posted: Tue Jul 11, 2000 4:38 am
Quote
> If you are talking about the usual SMS checksum, it takes account of the data up to 256 kilobytes.

For what it's worth, I confirmed this first-hand when my copier (SMSARCH) was working.

Eric Quinn.
  View user's profile Send private message Visit poster's website
  • Joined: 21 Apr 2000
  • Posts: 598
  • Location: Newcastle upon Tyne, England
Reply with quote
Re: About checksum
Post Posted: Thu Jul 13, 2000 9:23 am
Quote
> ...so I -still- wonder why tetracycline didn't run on a real US SMS... even though it ran on the same system with a mark 3 bios, and even a game gear.
> Did Mike G ever try the SMSpower demo?

I've given it a try. The demo "as is" wasn't recognized at all by the US BIOS (the standard instruction screen was displayed).

I added the "TMR SEGA" text to the ROM and this resulted in the "SOFTWARE ERROR" screen.

In both cases the ROM worked fine with the Japanese BIOS in place.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!