Previous 199869 Revisions Next

r32407 Friday 26th September, 2014 at 16:20:49 UTC by David Haywood
debug stuff (nw)
[src/mame/drivers]legionna.c
[src/mame/machine]raiden2cop.c

trunk/src/mame/machine/raiden2cop.c
r32406r32407
1313// use Z to dump out table info
1414//#define TABLE_DUMPER
1515
16
17#define LOG_CMDS 0
18
19#define seibu_cop_log \
20   if (LOG_CMDS) logerror
21
22
1623const device_type RAIDEN2COP = &device_creator<raiden2cop_device>;
1724
1825raiden2cop_device::raiden2cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
r32406r32407
336343   cop_latch_trigger = data;
337344}
338345
339#define seibu_cop_log logerror
340#define LOG_CMDS 1
341346
347
348
342349// currently only used by legionna.c implementation
343350int raiden2cop_device::find_trigger_match(UINT16 triggerval, UINT16 mask)
344351{
r32406r32407
356363
357364      if ((triggerval & mask) == (cop_func_trigger[i] & mask) && cop_func_trigger[i] != 0) /* cop_func_trigger[i] != 0 is just being used to prevent matching against empty / unused slots */
358365      {
359#if LOG_CMDS
366         int otherlog = 1;
367         
368         // just some per-game debug code so that we have a record of exactly which triggers each game is known to use
369         if (!strcmp(machine().system().name, "legionna"))
370         {
371            if (triggerval == 0x0205 || triggerval == 0x0905 ||
372               triggerval == 0x8100 || triggerval == 0x8900 || /* sin / cos */
373               triggerval == 0x138e || // atan?
374               triggerval == 0x3bb0 || // distance?
375               triggerval == 0x42c2 || // distance?
376               triggerval == 0xa180 || triggerval == 0xa980 || triggerval == 0xb100 || triggerval == 0xb900) /* collisions */
377               otherlog = 0;
378         }
379         else
380         {
381            otherlog = 0;
382         }
383
360384         seibu_cop_log("    Cop Command %04x found in slot %02x with other params %04x %04x\n", triggerval, i, cop_func_value[i], cop_func_mask[i]);
361#endif
385
386         if (otherlog == 1) printf("used command %04x\n", triggerval);
387
362388         command = i;
363389         matched++;
364390      }
r32406r32407
380406   else if (matched == 0)
381407   {
382408      seibu_cop_log("    Cop Command %04x NOT IN TABLE!\n", triggerval);
409      printf("Command Not Found!\n");
383410      return -1;
384411   }
385412
386   printf("multiple matches found with mask passed in! (bad!) (%04x %04x)\n", triggerval, mask);
413   printf("multiple matches found with mask passed in! (bad!) (%04x %04x)\n", triggerval, mask); // this should never happen with the uploaded tables
387414   return -1;
388415
389416}
r32406r32407
16441671      dx[i] = INT8(cop_collision_info[slot].dx[i]);
16451672   }
16461673
1674   //printf("%02x %02x %02x %02x %02x %02x\n", (UINT8)size[i], (UINT8)dx[i], (UINT8)size[1], (UINT8)dx[1], (UINT8)size[2], (UINT8)dx[2]);
1675
16471676   int j = slot;
16481677   
16491678   UINT8 res;
r32406r32407
19932022   int command;
19942023   
19952024
1996   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]);
2025   seibu_cop_log("%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]);
19972026
19982027
19992028   command = find_trigger_match(data, 0xf800);
trunk/src/mame/drivers/legionna.c
r32406r32407
167167   AM_IMPORT_FROM( legionna_cop_mem )
168168   AM_RANGE(0x000000, 0x07ffff) AM_ROM
169169   AM_RANGE(0x100000, 0x1003ff) AM_RAM
170   AM_RANGE(0x100470, 0x100471) AM_WRITENOP // toggles 0x2000 / 0x0000, tile bank on some games
170171   AM_RANGE(0x100600, 0x10063f) AM_DEVREADWRITE("crtc", seibu_crtc_device, read, write)
172   AM_RANGE(0x100680, 0x100681) AM_WRITENOP // writes 0x0000
171173   AM_RANGE(0x100700, 0x10071f) AM_READWRITE(sound_comms_r,sound_comms_w)
172174   AM_RANGE(0x100740, 0x100741) AM_READ_PORT("DSW1")
173175   AM_RANGE(0x100744, 0x100745) AM_READ_PORT("PLAYERS12")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team