gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Multiboot/link cable and RAM question

#19388 - FiveEight - Sun Apr 18, 2004 11:09 pm

Sorry if this has been answered somewhere before, I did a search, but didn't find anything.

I was wondering if it's possible to get around the 256KB multiboot game limit in the following way:

Start both GBAs, use multiboot to get the game into the cart-less GBA.

Play through the first level(s), up to about 256KB worth of game.

Dump the player 2 stats from the cartless GBA back across the cable into the RAM of the GBA with the cart (very little data, number of lives, score etc)

Load the second set of levels over the cable to the cartless GBA and copy the player 2 stats back.

Play the second set of levels.

Alternatively, is it possible to move level data over the link cable during short pauses between levels without wiping the whole RAM on the second GBA?

Just wondering because the only single-cart multiplayer I've played is Bubble Bobble, which seems to limit you to the first ten levels, which I assume is because of RAM limitations.

#19390 - Miked0801 - Mon Apr 19, 2004 12:47 am

Once a game starts, you no longer get multi-boot communications - you have to do all he communications yourself with serial code. What you are suggesting is possible, but would be done with serial code and would be fairly complex to pull off.

#19391 - Spockmeat - Mon Apr 19, 2004 1:53 am

I don't see why it'd bee too bad. Once you know how to send the data, all you have to do is overwrite the previous level description with the new one. If you fix the level sizes to be exactly the same size then it's a simple array swap.

On a similar note: the 256k of ram is the main ram right? Can't some of the other ram be filled up, like the IWRAM? That's another 32k...

#19394 - Miked0801 - Mon Apr 19, 2004 2:39 am

I'd assumed that IWRAM was reserved or stack, game-state, and code that must execute quickly that doesn't need to be swapped. But yes, once you master serial communications (much easier said than done), this overall task becomes doable.

#19403 - tepples - Mon Apr 19, 2004 4:29 am

My suggestion, which is similar to what at least one commercial GBA single-Pak multiplayer game seems to do:
  1. Master serial communications using two flash carts.
  2. Send a bootloader of about 8 KB from the master to each slave over multiboot. The bootloader should copy itself to IWRAM, decompress a loading screen to VRAM, receive the kernel, and jump to it.
  3. Using the 32-bit "normal" mode, broadcast a game kernel from the master to each slave.
  4. As the players enter different maps, broadcast the map data from the master to the slaves, using normal mode.
  5. Switch to multiplayer mode while actually playing the map.
  6. Make sure to allow for a slight speed difference among the various slaves; generate timestamps at the master and keep track of the difference in scanlines between the master's vblank and each slave's vblank.
  7. Rinse and repeat.

For broadcasting game kernels and maps to the various players, the normal mode is quite a bit faster than the multiplayer mode because players 2, 3, and 4 don't have to interject until player 1 has finished a packet.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#19428 - dagamer34 - Mon Apr 19, 2004 10:05 pm

For the most part, all multiboot games I've seen do it the way you're talking about, tepples.
_________________
Little kids and Playstation 2's don't mix. :(