Author Topic: Amstrad Plus sprite compiler v1.3  (Read 1816 times)

0 Members and 1 Guest are viewing this topic.

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Amstrad Plus sprite compiler v1.3
« on: 12:45, 23 September 18 »
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)

Code: [Select]
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, ...
Code: [Select]
; 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
« Last Edit: 11:18, 17 April 20 by roudoudou »
use RASM, the best assembler ever made :p

I will survive

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.0
« Reply #1 on: 13:48, 23 September 18 »
There is no PUSH version for full sprite compilation. Maybe in a future release.
use RASM, the best assembler ever made :p

I will survive

Offline fgbrain

  • CPC6128
  • ****
  • Posts: 232
  • Country: gr
    • index.php?action=treasury
    • Chaos CPC Homepage
  • Liked: 130
  • Likes Given: 305
Re: Amstrad Plus sprite compiler v1.0
« Reply #2 on: 12: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  ??


_____

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.

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.0
« Reply #3 on: 16:39, 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

use RASM, the best assembler ever made :p

I will survive

Offline Shining

  • Supporter
  • CPC6128
  • *
  • Posts: 266
  • Country: de
    • Shinings little CPC page
  • Liked: 366
  • Likes Given: 174
Re: Amstrad Plus sprite compiler v1.0
« Reply #4 on: 18:29, 14 December 18 »
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

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.0
« Reply #5 on: 12:03, 01 July 19 »
a small update for the tool


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


Code: [Select]
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


Code: [Select]
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



use RASM, the best assembler ever made :p

I will survive

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.869
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 845
  • Likes Given: 2101
Re: Amstrad Plus sprite compiler v1.0
« Reply #6 on: 23: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.  :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.0
« Reply #7 on: 23:56, 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)
use RASM, the best assembler ever made :p

I will survive

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.869
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 845
  • Likes Given: 2101
Re: Amstrad Plus sprite compiler v1.0
« Reply #8 on: 15:50, 02 July 19 »
Nice!!!  ;D
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.2
« Reply #9 on: 21:53, 02 July 19 »
update 1.2 with bugfixed, better optimizer and multi-threaded batch computations (x10 boost!!!)
use RASM, the best assembler ever made :p

I will survive

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.3
« Reply #10 on: 11:19, 17 April 20 »
update 1.3 with better register reallocation  8)
use RASM, the best assembler ever made :p

I will survive

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 761
  • Country: gb
  • Liked: 263
  • Likes Given: 391
Re: Amstrad Plus sprite compiler v1.3
« Reply #11 on: 12:05, 17 April 20 »
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?

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 849
  • Country: fr
    • urban exploration
  • Liked: 1151
  • Likes Given: 688
Re: Amstrad Plus sprite compiler v1.3
« Reply #12 on: 12:11, 17 April 20 »
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
use RASM, the best assembler ever made :p

I will survive