peasant: box now paramaterizable

This commit is contained in:
Vince Weaver 2021-08-12 00:42:12 -04:00
parent 4246c3d5cc
commit f62cab9038
3 changed files with 103 additions and 68 deletions

View File

@ -23,7 +23,22 @@ cottage:
jsr hgr_put_string
lda #0
sta BOX_X1H
lda #53
sta BOX_X1L
lda #24
sta BOX_Y1
lda #0
sta BOX_X2H
lda #253
sta BOX_X2L
lda #82
sta BOX_Y2
jsr draw_box
jsr hgr_put_string
jsr hgr_put_string
jsr hgr_put_string

View File

@ -1,105 +1,116 @@
;========================
; draw dialog box
;========================
; from X1H:X1L,Y1 to X2H:X2L, Y2
; FIXME: X1H/X2H mostly ignored
draw_box:
; draw rectangle
lda #$33
lda #$33 ; color is white1
sta VGI_RCOLOR
lda #53
lda BOX_X1L
sta VGI_RX1
lda #24
lda BOX_Y1
sta VGI_RY1
lda #200
sec
lda BOX_X2L
sbc BOX_X1L
sta VGI_RXRUN
lda #58
sec
lda BOX_Y2
sbc BOX_Y1
sta VGI_RYRUN
jsr vgi_simple_rectangle
; draw lines
ldx #2 ; purple
ldx #2 ; color is purple
lda COLORTBL,X
sta HGR_COLOR
ldy #0
ldx #59
lda #29
jsr HPLOT0 ; plot at (Y,X), (A)
; draw outer rectangle, x+6, y+5 x-6, y-5
ldx #0
lda #59
ldy #78
jsr HGLIN ; line to (X,A),(Y)
clc
lda BOX_X1L
adc #6
sta BOX_X1L
ldy #0
ldx #247
lda #29
jsr HPLOT0 ; plot at (Y,X), (A)
sec
lda BOX_X2L
sbc #6
sta BOX_X2L
ldx #0
lda #247
ldy #78
jsr HGLIN ; line to (X,A),(Y)
clc
lda BOX_Y1
adc #5
sta BOX_Y1
sec
lda BOX_Y2
sbc #5
sta BOX_Y2
jsr draw_rectangle
ldy #0
ldx #57
lda #29
jsr HPLOT0 ; plot at (Y,X), (A)
; draw inner rectangle, x+7, y+6 x-7, y-6
ldx #0
lda #249
ldy #29
jsr HGLIN ; line to (X,A),(Y)
inc BOX_X1L
dec BOX_X2L
inc BOX_Y1
dec BOX_Y2
ldx #0
lda #249
ldy #78
jsr HGLIN ; line to (X,A),(Y)
jsr draw_rectangle
ldx #0
lda #57
ldy #78
jsr HGLIN ; line to (X,A),(Y)
; make vertical line extra thick
ldx #0
lda #57
ldy #29
jsr HGLIN ; line to (X,A),(Y)
inc BOX_X1L
dec BOX_X2L
jsr draw_rectangle
; make vertical line extra thick
ldy #0
ldx #58
lda #30
jsr HPLOT0 ; plot at (Y,X), (A)
inc BOX_X1L
dec BOX_X2L
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)
jsr draw_rectangle
rts
draw_rectangle:
ldy #0
ldx BOX_X1L
lda BOX_Y1
jsr HPLOT0 ; plot at (Y,X), (A)
ldx #0
lda BOX_X2L
ldy BOX_Y1
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda BOX_X2L
ldy BOX_Y2
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda BOX_X1L
ldy BOX_Y2
jsr HGLIN ; line to (X,A),(Y)
ldx #0
lda BOX_X1L
ldy BOX_Y1
jsr HGLIN ; line to (X,A),(Y)
rts

View File

@ -17,7 +17,16 @@ CURSOR_Y = $63
WHICH_LOAD=$80
INPUT_X = $D0
; D0-D? used by HGR?
INPUT_X = $C0
BOX_X1L = $C1
BOX_X1H = $C2
BOX_Y1 = $C3
BOX_X2L = $C4
BOX_X2H = $C5
BOX_Y2 = $C6
WHICH_SLOT = $DA
CURRENT_DISK = $DC
HGR_COLOR = $E4