Woah that looks great! :O Also, screenshot 2 gave me some ideas since the tiles were from supersonic ball, but of course I would need to learn how to do mode 7 (and have it run fast) on the HP Prime. :POh I didn't notice that :P
This does look awesome Matref! ;D Damn shame it isn't a bit faster though. :/I swear I tried to make it fast though :/ I don't think there's much to be done about it in Axe.
That really does look cool! Is there a source? If I ever get free time, I might want to look into optimizing it with assembly or something.I'm sure you can make it at least twice faster with ASM, because if I had to make the drawing code in C it would be (direct translation from Axe) :
for(y = 0; y < 64; y++)
for(x = 0; x < 96; x++)
plotSScreen[y * 96 + x] = texture[ (ylut[y * 96 + x] & 7) * 8 + xlut[y * 96 + x] ];
I'm sure you can make it at least twice faster with ASM, because if I had to make the drawing code in C it would be (direct translation from Axe) :Code: [Select]for(y = 0; y < 64; y++)
for(x = 0; x < 96; x++)
plotSScreen[y * 96 + x] = texture[ (ylut[y * 96 + x] & 7) * 8 + xlut[y * 96 + x] ];
Lemme get on my PC and I'll attach the source.
;°xlut -> A
;°ylut -> B
Render:
ld hl, plotsScreen
push hl
RenderLoop:
ld c, 8
xor a
ByteLoop:
ld hl, (A)
ld b, (hl)
ld hl, (B)
ld e, (hl)
ld d, 0
ld hl, texture
add hl, de
ld d, (hl)
inc b
TexelLoop:
sra d
djnz TexelLoop
set 0, a
jr c, TexelEnd
res 0, a
TexelEnd:
ld hl, (A)
inc hl
ld (A), hl
ld hl, (B)
inc hl
ld (B), hl
sla a
dec c
jr nz, ByteLoop
rr a
pop hl
ld (hl), a
inc hl
push hl
ld de, Plotsscreen+768
or a
sbc hl, de
jr z, RenderLoop
pop hl
ret
You don't need to unpack anything. Just store a number from 1-64 which corresponds with the index of each pixel in the texture as if it was a 1-D array.Oh that's actually a good idea. I'll try and see how faster it is.
As I seldom have access to my PC, that will require some time before testing.I'm sure you can make it at least twice faster with ASM, because if I had to make the drawing code in C it would be (direct translation from Axe) :Code: [Select]for(y = 0; y < 64; y++)
for(x = 0; x < 96; x++)
plotSScreen[y * 96 + x] = texture[ (ylut[y * 96 + x] & 7) * 8 + xlut[y * 96 + x] ];
Lemme get on my PC and I'll attach the source.
I hope this code is slightely faster, but I haven't been able to test it, so I'm not sure if it even works.Code: [Select];°xlut -> A
;°ylut -> B
Render:
ld hl, plotsScreen
push hl
RenderLoop:
ld c, 8
xor a
ByteLoop:
ld hl, (A)
ld b, (hl)
ld hl, (B)
ld e, (hl)
ld d, 0
ld hl, texture
add hl, de
ld d, (hl)
inc b
TexelLoop:
sra d
djnz TexelLoop
set 0, a
jr c, TexelEnd
res 0, a
TexelEnd:
ld hl, (A)
inc hl
ld (A), hl
ld hl, (B)
inc hl
ld (B), hl
sla a
dec c
jr nz, ByteLoop
rr a
pop hl
ld (hl), a
inc hl
push hl
ld de, Plotsscreen+768
or a
sbc hl, de
jr z, RenderLoop
pop hl
ret
// usual for loops, x, y
plotSScreen[y * 96 + x] = texture[ tlut[y * 96 + x] ];
I'll put a pointer to texture in $8000 and a pointer to tlut in $8002.
:for(A,0,6144)
:plotsScreen[A] = texture[tlut[A]]
:End
Asm(214093E50E08AF2A02805E160021(°Texture)1946CBC7CB402802CB872A028023220280CB270D20E1CB1FE17723E5114096B7ED5220D0E1)
I have dissasembled it to see if I converted it to HEX correctly, and it was, but what I don't know is if my assembly code is fully correct, so backup your data just in case.Render:
ld hl, plotsScreen
push hl
RenderLoop:
ld c, 8
xor a
ByteLoop:
ld hl, ($8002)
ld e, (hl)
ld d, 0
ld hl, texture
add hl, de
ld b, (hl)
set 0, a
bit 0, b
jr z, TexelEnd
res 0, a
TexelEnd:
ld hl, ($8002)
inc hl
ld ($8002), hl
sla a ;optimization: add a, a
dec c
jr nz, ByteLoop
rr a
pop hl
ld (hl), a
inc hl
push hl
ld de, Plotsscreen+768
or a
sbc hl, de
jr nz, RenderLoop
pop hl
ret
#comment
HEX:
214093E5 -> 4 bytes
RenderLoop:
0E08AF -> 3 bytes
ByteLoop:
2A02805E1600 -> 6 bytes
21(°Texture) -> 3 bytes ld hl, texture
1946CBC7CB40 -> 6 bytes
2802 -> 2 bytes jr z, TexelEnd
CB87 -> 2 bytes
TexelEnd:
2A028023220280CB270D -> 10 bytes
20E1 -> 2 bytes jr nz, ByteLoop
CB1FE17723E5114096B7ED52 -> 12 bytes
20D0 -> 2 bytes jr nz, renderLoop
E1 -> 1 byte
TOTAL COMMAND:
Asm(214093E50E08AF2A02805E160021(°Texture)1946CBC7CB402802CB872A028023220280CB270D20E1CB1FE17723E5114096B7ED5220D0E1)
#endcomment
Glad to hear that it helped. This would be a great effect to have for a demoscene program. Speaking of demoscene, you should have a magnifying lens effect, as was common in demos for older systems. Also, if you want the GIFs to be smoother, crank up the framerate setting in Wabbitemu.We're not talking about the same thing here. Lens effect can't be achieved with a single formula for U and V, it needs a whole algorithm.
We're not talking about the same thing here. Lens effect can't be achieved with a single formula for U and V, it needs a whole algorithm.Here's something I put together quickly that produces the lens effect as a function of UV.
#ifdef TELEPORT_EFFECT
u = a;
v = 1./(r + sin(r + time));
#endif
TELEPORTATION TIME! \o/
Bump,
So my demo made it on Pouet ! :w00t: https://www.pouet.net/prod.php?which=62454
And ticalc too ! :D http://www.ticalc.org/archives/files/fileinfo/458/45819.html
Let's spam the staff with mails saying to feature it :evillaugh:
Final gif :
(http://www.ticalc.org/archives/files/ss/851/85138.gif)
My turn!
I was convinced this effect could be made faster, and after a lot of careful thought and crazy tricks, I managed to bump up the FPS: from 14.3 to 18.5, an improvement of about 30%! Again, it is running at 15MHz. It may look slightly different, as I had to rotate the texture up and right by one pixel per frame (rather than down and right) due to complications of the immensely aggressive optimization. I'll attach the source to this post, but be warned that there's a still a bug that I haven't had the time to hunt down which crashes the calculator with fair frequency upon exiting. But here's a gif, proving that it does indeed work:
(http://i.imgur.com/VlOGcAc.gif)Spoiler For Oh, and did I mention...:
Okay what the actual fuck. So you're getting 18.5, then 44, then 107 FPS ? You overclocked your calc or what.
EDIT : tested and yes. I see you actually wrote your own code, only taking my deformation functions. I can't understand shit to what you wrote, so yeah.
I find it actually a bit desperating, how whatever code we come with you can make it 600% faster.
My turn!Do you think this could be made into a mode 7 engine?
I was convinced this effect could be made faster, and after a lot of careful thought and crazy tricks, I managed to bump up the FPS: from 14.3 to 18.5, an improvement of about 30%! Again, it is running at 15MHz. It may look slightly different, as I had to rotate the texture up and right by one pixel per frame (rather than down and right) due to complications of the immensely aggressive optimization. I'll attach the source to this post, but be warned that there's a still a bug that I haven't had the time to hunt down which crashes the calculator with fair frequency upon exiting. But here's a gif, proving that it does indeed work:
(http://i.imgur.com/VlOGcAc.gif)Spoiler For Oh, and did I mention...:
Disp:
ld (spSave),sp
ld c,$20
ld a,$80
out ($10),a
ld sp,(LUT)
ColLoop:
ld de,64*256+%11111110
ld hl,ColLoop
ld a,c
inc c
ld b,7
djnz $
out ($10),a ;152cc into, 153cc loop
cp $2C
ld a,e
ret c
ld sp,(spSave)
;Pixel:
add a,a ;or adc, a a
ret c
out ($11),a ;147cc into, 148cc loop
ld a,e
scf
dec d
ret nz
jp (hl)
My turn!You could basically port Mario Kart O.O
I was convinced this effect could be made faster, and after a lot of careful thought and crazy tricks, I managed to bump up the FPS: from 14.3 to 18.5, an improvement of about 30%! Again, it is running at 15MHz. It may look slightly different, as I had to rotate the texture up and right by one pixel per frame (rather than down and right) due to complications of the immensely aggressive optimization. I'll attach the source to this post, and here's a gif proving that it does indeed work:
(http://i.imgur.com/VlOGcAc.gif)Spoiler For Oh, and did I mention...: