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.

Patater's Introduction to Nintendo DS Programming > Chapter 5

#165213 - the-anonymous-coward - Sat Dec 13, 2008 12:06 am

Okay, so I am trying to work my way through this tutorial. I tried to build the Chapter five project from its folder, just to make sure my system is set up correctly, but I get this output:

Code:

> "make"
thrust_1_22050_8_s.raw
grit /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/moon.png -fts -omoon
STATUS: ---grit v0.8.3 ---
STATUS: Individual runs.
STATUS: Input file c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/moon.png
STATUS: Output file: 'moon'.
STATUS: Started run at: 2008-12-12, 17:59:37
STATUS: Validatating gr.
WARNING:   No explicit symbol name. In overwrite mode, so using dst title.
STATUS: Validation succeeded.
STATUS: Preparing data.
STATUS: Work-DIB creation.
WARNING:   converting from 4 bpp to 4 bpp.
STATUS: Work-DIB creation complete: 32x32@8.
STATUS: Tile preparation.
STATUS:   tiling to 8x8 tiles.
STATUS: Tile preparation complete.
STATUS: Graphics preparation.
STATUS:   Bitpacking: 8 -> 4.
STATUS: Graphics preparation complete.
STATUS: Palette preparation.
STATUS: Palette preparation complete.
STATUS: Data preparation complete.
STATUS: Export to GNU asm: moon into moon.s .
STATUS: Run completed :).
STATUS: Done!
moon.s
arm-eabi-gcc -MMD -MP -MF /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build/moon.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c moon.s -o moon.o
grit /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/orangeShuttle.png -fts -oorangeShuttle
STATUS: ---grit v0.8.3 ---
STATUS: Individual runs.
STATUS: Input file c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/orangeShuttle.png
STATUS: Output file: 'orangeShuttle'.
STATUS: Started run at: 2008-12-12, 17:59:39
STATUS: Validatating gr.
WARNING:   No explicit symbol name. In overwrite mode, so using dst title.
STATUS: Validation succeeded.
STATUS: Preparing data.
STATUS: Work-DIB creation.
WARNING:   converting from 4 bpp to 4 bpp.
STATUS: Work-DIB creation complete: 64x64@8.
STATUS: Tile preparation.
STATUS:   tiling to 8x8 tiles.
STATUS: Tile preparation complete.
STATUS: Graphics preparation.
STATUS:   Bitpacking: 8 -> 4.
STATUS: Graphics preparation complete.
STATUS: Palette preparation.
STATUS: Palette preparation complete.
STATUS: Data preparation complete.
STATUS: Export to GNU asm: orangeShuttle into orangeShuttle.s .
STATUS: Run completed :).
STATUS: Done!
orangeShuttle.s
arm-eabi-gcc -MMD -MP -MF /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build/orangeShuttle.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c orangeShuttle.s -o orangeShuttle.o
grit /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/planet.png -fts -oplanet
STATUS: ---grit v0.8.3 ---
STATUS: Individual runs.
STATUS: Input file c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/planet.png
STATUS: Output file: 'planet'.
STATUS: Started run at: 2008-12-12, 17:59:39
STATUS: Validatating gr.
WARNING:   No explicit symbol name. In overwrite mode, so using dst title.
STATUS: Validation succeeded.
STATUS: Preparing data.
STATUS: Work-DIB creation.
WARNING:   converting from 24 bpp to 16 bpp.
STATUS:   converting to: 16bpp BGR, alpha=1, except for 0x0000.
STATUS: Work-DIB creation complete: 128x128@16.
STATUS: Tile preparation.
STATUS: Tile preparation complete.
STATUS: Graphics preparation.
STATUS: Graphics preparation complete.
STATUS: Data preparation complete.
STATUS: Export to GNU asm: planet into planet.s .
STATUS: Run completed :).
STATUS: Done!
planet.s
arm-eabi-gcc -MMD -MP -MF /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build/planet.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c planet.s -o planet.o
grit /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/splash.png -fts -osplash
STATUS: ---grit v0.8.3 ---
STATUS: Individual runs.
STATUS: Input file c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/splash.png
STATUS: Output file: 'splash'.
STATUS: Started run at: 2008-12-12, 17:59:39
STATUS: Validatating gr.
WARNING:   No explicit symbol name. In overwrite mode, so using dst title.
STATUS: Validation succeeded.
STATUS: Preparing data.
STATUS: Work-DIB creation.
WARNING:   converting from 24 bpp to 16 bpp.
STATUS:   converting to: 16bpp BGR, alpha=1, except for 0x0000.
STATUS: Work-DIB creation complete: 256x192@16.
STATUS: Tile preparation.
STATUS: Tile preparation complete.
STATUS: Graphics preparation.
STATUS: Graphics preparation complete.
STATUS: Data preparation complete.
STATUS: Export to GNU asm: splash into splash.s .
STATUS: Run completed :).
STATUS: Done!
splash.s
arm-eabi-gcc -MMD -MP -MF /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build/splash.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c splash.s -o splash.o
grit /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/starField.png -fts -ostarField
STATUS: ---grit v0.8.3 ---
STATUS: Individual runs.
STATUS: Input file c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/gfx/starField.png
STATUS: Output file: 'starField'.
STATUS: Started run at: 2008-12-12, 17:59:40
STATUS: Validatating gr.
WARNING:   No explicit symbol name. In overwrite mode, so using dst title.
STATUS: Validation succeeded.
STATUS: Preparing data.
STATUS: Work-DIB creation.
WARNING:   converting from 24 bpp to 16 bpp.
STATUS: converting to: 16bpp BGR, alpha=1.
STATUS: Work-DIB creation complete: 256x192@16.
STATUS: Tile preparation.
STATUS: Tile preparation complete.
STATUS: Graphics preparation.
STATUS: Graphics preparation complete.
STATUS: Data preparation complete.
STATUS: Export to GNU asm: starField into starField.s .
STATUS: Run completed :).
STATUS: Done!
starField.s
arm-eabi-gcc -MMD -MP -MF /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build/starField.d -x assembler-with-cpp -g -mthumb -mthumb-interwork -c starField.s -o starField.o
main.cpp
arm-eabi-g++ -MMD -MP -MF /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build/main.d -g -Wall -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/include -I/c/devkitPro/libnds/include -I/c/devkitPro/libnds/include -I/c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/build -DARM9 -fno-rtti -fno-exceptions -c /c/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp -o main.o
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp: In function 'void initBackgrounds()':
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:51: error: 'BG3_CR' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:58: error: 'BG3_XDX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:59: error: 'BG3_XDY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:60: error: 'BG3_YDX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:61: error: 'BG3_YDY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:65: error: 'BG3_CX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:66: error: 'BG3_CY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:70: error: 'BG2_CR' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:77: error: 'BG2_XDX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:78: error: 'BG2_XDY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:79: error: 'BG2_YDX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:80: error: 'BG2_YDY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:84: error: 'BG2_CX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:85: error: 'BG2_CY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:88: error: 'SUB_BG3_CR' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:95: error: 'SUB_BG3_XDX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:96: error: 'SUB_BG3_XDY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:97: error: 'SUB_BG3_YDX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:98: error: 'SUB_BG3_YDY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:103: error: 'SUB_BG3_CX' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:104: error: 'SUB_BG3_CY' was not declared in this scope
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp: In function 'int main()':
c:/MyProjects/NDS/Tutorial/manual/code/chapter_5-backgrounds/source/main.cpp:139: error: 'powerON' was not declared in this scope
make[1]: *** [main.o] Error 1
rm moon.s splash.s planet.s orangeShuttle.s starField.s
"make": *** [build] Error 2

