Page 3 of 3

Posted: Fri 25 Nov, 2005 10:22 pm
by Jim e
Rotating sprite like that doesn't look to good. BUt I think I have a way fo a 15 byte routine, but its a real strech.

Code: Select all

:--------------------------------------------
;Rotate tile by James Montelongo
;input:
;DE = 8x8 tile
;HL = 32 byte buffer(page aligned)
;BC = $1F1E equals Clockwise
;     $1716 equals Counter Clockwise
;
;Output:
;If rotated clockwise data at H*256+$16
;If rotated  counter-clockwise data at H*256+$0E
;
;Size: 15 Bytes

Rotate:
    ld (R_inloop+1),bc
rotateloop:
    ld a,(de)
    inc de
    ld l,c
R_inloop:
    rl (hl)
    rla
    dec l
    jr nz,R_inloop
    djnz rotateloop
    ret
That's just a theory, probably works.

Posted: Fri 25 Nov, 2005 10:37 pm
by CoBB
Given the right specification on DE it should work; it should point B-8 bytes before the input sprite as a first guess.

Posted: Fri 25 Nov, 2005 11:43 pm
by DarkerLine

Code: Select all

;Rotate tile
;
;Input:
;HL -> 8x8 tile 
;If you want to rotate the tile clockwise
;DE -> tile, rotated clockwise
;If you want to rotate the tile counterclockwise
;DE -> tile, rotated counterclockwise
;
;Output: 
;rotated tile at DE
; 
;Size: 1 byte

Rotate: ret

Posted: Sat 26 Nov, 2005 4:01 am
by Jim e
tr1p1ea wrote:Seems like this turned into a combined effort. Maybe next comp people should submit routines which will only be revealed when the comp ends?
Yeah true, it does seem like we inspired each other in some respect. You know I just noticed how much my last attempt looks like you deleted 3rd attempt. But then again i think 12 bytes would be the smallest theoretical size, so only the most basic instructions could remain.

I really think we should go for speed next based on a size limit. Because we bend the rules so much the routine almost becomes unusable(at least in a practical sense). As far as judging goes, perhaps cobb could add a tstate counter to pindur. :wink:

Posted: Sat 26 Nov, 2005 4:36 am
by Liazon
Please don't laugh at the newbie, but the goal does not include copying the rotated sprite onto the LCD screen, rite?

I don't think I could make anything better than any of you. I don't recognize half of the commands that CoBB, tr1p1ea, and Jim e used.

Can code be explained to us after the competition is over?

Posted: Sat 26 Nov, 2005 8:49 am
by CoBB
Certainly, but why don't you grab an instruction reference and work it out yourself? It's not a long routine after all, and it would be a good exercise for you.

Posted: Sun 27 Nov, 2005 10:41 am
by tr1p1ea
Important areas to read up on would be shift and rotate instructions. They are important and very useful.

Posted: Sun 27 Nov, 2005 1:07 pm
by CoBB
Read: indispensable. :)

Posted: Sun 27 Nov, 2005 5:46 pm
by Liazon
CoBB wrote:Read: indispensable. :)
of course I know reading is important. Almost all of the things I've learned comes from reading, not from some school teacher (english is an exception). I just didn't realize there were so many resources until after i joined the Ti community forums.

okay, I read about rra for the Ti-86, i'll just assume it's the same on Ti-83+. But how is shifting through the carry flag different from rca? was that the other one?

Posted: Sun 27 Nov, 2005 6:22 pm
by DarkerLine
Read over http://nwps.ws/~dragonfire/Asmin28/lesson/day09.html once, to get the general idea of how shift instructions work. Then when you need them, look back over that page to figure out which instruction it is that you need.

Posted: Sat 10 Dec, 2005 9:34 pm
by threefingeredguy
I wrote one, but it was like, 80 bytes, so I don't think I will post it.

Posted: Wed 14 Dec, 2005 4:26 am
by kalan_vod
threefingeredguy wrote:I wrote one, but it was like, 80 bytes, so I don't think I will post it.
I think it would be benifital to us who are new to asm :P.

Posted: Wed 14 Dec, 2005 8:47 pm
by Liazon
Ya, same here. I wish I could learn more ASM, but school takes up such a huge chunk of my time.

Posted: Wed 14 Dec, 2005 10:28 pm
by threefingeredguy
Lemme find it, I wrote it on a piece of paper during calculus and I'm not sure if I still have it, nor if I used the instructions correctly. Bleh, I shouldn't have said anything.

Posted: Mon 09 Jan, 2006 11:13 am
by soinsg
Isn't this comp. passed the deadline? Someone should update the original thread with better rules or a winner.