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 > MBV2 cable: Hardware newbie needs help...

#1580 - Indecisive - Mon Jan 20, 2003 1:42 pm

I recently got an MBV2 cable from lik-sang. I've so far succeeded in transferring the little demo program that came with it onto my GBA and it works fine. Unfortunately, my programs don't.

I have so far only been running them on emulators (which works fine) and I know I need to do something to them so they can run on hardware. Some sort of header?

I'm using DevKit Advance so if someone can provide a .h or .c that I can just add to the start of my prog that would be brilliant. Can anyone help?

#1601 - tepples - Mon Jan 20, 2003 6:02 pm

If you're using a recent version of Devkit Advance or any other system built around Jeff F's linker script, then put the following line in ONE of your source code files:

int __gba_multiboot;

This will instruct the linker script to output code relocated to EWRAM rather than ROM. (If run from ROM, the program will copy itself to RAM before running it.) Files compiled this way are usually named with the .mb extension rather than .gba.

You can put several .mb files into one .gba with a menu program such as this one.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#2250 - Indecisive - Fri Jan 31, 2003 6:50 pm

Okay, just got round to trying this. Guess I don't have a recent enough version of DevKit Advance as it didn't seem to work.
There weren't any errors when I compiled it, but I still get nothing but a blank screen after I transfer it.
Does this mean I need to get a more recent version of DevKit Advance or does someone have a .h or whatever I can #include make my program multiboot?
If this post is a bit odd it's because I'm not really sure what I'm talking about when it comes to hardware. So any help would be appreciated.

#2513 - Maverick - Wed Feb 05, 2003 2:45 pm

Just after your includes at the top, write in this

Code:

#define MULTIBOOT volatile const u8 __gba_multiboot;
MULTIBOOT


Then continue on with the rest of your code as normal, you also need a make.bat file that looks like this:

Code:

path=C:\devkitadv\bin
gcc -Ttext=0x02000000 -o game.elf game.c
objcopy -O binary game.elf game.mb


The first lot of code is to tell the GBA to boot the file into GBA RAM, this is necessary as there is no cart in the GBA so we cant load to CART RAM.

The change in the make.bat file from a normal one is the
-Ttext=0x02000000
This is to tell the GBA to start from memory address 0x02000000 and not 0x08000000, again because there is no cart installed.

Hope this helps!

#3581 - Indecisive - Fri Feb 28, 2003 12:29 pm

Couldn't let this go without responding. I just got round to trying this yesterday and it works. Many, many thanks!

#3711 - phr0zn - Thu Mar 06, 2003 2:43 am

Hey, I know this is a semi-old topic but I am still having trouble getting my MBV2 cable to work.

I am running windowsxp and I downloaded the UserPort.sys file and put it in Windows\System32\Drivers and am using UserPort.exe with my printer IO resources specified correctly (or I believe so - 378-37F).

However, when I run mb -s glib -w 500, nothing happens (it runs...just nothing seems to be going on). I double and double and double, but nothing happens. Approx how long should I wait?

Could there be something wrong with my cable, or am I doing something wrong?

Thanks.

#3712 - phr0zn - Thu Mar 06, 2003 3:02 am

one more thing I noticed: every time I hit exit in UserPort, the IO registers seem to return to default. However, it says it is still running when I click to start it again.

I have tried removing all of its entries and adding mine, and it does that, but when I load it up again mine are gone and it has returned to the default settings. Any ideas?

#3736 - Maverick - Thu Mar 06, 2003 11:52 pm

How far does mb.exe get?

What are the outputs given after you type this in?

#3738 - phr0zn - Fri Mar 07, 2003 1:15 am

it just kinda stalls there, and my 2.4ghz computer just kinda slowly freezes. It seems like it could be doing something...and thats why I ask how long it should take. There is no output, but nothing really happens. maybe im not waiting long enough?

#3739 - ampz - Fri Mar 07, 2003 2:12 am

No idea about the MBV2...
The XBOO cable downloads 20kB of code in 1-2seconds on my machine (450MHz)

#3747 - Maverick - Fri Mar 07, 2003 3:28 pm

Is your LPT1 set to 0378-037F or 378-37F.

I dont know how this prog works, so i dont know if this could make a difference.

#3749 - tepples - Fri Mar 07, 2003 4:27 pm

phr0zn wrote:
it just kinda stalls there, and my 2.4ghz computer just kinda slowly freezes. It seems like it could be doing something

Look at the GBA, and turn up the volume. If you hear six notes out of an ascending G major scale and you see "Nintendo?" on the display, the transfer has started. If the "Nintendo?" slowly fades in and out, the transfer is continuing. When "GAME BOY" and "Nintendo?" fade to white, the transferred program has started. (If it remains white after that point, the bug is in your program, not the transfer technique.)

That said, UserPort's default settings worked for me on Windows 2000.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#3758 - phr0zn - Fri Mar 07, 2003 10:31 pm

when i enter 0378-037F it just changes it to 378-37F, so I think they are the same.

As for the sound, etc: no sound, no blinking, no nothing. just kinda is there.

well...this is a bummer :)

#3765 - Maverick - Sat Mar 08, 2003 12:10 am

So, userport.sys is in system32, userport.exe is ready the mbv2 is in parallel port, lpt is set to 378-37F, userport is set to 378-37F

mb -s glib -w 500

with glib.mb in the same folder

But when you turn on the GBA and hit enter, nothing hapens at all?

#3772 - phr0zn - Sat Mar 08, 2003 5:51 am

exactly. that is a perfect description of what happens :)
_________________
http://cerberus.promodtecnologies.com

#3774 - ampz - Sat Mar 08, 2003 1:22 pm

Wrong paralell port mode?

#3775 - Maverick - Sat Mar 08, 2003 1:47 pm

I dont have XP myself but the way that it is supposed to work is:

userport.exe in XP root directory
userport.sys in XP\system32\drivers\
address range same as lpt port settings
then click start on userport.exe
then turn gba on with no cartridge installed

GBA output should be just GAME BOY

connect the mbv2 cable between the parallel port and the GBA
then startbar\run\cmd
goto directory with mb.exe and glib.mb in
type mb -s glib -w 500

MB.EXE output should be
Parallel MBV2 cable found: hardware=vX.X, firmware=vX
EPP support found.
Looking for multiboot-ready GBA...
Sending data. Please wait...
CRC Ok - Done.

GBA should "Bling"
NintendoR should now be flashing on the screen

When NintendoR stops flashing and GAME BOY and NintendoR fade away, the multiboot rom should execute.

This is the theory, but this is everything you are doing!

#3785 - phr0zn - Sat Mar 08, 2003 9:13 pm

yah. at this point

Quote:

MB.EXE output should be
Parallel MBV2 cable found: hardware=vX.X, firmware=vX
EPP support found.
Looking for multiboot-ready GBA...
Sending data. Please wait...
CRC Ok - Done.


nothing happens. i will try it on another computer with win98 or something, see if its the cable or my computer.
_________________
http://cerberus.promodtecnologies.com

#4633 - Maverick - Sat Apr 05, 2003 4:46 pm

When you click start in userport.exe, what happens?

#4744 - slippyr4 - Tue Apr 08, 2003 12:29 pm

Quote:
#define MULTIBOOT volatile const u8 __gba_multiboot;
MULTIBOOT


Why bother defining MULTIBOOT, when you only use it once, and on the next line? Better to just put:-

volatile const u8 __gba_multiboot;

on one line.[/quote]