Page 3 of 3

Posted: Thu 24 Aug, 2006 2:46 pm
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?

Posted: Thu 24 Aug, 2006 2:48 pm
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?)

Posted: Sat 26 Aug, 2006 2:56 am
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.

Posted: Sat 26 Aug, 2006 3:08 am
by qarnos
EDIT: Big Oops! I misread what you were trying to do. My bad!

Posted: Sun 27 Aug, 2006 6:02 am
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..

Posted: Sun 27 Aug, 2006 6:31 am
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.

Posted: Sun 27 Aug, 2006 7:50 am
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..