src/mess/drivers/pc8801.c
| r15773 | r15774 | |
| 20 | 20 | - PC-8801MC disk shows that bitmap and text colors mixes with additive blending (basically if the tv charset has white then the bitmap draws |
| 21 | 21 | with inverted color output). |
| 22 | 22 | - clean-ups, banking and video in particular (i.e. hook-ups with memory region should go away and device models should be used instead) |
| 23 | - OPNA needs dumping of YM2608 deltat ROM |
| 24 | - YMF288 support; |
| 23 | 25 | |
| 24 | 26 | per-game specific TODO: |
| 25 | 27 | - 100yen Disk 2 / Jumper 2: Sound BGM dies pretty soon; |
| r15773 | r15774 | |
| 40 | 42 | - Fire Hawk: tries to r/w the opn ports (probably crashed due to floppy?) |
| 41 | 43 | - Grobda: palette is ugly (parent pc8801 only); |
| 42 | 44 | - Hang-On: typical busted attributes for a N-BASIC game |
| 43 | | - Music Collection Vol. 2 - Final Fantasy Tokushuu: Accesses 0xa8-0xad OPNA ports |
| 45 | - Music Collection Vol. 2 - Final Fantasy Tokushuu: Tries to read to ADPCM delta-T ROM |
| 44 | 46 | - Wanderers from Ys: user data disk looks screwed? It loads with everything as maximum as per now ... |
| 45 | 47 | - Xevious: game is too fast (parent pc8801 only) |
| 46 | 48 | |
| r15773 | r15774 | |
| 168 | 170 | #include "machine/i8214.h" |
| 169 | 171 | #include "machine/i8251.h" |
| 170 | 172 | #include "sound/2203intf.h" |
| 173 | #include "sound/2608intf.h" |
| 171 | 174 | #include "sound/beep.h" |
| 172 | 175 | //#include "includes/pc8801.h" |
| 173 | 176 | |
| r15773 | r15774 | |
| 323 | 326 | DECLARE_WRITE_LINE_MEMBER(txdata_callback); |
| 324 | 327 | DECLARE_READ_LINE_MEMBER(dsr_r); |
| 325 | 328 | DECLARE_WRITE_LINE_MEMBER(rxrdy_w); |
| 326 | | |
| 329 | DECLARE_READ8_MEMBER(pc8801_sound_board_r); |
| 330 | DECLARE_WRITE8_MEMBER(pc8801_sound_board_w); |
| 331 | DECLARE_READ8_MEMBER(pc8801_opna_r); |
| 332 | DECLARE_WRITE8_MEMBER(pc8801_opna_w); |
| 327 | 333 | }; |
| 328 | 334 | |
| 329 | 335 | |
| r15773 | r15774 | |
| 1479 | 1485 | /* TODO: remaining bits */ |
| 1480 | 1486 | } |
| 1481 | 1487 | |
| 1488 | READ8_MEMBER(pc8801_state::pc8801_sound_board_r) |
| 1489 | { |
| 1490 | UINT8 has_opna = machine().root_device().ioport("BOARD_CONFIG")->read() & 1; |
| 1491 | |
| 1492 | if(has_opna) |
| 1493 | return ym2608_r(machine().device("opna"), offset); |
| 1494 | |
| 1495 | return (offset & 2) ? 0xff : ym2203_r(machine().device("opn"), offset); |
| 1496 | } |
| 1497 | |
| 1498 | WRITE8_MEMBER(pc8801_state::pc8801_sound_board_w) |
| 1499 | { |
| 1500 | UINT8 has_opna = machine().root_device().ioport("BOARD_CONFIG")->read() & 1; |
| 1501 | |
| 1502 | if(has_opna) |
| 1503 | ym2608_w(machine().device("opna"), offset,data); |
| 1504 | else if((offset & 2) == 0) |
| 1505 | ym2203_w(machine().device("opn"), offset,data); |
| 1506 | } |
| 1507 | |
| 1508 | READ8_MEMBER(pc8801_state::pc8801_opna_r) |
| 1509 | { |
| 1510 | UINT8 has_opna = machine().root_device().ioport("BOARD_CONFIG")->read() & 1; |
| 1511 | |
| 1512 | if(has_opna && (offset & 2) == 0) |
| 1513 | return ym2608_r(machine().device("opna"), (offset & 1) | ((offset & 4) >> 1)); |
| 1514 | |
| 1515 | return 0xff; |
| 1516 | } |
| 1517 | |
| 1518 | WRITE8_MEMBER(pc8801_state::pc8801_opna_w) |
| 1519 | { |
| 1520 | UINT8 has_opna = machine().root_device().ioport("BOARD_CONFIG")->read() & 1; |
| 1521 | |
| 1522 | if(has_opna && (offset & 2) == 0) |
| 1523 | ym2608_w(machine().device("opna"), (offset & 1) | ((offset & 4) >> 1),data); |
| 1524 | else if(has_opna && offset == 2) |
| 1525 | m_sound_irq_mask = ((data & 0x80) == 0); |
| 1526 | } |
| 1527 | |
| 1482 | 1528 | static ADDRESS_MAP_START( pc8801_io, AS_IO, 8, pc8801_state ) |
| 1483 | 1529 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1484 | 1530 | ADDRESS_MAP_UNMAP_HIGH |
| r15773 | r15774 | |
| 1509 | 1555 | AM_RANGE(0x34, 0x34) AM_WRITE(pc8801_alu_ctrl1_w) |
| 1510 | 1556 | AM_RANGE(0x35, 0x35) AM_WRITE(pc8801_alu_ctrl2_w) |
| 1511 | 1557 | AM_RANGE(0x40, 0x40) AM_READWRITE(pc8801_ctrl_r, pc8801_ctrl_w) |
| 1512 | | AM_RANGE(0x44, 0x45) AM_DEVREADWRITE_LEGACY("opn", ym2203_r,ym2203_w) |
| 1513 | | // AM_RANGE(0x46, 0x47) AM_NOP /* OPNA extra port */ |
| 1558 | AM_RANGE(0x44, 0x47) AM_READWRITE(pc8801_sound_board_r,pc8801_sound_board_w) /* OPN / OPNA ports */ |
| 1514 | 1559 | AM_RANGE(0x50, 0x50) AM_READWRITE(pc8801_crtc_param_r, pc88_crtc_param_w) |
| 1515 | 1560 | AM_RANGE(0x51, 0x51) AM_READWRITE(pc8801_crtc_status_r, pc88_crtc_cmd_w) |
| 1516 | 1561 | AM_RANGE(0x52, 0x52) AM_WRITE(pc8801_bgpal_w) |
| r15773 | r15774 | |
| 1527 | 1572 | AM_RANGE(0x78, 0x78) AM_WRITE(pc8801_window_bank_inc_w) |
| 1528 | 1573 | AM_RANGE(0x90, 0x9f) AM_READWRITE(pc8801_cdrom_r,pc8801_cdrom_w) |
| 1529 | 1574 | // AM_RANGE(0xa0, 0xa3) AM_NOP /* music & network */ |
| 1530 | | // AM_RANGE(0xa8, 0xad) AM_NOP /* second sound board */ |
| 1575 | AM_RANGE(0xa8, 0xad) AM_READWRITE(pc8801_opna_r,pc8801_opna_w) /* second sound board */ |
| 1531 | 1576 | // AM_RANGE(0xb4, 0xb5) AM_NOP /* Video art board */ |
| 1532 | 1577 | // AM_RANGE(0xc1, 0xc1) AM_NOP /* (unknown) */ |
| 1533 | 1578 | // AM_RANGE(0xc2, 0xcf) AM_NOP /* music */ |
| r15773 | r15774 | |
| 1927 | 1972 | PORT_CONFSETTING( 0x0b, "1.1M (PIO-8234H-1M x 1 + PC-8801-02N x 1)" ) |
| 1928 | 1973 | PORT_CONFSETTING( 0x0c, "2.1M (PIO-8234H-2M x 1 + PC-8801-02N x 1)" ) |
| 1929 | 1974 | PORT_CONFSETTING( 0x0d, "4.1M (PIO-8234H-2M x 2 + PC-8801-02N x 1)" ) |
| 1975 | |
| 1976 | PORT_START("BOARD_CONFIG") |
| 1977 | PORT_CONFNAME( 0x01, 0x00, "Sound Board" ) |
| 1978 | PORT_CONFSETTING( 0x00, "OPN (YM2203)" ) |
| 1979 | PORT_CONFSETTING( 0x01, "OPNA (YM2608)" ) |
| 1930 | 1980 | INPUT_PORTS_END |
| 1931 | 1981 | |
| 1932 | 1982 | static INPUT_PORTS_START( pc88sr ) |
| r15773 | r15774 | |
| 2296 | 2346 | pc8801_sound_irq |
| 2297 | 2347 | }; |
| 2298 | 2348 | |
| 2349 | static const ym2608_interface pc88_ym2608_intf = |
| 2350 | { |
| 2351 | { |
| 2352 | AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT, |
| 2353 | AY8910_DEFAULT_LOADS, |
| 2354 | DEVCB_HANDLER(opn_porta_r), |
| 2355 | DEVCB_HANDLER(opn_portb_r), |
| 2356 | DEVCB_NULL, |
| 2357 | DEVCB_NULL |
| 2358 | }, |
| 2359 | pc8801_sound_irq |
| 2360 | }; |
| 2361 | |
| 2299 | 2362 | /* Cassette Configuration */ |
| 2300 | 2363 | READ_LINE_MEMBER( pc8801_state::rxdata_callback ) |
| 2301 | 2364 | { |
| r15773 | r15774 | |
| 2393 | 2456 | MCFG_SOUND_CONFIG(pc88_ym2203_intf) |
| 2394 | 2457 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 2395 | 2458 | |
| 2459 | MCFG_SOUND_ADD("opna", YM2608, MASTER_CLOCK) |
| 2460 | MCFG_SOUND_CONFIG(pc88_ym2608_intf) |
| 2461 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 2462 | |
| 2396 | 2463 | MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0) |
| 2397 | 2464 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 2398 | 2465 | |
| r15773 | r15774 | |
| 2418 | 2485 | ROM_REGION( 0x10000, "wram", ROMREGION_ERASE00 ) \ |
| 2419 | 2486 | ROM_REGION( 0x1000, "hiwram", ROMREGION_ERASE00 ) \ |
| 2420 | 2487 | ROM_REGION( 0x40000, "ewram", ROMREGION_ERASE00 ) \ |
| 2421 | | ROM_REGION( 0xc000, "gvram", ROMREGION_ERASE00 ) |
| 2488 | ROM_REGION( 0xc000, "gvram", ROMREGION_ERASE00 ) \ |
| 2489 | ROM_REGION( 0x100000, "ymsnd", ROMREGION_ERASEFF ) \ |
| 2490 | ROM_LOAD( "opna.rom", 0x00000, 0x20000, NO_DUMP ) |
| 2422 | 2491 | |
| 2423 | 2492 | |
| 2424 | 2493 | ROM_START( pc8801 ) |