Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: SirCmpwn on March 26, 2011, 02:30:22 pm
-
Hello,
I whipped up this ridiculously small sprite converter program this morning, for those of you feeling the crunch of less memory. It will convert the 8x8 sprite in the top left corner of the screen to hex for you, weighing only 60 bytes! I challenge - no, I *dare* you to make a smaller sprite converter.
Note: This was inspired by re-reading this post: http://ourl.ca/8639/161291 (http://ourl.ca/8639/161291)
-
Hello,
I whipped up this ridiculously small sprite converter program this morning, for those of you feeling the crunch of less memory. It will convert the 8x8 sprite in the top left corner of the screen to hex for you, weighing only 60 bytes! I challenge - no, I *dare* you to make a smaller sprite converter.
Note: This was inspired by re-reading this post: http://ourl.ca/8639/161291 (http://ourl.ca/8639/161291)
That looks sweet, but you don't even ClrDraw =P I know it's for the speed and size :P
-
That looks sweet, but you don't even ClrDraw =P I know it's for the speed and size :P
I don't do anything that would take up any size. I don't even turn off the run indicator. This is in pure assembly, I'm just displaying the raw bytes from the graph screen.
-
That looks sweet, but you don't even ClrDraw =P I know it's for the speed and size :P
I don't do anything that would take up any size. I don't even turn off the run indicator. This is in pure assembly, I'm just displaying the raw bytes from the graph screen.
Will you post the code, though?
-
Will you post the code, though?
-
Wow's that amazingly small :O I still prefer a more GUI-based editor though, like your other converter.
Is this supposed to be a proof-of concept thing?
-
Wow's that amazingly small :O I still prefer a more GUI-based editor though, like your other converter.
Is this supposed to be a proof-of concept thing?
Note: This was inspired by re-reading this post: http://ourl.ca/8639/161291 (http://ourl.ca/8639/161291)
-
Nice, I guess it's good to see these tools as small as possible, especially if you have many small programs.
I'M starting to wonder if we will need a project/releases sub-forum just for sprite editors, converters and map editors now, though. O.O (no offense)
-
I took SirCmpwn's challenge/dare. Here's my own tiny sprite converter for the TI-86. It's 39 bytes of code/53 bytes on calc. It might be one byte larger if you port it to the 83+ because you can't jump straight to a bcall (or can you?).
EDIT: Derp, I finally saw the mistake in one of the comments. Where it says "height" in "height of graph screen in bytes", it should say "width". Oh well. :D
-
Snap CmPwn your bluff just got called :O
-
Nice. I wonder if there are any sprite routines for BASIC programmers on the 86 and if the Asm() command is as slow to launch as the one on the 83+ (due to VAT)? I never got to see an hybrid BASIC game for the 86 before and it would be nice to port some 83+ games using them. (although since 86 BASIC is slower than the 82/83/84/85 it might pose a problem).
-
Well, at first I thought the challenge was to store the sprite in a string in Ans (so you can recall it into an Axe program.) Then I looked at SirCmpwn's version and realized the challenge was just to display the string on screen. :)
My first version (store the string in Ans) is 39 bytes of code:
ld hl,16
B_CALL CreateTStrng
inc de
ld hl,plotSScreen
loop1: ld b,2
loop: xor a
rld
daa
add a,-16
adc a,40h
inc de
ld (de),a
djnz loop
ld a,l
add a,12
ld l,a
cp 95h
jr c,loop1
B_CALL OP4ToOP1
B_CALL StoAns
ret
(I feel like this could be optimized a little more.)
My second version (display the string on screen) is 26 bytes of code:
ld hl,plotSScreen
loop1: ld b,2
loop: xor a
rld
daa
add a,-16
adc a,40h
B_CALL PutC
djnz loop
ld a,l
cp h
ret nc
add a,12
ld l,a
jr loop1
-
Daaaaaaaaamn
-
In 83/84 basic, I got it down to 99 bytes with a one letter program name. Wabbit crashed upon export, so I have no proof of it, but I doubt if it can get any smaller.
Edit: If I just have to display it, I can make it smaller (if anyone cares). :P
-
okay, that's why Drew doesn't start with a B. Nicely nicely done FloppusMaximus.
-
okay, that's why Drew doesn't start with a B. Nicely nicely done FloppusMaximus.
Lol >.> Sir will kill you. :P
-
okay, that's why Drew doesn't start with a B. Nicely nicely done FloppusMaximus.
Lol >.> Sir will kill you. :P
Oh, most definitely. It was fun while it lasted though.
-
/me disembowels graphmastur and shoves his head where the bowels resided until very recently
In all seriousness, I spent less than 5 minutes on this program.
-
Wow nice, that's quite fast.
-
/me disembowels graphmastur and shoves his head where the bowels resided until very recently
In all seriousness, I spent less than 5 minutes on this program.
Wow, how painful.
-
In 83/84 basic, I got it down to 99 bytes with a one letter program name. Wabbit crashed upon export, so I have no proof of it, but I doubt if it can get any smaller.
Edit: If I just have to display it, I can make it smaller (if anyone cares). :P
Check the new topic I made in the TI-BASIC sub-forum ;)
-
FloppusMaximus, what is this?
ld a,l
cp h
ret nc
How did you even come up with that?
-
Genius O.o
-
Magic! ;)
(Well, actually, serendipity. I had just done the math to check that 8-bit additions would be sufficient, so I happened to notice that H was just the right value to compare to at that point. As you can see, plotSScreen + 7 * 12 = 9394h.)