3D cube routine example ?

All 680x0 related coding posts in this section please.

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

3D cube routine example ?

Postby exxos » Sun Jun 07, 2015 9:37 am

Can anyone help code a simple routine in ( resulting in machine code) ? I want to add a 3D test to GemBench , so would need a machine code program I can call and run. Gembench can set the timer before the execution of the code, and just wait for the machine code to exit (maybe after 10 seconds) then I can read the timer again to see how long it took. Though I need someone willing to help code the actual routine. Ideally it would use as many integer divisions as possible to make use of faster CPU speeds.

I'm not looking for anything fancy, just a spinny rotating cube would be ideal. probably geared up for medium resolution, but should also be able to run in other video modes for falcon users who may use higher resolutions or 256 colours etc. I guess it would be ideal if the code would just switch resolution to ST MED RES to prevent some confusion.

There may be some routines out there already, or something in a game menu that could be ripped out I could use. Though need help with all that kinda stuff :)
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Sun Jun 14, 2015 9:45 am

I am still hunting for some 3D code. I guess a 3D rotating cube must have been done in assembler at some point ??
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2945
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: 3D cube routine example ?

Postby AtariZoll » Sun Jun 14, 2015 10:15 am

I saw some simpler 3D sources in past, but need to look after again, because all those sites seem disappeared.
Don't know is medium resolution good idea. I don't know anything done for ST med res. Rotating cube is often done just as playback of prerecorded frames. In case of Ataris (and other oldies) without FPU integer divisions are avoided, even if there is such CPU command, because slowness. Instead it tables with precalculated results are used. Some universal code, for diverse resolutions hardly exists for Ataris, I think.
If you give me some intro (link), I can rip it :D
And something more: for benchmark purpose must remove v-sync from code, otherwise you may experience that rendering time is same on faster CPU .
There is way to stop global warming.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Sun Jun 14, 2015 10:28 am

AtariZoll wrote:I saw some simpler 3D sources in past, but need to look after again, because all those sites seem disappeared.
Don't know is medium resolution good idea. I don't know anything done for ST med res. Rotating cube is often done just as playback of prerecorded frames. In case of Ataris (and other oldies) without FPU integer divisions are avoided, even if there is such CPU command, because slowness. Instead it tables with precalculated results are used. Some universal code, for diverse resolutions hardly exists for Ataris, I think.
If you give me some intro (link), I can rip it :D


Low res is possible, just app runs in medium res.

I have been trying to find some 3D example in a game menu or demo or something, but not having much luck. It is games like castle master which make use of faster cpu speed. So need something to emulate that type of 3D routine. As you say pre-calculated stuff.. is no good for benchmarking testing.

AtariZoll wrote:And something more: for benchmark purpose must remove v-sync from code, otherwise you may experience that rendering time is same on faster CPU .

yes, I saw that in cyberpaint :D
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

wietze
Captain Atari
Captain Atari
Posts: 190
Joined: Fri Mar 01, 2013 10:52 pm

Re: 3D cube routine example ?

Postby wietze » Sun Jun 14, 2015 11:17 am

Have a look at the future minds code in ggns atar master sources. There is a non-precalced 3d there iirc. Otherwise there will be more examples there.

Google for ggn Atari master sources (I have trouble copy pasting on my mobile device, sorry).

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2945
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: 3D cube routine example ?

Postby AtariZoll » Sun Jun 14, 2015 11:28 am

Here is the source of Alpha Waves. Comments are in French, maybe you are better with it :D
ALPHAWSR.ZIP

Precalculated will work faster with faster CPU and RAM. Multiplication and division speed depends mostly from CPU clock, and barely on RAM speed.
You do not have the required permissions to view the files attached to this post.
There is way to stop global warming.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Sun Jun 14, 2015 11:34 am

wietze wrote:Have a look at the future minds code in ggns atar master sources. There is a non-precalced 3d there iirc. Otherwise there will be more examples there.

