peasant: hook up game over screen

no animation yet though
This commit is contained in:
Vince Weaver 2021-10-13 01:04:05 -04:00
parent aaeab984bf
commit 738a305897
9 changed files with 214 additions and 25 deletions

View File

@ -24,23 +24,20 @@ peasant.dsk: QBOOT QLOAD VID_LOGO TITLE INTRO \
$(DOS33_RAW) peasant.dsk 6 0 TITLE 0 0
$(DOS33_RAW) peasant.dsk 9 0 INTRO 0 0
$(DOS33_RAW) peasant.dsk 13 0 PEASANT1 0 0
$(DOS33_RAW) peasant.dsk 19 0 PEASANT2 0 0
$(DOS33_RAW) peasant.dsk 18 0 PEASANT2 0 0
$(DOS33_RAW) peasant.dsk 24 0 PEASANT3 0 0
$(DOS33_RAW) peasant.dsk 30 0 PEASANT4 0 0
peasant_side2.dsk: WBOOT2 COPY_CHECK TROGDOR ENDING CLIFF
peasant_side2.dsk: WBOOT2 COPY_CHECK TROGDOR ENDING CLIFF GAME_OVER
cp $(EMPTY_DISK)/empty.dsk peasant_side2.dsk
$(DOS33_RAW) peasant_side2.dsk 0 0 WBOOT2 0 1
$(DOS33_RAW) peasant_side2.dsk 1 0 COPY_CHECK 0 0
$(DOS33_RAW) peasant_side2.dsk 0 0 WBOOT2 0 1
$(DOS33_RAW) peasant_side2.dsk 1 0 COPY_CHECK 0 0
$(DOS33_RAW) peasant_side2.dsk 3 0 GAME_OVER 0 0
$(DOS33_RAW) peasant_side2.dsk 19 0 TROGDOR 0 0
$(DOS33_RAW) peasant_side2.dsk 24 0 ENDING 0 0
$(DOS33_RAW) peasant_side2.dsk 29 0 CLIFF 0 0
###
#HELLO: hello.bas
# $(TOKENIZE) < hello.bas > HELLO
###
@ -50,7 +47,6 @@ QBOOT: qboot_sector.o
qboot_sector.o: qboot_sector.s qboot_stage2.s
ca65 -o qboot_sector.o qboot_sector.s -l qboot_sector.lst
###
###
@ -208,6 +204,22 @@ cliff.o: cliff.s zp.inc \
peasant_move.s score.s
ca65 -o cliff.o cliff.s -l cliff.lst
###
GAME_OVER: game_over.o
ld65 -o GAME_OVER game_over.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
game_over.o: game_over.s zp.inc \
graphics_over/game_over_graphics.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_1x28_sprite_mask.s hgr_1x5_sprite.s hgr_save_restore.s \
wait_a_bit.s draw_peasant.s hgr_text_box.s \
keyboard.s parse_input.s new_map_location.s \
peasant_move.s score.s
ca65 -o game_over.o game_over.s -l game_over.lst
###
@ -319,15 +331,6 @@ copy_check.o: copy_check.s graphics_copy/copy_graphics.inc \
ca65 -o copy_check.o copy_check.s -l copy_check.lst
###
FONT_TEST: font_test.o
ld65 -o FONT_TEST font_test.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
font_test.o: font_test.s hgr_font.s hgr_1x8_sprite.s
ca65 -o font_test.o font_test.s -l font_test.lst
###
SAVE1: save1.o
@ -370,6 +373,9 @@ graphics_cliff/cliff_graphics.inc:
graphics_copy/copy_graphics.inc:
cd graphics_copy && make
graphics_over/game_over_graphics.inc:
cd graphics_over && make
graphics_trogdor/trogdor_graphics.inc:
cd graphics_trogdor && make
@ -395,13 +401,14 @@ distclean:
cd graphics_trogdor && make clean
cd graphics_end && make clean
cd graphics_cliff && make clean
cd graphics_over && make clean
###
clean:
rm -f *~ *.o *.lst HELLO VID_LOGO TITLE INTRO COPY_CHECK \
PEASANT1 PEASANT2 PEASANT3 PEASANT4 \
TROGDOR ENDING MUSIC
TROGDOR ENDING MUSIC GAME_OVER

134
games/peasant/game_over.s Normal file
View File

@ -0,0 +1,134 @@
; Game Over Screen
; by Vince `deater` Weaver vince@deater.net
.include "hardware.inc"
.include "zp.inc"
.include "qload.inc"
game_over:
lda #0
sta GAME_OVER
sta FRAME
jsr hgr_make_tables
jsr hgr2 ; Hi-res graphics, no text at bottom
; Y=0, A=0 after this called
; update score
jsr update_score
;===========================
; draw game over background
;===========================
lda #<game_over_lzsa
sta getsrc_smc+1
lda #>game_over_lzsa
sta getsrc_smc+2
lda #$40
jsr decompress_lzsa2_fast
; put peasant text
lda #<peasant_text
sta OUTL
lda #>peasant_text
sta OUTH
jsr hgr_put_string
; put score
jsr print_score
;=====================
; animate ending
; TODO
;=====================
; play music
; TODO
jsr wait_until_keypress
;=====================
; draw videlectrix
lda #<videlectrix_lzsa
sta getsrc_smc+1
lda #>videlectrix_lzsa
sta getsrc_smc+2
lda #$40
jsr decompress_lzsa2_fast
lda #<game_over_text
sta OUTL
lda #>game_over_text
sta OUTH
lda #8
sta CURSOR_X
lda #136
sta CURSOR_Y
jsr disp_put_string_cursor
jsr load_menu
rts
;forever:
; jmp forever
.include "wait_keypress.s"
;.include "draw_peasant.s"
;.include "gr_copy.s"
;.include "new_map_location.s"
;.include "peasant_move.s"
;.include "parse_input.s"
;.include "inventory.s"
.include "score.s"
;.include "keyboard.s"
.include "wait.s"
.include "wait_a_bit.s"
;.include "version.inc"
.include "loadsave_menu.s"
.include "graphics_over/game_over_graphics.inc"
game_over_text:
.byte "Thanks so much for playing",13
.byte "this game here! Don't get too",13
.byte "frustrated. Take some time",13
.byte "for yourself. Have a refreshing",13
.byte "coffee. Relax. Then come back",13
.byte "and try again maybe!",13
.byte " -The Videlectrix Guys",0

