diff --git a/games/peasant/Makefile b/games/peasant/Makefile index c6f3a408..9449b70f 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -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 diff --git a/games/peasant/cottage.s b/games/peasant/cottage.s index 272779cb..fd12be12 100644 --- a/games/peasant/cottage.s +++ b/games/peasant/cottage.s @@ -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 diff --git a/games/peasant/draw_box.s b/games/peasant/draw_box.s new file mode 100644 index 00000000..093d437d --- /dev/null +++ b/games/peasant/draw_box.s @@ -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 diff --git a/games/peasant/hgr_rectangle.s b/games/peasant/hgr_rectangle.s index 09439f13..0a50f088 100644 --- a/games/peasant/hgr_rectangle.s +++ b/games/peasant/hgr_rectangle.s @@ -254,9 +254,7 @@ swap_done: ; make /7 %7 tables ;===================== -vgi_init: - -vgi_make_tables: +hgr_make_tables: ldy #0 lda #0 diff --git a/games/peasant/peasant.s b/games/peasant/peasant.s index 06e46cae..a2745651 100644 --- a/games/peasant/peasant.s +++ b/games/peasant/peasant.s @@ -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" diff --git a/games/peasant/zp.inc b/games/peasant/zp.inc index b791139d..9448abda 100644 --- a/games/peasant/zp.inc +++ b/games/peasant/zp.inc @@ -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