A82: PutSprite Help


[Prev][Next][Index][Thread]

A82: PutSprite Help



I cant get Putsprite to work look at my code someone please

#include "ti82.h"
#include "oldcall.h"
#include "graph.h"

.org START_ADDR
.db "Sprite",0

Init: 
	ld hl, Sprite
	ld b,10
	ld c,10
Loop:
	ld hl, Sprite
	ld b,10
	ld c,10

	CALL_(PutSprite)
	CALL_(END)
	jr Loop

END:
	call GET_KEY
	cp 15
	ret z
	ret
PutSprite:
 push bc
 push de
 ld a,63
 sub c
 ld c,a
 push hl
 push hl
 ROM_CALL(FIND_PIXEL)
 ld de,$88B8                      ;CHANGED FROM $FC00 is that right?
 add hl,de
 ex de,hl
 pop hl
 ld b,(hl)
 inc hl
 ld c,(hl)
 inc hl
 push hl
 pop ix
 ex de,hl
PS_NewRow:
 push bc
 ld d,(ix)
 inc ix
 push af
 push hl
PS_NewCol:
 rl d
 ld e,a
 jr nc,PS_NoPixel
 or (hl)
 ld (hl),a
 jr PS_NextPixel
PS_NoPixel:
 cpl
 and (hl)
 ld (hl),a
PS_NextPixel:
 ld a,e
 rrca
 jr nc,PS_SameByte
 inc hl
PS_SameByte:
 djnz PS_NewCol
 pop hl
 pop af
 ld de,16
 add hl,de
 pop bc
 dec c
 jr nz,PS_NewRow
 pop hl
 pop de
 pop bc
 ret

Sprite:
.db 6,6 
.db %110011
.db %100001
.db %000000
.db %000000
.db %100001
.db %110011

#include "graph.inc"

.end



Follow-Ups: