mirror of https://github.com/snes9xgit/snes9x.git
dsp1: Optimise copying registers on LE platforms
Use {READ,WRITE}_WORD so that it copies by word on little-endian platforms. This also fixes a bug in the assignment of Op11Xr which was a regression introduced in snes9x-1.40.
This commit is contained in:
parent
242238a610
commit
96059dd45a
347
dsp1.cpp
347
dsp1.cpp
|
@ -1266,187 +1266,163 @@ void DSP1SetByte (uint8 byte, uint16 address)
|
|||
break;
|
||||
|
||||
case 0x00: // Multiple
|
||||
DSP1.Op00Multiplicand = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op00Multiplier = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op00Multiplicand = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op00Multiplier = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
|
||||
DSP1_Op00();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = DSP1.Op00Result & 0xFF;
|
||||
DSP1.output[1] = (DSP1.Op00Result >> 8) & 0xFF;
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op00Result);
|
||||
break;
|
||||
|
||||
case 0x20: // Multiple
|
||||
DSP1.Op20Multiplicand = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op20Multiplier = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op20Multiplicand = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op20Multiplier = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
|
||||
DSP1_Op20();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = DSP1.Op20Result & 0xFF;
|
||||
DSP1.output[1] = (DSP1.Op20Result >> 8) & 0xFF;
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op20Result);
|
||||
break;
|
||||
|
||||
case 0x30:
|
||||
case 0x10: // Inverse
|
||||
DSP1.Op10Coefficient = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op10Exponent = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op10Coefficient = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op10Exponent = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
|
||||
DSP1_Op10();
|
||||
|
||||
DSP1.out_count = 4;
|
||||
DSP1.output[0] = (uint8) ( ((int16) DSP1.Op10CoefficientR) & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((((int16) DSP1.Op10CoefficientR) >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) ( ((int16) DSP1.Op10ExponentR ) & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((((int16) DSP1.Op10ExponentR ) >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op10CoefficientR);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op10ExponentR);
|
||||
break;
|
||||
|
||||
case 0x24:
|
||||
case 0x04: // Sin and Cos of angle
|
||||
DSP1.Op04Angle = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op04Radius = (uint16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op04Angle = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op04Radius = (uint16) READ_WORD(&DSP1.parameters[2]);
|
||||
|
||||
DSP1_Op04();
|
||||
|
||||
DSP1.out_count = 4;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op04Sin & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op04Sin >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op04Cos & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op04Cos >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op04Sin);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op04Cos);
|
||||
break;
|
||||
|
||||
case 0x08: // Radius
|
||||
DSP1.Op08X = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op08Y = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op08Z = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op08X = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op08Y = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op08Z = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op08();
|
||||
|
||||
DSP1.out_count = 4;
|
||||
DSP1.output[0] = (uint8) ( ((int16) DSP1.Op08Ll) & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((((int16) DSP1.Op08Ll) >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) ( ((int16) DSP1.Op08Lh) & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((((int16) DSP1.Op08Lh) >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op08Ll);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op08Lh);
|
||||
break;
|
||||
|
||||
case 0x18: // Range
|
||||
|
||||
DSP1.Op18X = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op18Y = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op18Z = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op18R = (int16) (DSP1.parameters[6] | (DSP1.parameters[7] << 8));
|
||||
DSP1.Op18X = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op18Y = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op18Z = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
DSP1.Op18R = (int16) READ_WORD(&DSP1.parameters[6]);
|
||||
|
||||
DSP1_Op18();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op18D & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op18D >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op18D);
|
||||
break;
|
||||
|
||||
case 0x38: // Range
|
||||
|
||||
DSP1.Op38X = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op38Y = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op38Z = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op38R = (int16) (DSP1.parameters[6] | (DSP1.parameters[7] << 8));
|
||||
DSP1.Op38X = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op38Y = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op38Z = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
DSP1.Op38R = (int16) READ_WORD(&DSP1.parameters[6]);
|
||||
|
||||
DSP1_Op38();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op38D & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op38D >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op38D);
|
||||
break;
|
||||
|
||||
case 0x28: // Distance (vector length)
|
||||
DSP1.Op28X = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op28Y = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op28Z = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op28X = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op28Y = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op28Z = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op28();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op28R & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op28R >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op28R);
|
||||
break;
|
||||
|
||||
case 0x2c:
|
||||
case 0x0c: // Rotate (2D rotate)
|
||||
DSP1.Op0CA = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op0CX1 = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op0CY1 = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op0CA = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op0CX1 = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op0CY1 = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op0C();
|
||||
|
||||
DSP1.out_count = 4;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op0CX2 & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op0CX2 >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op0CY2 & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op0CY2 >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op0CX2);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op0CY2);
|
||||
break;
|
||||
|
||||
case 0x3c:
|
||||
case 0x1c: // Polar (3D rotate)
|
||||
DSP1.Op1CZ = (DSP1.parameters[ 0] | (DSP1.parameters[ 1] << 8));
|
||||
DSP1.Op1CZ = READ_WORD(&DSP1.parameters[ 0]);
|
||||
//MK: reversed X and Y on neviksti and John's advice.
|
||||
DSP1.Op1CY = (DSP1.parameters[ 2] | (DSP1.parameters[ 3] << 8));
|
||||
DSP1.Op1CX = (DSP1.parameters[ 4] | (DSP1.parameters[ 5] << 8));
|
||||
DSP1.Op1CXBR = (DSP1.parameters[ 6] | (DSP1.parameters[ 7] << 8));
|
||||
DSP1.Op1CYBR = (DSP1.parameters[ 8] | (DSP1.parameters[ 9] << 8));
|
||||
DSP1.Op1CZBR = (DSP1.parameters[10] | (DSP1.parameters[11] << 8));
|
||||
DSP1.Op1CY = READ_WORD(&DSP1.parameters[ 2]);
|
||||
DSP1.Op1CX = READ_WORD(&DSP1.parameters[ 4]);
|
||||
DSP1.Op1CXBR = READ_WORD(&DSP1.parameters[ 6]);
|
||||
DSP1.Op1CYBR = READ_WORD(&DSP1.parameters[ 8]);
|
||||
DSP1.Op1CZBR = READ_WORD(&DSP1.parameters[10]);
|
||||
|
||||
DSP1_Op1C();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op1CXAR & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op1CXAR >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op1CYAR & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op1CYAR >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op1CZAR & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op1CZAR >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op1CXAR);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op1CYAR);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op1CZAR);
|
||||
break;
|
||||
|
||||
case 0x32:
|
||||
case 0x22:
|
||||
case 0x12:
|
||||
case 0x02: // Parameter (Projection)
|
||||
DSP1.Op02FX = (int16) (DSP1.parameters[ 0] | (DSP1.parameters[ 1] << 8));
|
||||
DSP1.Op02FY = (int16) (DSP1.parameters[ 2] | (DSP1.parameters[ 3] << 8));
|
||||
DSP1.Op02FZ = (int16) (DSP1.parameters[ 4] | (DSP1.parameters[ 5] << 8));
|
||||
DSP1.Op02LFE = (int16) (DSP1.parameters[ 6] | (DSP1.parameters[ 7] << 8));
|
||||
DSP1.Op02LES = (int16) (DSP1.parameters[ 8] | (DSP1.parameters[ 9] << 8));
|
||||
DSP1.Op02AAS = (uint16) (DSP1.parameters[10] | (DSP1.parameters[11] << 8));
|
||||
DSP1.Op02AZS = (uint16) (DSP1.parameters[12] | (DSP1.parameters[13] << 8));
|
||||
DSP1.Op02FX = (int16) READ_WORD(&DSP1.parameters[ 0]);
|
||||
DSP1.Op02FY = (int16) READ_WORD(&DSP1.parameters[ 2]);
|
||||
DSP1.Op02FZ = (int16) READ_WORD(&DSP1.parameters[ 4]);
|
||||
DSP1.Op02LFE = (int16) READ_WORD(&DSP1.parameters[ 6]);
|
||||
DSP1.Op02LES = (int16) READ_WORD(&DSP1.parameters[ 8]);
|
||||
DSP1.Op02AAS = (uint16) READ_WORD(&DSP1.parameters[10]);
|
||||
DSP1.Op02AZS = (uint16) READ_WORD(&DSP1.parameters[12]);
|
||||
|
||||
DSP1_Op02();
|
||||
|
||||
DSP1.out_count = 8;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op02VOF & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op02VOF >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op02VVA & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op02VVA >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op02CX & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op02CX >> 8) & 0xFF);
|
||||
DSP1.output[6] = (uint8) (DSP1.Op02CY & 0xFF);
|
||||
DSP1.output[7] = (uint8) ((DSP1.Op02CY >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op02VOF);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op02VVA);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op02CX);
|
||||
WRITE_WORD(&DSP1.output[6], DSP1.Op02CY);
|
||||
break;
|
||||
|
||||
case 0x3a:
|
||||
case 0x2a:
|
||||
case 0x1a: // Raster mode 7 matrix data
|
||||
case 0x0a:
|
||||
DSP1.Op0AVS = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op0AVS = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
|
||||
DSP1_Op0A();
|
||||
|
||||
DSP1.out_count = 8;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op0AA & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op0AA >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op0AB & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op0AB >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op0AC & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op0AC >> 8) & 0xFF);
|
||||
DSP1.output[6] = (uint8) (DSP1.Op0AD & 0xFF);
|
||||
DSP1.output[7] = (uint8) ((DSP1.Op0AD >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op0AA);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op0AB);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op0AC);
|
||||
WRITE_WORD(&DSP1.output[6], DSP1.Op0AD);
|
||||
DSP1.in_index = 0;
|
||||
break;
|
||||
|
||||
|
@ -1454,35 +1430,30 @@ void DSP1SetByte (uint8 byte, uint16 address)
|
|||
case 0x26:
|
||||
case 0x36:
|
||||
case 0x06: // Project object
|
||||
DSP1.Op06X = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op06Y = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op06Z = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op06X = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op06Y = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op06Z = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op06();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op06H & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op06H >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op06V & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op06V >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op06M & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op06M >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op06H);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op06V);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op06M);
|
||||
break;
|
||||
|
||||
case 0x1e:
|
||||
case 0x2e:
|
||||
case 0x3e:
|
||||
case 0x0e: // Target
|
||||
DSP1.Op0EH = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op0EV = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op0EH = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op0EV = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
|
||||
DSP1_Op0E();
|
||||
|
||||
DSP1.out_count = 4;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op0EX & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op0EX >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op0EY & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op0EY >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op0EX);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op0EY);
|
||||
break;
|
||||
|
||||
// Extra commands used by Pilot Wings
|
||||
|
@ -1490,30 +1461,30 @@ void DSP1SetByte (uint8 byte, uint16 address)
|
|||
case 0x35:
|
||||
case 0x31:
|
||||
case 0x01: // Set attitude matrix A
|
||||
DSP1.Op01m = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op01Zr = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op01Yr = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op01Xr = (int16) (DSP1.parameters[6] | (DSP1.parameters[7] << 8));
|
||||
DSP1.Op01m = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op01Zr = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op01Yr = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
DSP1.Op01Xr = (int16) READ_WORD(&DSP1.parameters[6]);
|
||||
|
||||
DSP1_Op01();
|
||||
break;
|
||||
|
||||
case 0x15:
|
||||
case 0x11: // Set attitude matrix B
|
||||
DSP1.Op11m = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op11Zr = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op11Yr = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op11Xr = (int16) (DSP1.parameters[7] | (DSP1.parameters[7] << 8));
|
||||
DSP1.Op11m = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op11Zr = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op11Yr = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
DSP1.Op11Xr = (int16) READ_WORD(&DSP1.parameters[6]);
|
||||
|
||||
DSP1_Op11();
|
||||
break;
|
||||
|
||||
case 0x25:
|
||||
case 0x21: // Set attitude matrix C
|
||||
DSP1.Op21m = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op21Zr = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op21Yr = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op21Xr = (int16) (DSP1.parameters[6] | (DSP1.parameters[7] << 8));
|
||||
DSP1.Op21m = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op21Zr = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op21Yr = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
DSP1.Op21Xr = (int16) READ_WORD(&DSP1.parameters[6]);
|
||||
|
||||
DSP1_Op21();
|
||||
break;
|
||||
|
@ -1522,182 +1493,156 @@ void DSP1SetByte (uint8 byte, uint16 address)
|
|||
case 0x39:
|
||||
case 0x3d:
|
||||
case 0x0d: // Objective matrix A
|
||||
DSP1.Op0DX = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op0DY = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op0DZ = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op0DX = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op0DY = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op0DZ = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op0D();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output [0] = (uint8) (DSP1.Op0DF & 0xFF);
|
||||
DSP1.output [1] = (uint8) ((DSP1.Op0DF >> 8) & 0xFF);
|
||||
DSP1.output [2] = (uint8) (DSP1.Op0DL & 0xFF);
|
||||
DSP1.output [3] = (uint8) ((DSP1.Op0DL >> 8) & 0xFF);
|
||||
DSP1.output [4] = (uint8) (DSP1.Op0DU & 0xFF);
|
||||
DSP1.output [5] = (uint8) ((DSP1.Op0DU >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op0DF);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op0DL);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op0DU);
|
||||
break;
|
||||
|
||||
case 0x19:
|
||||
case 0x1d: // Objective matrix B
|
||||
DSP1.Op1DX = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op1DY = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op1DZ = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op1DX = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op1DY = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op1DZ = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op1D();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op1DF & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op1DF >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op1DL & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op1DL >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op1DU & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op1DU >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op1DF);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op1DL);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op1DU);
|
||||
break;
|
||||
|
||||
case 0x29:
|
||||
case 0x2d: // Objective matrix C
|
||||
DSP1.Op2DX = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op2DY = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op2DZ = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op2DX = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op2DY = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op2DZ = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op2D();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op2DF & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op2DF >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op2DL & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op2DL >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op2DU & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op2DU >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op2DF);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op2DL);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op2DU);
|
||||
break;
|
||||
|
||||
case 0x33:
|
||||
case 0x03: // Subjective matrix A
|
||||
DSP1.Op03F = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op03L = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op03U = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op03F = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op03L = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op03U = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op03();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op03X & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op03X >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op03Y & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op03Y >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op03Z & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op03Z >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op03X);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op03Y);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op03Z);
|
||||
break;
|
||||
|
||||
case 0x13: // Subjective matrix B
|
||||
DSP1.Op13F = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op13L = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op13U = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op13F = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op13L = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op13U = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op13();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op13X & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op13X >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op13Y & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op13Y >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op13Z & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op13Z >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op13X);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op13Y);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op13Z);
|
||||
break;
|
||||
|
||||
case 0x23: // Subjective matrix C
|
||||
DSP1.Op23F = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op23L = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op23U = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op23F = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op23L = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op23U = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op23();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op23X & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op23X >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op23Y & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op23Y >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op23Z & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op23Z >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op23X);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op23Y);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op23Z);
|
||||
break;
|
||||
|
||||
case 0x3b:
|
||||
case 0x0b:
|
||||
DSP1.Op0BX = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op0BY = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op0BZ = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op0BX = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op0BY = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op0BZ = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op0B();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op0BS & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op0BS >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op0BS);
|
||||
break;
|
||||
|
||||
case 0x1b:
|
||||
DSP1.Op1BX = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op1BY = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op1BZ = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op1BX = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op1BY = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op1BZ = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op1B();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op1BS & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op1BS >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op1BS);
|
||||
break;
|
||||
|
||||
case 0x2b:
|
||||
DSP1.Op2BX = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op2BY = (int16) (DSP1.parameters[2] | (DSP1.parameters[3] << 8));
|
||||
DSP1.Op2BZ = (int16) (DSP1.parameters[4] | (DSP1.parameters[5] << 8));
|
||||
DSP1.Op2BX = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
DSP1.Op2BY = (int16) READ_WORD(&DSP1.parameters[2]);
|
||||
DSP1.Op2BZ = (int16) READ_WORD(&DSP1.parameters[4]);
|
||||
|
||||
DSP1_Op2B();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op2BS & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op2BS >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op2BS);
|
||||
break;
|
||||
|
||||
case 0x34:
|
||||
case 0x14:
|
||||
DSP1.Op14Zr = (int16) (DSP1.parameters[ 0] | (DSP1.parameters[ 1] << 8));
|
||||
DSP1.Op14Xr = (int16) (DSP1.parameters[ 2] | (DSP1.parameters[ 3] << 8));
|
||||
DSP1.Op14Yr = (int16) (DSP1.parameters[ 4] | (DSP1.parameters[ 5] << 8));
|
||||
DSP1.Op14U = (int16) (DSP1.parameters[ 6] | (DSP1.parameters[ 7] << 8));
|
||||
DSP1.Op14F = (int16) (DSP1.parameters[ 8] | (DSP1.parameters[ 9] << 8));
|
||||
DSP1.Op14L = (int16) (DSP1.parameters[10] | (DSP1.parameters[11] << 8));
|
||||
DSP1.Op14Zr = (int16) READ_WORD(&DSP1.parameters[ 0]);
|
||||
DSP1.Op14Xr = (int16) READ_WORD(&DSP1.parameters[ 2]);
|
||||
DSP1.Op14Yr = (int16) READ_WORD(&DSP1.parameters[ 4]);
|
||||
DSP1.Op14U = (int16) READ_WORD(&DSP1.parameters[ 6]);
|
||||
DSP1.Op14F = (int16) READ_WORD(&DSP1.parameters[ 8]);
|
||||
DSP1.Op14L = (int16) READ_WORD(&DSP1.parameters[10]);
|
||||
|
||||
DSP1_Op14();
|
||||
|
||||
DSP1.out_count = 6;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op14Zrr & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op14Zrr >> 8) & 0xFF);
|
||||
DSP1.output[2] = (uint8) (DSP1.Op14Xrr & 0xFF);
|
||||
DSP1.output[3] = (uint8) ((DSP1.Op14Xrr >> 8) & 0xFF);
|
||||
DSP1.output[4] = (uint8) (DSP1.Op14Yrr & 0xFF);
|
||||
DSP1.output[5] = (uint8) ((DSP1.Op14Yrr >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op14Zrr);
|
||||
WRITE_WORD(&DSP1.output[2], DSP1.Op14Xrr);
|
||||
WRITE_WORD(&DSP1.output[4], DSP1.Op14Yrr);
|
||||
break;
|
||||
|
||||
case 0x27:
|
||||
case 0x2F:
|
||||
DSP1.Op2FUnknown = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op2FUnknown = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
|
||||
DSP1_Op2F();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op2FSize & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op2FSize >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op2FSize);
|
||||
break;
|
||||
|
||||
|
||||
case 0x07:
|
||||
case 0x0F:
|
||||
DSP1.Op0FRamsize = (int16) (DSP1.parameters[0] | (DSP1.parameters[1] << 8));
|
||||
DSP1.Op0FRamsize = (int16) READ_WORD(&DSP1.parameters[0]);
|
||||
|
||||
DSP1_Op0F();
|
||||
|
||||
DSP1.out_count = 2;
|
||||
DSP1.output[0] = (uint8) (DSP1.Op0FPass & 0xFF);
|
||||
DSP1.output[1] = (uint8) ((DSP1.Op0FPass >> 8) & 0xFF);
|
||||
WRITE_WORD(&DSP1.output[0], DSP1.Op0FPass);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue