peasant: more work on sprite merging

This commit is contained in:
Vince Weaver 2021-10-05 08:46:18 -04:00
parent 085d3f7b62
commit a454871f73
4 changed files with 49 additions and 59 deletions

View File

@ -1,4 +1,3 @@
;====================== ;======================
; hgr 1x5 draw sprite ; hgr 1x5 draw sprite
;====================== ;======================

View File

@ -1,7 +1,9 @@
;====================== ;======================================
; hgr 1x8 draw sprite ; hgr 1x8 draw sprite XOR
;====================== ;======================================
; mostly used for text print routines
;======================================
; SPRITE in INL/INH ; SPRITE in INL/INH
; Location at CURSOR_X CURSOR_Y*7 ; Location at CURSOR_X CURSOR_Y*7
; X, Y, A trashed ; X, Y, A trashed
@ -17,27 +19,16 @@ hgr_draw_sprite_1x8:
ldx #0 ldx #0
hgr_1x8_sprite_yloop: hgr_1x8_sprite_yloop:
txa txa
pha
clc clc
adc CURSOR_Y adc CURSOR_Y ; calculate row
; ldx #0 tay ; get co-ords for it
; ldy #0 lda hposn_low,Y
; calc GBASL/GBASH
; jsr HPOSN ; (Y,X),(A) (values stored in HGRX,XH,Y)
tax
lda hposn_low,X
sta GBASL sta GBASL
lda hposn_high,X lda hposn_high,Y
sta GBASH sta GBASH
pla
tax
ldy CURSOR_X ldy CURSOR_X
lda (GBASL),Y lda (GBASL),Y

View File

@ -9,30 +9,31 @@
; sprite AT INL/INH ; sprite AT INL/INH
hgr_draw_sprite: hgr_draw_sprite:
ldy #0 ldy #0
lda (INL),Y lda (INL),Y ; load xsize
clc clc
adc CURSOR_X adc CURSOR_X
sta h4231_width_end_smc+1 ; self modify for end of output sta sprite_width_end_smc+1 ; self modify for end of line
iny iny ; load ysize
lda (INL),Y lda (INL),Y
sta h4231_ysize_smc+1 sta sprite_ysize_smc+1 ; self modify
; set up sprite pointers ; skip the xsize/ysize and point to sprite
clc clc
lda INL lda INL ; 16-bit add
adc #2 adc #2
sta h4231_smc1+1 sta sprite_smc1+1
lda INH lda INH
adc #0 adc #0
sta h4231_smc1+2 sta sprite_smc1+2
ldx #0 ; X is pointer offset ldx #0 ; X is pointer offset
stx MASK ; actually row stx MASK ; actual row
hgr_42x31_sprite_yloop: hgr_sprite_yloop:
lda MASK ; row lda MASK ; row
@ -49,9 +50,9 @@ hgr_42x31_sprite_yloop:
ldy CURSOR_X ldy CURSOR_X
h3231_inner_loop: sprite_inner_loop:
h4231_smc1: sprite_smc1:
lda $d000 ; get sprite pattern lda $d000 ; get sprite pattern
sta (GBASL),Y ; store out sta (GBASL),Y ; store out
@ -59,23 +60,22 @@ h4231_smc1:
iny iny
inc h4231_smc1+1 inc sprite_smc1+1
bne h4231_noflo bne sprite_noflo
inc h4231_smc1+2 inc sprite_smc1+2
sprite_noflo:
h4231_noflo: sprite_width_end_smc:
h4231_width_end_smc:
cpy #6 cpy #6
bne h3231_inner_loop bne sprite_inner_loop
inc MASK ; row inc MASK ; row
lda MASK ; row lda MASK ; row
h4231_ysize_smc: sprite_ysize_smc:
cmp #31 cmp #31
bne hgr_42x31_sprite_yloop bne hgr_sprite_yloop
rts rts

View File

@ -3,27 +3,27 @@ sector_write =$0c63
requested_sector =$0d17 requested_sector =$0d17
decompress_lzsa2_fast =$0de6 decompress_lzsa2_fast =$0de6
getsrc_smc =$0edc getsrc_smc =$0edc
hgr2 =$1700 hgr2 =$16fd
hgr_make_tables =$15dd hgr_make_tables =$15da
hgr_put_string =$0ee9 hgr_put_string =$0ee9
save_bg_1x28 =$1424 save_bg_1x28 =$1421
restore_bg_1x28 =$1445 restore_bg_1x28 =$1442
hgr_draw_sprite_1x28 =$13bd hgr_draw_sprite_1x28 =$13ba
input_buffer =$15b5 input_buffer =$15b2
hgr_text_box =$1653 hgr_text_box =$1650
hgr_text_box_nosave =$16c7 hgr_text_box_nosave =$16c4
hgr_partial_restore =$1533 hgr_partial_restore =$1530
clear_bottom =$16d5 clear_bottom =$16d2
hgr_input =$155b hgr_input =$1558
hgr_partial_save =$1504 hgr_partial_save =$1501
draw_box =$126e draw_box =$126b
disp_put_string =$1689 disp_put_string =$1686
disp_one_line =$169d disp_one_line =$169a
invert_smc1 =$0f64 invert_smc1 =$0f61
disp_put_string_cursor =$1699 disp_put_string_cursor =$1696
hgr_put_char_cursor =$0f15 hgr_put_char_cursor =$0f15
vgi_simple_rectangle =$12ef vgi_simple_rectangle =$12ec
peasant_text =$17a8 peasant_text =$17a5
hposn_high = $BA00 hposn_high = $BA00
hposn_low = $BB00 hposn_low = $BB00
driveoff = $A22 driveoff = $A22