MindBomb Demo (3D Megaballs Screen) Disassembly

All about ST/STE demos

Moderators: Mug UK, lotek_style, Moderator Team

Post Reply
mlynn1974
Captain Atari
Captain Atari
Posts: 459
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

MindBomb Demo (3D Megaballs Screen) Disassembly

Post by mlynn1974 »

Hi All,

I have wanted to rewrite this demo using DirectX in Windows for years. I know a beautiful CODEF conversion exists and I am at present converting the waveforms to C# for conversion to C++ later. I have documented my findings so far here:
http://lynn3686.com/3dmega/3dmega.html

I think for the first time:
1. I have unpacked the Preview version of the screen so it can be disassembled,
2. I have described the process of how I have stabilised the rasters in the final MindBomb version during wave pre-calculation.

I will update my page and release source code as I go along (spare time permitting). I hope you enjoy.

Cheers,
Michael.
Still got, still working: Atari 4Mb STe, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
User avatar
Zorro 2
Administrator
Administrator
Posts: 2242
Joined: Tue May 21, 2002 12:44 pm
Location: Saint Cloud (France)
Contact:

Re: MindBomb Demo (3D Megaballs Screen) Disassembly

Post by Zorro 2 »

Hi Michael!

Very pleasant to read you for conversions from old computers :mrgreen:

If you search sources from demos, you can find a good repository here : https://github.com/ggnkua/Atari_ST_Sources.

And of course, if you want to have sources from MindBomb Megademo pf TLB, PM-me please :twisted:

Cheers.
Member of NoExtra Team
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 203
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: MindBomb Demo (3D Megaballs Screen) Disassembly

Post by thomas3 »

Hey Michael,

Love this sort of thing :).

On the flickering rasters - I just read your blog on this, and note that the STOP solution appears to result in about a factor 4 slowdown in the calculations - which is surprisingly big actually, interesting to see. Any ideas why the performance takes such a hit? This might be about the number of scanlines afforded to the calculation routine each frame.

Anyway, looking at the screenshot, it looks to me that the rasters only occupy about 100 pixels (less than a third) of the overall screen area. I think it also looks like (correct me if I'm wrong) that each raster "bar" is at least 2 pixels high. So if this was me, I'd be tempted to sync-lock the rasters to get them stable, which I suspect would be more efficient, even if you're burning screenlines to get there.

This is the approach I used to achieve stable rasters in my last demo (Flexiscroll 2021), in some similar computational circumstances :).
seedy1812
Atari freak
Atari freak
Posts: 70
Joined: Tue May 18, 2010 2:04 pm

Re: MindBomb Demo (3D Megaballs Screen) Disassembly

Post by seedy1812 »

Budgie Source Code disks

https://www.atari-forum.com/viewtopic.php?t=3123

PRO 14 SOURCE CODE from The Lost Boys: MINDBOMB - Red Sector Screen
The 'Red Sector' 3D balls demo originally on the Amiga and improved
on the ST by Manikin. Includes the famous helicopter routine.
Full reflection in the lower border, with the MFP chip pushed to
its limit. Great music to accompany.
mlynn1974
Captain Atari
Captain Atari
Posts: 459
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: MindBomb Demo (3D Megaballs Screen) Disassembly

Post by mlynn1974 »

That looks like a great resource. I'm sure I also bought the source code to the Spiral demo screen from Mindbomb.
I'd be tempted to sync-lock the rasters to get them stable
Thanks Thomas. That sounds like a good idea! I'll look into that.
Budgie Source Code disks
I've got them - but the Red Sector Demo is not the 3D Megaballs Screen!
3D MegaBalls:
https://demozoo.org/productions/120632/
Red Sector:
https://demozoo.org/productions/111209/
Still got, still working: Atari 4Mb STe, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
mlynn1974
Captain Atari
Captain Atari
Posts: 459
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: MindBomb Demo (3D Megaballs Screen) Disassembly

Post by mlynn1974 »

I have worked for many hours trying to convert the waveforms to C# from JavaScript (Codef) for eventual conversion to C++

One idea is to look at the commented Red Sector Demo code to try to convert the transformation and perspective routines. They look very similar to the 3d Megaballs code.

The transformation matrix code in C# converted from Manikin's Code looks like this:

Code: Select all

double cosx = Math.Cos(p.x);
double cosy = Math.Cos(p.y);
double cosz = Math.Cos(p.z);
double sinx = Math.Sin(p.x);
double siny = Math.Sin(p.y);
double sinz = Math.Sin(p.z);

double mat11 = (cosy * cosx) - (siny * (sinz * sinx));
double mat21 = (siny * cosx) + (cosy * (sinz * sinx));
double mat31 = -cosz * sinx;

double mat12 = -siny * cosz;
double mat22 = cosy * cosz;
double mat32 = sinz;

double mat13 = (cosy * sinx) + (siny * (sinz * cosx));
double mat23 = (siny * sinx) - (cosy * (sinz * cosx));
double mat33 = cosz * cosx;

// calculate x coordinate
double dx = mat11 * p.x;
double dy = mat21 * p.y;
double dz = mat31 * p.z;

dx = dx + dy;
dx = dx + dz;
double realx = dx + dx; // real x

// calculate y coordinate
dx = mat12 * p.x;
dy = mat22 * p.y;
dz = mat32 * p.z;

dy = dx + dy;
dy = dx + dz;
double realy = dy + dy; // real y

// calculate z coordinate
dx = mat13 * p.x;
dy = mat23 * p.y;
dz = mat33 * p.z;

dz = dx + dz;
dz = dy + dz;
double realz = dz + dz; // real z

// combine and perspect
realx = realx * mover;
realy = realy * mover;
realx = (realx / realz) + 160;
realy = (realy / realz) + 100;
The mover variable moves from -600 to 1000.

My prototype has dots moving in a weird path around the centre of the screen but not the cube or worm animation so far.

The funny thing is that this transformation matrix is not mentioned in the "Atari ST 3D Graphics Programming" book.
I can upload my C# code if any maths/3d gurus can help :) :coffe:
Last edited by mlynn1974 on Mon Aug 30, 2021 9:26 pm, edited 1 time in total.
Still got, still working: Atari 4Mb STe, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
Post Reply

Return to “Demos - General”