190
190
if(state->m_prev_bankswitch != param)
192
game_region = machine.region(banknames[param])->base();
192
game_region = machine.root_device().memregion(banknames[param])->base();
195
memcpy(machine.region("abus")->base(), game_region, 0x3000000);
195
memcpy(machine.root_device().memregion("abus")->base(), game_region, 0x3000000);
197
memset(machine.region("abus")->base(), 0x00, 0x3000000);
197
memset(machine.root_device().memregion("abus")->base(), 0x00, 0x3000000);
199
199
state->m_prev_bankswitch = param;
345
345
static const char *const padnames[] = { "JOY1", "JOY2" };
348
pad_data = input_port_read(machine, padnames[pad_num]);
348
pad_data = machine.root_device().ioport(padnames[pad_num])->read();
349
349
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
350
350
state->m_smpc.OREG[1+pad_num*offset] = 0x02;
351
351
state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
360
360
{ "AN_X2", "AN_Y2", "AN_Z2" }};
363
pad_data = input_port_read(machine, padnames[pad_num]);
363
pad_data = machine.root_device().ioport(padnames[pad_num])->read();
364
364
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
365
365
state->m_smpc.OREG[1+pad_num*offset] = id;
366
366
state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
367
367
state->m_smpc.OREG[3+pad_num*offset] = pad_data & 0xff;
368
state->m_smpc.OREG[4+pad_num*offset] = input_port_read(machine, annames[pad_num][0]);
368
state->m_smpc.OREG[4+pad_num*offset] = machine.root_device().ioport(annames[pad_num][0])->read();
371
state->m_smpc.OREG[5+pad_num*offset] = input_port_read(machine, annames[pad_num][1]);
372
state->m_smpc.OREG[6+pad_num*offset] = input_port_read(machine, annames[pad_num][2]);
371
state->m_smpc.OREG[5+pad_num*offset] = machine.root_device().ioport(annames[pad_num][1])->read();
372
state->m_smpc.OREG[6+pad_num*offset] = machine.root_device().ioport(annames[pad_num][2])->read();
381
381
game_key = 0xffff;
383
game_key ^= ((input_port_read(machine, "KEYS_1") & 0x80) << 8); // right
384
game_key ^= ((input_port_read(machine, "KEYS_1") & 0x40) << 8); // left
385
game_key ^= ((input_port_read(machine, "KEYS_1") & 0x20) << 8); // down
386
game_key ^= ((input_port_read(machine, "KEYS_1") & 0x10) << 8); // up
387
game_key ^= ((input_port_read(machine, "KEYF") & 0x80) << 4); // ESC -> START
388
game_key ^= ((input_port_read(machine, "KEY3") & 0x04) << 8); // Z / A trigger
389
game_key ^= ((input_port_read(machine, "KEY4") & 0x02) << 8); // C / C trigger
390
game_key ^= ((input_port_read(machine, "KEY6") & 0x04) << 6); // X / B trigger
391
game_key ^= ((input_port_read(machine, "KEY2") & 0x20) << 2); // Q / R trigger
392
game_key ^= ((input_port_read(machine, "KEY3") & 0x10) << 2); // A / X trigger
393
game_key ^= ((input_port_read(machine, "KEY3") & 0x08) << 2); // S / Y trigger
394
game_key ^= ((input_port_read(machine, "KEY4") & 0x08) << 1); // D / Z trigger
395
game_key ^= ((input_port_read(machine, "KEY4") & 0x10) >> 1); // E / L trigger
383
game_key ^= ((state->ioport("KEYS_1")->read() & 0x80) << 8); // right
384
game_key ^= ((state->ioport("KEYS_1")->read() & 0x40) << 8); // left
385
game_key ^= ((state->ioport("KEYS_1")->read() & 0x20) << 8); // down
386
game_key ^= ((state->ioport("KEYS_1")->read() & 0x10) << 8); // up
387
game_key ^= ((state->ioport("KEYF")->read() & 0x80) << 4); // ESC -> START
388
game_key ^= ((state->ioport("KEY3")->read() & 0x04) << 8); // Z / A trigger
389
game_key ^= ((state->ioport("KEY4")->read() & 0x02) << 8); // C / C trigger
390
game_key ^= ((state->ioport("KEY6")->read() & 0x04) << 6); // X / B trigger
391
game_key ^= ((state->ioport("KEY2")->read() & 0x20) << 2); // Q / R trigger
392
game_key ^= ((state->ioport("KEY3")->read() & 0x10) << 2); // A / X trigger
393
game_key ^= ((state->ioport("KEY3")->read() & 0x08) << 2); // S / Y trigger
394
game_key ^= ((state->ioport("KEY4")->read() & 0x08) << 1); // D / Z trigger
395
game_key ^= ((state->ioport("KEY4")->read() & 0x10) >> 1); // E / L trigger
397
397
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
398
398
state->m_smpc.OREG[1+pad_num*offset] = 0x34;
420
420
UINT8 mouse_ctrl;
421
421
INT16 mouse_x, mouse_y;
423
mouse_ctrl = input_port_read(machine, mousenames[pad_num][0]);
424
mouse_x = input_port_read(machine, mousenames[pad_num][1]);
425
mouse_y = input_port_read(machine, mousenames[pad_num][2]);
423
mouse_ctrl = machine.root_device().ioport(mousenames[pad_num][0])->read();
424
mouse_x = machine.root_device().ioport(mousenames[pad_num][1])->read();
425
mouse_y = machine.root_device().ioport(mousenames[pad_num][2])->read();
428
428
mouse_ctrl |= 0x10;
450
450
static const char *const padnames[] = { "MD_JOY1", "MD_JOY2" };
453
pad_data = input_port_read(machine, padnames[pad_num]);
453
pad_data = machine.root_device().ioport(padnames[pad_num])->read();
454
454
state->m_smpc.OREG[0+pad_num*offset] = 0xf1;
455
455
state->m_smpc.OREG[1+pad_num*offset] = id;
456
456
state->m_smpc.OREG[2+pad_num*offset] = pad_data>>8;
476
476
// if (LOG_SMPC) logerror("SMPC: providing PAD data for intback, pad %d\n", intback_stage-2);
478
read_id[0] = (input_port_read(machine, "INPUT_TYPE")) & 0x0f;
479
read_id[1] = (input_port_read(machine, "INPUT_TYPE")) >> 4;
478
read_id[0] = (machine.root_device().ioport("INPUT_TYPE")->read()) & 0x0f;
479
read_id[1] = (machine.root_device().ioport("INPUT_TYPE")->read()) >> 4;
481
481
/* doesn't work? */
482
482
//pad_num = state->m_smpc.intback_stage - 1;
744
744
return_data = state->m_smpc.SF;
746
746
if (offset == 0x75)//PDR1 read
747
return_data = input_port_read(space->machine(), "DSW1");
747
return_data = state->ioport("DSW1")->read();
749
749
if (offset == 0x77)//PDR2 read
750
750
return_data = (0xfe | space->machine().device<eeprom_device>("eeprom")->read_bit());
866
866
const int shift_bit[4] = { 4, 12, 8, 0 };
867
867
const char *const padnames[] = { "JOY1", "JOY2" };
869
if(input_port_read(space->machine(), "INPUT_TYPE") && !(space->debugger_access()))
869
if(space->machine().root_device().ioport("INPUT_TYPE")->read() && !(space->debugger_access()))
871
871
popmessage("Warning: read with SH-2 direct mode with a non-pad device");
880
880
if (LOG_SMPC) logerror("SMPC: SH-2 direct mode, returning data for phase %d\n", hshake);
882
return_data = 0x80 | 0x10 | ((input_port_read(space->machine(), padnames[offset == 0x77])>>shift_bit[hshake]) & 0xf);
882
return_data = 0x80 | 0x10 | ((space->machine().root_device().ioport(padnames[offset == 0x77])->read()>>shift_bit[hshake]) & 0xf);