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.

Hardware > Multiboot Protocol Details

#45071 - ZeroX - Tue Jun 07, 2005 2:21 pm

Hi. I'm trying to write a multiboot transfer software using the xboo cable that works on windows XP/2000, but im having difficulties understanding certain parts. Ive manage to transfer the header, but i dont understand how to specify the length before transfering the main data. All my coding is based on no$gba document by martin. this is what he wrote

Code:
Times  Send   Receive  Expl.
 -----------------------Required Transfer Initiation in master program
 ...    6200   FFFF     Slave not in multiplay/normal mode yet
 1      6200   0000     Slave entered correct mode now
 15     6200   720x     Repeat 15 times, if failed: delay 1/16s and restart
 1      610y   720x     Recognition okay, exchange master/slave info
 60h    xxxx   NN0x     Transfer C0h bytes header data in units of 16bits
 1      6200   000x     Transfer of header data completed
 1      620y   720x     Exchange master/slave info again
 ...    63pp   720x     Wait until all slaves reply 73cc instead 720x
 1      63pp   73cc     Send palette_data and receive client_data[1-3]
 1      64hh   73uu     Send handshake_data for final transfer completion
 -----------------------Below is SWI 37 MultiBoot handler in BIOS
 DELAY  -      -        Wait 1/16 seconds at master side
 1      llll   73rr     Send length information and receive random data[1-3]
 LEN    yyyy   nnnn     Transfer main data block in units of 16 or 32 bits
 1      0065   nnnn     Transfer of main data block completed, request CRC
 ...    0065   0074     Wait until all slaves reply 0075 instead 0074
 1      0065   0075     All slaves ready for CRC transfer
 1      0066   0075     Signalize that transfer of CRC follows
 1      zzzz   zzzz     Exchange CRC must be same for master and slaves
 -----------------------Optional Handshake (NOT part of master/slave BIOS)
 ...    ....   ....     Exchange whatever custom data

Legend for above Protocol

 y     client_bit, bit(s) 1-3 set if slave(s) 1-3 detected
 x     bit 1,2,or 3 set if slave 1,2,or 3
 xxxx  header data, transferred in 16bit (!) units (even in 32bit normal mode)
 nn    response value for header transfer, decreasing 60h..01h
 pp    palette_data
 cc    random client_data[1..3] from slave 1-3, FFh if slave not exists
 hh    handshake_data, 11h+client_data[1]+client_data[2]+client_data[3]
 uu    random data, not used, ignore this value

Below automatically calculated by SWI 37 BIOS function (don't care about)

 llll  download length/4-34h
 rr    random data from each slave for encryption, FFh if slave not exists
 yyyy  encoded data in 16bit (multiplay) or 32bit (normal mode) units
 nnnn  response value, lower 16bit of destadr in AGB memory (00C0h and up)
 zzzz  16bit download CRC value, must be same for master and slaves



I have no idea what llll stands for, how to send it. Any help will be appreaciated. Im doing this so that i can help a lot of users out the who cant get Userport or other programs working, and also because i have done nothing to help this community.

Another thing i would like to know is how do i choose what mode of transfer im using, Normal or multiplay. Right now the code uses 32 bit transfers, ( upper 16 bit zeroes, lower 16 bit are the data needed to be sent). Im assuming that multiboot uses normal mode. Please correct me on my mistakes.

The nintendo logo shows up, but sometimes garbled because i change that damn llll value. i dont know how to set it. My transfer code is correct, i got the timing down....i think, cause im getting the right responses. : )

If anybody thinks that Martin's xboo software works fine (i seem to think so, his program is great) and think im wasting my time, please say so. i will abandon this project, and come up with a different idea like maybe finishing MGS 3, or bullying my little brother by making wierd sound : )

#45134 - arundel - Tue Jun 07, 2005 9:48 pm

The length value is quite simple. You take the lenth (in bytes) of the entire ROM. Then just substract C0h, because you should already have sent the header at the time you exchange the length information.

However the standard multiboot mode (at least the one xboo is using) is NORMAL_MODE, which operates in 32bit mode. Since you send the main data in sets of 32bit the length needs to be divided by 4 (byte = 8bit -> dword = 32bit).

