Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

ZX Spectrum

3 posters

Go down  Message [Page 1 of 1]

1ZX Spectrum Empty ZX Spectrum Sat Jul 08, 2023 6:52 am

vranik



I am trying to implement computer ZX Spectrum 48 k in SimulIDE. There is a screenshot of the start of the computer. It is not finished yet.

ZX Spectrum Screen25

arcachofo and Fizik_S like this post

2ZX Spectrum Empty Re: ZX Spectrum Wed Jul 12, 2023 10:42 am

Defran

Defran

Vranik, Please, could you post schematics and software? It does not matter if the project is not finished yet, this would be very instructive because i am interested in how you have solved the development of the ULA and the screen. Thanks.

3ZX Spectrum Empty Re: ZX Spectrum Wed Jul 12, 2023 3:11 pm

vranik



The ULA is written in C++ and it is a chip only in the schematics, nothing more. I decided to implement it in C++ because of speed, but it is still very slow.

4ZX Spectrum Empty Re: ZX Spectrum Thu Jul 13, 2023 5:09 pm

arcachofo

arcachofo

@vranik:
Do you have the sources in some repo or something?
Or willing to share here?

5ZX Spectrum Empty Re: ZX Spectrum Sat Jul 22, 2023 6:33 am

arcachofo

arcachofo

vranik wrote:I decided to implement it in C++ because of speed, but it is still very slow.
The main problem in that circuit is that you are using resistors in the buses, negating the speed of pure logic circuits.
I guess that in real life those resistors are for protection, but in the simulation there is no problem.

For pullups: Resistor Dips have a new feature to solve this problem. If you configure then as pullups, then they will not force those lines to be "analog":

ZX Spectrum Kk21


Not sure what the transistor is doing, the image is not clear.
If it is a reset circuit or something like that then no problem, but if it is something that is switching fast you could replace it with a buffer.

Ideally you should have "0 Circuits":

ZX Spectrum Kk22


Also printing messages to msg panel at every read/write will slow down the simulation a lot.
But I guess you print them only in some kind of debug mode.

And if you want the maximum speed while using it, you could have another circuit without Logic analyzers and animation disabled.

I also have a "Fast Mode" for Logic Components more or less implemented that can increase the speed a bit more.
It is quite experimental and might not work correctly in some cases, that is why I have not commit it yet.
I will test it and commit later today with an option to enable/disable it.

6ZX Spectrum Empty Re: ZX Spectrum Sat Jul 22, 2023 7:08 am

vranik



Now I am concetrated on functionality. I will analyze the simulation speed later. The screenshot was from the first start of the computer, but there are still several problems to sort it out. For example there is no keyboard. It takes me quite long time because I don't have much free time for it. When it is finished I will share the source code.

The pull up resistors are used at the data bus because the Sinclair ULA has open collector outputs at data bus. There are also resistors which interconnects the data bus of Z80 and the data bus of the Sinclair ULA. It allows to have sometimes two separated data buses and sometimes one common bus.

The transistor is possible to replace by a logic gate. It is not a problem. I just copied it from the schematics.

7ZX Spectrum Empty Re: ZX Spectrum Sat Jul 22, 2023 9:28 am

arcachofo

arcachofo

Ok, nice.

Just note that in this circuit your code has little impact (unless you do something really crazy).
Most of the cpu usage comes from the circuit itself.

8ZX Spectrum Empty Re: ZX Spectrum Wed Jul 26, 2023 8:24 pm

vranik



I nearly finish the ULA chip for ZX Spectrum. It was compiled with trunk R1648.

I discovered bug in z80core. The maskable interrupt doesn't work correctly. It is necessary to move lines 838 - 844 (switch command) to begining of the function opCodeFetch() to line 833.

The ZX Spectrum has basic functionality and it is possible to type commands. The ULA Monitor is very rough and needs to be redesigned.

The class ULA_ZX48k is derived from Chip, but there is some problem during switching package and logic symbol. Also I don't know how to assign pins by their names from package file. Now they are assigned by numbers. The last problem is that I don't know how to set output voltage at pin with defined internal resistance.
Attachments
ZX Spectrum Attachmentula_zx48k_R1648.zip
You don't have permission to download attachments.
(49 Kb) Downloaded 6 times

9ZX Spectrum Empty Re: ZX Spectrum Thu Jul 27, 2023 8:44 pm

arcachofo

arcachofo

I discovered bug in z80core. The maskable interrupt doesn't work correctly. It is necessary to move lines 838 - 844 (switch command) to begining of the function opCodeFetch() to line 833.
Solved at Rev 1764.(Let me know if I did it wrong).

The class ULA_ZX48k is derived from Chip, but there is some problem during switching package and logic symbol. Also I don't know how to assign pins by their names from package file. Now they are assigned by numbers. The last problem is that I don't know how to set output voltage at pin with defined internal resistance.
It is probably better to make it as an MCU:
- You can get whole Ports and Pins by name.
- Set frequency, Status, PC and some other functionalities are available out of the box.
- I recently added a Display module that can be used by MCUs.
 Still very basic, but it probably could fit in your use case.

These things could potentially simplify the implementation quite a bit, letting you focus in the functionality.

The only thing missing is the buttons...
Anyway I need to have a closer look and see if there are more issues to solve to integrate this component.

You can set Input and output resistance at:
IoPin::setInputImp( double imp );
IoPin::setOutputImp( double imp );

Or force a resistance, to use in combination with setVoltage(). (this changes if you change Pin mode):
IoPin::setImp( double imp );

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum