Questions about the 'Rotate that sprite'
Moderator: MaxCoderz Staff
-
- MCF Legend
- Posts: 1601
- Joined: Mon 20 Dec, 2004 8:45 am
- Location: Budapest, Absurdistan
- Contact:
Yes, I realised it too, I just happened to test it with a symmetric sprite first.
Even if it isn't entirely serious, your third example raises an important concern. After all, we could technically create 0-byte routines by putting them all into the invocation. I saw a similar cheat once in a 256-byte intro: it used a directory structure full of zero-byte files as its data.
The solution would be to count the invocation in some way. We should probably not allow constant input at all, so e. g. if HL must be page aligned, it would be the routine's job to discard the initial value of L.
Even if it isn't entirely serious, your third example raises an important concern. After all, we could technically create 0-byte routines by putting them all into the invocation. I saw a similar cheat once in a 256-byte intro: it used a directory structure full of zero-byte files as its data.
The solution would be to count the invocation in some way. We should probably not allow constant input at all, so e. g. if HL must be page aligned, it would be the routine's job to discard the initial value of L.
- 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:
(totally cheating, so dont count this one ):
</cheating>
Code: Select all
;--------------------------------------------------
; RSprite by tr1p1ea - 13 bytes
;--------------------------------------------------
; Rotates an 8x8 sprite
;
; Input: de = SpriteData
; hl = TempBuffer (page aligned)
; b = # of rows to rotate (usually 8)
; (_rsL) = $1F and (_rsL+2) = $1E for CW
; (_rsL) = $17 and (_rsL+2) = $16 for CCW
;
; Output: hl + 1 = rotated sprite
;
; Remarks: TempBuffer must be page aligned.
; For example equate $8700
;
RSprite:
ld a,(de)
inc de
ld l,8
_rsL:
rra
rr (hl)
dec l
jr nz,_rsL
djnz RSprite
ret
-
- MCF Legend
- Posts: 1601
- Joined: Mon 20 Dec, 2004 8:45 am
- Location: Budapest, Absurdistan
- Contact:
It's no worse than having rotationdir*$808+$1716 in IX. We can make a deep philosophical question about whether one is more legitimate than the other, but we all know the answer anyway.Jim e wrote:Yeah but that seems like out right cheating since 9 never changes. But i knew you'd find the 16 byte routine.
- 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:
Do you think we have done all we can?
Is there a 15 byte routine out there?
Maybe as an extension we could do a 360 rotating routine that will take an 8x8 sprite, rotate it and draw it to gbuf?
EDIT - ok maybe not 360 individual degrees, maybe in 8 degree increments or even 45?
*Also i know that i bent the rules like crazy .*
Is there a 15 byte routine out there?
Maybe as an extension we could do a 360 rotating routine that will take an 8x8 sprite, rotate it and draw it to gbuf?
EDIT - ok maybe not 360 individual degrees, maybe in 8 degree increments or even 45?
*Also i know that i bent the rules like crazy .*