Fixing ROMs for EMS 64 GB Smart Card USB

Discussion of programming and development for the original Game Boy and Game Boy Color.
Nitro
Posts: 6
Joined: Tue Jun 17, 2014 1:16 am
Contact:

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by Nitro »

Yes, but I did not write in those positions. So I think they can use other protection.
Spirou shows "Bad emulation" on the screen at frozen.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by MottZilla »

Besides the $6000-$7FFF writing, another thing that the SmartCard doesn't like is writing to parts within the register's range. For example, it accepts $2000 just fine, but I remember certain games writing to for example $2134. It for some reason would crash. I think Gauntlet might have been one that acts as though it's a UNROM mapper and loads from and writes to a table to avoid bus conflicts. The SmartCard does not like this. So watch how it's writing the normal cartridge registers. If it's not plain standard, maybe that is the issue.
mariotaotao
Posts: 5
Joined: Mon May 11, 2015 1:57 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by mariotaotao »

Hi, Mottzilla, i just register here to follow you, thank you for making the multi SmartCard 64M Menu.
I also found some questions may need you to help, three official games.

1. Pokemon Yellow
i've tried many versions(Jap, US, Chinese trans) work on smartcard, but the save games corrupt, is there a fix to solve the problem?
2. Dai-2-Ji Super Robot Taisen G
A famous SLG game on gb, i think it's sgb1 format, and i'm not sure to choose color or noncolor, this game failed to go into the first chapter battle, then crashed.
3. Snoopy Tennis
This game can go to menu, but can not play a match

I hope you have time to test these games, and able to teach me how to solve the problem, if you need the rom, get it from the attachment(don't know if it is legal here), if i need to do something just let me know, appreciate it.
thanks again for your hard work on smartcard flash card, i really love this. Have a nice day, sir :)


[Nope. NESdev.com is not a commercial ROM site. --MOD]
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by MottZilla »

Have you already traced these games in a debugger with breakpoint set for $6000-$7FFF?
mariotaotao
Posts: 5
Joined: Mon May 11, 2015 1:57 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by mariotaotao »

MottZilla wrote:Have you already traced these games in a debugger with breakpoint set for $6000-$7FFF?
Sorry, i don't know how to debug games, is there a tutorial for that? I'll try it. Thank you
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by MottZilla »

In the Gameboy emulator BGB, right click on the window to bring up the menu. Load your ROM. Then right click to bring up the menu again but this time choose Other > Debugger. In the new window goto Debug > Access Breakpoints.

In the box addr range, put 6000-7FFF. Click Add. Then goto Run and tell it to run the game. If it kicks back to the debugger, it means the game has written to the range 6000-7FFF. This will usually crash the game if running on the SmartCard.

Snoopy Tennis writes to a non-standard address, 3A1A which the SmartCard doesn't like. I tried changing the writes, which then crashes the game. It may be a form of protection.

Update: It does appear Snoopy Tennis writes to the non-standard address which for whatever reason SmartCard and likely other older flash cartridges don't like causing them to crash. You can't simply change these writes however because another part of the code is loading the data from the opcodes and using them. Changing it will cause a crash. It'll require more effort to fix than I have time to put into it. Maybe someone else will. Or maybe there is a crack out there already.

About Pokemon Yellow, I'm not sure why there is a saving problem but I think I've heard of trouble with Pokemon before. Again, I don't have the time to invest in fixing it.

Super Robot Wars writes $6000 on startup but other than that I didn't notice any issues. Patching out the write may get it working.
mariotaotao
Posts: 5
Joined: Mon May 11, 2015 1:57 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by mariotaotao »

MottZilla wrote:In the Gameboy emulator BGB, right click on the window to bring up the menu. Load your ROM. Then right click to bring up the menu again but this time choose Other > Debugger. In the new window goto Debug > Access Breakpoints.

In the box addr range, put 6000-7FFF. Click Add. Then goto Run and tell it to run the game. If it kicks back to the debugger, it means the game has written to the range 6000-7FFF. This will usually crash the game if running on the SmartCard.

Snoopy Tennis writes to a non-standard address, 3A1A which the SmartCard doesn't like. I tried changing the writes, which then crashes the game. It may be a form of protection.

Update: It does appear Snoopy Tennis writes to the non-standard address which for whatever reason SmartCard and likely other older flash cartridges don't like causing them to crash. You can't simply change these writes however because another part of the code is loading the data from the opcodes and using them. Changing it will cause a crash. It'll require more effort to fix than I have time to put into it. Maybe someone else will. Or maybe there is a crack out there already.

