wavemotion-dave / A8DS

A8DS An Atari 8-bit Computer Emulator for the DS/DSi and includes virtually anything the Atari 8-bit computers can run.
GNU General Public License v2.0
25 stars 2 forks source link

Compile fails on latest devkitpro #4

Closed Ntemis closed 1 year ago

Ntemis commented 2 years ago

linking XEGS-DS.elf /opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/12.1.0/../../../../arm-none-eabi/bin/ld: /home/demetris/Desktop/Development/ds/XEGS-DS/arm9/XEGS-DS.elf section .itcm' will not fit in regionitcm' /opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/12.1.0/../../../../arm-none-eabi/bin/ld: region `itcm' overflowed by 1804 bytes collect2: error: ld returned 1 exit status make[2]: [/home/demetris/Desktop/Development/ds/XEGS-DS/arm9/Makefile:115: /home/demetris/Desktop/Development/ds/XEGS-DS/arm9/XEGS-DS.elf] Error 1 rm pdev_tbg0.s bgBottom.s pdev_bg0.s bgInfo.s bgKeyBrief.s bgFileSel.s bgTop.s bgKeyboard.s make[1]: [Makefile:99: build] Error 2 make[1]: Leaving directory '/home/demetris/Desktop/Development/ds/XEGS-DS/arm9' make: *** [Makefile:39: arm9/XEGS-DS.elf] Error 2

wavemotion-dave commented 2 years ago

Looks like some aspect of the new build library causes the .itcm region to overflow. The .itcm region is 32K of fast hand-tuned code... it just barely fits in my current build using 10.2.0 You can try removing one or more of the ITCM_CODE tags - it will affect performance but not usability.

wavemotion-dave commented 1 year ago

I've switched to the latest development kit - it should build again.

Ntemis commented 1 year ago

its a nope a8ds.c /home/demetris/Desktop/Development/ds/A8DS/arm9/source/a8ds.c:41:10: fatal error: kbd_XL2.h: No such file or directory 41 | #include "kbd_XL2.h" | ^~~ compilation terminated. make[2]: [/opt/devkitpro/devkitARM/base_rules:85: a8ds.o] Error 1 rm pdev_tbg0.s bgBottom.s kbd_400.s pdev_bg0.s bgInfo.s kbd_XL.s bgFileSel.s bgTop.s kbd_XE.s make[1]: [Makefile:99: build] Error 2 make[1]: Leaving directory '/home/demetris/Desktop/Development/ds/A8DS/arm9' make: *** [Makefile:39: arm9/A8DS.elf] Error 2

Ntemis commented 1 year ago

removed its and compile continued to /home/demetris/Desktop/Development/ds/A8DS/arm9/source/a8ds.c: In function 'dsShowKeyboard': /home/demetris/Desktop/Development/ds/A8DS/arm9/source/a8ds.c:1499:22: error: 'kbd_XL2Tiles' undeclared (first use in this function); did you mean 'kbd_XLTiles'? 1499 | decompress(kbd_XL2Tiles, bgGetGfxPtr(bg0b), LZ77Vram); | ^~~~ | kbd_XLTiles /home/demetris/Desktop/Development/ds/A8DS/arm9/source/a8ds.c:1499:22: note: each undeclared identifier is reported only once for each function it appears in /home/demetris/Desktop/Development/ds/A8DS/arm9/source/a8ds.c:1500:22: error: 'kbd_XL2Map' undeclared (first use in this function); did you mean 'kbd_XLMap'? 1500 | decompress(kbd_XL2Map, (void) bgGetMapPtr(bg0b), LZ77Vram); | ^~~~~~ | kbd_XLMap /home/demetris/Desktop/Development/ds/A8DS/arm9/source/a8ds.c:1501:28: error: 'kbd_XL2Pal' undeclared (first use in this function); did you mean 'kbd_XLPal'? 1501 | dmaCopy((void ) kbd_XL2Pal,(u16) BG_PALETTE_SUB,2562); | ^~~~~~ | kbd_XLPal make[2]: [/opt/devkitpro/devkitARM/base_rules:85: a8ds.o] Error 1 make[1]: [Makefile:99: build] Error 2 make[1]: Leaving directory '/home/demetris/Desktop/Development/ds/A8DS/arm9' make: *** [Makefile:39: arm9/A8DS.elf] Error 2

SimPiko commented 1 year ago

include "kbd_XL2.h

It's because kbd_XL2.png is missing in arm9/gfx/ folder. Temporary fix would be to make copy of kbd_XL.png and rename it as kbd_XL2.png

Ntemis commented 1 year ago

should reopen

wavemotion-dave commented 1 year ago

Sorry guys - yeah, I forgot the kbd_XL2.png file. I've just added it. I'll reopen until someone confirms they can compile (other than me!)

SimPiko commented 1 year ago

Compiles fine on my side with proper kbd_XL2.png, let's hear from Ntemis though to be certain

Ntemis commented 1 year ago

linking A8DS.elf /opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/bin/ld: /home/demetris/Desktop/Development/ds/A8DS/arm9/A8DS.elf section .itcm' will not fit in regionitcm' /opt/devkitpro/devkitARM/bin/../lib/gcc/arm-none-eabi/13.1.0/../../../../arm-none-eabi/bin/ld: region `itcm' overflowed by 2680 bytes collect2: error: ld returned 1 exit status make[2]: [/home/demetris/Desktop/Development/ds/A8DS/arm9/Makefile:115: /home/demetris/Desktop/Development/ds/A8DS/arm9/A8DS.elf] Error 1 rm kbd_XL2.s pdev_tbg0.s bgBottom.s kbd_400.s pdev_bg0.s bgInfo.s kbd_XL.s bgFileSel.s bgTop.s kbd_XE.s make[1]: [Makefile:99: build] Error 2 make[1]: Leaving directory '/home/demetris/Desktop/Development/ds/A8DS/arm9' make: *** [Makefile:39: arm9/A8DS.elf] Error 2

