From e242680690f76b29e37929de488515cfd3538401 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 11 Aug 2021 21:45:31 -0400 Subject: [PATCH] peasant: split off title from main exe --- games/peasant/Makefile | 14 ++++++- games/peasant/graphics/Makefile | 8 +--- .../peasant_title.png | Bin .../{graphics => graphics_title}/tips.png | Bin games/peasant/peasant.s | 37 ++--------------- games/peasant/qload.s | 30 +++++++------- games/peasant/title.s | 38 +++++++++++++++++- games/peasant/zp.inc | 32 +++++++++++++++ 8 files changed, 102 insertions(+), 57 deletions(-) rename games/peasant/{graphics => graphics_title}/peasant_title.png (100%) rename games/peasant/{graphics => graphics_title}/tips.png (100%) create mode 100644 games/peasant/zp.inc diff --git a/games/peasant/Makefile b/games/peasant/Makefile index f44aca7d..c6f3a408 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -8,7 +8,7 @@ EMPTY_DISK = ../../empty_disk all: peasant.dsk -peasant.dsk: QBOOT QLOAD INTRO PEASANT +peasant.dsk: QBOOT QLOAD INTRO TITLE PEASANT cp $(EMPTY_DISK)/empty.dsk peasant.dsk # $(DOS33) -y peasant.dsk BSAVE -a 0x6000 PEASANT $(DOS33_RAW) peasant.dsk 0 0 QBOOT 0 1 @@ -16,7 +16,8 @@ peasant.dsk: QBOOT QLOAD INTRO PEASANT $(DOS33_RAW) peasant.dsk 0 4 QBOOT 2 1 $(DOS33_RAW) peasant.dsk 1 0 QLOAD 0 0 $(DOS33_RAW) peasant.dsk 3 0 INTRO 0 0 - $(DOS33_RAW) peasant.dsk 10 0 PEASANT 0 0 + $(DOS33_RAW) peasant.dsk 10 0 TITLE 0 0 + $(DOS33_RAW) peasant.dsk 17 0 PEASANT 0 0 ### @@ -52,6 +53,15 @@ intro.o: intro.s decompress_fast_v2.s hgr_overlay.s \ ### +TITLE: title.o + ld65 -o TITLE title.o -C $(LINKER_SCRIPTS)/apple2_6000.inc + +title.o: title.s graphics_title/title_graphics.inc \ + title.s directions.s + ca65 -o title.o title.s -l title.lst + +### + PEASANT: peasant.o ld65 -o PEASANT peasant.o -C $(LINKER_SCRIPTS)/apple2_6000.inc diff --git a/games/peasant/graphics/Makefile b/games/peasant/graphics/Makefile index 424a8bd1..1b921505 100644 --- a/games/peasant/graphics/Makefile +++ b/games/peasant/graphics/Makefile @@ -9,8 +9,6 @@ all: graphics.inc graphics.inc: \ - peasant_title.lzsa \ - tips.lzsa \ cottage.lzsa \ lake_e.lzsa \ lake_w.lzsa \ @@ -18,9 +16,7 @@ graphics.inc: \ knight.lzsa \ trogdor.lzsa \ game_over.lzsa - echo "title_lzsa: .incbin \"peasant_title.lzsa\"" > graphics.inc - echo "tips_lzsa: .incbin \"tips.lzsa\"" >> graphics.inc - echo "cottage_lzsa: .incbin \"cottage.lzsa\"" >> graphics.inc + echo "cottage_lzsa: .incbin \"cottage.lzsa\"" > graphics.inc echo "lake_w_lzsa: .incbin \"lake_w.lzsa\"" >> graphics.inc echo "lake_e_lzsa: .incbin \"lake_e.lzsa\"" >> graphics.inc echo "river_lzsa: .incbin \"river.lzsa\"" >> graphics.inc @@ -116,5 +112,5 @@ game_over.hgr: game_over.png clean: - rm -f *~ outline.inc *.lzsa *.gr *.hgr + rm -f *~ graphics.inc *.lzsa *.gr *.hgr diff --git a/games/peasant/graphics/peasant_title.png b/games/peasant/graphics_title/peasant_title.png similarity index 100% rename from games/peasant/graphics/peasant_title.png rename to games/peasant/graphics_title/peasant_title.png diff --git a/games/peasant/graphics/tips.png b/games/peasant/graphics_title/tips.png similarity index 100% rename from games/peasant/graphics/tips.png rename to games/peasant/graphics_title/tips.png diff --git a/games/peasant/peasant.s b/games/peasant/peasant.s index c50abf8d..06e46cae 100644 --- a/games/peasant/peasant.s +++ b/games/peasant/peasant.s @@ -5,43 +5,16 @@ ; with apologies to everyone .include "hardware.inc" - -NIBCOUNT = $09 -GBASL = $26 -GBASH = $27 -CURSOR_X = $62 -CURSOR_Y = $63 -HGR_COLOR = $E4 -P0 = $F1 -P1 = $F2 -P2 = $F3 -P3 = $F4 -P4 = $F5 -P5 = $F6 - -INL = $FC -INH = $FD -OUTL = $FE -OUTH = $FF +.include "zp.inc" -hgr_display: + +peasant_quest: + jsr HGR2 ; Hi-res graphics, no text at bottom ; Y=0, A=0 after this called - ;************************ - ; Title - ;************************ - - jsr title - - - ;************************ - ; Tips - ;************************ - - jsr directions ;************************ ; Cottage @@ -88,8 +61,6 @@ forever: .include "decompress_fast_v2.s" .include "wait_keypress.s" -.include "title.s" -.include "directions.s" .include "cottage.s" .include "lake_w.s" .include "lake_e.s" diff --git a/games/peasant/qload.s b/games/peasant/qload.s index 4abd278e..3141c70f 100644 --- a/games/peasant/qload.s +++ b/games/peasant/qload.s @@ -1,20 +1,22 @@ ; Loader for MIST -;.include "zp.inc" +.include "zp.inc" LOAD_TEXT_TITLE = 16 ; ??? LOAD_FIRST_SECTOR = 22 ; ??? tmpsec = $3C -WHICH_LOAD=$80 -WHICH_SLOT=$DA -CURRENT_DISK=$DC -OUTL = $FE -OUTH = $FF +;WHICH_LOAD=$80 +;WHICH_SLOT=$DA +;CURRENT_DISK=$DC +;OUTL = $FE +;OUTH = $FF -LOAD_INTRO = 0 -LOAD_PEASANT = 1 +;LOAD_INTRO = 0 +;LOAD_TITLE = 1 +;LOAD_PEASANT = 2 +;LOAD_ENDING = 3 .include "hardware.inc" @@ -40,7 +42,7 @@ qload_start: jsr $6000 - lda #LOAD_PEASANT ; load peasant + lda #LOAD_TITLE ; load title sta WHICH_LOAD main_game_loop: @@ -192,7 +194,7 @@ error_string: which_disk_array: - .byte 1,1,3,3 ; INTRO, PEASANT + .byte 1,1,1,1 ; INTRO, TITLE, PEASANT. ENDING .byte 1,1,3,2 ; .byte 2,1,2,2 ; .byte 1,1,1,3 ; @@ -201,7 +203,7 @@ which_disk_array: .byte $f ; load_address_array: - .byte $60,$60,$40,$40 ; INTRO, PEASANT + .byte $60,$60,$60,$60 ; INTRO, TITLE, PEASANT, ENDING .byte $40,$40,$40,$40 ; .byte $40,$40,$40,$40 ; .byte $40,$40,$40,$40 ; @@ -211,7 +213,7 @@ load_address_array: .byte $08 ; track_array: - .byte 3,10, 1,21 ; INTRO, PEASANT + .byte 3,10,17,24 ; INTRO, TITLE, PEASANT, ENDING .byte 18,31,11, 1 ; .byte 27,26,10,20 ; .byte 30,32,28,30 ; @@ -220,7 +222,7 @@ track_array: .byte 0 ; sector_array: - .byte 0, 0, 0, 0 ; INTRO, PEASANT + .byte 0, 0, 0, 0 ; INTRO, TITLE, PEASANT, ENDING .byte 0, 8, 0, 0 ; .byte 0, 0, 0, 0 ; .byte 0,13, 0, 1 ; @@ -229,7 +231,7 @@ sector_array: .byte 0 ; length_array: - .byte 88, 88,157,145 ; INTRO, PEASANT + .byte 88, 88,88,88 ; INTRO, TITLE, PEASANT, ENDING .byte 128, 20,158,135 ; .byte 61, 31,159,109 ; .byte 20, 33, 27, 78 ; diff --git a/games/peasant/title.s b/games/peasant/title.s index ad41bada..34b40daa 100644 --- a/games/peasant/title.s +++ b/games/peasant/title.s @@ -1,10 +1,20 @@ -; o/~ Burnintating the Peasants o/~ +; o/~ It's the Title Screen, Yes it's the Title Screen o/~ +; by Vince `deater` Weaver vince@deater.net + +.include "hardware.inc" +.include "zp.inc" + + +title: + jsr HGR2 ; Hi-res graphics, no text at bottom + ; Y=0, A=0 after this called ;************************ ; Title ;************************ -title: + +do_title: lda #<(title_lzsa) sta getsrc_smc+1 lda #>(title_lzsa) @@ -16,4 +26,28 @@ title: jsr wait_until_keypress + + ;************************ + ; Tips + ;************************ + + jsr directions + + + lda #LOAD_PEASANT + sta WHICH_LOAD + + rts + + + + +.include "decompress_fast_v2.s" +.include "wait_keypress.s" + +.include "directions.s" + +.include "hgr_font.s" + +.include "graphics_title/title_graphics.inc" diff --git a/games/peasant/zp.inc b/games/peasant/zp.inc new file mode 100644 index 00000000..b791139d --- /dev/null +++ b/games/peasant/zp.inc @@ -0,0 +1,32 @@ +NIBCOUNT = $09 + +GBASL = $26 +GBASH = $27 + +CURSOR_X = $62 +CURSOR_Y = $63 + +WHICH_LOAD=$80 + +WHICH_SLOT = $DA +CURRENT_DISK = $DC +HGR_COLOR = $E4 + + +P0 = $F1 +P1 = $F2 +P2 = $F3 +P3 = $F4 +P4 = $F5 +P5 = $F6 + +INL = $FC +INH = $FD +OUTL = $FE +OUTH = $FF + +LOAD_INTRO = 0 +LOAD_TITLE = 1 +LOAD_PEASANT = 2 +LOAD_ENDING = 3 +