Vector graphics for the ZX Spectrum

Post Reply
User avatar
bbock
Posts: 53
Joined: Wed Jan 12, 2011 7:59 pm

Vector graphics for the ZX Spectrum

Post by bbock »

SVG (= Scalable Vector Graphics) is the standard format for vector graphics on the Internet. Unfortunately, this format is too complex to be displayed directly on 8-bit computers like the ZX Spectrum. My Java program TinySVG extracts "line drawings" from SVG files and converts them into simplified vector formats for retro computers. For the ZX Spectrum, it can create vector files, and these can be drawn on screen using one of two methods:
  • Standard BASIC routines, screen resolution 256x176, vector file *.zxv
  • Speedplot, screen resolution 256x192, vector file *.zxs
The current version of TinySVG can be found here: https://joyceforum.de/viewtopic.php?f=5&t=65&start=20

Download vecread (Standard BASIC routines) or speedplot from here: https://joyceforum.de/viewtopic.php?f=5&t=65&p=420#p420


A small manual:
  • Start TinySVG.jar with a double click (Java Runtime version 8 or higher required).
  • Under Options > Configuration the following items should be activated: Center, Resize, Bézier curve approximation, Arc approximation, Activate line reducer. To set the Output files and Screen resolution sections, simply choose "ZX Spectrum Standard" or "ZX Spectrum Speedplot" under Presets.
  • File > Open > Select SVG file
  • The .zxv or .zxs file can be found in the same directory as the SVG file, but with the extension .zxv or .zxs (e.g. laempel.svg -> laempel.zxs).
SVG.zip
Some SVG files to try out
(637.43 KiB) Downloaded 41 times

The vector graphics can be drawn on a real ZX Spectrum or in the emulator.

Settings in EightyOne:
  1. Options > Hardware or F6
  2. Register "Sinclair"
  3. Select 48k ZX Spectrum
Load the graphic in EightyOne (speedplot method):
  1. File > Open Tape > load speedplot_basic.tzx. The program will start automatically, and it sets RAMTOP to 29999.
  2. File > Load Memory Block > Filename: speedplot.bin, Address: 65145 - this loads the machine code.
  3. File > Load Memory Block > Filename: e.g. laempel.zxs, Address: 30000 - loads the vector data created by TinySVG.
  4. RUN
User avatar
bbock
Posts: 53
Joined: Wed Jan 12, 2011 7:59 pm

Re: Vector graphics for the ZX Spectrum

Post by bbock »

The following SVG files can be used in TinySVG, too, showing some nice "impossible figures":

Figuren.zip
Impossible figures
(6.43 KiB) Downloaded 43 times
User avatar
bbock
Posts: 53
Joined: Wed Jan 12, 2011 7:59 pm

Re: Vector graphics for the ZX Spectrum

Post by bbock »

For some teaser pictures look here: viewtopic.php?p=42474#p42474
User avatar
bbock
Posts: 53
Joined: Wed Jan 12, 2011 7:59 pm

Speedplot Update

Post by bbock »

The following TZX file loads everything automatically: first the BASIC file, then RAMTOP is changed, and finally the speedplot machine code is loaded. Then just load the vector data and enter RUN:

Instructions for using speedplot_all in the EightyOne emulator:
  • File > Open Tape > load speedplot_all.tzx. The program starts automatically, sets RAMTOP to 29999 and loads the machine code.
  • File > Load Memory Block > Filename: e.g. laempel.zxs, Address: 30000 - this loads the vector data created by TinySVG.
  • RUN
speedplot_all.zip
(526 Bytes) Downloaded 37 times
User avatar
stefano
Posts: 467
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Vector graphics for the ZX Spectrum

Post by stefano »

very nice!
I did a similar effort on z88dk, with z80svg.
It converts the graphic files in a metalanguage including dots, lines, and areas, which is run by specific z88dk functions.
I also put I the FUSE emulator the opposite feature for the zx spectrum: the SVG capture option traps the BASIC entries (all the standard ROM versions) and converts the plotting, printing and colour instructions in SVG format while the program runs. Scrolling text extends the SVG area, CLS closes the file and stars a new one..
User avatar
bbock
Posts: 53
Joined: Wed Jan 12, 2011 7:59 pm

Re: Vector graphics for the ZX Spectrum

Post by bbock »

stefano wrote: Sat Jun 12, 2021 9:29 am very nice!
I did a similar effort on z88dk, with z80svg.
It converts the graphic files in a metalanguage including dots, lines, and areas, which is run by specific z88dk functions.
That's very interesting! Where can I find more about z80svg, e.g. sources?
stefano wrote: Sat Jun 12, 2021 9:29 am I also put I the FUSE emulator the opposite feature for the zx spectrum: the SVG capture option traps the BASIC entries (all the standard ROM versions) and converts the plotting, printing and colour instructions in SVG format while the program runs. Scrolling text extends the SVG area, CLS closes the file and stars a new one..
I guess I have to try this one, too. :)
User avatar
stefano
Posts: 467
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Vector graphics for the ZX Spectrum

Post by stefano »

https://github.com/z88dk/z88dk/tree/mas ... t/graphics
https://github.com/z88dk/z88dk/blob/mas ... rofile.asm
draw_profile wraps up a bit of drawing functions, look around for more.
c128rabbit.png
c128rabbit.png (43.4 KiB) Viewed 1068 times
Post Reply