Generated code for sprites. Which technique ?

All 680x0 related coding posts in this section please.

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

Zarchos
Captain Atari
Captain Atari
Posts: 222
Joined: Wed May 09, 2012 7:38 pm
Location: FRANCE

Generated code for sprites. Which technique ?

Postby Zarchos » Fri Jul 21, 2017 7:34 am

As a (lazy) ARM coder I have developed what I believe is a good 'generated code sprites' generator.
I would like to know which solutions you chose on the ST and later machine with faster CPUs.
My technique and ideas for the Archies are described here :
http://www.stardot.org.uk/forums/vie...ilit=generated

Mode 13 is the 320 x 256, 8 bits per pixel screen mode on the Acorn Archimedes.

Thanks for your comments, it will be highly appreciated.

I think I have re invented the wheel and it has all been done already on the ST ; but if, who knows, that wasn't the case, I would be more than happy to give even more details to some programmers out there to port the technique to the ST.

Please note : this thread isn't intended to start a 'My machine is much better than yours'.
Contrary to the other well known other 68000 machine at the time, I do praise the ST for being the 1st available, ultracheap, and gifted with many games and great apps, and easy to use.

*Moderator note*
Thread continues ontopic here: viewtopic.php?f=16&t=31981
Flame war deleted
Atari 1040 STE+SATAN, 520ST, 800xl, xegs, Amiga 500, 2000 with 68020, Archimedes, RISC PCs + Iyonix, Omega, BBC B, Atom, Electron, ZX 81, Spectrum 48/128/+2/+3, Speccy2010, Russian clones, Sam Coupe, V6Z80P, QL with accelerators, Enterprise 128, Einstein inc 256, Oric Atmos, MSX 1, 2, Thomson MO5, Amstrads inc CPC+, C 16, 64, 128, VG5000, Apple IIGS and more ! Yes I want to create a museum when I retire.

User avatar
troed
Atari God
Atari God
Posts: 1213
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Generated code for sprites. Which technique ?

Postby troed » Fri Jul 21, 2017 7:37 am

Zarchos wrote:My technique and ideas are described here :
http://www.stardot.org.uk/forums/vie...ilit=generated


Your URL is broken. I tried searching the forum for the post you likely intended but didn't succeed.

But to answer, yes, there are lots of people here who wrote optimized sprite-blitting generating code, and still do today :)

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

Re: Generated code for sprites. Which technique ?

Postby AtariZoll » Fri Jul 21, 2017 8:16 am

Zarchos wrote:As a (lazy) ARM coder I have developed what I believe is a good 'generated code sprites' generator.
I would like to know which solutions you chose on the ST and later machine with faster CPUs.
My technique and ideas for the Archies are described here :
http://www.stardot.org.uk/forums/vie...ilit=generated
...

I would not talk about what I used - actually, so far I only did blitter based sprite draw for game OIDS (smaller sprites).
More interesting is what is already done. There are games with well made code, for machines without blitter, which draw sprites really fast using only 68000 code.
Your link is 404, so I will here say something what is crucial for sprite draw on ST screen:
Since in most used low res. there is 4 interleaved bit-plane, each of 16 px. width, it dictates some solutions: sprite definitions are in 16px steps horizontally. Putting them on any horizontal pos on screen needs shifting, and that's slow on 68000 CPU. And this is most important actually. To draw sprites fast with only CPU, you need to preshift them. If step is 1 px. it needs 16 sprite definitions in RAM for 1 sprite. So, many games just calculate preshifted at start of some level, for sprites used on it.
Related with this is tile draw - basically background draw, needed for scrolling games. It is basically similar to sprite draw.

I guess that in some 8 bitplane mode, where likely 1 byte is 1 pixel it needs pretty different approach.
There is way to stop global warming.

Zarchos
Captain Atari
Captain Atari
Posts: 222
Joined: Wed May 09, 2012 7:38 pm
Location: FRANCE

Re: Generated code for sprites. Which technique ?

Postby Zarchos » Fri Jul 21, 2017 8:25 am

http://www.stardot.org.uk/forums/viewto ... =generated

Sorry for the broken link.
Not my best English, sorry for that too.

Maybe because the Archie uses chunky modes, the ideas I used are more suited for the Falcon ...
The tools I created are written in BBC BASIC, and the ARM instructions are quite easy to understand, so **IF** this can have any interest to the Falcon users **IF** this has not been done before on the Falcon (honestly I doubt that) it would be extremely easy to convert to the Atari machines.
I'd be honoured, as to me the Falcon is a fantastic machine, much more powerful than the Archies even with a fast ARM3 upgrade.
Atari 1040 STE+SATAN, 520ST, 800xl, xegs, Amiga 500, 2000 with 68020, Archimedes, RISC PCs + Iyonix, Omega, BBC B, Atom, Electron, ZX 81, Spectrum 48/128/+2/+3, Speccy2010, Russian clones, Sam Coupe, V6Z80P, QL with accelerators, Enterprise 128, Einstein inc 256, Oric Atmos, MSX 1, 2, Thomson MO5, Amstrads inc CPC+, C 16, 64, 128, VG5000, Apple IIGS and more ! Yes I want to create a museum when I retire.

User avatar
troed
Atari God
Atari God
Posts: 1213
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Generated code for sprites. Which technique ?

Postby troed » Fri Jul 21, 2017 11:00 am

Top off my head, this is what demo coders on STs without blitter did (and was covered in the thread it seemed).

Code generating code that dynamically analyzed the graphics to be drawn, as well as possible shortcuts depending on position on screen and need for background clearing or not. The generated code would directly draw the graphics (no extra graphics lookup needed). This of course wastes enormous amounts of memory, but is always the fastest.


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 4 guests