Previous 15994 Revisions Next

r15774 Monday 6th August, 2012 at 14:17:26 UTC by Angelo Salese
PC-8801: Implemented preliminary YM2608 (OPNA) support
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r15773r15774
2020    - PC-8801MC disk shows that bitmap and text colors mixes with additive blending (basically if the tv charset has white then the bitmap draws
2121      with inverted color output).
2222   - 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;
2325
2426    per-game specific TODO:
2527    - 100yen Disk 2 / Jumper 2: Sound BGM dies pretty soon;
r15773r15774
4042    - Fire Hawk: tries to r/w the opn ports (probably crashed due to floppy?)
4143    - Grobda: palette is ugly (parent pc8801 only);
4244    - 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
4446    - Wanderers from Ys: user data disk looks screwed? It loads with everything as maximum as per now ...
4547    - Xevious: game is too fast (parent pc8801 only)
4648
r15773r15774
168170#include "machine/i8214.h"
169171#include "machine/i8251.h"
170172#include "sound/2203intf.h"
173#include "sound/2608intf.h"
171174#include "sound/beep.h"
172175//#include "includes/pc8801.h"
173176
r15773r15774
323326   DECLARE_WRITE_LINE_MEMBER(txdata_callback);
324327   DECLARE_READ_LINE_MEMBER(dsr_r);
325328   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);
327333};
328334
329335
r15773r15774
14791485   /* TODO: remaining bits */
14801486}
14811487
1488READ8_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
1498WRITE8_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
1508READ8_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
1518WRITE8_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
14821528static ADDRESS_MAP_START( pc8801_io, AS_IO, 8, pc8801_state )
14831529   ADDRESS_MAP_GLOBAL_MASK(0xff)
14841530   ADDRESS_MAP_UNMAP_HIGH
r15773r15774
15091555   AM_RANGE(0x34, 0x34) AM_WRITE(pc8801_alu_ctrl1_w)
15101556   AM_RANGE(0x35, 0x35) AM_WRITE(pc8801_alu_ctrl2_w)
15111557   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 */
15141559   AM_RANGE(0x50, 0x50) AM_READWRITE(pc8801_crtc_param_r, pc88_crtc_param_w)
15151560   AM_RANGE(0x51, 0x51) AM_READWRITE(pc8801_crtc_status_r, pc88_crtc_cmd_w)
15161561   AM_RANGE(0x52, 0x52) AM_WRITE(pc8801_bgpal_w)
r15773r15774
15271572   AM_RANGE(0x78, 0x78) AM_WRITE(pc8801_window_bank_inc_w)
15281573   AM_RANGE(0x90, 0x9f) AM_READWRITE(pc8801_cdrom_r,pc8801_cdrom_w)
15291574//  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 */
15311576//  AM_RANGE(0xb4, 0xb5) AM_NOP                                     /* Video art board */
15321577//  AM_RANGE(0xc1, 0xc1) AM_NOP                                     /* (unknown) */
15331578//  AM_RANGE(0xc2, 0xcf) AM_NOP                                     /* music */
r15773r15774
19271972   PORT_CONFSETTING(    0x0b, "1.1M (PIO-8234H-1M x 1 + PC-8801-02N x 1)" )
19281973   PORT_CONFSETTING(    0x0c, "2.1M (PIO-8234H-2M x 1 + PC-8801-02N x 1)" )
19291974   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)" )
19301980INPUT_PORTS_END
19311981
19321982static INPUT_PORTS_START( pc88sr )
r15773r15774
22962346   pc8801_sound_irq
22972347};
22982348
2349static 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
22992362/* Cassette Configuration */
23002363READ_LINE_MEMBER( pc8801_state::rxdata_callback )
23012364{
r15773r15774
23932456   MCFG_SOUND_CONFIG(pc88_ym2203_intf)
23942457   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
23952458
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
23962463   MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
23972464   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10)
23982465
r15773r15774
24182485   ROM_REGION( 0x10000, "wram", ROMREGION_ERASE00 ) \
24192486   ROM_REGION( 0x1000, "hiwram", ROMREGION_ERASE00 ) \
24202487   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 )
24222491
24232492
24242493ROM_START( pc8801 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team