#165416 - opal - Fri Dec 19, 2008 11:15 pm
Although I'm not new to programming, console development is new for me, and I've been seriously struggling trying to get a grasp on it.
I've been looking at a few websites for information, particularly The Pern Project and Tonc's GBA deving guide...
Unfortunately, the Pern Project sometimes uses register names that are different due to the ever-changing devkitpro, and Tonc has his own defines of registers and such. Because of this, I've had to go digging through files like gba_video.h for the right code. It's been a hassle, but I've pulled through and the code compiles ok.
Ah, speaking of which, the code...I'm starting out simple- just trying to display as simple of a tiled BG as you get.
I've gone through most of the motions with no problems- my issue comes along when I try to load the tileset, tile palette, and tilemap into VRAM.
Tonc, Pern, and devkitpros' examples show all sorts of ways of loading graphics into memory. After trying all of them, I found that the only one that worked for me was using a for loop...and so that's what I did.
I threw together a very basic tileset and tile palette using tonc's Usenti program. I haven't put together a map yet because I've been unable to find a good map editor.
I've gotten the code with for loops to compile correctly, and obviously when I run the program it shows a black screen because there's no map file to tell the GBA where to draw which tiles.
However, when I run it in an emulator rather than a flashcart and look in the tile data, it seems to be mis-paletted (the tiles are the wrong color) and around tiles 16-20 (which don't exist) there's some random pixels in the tiles.
My questions are this:
Look at my source code. Am I doing everything correctly, particularly in the loading functions I've made?
Do you have a better way to take the tileset/palette and load it into VRAM?
Can you suggest a good map editor so I can put together a map and hopefully by the end of this 3+ day attempt to put together a simple tiled map on the screen?
Sourcecode, tileset/palette, and original tileset pcx image are here:
http://uploading.com/files/Y31YJRYJ/game.zip.html
(tilemap_1 is the actual tileset/palette folder, although these files can also be found in the include folder of the 'game' folder)
I've been looking at a few websites for information, particularly The Pern Project and Tonc's GBA deving guide...
Unfortunately, the Pern Project sometimes uses register names that are different due to the ever-changing devkitpro, and Tonc has his own defines of registers and such. Because of this, I've had to go digging through files like gba_video.h for the right code. It's been a hassle, but I've pulled through and the code compiles ok.
Ah, speaking of which, the code...I'm starting out simple- just trying to display as simple of a tiled BG as you get.
I've gone through most of the motions with no problems- my issue comes along when I try to load the tileset, tile palette, and tilemap into VRAM.
Tonc, Pern, and devkitpros' examples show all sorts of ways of loading graphics into memory. After trying all of them, I found that the only one that worked for me was using a for loop...and so that's what I did.
I threw together a very basic tileset and tile palette using tonc's Usenti program. I haven't put together a map yet because I've been unable to find a good map editor.
I've gotten the code with for loops to compile correctly, and obviously when I run the program it shows a black screen because there's no map file to tell the GBA where to draw which tiles.
However, when I run it in an emulator rather than a flashcart and look in the tile data, it seems to be mis-paletted (the tiles are the wrong color) and around tiles 16-20 (which don't exist) there's some random pixels in the tiles.
My questions are this:
Look at my source code. Am I doing everything correctly, particularly in the loading functions I've made?
Do you have a better way to take the tileset/palette and load it into VRAM?
Can you suggest a good map editor so I can put together a map and hopefully by the end of this 3+ day attempt to put together a simple tiled map on the screen?
Sourcecode, tileset/palette, and original tileset pcx image are here:
http://uploading.com/files/Y31YJRYJ/game.zip.html
(tilemap_1 is the actual tileset/palette folder, although these files can also be found in the include folder of the 'game' folder)