Tuesday, 3 October 2023

What can we assume ?

One thing we know about Sinclair is there was quite a lot of recycling.  The ZX80 BASIC is the classic example. IME, this 4k ROM is a work of genius - display driver, BASIC, tape I/O all on ROM and somehow managing to provide a useable programmable machine in 1k of RAM. 

Then we had the ZX81 which is much the same with floating point added.

Then we had the Spectrum, which has (I think) much of the same code, which is why it is so jaw droppingly slow. The original's purpose wasn't to be quick ; it was to make efficient use of space. It's significantly slower than comparable machines of the era.

With this in mind, I'm going to start making some assumptions. Any comments anyone has on these are appreciated.

The CPU is clocked as 3.5Mhz, and the display is 32 characters across.

These two are indelibly linked. The pixel clock on a Spectrum is 7Mhz, which is why the Speccy is clocked at 3.5Mhz. 

I don't know the 32 characters it just seems logically consistent. The machine most like the LC3 AFAICS is the Vic 20, which is 22x23 and it does look a bit chunky and elongated.

I also wondered about the timing, as each block of 8 pixels requires 3 reads (character#, pixels and colour), but the Vic 20 does this easily enough. I recall when reading Bagnall's book that a major problem in producing the 40 column VIC they were considering was memory speed. But I found that the speed of the Vic's SRAM chips is quite slow (about 300ns access time), the LC3 being a couple of years ahead.

The ROM and cartridges occupy the first 32k of memory space. The rest is RAM or RAM expansion space.

I don't know this. There has to be a split point somewhere. Being a Z80, it resets from zero, and all the vectors are there. A few smart machines do allow this to be switched around, but I seriously doubt this is one of them. So half way seems as good as any and it would be easy enough to change. The most likely alternate is $C000, which gives up to 48k for program ROM ; the downside is that for the BASIC you are then limited to 16k.

Other hardware is standard Speccy stuff. Joystick, Sound, Tape I/O and the Border latch.

Much of the hardware could be just copied straight from port $FE. The tape interface is a few resistors and capacitors and a diode, and it worked well enough, not brilliant but okay.  Code exists to read/write to tape that is well tested. (as long as you don't write square roots).

The sound is just an add on to that.  And this is an argument against having the tape I/O in the BASIC cartridge, because the console would have to beep as a bare minimum.

I'm not so sure about this, it depends on how much space there is in the ULA. The alternatives - a D/A converter would take up too much processor time,perhaps and a hardware implementation like in the Vic 20 isn't complicated but takes up ULA space. And developers know how to make the beeper beep.

Finally, the input. Nobody mentions this anywhere but presumably there's some sort of joystick port. Games would be a bit boring otherwise. (It might improve "The Great Space Race")

Why not use the port that everyone already knows, the Sinclair Joystick port that was in the Interface 2 and is directly connected to keys 1-5 on the keyboard (which does not exist...) - there were at that time a vast number of alternative joystick devices you could buy. 

So while I'm at it I might as well keep the border bits as well.  

Finally a Frame Sync (50Hz) Interrupt on IRQ using IM1.

No comments:

Post a Comment

RAM, RAM, glorious RAM :)

Pacman in a UDG system The question is at root, do we have 1k RAM or 2k RAM to work with. We have certain requirements Each square on the sc...