Okay! I have just finished version 0.7a, which comes in an inordinate number of variants. I will explain...
The purpose of the 0.6 series was to get all the subsystems working reliably, but now we have to tune the exact parameters of slowdown in order to fix some of the remaining problems. Here are the remaining problems I'm aware of:
- Double bong and mouse issues on James's SE Reloaded
- Address error on reboot with SCSI Director 4.0 drivers
- LocalTalk not working, last worked in "fastscsi"
The issues on James's Reloaded are complicated so we will have to be patient and see what he finds. There's that old engineering joke--the hardest problem is the one that appears a little more often than every two weeks. Longer than that, you can get paid and go work on another project at some other company. More frequently and you'll be able to observe it enough that you can figure it out. But juuust under two weeks, that's the worst.
Okay, now the SCSI Director 4.0 address error. I will use the logic analyzer to see exactly what's happening before the address error but it doesn't seem like a huge problem. The drivers must just have some unusual speed dependence, like a game that plays faster on a faster CPU. Will investigate more but I don't think this one is a showstopper.
The LocalTalk issue is interesting. Did I introduce a bug since "fastscsi" or is it the increased slowdown interval introduced in 0.6b responsible for fixing sound the last bit? Or something else? This question is what the 0.7 version aims to answer. So attached I have
version 0.7a, which has a new feature, the slowdown control register. You write to it by writing to an address of the form $F00XXX (so in the range $F00000-$F00FFF). The register is written using address bits 11 through 1:
A[11:8] - SlowInterval[3:0] - Controls low long the accelerator is slowed down for in multiples of 11x the Mac’s E clock rate.
- 0 = always slow
- 1 = 7 microseconds avg. (range is 0 - 14.042 us)
- 2 = 21 us avg. (14 - 28 us)
- 3 = 35 us avg. (28 - 42 us)
- ...
- 15 = avg 203 us (196-210 us)
A[7] - SlowIACK - slowdown triggered on interrupt acknowledge cycle
A[6] - SlowVIA - slowdown triggered on VIA access
A[5] - SlowIWM - slowdown triggered on IWM access
A[4] - SlowSCC - slowdown triggered on SCC access
A[3] - SlowSCSI - slowdown triggered on SCSI access
A[2] - SlowSound - slowdown triggered on sound buffer write
A[1] - SlowClockGate - fast CPU clock reduced to C8M speed during slowdown
With this, we can investigate which slowdown triggers are causing/solving certain issues without having to reflash the firmware. Here are some example addresses and how they affect the slowdown behavior:
- $F00FFE - these are the default settings. Slowdown interval is 15 (203ish microseconds) and is triggered by all devices. During slowdown the fast CPU clock speed reduces to 7.8336 MHz too by selectively gating 25 MHz clock pulses to the CPU
- $F00FFC - same as previous but the clock gating is disabled, so slowdown affects only RAM/ROM access speed/latency, not CPU speed
- $F00002 - slowdown always enabled, including CPU clock reduced to 7.8336 MHz
- $F00000 - slowdown always enabled, but no clock gating so only RAM/ROM speed affected
- $F00F00 - slowdown always disabled for maximum speed but may have compatibility issues
- $F00374 - equivalent slowdown policy as the old "fastscsi." Slowdown interval is 3 (35ish microseconds) and is triggered by all devices except for IACK and SCSI. Clock gating disabled
So just write anything to these addresses and the slowdown settings will be changed according to the low 11 address bits A[11:1] (i.e. low three hex digits of the address). You can do this in the MacsBug debugger by pressing the interrupt key, then entering (using the $F00FFE address as an example):
The first line, "SM F00FFE 0000" means to write $0000 to address $F00FFE. The written data doesn't matter, only the address. After pressing enter to run the command, the slowdown settings will be applied. The second line "ES" means exit to shell. Basically quits the debugger and goes back to the Mac OS.
Slowdown settings will persist through reboot but not a power cycle.
However, what if we need to study something occurring when the Mac first boots, before there's a chance to change the settings? What if the ROM firmware like, measures the machine speed and stores that even between soft/warm reboots? So in addition to the register, I have a bunch of variants of the 0.7a firmware that have different speed control register settings applied at power-up:
Version name | Slowdown interval | Trigger devices | Clock gating? | Equivalent address |
0.7a | ~203 us | all | Yes (7.8336 MHz) | $F00FFE |
0.7a-35us | ~35 us | all | Yes (7.8336 MHz) | $F003FE |
0.7a-noclockgate | ~203 us | all | No (25 MHz) | $F00FFC |
0.7a-35us-noclockgate | ~35 us | all | No (25 MHz) | $F003FC |
0.7a-fast | never | n/a | n/a | $F00F00 |
0.7a-slow | always | n/a | Yes (7.8336 MHz) | $F00002 |
0.7a-slow-noclockgate | always | n/a | No (25 MHz) | $F00000 |
0.7a-fastiack | ~203 us | all but IACK | Yes (7.8336 MHz) | $F00F7E |
0.7a-fastiack-35us | ~35 us | all but IACK | Yes (7.8336 MHz) | $F0037E |
0.7a-fastiack-noclockgate | ~203 us | all but IACK | No (25 MHz) | $F00F7C |
0.7a-fastiack-35us-noclockgate | ~35 us | all but IACK | No (25 MHz) | $F0037C |
0.7a-fastscc | ~203 us | all but SCC | Yes (7.8336 MHz) | $F00FEE |
0.7a-fastscc-35us | ~35 us | all but SCC | Yes (7.8336 MHz) | $F003EE |
0.7a-fastscc-noclockgate | ~203 us | all but SCC | No (25 MHz) | $F00FEC |
0.7a-fastscc-35us-noclockgate | ~35 us | all but SCC | No (25 MHz) | $F003EC |
0.7a-fastscsi | ~203 us | all but SCSI | Yes (7.8336 MHz) | $F00FF7 |
0.7a-fastscsi-35us | ~35 us | all but SCSI | Yes (7.8336 MHz) | $F003F7 |
0.7a-fastscsi-noclockgate | ~203 us | all but SCSI | No (25 MHz) | $F00FF5 |
0.7a-fastscsi-35us-noclockgate | ~35 us | all but SCSI | No (25 MHz) | $F003F5 |
0.7a-fastiack-fastscc | ~203 us | all but IACK, SCC | Yes (7.8336 MHz) | $F00F6E |
0.7a-fastiack-fastscc-35us | ~35 us | all but IACK, SCC | Yes (7.8336 MHz) | $F0036E |
0.7a-fastiack-fastscc-noclockgate | ~203 us | all but IACK, SCC | No (25 MHz) | $F00F6C |
0.7a-fastiack-fastscc-35us-noclockgate | ~35 us | all but IACK, SCC | No (25 MHz) | $F0036C |
0.7a-fastiack-fastscsi | ~203 us | all but IACK, SCSI | Yes (7.8336 MHz) | $F00F76 |
0.7a-fastiack-fastscsi-35us | ~35 us | all but IACK, SCSI | Yes (7.8336 MHz) | $F00376 |
0.7a-fastiack-fastscsi-noclockgate | ~203 us | all but IACK, SCSI | No (25 MHz) | $F00F74 |
0.7a-fastiack-fastscsi-35us-noclockgate | ~35 us | all but IACK, SCSI | No (25 MHz) | $F00374 |
0.7a-fastiack-fastscc-fastscsi | ~203 us | all but IACK, SCC, SCSI | Yes (7.8336 MHz) | $F00F64 |
0.7a-fastiack-fastscc-fastscsi-35us | ~35 us | all but IACK, SCC, SCSI | Yes (7.8336 MHz) | $F00364 |
0.7a-fastiack-fastscc-fastscsi-noclockgate | ~203 us | all but IACK, SCC, SCSI | No (25 MHz) | $F00F62 |
0.7a-fastiack-fastscc-fastscsi-35us-noclockgate | ~35 us | all but IACK, SCC, SCSI | No (25 MHz) | $F00362 |
There are just a small number of the total 2048 firmware variants that could be generated. I mainly picked these so we could start investigating how to improve SCSI speed and fix LocalTalk without breaking anything else. The point of all these is not to try them all, but to pick the exact right combination to try so as to test for the cause of a particular problem.
@JDW @JTRetro I recommend you try version 0.7a or 0.7a-fastscsi since disabling SCSI slowdown is probably the most fun option here lol.
@ppuskari If LocalTalk doesn't work on 0.7a, try 0.7a-fastiack-fastscsi-35us-noclockgate. This is more or less equivalent in slowdown policy to the old "fastscsi." Might be interesting to first flash 0.7a, check LocalTalk, write to $F00374 to set fastiack-fastscsi-35us-noclockgate, try LocalTalk again, soft reboot, try LocalTalk again, flash 0.7a-fastiack-fastscsi-35us-noclockgate, try LocalTalk again. At least until you get success. That way we can get a little more insight into whether you can just change the slowdown speed, or if there are some compiled routines that are dependent on the speed measured at boot or initial power-on.
All the firmware variants are attached!