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 > ASM newb question :P

#9733 - Opius - Fri Aug 15, 2003 2:56 pm

I have been following gbaguys tutorials, and they work fine on VisualBoy. The problem I am having is when i try to flash them on to my cart and test them on the GBA, they dont work properly.

For example the displaying a sprite tutorial, the sprite draws but the top half of it is corrupted (random pixel colors) and the bottom half of it seems darker then it should be. Also the sound tutorial, the code works fine in VisualBoy, but nothing plays on my GBA (yes i do have the volume turned up :P )

Anyway i was just wondering if anyone had encountered similar problems, or had suggestions to what the problem could be?

Could it be my linker/flash card? I havent had any problems with C programs i have written or with backups of comercial roms i have tested..

Its a visoly linker and a flash advance extreme 256m card btw

Any help or suggestions will be much appreciated.

Thanks

#9735 - tepples - Fri Aug 15, 2003 4:07 pm

Opius wrote:
I have been following gbaguys tutorials, and they work fine on VisualBoy. The problem I am having is when i try to flash them on to my cart and test them on the GBA, they dont work properly.

What version of VBA? Version 1.6 (just released) emulates a few of the GBA's bugs better.

Quote:
For example the displaying a sprite tutorial, the sprite draws but the top half of it is corrupted (random pixel colors) and the bottom half of it seems darker then it should be.

I can't exactly help you on the top half, but the bottom half will be dark. The GBA's screen (gamma about 4) is darker than a PC's (standard sRGB gamma 2.2).

Quote:
Also the sound tutorial, the code works fine in VisualBoy, but nothing plays on my GBA (yes i do have the volume turned up :P )

Does this "sound tutorial" use the tone generators, or does it use Dsound DMA? If you're having Dsound problems, the first thing to check is that on hardware, you have to zero out the DMA channel's control register when writing to the source or destination registers.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9740 - Opius - Fri Aug 15, 2003 5:50 pm

hmm i still havent fixed it but i think this might be a problem with headers...

the reason i think this is that the program works fine in VBA (1.6) but not when i flash it to my cart. But if i fix the header using GBARM then load it on VBA it does the same thing that it does on my GBA, with all the weird color corruptions ;/

hmm :(

#9742 - torne - Fri Aug 15, 2003 6:56 pm

The linker software often does the header fix for you when you flash the game to the cart (LittleWriter certainly does), as a rom with an invalid header will never start at all on real hardware. If your ROM works on VBA before but not after you do a header fix, check that you have left space for the header at the start of your ROM..

Torne

#9756 - Opius - Sat Aug 16, 2003 6:24 am

Ah cool, that sounds like it must be what is causing my troubles.

How would you go about making sure there was space left for the header?

Thanks

#9758 - torne - Sat Aug 16, 2003 1:40 pm

Are you using Goldroad or GAS?

#9793 - Opius - Mon Aug 18, 2003 10:30 am

I had been using goldroad, but I think I am going to wtry and switch over to using gas

#9796 - torne - Mon Aug 18, 2003 12:31 pm

I tried using Goldroad once; it was pretty painful for me. I develop for a number of platforms and am highly accustomed to GNU syntax (and to manually using the linker), so using gas was a pretty obvious choice.

I can't really help you for Goldroad; it does things in a sufficiently different way that any suggestions I make will be pretty useless. Goldroad seems to be structured around the idea of building a GBA rom, (whereas gas just makes ordinary ELF .o files, no platform specificity), so you'd expect it to work out that they need headers. Ah well. The crt0.S that I use in DevKitAdvance has a valid (minus the Nintendo logo) header built into it at the correct location, so only needs to have the logo pasted in to be usable. =)

Torne

#9806 - GbaGuy - Mon Aug 18, 2003 4:34 pm

Hello,

I've had this problem with Goldroad recently also,
adding this to the start of the file should fix it
(slightly changed from what I was using):

@arm
@fsize 32

b start
@dup dcb 0xba,0x0
start:

Goldroad is sure doing something wierd when/if it
does the header. I'd switch to GAS, but assemblers that
output object files is something I really don't like...

Greetings,
- Mike H

#9808 - tepples - Mon Aug 18, 2003 5:18 pm

GbaGuy wrote:
assemblers that output object files is something I really don't like...

And why not? If you specify arm-agb-elf-gcc kitten.s -o kitten.elf then all you need to do to go from that to a ROM is the arm-agb-elf-objcopy that comes with DKA binutils.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9809 - torne - Mon Aug 18, 2003 6:17 pm

GbaGuy wrote:
I'd switch to GAS, but assemblers that
output object files is something I really don't like...


Then take the time with a conventional assembly/linkage tutorial, one not associated with the GBA, to understand how it works. =)

Torne