Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ld a, cRed
- ld hl, vram
- ld bc, 36*320
- call _MemSet
- ld hl, 2 \ push hl \ push hl
- ld hl, 2 \ push hl
- ld hl, 70
- ld ix, dieValues-1 \ ld b, 5
- dierender_foreach:
- ; we enter this loop with the sprite x and y scale, and y position pushed
- ; the x position is in hl, and the pointer to the die value array -1 is in ix
- push hl
- call sprite_getPointer
- push hl
- call gfx_SSprite
- pop hl
- pop hl
- ld a, b
- ld bc, 34 \ add hl, bc
- ld b, a
- djnz dierender_foreach
- pop hl
- pop hl
- pop hl
- ret
- sprite_getPointer:
- ; in = ix pointing to byte before die value
- ; out = ix advanced 1, hl points to sprite
- inc ix \ ld a, (ix) \ inc a
- ld hl, DieSpritesStart-258
- push bc \ ld bc, 258
- ld b, a
- jumptospriteloop:
- add hl, bc
- djnz jumptospriteloop
- pop bc
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement