mirror of
https://github.com/holub/mame
synced 2025-06-25 05:44:23 +03:00
some notes from charles
This commit is contained in:
parent
f0fad04eb6
commit
a6ca34b6ee
@ -417,7 +417,6 @@ READ8_MEMBER(segac2_state::io_portc_r)
|
|||||||
// D6 : From uPD7759 pin 18. (/BUSY output)
|
// D6 : From uPD7759 pin 18. (/BUSY output)
|
||||||
int busy = (m_upd7759 != NULL) ? (m_upd7759->busy_r() << 6) : 0x40;
|
int busy = (m_upd7759 != NULL) ? (m_upd7759->busy_r() << 6) : 0x40;
|
||||||
return 0xbf | busy;
|
return 0xbf | busy;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_MEMBER(segac2_state::io_portd_w)
|
WRITE8_MEMBER(segac2_state::io_portd_w)
|
||||||
@ -1375,7 +1374,7 @@ static MACHINE_CONFIG_START( segac, segac2_state )
|
|||||||
MCFG_MACHINE_RESET_OVERRIDE(segac2_state,segac2)
|
MCFG_MACHINE_RESET_OVERRIDE(segac2_state,segac2)
|
||||||
MCFG_NVRAM_ADD_1FILL("nvram") // borencha requires 0xff fill or there is no sound (it lacks some of the init code of the borench set)
|
MCFG_NVRAM_ADD_1FILL("nvram") // borencha requires 0xff fill or there is no sound (it lacks some of the init code of the borench set)
|
||||||
|
|
||||||
MCFG_DEVICE_ADD("io", SEGA_315_5296, 0)
|
MCFG_DEVICE_ADD("io", SEGA_315_5296, XL2_CLOCK/6) // clock divider guessed
|
||||||
MCFG_315_5296_IN_PORTA_CB(IOPORT("P1"))
|
MCFG_315_5296_IN_PORTA_CB(IOPORT("P1"))
|
||||||
MCFG_315_5296_IN_PORTB_CB(IOPORT("P2"))
|
MCFG_315_5296_IN_PORTB_CB(IOPORT("P2"))
|
||||||
MCFG_315_5296_IN_PORTC_CB(READ8(segac2_state, io_portc_r))
|
MCFG_315_5296_IN_PORTC_CB(READ8(segac2_state, io_portc_r))
|
||||||
|
@ -3,8 +3,21 @@
|
|||||||
Sega 315-5296 I/O chip
|
Sega 315-5296 I/O chip
|
||||||
|
|
||||||
Sega 100-pin QFP, with 8 bidirectional I/O ports, and 3 output pins.
|
Sega 100-pin QFP, with 8 bidirectional I/O ports, and 3 output pins.
|
||||||
|
It also has chip select(/FMCS) and clock(CKOT) for a peripheral device.
|
||||||
Commonly used from the late 80s up until Sega Model 2.
|
Commonly used from the late 80s up until Sega Model 2.
|
||||||
|
|
||||||
|
The I/O chip has 64 addresses:
|
||||||
|
$00-0F : I/O ports, security, configuration registers
|
||||||
|
$10-1F : Unused (no effect when read or written)
|
||||||
|
$20-3F : Unused (enables /FMCS output, eg. to YM2151 /CS)
|
||||||
|
|
||||||
|
On System 16 derivatives, the unused locations return the 68000 prefetch
|
||||||
|
value off the bus when read.
|
||||||
|
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
- complete emulation of CNT register
|
||||||
|
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
#include "machine/315-5296.h"
|
#include "machine/315-5296.h"
|
||||||
@ -16,7 +29,6 @@ const device_type SEGA_315_5296 = &device_creator<sega_315_5296_device>;
|
|||||||
// sega_315_5296_device - constructor
|
// sega_315_5296_device - constructor
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
sega_315_5296_device::sega_315_5296_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||||
: device_t(mconfig, SEGA_315_5296, "Sega 315-5296", tag, owner, clock, "315-5296", __FILE__),
|
: device_t(mconfig, SEGA_315_5296, "Sega 315-5296", tag, owner, clock, "315-5296", __FILE__),
|
||||||
m_in_pa_cb(*this),
|
m_in_pa_cb(*this),
|
||||||
@ -100,7 +112,7 @@ void sega_315_5296_device::device_reset()
|
|||||||
|
|
||||||
READ8_MEMBER( sega_315_5296_device::read )
|
READ8_MEMBER( sega_315_5296_device::read )
|
||||||
{
|
{
|
||||||
offset &= 0xf;
|
offset &= 0x3f;
|
||||||
|
|
||||||
switch (offset)
|
switch (offset)
|
||||||
{
|
{
|
||||||
@ -130,6 +142,9 @@ READ8_MEMBER( sega_315_5296_device::read )
|
|||||||
// port direction register & mirror
|
// port direction register & mirror
|
||||||
case 0xd: case 0xf:
|
case 0xd: case 0xf:
|
||||||
return m_dir;
|
return m_dir;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0xff;
|
return 0xff;
|
||||||
@ -138,7 +153,7 @@ READ8_MEMBER( sega_315_5296_device::read )
|
|||||||
|
|
||||||
WRITE8_MEMBER( sega_315_5296_device::write )
|
WRITE8_MEMBER( sega_315_5296_device::write )
|
||||||
{
|
{
|
||||||
offset &= 0xf;
|
offset &= 0x3f;
|
||||||
|
|
||||||
switch (offset)
|
switch (offset)
|
||||||
{
|
{
|
||||||
@ -153,10 +168,16 @@ WRITE8_MEMBER( sega_315_5296_device::write )
|
|||||||
|
|
||||||
// CNT register
|
// CNT register
|
||||||
case 0xe:
|
case 0xe:
|
||||||
// d0-2: CNT0-2, other bits: ?
|
// d0-2: CNT0-2 output pins
|
||||||
|
// note: When CNT2 is configured as clock output, bit 2 of this register has
|
||||||
|
// no effect on the output level of CNT2.
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
(*m_out_cnt_cb[i])(data >> i & 1);
|
(*m_out_cnt_cb[i])(data >> i & 1);
|
||||||
|
|
||||||
|
// d3: CNT2 output mode (1= Clock output, 0= Programmable output)
|
||||||
|
// d4,5: CNT2 clock divider (0= CLK/4, 1= CLK/8, 2= CLK/16, 3= CLK/2)
|
||||||
|
// d6,7: CKOT clock divider (0= CLK/4, 1= CLK/8, 2= CLK/16, 3= CLK/2)
|
||||||
|
// TODO..
|
||||||
m_cnt = data;
|
m_cnt = data;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user