• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Any progress being made with ZX81 emulation?

Scheduled Pinned Locked Moved Help and Support
zx81lr-81
28 Posts 2 Posters 1.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JimmyFromTheBay @Folly
    last edited by 7 Feb 2025, 08:34

    @Folly (Did it work in fullscreen for you? I get it in a little corner less than a quarter of the screen, I can make it a bit bigger or smaller with Alt-R but still off-centre. F11 does nothing.)

    Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

    F 1 Reply Last reply 7 Feb 2025, 08:53 Reply Quote 0
    • F
      Folly @JimmyFromTheBay
      last edited by Folly 2 Jul 2025, 08:43 7 Feb 2025, 08:38

      @JimmyFromTheBay

      Good to hear that it's working even without adding dependancies.
      Here are the options you can use.

      help.png

      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.

      J 1 Reply Last reply 7 Feb 2025, 11:01 Reply Quote 0
      • F
        Folly @JimmyFromTheBay
        last edited by Folly 2 Jul 2025, 09:01 7 Feb 2025, 08:53

        @JimmyFromTheBay

        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 :
        -800x600

        edit:
        For me this option doesn't work on a regular pc, not sure why.

        J 1 Reply Last reply 7 Feb 2025, 11:26 Reply Quote 0
        • J
          JimmyFromTheBay @Folly
          last edited by 7 Feb 2025, 11:01

          @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!

          Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

          1 Reply Last reply Reply Quote 0
          • J
            JimmyFromTheBay @Folly
            last edited by JimmyFromTheBay 2 Jul 2025, 11:28 7 Feb 2025, 11:26

            @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.

            sz1.jpg

            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.

            sz2.jpg

            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...

            Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

            F 1 Reply Last reply 7 Feb 2025, 13:32 Reply Quote 0
            • F
              Folly @JimmyFromTheBay
              last edited by Folly 2 Jul 2025, 13:45 7 Feb 2025, 13:32

              @JimmyFromTheBay

              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.

              J 1 Reply Last reply 7 Feb 2025, 15:47 Reply Quote 0
              • J
                JimmyFromTheBay @Folly
                last edited by JimmyFromTheBay 2 Jul 2025, 16:00 7 Feb 2025, 15:47

                @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.

                sz3.jpg

                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.

                sz4.jpg

                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"
                

                Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                F 1 Reply Last reply 7 Feb 2025, 16:03 Reply Quote 1
                • F
                  Folly @JimmyFromTheBay
                  last edited by 7 Feb 2025, 16:03

                  @JimmyFromTheBay

                  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.

                  J 1 Reply Last reply 7 Feb 2025, 16:11 Reply Quote 0
                  • J
                    JimmyFromTheBay @Folly
                    last edited by JimmyFromTheBay 2 Jul 2025, 16:12 7 Feb 2025, 16:11

                    @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.)

                    Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                    F 4 Replies Last reply 8 Feb 2025, 16:47 Reply Quote 0
                    • F
                      Folly @JimmyFromTheBay
                      last edited by 8 Feb 2025, 16:47

                      @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.

                      1 Reply Last reply Reply Quote 0
                      • F
                        Folly @JimmyFromTheBay
                        last edited by 8 Feb 2025, 16:54

                        @JimmyFromTheBay

                        BTW.
                        Did you try altering the video-mode in the runcommand launch menu for displaying the emulator screen properly or better ?

                        J 1 Reply Last reply 9 Feb 2025, 18:58 Reply Quote 0
                        • F
                          Folly @JimmyFromTheBay
                          last edited by Folly 2 Aug 2025, 18:23 8 Feb 2025, 17:12

                          @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 world

                          So 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.

                          1 Reply Last reply Reply Quote 1
                          • F
                            Folly @JimmyFromTheBay
                            last edited by Folly 2 Aug 2025, 20:13 8 Feb 2025, 20:13

                            @JimmyFromTheBay

                            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.sh

                            It 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.

                            J 1 Reply Last reply 8 Feb 2025, 20:44 Reply Quote 1
                            • J
                              JimmyFromTheBay @Folly
                              last edited by 8 Feb 2025, 20:44

                              @Folly Works! Fantastic! ZX80 games! Thank you! :)

                              Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                              1 Reply Last reply Reply Quote 0
                              • J
                                JimmyFromTheBay @Folly
                                last edited by 9 Feb 2025, 18:58

                                @Folly said in Any progress being made with ZX81 emulation?:

                                @JimmyFromTheBay

                                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.

                                Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                                F 2 Replies Last reply 10 Feb 2025, 07:27 Reply Quote 1
                                • F
                                  Folly @JimmyFromTheBay
                                  last edited by 10 Feb 2025, 07:27

                                  @JimmyFromTheBay

                                  I tested hero and had exactly the same image.
                                  I will add that second option to the script that you suggested.

                                  1 Reply Last reply Reply Quote 1
                                  • F
                                    Folly @JimmyFromTheBay
                                    last edited by 10 Feb 2025, 10:15

                                    @JimmyFromTheBay

                                    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 :
                                    Wall.png
                                    Rebound.png

                                    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

                                    J 1 Reply Last reply 13 Feb 2025, 22:39 Reply Quote 0
                                    • J
                                      JimmyFromTheBay @Folly
                                      last edited by 13 Feb 2025, 22:39

                                      @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.

                                      Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                                      F 1 Reply Last reply 14 Feb 2025, 15:51 Reply Quote 0
                                      • F
                                        Folly @JimmyFromTheBay
                                        last edited by Folly 14 Feb 2025, 15:51

                                        @JimmyFromTheBay

                                        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 ?

                                        J 1 Reply Last reply 14 Feb 2025, 17:44 Reply Quote 0
                                        • J
                                          JimmyFromTheBay @Folly
                                          last edited by JimmyFromTheBay 14 Feb 2025, 17:44

                                          @Folly

                                          • 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

                                          Raspberry Pi 3b and 8GB Raspberry Pi 4, both running Retropie 4.7.1 installed from scratch using Raspberry Pi Imager, with wired keyboard, wireless mouse and double arcade joystick attached.

                                          F 1 Reply Last reply 14 Feb 2025, 19:14 Reply Quote 0
                                          27 out of 28
                                          • First post
                                            27/28
                                            Last post

                                          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.

                                            This community forum collects and processes your personal information.
                                            consent.not_received