New Z80 MZ-700 emulator implemented in Rust and Slint

CnfBenMorgan
Posts: 7
Joined: Sun Nov 12, 2023 10:05 pm

New Z80 MZ-700 emulator implemented in Rust and Slint

Post by CnfBenMorgan »

Hello,

I've been for some time working on an emulator, emulating the Z80 CPU and the wonderful MZ-700 hardware. The MZ-731 was my first computer, and I'm nostalgic and missing it. The emulator is fully functional, it can run S-BASIC - all games I tested, and also modern demos I've tested.

It's available from here:
https://bitbucket.org/bennysj/z80emu

Cheers!
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by hlide »

const HBLK_HIGH_PERIOD: u64 = 36088; <--- Period in which unit?
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by hlide »

BLKN -> should be BLNK I guess

vram_enabled <- I suspect it is for INH1 which inhibits DRAM ($D000-$FFFF) for VRAM ($D000-$DFFF), IO memory ($E000-$E00F), QD ($E800-$EFFF), FD ($F000-$FFFF), which is more than enabling VRAM access. rom_enabled -> INH0 which inhibits DRAM ($0000-$3FFF) for MROM at the same address range.

(I prefer to stick to signal name used in manual)
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by hlide »

The clock source for i8253 channel #1 is BLNK. It may not sound like but it is important that channel #1 is synchronized with BLNK because some effects may depend upon it: one of my games is using that timer to output a sound just after BLNK goes 0.

HALT ; wait for BLNK goes to 0 and call INT outputting a sound
LD SP, source
retrieving up to 14 bytes using PUSH to prepare their drawings
LD SP, vram
PUSH AF ; first to block on BLNK = 0, waiting for BLNK = 1
PUSH... ; drawing the bytes on VRAM during BLNK = 1
LD SP, normal stack at this point so INT can occur safely
HALT ; next sound output and next 14 bytes to draw
...
CnfBenMorgan
Posts: 7
Joined: Sun Nov 12, 2023 10:05 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by CnfBenMorgan »

Let me start with, thank you so much for your feedback, and thank you so much for taking your time to analyse and review the code, it's all very much appreciated :)
const HBLK_HIGH_PERIOD: u64 = 36088; // It's nano seconds

BLKN- yes you are right, that's an unintentional typo - should be BLNK - I'll fix that
vram_enabled/INH1/INH0 - I've done my best to read and understand the MZ-700 User manual, I see that I did'nt get it totally right, I'll have to work and fix this. Thank you for pointing it out.

About the HALT instruction and INT, that's very interesting :) If you please can point to some specific game/demo that make use of this? I'll do my best to implement this correctly.

Cheers

/Benny
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by hlide »

Basically, my game using the HALT/INT/BLNK is SpaceRally. It is not finished and in pause for a long time. There were many attempts to have better sound using different ways to encode sound than just a sequence of mono-volume frequencies à la MUSIC. I seem I have a version I kept in binary. Understand that is very experimental and I think it can be improved but with more memory wasting. :/

It was tested on EmuZ-700 PAL and on mz800emu.
SPACERALLY v0.4.mzf.zip
(14.81 KiB) Downloaded 62 times
User avatar
mz-80a
Posts: 403
Joined: Thu Jan 25, 2018 10:46 am
Location: Devon, UK
Contact:

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by mz-80a »

I will be interested to see how this emulator pans out, especially with comparison to EmuZ-700
MZ-80A Secrets
https://mz-80a.com/

Sharpworks (Sharp MZ homebrew)
https: //mz-sharpworks.co.uk/
User avatar
mz-80a
Posts: 403
Joined: Thu Jan 25, 2018 10:46 am
Location: Devon, UK
Contact:

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by mz-80a »

I also wish someone would make an MZ-80K emulator where the MUSIC isn't slower than the real machine's MUSIC.
MZ-80A Secrets
https://mz-80a.com/

Sharpworks (Sharp MZ homebrew)
https: //mz-sharpworks.co.uk/
CnfBenMorgan
Posts: 7
Joined: Sun Nov 12, 2023 10:05 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by CnfBenMorgan »

@hilde - Tested the SPACERALLY - so far what I can see it works.
I understand that our available time to spend on Nostalgia may be a bit limited, I would love to see this game finished :)

Uploaded binaries for WIndows and LInux (built on Fedora) for whoever wants to test:
https://bitbucket.org/bennysj/z80emu/do ... =downloads

However no idea if the binaries will work, I would in any case recommend to build from sources.

My knowledge of the MZ-80K is a bit limited, as I have never owned or seen one. I would love to add emulation support for both MZ-80K and the MZ-800, maybe in the future, depending how time I have available etc.

Cheers

/Benny
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: New Z80 MZ-700 emulator implemented in Rust and Slint

Post by hlide »

MZ-80 K should be simpler. There is no LSI. With the service manual, it should be okay to implement it.
Post Reply