MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: Fri 25 Nov, 2005 12:43 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
CoBB, im pretty sure you will have to change your rotating otherwise the sprite will mirror itself as well as rotate.

rra \ rr (hl) instead of rla \ rr (hl).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 2:38 pm 
Offline
MCF Legend

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

_________________
The Independent Z80 Assembly Guide
Acelgoyobis
PindurTI


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 2:43 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
Yeah i put it there as a joke (:)), i consider it below the belt and wouldnt dare try to actually include it in the comp. Perhaps we need a tighter set of rules for future comps which specify the required input and required output (like hl must point to start of rotated sprite on exit).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 2:49 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
tr1p, the 3rd attempt... the only thing it does it mirroring the sprite or something? I am sorry that I am not as good as you guys :$

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 2:52 pm 
Offline
MCF Legend

Joined: Mon 20 Dec, 2004 8:45 am
Posts: 1601
Location: Budapest, Absurdistan
No, the cheat is that you have to ld part of the routine into its place before calling it. :lol:

_________________
The Independent Z80 Assembly Guide
Acelgoyobis
PindurTI


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 2:54 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
The 3rd attempt will rotate correctly, left or right depending on a few inputs :x. Its basically like the first one ... but with a cheat, so its best that it is forgotten about :).

The second one is the best i have so far.

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 3:10 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Wed 15 Dec, 2004 7:26 pm
Posts: 2735
Location: The Hague, Netherlands
Ah, I understand. Tr1p, can you re-post it here? I want to re-read the routine again :)

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 3:16 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
(totally cheating, so dont count this one :)):

Code:
;--------------------------------------------------
; 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

</cheating>

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 8:10 pm 
Offline
Calc King
User avatar

Joined: Sun 26 Dec, 2004 5:27 am
Posts: 2457
Location: SXIOPO = Infinite lives for both players
Okay I cut it down to 17 bytes, though I kinda perfer my first, it's seems more useful.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 8:39 pm 
Offline
MCF Legend

Joined: Mon 20 Dec, 2004 8:45 am
Posts: 1601
Location: Budapest, Absurdistan
Yes, it was nice of the designers of z80 to have inc/dec preserve the carry. ;)

You can shave off another byte by having BC=height*256+9 as the input... I'm not going to post that. :P

_________________
The Independent Z80 Assembly Guide
Acelgoyobis
PindurTI


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 9:40 pm 
Offline
Calc King
User avatar

Joined: Sun 26 Dec, 2004 5:27 am
Posts: 2457
Location: SXIOPO = Infinite lives for both players
Yeah but that seems like out right cheating since 9 never changes. :roll: But i knew you'd find the 16 byte routine.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 9:46 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
Here i come to suggest just that and its already been suggested :).

Seems like this turned into a combined effort. Maybe next comp people should submit routines which will only be revealed when the comp ends?

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 9:55 pm 
Offline
MCF Legend

Joined: Mon 20 Dec, 2004 8:45 am
Posts: 1601
Location: Budapest, Absurdistan
Jim e wrote:
Yeah but that seems like out right cheating since 9 never changes. :roll: But i knew you'd find the 16 byte routine.

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. :)

_________________
The Independent Z80 Assembly Guide
Acelgoyobis
PindurTI


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 10:02 pm 
Offline
Calc King
User avatar

Joined: Sun 26 Dec, 2004 5:27 am
Posts: 2457
Location: SXIOPO = Infinite lives for both players
True, ix is in a similar situation, but it's more than just moving a byte out of the routine and into the user end, it actual detremines something. This contest seems more and more like how far we can bend the rules.


The next contest should be for speed.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 25 Nov, 2005 10:06 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
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 :).*

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 45 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt