tangstad/helds
tangstad
/
helds
Archived
1
0
Fork 0

Updated source to compile with libgba-20060720.

This commit is contained in:
Truls Alexander Tangstad 2007-03-09 15:04:07 +00:00
parent c49e177fa6
commit 94627af503
1 changed files with 12 additions and 12 deletions

View File

@ -38,7 +38,7 @@ unsigned int frame;
void VblankInterrupt() void VblankInterrupt()
{ {
frame += 1; frame += 1;
ScanKeys(); scanKeys();
} }
class Smoke { class Smoke {
@ -168,10 +168,10 @@ int main(void)
OBJAFFINE *const oa_buffer = (OBJAFFINE*)oe_buffer; OBJAFFINE *const oa_buffer = (OBJAFFINE*)oe_buffer;
// Set up the interrupt handlers // Set up the interrupt handlers
InitInterrupt(); irqInit();
SetInterrupt( IE_VBL, VblankInterrupt); irqSet( IRQ_VBLANK, VblankInterrupt);
// Enable Vblank Interrupt to allow VblankIntrWait // Enable Vblank Interrupt to allow VblankIntrWait
EnableInterrupt(IE_VBL); irqEnable(IRQ_VBLANK);
// Allow Interrupts // Allow Interrupts
REG_IME = 1; REG_IME = 1;
// screen mode, background and objects to display // screen mode, background and objects to display
@ -194,29 +194,29 @@ int main(void)
Smoke smoke(NUMSMOKES, &oe_buffer[2], smoke_index); Smoke smoke(NUMSMOKES, &oe_buffer[2], smoke_index);
while (1) { while (1) {
if (KeysHeld() & KEY_RIGHT) { if (keysHeld() & KEY_RIGHT) {
red.rotate(-8); red.rotate(-8);
} else if (KeysHeld() & KEY_LEFT) { } else if (keysHeld() & KEY_LEFT) {
red.rotate(8); red.rotate(8);
} }
if (KeysHeld() & KEY_A) { if (keysHeld() & KEY_A) {
blue.rotate(-8); blue.rotate(-8);
} else if (KeysHeld() & KEY_B) { } else if (keysHeld() & KEY_B) {
blue.rotate(8); blue.rotate(8);
} }
if (KeysHeld() & KEY_L) { if (keysHeld() & KEY_L) {
red.speedup(); red.speedup();
} }
if (KeysHeld() & KEY_R) { if (keysHeld() & KEY_R) {
blue.speedup(); blue.speedup();
} }
if (!(KeysHeld() & KEY_L)) { if (!(keysHeld() & KEY_L)) {
red.slowdown(); red.slowdown();
} }
if (!(KeysHeld() & KEY_R)) { if (!(keysHeld() & KEY_R)) {
blue.slowdown(); blue.slowdown();
} }