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.

ASM > MBV2, GoldRoad....how do i get a listing to work

#13734 - LOOP-HOG - Sun Dec 21, 2003 9:20 pm

I am using the Goldroad assembler to try to create a .MB file, that is to say, one that you can download directly to the GBA using the MBV2 cable. I have tried several sample listings, but none of them work. Always the screen will go blank and then nothing will come up. I'm thinking that **ALL** Goldroad sample listings assume the usage of either an emulator OR a flashcart.

I've read some of the technical info on how to make a .MB file as opposed to a .GBA file, but it just isn't clicking.

basically what i want is a small simple listing that is 100% guaranteed to work with the multiboot cable, ( tested with said hardware ) and nothing else, so that I can see everything that is involved in making a .MB file function properly.

thanks.

#13752 - LOOP-HOG - Mon Dec 22, 2003 5:42 am

@include screen.h

@textarea 0x2000000

@dcb 0x00,0x00,0x00,0x00

@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
@dcb 0x00,0x00,0x00,0x00

; Note: The title MUST have 12 characters. You can of course use spaces at the end.
@dcb "TITLE HERE"

@dcb "Home"

@dcb 0x00,0x00

@dcb 0x96

@dcb 0x00

@dcb 0x00

@dcb 0x00,0x00,0x00,0x00,0x00,0x00,0x00

@dcb 0x00

; Complement check - use gbafix to determine your complement ( e.g. gbafix -v yourgame.agb ) and insert it here
@dcb 0x62

@dcb 0x00,0x00

b main

@dcb 0x1C,0x0

main:

ldr r1,=REG_DISPCNT
ldr r2,=(BG2_ENABLE|MODE_3)
str r2,[r1]

ldr r1,= 0x7FFF
ldr r2,=vram
add r2,r2,38400
str r1,[r2]

START
b START

@pool
@endarea

#13753 - LOOP-HOG - Mon Dec 22, 2003 5:47 am

BigRedPMP from #gbadev on irc.blessed.net helped me out alot with it. My original listing had the header wrong. Posted above is a correct header. The program is very simple, just a sample to get something to work.

First you need to run the listing through the Goldroad assembler. Then you take the resulting .mb file and fix the checksum on it using GBAFIX. After that you upload it to a GBA using a multiboot cable, such as MVB2 or XBOO. After that you should see if you squint hard enough a white pixel on a black screen, the pixel is in the middle left of the screen right up against the edge.

#14030 - rogergba - Sat Dec 27, 2003 11:05 pm

I was just about to ask for this very code.
Some sort of sample multiboot code to get me going.
thx.

I spent MANY years developing for the c64 and I must say that the assembly on the arm is all but readable to me as is, without reading an instruction maunal.

Now for a plan...
Now for a project...
Now for a financial goal...
...the knowledge is there
and away we go!