peasant: ending: work on jhonka scene

This commit is contained in:
Vince Weaver 2021-09-15 16:32:43 -04:00
parent 444d949181
commit 7518089721
6 changed files with 93 additions and 12 deletions

View File

@ -180,7 +180,8 @@ ending.o: ending.s zp.inc \
graphics_end/ending_graphics.inc sprites/peasant_sprite.inc \
sprites/ending_sprites.inc \
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
hgr_14x14_sprite_mask.s hgr_1x5_sprite.s hgr_save_restore.s \
hgr_14x14_sprite_mask.s hgr_1x5_sprite.s \
hgr_42x31_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 score.s inventory.s

View File

@ -252,17 +252,6 @@ jhonka:
sta VGI_RYRUN
jsr vgi_simple_rectangle
; lda #214
; sta VGI_RX1
; lda #58
; sta VGI_RY1
; lda #8
; sta VGI_RXRUN
; lda #20
; sta VGI_RYRUN
; jsr vgi_simple_rectangle
lda #<jhonka_string
sta OUTL
lda #>jhonka_string
@ -273,8 +262,33 @@ jhonka:
;=================
; animate jhonka
lda #19
sta CURSOR_X
lda #83
sta CURSOR_Y
animation_loop:
lda #<jhonka1
sta INL
lda #>jhonka1
sta INH
jsr hgr_draw_sprite_42x31
jsr wait_until_keypress
lda #<jhonka2
sta INL
lda #>jhonka2
sta INH
jsr hgr_draw_sprite_42x31
jsr wait_until_keypress
jmp animation_loop
;========================
;========================
; cottage
@ -406,6 +420,7 @@ peasant_text:
;.include "version.inc"
.include "hgr_14x14_sprite_mask.s"
.include "hgr_42x31_sprite.s"
.include "score.s"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,63 @@
;===============================
; hgr 42x31 draw sprite
;===============================
; SPRITE in INL/INH
; Location at CURSOR_X CURSOR_Y
; sprite AT INL/INH
hgr_draw_sprite_42x31:
; set up sprite pointers
lda INL
sta h4231_smc1+1
lda INH
sta h4231_smc1+2
ldx #0 ; X is pointer offset
stx MASK ; actually row
hgr_42x31_sprite_yloop:
lda MASK ; row
clc
adc CURSOR_Y ; add in cursor_y
; calc GBASL/GBASH
tay ; get output ROW into GBASL/H
lda hposn_low,Y
sta GBASL
lda hposn_high,Y
sta GBASH
ldy CURSOR_X
tya
clc
adc #6
sta h4231_width_smc+1
h3231_inner_loop:
h4231_smc1:
lda $d000,X ; or in sprite
sta (GBASL),Y ; store out
inx
iny
h4231_width_smc:
cpy #6
bne h3231_inner_loop
inc MASK ; row
lda MASK ; row
cmp #31
bne hgr_42x31_sprite_yloop
rts

View File

@ -46,6 +46,8 @@ ending_sprites.inc: end_sprites.png
$(HGR_SPRITE) -l baby9_mask end_sprites.png 42 156 55 170 >> ending_sprites.inc
$(HGR_SPRITE) -l baby10_sprite end_sprites.png 14 173 27 187 >> ending_sprites.inc
$(HGR_SPRITE) -l baby10_mask end_sprites.png 42 173 55 187 >> ending_sprites.inc
$(HGR_SPRITE) -l jhonka1 end_sprites.png 105 84 145 115 >> ending_sprites.inc
$(HGR_SPRITE) -l jhonka2 end_sprites.png 105 121 145 152 >> ending_sprites.inc
clean:
rm -f *~ inventory_sprites.inc ending_sprites.inc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB