How to compile from source?

Use this forum to share and discuss Uzebox games and demos.
Post Reply
HolyCarHorn
Posts: 21
Joined: Wed Dec 11, 2013 4:03 pm

How to compile from source?

Post by HolyCarHorn »

Morning. I decided I wanted to try and mod one of the games as a starter to uzebox programming. I decided I wanted to fix a few of the glitches in "Donkey Kong" (that is: Being able to climb a ladder when your in mid air, not being able to jump fireballs, etc.) But I ran into a problem trying to compile it. My error was:

Code: Select all

make: *** No rule to make target `../kernel/uzeboxVideoEngineCore.s', needed by `uzeboxVideoEngineCore.o'.  Stop.
Any help would be appreciated!
User avatar
Janka
Posts: 214
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: How to compile from source?

Post by Janka »

This depends on the actual game sources. You usually have to edit the included makefile to point to the place where your uzebox kernel sources are - they are compiled into the game, but not shipped with it, remember?
HolyCarHorn
Posts: 21
Joined: Wed Dec 11, 2013 4:03 pm

Re: How to compile from source?

Post by HolyCarHorn »

Yeah sorry, my c programming experience isn't very large. The only experience I have is programming arduino's which (typically) only use one file.
Anywho I did what you said and it worked. At least partially.
Now I'm getting this:

Code: Select all

avr-gcc -I"/home/bolle/Uzebox_Source/kernel"  -mmcu=atmega644 -Wall -gdwarf-2 -std=gnu99 -DF_CPU=28636360UL -Os -fsigned-char -ffunction-sections -MD -MP -MT DonkeyKong.o -MF dep/DonkeyKong.o.d  -DVIDEO_MODE=3 -DINTRO_LOGO=0 -DSOUND_CHANNEL_4_ENABLE=0 -DSOUND_CHANNEL_2_ENABLE=1 -DSOUND_CHANNEL_3_ENABLE=1 -DMIXER_CHAN4_TYPE=1 -DMAX_SPRITES=16 -DRAM_TILES_COUNT=27 -DMIXER_WAVES=\"/home/bolle/Uzebox_Source/games/DonkeyKong/data/sounds.inc\" -c  ../DonkeyKong.c
In file included from ../DonkeyKong.c:377:0:
../data/levels.inc:9:13: error: variable ‘bgMaps’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
../DonkeyKong.c:416:7: error: variable ‘pgmEnemies’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
../DonkeyKong.c:429:5: error: variable ‘frameDurations’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
../DonkeyKong.c:444:4: error: variable ‘frameSequences’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
../DonkeyKong.c: In function ‘DKLoadHiScore’:
../DonkeyKong.c:2762:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
make: *** [DonkeyKong.o] Error 1
I did a bit of googling on it but I couldn't seem to find anything to fix it. Any ideas?
User avatar
Janka
Posts: 214
Joined: Fri Sep 21, 2012 10:46 pm
Location: inside Out

Re: How to compile from source?

Post by Janka »

I get the same error with avr-gcc 4.8. This compiler optimizes much different than previous versions of gcc and it is very picky about subtle programming errors like these. ALL of these const arrays need an additional "const"; even at the expense of e.g. having a const char* const, which the casual C programmer looks at with a raised brow.

Edit the sources and put "const" at the place where the compiler expects it. This is alright, all these are const because of PROGMEM.


EDIT: I see avr-gcc-4.8 seems to produce broken code with the Donkey Kong sources. Most likely because of optimizations, Paul has to look into this. Use an older version of avr-gcc in the meantime, 4.5.3 is fine.
Post Reply