Inquiry about 'generated sprites' techniques used on the ST and the Falcon

GFA, ASM, STOS, ...

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

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

Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby Zarchos » Sat Jul 22, 2017 7:59 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, and the Falcon (with its chunky modes).

My technique and ideas for the Archies are described here :
http://www.stardot.org.uk/forums/viewto ... s+plotting and the links provided in the thread.
Please note the Archimedes uses chunky modes, linear, so what happens is that the memory controler on the Archimedes reads sequentially, under DMA, the memory space defined as memory screen, sends this data to the VIDC (video controler) which outputs them.

My routines use mode 13, it 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.

You might need to know the following on the Archie :
- There are no memory to memory transfer instructions in the ARM2 (early generation of Archies) instructions set : it is always memory to register or register to memory
- The ARM2 can only deal with :
+ 32 bit words or series of consecutive 32 bit words (1 register (1 time 4 bytes) ; n registers (n times 4 bytes) )
with the LDR / STR and LDM / STM (load / store register and load / store multiple registers)
or
+ one byte
with LDRB / STRB (load / store one byte).

As I said earlier maybe my technique can be of interest, most probably for the Falcon becuse it uses chunky modes.
Before giving you more infos I'd like to know if there is some interest, and as I do not see the interest of reposting everything here, I give you some links to listen to, or read, to know more.
https://youtu.be/2gr2YhaXYsk Steve Harrison presenting his raster manager and then me trying to explain my sprites routines
Then you have the link I gave at the beginning to the stardot forum ... sorry for the not so good English.
http://www.stardot.org.uk/forums/viewto ... s+plotting

Links validated.
Last edited by Zarchos on Sat Jul 22, 2017 8:16 am, edited 1 time in total.
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: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby troed » Sat Jul 22, 2017 8:05 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.

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

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby Zarchos » Sat Jul 22, 2017 8:06 am

Please moderator delete the multiple copies.
The site kept saying me that there was an issue with the page, so I resent many times.
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: 1217
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby troed » Sat Jul 22, 2017 8:11 am

On the ST, the most limiting factor is that there are only bitplane modes available. You're unable to address a single pixel in any effective way, and while there are some tricks to address blocks of 8 through the movep instruction, most code simply works on 16 pixel (word) boundaries.

Most sprite code you'll find on the ST will thus need to take care of a lot of bitplane quirks, and that's where most of the optimization can be found. Anything that needs smooth 1 pixel horisontal movement will most likely exist in 16 copies, preshifted, for example.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4872
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby simonsunnyboy » Sat Jul 22, 2017 8:51 am

Chunky or not, sprite data can be pregenerated for bitplanes as well. We call this technique "preshift".
Combining preshift with creating a direct algorithmn to apply the preshifted data should be possible aswell. I also think that's the way the real-big-sprite demos on the ST do work....
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 4872
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby simonsunnyboy » Sat Jul 22, 2017 8:54 am

The Thadoss technique for Falcon was explained here: viewtopic.php?f=68&t=24462
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org

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

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby Zarchos » Sat Jul 22, 2017 9:00 am

simonsunnyboy wrote:The Thadoss technique for Falcon was explained here: viewtopic.php?f=68&t=24462


Thanks for the link provided. Will read with interest.
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.

mlynn1974
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 129
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby mlynn1974 » Sat Jul 22, 2017 9:17 am

I don't know if I can add more to what has been already said.

In low res (320x200) the STOS BASIC sprite command has the sprite in memory and uses the ROXL instruction to rotate the bits to reposition the sprite depending on the x position and multiply the start line by 160 for display. It then uses the OR instruction to display the sprite on top of the background. 13 16x16 4 bitplane sprites in 1 VBL is possible when compiled. This is nice but not efficient. STOS Extensions like Misty give you the option to display 1 bitplane sprites and uses a table of y-offsets to avoid the multiplication.

For horizontal scrollers a 4 pixel preshift is sufficient. If you double buffer the display this can provide a nice effect of the scoller moving 4 pixels per frame despite the 16 pixel per word limit. Clipping might have to be dealt with differently. Also displaying sprites "behind" other sprites in games and demos would require a sprite\tile arrangement where the display priorities change.

The ZX Spectrum game Skool Daze require real-time positioned sprites due the number of sprites displayed on screen at once and memory limitations.
Last edited by mlynn1974 on Sat Jul 22, 2017 9:21 am, edited 1 time in total.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 655
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby Anima » Sat Jul 22, 2017 9:19 am

Cho Ren Sha for the Atari Falcon 030 uses the DSP to support the sprite drawing to reduce the bandwidth needed to clear (restore) the screen.

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

Re: Inquiry about 'generated sprites' techniques used on the ST and the Falcon

Postby Zarchos » Sat Jul 22, 2017 9:24 am

Anima wrote:Cho Ren Sha for the Atari Falcon 030 uses the DSP to support the sprite drawing to reduce the bandwidth needed to clear (restore) the screen.


Thanks, it is going to be an interesting read for sure.
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.


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 1 guest