[TI ASM] stupid sprite..
Moderator: MaxCoderz Staff
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
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?)
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?)
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.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
Relax - the first steps into ASM programming are always the hardest. You'll get the hang of it with time.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..
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.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am