View Single Post
Old September 11th, 2003   #1 (permalink)
Shamus
Emu author
 
Shamus's Avatar
 
Join Date: Jul 2003
Posts: 130
Cool Devtalk: Musings on the DSP (and 1.0.6)

Things have been quiet on the development front lately, so I though I'd share some thoughts on what I've been up to...

So there I was, minding my own business, when Wolfenstein 3D presented me the following DSP code:

Code:
F1B248: MOVEI  #$00F1A100, R01
F1B24E: STORE  R00, (R01)
F1B250: JUMP   T, (R03)
F1B252: NOP
What this little bit of innocuous code does is end the interrupt that it was servicing (in this case, the SSI interrupt). However, unlike what the JTRM recommends, they alter the DSP_FLAGS register before they jump back. What is the problem with this? The main problem is that REGPAGE gets written to on the STORE instruction and so R03 has the wrong address to jump back to when its chance to execute comes up. Egad! Code that depends on pipeline effects!

I tried to think of a simple way to fix this without wrecking other DSP code, and there doesn't seem to be one. If anyone comes up with a simple way to fix this without using a pipelined core, feel free to send a patch.

So anyway, to make a long story short, I tried pipelines with various numbers of stages (4, 3, then 2) and found the optimal number of pipeline stages to be 3. So now I've been going through the DSP code and fixing problems wherever they manifest themselves, but it's been slow going. Pipelines are tricky things to emulate!

So what does this have to do with 1.0.6? Well, it seems that it might be a while before all the kinks are ironed out of the pipelined DSP core, but the changes that have been made up to this point elsewhere (OpenGL, config file, etc.) are important enough to warrant a release. The old DSP core is still there, and it still works the same old (wrong) way that it did before, so it wouldn't be all that difficult to put it out there...
Shamus is offline   Reply With Quote