Author Topic: An interesting conundrum.  (Read 5472 times)

Offline Muzer

  • Sgt. Retrode
  • ***
  • Posts: 121
  • Karma: +4/-0
An interesting conundrum.
« on: 29/Oct/2012 01:33:00 AM »
Hello again!

Thanks to Matthias's genius, I now have most Atari 2600 games working flawlessly once more. However, they are a little slow now - it seems to be about one second per kilobyte (varying slightly depending on which bankswitching method is used), with most Atari games being from 2kB to 16kB. This isn't too much of an issue though, in my opinion. Basically the problem was that for some electronics reasons I don't understand, changing every bit at once on the address buses of Atari games was causing a power drain causing the processor to freeze. This affected some people's units worse than others due to natural differences in the tolerances of the components. The fix is to only write to the port bit-by-bit.

However, I've run across another interesting issue that isn't any fault of the Retrode hardware or software that is interesting.

Atari 2600 game ROMs have no headers, and there is also no header in the file. However, Atari 2600 games sometimes have RAM on the cartridge and sometimes don't.

So, emulators decide whether or not to emulate RAM based on the checksum of the game (among a few other things as far as I can tell).

However, the checksum of the game includes the RAM. RAM is not always going to be the same.

You can see where this is going.

Games dumped by the Retrode, through no fault of the Retrode or its firmware, have a different RAM each time. So, the emulators don't always detect it as having RAM and you must specify manually that it does. This only works normally because the emulators have checksums of most/all of the ROMs on the internet; even for those there doesn't seem to be a convention for what to fill the RAM with (some have it as 0s but others have again random bytes). But obviously stuff from a Retrode isn't going to be the same as stuff from the internet, so the checksums won't match.


I suppose the only real way around this would be to moan at emulator authors to not include the RAM in the checksums. However, this would still have problems for previously undumped games (which are more common than you think; most games where the PAL versions are different have no PAL dumps online).

Thoughts?

Offline emuDrache

  • Junior Retrode
  • **
  • Posts: 57
  • Karma: +2/-0
    • database.trurip.org
Re: An interesting conundrum.
« Reply #1 on: 29/Oct/2012 05:40:47 PM »
sounds like that will be a royal pain to sort out properly ....
The goal of database.trurip.org is to catalogue the software of as many classic systems as possible. database.trurip.org does not and will never host ISO or ROM downloads

Offline rĂ­omhaire

  • Baby Retrode
  • *
  • Posts: 8
  • Karma: +0/-0
Re: An interesting conundrum.
« Reply #2 on: 08/Dec/2012 11:14:08 AM »
I don't know that much about emulations, but will telling the emulator to emulate RAM affect games that don't need any RAM or will it just waste some computer resources while doing nothing? If won't affect the game you could just recommend that the emulator makers put in an option to force RAM emulation always.

Offline Muzer

  • Sgt. Retrode
  • ***
  • Posts: 121
  • Karma: +4/-0
Re: An interesting conundrum.
« Reply #3 on: 21/Dec/2012 07:16:03 PM »
It will affect the other games, because the RAM's addresses overlap where ROM would be on other games, so make those parts of ROM inaccessible.

Offline HowlingBlue

  • Baby Retrode
  • *
  • Posts: 15
  • Karma: +0/-0
Re: An interesting conundrum.
« Reply #4 on: 11/Jan/2013 03:58:59 AM »
So, the RAM is always mixed in as part of the ROM file, and there is no real way to tell if it is RAM or not without knowing in advance? That is annoying.

I have a couple of questions, out of curiosity.

1. How are the emulator makers getting a consistent checksum? Are they just not including or zeroing out the RAM area of the dumped ROM?

2. Is the location of the RAM area consistent among all cartridges or even certain developers?

3. Can the Retrode manipulate the cartridge RAM?
     3a. Could this damage the ROM, if the cartridge has no RAM?

* Incoming dumb theory from someone who has no concept of how the Retrode's dumping process works *

The first thought I have, although it would make the slow dumping process even slower and would need #3 to be true, is to do a two-pass dump. Get a dump, then try to manipulate possible RAM areas, then dump again. If the ROM turns out to be different, then you know you have RAM and where it is. Zero out the RAM (or whatever need be done to meet the checksum criteria) and there is the true dump.

* End dumb theory *

At worst, one could write a utility to tidy up the RAM areas of A2600 ROMs. Even if each game is different, you would just need profiles for each different game.

Offline Muzer

  • Sgt. Retrode
  • ***
  • Posts: 121
  • Karma: +4/-0
Re: An interesting conundrum.
« Reply #5 on: 12/Jan/2013 01:34:47 AM »
So, the RAM is always mixed in as part of the ROM file, and there is no real way to tell if it is RAM or not without knowing in advance? That is annoying.

Yep!

Quote
I have a couple of questions, out of curiosity.

1. How are the emulator makers getting a consistent checksum? Are they just not including or zeroing out the RAM area of the dumped ROM?

There is only one ROM dump on the internet for most A2600 games, and obviously the RAM that happened to be present at the time when it was dumped will stay like that in the ROM, which is how the checksums are consistent.

Quote
2. Is the location of the RAM area consistent among all cartridges or even certain developers?

There are a relatively small number of possible configurations - if you know (or can guess/work out through trial and error) the configuration you know exactly where the RAM is.

Quote
3. Can the Retrode manipulate the cartridge RAM?
     3a. Could this damage the ROM, if the cartridge has no RAM?

Almost certainly it can, and it won't damage the ROM at all as far as I know.

Quote
* Incoming dumb theory from someone who has no concept of how the Retrode's dumping process works *

The first thought I have, although it would make the slow dumping process even slower and would need #3 to be true, is to do a two-pass dump. Get a dump, then try to manipulate possible RAM areas, then dump again. If the ROM turns out to be different, then you know you have RAM and where it is. Zero out the RAM (or whatever need be done to meet the checksum criteria) and there is the true dump.

* End dumb theory *

That's a good theory, if it weren't for #1. Most of the ROM dumps in the wild are filled with random garbage data in the RAM section that happened to be there when the ROM was dumped, and this random garbage data is included in the checksum. Of course, talking to emulator authors would be a very viable option; they could add additional checksums for games based on zeroed-out RAM, then this suggestion would work fine :)

Quote
At worst, one could write a utility to tidy up the RAM areas of A2600 ROMs. Even if each game is different, you would just need profiles for each different game.

This is also possible, but it does make the Retrode a bit more of a pain to use (plug in cartridge, plug in Retrode, copy rom to HDD, run through utility, run in emulator).