peasant: make peasant sprite 7x28 instead of 7x30

not sure why it was 7x30 anyway as we ignored the bottom 2 lines

hopefully makes bg masking easier
This commit is contained in:
Vince Weaver 2021-08-24 20:58:44 -04:00
parent d8155c8f4e
commit da4412f3f2
16 changed files with 80 additions and 109 deletions

View File

@ -76,7 +76,7 @@ INTRO: intro.o
intro.o: intro.s zp.inc \
graphics/graphics_intro.inc sprites/peasant_sprite.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_7x30_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_7x28_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_partial_save.s \
wait_a_bit.s draw_peasant.s hgr_text_box.s \
title.s directions.s \
@ -92,7 +92,7 @@ PEASANT1: peasant1.o
peasant1.o: peasant1.s zp.inc \
graphics/graphics_peasant1.inc sprites/peasant_sprite.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_7x30_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_7x28_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
wait_a_bit.s draw_peasant.s hgr_text_box.s \
keyboard.s parse_input.s new_map_location.s \
peasant_move.s
@ -106,7 +106,7 @@ PEASANT2: peasant2.o
peasant2.o: peasant2.s zp.inc \
graphics/graphics_peasant2.inc sprites/peasant_sprite.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_7x30_sprite_mask.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_7x28_sprite_mask.s hgr_1x5_sprite.s hgr_save_restore.s \
wait_a_bit.s draw_peasant.s hgr_text_box.s \
keyboard.s parse_input.s new_map_location.s \
peasant_move.s
@ -121,7 +121,7 @@ PEASANT3: peasant3.o
peasant3.o: peasant3.s zp.inc \
graphics/graphics_peasant3.inc sprites/peasant_sprite.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_7x30_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_7x28_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
wait_a_bit.s draw_peasant.s hgr_text_box.s \
keyboard.s parse_input.s new_map_location.s \
peasant_move.s
@ -135,7 +135,7 @@ PEASANT4: peasant4.o
peasant4.o: peasant4.s zp.inc \
graphics/graphics_peasant4.inc sprites/peasant_sprite.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_7x30_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_7x28_sprite.s hgr_1x5_sprite.s hgr_save_restore.s \
wait_a_bit.s draw_peasant.s hgr_text_box.s \
keyboard.s parse_input.s new_map_location.s \
peasant_move.s

View File

@ -100,7 +100,7 @@ draw_right1:
done_pick_draw:
sta INH
jsr hgr_draw_sprite_7x30
jsr hgr_draw_sprite_7x28
rts

View File

@ -1,6 +1,6 @@
;===============================================
; hgr 7x30 draw sprite
; hgr 7x28 draw sprite
;===============================================
; SPRITE in INL/INH
; Location at CURSOR_X CURSOR_Y
@ -10,24 +10,24 @@
; left mask at INL/INH + 28
; right mask at INL/INH + 42
hgr_draw_sprite_7x30:
hgr_draw_sprite_7x28:
; set up pointers
lda INL
sta h730_smc1+1
sta h728_smc1+1
lda INH
sta h730_smc1+2
sta h728_smc1+2
clc
lda INL
adc #30
sta h730_smc3+1
adc #28
sta h728_smc3+1
lda INH
adc #0
sta h730_smc3+2
sta h728_smc3+2
ldx #0 ; X is row counter
hgr_7x30_sprite_yloop:
hgr_7x28_sprite_yloop:
txa ; X is current row
clc
@ -44,24 +44,24 @@ hgr_7x30_sprite_yloop:
ldy CURSOR_X
lda (GBASL),Y ; load background
h730_smc3:
h728_smc3:
and $d000,X ; mask with sprite mask
h730_smc1:
h728_smc1:
ora $d000,X ; or in sprite
sta (GBASL),Y ; store out
inx
cpx #30
bne hgr_7x30_sprite_yloop
cpx #28
bne hgr_7x28_sprite_yloop
rts
;======================
; save bg 7x30
; save bg 7x28
;======================
save_bg_7x30:
save_bg_7x28:
ldx #0
save_yloop:
@ -86,19 +86,19 @@ save_yloop:
ldy CURSOR_X
lda (GBASL),Y
sta save_sprite_7x30,X
sta save_sprite_7x28,X
inx
cpx #30
cpx #28
bne save_yloop
rts
;======================
; restore bg 7x30
; restore bg 7x28
;======================
restore_bg_7x30:
restore_bg_7x28:
ldx #0
restore_yloop:
@ -116,11 +116,11 @@ restore_yloop:
ldy CURSOR_X
lda save_sprite_7x30,X
lda save_sprite_7x28,X
sta (GBASL),Y
inx
cpx #30
cpx #28
bne restore_yloop
rts
@ -130,6 +130,6 @@ restore_yloop:
; save area
;====================
save_sprite_7x30:
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
save_sprite_7x28:
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

View File

