diff --git a/space_bars/Makefile b/space_bars/Makefile index 8121e24f..85971cdd 100644 --- a/space_bars/Makefile +++ b/space_bars/Makefile @@ -14,7 +14,8 @@ space_bars.dsk: SPACE_BARS SPACE_BARS: space_bars.o ld65 -o SPACE_BARS space_bars.o -C ../linker_scripts/apple2_1000.inc -space_bars.o: space_bars.s instructions.s gr_copy.s text_print.s title.s \ +space_bars.o: space_bars.s instructions.s game.s \ + game_over.s gr_copy.s text_print.s title.s \ spacebars_title.inc ca65 -o space_bars.o space_bars.s -l space_bars.lst diff --git a/space_bars/game.s b/space_bars/game.s new file mode 100644 index 00000000..498ce6ef --- /dev/null +++ b/space_bars/game.s @@ -0,0 +1,27 @@ + ;================================ + ; Show some instructions + ; return when a key is pressed + ;================================ + +game: + ;=================== + ; init screen + bit LORES + bit SET_GR + bit FULLGR + bit KEYRESET + + ;=================== + ; init vars + + lda #0 + sta DRAW_PAGE + + lda #0 + jsr clear_gr + + + jsr wait_until_keypressed ; tail call? + + rts + diff --git a/space_bars/game_over.s b/space_bars/game_over.s new file mode 100644 index 00000000..3ab10d8c --- /dev/null +++ b/space_bars/game_over.s @@ -0,0 +1,35 @@ + ;================================ + ; Print Game Over + ;================================ + +game_over: + ;=================== + ; init screen + jsr TEXT + jsr HOME + bit KEYRESET + + ;=================== + ; init vars + + lda #0 + sta DRAW_PAGE + + lda #game_over_text + sta OUTH + + jsr move_and_print + + jsr wait_until_keypressed ; tail call? + + rts + +; 0 1 2 3 +; 0123456789012345678901234567890123456789 +game_over_text: + +.byte 11, 10, "*** GAME OVER ***",0 + + diff --git a/space_bars/space_bars.dsk b/space_bars/space_bars.dsk index ac820260..edcba382 100644 Binary files a/space_bars/space_bars.dsk and b/space_bars/space_bars.dsk differ diff --git a/space_bars/space_bars.s b/space_bars/space_bars.s index 09ddee9f..1134bafa 100644 --- a/space_bars/space_bars.s +++ b/space_bars/space_bars.s @@ -65,12 +65,16 @@ WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us ; Rasterbars ;================== + jsr game + ;================== ; Game Over ;================== -game_over: - jmp game_over + jsr game_over + +loop_forever: + jmp loop_forever @@ -122,7 +126,9 @@ gr_offsets: .include "gr_copy.s" .include "title.s" .include "instructions.s" +.include "game.s" .include "text_print.s" +.include "game_over.s" .include "spacebars_title.inc"