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.

Beginners > stopped using ham

#121276 - Funky Gibbon - Sun Mar 11, 2007 1:12 am

Hi All,
is there an easy-ish way to convert code written in ham to gbalib?
does this question make aby sense?

to work in devkitpro is what i mean

Thanks

#121278 - gmiller - Sun Mar 11, 2007 1:23 am

I assume you mean hamlib not ham. The toolchain / IDE / Library seems to be refeered to as "ham" but you can use the IDE with devkitPRO. The conversion from hamlib to gbalib is something I could not address since even in the ham development environment I never using hamlib. Using the ham IDE (Visual HAM) with devkitPRO is faily simple. almost all that needs to be changed is in environment variables and some simple makefile issues. Looking forward to your reply.

#121330 - Funky Gibbon - Sun Mar 11, 2007 5:11 pm

ok as an example

ham_LoadObjPal((void *)&master_Palette,SIZEOF_16BIT master_Palette));

what would the function be using gbalib?

i've not been able to find a good source of infomation on gbalib and ndslib with refrence to the commands, maybe im looking in the wrong places, i've found pleanty of good tutorials and source on how to make projects start to finish, but nothing to explaine the syntax or what the funtions do in detail, if anyone knows of such sources of information i'd be very gratefull, playing around with someone else source code is fine but doesn't explain why it does what it does

Cheers

#121341 - gmiller - Sun Mar 11, 2007 7:32 pm

You would need to copy the data to SPRITE_PALETTE from master_Palette either with code of your own or dmaCopy(const void * source, void * dest, u32 size). I got this by reading the header files in the include folder. I have not used either library so I am not an expert. The line would be something like:

Code:

dmaCopy((void*)&masterPalette, (void *)SPRITE_PALETTE, sizeof(master_Palette) >> 2);
// Of course if masterPalette is not 4 byte aligned this will not work correctly
// correctly because the dmaCopy is moving 4 byte chunks and the starting
// address must be on a 4 byte boundary (low order 2 bit must be zero) and
// the data being moved must be a multiple of 4.