Tilemap (Updated.)

Post Reply
biertje
Posts: 2
Joined: Tue Dec 01, 2009 8:10 pm

Tilemap (Updated.)

Post by biertje » Tue Dec 01, 2009 8:11 pm

hey,

I searched for my question, and now i have more. This is my code (main.c):

Code: Select all

#include <nds.h>
#include "back.h"

int main(void) {

with background 0 active	
videoSetMode(MODE_0_2D | DISPLAY_BG0_ACTIVE);	
	
vramSetBankA(VRAM_A_MAIN_BG); 	
	
BGCTRL[0] = BG_TILE_BASE(0) | BG_MAP_BASE(4) | BG_COLOR_256 | TEXTBG_SIZE_256x256;	

dmaCopy(backPal,BG_PALETTE,backPalLen);	
dmaCopy(backTiles,(void *)CHAR_BASE_BLOCK(0),backTilesLen);	
dmaCopy(backMap,(void *)SCREEN_BASE_BLOCK(4),backMapLen);	

while(1) {		
swiWaitForVBlank();	
}	
return 0;
}
My back.grit:

Code: Select all

-gt
-mRtpf
-gB8
-mLs
main.c in the map Source, and my back.grit in the map gfx(With back.png (256x256)).

I i go to cmd, and press make, i get errors:

Code: Select all

C:\devkitPro\project>make
main.c
arm-eabi-gcc -MMD -MP -MF /c/devkitPro/project/build/main.d -g -Wall -O2 -march=
armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interw
ork -iquote /c/devkitPro/project/include -I/c/devkitPro/libnds/include -I/c/devk
itPro/project/build -DARM9 -c /c/devkitPro/project/source/main.c -o main.o
c:/devkitPro/project/source/main.c:3:18: error: back.h: No such file or director
y
c:/devkitPro/project/source/main.c: In function 'main':
c:/devkitPro/project/source/main.c:13: error: 'TEXTBG_SIZE_256x256' undeclared (
first use in this function)
c:/devkitPro/project/source/main.c:13: error: (Each undeclared identifier is rep
orted only once
c:/devkitPro/project/source/main.c:13: error: for each function it appears in.)
c:/devkitPro/project/source/main.c:18: error: 'backPal' undeclared (first use in
 this function)
c:/devkitPro/project/source/main.c:18: error: 'backPalLen' undeclared (first use
 in this function)
c:/devkitPro/project/source/main.c:19: error: 'backTiles' undeclared (first use
in this function)
c:/devkitPro/project/source/main.c:19: error: 'backTilesLen' undeclared (first u
se in this function)
c:/devkitPro/project/source/main.c:20: error: 'backMap' undeclared (first use in
 this function)
c:/devkitPro/project/source/main.c:20: error: 'backMapLen' undeclared (first use
 in this function)
make[1]: *** [main.o] Error 1
make: *** [build] Error 2
Does anybody knows what i'm doing wrong?

Thank you,
Biertje

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Tilemap (Updated.)

Post by vuurrobin » Wed Dec 02, 2009 8:10 pm

open your makefile and see if there is a grit rule for *.png files. it should look something like this:

Code: Select all

#---------------------------------------------------------------------------------
%.s %.h	: %.png %.grit
#---------------------------------------------------------------------------------
	grit $< -fts -o$*
if it isn't in there, then you should add it to the makefile, as well as some other things. look in the examples for a makefile that has the rule and see what you need to add/change. or just use that makefile :).

biertje
Posts: 2
Joined: Tue Dec 01, 2009 8:10 pm

Re: Tilemap (Updated.)

Post by biertje » Wed Dec 02, 2009 8:18 pm

vuurrobin wrote:open your makefile and see if there is a grit rule for *.png files. it should look something like this:

Code: Select all

#---------------------------------------------------------------------------------
%.s %.h	: %.png %.grit
#---------------------------------------------------------------------------------
	grit $< -fts -o$*
if it isn't in there, then you should add it to the makefile, as well as some other things. look in the examples for a makefile that has the rule and see what you need to add/change. or just use that makefile :).
EDIT:
I editted all the things, but i doesn't work. Same errors again. About the main.c and the backTile, back Tilemap, etc.


ps.Kan ik je toevoegen op MSN? Gaat sneller, makkelijker, simpeler. Als je wilt natuurlijk.

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Tilemap (Updated.)

Post by vuurrobin » Wed Dec 02, 2009 10:03 pm

biertje wrote:ps.Kan ik je toevoegen op MSN? Gaat sneller, makkelijker, simpeler. Als je wilt natuurlijk.
Ik hou vragen zoals dit liever op het forum. als er dan andere mensen zijn met hetzelfde probleem, dan kunnen ze hier gelijk de oplossing zien.


is back.h created in the build directory? if not, then something is wrong with the grit rule. if it does exists, then the compiler can't find the file.

or could you copy/paste your makefile?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest