It is currently Tue Oct 17, 2017 11:55 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Fri Nov 09, 2012 12:22 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2799
From what the menu writes to the upper nibble I assume it might be RAM Bank limiting. It may indeed be fully functional. That *could* be useful if you were to store data in banks beyond what you set the limit to to prevent anything from writing those banks. But I see no reason to do that. It would be more useful if the upper nibble was like the ROM page select of the lower nibble and could isolate a section for you.

Since you've looked at the patch you've probably seen it's pretty simple. Remove the possible SRAM limiting as we need to control the whole chip. Then it just selects the desired bank before transferring execution to the game. Most games don't initialize the register since there is no need but some games do and ofcourse games with 32 kilobytes of RAM will be constantly writing it. But they shouldn't disturb the upper banks.

If I were to list improvements to be made to the SmartCard they would be:
    $7000 Register Write Protection
    SRAM Bank Limiting
    MBC1/2/3 ROM Bank Register Mode ($2000-$3FFF rather than $2000-$2FFF with $3000-$3FFF for 9th bit)

With all of those it would pretty much eliminate the need for patches.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 6:55 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19086
Location: NE Indiana, USA (NTSC)
Perhaps the intended use was that the menu would copy (or decompress) the save data from storage banks ($04-$0F) to the working banks ($00-$03), unmount storage by enabling bank limiting, run the game, disable bank limiting, and then copy (or compress) it back.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 7:35 am 
Offline

Joined: Mon Oct 22, 2012 6:38 am
Posts: 20
tepples wrote:
Perhaps the intended use was that the menu would copy (or decompress) the save data from storage banks ($04-$0F) to the working banks ($00-$03), unmount storage by enabling bank limiting, run the game, disable bank limiting, and then copy (or compress) it back.


that is what the EMSMenu (the program i mentioned in the first post) does (except compressing). it might not be possible in the new EMS 64 MB usb cart though. Detailed info on master registers of EMS cart is needed and so far i haven't found it on net.

that is why what MottZilla accomplished is a great thing and could be accomplished by reverse engineering(or debugging).

it would be great if EMS would publish the use of master registers. Their flashing program is buggy and under-featured and this hurts the potential of their flash cart.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 12:43 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2799
I'm not sure how much we need exact details on the Master Bank register. I suppose if you wanted to totally rewrite a new menu that would help. With some experimenting or careful reading of the code you could probably figure out what the lower nibble of the value means exactly. I might investigate it at some point.

I'm not too interested in save game compression because what happens if you have a number of save games compressed and then some change in the data causes the save to get bigger and now you don't have room anymore?

Though you did make me think with some SRAM management in a new menu you could support multiple 32Kbyte saves by using the Menu to manually copy data between slots. The current patch works pretty well, but actually the need for "save fixes" could also be avoided if the save banks were always copied to banks 0-3 before starting the game. So that is a good idea, but you potentially lose some save slots. I'd say you'd have 88Kbytes or 11 Banks to save data. That's 2 less games than the current setup which isn't so bad I guess. You could then manage to fit 5 games that save at once with two of those being 32kbytes in size.

Another thought is if you add SRAM management to a new menu, the bank reserved for the Menu could hold also custom save game titles. Then when you change games on your cartridge you could use the read SRAM option and then use a tool to see the contents of your SRAM to extract the saves you want. Although if you make it so after choosing a game you choose SRAM slots that could work too without you having to worry about using a PC tool to manage SRAM. So there is potential for a new menu to improve.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 1:50 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19086
Location: NE Indiana, USA (NTSC)
MottZilla wrote:
I'm not too interested in save game compression because what happens if you have a number of save games compressed and then some change in the data causes the save to get bigger and now you don't have room anymore?

Don't allow starting a game if compressed_size + free_space < uncompressed_size.

Another thing you could do to increase capacity is identify what ranges a particular game actually uses for saving (as opposed to scratch space) and zero out the rest before compression.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 2:04 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2799
While that works in theory, we can't know or assume what space a game uses. The menu is just expected to work by all users. We can't ask them to know technical details of how their game works.