@ -1,6 +1,6 @@
;===============================================
; hgr 7x30 draw sprite, with bg mask in GR $400
; hgr 7x28 draw sprite, with bg mask in GR $400
;===============================================
; SPRITE in INL/INH
; Location at CURSOR_X CURSOR_Y
@ -13,24 +13,24 @@
; left mask at INL/INH + 28
; right mask at INL/INH + 42
hgr_draw_sprite_7x30:
hgr_draw_sprite_7x28:
; set up pointers
lda INL
sta h730_smc1+1
sta h728_smc1+1
lda INH
sta h730_smc1+2
sta h728_smc1+2
clc
lda INL
adc #30
sta h730_smc3+1
adc #28
sta h728_smc3+1
lda INH
adc #0
sta h730_smc3+2
sta h728_smc3+2
ldx #0 ; X is row counter
hgr_7x30_sprite_yloop:
hgr_7x28_sprite_yloop:
txa ; X is current row
clc
@ -47,24 +47,24 @@ hgr_7x30_sprite_yloop:
ldy CURSOR_X
lda (GBASL),Y ; load background
h730_smc3:
h728_smc3:
and $d000,X ; mask with sprite mask
h730_smc1:
h728_smc1:
ora $d000,X ; or in sprite
sta (GBASL),Y ; store out
inx
cpx #30
bne hgr_7x30_sprite_yloop
cpx #28
bne hgr_7x28_sprite_yloop
rts
;======================
; save bg 7x30
; save bg 7x28
;======================
save_bg_7x30:
save_bg_7x28:
ldx #0
save_yloop:
@ -89,19 +89,19 @@ save_yloop:
ldy CURSOR_X
lda (GBASL),Y
sta save_sprite_7x30,X
sta save_sprite_7x28,X
inx
cpx #30
cpx #28
bne save_yloop
rts
;======================
; restore bg 7x30
; restore bg 7x28
;======================
restore_bg_7x30:
restore_bg_7x28:
ldx #0
restore_yloop:
@ -119,11 +119,11 @@ restore_yloop:
ldy CURSOR_X
lda save_sprite_7x30,X
lda save_sprite_7x28,X
sta (GBASL),Y
inx
cpx #30
cpx #28
bne restore_yloop
rts
@ -133,6 +133,6 @@ restore_yloop:
; save area
;====================
save_sprite_7x30:
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
save_sprite_7x28:
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

View File

@ -142,7 +142,7 @@ escape_handler:
.include "hgr_font.s"
.include "draw_box.s"
.include "hgr_rectangle.s"
.include "hgr_7x30_sprite.s"
.include "hgr_7x28_sprite.s"
.include "hgr_1x5_sprite.s"
;.include "hgr_save_restore.s"
.include "hgr_partial_save.s"

View File

@ -57,7 +57,7 @@ cottage:
;=======================
; walking
jsr save_bg_7x30
jsr save_bg_7x28
cottage_walk_loop:
@ -66,7 +66,7 @@ cottage_walk_loop:
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x30
jsr restore_bg_7x28
;=======================
@ -87,7 +87,7 @@ cottage_walk_loop:
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant

View File

@ -53,7 +53,7 @@ knight:
;=======================
; walking
jsr save_bg_7x30
jsr save_bg_7x28
knight_walk_loop:
@ -62,7 +62,7 @@ knight_walk_loop:
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x30
jsr restore_bg_7x28
; draw peasant
@ -80,7 +80,7 @@ knight_walk_loop:
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant

View File

@ -50,7 +50,7 @@ lake_east:
;=======================
; walking
jsr save_bg_7x30
jsr save_bg_7x28
lake_e_walk_loop:
@ -59,7 +59,7 @@ lake_e_walk_loop:
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x30
jsr restore_bg_7x28
; draw peasant
@ -77,7 +77,7 @@ lake_e_walk_loop:
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant

View File

@ -51,7 +51,7 @@ lake_west:
;=======================
; walking
jsr save_bg_7x30
jsr save_bg_7x28
lake_w_walk_loop:
@ -60,7 +60,7 @@ lake_w_walk_loop:
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x30
jsr restore_bg_7x28
; draw peasant
@ -78,7 +78,7 @@ lake_w_walk_loop:
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant

View File

@ -53,7 +53,7 @@ river:
;=======================
; walking
jsr save_bg_7x30
jsr save_bg_7x28
river_walk_loop:
@ -62,7 +62,7 @@ river_walk_loop:
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x30
jsr restore_bg_7x28
; draw peasant
@ -80,7 +80,7 @@ river_walk_loop:
sta PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant

View File

@ -112,7 +112,7 @@ new_location:
;=======================
; draw initial peasant
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant
@ -167,7 +167,7 @@ score_text:
.include "hgr_font.s"
.include "draw_box.s"
.include "hgr_rectangle.s"
.include "hgr_7x30_sprite.s"
.include "hgr_7x28_sprite.s"
.include "hgr_1x5_sprite.s"
;.include "hgr_save_restore.s"
.include "hgr_partial_save.s"

View File

@ -112,7 +112,7 @@ new_location:
;=======================
; draw initial peasant
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant
@ -167,7 +167,7 @@ score_text:
.include "hgr_font.s"
.include "draw_box.s"
.include "hgr_rectangle.s"
.include "hgr_7x30_sprite_mask.s"
.include "hgr_7x28_sprite_mask.s"
.include "hgr_1x5_sprite.s"
;.include "hgr_save_restore.s"
.include "hgr_partial_save.s"

View File

@ -111,7 +111,7 @@ new_location:
;=======================
; draw initial peasant
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant
@ -165,7 +165,7 @@ score_text:
.include "hgr_font.s"
.include "draw_box.s"
.include "hgr_rectangle.s"
.include "hgr_7x30_sprite.s"
.include "hgr_7x28_sprite.s"
.include "hgr_1x5_sprite.s"
;.include "hgr_save_restore.s"
.include "hgr_partial_save.s"

View File

@ -111,7 +111,7 @@ new_location:
;=======================
; draw initial peasant
jsr save_bg_7x30
jsr save_bg_7x28
jsr draw_peasant
@ -166,7 +166,7 @@ score_text:
.include "hgr_font.s"
.include "draw_box.s"
.include "hgr_rectangle.s"
.include "hgr_7x30_sprite.s"
.include "hgr_7x28_sprite.s"
.include "hgr_1x5_sprite.s"
;.include "hgr_save_restore.s"
.include "hgr_partial_save.s"

View File

@ -20,7 +20,7 @@ really_move_peasant:
lda PEASANT_Y
sta CURSOR_Y
jsr restore_bg_7x30
jsr restore_bg_7x28
; move peasant
@ -147,7 +147,7 @@ done_movey:
lda PEASANT_Y
sta CURSOR_Y
jsr save_bg_7x30
jsr save_bg_7x28
; draw peasant

View File

@ -29,8 +29,6 @@ peasant_right1_sprite:
.byte $0F
.byte $0F
.byte $1C
.byte $00
.byte $00
; hgr_make_sprite peasant_sprites.png 21 1 21 31
peasant_right1_mask:
@ -62,8 +60,6 @@ peasant_right1_mask:
.byte $70
.byte $70
.byte $63
.byte $FF
.byte $FF
; hgr_make_sprite ./peasant_sprites.png 35 34 35 64
peasant_right2_sprite:
@ -95,8 +91,6 @@ peasant_right2_sprite:
.byte $63
.byte $63
.byte $6F
.byte $00
.byte $00
; 21 34 21 64
peasant_right2_mask:
@ -128,8 +122,6 @@ peasant_right2_mask:
.byte $1C
.byte $1C
.byte $10
.byte $FF
.byte $FF
; 35 68 35 98
peasant_up1_sprite:
@ -161,8 +153,7 @@ peasant_up1_sprite:
.byte $33
.byte $33
.byte $03
.byte $00
.byte $00
; 21 68 21 98
peasant_up1_mask:
.byte $73
@ -193,8 +184,7 @@ peasant_up1_mask:
.byte $4C
.byte $4C
.byte $7C
.byte $7F
.byte $7F
; 35 102 35 132
peasant_up2_sprite:
@ -226,8 +216,7 @@ peasant_up2_sprite:
.byte $33
.byte $33
.byte $30
.byte $00
.byte $00
; 21 102 21 132
peasant_up2_mask:
@ -259,8 +248,6 @@ peasant_up2_mask:
.byte $4C
.byte $4C
.byte $4F
.byte $7F
.byte $7F
; 84 1 90 31
@ -293,8 +280,6 @@ peasant_left1_sprite:
.byte $78
.byte $78
.byte $1C
.byte $00
.byte $00
; 70 1 76 31
peasant_left1_mask:
@ -326,9 +311,6 @@ peasant_left1_mask:
.byte $07
.byte $07
.byte $63
.byte $7F
.byte $7F
; 84 34 90 65
@ -361,8 +343,6 @@ peasant_left2_sprite:
.byte $63
.byte $63
.byte $7B
.byte $00
.byte $00
; 70 34 76 65
peasant_left2_mask:
@ -394,8 +374,6 @@ peasant_left2_mask:
.byte $1C
.byte $1C
.byte $04
.byte $7F
.byte $7F
; 84 68 90 99
peasant_down1_sprite:
@ -427,8 +405,6 @@ peasant_down1_sprite:
.byte $33
.byte $33
.byte $03
.byte $00
.byte $00
; 70 68 76 99
peasant_down1_mask:
@ -460,8 +436,6 @@ peasant_down1_mask:
.byte $4C
.byte $4C
.byte $7C
.byte $7F
.byte $7F
; 84 102 90 133
peasant_down2_sprite:
@ -493,8 +467,6 @@ peasant_down2_sprite:
.byte $33
.byte $33
.byte $30
.byte $00
.byte $00
; 70 102 76 133
peasant_down2_mask:
@ -526,5 +498,4 @@ peasant_down2_mask:
.byte $4C
.byte $4C
.byte $4F
.byte $7F
.byte $7F