View File

@ -0,0 +1,42 @@
PNG2RLE = ../../../utils/gr-utils/png2rle
PNG2GR = ../../../utils/gr-utils/png2gr
PNG2HGR = ../../../utils/hgr-utils/png2hgr
LZSA = ~/research/lzsa/lzsa/lzsa
B2D = ../../../utils/bmp2dhr/b2d
all: game_over_graphics.inc
game_over_graphics.inc: \
game_over.lzsa \
videlectrix.lzsa
echo "game_over_lzsa: .incbin \"game_over.lzsa\"" > game_over_graphics.inc
echo "videlectrix_lzsa: .incbin \"videlectrix.lzsa\"" >> game_over_graphics.inc
###
videlectrix.lzsa: videlectrix.hgr
$(LZSA) -r -f2 videlectrix.hgr videlectrix.lzsa
videlectrix.hgr: videlectrix.png
$(PNG2HGR) videlectrix.png > videlectrix.hgr
###
game_over.lzsa: game_over.hgr
$(LZSA) -r -f2 game_over.hgr game_over.lzsa
game_over.hgr: game_over.png
$(PNG2HGR) game_over.png > game_over.hgr
###
clean:
rm -f *~ game_over_graphics.inc *.lzsa *.gr *.hgr

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -236,6 +236,11 @@ parse_dance:
;===================
parse_die:
lda #LOAD_GAME_OVER
sta WHICH_LOAD
lda #1
sta GAME_OVER
lda #<die_message
sta OUTL

View File

@ -196,7 +196,7 @@ which_disk_array:
.byte 1,1,1,2 ; VID_LOGO, TITLE, INTRO. COPY_CHECK
.byte 1,1,1,1 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4
.byte 2,2,1,2 ; TROGDOR, ENDING, MUSIC, CLIFF
.byte 1,1,1,1 ;
.byte 2,1,1,1 ; GAME_OVER
.byte 1 ;
.byte 1,1,1,1,1 ; SAVE1, SAVE2, SAVE3
.byte $f ; disk detect
@ -205,7 +205,7 @@ load_address_array:
.byte $60,$60,$60,$60 ; VID_LOGO, TITLE, INTRO, COPY_CHECK
.byte $60,$60,$60,$60 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4
.byte $60,$60,$D0,$60 ; TROGDOR, ENDING, MUSIC, CLIFF
.byte $40,$40,$40,$40 ;
.byte $60,$40,$40,$40 ; GAME_OVER
.byte $08 ;
.byte $BC,$BC,$BC,$0A ; SAVE1, SAVE2, SAVE3
.byte $0A ;
@ -213,9 +213,9 @@ load_address_array:
track_array:
.byte 4, 6, 9,1 ; VID_LOGO, TITLE, INTRO, COPY_CHECK
.byte 13,19,24,30 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4
.byte 13,18,24,30 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4
.byte 19,24, 3,29 ; TROGDOR, ENDING, MUSIC, CLIFF
.byte 30,32,28,30 ;
.byte 3,32,28,30 ; GAME_OVER
.byte 0 ;
.byte 0, 0, 0, 0, 0 ; SAVE1, SAVE2, SAVE3
.byte 0 ; disk detect
@ -224,7 +224,7 @@ sector_array:
.byte 0, 0, 0, 0 ; VID_LOGO, TITLE, INTRO, COPY_CHECK
.byte 0, 0, 0, 0 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4
.byte 0, 0, 0, 0 ; TROGDOR, ENDING, MUSIC, CLIFF
.byte 0,13, 0, 1 ;
.byte 0,13, 0, 1 ; GAME_OVER
.byte 6 ;
.byte 11,12,13,14,15 ; SAVE1, SAVE2, SAVE3
.byte 0 ; disk detect
@ -233,7 +233,7 @@ length_array:
.byte 32, 50, 60, 20 ; VID_LOGO, TITLE, INTRO, COPY_CHECK
.byte 80, 88, 88, 80 ; PEASANT1, PEASANT2, PEASANT3, PEASANT4
.byte 80, 80, 16, 80 ; TROGDOR, ENDING, MUSIC, CLIFF
.byte 20, 33, 27, 78 ;
.byte 16, 33, 27, 78 ; GAME_OVER
.byte 3 ;
.byte 1,1,1,1,1 ; SAVE1, SAVE2, SAVE3
.byte 1 ; disk detect

View File

@ -233,6 +233,7 @@ LOAD_TROGDOR = 8
LOAD_ENDING = 9
LOAD_MUSIC = 10
LOAD_CLIFF = 11
LOAD_GAME_OVER = 12
LOAD_SAVE1 = 17
LOAD_SAVE2 = 18