wavemotion-dave commented 1 year ago

Hmm... must be the version of gcc you're using. Maybe you're trying to build under Windows? Don't know... there should be about 80 bytes of itcm memory left (out of 16k itcm memory pool) - it's really tight but it just fits.

You can try taking ITCM_CODE off the one big function in cpu.c and compile it. But you won't get the speed needed for really smooth operation.

Ntemis commented 1 year ago

Linux demetris-TA770E3 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux You should update to the latest devkitpro version that is using gcc 13.1

wavemotion-dave commented 1 year ago

According to the devkitpro-Pacman scripts, I'm running the latest version.

devkitpro-pacman is already the newest version (6.0.1-2).

But yes, I am running an older compiler: gcc 11.3

To be honest, I couldn't imagine switching to something that bloats out another 2.5k of valuable ITCM memory. Given how hand-optimized the code is now, my recommendation is that you downgrade to match my setup:

devkitpro-pacman version 6.0.1-2 gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0

Or else you will have to figure out how to gut 2.5k of extra code created by the latest gcc that ended up in the fast instruction cache. Feel free to branch and have at it! In the meantime, I'll document the required versions to build it 1:1 with my setup and close this.

Ntemis commented 1 year ago

demetris@demetris-TA770E3:~$ sudo dkp-pacman -Ss nds-dev dkp-libs/default-arm7 0.7.4-7 (nds-dev) [installed] Nintendo DS library. dkp-libs/devkitarm-cmake 1.2.1-1 (gp32-dev gp2x-dev gba-dev nds-dev 3ds-dev) [installed] CMake support files for devkitARM dkp-libs/devkitarm-crtls 1.2.1-1 (gba-dev gp32-dev nds-dev 3ds-dev) [installed] devkitARM crtls. dkp-libs/dswifi 0.4.2-1 (nds-dev) [installed] Nintendo DS wifi library. dkp-libs/libfat-nds 1.1.5-1 (nds-dev) [installed] Nintendo NDS FAT library. dkp-libs/libfilesystem 0.9.14-2 (nds-dev) [installed] Nintendo DS filesystem support library. dkp-libs/libnds 1.8.2-1 (nds-dev) [installed] Nintendo DS library. dkp-libs/maxmod-nds 1.0.15-1 (nds-dev) [installed] Nintendo NDS Audio library. dkp-libs/nds-cmake 1.2.0-1 (nds-dev) CMake support for Nintendo DS dkp-libs/nds-examples 20200727-1 (nds-dev) [installed] Nintendo NDS example code. dkp-libs/nds-pkg-config 0.28-4 (nds-dev) [installed] pkg-config wrapper (for Nintendo DS homebrew development) dkp-linux/devkit-env 1.0.1-2 (gp32-dev gba-dev nds-dev 3ds-dev gamecube-dev wii-dev wiiu-dev switch-dev) [installed] environment settings for devkitPro supplied tools dkp-linux/devkitARM r61-5 (gp32-dev gp2x-dev gba-dev nds-dev 3ds-dev) [installed] Toolchain for gp2x, gp32, Nintendo gba, nds, dsi, (3)ds & switch homebrew development dkp-linux/devkitARM-gdb 13.1-1 (gp32-dev gba-dev nds-dev 3ds-dev) [installed] gnu debugger for devkitARM dkp-linux/dstools 1.3.0-1 (nds-dev) [installed] ds tools dkp-linux/general-tools 1.2.0-2 (gp32-dev gp2x-dev gba-dev nds-dev 3ds-dev switch-dev gamecube-dev wii-dev wiiu-dev) [installed] Tools for homebrew development) dkp-linux/grit 0.9.2-1 (nds-dev gba-dev) [installed] Game Raster Image Transmogrifier dkp-linux/mmutil 1.10.1-1 (nds-dev gba-dev) [installed] maxmod conversion utility dkp-linux/ndstool 2.2.0-2 (nds-dev) [installed] Nintendo DS rom creation tool