Removed unneeded whitespace.
This commit is contained in:
@@ -289,7 +289,7 @@ void C4Op0D()
|
||||
}
|
||||
|
||||
#define READ_WORD(s) (*(unsigned short *) (s))
|
||||
void C4Op22()
|
||||
void C4Op22()
|
||||
{
|
||||
extern unsigned char *C4Ram;
|
||||
short angle1 = READ_WORD(C4Ram+0x1f8c) & 0x1ff;
|
||||
@@ -298,7 +298,7 @@ void C4Op22()
|
||||
int tan2 = Tan(angle2);
|
||||
short y = READ_WORD(C4Ram+0x1f83) - READ_WORD(C4Ram+0x1f89);
|
||||
short left, right;
|
||||
|
||||
|
||||
int j;
|
||||
for (j = 0; j < 225; j++, y++)
|
||||
{
|
||||
@@ -311,11 +311,11 @@ void C4Op22()
|
||||
{
|
||||
left = 1;
|
||||
right = 0;
|
||||
}
|
||||
}
|
||||
else if (left < 0)
|
||||
{
|
||||
left = 0;
|
||||
}
|
||||
}
|
||||
else if (right < 0)
|
||||
{
|
||||
right = 0;
|
||||
@@ -324,11 +324,11 @@ void C4Op22()
|
||||
{
|
||||
left = 255;
|
||||
right = 254;
|
||||
}
|
||||
}
|
||||
else if (left > 255)
|
||||
{
|
||||
left = 255;
|
||||
}
|
||||
}
|
||||
else if (right > 255)
|
||||
{
|
||||
right = 255;
|
||||
|
||||
@@ -57,7 +57,7 @@ void Log_Message (char *Message, ...)
|
||||
va_start(ap,Message);
|
||||
vsprintf(Msg,Message,ap );
|
||||
va_end(ap);
|
||||
|
||||
|
||||
strcat(Msg,"\r\n\0");
|
||||
fwrite(Msg,strlen(Msg),1,LogFile);
|
||||
fflush (LogFile);
|
||||
@@ -69,7 +69,7 @@ void Start_Log (void)
|
||||
// [4/15/2001] char *p;
|
||||
|
||||
strcpy(LogFileName,"dsp1emu.log\0");
|
||||
|
||||
|
||||
LogFile = fopen(LogFileName,"wb");
|
||||
}
|
||||
|
||||
@@ -85,133 +85,133 @@ void Stop_Log (void)
|
||||
#endif
|
||||
|
||||
const unsigned short DSP1ROM[1024] = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
|
||||
0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
|
||||
0x4000, 0x7fff, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200,
|
||||
0x0100, 0x0080, 0x0040, 0x0020, 0x0001, 0x0008, 0x0004, 0x0002,
|
||||
0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x8000, 0xffe5, 0x0100, 0x7fff, 0x7f02, 0x7e08,
|
||||
0x7d12, 0x7c1f, 0x7b30, 0x7a45, 0x795d, 0x7878, 0x7797, 0x76ba,
|
||||
0x75df, 0x7507, 0x7433, 0x7361, 0x7293, 0x71c7, 0x70fe, 0x7038,
|
||||
0x6f75, 0x6eb4, 0x6df6, 0x6d3a, 0x6c81, 0x6bca, 0x6b16, 0x6a64,
|
||||
0x69b4, 0x6907, 0x685b, 0x67b2, 0x670b, 0x6666, 0x65c4, 0x6523,
|
||||
0x6484, 0x63e7, 0x634c, 0x62b3, 0x621c, 0x6186, 0x60f2, 0x6060,
|
||||
0x5fd0, 0x5f41, 0x5eb5, 0x5e29, 0x5d9f, 0x5d17, 0x5c91, 0x5c0c,
|
||||
0x5b88, 0x5b06, 0x5a85, 0x5a06, 0x5988, 0x590b, 0x5890, 0x5816,
|
||||
0x579d, 0x5726, 0x56b0, 0x563b, 0x55c8, 0x5555, 0x54e4, 0x5474,
|
||||
0x5405, 0x5398, 0x532b, 0x52bf, 0x5255, 0x51ec, 0x5183, 0x511c,
|
||||
0x50b6, 0x5050, 0x4fec, 0x4f89, 0x4f26, 0x4ec5, 0x4e64, 0x4e05,
|
||||
0x4da6, 0x4d48, 0x4cec, 0x4c90, 0x4c34, 0x4bda, 0x4b81, 0x4b28,
|
||||
0x4ad0, 0x4a79, 0x4a23, 0x49cd, 0x4979, 0x4925, 0x48d1, 0x487f,
|
||||
0x482d, 0x47dc, 0x478c, 0x473c, 0x46ed, 0x469f, 0x4651, 0x4604,
|
||||
0x45b8, 0x456c, 0x4521, 0x44d7, 0x448d, 0x4444, 0x43fc, 0x43b4,
|
||||
0x436d, 0x4326, 0x42e0, 0x429a, 0x4255, 0x4211, 0x41cd, 0x4189,
|
||||
0x4146, 0x4104, 0x40c2, 0x4081, 0x4040, 0x3fff, 0x41f7, 0x43e1,
|
||||
0x45bd, 0x478d, 0x4951, 0x4b0b, 0x4cbb, 0x4e61, 0x4fff, 0x5194,
|
||||
0x5322, 0x54a9, 0x5628, 0x57a2, 0x5914, 0x5a81, 0x5be9, 0x5d4a,
|
||||
0x5ea7, 0x5fff, 0x6152, 0x62a0, 0x63ea, 0x6530, 0x6672, 0x67b0,
|
||||
0x68ea, 0x6a20, 0x6b53, 0x6c83, 0x6daf, 0x6ed9, 0x6fff, 0x7122,
|
||||
0x7242, 0x735f, 0x747a, 0x7592, 0x76a7, 0x77ba, 0x78cb, 0x79d9,
|
||||
0x7ae5, 0x7bee, 0x7cf5, 0x7dfa, 0x7efe, 0x7fff, 0x0000, 0x0324,
|
||||
0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2, 0x18f8, 0x1c0b,
|
||||
0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33de,
|
||||
0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4,
|
||||
0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb4,
|
||||
0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c24,
|
||||
0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504, 0x7641, 0x776c,
|
||||
0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3, 0x7d8a, 0x7e1d,
|
||||
0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6, 0x7fff, 0x7ff6,
|
||||
0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3,
|
||||
0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504,
|
||||
0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6,
|
||||
0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842,
|
||||
0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a,
|
||||
0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11,
|
||||
0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2,
|
||||
0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x7fff, 0x7ff6,
|
||||
0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3,
|
||||
0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504,
|
||||
0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6,
|
||||
0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842,
|
||||
0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a,
|
||||
0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11,
|
||||
0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2,
|
||||
0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x0000, 0xfcdc,
|
||||
0xf9b9, 0xf696, 0xf375, 0xf055, 0xed38, 0xea1e, 0xe708, 0xe3f5,
|
||||
0xe0e7, 0xdddd, 0xdad8, 0xd7da, 0xd4e1, 0xd1ef, 0xcf05, 0xcc22,
|
||||
0xc946, 0xc674, 0xc3aa, 0xc0e9, 0xbe32, 0xbb86, 0xb8e4, 0xb64c,
|
||||
0xb3c1, 0xb141, 0xaecd, 0xac65, 0xaa0b, 0xa7be, 0xa57e, 0xa34c,
|
||||
0xa129, 0x9f14, 0x9d0e, 0x9b18, 0x9931, 0x975a, 0x9593, 0x93dc,
|
||||
0x9236, 0x90a1, 0x8f1e, 0x8dab, 0x8c4b, 0x8afc, 0x89bf, 0x8894,
|
||||
0x877c, 0x8676, 0x8583, 0x84a3, 0x83d7, 0x831d, 0x8276, 0x81e3,
|
||||
0x8163, 0x80f7, 0x809e, 0x8059, 0x8028, 0x800a, 0x6488, 0x0080,
|
||||
0x03ff, 0x0116, 0x0002, 0x0080, 0x4000, 0x3fd7, 0x3faf, 0x3f86,
|
||||
0x3f5d, 0x3f34, 0x3f0c, 0x3ee3, 0x3eba, 0x3e91, 0x3e68, 0x3e40,
|
||||
0x3e17, 0x3dee, 0x3dc5, 0x3d9c, 0x3d74, 0x3d4b, 0x3d22, 0x3cf9,
|
||||
0x3cd0, 0x3ca7, 0x3c7f, 0x3c56, 0x3c2d, 0x3c04, 0x3bdb, 0x3bb2,
|
||||
0x3b89, 0x3b60, 0x3b37, 0x3b0e, 0x3ae5, 0x3abc, 0x3a93, 0x3a69,
|
||||
0x3a40, 0x3a17, 0x39ee, 0x39c5, 0x399c, 0x3972, 0x3949, 0x3920,
|
||||
0x38f6, 0x38cd, 0x38a4, 0x387a, 0x3851, 0x3827, 0x37fe, 0x37d4,
|
||||
0x37aa, 0x3781, 0x3757, 0x372d, 0x3704, 0x36da, 0x36b0, 0x3686,
|
||||
0x365c, 0x3632, 0x3609, 0x35df, 0x35b4, 0x358a, 0x3560, 0x3536,
|
||||
0x350c, 0x34e1, 0x34b7, 0x348d, 0x3462, 0x3438, 0x340d, 0x33e3,
|
||||
0x33b8, 0x338d, 0x3363, 0x3338, 0x330d, 0x32e2, 0x32b7, 0x328c,
|
||||
0x3261, 0x3236, 0x320b, 0x31df, 0x31b4, 0x3188, 0x315d, 0x3131,
|
||||
0x3106, 0x30da, 0x30ae, 0x3083, 0x3057, 0x302b, 0x2fff, 0x2fd2,
|
||||
0x2fa6, 0x2f7a, 0x2f4d, 0x2f21, 0x2ef4, 0x2ec8, 0x2e9b, 0x2e6e,
|
||||
0x2e41, 0x2e14, 0x2de7, 0x2dba, 0x2d8d, 0x2d60, 0x2d32, 0x2d05,
|
||||
0x2cd7, 0x2ca9, 0x2c7b, 0x2c4d, 0x2c1f, 0x2bf1, 0x2bc3, 0x2b94,
|
||||
0x2b66, 0x2b37, 0x2b09, 0x2ada, 0x2aab, 0x2a7c, 0x2a4c, 0x2a1d,
|
||||
0x29ed, 0x29be, 0x298e, 0x295e, 0x292e, 0x28fe, 0x28ce, 0x289d,
|
||||
0x286d, 0x283c, 0x280b, 0x27da, 0x27a9, 0x2777, 0x2746, 0x2714,
|
||||
0x26e2, 0x26b0, 0x267e, 0x264c, 0x2619, 0x25e7, 0x25b4, 0x2581,
|
||||
0x254d, 0x251a, 0x24e6, 0x24b2, 0x247e, 0x244a, 0x2415, 0x23e1,
|
||||
0x23ac, 0x2376, 0x2341, 0x230b, 0x22d6, 0x229f, 0x2269, 0x2232,
|
||||
0x21fc, 0x21c4, 0x218d, 0x2155, 0x211d, 0x20e5, 0x20ad, 0x2074,
|
||||
0x203b, 0x2001, 0x1fc7, 0x1f8d, 0x1f53, 0x1f18, 0x1edd, 0x1ea1,
|
||||
0x1e66, 0x1e29, 0x1ded, 0x1db0, 0x1d72, 0x1d35, 0x1cf6, 0x1cb8,
|
||||
0x1c79, 0x1c39, 0x1bf9, 0x1bb8, 0x1b77, 0x1b36, 0x1af4, 0x1ab1,
|
||||
0x1a6e, 0x1a2a, 0x19e6, 0x19a1, 0x195c, 0x1915, 0x18ce, 0x1887,
|
||||
0x183f, 0x17f5, 0x17ac, 0x1761, 0x1715, 0x16c9, 0x167c, 0x162e,
|
||||
0x15df, 0x158e, 0x153d, 0x14eb, 0x1497, 0x1442, 0x13ec, 0x1395,
|
||||
0x133c, 0x12e2, 0x1286, 0x1228, 0x11c9, 0x1167, 0x1104, 0x109e,
|
||||
0x1036, 0x0fcc, 0x0f5f, 0x0eef, 0x0e7b, 0x0e04, 0x0d89, 0x0d0a,
|
||||
0x0c86, 0x0bfd, 0x0b6d, 0x0ad6, 0x0a36, 0x098d, 0x08d7, 0x0811,
|
||||
0x0736, 0x063e, 0x0519, 0x039a, 0x0000, 0x7fff, 0x0100, 0x0080,
|
||||
0x021d, 0x00c8, 0x00ce, 0x0048, 0x0a26, 0x277a, 0x00ce, 0x6488,
|
||||
0x14ac, 0x0001, 0x00f9, 0x00fc, 0x00ff, 0x00fc, 0x00f9, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020,
|
||||
0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000,
|
||||
0x4000, 0x7fff, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200,
|
||||
0x0100, 0x0080, 0x0040, 0x0020, 0x0001, 0x0008, 0x0004, 0x0002,
|
||||
0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x0000, 0x0000, 0x8000, 0xffe5, 0x0100, 0x7fff, 0x7f02, 0x7e08,
|
||||
0x7d12, 0x7c1f, 0x7b30, 0x7a45, 0x795d, 0x7878, 0x7797, 0x76ba,
|
||||
0x75df, 0x7507, 0x7433, 0x7361, 0x7293, 0x71c7, 0x70fe, 0x7038,
|
||||
0x6f75, 0x6eb4, 0x6df6, 0x6d3a, 0x6c81, 0x6bca, 0x6b16, 0x6a64,
|
||||
0x69b4, 0x6907, 0x685b, 0x67b2, 0x670b, 0x6666, 0x65c4, 0x6523,
|
||||
0x6484, 0x63e7, 0x634c, 0x62b3, 0x621c, 0x6186, 0x60f2, 0x6060,
|
||||
0x5fd0, 0x5f41, 0x5eb5, 0x5e29, 0x5d9f, 0x5d17, 0x5c91, 0x5c0c,
|
||||
0x5b88, 0x5b06, 0x5a85, 0x5a06, 0x5988, 0x590b, 0x5890, 0x5816,
|
||||
0x579d, 0x5726, 0x56b0, 0x563b, 0x55c8, 0x5555, 0x54e4, 0x5474,
|
||||
0x5405, 0x5398, 0x532b, 0x52bf, 0x5255, 0x51ec, 0x5183, 0x511c,
|
||||
0x50b6, 0x5050, 0x4fec, 0x4f89, 0x4f26, 0x4ec5, 0x4e64, 0x4e05,
|
||||
0x4da6, 0x4d48, 0x4cec, 0x4c90, 0x4c34, 0x4bda, 0x4b81, 0x4b28,
|
||||
0x4ad0, 0x4a79, 0x4a23, 0x49cd, 0x4979, 0x4925, 0x48d1, 0x487f,
|
||||
0x482d, 0x47dc, 0x478c, 0x473c, 0x46ed, 0x469f, 0x4651, 0x4604,
|
||||
0x45b8, 0x456c, 0x4521, 0x44d7, 0x448d, 0x4444, 0x43fc, 0x43b4,
|
||||
0x436d, 0x4326, 0x42e0, 0x429a, 0x4255, 0x4211, 0x41cd, 0x4189,
|
||||
0x4146, 0x4104, 0x40c2, 0x4081, 0x4040, 0x3fff, 0x41f7, 0x43e1,
|
||||
0x45bd, 0x478d, 0x4951, 0x4b0b, 0x4cbb, 0x4e61, 0x4fff, 0x5194,
|
||||
0x5322, 0x54a9, 0x5628, 0x57a2, 0x5914, 0x5a81, 0x5be9, 0x5d4a,
|
||||
0x5ea7, 0x5fff, 0x6152, 0x62a0, 0x63ea, 0x6530, 0x6672, 0x67b0,
|
||||
0x68ea, 0x6a20, 0x6b53, 0x6c83, 0x6daf, 0x6ed9, 0x6fff, 0x7122,
|
||||
0x7242, 0x735f, 0x747a, 0x7592, 0x76a7, 0x77ba, 0x78cb, 0x79d9,
|
||||
0x7ae5, 0x7bee, 0x7cf5, 0x7dfa, 0x7efe, 0x7fff, 0x0000, 0x0324,
|
||||
0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2, 0x18f8, 0x1c0b,
|
||||
0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33de,
|
||||
0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4,
|
||||
0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb4,
|
||||
0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c24,
|
||||
0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504, 0x7641, 0x776c,
|
||||
0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3, 0x7d8a, 0x7e1d,
|
||||
0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6, 0x7fff, 0x7ff6,
|
||||
0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3,
|
||||
0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504,
|
||||
0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6,
|
||||
0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842,
|
||||
0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a,
|
||||
0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11,
|
||||
0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2,
|
||||
0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x7fff, 0x7ff6,
|
||||
0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3,
|
||||
0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504,
|
||||
0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6,
|
||||
0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842,
|
||||
0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a,
|
||||
0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11,
|
||||
0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2,
|
||||
0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x0000, 0xfcdc,
|
||||
0xf9b9, 0xf696, 0xf375, 0xf055, 0xed38, 0xea1e, 0xe708, 0xe3f5,
|
||||
0xe0e7, 0xdddd, 0xdad8, 0xd7da, 0xd4e1, 0xd1ef, 0xcf05, 0xcc22,
|
||||
0xc946, 0xc674, 0xc3aa, 0xc0e9, 0xbe32, 0xbb86, 0xb8e4, 0xb64c,
|
||||
0xb3c1, 0xb141, 0xaecd, 0xac65, 0xaa0b, 0xa7be, 0xa57e, 0xa34c,
|
||||
0xa129, 0x9f14, 0x9d0e, 0x9b18, 0x9931, 0x975a, 0x9593, 0x93dc,
|
||||
0x9236, 0x90a1, 0x8f1e, 0x8dab, 0x8c4b, 0x8afc, 0x89bf, 0x8894,
|
||||
0x877c, 0x8676, 0x8583, 0x84a3, 0x83d7, 0x831d, 0x8276, 0x81e3,
|
||||
0x8163, 0x80f7, 0x809e, 0x8059, 0x8028, 0x800a, 0x6488, 0x0080,
|
||||
0x03ff, 0x0116, 0x0002, 0x0080, 0x4000, 0x3fd7, 0x3faf, 0x3f86,
|
||||
0x3f5d, 0x3f34, 0x3f0c, 0x3ee3, 0x3eba, 0x3e91, 0x3e68, 0x3e40,
|
||||
0x3e17, 0x3dee, 0x3dc5, 0x3d9c, 0x3d74, 0x3d4b, 0x3d22, 0x3cf9,
|
||||
0x3cd0, 0x3ca7, 0x3c7f, 0x3c56, 0x3c2d, 0x3c04, 0x3bdb, 0x3bb2,
|
||||
0x3b89, 0x3b60, 0x3b37, 0x3b0e, 0x3ae5, 0x3abc, 0x3a93, 0x3a69,
|
||||
0x3a40, 0x3a17, 0x39ee, 0x39c5, 0x399c, 0x3972, 0x3949, 0x3920,
|
||||
0x38f6, 0x38cd, 0x38a4, 0x387a, 0x3851, 0x3827, 0x37fe, 0x37d4,
|
||||
0x37aa, 0x3781, 0x3757, 0x372d, 0x3704, 0x36da, 0x36b0, 0x3686,
|
||||
0x365c, 0x3632, 0x3609, 0x35df, 0x35b4, 0x358a, 0x3560, 0x3536,
|
||||
0x350c, 0x34e1, 0x34b7, 0x348d, 0x3462, 0x3438, 0x340d, 0x33e3,
|
||||
0x33b8, 0x338d, 0x3363, 0x3338, 0x330d, 0x32e2, 0x32b7, 0x328c,
|
||||
0x3261, 0x3236, 0x320b, 0x31df, 0x31b4, 0x3188, 0x315d, 0x3131,
|
||||
0x3106, 0x30da, 0x30ae, 0x3083, 0x3057, 0x302b, 0x2fff, 0x2fd2,
|
||||
0x2fa6, 0x2f7a, 0x2f4d, 0x2f21, 0x2ef4, 0x2ec8, 0x2e9b, 0x2e6e,
|
||||
0x2e41, 0x2e14, 0x2de7, 0x2dba, 0x2d8d, 0x2d60, 0x2d32, 0x2d05,
|
||||
0x2cd7, 0x2ca9, 0x2c7b, 0x2c4d, 0x2c1f, 0x2bf1, 0x2bc3, 0x2b94,
|
||||
0x2b66, 0x2b37, 0x2b09, 0x2ada, 0x2aab, 0x2a7c, 0x2a4c, 0x2a1d,
|
||||
0x29ed, 0x29be, 0x298e, 0x295e, 0x292e, 0x28fe, 0x28ce, 0x289d,
|
||||
0x286d, 0x283c, 0x280b, 0x27da, 0x27a9, 0x2777, 0x2746, 0x2714,
|
||||
0x26e2, 0x26b0, 0x267e, 0x264c, 0x2619, 0x25e7, 0x25b4, 0x2581,
|
||||
0x254d, 0x251a, 0x24e6, 0x24b2, 0x247e, 0x244a, 0x2415, 0x23e1,
|
||||
0x23ac, 0x2376, 0x2341, 0x230b, 0x22d6, 0x229f, 0x2269, 0x2232,
|
||||
0x21fc, 0x21c4, 0x218d, 0x2155, 0x211d, 0x20e5, 0x20ad, 0x2074,
|
||||
0x203b, 0x2001, 0x1fc7, 0x1f8d, 0x1f53, 0x1f18, 0x1edd, 0x1ea1,
|
||||
0x1e66, 0x1e29, 0x1ded, 0x1db0, 0x1d72, 0x1d35, 0x1cf6, 0x1cb8,
|
||||
0x1c79, 0x1c39, 0x1bf9, 0x1bb8, 0x1b77, 0x1b36, 0x1af4, 0x1ab1,
|
||||
0x1a6e, 0x1a2a, 0x19e6, 0x19a1, 0x195c, 0x1915, 0x18ce, 0x1887,
|
||||
0x183f, 0x17f5, 0x17ac, 0x1761, 0x1715, 0x16c9, 0x167c, 0x162e,
|
||||
0x15df, 0x158e, 0x153d, 0x14eb, 0x1497, 0x1442, 0x13ec, 0x1395,
|
||||
0x133c, 0x12e2, 0x1286, 0x1228, 0x11c9, 0x1167, 0x1104, 0x109e,
|
||||
0x1036, 0x0fcc, 0x0f5f, 0x0eef, 0x0e7b, 0x0e04, 0x0d89, 0x0d0a,
|
||||
0x0c86, 0x0bfd, 0x0b6d, 0x0ad6, 0x0a36, 0x098d, 0x08d7, 0x0811,
|
||||
0x0736, 0x063e, 0x0519, 0x039a, 0x0000, 0x7fff, 0x0100, 0x0080,
|
||||
0x021d, 0x00c8, 0x00ce, 0x0048, 0x0a26, 0x277a, 0x00ce, 0x6488,
|
||||
0x14ac, 0x0001, 0x00f9, 0x00fc, 0x00ff, 0x00fc, 0x00f9, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
|
||||
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff};
|
||||
|
||||
/***************************************************************************\
|
||||
@@ -232,7 +232,7 @@ double SinTable2[INCR];
|
||||
|
||||
double Atan(double x)
|
||||
{
|
||||
if ((x>=1) || (x<=1))
|
||||
if ((x>=1) || (x<=1))
|
||||
return (x/(1+0.28*x*x));
|
||||
else
|
||||
return (PI/2 - Atan(1/x));
|
||||
@@ -303,12 +303,12 @@ void DSP1_Inverse(short Coefficient, short Exponent, short *iCoefficient, short
|
||||
|
||||
// Step Two: Remove Sign
|
||||
if (Coefficient < 0)
|
||||
{
|
||||
{
|
||||
if (Coefficient < -32767) Coefficient = -32767;
|
||||
Coefficient = -Coefficient;
|
||||
Sign = -1;
|
||||
}
|
||||
|
||||
|
||||
// Step Three: Normalize
|
||||
while (Coefficient < 0x4000)
|
||||
{
|
||||
@@ -603,7 +603,7 @@ void DSPOp02()
|
||||
ViewerX1=Sin(Angle(Op02AZS))*Sin(Angle(Op02AAS));
|
||||
ViewerY1=Sin(Angle(Op02AZS))*Cos(Angle(Op02AAS));
|
||||
|
||||
|
||||
|
||||
#ifdef debug02
|
||||
printf("\nViewerX1 : %f ViewerY1 : %f ViewerZ1 : %f\n",ViewerX1,ViewerY1,
|
||||
ViewerZ1);
|
||||
@@ -1005,7 +1005,7 @@ void DSPOp06()
|
||||
Log_Message("OP06 H:%d V:%d S:%d",Op06H,Op06V,Op06S);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
short matrixC[3][3];
|
||||
@@ -1214,22 +1214,22 @@ short Op14Yrr;
|
||||
void DSPOp14()
|
||||
{
|
||||
short CSec, ESec, CTan, CSin, C, E;
|
||||
|
||||
|
||||
DSP1_Inverse(DSP1_Cos(Op14Xr), 0, &CSec, &ESec);
|
||||
|
||||
|
||||
// Rotation Around Z
|
||||
DSP1_NormalizeDouble(Op14U * DSP1_Cos(Op14Yr) - Op14F * DSP1_Sin(Op14Yr), &C, &E);
|
||||
|
||||
|
||||
E = ESec - E;
|
||||
|
||||
|
||||
DSP1_Normalize(C * CSec >> 15, &C, &E);
|
||||
|
||||
|
||||
if (E > 0) {
|
||||
if (C > 0) C = 32767; else if (C < 0) C = -32767;
|
||||
} else {
|
||||
if (E < 0) C = C * DSP1ROM[0x31 + E] >> 15;
|
||||
}
|
||||
|
||||
|
||||
Op14Zrr = Op14Zr + C;
|
||||
|
||||
// Rotation Around X
|
||||
@@ -1245,7 +1245,7 @@ void DSPOp14()
|
||||
CTan = CSec * CSin >> 15;
|
||||
|
||||
DSP1_Normalize(-(C * CTan >> 15), &C, &E);
|
||||
|
||||
|
||||
if (E > 0) {
|
||||
if (C > 0) C = 32767; else if (C < 0) C = -32767;
|
||||
} else {
|
||||
@@ -1297,7 +1297,7 @@ void DSPOp0B()
|
||||
}
|
||||
|
||||
void DSPOp1B()
|
||||
{
|
||||
{
|
||||
Op1BS = (Op1BX * matrixB[0][0] + Op1BY * matrixB[0][1] + Op1BZ * matrixB[0][2]) >> 15;
|
||||
|
||||
#ifdef DebugDSP1
|
||||
@@ -1405,7 +1405,7 @@ void DSPOp1C()
|
||||
Op1CX1 = (Op1CXBR * DSP1_Cos(Op1CY) >> 15) - (Op1CZBR * DSP1_Sin(Op1CY) >> 15);
|
||||
Op1CXAR = Op1CX1; Op1CZBR = Op1CZ1;
|
||||
|
||||
// Rotate Around Op1CX1
|
||||
// Rotate Around Op1CX1
|
||||
Op1CY1 = (Op1CZBR * DSP1_Sin(Op1CX) >> 15) + (Op1CYBR * DSP1_Cos(Op1CX) >> 15);
|
||||
Op1CZ1 = (Op1CZBR * DSP1_Cos(Op1CX) >> 15) - (Op1CYBR * DSP1_Sin(Op1CX) >> 15);
|
||||
Op1CYAR = Op1CY1; Op1CZAR = Op1CZ1;
|
||||
|
||||
@@ -50,7 +50,7 @@ Fixed-point math reminder:
|
||||
#define WRITE_WORD(s, d) (*(uint16 *) (s)) = (d)
|
||||
#define WRITE_DWORD(s, d) (*(uint32 *) (s)) = (d)
|
||||
|
||||
struct
|
||||
struct
|
||||
{
|
||||
bool8 waiting4command;
|
||||
bool8 half_command;
|
||||
@@ -428,7 +428,7 @@ void DSP4_OP01()
|
||||
|
||||
// scan next command
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(1) resume1 :
|
||||
DSP4_WAIT(1) resume1 :
|
||||
|
||||
// check for termination
|
||||
distance = DSP4_READ_WORD();
|
||||
@@ -469,7 +469,7 @@ void DSP4_OP01()
|
||||
|
||||
// already have 2 bytes read
|
||||
DSP4.in_count = 6;
|
||||
DSP4_WAIT(3) resume3 :
|
||||
DSP4_WAIT(3) resume3 :
|
||||
|
||||
// inspect inputs
|
||||
world_ddy = DSP4_READ_WORD();
|
||||
@@ -662,7 +662,7 @@ void DSP4_OP07()
|
||||
|
||||
// scan next command
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(1) resume1 :
|
||||
DSP4_WAIT(1) resume1 :
|
||||
|
||||
// check for opcode termination
|
||||
distance = DSP4_READ_WORD();
|
||||
@@ -671,7 +671,7 @@ void DSP4_OP07()
|
||||
|
||||
// already have 2 bytes in queue
|
||||
DSP4.in_count = 10;
|
||||
DSP4_WAIT(2) resume2 :
|
||||
DSP4_WAIT(2) resume2 :
|
||||
|
||||
// inspect inputs
|
||||
view_y2 = DSP4_READ_WORD();
|
||||
@@ -832,7 +832,7 @@ void DSP4_OP08()
|
||||
|
||||
// scan next command
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(1) resume1 :
|
||||
DSP4_WAIT(1) resume1 :
|
||||
|
||||
// terminate op
|
||||
distance = DSP4_READ_WORD();
|
||||
@@ -842,7 +842,7 @@ void DSP4_OP08()
|
||||
// already have 2 bytes in queue
|
||||
DSP4.in_count = 16;
|
||||
|
||||
DSP4_WAIT(2) resume2 :
|
||||
DSP4_WAIT(2) resume2 :
|
||||
|
||||
// look at guidelines for both polygon shapes
|
||||
view_x[0] = DSP4_READ_WORD();
|
||||
@@ -1051,7 +1051,7 @@ void DSP4_OP09()
|
||||
// check for new sprites
|
||||
|
||||
DSP4.in_count = 4;
|
||||
DSP4_WAIT(1) resume1 :
|
||||
DSP4_WAIT(1) resume1 :
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// raster overdraw check
|
||||
@@ -1094,7 +1094,7 @@ void DSP4_OP09()
|
||||
|
||||
// we already have 4 bytes we want
|
||||
DSP4.in_count = 14;
|
||||
DSP4_WAIT(2) resume2 :
|
||||
DSP4_WAIT(2) resume2 :
|
||||
|
||||
// filter inputs
|
||||
energy = DSP4_READ_WORD();
|
||||
@@ -1127,7 +1127,7 @@ void DSP4_OP09()
|
||||
|
||||
// grab a few remaining vehicle values
|
||||
DSP4.in_count = 4;
|
||||
DSP4_WAIT(3) resume3 :
|
||||
DSP4_WAIT(3) resume3 :
|
||||
|
||||
// add vertical lift factor
|
||||
sprite_y += DSP4_READ_WORD();
|
||||
@@ -1140,7 +1140,7 @@ void DSP4_OP09()
|
||||
|
||||
// we already have 4 bytes we want
|
||||
DSP4.in_count = 10;
|
||||
DSP4_WAIT(4) resume4 :
|
||||
DSP4_WAIT(4) resume4 :
|
||||
|
||||
// sort loop inputs
|
||||
poly_cx[0][0] = DSP4_READ_WORD();
|
||||
@@ -1170,18 +1170,18 @@ void DSP4_OP09()
|
||||
do
|
||||
{
|
||||
uint16 header;
|
||||
|
||||
|
||||
int16 sp_x, sp_y, sp_attr, sp_dattr;
|
||||
int16 sp_dx, sp_dy;
|
||||
int16 pixels;
|
||||
|
||||
bool8 draw;
|
||||
|
||||
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(5) resume5 :
|
||||
DSP4_WAIT(5) resume5 :
|
||||
|
||||
draw = TRUE;
|
||||
|
||||
|
||||
// opcode termination
|
||||
raster = DSP4_READ_WORD();
|
||||
if (raster == -0x8000)
|
||||
@@ -1212,10 +1212,10 @@ void DSP4_OP09()
|
||||
|
||||
// read in rest of sprite data
|
||||
DSP4.in_count = 4;
|
||||
DSP4_WAIT(6) resume6 :
|
||||
DSP4_WAIT(6) resume6 :
|
||||
|
||||
draw = TRUE;
|
||||
|
||||
|
||||
/////////////////////////////////////
|
||||
// process tile data
|
||||
|
||||
@@ -1427,7 +1427,7 @@ void DSP4_OP0D()
|
||||
view_yofs2 = (world_yofs * distance >> 15) + poly_bottom[0][0] - view_y2;
|
||||
|
||||
// 1. World x-location before transformation
|
||||
// 2. Viewer x-position at the current
|
||||
// 2. Viewer x-position at the current
|
||||
// 3. World y-location before perspective projection
|
||||
// 4. Viewer y-position below the horizon
|
||||
// 5. Number of raster lines drawn in this iteration
|
||||
@@ -1528,9 +1528,9 @@ void DSP4_OP0D()
|
||||
|
||||
// scan next command
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(1) resume1 :
|
||||
DSP4_WAIT(1) resume1 :
|
||||
|
||||
// inspect input
|
||||
// inspect input
|
||||
distance = DSP4_READ_WORD();
|
||||
|
||||
// terminate op
|
||||
@@ -1539,7 +1539,7 @@ void DSP4_OP0D()
|
||||
|
||||
// already have 2 bytes in queue
|
||||
DSP4.in_count = 6;
|
||||
DSP4_WAIT(2) resume2 :
|
||||
DSP4_WAIT(2) resume2 :
|
||||
|
||||
// inspect inputs
|
||||
world_ddy = DSP4_READ_WORD();
|
||||
@@ -1680,7 +1680,7 @@ void DSP4_OP0F()
|
||||
// grab inputs
|
||||
DSP4.in_count = 4;
|
||||
DSP4_WAIT(1);
|
||||
resume1 :
|
||||
resume1 :
|
||||
for (;;)
|
||||
{
|
||||
int16 distance;
|
||||
@@ -1763,7 +1763,7 @@ void DSP4_OP0F()
|
||||
|
||||
// scan next command
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(2) resume2 :
|
||||
DSP4_WAIT(2) resume2 :
|
||||
|
||||
// check for termination
|
||||
distance = DSP4_READ_WORD();
|
||||
@@ -1804,7 +1804,7 @@ void DSP4_OP0F()
|
||||
|
||||
// already have 2 bytes in queue
|
||||
DSP4.in_count = 6;
|
||||
DSP4_WAIT(4) resume4 :
|
||||
DSP4_WAIT(4) resume4 :
|
||||
|
||||
// inspect inputs
|
||||
world_ddy = DSP4_READ_WORD();
|
||||
@@ -1925,7 +1925,7 @@ void DSP4_OP10()
|
||||
// grab inputs
|
||||
DSP4.in_count = 4;
|
||||
DSP4_WAIT(1);
|
||||
resume1 :
|
||||
resume1 :
|
||||
for (;;)
|
||||
{
|
||||
int16 distance;
|
||||
@@ -2006,7 +2006,7 @@ void DSP4_OP10()
|
||||
|
||||
// scan next command
|
||||
DSP4.in_count = 2;
|
||||
DSP4_WAIT(2) resume2 :
|
||||
DSP4_WAIT(2) resume2 :
|
||||
|
||||
// check for opcode termination
|
||||
distance = DSP4_READ_WORD();
|
||||
@@ -2015,7 +2015,7 @@ void DSP4_OP10()
|
||||
|
||||
// already have 2 bytes in queue
|
||||
DSP4.in_count = 10;
|
||||
DSP4_WAIT(3) resume3 :
|
||||
DSP4_WAIT(3) resume3 :
|
||||
|
||||
|
||||
// inspect inputs
|
||||
@@ -2064,7 +2064,7 @@ void DSP4SetByte()
|
||||
DSP4.out_index++;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (DSP4.waiting4command)
|
||||
{
|
||||
if (DSP4.half_command)
|
||||
@@ -2127,14 +2127,14 @@ void DSP4SetByte()
|
||||
DSP4.parameters[DSP4.in_index] = dsp4_byte;
|
||||
DSP4.in_index++;
|
||||
}
|
||||
|
||||
|
||||
if (!DSP4.waiting4command && DSP4.in_count == DSP4.in_index)
|
||||
{
|
||||
// Actually execute the command
|
||||
DSP4.waiting4command = TRUE;
|
||||
DSP4.out_index = 0;
|
||||
DSP4.in_index = 0;
|
||||
|
||||
|
||||
switch (DSP4.command)
|
||||
{
|
||||
// 16-bit multiplication
|
||||
@@ -2147,7 +2147,7 @@ void DSP4SetByte()
|
||||
multiplicand = DSP4_READ_WORD();
|
||||
|
||||
DSP4_Multiply(multiplicand, multiplier, &product);
|
||||
|
||||
|
||||
DSP4_CLEAR_OUT();
|
||||
DSP4_WRITE_WORD(product);
|
||||
DSP4_WRITE_WORD(product >> 16);
|
||||
@@ -2165,7 +2165,7 @@ void DSP4SetByte()
|
||||
// clear OAM
|
||||
case 0x0005:
|
||||
DSP4_OP05(); break;
|
||||
|
||||
|
||||
// transfer OAM
|
||||
case 0x0006:
|
||||
DSP4_OP06(); break;
|
||||
@@ -2189,9 +2189,9 @@ void DSP4SetByte()
|
||||
int16 in2a = DSP4_READ_WORD();
|
||||
int16 in3a = DSP4_READ_WORD();
|
||||
int16 out1a, out2a, out3a, out4a;
|
||||
|
||||
|
||||
DSP4_OP0A(in2a, &out2a, &out1a, &out4a, &out3a);
|
||||
|
||||
|
||||
DSP4_CLEAR_OUT();
|
||||
DSP4_WRITE_WORD(out1a);
|
||||
DSP4_WRITE_WORD(out2a);
|
||||
@@ -2209,7 +2209,7 @@ void DSP4SetByte()
|
||||
bool8 draw = 1;
|
||||
|
||||
DSP4_CLEAR_OUT();
|
||||
|
||||
|
||||
DSP4_OP0B(&draw, sp_x, sp_y, sp_attr, 0, 1);
|
||||
}
|
||||
break;
|
||||
@@ -2242,7 +2242,7 @@ void DSP4SetByte()
|
||||
a = DSP4_READ_WORD();
|
||||
|
||||
DSP4_OP11(a, b, c, d, &m);
|
||||
|
||||
|
||||
DSP4_CLEAR_OUT();
|
||||
DSP4_WRITE_WORD(m);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
%include "macros.mac"
|
||||
|
||||
EXTSYM dsp4_address,dsp4_byte,DSP4GetByte,DSP4SetByte
|
||||
EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8
|
||||
EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8
|
||||
|
||||
SECTION .text
|
||||
|
||||
@@ -53,19 +53,19 @@ NEWSYM DSP4Write8b
|
||||
call DSP4SetByte
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
NEWSYM DSP4Read16b
|
||||
RouteAccess regaccessbankr16
|
||||
RouteAccess regaccessbankr16
|
||||
mov word[dsp4_address],cx
|
||||
pushad
|
||||
call DSP4GetByte
|
||||
mov al,byte[dsp4_byte]
|
||||
mov al,byte[dsp4_byte]
|
||||
mov byte[dsp4temp],al
|
||||
inc word[dsp4_address]
|
||||
call DSP4GetByte
|
||||
popad
|
||||
popad
|
||||
mov al,byte[dsp4temp]
|
||||
mov ah,byte[dsp4_byte]
|
||||
mov ah,byte[dsp4_byte]
|
||||
ret
|
||||
|
||||
NEWSYM DSP4Write16b
|
||||
@@ -81,6 +81,6 @@ NEWSYM DSP4Write16b
|
||||
call DSP4SetByte
|
||||
popad
|
||||
ret
|
||||
|
||||
|
||||
SECTION .bss
|
||||
NEWSYM dsp4temp, resb 1
|
||||
NEWSYM dsp4temp, resb 1
|
||||
|
||||
@@ -58,30 +58,30 @@ NEWSYM SfxR6, dd 0 ; multiplier for fmult and lmult
|
||||
NEWSYM SfxR7, dd 0 ; fixed point texel X position for merge
|
||||
NEWSYM SfxR8, dd 0 ; fixed point texel Y position for merge
|
||||
NEWSYM SfxR9, dd 0 ;
|
||||
NEWSYM SfxR10, dd 0 ;
|
||||
NEWSYM SfxR10, dd 0 ;
|
||||
NEWSYM SfxR11, dd 0 ; return address set by link
|
||||
NEWSYM SfxR12, dd 0 ; loop counter
|
||||
NEWSYM SfxR13, dd 0 ; loop point address
|
||||
NEWSYM SfxR14, dd 0 ; rom address for getb, getbh, getbl, getbs
|
||||
NEWSYM SfxR15, dd 0 ; program counter
|
||||
NEWSYM SfxR15, dd 0 ; program counter
|
||||
|
||||
NEWSYM SfxSFR, dd 0 ; status flag register (16bit)
|
||||
;SFR status flag register bits:
|
||||
; 0 -
|
||||
; 0 -
|
||||
; 1 Z Zero flag
|
||||
; 2 CY Carry flag
|
||||
; 3 S Sign flag
|
||||
; 4 OV Overflow flag
|
||||
; 5 G Go flag (set to 1 when the GSU is running)
|
||||
; 6 R Set to 1 when reading ROM using R14 address
|
||||
; 7 -
|
||||
; 7 -
|
||||
; 8 ALT1 Mode set-up flag for the next instruction
|
||||
; 9 ALT2 Mode set-up flag for the next instruction
|
||||
;10 IL Immediate lower 8-bit flag
|
||||
;11 IH Immediate higher 8-bit flag
|
||||
;12 B Set to 1 when the WITH instruction is executed
|
||||
;13 -
|
||||
;14 -
|
||||
;13 -
|
||||
;14 -
|
||||
;15 IRQ Set to 1 when GSU caused an interrupt
|
||||
; Set to 0 when read by 658c16
|
||||
|
||||
@@ -363,29 +363,29 @@ NEWSYM FxOp0F ; BVS branch on overflow set ; Verified.
|
||||
NEWSYM FxOp10 ; TO RN set register n as destination register
|
||||
TORN 0
|
||||
NEWSYM FxOp11 ; TO RN set register n as destination register
|
||||
TORN 1
|
||||
TORN 1
|
||||
NEWSYM FxOp12 ; TO RN set register n as destination register
|
||||
TORN 2
|
||||
TORN 2
|
||||
NEWSYM FxOp13 ; TO RN set register n as destination register
|
||||
TORN 3
|
||||
TORN 3
|
||||
NEWSYM FxOp14 ; TO RN set register n as destination register
|
||||
TORN 4
|
||||
TORN 4
|
||||
NEWSYM FxOp15 ; TO RN set register n as destination register
|
||||
TORN 5
|
||||
TORN 5
|
||||
NEWSYM FxOp16 ; TO RN set register n as destination register
|
||||
TORN 6
|
||||
TORN 6
|
||||
NEWSYM FxOp17 ; TO RN set register n as destination register
|
||||
TORN 7
|
||||
TORN 7
|
||||
NEWSYM FxOp18 ; TO RN set register n as destination register
|
||||
TORN 8
|
||||
TORN 8
|
||||
NEWSYM FxOp19 ; TO RN set register n as destination register
|
||||
TORN 9
|
||||
TORN 9
|
||||
NEWSYM FxOp1A ; TO RN set register n as destination register
|
||||
TORN 10
|
||||
TORN 10
|
||||
NEWSYM FxOp1B ; TO RN set register n as destination register
|
||||
TORN 11
|
||||
TORN 11
|
||||
NEWSYM FxOp1C ; TO RN set register n as destination register
|
||||
TORN 12
|
||||
TORN 12
|
||||
NEWSYM FxOp1D ; TO RN set register n as destination register
|
||||
TORN 13
|
||||
NEWSYM FxOp1E ; TO RN set register n as destination register
|
||||
@@ -587,21 +587,21 @@ NEWSYM FxOp4B ; LDW RN load word from RAM
|
||||
LDWRN 11
|
||||
|
||||
NEWSYM FxOp40A1 ; LDB RN load byte from RAM
|
||||
LDBRN 0
|
||||
LDBRN 0
|
||||
NEWSYM FxOp41A1 ; LDB RN load byte from RAM
|
||||
LDBRN 1
|
||||
LDBRN 1
|
||||
NEWSYM FxOp42A1 ; LDB RN load byte from RAM
|
||||
LDBRN 2
|
||||
LDBRN 2
|
||||
NEWSYM FxOp43A1 ; LDB RN load byte from RAM
|
||||
LDBRN 3
|
||||
LDBRN 3
|
||||
NEWSYM FxOp44A1 ; LDB RN load byte from RAM
|
||||
LDBRN 4
|
||||
LDBRN 4
|
||||
NEWSYM FxOp45A1 ; LDB RN load byte from RAM
|
||||
LDBRN 5
|
||||
NEWSYM FxOp46A1 ; LDB RN load byte from RAM
|
||||
LDBRN 6
|
||||
LDBRN 6
|
||||
NEWSYM FxOp47A1 ; LDB RN load byte from RAM
|
||||
LDBRN 7
|
||||
LDBRN 7
|
||||
NEWSYM FxOp48A1 ; LDB RN load byte from RAM
|
||||
LDBRN 8
|
||||
NEWSYM FxOp49A1 ; LDB RN load byte from RAM
|
||||
@@ -1036,7 +1036,7 @@ NEWSYM FxOp4CA1 ; RPIX read color of the pixel with R1,R2 as x,y
|
||||
NEWSYM FxOp4D ; SWAP swap upper and lower byte of a register ; V
|
||||
mov eax,[esi] ; Read Source
|
||||
FETCHPIPE
|
||||
ror ax,8
|
||||
ror ax,8
|
||||
inc ebp ; Increase program counter
|
||||
mov [SfxSignZero],eax
|
||||
mov [edi],eax ; Write Destination
|
||||
@@ -1650,35 +1650,35 @@ NEWSYM FxOp7FA3 ; BICIRN register & ~immediate
|
||||
BICIRN 15 ^ 0FFFFh
|
||||
|
||||
NEWSYM FxOp80 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 0
|
||||
MULTRN 0
|
||||
NEWSYM FxOp81 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 1
|
||||
MULTRN 1
|
||||
NEWSYM FxOp82 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 2
|
||||
MULTRN 2
|
||||
NEWSYM FxOp83 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 3
|
||||
MULTRN 3
|
||||
NEWSYM FxOp84 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 4
|
||||
MULTRN 4
|
||||
NEWSYM FxOp85 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 5
|
||||
MULTRN 5
|
||||
NEWSYM FxOp86 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 6
|
||||
MULTRN 6
|
||||
NEWSYM FxOp87 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 7
|
||||
MULTRN 7
|
||||
NEWSYM FxOp88 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 8
|
||||
MULTRN 8
|
||||
NEWSYM FxOp89 ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 9
|
||||
MULTRN 9
|
||||
NEWSYM FxOp8A ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 10
|
||||
MULTRN 10
|
||||
NEWSYM FxOp8B ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 11
|
||||
MULTRN 11
|
||||
NEWSYM FxOp8C ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 12
|
||||
MULTRN 12
|
||||
NEWSYM FxOp8D ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 13
|
||||
MULTRN 13
|
||||
NEWSYM FxOp8E ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRN 14
|
||||
MULTRN 14
|
||||
NEWSYM FxOp8F ; MULTRN 8 bit to 16 bit signed multiply, register * register
|
||||
FETCHPIPE
|
||||
mov ebx,ebp
|
||||
|
||||
@@ -188,29 +188,29 @@ NEWSYM FxOpb0F ; BVS branch on overflow set ; Verified.
|
||||
NEWSYM FxOpb10 ; TO RN set register n as destination register
|
||||
TORNb 0
|
||||
NEWSYM FxOpb11 ; TO RN set register n as destination register
|
||||
TORNb 1
|
||||
TORNb 1
|
||||
NEWSYM FxOpb12 ; TO RN set register n as destination register
|
||||
TORNb 2
|
||||
TORNb 2
|
||||
NEWSYM FxOpb13 ; TO RN set register n as destination register
|
||||
TORNb 3
|
||||
TORNb 3
|
||||
NEWSYM FxOpb14 ; TO RN set register n as destination register
|
||||
TORNb 4
|
||||
TORNb 4
|
||||
NEWSYM FxOpb15 ; TO RN set register n as destination register
|
||||
TORNb 5
|
||||
TORNb 5
|
||||
NEWSYM FxOpb16 ; TO RN set register n as destination register
|
||||
TORNb 6
|
||||
TORNb 6
|
||||
NEWSYM FxOpb17 ; TO RN set register n as destination register
|
||||
TORNb 7
|
||||
TORNb 7
|
||||
NEWSYM FxOpb18 ; TO RN set register n as destination register
|
||||
TORNb 8
|
||||
TORNb 8
|
||||
NEWSYM FxOpb19 ; TO RN set register n as destination register
|
||||
TORNb 9
|
||||
TORNb 9
|
||||
NEWSYM FxOpb1A ; TO RN set register n as destination register
|
||||
TORNb 10
|
||||
TORNb 10
|
||||
NEWSYM FxOpb1B ; TO RN set register n as destination register
|
||||
TORNb 11
|
||||
TORNb 11
|
||||
NEWSYM FxOpb1C ; TO RN set register n as destination register
|
||||
TORNb 12
|
||||
TORNb 12
|
||||
NEWSYM FxOpb1D ; TO RN set register n as destination register
|
||||
TORNb 13
|
||||
NEWSYM FxOpb1E ; TO RN set register n as destination register
|
||||
@@ -504,29 +504,29 @@ NEWSYM FxOpc0F ; BVS branch on overflow set ; Verified.
|
||||
NEWSYM FxOpc10 ; TO RN set register n as destination register
|
||||
TORNc 0
|
||||
NEWSYM FxOpc11 ; TO RN set register n as destination register
|
||||
TORNc 1
|
||||
TORNc 1
|
||||
NEWSYM FxOpc12 ; TO RN set register n as destination register
|
||||
TORNc 2
|
||||
TORNc 2
|
||||
NEWSYM FxOpc13 ; TO RN set register n as destination register
|
||||
TORNc 3
|
||||
TORNc 3
|
||||
NEWSYM FxOpc14 ; TO RN set register n as destination register
|
||||
TORNc 4
|
||||
TORNc 4
|
||||
NEWSYM FxOpc15 ; TO RN set register n as destination register
|
||||
TORNc 5
|
||||
TORNc 5
|
||||
NEWSYM FxOpc16 ; TO RN set register n as destination register
|
||||
TORNc 6
|
||||
TORNc 6
|
||||
NEWSYM FxOpc17 ; TO RN set register n as destination register
|
||||
TORNc 7
|
||||
TORNc 7
|
||||
NEWSYM FxOpc18 ; TO RN set register n as destination register
|
||||
TORNc 8
|
||||
TORNc 8
|
||||
NEWSYM FxOpc19 ; TO RN set register n as destination register
|
||||
TORNc 9
|
||||
TORNc 9
|
||||
NEWSYM FxOpc1A ; TO RN set register n as destination register
|
||||
TORNc 10
|
||||
TORNc 10
|
||||
NEWSYM FxOpc1B ; TO RN set register n as destination register
|
||||
TORNc 11
|
||||
TORNc 11
|
||||
NEWSYM FxOpc1C ; TO RN set register n as destination register
|
||||
TORNc 12
|
||||
TORNc 12
|
||||
NEWSYM FxOpc1D ; TO RN set register n as destination register
|
||||
TORNc 13
|
||||
NEWSYM FxOpc1E ; TO RN set register n as destination register
|
||||
|
||||
@@ -264,29 +264,29 @@ NEWSYM FxOpd0F ; BVS branch on overflow set ; Verified.
|
||||
NEWSYM FxOpd10 ; TO RN set register n as destination register
|
||||
TORNd 0
|
||||
NEWSYM FxOpd11 ; TO RN set register n as destination register
|
||||
TORNd 1
|
||||
TORNd 1
|
||||
NEWSYM FxOpd12 ; TO RN set register n as destination register
|
||||
TORNd 2
|
||||
TORNd 2
|
||||
NEWSYM FxOpd13 ; TO RN set register n as destination register
|
||||
TORNd 3
|
||||
TORNd 3
|
||||
NEWSYM FxOpd14 ; TO RN set register n as destination register
|
||||
TORNd 4
|
||||
TORNd 4
|
||||
NEWSYM FxOpd15 ; TO RN set register n as destination register
|
||||
TORNd 5
|
||||
TORNd 5
|
||||
NEWSYM FxOpd16 ; TO RN set register n as destination register
|
||||
TORNd 6
|
||||
TORNd 6
|
||||
NEWSYM FxOpd17 ; TO RN set register n as destination register
|
||||
TORNd 7
|
||||
TORNd 7
|
||||
NEWSYM FxOpd18 ; TO RN set register n as destination register
|
||||
TORNd 8
|
||||
TORNd 8
|
||||
NEWSYM FxOpd19 ; TO RN set register n as destination register
|
||||
TORNd 9
|
||||
TORNd 9
|
||||
NEWSYM FxOpd1A ; TO RN set register n as destination register
|
||||
TORNd 10
|
||||
TORNd 10
|
||||
NEWSYM FxOpd1B ; TO RN set register n as destination register
|
||||
TORNd 11
|
||||
TORNd 11
|
||||
NEWSYM FxOpd1C ; TO RN set register n as destination register
|
||||
TORNd 12
|
||||
TORNd 12
|
||||
NEWSYM FxOpd1D ; TO RN set register n as destination register
|
||||
TORNd 13
|
||||
NEWSYM FxOpd1E ; TO RN set register n as destination register
|
||||
@@ -488,21 +488,21 @@ NEWSYM FxOpd4B ; LDW RN load word from RAM
|
||||
LDWRNc 11
|
||||
|
||||
NEWSYM FxOpd40A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 0
|
||||
LDBRNc 0
|
||||
NEWSYM FxOpd41A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 1
|
||||
LDBRNc 1
|
||||
NEWSYM FxOpd42A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 2
|
||||
LDBRNc 2
|
||||
NEWSYM FxOpd43A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 3
|
||||
LDBRNc 3
|
||||
NEWSYM FxOpd44A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 4
|
||||
LDBRNc 4
|
||||
NEWSYM FxOpd45A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 5
|
||||
NEWSYM FxOpd46A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 6
|
||||
LDBRNc 6
|
||||
NEWSYM FxOpd47A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 7
|
||||
LDBRNc 7
|
||||
NEWSYM FxOpd48A1 ; LDB RN load byte from RAM
|
||||
LDBRNc 8
|
||||
NEWSYM FxOpd49A1 ; LDB RN load byte from RAM
|
||||
@@ -937,7 +937,7 @@ NEWSYM FxOpd4CA1 ; RPIX read color of the pixel with R1,R2 as x,y
|
||||
NEWSYM FxOpd4D ; SWAP swap upper and lower byte of a register ; V
|
||||
mov eax,[esi] ; Read Source
|
||||
FETCHPIPE
|
||||
ror ax,8
|
||||
ror ax,8
|
||||
inc ebp ; Increase program counter
|
||||
mov [SfxSignZero],eax
|
||||
mov [edi],eax ; Write Destination
|
||||
@@ -1552,35 +1552,35 @@ NEWSYM FxOpd7FA3 ; BICIRNc register & ~immediate
|
||||
BICIRNc 15 ^ 0FFFFh
|
||||
|
||||
NEWSYM FxOpd80 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 0
|
||||
MULTRNc 0
|
||||
NEWSYM FxOpd81 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 1
|
||||
MULTRNc 1
|
||||
NEWSYM FxOpd82 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 2
|
||||
MULTRNc 2
|
||||
NEWSYM FxOpd83 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 3
|
||||
MULTRNc 3
|
||||
NEWSYM FxOpd84 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 4
|
||||
MULTRNc 4
|
||||
NEWSYM FxOpd85 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 5
|
||||
MULTRNc 5
|
||||
NEWSYM FxOpd86 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 6
|
||||
MULTRNc 6
|
||||
NEWSYM FxOpd87 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 7
|
||||
MULTRNc 7
|
||||
NEWSYM FxOpd88 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 8
|
||||
MULTRNc 8
|
||||
NEWSYM FxOpd89 ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 9
|
||||
MULTRNc 9
|
||||
NEWSYM FxOpd8A ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 10
|
||||
MULTRNc 10
|
||||
NEWSYM FxOpd8B ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 11
|
||||
MULTRNc 11
|
||||
NEWSYM FxOpd8C ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 12
|
||||
MULTRNc 12
|
||||
NEWSYM FxOpd8D ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 13
|
||||
MULTRNc 13
|
||||
NEWSYM FxOpd8E ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
MULTRNc 14
|
||||
MULTRNc 14
|
||||
NEWSYM FxOpd8F ; MULTRNc 8 bit to 16 bit signed multiply, register * register
|
||||
FETCHPIPE
|
||||
mov ebx,ebp
|
||||
|
||||
@@ -32,8 +32,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
* of thanks and credit for figuring this out.
|
||||
*
|
||||
* Andreas says:
|
||||
* The author is greatly indebted with The Dumper, without whose help and
|
||||
* patience providing him with real S-DD1 data the research had never been
|
||||
* The author is greatly indebted with The Dumper, without whose help and
|
||||
* patience providing him with real S-DD1 data the research had never been
|
||||
* possible. He also wish to note that in the very beggining of his research,
|
||||
* Neviksti had done some steps in the right direction. By last, the author is
|
||||
* indirectly indebted to all the people that worked and contributed in the
|
||||
@@ -163,7 +163,7 @@ INLINE unsigned char ProbGetBit(unsigned char context){
|
||||
|
||||
INLINE unsigned char GetBit(unsigned char cur_bitplane){
|
||||
unsigned char bit;
|
||||
|
||||
|
||||
bit=ProbGetBit(((cur_bitplane&1)<<4)
|
||||
| ((prev_bits[cur_bitplane]&high_context_bits)>>5)
|
||||
| (prev_bits[cur_bitplane]&low_context_bits));
|
||||
|
||||
@@ -206,7 +206,7 @@ void ST010_OP01(short x0, short y0, short *x1, short *y1, short *Quadrant, short
|
||||
else
|
||||
{
|
||||
*x1 = x0;
|
||||
*y1 = y0;
|
||||
*y1 = y0;
|
||||
*Quadrant = 0x0000;
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void ST010_Rotate(short Theta, short X0, short Y0, short *X1, short *Y1)
|
||||
*Y1 = (Y0 * ST010_Cos(Theta) >> 15) - (X0 * ST010_Sin(Theta) >> 15);
|
||||
}
|
||||
|
||||
void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32])
|
||||
void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32])
|
||||
{
|
||||
bool Sorted;
|
||||
uint16 Temp;
|
||||
@@ -251,12 +251,12 @@ void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32])
|
||||
Sorted = true;
|
||||
for (i = 0; i < Positions - 1; i++)
|
||||
{
|
||||
if (Places[i] < Places[i + 1])
|
||||
if (Places[i] < Places[i + 1])
|
||||
{
|
||||
Temp = Places[i + 1];
|
||||
Places[i + 1] = Places[i];
|
||||
Places[i] = Temp;
|
||||
|
||||
|
||||
Temp = Drivers[i + 1];
|
||||
Drivers[i + 1] = Drivers[i];
|
||||
Drivers[i] = Temp;
|
||||
@@ -278,13 +278,13 @@ void ST010DoCommand(void)
|
||||
{
|
||||
/*
|
||||
Calculate track data based on direction coords
|
||||
|
||||
|
||||
Input
|
||||
0x0000-0x0001 : DX (signed)
|
||||
0x0002-0x0003 : DY (signed)
|
||||
Output
|
||||
0x0010-0x0011 : Angle (signed)
|
||||
*/
|
||||
*/
|
||||
|
||||
case 0x01:
|
||||
{
|
||||
@@ -295,13 +295,13 @@ void ST010DoCommand(void)
|
||||
break;
|
||||
|
||||
//Sorts a bunch of values by weight
|
||||
|
||||
|
||||
case 0x02:
|
||||
{
|
||||
ST010_SortDrivers(*(short*)&SRAM[0x0024], (uint16*)&SRAM[0x0040], (uint16*)&SRAM[0x0080]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
Two Dimensional Coordinate Scale
|
||||
|
||||
@@ -312,8 +312,8 @@ void ST010DoCommand(void)
|
||||
Output
|
||||
0x0010-0x0013 : X1 (signed)
|
||||
0x0014-0x0017 : Y1 (signed)
|
||||
*/
|
||||
|
||||
*/
|
||||
|
||||
case 0x03:
|
||||
{
|
||||
ST010_Scale(*(short*)&SRAM[0x0004], *(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (int *)&SRAM[0x10], (int *)&SRAM[0x14]);
|
||||
@@ -344,7 +344,7 @@ void ST010DoCommand(void)
|
||||
//Target (x,y) coordinates
|
||||
int16 ypos_max = ST010_WORD(0x00C0);
|
||||
int16 xpos_max = ST010_WORD(0x00C2);
|
||||
|
||||
|
||||
//Current coordinates and direction
|
||||
int32 ypos = SRAM[0xC4]|(SRAM[0xC5]<<8)|(SRAM[0xC6]<<16)|(SRAM[0xC7]<<24);
|
||||
int32 xpos = SRAM[0xC8]|(SRAM[0xC9]<<8)|(SRAM[0xCA]<<16)|(SRAM[0xCB]<<24);
|
||||
@@ -395,7 +395,7 @@ void ST010DoCommand(void)
|
||||
{
|
||||
speed = 0x100;
|
||||
}
|
||||
|
||||
|
||||
//Slow down for sharp curves
|
||||
else if (abs(o1-rot)>=0x1000)
|
||||
{
|
||||
@@ -476,7 +476,7 @@ void ST010DoCommand(void)
|
||||
SRAM[0x00DD]=(uint8)(flags >> 8);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
/*
|
||||
16-bit Multiplication
|
||||
|
||||
@@ -493,7 +493,7 @@ void ST010DoCommand(void)
|
||||
}
|
||||
break;
|
||||
|
||||
/*
|
||||
/*
|
||||
Mode 7 Raster Data Calculation
|
||||
|
||||
Input
|
||||
@@ -503,7 +503,7 @@ void ST010DoCommand(void)
|
||||
0x0250-0x03af : Mode 7 Matrix B
|
||||
0x03b0-0x050f : Mode 7 Matrix C
|
||||
0x0510-0x066f : Mode 7 Matrix D
|
||||
*/
|
||||
*/
|
||||
|
||||
case 0x07:
|
||||
{
|
||||
@@ -519,7 +519,7 @@ void ST010DoCommand(void)
|
||||
SRAM[0x00f0 + offset]=(uint8)(data);
|
||||
SRAM[0x00f1 + offset]=(uint8)(data >> 8);
|
||||
SRAM[0x0510 + offset]=(uint8)(data);
|
||||
SRAM[0x0511 + offset]=(uint8)(data >> 8);
|
||||
SRAM[0x0511 + offset]=(uint8)(data >> 8);
|
||||
|
||||
//Calculate Mode 7 Matrix B/C data
|
||||
data = ST010_M7Scale[line] * ST010_Sin(Theta) >> 15;
|
||||
@@ -527,10 +527,10 @@ void ST010DoCommand(void)
|
||||
SRAM[0x0251 + offset]=(uint8)(data >> 8);
|
||||
|
||||
if (data) { data = ~data; }
|
||||
|
||||
|
||||
SRAM[0x03b0 + offset]=(uint8)(data);
|
||||
SRAM[0x03b1 + offset]=(uint8)(data >> 8);
|
||||
|
||||
|
||||
offset += 2;
|
||||
}
|
||||
|
||||
@@ -551,7 +551,7 @@ void ST010DoCommand(void)
|
||||
0x0010-0x0011 : X1 (signed)
|
||||
0x0012-0x0013 : Y1 (signed)
|
||||
*/
|
||||
|
||||
|
||||
case 0x08:
|
||||
{
|
||||
ST010_Rotate(*(short*)&SRAM[0x0004], *(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (short *)&SRAM[0x10], (short *)&SRAM[0x12]);
|
||||
|
||||
@@ -438,7 +438,7 @@ NEWSYM reg3010w
|
||||
ret
|
||||
NEWSYM reg3011w
|
||||
mov [SfxR8+1],al
|
||||
ret
|
||||
ret
|
||||
NEWSYM reg3012w
|
||||
mov [SfxR9],al
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user