diff --git a/games/peasant/hgr_1x5_sprite.s b/games/peasant/hgr_1x5_sprite.s index 732f8a29..bf61a4a8 100644 --- a/games/peasant/hgr_1x5_sprite.s +++ b/games/peasant/hgr_1x5_sprite.s @@ -1,4 +1,3 @@ - ;====================== ; hgr 1x5 draw sprite ;====================== diff --git a/games/peasant/hgr_1x8_sprite.s b/games/peasant/hgr_1x8_sprite.s index f8c0dc8c..3f79a67e 100644 --- a/games/peasant/hgr_1x8_sprite.s +++ b/games/peasant/hgr_1x8_sprite.s @@ -1,7 +1,9 @@ - ;====================== - ; hgr 1x8 draw sprite - ;====================== + ;====================================== + ; hgr 1x8 draw sprite XOR + ;====================================== + ; mostly used for text print routines + ;====================================== ; SPRITE in INL/INH ; Location at CURSOR_X CURSOR_Y*7 ; X, Y, A trashed @@ -17,27 +19,16 @@ hgr_draw_sprite_1x8: ldx #0 hgr_1x8_sprite_yloop: txa - pha clc - adc CURSOR_Y + adc CURSOR_Y ; calculate row -; ldx #0 -; ldy #0 - - ; calc GBASL/GBASH -; jsr HPOSN ; (Y,X),(A) (values stored in HGRX,XH,Y) - - tax - lda hposn_low,X + tay ; get co-ords for it + lda hposn_low,Y sta GBASL - lda hposn_high,X + lda hposn_high,Y sta GBASH - - pla - tax - ldy CURSOR_X lda (GBASL),Y diff --git a/games/peasant/hgr_sprite.s b/games/peasant/hgr_sprite.s index 033118e4..80451cba 100644 --- a/games/peasant/hgr_sprite.s +++ b/games/peasant/hgr_sprite.s @@ -9,30 +9,31 @@ ; sprite AT INL/INH hgr_draw_sprite: + ldy #0 - lda (INL),Y + lda (INL),Y ; load xsize clc 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 - 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 - lda INL + lda INL ; 16-bit add adc #2 - sta h4231_smc1+1 + sta sprite_smc1+1 lda INH adc #0 - sta h4231_smc1+2 + sta sprite_smc1+2 ldx #0 ; X is pointer offset - stx MASK ; actually row + stx MASK ; actual row -hgr_42x31_sprite_yloop: +hgr_sprite_yloop: lda MASK ; row @@ -49,9 +50,9 @@ hgr_42x31_sprite_yloop: ldy CURSOR_X -h3231_inner_loop: +sprite_inner_loop: -h4231_smc1: +sprite_smc1: lda $d000 ; get sprite pattern sta (GBASL),Y ; store out @@ -59,23 +60,22 @@ h4231_smc1: iny - inc h4231_smc1+1 - bne h4231_noflo - inc h4231_smc1+2 + inc sprite_smc1+1 + bne sprite_noflo + inc sprite_smc1+2 +sprite_noflo: -h4231_noflo: - -h4231_width_end_smc: +sprite_width_end_smc: cpy #6 - bne h3231_inner_loop + bne sprite_inner_loop inc MASK ; row lda MASK ; row -h4231_ysize_smc: +sprite_ysize_smc: cmp #31 - bne hgr_42x31_sprite_yloop + bne hgr_sprite_yloop rts diff --git a/games/peasant/qload.inc b/games/peasant/qload.inc index 4361442b..d2aead95 100644 --- a/games/peasant/qload.inc +++ b/games/peasant/qload.inc @@ -3,27 +3,27 @@ sector_write =$0c63 requested_sector =$0d17 decompress_lzsa2_fast =$0de6 getsrc_smc =$0edc -hgr2 =$1700 -hgr_make_tables =$15dd +hgr2 =$16fd +hgr_make_tables =$15da hgr_put_string =$0ee9 -save_bg_1x28 =$1424 -restore_bg_1x28 =$1445 -hgr_draw_sprite_1x28 =$13bd -input_buffer =$15b5 -hgr_text_box =$1653 -hgr_text_box_nosave =$16c7 -hgr_partial_restore =$1533 -clear_bottom =$16d5 -hgr_input =$155b -hgr_partial_save =$1504 -draw_box =$126e -disp_put_string =$1689 -disp_one_line =$169d -invert_smc1 =$0f64 -disp_put_string_cursor =$1699 +save_bg_1x28 =$1421 +restore_bg_1x28 =$1442 +hgr_draw_sprite_1x28 =$13ba +input_buffer =$15b2 +hgr_text_box =$1650 +hgr_text_box_nosave =$16c4 +hgr_partial_restore =$1530 +clear_bottom =$16d2 +hgr_input =$1558 +hgr_partial_save =$1501 +draw_box =$126b +disp_put_string =$1686 +disp_one_line =$169a +invert_smc1 =$0f61 +disp_put_string_cursor =$1696 hgr_put_char_cursor =$0f15 -vgi_simple_rectangle =$12ef -peasant_text =$17a8 +vgi_simple_rectangle =$12ec +peasant_text =$17a5 hposn_high = $BA00 hposn_low = $BB00 driveoff = $A22