Cartridge ROM mapping

Discuss the games, programs, utilities... and vaporware!
Post Reply
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Cartridge ROM mapping

Post by @username@ » Sun Feb 14, 2021 10:58 pm

From looking at the BASIC 12KB ROMs, they appear to use $A000-$BFFF(ROM1) and $7000-$7FFF(ROM2). An anomoly in BASIC82A and B, is that the first 256 bytes of ROM2 are also available at $4000.

In the emulator - this is easily handled with a software AND mask.

However, I wondered if perhaps the original cartridge had another means of mapping the address lines.

Reading the "Circuit 1" PDF, it's eay to follow ROM 0/1/2 through the 74LS139 decoder B. So is it safe to assume that any 4K ROM on the other side of ROM2 enable can be read from $4000/$5000/$6000/$7000? Is there a mapping connection on the physical cartridge to facilitate this?

If you look at Planet Defender 6K against Planet Defender 8K - you will see that the difference is just the lower 2K at $A000 is repeated at $A800. Otherwise these dumps are binary identical - which would indicate the 8K dump is unnecessary - as the main routines read from $A200.

So is this the cartridge itself doing this translation to mirror the same 2K block when read?

Look forward to the hw guys letting me know the answers!
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Cartridge ROM mapping

Post by MADrigal » Thu Feb 25, 2021 8:29 pm

Mate, unfortunately I do not own the BASIC cartridge with the BASIC 82 roms anymore, so I cannot help you with that.
But one thing I can tell you for sure: all dumps were done on actual EPROMs not from the cartridge w/connectors to an EPROM programmer.
So whatever you see in the dumps, is the actual content of the EPROM chips.
Some 6K ROMs saved in a 8K EPROMs have mirrored 2K, but from memory, a few 8K EPROMs had the 2K blanked (full of 00 or FF). Again I think this is quite random and there are probably different dump types around.
And also there is a 16K version of BASIC83 (or was it VTL V1 BASIC, I dont remember) - which I found on cartridge once only, hence extremely rare. I think that also has some mirroring and blank spaces
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: Cartridge ROM mapping

Post by @username@ » Sun Apr 25, 2021 10:31 am

OK - I think we can say that there is no mirroring required for any 4K ROM.

This is backed up by VTech with AirSea and Sonic Invaders. They are just load to $B000 and run on Salora Manager and Laser 2001.

So the "mirroring" at $8000,$9000,$A000 is nonsense and completely unnecessary.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Cartridge ROM mapping

Post by MADrigal » Sun Apr 25, 2021 10:40 am

The games do work in their 4k space but because of the way the cartridge PCB pinouts are designed, the 4k are repeated (mirrored) within their Rom space, filling it. Unnecessary but that's how the real console "sees" the game.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Cartridge ROM mapping

Post by Scouter3d » Sun Apr 25, 2021 6:08 pm

The "mirroring" is mostly a byproduct of using smaller ROMs in a bigger ROMspace, you use one of the higher (or possible the highest) adresslines as Chipselect, the PCB con hold different chips (16K, 8K, 4k or 2k per bank) ... so somtimes 2k EPROMS are enabled as 4k or 8K, as they miss the higher Addresslines of their bigger brothers they repeat / mirror the same content a few times over their bank.

Sometimes when you burn an EPROM and you use a bigger EPROM than you need (e.g. 8K instead of 4k) it is common to burn the content 2 times into the rom, so you can either set the highest Addressline to 0 or 1 and both will deliver the same data...
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: Cartridge ROM mapping

Post by @username@ » Sun Apr 25, 2021 6:57 pm

Yes - the address lines make sense, if you consider a 4K rom only needs 12 bits, so anything above that will give the same data from $8000,$9000,$A000 or $B000.

My question is why bother when the actual code does not look outside of itself?

What is the value add?

Why not just do an AND mask?

One interesting thing of this review, is that my understanding of the 6K-8K roms was a little off. Tank Attack should load at $A800 for 2K, then $B000 for 4k.

I had always assumed ALL 6K roms needed to be loaded to $A000, then mirrored - which is not the case. Tennis, Deep Sea and Planet Defender need to be loaded to $A000 2k then $B000 for 4k.

Interestingly, a single bit change in both Deep Sea and Planet Defender render the 2K at $A800 useless too.
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Re: Cartridge ROM mapping

Post by kevgal » Fri Mar 24, 2023 6:21 am

Gday guys, I'm trying to add roms to my multi cart by making them all 32k in size.
This works for 4k, 8k and 16k games but not for the others . I managed to convert the 6k games to 8k by doubling the last 2 k and adding this at the start instead of the end (which seems odd). Why does this work?
Any idea how to convert 12k and 18k games? simply padding out the ends to make them 16k or 32k doesn't work. I assume I need to do some swapping around as for the 6k games but so far all the combinations I use fail in the emulator.
Cheers
Kev
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Cartridge ROM mapping

Post by MADrigal » Fri Mar 24, 2023 7:07 am

Depending on the model of multicart and its logic, you may need to swap the low 16k with the high 16k.
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Re: Cartridge ROM mapping

Post by kevgal » Fri Mar 24, 2023 8:10 am

Tried that with various versions of 12k games but to no avail (with the emulator anyway). Tried with the last 4k repeated, padded out at the front or back with zeros. Not sure what other combinations to try.
Not a very complex multi cart, just a big eprom with thumb wheel switches on addresses 14,15,16,17,18 and 19 and ROM2 line on address 13 and ROM 1 or Rom 2 on the enable line. So should just look like a 32k eprom with 2 banks of 16k.
User avatar
MADrigal
Site Admin
Posts: 1189
Joined: Sun Sep 15, 2013 1:00 pm
Contact:

Re: Cartridge ROM mapping

Post by MADrigal » Fri Mar 24, 2023 8:44 am

12k is made of
4k 4k 4k 4k to fill one 16k bank, and 8k 8k on the 2nd. Then try to swap the two banks.
Post Reply