src/mess/machine/pce.c
| r9141 | r9142 | |
| 388 | 388 | |
| 389 | 389 | for (joy_i = 0; joy_i < 5; joy_i++) |
| 390 | 390 | { |
| 391 | | if (BIT(joy_type, joy_i)) |
| 391 | if (((joy_type >> (joy_i*2)) & 3) == 2) |
| 392 | 392 | joy_6b_packet[joy_i] ^= 1; |
| 393 | 393 | } |
| 394 | 394 | } |
| r9141 | r9142 | |
| 396 | 396 | |
| 397 | 397 | READ8_HANDLER ( pce_joystick_r ) |
| 398 | 398 | { |
| 399 | | static const char *const joyname[2][5] = { |
| 399 | static const char *const joyname[4][5] = { |
| 400 | 400 | { "JOY_P1", "JOY_P2", "JOY_P3", "JOY_P4", "JOY_P5" }, |
| 401 | | { "JOY6B_P1", "JOY6B_P2", "JOY6B_P3", "JOY6B_P4", "JOY6B_P5" } |
| 401 | { }, |
| 402 | { "JOY6B_P1", "JOY6B_P2", "JOY6B_P3", "JOY6B_P4", "JOY6B_P5" }, |
| 403 | { } |
| 402 | 404 | }; |
| 403 | 405 | UINT8 joy_type = input_port_read(space->machine, "JOY_TYPE"); |
| 404 | 406 | UINT8 ret, data; |
| r9141 | r9142 | |
| 407 | 409 | { |
| 408 | 410 | /* Note: six buttons pad just doesn't work with (almost?) every single 2-button-only games, it's really just an after-thought and it is like this on real HW. */ |
| 409 | 411 | if (joy_6b_packet[joystick_port_select]) // 6 buttons "header" (high 4 bits active low) + III, IV, V, VI |
| 410 | | data = ((input_port_read(space->machine, joyname[BIT(joy_type, joystick_port_select)][joystick_port_select]) >> 8) & 0x0f); |
| 412 | data = ((input_port_read(space->machine, joyname[(joy_type >> (joystick_port_select*2)) & 3][joystick_port_select]) >> 8) & 0x0f); |
| 411 | 413 | else // directions + I, II, Run, Select |
| 412 | | data = input_port_read(space->machine, joyname[BIT(joy_type, joystick_port_select)][joystick_port_select]); |
| 414 | data = input_port_read(space->machine, joyname[(joy_type >> (joystick_port_select*2)) & 3][joystick_port_select]); |
| 413 | 415 | } |
| 414 | 416 | else |
| 415 | 417 | data = 0xff; |
| r9141 | r9142 | |
| 1309 | 1311 | pce_cd_set_adpcm_ram_byte(space->machine, data); |
| 1310 | 1312 | break; |
| 1311 | 1313 | case 0x0B: /* ADPCM DMA control */ |
| 1312 | | if ( ! ( pce_cd.regs[0x0B] & 0x02 ) && ( data & 0x02 ) ) |
| 1314 | if ( ! ( pce_cd.regs[0x0B] & 0x03 ) && ( data & 0x03 ) ) |
| 1313 | 1315 | { |
| 1314 | 1316 | /* Start CD to ADPCM transfer */ |
| 1315 | 1317 | timer_adjust_periodic(pce_cd.adpcm_dma_timer, ATTOTIME_IN_HZ( PCE_CD_DATA_FRAMES_PER_SECOND * 2048 ), 0, ATTOTIME_IN_HZ( PCE_CD_DATA_FRAMES_PER_SECOND * 2048 ) ); |
| 1316 | 1318 | pce_cd.regs[0x0c] |= 4; |
| 1317 | 1319 | } |
| 1318 | | if ( ( pce_cd.regs[0x0B] & 0x02 ) && ! ( data & 0x02 ) ) |
| 1320 | if ( ( pce_cd.regs[0x0B] & 0x03 ) && ! ( data & 0x03 ) ) |
| 1319 | 1321 | { |
| 1320 | 1322 | /* Stop CD to ADPCM transfer (?) */ |
| 1321 | 1323 | timer_adjust_oneshot(pce_cd.adpcm_dma_timer, attotime_never, 0); |
src/mess/drivers/pce.c
| r9141 | r9142 | |
| 252 | 252 | PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P5 Button VI") PORT_PLAYER(5) PORT_CATEGORY(51) |
| 253 | 253 | |
| 254 | 254 | PORT_START("JOY_TYPE") |
| 255 | | PORT_CATEGORY_CLASS(0x01,0x00,"Joystick Type Player 1") |
| 256 | | PORT_CATEGORY_ITEM(0x00,"2-buttons", 10) |
| 257 | | PORT_CATEGORY_ITEM(0x01,"6-buttons", 11) |
| 258 | | PORT_CATEGORY_CLASS(0x02,0x00,"Joystick Type Player 2") |
| 259 | | PORT_CATEGORY_ITEM(0x00,"2-buttons", 20) |
| 260 | | PORT_CATEGORY_ITEM(0x02,"6-buttons", 21) |
| 261 | | PORT_CATEGORY_CLASS(0x04,0x00,"Joystick Type Player 3") |
| 262 | | PORT_CATEGORY_ITEM(0x00,"2-buttons", 30) |
| 263 | | PORT_CATEGORY_ITEM(0x04,"6-buttons", 31) |
| 264 | | PORT_CATEGORY_CLASS(0x08,0x00,"Joystick Type Player 4") |
| 265 | | PORT_CATEGORY_ITEM(0x00,"2-buttons", 40) |
| 266 | | PORT_CATEGORY_ITEM(0x08,"6-buttons", 41) |
| 267 | | PORT_CATEGORY_CLASS(0x10,0x00,"Joystick Type Player 5") |
| 268 | | PORT_CATEGORY_ITEM(0x00,"2-buttons", 50) |
| 269 | | PORT_CATEGORY_ITEM(0x10,"6-buttons", 51) |
| 255 | PORT_CATEGORY_CLASS(0x0003,0x0000,"Joystick Type Player 1") |
| 256 | PORT_CATEGORY_ITEM( 0x0000,"2-buttons", 10) |
| 257 | // PORT_CATEGORY_ITEM( 0x0001,"3-buttons", xx) |
| 258 | PORT_CATEGORY_ITEM( 0x0002,"6-buttons", 11) |
| 259 | // PORT_CATEGORY_ITEM( 0x0003,"Mouse", xx) |
| 260 | PORT_CATEGORY_CLASS(0x000c,0x0000,"Joystick Type Player 2") |
| 261 | PORT_CATEGORY_ITEM( 0x0000,"2-buttons", 20) |
| 262 | // PORT_CATEGORY_ITEM( 0x0004,"3-buttons", xx) |
| 263 | PORT_CATEGORY_ITEM( 0x0008,"6-buttons", 21) |
| 264 | // PORT_CATEGORY_ITEM( 0x000c,"Mouse", xx) |
| 265 | PORT_CATEGORY_CLASS(0x0030,0x0000,"Joystick Type Player 3") |
| 266 | PORT_CATEGORY_ITEM( 0x0000,"2-buttons", 30) |
| 267 | // PORT_CATEGORY_ITEM( 0x0010,"3-buttons", xx) |
| 268 | PORT_CATEGORY_ITEM( 0x0020,"6-buttons", 31) |
| 269 | // PORT_CATEGORY_ITEM( 0x0030,"Mouse", xx) |
| 270 | PORT_CATEGORY_CLASS(0x00c0,0x0000,"Joystick Type Player 4") |
| 271 | PORT_CATEGORY_ITEM( 0x0000,"2-buttons", 40) |
| 272 | // PORT_CATEGORY_ITEM( 0x0040,"3-buttons", xx) |
| 273 | PORT_CATEGORY_ITEM( 0x0080,"6-buttons", 41) |
| 274 | // PORT_CATEGORY_ITEM( 0x00c0,"Mouse", xx) |
| 275 | PORT_CATEGORY_CLASS(0x0300,0x0000,"Joystick Type Player 5") |
| 276 | PORT_CATEGORY_ITEM( 0x0000,"2-buttons", 50) |
| 277 | // PORT_CATEGORY_ITEM( 0x0100,"3-buttons", xx) |
| 278 | PORT_CATEGORY_ITEM( 0x0200,"6-buttons", 51) |
| 279 | // PORT_CATEGORY_ITEM( 0x0300,"Mouse", xx) |
| 270 | 280 | |
| 271 | 281 | PORT_START("A_CARD") |
| 272 | 282 | PORT_CONFNAME( 0x01, 0x01, "Arcade Card" ) |
| 273 | 283 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) |
| 274 | 284 | PORT_CONFSETTING( 0x01, DEF_STR( On ) ) |
| 275 | | |
| 276 | | #if 0 |
| 277 | | PORT_START /* Fake dipswitches for system config */ |
| 278 | | PORT_DIPNAME( 0x01, 0x01, "Console type") |
| 279 | | PORT_DIPSETTING( 0x00, "Turbo-Grafx 16") |
| 280 | | PORT_DIPSETTING( 0x01, "PC-Engine") |
| 281 | | |
| 282 | | PORT_DIPNAME( 0x01, 0x01, "Joystick type") |
| 283 | | PORT_DIPSETTING( 0x00, "2 Button") |
| 284 | | PORT_DIPSETTING( 0x01, "6 Button") |
| 285 | | #endif |
| 286 | 285 | INPUT_PORTS_END |
| 287 | 286 | |
| 288 | 287 | |