Any progress being made with ZX81 emulation?
-
Good to hear that it's working even without adding dependancies.
Here are the options you can use.In the runcommand I added
-f
for fullscreen.
For me that worked but seems that it doesn't work on the RPI.
You might want to experiment with adding the resolution, something like adding :
-800x600
If it still doesn't work then try to match the boot up resolution in the startup dialog box.Let me know if you find a solution then I will add that to the module-script.
edit:
-b
might also do the trick. -
I remember that you can also use resolution variables in the runcommand.
You might want to give that a try.
So use :
-%XRES%x%YRES%
instead of :
-800x600edit:
For me this option doesn't work on a regular pc, not sure why. -
@Folly No luck so far. I'd already tried adjusting the resolution in the runcommand window but it made no difference, and matching the runcommand resolution to the commandline resolution didn't help any.
The -b flag did make a small improvement - it no longer crops off the bottom of the screen in H.E.R.O. - but the window is still small and stuck in the top left corner. And as you note the -f flag does nothing either.
Will keep trying stuff. I've no idea what some of the options do, like "TAGULA".
Incidentally, I briefly got excited because I thought this emulator would also run ZX80 games (which nothing on my Pi currently will), but I can't get it to do anything even though I've set the -o flag and the ZX80 ROM is in the emulator's folder - it just crashes back to ES. If I put the ZX80 game files in the ZX81 ROM folder it does boot, but only to the "K" prompt, the games don't load. Tantalisingly close!
-
@Folly So, this is getting weird. If I use this commandline:
sz81 = "pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -1920x1080 %ROM%; popd"
It now occupies my whole screen, but it looks like this - shoved over to the left and still only using a small amount of screen area.
Adding the -b flag makes no difference.
sz81 = "pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -b -1920x1080 %ROM%; popd"
But if I add the -f flag:
sz81 = "pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f -1920x1080 %ROM%; popd"
it suddenly centres itself, with a couple of big bars at the sides, BUT it displays the black parts in a "stipply" and much lighter grey shade, like it had been really badly photocopied and printed out on a printer very low on ink.
If I add BOTH flags, it acts the same as if I'd added none, or just the -b.
But if I use the -f flag and then press Alt-R, it goes back to the -b version, ie it reverts to proper black but shifts the screen off-centre again.
This is really peculiar. All the parts are in there but they just won't come together...
-
Not sure if it will work but you could try to use xinit like this :
sz81 = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f %ROM%; popd"Maybe using matchbox-windows-manager could also help but I need to test.
Not at my RPI right now.
If I have the time I will try it on my RPI. -
@Folly said in Any progress being made with ZX81 emulation?:
sz81 = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f %ROM%; popd"
Bingo! Centred horizontally and a decent size, but it's cropping the bottom off H.E.R.O. again.
But if I add -b to the -f, we get the whole screen, albeit it's still not vertically centred or occupying anything like the full space. Playable and fairly tidy (the -b introduces a bit of scrappiness on the top and right edges), though, definitely the best yet.
Other games are perfectly centred, though, so it looks like this is a H.E.R.O. problem. Easily solved by having two versions in EMULATORS.CFG.
sz81 = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f %ROM%; popd" sz81hero = "XINIT:pushd /opt/retropie/emulators/sz81; /opt/retropie/emulators/sz81/sz81 -f -b %ROM%; popd"
-
Good to hear that it's almost OK.
Seems it could be some sort of a 16:9 / 4:3 issue.
Will have to think about it.
Might be that I find a better solution.
Then I will let you know. -
@Folly Many thanks yet again :) Would editing the script to something like this called sz80.sh
#!/usr/bin/env bash # This file is part of The RetroPie Project # # The RetroPie Project is the legal property of its developers, whose names are # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. # # See the LICENSE.md file at the top-level directory of this distribution and # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md # rp_module_id="sz80" rp_module_desc="Sinclair ZX80 emulator" rp_module_help="ROM Extensions: .o .p .80 .81\n\nCopy your ZX80 roms to $romdir/zx80\n\n Exit - Exit emulator (F10)\n Reset - Reset emulator (F12)\n\n Read the README files for more information\n " rp_module_licence="GPL2 https://github.com/SegHaxx/sz81/blob/main/README" rp_module_repo="git https://github.com/SegHaxx/sz81.git main" rp_module_section="exp" function sources_sz81() { gitPullOrClone } function build_sz81() { make clean make md_ret_require="$md_build/sz81" } function install_sz81() { md_ret_files=( "." ) } function configure_sz81() { mkRomDir "zx80" defaultRAConfig "zx80" addEmulator 1 "$md_id" "zx80" "pushd $md_inst; $md_inst/sz81 -f %ROM%; popd" addSystem "zx80" }
Install another instance of it labelled SZ80 that might run the ZX80 games? (I have really zero idea how scripts work.)
-
@JimmyFromTheBay said in Any progress being made with ZX81 emulation?:
Would editing the script to something like this
Nice try, though I would try to do both zx80 and zx81 in one script.
However, the difficult part would be the config file.
If the same emulator is used for both systems and the same config file is used then if will not always boot into the proper system.
So when you select zx80 you want to boot into zx80 and not in zx81.
It's the same vice-versa, got it ?I will have a look if we can use separate configs.
-
BTW.
Did you try altering the video-mode in the runcommand launch menu for displaying the emulator screen properly or better ? -
@JimmyFromTheBay said in Any progress being made with ZX81 emulation?:
(I have really zero idea how scripts work.)
I would suggest you read this :
https://www.freecodecamp.org/news/how-to-learn-linux-terminal-as-a-beginner/
and this :
https://www.freecodecamp.org/news/shell-scripting-crash-course-how-to-write-bash-scripts-in-linux/There are many more sites on the internet to find.
Terminal commands can be used in a bash script.
RetroPie is a collection of bash scripts and are basically tied together.
For beginners the most difficult part is how these scripts work.
I had the same issue when starting to write module-scripts.
(A module-script is basically 1 script of the collection of RetroPie scripts.)
The most important thing is to recognize that a module-script contains functions and also that it uses functions.
Also variable are used.
These functions and variables are made and used to simplify the scripts so they can be used in more module-scripts.
Most functions can be found in the RetroPie-Setup/scriptmodules/helpers.sh.
That is basically the summary.Have a look and hopefully you will understand it better now.
You can experiment with it testing just 1 function in a module-script.
Lets say you only want to test the function sources_sz81 from the sz81.sh :function sources_sz81() { gitPullOrClone }
Then you can go into the terminal and do :
cd cd Retropie-Setup sudo ./retropie_packages sz81 sources
It will then download the sz81 source code, using the gitPullOrClone function, and places it in :
~/RetroPie-Setup/tmp/build/sz81
If you want to remove source code for sz81 then you can use :sudo ./retropie_packages sz81 clean
You can just do a test in the sources_sz81 function and replace gitPullOrClone with something like :
echo "hello world"
Then if you do :
sudo ./retropie_packages sz81 sources
Instead it will output :
hello worldSo you can test every function one by one (and add stuff in there just to test) :
sudo ./retropie_packages sz81 depends (if it's there) sudo ./retropie_packages sz81 sources sudo ./retropie_packages sz81 build sudo ./retropie_packages sz81 install sudo ./retropie_packages sz81 configure sudo ./retropie_packages sz81 clean
This, however, will execute all functions in one go :
sudo ./retropie_packages sz81
Just like when running it from the retropie_setup.
-
Seems it wasn't possible to make one script because of not being able to load the config as an option.
So I created a separate module-script for zx80 just like you suggested :
https://github.com/FollyMaddy/RetroPie-Share/blob/main/00-scriptmodules-00/emulators/sz80.shIt patches the source code to make use of a different config directory (.sz80 instead of sz81)
Read the help.
First time it will boot in zx81 by default.
Change the it by clicking the config icon inside the emulator and save the config. -
@Folly Works! Fantastic! ZX80 games! Thank you! :)
-
@Folly said in Any progress being made with ZX81 emulation?:
BTW.
Did you try altering the video-mode in the runcommand launch menu for displaying the emulator screen properly or better ?Yes, can't get it to make any difference.
-
I tested hero and had exactly the same image.
I will add that second option to the script that you suggested. -
A suggestion is to read the manual.
It can be found in the folder manual in the source.Found that it can also do Chroma.
So games that have color will work too.Here are some examples :
In the Makefile you can also add more, ZXPAND is an example which is an external addon.
It seems to be working but I do not know yet where to put the SD-card files -
@Folly Ooh, getting ZXPAND in would be great, because then Zedragon II would work, and maybe the DK'Tronics version of Space Invaders by Jeff Minter.
-
When also doing the ZX81-ZXPAND I think the approach should be similar as what we did with zx80.
- rename the function names
- do the same patch as in zx80 to separate the config file for the zxpand version
- patch the makefile so the option
-zxpand
will be added for compiling the emulator with xzpand - edit the help part if we know where to put the sdcard files for zxpand
- edit where the configure part so the binary is saver in a different folder than the standar sz81 emultor and edit where the runcommands go to and how they are called
Looking at the previous module-scripts I made, would you be able to make the module-script for zxpand now ?
-
-
What is the "makefile"?
-
What are the "sdcard files" for ZXPAND?
-
"edit where the configure part so the binary is saver in a different folder than the standar sz81 emultor" - is that referring to these lines?
function sources_sz80() { gitPullOrClone #patch and change the config directory for ZX80 sed -i 's/\"\.sz81\"/\"\.sz80\"/g' "sdl_resources.h"
Because I have NO idea what that's all about, or what the different slashes mean. There basically isn't one part of that last line I understand :(
So it looks like the answer to your question, sadly, is "Hell no" :D
-
-
@JimmyFromTheBay said in Any progress being made with ZX81 emulation?:
- What is the "makefile"?
Here you can find what makefiles do.
The sourcecode of sz81 is here.
You will notice the Makefile.
I highlighted these lines to give you an impression on what can be added to the CFLAGS in order to compile the source code with for example zxpand.
To add zxpand it has to be added in the line 40 :
.... -D_DZ80_EXCLUDE_SCRIPT -DZXPAND- What are the "sdcard files" for ZXPAND?
I am not an expert on zxpand but it seems that program files are loaded from sdcard.
More info about zxpand can be found here.
You can also read that the SZ81 emulator can emulate the ZXpand+. To run a ZXpand-compatible program, you have to put the P file and its .wad file in the ZXpand_SD_Card folder.- "edit where the configure part so the binary is saver in a different folder than the standar sz81 emultor" - is that referring to these lines?
function sources_sz80() { gitPullOrClone #patch and change the config directory for ZX80 sed -i 's/\"\.sz81\"/\"\.sz80\"/g' "sdl_resources.h"
no,
I meant :
function configure_sz80()What you mention is sources part , look at the function name.
Because I have NO idea what that's all about, or what the different slashes mean. There basically isn't one part of that last line I understand :(
You can read more about what the program sed does over here.
So it looks like the answer to your question, sadly, is "Hell no" :D
Haha, I understand.
In the beginning it's all garbage.
Try to read the stuff I send you.
Hope you will understand it a little bit better.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.