Register - Login
Views: 99792489
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 04:49:01 AM
Jul - General Game/ROM Hacking - GBA cartridge bus question... New poll - New thread - New reply
Pages: 1 2Next newer thread | Next older thread
stag019

Red Koopa
Level: 26


Posts: 102/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 12-10-13 09:57:01 PM Link | Quote
Originally posted by GuyPerfect
I put together a few more test programs; one of which allowed me to page through the entire 64k region of GBA's SRAM to see exactly what was in there. For Pokémon, addresses 0x0E000000-0x0E003FFF were ROM bank 0 as expected. 0x0E004000-0x0E007FFF, for whatever reason, were also ROM bank 0. 0x0E008000-0x0E00FFFF were all read back as 0xFF, meaning there wasn't any actual data being accessed in that range. Writing 0x0A to 0x0E000000 or anything to 0x0E002000 didn't have any effect.
I'm curious if it's the bus speed or the voltage that's causing you not to be able to switch ROM banks. Did you try slowing down the bus speed by unsetting bit 11 and setting bit 12 of the GBA register at 0x4000204?

Originally posted by GuyPerfect
Which puts me back at being an electronics noob and unable to take the experiment any further. Someone else is free to step up to the plate and I'll help out as best I can!

Trust me, I'm much worse and much less knowledgeable. Plus I'm sure if I tried to use a soldering iron, my hands would be too shaky and I'd fail miserably.
GuyPerfect
Catgirl
Level: 68


Posts: 882/1096
EXP: 2665649
For next: 63151

Since: 07-23-07


Since last post: 1.7 years
Last activity: 219 days

Posted on 12-13-13 01:56:39 AM Link | Quote
For lack of a better place to ask...

How do games with > 64 KB of SRAM access their additional memory? I know Pokémon and F-Zero Climax among other games use 128 KB of SRAM, and I don't know how to access it through software.
nitro2k01
Random nobody
Level: 6


Posts: 4/6
EXP: 813
For next: 94

Since: 12-10-13


Since last post: 8.4 years
Last activity: 8.2 years

Posted on 12-13-13 10:00:41 AM (last edited by nitro2k01 at 12-13-13 11:11:31 AM) Link | Quote
Originally posted by GuyPerfect
For lack of a better place to ask...

How do games with > 64 KB of SRAM access their additional memory? I know Pokémon and F-Zero Climax among other games use 128 KB of SRAM, and I don't know how to access it through software.


GBATek to the rescue:

http://nocash.emubase.de/gbatek.htm#gbacartbackupflashrom


Bank Switching (devices bigger than 64K only)


  [E005555h]=AAh, [E002AAAh]=55h, [E005555h]=B0h  (select bank command)

[E000000h]=bnk (write bank number 0..1)


Specifies 64K bank number for read/write/erase operations.
Required because gamepak flash/sram addressbus is limited to 16bit width.

Originally posted by GuyPerfect
I put together a few more test programs; one of which allowed me to page through the entire 64k region of GBA's SRAM to see exactly what was in there. For Pokémon, addresses 0x0E000000-0x0E003FFF were ROM bank 0 as expected. 0x0E004000-0x0E007FFF, for whatever reason, were also ROM bank 0. 0x0E008000-0x0E00FFFF were all read back as 0xFF, meaning there wasn't any actual data being accessed in that range. Writing 0x0A to 0x0E000000 or anything to 0x0E002000 didn't have any effect.
This should never happen under normal circumstances. You could write $00 to $2000 to select bank 0 in $4000-$7FFF, except that MBC3 (the memory bank controller used in Pokémon RBY carts) has a bug/feature where it selects bank 1 when you write 0. In other words, something in this setup makes the MBC fail to drive the upper address lines of the ROM chip to "high". This likely has to do with the lower voltage and/or higher frequency (assuming the waitstates setting isn't set to 4 MiHz) used by the GBA.
GuyPerfect
Catgirl
Level: 68


Posts: 889/1096
EXP: 2665649
For next: 63151

Since: 07-23-07


Since last post: 1.7 years
Last activity: 219 days

Posted on 12-24-13 01:14:38 AM Link | Quote
Originally posted by stag019
Did you try slowing down the bus speed by unsetting bit 11 and setting bit 12 of the GBA register at 0x4000204?

I did, and no dice. Since ROM bank 0 is being read correctly, I don't think the bus speed is the issue. Since it's being read in the 0x4000-0x7FFF range, I think the MBC isn't being initialized properly. I'm more inclined to think that the voltage is the issue.
stag019

Red Koopa
Level: 26


Posts: 103/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 01-23-14 11:26:00 PM Link | Quote
It's been a while now already, but a while ago I wrote a DS program that did the same thing, dumping that memory to a save file on the microsd card. I was getting the exact same results as you. But now I'm curious as to whether the data lines need the correct voltage, or just the power being supplied to the MBC. I tried to test this, but I don't have very stable hands. If you want to try it, what I wanted to do was simply attach a 5v wire and a ground wire on the inside of the cartridge at pins 1 and 32 respectively, and using electrical tape to ensure that the pins weren't touched by the contacts on the inside of the cartridge slot or the inside of the cartridge slot touching the write (but also not overlapping any other pins).

If you're able to try it, let me know if reading any other bank ends up as being possible or not.
Joe
Common spammer
🍬
Level: 111


Posts: 3079/3392
EXP: 14501035
For next: 367325

Since: 08-02-07

From: Pororoca

Since last post: 12 days
Last activity: 6 hours

Posted on 01-24-14 04:40:35 AM Link | Quote
Powering the cartridge with 5v on a DS runs the potential risk of damaging the DS if it's not 5v-tolerant.

____________________
ふにゃあ。
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 5172/5390
EXP: 29075303
For next: 259702

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 06-25-14 07:45:08 PM Link | Quote
Post #5172 · Wed 140625 154508
One thing I've thought about to achieve this is the IR link. HG/SS have an IR port built into the cartridges, and G/S have that mystery gift thing using IR on GBC. I wonder if you could exploit it (overflow a buffer?) to take over the GBC game and use the IR link to access save data. Even if not, that would be a convenient way to communicate between the two.

____________________
GuyPerfect
Catgirl
Level: 68


Posts: 977/1096
EXP: 2665649
For next: 63151

Since: 07-23-07


Since last post: 1.7 years
Last activity: 219 days

Posted on 06-25-14 10:33:32 PM Link | Quote
Originally posted by Rena
HG/SS have an IR port built into the cartridges, and G/S have that mystery gift thing using IR on GBC.

I had no idea. Now the IR feature in C-Gear makes all sorts of sense. I guess that's why the plastic is ever-so-slightly transparent.

Depending on the protocols et al, it might just be possible to communicate with a Game Boy Color and a Nintendo DS. I'd need some ample information on controlling that hardware, though, and if it's feasible, I'd need a way to run homebrew on both systems. |-:
stag019

Red Koopa
Level: 26


Posts: 112/129
EXP: 91339
For next: 10936

Since: 09-11-11


Since last post: 5.6 years
Last activity: 2.1 years

Posted on 06-26-14 05:09:01 PM Link | Quote
Originally posted by GuyPerfect
Depending on the protocols et al, it might just be possible to communicate with a Game Boy Color and a Nintendo DS. I'd need some ample information on controlling that hardware, though, and if it's feasible, I'd need a way to run homebrew on both systems. |-:

I know it might be annoying to not have this yourself, but if you have anything to test, I have a DS flashcart, and 2 Gameboy flashcarts. I could test anything you'd be willing to write.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 5174/5390
EXP: 29075303
For next: 259702

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 07-05-14 06:45:55 AM Link | Quote
Post #5174 · Sat 140705 024555
Well, you can always take over the GBC game the hard way.

I forgot Black/White (and their sequels) also have the IR port, so that's a few different games you can use. I don't think anyone's examined how to operate the port, though.

____________________
IIMarckus
Member
Level: 25


Posts: 101/111
EXP: 82290
For next: 7330

Since: 10-11-08


Since last post: 3.0 years
Last activity: 1.8 years

Posted on 07-20-14 12:16:51 AM Link | Quote

Coming into this thread way late, just to say that this reminds me of an old thread on PocketHeaven where people tried to run GBC games on the Game Boy Micro. I don’t think it was successful but it might have some useful info.

(Fun fact: the GBA was originally supposed to have software support for GBC carts, but they couldn’t get it to work, so they went with a hardware switch instead. See this post. I remember reading the relevant interview with the GBA developers several years ago but don’t have a link handy.)

____________________

GuyPerfect
Catgirl
Level: 68


Posts: 1069/1096
EXP: 2665649
For next: 63151

Since: 07-23-07


Since last post: 1.7 years
Last activity: 219 days

Posted on 04-04-15 04:46:58 PM Link | Quote
So I'm trying to research how to program with GBA multiboot, but information on that topic seems limited, and most resources are about cables that you use to upload programs from your computer to a GBA unit.

What I want to do is write a GBA program that allows a linked slave to boot up without a game (or press Start+Select if a cartridge is present) and download a multiboot program that way. F-Zero Maximum Velocity has a multiplayer mode that functions this way: 4 players can use just one cartridge.

I found information about the cartridge header, and how there are multiboot fields in there, but beyond that, I don't know how to program with it. Does the slave GBA put itself into some listening state for link cable communications and the master GBA unit uploads the appropriate program data through the usual link cable registers? Is the process somehow automated? I'm not sure where to find the answers, so I'm coming here!
Pages: 1 2Next newer thread | Next older thread
Jul - General Game/ROM Hacking - GBA cartridge bus question... New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

32 database queries, 5 query cache hits.
Query execution time: 0.343603 seconds
Script execution time: 0.023024 seconds
Total render time: 0.366627 seconds