Questions about the 'Rotate that sprite'

Moderator: MaxCoderz Staff

User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post 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.
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post 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.
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post 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
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post 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:
Image
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post 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?
Image Image Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post 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.
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 »

Important areas to read up on would be shift and rotate instructions. They are important and very useful.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

Read: indispensable. :)
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post 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?
Image Image Image
DarkerLine
Calc Wizard
Posts: 526
Joined: Tue 08 Mar, 2005 1:37 am
Location: who wants to know?
Contact:

Post 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.
just try to be nice to people.
_________________
My TI Blog - http://mpl.unitedti.org/
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I wrote one, but it was like, 80 bytes, so I don't think I will post it.
Image
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post 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.
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

Ya, same here. I wish I could learn more ASM, but school takes up such a huge chunk of my time.
Image Image Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post 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.
Image
soinsg
New Member
Posts: 25
Joined: Fri 18 Feb, 2005 12:35 am

Post by soinsg »

Isn't this comp. passed the deadline? Someone should update the original thread with better rules or a winner.
Post Reply