本文整理汇总了C++中cpu_get_pc函数的典型用法代码示例。如果您正苦于以下问题:C++ cpu_get_pc函数的具体用法?C++ cpu_get_pc怎么用?C++ cpu_get_pc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpu_get_pc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: READ16_HANDLER
static READ16_HANDLER( eeprom_r )
{
int res;
logerror("%06x eeprom_r\n",cpu_get_pc());
/* bit 6 is EEPROM data */
/* bit 7 is EEPROM ready */
/* bit 14 is service button */
res = (EEPROM_read_bit() << 6) | input_port_2_word_r(0,0);
if (init_eeprom_count)
{
init_eeprom_count--;
res &= 0xbfff;
}
return res;
}
示例2: unlock_shared_ram
ADDRESS_MAP_END
/* sub 6809 */
static void unlock_shared_ram(address_space *space)
{
sothello_state *state = space->machine().driver_data<sothello_state>();
if(!space->machine().device<cpu_device>("sub")->suspended(SUSPEND_REASON_HALT))
{
state->m_subcpu_status|=1;
}
else
{
logerror("Sub cpu active! @%x\n",cpu_get_pc(&space->device()));
}
}
示例3: WRITE8_HANDLER
static WRITE8_HANDLER( parodius_3fc0_w )
{
parodius_state *state = space->machine().driver_data<parodius_state>();
if ((data & 0xf4) != 0x10)
logerror("%04x: 3fc0 = %02x\n",cpu_get_pc(&space->device()),data);
/* bit 0/1 = coin counters */
coin_counter_w(space->machine(), 0, data & 0x01);
coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 3 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->m_k052109, (data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
/* other bits unknown */
}
示例4: WRITE8_MEMBER
ADDRESS_MAP_END
/***************************************************************************
Ultra Balloon
***************************************************************************/
/* Bank Switching */
WRITE8_MEMBER(suna16_state::uballoon_pcm_1_bankswitch_w)
{
UINT8 *RAM = memregion("pcm1")->base();
int bank = data & 1;
if (bank & ~1) logerror("CPU#2 PC %06X - ROM bank unknown bits: %02X\n", cpu_get_pc(&space.device()), data);
membank("bank1")->set_base(&RAM[bank * 0x10000 + 0x400]);
}
示例5: WRITE8_HANDLER
static WRITE8_HANDLER( rollerg_0010_w )
{
logerror("%04x: write %02x to 0010\n",cpu_get_pc(space->cpu),data);
/* bits 0/1 are coin counters */
coin_counter_w(0,data & 0x01);
coin_counter_w(1,data & 0x02);
/* bit 2 enables 051316 ROM reading */
readzoomroms = data & 0x04;
/* bit 5 enables 051316 wraparound */
K051316_wraparound_enable(0, data & 0x20);
/* other bits unknown */
}
示例6: WRITE8_HANDLER
static WRITE8_HANDLER( dunhuang_block_h_w )
{
int i,j, addr;
UINT8 *tile_addr;
// logerror("%06x: block dst %x, src %x, xy %x %x, wh %x %x, clr %x\n", cpu_get_pc(space->cpu), dunhuang_block_dest, (dunhuang_block_addr_hi << 8) + dunhuang_block_addr_lo, dunhuang_block_x,dunhuang_block_y,dunhuang_block_w+1,dunhuang_block_h+1,dunhuang_block_c);
dunhuang_block_h = data;
tile_addr = memory_region(space->machine, "gfx2") + ((dunhuang_block_addr_hi << 8) + dunhuang_block_addr_lo)*4;
switch (dunhuang_block_dest)
{
case 0x04: // write to videoram
for (j = 0; j <= dunhuang_block_h; j++)
{
for (i = 0; i <= dunhuang_block_w; i++)
{
addr = ((dunhuang_block_x+i)& 0x3f) + ((dunhuang_block_y+j) & 0x1f) * 0x40;
dunhuang_videoram[addr] = (tile_addr[1] << 8) | tile_addr[0];
dunhuang_colorram[addr] = dunhuang_block_c;
tilemap_mark_tile_dirty(tmap, addr);
tile_addr += 4;
}
}
break;
case 0x08: // write to videoram2
for (j = 0; j <= dunhuang_block_h; j++)
{
for (i = 0; i <= dunhuang_block_w; i++)
{
addr = ((dunhuang_block_x+i)& 0x3f) + ((dunhuang_block_y+j) & 0x7) * 0x40;
dunhuang_videoram2[addr] = (tile_addr[1] << 8) | tile_addr[0];
dunhuang_colorram2[addr] = dunhuang_block_c;
tilemap_mark_tile_dirty(tmap2, addr);
tile_addr += 4;
}
}
break;
default:
popmessage("%06x: block dst=%x", cpu_get_pc(space->cpu), dunhuang_block_dest);
}
}
示例7: READ8_HANDLER
static READ8_HANDLER( cyclej_r )
{
actfancr_state *state = (actfancr_state *)space->machine->driver_data;
int pc = cpu_get_pc(space->cpu);
int ret = state->main_ram[0x26];
if (offset == 1)
return state->main_ram[0x27];
if (pc == 0xe2b1 && ret == 0)
{
cpu_spinuntil_int(space->cpu);
return 1;
}
return ret;
}
示例8: WRITE8_HANDLER
static WRITE8_HANDLER( rollerg_0010_w )
{
rollerg_state *state = space->machine->driver_data<rollerg_state>();
logerror("%04x: write %02x to 0010\n",cpu_get_pc(space->cpu), data);
/* bits 0/1 are coin counters */
coin_counter_w(space->machine, 0, data & 0x01);
coin_counter_w(space->machine, 1, data & 0x02);
/* bit 2 enables 051316 ROM reading */
state->readzoomroms = data & 0x04;
/* bit 5 enables 051316 wraparound */
k051316_wraparound_enable(state->k051316, data & 0x20);
/* other bits unknown */
}
示例9: READ16_HANDLER
static READ16_HANDLER( stadhero_control_r )
{
switch (offset<<1)
{
case 0: /* Player 1 & 2 joystick & buttons */
return (readinputport(0) + (readinputport(1) << 8));
case 2: /* Credits, start buttons */
return readinputport(2) | (readinputport(2)<<8);
case 4: /* Byte 4: Dipswitch bank 2, Byte 5: Dipswitch Bank 1 */
return (readinputport(3) + (readinputport(4) << 8));
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(),0x30c000+offset);
return ~0;
}
示例10: READ16_HANDLER
static READ16_HANDLER( stadhero_control_r )
{
switch (offset<<1)
{
case 0:
return input_port_read(space->machine(), "INPUTS");
case 2:
return input_port_read(space->machine(), "COIN");
case 4:
return input_port_read(space->machine(), "DSW");
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n",cpu_get_pc(&space->device()),0x30c000+offset);
return ~0;
}
示例11: READ8_DEVICE_HANDLER
static READ8_DEVICE_HANDLER( scramble_protection_r )
{
switch (cpu_get_pc(devtag_get_device(device->machine, "maincpu")))
{
case 0x00a8: return 0xf0;
case 0x00be: return 0xb0;
case 0x0c1d: return 0xf0;
case 0x0c6a: return 0xb0;
case 0x0ceb: return 0x40;
case 0x0d37: return 0x60;
case 0x1ca2: return 0x00; /* I don't think it's checked */
case 0x1d7e: return 0xb0;
default:
logerror("%s: read protection\n",cpuexec_describe_context(device->machine));
return 0;
}
}
示例12: READ8_HANDLER
static READ8_HANDLER( mole_protection_r )
{
/* Following are all known examples of Mole Attack
** code reading from the protection circuitry:
**
** 5b0b:
** ram[0x0361] = (ram[0x885+ram[0x8a5])&ram[0x886]
** ram[0x0363] = ram[0x886]
**
** 53c9:
** ram[0xe0] = ram[0x800]+ram[0x802]+ram[0x804]
** ram[0xea] = ram[0x828]
**
** ram[0xe2] = (ram[0x806]&ram[0x826])|ram[0x820]
** ram[0xe3] = ram[0x826]
**
** ram[0x361] = (ram[0x8cd]&ram[0x8ad])|ram[0x8ce]
** ram[0x362] = ram[0x8ae] = 0x32
**
** ram[0x363] = ram[0x809]+ram[0x829]+ram[0x828]
** ram[0x364] = ram[0x808]
*/
switch (offset)
{
case 0x08: return 0xb0; /* random mole placement */
case 0x26:
if (cpu_get_pc(space->cpu) == 0x53d7)
{
return 0x06; /* bonus round */
}
else
{ // pc == 0x515b, 0x5162
return 0xc6; /* game start */
}
case 0x86: return 0x91; /* game over */
case 0xae: return 0x32; /* coinage */
}
/* The above are critical protection reads.
** It isn't clear what effect (if any) the
** remaining reads have; for now we simply
** return 0x00
*/
return 0x00;
}
示例13: WRITE8_HANDLER
static WRITE8_HANDLER( jingbell_magic_w )
{
igs_magic[offset] = data;
if (offset == 0)
return;
switch(igs_magic[0])
{
case 0x01:
break;
default:
// popmessage("magic %x <- %04x",igs_magic[0],data);
logerror("%06x: warning, writing to igs_magic %02x = %02x\n", cpu_get_pc(space->cpu), igs_magic[0], data);
}
}
示例14: READ16_HANDLER
static READ16_HANDLER( zerozone_input_r )
{
switch (offset)
{
case 0x00:
return input_port_read(space->machine, "SYSTEM");
case 0x01:
return input_port_read(space->machine, "INPUTS");
case 0x04:
return input_port_read(space->machine, "DSWB");
case 0x05:
return input_port_read(space->machine, "DSWA");
}
logerror("CPU #0 PC %06x: warning - read unmapped memory address %06x\n", cpu_get_pc(space->cpu), 0x800000 + offset);
return 0x00;
}
示例15: READ16_HANDLER
/* Protection/IO chip 146 */
static READ16_HANDLER( sshangha_protection16_r )
{
switch (offset)
{
case 0x050 >> 1:
return input_port_read(space->machine, "INPUTS");
case 0x76a >> 1:
return input_port_read(space->machine, "SYSTEM");
case 0x0ac >> 1:
return input_port_read(space->machine, "DSW");
// Protection TODO
}
logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",cpu_get_pc(space->cpu),offset<<1);
return sshangha_prot_data[offset];
}