Menu

Communicating with running fuse from host computer and other small things

Help
Pete Moore
2020-11-25
2020-11-26
  • Pete Moore

    Pete Moore - 2020-11-25

    Hi folks,
    I'm working on a modern port (not an emulator) of the ZX Spectrum 128K to the raspberry pi. In other words, conversion of the original ROM routines to aarch64, so that Sinclair BASIC and the familiar menus etc are available, but the machine will have more memory, better graphics, better sound etc. So not backwardly compatible with the original spectrum.
    In order to do this I've been porting ROM routines, and started writing tests for the raspberry pi port of the routines. However, I would like to verify my assertions about the original routines by writing some tests against the original ZX Spectrum 128K ROM routines too, to line up with the new tests for the ported routines. My plan is to compile some test case data into Z80 assembly, probably use pasmo to compile it and build a snapshot image of a BASIC program to load the machine code and run it, and feed back tests results to the host running fuse. So now ... the question.
    The plan is to build a z80 snapshot (or some other format), start up fuse, to load the binary automatically, execute it, and then to somehow shutdown fuse when the test(s) complete. The tests (running under fuse) would communicate either by writing to e.g. RS232 / printer interface / divIDE / some storage medium, and then stop.
    1) How can a program running under fuse cause fuse to stop? Is there some way I can signal the tests are complete, and the emulator can stop?
    2) What is the most efficient way to communicate test results back to the process that started fuse up?
    3) If I have a running fuse process, can I communicate with it using e.g. unix signals, or connect to a control port etc, in order to call APIs such as taking a screenshot, stopping the machine, hitting the NMI reset button, ... all the things you can do in the UI?
    4) Can I run fuse without it starting a graphical window? If the z80 assembly has a way to write to a serial port etc that I can get access to from the process that started fuse, I don't need a physical window to open etc. Also this is useful when running e.g. under docker.

    Also happy if this is documented, if you can just point me to the docs about communicating with a running fuse process, or how to cause the emulator to stop from inside the machine from a running program.

    Many thanks in advance for any tips!

    Best wishes,
    Pete

     
  • Pete Moore

    Pete Moore - 2020-11-25

    .... for anyone interested in the project, link is here, btw: https://github.com/spectrum4 - I should have included it above, but forgot!

     
  • Paul Osmialowski

    Hi Pete,

    I think I may have something that could be partially of your interest. Some time ago I proposed following patch: https://sourceforge.net/p/fuse-emulator/patches/426
    Basically, it enables two ways communication with emulation session by redirecting fuse's stdin and stdout to the emulated built-in ZX Spectrum 128k (and later models) bit-banging serial port. On emulated ZX Spectrum +3 this can be nicely utilized by CP/M Plus programs (e.g. Qterm), as demonstrated on this video: https://youtu.be/53hfur7ZBJU maybe you'll find it interesting.

    Good luck with your project,
    Paul

     

Log in to post a comment.