ijor wrote: 16 Oct 2023 12:00
I'm not sure I understand. Are you going to process all the computer's audio analogically through an ADC, or just the SIO Audio will use ADC, and the Pokey audio will be fully digitally?
A bit of column A and a bit of column B. It’s possible to bus-snoop to get Pokey data, and then implement a Pokey core (or two, for stereo) on the FPGA to reconstruct the sound, but you don’t get SIO audio, as you point out.
I also have 4 ADC channels that aren’t doing anything on the RP2040, and I know there are people who have a 3.5mm jack on the back of their 8-bit, so allowing that to be just plugged in would be useful too. If I’m implementing one of these to capture SIO audio, it doesn’t take much to do another two (for stereo Pokey) and allow them to be plugged in. The RP2040 is a capable little chip and I’m not really using it for much, computationally, it can easily manage some audio mixing.
Badwolf wrote: 16 Oct 2023 10:39.
I suspect though there are many (if not the majority) of programs that for the sake of speed infer (or simply assume) the pixel format in use and bash their graphics to what they consider screen RAM.
It'll be fascinating to see if this is a problem down the line -- it may be that a smart raster sync protocol is needed later on. :)
Yep, I actually tend to agree with you here, as I said above…
Also, I should point out that the ST was an after-thought for this project, and I was really targeting the XL/XE. I do think using the ST cartridge port is a viable technical approach, but I'm not sure just how much software on the ST used the API calls exclusively to output their display, and didn't rely on hacks to write to the screen memory. The ST wasn't actually that fast once you took the 68k bus access protocol into consideration... I suspect "cheating" to get performance was widespread.
I think anything that could run on a TT and would take advantage of something like a crazy-dots card ought to be good to go. I suspect later applications might be better behaved because they’d either assume NVDI was in place or would have aspirations to run on expanded hardware, but I also tend to think there will be a lot where things fall down :(
[edit]
So here's a far-out idea that might help :)
Let's say we reserve the first (or last) megabyte or so of our paged space to be ROM, with 68K code contained within it, and we set the page address by default to point to the ROM. That means, on boot, the cartridge code can be run and do stuff before anything else gets to play - including TOS if we set this as a "diagnostic" cartridge. I guess it could change mode to "pipe" operation once it's all finished with setup.
In previous systems at work (on ARM processors), I've used processor exceptions to handle some "out there" cases, and I think it could be done here too. If, at boot, we set Physbase / Logbase to point to some unmapped memory address (for the entire 32K/150K of screen RAM) and install an exception handler for BusError, then any write to the "screen memory" will instead cause an exception. The 68K is pretty good at exceptions (coming from the ARM world, where 12 cycles for an interrupt is "good") and starts handling the exception within 2 clocks for group-0 exceptions (which BusError falls into).
We get an exception frame of 7 words, pointed to by the SSP which looks like...
| Memory Access / function code |
| Access address high |
| Access address low |
| Instruction register |
| Status register |
| Program counter high |
| Program counter low |
... which means we can bundle up the only thing we care about (the access address) and send it down the pipe as a "write-to-screen" command, then just use the PC information to return to the program, which is none the wiser.
I mean, calling an exception per pixel plotted isn't going to set the world on fire in terms of speed :) But it ought to be possible to make it work - even if it is (slightly ironically) slower than the new "OS" way of setting pixels, and if a program is going to be badly behaved, wotchagonnado ? :roll:
FWIW,
this is a decent treatment of 68K exception handling (Goes through tiny-url because the link-handler doesn't like square brackets in URLs...)