ZX Spectrum 48K simulation
Quote from Deleted user on December 22, 2024, 11:09 pmI have notice there is a simulation for ZX Spectrum 48K. On the website is the picture which have a composite monitor / tv which show output. I have download and compiled latest source and run simulation, however there is no output on any composite monitor.
What I'm missing?
I have notice there is a simulation for ZX Spectrum 48K. On the website is the picture which have a composite monitor / tv which show output. I have download and compiled latest source and run simulation, however there is no output on any composite monitor.
What I'm missing?
Quote from vranik on December 23, 2024, 6:24 amThere is no monitor nor tv. The video ram content can be displayed by right click on ULA ZX48k and Open MCU monitor. But I noticed that there is a problem with screen refresh.
There is no monitor nor tv. The video ram content can be displayed by right click on ULA ZX48k and Open MCU monitor. But I noticed that there is a problem with screen refresh.
Quote from arcachofo on December 23, 2024, 8:15 pmThe refresh problem can be solved editing the file:
data/Z80/ULA ZX48k/ULA ZX48k.mcuAt line 11 change "monitorscale" by "scale":
<display name="screen" width="448" height="312" scale="2"/>
Anyway I will fix it in the code.
The refresh problem can be solved editing the file:
data/Z80/ULA ZX48k/ULA ZX48k.mcu
At line 11 change "monitorscale" by "scale":
<display name="screen" width="448" height="312" scale="2"/>
Anyway I will fix it in the code.
Quote from Deleted user on December 24, 2024, 1:17 amThanks. Now it works, but very slowly and screen should be 256 x 192, not 448 x 312.
Thanks. Now it works, but very slowly and screen should be 256 x 192, not 448 x 312.
Quote from Deleted user on December 24, 2024, 1:57 amFirst of all, speed of CPU is 3.5MHz and accordingly anything else. But here is shown it is 0MHz during simulation. And there is no way to change frequency of Z80. Frequency for different versions of Z80 goes from 2.5 to 8MHz, but here with ZX Spectrum is used one which works at 3.5MHz. Reset process until it is ready with original ZX spectrum last around 1s.
Secondly, the same thing for ULA, there is several versions. With SZ Spectrum 16/48K is uses 5C and 6C.
And the last, keyboard. I have tried actually to type some very simple BASIC program, but that doesn't work. Basically because ZX Spectrum spending most of interrupt time scanning keyboard and since frequency is not correct, all is messed up. I have tried pressing 1,0,F in order to get 10 FOR..., but that can't be done as on real computer, actually after many times pressing I have got 0... Using PC keyboard seem is not synchronized anyway and many keys doesn't works, even simulator shows it is pressed.
BTW, ZX Spectrum 48 was my first home computer and I have spent a lot of time with it as a kid back in 80s , programming in BASIC and assembler as well... Quite a big nostalgia is related with. Though, real one still works without problems when I turned it on after so many decades!
First of all, speed of CPU is 3.5MHz and accordingly anything else. But here is shown it is 0MHz during simulation. And there is no way to change frequency of Z80. Frequency for different versions of Z80 goes from 2.5 to 8MHz, but here with ZX Spectrum is used one which works at 3.5MHz. Reset process until it is ready with original ZX spectrum last around 1s.
Secondly, the same thing for ULA, there is several versions. With SZ Spectrum 16/48K is uses 5C and 6C.
And the last, keyboard. I have tried actually to type some very simple BASIC program, but that doesn't work. Basically because ZX Spectrum spending most of interrupt time scanning keyboard and since frequency is not correct, all is messed up. I have tried pressing 1,0,F in order to get 10 FOR..., but that can't be done as on real computer, actually after many times pressing I have got 0... Using PC keyboard seem is not synchronized anyway and many keys doesn't works, even simulator shows it is pressed.
BTW, ZX Spectrum 48 was my first home computer and I have spent a lot of time with it as a kid back in 80s , programming in BASIC and assembler as well... Quite a big nostalgia is related with. Though, real one still works without problems when I turned it on after so many decades!
Quote from Deleted user on December 24, 2024, 2:56 amMore, ULA_Z80-MCU.sim1, ULA_Z80-MCU-fast.sim1 and ULA_Z80-MCU-debug.sim1 have different keyboards. All should have ZX Spectrum keyboard.
Backspace actually stops simulator, instead to delete last token, there is no way to type "=" sight etc. Ser Sinclair's computers are unique how to type commands and special characters... It would be really great if that could be done here as well!
More, ULA_Z80-MCU.sim1, ULA_Z80-MCU-fast.sim1 and ULA_Z80-MCU-debug.sim1 have different keyboards. All should have ZX Spectrum keyboard.
Backspace actually stops simulator, instead to delete last token, there is no way to type "=" sight etc. Ser Sinclair's computers are unique how to type commands and special characters... It would be really great if that could be done here as well!
Quote from arcachofo on December 24, 2024, 12:51 pmOf course it is slow, you are simulating a relatively complex circuit at 3,5 MHz.
About some points you commented:
- As vranik mentioned you are watching the video RAM, not an "screen".
- Z80 frequency is determined by whatever you put in Pin Clk.
- ULA can be configured to 5 different models.
- Keyboard is not "synchronized", it is just a subcircuit with a bunch of switches.You need to understand that this is not the real computer nor even an emulator.
This is a circuit simulator and you are using some example circuits using Z80 and ULA components.
The purpose of a circuit simulator is to design, study and understand circuits. If you want to write and test Basic programs, better use the real computer or an emulator.These are just example circuits using the components Z80 and ULA and a subcircuit for the keyboard.
You can create other circuits using the Z80, ULA and these keyboards or you can create your own components.
Of course it is slow, you are simulating a relatively complex circuit at 3,5 MHz.
About some points you commented:
- As vranik mentioned you are watching the video RAM, not an "screen".
- Z80 frequency is determined by whatever you put in Pin Clk.
- ULA can be configured to 5 different models.
- Keyboard is not "synchronized", it is just a subcircuit with a bunch of switches.
You need to understand that this is not the real computer nor even an emulator.
This is a circuit simulator and you are using some example circuits using Z80 and ULA components.
The purpose of a circuit simulator is to design, study and understand circuits. If you want to write and test Basic programs, better use the real computer or an emulator.
These are just example circuits using the components Z80 and ULA and a subcircuit for the keyboard.
You can create other circuits using the Z80, ULA and these keyboards or you can create your own components.
Quote from Deleted user on December 24, 2024, 6:06 pmI understand upper, but still I can't believe that this is 10x slower even on 1000 times faster machines these days with half-dozen or more than a dozen multi-cores. It have to be a way to speed up all... This circuit is a bare bone form of original ZX Spectrum 48 issue 4 I have or other versions.
Though I can't see how to change frequency of CPU and I see in the code and this mcu file some 14MHz constants... A bit confusing for me, I may say...
I understand upper, but still I can't believe that this is 10x slower even on 1000 times faster machines these days with half-dozen or more than a dozen multi-cores. It have to be a way to speed up all... This circuit is a bare bone form of original ZX Spectrum 48 issue 4 I have or other versions.
Though I can't see how to change frequency of CPU and I see in the code and this mcu file some 14MHz constants... A bit confusing for me, I may say...
Quote from arcachofo on December 25, 2024, 8:58 amUnfortunately a circuit simulation is an inherently sequential proccess, not well suited for parallelism.
In this case the number of cores does not help.
Unfortunately a circuit simulation is an inherently sequential proccess, not well suited for parallelism.
In this case the number of cores does not help.
Quote from Deleted user on December 25, 2024, 9:48 amUnfortunately, something is problematic with ULA simulation... If I detach the component, real simulation percentage raise to 100%. When ULA is present, simulation speed is 10%.
If ULA is real chip simulation on all raw logic gate levels, I could understand why all this is so slow. Otherwise, something in the code radically slow down execution...
Unfortunately, something is problematic with ULA simulation... If I detach the component, real simulation percentage raise to 100%. When ULA is present, simulation speed is 10%.
If ULA is real chip simulation on all raw logic gate levels, I could understand why all this is so slow. Otherwise, something in the code radically slow down execution...