Hello!
I don't know much about coding, especially not C, ASM or anything hardware related.
But I really, really need to finish a project before this week ends.
What I need to do is rewrite a small piece of the source rom for the GBA Slideshow Builder, I need it to change picture every second instead of using the buttons to manually advance the slides.
I've got Devkit Advance running, I can compile some things fine, but not the .bin I need to use for this.
There's a file called makefile.mak that I tried making into a .bat (read a tutorial on compiling for the gba), but that didn't work.
CFLAGS = -I c:\gba\include -c -g -O2 -mthumb-interwork -Wall -ffreestanding
ASFLAGS = -mthumb-interwork
LDFLAGS = -L c:\gba\lib -T gbarom2mb
all : ufgbass.bin
ufgbass.bin : ufgbass.elf
objcopy -v -O binary ufgbass.elf ufgbass.bin
ufgbass.elf : main.o
ld $(LDFLAGS) -o ufgbass.elf main.o
main.o : main.c
gcc $(CFLAGS) main.c
I don't know if this is for a different compiler or devkit or something, I have no idea at all.
I just know I need this project to be finished asap and would appreciate help.
And, I need the code to change the slides automatically.
I'm thinking I need to change these lines of code:
// react to joypad presses
while(1)
{
// copy current index
imgNew = imgCurrent;
if (!(PADREG & PAD_RIGHT)) imgNew++;
if (!(PADREG & PAD_LEFT)) imgNew--;
// wrap around if neccesary
if (imgNew < 0) imgNew = imgCount - 1;
if (imgNew >= imgCount) imgNew = 0;
// copy image
if (imgNew != imgCurrent)
{
waitVSync();
copyImage(pScreen, imageinfo.list->start[imgNew]);
imgCurrent = imgNew;
// wait keyDelay frames
for(keyDelayCount = keyDelay; keyDelayCount > 0; keyDelayCount--)
{
// next time use shorter delay
keyDelay = KEYREPEATDELAY;
waitVSync();
// both keys are released ?
if ((PADREG & PAD_RIGHT) && (PADREG & PAD_LEFT))
{
// use initial delay
keyDelay = KEYWAITDELAY;
// break from loop
break;
}
}
}
}
}
Here is a link to the program:
http://www.gameboy-advance.net/emulated
e_show.htm
Here is the sourcerom:
http://moire.se/sourcerom.zip
It would mean alot to me if I could get some help with this.