I start this thread, which in a way is a follow up to this one : http://theqlforum.com/viewtopic.php?f=3&t=2190
I propose we think together about what could be the fastest way to fast plot and fast unplot sprites,
on the Q68.
I have developped some fast routines on the Archie, which in a way is a machine very close to the Q68.
Why ?
Well, both share the following :
- Very fast CPU
- 'Chunky' or 'linear' screen modes, where 1 byte, or 2 consecutive bytes, define a pixel on screen, and
the screen memory layout is 'easy' or 'logical' to understand, meaning :
what you see displayed on screen is the reading of the screen memory area, with top left corner corresponding
to data read from the 1st address of the memory dedicated to screen memory, and reading consecutively in memory,
the entire visible screen is built linearly, from left to right, reading in memory linearly the contents of the memory,
until the last pixel is displayed (bottom right), corresponding to the last byte, or 2 consecutive bytes, of the screen memory area.
- The Q68 has the advantage of hi colour screen modes, and also
° A lot of memory
° An extra super fast area of memory .... Very, very, very promising ... it will have to be used, over used, intensively, until Death

Please read this to understand the method I have used :
http://www.stardot.org.uk/forums/viewto ... 13+sprites
On the Archimedes, mode 13 is 320 x 256, 8 bit per pixel (and linear, or 'chunky' as are all modes on this machine)
Basically :
a sprite is 1st fully scanned to get all its infos describing it inside the rectangle it is fitted into.(With a tool in BASIC).
Its visible pixels are extracted for each of its lines.
These infos are what will be used by your game or demo, and they are stored on disk.
For each possible length of pixels (I did from 1 to 384), in your game or demo, there exists the ASM code, fastest possible, to load the pixels data and plot them on screen.
Yes, we are working with generated code, but my idea is to have the code generator in your game or demo, so that, when you know in a few frames you will need to display this or that sprite, you call your generated code generator, so
that the creation of the shifted data, and the actual ASM instructions to plot your sprite, segment by segment, and line by line, is 'sliced' on a series of frames, using the available CPU cycles you have got, left per frame. ( This way your action on screen will not suffer from framerate dropping while generating the opcodes ).
I have chosen that the smallest granularity of calling the code generator is creating the opcodes to deal with one horizontal segment of sprite ( understand a sprite can have many horizontal segments on a given scanline if there exists some transparent pixels on its scanline : between consecutive segments of pixels ).
The unplotting side ( so far I am unhappy with the algo I have ) is thought to also generate the ASM instructions, to partially delete your sprite ( restoring the background by reading pixels from the area of memory your background, unaltered, is stored) that is : only what is necessary, representing the visual difference of the seen background, between the previous displayed frame, with this next frame to display.
I hope you will enjoy the idea of sharing some ideas with me to decide what can be the fastest possible 68000 mnemonics to use.
I have spent a lot of time on the Archie to find the best ARM instructions to do so.
You can see the results ( well, only the plotting algos ) on my YT channel, if you search for 'WIP' or 'POC' ( for Proof Of Concept ) ***** in my uploaded videos.
Most tools I have used are in BBC BASIC ( I have only ever learnt BASIC on the Speccy ), very crude and not sophisticated at all, their conversions to Super Basic should be very easy.
My knowledge of 68000 is far too poor to do that alone, and well I believe it can be a great community project.
Everything we'll do will be freely usable by everyone, be it for PD software, or commercial usage, as long as there is a 'thank you' in both the software,
and / or the accompanying manual / documentation, with the names of all contributors.
Kindest regards,
Xavier.
***** : Much easier, I have also coded on the Archies what I believe are the fastest ever horizontal segments filling routines for example for 3D ( if shapes are big enough, ie not suitable for a game like Zarch, but most certainly for a game like Chocks Away or Chopper Force. Perfect also for a Bad Apple demo. )
Adapting them to the Q68 should be very easy, as there is no need of of a code generator at all.
https://www.youtube.com/results?search_ ... g+routines
Still uncomplete, I also have some routines for 1 load N store of sprites, and 'see through like through a window' routines.
Great for fast 2D arcade games, or demos.
Something, once ported to the Q68, which could be used very easily by everybody, as for all of the above, the calling routines are to use with only a handful of parameters.