diff --git a/games/peasant/Makefile b/games/peasant/Makefile index 7d0d903c..531d45d3 100644 --- a/games/peasant/Makefile +++ b/games/peasant/Makefile @@ -107,6 +107,7 @@ PEASANT2: peasant2.o peasant2.o: peasant2.s zp.inc \ graphics/graphics_peasant2.inc sprites/peasant_sprite.inc \ graphics/priority_peasant2.inc \ + sprites/inventory_sprites.inc \ draw_box.s hgr_rectangle.s hgr_font.s hgr_input.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 \ @@ -182,6 +183,9 @@ graphics_copy/copy_graphics.inc: cd graphics_copy && make +sprites/inventory_sprites.inc: + cd sprites && make + ### clean: diff --git a/games/peasant/hgr_2x16_sprite.s b/games/peasant/hgr_2x16_sprite.s index 115c99f1..0e9ca717 100644 --- a/games/peasant/hgr_2x16_sprite.s +++ b/games/peasant/hgr_2x16_sprite.s @@ -12,14 +12,26 @@ hgr_draw_sprite_2x16: ; set up pointers lda INL sta hds2_smc1+1 + sta hds2_smc2+1 lda INH sta hds2_smc1+2 + sta hds2_smc2+2 + +; clc +; lda INL +; adc #1 +; sta hds2_smc2+1 +; lda #0 +; adc INH +; sta hds2_smc2+2 ldx #0 hgr_2x16_sprite_yloop: txa pha + lsr + clc adc CURSOR_Y @@ -34,11 +46,18 @@ hgr_2x16_sprite_yloop: ldy CURSOR_X hds2_smc1: - lda $D000 + lda $D000,X sta (GBASL),Y inx - cpx #16 + iny + +hds2_smc2: + lda $D000,X + sta (GBASL),Y + + inx + cpx #32 bne hgr_2x16_sprite_yloop rts diff --git a/games/peasant/inventory.s b/games/peasant/inventory.s index 31ef922d..1347d4b1 100644 --- a/games/peasant/inventory.s +++ b/games/peasant/inventory.s @@ -275,11 +275,11 @@ inv_done_moving: ;================ ; draw item -; ldy INVENTORY_Y + ldy INVENTORY_Y - lda #arrow_sprite + lda inv_sprite_table_high,Y sta INH lda #18 @@ -733,19 +733,55 @@ overwite_char_smc: masks: .byte $01,$02,$04,$08, $10,$20,$40,$80 - - -arrow_sprite: - .byte $00,$00,$00,$00,$00,$00,$00,$00 - .byte $00,$00,$00,$00,$00,$00,$00,$00 - .byte $00,$00,$00,$00,$00,$00,$00,$00 - .byte $00,$00,$00,$00,$00,$00,$00,$00 - no_sprite: .byte $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f .byte $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f .byte $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f .byte $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f +inv_sprite_table_low: + .byte arrow_sprite + .byte >baby_sprite + .byte >kerrek_belt_sprite + .byte >chicken_feed_sprite + .byte >bow_sprite + .byte >mask_sprite + .byte >pebbles_sprite + .byte >pills_sprite + .byte >riches_sprite + .byte >robe_sprite + .byte >soda_sprite + .byte >sub_sprite + .byte >trinket_sprite + .byte >troghelm_sprite + .byte >trogshield_sprite + .byte >trogsword_sprite + .byte >no_sprite + .byte >tshirt_sprite + + + + +.include "sprites/inventory_sprites.inc" .include "hgr_2x16_sprite.s" diff --git a/games/peasant/sprites/Makefile b/games/peasant/sprites/Makefile new file mode 100644 index 00000000..0744018d --- /dev/null +++ b/games/peasant/sprites/Makefile @@ -0,0 +1,32 @@ +HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite + +all: inventory_sprites.inc + +inventory_sprites.inc: inventory.png + $(HGR_SPRITE) -l arrow_sprite inventory.png 14 3 27 19 > inventory_sprites.inc + $(HGR_SPRITE) -l baby_sprite inventory.png 14 20 27 36 >> inventory_sprites.inc + $(HGR_SPRITE) -l kerrek_belt_sprite inventory.png 14 37 27 53 >> inventory_sprites.inc + $(HGR_SPRITE) -l chicken_feed_sprite inventory.png 14 54 27 70 >> inventory_sprites.inc + $(HGR_SPRITE) -l bow_sprite inventory.png 14 71 27 87 >> inventory_sprites.inc + $(HGR_SPRITE) -l mask_sprite inventory.png 14 88 27 104 >> inventory_sprites.inc + $(HGR_SPRITE) -l pebbles_sprite inventory.png 14 105 27 121 >> inventory_sprites.inc + $(HGR_SPRITE) -l pills_sprite inventory.png 14 122 27 138 >> inventory_sprites.inc + $(HGR_SPRITE) -l riches_sprite inventory.png 14 139 27 155 >> inventory_sprites.inc + $(HGR_SPRITE) -l robe_sprite inventory.png 42 3 55 19 >> inventory_sprites.inc + $(HGR_SPRITE) -l soda_sprite inventory.png 42 20 55 36 >> inventory_sprites.inc + $(HGR_SPRITE) -l sub_sprite inventory.png 42 37 55 53 >> inventory_sprites.inc + $(HGR_SPRITE) -l trinket_sprite inventory.png 42 54 55 70 >> inventory_sprites.inc + $(HGR_SPRITE) -l troghelm_sprite inventory.png 42 71 55 87 >> inventory_sprites.inc + $(HGR_SPRITE) -l trogshield_sprite inventory.png 42 88 55 104 >> inventory_sprites.inc + $(HGR_SPRITE) -l trogsword_sprite inventory.png 42 105 55 121 >> inventory_sprites.inc +# $(HGR_SPRITE) -l no_sprite inventory.png 42 122 55 138 >> inventory_sprites.inc + $(HGR_SPRITE) -l tshirt_sprite inventory.png 42 139 55 155 >> inventory_sprites.inc + + + + + + + +clean: + rm *~ inventory_sprites.inc diff --git a/games/peasant/sprites/inventory.png b/games/peasant/sprites/inventory.png index f56a1d2c..8ea34056 100644 Binary files a/games/peasant/sprites/inventory.png and b/games/peasant/sprites/inventory.png differ