#22263 - ProblemBaby - Wed Jun 16, 2004 12:31 pm
Hi iam doing a game that is bigger then 256K
but I want multiplayer support for some levels
how should I do? how do they do in MarioCart for example?
plz give me a link or tell me if it is easy
thanks in advance
#22264 - keldon - Wed Jun 16, 2004 12:42 pm
instead of loading game code, load code that will load more code into the gba. A fine example of this is the free no$gba; www.work.de/nocash
#22282 - dagamer34 - Wed Jun 16, 2004 9:49 pm
Just like keldon said. You'll probably end up making a file format so that the data transfer becomes easier. I don't know of any examples though.
_________________
Little kids and Playstation 2's don't mix. :(
#22303 - ProblemBaby - Thu Jun 17, 2004 9:36 am
Load code that will load more code??
I dont understand:D
and at the link it stands
NO$GBA - GBA Debugger
Professional Tool, no Freeware!
didnt you mean that one?
what is it I really should do? compile in a different way
or can I just set some compilator directives?
#22317 - ScottLininger - Thu Jun 17, 2004 5:29 pm
Do you mean you want a >256K multiplayer game with 2-carts or a >256K multiplayer game with a single cart (downloaded to clients via link cable)?
-Scott
#22340 - dagamer34 - Sat Jun 19, 2004 12:28 am
ProblemBaby wrote: |
Hi iam doing a game that is bigger then 256K
but I want multiplayer support for some levels
how should I do? how do they do in MarioCart for example?
plz give me a link or tell me if it is easy
thanks in advance |
There are really limited resources on multiplayer. I haven't seen a single example of code that loads more code or data(publically, maybe people keep it to themselves!).
Perhaps you should do some searches on the forum and you will find out why I bolded part of what you said... :)
_________________
Little kids and Playstation 2's don't mix. :(
#22371 - ProblemBaby - Sat Jun 19, 2004 5:09 pm
I want it to be single cart multiplayer
but the second player dont need all data from the cart
it depends on which level player 1 choosed and such stuff..
I need it to be bigger then 256kB about 400kB
most of this is samples
But i dont understand if the 256kb barrier is for code, graphics, sound
or everything
even if I put it directly in the background mem / sound mem
#22396 - tepples - Sun Jun 20, 2004 5:04 am
In general, the GBA system acting as server in a single-pak can circumvent the 256 KB limit (but not by much). Try sending two separate binary images in turn to the other systems: one for background tiles (up to 48 KiB) and sprite cels (up to 32 KiB), and one for code, audio samples, etc (up to 256 KiB).
If you're willing to take some CPU time on each machine to decompress graphics and sound, then yes, you can stream compressed audio (such as 8ad or GSM) or compressed sprite cels from the server to the other GBAs using a Normal Mode broadcast.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#22403 - dagamer34 - Sun Jun 20, 2004 3:27 pm
tepples wrote: |
In general, the GBA system acting as server in a single-pak can circumvent the 256 KB limit (but not by much). Try sending two separate binary images in turn to the other systems: one for background tiles (up to 48 KiB) and sprite cels (up to 32 KiB), and one for code, audio samples, etc (up to 256 KiB).
If you're willing to take some CPU time on each machine to decompress graphics and sound, then yes, you can stream compressed audio (such as 8ad or GSM) or compressed sprite cels from the server to the other GBAs using a Normal Mode broadcast. |
I'm guessing he won't really be streaming audio or sprites in real-time, but instead sending a tileset and map when the master GBA chooses a level to play. Something like that right?
_________________
Little kids and Playstation 2's don't mix. :(
#22405 - tepples - Sun Jun 20, 2004 3:40 pm
Correct. Send one program to load VRAM and another program to load everything else. You'll just have to make sure your crt0's init code doesn't clear out VRAM in its call to RegisterRamReset(). I just mentioned streaming because some people are greedy and want more, more, more, and I'm sick and tired of single-pak being so darn crippled in commercial games.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#22408 - ProblemBaby - Sun Jun 20, 2004 4:29 pm
Ok but how does all this things work in theory
ive no idea what register I should use or how it works
do anyone know a tutorial that describes it?
#22409 - ProblemBaby - Sun Jun 20, 2004 4:58 pm
And i have no idea how compression works!
ive just headers for the graphics
in use krawall for music
Ive heard of stuff like LZ227 or what it is called
How does that work. I really want to know that to
A little more CPU time for decompress is no problem
#22413 - Miked0801 - Sun Jun 20, 2004 5:51 pm
I can explain how LZSS (or LZ77) works if you want, but I think you are looking for how to use the BIOS functions right?
#22414 - dagamer34 - Sun Jun 20, 2004 6:31 pm
ProblemBaby wrote: |
Ok but how does all this things work in theory
ive no idea what register I should use or how it works
do anyone know a tutorial that describes it? |
Go to www.suddenpresence.com and download the SGADE libraries. It has the best multiplayer code for public use out there with an example. However, the example is designed for multi-pak use. I've have to dig around and see if I can still find my single-pak example or whip up another one if needed.
Have fun and good luck! You'll need it :)
_________________
Little kids and Playstation 2's don't mix. :(
#22422 - ProblemBaby - Sun Jun 20, 2004 9:57 pm
Miked0801:
It would be great if you can tell me how it works!
what kind of BIOS functions?
I even dont know if I already use compression=)
dagamer34:
I will check out the site tomorrow!
But probably I will need your help! for the single pak game play
Ive never programmed network before
so ive much to learn!
#22426 - keldon - Sun Jun 20, 2004 11:38 pm
keldon wrote: |
instead of loading game code, load code that will load more code into the gba. A fine example of this is the free no$gba; www.work.de/nocash |
Sorry, he's apparently removed it after people created a working crack for it to play full games. ( http://work.typo3.work.de/nocash/gbanew.htm )
#22591 - ProblemBaby - Thu Jun 24, 2004 7:37 pm
I cant find any tutorial on this topic (single pak, multiplayer), do it exist???
plz if anyone know any give me a link!
Ive found one source example but I didnt get that much cuz it's just an example and iam doing a whole game so I need to know how the thing works and what ive to do to make it work in my game.
#22689 - ProblemBaby - Sun Jun 27, 2004 12:29 am
Damn I really need help! I know it maybe is hard questions to answer here but a hint or anything would be great!
Ive seen some source to a program with Single Pak Multiplayer
But the Code is compiled as MultiBoot.
But my project is bigger then 256kB
So.. is it possible to copy from the masters ROM to the Slaves EWRAM?
If ive for an example an array with a palette called MyPalette does it work
if I do a something like COPYPAL(MyPalette)
if it is in ROM in the master and EWRAM in the Slave??
Ive Succeeded to Find the Slave GBA but not to Show the LOGO.
Maybe it is because my program isnt compiled as MultiBoot?
As I said before any comment, link, source or whatever am I interested in!
Thanks in advance!
#22691 - dagamer34 - Sun Jun 27, 2004 2:36 am
ProblemBaby wrote: |
Damn I really need help! I know it maybe is hard questions to answer here but a hint or anything would be great!
Ive seen some source to a program with Single Pak Multiplayer
But the Code is compiled as MultiBoot.
But my project is bigger then 256kB
So.. is it possible to copy from the masters ROM to the Slaves EWRAM?
If ive for an example an array with a palette called MyPalette does it work
if I do a something like COPYPAL(MyPalette)
if it is in ROM in the master and EWRAM in the Slave??
Ive Succeeded to Find the Slave GBA but not to Show the LOGO.
Maybe it is because my program isnt compiled as MultiBoot?
As I said before any comment, link, source or whatever am I interested in!
Thanks in advance! |
Do you feel like digging through my library? It's pretty much the same as the multiplayer part of the SGADE library, except I know it works (took me hours to find out why that code didn't work). Post if you want it..
_________________
Little kids and Playstation 2's don't mix. :(
#22703 - ProblemBaby - Sun Jun 27, 2004 12:45 pm
Yes it would be really great!
you can send it to:
aron_aggrieve@hotmail.com
#22718 - dagamer34 - Sun Jun 27, 2004 9:45 pm
Will do. I'll also send you the multiplayer example, but I'm not exactly sure if it works (I don't have my second GBA with me).
_________________
Little kids and Playstation 2's don't mix. :(
#22736 - ProblemBaby - Mon Jun 28, 2004 8:24 am
Thanks a lot!
#22756 - dagamer34 - Mon Jun 28, 2004 8:34 pm
ProblemBaby wrote: |
Thanks a lot! |
Did it help any?
_________________
Little kids and Playstation 2's don't mix. :(
#22762 - ProblemBaby - Mon Jun 28, 2004 10:51 pm
I dont know yet cause Ive not got it?!
have you sent it?
#22763 - dagamer34 - Mon Jun 28, 2004 11:36 pm
I got a "Failed to deliver" message in my inbox when I checked. Are you sure you gave me the correct address?
_________________
Little kids and Playstation 2's don't mix. :(
#22765 - ProblemBaby - Mon Jun 28, 2004 11:46 pm
#22766 - dagamer34 - Mon Jun 28, 2004 11:58 pm
It should be there in about 10 minutes. Uploading stuff on dial-up takes forever. It's 710 KB.
_________________
Little kids and Playstation 2's don't mix. :(
#22769 - ProblemBaby - Tue Jun 29, 2004 12:17 am
Thanks I got it!
I will check it out tomorrow after work!
#22820 - ProblemBaby - Tue Jun 29, 2004 11:05 pm
I flashed your program to my Flash Cart
It worked until this text appeared:
Quote: |
Multiplayer demonstation
Waiting for connection
|
I tried to push all buttons twice on both GBAs both nothing happend.
Anyway Ive looked some at your code.
and I think I can get it to work.
But I need to now one thing and that is what the foo[] is
its huge and not const. Ive no idea of what it is and it isnt described.
But Ive seen that you send it to the Slave is it image data?
#22830 - dagamer34 - Wed Jun 30, 2004 12:56 am
foo[] is the slave rom that supposed to be sent across the link cable.
Whoops, I forgot to tell you to edit that file. After you create that file, you need to make it const so that it is stored in ROM otherwise it will be in RAM, screwing things up. Let me check and see if anything else is off. I still don't have my other GBA though, so it will be by memory.
_________________
Little kids and Playstation 2's don't mix. :(
#22843 - ProblemBaby - Wed Jun 30, 2004 9:46 am
Aha ok now I thinkk I understand...
You compile the same program but with SLAVE_ROM defined and the result is the program that should be run in the slave, right?
I need to know a couple of things...
1.
How do you compile it to get it in unsigned char format.
2.
Is it possible to compile as usual and do a .incbin?
or is it something extra special with that data?
3.
Is it possible to send new data for example...
If I first make a "choose player"-Slave Rom
and then a "game""-Slave Rom
etc... OR...
must everything fit in the 256K boundary from start?
#22855 - tepples - Wed Jun 30, 2004 3:48 pm
ProblemBaby wrote: |
How do you compile it to get it in unsigned char format. |
In order to compile a GBA multiboot slave, you have to compile it with int __gba_multiboot; in one source file (DevKit Advance) or give the linker -specs=gba_mb.specs (devkitARM). Then once you have a binary (after objcopy), convert it to an object file the same way you'd convert any other raw binary file, with something like bin2s or the bin2o macro that comes with the devkitARM examples.
Quote: |
2.
Is it possible to compile as usual and do a .incbin? |
As long as you're in fact compiling a multiboot program, one to run from EWRAM, you should be fine.
Quote: |
or is it something extra special with that data? |
It needs a proper logo, but that's all.
Quote: |
3.
Is it possible to send new data for example...
If I first make a "choose player"-Slave Rom
and then a "game""-Slave Rom |
Yes. You can switch back to so-called Normal Mode at 256 kbps and broadcast the new program to all slaves, preferably with some error-correction coding.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#22910 - dagamer34 - Thu Jul 01, 2004 12:39 am
ProblemBaby wrote: |
Aha ok now I thinkk I understand...
You compile the same program but with SLAVE_ROM defined and the result is the program that should be run in the slave, right?
I need to know a couple of things...
1.
How do you compile it to get it in unsigned char format.
2.
Is it possible to compile as usual and do a .incbin?
or is it something extra special with that data?
3.
Is it possible to send new data for example...
If I first make a "choose player"-Slave Rom
and then a "game""-Slave Rom
etc... OR...
must everything fit in the 256K boundary from start? |
Okay, I guess my instructions weren't very clear so I will give them to you step by step in between the steps. :)
First, open Multiplayer.cpp, and define SLAVE_ROM. There are several preprocessor directives that will compile to make a multiboot ROM, as well as other differences (the slave won't send the ROM, the master will). Build it. You have just created the slave ROM. This is the rom that will be sent over the link cable. Remember the size of the rom for later.
Next, run a file called mboot.bat, included in the files I gave you. What it does is use a program called b2x.exe to convert raw files into header format so that they can be included in another program within a header (yes, tepples, there are better ways, but this is the simplest :)), It is going to create a file called Multiplayer.h.
Finally, go back to Multiplayer.cpp and undefine SLAVE_ROM. Build it again. Now you have the master ROM, check and make sure it is about twice the size of the slave rom. If so, then everything went well. This is the file that you can send to your flash cart to run the example.
Yes, setting this stuff up is hard. Just take a look at my example and run your finger through it just as if you were the CPU. It should help to understand what happens. Post again if you need more help.
_________________
Little kids and Playstation 2's don't mix. :(
#22971 - ProblemBaby - Thu Jul 01, 2004 11:54 pm
Ive some problems first off
Code: |
::: "r0","r1","r2","r8","r9","r10","r11","r12"
|
this line gives me this error:
error: fp cannot be used in asm here
I found out that it works if I take away "r11"
and then I got a warning cuz the function doesnt return any value...
I Tried it and at this point I can find the GBA but when I try to Send the ROM nothing happens. no logo, no stuff at all just the GameBoy text
in sad dark blue.
Can it be the ::: "r0" stuff that makes this problem cause I tried to compile
without it.
And I should also mention this:
I just call the FindGBA and SendROM functions for now to see if I can play it on both GBAs without any data exchanges maybe Ive to do something more to get it to work??
Then I wonder if it is really nessecery to have all the code twice??
well well thats a later problem first off I want it to work..
#23104 - ProblemBaby - Sun Jul 04, 2004 7:19 pm
I got som e problems
First off the inline asm codes for DelayCycles and Call the BIOS-function
gives me error from the DelayCycles-function i got
Error: bad instruction `lsr r2,#24'
Error: bad arguments to instruction -- `sub r0,r1'
and in the asm for calling swi 0x25 I got:
error: fp cannot be used in asm here
and its this line ::: "r0","r1","r2","r8","r9","r10","r11", "r12"
If I take away "r11" it works. I dont know how important it is and what it does..
In the DelayCycles function ive seen two kinds of inline asm
asm("instruction"); and __asm{instruction};
whats the difference?
And how do I know if I should write swi 0x25 or swi 0x0025000??
Another things that really makes me confused is: at the GBATek it says that the r7 should poiunt to the multiboot structure but in the code it is
r0 it also says that the return value is placed in r0...
Please help me, if anyone can answer just one thing that would be great
thanks in advance
#23111 - dagamer34 - Sun Jul 04, 2004 11:14 pm
ProblemBaby wrote: |
I got som e problems
First off the inline asm codes for DelayCycles and Call the BIOS-function
gives me error from the DelayCycles-function i got
Error: bad instruction `lsr r2,#24'
Error: bad arguments to instruction -- `sub r0,r1'
and in the asm for calling swi 0x25 I got:
error: fp cannot be used in asm here
and its this line ::: "r0","r1","r2","r8","r9","r10","r11", "r12"
If I take away "r11" it works. I dont know how important it is and what it does..
In the DelayCycles function ive seen two kinds of inline asm
asm("instruction"); and __asm{instruction};
whats the difference?
And how do I know if I should write swi 0x25 or swi 0x0025000??
Another things that really makes me confused is: at the GBATek it says that the r7 should poiunt to the multiboot structure but in the code it is
r0 it also says that the return value is placed in r0...
Please help me, if anyone can answer just one thing that would be great
thanks in advance |
This is where I got the multiboot info from:
http://www.devrs.com/gba/files/mbclient.txt
You need to compile it in arm mode for it to work properly. The swi should be written 0x250000 since it's in arm mode too.
_________________
Little kids and Playstation 2's don't mix. :(
#23141 - ProblemBaby - Mon Jul 05, 2004 5:12 pm
I found out the problem
it was Krawall that disturb it in some way I dont now what but I think I can find out it Iam just happy that it works thanks a lot to everyone that have helped me especially dagamer34:)
Now Ive one last question of course=)
If I want to send new data which steps should I repeat?