diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 4abd99a5..ed750f87 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -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 diff --git a/games/peasant/ending.s b/games/peasant/ending.s index 08a13f10..4406e4b6 100644 --- a/games/peasant/ending.s +++ b/games/peasant/ending.s @@ -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 @@ -273,8 +262,33 @@ jhonka: ;================= ; animate jhonka + lda #19 + sta CURSOR_X + lda #83 + sta CURSOR_Y + +animation_loop: + + lda #jhonka1 + sta INH + + jsr hgr_draw_sprite_42x31 + jsr wait_until_keypress + 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" diff --git a/games/peasant/graphics_end/jhonka.png b/games/peasant/graphics_end/jhonka.png index e92304df..dd9632d6 100644 Binary files a/games/peasant/graphics_end/jhonka.png and b/games/peasant/graphics_end/jhonka.png differ diff --git a/games/peasant/hgr_42x31_sprite.s b/games/peasant/hgr_42x31_sprite.s new file mode 100644 index 00000000..0aaaee31 --- /dev/null +++ b/games/peasant/hgr_42x31_sprite.s @@ -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 + diff --git a/games/peasant/sprites/Makefile b/games/peasant/sprites/Makefile index c6214971..b89dbc51 100644 --- a/games/peasant/sprites/Makefile +++ b/games/peasant/sprites/Makefile @@ -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 diff --git a/games/peasant/sprites/end_sprites.png b/games/peasant/sprites/end_sprites.png index eec802cb..fa05e3ea 100644 Binary files a/games/peasant/sprites/end_sprites.png and b/games/peasant/sprites/end_sprites.png differ