Page 1 of 1

A little voxel-demo

Posted: Wed Mar 03, 2010 6:58 pm
by Nox
Haven't found one here, so I had to do it...

Image

Yes, in one corner I built a little "city" :)
That could look better of course with some fine-tuning (and a mapeditor...)

so here's the file
voxel.tap

- Uses a hires display with virtual 40 x 100 pixel.
- Mapsize is 128 x 128 (byte), using 5 bit for height and 3 bit for color
(in fact, it uses the whole 8 bit to determine the color, so one could use more bits for height).
- 8 altitude-levels for the player, view-distance is 16.
- The voxel part could be optimized, but the drawing itself is quite fast I think.
I draw a whole column on the stack (up to 100 byte!), and then copy it to the screen with just a long list of

Code: Select all

  pla:sta $A000,x    
  pla:sta $A050,x
  pla:sta $A0A0,x
  ...
  
jumping to the appropriate start-location and pokeing a jmp to the appropriate end-location in advance.
So 12 cycles per "pixel" (just for drawing), and in the main loop I have X and Y free for other things and don't have to worry about screen-positions.
- It's fast enough that the from-left-to-right-screen-update doesn't look to bad, and at 2/4 mhz you really have a feeling of "flying" :)

ps:
- "rotate map" will in fact not rotate the map, but move the player in a circle around the map, always looking to the center.
It draws 128 frames, so have some patience or get some coffee...

Posted: Wed Mar 03, 2010 8:30 pm
by Dbug
Using the stack, smart :)

Posted: Wed Mar 03, 2010 8:48 pm
by Chema
This is really amazing Nox... Incredible what you achieved in so little time!

Congratulations!

Posted: Wed Mar 03, 2010 10:16 pm
by Twilighte
ok, Nox.. can we now have Outcast on the Oric? :P
Man that demo is incredible.. Wow!

Posted: Sat Mar 13, 2010 10:26 pm
by Nox
Outcast, hm... probably not this year ;)
Dbug wrote:Using the stack, smart :)
Yes, and sometimes you get some really interesting graphics on the screen when
making mistakes (I had expected the emulator to just freeze when poping/pushing
a differing amount of bytes, but sometimes the result was still playable many seconds)

Posted: Sun Mar 14, 2010 5:23 pm
by kamelito
Nice demo, if you can't do Outcast this year you can maybe do Rescue on Fractalus ;) (how about Captain Blood)

kml

Nox wrote:Outcast, hm... probably not this year ;)
Dbug wrote:Using the stack, smart :)
Yes, and sometimes you get some really interesting graphics on the screen when
making mistakes (I had expected the emulator to just freeze when poping/pushing
a differing amount of bytes, but sometimes the result was still playable many seconds)

Re: A little voxel-demo

Posted: Wed Jun 19, 2013 9:40 pm
by Dbug
It's been a while, I was wondering if you could release the source code :)

Re: A little voxel-demo

Posted: Fri Oct 21, 2016 9:02 pm
by ThomH
The original file link is now broken. Did anybody preserve this demo?

Re: A little voxel-demo

Posted: Sat Oct 22, 2016 6:43 am
by coco.oric
I got it, three times in some backup directories ... now i've saved 70 ko on my hd

Re: A little voxel-demo

Posted: Mon Oct 24, 2016 2:56 pm
by ThomH
coco.oric wrote:I got it, three times in some backup directories ... now i've saved 70 ko on my hd
Thanks! It's a pretty cool demo.