peasant: initial text box support

This commit is contained in:
Vince Weaver 2021-08-11 22:07:33 -04:00
parent e242680690
commit b763f51810
6 changed files with 139 additions and 8 deletions

View File

@ -66,6 +66,7 @@ PEASANT: peasant.o
ld65 -o PEASANT peasant.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
peasant.o: peasant.s graphics/graphics.inc \
draw_box.s hgr_rectangle.s hgr_font.s \
title.s directions.s \
cottage.s lake_w.s lake_e.s river.s knight.s \
ending.s

View File

@ -23,6 +23,13 @@ cottage:
jsr hgr_put_string
jsr draw_box
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string
jsr wait_until_keypress
rts
@ -33,10 +40,10 @@ peasant_text:
cottage_text1:
.byte 0,0,"YOU are Rather Dashing, a",0
.byte 0,0,"humble peasant living in",0
.byte 0,0,"the peasant kingdom of",0
.byte 0,0,"Peasantry.",0
.byte 9,35,"YOU are Rather Dashing, a",0
.byte 9,44,"humble peasant living in",0
.byte 9,53,"the peasant kingdom of",0
.byte 9,62,"Peasantry.",0
; wait a few seconds

105
games/peasant/draw_box.s Normal file
View File

@ -0,0 +1,105 @@
;========================
; draw dialog box
;========================
draw_box:
; draw rectangle
lda #$33
sta VGI_RCOLOR
lda #53
sta VGI_RX1
lda #24
sta VGI_RY1
lda #200
sta VGI_RXRUN
lda #58
sta VGI_RYRUN
jsr vgi_simple_rectangle
; draw lines
ldx #2 ; purple
lda COLORTBL,X
sta HGR_COLOR
ldy #0
ldx #59
lda #29
jsr HPLOT0 ; plot at (Y,X), (A)
ldx #0
lda #59
ldy #78
jsr HGLIN ; line to (X,A),(Y)
ldy #0
ldx #247
lda #29
jsr HPLOT0 ; plot at (Y,X), (A)
ldx #0
lda #247
ldy #78
jsr HGLIN ; line to (X,A),(Y)
ldy #0
ldx #57
lda #29
jsr HPLOT0 ; plot at (Y,X), (A)
ldx #0
lda #249
ldy #29
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda #249
ldy #78
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda #57
ldy #78
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda #57
ldy #29
jsr HGLIN ; line to (X,A),(Y)
ldy #0
ldx #58
lda #30
jsr HPLOT0 ; plot at (Y,X), (A)
ldx #0
lda #248
ldy #30
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda #248
ldy #77
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda #58
ldy #77
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda #58
ldy #30
jsr HGLIN ; line to (X,A),(Y)
rts

View File

@ -254,9 +254,7 @@ swap_done:
; make /7 %7 tables
;=====================
vgi_init:
vgi_make_tables:
hgr_make_tables:
ldy #0
lda #0

View File

@ -12,6 +12,8 @@
peasant_quest:
jsr hgr_make_tables
jsr HGR2 ; Hi-res graphics, no text at bottom
; Y=0, A=0 after this called
@ -22,7 +24,6 @@ peasant_quest:
jsr cottage
;************************
; Lake West
;************************
@ -69,5 +70,7 @@ forever:
.include "ending.s"
.include "hgr_font.s"
.include "draw_box.s"
.include "hgr_rectangle.s"
.include "graphics/graphics.inc"

View File

@ -1,5 +1,14 @@
NIBCOUNT = $09
TEMP0 = $10
TEMP1 = $11
TEMP2 = $12
TEMP3 = $13
TEMP4 = $14
TEMP5 = $15
HGR_BITS = $1C
GBASL = $26
GBASH = $27
@ -30,3 +39,11 @@ LOAD_TITLE = 1
LOAD_PEASANT = 2
LOAD_ENDING = 3
VGI_RCOLOR = P0
VGI_RX1 = P1
VGI_RY1 = P2
VGI_RXRUN = P3
VGI_RYRUN = P4
VGI_RCOLOR2 = P5 ; only for dither
COUNT = TEMP5