About the first point, so if we can't compress the save to fit into free space your idea is to not allow starting any other game until you free enough space or play the game again and get SRAM manipulated into a more compression friendly state? While again that makes sense as an idea, I think the end user would not appreciate this. Usually most users just want it to work reliability and easily.


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 2:14 pm 
Offline

Joined: Mon Oct 22, 2012 6:38 am
Posts: 20
128 kilobytes = 16 x 8kb that means 16 slots

reserve the first 4 slot for the current game
reserve the last slot for save game info (save the header of the game and which slots that game use)

11 slots is still plenty, it gives you 2 32 kb save games and 3 8 kb save games or 11 8 kb save games.

that is (with an automated system) what EMSMenu 1.2 does and i think it is very efficient

i do not think there is need for compression which might cause several issues in the long run


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 2:50 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19086
Location: NE Indiana, USA (NTSC)
MottZilla wrote:
While that works in theory, we can't know or assume what space a game uses. The menu is just expected to work by all users. We can't ask them to know technical details of how their game works.

I was thinking of including a database of zeroable regions for those games that 1. are popular among end users (e.g. Pokemon) and 2. are fairly well understood by ROM hackers (e.g. Pokemon), especially if they 3. normally allow only one save per cartridge (e.g. Pokemon).

Quote:
so if we can't compress the save to fit into free space your idea is to not allow starting any other game until you free enough space or play the game again and get SRAM manipulated into a more compression friendly state? While again that makes sense as an idea, I think the end user would not appreciate this. Usually most users just want it to work reliability and easily.

One way to is to put a percentage of used space on the game select screen (e.g. 53% full). When the space runs out:
Code:
This card's save
memory is 100% full.
Which save data do
you want to delete?


Top
 Profile  
 
PostPosted: Fri Nov 09, 2012 7:29 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2799
Well with enough time and rom space for the menu you could probably add such features to maximize the amount of saves you could store. I'm not really that comfortable with the Gameboy to anything that extravagant right now.


Top
 Profile  
 
PostPosted: Mon Nov 12, 2012 12:23 pm 
Offline

Joined: Tue Nov 23, 2004 9:35 pm
Posts: 615
List of US Gameboy (not including Color) Game Paks with Battery Backed RAM :

Bomberman GB
Donkey Kong
Donkey Kong Land
Donkey Kong Land 2
Donkey Kong Land III$
F-1 Race*
Fastest Lap*
Final Fantasy Adventure* (Mystic Quest in Europe)
The Final Fantasy Legend*
Final Fantasy Legend II
Final Fantasy Legend III
Go! Go! Tank
Golf*
Great Greed
Harvest Moon GB
InfoGenius Systems Personal Organizer
International Superstar Soccer
James Bond 007
Ken Griffey Jr. Presents Major League Baseball
Kid Icarus - Of Myths and Monsters*
Kirby's Block Ball
Kirby's Dream Land 2
Kirby's Pinball Land*
Kirby's Star Stacker
Lazlos' Leap*
Legend of the River King GB
The Legend of Zelda - Link's Awakening
Mario's Picross
Metroid II - Return of Samus
Mole Mania
Ninja Taro*
Nobunaga's Ambition
Pokemon Blue#$
Pokemon Red#$
Rolan's Curse II*
The Sword of Hope II
Super Mario Land 2 - 6 Golden Coins$
Tamagotchi
Tetris Plus
Top Rank Tennis*
Torpedo Range*
Ultima - Runes of Virtue*
Ultima - Runes of Virtue II*
Ultra Golf* (Konami Golf in Europe)
Vegas Stakes
Wario Land - Super Mario Land 3
Wario Land II#
Wave Race*

* - MCB2, 512bytes S-RAM
# - MCB3, 32Kbytes S-RAM
$ - Fix Required

European Exclusives :
Lucle
World Cup USA '94
Oodles of MCB5 Paks, intended for the Gameboy Color use battery backed S-RAM.