Google for ggn Atari master sources (I have trouble copy pasting on my mobile device, sorry).


https://github.com/ggnkua/Atari_ST_Sources/tree/master/ASM/Futur%20Minds/SOURCES

Is it one of those ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

wietze
Captain Atari
Captain Atari
Posts: 190
Joined: Fri Mar 01, 2013 10:52 pm

Re: 3D cube routine example ?

Postby wietze » Sun Jun 14, 2015 12:12 pm

Yes. At least a glenz.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Mon Jun 15, 2015 8:46 am

wietze wrote:Yes. At least a glenz.


I tried the PRG, but just gets stuck on the busy bee icon :roll:
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Mon Jun 15, 2015 12:38 pm

AtariZoll wrote:Here is the source of Alpha Waves. Comments are in French, maybe you are better with it :D
ALPHAWSR.ZIP

Precalculated will work faster with faster CPU and RAM. Multiplication and division speed depends mostly from CPU clock, and barely on RAM speed.


Is the PRG a actual runnable program as it crashes for me ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
Cyprian
Atari God
Atari God
Posts: 1405
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: 3D cube routine example ?

Postby Cyprian » Mon Jun 15, 2015 12:50 pm

GLENZ.PRG works ok under Steem/Hatari in STE mode
https://github.com/ggnkua/Atari_ST_Sour ... RCES/glenz
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1026
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: 3D cube routine example ?

Postby MasterOfGizmo » Mon Jun 15, 2015 1:22 pm

exxos wrote:Is the PRG a actual runnable program as it crashes for me ?


Works nicely on a MiST.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Mon Jun 15, 2015 1:25 pm

This is all I get. running steem at 128mhz. Just seems to make the bee flicker thats all.

GB_00001.png
You do not have the required permissions to view the files attached to this post.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2945
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: 3D cube routine example ?

Postby AtariZoll » Mon Jun 15, 2015 1:45 pm

It works fine in Steem, just need to edit few things - like launcher - removing A:\ . But main problem is that some include files missing. Namely: SNDTBL.S - not needed for 3D really, and FILL.S - this is needed. If someone can contact author about it ...
There is way to stop global warming.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Mon Jun 15, 2015 1:48 pm

AtariZoll wrote:It works fine in Steem, just need to edit few things - like launcher - removing A:\ . But main problem is that some include files missing. Namely: SNDTBL.S - not needed for 3D really, and FILL.S - this is needed. If someone can contact author about it ...


hmm, I am trying to run from C: .. but same for running from A:\, it just go right back to desktop in steem. So ALPHAWSR and GLENZ don't work in steem for me :shrug:

I tried GLENZ from A: and get TOS error 35.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Tue Jun 16, 2015 7:26 am

can anyone who can run those 2 programs take a couple of screenshots so i can see what they actually do ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
Cyprian
Atari God
Atari God
Posts: 1405
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: 3D cube routine example ?

Postby Cyprian » Tue Jun 16, 2015 9:28 am

GLENZ.PRG
glenz.png
You do not have the required permissions to view the files attached to this post.
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

wietze
Captain Atari
Captain Atari
Posts: 190
Joined: Fri Mar 01, 2013 10:52 pm

Re: 3D cube routine example ?

Postby wietze » Tue Jun 16, 2015 9:36 am

https://www.youtube.com/watch?v=Mp7zbub9MQ0

Last edited by wietze on Tue Jun 16, 2015 9:38 am, edited 4 times in total.

User avatar
mfro
Atari Super Hero
Atari Super Hero
Posts: 685
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: 3D cube routine example ?

Postby mfro » Tue Jun 16, 2015 9:37 am

exxos wrote:can anyone who can run those 2 programs take a couple of screenshots so i can see what they actually do ?


You probably downloaded incorrectly from git. You need to click until you get to the "View Raw" display, then click that link.

This should give you a .prg file with 13467 bytes. At least this worked for me.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2945
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: 3D cube routine example ?

