DDR like demo
Moderator: Mask of Destiny
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...
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.
-
- Very interested
- Posts: 2442
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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.
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
Thanks, i've just understood that
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)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...
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
The SEGA standard for SRAM is to be at $200001. A handful aren't, but probably 95%+ follow the standard.notaz wrote: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.TmEE co.(TM) wrote:SRAM is always in $200001...$20FFFF range.
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.
-
- Very interested
- Posts: 2442
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
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
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
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
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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).
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).
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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.
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.
I don't really understand?after playing the Sonic stage once, the graphics for the stage select screens are messed up.
I test it with gens, and the select stage is exactly as the first launch
For demo, game is resetting when you select the other stage.you're clearly not handling the launching of stages correctly. Whatever you use to select the stage is only correct for Sonic.
In fact, the stages exists, but they are ugly and i didn't want to show us
I suppose you are talking of this image?The Bleach stage select display is the worst of the three.
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
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
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Well, on my CDX, it's farged (technical term ). I'll take some photos to post.oofwill wrote:I don't really understand?after playing the Sonic stage once, the graphics for the stage select screens are messed up.
I test it with gens, and the select stage is exactly as the first launch
Ah - I thought we were able to select them, but you had some kind of problem in the menu.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
I suppose you are talking of this image?The Bleach stage select display is the worst of the three.
Yes, that one. Like I said, I'll take some pics, but it's definitely farged on real hardware.
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.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.
Nope! Just the dev cart. It had both the bank selection and save ram and is MONSTROUS in size.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.
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.