The necessaty to substract 34h is just due to some BIOS convention Nintendo programed into the BIOS.

The BIOS will determine whether the AGB will operate in NORMAL_MODE or MULTIPLAYER_MODE, after being set into multiboot mode. This will simply be chosen depending on the protocol used.

However I don't recommend using Multiplayer Mode when using PC <-> AGB communication. I talked to Martin and he wrote some test code to do that. The results were not very convincing. The transfer was slow and completely unstable.

Use NORMAL_MODE for the multiboot procedure. If you want to implement Single/Double-Burst-Boot later on you should be using GENERAL_PURPOSE_MODE.

If you need more help or some code examples just drop me a short note. I wrote an xboo client for FreeBSD/Linux a little while ago. The sources are open (of course). ;)
_________________
http://www.nausicaa.net

#45151 - kudzoo - Wed Jun 08, 2005 3:04 am

i'm trying to get the xcomms client to work on linux but it segfaults when click the gba icon to open the file dialog. any ideas why? is the linux xboo client you put together something i could use arundel?

#45173 - ZeroX - Wed Jun 08, 2005 7:24 am

Thanks for the offer to help arundel. I'll send u private messages.

#45204 - arundel - Wed Jun 08, 2005 4:18 pm

Unfortunately the webspace where I was uploading my files to is no longer avilable. My ISP offered 10MB webspace to all it's customers, but for some reason it isn't offering that option any longer. Pretty lame.

So right now I don't have any place where I can host the sources. The sources are ~ 80k and the binary is 6.4k. So I don't really need that much space. Maybe 1 or 2 megs.

Does anybody know a place where I can host the files?

Here's the project page. Well actually it's just my crappy BLOG. The links however don't work, because of my crappy ISP:

http://arundel.blog.de/main/index.php/arundel?tag=gbadev

If you need the sources right now, just drop me a PM with you e-mail address and I'll send the files to you. Please keep in mind that this is just a little project I did for myself in order to use multiboot upload under FreeBSD. It's not perfect.
_________________
http://www.nausicaa.net

#45205 - strager - Wed Jun 08, 2005 4:55 pm

Try uploading to www.ripway.com . They offer 30MB maximum filesize (unlimited files, I believe), and it is free with registration. And good luck with the code.

#45238 - wintermute - Wed Jun 08, 2005 10:23 pm

http://devkitpro.sourceforge.net/downloads.shtml

see Xboo Communicator

#45474 - arundel - Sat Jun 11, 2005 1:05 am

OK. Sources are up. Some pals of mine are hosting the files now:

http://arundel.blog.de/main/index.php/arundel?tag=gbadev

Please mail/PM any bugs. Again this app is just a custom project for myself. I didn't write it for you guys out there. That's why it natively compiles under FreeBSD.

To use it under Linux you have to define LINUX (-DLINUX=yes when you're using nasm).

Chers.
_________________
http://www.nausicaa.net

#46628 - ZeroX - Tue Jun 28, 2005 10:05 am

Alright, i've finished the xboo program for winXP. I dont know how to submit this program to the website. But before that, i need beta testers. Anybody wanna be beta testers? I've already asked Arundel, cause he has helped me a lot with this program.

PM me if u wanna help. This program works in winXP, and doesnt require Userport or anything like that. The timing is set properly, but i have put a way to change it, if there are any problems.

#54260 - Spektre - Sat Sep 17, 2005 8:20 am

Does your softare allow the up and downloading of data in game?

I.e. sending a file to the PC?

#54323 - ZeroX - Sun Sep 18, 2005 9:06 am

No, it doesnt not. But i dont quite understand your question. Please elaborate.

My program allows a user to send a ROM image(which must be under 256 kB) to the gba and run it. The ROM image must be compiled as a multiboot image. This is useful for small homebrew programs.

Currently im working on a code that allows you to download the ROM into your PC. It will save it as a ROM image. Since you must have the cart with you to do this, i guess there's nothing wrong.

I've finish a minor part of reading the SRAM. But you need to specify the size by yourself. Anyone want to lend a hand in beta testing?

#54324 - ZeroX - Sun Sep 18, 2005 9:11 am

Oh yeah, and you need to use an XBOO cable. Its a dumb cable, easy to build. There are guides everywhere.