Myask wrote:
So pretty much every bit is inverted and backwards from what you're expecting?
Backwards, yes... not inverted. (Well, spatially inverted. Not logically.)
All 24 bits are like this:
Attachment:
mysterycounter.png [ 5.23 KiB | Viewed 7737 times ]
(I've erased some of the metal and polysilicon for clarity) They really liked their transmission gates in this era.
It's a synchronous up/down counter. Carry out indicates whether the next more significant bit should toggle on the next φ0. It always flows from top to bottom; at the end of each 8 bits there's a big hook that goes to the next one. Carry out from the last bit doesn't go anywhere (node 307).
——
From left to right, the columns in 2a03dead are: I/O buffers to 2A03-internal data bus; 8 LSBs of counter, 8 middle bits of counter; 8 MSBs of counter; control logic; 8 bits of ... broken prescaler? I guess I can fix that:
The control bits ($11) seem to be:
* $00 = 1/8th prescaler (not ÷16 ??)
* $01 = Count rising edges on JOY2
* $10 = 1/128th prescaler (not ÷256 ??)
* $11 = Count falling edges on JOY2
All of these options are inscrutable:
* Why is there no smaller prescaler option?
* Why would we need to count 2³¹ cycles? That's 20 minutes. It seems Memblers was on to something?
* JOY2 is normally an output controlled by software. But even if it was an input, why would we want to be able to count a choice of rising edges or falling edges?
Requesting a load (either by writing to $401F with $40 set or the automatic reload) also clears the prescaler.
Also, I don't quite trust those exact prescalers; I think they "should" be ÷16 and ÷256 given the number of bits in-between.
——
There's two places in the control logic where things were meant to be readable, but are miswired (
there's no "read from $401F" signal and it incorrectly uses the "write to $401F" signal):
Code:
$401F reads: [Exxx xxxI]
|||| ||||
|||| |||+-- Interrupt would be requested
|+++-+++--- special internal-timer open bus value
+---------- Interrupt is allowed to be requested (i.e. value written to $401F & $80)
(Look at nodes 875 and 916)
Reads from $401F
are detected and
do acknowledge the interrupt.
——
Oh, speaking of errors, they're incorrectly generating all the "read from $401C/D/E" strobes ... detecting writes instead of reads.
There's a missing polysilicon-metal junction with node 356. It should be connected to node 60, but isn't. (in hardware. Obviously the sim doesn't have it either.)
And the $401F & $06 bits
are still inscrutable ... but it appears to be some alternate function for JOY1.
$401F & $04 = directly controls JOY1. When the count becomes 0, it causes both $06 bits to invert.
$401F & $02 = doesn't appear to actually change anything, even though the latched value toggles.
I have no idea what this functionality was intended to be.