+ // Fixup DSP56001 addresses
+ case FU_56001:
+ switch (dw & FUMASKDSP)
+ {
+ // DSPIMM5 actually is clamped from 0 to 23 for our purposes
+ // and does not use the full 5 bit range.
+ case FU_DSPIMM5:
+ if (eval > 23)
+ {
+ error("immediate value must be between 0 and 23");
+ break;
+ }
+
+ locp[2] |= eval;
+ break;
+
+ // This is a 12-bit address encoded into the lower 12
+ // bits of a DSP word
+ case FU_DSPADR12:
+ if (eval >= 0x1000)
+ {
+ error("address out of range ($0-$FFF)");
+ break;
+ }
+
+ locp[1] |= eval >> 8;
+ locp[2] = eval & 0xFF;
+ break;
+
+ // This is a full DSP word containing Effective Address Extension
+ case FU_DSPADR24:
+ case FU_DSPIMM24:
+ if (eval >= 0x1000000)
+ {
+ error("value out of range ($0-$FFFFFF)");
+ break;
+ }
+
+ locp[0] = (uint8_t)((eval >> 16) & 0xFF);
+ locp[1] = (uint8_t)((eval >> 8) & 0xFF);
+ locp[2] = (uint8_t)(eval & 0xFF);
+ break;
+
+ // This is a 16bit absolute address into a 24bit field
+ case FU_DSPADR16:
+ if (eval >= 0x10000)
+ {
+ error("address out of range ($0-$FFFF)");
+ break;
+ }
+
+ locp[1] = (uint8_t)(eval >> 8);
+ locp[2] = (uint8_t)eval;
+ break;
+
+ // This is 12-bit immediate short data
+ // The upper nibble goes into the last byte's low nibble
+ // while the remainder 8 bits go into the 2nd byte.
+ case FU_DSPIMM12:
+ if (eval >= 0x1000)
+ {
+ error("immediate out of range ($0-$FFF)");
+ break;
+ }
+
+ locp[1] = (uint8_t)eval;
+ locp[2] |= (uint8_t)(eval >> 8);
+ break;
+
+ // This is 8-bit immediate short data
+ // which goes into the middle byte of a DSP word.
+ case FU_DSPIMM8:
+ if (eval >= 0x100)
+ {
+ error("immediate out of range ($0-$FF)");
+ break;
+ }
+
+ locp[1] = (uint8_t)eval;
+ break;
+
+ // This is a 6 bit absoulte short address. It occupies the low 6
+ // bits of the middle byte of a DSP word.
+ case FU_DSPADR06:
+ if (eval > 63)
+ {
+ error("address must be between 0 and 63");
+ break;
+ }
+
+ locp[1] |= eval;
+ break;
+
+ // This is a 6 bit absoulte short address. It occupies the low 6
+ // bits of the middle byte of a DSP word.
+ case FU_DSPPP06:
+ if (eval < 0xFFFFFFC0)
+ {
+ error("address must be between $FFC0 and $FFFF");
+ break;
+ }
+
+ locp[1] |= eval & 0x3F;
+ break;
+
+ // Shamus: I'm pretty sure these don't make any sense...
+ case FU_DSPIMMFL8:
+ warn("FU_DSPIMMFL8 missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
+ break;
+
+ case FU_DSPIMMFL16:
+ warn("FU_DSPIMMFL16 missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
+ break;
+
+ case FU_DSPIMMFL24:
+ warn("FU_DSPIMMFL24 missing implementation\n%s", "And you may ask yourself, \"Self, how did I get here?\"");
+ break;
+
+ // Bad fixup type--this should *never* happen!
+ default:
+ interror(4);
+ // NOTREACHED
+ }
+ break;
+