pattern -> bitmap

This commit is contained in:
Joshua Bell 2017-09-13 21:58:37 -07:00
parent e57c316180
commit 6bb8ef67f9
3 changed files with 18 additions and 18 deletions

View File

@ -134,7 +134,7 @@ A2D_TEST_BOX := $13 ; Is pos (via SET_POS) in bounds? Returns true/f
;; .word right ;; .word right
;; .word bottom ;; .word bottom
A2D_DRAW_PATTERN := $14 ; Draw pattern A2D_DRAW_BITMAP := $14 ; Draw pattern
;; (input length 16 bytes) ;; (input length 16 bytes)
;; .word left ;; .word left
;; .word top ;; .word top
@ -392,7 +392,7 @@ end:
.byte str .byte str
.endmacro .endmacro
;;; Define pattern for A2D_DRAW_PATTERN - low 7 bits are reversed ;;; Define pattern for A2D_DRAW_BITMAP - low 7 bits are reversed
;;; e.g. .byte px(%1000000) ;;; e.g. .byte px(%1000000)
.define px(bits) (((bits&$40)>>6)|((bits&$20)>>4)|((bits&$10)>>2)|(bits&$8)|((bits&$4)<<2)|((bits&$2)<<4)|((bits&$1)<<6)) .define px(bits) (((bits&$40)>>6)|((bits&$20)>>4)|((bits&$10)>>2)|(bits&$8)|((bits&$4)<<2)|((bits&$2)<<4)|((bits&$1)<<6))

View File

@ -658,7 +658,7 @@ base: .word 16
farg: .byte $00,$00,$00,$00,$00,$00 farg: .byte $00,$00,$00,$00,$00,$00
.proc title_bar_decoration ; Params for A2D_DRAW_PATTERN .proc title_bar_decoration ; Params for A2D_DRAW_BITMAP
left: .word 115 ; overwritten left: .word 115 ; overwritten
top: .word $FFF7 ; overwritten top: .word $FFF7 ; overwritten
pattern:.addr pixels pattern:.addr pixels
@ -1588,9 +1588,9 @@ loop: ldy #0
beq draw_title_bar ; done! beq draw_title_bar ; done!
lda ptr ; address for shadowed rect params lda ptr ; address for shadowed rect params
sta pattern_addr sta bitmap_addr
ldy ptr+1 ldy ptr+1
sty pattern_addr+1 sty bitmap_addr+1
clc ; address for label pos clc ; address for label pos
adc #(btn_c::pos - btn_c) adc #(btn_c::pos - btn_c)
@ -1603,7 +1603,7 @@ loop: ldy #0
lda (ptr),y lda (ptr),y
sta label sta label
A2D_CALL A2D_DRAW_PATTERN, 0, pattern_addr ; draw shadowed rect A2D_CALL A2D_DRAW_BITMAP, 0, bitmap_addr ; draw shadowed rect
A2D_CALL A2D_SET_POS, 0, text_addr ; button label pos A2D_CALL A2D_SET_POS, 0, text_addr ; button label pos
A2D_CALL A2D_DRAW_TEXT, draw_text_params_label ; button label text A2D_CALL A2D_DRAW_TEXT, draw_text_params_label ; button label text
@ -1639,7 +1639,7 @@ draw_title_bar:
dex dex
: stx title_bar_decoration::top+1 : stx title_bar_decoration::top+1
A2D_CALL A2D_SET_BOX, screen_box ; set clipping rect to whole screen A2D_CALL A2D_SET_BOX, screen_box ; set clipping rect to whole screen
A2D_CALL A2D_DRAW_PATTERN, title_bar_decoration ; Draws decoration in title bar A2D_CALL A2D_DRAW_BITMAP, title_bar_decoration ; Draws decoration in title bar
lda #window_id lda #window_id
sta query_state_params::id sta query_state_params::id
A2D_CALL A2D_QUERY_STATE, query_state_params A2D_CALL A2D_QUERY_STATE, query_state_params

View File

@ -218,7 +218,7 @@ space_positions: ; left, top for all 16 holes
.word c3,r4 .word c3,r4
.word c4,r4 .word c4,r4
.proc pattern_table .proc bitmap_table
.addr piece1, piece2, piece3, piece4 .addr piece1, piece2, piece3, piece4
.addr piece5, piece6, piece7, piece8 .addr piece5, piece6, piece7, piece8
.addr piece9, piece10, piece11, piece12 .addr piece9, piece10, piece11, piece12
@ -229,7 +229,7 @@ space_positions: ; left, top for all 16 holes
position_table: position_table:
.res 16, 0 .res 16, 0
.proc draw_pattern_params .proc draw_bitmap_params
left: .word 0 left: .word 0
top: .word 0 top: .word 0
addr: .addr 0 addr: .addr 0
@ -1035,21 +1035,21 @@ loop: tya
asl a asl a
tax tax
lda space_positions,x lda space_positions,x
sta draw_pattern_params::left sta draw_bitmap_params::left
lda space_positions+1,x lda space_positions+1,x
sta draw_pattern_params::left+1 sta draw_bitmap_params::left+1
lda space_positions+2,x lda space_positions+2,x
sta draw_pattern_params::top sta draw_bitmap_params::top
lda space_positions+3,x lda space_positions+3,x
sta draw_pattern_params::top+1 sta draw_bitmap_params::top+1
lda position_table,y lda position_table,y
asl a asl a
tax tax
lda pattern_table,x lda bitmap_table,x
sta draw_pattern_params::addr sta draw_bitmap_params::addr
lda pattern_table+1,x lda bitmap_table+1,x
sta draw_pattern_params::addr+1 sta draw_bitmap_params::addr+1
A2D_CALL A2D_DRAW_PATTERN, draw_pattern_params A2D_CALL A2D_DRAW_BITMAP, draw_bitmap_params
pla pla
clc clc
adc draw_inc adc draw_inc