Standardize state label names a bit

This commit is contained in:
Joshua Bell 2017-10-07 20:22:39 -07:00
parent 33f2945f32
commit 6bd9738e90
10 changed files with 319 additions and 283 deletions

View File

@ -52,8 +52,8 @@ A2D_QUERY_SCREEN := $03 ; Get screen state
;; .word top
;; .addr addr A2D_SCREEN_ADDR
;; .word stride A2D_SCREEN_STRIDE
;; .word hoffset
;; .word voffset
;; .word hoff
;; .word voff
;; .word width 560-1
;; .word height 192-1
;; .res 8 pattern
@ -64,7 +64,7 @@ A2D_QUERY_SCREEN := $03 ; Get screen state
;; .byte hthick horizontal pen thickness
;; .byte vthick vertical pen thickness
;; .byte 0 ??? fill mode?
;; .byte tmsk AND mask for text, default $7F
;; .byte tmask AND mask for text, default $7F
;; .addr font A2D_DEFAULT_FONT
A2D_SET_STATE := $04 ; Set full drawing state
@ -73,8 +73,8 @@ A2D_SET_STATE := $04 ; Set full drawing state
;; .word top
;; .addr addr A2D_SCREEN_ADDR
;; .word stride A2D_SCREEN_STRIDE
;; .word hoffset pixels scrolled
;; .word voffset
;; .word hoff pixels scrolled
;; .word voff
;; .word width pixels
;; .word height
;; .res 8 pattern
@ -85,7 +85,7 @@ A2D_SET_STATE := $04 ; Set full drawing state
;; .byte hthick horizontal pen thickness
;; .byte vthick vertical pen thickness
;; .byte 0 ??? fill mode?
;; .byte tmsk AND mask for text, default $7F
;; .byte tmask AND mask for text, default $7F
;; .addr font A2D_DEFAULT_FONT
;; $05 used in DeskTop but not DAs - icon click
@ -97,14 +97,14 @@ A2D_SET_BOX := $06 ; Set just the drawing box, subset of full state
;; .word top
;; .addr addr A2D_SCREEN_ADDR ($2000)
;; .word stride A2D_SCREEN_STRIDE ($80)
;; .word hoffset pixels scrolled
;; .word voffset
;; .word hoff pixels scrolled
;; .word voff
;; .word width pixels
;; .word height
A2D_SET_FILL_MODE := $07
;; (input length 1 byte)
;; .byte mode 0 = normal, 6 = xor (<4, >=4)
;; .byte mode (>=4 also sets eor mask to $7f)
A2D_SET_PATTERN := $08
;; (input length 8 bytes)
@ -167,8 +167,8 @@ A2D_DRAW_BITMAP := $14 ; Draw pattern
;; .addr bitmap bitmap is 7 bits per byte, 0 = black, 1 = white
;; .byte stride bitmap width in bytes
;; .byte 0 ???
;; .word hoffset offset within bitmap definition
;; .word voffset
;; .word hoff offset within bitmap definition
;; .word voff
;; .word width pixels
;; .word height pixels
@ -258,8 +258,8 @@ A2D_CREATE_WINDOW := $38
;; .word top
;; .word screen_addr
;; .word screen_stride
;; .word hoffset pixels scrolled
;; .word voffset
;; .word hoff pixels scrolled
;; .word voff
;; .word width pixels
;; .word height
;; .res 8 pattern
@ -270,7 +270,7 @@ A2D_CREATE_WINDOW := $38
;; .byte hthick
;; .byte vthick
;; .byte 0 ??? fill mode?
;; .byte tmsk AND mask for text, default $7F
;; .byte tmask AND mask for text, default $7F
;; .addr font A2D_DEFAULT_FONT
;; .addr next address of next lower window in stack (filled in by call)
@ -413,7 +413,7 @@ A2D_CZP_OVERWRITE := 0
;;; Used in various state blocks
A2D_DEFAULT_MSKAND := $FF
A2D_DEFAULT_MSKOR := $00
A2D_DEFAULT_TMSK := $7F
A2D_DEFAULT_TMASK := $7F
;;; ==================================================

View File

