Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .nolist
- #include "ti83plus.inc"
- #include "dcs7.inc"
- .list
- .org userMem-2
- .db $BB,$6D
- Init:
- B_CALL (_ClrLCDFull)
- ld hl,0
- Loop:
- ld b,8
- ld ix,MyImage
- ld a,h
- push hl
- call iPutSprite ;Display Image
- call iFastCopy ;Put it in the buffer
- B_CALL(_GrBufClr) ;Clears the graph screen
- ;Draw line code
- ld h,0
- ld l,63
- ld d,95
- ld e,63
- ld a,1
- call fastline
- ;End of draw line code
- ;Start of gravity code
- ld a,8
- add a,l
- ld e,a ;Sets e to y+8
- ld a,h ;Sets a to x
- call iGetPixel
- ld e,0
- and (hl)
- pop hl
- call z,SetGravity ;If pixel below image is white, y=y+1
- ;End of gravity code
- pop hl
- ld a,l
- add a,e
- ld l,a
- ;Getkeys code
- ld a,$FE
- out (1),a
- nop
- nop
- nop
- in a,(1)
- bit 1,a
- call z,CheckMoveLeft
- bit 2,a
- call z,CheckMoveRight
- bit 3,a
- call z,CheckMoveUp
- ;End of getkeys code
- jp Loop
- SetGravity:
- ld e,0
- inc e
- ret
- CheckMoveUp:
- push af
- ld a,l
- cp 0
- call nz,MoveUp
- pop af
- ret
- MoveUp:
- dec l
- dec l
- ret
- CheckMoveLeft:
- push af
- ld a,h
- cp 0
- call nz,MoveLeft
- pop af
- ret
- MoveLeft:
- dec h
- dec h
- ret
- CheckMoveRight:
- push af
- ld a,h
- cp 87
- call c,MoveRight
- pop af
- ret
- MoveRight:
- inc h
- inc h
- ret
- MyImage:
- .db $FF,$81,$81,$81,$81,$81,$81,$FF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement