Use the Apple //e enhanced target and use some features from that .h file

This commit is contained in:
Jeremy Rand 2014-07-23 16:26:55 -05:00
parent 16b96a515c
commit 0342f9a18c
2 changed files with 15 additions and 6 deletions

View File

@ -12,7 +12,7 @@ C_OBJS=$(SRCS:.c=.o)
ASM_OBJS=$(ASM:.s=.o) ASM_OBJS=$(ASM:.s=.o)
OBJS=$(C_OBJS) $(ASM_OBJS) OBJS=$(C_OBJS) $(ASM_OBJS)
PLATFORM=apple2 PLATFORM=apple2enh
PLATFORM_CFG=-C apple2-system.cfg PLATFORM_CFG=-C apple2-system.cfg

View File

@ -1,3 +1,12 @@
/*
* File: apple2048.c
* Author: Jeremy Rand
* Date: July 23, 2014
*
* This file contains the entry point for the 2048 game.
*/
#include <apple2enh.h>
#include <conio.h> #include <conio.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -105,29 +114,29 @@ void handleNextEvent(void)
switch (ch) { switch (ch) {
case 'i': case 'i':
case 'I': case 'I':
case 11: // Up arrow case CH_CURS_UP:
slideInDirection(DIR_UP); slideInDirection(DIR_UP);
return; return;
case 'j': case 'j':
case 'J': case 'J':
case 8: // Left arrow case CH_CURS_LEFT:
slideInDirection(DIR_LEFT); slideInDirection(DIR_LEFT);
return; return;
case 'k': case 'k':
case 'K': case 'K':
case 21: // Right arrow case CH_CURS_RIGHT:
slideInDirection(DIR_RIGHT); slideInDirection(DIR_RIGHT);
return; return;
case 'm': case 'm':
case 'M': case 'M':
case 10: // Up arrow case CH_CURS_DOWN:
slideInDirection(DIR_DOWN); slideInDirection(DIR_DOWN);
return; return;
case 27: // Escape case CH_ESC:
case 'q': case 'q':
case 'Q': case 'Q':
exit(0); exit(0);