ZX81 BMP converter

For those of you watching in black and white, the pink is next to the green...
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

ZX81 BMP converter

Post by kolbeck »

Hi,

Announcing an ALPHA version of a ZX81 screenshot converter. It takes a BMP (from EighyOne or SZ81) and converts it to the following formats:
  • .s81 for standard non-hires ZX81 screens (a sequence of 768 character codes from the ZX81 charset)
  • .scr for hires screens with regular size (in ZX Spectrum display format)
  • .png for big screens, that goes beyond the 256x192 size
  • .txt for ASCII (with control codes to implement inverse print)
You can find it here: https://zxinfo.dk/scr/ - just remember it's still in an early phase.

For ZX81 charset mapping find it here: https://en.wikipedia.org/wiki/ZX81_character_set. For big screens, take an a look at MaxDemo here: https://spectrumcomputing.co.uk/entry/32034

[mention]4thRock[/mention] , [mention]moroz1999[/mention] , [mention]R-Tape[/mention] , [mention]Einar Saukas[/mention] . [mention]pavero[/mention]

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: ZX81 BMP converter

Post by 4thRock »

Very interesting!

I guess this might also work for the ZX80, if you account for the different character set:
https://en.wikipedia.org/wiki/ZX80_character_set

;)

(Sorry for the late comment but I've been in places with no internet or mobile network!)
User avatar
Einar Saukas
Bugaboo
Posts: 3093
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZX81 BMP converter

Post by Einar Saukas »

It works perfectly, thank you!!!

Perhaps it could also accept SCR or S81 as input, to generate the other formats?
User avatar
Einar Saukas
Bugaboo
Posts: 3093
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZX81 BMP converter

Post by Einar Saukas »

Here's a simple program for the ZX81 16K. Load a S81 file to memory address 30000, then run the program to see it on screen:

Code: Select all

10 LET D=PEEK 16396+256*PEEK 16397
20 FOR R=0 TO 23
30 FOR C=0 TO 31
40 POKE D+R*33+C+1,PEEK (3E4+R*32+C)
50 NEXT C
60 NEXT R
70 GOTO 70
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

4thRock wrote: Mon Aug 10, 2020 2:52 pm Very interesting!

I guess this might also work for the ZX80, if you account for the different character set:
https://en.wikipedia.org/wiki/ZX80_character_set

;)

(Sorry for the late comment but I've been in places with no internet or mobile network!)
It will work for ZX80 as soon as I get the mapping for the charset done :-)
Last edited by kolbeck on Wed Aug 12, 2020 10:38 am, edited 1 time in total.
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

Einar Saukas wrote: Mon Aug 10, 2020 5:25 pm It works perfectly, thank you!!!

Perhaps it could also accept SCR or S81 as input, to generate the other formats?
Great idea - will put it on the TODO list.

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: ZX81 BMP converter

Post by 4thRock »

Just one more thing ;)
SCR export doesn't use bright. That's correct because of ZX Spectrum attribute limitations on the border area.
But PNG export is using full bright white. I understand why buy it's somewhat inconsistent.
Could you change it to #CDCDCD (that's what we are using for non-bright white) ?
It would allow back and forth conversion with consistent results.
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

PNG is for now a simple convert of the BMP, so whatever the emulator produces. Another example is if you have TV artefacts enabled in EO, then the PNG Will have scanlines.

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

4thRock wrote: Wed Aug 12, 2020 2:05 pm Just one more thing ;)
SCR export doesn't use bright. That's correct because of ZX Spectrum attribute limitations on the border area.
But PNG export is using full bright white. I understand why buy it's somewhat inconsistent.
Could you change it to #CDCDCD (that's what we are using for non-bright white) ?
It would allow back and forth conversion with consistent results.
[mention]4thRock[/mention] - can you please try again with your BMP? Just testing a concept, and would like to hear if that is the right direction.
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: ZX81 BMP converter

Post by 4thRock »

@kolbeck, now I get a PNG that looks the same as the SCR (non-bright) ;)
So yes, that's what I had in mind.
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

The ZX81 screen converter https://zxinfo.dk/scr/ now goes into BETA.

Now supports the following formats as input:
* .bmp as produced by various emulators (e.g. EightyOne and SZ81)
* .a81 for standard non-hires ZX81 screens (a sequence of 768 character codes from the ZX81 charset)
* .scr Widely used screen format used for ZX Spectrum (ZX81 hi-res)

And converts to the following formats:

png, scr, a81 & txt (the txt format makes it easier to copy/paste text, in case that is required).

Next I will be adding support for ZX80 screen dumps.

Any feedback is appreciated - thanks!

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Einar Saukas
Bugaboo
Posts: 3093
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZX81 BMP converter

Post by Einar Saukas »

