trunk/src/mame/machine/raiden2cop.c
| r32338 | r32339 | |
| 3 | 3 | Seibu Cop (Co-Processor) emulation |
| 4 | 4 | (new implementation, based on Raiden 2 code) |
| 5 | 5 | |
| 6 | (should write new notes to replace those that were in seicop.c) |
| 7 | |
| 6 | 8 | ***************************************************************************/ |
| 7 | 9 | |
| 8 | 10 | #include "emu.h" |
| r32338 | r32339 | |
| 47 | 49 | m_cop_sprite_dma_src(0), |
| 48 | 50 | m_cop_sprite_dma_size(0), |
| 49 | 51 | |
| 52 | m_cop_rom_addr_lo(0), |
| 53 | m_cop_rom_addr_hi(0), |
| 54 | m_cop_rom_addr_unk(0), |
| 50 | 55 | |
| 56 | m_cop_sprite_dma_abs_x(0), |
| 57 | m_cop_sprite_dma_abs_y(0), |
| 58 | |
| 59 | m_LEGACY_cop_angle_compare(0), |
| 60 | m_LEGACY_cop_angle_mod_val(0), |
| 61 | m_LEGACY_cop_hit_val_x(0), |
| 62 | m_LEGACY_cop_hit_val_y(0), |
| 63 | m_LEGACY_m_cop_hit_val_z(0), |
| 64 | m_LEGACY_r0(0), |
| 65 | m_LEGACY_r1(0), |
| 66 | |
| 51 | 67 | m_videoramout_cb(*this), |
| 52 | 68 | m_palette(*this, ":palette") |
| 53 | 69 | { |
| r32338 | r32339 | |
| 139 | 155 | save_item(NAME(m_cop_sprite_dma_size)); |
| 140 | 156 | save_item(NAME(m_cop_sprite_dma_src)); |
| 141 | 157 | |
| 158 | save_item(NAME(m_cop_rom_addr_lo)); |
| 159 | save_item(NAME(m_cop_rom_addr_hi)); |
| 160 | save_item(NAME(m_cop_rom_addr_unk)); |
| 142 | 161 | |
| 162 | save_item(NAME(m_cop_sprite_dma_abs_x)); |
| 163 | save_item(NAME(m_cop_sprite_dma_abs_y)); |
| 164 | |
| 165 | // legacy |
| 166 | save_item(NAME(m_LEGACY_cop_angle_compare)); |
| 167 | save_item(NAME(m_LEGACY_cop_angle_mod_val)); |
| 168 | save_item(NAME(m_LEGACY_cop_hit_val_x)); |
| 169 | save_item(NAME(m_LEGACY_cop_hit_val_y)); |
| 170 | save_item(NAME(m_LEGACY_m_cop_hit_val_z)); |
| 171 | save_item(NAME(m_LEGACY_r0)); |
| 172 | save_item(NAME(m_LEGACY_r1)); |
| 173 | |
| 143 | 174 | m_videoramout_cb.resolve_safe(); |
| 144 | 175 | |
| 145 | 176 | cop_itoa_digit_count = 4; //TODO: Raiden 2 never inits the BCD register, value here is a guess (8 digits, as WR is 10.000.000 + a) |
| r32338 | r32339 | |
| 1139 | 1170 | cop_status |= 2; |
| 1140 | 1171 | } |
| 1141 | 1172 | } |
| 1173 | |
| 1174 | // more misc |
| 1175 | |
| 1176 | WRITE16_MEMBER( raiden2cop_device::cop_rom_addr_unk_w) |
| 1177 | { |
| 1178 | COMBINE_DATA(&m_cop_rom_addr_unk); |
| 1179 | } |
| 1180 | |
| 1181 | WRITE16_MEMBER( raiden2cop_device::cop_rom_addr_lo_w) |
| 1182 | { |
| 1183 | COMBINE_DATA(&m_cop_rom_addr_lo); |
| 1184 | } |
| 1185 | |
| 1186 | WRITE16_MEMBER( raiden2cop_device::cop_rom_addr_hi_w) |
| 1187 | { |
| 1188 | COMBINE_DATA(&m_cop_rom_addr_hi); |
| 1189 | } |
| 1190 | |
| 1191 | WRITE16_MEMBER(raiden2cop_device::cop_sprite_dma_abs_y_w) |
| 1192 | { |
| 1193 | m_cop_sprite_dma_abs_y = data; |
| 1194 | } |
| 1195 | |
| 1196 | WRITE16_MEMBER(raiden2cop_device::cop_sprite_dma_abs_x_w) |
| 1197 | { |
| 1198 | m_cop_sprite_dma_abs_x = data; |
| 1199 | } |
| 1200 | |
| 1201 | /*------------------------------------------------------------------------------------------------------------------------------------------------*/ |
| 1202 | /* LEGACY CODE -----------------------------------------------------------------------------------------------------------------------------------*/ |
| 1203 | /* this is all old code that hasn't been refactored yet, it will go away */ |
| 1204 | /*------------------------------------------------------------------------------------------------------------------------------------------------*/ |
| 1205 | /*------------------------------------------------------------------------------------------------------------------------------------------------*/ |
| 1206 | /*------------------------------------------------------------------------------------------------------------------------------------------------*/ |
| 1207 | |
| 1208 | |
| 1209 | WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_angle_compare_w) |
| 1210 | { |
| 1211 | m_LEGACY_cop_angle_compare = UINT16(data); |
| 1212 | } |
| 1213 | |
| 1214 | WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_angle_mod_val_w) |
| 1215 | { |
| 1216 | m_LEGACY_cop_angle_mod_val = UINT16(data); |
| 1217 | } |
| 1218 | |
| 1219 | READ16_MEMBER( raiden2cop_device::LEGACY_cop_collision_status_val_r) |
| 1220 | { |
| 1221 | /* these two controls facing direction in Godzilla opponents (only vs.) - x value compare? */ |
| 1222 | if (offset==0) return (m_LEGACY_cop_hit_val_y); |
| 1223 | else if (offset==1) return (m_LEGACY_cop_hit_val_x); |
| 1224 | else return (m_LEGACY_m_cop_hit_val_z); |
| 1225 | } |
| 1226 | |
| 1227 | |
| 1228 | /* |
| 1229 | Godzilla 0x12c0 X = 0x21ed Y = 0x57da |
| 1230 | Megaron 0x12d0 X = 0x1ef1 Y = 0x55db |
| 1231 | King Ghidorah 0x12c8 X = 0x26eb Y = 0x55dc |
| 1232 | Mecha Ghidorah 0x12dc X = 0x24ec Y = 0x55dc |
| 1233 | Mecha Godzilla 0x12d4 X = 0x1cf1 Y = 0x52dc |
| 1234 | Gigan 0x12cc X = 0x23e8 Y = 0x55db |
| 1235 | |
| 1236 | (DC.W $1020, $F0C0, $0000, $0000) |
| 1237 | X = collides at the same spot |
| 1238 | Y = collides between 0xd0 and 0x20 |
| 1239 | 0x588 bits 2 & 3 = 0 |
| 1240 | (DC.W $F0C0, $1020, $0000, $0000) |
| 1241 | X = collides between 0xb0 and 0x50 (inclusive) |
| 1242 | Y = collides between 0xd0 and 0x30 (not inclusive) |
| 1243 | 0x588 bits 2 & 3 = 0x580 bits 0 & 1 |
| 1244 | */ |
| 1245 | void raiden2cop_device::LEGACY_cop_take_hit_box_params(UINT8 offs) |
| 1246 | { |
| 1247 | INT16 start_x,start_y,height,width; |
| 1248 | |
| 1249 | { |
| 1250 | height = UINT8(m_LEGACY_cop_collision_info[offs].hitbox_y >> 8); |
| 1251 | start_y = INT8(m_LEGACY_cop_collision_info[offs].hitbox_y); |
| 1252 | width = UINT8(m_LEGACY_cop_collision_info[offs].hitbox_x >> 8); |
| 1253 | start_x = INT8(m_LEGACY_cop_collision_info[offs].hitbox_x); |
| 1254 | } |
| 1255 | |
| 1256 | m_LEGACY_cop_collision_info[offs].min_x = (m_LEGACY_cop_collision_info[offs].x >> 16) + start_x; |
| 1257 | m_LEGACY_cop_collision_info[offs].max_x = m_LEGACY_cop_collision_info[offs].min_x + width; |
| 1258 | m_LEGACY_cop_collision_info[offs].min_y = (m_LEGACY_cop_collision_info[offs].y >> 16) + start_y; |
| 1259 | m_LEGACY_cop_collision_info[offs].max_y = m_LEGACY_cop_collision_info[offs].min_y + height; |
| 1260 | } |
| 1261 | |
| 1262 | |
| 1263 | UINT8 raiden2cop_device::LEGACY_cop_calculate_collsion_detection() |
| 1264 | { |
| 1265 | static UINT8 res; |
| 1266 | |
| 1267 | res = 3; |
| 1268 | |
| 1269 | /* outbound X check */ |
| 1270 | if(m_LEGACY_cop_collision_info[0].max_x >= m_LEGACY_cop_collision_info[1].min_x && m_LEGACY_cop_collision_info[0].min_x <= m_LEGACY_cop_collision_info[1].max_x) |
| 1271 | res &= ~2; |
| 1272 | |
| 1273 | if(m_LEGACY_cop_collision_info[1].max_x >= m_LEGACY_cop_collision_info[0].min_x && m_LEGACY_cop_collision_info[1].min_x <= m_LEGACY_cop_collision_info[0].max_x) |
| 1274 | res &= ~2; |
| 1275 | |
| 1276 | /* outbound Y check */ |
| 1277 | if(m_LEGACY_cop_collision_info[0].max_y >= m_LEGACY_cop_collision_info[1].min_y && m_LEGACY_cop_collision_info[0].min_y <= m_LEGACY_cop_collision_info[1].max_y) |
| 1278 | res &= ~1; |
| 1279 | |
| 1280 | if(m_LEGACY_cop_collision_info[1].max_y >= m_LEGACY_cop_collision_info[0].min_y && m_LEGACY_cop_collision_info[1].min_y <= m_LEGACY_cop_collision_info[0].max_y) |
| 1281 | res &= ~1; |
| 1282 | |
| 1283 | m_LEGACY_cop_hit_val_x = (m_LEGACY_cop_collision_info[0].x - m_LEGACY_cop_collision_info[1].x) >> 16; |
| 1284 | m_LEGACY_cop_hit_val_y = (m_LEGACY_cop_collision_info[0].y - m_LEGACY_cop_collision_info[1].y) >> 16; |
| 1285 | m_LEGACY_m_cop_hit_val_z = 1; |
| 1286 | cop_hit_val_stat = res; // TODO: there's also bit 2 and 3 triggered in the tests, no known meaning |
| 1287 | |
| 1288 | //popmessage("%d %d %04x %04x %04x %04x",m_LEGACY_cop_hit_val_x,m_LEGACY_cop_hit_val_y,m_LEGACY_cop_collision_info[0].hitbox_x,m_LEGACY_cop_collision_info[0].hitbox_y,m_LEGACY_cop_collision_info[1].hitbox_x,m_LEGACY_cop_collision_info[1].hitbox_y); |
| 1289 | |
| 1290 | //if(res == 0) |
| 1291 | //popmessage("0:%08x %08x %08x 1:%08x %08x %08x\n",m_LEGACY_cop_collision_info[0].x,m_LEGACY_cop_collision_info[0].y,m_LEGACY_cop_collision_info[0].hitbox,m_LEGACY_cop_collision_info[1].x,m_LEGACY_cop_collision_info[1].y,m_LEGACY_cop_collision_info[1].hitbox); |
| 1292 | // popmessage("0:%08x %08x %08x %08x 1:%08x %08x %08x %08x\n",m_LEGACY_cop_collision_info[0].min_x,m_LEGACY_cop_collision_info[0].max_x,m_LEGACY_cop_collision_info[0].min_y, m_LEGACY_cop_collision_info[0].max_y, |
| 1293 | // m_LEGACY_cop_collision_info[1].min_x,m_LEGACY_cop_collision_info[1].max_x,m_LEGACY_cop_collision_info[1].min_y, m_LEGACY_cop_collision_info[1].max_y); |
| 1294 | |
| 1295 | return res; |
| 1296 | } |
| 1297 | |
| 1298 | |
| 1299 | WRITE16_MEMBER(raiden2cop_device::LEGACY_cop_cmd_w) |
| 1300 | { |
| 1301 | int command; |
| 1302 | |
| 1303 | |
| 1304 | logerror("%06x: COPX execute table macro command %04x | regs %08x %08x %08x %08x %08x\n", space.device().safe_pc(), data, cop_regs[0], cop_regs[1], cop_regs[2], cop_regs[3], cop_regs[4]); |
| 1305 | |
| 1306 | |
| 1307 | command = find_trigger_match(data, 0xff00); |
| 1308 | |
| 1309 | |
| 1310 | if (command == -1) |
| 1311 | { |
| 1312 | return; |
| 1313 | } |
| 1314 | UINT16 funcval, funcmask; |
| 1315 | // this is pointless.. all we use it for is comparing against the same value |
| 1316 | funcval = get_func_value(command); |
| 1317 | funcmask = get_func_mask(command); |
| 1318 | //printf("%04x %04x %04x\n",m_cop_mcu_ram[offset],funcval,funcmask); |
| 1319 | |
| 1320 | /* |
| 1321 | Macro notes: |
| 1322 | - endianess changes from/to Raiden 2: |
| 1323 | dword ^= 0 |
| 1324 | word ^= 2 |
| 1325 | byte ^= 3 |
| 1326 | - some macro commands here have a commented algorithm, it's how Seibu Cup Bootleg version handles maths inside the 14/15 roms. |
| 1327 | The ROMs map tables in the following arrangement: |
| 1328 | 0x00000 - 0x1ffff Sine math results |
| 1329 | 0x20000 - 0x3ffff Cosine math results |
| 1330 | 0x40000 - 0x7ffff Division math results |
| 1331 | 0x80000 - 0xfffff Pythagorean theorem, hypotenuse length math results |
| 1332 | Surprisingly atan maths are nowhere to be found from the roms. |
| 1333 | */ |
| 1334 | |
| 1335 | int executed = 0; |
| 1336 | |
| 1337 | /* "automatic" movement, 0205 */ |
| 1338 | if (check_command_matches(command, 0x188, 0x282, 0x082, 0xb8e, 0x98e, 0x000, 0x000, 0x000, 6, 0xffeb)) |
| 1339 | { |
| 1340 | executed = 1; |
| 1341 | UINT8 offs; |
| 1342 | |
| 1343 | offs = (offset & 3) * 4; |
| 1344 | int ppos = space.read_dword(cop_regs[0] + 4 + offs); |
| 1345 | int npos = ppos + space.read_dword(cop_regs[0] + 0x10 + offs); |
| 1346 | int delta = (npos >> 16) - (ppos >> 16); |
| 1347 | |
| 1348 | space.write_dword(cop_regs[0] + 4 + offs, npos); |
| 1349 | space.write_word(cop_regs[0] + 0x1c + offs, space.read_word(cop_regs[0] + 0x1c + offs) + delta); |
| 1350 | return; |
| 1351 | } |
| 1352 | |
| 1353 | /* "automatic" movement, for arcs in Legionnaire / Zero Team (expression adjustment) 0905 */ |
| 1354 | if (check_command_matches(command, 0x194, 0x288, 0x088, 0x000, 0x000, 0x000, 0x000, 0x000, 6, 0xfbfb)) |
| 1355 | { |
| 1356 | executed = 1; |
| 1357 | UINT8 offs; |
| 1358 | |
| 1359 | offs = (offset & 3) * 4; |
| 1360 | |
| 1361 | /* read 0x28 + offs */ |
| 1362 | /* add 0x10 + offs */ |
| 1363 | /* write 0x10 + offs */ |
| 1364 | |
| 1365 | space.write_dword(cop_regs[0] + 0x10 + offs, space.read_dword(cop_regs[0] + 0x10 + offs) + space.read_dword(cop_regs[0] + 0x28 + offs)); |
| 1366 | return; |
| 1367 | } |
| 1368 | |
| 1369 | /* SINE math - 0x8100 */ |
| 1370 | /* |
| 1371 | 00000-0ffff: |
| 1372 | amp = x/256 |
| 1373 | ang = x & 255 |
| 1374 | s = sin(ang*2*pi/256) |
| 1375 | val = trunc(s*amp) |
| 1376 | if(s<0) |
| 1377 | val-- |
| 1378 | if(s == 192) |
| 1379 | val = -2*amp |
| 1380 | */ |
| 1381 | if (check_command_matches(command, 0xb9a, 0xb88, 0x888, 0x000, 0x000, 0x000, 0x000, 0x000, 7, 0xfdfb)) |
| 1382 | { |
| 1383 | executed = 1; |
| 1384 | int raw_angle = (space.read_word(cop_regs[0] + (0x34 ^ 2)) & 0xff); |
| 1385 | double angle = raw_angle * M_PI / 128; |
| 1386 | double amp = (65536 >> 5)*(space.read_word(cop_regs[0] + (0x36 ^ 2)) & 0xff); |
| 1387 | int res; |
| 1388 | |
| 1389 | /* TODO: up direction, why? */ |
| 1390 | if (raw_angle == 0xc0) |
| 1391 | amp *= 2; |
| 1392 | |
| 1393 | res = int(amp*sin(angle)) << cop_scale; |
| 1394 | |
| 1395 | space.write_dword(cop_regs[0] + 0x10, res); |
| 1396 | return; |
| 1397 | } |
| 1398 | |
| 1399 | /* COSINE math - 0x8900 */ |
| 1400 | /* |
| 1401 | 10000-1ffff: |
| 1402 | amp = x/256 |
| 1403 | ang = x & 255 |
| 1404 | s = cos(ang*2*pi/256) |
| 1405 | val = trunc(s*amp) |
| 1406 | if(s<0) |
| 1407 | val-- |
| 1408 | if(s == 128) |
| 1409 | val = -2*amp |
| 1410 | */ |
| 1411 | if (check_command_matches(command, 0xb9a, 0xb8a, 0x88a, 0x000, 0x000, 0x000, 0x000, 0x000, 7, 0xfdfb)) |
| 1412 | { |
| 1413 | executed = 1; |
| 1414 | int raw_angle = (space.read_word(cop_regs[0] + (0x34 ^ 2)) & 0xff); |
| 1415 | double angle = raw_angle * M_PI / 128; |
| 1416 | double amp = (65536 >> 5)*(space.read_word(cop_regs[0] + (0x36 ^ 2)) & 0xff); |
| 1417 | int res; |
| 1418 | |
| 1419 | /* TODO: left direction, why? */ |
| 1420 | if (raw_angle == 0x80) |
| 1421 | amp *= 2; |
| 1422 | |
| 1423 | res = int(amp*cos(angle)) << cop_scale; |
| 1424 | |
| 1425 | space.write_dword(cop_regs[0] + 20, res); |
| 1426 | return; |
| 1427 | } |
| 1428 | |
| 1429 | /* 0x130e / 0x138e */ |
| 1430 | if (check_command_matches(command, 0x984, 0xaa4, 0xd82, 0xaa2, 0x39b, 0xb9a, 0xb9a, 0xa9a, 5, 0xbf7f)) |
| 1431 | { |
| 1432 | executed = 1; |
| 1433 | int dy = space.read_dword(cop_regs[1] + 4) - space.read_dword(cop_regs[0] + 4); |
| 1434 | int dx = space.read_dword(cop_regs[1] + 8) - space.read_dword(cop_regs[0] + 8); |
| 1435 | |
| 1436 | cop_status = 7; |
| 1437 | if (!dx) { |
| 1438 | cop_status |= 0x8000; |
| 1439 | cop_angle = 0; |
| 1440 | } |
| 1441 | else { |
| 1442 | cop_angle = atan(double(dy) / double(dx)) * 128.0 / M_PI; |
| 1443 | if (dx < 0) |
| 1444 | cop_angle += 0x80; |
| 1445 | } |
| 1446 | |
| 1447 | m_LEGACY_r0 = dy; |
| 1448 | m_LEGACY_r1 = dx; |
| 1449 | |
| 1450 | //printf("%d %d %f %04x\n",dx,dy,atan(double(dy)/double(dx)) * 128 / M_PI,cop_angle); |
| 1451 | |
| 1452 | if (data & 0x80) |
| 1453 | space.write_word(cop_regs[0] + (0x34 ^ 2), cop_angle); |
| 1454 | return; |
| 1455 | } |
| 1456 | |
| 1457 | /* Pythagorean theorem, hypotenuse direction - 130e / 138e */ |
| 1458 | //(heatbrl) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a |
| 1459 | if (check_command_matches(command, 0x984, 0xaa4, 0xd82, 0xaa2, 0x39b, 0xb9a, 0xb9a, 0xb9a, 5, 0xbf7f)) |
| 1460 | { |
| 1461 | executed = 1; |
| 1462 | int dy = space.read_dword(cop_regs[1] + 4) - space.read_dword(cop_regs[0] + 4); |
| 1463 | int dx = space.read_dword(cop_regs[1] + 8) - space.read_dword(cop_regs[0] + 8); |
| 1464 | |
| 1465 | cop_status = 7; |
| 1466 | if (!dx) { |
| 1467 | cop_status |= 0x8000; |
| 1468 | cop_angle = 0; |
| 1469 | } |
| 1470 | else { |
| 1471 | cop_angle = atan(double(dy) / double(dx)) * 128.0 / M_PI; |
| 1472 | if (dx < 0) |
| 1473 | cop_angle += 0x80; |
| 1474 | } |
| 1475 | |
| 1476 | cop_angle -= 0x80; |
| 1477 | m_LEGACY_r0 = dy; |
| 1478 | m_LEGACY_r1 = dx; |
| 1479 | |
| 1480 | if (data & 0x80) |
| 1481 | space.write_word(cop_regs[0] + (0x34 ^ 2), cop_angle); |
| 1482 | return; |
| 1483 | } |
| 1484 | |
| 1485 | /* Pythagorean theorem, hypotenuse length - 0x3bb0 */ |
| 1486 | //(grainbow) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1487 | /* |
| 1488 | 40000-7ffff: |
| 1489 | v1 = (x / 32768)*64 |
| 1490 | v2 = (x & 255)*32767/255 |
| 1491 | val = sqrt(v1*v1+v2*v2) (unsigned) |
| 1492 | */ |
| 1493 | if (check_command_matches(command, 0xf9c, 0xb9c, 0xb9c, 0xb9c, 0xb9c, 0xb9c, 0xb9c, 0x99c, 4, 0x007f)) |
| 1494 | { |
| 1495 | executed = 1; |
| 1496 | int dy = m_LEGACY_r0; |
| 1497 | int dx = m_LEGACY_r1; |
| 1498 | |
| 1499 | dx >>= 16; |
| 1500 | dy >>= 16; |
| 1501 | cop_dist = sqrt((double)(dx*dx + dy*dy)); |
| 1502 | |
| 1503 | if (data & 0x80) |
| 1504 | space.write_word(cop_regs[0] + (0x38), cop_dist); |
| 1505 | return; |
| 1506 | } |
| 1507 | |
| 1508 | /* Division - 0x42c2 */ |
| 1509 | /* |
| 1510 | 20000-2ffff: |
| 1511 | v1 = x / 1024 |
| 1512 | v2 = x & 1023 |
| 1513 | val = !v1 ? 32767 : trunc(v2/v1+0.5) |
| 1514 | 30000-3ffff: |
| 1515 | v1 = x / 1024 |
| 1516 | v2 = (x & 1023)*32 |
| 1517 | val = !v1 ? 32767 : trunc(v2/v1+0.5) |
| 1518 | */ |
| 1519 | if (check_command_matches(command, 0xf9a, 0xb9a, 0xb9c, 0xb9c, 0xb9c, 0x29c, 0x000, 0x000, 5, 0xfcdd)) |
| 1520 | { |
| 1521 | executed = 1; |
| 1522 | int dy = m_LEGACY_r0; |
| 1523 | int dx = m_LEGACY_r1; |
| 1524 | int div = space.read_word(cop_regs[0] + (0x36 ^ 2)); |
| 1525 | int res; |
| 1526 | int cop_dist_raw; |
| 1527 | |
| 1528 | if (!div) |
| 1529 | { |
| 1530 | printf("divide by zero?\n"); |
| 1531 | div = 1; |
| 1532 | } |
| 1533 | |
| 1534 | /* TODO: calculation of this one should occur at 0x3b30/0x3bb0 I *think* */ |
| 1535 | /* TODO: recheck if cop_scale still masks at 3 with this command */ |
| 1536 | dx >>= 11 + cop_scale; |
| 1537 | dy >>= 11 + cop_scale; |
| 1538 | cop_dist_raw = sqrt((double)(dx*dx + dy*dy)); |
| 1539 | |
| 1540 | res = cop_dist_raw; |
| 1541 | res /= div; |
| 1542 | |
| 1543 | cop_dist = (1 << (5 - cop_scale)) / div; |
| 1544 | |
| 1545 | /* TODO: bits 5-6-15 */ |
| 1546 | cop_status = 7; |
| 1547 | |
| 1548 | space.write_word(cop_regs[0] + (0x38 ^ 2), res); |
| 1549 | return; |
| 1550 | } |
| 1551 | |
| 1552 | /* |
| 1553 | collision detection: |
| 1554 | |
| 1555 | int dy_0 = space.read_dword(cop_regs[0]+4); |
| 1556 | int dx_0 = space.read_dword(cop_regs[0]+8); |
| 1557 | int dy_1 = space.read_dword(cop_regs[1]+4); |
| 1558 | int dx_1 = space.read_dword(cop_regs[1]+8); |
| 1559 | int hitbox_param1 = space.read_dword(cop_regs[2]); |
| 1560 | int hitbox_param2 = space.read_dword(cop_regs[3]); |
| 1561 | |
| 1562 | TODO: we are ignoring the funcval / funcmask params for now |
| 1563 | */ |
| 1564 | |
| 1565 | if (check_command_matches(command, 0xb80, 0xb82, 0xb84, 0xb86, 0x000, 0x000, 0x000, 0x000, funcval, funcmask)) |
| 1566 | { |
| 1567 | executed = 1; |
| 1568 | m_LEGACY_cop_collision_info[0].y = (space.read_dword(cop_regs[0] + 4)); |
| 1569 | m_LEGACY_cop_collision_info[0].x = (space.read_dword(cop_regs[0] + 8)); |
| 1570 | return; |
| 1571 | } |
| 1572 | |
| 1573 | //(heatbrl) | 9 | ffff | b080 | b40 bc0 bc2 |
| 1574 | if (check_command_matches(command, 0xb40, 0xbc0, 0xbc2, 0x000, 0x000, 0x000, 0x000, 0x000, funcval, funcmask)) |
| 1575 | { |
| 1576 | executed = 1; |
| 1577 | m_LEGACY_cop_collision_info[0].hitbox = space.read_word(cop_regs[2]); |
| 1578 | m_LEGACY_cop_collision_info[0].hitbox_y = space.read_word((cop_regs[2] & 0xffff0000) | (m_LEGACY_cop_collision_info[0].hitbox)); |
| 1579 | m_LEGACY_cop_collision_info[0].hitbox_x = space.read_word(((cop_regs[2] & 0xffff0000) | (m_LEGACY_cop_collision_info[0].hitbox)) + 2); |
| 1580 | |
| 1581 | /* do the math */ |
| 1582 | LEGACY_cop_take_hit_box_params(0); |
| 1583 | cop_hit_status = LEGACY_cop_calculate_collsion_detection(); |
| 1584 | |
| 1585 | return; |
| 1586 | } |
| 1587 | |
| 1588 | if (check_command_matches(command, 0xba0, 0xba2, 0xba4, 0xba6, 0x000, 0x000, 0x000, 0x000, funcval, funcmask)) |
| 1589 | { |
| 1590 | executed = 1; |
| 1591 | m_LEGACY_cop_collision_info[1].y = (space.read_dword(cop_regs[1] + 4)); |
| 1592 | m_LEGACY_cop_collision_info[1].x = (space.read_dword(cop_regs[1] + 8)); |
| 1593 | return; |
| 1594 | } |
| 1595 | |
| 1596 | //(heatbrl) | 6 | ffff | b880 | b60 be0 be2 |
| 1597 | if (check_command_matches(command, 0xb60, 0xbe0, 0xbe2, 0x000, 0x000, 0x000, 0x000, 0x000, funcval, funcmask)) |
| 1598 | { |
| 1599 | executed = 1; |
| 1600 | m_LEGACY_cop_collision_info[1].hitbox = space.read_word(cop_regs[3]); |
| 1601 | m_LEGACY_cop_collision_info[1].hitbox_y = space.read_word((cop_regs[3] & 0xffff0000) | (m_LEGACY_cop_collision_info[1].hitbox)); |
| 1602 | m_LEGACY_cop_collision_info[1].hitbox_x = space.read_word(((cop_regs[3] & 0xffff0000) | (m_LEGACY_cop_collision_info[1].hitbox)) + 2); |
| 1603 | |
| 1604 | /* do the math */ |
| 1605 | LEGACY_cop_take_hit_box_params(1); |
| 1606 | cop_hit_status = LEGACY_cop_calculate_collsion_detection(); |
| 1607 | return; |
| 1608 | } |
| 1609 | |
| 1610 | // grainbow 0d | a | fff3 | 6980 | b80 ba0 |
| 1611 | if (check_command_matches(command, 0xb80, 0xba0, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 10, 0xfff3)) |
| 1612 | { |
| 1613 | executed = 1; |
| 1614 | UINT8 offs; |
| 1615 | int abs_x, abs_y, rel_xy; |
| 1616 | |
| 1617 | offs = (offset & 3) * 4; |
| 1618 | |
| 1619 | /* TODO: I really suspect that following two are actually taken from the 0xa180 macro command then internally loaded */ |
| 1620 | abs_x = space.read_word(cop_regs[0] + 8) - m_cop_sprite_dma_abs_x; |
| 1621 | abs_y = space.read_word(cop_regs[0] + 4) - m_cop_sprite_dma_abs_y; |
| 1622 | rel_xy = space.read_word(m_cop_sprite_dma_src + 4 + offs); |
| 1623 | |
| 1624 | //if(rel_xy & 0x0706) |
| 1625 | // printf("sprite rel_xy = %04x\n",rel_xy); |
| 1626 | |
| 1627 | if (rel_xy & 1) |
| 1628 | space.write_word(cop_regs[4] + offs + 4, 0xc0 + abs_x - (rel_xy & 0xf8)); |
| 1629 | else |
| 1630 | space.write_word(cop_regs[4] + offs + 4, (((rel_xy & 0x78) + (abs_x)-((rel_xy & 0x80) ? 0x80 : 0)))); |
| 1631 | |
| 1632 | space.write_word(cop_regs[4] + offs + 6, (((rel_xy & 0x7800) >> 8) + (abs_y)-((rel_xy & 0x8000) ? 0x80 : 0))); |
| 1633 | return; |
| 1634 | } |
| 1635 | |
| 1636 | // grainbow 18 | a | ff00 | c480 | 080 882 |
| 1637 | if (check_command_matches(command, 0x080, 0x882, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 10, 0xff00)) |
| 1638 | { |
| 1639 | executed = 1; |
| 1640 | UINT8 offs; |
| 1641 | |
| 1642 | offs = (offset & 3) * 4; |
| 1643 | |
| 1644 | space.write_word(cop_regs[4] + offs + 0, space.read_word(m_cop_sprite_dma_src + offs) + (m_cop_sprite_dma_param & 0x3f)); |
| 1645 | //space.write_word(cop_regs[4] + offs + 2,space.read_word(m_cop_sprite_dma_src+2 + offs)); |
| 1646 | return; |
| 1647 | } |
| 1648 | |
| 1649 | // cupsoc 1b | 5 | 7ff7 | dde5 | f80 aa2 984 0c2 |
| 1650 | /* radar x/y positions */ |
| 1651 | /* FIXME: x/ys are offsetted */ |
| 1652 | /* FIXME: uses 0x10044a for something */ |
| 1653 | if (check_command_matches(command, 0xf80, 0xaa2, 0x984, 0x0c2, 0x000, 0x000, 0x000, 0x000, 5, 0x7ff7)) |
| 1654 | { |
| 1655 | executed = 1; |
| 1656 | UINT8 offs; |
| 1657 | int div; |
| 1658 | INT16 dir_offset; |
| 1659 | // INT16 offs_val; |
| 1660 | |
| 1661 | /* TODO: [4-7] could be mirrors of [0-3] (this is the only command so far that uses 4-7 actually)*/ |
| 1662 | /* ? 0 + [4] */ |
| 1663 | /* sub32 4 + [5] */ |
| 1664 | /* write16h 8 + [4] */ |
| 1665 | /* addmem16 4 + [6] */ |
| 1666 | |
| 1667 | // these two are obvious ... |
| 1668 | // 0xf x 16 = 240 |
| 1669 | // 0x14 x 16 = 320 |
| 1670 | // what are these two instead? scale factor? offsets? (edit: offsets to apply from the initial sprite data) |
| 1671 | // 0xfc69 ? |
| 1672 | // 0x7f4 ? |
| 1673 | //printf("%08x %08x %08x %08x %08x %08x %08x\n",cop_regs[0],cop_regs[1],cop_regs[2],cop_regs[3],cop_regs[4],cop_regs[5],cop_regs[6]); |
| 1674 | |
| 1675 | offs = (offset & 3) * 4; |
| 1676 | |
| 1677 | div = space.read_word(cop_regs[4] + offs); |
| 1678 | dir_offset = space.read_word(cop_regs[4] + offs + 8); |
| 1679 | // offs_val = space.read_word(cop_regs[3] + offs); |
| 1680 | //420 / 180 = 500 : 400 = 30 / 50 = 98 / 18 |
| 1681 | |
| 1682 | /* TODO: this probably trips a cop status flag */ |
| 1683 | if (div == 0) { div = 1; } |
| 1684 | |
| 1685 | |
| 1686 | space.write_word((cop_regs[6] + offs + 4), ((space.read_word(cop_regs[5] + offs + 4) + dir_offset) / div)); |
| 1687 | return; |
| 1688 | } |
| 1689 | |
| 1690 | //(cupsoc) | 8 | f3e7 | 6200 | 3a0 3a6 380 aa0 2a6 |
| 1691 | if (check_command_matches(command, 0x3a0, 0x3a6, 0x380, 0xaa0, 0x2a6, 0x000, 0x000, 0x000, 8, 0xf3e7)) |
| 1692 | { |
| 1693 | executed = 1; |
| 1694 | UINT8 cur_angle; |
| 1695 | UINT16 flags; |
| 1696 | |
| 1697 | /* 0 [1] */ |
| 1698 | /* 0xc [1] */ |
| 1699 | /* 0 [0] */ |
| 1700 | /* 0 [1] */ |
| 1701 | /* 0xc [1] */ |
| 1702 | |
| 1703 | cur_angle = space.read_byte(cop_regs[1] + (0xc ^ 3)); |
| 1704 | flags = space.read_word(cop_regs[1]); |
| 1705 | //space.write_byte(cop_regs[1] + (0^3),space.read_byte(cop_regs[1] + (0^3)) & 0xfb); //correct? |
| 1706 | |
| 1707 | m_LEGACY_cop_angle_compare &= 0xff; |
| 1708 | m_LEGACY_cop_angle_mod_val &= 0xff; |
| 1709 | flags &= ~0x0004; |
| 1710 | |
| 1711 | int delta = cur_angle - m_LEGACY_cop_angle_compare; |
| 1712 | if (delta >= 128) |
| 1713 | delta -= 256; |
| 1714 | else if (delta < -128) |
| 1715 | delta += 256; |
| 1716 | if (delta < 0) |
| 1717 | { |
| 1718 | if (delta >= -m_LEGACY_cop_angle_mod_val) |
| 1719 | { |
| 1720 | cur_angle = m_LEGACY_cop_angle_compare; |
| 1721 | flags |= 0x0004; |
| 1722 | } |
| 1723 | else |
| 1724 | cur_angle += m_LEGACY_cop_angle_mod_val; |
| 1725 | } |
| 1726 | else |
| 1727 | { |
| 1728 | if (delta <= m_LEGACY_cop_angle_mod_val) |
| 1729 | { |
| 1730 | cur_angle = m_LEGACY_cop_angle_compare; |
| 1731 | flags |= 0x0004; |
| 1732 | } |
| 1733 | else |
| 1734 | cur_angle -= m_LEGACY_cop_angle_mod_val; |
| 1735 | } |
| 1736 | |
| 1737 | space.write_byte(cop_regs[1] + (0 ^ 2), flags); |
| 1738 | space.write_byte(cop_regs[1] + (0xc ^ 3), cur_angle); |
| 1739 | return; |
| 1740 | } |
| 1741 | |
| 1742 | //(grainbow) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1743 | /* search direction, used on SD Gundam homing weapon */ |
| 1744 | /* FIXME: still doesn't work ... */ |
| 1745 | if (check_command_matches(command, 0x380, 0x39a, 0x380, 0xa80, 0x29a, 0x000, 0x000, 0x000, 8, 0xf3e7)) |
| 1746 | { |
| 1747 | executed = 1; |
| 1748 | UINT8 cur_angle; |
| 1749 | UINT16 flags; |
| 1750 | |
| 1751 | cur_angle = space.read_byte(cop_regs[0] + (0x34 ^ 3)); |
| 1752 | flags = space.read_word(cop_regs[0] + (0 ^ 2)); |
| 1753 | //space.write_byte(cop_regs[1] + (0^3),space.read_byte(cop_regs[1] + (0^3)) & 0xfb); //correct? |
| 1754 | |
| 1755 | m_LEGACY_cop_angle_compare &= 0xff; |
| 1756 | m_LEGACY_cop_angle_mod_val &= 0xff; |
| 1757 | flags &= ~0x0004; |
| 1758 | |
| 1759 | int delta = cur_angle - m_LEGACY_cop_angle_compare; |
| 1760 | if (delta >= 128) |
| 1761 | delta -= 256; |
| 1762 | else if (delta < -128) |
| 1763 | delta += 256; |
| 1764 | if (delta < 0) |
| 1765 | { |
| 1766 | if (delta >= -m_LEGACY_cop_angle_mod_val) |
| 1767 | { |
| 1768 | cur_angle = m_LEGACY_cop_angle_compare; |
| 1769 | flags |= 0x0004; |
| 1770 | } |
| 1771 | else |
| 1772 | cur_angle += m_LEGACY_cop_angle_mod_val; |
| 1773 | } |
| 1774 | else |
| 1775 | { |
| 1776 | if (delta <= m_LEGACY_cop_angle_mod_val) |
| 1777 | { |
| 1778 | cur_angle = m_LEGACY_cop_angle_compare; |
| 1779 | flags |= 0x0004; |
| 1780 | } |
| 1781 | else |
| 1782 | cur_angle -= m_LEGACY_cop_angle_mod_val; |
| 1783 | } |
| 1784 | |
| 1785 | space.write_byte(cop_regs[0] + (0 ^ 3), flags); |
| 1786 | space.write_word(cop_regs[0] + (0x34 ^ 3), cur_angle); |
| 1787 | return; |
| 1788 | } |
| 1789 | |
| 1790 | //(cupsoc) 1c | 5 | b07f | e38e | 984 ac4 d82 ac2 39b b9a b9a a9a |
| 1791 | if (check_command_matches(command, 0x984, 0xac4, 0xd82, 0xac2, 0x39b, 0xb9a, 0xb9a, 0xa9a, 5, 0xb07f)) |
| 1792 | { |
| 1793 | executed = 1; |
| 1794 | int dy = space.read_dword(cop_regs[2] + 4) - space.read_dword(cop_regs[0] + 4); |
| 1795 | int dx = space.read_dword(cop_regs[2] + 8) - space.read_dword(cop_regs[0] + 8); |
| 1796 | |
| 1797 | cop_status = 7; |
| 1798 | if (!dx) { |
| 1799 | cop_status |= 0x8000; |
| 1800 | cop_angle = 0; |
| 1801 | } |
| 1802 | else { |
| 1803 | cop_angle = atan(double(dy) / double(dx)) * 128.0 / M_PI; |
| 1804 | if (dx < 0) |
| 1805 | cop_angle += 0x80; |
| 1806 | } |
| 1807 | |
| 1808 | m_LEGACY_r0 = dy; |
| 1809 | m_LEGACY_r1 = dx; |
| 1810 | |
| 1811 | //printf("%d %d %f %04x\n",dx,dy,atan(double(dy)/double(dx)) * 128 / M_PI,cop_angle); |
| 1812 | |
| 1813 | if (data & 0x80) |
| 1814 | space.write_word(cop_regs[0] + (0x34 ^ 2), cop_angle); |
| 1815 | return; |
| 1816 | } |
| 1817 | |
| 1818 | //(cupsoc) 1a | 5 | fffb | d104 | ac2 9e0 0a2 |
| 1819 | /* controls player vs. player collision detection, 0xf105 controls player vs. ball */ |
| 1820 | if (check_command_matches(command, 0xac2, 0x9e0, 0x0a2, 0x000, 0x000, 0x000, 0x000, 0x000, 5, 0xfffb)) |
| 1821 | { |
| 1822 | executed = 1; |
| 1823 | UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base(); |
| 1824 | UINT32 rom_addr = (m_cop_rom_addr_hi << 16 | m_cop_rom_addr_lo) & ~1; |
| 1825 | UINT16 rom_data = (ROM[rom_addr + 0]) | (ROM[rom_addr + 1] << 8); |
| 1826 | |
| 1827 | /* writes to some unemulated COP registers, then puts the result in here, adding a parameter taken from ROM */ |
| 1828 | //space.write_word(cop_regs[0]+(0x44 + offset * 4), rom_data); |
| 1829 | |
| 1830 | printf("%04x%04x %04x %04x\n", m_cop_rom_addr_hi, m_cop_rom_addr_lo, m_cop_rom_addr_unk, rom_data); |
| 1831 | return; |
| 1832 | } |
| 1833 | |
| 1834 | if (executed == 0) printf("did not execute %04x\n", data); |
| 1835 | } |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | |
trunk/src/mame/machine/seicop.c
| r32338 | r32339 | |
| 1 | 1 | |
| 2 | | /* Seibu 'COP' (co-processor) protection |
| 2 | /* |
| 3 | OLD Seibu Cop simulation code. |
| 3 | 4 | |
| 4 | | there appear to be 3 revisions of this protection (based on the external rom) |
| 5 | this is currently only used by the Seibu Cup Soccer BOOTLEG |
| 6 | |
| 7 | */ |
| 5 | 8 | |
| 6 | | COPX-D1 - Seibu Cup Soccer / Olympic Soccer '92 |
| 7 | | - Legionnaire |
| 8 | | COPX-D2 - Heated Barrel |
| 9 | | - Godzilla |
| 10 | | - SD Gundam Sangokushi Rainbow Tairiku Senki |
| 11 | | - Denjin Makai |
| 12 | | - Raiden 2 |
| 13 | | - Raiden DX |
| 14 | | - Zero Team |
| 15 | | COPX-D3 - Raiden 2/DX New (V33 PCB version) |
| 16 | | - New Zero Team |
| 9 | /******************************************************************************************** |
| 17 | 10 | |
| 18 | | COPX / COPX-D2 based games appear to function in a similar way to each other |
| 19 | | while the games using COPX-D3 appears to access the protection device very |
| 20 | | differently to the others. |
| 11 | COPX bootleg simulation |
| 12 | - Seibu Cup Soccer (bootleg) |
| 21 | 13 | |
| 22 | | As this is only the external rom it isn't confirmed that the actual protection |
| 23 | | devices are identical even where the external rom matches. |
| 14 | *******************************************************************************************/ |
| 24 | 15 | |
| 25 | | Protection features include BCD math protection, 'command sequences', DMA. |
| 26 | | memory clearing etc. |
| 27 | | |
| 28 | | it is not confirmed which custom Seibu chip contains the actual co-processor, |
| 29 | | nor if the co-processor is a real MCU with internal code, or a custom designed |
| 30 | | 'blitter' like device. |
| 31 | | |
| 32 | | I suspect that for the earlier games it's part of the COP300 or COP1000 chips, |
| 33 | | for the COPX-D3 based games it's probably inside the system controller SEI333 |
| 34 | | |
| 35 | | the external COP rom is probably used as a lookup for maths operations. |
| 36 | | |
| 37 | | there should probably only be a single cop2_r / cop2_w function, the chip |
| 38 | | looks to be configurable via the table uploaded to |
| 39 | | 0x432 / 0x434 / 0x438 / 0x43a / 0x43c, with 'macro' commands triggered via |
| 40 | | writes to 0x500. |
| 41 | | |
| 42 | | this simulation is incomplete |
| 43 | | |
| 44 | | COP TODO list: |
| 45 | | - collision detection, hitbox parameter is a complete mystery; |
| 46 | | - collision detection, unknown usage of reads at 0x582-0x588; |
| 47 | | - The RNG relies on the master CPU clock cycles, but without accurate waitstate support is |
| 48 | | basically impossible to have a 1:1 matchup. Seibu Cup Soccer Selection for instance should show the |
| 49 | | first match as Germany vs. USA at twilight, right now is Spain vs. Brazil at sunset. |
| 50 | | - (MANY other things that needs to be listed here) |
| 51 | | |
| 52 | | Protection information |
| 53 | | |
| 54 | | ALL games using COPX-D/D2 upload a series of command tables, using the following upload pattern. |
| 55 | | This happens ONCE at startup. |
| 56 | | |
| 57 | | Each table is 8 words long, and the table upload offsets aren't always in sequential order, as |
| 58 | | you can see from this example (cupsocs) it uploads in the following order |
| 59 | | |
| 60 | | 00 - 07, 08 - 0f, 10 - 17, 18 - 1f, 28 - 2f, 60 - 67, 80 - 87, 88 - 8f |
| 61 | | 90 - 97, 98 - 9f, 20 - 27, 30 - 37, 38 - 3f, 40 - 47, 48 - 4f, 68 - 6f |
| 62 | | c0 - c7, a0 - a7, a8 - af, b0 - b7, b8 - bf, c8 - cf, d0 - d7, d8 - df |
| 63 | | e0 - e7, e8 - ef, 50 - 57, 58 - 5f, 78 - 7f, f0 - f7 |
| 64 | | |
| 65 | | table data is never overwritten, and in this case no data is uploaded |
| 66 | | in the 70-77 or f8 - ff region. |
| 67 | | |
| 68 | | It is assumed that the data written before each part of the table is associated |
| 69 | | with that table. |
| 70 | | |
| 71 | | 000620: write data 0205 at offset 003c <- 'trigger' associated with this table |
| 72 | | 000624: write data 0006 at offset 0038 <- 'unknown1 (4-bit)' |
| 73 | | 000628: write data ffeb at offset 003a <- 'unknown2' |
| 74 | | |
| 75 | | 000632: write data 0000 at offset 0034 <- 'table offset' |
| 76 | | 000638: write data 0188 at offset 0032 <- '12-bit data' for this offset |
| 77 | | 000632: write data 0001 at offset 0034 |
| 78 | | 000638: write data 0282 at offset 0032 |
| 79 | | 000632: write data 0002 at offset 0034 |
| 80 | | 000638: write data 0082 at offset 0032 |
| 81 | | 000632: write data 0003 at offset 0034 |
| 82 | | 000638: write data 0b8e at offset 0032 |
| 83 | | 000632: write data 0004 at offset 0034 |
| 84 | | 000638: write data 098e at offset 0032 |
| 85 | | 000632: write data 0005 at offset 0034 |
| 86 | | 000638: write data 0000 at offset 0032 |
| 87 | | 000632: write data 0006 at offset 0034 |
| 88 | | 000638: write data 0000 at offset 0032 |
| 89 | | 000632: write data 0007 at offset 0034 |
| 90 | | 000638: write data 0000 at offset 0032 |
| 91 | | -------------------------------------------- |
| 92 | | 000620: write data 0905 at offset 003c |
| 93 | | 000624: write data 0006 at offset 0038 |
| 94 | | 000628: write data fbfb at offset 003a |
| 95 | | |
| 96 | | 000632: write data 0008 at offset 0034 |
| 97 | | 000638: write data 0194 at offset 0032 |
| 98 | | 000632: write data 0009 at offset 0034 |
| 99 | | 000638: write data 0288 at offset 0032 |
| 100 | | 000632: write data 000a at offset 0034 |
| 101 | | 000638: write data 0088 at offset 0032 |
| 102 | | 000632: write data 000b at offset 0034 |
| 103 | | 000638: write data 0000 at offset 0032 |
| 104 | | 000632: write data 000c at offset 0034 |
| 105 | | 000638: write data 0000 at offset 0032 |
| 106 | | 000632: write data 000d at offset 0034 |
| 107 | | 000638: write data 0000 at offset 0032 |
| 108 | | 000632: write data 000e at offset 0034 |
| 109 | | 000638: write data 0000 at offset 0032 |
| 110 | | 000632: write data 000f at offset 0034 |
| 111 | | 000638: write data 0000 at offset 0032 |
| 112 | | -------------------------------------------- |
| 113 | | 000620: write data 138e at offset 003c |
| 114 | | 000624: write data 0005 at offset 0038 |
| 115 | | 000628: write data bf7f at offset 003a |
| 116 | | |
| 117 | | 000632: write data 0010 at offset 0034 |
| 118 | | 000638: write data 0984 at offset 0032 |
| 119 | | 000632: write data 0011 at offset 0034 |
| 120 | | 000638: write data 0aa4 at offset 0032 |
| 121 | | 000632: write data 0012 at offset 0034 |
| 122 | | 000638: write data 0d82 at offset 0032 |
| 123 | | 000632: write data 0013 at offset 0034 |
| 124 | | 000638: write data 0aa2 at offset 0032 |
| 125 | | 000632: write data 0014 at offset 0034 |
| 126 | | 000638: write data 039b at offset 0032 |
| 127 | | 000632: write data 0015 at offset 0034 |
| 128 | | 000638: write data 0b9a at offset 0032 |
| 129 | | 000632: write data 0016 at offset 0034 |
| 130 | | 000638: write data 0b9a at offset 0032 |
| 131 | | 000632: write data 0017 at offset 0034 |
| 132 | | 000638: write data 0a9a at offset 0032 |
| 133 | | -------------------------------------------- |
| 134 | | 000620: write data 1905 at offset 003c |
| 135 | | 000624: write data 0006 at offset 0038 |
| 136 | | 000628: write data fbfb at offset 003a |
| 137 | | |
| 138 | | 000632: write data 0018 at offset 0034 |
| 139 | | 000638: write data 0994 at offset 0032 |
| 140 | | 000632: write data 0019 at offset 0034 |
| 141 | | 000638: write data 0a88 at offset 0032 |
| 142 | | 000632: write data 001a at offset 0034 |
| 143 | | 000638: write data 0088 at offset 0032 |
| 144 | | 000632: write data 001b at offset 0034 |
| 145 | | 000638: write data 0000 at offset 0032 |
| 146 | | 000632: write data 001c at offset 0034 |
| 147 | | 000638: write data 0000 at offset 0032 |
| 148 | | 000632: write data 001d at offset 0034 |
| 149 | | 000638: write data 0000 at offset 0032 |
| 150 | | 000632: write data 001e at offset 0034 |
| 151 | | 000638: write data 0000 at offset 0032 |
| 152 | | 000632: write data 001f at offset 0034 |
| 153 | | 000638: write data 0000 at offset 0032 |
| 154 | | -------------------------------------------- |
| 155 | | 000620: write data 2a05 at offset 003c |
| 156 | | 000624: write data 0006 at offset 0038 |
| 157 | | 000628: write data ebeb at offset 003a |
| 158 | | |
| 159 | | 000632: write data 0028 at offset 0034 |
| 160 | | 000638: write data 09af at offset 0032 |
| 161 | | 000632: write data 0029 at offset 0034 |
| 162 | | 000638: write data 0a82 at offset 0032 |
| 163 | | 000632: write data 002a at offset 0034 |
| 164 | | 000638: write data 0082 at offset 0032 |
| 165 | | 000632: write data 002b at offset 0034 |
| 166 | | 000638: write data 0a8f at offset 0032 |
| 167 | | 000632: write data 002c at offset 0034 |
| 168 | | 000638: write data 018e at offset 0032 |
| 169 | | 000632: write data 002d at offset 0034 |
| 170 | | 000638: write data 0000 at offset 0032 |
| 171 | | 000632: write data 002e at offset 0034 |
| 172 | | 000638: write data 0000 at offset 0032 |
| 173 | | 000632: write data 002f at offset 0034 |
| 174 | | 000638: write data 0000 at offset 0032 |
| 175 | | -------------------------------------------- |
| 176 | | 000620: write data 6200 at offset 003c |
| 177 | | 000624: write data 0008 at offset 0038 |
| 178 | | 000628: write data f3e7 at offset 003a |
| 179 | | |
| 180 | | 000632: write data 0060 at offset 0034 |
| 181 | | 000638: write data 03a0 at offset 0032 |
| 182 | | 000632: write data 0061 at offset 0034 |
| 183 | | 000638: write data 03a6 at offset 0032 |
| 184 | | 000632: write data 0062 at offset 0034 |
| 185 | | 000638: write data 0380 at offset 0032 |
| 186 | | 000632: write data 0063 at offset 0034 |
| 187 | | 000638: write data 0aa0 at offset 0032 |
| 188 | | 000632: write data 0064 at offset 0034 |
| 189 | | 000638: write data 02a6 at offset 0032 |
| 190 | | 000632: write data 0065 at offset 0034 |
| 191 | | 000638: write data 0000 at offset 0032 |
| 192 | | 000632: write data 0066 at offset 0034 |
| 193 | | 000638: write data 0000 at offset 0032 |
| 194 | | 000632: write data 0067 at offset 0034 |
| 195 | | 000638: write data 0000 at offset 0032 |
| 196 | | -------------------------------------------- |
| 197 | | 000620: write data 8100 at offset 003c |
| 198 | | 000624: write data 0007 at offset 0038 |
| 199 | | 000628: write data fdfb at offset 003a |
| 200 | | |
| 201 | | 000632: write data 0080 at offset 0034 |
| 202 | | 000638: write data 0b9a at offset 0032 |
| 203 | | 000632: write data 0081 at offset 0034 |
| 204 | | 000638: write data 0b88 at offset 0032 |
| 205 | | 000632: write data 0082 at offset 0034 |
| 206 | | 000638: write data 0888 at offset 0032 |
| 207 | | 000632: write data 0083 at offset 0034 |
| 208 | | 000638: write data 0000 at offset 0032 |
| 209 | | 000632: write data 0084 at offset 0034 |
| 210 | | 000638: write data 0000 at offset 0032 |
| 211 | | 000632: write data 0085 at offset 0034 |
| 212 | | 000638: write data 0000 at offset 0032 |
| 213 | | 000632: write data 0086 at offset 0034 |
| 214 | | 000638: write data 0000 at offset 0032 |
| 215 | | 000632: write data 0087 at offset 0034 |
| 216 | | 000638: write data 0000 at offset 0032 |
| 217 | | -------------------------------------------- |
| 218 | | 000620: write data 8900 at offset 003c |
| 219 | | 000624: write data 0007 at offset 0038 |
| 220 | | 000628: write data fdfb at offset 003a |
| 221 | | |
| 222 | | 000632: write data 0088 at offset 0034 |
| 223 | | 000638: write data 0b9a at offset 0032 |
| 224 | | 000632: write data 0089 at offset 0034 |
| 225 | | 000638: write data 0b8a at offset 0032 |
| 226 | | 000632: write data 008a at offset 0034 |
| 227 | | 000638: write data 088a at offset 0032 |
| 228 | | 000632: write data 008b at offset 0034 |
| 229 | | 000638: write data 0000 at offset 0032 |
| 230 | | 000632: write data 008c at offset 0034 |
| 231 | | 000638: write data 0000 at offset 0032 |
| 232 | | 000632: write data 008d at offset 0034 |
| 233 | | 000638: write data 0000 at offset 0032 |
| 234 | | 000632: write data 008e at offset 0034 |
| 235 | | 000638: write data 0000 at offset 0032 |
| 236 | | 000632: write data 008f at offset 0034 |
| 237 | | 000638: write data 0000 at offset 0032 |
| 238 | | -------------------------------------------- |
| 239 | | 000620: write data 9180 at offset 003c |
| 240 | | 000624: write data 0007 at offset 0038 |
| 241 | | 000628: write data f8f7 at offset 003a |
| 242 | | |
| 243 | | 000632: write data 0090 at offset 0034 |
| 244 | | 000638: write data 0b80 at offset 0032 |
| 245 | | 000632: write data 0091 at offset 0034 |
| 246 | | 000638: write data 0b94 at offset 0032 |
| 247 | | 000632: write data 0092 at offset 0034 |
| 248 | | 000638: write data 0b94 at offset 0032 |
| 249 | | 000632: write data 0093 at offset 0034 |
| 250 | | 000638: write data 0894 at offset 0032 |
| 251 | | 000632: write data 0094 at offset 0034 |
| 252 | | 000638: write data 0000 at offset 0032 |
| 253 | | 000632: write data 0095 at offset 0034 |
| 254 | | 000638: write data 0000 at offset 0032 |
| 255 | | 000632: write data 0096 at offset 0034 |
| 256 | | 000638: write data 0000 at offset 0032 |
| 257 | | 000632: write data 0097 at offset 0034 |
| 258 | | 000638: write data 0000 at offset 0032 |
| 259 | | -------------------------------------------- |
| 260 | | 000620: write data 9980 at offset 003c |
| 261 | | 000624: write data 0007 at offset 0038 |
| 262 | | 000628: write data f8f7 at offset 003a |
| 263 | | |
| 264 | | 000632: write data 0098 at offset 0034 |
| 265 | | 000638: write data 0b80 at offset 0032 |
| 266 | | 000632: write data 0099 at offset 0034 |
| 267 | | 000638: write data 0b94 at offset 0032 |
| 268 | | 000632: write data 009a at offset 0034 |
| 269 | | 000638: write data 0b94 at offset 0032 |
| 270 | | 000632: write data 009b at offset 0034 |
| 271 | | 000638: write data 0896 at offset 0032 |
| 272 | | 000632: write data 009c at offset 0034 |
| 273 | | 000638: write data 0000 at offset 0032 |
| 274 | | 000632: write data 009d at offset 0034 |
| 275 | | 000638: write data 0000 at offset 0032 |
| 276 | | 000632: write data 009e at offset 0034 |
| 277 | | 000638: write data 0000 at offset 0032 |
| 278 | | 000632: write data 009f at offset 0034 |
| 279 | | 000638: write data 0000 at offset 0032 |
| 280 | | -------------------------------------------- |
| 281 | | 000620: write data 2288 at offset 003c |
| 282 | | 000624: write data 0005 at offset 0038 |
| 283 | | 000628: write data f5df at offset 003a |
| 284 | | |
| 285 | | 000632: write data 0020 at offset 0034 |
| 286 | | 000638: write data 0f8a at offset 0032 |
| 287 | | 000632: write data 0021 at offset 0034 |
| 288 | | 000638: write data 0b8a at offset 0032 |
| 289 | | 000632: write data 0022 at offset 0034 |
| 290 | | 000638: write data 0388 at offset 0032 |
| 291 | | 000632: write data 0023 at offset 0034 |
| 292 | | 000638: write data 0b9a at offset 0032 |
| 293 | | 000632: write data 0024 at offset 0034 |
| 294 | | 000638: write data 0b9a at offset 0032 |
| 295 | | 000632: write data 0025 at offset 0034 |
| 296 | | 000638: write data 0a9a at offset 0032 |
| 297 | | 000632: write data 0026 at offset 0034 |
| 298 | | 000638: write data 0000 at offset 0032 |
| 299 | | 000632: write data 0027 at offset 0034 |
| 300 | | 000638: write data 0000 at offset 0032 |
| 301 | | -------------------------------------------- |
| 302 | | 000620: write data 338e at offset 003c |
| 303 | | 000624: write data 0005 at offset 0038 |
| 304 | | 000628: write data bf7f at offset 003a |
| 305 | | |
| 306 | | 000632: write data 0030 at offset 0034 |
| 307 | | 000638: write data 0984 at offset 0032 |
| 308 | | 000632: write data 0031 at offset 0034 |
| 309 | | 000638: write data 0aa4 at offset 0032 |
| 310 | | 000632: write data 0032 at offset 0034 |
| 311 | | 000638: write data 0d82 at offset 0032 |
| 312 | | 000632: write data 0033 at offset 0034 |
| 313 | | 000638: write data 0aa2 at offset 0032 |
| 314 | | 000632: write data 0034 at offset 0034 |
| 315 | | 000638: write data 039c at offset 0032 |
| 316 | | 000632: write data 0035 at offset 0034 |
| 317 | | 000638: write data 0b9c at offset 0032 |
| 318 | | 000632: write data 0036 at offset 0034 |
| 319 | | 000638: write data 0b9c at offset 0032 |
| 320 | | 000632: write data 0037 at offset 0034 |
| 321 | | 000638: write data 0a9a at offset 0032 |
| 322 | | -------------------------------------------- |
| 323 | | 000620: write data 3bb0 at offset 003c |
| 324 | | 000624: write data 0004 at offset 0038 |
| 325 | | 000628: write data 007f at offset 003a |
| 326 | | |
| 327 | | 000632: write data 0038 at offset 0034 |
| 328 | | 000638: write data 0f9c at offset 0032 |
| 329 | | 000632: write data 0039 at offset 0034 |
| 330 | | 000638: write data 0b9c at offset 0032 |
| 331 | | 000632: write data 003a at offset 0034 |
| 332 | | 000638: write data 0b9c at offset 0032 |
| 333 | | 000632: write data 003b at offset 0034 |
| 334 | | 000638: write data 0b9c at offset 0032 |
| 335 | | 000632: write data 003c at offset 0034 |
| 336 | | 000638: write data 0b9c at offset 0032 |
| 337 | | 000632: write data 003d at offset 0034 |
| 338 | | 000638: write data 0b9c at offset 0032 |
| 339 | | 000632: write data 003e at offset 0034 |
| 340 | | 000638: write data 0b9c at offset 0032 |
| 341 | | 000632: write data 003f at offset 0034 |
| 342 | | 000638: write data 099c at offset 0032 |
| 343 | | -------------------------------------------- |
| 344 | | 000620: write data 42c2 at offset 003c |
| 345 | | 000624: write data 0005 at offset 0038 |
| 346 | | 000628: write data fcdd at offset 003a |
| 347 | | |
| 348 | | 000632: write data 0040 at offset 0034 |
| 349 | | 000638: write data 0f9a at offset 0032 |
| 350 | | 000632: write data 0041 at offset 0034 |
| 351 | | 000638: write data 0b9a at offset 0032 |
| 352 | | 000632: write data 0042 at offset 0034 |
| 353 | | 000638: write data 0b9c at offset 0032 |
| 354 | | 000632: write data 0043 at offset 0034 |
| 355 | | 000638: write data 0b9c at offset 0032 |
| 356 | | 000632: write data 0044 at offset 0034 |
| 357 | | 000638: write data 0b9c at offset 0032 |
| 358 | | 000632: write data 0045 at offset 0034 |
| 359 | | 000638: write data 029c at offset 0032 |
| 360 | | 000632: write data 0046 at offset 0034 |
| 361 | | 000638: write data 0000 at offset 0032 |
| 362 | | 000632: write data 0047 at offset 0034 |
| 363 | | 000638: write data 0000 at offset 0032 |
| 364 | | -------------------------------------------- |
| 365 | | 000620: write data 4aa0 at offset 003c |
| 366 | | 000624: write data 0005 at offset 0038 |
| 367 | | 000628: write data fcdd at offset 003a |
| 368 | | |
| 369 | | 000632: write data 0048 at offset 0034 |
| 370 | | 000638: write data 0f9a at offset 0032 |
| 371 | | 000632: write data 0049 at offset 0034 |
| 372 | | 000638: write data 0b9a at offset 0032 |
| 373 | | 000632: write data 004a at offset 0034 |
| 374 | | 000638: write data 0b9c at offset 0032 |
| 375 | | 000632: write data 004b at offset 0034 |
| 376 | | 000638: write data 0b9c at offset 0032 |
| 377 | | 000632: write data 004c at offset 0034 |
| 378 | | 000638: write data 0b9c at offset 0032 |
| 379 | | 000632: write data 004d at offset 0034 |
| 380 | | 000638: write data 099b at offset 0032 |
| 381 | | 000632: write data 004e at offset 0034 |
| 382 | | 000638: write data 0000 at offset 0032 |
| 383 | | 000632: write data 004f at offset 0034 |
| 384 | | 000638: write data 0000 at offset 0032 |
| 385 | | -------------------------------------------- |
| 386 | | 000620: write data 6880 at offset 003c |
| 387 | | 000624: write data 000a at offset 0038 |
| 388 | | 000628: write data fff3 at offset 003a |
| 389 | | |
| 390 | | 000632: write data 0068 at offset 0034 |
| 391 | | 000638: write data 0b80 at offset 0032 |
| 392 | | 000632: write data 0069 at offset 0034 |
| 393 | | 000638: write data 0ba0 at offset 0032 |
| 394 | | 000632: write data 006a at offset 0034 |
| 395 | | 000638: write data 0000 at offset 0032 |
| 396 | | 000632: write data 006b at offset 0034 |
| 397 | | 000638: write data 0000 at offset 0032 |
| 398 | | 000632: write data 006c at offset 0034 |
| 399 | | 000638: write data 0000 at offset 0032 |
| 400 | | 000632: write data 006d at offset 0034 |
| 401 | | 000638: write data 0000 at offset 0032 |
| 402 | | 000632: write data 006e at offset 0034 |
| 403 | | 000638: write data 0000 at offset 0032 |
| 404 | | 000632: write data 006f at offset 0034 |
| 405 | | 000638: write data 0000 at offset 0032 |
| 406 | | -------------------------------------------- |
| 407 | | 000620: write data c480 at offset 003c |
| 408 | | 000624: write data 000a at offset 0038 |
| 409 | | 000628: write data ff00 at offset 003a |
| 410 | | |
| 411 | | 000632: write data 00c0 at offset 0034 |
| 412 | | 000638: write data 0080 at offset 0032 |
| 413 | | 000632: write data 00c1 at offset 0034 |
| 414 | | 000638: write data 0882 at offset 0032 |
| 415 | | 000632: write data 00c2 at offset 0034 |
| 416 | | 000638: write data 0000 at offset 0032 |
| 417 | | 000632: write data 00c3 at offset 0034 |
| 418 | | 000638: write data 0000 at offset 0032 |
| 419 | | 000632: write data 00c4 at offset 0034 |
| 420 | | 000638: write data 0000 at offset 0032 |
| 421 | | 000632: write data 00c5 at offset 0034 |
| 422 | | 000638: write data 0000 at offset 0032 |
| 423 | | 000632: write data 00c6 at offset 0034 |
| 424 | | 000638: write data 0000 at offset 0032 |
| 425 | | 000632: write data 00c7 at offset 0034 |
| 426 | | 000638: write data 0000 at offset 0032 |
| 427 | | -------------------------------------------- |
| 428 | | 000620: write data a180 at offset 003c |
| 429 | | 000624: write data 0000 at offset 0038 |
| 430 | | 000628: write data ffff at offset 003a |
| 431 | | |
| 432 | | 000632: write data 00a0 at offset 0034 |
| 433 | | 000638: write data 0b80 at offset 0032 |
| 434 | | 000632: write data 00a1 at offset 0034 |
| 435 | | 000638: write data 0b82 at offset 0032 |
| 436 | | 000632: write data 00a2 at offset 0034 |
| 437 | | 000638: write data 0b84 at offset 0032 |
| 438 | | 000632: write data 00a3 at offset 0034 |
| 439 | | 000638: write data 0b86 at offset 0032 |
| 440 | | 000632: write data 00a4 at offset 0034 |
| 441 | | 000638: write data 0000 at offset 0032 |
| 442 | | 000632: write data 00a5 at offset 0034 |
| 443 | | 000638: write data 0000 at offset 0032 |
| 444 | | 000632: write data 00a6 at offset 0034 |
| 445 | | 000638: write data 0000 at offset 0032 |
| 446 | | 000632: write data 00a7 at offset 0034 |
| 447 | | 000638: write data 0000 at offset 0032 |
| 448 | | -------------------------------------------- |
| 449 | | 000620: write data a980 at offset 003c |
| 450 | | 000624: write data 000f at offset 0038 |
| 451 | | 000628: write data ffff at offset 003a |
| 452 | | |
| 453 | | 000632: write data 00a8 at offset 0034 |
| 454 | | 000638: write data 0ba0 at offset 0032 |
| 455 | | 000632: write data 00a9 at offset 0034 |
| 456 | | 000638: write data 0ba2 at offset 0032 |
| 457 | | 000632: write data 00aa at offset 0034 |
| 458 | | 000638: write data 0ba4 at offset 0032 |
| 459 | | 000632: write data 00ab at offset 0034 |
| 460 | | 000638: write data 0ba6 at offset 0032 |
| 461 | | 000632: write data 00ac at offset 0034 |
| 462 | | 000638: write data 0000 at offset 0032 |
| 463 | | 000632: write data 00ad at offset 0034 |
| 464 | | 000638: write data 0000 at offset 0032 |
| 465 | | 000632: write data 00ae at offset 0034 |
| 466 | | 000638: write data 0000 at offset 0032 |
| 467 | | 000632: write data 00af at offset 0034 |
| 468 | | 000638: write data 0000 at offset 0032 |
| 469 | | -------------------------------------------- |
| 470 | | 000620: write data b100 at offset 003c |
| 471 | | 000624: write data 0009 at offset 0038 |
| 472 | | 000628: write data ffff at offset 003a |
| 473 | | |
| 474 | | 000632: write data 00b0 at offset 0034 |
| 475 | | 000638: write data 0b40 at offset 0032 |
| 476 | | 000632: write data 00b1 at offset 0034 |
| 477 | | 000638: write data 0bc0 at offset 0032 |
| 478 | | 000632: write data 00b2 at offset 0034 |
| 479 | | 000638: write data 0bc2 at offset 0032 |
| 480 | | 000632: write data 00b3 at offset 0034 |
| 481 | | 000638: write data 0000 at offset 0032 |
| 482 | | 000632: write data 00b4 at offset 0034 |
| 483 | | 000638: write data 0000 at offset 0032 |
| 484 | | 000632: write data 00b5 at offset 0034 |
| 485 | | 000638: write data 0000 at offset 0032 |
| 486 | | 000632: write data 00b6 at offset 0034 |
| 487 | | 000638: write data 0000 at offset 0032 |
| 488 | | 000632: write data 00b7 at offset 0034 |
| 489 | | 000638: write data 0000 at offset 0032 |
| 490 | | -------------------------------------------- |
| 491 | | 000620: write data b900 at offset 003c |
| 492 | | 000624: write data 0006 at offset 0038 |
| 493 | | 000628: write data ffff at offset 003a |
| 494 | | |
| 495 | | 000632: write data 00b8 at offset 0034 |
| 496 | | 000638: write data 0b60 at offset 0032 |
| 497 | | 000632: write data 00b9 at offset 0034 |
| 498 | | 000638: write data 0be0 at offset 0032 |
| 499 | | 000632: write data 00ba at offset 0034 |
| 500 | | 000638: write data 0be2 at offset 0032 |
| 501 | | 000632: write data 00bb at offset 0034 |
| 502 | | 000638: write data 0000 at offset 0032 |
| 503 | | 000632: write data 00bc at offset 0034 |
| 504 | | 000638: write data 0000 at offset 0032 |
| 505 | | 000632: write data 00bd at offset 0034 |
| 506 | | 000638: write data 0000 at offset 0032 |
| 507 | | 000632: write data 00be at offset 0034 |
| 508 | | 000638: write data 0000 at offset 0032 |
| 509 | | 000632: write data 00bf at offset 0034 |
| 510 | | 000638: write data 0000 at offset 0032 |
| 511 | | -------------------------------------------- |
| 512 | | 000620: write data cb8f at offset 003c |
| 513 | | 000624: write data 0005 at offset 0038 |
| 514 | | 000628: write data bf7f at offset 003a |
| 515 | | |
| 516 | | 000632: write data 00c8 at offset 0034 |
| 517 | | 000638: write data 0984 at offset 0032 |
| 518 | | 000632: write data 00c9 at offset 0034 |
| 519 | | 000638: write data 0aa4 at offset 0032 |
| 520 | | 000632: write data 00ca at offset 0034 |
| 521 | | 000638: write data 0d82 at offset 0032 |
| 522 | | 000632: write data 00cb at offset 0034 |
| 523 | | 000638: write data 0aa2 at offset 0032 |
| 524 | | 000632: write data 00cc at offset 0034 |
| 525 | | 000638: write data 039b at offset 0032 |
| 526 | | 000632: write data 00cd at offset 0034 |
| 527 | | 000638: write data 0b9a at offset 0032 |
| 528 | | 000632: write data 00ce at offset 0034 |
| 529 | | 000638: write data 0b9a at offset 0032 |
| 530 | | 000632: write data 00cf at offset 0034 |
| 531 | | 000638: write data 0a9f at offset 0032 |
| 532 | | -------------------------------------------- |
| 533 | | 000620: write data d104 at offset 003c |
| 534 | | 000624: write data 0005 at offset 0038 |
| 535 | | 000628: write data fffb at offset 003a |
| 536 | | |
| 537 | | 000632: write data 00d0 at offset 0034 |
| 538 | | 000638: write data 0ac2 at offset 0032 |
| 539 | | 000632: write data 00d1 at offset 0034 |
| 540 | | 000638: write data 09e0 at offset 0032 |
| 541 | | 000632: write data 00d2 at offset 0034 |
| 542 | | 000638: write data 00a2 at offset 0032 |
| 543 | | 000632: write data 00d3 at offset 0034 |
| 544 | | 000638: write data 0000 at offset 0032 |
| 545 | | 000632: write data 00d4 at offset 0034 |
| 546 | | 000638: write data 0000 at offset 0032 |
| 547 | | 000632: write data 00d5 at offset 0034 |
| 548 | | 000638: write data 0000 at offset 0032 |
| 549 | | 000632: write data 00d6 at offset 0034 |
| 550 | | 000638: write data 0000 at offset 0032 |
| 551 | | 000632: write data 00d7 at offset 0034 |
| 552 | | 000638: write data 0000 at offset 0032 |
| 553 | | -------------------------------------------- |
| 554 | | 000620: write data dde5 at offset 003c |
| 555 | | 000624: write data 0005 at offset 0038 |
| 556 | | 000628: write data 7ff7 at offset 003a |
| 557 | | |
| 558 | | 000632: write data 00d8 at offset 0034 |
| 559 | | 000638: write data 0f80 at offset 0032 |
| 560 | | 000632: write data 00d9 at offset 0034 |
| 561 | | 000638: write data 0aa2 at offset 0032 |
| 562 | | 000632: write data 00da at offset 0034 |
| 563 | | 000638: write data 0984 at offset 0032 |
| 564 | | 000632: write data 00db at offset 0034 |
| 565 | | 000638: write data 00c2 at offset 0032 |
| 566 | | 000632: write data 00dc at offset 0034 |
| 567 | | 000638: write data 0000 at offset 0032 |
| 568 | | 000632: write data 00dd at offset 0034 |
| 569 | | 000638: write data 0000 at offset 0032 |
| 570 | | 000632: write data 00de at offset 0034 |
| 571 | | 000638: write data 0000 at offset 0032 |
| 572 | | 000632: write data 00df at offset 0034 |
| 573 | | 000638: write data 0000 at offset 0032 |
| 574 | | -------------------------------------------- |
| 575 | | 000620: write data e38e at offset 003c |
| 576 | | 000624: write data 0005 at offset 0038 |
| 577 | | 000628: write data b07f at offset 003a |
| 578 | | |
| 579 | | 000632: write data 00e0 at offset 0034 |
| 580 | | 000638: write data 0984 at offset 0032 |
| 581 | | 000632: write data 00e1 at offset 0034 |
| 582 | | 000638: write data 0ac4 at offset 0032 |
| 583 | | 000632: write data 00e2 at offset 0034 |
| 584 | | 000638: write data 0d82 at offset 0032 |
| 585 | | 000632: write data 00e3 at offset 0034 |
| 586 | | 000638: write data 0ac2 at offset 0032 |
| 587 | | 000632: write data 00e4 at offset 0034 |
| 588 | | 000638: write data 039b at offset 0032 |
| 589 | | 000632: write data 00e5 at offset 0034 |
| 590 | | 000638: write data 0b9a at offset 0032 |
| 591 | | 000632: write data 00e6 at offset 0034 |
| 592 | | 000638: write data 0b9a at offset 0032 |
| 593 | | 000632: write data 00e7 at offset 0034 |
| 594 | | 000638: write data 0a9a at offset 0032 |
| 595 | | -------------------------------------------- |
| 596 | | 000620: write data eb8e at offset 003c |
| 597 | | 000624: write data 0005 at offset 0038 |
| 598 | | 000628: write data b07f at offset 003a |
| 599 | | |
| 600 | | 000632: write data 00e8 at offset 0034 |
| 601 | | 000638: write data 0984 at offset 0032 |
| 602 | | 000632: write data 00e9 at offset 0034 |
| 603 | | 000638: write data 0ac4 at offset 0032 |
| 604 | | 000632: write data 00ea at offset 0034 |
| 605 | | 000638: write data 0d82 at offset 0032 |
| 606 | | 000632: write data 00eb at offset 0034 |
| 607 | | 000638: write data 0ac2 at offset 0032 |
| 608 | | 000632: write data 00ec at offset 0034 |
| 609 | | 000638: write data 039b at offset 0032 |
| 610 | | 000632: write data 00ed at offset 0034 |
| 611 | | 000638: write data 0b9a at offset 0032 |
| 612 | | 000632: write data 00ee at offset 0034 |
| 613 | | 000638: write data 0b9a at offset 0032 |
| 614 | | 000632: write data 00ef at offset 0034 |
| 615 | | 000638: write data 0a9f at offset 0032 |
| 616 | | -------------------------------------------- |
| 617 | | 000620: write data 5105 at offset 003c |
| 618 | | 000624: write data 0005 at offset 0038 |
| 619 | | 000628: write data fefb at offset 003a |
| 620 | | |
| 621 | | 000632: write data 0050 at offset 0034 |
| 622 | | 000638: write data 0a80 at offset 0032 |
| 623 | | 000632: write data 0051 at offset 0034 |
| 624 | | 000638: write data 0984 at offset 0032 |
| 625 | | 000632: write data 0052 at offset 0034 |
| 626 | | 000638: write data 0082 at offset 0032 |
| 627 | | 000632: write data 0053 at offset 0034 |
| 628 | | 000638: write data 0000 at offset 0032 |
| 629 | | 000632: write data 0054 at offset 0034 |
| 630 | | 000638: write data 0000 at offset 0032 |
| 631 | | 000632: write data 0055 at offset 0034 |
| 632 | | 000638: write data 0000 at offset 0032 |
| 633 | | 000632: write data 0056 at offset 0034 |
| 634 | | 000638: write data 0000 at offset 0032 |
| 635 | | 000632: write data 0057 at offset 0034 |
| 636 | | 000638: write data 0000 at offset 0032 |
| 637 | | -------------------------------------------- |
| 638 | | 000620: write data 5905 at offset 003c |
| 639 | | 000624: write data 0005 at offset 0038 |
| 640 | | 000628: write data fffb at offset 003a |
| 641 | | |
| 642 | | 000632: write data 0058 at offset 0034 |
| 643 | | 000638: write data 09c8 at offset 0032 |
| 644 | | 000632: write data 0059 at offset 0034 |
| 645 | | 000638: write data 0a84 at offset 0032 |
| 646 | | 000632: write data 005a at offset 0034 |
| 647 | | 000638: write data 00a2 at offset 0032 |
| 648 | | 000632: write data 005b at offset 0034 |
| 649 | | 000638: write data 0000 at offset 0032 |
| 650 | | 000632: write data 005c at offset 0034 |
| 651 | | 000638: write data 0000 at offset 0032 |
| 652 | | 000632: write data 005d at offset 0034 |
| 653 | | 000638: write data 0000 at offset 0032 |
| 654 | | 000632: write data 005e at offset 0034 |
| 655 | | 000638: write data 0000 at offset 0032 |
| 656 | | 000632: write data 005f at offset 0034 |
| 657 | | 000638: write data 0000 at offset 0032 |
| 658 | | -------------------------------------------- |
| 659 | | 000620: write data 7905 at offset 003c |
| 660 | | 000624: write data 0006 at offset 0038 |
| 661 | | 000628: write data fffb at offset 003a |
| 662 | | |
| 663 | | 000632: write data 0078 at offset 0034 |
| 664 | | 000638: write data 01a2 at offset 0032 |
| 665 | | 000632: write data 0079 at offset 0034 |
| 666 | | 000638: write data 02c2 at offset 0032 |
| 667 | | 000632: write data 007a at offset 0034 |
| 668 | | 000638: write data 00a2 at offset 0032 |
| 669 | | 000632: write data 007b at offset 0034 |
| 670 | | 000638: write data 0000 at offset 0032 |
| 671 | | 000632: write data 007c at offset 0034 |
| 672 | | 000638: write data 0000 at offset 0032 |
| 673 | | 000632: write data 007d at offset 0034 |
| 674 | | 000638: write data 0000 at offset 0032 |
| 675 | | 000632: write data 007e at offset 0034 |
| 676 | | 000638: write data 0000 at offset 0032 |
| 677 | | 000632: write data 007f at offset 0034 |
| 678 | | 000638: write data 0000 at offset 0032 |
| 679 | | -------------------------------------------- |
| 680 | | 000620: write data f105 at offset 003c |
| 681 | | 000624: write data 0005 at offset 0038 |
| 682 | | 000628: write data fefb at offset 003a |
| 683 | | |
| 684 | | 000632: write data 00f0 at offset 0034 |
| 685 | | 000638: write data 0a88 at offset 0032 |
| 686 | | 000632: write data 00f1 at offset 0034 |
| 687 | | 000638: write data 0994 at offset 0032 |
| 688 | | 000632: write data 00f2 at offset 0034 |
| 689 | | 000638: write data 0088 at offset 0032 |
| 690 | | 000632: write data 00f3 at offset 0034 |
| 691 | | 000638: write data 0000 at offset 0032 |
| 692 | | 000632: write data 00f4 at offset 0034 |
| 693 | | 000638: write data 0000 at offset 0032 |
| 694 | | 000632: write data 00f5 at offset 0034 |
| 695 | | 000638: write data 0000 at offset 0032 |
| 696 | | 000632: write data 00f6 at offset 0034 |
| 697 | | 000638: write data 0000 at offset 0032 |
| 698 | | 000632: write data 00f7 at offset 0034 |
| 699 | | 000638: write data 0000 at offset 0032 |
| 700 | | |
| 701 | | These uploads appear to form the basis of one part of the protection; command lists. |
| 702 | | |
| 703 | | The games upload these tables |
| 704 | | |
| 705 | | cupsoc, cupsoca, cupsocs, cupsocs2, olysoc92 |
| 706 | | t u1 u2 trg tbl |
| 707 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 708 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 709 | | 02 | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 710 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 711 | | 04 | 5 | f5df | 2288 | f8a b8a 388 b9a b9a a9a |
| 712 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 713 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 714 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 715 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 716 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 717 | | 0a | 5 | fefb | 5105 | a80 984 082 |
| 718 | | 0b | 5 | fffb | 5905 | 9c8 a84 0a2 |
| 719 | | 0c | 8 | f3e7 | 6200 | 3a0 3a6 380 aa0 2a6 |
| 720 | | 0d | a | fff3 | 6880 | b80 ba0 |
| 721 | | 0e | 0 | 0000 | 0000 | |
| 722 | | 0f | 6 | fffb | 7905 | 1a2 2c2 0a2 |
| 723 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 724 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 725 | | 12 | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 726 | | 13 | 7 | f8f7 | 9980 | b80 b94 b94 896 |
| 727 | | 14 | 0 | ffff | a180 | b80 b82 b84 b86 |
| 728 | | 15 | f | ffff | a980 | ba0 ba2 ba4 ba6 |
| 729 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 730 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 731 | | 18 | a | ff00 | c480 | 080 882 |
| 732 | | 19 | 5 | bf7f | cb8f | 984 aa4 d82 aa2 39b b9a b9a a9f |
| 733 | | 1a | 5 | fffb | d104 | ac2 9e0 0a2 |
| 734 | | 1b | 5 | 7ff7 | dde5 | f80 aa2 984 0c2 |
| 735 | | 1c | 5 | b07f | e38e | 984 ac4 d82 ac2 39b b9a b9a a9a |
| 736 | | 1d | 5 | b07f | eb8e | 984 ac4 d82 ac2 39b b9a b9a a9f |
| 737 | | 1e | 5 | fefb | f105 | a88 994 088 |
| 738 | | 1f | 0 | 0000 | 0000 | |
| 739 | | |
| 740 | | heatbrl, heatbrl2, heatbrlo, heatbrlu |
| 741 | | t u1 u2 trg tbl |
| 742 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 743 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 744 | | 02 | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a |
| 745 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 746 | | 04 | 5 | f5df | 2288 | f8a b8a 388 b9c b9a a9a |
| 747 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 748 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 749 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 750 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 751 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 752 | | 0a | 0 | 0000 | 0000 | |
| 753 | | 0b | 0 | 0000 | 0000 | |
| 754 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 755 | | 0d | a | fff3 | 6880 | b80 ba0 |
| 756 | | 0e | 0 | 0000 | 0000 | |
| 757 | | 0f | 0 | 0000 | 0000 | |
| 758 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 759 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 760 | | 12 | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 761 | | 13 | 7 | f8f7 | 9980 | b80 b96 b96 896 |
| 762 | | 14 | 0 | ffff | a100 | b80 b82 b84 b86 |
| 763 | | 15 | f | ffff | a900 | ba0 ba2 ba4 ba6 |
| 764 | | 16 | 9 | ffff | b080 | b40 bc0 bc2 |
| 765 | | 17 | 6 | ffff | b880 | b60 be0 be2 |
| 766 | | 18 | a | ff00 | c480 | 080 882 |
| 767 | | 19 | 0 | 0000 | 0000 | |
| 768 | | 1a | 0 | 0000 | 0000 | |
| 769 | | 1b | 0 | 0000 | 0000 | |
| 770 | | 1c | 0 | 0000 | 0000 | |
| 771 | | 1d | 0 | 0000 | 0000 | |
| 772 | | 1e | 0 | 0000 | 0000 | |
| 773 | | 1f | 0 | 0000 | 0000 | |
| 774 | | |
| 775 | | legionna, legionnau (commands are the same as heatbrl, triggers are different) |
| 776 | | t u1 u2 trg tbl |
| 777 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 778 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 779 | | 02 | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a |
| 780 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 781 | | 04 | 5 | f5df | 2288 | f8a b8a 388 b9c b9a a9a |
| 782 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 783 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 784 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 785 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 786 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 787 | | 0a | 0 | 0000 | 0000 | |
| 788 | | 0b | 0 | 0000 | 0000 | |
| 789 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 790 | | 0d | a | fff3 | 6880 | b80 ba0 |
| 791 | | 0e | 0 | 0000 | 0000 | |
| 792 | | 0f | 0 | 0000 | 0000 | |
| 793 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 794 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 795 | | 12 | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 796 | | 13 | 7 | f8f7 | 9980 | b80 b96 b96 896 |
| 797 | | 14 | 0 | ffff | a180 | b80 b82 b84 b86 |
| 798 | | 15 | f | ffff | a980 | ba0 ba2 ba4 ba6 |
| 799 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 800 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 801 | | 18 | a | ff00 | c480 | 080 882 |
| 802 | | 19 | 0 | 0000 | 0000 | |
| 803 | | 1a | 0 | 0000 | 0000 | |
| 804 | | 1b | 0 | 0000 | 0000 | |
| 805 | | 1c | 0 | 0000 | 0000 | |
| 806 | | 1d | 0 | 0000 | 0000 | |
| 807 | | 1e | 0 | 0000 | 0000 | |
| 808 | | 1f | 0 | 0000 | 0000 | |
| 809 | | |
| 810 | | godzilla, denjinmk |
| 811 | | (denjinmk doesn't actually make use of the table, it never writes to the execute trigger) |
| 812 | | t u1 u2 trg tbl |
| 813 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 814 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 815 | | 02 | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 816 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 817 | | 04 | 5 | f5df | 2288 | f8a b8a 388 b9a b9a a9a |
| 818 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 819 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 820 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 821 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 822 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 823 | | 0a | 0 | 0000 | 0000 | |
| 824 | | 0b | 0 | 0000 | 0000 | |
| 825 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 826 | | 0d | a | fff3 | 6880 | b80 ba0 |
| 827 | | 0e | 0 | 0000 | 0000 | |
| 828 | | 0f | 0 | 0000 | 0000 | |
| 829 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 830 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 831 | | 12 | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 832 | | 13 | 7 | f8f7 | 9980 | b80 b94 b94 896 |
| 833 | | 14 | 0 | ffff | a180 | b80 b82 b84 b86 |
| 834 | | 15 | f | ffff | a980 | ba0 ba2 ba4 ba6 |
| 835 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 836 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 837 | | 18 | a | ff00 | c480 | 080 882 |
| 838 | | 19 | 0 | 0000 | 0000 | |
| 839 | | 1a | 0 | 0000 | 0000 | |
| 840 | | 1b | 0 | 0000 | 0000 | |
| 841 | | 1c | 0 | 0000 | 0000 | |
| 842 | | 1d | 0 | 0000 | 0000 | |
| 843 | | 1e | 0 | 0000 | 0000 | |
| 844 | | 1f | 0 | 0000 | 0000 | |
| 845 | | |
| 846 | | grainbow |
| 847 | | t u1 u2 trg tbl |
| 848 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 849 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 850 | | 02 | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 851 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 852 | | 04 | 5 | f5df | 2288 | f8a b8a 388 b9a b9a a9a |
| 853 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 854 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 855 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 856 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 857 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 858 | | 0a | 5 | fefb | 5105 | a80 984 082 |
| 859 | | 0b | 5 | fffb | 5905 | 9c8 a84 0a2 |
| 860 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 861 | | 0d | a | fff3 | 6980 | b80 ba0 |
| 862 | | 0e | 0 | 0000 | 0000 | |
| 863 | | 0f | 6 | fffb | 7905 | 1a2 2c2 0a2 |
| 864 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 865 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 866 | | 12 | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 867 | | 13 | 7 | f8f7 | 9980 | b80 b94 b94 896 |
| 868 | | 14 | 0 | 02ff | a180 | b80 b82 b84 b86 |
| 869 | | 15 | f | 02ff | a980 | ba0 ba2 ba4 ba6 |
| 870 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 871 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 872 | | 18 | a | ff00 | c480 | 080 882 |
| 873 | | 19 | 5 | bf7f | cb8f | 984 aa4 d82 aa2 39b b9a b9a a9f |
| 874 | | 1a | 5 | fffb | d104 | ac2 9e0 0a2 |
| 875 | | 1b | 5 | 7ff7 | dde5 | f80 aa2 984 0c2 |
| 876 | | 1c | 5 | b07f | e38e | 984 ac4 d82 ac2 39b b9a b9a a9a |
| 877 | | 1d | 5 | b07f | eb8e | 984 ac4 d82 ac2 39b b9a b9a a9f |
| 878 | | 1e | 5 | fefb | f105 | a88 994 088 |
| 879 | | 1f | 0 | 0000 | 0000 | |
| 880 | | |
| 881 | | raiden2, raiden2a, raiden2b, raiden2c, raiden2d, raiden2e, raiden2f |
| 882 | | t u1 u2 trg tbl |
| 883 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 884 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 885 | | 02 | 5 | bf7f | 130e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 886 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 887 | | 04 | 5 | f5df | 2208 | f8a b8a 388 b9a b9a a9a |
| 888 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 889 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 890 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 891 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 892 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 893 | | 0a | 6 | fff7 | 5205 | 180 2e0 3a0 0a0 3a0 |
| 894 | | 0b | 6 | fff7 | 5a05 | 180 2e0 3a0 0a0 3a0 |
| 895 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 896 | | 0d | 0 | 0000 | 0000 | |
| 897 | | 0e | 0 | 0000 | 0000 | |
| 898 | | 0f | 0 | 0000 | 0000 | |
| 899 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 900 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 901 | | 12 | 7 | fefb | 9100 | b80 b94 894 |
| 902 | | 13 | 7 | fefb | 9900 | b80 b94 896 |
| 903 | | 14 | 0 | 00ff | a100 | b80 b82 b84 b86 |
| 904 | | 15 | f | 00ff | a900 | ba0 ba2 ba4 ba6 |
| 905 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 906 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 907 | | 18 | 0 | 0000 | 0000 | |
| 908 | | 19 | 0 | 0000 | 0000 | |
| 909 | | 1a | 0 | 0000 | 0000 | |
| 910 | | 1b | 0 | 0000 | 0000 | |
| 911 | | 1c | 0 | 0000 | 0000 | |
| 912 | | 1d | 0 | 0000 | 0000 | |
| 913 | | 1e | 6 | fff7 | f205 | 182 2e0 3c0 0c0 3c0 |
| 914 | | 1f | 0 | 0000 | 0000 | |
| 915 | | |
| 916 | | raidndx, raidndxj, raidndxm, raidndxt |
| 917 | | (the same as raiden2, but adds an extra command with trigger 7e05) |
| 918 | | t u1 u2 trg tbl |
| 919 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 920 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 921 | | 02 | 5 | bf7f | 130e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 922 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 923 | | 04 | 5 | f5df | 2208 | f8a b8a 388 b9a b9a a9a |
| 924 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 925 | | 06 | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 926 | | 07 | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 927 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 928 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 929 | | 0a | 6 | fff7 | 5205 | 180 2e0 3a0 0a0 3a0 |
| 930 | | 0b | 6 | fff7 | 5a05 | 180 2e0 3a0 0a0 3a0 |
| 931 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 932 | | 0d | 0 | 0000 | 0000 | |
| 933 | | 0e | 0 | 0000 | 0000 | |
| 934 | | 0f | 6 | fffb | 7e05 | 180 282 080 180 282 |
| 935 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 936 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 937 | | 12 | 7 | fefb | 9100 | b80 b94 894 |
| 938 | | 13 | 7 | fefb | 9900 | b80 b94 896 |
| 939 | | 14 | 0 | 00ff | a100 | b80 b82 b84 b86 |
| 940 | | 15 | f | 00ff | a900 | ba0 ba2 ba4 ba6 |
| 941 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 942 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 943 | | 18 | 0 | 0000 | 0000 | |
| 944 | | 19 | 0 | 0000 | 0000 | |
| 945 | | 1a | 0 | 0000 | 0000 | |
| 946 | | 1b | 0 | 0000 | 0000 | |
| 947 | | 1c | 0 | 0000 | 0000 | |
| 948 | | 1d | 0 | 0000 | 0000 | |
| 949 | | 1e | 6 | fff7 | f205 | 182 2e0 3c0 0c0 3c0 |
| 950 | | 1f | 0 | 0000 | 0000 | |
| 951 | | |
| 952 | | |
| 953 | | zeroteam, zeroteama, zeroteamb, zeroteamc, zeroteams, xsedae |
| 954 | | t u1 u2 trg tbl |
| 955 | | 00 | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 956 | | 01 | 6 | fbfb | 0905 | 194 288 088 |
| 957 | | 02 | 5 | bf7f | 130e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 958 | | 03 | 6 | fbfb | 1905 | 994 a88 088 |
| 959 | | 04 | 5 | f5df | 2208 | f8a b8a 388 b9a b9a a9a |
| 960 | | 05 | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 961 | | 06 | 5 | bf7f | 330e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 962 | | 07 | 4 | 007f | 3b30 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 963 | | 08 | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 964 | | 09 | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 965 | | 0a | 6 | fffb | 5105 | 180 2e0 0a0 |
| 966 | | 0b | 6 | ffdb | 5a85 | 180 2e0 0a0 182 2e0 0c0 3c0 |
| 967 | | 0c | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 968 | | 0d | a | fff3 | 6980 | b80 ba0 |
| 969 | | 0e | 8 | fdfd | 7100 | b80 a80 b80 |
| 970 | | 0f | 0 | 0000 | 0000 | |
| 971 | | 10 | 7 | fdfb | 8100 | b9a b88 888 |
| 972 | | 11 | 7 | fdfb | 8900 | b9a b8a 88a |
| 973 | | 12 | 7 | f8f7 | 9100 | b80 b94 b94 894 |
| 974 | | 13 | 7 | f8f7 | 9900 | b80 b94 b94 896 |
| 975 | | 14 | 0 | ffff | a100 | b80 b82 b84 b86 |
| 976 | | 15 | f | ffff | a900 | ba0 ba2 ba4 ba6 |
| 977 | | 16 | 9 | ffff | b100 | b40 bc0 bc2 |
| 978 | | 17 | 6 | ffff | b900 | b60 be0 be2 |
| 979 | | 18 | a | ff00 | 7c80 | 080 882 |
| 980 | | 19 | 0 | 0000 | 0000 | |
| 981 | | 1a | 0 | 0000 | 0000 | |
| 982 | | 1b | 0 | 0000 | 0000 | |
| 983 | | 1c | 5 | 06fb | e105 | a88 994 088 |
| 984 | | 1d | 5 | 05f7 | ede5 | f88 a84 986 08a |
| 985 | | 1e | 4 | 00ff | f790 | f80 b84 b84 b84 b84 b84 b84 b84 |
| 986 | | 1f | 6 | 00ff | fc84 | 182 280 |
| 987 | | |
| 988 | | as you can see, there are a lot of command 'command lists' between the games. |
| 989 | | (todo, comment ones which seem to have a known function) |
| 990 | | |
| 991 | | executing these seems to cause various operations to occur, be it memory transfer, collision checking, or movement checking. |
| 992 | | |
| 993 | | each 12-bit entry in the tables is probably some kind of 'opcode' which runs and processes data placed in registers / memory. |
| 994 | | |
| 995 | | If we rearrange these tables a bit, so that we can see which are common between games we get the following, take note of |
| 996 | | the ones with slight changes, these could be important to figuring out how this works! |
| 997 | | |
| 998 | | |
| 999 | | Game |u1 |u2 | trig | macrolist |
| 1000 | | |
| 1001 | | Table 00 - Same on All games |
| 1002 | | (grainbow) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1003 | | (cupsoc) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1004 | | (legionna) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1005 | | (godzilla) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1006 | | (heatbrl) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1007 | | (zeroteam) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1008 | | (raiden2) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1009 | | (raidndx) | 6 | ffeb | 0205 | 188 282 082 b8e 98e |
| 1010 | | |
| 1011 | | Table 01 - Same on All games |
| 1012 | | (grainbow) | 6 | fbfb | 0905 | 194 288 088 |
| 1013 | | (cupsoc) | 6 | fbfb | 0905 | 194 288 088 |
| 1014 | | (legionna) | 6 | fbfb | 0905 | 194 288 088 |
| 1015 | | (godzilla) | 6 | fbfb | 0905 | 194 288 088 |
| 1016 | | (heatbrl) | 6 | fbfb | 0905 | 194 288 088 |
| 1017 | | (zeroteam) | 6 | fbfb | 0905 | 194 288 088 |
| 1018 | | (raiden2) | 6 | fbfb | 0905 | 194 288 088 |
| 1019 | | (raidndx) | 6 | fbfb | 0905 | 194 288 088 |
| 1020 | | |
| 1021 | | Table 02 - grainbow and heatbrl have different last entry. triggers differ on v30 hw |
| 1022 | | (grainbow) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a |
| 1023 | | (cupsoc) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 1024 | | (legionna) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 1025 | | (godzilla) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 1026 | | (heatbrl) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a |
| 1027 | | (zeroteam) | 5 | bf7f | 130e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 1028 | | (raiden2) | 5 | bf7f | 130e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 1029 | | (raidndx) | 5 | bf7f | 130e | 984 aa4 d82 aa2 39b b9a b9a a9a |
| 1030 | | |
| 1031 | | Table 03 - Same on All games |
| 1032 | | (grainbow) | 6 | fbfb | 1905 | 994 a88 088 |
| 1033 | | (cupsoc) | 6 | fbfb | 1905 | 994 a88 088 |
| 1034 | | (legionna) | 6 | fbfb | 1905 | 994 a88 088 |
| 1035 | | (godzilla) | 6 | fbfb | 1905 | 994 a88 088 |
| 1036 | | (heatbrl) | 6 | fbfb | 1905 | 994 a88 088 |
| 1037 | | (zeroteam) | 6 | fbfb | 1905 | 994 a88 088 |
| 1038 | | (raiden2) | 6 | fbfb | 1905 | 994 a88 088 |
| 1039 | | (raidndx) | 6 | fbfb | 1905 | 994 a88 088 |
| 1040 | | |
| 1041 | | Table 04 - grainbow and heatbrl have a b9c in the 4th slot, triggers differ on v30 hw |
| 1042 | | (grainbow) | 5 | f5df | 2288 | f8a b8a 388 b9c b9a a9a |
| 1043 | | (cupsoc) | 5 | f5df | 2288 | f8a b8a 388 b9a b9a a9a |
| 1044 | | (legionna) | 5 | f5df | 2288 | f8a b8a 388 b9a b9a a9a |
| 1045 | | (godzilla) | 5 | f5df | 2288 | f8a b8a 388 b9a b9a a9a |
| 1046 | | (heatbrl) | 5 | f5df | 2288 | f8a b8a 388 b9c b9a a9a |
| 1047 | | (zeroteam) | 5 | f5df | 2208 | f8a b8a 388 b9a b9a a9a |
| 1048 | | (raiden2) | 5 | f5df | 2208 | f8a b8a 388 b9a b9a a9a |
| 1049 | | (raidndx) | 5 | f5df | 2208 | f8a b8a 388 b9a b9a a9a |
| 1050 | | |
| 1051 | | Table 05 - Same on All games |
| 1052 | | (grainbow) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1053 | | (cupsoc) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1054 | | (legionna) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1055 | | (godzilla) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1056 | | (heatbrl) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1057 | | (zeroteam) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1058 | | (raiden2) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1059 | | (raidndx) | 6 | ebeb | 2a05 | 9af a82 082 a8f 18e |
| 1060 | | |
| 1061 | | Table 06 - different trigger on zeroteam (330e) |
| 1062 | | (grainbow) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1063 | | (cupsoc) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1064 | | (legionna) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1065 | | (godzilla) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1066 | | (heatbrl) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1067 | | (zeroteam) | 5 | bf7f | 330e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1068 | | (raiden2) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1069 | | (raidndx) | 5 | bf7f | 338e | 984 aa4 d82 aa2 39c b9c b9c a9a |
| 1070 | | |
| 1071 | | Table 07 - different trigger on zeroteam (3b30) |
| 1072 | | (grainbow) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1073 | | (cupsoc) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1074 | | (legionna) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1075 | | (godzilla) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1076 | | (heatbrl) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1077 | | (zeroteam) | 4 | 007f | 3b30 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1078 | | (raiden2) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1079 | | (raidndx) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 1080 | | |
| 1081 | | Table 08 - Same on All games |
| 1082 | | (grainbow) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1083 | | (cupsoc) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1084 | | (legionna) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1085 | | (godzilla) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1086 | | (heatbrl) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1087 | | (zeroteam) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1088 | | (raiden2) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1089 | | (raidndx) | 5 | fcdd | 42c2 | f9a b9a b9c b9c b9c 29c |
| 1090 | | |
| 1091 | | Table 09 - Same on All games |
| 1092 | | (grainbow) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1093 | | (cupsoc) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1094 | | (legionna) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1095 | | (godzilla) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1096 | | (heatbrl) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1097 | | (zeroteam) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1098 | | (raiden2) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1099 | | (raidndx) | 5 | fcdd | 4aa0 | f9a b9a b9c b9c b9c 99b |
| 1100 | | |
| 1101 | | Table 0a - Game specific |
| 1102 | | (grainbow) | 5 | fefb | 5105 | a80 984 082 |
| 1103 | | (cupsoc) | 5 | fefb | 5105 | a80 984 082 |
| 1104 | | (legionna) | 0 | 0000 | 0000 | |
| 1105 | | (godzilla) | 0 | 0000 | 0000 | |
| 1106 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1107 | | (zeroteam) | 6 | fffb | 5105 | 180 2e0 0a0 |
| 1108 | | (raiden2) | 6 | fff7 | 5205 | 180 2e0 3a0 0a0 3a0 |
| 1109 | | (raidndx) | 6 | fff7 | 5205 | 180 2e0 3a0 0a0 3a0 |
| 1110 | | |
| 1111 | | Table 0b - Game specific |
| 1112 | | (grainbow) | 5 | fffb | 5905 | 9c8 a84 0a2 |
| 1113 | | (cupsoc) | 5 | fffb | 5905 | 9c8 a84 0a2 |
| 1114 | | (legionna) | 0 | 0000 | 0000 | |
| 1115 | | (godzilla) | 0 | 0000 | 0000 | |
| 1116 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1117 | | (zeroteam) | 6 | ffdb | 5a85 | 180 2e0 0a0 182 2e0 0c0 3c0 |
| 1118 | | (raiden2) | 6 | fff7 | 5a05 | 180 2e0 3a0 0a0 3a0 |
| 1119 | | (raidndx) | 6 | fff7 | 5a05 | 180 2e0 3a0 0a0 3a0 |
| 1120 | | |
| 1121 | | Table 0c - cupsoc has various modifications |
| 1122 | | notice how *80 is replaced by *a0 and *9a is replaced with *a6, maybe it has the same function, but on different registers? |
| 1123 | | (grainbow) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1124 | | (cupsoc) | 8 | f3e7 | 6200 | 3a0 3a6 380 aa0 2a6 |
| 1125 | | (legionna) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1126 | | (godzilla) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1127 | | (heatbrl) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1128 | | (zeroteam) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1129 | | (raiden2) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1130 | | (raidndx) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 1131 | | |
| 1132 | | Table 0d - Zero team uses different trigger, doesn't exist on raiden2/dx |
| 1133 | | (grainbow) | a | fff3 | 6980 | b80 ba0 |
| 1134 | | (cupsoc) | a | fff3 | 6880 | b80 ba0 |
| 1135 | | (legionna) | a | fff3 | 6880 | b80 ba0 |
| 1136 | | (godzilla) | a | fff3 | 6880 | b80 ba0 |
| 1137 | | (heatbrl) | a | fff3 | 6880 | b80 ba0 |
| 1138 | | (zeroteam) | a | fff3 | 6980 | b80 ba0 |
| 1139 | | (raiden2) | 0 | 0000 | 0000 | |
| 1140 | | (raidndx) | 0 | 0000 | 0000 | |
| 1141 | | |
| 1142 | | Table 0e - Zero Team only |
| 1143 | | (grainbow) | 0 | 0000 | 0000 | |
| 1144 | | (cupsoc) | 0 | 0000 | 0000 | |
| 1145 | | (legionna) | 0 | 0000 | 0000 | |
| 1146 | | (godzilla) | 0 | 0000 | 0000 | |
| 1147 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1148 | | (zeroteam) | 8 | fdfd | 7100 | b80 a80 b80 |
| 1149 | | (raiden2) | 0 | 0000 | 0000 | |
| 1150 | | (raidndx) | 0 | 0000 | 0000 | |
| 1151 | | |
| 1152 | | Table 0f - Same on grainbow/cupsoc, different on raidndx (added compared to raiden2) |
| 1153 | | (grainbow) | 6 | fffb | 7905 | 1a2 2c2 0a2 |
| 1154 | | (cupsoc) | 6 | fffb | 7905 | 1a2 2c2 0a2 |
| 1155 | | (legionna) | 0 | 0000 | 0000 | |
| 1156 | | (godzilla) | 0 | 0000 | 0000 | |
| 1157 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1158 | | (zeroteam) | 0 | 0000 | 0000 | |
| 1159 | | (raiden2) | 0 | 0000 | 0000 | |
| 1160 | | (raidndx) | 6 | fffb | 7e05 | 180 282 080 180 282 |
| 1161 | | |
| 1162 | | Table 10 - Same on all games |
| 1163 | | (grainbow) | 7 | fdfb | 8100 | b9a b88 888 |
| 1164 | | (cupsoc) | 7 | fdfb | 8100 | b9a b88 888 |
| 1165 | | (legionna) | 7 | fdfb | 8100 | b9a b88 888 |
| 1166 | | (godzilla) | 7 | fdfb | 8100 | b9a b88 888 |
| 1167 | | (heatbrl) | 7 | fdfb | 8100 | b9a b88 888 |
| 1168 | | (zeroteam) | 7 | fdfb | 8100 | b9a b88 888 |
| 1169 | | (raiden2) | 7 | fdfb | 8100 | b9a b88 888 |
| 1170 | | (raidndx) | 7 | fdfb | 8100 | b9a b88 888 |
| 1171 | | |
| 1172 | | Table 11 - Same on all games |
| 1173 | | (grainbow) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1174 | | (cupsoc) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1175 | | (legionna) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1176 | | (godzilla) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1177 | | (heatbrl) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1178 | | (zeroteam) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1179 | | (raiden2) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1180 | | (raidndx) | 7 | fdfb | 8900 | b9a b8a 88a |
| 1181 | | |
| 1182 | | Table 12 - Raiden2/DX differ from others (list and trigger) |
| 1183 | | (grainbow) | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 1184 | | (cupsoc) | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 1185 | | (legionna) | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 1186 | | (godzilla) | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 1187 | | (heatbrl) | 7 | f8f7 | 9180 | b80 b94 b94 894 |
| 1188 | | (zeroteam) | 7 | f8f7 | 9100 | b80 b94 b94 894 |
| 1189 | | (raiden2) | 7 | fefb | 9100 | b80 b94 894 |
| 1190 | | (raidndx) | 7 | fefb | 9100 | b80 b94 894 |
| 1191 | | |
| 1192 | | Table 13 - Raiden2/DX differ from others , slight changes on legionna and hearbrl too |
| 1193 | | (*94 replaced with *96, to operate on a different register?) |
| 1194 | | (grainbow) | 7 | f8f7 | 9980 | b80 b94 b94 896 |
| 1195 | | (cupsoc) | 7 | f8f7 | 9980 | b80 b94 b94 896 |
| 1196 | | (legionna) | 7 | f8f7 | 9980 | b80 b96 b96 896 |
| 1197 | | (godzilla) | 7 | f8f7 | 9980 | b80 b94 b94 896 |
| 1198 | | (heatbrl) | 7 | f8f7 | 9980 | b80 b96 b96 896 |
| 1199 | | (zeroteam) | 7 | f8f7 | 9900 | b80 b94 b94 896 |
| 1200 | | (raiden2) | 7 | fefb | 9900 | b80 b94 896 |
| 1201 | | (raidndx) | 7 | fefb | 9900 | b80 b94 896 |
| 1202 | | |
| 1203 | | Table 14 - Trigger differs on heatbrl + v30 games, unknown param differs on grainbow + v30 games |
| 1204 | | (grainbow) | 0 | 02ff | a180 | b80 b82 b84 b86 |
| 1205 | | (cupsoc) | 0 | ffff | a180 | b80 b82 b84 b86 |
| 1206 | | (legionna) | 0 | ffff | a180 | b80 b82 b84 b86 |
| 1207 | | (godzilla) | 0 | ffff | a180 | b80 b82 b84 b86 |
| 1208 | | (heatbrl) | 0 | ffff | a100 | b80 b82 b84 b86 |
| 1209 | | (zeroteam) | 0 | ffff | a100 | b80 b82 b84 b86 |
| 1210 | | (raiden2) | 0 | 00ff | a100 | b80 b82 b84 b86 |
| 1211 | | (raidndx) | 0 | 00ff | a100 | b80 b82 b84 b86 |
| 1212 | | |
| 1213 | | Table 15 - Trigger differs on heatbrl + v30 games, unknown param differs on grainbow + v30 games |
| 1214 | | (grainbow) | f | 02ff | a980 | ba0 ba2 ba4 ba6 |
| 1215 | | (cupsoc) | f | ffff | a980 | ba0 ba2 ba4 ba6 |
| 1216 | | (legionna) | f | ffff | a980 | ba0 ba2 ba4 ba6 |
| 1217 | | (godzilla) | f | ffff | a980 | ba0 ba2 ba4 ba6 |
| 1218 | | (heatbrl) | f | ffff | a900 | ba0 ba2 ba4 ba6 |
| 1219 | | (zeroteam) | f | ffff | a900 | ba0 ba2 ba4 ba6 |
| 1220 | | (raiden2) | f | 00ff | a900 | ba0 ba2 ba4 ba6 |
| 1221 | | (raidndx) | f | 00ff | a900 | ba0 ba2 ba4 ba6 |
| 1222 | | |
| 1223 | | Table 16 - Trigger differs on heatbrl |
| 1224 | | (grainbow) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1225 | | (cupsoc) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1226 | | (legionna) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1227 | | (godzilla) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1228 | | (heatbrl) | 9 | ffff | b080 | b40 bc0 bc2 |
| 1229 | | (zeroteam) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1230 | | (raiden2) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1231 | | (raidndx) | 9 | ffff | b100 | b40 bc0 bc2 |
| 1232 | | |
| 1233 | | Table 17 - Trigger differs on heatbrl |
| 1234 | | (grainbow) | 6 | ffff | b900 | b60 be0 be2 |
| 1235 | | (cupsoc) | 6 | ffff | b900 | b60 be0 be2 |
| 1236 | | (legionna) | 6 | ffff | b900 | b60 be0 be2 |
| 1237 | | (godzilla) | 6 | ffff | b900 | b60 be0 be2 |
| 1238 | | (heatbrl) | 6 | ffff | b880 | b60 be0 be2 |
| 1239 | | (zeroteam) | 6 | ffff | b900 | b60 be0 be2 |
| 1240 | | (raiden2) | 6 | ffff | b900 | b60 be0 be2 |
| 1241 | | (raidndx) | 6 | ffff | b900 | b60 be0 be2 |
| 1242 | | |
| 1243 | | Table 18 - Same for all 68k games, zero team has different trigger, not on Raiden2/DX |
| 1244 | | (grainbow) | a | ff00 | c480 | 080 882 |
| 1245 | | (cupsoc) | a | ff00 | c480 | 080 882 |
| 1246 | | (legionna) | a | ff00 | c480 | 080 882 |
| 1247 | | (godzilla) | a | ff00 | c480 | 080 882 |
| 1248 | | (heatbrl) | a | ff00 | c480 | 080 882 |
| 1249 | | (zeroteam) | a | ff00 | 7c80 | 080 882 |
| 1250 | | (raiden2) | 0 | 0000 | 0000 | |
| 1251 | | (raidndx) | 0 | 0000 | 0000 | |
| 1252 | | |
| 1253 | | Table 19 - grainbow / cupsoc only |
| 1254 | | (grainbow) | 5 | bf7f | cb8f | 984 aa4 d82 aa2 39b b9a b9a a9f |
| 1255 | | (cupsoc) | 5 | bf7f | cb8f | 984 aa4 d82 aa2 39b b9a b9a a9f |
| 1256 | | (legionna) | 0 | 0000 | 0000 | |
| 1257 | | (godzilla) | 0 | 0000 | 0000 | |
| 1258 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1259 | | (zeroteam) | 0 | 0000 | 0000 | |
| 1260 | | (raiden2) | 0 | 0000 | 0000 | |
| 1261 | | (raidndx) | 0 | 0000 | 0000 | |
| 1262 | | |
| 1263 | | Table 1a - grainbow / cupsoc only |
| 1264 | | (grainbow) | 5 | fffb | d104 | ac2 9e0 0a2 |
| 1265 | | (cupsoc) | 5 | fffb | d104 | ac2 9e0 0a2 |
| 1266 | | (legionna) | 0 | 0000 | 0000 | |
| 1267 | | (godzilla) | 0 | 0000 | 0000 | |
| 1268 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1269 | | (zeroteam) | 0 | 0000 | 0000 | |
| 1270 | | (raiden2) | 0 | 0000 | 0000 | |
| 1271 | | (raidndx) | 0 | 0000 | 0000 | |
| 1272 | | |
| 1273 | | Table 1b - grainbow / cupsoc only |
| 1274 | | (grainbow) | 5 | 7ff7 | dde5 | f80 aa2 984 0c2 |
| 1275 | | (cupsoc) | 5 | 7ff7 | dde5 | f80 aa2 984 0c2 |
| 1276 | | (legionna) | 0 | 0000 | 0000 | |
| 1277 | | (godzilla) | 0 | 0000 | 0000 | |
| 1278 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1279 | | (zeroteam) | 0 | 0000 | 0000 | |
| 1280 | | (raiden2) | 0 | 0000 | 0000 | |
| 1281 | | (raidndx) | 0 | 0000 | 0000 | |
| 1282 | | |
| 1283 | | Table 1c - grainbow / cupsoc are the same, different on zero team |
| 1284 | | (grainbow) | 5 | b07f | e38e | 984 ac4 d82 ac2 39b b9a b9a a9a |
| 1285 | | (cupsoc) | 5 | b07f | e38e | 984 ac4 d82 ac2 39b b9a b9a a9a |
| 1286 | | (legionna) | 0 | 0000 | 0000 | |
| 1287 | | (godzilla) | 0 | 0000 | 0000 | |
| 1288 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1289 | | (zeroteam) | 5 | 06fb | e105 | a88 994 088 |
| 1290 | | (raiden2) | 0 | 0000 | 0000 | |
| 1291 | | (raidndx) | 0 | 0000 | 0000 | |
| 1292 | | |
| 1293 | | Table 1d - grainbow / cupsoc are the same, different on zero team |
| 1294 | | (grainbow) | 5 | b07f | eb8e | 984 ac4 d82 ac2 39b b9a b9a a9f |
| 1295 | | (cupsoc) | 5 | b07f | eb8e | 984 ac4 d82 ac2 39b b9a b9a a9f |
| 1296 | | (legionna) | 0 | 0000 | 0000 | |
| 1297 | | (godzilla) | 0 | 0000 | 0000 | |
| 1298 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1299 | | (zeroteam) | 5 | 05f7 | ede5 | f88 a84 986 08a |
| 1300 | | (raiden2) | 0 | 0000 | 0000 | |
| 1301 | | (raidndx) | 0 | 0000 | 0000 | |
| 1302 | | |
| 1303 | | Table 1e - grainbow / cupsoc are the same, different on zero team, different on raiden2/dx |
| 1304 | | (grainbow) | 5 | fefb | f105 | a88 994 088 |
| 1305 | | (cupsoc) | 5 | fefb | f105 | a88 994 088 |
| 1306 | | (legionna) | 0 | 0000 | 0000 | |
| 1307 | | (godzilla) | 0 | 0000 | 0000 | |
| 1308 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1309 | | (zeroteam) | 4 | 00ff | f790 | f80 b84 b84 b84 b84 b84 b84 b84 |
| 1310 | | (raiden2) | 6 | fff7 | f205 | 182 2e0 3c0 0c0 3c0 |
| 1311 | | (raidndx) | 6 | fff7 | f205 | 182 2e0 3c0 0c0 3c0 |
| 1312 | | |
| 1313 | | Table 1f - zeroteam specific |
| 1314 | | (grainbow) | 0 | 0000 | 0000 | |
| 1315 | | (cupsoc) | 0 | 0000 | 0000 | |
| 1316 | | (legionna) | 0 | 0000 | 0000 | |
| 1317 | | (godzilla) | 0 | 0000 | 0000 | |
| 1318 | | (heatbrl) | 0 | 0000 | 0000 | |
| 1319 | | (zeroteam) | 6 | 00ff | fc84 | 182 280 |
| 1320 | | (raiden2) | 0 | 0000 | 0000 | |
| 1321 | | (raidndx) | 0 | 0000 | 0000 | |
| 1322 | | |
| 1323 | | |
| 1324 | | |
| 1325 | | typically the games write data for use with the commands at MCUBASE+0xa0 - 0xaf and MCUBASE+0xc0 - 0xcf before triggering |
| 1326 | | the operation by writing to MCUBASE+0x100 (or MCUBASE+0x102) with the trigger value. I believe the commands can change |
| 1327 | | both COP registers and system memory. |
| 1328 | | |
| 1329 | | (MCUBASE typically being 0x100400 in the 68k games, and 0x400 in the v30 games) |
| 1330 | | |
| 1331 | | Seibu Cup Soccer sometimes attempts to use a trigger value which wasn't defined in the table, I don't know what should |
| 1332 | | happen in that case! |
| 1333 | | |
| 1334 | | ---- |
| 1335 | | |
| 1336 | | Protection Part 2: BCD Maths |
| 1337 | | |
| 1338 | | some additional registers serve as a math box type device, converting numbers + other functions. Godzilla seems to use |
| 1339 | | this for a protection check, other games (Denjin Makai, Raiden 2) use it for scoring: |
| 1340 | | |
| 1341 | | ---- |
| 1342 | | |
| 1343 | | Protection Part 3: Private Buffer DMA + RAM Clear |
| 1344 | | (todo, expand on this) |
| 1345 | | |
| 1346 | | address ranges can be specified which allows DMA Fill / Clear operations to be performed, as well as transfering |
| 1347 | | tilemap+palette data to private buffers for rendering. If you don't use these nothing gets updated on the real |
| 1348 | | hardware!. These don't currently make much sense because the hardware specifies ranges which aren't mapped, or |
| 1349 | | contain nothing. It's possible the original hardware has mirroring which this function relies on. |
| 1350 | | |
| 1351 | | the DMA to private buffer operations are currently ignored due to |
| 1352 | | if ((cop_dma_trigger==0x14) || (cop_dma_trigger==0x15)) return; |
| 1353 | | |
| 1354 | | ---- |
| 1355 | | |
| 1356 | | Other Protections? |
| 1357 | | |
| 1358 | | Denjin Makai seems to rely on a byteswapped mirror to write the palette. |
| 1359 | | Various other ports go through the COP area, and get mapped to inputs / sounds / video registers, this adds to |
| 1360 | | the confusion and makes it less clear what is / isn't protection related |
| 1361 | | |
| 1362 | | ================================================================================================================= |
| 1363 | | Seibu COP memory map |
| 1364 | | |
| 1365 | | DMA mode partial documentation: |
| 1366 | | 0x476 |
| 1367 | | ???? ???? ???? ???? SRC table value used for palette DMAs, val << 10 |
| 1368 | | |
| 1369 | | 0x478 |
| 1370 | | xxxx xxxx xxxx xxxx SRC address register, val << 6 |
| 1371 | | |
| 1372 | | 0x47a |
| 1373 | | xxxx xxxx xxxx xxxx length register, val << 5 |
| 1374 | | |
| 1375 | | 0x47c |
| 1376 | | xxxx xxxx xxxx xxxx DST address register, val << 6 |
| 1377 | | |
| 1378 | | 0x47e |
| 1379 | | ---- ---x ---x ---- DMA mode (00: DMA, work RAM to work RAM 01: DMA, work RAM to private buffers / 10 <unknown> / 11: fill work RAM) |
| 1380 | | ---- ---- x--- ---- palette DMA mode (used for brightness effects) |
| 1381 | | ---- ---- ---- x--- Transfer type (0: word 1:dword) |
| 1382 | | ---- ---- ---- -xxx Channel # |
| 1383 | | |
| 1384 | | - channels 0x4 and 0x5 are always used to transfer respectively the VRAM and the palette data to the private buffers. |
| 1385 | | It isn't know at current stage if it's just a design choice or they are dedicated DMAs. |
| 1386 | | |
| 1387 | | - Some games (Heated Barrel start-up menu, Olympic Soccer '92 OBJ test) sets up the layer clearance in the midst of the |
| 1388 | | frame interval. It might indicate that it delays those DMAs inside the buffers at vblank time. |
| 1389 | | |
| 1390 | | - Raiden 2 / Raiden DX sets 0x14 with DST = 0xfffe and size as a sprite limit behaviour. The former is probably used to change the |
| 1391 | | order of the loaded tables (they are the only known cases where spriteram is smallest address-wise). |
| 1392 | | |
| 1393 | | - Reading here is probably used for DMA status of the individual channels or just for read-back of the register, but nothing seems to rely |
| 1394 | | on it so far so nothing is really known about it. |
| 1395 | | |
| 1396 | | 0x6fc |
| 1397 | | ???? ???? ???? ???? triggers DMA loaded in registers, value looks meaningless |
| 1398 | | |
| 1399 | | Miscellaneous registers: |
| 1400 | | 0x470 |
| 1401 | | ???? ???? ???? ???? External pin register, used by some games for prg/gfx banking (per-game specific) |
| 1402 | | |
| 1403 | | |
| 1404 | | --- |
| 1405 | | |
| 1406 | | commands 0x8100/0x8900: |
| 1407 | | |
| 1408 | | status always 0x8007 (doesn't seem to care) |
| 1409 | | raw | amp | scale | sin | cos | |
| 1410 | | ------------------------------------------ |
| 1411 | | y 0x00 x 0x00000000 0x00000000 (i.e. if amp is 0 then sin/cos are zero too) |
| 1412 | | 0 0x40 0 0x00000000 0x00020000 |
| 1413 | | 0 0x40 1 0x00000000 0x00040000 |
| 1414 | | 0 0x40 2 0x00000000 0x00080000 |
| 1415 | | 0 0x40 3 0x00000000 0x00100000 |
| 1416 | | 0x40 0x40 0 0x00020000 0x00000000 |
| 1417 | | 0x40 0x40 1 0x00040000 0x00000000 |
| 1418 | | 0x40 0x40 2 0x00080000 0x00000000 |
| 1419 | | 0x40 0x40 3 0x00100000 0x00000000 |
| 1420 | | 0x80 0x40 0 0x00000000 0xfffc0000 |
| 1421 | | 0x80 0x40 1 0x00000000 0xfff80000 |
| 1422 | | 0x80 0x40 2 0x00000000 0xfff00000 |
| 1423 | | 0x80 0x40 3 0x00000000 0xffe00000 |
| 1424 | | 0xc0 0x40 0 0xfffc0000 0x00000000 |
| 1425 | | 0xc0 0x40 1 0xfff80000 0x00000000 |
| 1426 | | 0xc0 0x40 2 0xfff00000 0x00000000 |
| 1427 | | 0xc0 0x40 3 0xffe00000 0x00000000 |
| 1428 | | 0 0x80 0 0x00000000 0x00040000 |
| 1429 | | 0 0x80 1 0x00000000 0x00080000 |
| 1430 | | 0 0x80 2 0x00000000 0x00100000 |
| 1431 | | 0 0x80 3 0x00000000 0x00200000 |
| 1432 | | 0x40 0x80 0 0x00040000 0x00000000 |
| 1433 | | 0x40 0x80 1 0x00080000 0x00000000 |
| 1434 | | 0x40 0x80 2 0x00100000 0x00000000 |
| 1435 | | 0x40 0x80 3 0x00200000 0x00000000 |
| 1436 | | 0x80 0x80 0 0x00000000 0xfff80000 |
| 1437 | | 0x80 0x80 1 0x00000000 0xfff00000 |
| 1438 | | 0x80 0x80 2 0x00000000 0xffe00000 |
| 1439 | | 0x80 0x80 3 0x00000000 0xffc00000 |
| 1440 | | 0xc0 0x80 0 0xfff80000 0x00000000 |
| 1441 | | 0xc0 0x80 1 0xfff00000 0x00000000 |
| 1442 | | 0xc0 0x80 2 0xffe00000 0x00000000 |
| 1443 | | 0xc0 0x80 3 0xffc00000 0x00000000 |
| 1444 | | 0 0xc0 0 0x00000000 0x00060000 |
| 1445 | | 0 0xc0 1 0x00000000 0x000c0000 |
| 1446 | | 0 0xc0 2 0x00000000 0x00180000 |
| 1447 | | 0 0xc0 3 0x00000000 0x00300000 |
| 1448 | | 0x40 0xc0 0 0x00060000 0x00000000 |
| 1449 | | 0x40 0xc0 1 0x000c0000 0x00000000 |
| 1450 | | 0x40 0xc0 2 0x00180000 0x00000000 |
| 1451 | | 0x40 0xc0 3 0x00300000 0x00000000 |
| 1452 | | 0x80 0xc0 0 0x00000000 0xfff40000 |
| 1453 | | 0x80 0xc0 1 0x00000000 0xffe80000 |
| 1454 | | 0x80 0xc0 2 0x00000000 0xffd00000 |
| 1455 | | 0x80 0xc0 3 0x00000000 0xffa00000 |
| 1456 | | 0xc0 0xc0 0 0xfff40000 0x00000000 |
| 1457 | | 0xc0 0xc0 1 0xffe80000 0x00000000 |
| 1458 | | 0xc0 0xc0 2 0xffd00000 0x00000000 |
| 1459 | | 0xc0 0xc0 3 0xffa00000 0x00000000 |
| 1460 | | |
| 1461 | | commands 0x130e/0x138e: (dx dy 2 fixed point 0x80) |
| 1462 | | dx dy angle |
| 1463 | | --------------------- |
| 1464 | | 0x00 0x00 0x20 |
| 1465 | | 0x20 0x00 0x25 (0x26 in test) |
| 1466 | | 0x40 0x00 0x2d (0x2b in test) |
| 1467 | | 0x60 0x00 0x36 |
| 1468 | | 0x80 0x00 0x00 cop status 0x8007 |
| 1469 | | 0xa0 0x00 0x4a |
| 1470 | | 0xc0 0x00 0x53 |
| 1471 | | 0xe0 0x00 0x5b (0x5a) |
| 1472 | | 0x100 0x00 0x60 |
| 1473 | | 0x120 0x00 0x65 |
| 1474 | | 0x140 0x00 0x69 (0x68) |
| 1475 | | 0x160 0x00 0x6b |
| 1476 | | 0x180 0x00 0x6e (0x6d) |
| 1477 | | 0x1a0 0x00 0x6f |
| 1478 | | 0x1c0 0x00 0x71 |
| 1479 | | 0x1e0 0x00 0x72 |
| 1480 | | |
| 1481 | | |
| 1482 | | command 0x3bb0 |
| 1483 | | dx dy | dist |
| 1484 | | -----------|----- |
| 1485 | | 0x00 0x00 | 0xb5 |
| 1486 | | 0x20 0x00 | 0xa0 |
| 1487 | | 0x40 0x00 | 0x8f |
| 1488 | | 0x60 0x00 | 0x83 |
| 1489 | | 0x80 0x00 | 0x80 |
| 1490 | | 0xa0 0x00 | 0x83 |
| 1491 | | 0xc0 0x00 | 0x8f |
| 1492 | | 0xe0 0x00 | 0xa0 |
| 1493 | | |
| 1494 | | command 0x42c2 |
| 1495 | | dx dy | stat dist angle scale r34(r) r36 r38* r3a |
| 1496 | | -----------|----------------------------------------------------- |
| 1497 | | 0x00 0x00 | 0x0067 0x20 0x20 0x0000 0x0001 0x0020 0xb5 0x16a0 |
| 1498 | | 0x20 0x00 | 0x0027 0x20 0x26 0x0000 0x0001 0x0026 0xa0 0x1400 |
| 1499 | | 0x40 0x00 | 0x0067 0x20 0x2d 0x0000 0x0001 0x002d 0x8f 0x11e3 |
| 1500 | | 0x60 0x00 | 0x0067 0x20 0x36 0x0000 0x0001 0x0036 0x83 0x107e |
| 1501 | | 0x80 0x00 | 0x0027 0x20 0x00 0x0000 0x0001 0x0000 0x80 0x1000 |
| 1502 | | 0xa0 0x00 | 0x0067 0x20 0x4a 0x0000 0x0001 0x004a 0x83 0x107e |
| 1503 | | 0xc0 0x00 | 0x0067 0x20 0x53 0x0000 0x0001 0x0053 0x8f 0x11e3 |
| 1504 | | 0xe0 0x00 | 0x0027 0x20 0x5a 0x0000 0x0001 0x005a 0xa0 0x1400 |
| 1505 | | |
| 1506 | | 0x00 0x00 | ****** 0x10 0x20 0x0000 0x0002 0x0020 0xb5 0x0b50 |
| 1507 | | 0x20 0x00 | ****** 0x10 0x26 0x0000 0x0002 0x0026 0xa0 0x0a00 |
| 1508 | | 0x40 0x00 | ****** 0x10 0x2d 0x0000 0x0002 0x002d 0x8f 0x08f1 |
| 1509 | | 0x60 0x00 | ****** 0x10 0x36 0x0000 0x0002 0x0036 0x83 0x083f |
| 1510 | | 0x80 0x00 | ****** 0x10 0x00 0x0000 0x0002 0x0000 0x80 0x0800 |
| 1511 | | 0xa0 0x00 | ****** 0x10 0x4a 0x0000 0x0002 0x004a 0x83 0x083f |
| 1512 | | 0xc0 0x00 | ****** 0x10 0x53 0x0000 0x0002 0x0053 0x8f 0x08f1 |
| 1513 | | 0xe0 0x00 | ****** 0x10 0x5a 0x0000 0x0002 0x005a 0xa0 0x0a00 |
| 1514 | | |
| 1515 | | 0x00 0x00 | ****** 0x08 0x20 0x0000 0x0004 0x0020 0xb5 0x05a8 |
| 1516 | | 0x20 0x00 | ****** 0x08 0x26 0x0000 0x0004 0x0026 0xa0 0x0500 |
| 1517 | | |
| 1518 | | 0x20 0x00 | ****** 0x02 0x26 0x0000 0x0010 0x0026 0xa0 0x0140 |
| 1519 | | |
| 1520 | | 0xc0 0x00 | 0x0047 0x01 0x53 0x0000 0x0020 0x0053 0x8f 0x008f |
| 1521 | | |
| 1522 | | 0x60 0x00 | 0x0047 0x00 0x36 0x0000 0x0040 0x0036 0x83 0x0041 |
| 1523 | | |
| 1524 | | 0x40 0x00 | 0x0047 0x00 0x2d 0x0000 0x0080 0x002d 0x8f 0x0023 |
| 1525 | | |
| 1526 | | 0x40 0x00 | 0x8007 0x00 0x2d 0x0000 0x0400 0x008f 0x8f 0x0000 |
| 1527 | | |
| 1528 | | 0x00 0x00 | 0x0067 0x10 0x2d 0x0000 0x0001 0x0020 0xb5 0x0b50 |
| 1529 | | |
| 1530 | | *same as 0x3bb0 |
| 1531 | | |
| 1532 | | command 0x6200 |
| 1533 | | raw angle|angle compare|angle mod value| res | |
| 1534 | | ---------|-------------|---------------|-----| |
| 1535 | | 0x00 **** 0x00 0x00 |
| 1536 | | 0x00 0x00 0x20 0x00 |
| 1537 | | 0x00 0x20 0x20 0x20 |
| 1538 | | 0x00 0x40 0x20 0x20 |
| 1539 | | 0x00 0x60 0x20 0x20 |
| 1540 | | 0x00 0x80 0x20 0xe0 |
| 1541 | | 0x00 0xa0 0x20 0xe0 |
| 1542 | | 0x00 0xc0 0x20 0xe0 |
| 1543 | | 0x00 0xe0 0x20 0xe0 |
| 1544 | | 0x00 0x00 0x40 0x00 |
| 1545 | | 0x00 0x20 0x40 0x20 |
| 1546 | | 0x00 0x40 0x40 0x40 |
| 1547 | | 0x00 0x60 0x40 0x40 |
| 1548 | | 0x00 0x80 0x40 0xc0 |
| 1549 | | 0x00 0xa0 0x40 0xc0 |
| 1550 | | 0x00 0xc0 0x40 0xc0 |
| 1551 | | 0x00 0xe0 0x40 0xe0 |
| 1552 | | 0x00 0x00 0x60 0x00 |
| 1553 | | 0x00 0x20 0x60 0x20 |
| 1554 | | 0x00 0x40 0x60 0x60 * |
| 1555 | | 0x00 0x60 0x60 0x60 |
| 1556 | | 0x00 0x80 0x60 0xa0 |
| 1557 | | 0x00 0xa0 0x60 0xa0 |
| 1558 | | 0x00 0xc0 0x60 0xc0 |
| 1559 | | 0x00 0xe0 0x60 0xe0 |
| 1560 | | 0x00 0x00 0x80 0x00 |
| 1561 | | 0x00 0x20 0x80 0x80 * |
| 1562 | | 0x00 0x40 0x80 0x80 * |
| 1563 | | 0x00 0x60 0x80 0x80 * |
| 1564 | | 0x00 0x80 0x80 0x80 * |
| 1565 | | 0x00 0xa0 0x80 0x80 |
| 1566 | | 0x00 0xc0 0x80 0x80 |
| 1567 | | 0x00 0xe0 0x80 0x80 |
| 1568 | | 0x00 0x00 0xa0 0x00 |
| 1569 | | 0x00 0x20 0xa0 0x20 |
| 1570 | | 0x00 0x40 0xa0 0xa0 |
| 1571 | | 0x00 0x60 0xa0 0xa0 |
| 1572 | | 0x00 0x80 0xa0 0x60 |
| 1573 | | 0x00 0xa0 0xa0 0x60 |
| 1574 | | 0x00 0xc0 0xa0 0x60 |
| 1575 | | 0x00 0xe0 0xa0 0xe0 |
| 1576 | | 0x00 0x00 0xc0 0x00 |
| 1577 | | 0x00 0x20 0xc0 0x20 |
| 1578 | | 0x00 0x40 0xc0 0xc0 |
| 1579 | | 0x00 0x60 0xc0 **** |
| 1580 | | 0x00 0x80 0xc0 0x40 |
| 1581 | | 0x00 0xa0 0xc0 **** |
| 1582 | | 0x00 0xc0 0xc0 0xc0 |
| 1583 | | 0x00 0xe0 0xc0 0xe0 |
| 1584 | | 0x00 0x00 0xe0 0x00 |
| 1585 | | 0x00 0x20 0xe0 0x20 |
| 1586 | | 0x00 0x40 0xe0 0xe0 |
| 1587 | | 0x00 0x60 0xe0 0xe0 |
| 1588 | | 0x00 0x80 0xe0 0x20 |
| 1589 | | 0x00 0xa0 0xe0 0x20 |
| 1590 | | 0x00 0xc0 0xe0 0xc0 |
| 1591 | | 0x00 0xe0 0xe0 0xe0 |
| 1592 | | */ |
| 1593 | | |
| 1594 | 16 | #include "emu.h" |
| 17 | #include "seicop.h" |
| 1595 | 18 | #include "includes/legionna.h" |
| 1596 | | #include "machine/seicop.h" |
| 1597 | 19 | |
| 1598 | 20 | |
| 1599 | | const device_type SEIBU_COP_LEGACY = &device_creator<seibu_cop_legacy_device>; |
| 21 | const device_type SEIBU_COP_BOOTLEG = &device_creator<seibu_cop_bootleg_device>; |
| 1600 | 22 | |
| 1601 | | seibu_cop_legacy_device::seibu_cop_legacy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1602 | | : device_t(mconfig, SEIBU_COP_LEGACY, "Seibu COP Legacy", tag, owner, clock, "seibu_cop_legacy", __FILE__), |
| 23 | seibu_cop_bootleg_device::seibu_cop_bootleg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 24 | : device_t(mconfig, SEIBU_COP_BOOTLEG, "Seibu COP Bootleg", tag, owner, clock, "seibu_cop_boot", __FILE__), |
| 1603 | 25 | m_cop_mcu_ram(NULL), |
| 1604 | | m_cop_hit_val_x(0), |
| 1605 | | m_cop_hit_val_y(0), |
| 1606 | | m_cop_hit_val_z(0), |
| 1607 | | m_legacycop_angle_compare(0), |
| 1608 | | m_legacycop_angle_mod_val(0), |
| 1609 | | m_r0(0), |
| 1610 | | m_r1(0), |
| 1611 | | m_cop_rom_addr_lo(0), |
| 1612 | | m_cop_rom_addr_hi(0), |
| 1613 | | m_cop_rom_addr_unk(0), |
| 1614 | | m_cop_sprite_dma_abs_x(0), |
| 1615 | | m_cop_sprite_dma_abs_y(0), |
| 1616 | 26 | m_raiden2cop(*this, ":raiden2cop") |
| 1617 | 27 | { |
| 1618 | 28 | |
| r32338 | r32339 | |
| 1627 | 37 | // complete |
| 1628 | 38 | //------------------------------------------------- |
| 1629 | 39 | |
| 1630 | | void seibu_cop_legacy_device::device_config_complete() |
| 40 | void seibu_cop_bootleg_device::device_config_complete() |
| 1631 | 41 | { |
| 1632 | 42 | } |
| 1633 | 43 | |
| r32338 | r32339 | |
| 1635 | 45 | // device_start - device-specific startup |
| 1636 | 46 | //------------------------------------------------- |
| 1637 | 47 | |
| 1638 | | void seibu_cop_legacy_device::device_start() |
| 48 | void seibu_cop_bootleg_device::device_start() |
| 1639 | 49 | { |
| 1640 | 50 | m_cop_mcu_ram = reinterpret_cast<UINT16 *>(machine().root_device().memshare("cop_mcu_ram")->ptr()); |
| 1641 | 51 | |
| 1642 | | |
| 1643 | | save_item(NAME(m_cop_hit_val_x)); |
| 1644 | | save_item(NAME(m_cop_hit_val_y)); |
| 1645 | | save_item(NAME(m_cop_hit_val_z)); |
| 1646 | | save_item(NAME(m_legacycop_angle_compare)); |
| 1647 | | save_item(NAME(m_legacycop_angle_mod_val)); |
| 1648 | | save_item(NAME(m_r0)); |
| 1649 | | save_item(NAME(m_r1)); |
| 1650 | | save_item(NAME(m_cop_rom_addr_lo)); |
| 1651 | | save_item(NAME(m_cop_rom_addr_hi)); |
| 1652 | | save_item(NAME(m_cop_rom_addr_unk)); |
| 1653 | | save_item(NAME(m_cop_sprite_dma_abs_x)); |
| 1654 | | save_item(NAME(m_cop_sprite_dma_abs_y)); |
| 1655 | 52 | } |
| 1656 | 53 | |
| 1657 | 54 | //------------------------------------------------- |
| 1658 | | // device_ |
| 1659 | | // device-specific startup |
| 55 | // device_reset |
| 1660 | 56 | //------------------------------------------------- |
| 1661 | 57 | |
| 1662 | | void seibu_cop_legacy_device::device_reset() |
| 58 | void seibu_cop_bootleg_device::device_reset() |
| 1663 | 59 | { |
| 1664 | 60 | } |
| 1665 | 61 | |
| 1666 | 62 | |
| 1667 | 63 | |
| 1668 | | /* |
| 1669 | | "The area of ASM snippets" |
| 1670 | | |
| 1671 | | player-1 priorities list: |
| 1672 | | 1086d8: show this sprite (bit 15) |
| 1673 | | 1086dc: lives (BCD,bits 3,2,1,0) |
| 1674 | | 1086de: energy bar (upper byte) |
| 1675 | | 1086e0: walk animation (lower byte) |
| 1676 | | 1086ec: "death" status (bit 15) |
| 1677 | | 1086f4: sprite y axis |
| 1678 | | 1086f0: sprite x axis |
| 1679 | | |
| 1680 | | Sprite DMA TODO: |
| 1681 | | - various bits not yet understood in the sprite src tables and in the 0x400/0x402 sprite param; |
| 1682 | | |
| 1683 | | spriteram DMA [1] |
| 1684 | | 001DE4: 3086 move.w D6, (A0) ;$100400,color + other stuff |
| 1685 | | 001DE6: 2440 movea.l D0, A2 |
| 1686 | | 001DE8: 0269 0004 0002 andi.w #$4, ($2,A1) |
| 1687 | | 001DEE: 3152 000C move.w (A2), ($c,A0) ;DMA size |
| 1688 | | 001DF2: 3145 0002 move.w D5, ($2,A0) |
| 1689 | | 001DF6: 0245 0040 andi.w #$40, D5 |
| 1690 | | 001DFA: 2009 move.l A1, D0 |
| 1691 | | 001DFC: 3140 00C0 move.w D0, ($c0,A0) ;RAM -> $1004c0 (work ram index?) |
| 1692 | | 001E00: 4840 swap D0 |
| 1693 | | 001E02: 3140 00A0 move.w D0, ($a0,A0) ;RAM -> $1004a0 |
| 1694 | | 001E06: 200A move.l A2, D0 |
| 1695 | | 001E08: 3140 0014 move.w D0, ($14,A0) ;$ROM lo -> $100414 src |
| 1696 | | 001E0C: 4840 swap D0 |
| 1697 | | 001E0E: 3140 0012 move.w D0, ($12,A0) ;$ROM hi -> $100412 |
| 1698 | | 001E12: 2679 0010 8116 movea.l $108116.l, A3 ;points to dst spriteram |
| 1699 | | 001E18: 3839 0010 810A move.w $10810a.l, D4 ;spriteram index |
| 1700 | | 001E1E: 260B move.l A3, D3 |
| 1701 | | 001E20: 3143 00C8 move.w D3, ($c8,A0) ;sets the dst spriteram |
| 1702 | | 001E24: 4843 swap D3 |
| 1703 | | 001E26: 3143 00A8 move.w D3, ($a8,A0) |
| 1704 | | 001E2A: 45EA 0004 lea ($4,A2), A2 |
| 1705 | | //at this point we're ready for DMAing |
| 1706 | | 001E2E: 317C A180 0100 move.w #$a180, ($100,A0) ;<-get x/y from sprite |
| 1707 | | 001E34: 317C 6980 0102 move.w #$6980, ($102,A0) ;<-adjust sprite x/y |
| 1708 | | 001E3A: 317C C480 0102 move.w #$c480, ($102,A0) ;<-load sprite offset |
| 1709 | | 001E40: 317C 0000 0010 move.w #$0, ($10,A0) ;<-do the job? |
| 1710 | | 001E46: 302A 0002 move.w ($2,A2), D0 |
| 1711 | | 001E4A: 816B 0006 or.w D0, ($6,A3) |
| 1712 | | 001E4E: 45EA 0006 lea ($6,A2), A2 |
| 1713 | | 001E52: 302B 0008 move.w ($8,A3), D0 |
| 1714 | | 001E56: B079 0010 8112 cmp.w $108112.l, D0 |
| 1715 | | 001E5C: 6E00 0054 bgt $1eb2 |
| 1716 | | 001E60: B079 0010 8110 cmp.w $108110.l, D0 |
| 1717 | | 001E66: 6D00 004A blt $1eb2 |
| 1718 | | 001E6A: 026B 7FFF 000A andi.w #$7fff, ($a,A3) |
| 1719 | | 001E70: 8B6B 0004 or.w D5, ($4,A3) |
| 1720 | | 001E74: 47EB 0008 lea ($8,A3), A3 |
| 1721 | | 001E78: 260B move.l A3, D3 |
| 1722 | | 001E7A: 3143 00C8 move.w D3, ($c8,A0) |
| 1723 | | 001E7E: 4843 swap D3 |
| 1724 | | 001E80: 3143 00A8 move.w D3, ($a8,A0) |
| 1725 | | 001E84: 5244 addq.w #1, D4 |
| 1726 | | 001E86: B879 0010 8114 cmp.w $108114.l, D4 |
| 1727 | | 001E8C: 6500 000C bcs $1e9a |
| 1728 | | 001E90: 0069 0002 0002 ori.w #$2, ($2,A1) |
| 1729 | | 001E96: 6000 000C bra $1ea4 |
| 1730 | | 001E9A: 3028 01B0 move.w ($1b0,A0), D0 ;bit 1 = DMA job finished |
| 1731 | | 001E9E: 0240 0002 andi.w #$2, D0 |
| 1732 | | 001EA2: 6790 beq $1e34 |
| 1733 | | 001EA4: 33C4 0010 810A move.w D4, $10810a.l |
| 1734 | | 001EAA: 23CB 0010 8116 move.l A3, $108116.l |
| 1735 | | 001EB0: 4E75 rts |
| 1736 | | |
| 1737 | | x/y check [2] |
| 1738 | | 002030: E58D lsl.l #2, D5 |
| 1739 | | 002032: 0685 0003 0000 addi.l #$30000, D5 |
| 1740 | | 002038: 33C5 0010 04C4 move.w D5, $1004c4.l |
| 1741 | | 00203E: 4845 swap D5 |
| 1742 | | 002040: 33C5 0010 04A4 move.w D5, $1004a4.l |
| 1743 | | 002046: E58E lsl.l #2, D6 |
| 1744 | | 002048: 0686 0003 0000 addi.l #$30000, D6 |
| 1745 | | 00204E: 33C6 0010 04C6 move.w D6, $1004c6.l |
| 1746 | | 002054: 4846 swap D6 |
| 1747 | | 002056: 33C6 0010 04A6 move.w D6, $1004a6.l |
| 1748 | | 00205C: 33FC A180 0010 0500 move.w #$a180, $100500.l |
| 1749 | | 002064: 33FC B100 0010 0500 move.w #$b100, $100500.l |
| 1750 | | 00206C: 33FC A980 0010 0500 move.w #$a980, $100500.l |
| 1751 | | 002074: 33FC B900 0010 0500 move.w #$b900, $100500.l |
| 1752 | | 00207C: 4E75 rts |
| 1753 | | [...] |
| 1754 | | //then reads at $580 |
| 1755 | | |
| 1756 | | sine cosine has a weird math problem, it needs that the amp is multiplied by two when the direction is TOTALLY left or TOTALLY up. |
| 1757 | | No known explanation to this so far ... |
| 1758 | | |
| 1759 | | 003306: move.w #$8100, ($100,A0) |
| 1760 | | 00330C: move.w #$8900, ($100,A0) |
| 1761 | | 003312: cmpi.w #$80, ($36,A1) ;checks if angle is equal to 0x80 (left direction of objects) |
| 1762 | | 003318: bne $332a |
| 1763 | | 00331C: move.l ($14,A1), D0 ;divide by two if so |
| 1764 | | 003320: asr.l #1, D0 |
| 1765 | | 003322: move.l D0, ($14,A1) |
| 1766 | | 003326: bra $333e |
| 1767 | | 00332A: cmpi.w #$c0, ($36,A1) ;checks if angle is equal to 0xc0 (up direction of objects) |
| 1768 | | 003330: bne $333e |
| 1769 | | 003334: move.l ($10,A1), D0 ;divide by two if so |
| 1770 | | 003338: asr.l #1, D0 |
| 1771 | | 00333A: move.l D0, ($10,A1) |
| 1772 | | 00333E: movem.l (A7)+, D0/A0-A1 |
| 1773 | | 003342: rts |
| 1774 | | |
| 1775 | | */ |
| 1776 | | |
| 1777 | | /******************************************************************************************** |
| 1778 | | |
| 1779 | | COPX bootleg simulation |
| 1780 | | - Seibu Cup Soccer (bootleg) |
| 1781 | | |
| 1782 | | *******************************************************************************************/ |
| 1783 | | |
| 1784 | | |
| 1785 | | READ16_MEMBER( seibu_cop_legacy_device::copdxbl_0_r ) |
| 64 | READ16_MEMBER( seibu_cop_bootleg_device::copdxbl_0_r ) |
| 1786 | 65 | { |
| 1787 | 66 | UINT16 retvalue = m_cop_mcu_ram[offset]; |
| 1788 | 67 | |
| r32338 | r32339 | |
| 1809 | 88 | } |
| 1810 | 89 | } |
| 1811 | 90 | |
| 1812 | | WRITE16_MEMBER( seibu_cop_legacy_device::copdxbl_0_w ) |
| 91 | WRITE16_MEMBER( seibu_cop_bootleg_device::copdxbl_0_w ) |
| 1813 | 92 | { |
| 1814 | 93 | legionna_state *state = space.machine().driver_data<legionna_state>(); |
| 1815 | 94 | COMBINE_DATA(&m_cop_mcu_ram[offset]); |
| r32338 | r32339 | |
| 1892 | 171 | m_raiden2cop->cop_angle += 0x80; |
| 1893 | 172 | } |
| 1894 | 173 | |
| 1895 | | m_r0 = dy; |
| 1896 | | m_r1 = dx; |
| 174 | m_raiden2cop->m_LEGACY_r0 = dy; |
| 175 | m_raiden2cop->m_LEGACY_r1 = dx; |
| 1897 | 176 | |
| 1898 | 177 | if(m_cop_mcu_ram[offset] & 0x80) |
| 1899 | 178 | space.write_word(m_raiden2cop->cop_regs[0]+(0x34^2), m_raiden2cop->cop_angle); |
| r32338 | r32339 | |
| 1903 | 182 | case 0x3b30: |
| 1904 | 183 | case 0x3bb0: |
| 1905 | 184 | { |
| 1906 | | int dy = m_r0; |
| 1907 | | int dx = m_r1; |
| 185 | int dy = m_raiden2cop->m_LEGACY_r0; |
| 186 | int dx = m_raiden2cop->m_LEGACY_r1; |
| 1908 | 187 | |
| 1909 | 188 | dx >>= 16; |
| 1910 | 189 | dy >>= 16; |
| r32338 | r32339 | |
| 1940 | 219 | } |
| 1941 | 220 | } |
| 1942 | 221 | |
| 1943 | | /* Generic COP functions |
| 1944 | | -- the game specific handlers fall through to these if there |
| 1945 | | isn't a specific case for them. these implement behavior |
| 1946 | | which seems common to all the games |
| 1947 | | */ |
| 1948 | 222 | |
| 1949 | | |
| 1950 | | |
| 1951 | | |
| 1952 | | |
| 1953 | | /* |
| 1954 | | _ |
| 1955 | | */ |
| 1956 | | |
| 1957 | | /* |
| 1958 | | Godzilla 0x12c0 X = 0x21ed Y = 0x57da |
| 1959 | | Megaron 0x12d0 X = 0x1ef1 Y = 0x55db |
| 1960 | | King Ghidorah 0x12c8 X = 0x26eb Y = 0x55dc |
| 1961 | | Mecha Ghidorah 0x12dc X = 0x24ec Y = 0x55dc |
| 1962 | | Mecha Godzilla 0x12d4 X = 0x1cf1 Y = 0x52dc |
| 1963 | | Gigan 0x12cc X = 0x23e8 Y = 0x55db |
| 1964 | | |
| 1965 | | (DC.W $1020, $F0C0, $0000, $0000) |
| 1966 | | X = collides at the same spot |
| 1967 | | Y = collides between 0xd0 and 0x20 |
| 1968 | | 0x588 bits 2 & 3 = 0 |
| 1969 | | (DC.W $F0C0, $1020, $0000, $0000) |
| 1970 | | X = collides between 0xb0 and 0x50 (inclusive) |
| 1971 | | Y = collides between 0xd0 and 0x30 (not inclusive) |
| 1972 | | 0x588 bits 2 & 3 = 0x580 bits 0 & 1 |
| 1973 | | */ |
| 1974 | | void seibu_cop_legacy_device::cop_take_hit_box_params(UINT8 offs) |
| 1975 | | { |
| 1976 | | INT16 start_x,start_y,height,width; |
| 1977 | | |
| 1978 | | { |
| 1979 | | height = UINT8(m_cop_collision_info[offs].hitbox_y >> 8); |
| 1980 | | start_y = INT8(m_cop_collision_info[offs].hitbox_y); |
| 1981 | | width = UINT8(m_cop_collision_info[offs].hitbox_x >> 8); |
| 1982 | | start_x = INT8(m_cop_collision_info[offs].hitbox_x); |
| 1983 | | } |
| 1984 | | |
| 1985 | | m_cop_collision_info[offs].min_x = (m_cop_collision_info[offs].x >> 16) + start_x; |
| 1986 | | m_cop_collision_info[offs].max_x = m_cop_collision_info[offs].min_x + width; |
| 1987 | | m_cop_collision_info[offs].min_y = (m_cop_collision_info[offs].y >> 16) + start_y; |
| 1988 | | m_cop_collision_info[offs].max_y = m_cop_collision_info[offs].min_y + height; |
| 1989 | | } |
| 1990 | | |
| 1991 | | |
| 1992 | | UINT8 seibu_cop_legacy_device::cop_calculate_collsion_detection() |
| 1993 | | { |
| 1994 | | static UINT8 res; |
| 1995 | | |
| 1996 | | res = 3; |
| 1997 | | |
| 1998 | | /* outbound X check */ |
| 1999 | | if(m_cop_collision_info[0].max_x >= m_cop_collision_info[1].min_x && m_cop_collision_info[0].min_x <= m_cop_collision_info[1].max_x) |
| 2000 | | res &= ~2; |
| 2001 | | |
| 2002 | | if(m_cop_collision_info[1].max_x >= m_cop_collision_info[0].min_x && m_cop_collision_info[1].min_x <= m_cop_collision_info[0].max_x) |
| 2003 | | res &= ~2; |
| 2004 | | |
| 2005 | | /* outbound Y check */ |
| 2006 | | if(m_cop_collision_info[0].max_y >= m_cop_collision_info[1].min_y && m_cop_collision_info[0].min_y <= m_cop_collision_info[1].max_y) |
| 2007 | | res &= ~1; |
| 2008 | | |
| 2009 | | if(m_cop_collision_info[1].max_y >= m_cop_collision_info[0].min_y && m_cop_collision_info[1].min_y <= m_cop_collision_info[0].max_y) |
| 2010 | | res &= ~1; |
| 2011 | | |
| 2012 | | m_cop_hit_val_x = (m_cop_collision_info[0].x - m_cop_collision_info[1].x) >> 16; |
| 2013 | | m_cop_hit_val_y = (m_cop_collision_info[0].y - m_cop_collision_info[1].y) >> 16; |
| 2014 | | m_cop_hit_val_z = 1; |
| 2015 | | m_raiden2cop->cop_hit_val_stat = res; // TODO: there's also bit 2 and 3 triggered in the tests, no known meaning |
| 2016 | | |
| 2017 | | //popmessage("%d %d %04x %04x %04x %04x",m_cop_hit_val_x,m_cop_hit_val_y,m_cop_collision_info[0].hitbox_x,m_cop_collision_info[0].hitbox_y,m_cop_collision_info[1].hitbox_x,m_cop_collision_info[1].hitbox_y); |
| 2018 | | |
| 2019 | | //if(res == 0) |
| 2020 | | //popmessage("0:%08x %08x %08x 1:%08x %08x %08x\n",m_cop_collision_info[0].x,m_cop_collision_info[0].y,m_cop_collision_info[0].hitbox,m_cop_collision_info[1].x,m_cop_collision_info[1].y,m_cop_collision_info[1].hitbox); |
| 2021 | | // popmessage("0:%08x %08x %08x %08x 1:%08x %08x %08x %08x\n",m_cop_collision_info[0].min_x,m_cop_collision_info[0].max_x,m_cop_collision_info[0].min_y, m_cop_collision_info[0].max_y, |
| 2022 | | // m_cop_collision_info[1].min_x,m_cop_collision_info[1].max_x,m_cop_collision_info[1].min_y, m_cop_collision_info[1].max_y); |
| 2023 | | |
| 2024 | | return res; |
| 2025 | | } |
| 2026 | | |
| 2027 | | READ16_MEMBER( seibu_cop_legacy_device::generic_cop_r ) |
| 2028 | | { |
| 2029 | | UINT16 retvalue; |
| 2030 | | retvalue = m_cop_mcu_ram[offset]; |
| 2031 | | |
| 2032 | | |
| 2033 | | switch (offset) |
| 2034 | | { |
| 2035 | | |
| 2036 | | /* these two controls facing direction in Godzilla opponents (only vs.) - x value compare? */ |
| 2037 | | case 0x182/2: |
| 2038 | | return (m_cop_hit_val_y); |
| 2039 | | |
| 2040 | | case 0x184/2: |
| 2041 | | return (m_cop_hit_val_x); |
| 2042 | | |
| 2043 | | /* Legionnaire only - z value compare? */ |
| 2044 | | case 0x186/2: |
| 2045 | | return (m_cop_hit_val_z); |
| 2046 | | |
| 2047 | | |
| 2048 | | |
| 2049 | | |
| 2050 | | |
| 2051 | | default: |
| 2052 | | seibu_cop_log("%06x: COPX unhandled read returning %04x from offset %04x\n", space.device().safe_pc(), retvalue, offset*2); |
| 2053 | | return retvalue; |
| 2054 | | } |
| 2055 | | } |
| 2056 | | |
| 2057 | | WRITE16_MEMBER( seibu_cop_legacy_device::generic_cop_w ) |
| 2058 | | { |
| 2059 | | COMBINE_DATA(&m_cop_mcu_ram[offset]); |
| 2060 | | |
| 2061 | | switch (offset) |
| 2062 | | { |
| 2063 | | default: |
| 2064 | | seibu_cop_log("%06x: COPX unhandled write data %04x at offset %04x\n", space.device().safe_pc(), data, offset*2); |
| 2065 | | break; |
| 2066 | | |
| 2067 | | |
| 2068 | | |
| 2069 | | |
| 2070 | | |
| 2071 | | |
| 2072 | | |
| 2073 | | /* triggered before 0x6200 in Seibu Cup, looks like an angle value ... */ |
| 2074 | | case (0x01c/2): m_legacycop_angle_compare = UINT16(m_cop_mcu_ram[0x1c/2]); break; |
| 2075 | | case (0x01e/2): m_legacycop_angle_mod_val = UINT16(m_cop_mcu_ram[0x1e/2]); break; |
| 2076 | | |
| 2077 | | |
| 2078 | | |
| 2079 | | |
| 2080 | | |
| 2081 | | |
| 2082 | | |
| 2083 | | |
| 2084 | | case (0x03e/2): |
| 2085 | | /* |
| 2086 | | 0 in all 68k based games |
| 2087 | | 0xffff in raiden2 / raidendx |
| 2088 | | 0x2000 in zeroteam / xsedae |
| 2089 | | it's always setted up just before the 0x474 register |
| 2090 | | */ |
| 2091 | | break; |
| 2092 | | |
| 2093 | | case (0x046/2): { m_cop_rom_addr_unk = data & 0xffff; break; } |
| 2094 | | case (0x048/2): { m_cop_rom_addr_lo = data & 0xffff; break; } |
| 2095 | | case (0x04a/2): { m_cop_rom_addr_hi = data & 0xffff; break; } |
| 2096 | | |
| 2097 | | |
| 2098 | | /* DMA / layer clearing section */ |
| 2099 | | case (0x074/2): |
| 2100 | | /* |
| 2101 | | This sets up a DMA mode of some sort |
| 2102 | | 0x0e00: grainbow, cupsoc |
| 2103 | | 0x0a00: legionna, godzilla, denjinmk |
| 2104 | | 0x0600: heatbrl |
| 2105 | | 0x1e00: zeroteam, xsedae |
| 2106 | | raiden2 and raidendx doesn't set this up, this could indicate that this is related to the non-private buffer DMAs |
| 2107 | | (both only uses 0x14 and 0x15 as DMAs) |
| 2108 | | */ |
| 2109 | | break; |
| 2110 | | |
| 2111 | | |
| 2112 | | |
| 2113 | | |
| 2114 | | |
| 2115 | | |
| 2116 | | |
| 2117 | | |
| 2118 | | |
| 2119 | | |
| 2120 | | case (0x08c/2): m_cop_sprite_dma_abs_y = (m_cop_mcu_ram[0x08c/2]); break; |
| 2121 | | case (0x08e/2): m_cop_sprite_dma_abs_x = (m_cop_mcu_ram[0x08e/2]); break; |
| 2122 | | |
| 2123 | | |
| 2124 | | |
| 2125 | | case (0x100/2): |
| 2126 | | case (0x102/2): |
| 2127 | | case (0x104/2): |
| 2128 | | { |
| 2129 | | int command; |
| 2130 | | |
| 2131 | | |
| 2132 | | logerror("%06x: COPX execute table macro command %04x %04x | regs %08x %08x %08x %08x %08x\n", space.device().safe_pc(), data, m_cop_mcu_ram[offset], m_raiden2cop->cop_regs[0], m_raiden2cop->cop_regs[1], m_raiden2cop->cop_regs[2], m_raiden2cop->cop_regs[3], m_raiden2cop->cop_regs[4]); |
| 2133 | | |
| 2134 | | |
| 2135 | | command = m_raiden2cop->find_trigger_match(m_cop_mcu_ram[offset], 0xff00); |
| 2136 | | |
| 2137 | | |
| 2138 | | if (command==-1) |
| 2139 | | { |
| 2140 | | return; |
| 2141 | | } |
| 2142 | | UINT16 funcval,funcmask; |
| 2143 | | // this is pointless.. all we use it for is comparing against the same value |
| 2144 | | funcval = m_raiden2cop->get_func_value(command); |
| 2145 | | funcmask = m_raiden2cop->get_func_mask(command); |
| 2146 | | //printf("%04x %04x %04x\n",m_cop_mcu_ram[offset],funcval,funcmask); |
| 2147 | | |
| 2148 | | /* |
| 2149 | | Macro notes: |
| 2150 | | - endianess changes from/to Raiden 2: |
| 2151 | | dword ^= 0 |
| 2152 | | word ^= 2 |
| 2153 | | byte ^= 3 |
| 2154 | | - some macro commands here have a commented algorithm, it's how Seibu Cup Bootleg version handles maths inside the 14/15 roms. |
| 2155 | | The ROMs map tables in the following arrangement: |
| 2156 | | 0x00000 - 0x1ffff Sine math results |
| 2157 | | 0x20000 - 0x3ffff Cosine math results |
| 2158 | | 0x40000 - 0x7ffff Division math results |
| 2159 | | 0x80000 - 0xfffff Pythagorean theorem, hypotenuse length math results |
| 2160 | | Surprisingly atan maths are nowhere to be found from the roms. |
| 2161 | | */ |
| 2162 | | |
| 2163 | | int executed = 0; |
| 2164 | | |
| 2165 | | /* "automatic" movement, 0205 */ |
| 2166 | | if(m_raiden2cop->check_command_matches(command, 0x188,0x282,0x082,0xb8e,0x98e,0x000,0x000,0x000,6,0xffeb)) |
| 2167 | | { |
| 2168 | | executed = 1; |
| 2169 | | UINT8 offs; |
| 2170 | | |
| 2171 | | offs = (offset & 3) * 4; |
| 2172 | | int ppos = space.read_dword(m_raiden2cop->cop_regs[0] + 4 + offs); |
| 2173 | | int npos = ppos + space.read_dword(m_raiden2cop->cop_regs[0] + 0x10 + offs); |
| 2174 | | int delta = (npos >> 16) - (ppos >> 16); |
| 2175 | | |
| 2176 | | space.write_dword(m_raiden2cop->cop_regs[0] + 4 + offs, npos); |
| 2177 | | space.write_word(m_raiden2cop->cop_regs[0] + 0x1c + offs, space.read_word(m_raiden2cop->cop_regs[0] + 0x1c + offs) + delta); |
| 2178 | | return; |
| 2179 | | } |
| 2180 | | |
| 2181 | | /* "automatic" movement, for arcs in Legionnaire / Zero Team (expression adjustment) 0905 */ |
| 2182 | | if(m_raiden2cop->check_command_matches(command, 0x194,0x288,0x088,0x000,0x000,0x000,0x000,0x000,6,0xfbfb)) |
| 2183 | | { |
| 2184 | | executed = 1; |
| 2185 | | UINT8 offs; |
| 2186 | | |
| 2187 | | offs = (offset & 3) * 4; |
| 2188 | | |
| 2189 | | /* read 0x28 + offs */ |
| 2190 | | /* add 0x10 + offs */ |
| 2191 | | /* write 0x10 + offs */ |
| 2192 | | |
| 2193 | | space.write_dword(m_raiden2cop->cop_regs[0] + 0x10 + offs, space.read_dword(m_raiden2cop->cop_regs[0] + 0x10 + offs) + space.read_dword(m_raiden2cop->cop_regs[0] + 0x28 + offs)); |
| 2194 | | return; |
| 2195 | | } |
| 2196 | | |
| 2197 | | /* SINE math - 0x8100 */ |
| 2198 | | /* |
| 2199 | | 00000-0ffff: |
| 2200 | | amp = x/256 |
| 2201 | | ang = x & 255 |
| 2202 | | s = sin(ang*2*pi/256) |
| 2203 | | val = trunc(s*amp) |
| 2204 | | if(s<0) |
| 2205 | | val-- |
| 2206 | | if(s == 192) |
| 2207 | | val = -2*amp |
| 2208 | | */ |
| 2209 | | if(m_raiden2cop->check_command_matches(command, 0xb9a,0xb88,0x888,0x000,0x000,0x000,0x000,0x000,7,0xfdfb)) |
| 2210 | | { |
| 2211 | | executed = 1; |
| 2212 | | int raw_angle = (space.read_word(m_raiden2cop->cop_regs[0]+(0x34^2)) & 0xff); |
| 2213 | | double angle = raw_angle * M_PI / 128; |
| 2214 | | double amp = (65536 >> 5)*(space.read_word(m_raiden2cop->cop_regs[0]+(0x36^2)) & 0xff); |
| 2215 | | int res; |
| 2216 | | |
| 2217 | | /* TODO: up direction, why? */ |
| 2218 | | if(raw_angle == 0xc0) |
| 2219 | | amp*=2; |
| 2220 | | |
| 2221 | | res = int(amp*sin(angle)) << m_raiden2cop->cop_scale; |
| 2222 | | |
| 2223 | | space.write_dword(m_raiden2cop->cop_regs[0] + 0x10, res); |
| 2224 | | return; |
| 2225 | | } |
| 2226 | | |
| 2227 | | /* COSINE math - 0x8900 */ |
| 2228 | | /* |
| 2229 | | 10000-1ffff: |
| 2230 | | amp = x/256 |
| 2231 | | ang = x & 255 |
| 2232 | | s = cos(ang*2*pi/256) |
| 2233 | | val = trunc(s*amp) |
| 2234 | | if(s<0) |
| 2235 | | val-- |
| 2236 | | if(s == 128) |
| 2237 | | val = -2*amp |
| 2238 | | */ |
| 2239 | | if(m_raiden2cop->check_command_matches(command, 0xb9a,0xb8a,0x88a,0x000,0x000,0x000,0x000,0x000,7,0xfdfb)) |
| 2240 | | { |
| 2241 | | executed = 1; |
| 2242 | | int raw_angle = (space.read_word(m_raiden2cop->cop_regs[0]+(0x34^2)) & 0xff); |
| 2243 | | double angle = raw_angle * M_PI / 128; |
| 2244 | | double amp = (65536 >> 5)*(space.read_word(m_raiden2cop->cop_regs[0]+(0x36^2)) & 0xff); |
| 2245 | | int res; |
| 2246 | | |
| 2247 | | /* TODO: left direction, why? */ |
| 2248 | | if(raw_angle == 0x80) |
| 2249 | | amp*=2; |
| 2250 | | |
| 2251 | | res = int(amp*cos(angle)) << m_raiden2cop->cop_scale; |
| 2252 | | |
| 2253 | | space.write_dword(m_raiden2cop->cop_regs[0] + 20, res); |
| 2254 | | return; |
| 2255 | | } |
| 2256 | | |
| 2257 | | /* 0x130e / 0x138e */ |
| 2258 | | if(m_raiden2cop->check_command_matches(command, 0x984,0xaa4,0xd82,0xaa2,0x39b,0xb9a,0xb9a,0xa9a,5,0xbf7f)) |
| 2259 | | { |
| 2260 | | executed = 1; |
| 2261 | | int dy = space.read_dword(m_raiden2cop->cop_regs[1]+4) - space.read_dword(m_raiden2cop->cop_regs[0]+4); |
| 2262 | | int dx = space.read_dword(m_raiden2cop->cop_regs[1]+8) - space.read_dword(m_raiden2cop->cop_regs[0]+8); |
| 2263 | | |
| 2264 | | m_raiden2cop->cop_status = 7; |
| 2265 | | if(!dx) { |
| 2266 | | m_raiden2cop->cop_status |= 0x8000; |
| 2267 | | m_raiden2cop->cop_angle = 0; |
| 2268 | | } else { |
| 2269 | | m_raiden2cop->cop_angle = atan(double(dy)/double(dx)) * 128.0 / M_PI; |
| 2270 | | if(dx<0) |
| 2271 | | m_raiden2cop->cop_angle += 0x80; |
| 2272 | | } |
| 2273 | | |
| 2274 | | m_r0 = dy; |
| 2275 | | m_r1 = dx; |
| 2276 | | |
| 2277 | | //printf("%d %d %f %04x\n",dx,dy,atan(double(dy)/double(dx)) * 128 / M_PI,m_raiden2cop->cop_angle); |
| 2278 | | |
| 2279 | | if(m_cop_mcu_ram[offset] & 0x80) |
| 2280 | | space.write_word(m_raiden2cop->cop_regs[0]+(0x34^2), m_raiden2cop->cop_angle); |
| 2281 | | return; |
| 2282 | | } |
| 2283 | | |
| 2284 | | /* Pythagorean theorem, hypotenuse direction - 130e / 138e */ |
| 2285 | | //(heatbrl) | 5 | bf7f | 138e | 984 aa4 d82 aa2 39b b9a b9a b9a |
| 2286 | | if(m_raiden2cop->check_command_matches(command, 0x984,0xaa4,0xd82,0xaa2,0x39b,0xb9a,0xb9a,0xb9a,5,0xbf7f)) |
| 2287 | | { |
| 2288 | | executed = 1; |
| 2289 | | int dy = space.read_dword(m_raiden2cop->cop_regs[1]+4) - space.read_dword(m_raiden2cop->cop_regs[0]+4); |
| 2290 | | int dx = space.read_dword(m_raiden2cop->cop_regs[1]+8) - space.read_dword(m_raiden2cop->cop_regs[0]+8); |
| 2291 | | |
| 2292 | | m_raiden2cop->cop_status = 7; |
| 2293 | | if(!dx) { |
| 2294 | | m_raiden2cop->cop_status |= 0x8000; |
| 2295 | | m_raiden2cop->cop_angle = 0; |
| 2296 | | } else { |
| 2297 | | m_raiden2cop->cop_angle = atan(double(dy)/double(dx)) * 128.0 / M_PI; |
| 2298 | | if(dx<0) |
| 2299 | | m_raiden2cop->cop_angle += 0x80; |
| 2300 | | } |
| 2301 | | |
| 2302 | | m_raiden2cop->cop_angle-=0x80; |
| 2303 | | m_r0 = dy; |
| 2304 | | m_r1 = dx; |
| 2305 | | |
| 2306 | | if(m_cop_mcu_ram[offset] & 0x80) |
| 2307 | | space.write_word(m_raiden2cop->cop_regs[0]+(0x34^2), m_raiden2cop->cop_angle); |
| 2308 | | return; |
| 2309 | | } |
| 2310 | | |
| 2311 | | /* Pythagorean theorem, hypotenuse length - 0x3bb0 */ |
| 2312 | | //(grainbow) | 4 | 007f | 3bb0 | f9c b9c b9c b9c b9c b9c b9c 99c |
| 2313 | | /* |
| 2314 | | 40000-7ffff: |
| 2315 | | v1 = (x / 32768)*64 |
| 2316 | | v2 = (x & 255)*32767/255 |
| 2317 | | val = sqrt(v1*v1+v2*v2) (unsigned) |
| 2318 | | */ |
| 2319 | | if(m_raiden2cop->check_command_matches(command, 0xf9c,0xb9c,0xb9c,0xb9c,0xb9c,0xb9c,0xb9c,0x99c,4,0x007f)) |
| 2320 | | { |
| 2321 | | executed = 1; |
| 2322 | | int dy = m_r0; |
| 2323 | | int dx = m_r1; |
| 2324 | | |
| 2325 | | dx >>= 16; |
| 2326 | | dy >>= 16; |
| 2327 | | m_raiden2cop->cop_dist = sqrt((double)(dx*dx+dy*dy)); |
| 2328 | | |
| 2329 | | if(m_cop_mcu_ram[offset] & 0x80) |
| 2330 | | space.write_word(m_raiden2cop->cop_regs[0]+(0x38), m_raiden2cop->cop_dist); |
| 2331 | | return; |
| 2332 | | } |
| 2333 | | |
| 2334 | | /* Division - 0x42c2 */ |
| 2335 | | /* |
| 2336 | | 20000-2ffff: |
| 2337 | | v1 = x / 1024 |
| 2338 | | v2 = x & 1023 |
| 2339 | | val = !v1 ? 32767 : trunc(v2/v1+0.5) |
| 2340 | | 30000-3ffff: |
| 2341 | | v1 = x / 1024 |
| 2342 | | v2 = (x & 1023)*32 |
| 2343 | | val = !v1 ? 32767 : trunc(v2/v1+0.5) |
| 2344 | | */ |
| 2345 | | if(m_raiden2cop->check_command_matches(command, 0xf9a,0xb9a,0xb9c,0xb9c,0xb9c,0x29c,0x000,0x000,5,0xfcdd)) |
| 2346 | | { |
| 2347 | | executed = 1; |
| 2348 | | int dy = m_r0; |
| 2349 | | int dx = m_r1; |
| 2350 | | int div = space.read_word(m_raiden2cop->cop_regs[0]+(0x36^2)); |
| 2351 | | int res; |
| 2352 | | int cop_dist_raw; |
| 2353 | | |
| 2354 | | if(!div) |
| 2355 | | { |
| 2356 | | printf("divide by zero?\n"); |
| 2357 | | div = 1; |
| 2358 | | } |
| 2359 | | |
| 2360 | | /* TODO: calculation of this one should occur at 0x3b30/0x3bb0 I *think* */ |
| 2361 | | /* TODO: recheck if m_raiden2cop->cop_scale still masks at 3 with this command */ |
| 2362 | | dx >>= 11 + m_raiden2cop->cop_scale; |
| 2363 | | dy >>= 11 + m_raiden2cop->cop_scale; |
| 2364 | | cop_dist_raw = sqrt((double)(dx*dx+dy*dy)); |
| 2365 | | |
| 2366 | | res = cop_dist_raw; |
| 2367 | | res /= div; |
| 2368 | | |
| 2369 | | m_raiden2cop->cop_dist = (1 << (5 - m_raiden2cop->cop_scale)) / div; |
| 2370 | | |
| 2371 | | /* TODO: bits 5-6-15 */ |
| 2372 | | m_raiden2cop->cop_status = 7; |
| 2373 | | |
| 2374 | | space.write_word(m_raiden2cop->cop_regs[0]+(0x38^2), res); |
| 2375 | | return; |
| 2376 | | } |
| 2377 | | |
| 2378 | | /* |
| 2379 | | collision detection: |
| 2380 | | |
| 2381 | | int dy_0 = space.read_dword(m_raiden2cop->cop_regs[0]+4); |
| 2382 | | int dx_0 = space.read_dword(m_raiden2cop->cop_regs[0]+8); |
| 2383 | | int dy_1 = space.read_dword(m_raiden2cop->cop_regs[1]+4); |
| 2384 | | int dx_1 = space.read_dword(m_raiden2cop->cop_regs[1]+8); |
| 2385 | | int hitbox_param1 = space.read_dword(m_raiden2cop->cop_regs[2]); |
| 2386 | | int hitbox_param2 = space.read_dword(m_raiden2cop->cop_regs[3]); |
| 2387 | | |
| 2388 | | TODO: we are ignoring the funcval / funcmask params for now |
| 2389 | | */ |
| 2390 | | |
| 2391 | | if(m_raiden2cop->check_command_matches(command, 0xb80,0xb82,0xb84,0xb86,0x000,0x000,0x000,0x000,funcval,funcmask)) |
| 2392 | | { |
| 2393 | | executed = 1; |
| 2394 | | m_cop_collision_info[0].y = (space.read_dword(m_raiden2cop->cop_regs[0]+4)); |
| 2395 | | m_cop_collision_info[0].x = (space.read_dword(m_raiden2cop->cop_regs[0]+8)); |
| 2396 | | return; |
| 2397 | | } |
| 2398 | | |
| 2399 | | //(heatbrl) | 9 | ffff | b080 | b40 bc0 bc2 |
| 2400 | | if(m_raiden2cop->check_command_matches(command, 0xb40,0xbc0,0xbc2,0x000,0x000,0x000,0x000,0x000,funcval,funcmask)) |
| 2401 | | { |
| 2402 | | executed = 1; |
| 2403 | | m_cop_collision_info[0].hitbox = space.read_word(m_raiden2cop->cop_regs[2]); |
| 2404 | | m_cop_collision_info[0].hitbox_y = space.read_word((m_raiden2cop->cop_regs[2]&0xffff0000)|(m_cop_collision_info[0].hitbox)); |
| 2405 | | m_cop_collision_info[0].hitbox_x = space.read_word(((m_raiden2cop->cop_regs[2]&0xffff0000)|(m_cop_collision_info[0].hitbox))+2); |
| 2406 | | |
| 2407 | | /* do the math */ |
| 2408 | | cop_take_hit_box_params(0); |
| 2409 | | m_raiden2cop->cop_hit_status = cop_calculate_collsion_detection(); |
| 2410 | | |
| 2411 | | return; |
| 2412 | | } |
| 2413 | | |
| 2414 | | if(m_raiden2cop->check_command_matches(command, 0xba0,0xba2,0xba4,0xba6,0x000,0x000,0x000,0x000,funcval,funcmask)) |
| 2415 | | { |
| 2416 | | executed = 1; |
| 2417 | | m_cop_collision_info[1].y = (space.read_dword(m_raiden2cop->cop_regs[1]+4)); |
| 2418 | | m_cop_collision_info[1].x = (space.read_dword(m_raiden2cop->cop_regs[1]+8)); |
| 2419 | | return; |
| 2420 | | } |
| 2421 | | |
| 2422 | | //(heatbrl) | 6 | ffff | b880 | b60 be0 be2 |
| 2423 | | if(m_raiden2cop->check_command_matches(command, 0xb60,0xbe0,0xbe2,0x000,0x000,0x000,0x000,0x000,funcval,funcmask)) |
| 2424 | | { |
| 2425 | | executed = 1; |
| 2426 | | m_cop_collision_info[1].hitbox = space.read_word(m_raiden2cop->cop_regs[3]); |
| 2427 | | m_cop_collision_info[1].hitbox_y = space.read_word((m_raiden2cop->cop_regs[3]&0xffff0000)|(m_cop_collision_info[1].hitbox)); |
| 2428 | | m_cop_collision_info[1].hitbox_x = space.read_word(((m_raiden2cop->cop_regs[3]&0xffff0000)|(m_cop_collision_info[1].hitbox))+2); |
| 2429 | | |
| 2430 | | /* do the math */ |
| 2431 | | cop_take_hit_box_params(1); |
| 2432 | | m_raiden2cop->cop_hit_status = cop_calculate_collsion_detection(); |
| 2433 | | return; |
| 2434 | | } |
| 2435 | | |
| 2436 | | // grainbow 0d | a | fff3 | 6980 | b80 ba0 |
| 2437 | | if(m_raiden2cop->check_command_matches(command, 0xb80,0xba0,0x000,0x000,0x000,0x000,0x000,0x000,10,0xfff3)) |
| 2438 | | { |
| 2439 | | executed = 1; |
| 2440 | | UINT8 offs; |
| 2441 | | int abs_x,abs_y,rel_xy; |
| 2442 | | |
| 2443 | | offs = (offset & 3) * 4; |
| 2444 | | |
| 2445 | | /* TODO: I really suspect that following two are actually taken from the 0xa180 macro command then internally loaded */ |
| 2446 | | abs_x = space.read_word(m_raiden2cop->cop_regs[0] + 8) - m_cop_sprite_dma_abs_x; |
| 2447 | | abs_y = space.read_word(m_raiden2cop->cop_regs[0] + 4) - m_cop_sprite_dma_abs_y; |
| 2448 | | rel_xy = space.read_word(m_raiden2cop->m_cop_sprite_dma_src + 4 + offs); |
| 2449 | | |
| 2450 | | //if(rel_xy & 0x0706) |
| 2451 | | // printf("sprite rel_xy = %04x\n",rel_xy); |
| 2452 | | |
| 2453 | | if(rel_xy & 1) |
| 2454 | | space.write_word(m_raiden2cop->cop_regs[4] + offs + 4,0xc0 + abs_x - (rel_xy & 0xf8)); |
| 2455 | | else |
| 2456 | | space.write_word(m_raiden2cop->cop_regs[4] + offs + 4,(((rel_xy & 0x78) + (abs_x) - ((rel_xy & 0x80) ? 0x80 : 0)))); |
| 2457 | | |
| 2458 | | space.write_word(m_raiden2cop->cop_regs[4] + offs + 6,(((rel_xy & 0x7800) >> 8) + (abs_y) - ((rel_xy & 0x8000) ? 0x80 : 0))); |
| 2459 | | return; |
| 2460 | | } |
| 2461 | | |
| 2462 | | // grainbow 18 | a | ff00 | c480 | 080 882 |
| 2463 | | if(m_raiden2cop->check_command_matches(command, 0x080,0x882,0x000,0x000,0x000,0x000,0x000,0x000,10,0xff00)) |
| 2464 | | { |
| 2465 | | executed = 1; |
| 2466 | | UINT8 offs; |
| 2467 | | |
| 2468 | | offs = (offset & 3) * 4; |
| 2469 | | |
| 2470 | | space.write_word(m_raiden2cop->cop_regs[4] + offs + 0,space.read_word(m_raiden2cop->m_cop_sprite_dma_src + offs) + (m_raiden2cop->m_cop_sprite_dma_param & 0x3f)); |
| 2471 | | //space.write_word(m_raiden2cop->cop_regs[4] + offs + 2,space.read_word(m_raiden2cop->m_cop_sprite_dma_src+2 + offs)); |
| 2472 | | return; |
| 2473 | | } |
| 2474 | | |
| 2475 | | // cupsoc 1b | 5 | 7ff7 | dde5 | f80 aa2 984 0c2 |
| 2476 | | /* radar x/y positions */ |
| 2477 | | /* FIXME: x/ys are offsetted */ |
| 2478 | | /* FIXME: uses 0x10044a for something */ |
| 2479 | | if(m_raiden2cop->check_command_matches(command, 0xf80,0xaa2,0x984,0x0c2,0x000,0x000,0x000,0x000,5,0x7ff7)) |
| 2480 | | { |
| 2481 | | executed = 1; |
| 2482 | | UINT8 offs; |
| 2483 | | int div; |
| 2484 | | INT16 dir_offset; |
| 2485 | | // INT16 offs_val; |
| 2486 | | |
| 2487 | | /* TODO: [4-7] could be mirrors of [0-3] (this is the only command so far that uses 4-7 actually)*/ |
| 2488 | | /* ? 0 + [4] */ |
| 2489 | | /* sub32 4 + [5] */ |
| 2490 | | /* write16h 8 + [4] */ |
| 2491 | | /* addmem16 4 + [6] */ |
| 2492 | | |
| 2493 | | // these two are obvious ... |
| 2494 | | // 0xf x 16 = 240 |
| 2495 | | // 0x14 x 16 = 320 |
| 2496 | | // what are these two instead? scale factor? offsets? (edit: offsets to apply from the initial sprite data) |
| 2497 | | // 0xfc69 ? |
| 2498 | | // 0x7f4 ? |
| 2499 | | //printf("%08x %08x %08x %08x %08x %08x %08x\n",m_raiden2cop->cop_regs[0],m_raiden2cop->cop_regs[1],m_raiden2cop->cop_regs[2],m_raiden2cop->cop_regs[3],m_raiden2cop->cop_regs[4],m_raiden2cop->cop_regs[5],m_raiden2cop->cop_regs[6]); |
| 2500 | | |
| 2501 | | offs = (offset & 3) * 4; |
| 2502 | | |
| 2503 | | div = space.read_word(m_raiden2cop->cop_regs[4] + offs); |
| 2504 | | dir_offset = space.read_word(m_raiden2cop->cop_regs[4] + offs + 8); |
| 2505 | | // offs_val = space.read_word(m_raiden2cop->cop_regs[3] + offs); |
| 2506 | | //420 / 180 = 500 : 400 = 30 / 50 = 98 / 18 |
| 2507 | | |
| 2508 | | /* TODO: this probably trips a cop status flag */ |
| 2509 | | if(div == 0) { div = 1; } |
| 2510 | | |
| 2511 | | |
| 2512 | | space.write_word((m_raiden2cop->cop_regs[6] + offs + 4), ((space.read_word(m_raiden2cop->cop_regs[5] + offs + 4) + dir_offset) / div)); |
| 2513 | | return; |
| 2514 | | } |
| 2515 | | |
| 2516 | | //(cupsoc) | 8 | f3e7 | 6200 | 3a0 3a6 380 aa0 2a6 |
| 2517 | | if(m_raiden2cop->check_command_matches(command, 0x3a0,0x3a6,0x380,0xaa0,0x2a6,0x000,0x000,0x000,8,0xf3e7)) |
| 2518 | | { |
| 2519 | | executed = 1; |
| 2520 | | UINT8 cur_angle; |
| 2521 | | UINT16 flags; |
| 2522 | | |
| 2523 | | /* 0 [1] */ |
| 2524 | | /* 0xc [1] */ |
| 2525 | | /* 0 [0] */ |
| 2526 | | /* 0 [1] */ |
| 2527 | | /* 0xc [1] */ |
| 2528 | | |
| 2529 | | cur_angle = space.read_byte(m_raiden2cop->cop_regs[1] + (0xc ^ 3)); |
| 2530 | | flags = space.read_word(m_raiden2cop->cop_regs[1]); |
| 2531 | | //space.write_byte(m_raiden2cop->cop_regs[1] + (0^3),space.read_byte(m_raiden2cop->cop_regs[1] + (0^3)) & 0xfb); //correct? |
| 2532 | | |
| 2533 | | m_legacycop_angle_compare &= 0xff; |
| 2534 | | m_legacycop_angle_mod_val &= 0xff; |
| 2535 | | flags &= ~0x0004; |
| 2536 | | |
| 2537 | | int delta = cur_angle - m_legacycop_angle_compare; |
| 2538 | | if(delta >= 128) |
| 2539 | | delta -= 256; |
| 2540 | | else if(delta < -128) |
| 2541 | | delta += 256; |
| 2542 | | if(delta < 0) |
| 2543 | | { |
| 2544 | | if(delta >= -m_legacycop_angle_mod_val) |
| 2545 | | { |
| 2546 | | cur_angle = m_legacycop_angle_compare; |
| 2547 | | flags |= 0x0004; |
| 2548 | | } |
| 2549 | | else |
| 2550 | | cur_angle += m_legacycop_angle_mod_val; |
| 2551 | | } |
| 2552 | | else |
| 2553 | | { |
| 2554 | | if(delta <= m_legacycop_angle_mod_val) |
| 2555 | | { |
| 2556 | | cur_angle = m_legacycop_angle_compare; |
| 2557 | | flags |= 0x0004; |
| 2558 | | } |
| 2559 | | else |
| 2560 | | cur_angle -= m_legacycop_angle_mod_val; |
| 2561 | | } |
| 2562 | | |
| 2563 | | space.write_byte(m_raiden2cop->cop_regs[1] + (0 ^ 2),flags); |
| 2564 | | space.write_byte(m_raiden2cop->cop_regs[1] + (0xc ^ 3),cur_angle); |
| 2565 | | return; |
| 2566 | | } |
| 2567 | | |
| 2568 | | //(grainbow) | 8 | f3e7 | 6200 | 380 39a 380 a80 29a |
| 2569 | | /* search direction, used on SD Gundam homing weapon */ |
| 2570 | | /* FIXME: still doesn't work ... */ |
| 2571 | | if(m_raiden2cop->check_command_matches(command, 0x380,0x39a,0x380,0xa80,0x29a,0x000,0x000,0x000,8,0xf3e7)) |
| 2572 | | { |
| 2573 | | executed = 1; |
| 2574 | | UINT8 cur_angle; |
| 2575 | | UINT16 flags; |
| 2576 | | |
| 2577 | | cur_angle = space.read_byte(m_raiden2cop->cop_regs[0] + (0x34 ^ 3)); |
| 2578 | | flags = space.read_word(m_raiden2cop->cop_regs[0] + (0 ^ 2)); |
| 2579 | | //space.write_byte(m_raiden2cop->cop_regs[1] + (0^3),space.read_byte(m_raiden2cop->cop_regs[1] + (0^3)) & 0xfb); //correct? |
| 2580 | | |
| 2581 | | m_legacycop_angle_compare &= 0xff; |
| 2582 | | m_legacycop_angle_mod_val &= 0xff; |
| 2583 | | flags &= ~0x0004; |
| 2584 | | |
| 2585 | | int delta = cur_angle - m_legacycop_angle_compare; |
| 2586 | | if(delta >= 128) |
| 2587 | | delta -= 256; |
| 2588 | | else if(delta < -128) |
| 2589 | | delta += 256; |
| 2590 | | if(delta < 0) |
| 2591 | | { |
| 2592 | | if(delta >= -m_legacycop_angle_mod_val) |
| 2593 | | { |
| 2594 | | cur_angle = m_legacycop_angle_compare; |
| 2595 | | flags |= 0x0004; |
| 2596 | | } |
| 2597 | | else |
| 2598 | | cur_angle += m_legacycop_angle_mod_val; |
| 2599 | | } |
| 2600 | | else |
| 2601 | | { |
| 2602 | | if(delta <= m_legacycop_angle_mod_val) |
| 2603 | | { |
| 2604 | | cur_angle = m_legacycop_angle_compare; |
| 2605 | | flags |= 0x0004; |
| 2606 | | } |
| 2607 | | else |
| 2608 | | cur_angle -= m_legacycop_angle_mod_val; |
| 2609 | | } |
| 2610 | | |
| 2611 | | space.write_byte(m_raiden2cop->cop_regs[0] + (0 ^ 3),flags); |
| 2612 | | space.write_word(m_raiden2cop->cop_regs[0] + (0x34 ^ 3),cur_angle); |
| 2613 | | return; |
| 2614 | | } |
| 2615 | | |
| 2616 | | //(cupsoc) 1c | 5 | b07f | e38e | 984 ac4 d82 ac2 39b b9a b9a a9a |
| 2617 | | if(m_raiden2cop->check_command_matches(command, 0x984,0xac4,0xd82,0xac2,0x39b,0xb9a,0xb9a,0xa9a,5,0xb07f)) |
| 2618 | | { |
| 2619 | | executed = 1; |
| 2620 | | int dy = space.read_dword(m_raiden2cop->cop_regs[2]+4) - space.read_dword(m_raiden2cop->cop_regs[0]+4); |
| 2621 | | int dx = space.read_dword(m_raiden2cop->cop_regs[2]+8) - space.read_dword(m_raiden2cop->cop_regs[0]+8); |
| 2622 | | |
| 2623 | | m_raiden2cop->cop_status = 7; |
| 2624 | | if(!dx) { |
| 2625 | | m_raiden2cop->cop_status |= 0x8000; |
| 2626 | | m_raiden2cop->cop_angle = 0; |
| 2627 | | } else { |
| 2628 | | m_raiden2cop->cop_angle = atan(double(dy)/double(dx)) * 128.0 / M_PI; |
| 2629 | | if(dx<0) |
| 2630 | | m_raiden2cop->cop_angle += 0x80; |
| 2631 | | } |
| 2632 | | |
| 2633 | | m_r0 = dy; |
| 2634 | | m_r1 = dx; |
| 2635 | | |
| 2636 | | //printf("%d %d %f %04x\n",dx,dy,atan(double(dy)/double(dx)) * 128 / M_PI,m_raiden2cop->cop_angle); |
| 2637 | | |
| 2638 | | if(m_cop_mcu_ram[offset] & 0x80) |
| 2639 | | space.write_word(m_raiden2cop->cop_regs[0]+(0x34^2), m_raiden2cop->cop_angle); |
| 2640 | | return; |
| 2641 | | } |
| 2642 | | |
| 2643 | | //(cupsoc) 1a | 5 | fffb | d104 | ac2 9e0 0a2 |
| 2644 | | /* controls player vs. player collision detection, 0xf105 controls player vs. ball */ |
| 2645 | | if(m_raiden2cop->check_command_matches(command, 0xac2,0x9e0,0x0a2,0x000,0x000,0x000,0x000,0x000,5,0xfffb)) |
| 2646 | | { |
| 2647 | | executed = 1; |
| 2648 | | UINT8 *ROM = space.machine().root_device().memregion("maincpu")->base(); |
| 2649 | | UINT32 rom_addr = (m_cop_rom_addr_hi << 16 | m_cop_rom_addr_lo) & ~1; |
| 2650 | | UINT16 rom_data = (ROM[rom_addr + 0]) | (ROM[rom_addr + 1]<<8); |
| 2651 | | |
| 2652 | | /* writes to some unemulated COP registers, then puts the result in here, adding a parameter taken from ROM */ |
| 2653 | | //space.write_word(m_raiden2cop->cop_regs[0]+(0x44 + offset * 4), rom_data); |
| 2654 | | |
| 2655 | | printf("%04x%04x %04x %04x\n",m_cop_rom_addr_hi,m_cop_rom_addr_lo,m_cop_rom_addr_unk,rom_data); |
| 2656 | | return; |
| 2657 | | } |
| 2658 | | |
| 2659 | | if (executed==0) printf("did not execute %04x\n",m_cop_mcu_ram[offset]); |
| 2660 | | break; |
| 2661 | | } |
| 2662 | | |
| 2663 | | |
| 2664 | | |
| 2665 | | |
| 2666 | | |
| 2667 | | } |
| 2668 | | } |