CPCWiki forum

General Category => Programming => Topic started by: Nemo59 on 00:34, 11 April 21

Title: Hardware sprite editor for Amstrad CPC6128+
Post by: Nemo59 on 00:34, 11 April 21
Hi all,

Here is the version 1.0 (edit : udpdated to v1.01 with UNDO, improved COPY, LOAD, SAVE etc.)  of TP-Sprite for Amstrad CPC+. It's in french (but not a lot of text lol) and runs under CPM+ on Amstrad CPC6128Plus only.
3" image download (cpm included) :


https://cpcrulez.fr/applications_graphic-tp-sprite.htm (https://cpcrulez.fr/applications_graphic-tp-sprite.htm)

Two  videos of TPSprite (in french)  :
https://youtu.be/Dd5Jzzogqdg (https://youtu.be/Dd5Jzzogqdg)


https://youtu.be/5E5j3V7UEPM (https://youtu.be/5E5j3V7UEPM)


(and a lot of other videos  CPC, CPM, Turbo Pascal, Turbo modula on CPC, Turbo Pascal library for Amstrad CPC on my channel, Gomoku Game, Julia Set ...)
Title: Re: Hardware sprite editor for Amstrad CPC6128+
Post by: Nemo59 on 23:23, 11 April 21
Hi All, I pushed the version 1.01on the google drive below. It replace the v1.0.


v1.01  adds :


- Save and load file ( Ctrl S / Ctrl L)
- Improved copy rectangular block of bitmap ( Ctlr Copy / Shift Copy). Rectangular selection with RETURN and the cursor position. Shift RETURN hides the cursor mark. You can copy  between animations pictures for the same sprite or in another File 
- Improved circle
- Some cosmetics things

If someone use a mouse on CPC i'm aware to know how it works. I've no mouse on my CPC+ and just test this aspect with WINAPE.


Note that you may use ESC to exit the EDIT Sprite Windows. ESC also allows you to exit the program/
Title: Re: Hardware sprite editor for Amstrad CPC6128+
Post by: GUNHED on 16:02, 13 April 21
use setdef c,a


BTW: Cool that you use CP/M Plus for it.  :D
Title: Re: Hardware sprite editor for Amstrad CPC6128+
Post by: Nemo59 on 16:28, 13 April 21
New version in progress ( one week hollidays ;D ) . I now use binaries files for load (Ctrl L) and save (Ctrl S) the sprites (new .spr format as 'native' format). Ascii files are now produced with  Import (Ctrl I) and Export (Ctrl L) commands. Binaries files are much much faster ( specialy with animated big sprites). Some other speed improvments too. I will use this new version heavily for a quick and dirty game and will publish the v1.1 as a major improvment after all these tests.


If someone has a cpc+ with a mouse, i'm very curious to know if it works fine or not on a real hardware. No mouse on my cpc+ ;D 
Title: Re: Hardware sprite editor for Amstrad CPC6128+
Post by: Nemo59 on 13:54, 16 April 21
Version 1.02 now available in attached file.

Improvment :
- Use binary  format .spr. Far much faster

- Export and import in ascii file (Pascal format but easy to change)


Tp-Sprite is a hardware sprite editor for CPC6128 +. It allows you to create animated sprites up to 48x48 pixels. the software works in CPM +. To launch it: TPSPRITE displays a help page (in French) and opens the "default.spr" sprite. TPSPRITE NAME creates or modifies the NAME file. SPR. To move in the menus use Control arrow, to modify values use the arrows. Ctrl L: Load binary file, Ctrl S: save binary. You can export the sprite files in ASCII mode commented with Ctrl E (export).

- 4096 couleurs
- AMX Mouse allowed
- Animated sprite
- 16x16 or mutiple of 16x16
- copy-paste in/between sprites and animations
- Fill
- Circle
- rectangle
...

Next version in progress : Export windows rectangle for usage else than hardwre sprite
Title: Re: Hardware sprite editor for Amstrad CPC6128+
Post by: Sykobee (Briggsy) on 14:13, 16 April 21

I believe the problem with Plus animated sprites is you need to write 256 bytes to ASIC memory to update a single sprite frame, if you use a generic sprite animation routine. So you can't update many sprites per frame - hence many games used sprites for static scenery (switchblade).

Is there an option to export an animated sprite stored as a keyframe + set of animation differences (z80 code to update only the altered pixels) for the full animation loop? Or maybe that's best left up to the programmer to get best results for particular games...
Title: Re: Hardware sprite editor for Amstrad CPC6128+
Post by: Nemo59 on 14:30, 16 April 21
Hi, in my opinion, its not really a big problem in most cases.
For example, in those videos :

https://youtu.be/TICFUyjkt0U (https://youtu.be/TICFUyjkt0U)

Or this (those videos are at exact  CPC+ speed) :
https://youtu.be/iKuFmrqHIa0 (https://youtu.be/iKuFmrqHIa0)b


And an extreme example with a 64x64 hdw sprite (4kB)  which show the cpc6128+ memory ;D
https://youtu.be/nlcE3Jrmqa4 (https://youtu.be/nlcE3Jrmqa4)

Those are the most defavorable cases. In most cases you need only to change few pixels between two animations and not necessery at each frame.  Change few pixels dont take much more time than change a vector.
And you can also have the animation in the ASIC (for exemple 4 hardwares sprites  16x16 pixels with each 4 animations takes quite no cpu time (and no ram space, only the ram of the Asci) , just x y positions and zomm  to change). Take Antiriad for example, how many sprites on the same screen? 4? 5? no more I think.

Quote
"Is there an option to export an animated sprite stored as a keyframe + set of animation differences (z80 code to update only the altered pixels) for the full animation loop? Or maybe that's best left up to the programmer to get best results for particular games...
"

Not at this time. My final project is an adventure text game wth graphics and animations, so it s not a priority but I will think of this. It would be interesting only if it s much faster than a LDDIR command. But it would be interesting also in the point of view of data size. Here it's not optimiszed at all. I ve the idea of line command program for this like "Compact sprite"...