About Pokemon Yellow, I'm not sure why there is a saving problem but I think I've heard of trouble with Pokemon before. Again, I don't have the time to invest in fixing it.

Super Robot Wars writes $6000 on startup but other than that I didn't notice any issues. Patching out the write may get it working.
Thank you for the tutorial, I want to try super robot wars, can you teach me how to patch out the write? Maybe making a ips patch for this game. I just go to this step (show on attachment image), really hope I can make some other fix patches for smartcard
2015-05-13_041217.jpg
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by MottZilla »

You need to right click on the line where it writes 6000 and choose to modify it with code. Replace with with 3 NOP operations. That would mean you type in the box exactly what is below:

NOP;NOP;NOP

That should replace the opcode with 3 NOPs and maybe the game will work now. It's easier if you have some experience with assembly programming for this family of CPU.
mariotaotao
Posts: 5
Joined: Mon May 11, 2015 1:57 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by mariotaotao »

MottZilla wrote:You need to right click on the line where it writes 6000 and choose to modify it with code. Replace with with 3 NOP operations. That would mean you type in the box exactly what is below:

NOP;NOP;NOP

That should replace the opcode with 3 NOPs and maybe the game will work now. It's easier if you have some experience with assembly programming for this family of CPU.
I modified the rom by your instruction, saved the rom, but this game still has problem when go to chapter 1, I guess there're some unknown issues cannot show on the bgb debugger, too bad.
Again, thank you for sharing the tutorial with me. :)
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by MottZilla »

The game is in Japanese so I don't know what you mean by Chapter 1. I started a game and attacked a few enemy units without noticing any signs of a problem. I didn't play the full first scenario, but no bad writes were triggered. I don't have time to test it on the SmartCard myself. Sorry.
mariotaotao
Posts: 5
Joined: Mon May 11, 2015 1:57 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by mariotaotao »

MottZilla wrote:The game is in Japanese so I don't know what you mean by Chapter 1. I started a game and attacked a few enemy units without noticing any signs of a problem. I didn't play the full first scenario, but no bad writes were triggered. I don't have time to test it on the SmartCard myself. Sorry.
On smartcard this game crash when loading the first battle, but on bgb is able to play through.
Thank you, MottZilla.
snugglefox
Posts: 1
Joined: Tue Jul 21, 2015 12:02 am

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by snugglefox »

Haven't done much testing on a GameBoy but the Pokémon fix makes it so that the GB Tower on Stadium will get a transfer pak error trying to load it.
Playing on a GameBoy seems to work regardless of the patch.

Without the patch, Stadium 2 sometimes gets saving errors in both GB Tower and the Lab and sometimes gets a transfer pak error.
using a Mega Memory Card in the transfer pak seems to reduce the errors in GB Tower but increase errors in the Lab

My guess is it's a MBC issue, perhaps I could solder on an MBC3 chip

http://www.tototek.com/store/index.php? ... 5ibgl18j62
This is where I got my cart.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by MottZilla »

The Pokemon games are probably reading the SRAM of the cartridge which does not match the real game.

The Stadium games will likely check SRAM banks 0, 1, 2, and 3. On the SmartCard menu I made, these are the "working" banks. Your Pokemon save data is only located here temporarily. It is moved to higher banks the next time the menu is run. If the Pokemon game is the only game on the cartridge then it shouldn't be a big issue. If you have multiple games you need to be sure that the last game you played on a gameboy is the pokemon game before using it with Stadium. This would make sure your save data is in the lower banks.

But does the Stadium game save data back to the cartridge? If it does then for the menu system to work you need to olad your pokemon game on a gameboy so the menu copies the save into the working banks but then do *not* reboot the gameboy. This will leave a flag marked so that the menu the next time it is run will copy from the working banks to the save banks. That means that when Stadium modifys the save data it will get saved the next time you play it on a gameboy.

That's all I can really tell you because I don't know a whole lot about the Pokemon games and virtually nothing about the Stadium games.
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by Sik »

MottZilla wrote:But does the Stadium game save data back to the cartridge?
Yep. It also shows a message while it's accessing the save memory (since the emulation is practically frozen during this time, it looks like accessing the memory is quite slow).
User avatar
juju
Posts: 3
Joined: Tue Aug 25, 2015 7:43 pm

Re: Fixing ROMs for EMS 64 GB Smart Card USB

Post by juju »

So... No fix coming for Revelations: The Demon Slayer? :(
I've tried every combination of ROM and IPS I could find, but nothing happens; the game just goes to an empty screen after I boot it.
Post Reply