From bc86b41d5bc7fc71b756d22963ef30745e8849b0 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 10 Aug 2021 01:09:35 -0400 Subject: [PATCH] peasant: hook up the text generation --- games/peasant/Makefile | 3 +- games/peasant/directions.s | 52 ++++++++++++++++++++++++++++++++++ games/peasant/peasant.s | 35 +++++++++++++++-------- linker_scripts/apple2_6000.inc | 2 +- 4 files changed, 78 insertions(+), 14 deletions(-) create mode 100644 games/peasant/directions.s diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 6a7143ad..940e3dfa 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -24,7 +24,8 @@ HELLO: hello.bas PEASANT: peasant.o ld65 -o PEASANT peasant.o -C $(LINKER_SCRIPTS)/apple2_6000.inc -peasant.o: peasant.s graphics/graphics.inc +peasant.o: peasant.s graphics/graphics.inc \ + directions.s ca65 -o peasant.o peasant.s -l peasant.lst ### diff --git a/games/peasant/directions.s b/games/peasant/directions.s new file mode 100644 index 00000000..484c682b --- /dev/null +++ b/games/peasant/directions.s @@ -0,0 +1,52 @@ + + ;************************ + ; Tips + ;************************ +directions: + lda #<(tips_lzsa) + sta getsrc_smc+1 + lda #>(tips_lzsa) + sta getsrc_smc+2 + + lda #$40 + + jsr decompress_lzsa2_fast + + lda #directions_text + sta OUTH + + ldx #15 +directions_loop: + txa + pha + + jsr hgr_put_string + + pla + tax + dex + bne directions_loop + + jsr wait_until_keypress + + rts + +directions_text: + ;0123456789012345678901234567890123456789 +.byte 4,46,"Here's how things work round here:",0 +.byte 0,60,"-Look around by typing stuff like",0 +.byte 1,69,"'look tree' or just plain 'look'",0 +.byte 0,78,"-Talk to folks by typing stuff like",0 +.byte 1,87,"'talk man'",0 +.byte 0,96,"-Take items by typing 'get (item)'",0 +.byte 0,105,"-Use items by typing 'use (item)' You",0 +.byte 1,114,"can also 'give (item)' 'throw (item)'",0 +.byte 1,123,"or some other action words",0 +.byte 0,132,"-Type 'inv' to see your INVENTORY",0 +.byte 0,141,"-Type 'save' to save your game and",0 +.byte 1,150,"'load' to load one.",0 +.byte 0,159,"-press + and - to speed up or slow down",0 +.byte 1,168,"your character",0 +.byte 7,180,"click anywheres to start game",0 diff --git a/games/peasant/peasant.s b/games/peasant/peasant.s index 4057639f..0b1112ee 100644 --- a/games/peasant/peasant.s +++ b/games/peasant/peasant.s @@ -7,6 +7,23 @@ .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 + hgr_display: @@ -48,17 +65,7 @@ hgr_display: ; Tips ;************************ - lda #<(tips_lzsa) - sta getsrc_smc+1 - lda #>(tips_lzsa) - sta getsrc_smc+2 - - lda #$40 - - jsr decompress_lzsa2_fast - - jsr wait_until_keypress - + jsr directions ;************************ ; Cottage @@ -76,6 +83,7 @@ hgr_display: jsr wait_until_keypress +.if 0 ;************************ ; Lake West ;************************ @@ -138,7 +146,7 @@ hgr_display: jsr wait_until_keypress - +.endif forever: jmp forever @@ -147,4 +155,7 @@ forever: .include "decompress_fast_v2.s" .include "wait_keypress.s" +.include "directions.s" +.include "hgr_font.s" + .include "graphics/graphics.inc" diff --git a/linker_scripts/apple2_6000.inc b/linker_scripts/apple2_6000.inc index b791e52a..1b80c5d5 100644 --- a/linker_scripts/apple2_6000.inc +++ b/linker_scripts/apple2_6000.inc @@ -1,6 +1,6 @@ MEMORY { ZP: start = $00, size = $1A, type = rw; - RAM: start = $6000, size = $4000, file = %O; + RAM: start = $6000, size = $6000, file = %O; } SEGMENTS {