Previous 199869 Revisions Next

r23663 Thursday 13th June, 2013 at 03:43:40 UTC by Carl
mediagx: fix config register access (nw)
[src/mame/drivers]funkball.c mediagx.c pinball2k.c

trunk/src/mame/drivers/pinball2k.c
r23662r23663
386386   UINT8 r = 0;
387387
388388   // 0x22, 0x23, Cyrix configuration registers
389   if (offset == 0x02)
389   if (offset == 0x00)
390390   {
391391   }
392   else if (offset == 0x03)
392   else if (offset == 0x01)
393393   {
394394      r = m_mediagx_config_regs[m_mediagx_config_reg_sel];
395395   }
396   else
397   {
398      r = m_pic8259_1->read(space, offset);
399   }
400396   return r;
401397}
402398
403399WRITE8_MEMBER(pinball2k_state::io20_w)
404400{
405401   // 0x22, 0x23, Cyrix configuration registers
406   if (offset == 0x02)
402   if (offset == 0x00)
407403   {
408404      m_mediagx_config_reg_sel = data;
409405   }
410   else if (offset == 0x03)
406   else if (offset == 0x01)
411407   {
412408      m_mediagx_config_regs[m_mediagx_config_reg_sel] = data;
413409   }
414   else
415   {
416      m_pic8259_1->write(space, offset, data);
417   }
418410}
419411
420412READ32_MEMBER(pinball2k_state::parallel_port_r)
r23662r23663
465457ADDRESS_MAP_END
466458
467459static ADDRESS_MAP_START(mediagx_io, AS_IO, 32, pinball2k_state )
460   AM_RANGE(0x0020, 0x0023) AM_READWRITE8(io20_r, io20_w, 0xffff0000)
468461   AM_IMPORT_FROM(pcat32_io_common)
469   AM_RANGE(0x0020, 0x003f) AM_READWRITE8(io20_r, io20_w, 0xffffffff)
470462   AM_RANGE(0x00e8, 0x00eb) AM_NOP     // I/O delay port
471463   AM_RANGE(0x0378, 0x037b) AM_READWRITE(parallel_port_r, parallel_port_w)
472464   AM_RANGE(0x0cf8, 0x0cff) AM_DEVREADWRITE("pcibus", pci_bus_legacy_device, read, write)
trunk/src/mame/drivers/funkball.c
r23662r23663
247247   UINT8 r = 0;
248248
249249   // 0x22, 0x23, Cyrix configuration registers
250   if (offset == 0x02)
250   if (offset == 0x00)
251251   {
252252   }
253   else if (offset == 0x03)
253   else if (offset == 0x01)
254254   {
255255      r = funkball_config_reg_r();
256256   }
257   else
258   {
259      r = m_pic8259_1->read(space, offset);
260   }
261257   return r;
262258}
263259
264260WRITE8_MEMBER(funkball_state::io20_w)
265261{
266262   // 0x22, 0x23, Cyrix configuration registers
267   if (offset == 0x02)
263   if (offset == 0x00)
268264   {
269265      m_funkball_config_reg_sel = data;
270266   }
271   else if (offset == 0x03)
267   else if (offset == 0x01)
272268   {
273269      funkball_config_reg_w(data);
274270   }
275   else
276   {
277      m_pic8259_1->write(space, offset, data);
278   }
279271}
280272
281273WRITE8_MEMBER( funkball_state::flash_w )
r23662r23663
405397ADDRESS_MAP_END
406398
407399static ADDRESS_MAP_START(funkball_io, AS_IO, 32, funkball_state)
400   AM_RANGE(0x0020, 0x0023) AM_READWRITE8(io20_r, io20_w, 0xffff0000)
408401   AM_IMPORT_FROM(pcat32_io_common)
409   AM_RANGE(0x0020, 0x003f) AM_READWRITE8(io20_r, io20_w, 0xffffffff)
410402   AM_RANGE(0x00e8, 0x00ef) AM_NOP
411403
412404//  AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE16("ide", ide_controller_device, read_cs0_pc, write_cs0_pc, 0xffffffff)
trunk/src/mame/drivers/mediagx.c
r23662r23663
482482   UINT8 r = 0;
483483
484484   // 0x22, 0x23, Cyrix configuration registers
485   if (offset == 0x02)
485   if (offset == 0x00)
486486   {
487487   }
488   else if (offset == 0x03)
488   else if (offset == 0x01)
489489   {
490490      r = m_mediagx_config_regs[m_mediagx_config_reg_sel];
491491   }
492   else
493   {
494      r = m_pic8259_1->read(space, offset);
495   }
496492   return r;
497493}
498494
499495WRITE8_MEMBER(mediagx_state::io20_w)
500496{
501497   // 0x22, 0x23, Cyrix configuration registers
502   if (offset == 0x02)
498   if (offset == 0x00)
503499   {
504500      m_mediagx_config_reg_sel = data;
505501   }
506   else if (offset == 0x03)
502   else if (offset == 0x01)
507503   {
508504      m_mediagx_config_regs[m_mediagx_config_reg_sel] = data;
509505   }
510   else
511   {
512      m_pic8259_1->write(space, offset, data);
513   }
514506}
515507
516508READ32_MEMBER(mediagx_state::parallel_port_r)
r23662r23663
755747ADDRESS_MAP_END
756748
757749static ADDRESS_MAP_START(mediagx_io, AS_IO, 32, mediagx_state )
750   AM_RANGE(0x0020, 0x0023) AM_READWRITE8(io20_r, io20_w, 0xffff0000)
758751   AM_IMPORT_FROM(pcat32_io_common)
759   AM_RANGE(0x0020, 0x003f) AM_READWRITE8(io20_r, io20_w, 0xffffffff)
760752   AM_RANGE(0x00e8, 0x00eb) AM_NOP     // I/O delay port
761753   AM_RANGE(0x01f0, 0x01f7) AM_DEVREADWRITE16("ide", ide_controller_device, read_cs0_pc, write_cs0_pc, 0xffffffff)
762754   AM_RANGE(0x0378, 0x037b) AM_READWRITE(parallel_port_r, parallel_port_w)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team