News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_roudoudou

Amstrad Plus sprite compiler v1.3

Started by roudoudou, 10:45, 23 September 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

roudoudou

Here is a small utility i use to compile hardware sprites (16x16 with 15 colors+transparency)
There is a few options to chain code produced (for metasprites for example)

compiler.exe v1.2 / Edouard BERGE 2018-09


syntaxe is: compiler file1 [file2] [options]


options:
-idx <sequence(s)>  define sprite indexes to compute
-c     compile a full sprite
-d     compile difference between two sprites or a sequence
-noret do not add RET at the end of the routine
-inch  add a INC H at the end of the routine
-jpix  add a JP (IX) at the end of the routine
-jpiy  add a JP (IY) at the end of the routine
-l <label>  insert a numbered label for multi diff


Here is a sample code produced by the tool. With more complex sprite there is an optimizer which may reallocate registers, ...; diff routine from bulle5.b02 to bulle5.b03
xor a
ld b,1

ld l,81
ld (hl),b
inc l : ld (hl),a
ld l,93 : ld (hl),a
inc l : ld (hl),b
ld l,112 : ld (hl),b
inc l : ld (hl),a
ld l,126 : ld (hl),a
inc l : ld (hl),b
inc l : ld (hl),b
inc l : ld (hl),a
ld l,142 : ld (hl),a
inc l : ld (hl),b
ld l,161 : ld (hl),b
inc l : ld (hl),a
ld l,173 : ld (hl),a
inc l : ld (hl),b
ret
My pronouns are RASM and ACE

roudoudou

There is no PUSH version for full sprite compilation. Maybe in a future release.
My pronouns are RASM and ACE

fgbrain

sorry for my dump questions .. BUT:

1)  "file1"   contains what  (raw data or asm text) ??
2) 
what do you mean by " difference " ??
3) what is a metasprite  ??


_____

6128 (UK keyboard, Crtc type 0/2), 6128+ (UK keyboard), 3.5" and 5.25" drives, Reset switch and Digiblaster (selfmade), Inicron Romram box, Bryce Megaflash, SVideo & PS/2 mouse, , Magnum Lightgun, X-MEM, X4 Board, C4CPC, Multiface2 X4, RTC X4 and Gotek USB Floppy emulator.

roudoudou

Quote from: fgbrain on 10:38, 07 October 18
sorry for my dump questions .. BUT:

1)  "file1"   contains what  (raw data or asm text) ??
2) 
what do you mean by " difference " ??
3) what is a metasprite  ??
file1 is a raw data sprite (256 bytes)
difference need file1 and file2 -> the generated code makes changes from sprite1 to sprite2
a metasprite is a bundle of sprites. If you need two consecutives sprites for an object, you can chain the code by removing final RET and adding an INC H

My pronouns are RASM and ACE

Shining

Little off-topic here:


Compiling a sprite-animation with this tool for a straight-forward animation is a great thing.


But is there any clever idea to reduce the amount of data which has to be written to a hardware-sprite which has different animations in all 8 directions without using 8 hw-sprites ?
TGS is back

Download my productions at:
cpc.scifinet.org

roudoudou

a small update for the tool


you may compile multiple diff with only one variable input file...


compiler.exe -d sprite%02d.spr


and the compiler will try to start from 0 or 1 then increment counter until there is no more files found


another behaviour may be useful with big sprite binaries


compiler.exe -d planche.bin -idx 0-10,40,30-40,55 planche.bin -idx 1-11,41,31,41,0


and the compiler will load planche.bin (must be at least 56*256 bytes) twice
and run differences for 0-1, 1-2, 2-3 ...  40-41, ... 55-0
the 2 -idx sequences description MUST describe sequences with the very same count


binaries+sources updated in the first post



My pronouns are RASM and ACE

GUNHED

On 6128 Plus I use the GMSK utility to convert MODE 0 screen parts into sprite date (4 x 4 sprites). But for PC I didn't see a solution before.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

roudoudou

Quote from: GUNHED on 21:51, 01 July 19
On 6128 Plus I use the GMSK utility to convert MODE 0 screen parts into sprite date (4 x 4 sprites). But for PC I didn't see a solution before.  :)
i have a converter from PNG but it's still in progress (cause it is supposed to manage many conversions)

now i'm working on optimisations for the sprite compiler (and multi-threading to boost multi-compilations)
My pronouns are RASM and ACE

GUNHED

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

roudoudou

update 1.2 with bugfixed, better optimizer and multi-threaded batch computations (x10 boost!!!)
My pronouns are RASM and ACE

roudoudou

update 1.3 with better register reallocation  8)
My pronouns are RASM and ACE

Sykobee (Briggsy)

A clever tool to optimise plus animated sprites - how does it handle the first sprite in a sequence and looping around, and changing to a different sequence of sprites? I guess there will need to be a few 'key frame' sprites for these cases?

roudoudou

Correct, you need to create a keyframe to begin, with the tool or not (option -c)

But to switch between different sequences you just need different compilations and manage cases as you like
My pronouns are RASM and ACE

Powered by SMFPacks Menu Editor Mod