diff --git a/asoft_presenter/Makefile b/asoft_presenter/Makefile index dddf4586..5295c65f 100644 --- a/asoft_presenter/Makefile +++ b/asoft_presenter/Makefile @@ -13,7 +13,7 @@ TEST: test.bas ../tokenize_asoft < test.bas > TEST test.bas: generate_presentation - ./generate_presentation > test.bas + ./generate_presentation test > test.bas generate_presentation: generate_presentation.o $(CC) $(LFLAGS) -o generate_presentation generate_presentation.o diff --git a/asoft_presenter/generate_presentation.c b/asoft_presenter/generate_presentation.c index 726b861a..f155b57e 100644 --- a/asoft_presenter/generate_presentation.c +++ b/asoft_presenter/generate_presentation.c @@ -1,23 +1,26 @@ #include #include +#include static void generate_keyhandler(void) { printf("9000 REM ******************\n"); - printf("9003 REM * GET KEYPRESSES *\n"); - printf("9005 REM ******************\n"); + printf("9002 REM * GET KEYPRESSES *\n"); + printf("9004 REM ******************\n"); + + printf("9006 N%%=1\n"); /* memory location -16384 holds keyboard strobe */ /* Loop until a key is pressed. */ - printf("9005 X=PEEK(-16384): IF X < 128 THEN 9005\n"); + printf("9008 X=PEEK(-16384): IF X < 128 THEN 9008\n"); /* get the key value, convert to ASCII */ printf("9010 X=PEEK(-16368)-128\n"); - /* Exit if escape pressed */ - printf("9020 IF X=27 THEN END\n"); + /* Exit if escape or Q pressed */ + printf("9020 IF X=27 OR X=81 THEN END\n"); /* increment page count if space or -> */ - printf("9030 IF X=21 OR X=32 THEN P%%=P%%+1\n"); + printf("9030 IF X=21 OR X=32 THEN P%%=P%%+1:N%%=3\n"); /* decrement page count if <- */ - printf("9040 IF X=8 THEN P%%=P%%-1\n"); + printf("9040 IF X=8 THEN P%%=P%%-1:N%%=2\n"); /* keep from going off the end */ printf("9050 IF P%%>TP%% THEN P%%=TP%%\n"); printf("9060 IF P%%<0 THEN P%%=0\n"); @@ -33,7 +36,7 @@ static void generate_footer(char *left, char *center, int cols) { printf("10001 REM * PRINT FOOTER *\n"); printf("10002 REM ****************\n"); /* make text black on white; move to bottom line */ - printf("10003 INVERSE : VTAB 24\n"); + printf("10003 HOME: INVERSE : VTAB 24\n"); printf("10005 X$=STR$(P%%)+\"/\":X$=X$+STR$(TP%%)\n"); printf("10007 L%%=LEN(X$)\n"); @@ -66,15 +69,143 @@ static void generate_footer(char *left, char *center, int cols) { printf("10030 RETURN\n"); } +static void print_line(unsigned char c, int num) { + + int i; + + for(i=0;i