@ -19,8 +19,8 @@ The _box_ block is reused in several places. It has the following structure:
.word top pixels from screen top edge
.addr addr A2D_SCREEN_ADDR ($2000)
.word stride A2D_SCREEN_STRIDE ($80)
.word hoffset pixels scrolled left
.word voffset pixels scrolled up
.word hoff pixels scrolled left
.word voff pixels scrolled up
.word width pixels wide
.word height pixels tall
```

View File

@ -242,8 +242,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte 'c'
@ -257,8 +257,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte 'e'
@ -272,8 +272,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '='
@ -287,8 +287,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '*'
@ -302,8 +302,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '7'
@ -317,8 +317,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '8'
@ -332,8 +332,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '9'
@ -347,8 +347,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '/'
@ -362,8 +362,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '4'
@ -377,8 +377,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '5'
@ -392,8 +392,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '6'
@ -407,8 +407,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '-'
@ -422,8 +422,8 @@ top: .word row4_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '1'
@ -437,8 +437,8 @@ top: .word row4_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '2'
@ -452,8 +452,8 @@ top: .word row4_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '3'
@ -467,8 +467,8 @@ top: .word row5_top - border_lt
bitmap: .addr wide_button_bitmap
stride: .byte 8 ; bitmap_stride (bytes)
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 49 ; 0 is extra wide
height: .word button_height + border_lt + border_br
label: .byte '0'
@ -482,8 +482,8 @@ top: .word row5_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '.'
@ -497,8 +497,8 @@ top: .word row4_top - border_lt
bitmap: .addr tall_button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word 27 ; + is extra tall
label: .byte '+'
@ -698,8 +698,8 @@ top: .word $FFF7 ; overwritten
bitmap:.addr pixels
stride: .byte 1
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 6
height: .word 5
;; (not part of struct, but not referenced outside)
@ -711,14 +711,13 @@ pixels: .byte px(%1000001)
.byte px(%1001001)
.endproc
;; param block for a QUERY_SCREEN and SET_STATE calls, and ref'd in QUERY_STATE call
.proc state_params
left: .word 0
top: .word 0
saddr: .word 0
addr: .word 0
stride: .word 0
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 0
height: .word 0
pattern:.res 8, 0
@ -728,12 +727,13 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 0
vthick: .byte 0
.byte 0 ; ???
mode: .byte 0
tmask: .byte 0
font: .addr 0
.byte 0,0 ; ???
.endproc
.byte 0,0 ; ???
menu_bar_height := 13
screen_width := 560
screen_height := 192
@ -744,7 +744,7 @@ font: .addr 0
.word menu_bar_height
.word A2D_SCREEN_ADDR
.word A2D_SCREEN_STRIDE
.word 0, 0 ; hoffset/voffset
.word 0, 0 ; hoff/voff
.word screen_width - 1
.word screen_height - menu_bar_height - 2
.endproc
@ -781,10 +781,10 @@ w2: .word window_width
h2: .word window_height
left: .word default_left
top: .word default_top
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word window_width
height: .word window_height
pattern:.res 8, $FF
@ -794,7 +794,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
mode: .byte 0
tmask: .byte 0
font: .addr A2D_DEFAULT_FONT
next: .addr 0

View File

@ -247,8 +247,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte 'c'
@ -262,8 +262,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte 'e'
@ -277,8 +277,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '='
@ -292,8 +292,8 @@ top: .word row1_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '*'
@ -307,8 +307,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '7'
@ -322,8 +322,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '8'
@ -337,8 +337,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '9'
@ -352,8 +352,8 @@ top: .word row2_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '/'
@ -367,8 +367,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '4'
@ -382,8 +382,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '5'
@ -397,8 +397,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '6'
@ -412,8 +412,8 @@ top: .word row3_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '-'
@ -427,8 +427,8 @@ top: .word row4_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '1'
@ -442,8 +442,8 @@ top: .word row4_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '2'
@ -457,8 +457,8 @@ top: .word row4_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '3'
@ -472,8 +472,8 @@ top: .word row5_top - border_lt
bitmap: .addr wide_button_bitmap
stride: .byte 8 ; bitmap_stride (bytes)
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 49 ; 0 is extra wide
height: .word button_height + border_lt + border_br
label: .byte '0'
@ -487,8 +487,8 @@ top: .word row5_top - border_lt
bitmap: .addr button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word button_height + border_lt + border_br
label: .byte '.'
@ -502,8 +502,8 @@ top: .word row4_top - border_lt
bitmap: .addr tall_button_bitmap
stride: .byte bitmap_stride
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word button_width + border_lt + border_br
height: .word 27 ; + is extra tall
label: .byte '+'
@ -703,8 +703,8 @@ top: .word $FFF7 ; overwritten
bitmap:.addr pixels
stride: .byte 1
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 6
height: .word 5
;; (not part of struct, but not referenced outside)
@ -720,10 +720,10 @@ pixels: .byte px(%1000001)
.proc state_params
left: .word 0
top: .word 0
saddr: .word 0
addr: .word 0
stride: .word 0
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 0
height: .word 0
pattern:.res 8, 0
@ -733,7 +733,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 0
vthick: .byte 0
.byte 0 ; ???
mode: .byte 0
tmask: .byte 0
font: .addr 0
.endproc
@ -747,13 +747,14 @@ font: .addr 0
;; params for A2D_SET_BOX when decorating title bar
.proc screen_box
.word 0
.word menu_bar_height
.word A2D_SCREEN_ADDR
.word A2D_SCREEN_STRIDE
.word 0, 0 ; hoffset/voffset
.word screen_width - 1
.word screen_height - menu_bar_height - 2
left: .word 0
top: .word menu_bar_height
addr: .word A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
width: .word screen_width - 1
height: .word screen_height - menu_bar_height - 2
.endproc
.proc fill_mode_normal
@ -788,10 +789,10 @@ w2: .word window_width
h2: .word window_height
left: .word default_left
top: .word default_top
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word window_width
height: .word window_height
pattern:.res 8, $FF
@ -801,7 +802,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
mode: .byte 0
tmask: .byte $7f
font: .addr A2D_DEFAULT_FONT
next: .addr 0

View File

@ -270,10 +270,10 @@ h2: .word $1F4
.proc box
left: .word 180
top: .word 50
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word $C7
height: .word $40
.endproc
@ -284,7 +284,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 4
vthick: .byte 2
.byte 0 ; ???
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
next: .addr 0

View File

@ -239,8 +239,8 @@ top: .word 0
addr: .addr 0
stride: .byte 4
.byte 0 ; ???
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 27
height: .word 15
.endproc
@ -608,10 +608,10 @@ h2: .word default_height
left: .word default_left
top: .word default_top
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word default_width
height: .word default_height
@ -622,7 +622,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
next: .addr 0
@ -632,10 +632,10 @@ next: .addr 0
.proc box_cruft ; Unknown usage
left: .word default_left
top: .word default_top
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word default_width
height: .word default_height
pattern:.res 8, $FF
@ -645,7 +645,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
.byte 0,0 ; ???

View File

@ -209,10 +209,10 @@ h2: .word default_height
.proc box
left: .word default_left
top: .word default_top
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word default_width
height: .word default_height
.endproc
@ -224,7 +224,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
next: .addr 0

View File

@ -318,10 +318,10 @@ h2: .word default_height
.proc box
left: .word default_left
top: .word default_top
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0 ; Also used for A2D_FILL_RECT
voffset:.word 0
hoff: .word 0 ; Also used for A2D_FILL_RECT
voff: .word 0
width: .word default_width
height: .word default_height
.endproc
@ -333,7 +333,7 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
mode: .byte 0
tmask: .byte $7F
font: .addr A2D_DEFAULT_FONT
next: .addr 0
@ -345,8 +345,8 @@ left: .word default_left
top: .word default_top
addr: .word A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word default_width
height: .word default_height
.endproc
@ -580,10 +580,10 @@ title: jsr on_title_bar_click
sec
lda window_params::box::width
sbc window_width
sta window_params::box::hoffset
sta window_params::box::hoff
lda window_params::box::width+1
sbc window_width+1
sta window_params::box::hoffset+1
sta window_params::box::hoff+1
wider: lda window_params::hscroll
ldx window_width
cpx #<max_width
@ -779,14 +779,14 @@ loop: inx
lda thumb_drag_params::pos
jsr mul_by_16
lda $06
sta window_params::box::hoffset
sta window_params::box::hoff
lda $07
sta window_params::box::hoffset+1
sta window_params::box::hoff+1
clc
lda window_params::box::hoffset
lda window_params::box::hoff
adc window_width
sta window_params::box::width
lda window_params::box::hoffset+1
lda window_params::box::hoff+1
adc window_width+1
sta window_params::box::width+1
jsr update_hscroll
@ -875,11 +875,11 @@ store: sta window_params::hspos
jsr mul_by_16
clc
lda $06
sta window_params::box::hoffset
sta window_params::box::hoff
adc window_width
sta window_params::box::width
lda $07
sta window_params::box::hoffset+1
sta window_params::box::hoff+1
adc window_width+1
sta window_params::box::width+1
rts
@ -887,26 +887,26 @@ store: sta window_params::hspos
.proc update_voffset
lda #0
sta window_params::box::voffset
sta window_params::box::voffset+1
sta window_params::box::voff
sta window_params::box::voff+1
ldx update_scroll_params::pos
loop: beq adjust_box_height
clc
lda window_params::box::voffset
lda window_params::box::voff
adc #50
sta window_params::box::voffset
sta window_params::box::voff
bcc :+
inc window_params::box::voffset+1
inc window_params::box::voff+1
: dex
jmp loop
.endproc
.proc adjust_box_height
clc
lda window_params::box::voffset
lda window_params::box::voff
adc window_height
sta window_params::box::height
lda window_params::box::voffset+1
lda window_params::box::voff+1
adc window_height+1
sta window_params::box::height+1
jsr calc_line_position
@ -929,9 +929,9 @@ end: rts
.proc update_hscroll
lda #2
sta update_scroll_params::type
lda window_params::box::hoffset
lda window_params::box::hoff
sta $06
lda window_params::box::hoffset+1
lda window_params::box::hoff+1
sta $07
jsr div_by_16
sta update_scroll_params::pos
@ -962,7 +962,7 @@ end: rts
.proc clear_window
A2D_CALL A2D_SET_PATTERN, white_pattern
A2D_CALL A2D_FILL_RECT, window_params::box::hoffset
A2D_CALL A2D_FILL_RECT, window_params::box::hoff
A2D_CALL A2D_SET_PATTERN, black_pattern
rts
.endproc
@ -1273,15 +1273,15 @@ end: rts
.proc calc_window_size
sec
lda window_params::box::width
sbc window_params::box::hoffset
sbc window_params::box::hoff
sta window_width
lda window_params::box::width+1
sbc window_params::box::hoffset+1
sbc window_params::box::hoff+1
sta window_width+1
sec
lda window_params::box::height
sbc window_params::box::voffset
sbc window_params::box::voff
sta window_height
;; fall through
.endproc
@ -1432,8 +1432,8 @@ left: .word 0
top: .word 0
addr: .word A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoffset:.word 0
voffset:.word 0
hoff: .word 0
voff: .word 0
width: .word 80
height: .word 10
.endproc

View File

@ -64,6 +64,8 @@ LD2D0 := $D2D0
sizeof_state := 36
fill_eor_mask := $F6
;;; ==================================================
;;; A2D
@ -738,88 +740,104 @@ hires_table_hi:
.byte $03,$07,$0B,$0F,$13,$17,$1B,$1F
;;; ==================================================
;;; Routines called during FILL_RECT etc based on
;;; state_fill
L4BA1: lda ($84),y
.proc fillmode0
lda ($84),y
eor ($8E),y
eor $F6
eor fill_eor_mask
and $89
eor ($84),y
bcc L4BB1
L4BAD: lda ($8E),y
eor $F6
L4BB1: and state_mskand
bcc :+
loop: lda ($8E),y
eor fill_eor_mask
: and state_mskand
ora state_mskor
sta ($84),y
dey
bne L4BAD
bne loop
.endproc
.proc fillmode0a
lda ($84),y
eor ($8E),y
eor $F6
eor fill_eor_mask
and $88
eor ($84),y
and state_mskand
ora state_mskor
sta ($84),y
rts
.endproc
.proc fillmode1
lda ($8E),y
eor $F6
eor fill_eor_mask
and $89
bcc L4BD7
L4BD3: lda ($8E),y
eor $F6
L4BD7: ora ($84),y
bcc :+
loop: lda ($8E),y
eor fill_eor_mask
: ora ($84),y
and state_mskand
ora state_mskor
sta ($84),y
dey
bne L4BD3
bne loop
.endproc
.proc fillmode1a
lda ($8E),y
eor $F6
eor fill_eor_mask
and $88
ora ($84),y
and state_mskand
ora state_mskor
sta ($84),y
rts
.endproc
.proc fillmode2
lda ($8E),y
eor $F6
eor fill_eor_mask
and $89
bcc L4BFD
L4BF9: lda ($8E),y
eor $F6
L4BFD: eor ($84),y
bcc :+
loop: lda ($8E),y
eor fill_eor_mask
: eor ($84),y
and state_mskand
ora state_mskor
sta ($84),y
dey
bne L4BF9
bne loop
.endproc
.proc fillmode2a
lda ($8E),y
eor $F6
eor fill_eor_mask
and $88
eor ($84),y
and state_mskand
ora state_mskor
sta ($84),y
rts
.endproc
.proc fillmode3
lda ($8E),y
eor $F6
eor fill_eor_mask
and $89
bcc L4C23
L4C1F: lda ($8E),y
eor $F6
L4C23: eor #$FF
bcc :+
loop: lda ($8E),y
eor fill_eor_mask
: eor #$FF
and ($84),y
and state_mskand
ora state_mskor
sta ($84),y
dey
bne L4C1F
L4C30: lda ($8E),y
eor $F6
bne loop
.endproc
.proc fillmode3a
lda ($8E),y
eor fill_eor_mask
and $88
eor #$FF
and ($84),y
@ -827,6 +845,7 @@ L4C30: lda ($8E),y
ora state_mskor
sta ($84),y
rts
.endproc
L4C41: cpx $98
beq L4C49
@ -1002,10 +1021,7 @@ L4D54: sta LOWSCR,y
ora #$80
sta $89
ldy $91
L4D67:
L4D68 := * + 1
L4D69 := * + 2
jmp L4BA1
L4D67: jmp fillmode0 ; modified with fillmode routine
L4D6A: .byte $FB
L4D6B:
@ -1017,12 +1033,15 @@ L4D73: .byte $01,$03,$07,$0F,$1F,$3F,$7F
L4D7A: .byte $7F,$7F,$7F,$7F,$7F,$7F,$7F
L4D81: .byte $7F,$7E,$7C,$78,$70,$60,$40,$00
.byte $00,$00,$00,$00,$00,$00
L4D8F: .byte $A1
L4D90: .byte $4B,$CB,$4B,$F1,$4B,$17,$4C,$A1
.byte $4B,$CB,$4B,$F1,$4B,$17,$4C
L4D9F: .byte $BA
L4DA0: .byte $4B,$E2,$4B,$08,$4C,$30,$4C,$BA
.byte $4B,$E2,$4B,$08,$4C,$30,$4C
;; Tables used for fill modes
fill_mode_table:
.addr fillmode0,fillmode1,fillmode2,fillmode3
.addr fillmode0,fillmode1,fillmode2,fillmode3
fill_mode_table_a:
.addr fillmode0a,fillmode1a,fillmode2a,fillmode3a
.addr fillmode0a,fillmode1a,fillmode2a,fillmode3a
;;; ==================================================
@ -1030,12 +1049,15 @@ SET_FILL_MODE_IMPL:
lda state_fill
ldx #$00
cmp #$04
bcc L4DB9
bcc :+
ldx #$7F
L4DB9: stx $F6
: stx fill_eor_mask
rts
L4DBC: lda $F7
;; Called from FILL_RECT, DRAW_TEXT, etc to configure
;; fill routines from mode.
set_up_fill_mode:
lda $F7
clc
adc $96
sta $96
@ -1064,10 +1086,10 @@ L4DBC: lda $F7
adc $95
sta $95
lsr $97
beq L4DF7
beq :+
jmp L4E79
L4DF7: lda $96
: lda $96
ror a
tax
lda L4821,x
@ -1114,16 +1136,16 @@ L4E34: sta $91
and $96
sta $92
sta $96
lda L4D9F,x
sta L4D68
lda L4DA0,x
sta L4D69
lda fill_mode_table_a,x
sta L4D67+1
lda fill_mode_table_a+1,x
sta L4D67+2
rts
L4E5B: lda L4D8F,x
sta L4D68
lda L4D90,x
sta L4D69
L4E5B: lda fill_mode_table,x
sta L4D67+1
lda fill_mode_table+1,x
sta L4D67+2
rts
L4E68: lda $92
@ -1411,7 +1433,7 @@ FILL_RECT_IMPL:
jsr L514C
L5043: jsr L50A9
bcc L5015
jsr L4DBC
jsr set_up_fill_mode
jsr L4EA9
jmp L4CED
@ -1669,7 +1691,7 @@ L51B3: lda #$00
bcs L51C5
rts
L51C5: jsr L4DBC
L51C5: jsr set_up_fill_mode
lda $91
asl a
ldx $93
@ -2544,32 +2566,39 @@ L5852: .byte $00,$00,$00,$00,$00,$00,$00,$00
;;; $0B IMPL
;;; SET_FONT ???
L586A:
lda params_addr
lda params_addr ; set font to passed address
sta state_font
lda params_addr+1
sta state_font+1
L5872: ldy #$00
L5874: lda (state_font),y
L5872: ldy #0 ; copy first 3 bytes of font defn (??, ??, height) to $FD-$FF
: lda (state_font),y
sta $FD,y
iny
cpy #$03
bne L5874
cmp #$11
cpy #3
bne :-
cmp #17 ; if height >= 17, skip this next bit
bcs L58B7
lda state_font
ldx state_font+1
clc
adc #$03
adc #3
bcc L588C
inx
L588C: sta $FB
L588C: sta $FB ; set $FB/$FC to start of widths
stx $FC
sec
adc $FE
bcc L5896
inx
L5896: ldy #$00
L5896: ldy #0 ; loop 0... height-1
L5898: sta L58BC,y
pha
txa
@ -2577,25 +2606,24 @@ L5898: sta L58BC,y
pla
sec
adc $FE
bcc L58A7
bcc :+
inx
L58A7: bit $FD
bpl L58B1
: bit $FD
bpl :+
sec
adc $FE
bcc L58B1
bcc :+
inx
L58B1: iny
cpy $FF
: iny
cpy $FF ; =height?
bne L5898
rts
L58B7: lda #$83
jmp a2d_exit_with_a
L58BC: .byte 0
L58BC: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00
L58CC: .byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
@ -2697,7 +2725,7 @@ L596B: sta $9B
ldy $9F
iny
bne L595C
L5972: jsr L4DBC
L5972: jsr set_up_fill_mode
jsr L4EA9
lda $87
clc
@ -3260,10 +3288,10 @@ L5E5A: lda L5F1E,x
ldx L5E79+1
jsr L5EA0
lda #$7F
sta $F6
sta fill_eor_mask
jsr FILL_RECT_IMPL
lda #$00
sta $F6
sta fill_eor_mask
rts
L5E79: .addr $5F42
@ -3416,8 +3444,8 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte 0
mode: .byte 0
tmask: .byte 0
font: .addr 0
.endproc
@ -3881,7 +3909,7 @@ L6348: lda $82,x
dex
bpl L6348
lda #$7F
sta L5F1E::tmsk
sta L5F1E::tmask
lda $87
sta L5F1E::font
lda $88
@ -7642,7 +7670,7 @@ L7F66: pha
lda #$04
sta L7D74
ldx #$0A
L7F7D: lda SPKR
L7F7D: lda SPKR ; Beep?
ldy #$00
L7F82: dey
bne L7F82
@ -7754,21 +7782,21 @@ L8056: jsr L7EE2
L805C: pha
jsr L8035
pla
cmp #$1B
cmp #KEY_ESCAPE
bne L8073
lda #$00
lda #0
sta L7D80
sta L7D7F
lda #$80
sta L7D81
rts
L8073: cmp #$0D
L8073: cmp #KEY_RETURN
bne L807D
jsr L7E8C
jmp L7EAD
L807D: cmp #$0B
L807D: cmp #KEY_UP
bne L80A3
L8081: dec L7D7B
bpl L8091
@ -7785,7 +7813,7 @@ L8091: ldx L7D7B
bne L8081
L80A0: jmp L800F
L80A3: cmp #$0A
L80A3: cmp #KEY_DOWN
bne L80D0
L80A7: inc L7D7B
ldx L7D7A
@ -7794,7 +7822,7 @@ L80A7: inc L7D7B
cmp $AA
bcc L80BE
beq L80BE
lda #$00
lda #0
sta L7D7B
L80BE: ldx L7D7B
beq L80CD
@ -7805,9 +7833,9 @@ L80BE: ldx L7D7B
bne L80A7
L80CD: jmp L800F
L80D0: cmp #$15
L80D0: cmp #KEY_RIGHT
bne L80EB
lda #$00
lda #0
sta L7D7B
inc L7D7A
lda L7D7A
@ -7817,9 +7845,9 @@ L80D0: cmp #$15
sta L7D7A
L80E8: jmp L800F
L80EB: cmp #$08
L80EB: cmp #KEY_LEFT
bne L8105
lda #$00
lda #0
sta L7D7B
dec L7D7A
bmi L80FC
@ -9129,7 +9157,8 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte $96,$00 ; ???
mode: .byte $96 ; ???
tmask: .byte 0
font: .addr A2D_DEFAULT_FONT
.endproc
@ -9154,8 +9183,8 @@ xpos: .word 0
ypos: .word 0
hthick: .byte 0
vthick: .byte 0
.byte 0 ; ???
tmsk: .byte 0
mode: .byte 0
tmask: .byte 0
font: .addr 0
.endproc

View File

@ -374,7 +374,7 @@ w2: .word $1F4
h2: .word $8C
left: .word $4B
top: .word $23
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
@ -383,11 +383,12 @@ height: .word $64
pattern:.res 8, $FF
mskand: .byte A2D_DEFAULT_MSKAND
mskor: .byte A2D_DEFAULT_MSKOR
.byte 0,0,0,0 ; ???
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte A2D_DEFAULT_TMSK
fill: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
next: .addr 0
.endproc
@ -409,7 +410,7 @@ w2: .word $1F4
h2: .word $8C
left: .word $19
top: .word $14
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
@ -418,11 +419,12 @@ height: .word $99
pattern:.res 8, $FF
mskand: .byte A2D_DEFAULT_MSKAND
mskor: .byte A2D_DEFAULT_MSKOR
.byte 0,0,0,0 ; ???
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte A2D_DEFAULT_TMSK
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
next: .addr 0
.endproc
@ -444,7 +446,7 @@ w2: .word $64
h2: .word $46
left: .word $35
top: .word $32
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
@ -453,11 +455,12 @@ height: .word $46
pattern:.res 8, $FF
mskand: .byte A2D_DEFAULT_MSKAND
mskor: .byte A2D_DEFAULT_MSKOR
.byte 0,0,0,0 ; ???
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte A2D_DEFAULT_TMSK
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
next: .addr 0
.endproc
@ -479,7 +482,7 @@ w2: .word $1F4
h2: .word $8C
left: .word $50
top: .word $28
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
@ -488,11 +491,12 @@ height: .word $6E
pattern:.res 8, $FF
mskand: .byte A2D_DEFAULT_MSKAND
mskor: .byte A2D_DEFAULT_MSKOR
.byte 0,0,0,0 ; ???
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte A2D_DEFAULT_TMSK
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
next: .addr 0
.endproc
@ -514,7 +518,7 @@ w2: .word $1F4
h2: .word $8C
left: .word $69
top: .word $19
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
@ -523,11 +527,12 @@ height: .word $6E
pattern:.res 8, $FF
mskand: .byte A2D_DEFAULT_MSKAND
mskor: .byte A2D_DEFAULT_MSKOR
.byte 0,0,0,0 ; ???
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte A2D_DEFAULT_TMSK
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
next: .addr 0
.endproc
@ -868,7 +873,7 @@ w2: .word 545
h2: .word 175
left: .word 20
top: .word 27
saddr: .addr A2D_SCREEN_ADDR
addr: .addr A2D_SCREEN_ADDR
stride: .word A2D_SCREEN_STRIDE
hoff: .word 0
voff: .word 0
@ -877,11 +882,12 @@ height: .word 120
pattern:.res 8, $FF
mskand: .byte A2D_DEFAULT_MSKAND
mskor: .byte A2D_DEFAULT_MSKOR
.byte 0,0,0,0 ; ???
xpos: .word 0
ypos: .word 0
hthick: .byte 1
vthick: .byte 1
.byte 0 ; ???
tmsk: .byte A2D_DEFAULT_TMSK
mode: .byte 0
tmask: .byte A2D_DEFAULT_TMASK
font: .addr A2D_DEFAULT_FONT
next: .addr 0
.endproc