Postby AtariZoll » Tue Jun 16, 2015 9:45 am

Cube/AlphaWaves is game, and as I know, it is first 3D game and only one for Atari ST, which source is published. Of course, it needs plenty of time to go in that code.
Glenz is simple demo, and as I see very suitable for benchmark purpose.
Glenz.png

I did some modifications in source, and here are 2 versions:
GLENZBM.ZIP

GLENZB is standalone benchmark, will outprint score at end of demo. What is actually count of 200 Hz interrupts during test. So, lower value is faster machine. Run it from ST medium res. 8MHz ST will give ~ 11228 . 16 MHz Mega STE : 7217 . Falcon : 4552 .
Test is with Vsync waiting off, as recommended earlier. With it on values are little higher: 11275, 7536, 5221 . Note that difference is much higher by faster machines. That's normal, as there is more waiting on them, and this demo uses a lot, 16 screen buffers .
GLENZP is intended to be called from another APP, via Pexec . It will give score, same as above in register d0 (16 bit) at exit, so caller can use it. Will return to medium res at exit too, so should be fine for Gembench.
You do not have the required permissions to view the files attached to this post.
There is way to stop global warming.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Tue Jun 16, 2015 2:12 pm

Looks awesome. I don't think Hisoft has Pexec command, to call a program Rodlphe did was this..

Code: Select all

dim tostest%(1000)
BLOAD "TOSMOD.O", varptr(tostest%(0))
code=varptr(tostest%(0))+36
print "calling tos test"
call loc code,1000
print "tos test done"


I enclose the 2 files also. hopefully you can work out how its setup to modify GLENZ ?
TOSMOD.zip

call loc code,1000, where 1000 was the number of loops to do in the program.
You do not have the required permissions to view the files attached to this post.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2945
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: 3D cube routine example ?

Postby AtariZoll » Tue Jun 16, 2015 3:55 pm

Well, it is possible to make it as module, but that's additional complication, and I don't see how to supply result (score) to caller.
If you measure time in caller, it will give not so accurate result, because there is preparation phase.
Pexec is regular GEMDOS command, like command for printing some txt. It must be supported in Basic. Just need to give filename as parameter, and will get score as return value. Really should be not hard.
There is way to stop global warming.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Tue Jun 16, 2015 4:12 pm

I just did some testing on real ST.

Score 10162 16mhz machine
score 11232 8mhz machine.

So not a huge jump really around 10% :? I know castle master runs a lot faster in 16mhz than stock machine. So that must use a lot of integer divisions, and assume GLENZ does not ? It looks a really nice test, but if only going to show 10% speed boost at 16mhz then i'm not sure its a good test to include :roll:
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2945
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: 3D cube routine example ?

Postby AtariZoll » Tue Jun 16, 2015 5:19 pm

I think that you mixed results - lower score is faster.
Division is avoided in good 3D code, because it is slow. There is only few in Glenz, and that's OK. 16 MHz on Mega STE gives good speed gain, as may see. With good 3D code beside CPU speed, RAM speed is relevant too.
If you want CPU division test, we can make special test for that .
There is way to stop global warming.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 3D cube routine example ?

Postby exxos » Tue Jun 16, 2015 5:40 pm

Yeah RAM being the bottleneck as normal :roll: There is a integer division test which shows 195% normally. Graphics normally show a boost in speed also at 16mhz. Though I thought as castle master is 3D and runs faster, then another 3D routine would show similar results. But like you say, it depends how it is coded. A lot of GEM/GFX loops are already in GemBench so I am not sure if anymore tests could even be added to show better use of CPU 16mhz. Things which depends on RAM access a lot are not going to work so good, so probably the reason why GLENZ does not show much speed boost. On machines with cache or faster access to RAM then of course GLENZ will show better results. Really it is another RAM speed test loop :roll: So not really sure if any functions will make any good use of 16mhz CPU time ?
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 3 guests