#4653 - Burre - Sun Apr 06, 2003 12:06 pm
Hi there...
I recently bought EMapper2 Advance to solve my mapping issues, but I can't seem to get them to work properly with each other. The E2A (Emapper2 Advance) is a licenced version and HAM isn't.
I've successfully built an map, based on an imported BMP tileset and manage to export both to C-code. I have then included the header files in my project and also included the C-files (containing map and tiles) into the compiler chain. So far so good. But when I run my code (using VBA), the tileset looks scrambled. I think that the map loads up fine, but the tilset looks scrambled (both by looking at the game and looking in the tile-viewer included in VBA). The pallette is fine, but is seems that HAM loads the tileset with wrong offset or something. I've noticed that gfx2gba exports to an array of 'const unsigned char' while E2A exports to 'const unsigned short', would that make any difference? Exporting the tilset with gfx2gba doesn't work either.
The code I use for loading maps and tiles are as follows:
I think that is about all code I use for loading and displaying my map (if I haven't forgotten any). I use C++ (wich would explain all explicit typeconversions).
Any ideas why it won't work? I bet it's a simple nut to crack but I'm out of ideas and one can get quite blind reading it's own code over and over...
Any and all help appreciated! :)
_________________
"The best optimizer is between your ears..."
I recently bought EMapper2 Advance to solve my mapping issues, but I can't seem to get them to work properly with each other. The E2A (Emapper2 Advance) is a licenced version and HAM isn't.
I've successfully built an map, based on an imported BMP tileset and manage to export both to C-code. I have then included the header files in my project and also included the C-files (containing map and tiles) into the compiler chain. So far so good. But when I run my code (using VBA), the tileset looks scrambled. I think that the map loads up fine, but the tilset looks scrambled (both by looking at the game and looking in the tile-viewer included in VBA). The pallette is fine, but is seems that HAM loads the tileset with wrong offset or something. I've noticed that gfx2gba exports to an array of 'const unsigned char' while E2A exports to 'const unsigned short', would that make any difference? Exporting the tilset with gfx2gba doesn't work either.
The code I use for loading maps and tiles are as follows:
Code: |
ham_LoadBGPal((void*)bgmaster_Palette,256); // Background palette ham_bg[0].ti = ham_InitTileSet((void*)&tiles0,SIZEOF_16BIT(&tiles0),1,1); // Load tileset ham_bg[0].mi = ham_InitMapEmptySet(3,0); // Make room for the map bg_game_ptr = ham_InitMapFragment((void*)&map0,40,30,0,0,32,22,0); // Load the map fragment ham_InsertMapFragment(bg_game_ptr,0,0,0); // Put fragment on BG ham_InitBg(0,1,0,0); // Display the background |
I think that is about all code I use for loading and displaying my map (if I haven't forgotten any). I use C++ (wich would explain all explicit typeconversions).
Any ideas why it won't work? I bet it's a simple nut to crack but I'm out of ideas and one can get quite blind reading it's own code over and over...
Any and all help appreciated! :)
_________________
"The best optimizer is between your ears..."