This is great!

Is there any reason to name it a81 instead of s81?
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

a & s - left, right, right left - sometimes I mix them up :-)

It's been fixed now
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Einar Saukas
Bugaboo
Posts: 3093
Joined: Wed Nov 15, 2017 2:48 pm

Re: ZX81 BMP converter

Post by Einar Saukas »

Thanks :)
User avatar
pavero
Dynamite Dan
Posts: 1581
Joined: Sat Dec 09, 2017 11:49 pm
Location: The Czech Republic
Contact:

Re: ZX81 BMP converter

Post by pavero »

Maybe small improvement. It doesn't work for BMP files without a border - 256 x 192 pixels only. ;)
User avatar
Solaris104
Drutt
Posts: 38
Joined: Wed Jun 06, 2018 4:18 pm

Re: ZX81 BMP converter

Post by Solaris104 »

Some screenshot from EightyOne need correction.

Image

Image
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

pavero wrote: Thu Aug 13, 2020 8:03 pm Maybe small improvement. It doesn't work for BMP files without a border - 256 x 192 pixels only. ;)
I’m not aware of any emulator that only outputs 256x192- sz81 can however output dumps double the size, which is handled. I will look into the 256x192 that in the future.
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

solaris104 wrote: Thu Aug 13, 2020 8:19 pm Some screenshot from EightyOne need correction.

Image

Image
There’s no way of correcting that automatic, but the screens you show are exactly for the purpose of identifying screens that needs correction. A lot of the 1k hi-rea games needs correction, so parameters for offsetX and offeetY will be implemented in the future
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
pavero
Dynamite Dan
Posts: 1581
Joined: Sat Dec 09, 2017 11:49 pm
Location: The Czech Republic
Contact:

Re: ZX81 BMP converter

Post by pavero »

kolbeck wrote: Thu Aug 13, 2020 8:38 pm
pavero wrote: Thu Aug 13, 2020 8:03 pm Maybe small improvement. It doesn't work for BMP files without a border - 256 x 192 pixels only. ;)
I’m not aware of any emulator that only outputs 256x192- sz81 can however output dumps double the size, which is handled. I will look into the 256x192 that in the future.
Just EightyOne can do this, if you set Border Size = none. ;-)
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

pavero wrote: Thu Aug 13, 2020 8:56 pm
kolbeck wrote: Thu Aug 13, 2020 8:38 pm I’m not aware of any emulator that only outputs 256x192- sz81 can however output dumps double the size, which is handled. I will look into the 256x192 that in the future.
Just EightyOne can do this, if you set Border Size = none. ;-)
Ahh- thanks, will take care of that :-)
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

pavero wrote: Thu Aug 13, 2020 8:03 pm Maybe small improvement. It doesn't work for BMP files without a border - 256 x 192 pixels only. ;)
Hi [mention]pavero[/mention] - please try again, it should now support all sizes from EO

* No Border: 256x192 pixels
* Small Border: 264x200 pixels
* Standard Border: 320x240 pixels
* Large border: 400x300 pixels
* Full frame: 413x312 pixels

The PNG will of course have the same size as the input file. Also for large and full frame, the adjustment is not 100% correct - looks like the actual dump is not centered :-) Will be fixable when adjustment parameters are added.

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

solaris104 wrote: Thu Aug 13, 2020 8:19 pm Some screenshot from EightyOne need correction.

Image

Image
[mention]solaris104[/mention] - please try out the added correction parameters

/Thomas
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
4thRock
Manic Miner
Posts: 415
Joined: Thu Nov 09, 2017 9:35 am
Location: Portugal

Re: ZX81 BMP converter

Post by 4thRock »

kolbeck wrote: Fri Aug 14, 2020 12:01 pm * Full frame: 413x312 pixels
Interesting. 312 lines seem to be the full extent of the generated TV signal, including non-visible sync lines:
Image
( http://blog.retroleum.co.uk/electronics ... -voltages/ )
User avatar
kolbeck
Manic Miner
Posts: 310
Joined: Mon Nov 13, 2017 9:04 pm

Re: ZX81 BMP converter

Post by kolbeck »

I have not seen any full frame programs yet, maybe a little challenge for our experts? :-)
https://api.zxinfo.dk/v3/ - ZXDB API for developers
zxinfo-file-browser - Cross platform app to manage your files
https://zxinfo.dk - another ZXDB frontend
User avatar
Solaris104
Drutt
Posts: 38
Joined: Wed Jun 06, 2018 4:18 pm

Re: ZX81 BMP converter

Post by Solaris104 »

kolbeck wrote: Fri Aug 14, 2020 1:04 pm @solaris104 - please try out the added correction parameters

/Thomas
Thank you, it's works :-)
Post Reply