- Trying to make sprite routine [TI84+]
- 19 Mar 2016 12:50:07 pm
- Last edited by x190 on 19 Mar 2016 02:13:24 pm; edited 4 times in total
I have been trying to write a routine to display sprites on the ti-84+.
I am trying to do it by accessing the LCD screen hardware port itself.
Here is the most recent attempt. It does create some cool affects though, even if it doesn't work:
Code:
This is sadly, the worst try out of the bunch.
But my idea is as follows:
1. load x,y coords
2. load sprite
3. load 0 into reg de
3.5 Main
4. add de to hl (containing sprite) to grab next line
5. display line of hl
6. increment de
7. test if we have hit 8 lines, if so exit
8. if not, increment y coords
9. go back to Main
9.5 Exit
10. return
Granted knowing me, I have learned z80 asm 100% wrong and should give up.
Another attempt:
Code:
I am trying to get this code, but universal and using a loop:
Code:
Another attempt, getting partial success.
Code:
Again:
Code:
I am trying to do it by accessing the LCD screen hardware port itself.
Here is the most recent attempt. It does create some cool affects though, even if it doesn't work:
Code:
Draw:
ld (Temp),hl
ld d,h
ld e,l
push hl
ld de,0
ld a,$80
out ($10),a
Draw_Main:
pop hl
inc hl
ld a,l
out ($10),a
push hl
ld hl,(Temp)
inc de
add hl,de
ld a,(hl)
out ($11),a
ld a,0
ld e,a
cp 8
jr z,Draw_Quit
jr nz, Draw_Main
Draw_Quit:
ret
This is sadly, the worst try out of the bunch.
But my idea is as follows:
1. load x,y coords
2. load sprite
3. load 0 into reg de
3.5 Main
4. add de to hl (containing sprite) to grab next line
5. display line of hl
6. increment de
7. test if we have hit 8 lines, if so exit
8. if not, increment y coords
9. go back to Main
9.5 Exit
10. return
Granted knowing me, I have learned z80 asm 100% wrong and should give up.
Another attempt:
Code:
Draw:
ld a,$20
inc a
out ($10),a
ld a,$80
inc a
out ($10),a
Draw_Main:
ld a,(hl)
out ($11),a
inc bc
add hl,bc
inc e
ld e,a
cp 8
jr z,Draw
jr nz,Draw_Quit
Draw_Quit:
ret
I am trying to get this code, but universal and using a loop:
Code:
Draw_Drone:
ld a,$20
inc a
out ($10),a
ld a, %00000000
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %00011000
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %01111110
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %11111111
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %11011011
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %11000011
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %01100110
out ($11),a
ld a,$20
inc a
out ($10),a
ld a, %00000000
out ($11),a
ret
Another attempt, getting partial success.
Code:
Draw:
ld bc,0
Draw_Main:
in a,($11)
add hl,bc
ld a,(hl)
out ($11),a
in a,($10)
ld a,$20
inc a
out ($10),a
inc e
ld a,e
cp 8
jr z,Draw_Quit
inc bc
jr nz,Draw_Main
Draw_Quit:
ret
Again:
Code:
Draw:
ld bc,0
Draw_Main:
call _LCD_Ready_
ld hl,Zerg_Drone
add hl,bc
ld (Temp),hl
ld a,(Temp)
out ($11),a
call _LCD_Ready_
ld a,$20
inc a
out ($10),a
inc e
ld a,e
cp 8
jr z,Draw_Quit
inc bc
jr nz,Draw_Main
Draw_Quit:
ret