[TI ASM] stupid sprite..

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Ummm, that reminds me a lot of the sprite routine from Asm in 28 days :). It is possible that it is finding a blank part of your PIC?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

lol yes it should remind you of the asm in 28 days sprite routine, thats where i learned asm so.. thats only natural (ok then i copied the bits i couldnt think of myself..)
possible, but probebly not, i do have a picture in Pic0 and it does have sprites (im afraid its the pic from your demo, but i had to test it with SOMETHING didnt i?)
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

Code: Select all

		ld de,96
calulateYloop:			;stuff takes care of alignment
	cp 12
	jr c,lessthen12
	add hl,de
	sub 12
	jr calulateYloop
lessthen12:


Hmmm... Why are you adding 96 in each YLoop? Shouldn't it be 12?

This could also be optimised. cp 12 is the same as sub 12, but with the result discarded. Since you end up doing a sub 12 anyway, except on the last iteration, try this:

Code: Select all

        ld      de, 12          ; Try 12 instead of 96
calculateYLoop:
        sub     e               ; E contains 12 so use that instead of a literal value.
        jr      c, lessthan12
        add     hl, de
        jr      calculateYLoop
lessthan12:
        add     a, e            ; Fix up A so it contains the remainder.
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

EDIT: Big Oops! I misread what you were trying to do. My bad!
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

well i forgot to add 12 to ix again, but it isnt whats wrong about the program, it never displayed anything and it still doesnt..
i think ive proved im an idiot..
User avatar
qarnos
Maxcoderz Staff
Posts: 227
Joined: Thu 01 Dec, 2005 9:04 am
Location: Melbourne, Australia

Post by qarnos »

King Harold wrote:well i forgot to add 12 to ix again, but it isnt whats wrong about the program, it never displayed anything and it still doesnt..
i think ive proved im an idiot..
Relax - the first steps into ASM programming are always the hardest. You'll get the hang of it with time.

So is the program crashing or just not displaying anything?

If it isn't crashing, try forcing some data into the part of the code that is supposed to display the image.

For instance, when you get to the point where you have the byte that needs to be loaded into the graph buffer (ie: ld (hl), a), just insert a line in front of it such as ld a, 255 and see if anything gets displayed. If it does, then the problem is almost certainly that for some reason or other you are trying to display a blank image.

That will at least narrow down the regions of code you need to look at.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

it doesnt crash, it just doesnt do anything..
well probebly some crap but nothing usefull like displaying a sprite
and i think i'll try with loads of $FF's in mem, see if they get displayed..
Post Reply