DDR like demo

Announce (tech) demos or games releases

Moderator: Mask of Destiny

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Mon Aug 27, 2012 11:22 am

Chilly, your code is addressing sram @ 0x200001.

I suppose wa can modify this?

Exemple, Phantasy star IV is 3Mo, so i think sram is @0x300001 right?

I would just have to modify rom header, and modify your code, then i can use 3Mo for the game and my save @ 0x300001 or more right?

Moreover, with my 8Mo pcb, i suppose i would be able to add sram if i wire it correctly i will be able to use 7Mo for game and the rest for sram, but is it possible to address sram @ 0x700001 with SGDK? or this won't work at all?

You tell me for rom >2Mo i must disable sram, but even if i do this, i have always some bugs as you could have seen on video... i think it's because my game wants to read some code @0x200001 but this enable the sram on the pcb and read some corrupt data...

EDIT : no, Phantasy star IV is 3Mo but have 2Mo and 1Mo eprom. SO we never really address @ 0x200001 for the game... this is a bankswitch...
Last edited by oofwill on Mon Aug 27, 2012 11:30 am, edited 1 time in total.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Aug 27, 2012 11:29 am

SRAM is always in $200001...$20FFFF range.

Phantasy Star and all other games larger than 2MB use bank switching, which is exactly what the $A130xx write does.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Mon Aug 27, 2012 11:31 am

Thanks, i've just understood that :lol:
EDIT : no, Phantasy star IV is 3Mo but have 2Mo and 1Mo eprom. SO we never really address @ 0x200001 for the game... this is a bankswitch...
So i suppose i can't have 8Mo cart AND sram. Or i have to build cart with 2Mo eprom only and bankswitch every 2Mo... (no 27c322 then)

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Mon Aug 27, 2012 11:47 am

If I don't make a mistake, disabling SRAM gives you back access to your ROM (when using bankswitching) so access to 0x200001 is no longer the RAM but your ROM

correct me if I'm wrong, I'm actually playing with the bankswitching

notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Wed Aug 29, 2012 3:47 pm

TmEE co.(TM) wrote:SRAM is always in $200001...$20FFFF range.
Not really, there are a few licensed ones that are not, I think they were some sports games that do it at $30xxxx, somebody like Eke probably remembers better.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Aug 29, 2012 4:08 pm

notaz wrote:
TmEE co.(TM) wrote:SRAM is always in $200001...$20FFFF range.
Not really, there are a few licensed ones that are not, I think they were some sports games that do it at $30xxxx, somebody like Eke probably remembers better.
The SEGA standard for SRAM is to be at $200001. A handful aren't, but probably 95%+ follow the standard.

All flashcarts I have seen put the sram at $200001. So if you want to be compatible with most cards (replacing the roms with your own) and flash carts, you'll want to use $200001 as the base.

Remember that the Sega Standard Mapper for the MegaDrive is often referred to as the Super Street Fighter mapper as it was the only game to use more than the sram part of the mapper. The way the standard mapper works is you have eight banks of space in the cart space, with each bank being 512KBytes. That's a total of 4MBytes of space, which is all the cart is allowed. There are eight byte-sized registers at odd locations from $A130F1 to $A130FF.

The first 512KB bank is fixed to offset 0 in the rom and cannot be changed. Since the first bank cannot be changed, the first bank register controls the save ram, not the rom bank. In general, bit0 = 1 = sram enabled, = 0 = sram disabled. bit1 can be a write protected control, where = 1 = write protected, = 0 = write-enabled.

All the other bank registers control one of the banks, each bank being 512KB. The bank register value can be from 0 to 63 and sets which bank of the rom appears in the bank. That allows for roms up to 32MBytes to be used.

There's more about the standard mapper in the Sega docs, but that's all that's really needed for programming. Note: the mapper works fine with the 32X as well, but the mapper registers cannot be accessed by the SH2s, so the SH2 has to send a request to the MD side, which changes the registers for it. In fact, there is a small routine in the 32X BIOS for the 68K to set one or more of the mapper registers so that MD side code can merely call the BIOS to set the mappers.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Wed Aug 29, 2012 8:43 pm

The thing I don't understand on the Sega Mapper is the hardware part...
Do you need a special IC on the cart or the Genny handles it for you ?

For the SRAM, I'll open a cheap EA game and check it but it's harder to find a cheap SSF2 to open ;)
Are we talking about this one or this one ?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Aug 29, 2012 8:52 pm

If games is beyond 2MB it needs 74 to hold banking bit and 139 or something to do the address decode.
All emulators I tested years ago only supported SRAM in 20xxxx range, so 64KB of total if both bytes were used. Standard Sega mapper gives 2MB :P
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Aug 29, 2012 10:55 pm

The mapper is like most all other consoles... on the cart pcb, not the console. You don't HAVE to support EVERYTHING- for example, many carts with sram merely use a single flip-flop to store the sram enable based on the assertion of write and the $A130XX signal. So even though you write to $A130F1 to enable the sram, the cart actually handles a write to any address from $A13001 to $A130FF as sram enable/disable. SSF2 only handles bank mapping as it doesn't have sram. So while Sega specified a certain functionality, carts may slack off a bit to reduce the hardware costs for themselves.

Note that EEPROM type carts have the most variation. It's best to use sram than eeprom - you get more storage and you're more compatible with emulators and flash carts. Most MD flash carts don't support EEPROM (only NeoMyth does if I remember correctly).

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Mon Sep 03, 2012 9:02 am

Thanks for those usefull infos! :)

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Thu Sep 06, 2012 5:28 pm

Anybody to test the demo?

I think something is not working correctly, but i'm not able to determine what...

You'll find the rom here

Only sonic stage is playable.
Feel free to give me some advices ;)

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Sep 06, 2012 6:05 pm

Well, without having any code to look at, you're clearly not handling the launching of stages correctly. Whatever you use to select the stage is only correct for Sonic.

By the way, after playing the Sonic stage once, the graphics for the stage select screens are messed up. The Bleach stage select display is the worst of the three.

oofwill
Very interested
Posts: 173
Joined: Mon May 03, 2010 6:12 pm
Location: France - Niort

Post by oofwill » Thu Sep 06, 2012 6:15 pm

after playing the Sonic stage once, the graphics for the stage select screens are messed up.
I don't really understand?
I test it with gens, and the select stage is exactly as the first launch :shock:
you're clearly not handling the launching of stages correctly. Whatever you use to select the stage is only correct for Sonic.
For demo, game is resetting when you select the other stage.
In fact, the stages exists, but they are ugly and i didn't want to show us :lol:
The Bleach stage select display is the worst of the three.
I suppose you are talking of this image?

Image

Eke
Very interested
Posts: 885
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Thu Sep 06, 2012 9:02 pm

It's true most games board have SRAM mapped to 200000-3fffff because it was apparently sega standard for licensed cartridges. Some other companies like EA designed their own boards and some games have SRAM mapped to other areas, sometime just above ROM because it was probably more logical and easier to implement (one of the Might & Magic game for example, has sram mapped to 300000-3fffff, even the ROM header correctly indicates it). Non-standard mapping is however not guaranteed to be supported by all emulators or flashcarts. But if you make your own cart, you can pretty much do anything you want.

About the SRAM access enable (read/write), it's only supported on a specific cartridge board (or mapper if you prefer) that came later and afaik, this one is only found in 3 genesis games (Phantasy Star 4, Beyond Oasis and Sonic 3).
Note that Sonic 3 is smaller than 2MB but apparently was put on this board in preparation to be used with Sonic &Knuckles lock-on feature (the locked game is accessed at 200000-3fffff and ROM smaller than 2M will generally be mirrored here... except those which have sram mapped here, like sonic 3).
I am not sure if any of these games use the write-protection feature, it seemed to me that only enable/disable feature was used but i might be wrong.

The SSF2 mapper is a completely different cartridge board, with no room for SRAM apparently so i doubt it is an expanded version of the previous one. It just appeared they used the same address range and !TIME signal but that does not mean much since most cartridge that need bankshifting will likely use this signal. People usually call it "official mapper" because an upgraded version of the cartridge board with SRAM support was apparently used during 32x developmznt and was described in official docs but i am not even sure a single official game use it.

That's pretty much all i know about sram :wink:

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Sep 06, 2012 10:03 pm

oofwill wrote:
after playing the Sonic stage once, the graphics for the stage select screens are messed up.
I don't really understand?
I test it with gens, and the select stage is exactly as the first launch :shock:
Well, on my CDX, it's farged (technical term :wink: :lol: ). I'll take some photos to post.
For demo, game is resetting when you select the other stage.
In fact, the stages exists, but they are ugly and i didn't want to show us :lol:
Ah - I thought we were able to select them, but you had some kind of problem in the menu.
The Bleach stage select display is the worst of the three.
I suppose you are talking of this image?

Image


Yes, that one. Like I said, I'll take some pics, but it's definitely farged on real hardware.
Eke wrote:I am not sure if any of these games use the write-protection feature, it seemed to me that only enable/disable feature was used but i might be wrong.
I don't think anything but the dev cart used the write protect. Certainly S3&K only use 1 and 0 for the values, so they don't use the write protect. I haven't looked at PS4 or BO.
The SSF2 mapper is a completely different cartridge board, with no room for SRAM apparently so i doubt it is an expanded version of the previous one. It just appeared they used the same address range and !TIME signal but that does not mean much since most cartridge that need bankshifting will likely use this signal. People usually call it "official mapper" because an upgraded version of the cartridge board with SRAM support was apparently used during 32x developmznt and was described in official docs but i am not even sure a single official game use it.
Nope! Just the dev cart. It had both the bank selection and save ram and is MONSTROUS in size. :lol:

The dev carts were in use before the 32X, but the first documentation found (so far) is with the 32X where they cover how to use the regular dev carts with the 32X in both smaller sized chips and larger sized. There are a number of dip switches on the dev cart that they also talk about, but doesn't affect retail carts.

I'm willing to bet that had we seen more 32X games, some would have used bank selection (8+ MByte games like with SNES/N64), and some might have had extra ram on the cart as well. The 32X was cut off before we saw anything more than regular carts. :(

Post Reply