A question about the menu patch : will a 32K S-RAM game work with other, smaller games in a ROM page? As I understand it, the first partition reserves 32K of the 128K of S-RAM in the Multicart. But the menu program arranges ROMs by size, so the 32K S-RAM game will not likely be in the first game slot. But in the 2nd through 13th slot, it is apparently allocated only 8K of SRAM. Will the game take the next three 8K partitions?

_________________
Nerdly Pleasures - My Vintage Video Game & Computing Blog


Last edited by Great Hierophant on Mon Nov 12, 2012 11:36 pm, edited 5 times in total.

Top
 Profile  
 
PostPosted: Mon Nov 12, 2012 1:41 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2799
Basically any 32K game is going to set the RAM Bank register itself. So it doesn't matter which slot it goes in at all. Games that only have 1 bank and don't write the ram bank register will use whatever the menu set for it, which is based on which slot it is in.

Thanks for the list. Is that a complete list by chance? Also I'm looking to write a new menu to manage SRAM in a different way.

Again the first 32K of the SRAM will be reserved for the game running. The last 8K will be reserved for the Menu program, leaving 88K for save storage. The idea would be to manage saves independently of the slots they are stored by using the title string as an identifier. Basically when saving the menu would try to match the name of the game being saved to one of the existing records. If no record is found then it would try to find space to make a new record. If it can't it'll inform you that the data couldn't be saved and that you need to free more room. There would be a menu for managing your records. And ofcourse when loading a game that has battery backup it would automatically search your list of records for a title string match and if found it would load your data. The reserved bank would also hold variables to know if the last game launched needs to be saved the next time the menu runs, to avoid requiring the user to manually backup data before playing another game.

I think it'll work out, even though you will lose some save slots compared to the current menu you will have more control over your save data and if you choose to change the games on your cartridge you won't lose your saves. A simple PC tool could be made to manage the 128KB extracted saves on your computer if for some reason you needed to backup individual saves. This would be easier with the new idea than the current menu since the program would have an idea of what data is in what bank.

By the way what do you mean Fix required? Fix to run on the SmartCard right? Link's Awakening requires a fix or else it will crash if you press A+B+Select+Start and use the Save & Quit option.


Top
 Profile  
 
PostPosted: Mon Nov 12, 2012 11:09 pm 
Offline

Joined: Tue Nov 23, 2004 9:35 pm
Posts: 615
Yeah, Fix means it requires an IPS patch to work with the Flash Cart.

The list above should be all of games with a battery backed S-RAM that were released in the USA. It does not include Gameboy Color games (including Pokemon Yellow), Japanese exclusives, Unlicensed titles (if any) or peripherals like the Gameboy Camera.

_________________
Nerdly Pleasures - My Vintage Video Game & Computing Blog


Top
 Profile  
 
PostPosted: Tue Nov 13, 2012 12:13 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2799
This list will be helpful for testing. I've got a new menu written that should work for loading games, when I get the chance I'll work on the SRAM features.


Top
 Profile  
 
PostPosted: Tue Nov 13, 2012 2:26 pm 
Offline

Joined: Fri May 04, 2012 9:47 am
Posts: 12
Does your new menu have GB mode and GBC mode versions? The standard menu for the cart runs games in GBC mode even if you are using it for GB games. In order to get it to run games in GB mode (and thus have the same palette-selection features as a GB game) I had to upload games with a menu, download the games+menu as if it was a single game, hex edit it to get the GB mode flag correct, and upload it again.


Top
 Profile  
 
PostPosted: Tue Nov 13, 2012 3:09 pm 
Offline

Joined: Mon Oct 22, 2012 6:38 am
Posts: 20
arromdee wrote:
Does your new menu have GB mode and GBC mode versions? The standard menu for the cart runs games in GBC mode even if you are using it for GB games. In order to get it to run games in GB mode (and thus have the same palette-selection features as a GB game) I had to upload games with a menu, download the games+menu as if it was a single game, hex edit it to get the GB mode flag correct, and upload it again.


yes download the the new multi-sram menu program at MottZilla's home page which already solved this issue (and i am currently using it) or wait for some time as MottZilla is now writing a new program which has much better SRAM management capabilities and will surely include this fix too.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group