Finally getting around to writing a Raspberry pico-based Sharp MZ-80K emulator.
-
Kludged a way of putting tape contents into memory. SP-5025 BASIC loads and initialises, but hangs before the READY prompt.
Going back to my real MZ-80K, I note that a beep is issued just before the READY prompt. The 8253 is generating the signals for the beep.
And ... I haven't implemented my 8253 handling for the emulator yet, which is why it hangs!
So that's the next job then ...
-
Tim Holyoakereplied to Tim Holyoake on last edited by
8253 impl. seems about right now. Sorted /vblank & cursor blinking, still need to deal with /vgate. 8255 impl. being fleshed out so cassette tape handling is a little less hacky. I also replaced the GPL licensed z80 core I started with for a MIT licenced one, as I prefer that licence (I'd have stuck with the original core, but it was GPL full-fat rather than LGPL, which would have made more sense as it was just a library). The alternative seems to work just as well.
-
Tim Holyoakereplied to Tim Holyoake on last edited by
Not done very much on the emulator for the last few days. Getting back into the swing of things by debugging my cassette tape handling code ...
-
Made some good progress with the pico #SharpMZ80K emulator this evening. For the first time (after merciless kludging of the 8253 code wot I wrote) I have SP-5025 BASIC up and running - and executing a "hello world" program!
-
Fixed the shift key glitching issue. Implemented more key codes (just SML codes left now - lower case alpha & graphics).
I want to get cassette read to work properly, even though I can bash programs directly into memory (not satisfying for some reason).
Oh, and then getting the SD card to work. The Raspberry Pico example code doesn't work for me, which means I have a bad SD card or a bad pico demo board.
And my 8253 code is driving the MZ-80K's clock backwards!
-
A big effort on 8253 emulation has pared it back to the bare minimum, fixing the time going backwards issue.
Time synchronises with the pico RTC, so I don't think implementing counter 1 (clock rate generator) is needed, beyond returning from any calls to read or write to it (at address E005).
I may be able to do something similar for sound generation at E004 & E008. That will probably make implementing E007 redundant, as there are no other PIT control words used!
-
Cassette tape read emulation now starting to work ... Eventually tracked down my main issue to a |= that should just have been an assignment. Load from SD card rather than hard coding 'tapes' in memory will be the next job, but it may be a few weeks before I get to that, as real life calls!
-
Cassette read is working well enough to load a program after boot, but not well enough to load a BASIC program - they all seem corrupt when listed or run. I'm clearly missing something subtle. But in the meantime, here's a video of the Sharp Invader program running in demo mode
-
The problem with my cassette read wasn't subtle at all, but a horrendous bug in my temporary bodges before I get sd card reading sorted. Doh. Took ages to find! May have been quicker just to write the sd card handling...
-
Emulator is generating the primes below 7500 in just over 13 minutes with all the debug output turned on, so should get close to the 10m12s the real machine takes to do this I hope. Otherwise I will need to optimise some stuff!
-
Ah, no - the real machine is 10m 18s, not 10m 12s. Less optimisation required, which is a good thing.
-
Diagnostics off has saved me a massive 4 seconds. I'm going to overclock the pico I think ...
-
An overclock to 200Mhz is too fast ... I have 8m 34s now!
-
150MHz is a little too slow, but close enough until I figure out the set_sys_clk_pll stuff (I've used set_sys_clk_khz for the moment). Fairly important bit of missing Pico sdk documentation is what the first parameter is measured in. Hz? KHz? MHz? Something else? If anyone knows how to set a clock of about 166MHz I'd appreciate a reply
#RetroComputing #SharpMZ80K #RaspberryPi #RaspberryPico #RaspberryPiPico #Pico
-
I've decided I need a little bit of a push to get this project to a first release, so I've signed it up for #RetroChallenge 2024/10. #SharpMZ80K #RetroComputing
-
I'm on the list ... No turning back now! https://www.retrochallenge.org/p/entrants-list-202410.html
#RetroChallenge #RetroComputing #SharpMZ80K #RaspberryPi #Pico
-
First day of #RetroChallenge and as I'm away from home today there won't be any progress to report. Coincidentally, last night I came across an article titled "Why MZ emulate?" penned by Arthur Luddight (geddit?!) in the March 1999 edition of the now-defunct Sharp Users Club magazine. Not sure that it bodes well
-
Riley S. Faelanreplied to Tim Holyoake last edited by
@psychotimmy I have had a wee bit of experience with the Sharp MZ series. Beautiful machines, even with their limitations.