mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-27 07:30:12 +00:00
peasant: work on adding item sprites
This commit is contained in:
parent
6b45f182d9
commit
c1a176279b
44
games/peasant/hgr_2x16_sprite.s
Normal file
44
games/peasant/hgr_2x16_sprite.s
Normal file
@ -0,0 +1,44 @@
|
||||
;======================
|
||||
; hgr 2x16 draw sprite
|
||||
;======================
|
||||
; Note: NOT TRANSPARENT
|
||||
;
|
||||
; SPRITE in INL/INH
|
||||
; Location at CURSOR_X*7 CURSOR_Y
|
||||
; X, Y, A trashed
|
||||
|
||||
hgr_draw_sprite_2x16:
|
||||
|
||||
; set up pointers
|
||||
lda INL
|
||||
sta hds2_smc1+1
|
||||
lda INH
|
||||
sta hds2_smc1+2
|
||||
|
||||
ldx #0
|
||||
hgr_2x16_sprite_yloop:
|
||||
txa
|
||||
pha
|
||||
|
||||
clc
|
||||
adc CURSOR_Y
|
||||
|
||||
tax
|
||||
lda hposn_low,X
|
||||
sta GBASL
|
||||
lda hposn_high,X
|
||||
sta GBASH
|
||||
|
||||
pla
|
||||
tax
|
||||
|
||||
ldy CURSOR_X
|
||||
hds2_smc1:
|
||||
lda $D000
|
||||
sta (GBASL),Y
|
||||
|
||||
inx
|
||||
cpx #16
|
||||
bne hgr_2x16_sprite_yloop
|
||||
|
||||
rts
|
@ -180,9 +180,12 @@ handle_inv_keypress:
|
||||
and #$7f ; clear top bit
|
||||
|
||||
cmp #27
|
||||
beq done_inv_keypress ; ESCAPE
|
||||
beq urgh_done ; ESCAPE
|
||||
cmp #$7f
|
||||
beq done_inv_keypress ; DELETE
|
||||
bne inv_check_down ; DELETE
|
||||
|
||||
urgh_done:
|
||||
jmp done_inv_keypress
|
||||
|
||||
inv_check_down:
|
||||
cmp #$0A
|
||||
@ -269,6 +272,24 @@ inv_done_moving:
|
||||
ldy INVENTORY_Y
|
||||
jsr overwrite_entry
|
||||
|
||||
;================
|
||||
; draw item
|
||||
|
||||
; ldy INVENTORY_Y
|
||||
|
||||
lda #<arrow_sprite
|
||||
sta INL
|
||||
lda #>arrow_sprite
|
||||
sta INH
|
||||
|
||||
lda #18
|
||||
sta CURSOR_X
|
||||
lda #88
|
||||
sta CURSOR_Y
|
||||
|
||||
jsr hgr_draw_sprite_2x16
|
||||
|
||||
|
||||
;================
|
||||
; repeat
|
||||
|
||||
@ -711,3 +732,20 @@ 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
|
||||
|
||||
|
||||
.include "hgr_2x16_sprite.s"
|
||||
|
BIN
games/peasant/sprites/inventory.png
Normal file
BIN
games/peasant/sprites/inventory.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -20,8 +20,7 @@ PEASANT_PRIORITY = $30
|
||||
|
||||
|
||||
INVENTORY_MASK = $60
|
||||
INVENTORY_X = $61
|
||||
INVENTORY_Y = $62
|
||||
INVENTORY_Y = $61
|
||||
|
||||
CURSOR_X = $63
|
||||
CURSOR_Y = $64
|
||||
|
Loading…
x
Reference in New Issue
Block a user