> Process Exit Code: 2
> Time Taken: 00:11


I just assumed that the code that came with manual would build. Keep in mind that I am not very experienced in any of this, so it could be something very simple.

#165215 - Ludo6431 - Sat Dec 13, 2008 12:40 am

You use devkitARM r24...
i think in the libnds of this release, these registers are not defined... (view : http://forum.gbadev.org/viewtopic.php?p=165210#165210)
_________________
Sorry for my poor english, I'm french.

#165217 - wintermute - Sat Dec 13, 2008 1:24 am

The naming scheme in the latest libnds has changed, hopefully Patater will get round to updating soon.

In the meantime the answer in the thread linked above should help with this too.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#165220 - the-anonymous-coward - Sat Dec 13, 2008 2:11 am

Oh, thanks guys. I looked through the header files and thought it must just be something stupid I wias missing.

#165262 - Patater - Mon Dec 15, 2008 2:50 pm

The new version of the manual is now up. All chapters are verified to build and work with version 1.3.1 of libnds.

http://patater.com/manual

Enjoy the manual and good luck on your projects!

#165285 - the-anonymous-coward - Tue Dec 16, 2008 4:47 am

Thanks Patater!

#165289 - the-anonymous-coward - Tue Dec 16, 2008 6:47 am

Patater, I thought I would go through and just make sure that all the chapters compile. Chapters 6, 7, 8, and 9 don't, all because SPRITE_DMA_CHANNEL isn't visible. Just thought I'd let you know.

#165307 - Patater - Tue Dec 16, 2008 3:06 pm

Doh. I thought I had addressed that. This is embarrassing for me. Anyhow, it is fixed. Sorry for the trouble. Thanks for notifying me.

#165318 - the-anonymous-coward - Wed Dec 17, 2008 12:29 am

Ah, it's no big deal. Maybe I should have let you known more discreetly. I embarrass myself quite often when it comes to coding.