diff options
author | 2008-09-08 03:05:09 +0000 | |
---|---|---|
committer | 2008-09-08 03:05:09 +0000 | |
commit | f5d90dac563a8921c5cb2dcd10929ae6400585ec (patch) | |
tree | 72bd8314df086fd220c407f4726b4943f60a51ac /src/emu/machine/ldpr8210.c | |
parent | 9af15fd27ff74bae235ce3add87b235ea3edb1df (diff) |
CPUs, sound chips, devices, and ROM-regions which are specified by devices
now have their tags auto-prefixed with the device's tag. This allows for
multiple instances to be present. For example, the PR-8210 laserdisc player
has a CPU with a tag of "pr8210". When it is included as a device by a
driver, the driver may tag the device "laserdisc". The resulting final
CPU tag name will be "laserdisc:pr8210". Also updated the debugger
expression engine to support names with embedded colons.
Added warnings to ensure that tags used for CPUs, sound chips, regions, and
devices follow some basic rules: they should be less than 12 characters long,
be all lower-case, and only contain letters, numbers, underscores, or dots
(no spaces). This is to ensure that they can be used properly in debugger
expressions and don't get too long or unwieldy to type (even 12 chars is a
bit long).
Diffstat (limited to 'src/emu/machine/ldpr8210.c')
-rw-r--r-- | src/emu/machine/ldpr8210.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c index b5c358a0c54..f3940cc46d4 100644 --- a/src/emu/machine/ldpr8210.c +++ b/src/emu/machine/ldpr8210.c @@ -74,6 +74,7 @@ struct _ldplayer_data void (*cmd_ack_callback)(void); /* callback to clear game command write flag */ /* low-level emulation data */ + int cpunum; UINT8 pia[0x100]; UINT8 porta; UINT8 portb; @@ -204,6 +205,13 @@ INLINE int requires_state_save(UINT8 state) static void pr8210_init(laserdisc_state *ld) { + astring *tempstring = astring_alloc(); + + /* find our CPU */ + astring_printf(tempstring, "%s:%s", ld->device->tag, "pr8210"); + ld->player->cpunum = mame_find_cpu_index(ld->device->machine, astring_c(tempstring)); + astring_free(tempstring); + /* do a soft reset */ pr8210_soft_reset(ld); } @@ -917,7 +925,7 @@ static WRITE8_HANDLER( pr8210_portb_w ) $01 = (out) LASER ON */ ldplayer_data *player = find_pr8210(machine); - cputag_set_input_line(machine, "pr8210", 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); + cpunum_set_input_line(machine, player->cpunum, 0, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE); if ((data & 0x7f) != (player->portb & 0x7f)) { printf("%03X:portb_w = %02X", activecpu_get_pc(), data); |