summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/highvdeo.c
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2011-06-05 21:53:19 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2011-06-05 21:53:19 +0000
commit69ece3433ccd0a9a30b5c3c3da021f2467c4344f (patch)
tree26f94c4155a700d559ebdb2499eae0adbd820fb2 /src/mame/drivers/highvdeo.c
parent7506e9cf1348c82f1015c256e17fb7f4b529383d (diff)
Added echo emulation to the OkiM6376 sound chip [J. Wallace]
Diffstat (limited to 'src/mame/drivers/highvdeo.c')
-rw-r--r--src/mame/drivers/highvdeo.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index c53181aca83..7d28da446b9 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -26,7 +26,7 @@ Port layout:
0x0000 W Keyboard Lights control port
0x0002 W \ Hopper or ticket related
0x0004 W /
-0x0006 W OKI6395 ADPCM command: need to be latched
+0x0006 W OKI6395 (6376?)ADPCM command: need to be latched
0x0010 W Like 0x3c8 in VGA
0x0014 W Like 0x3c9 in VGA
@@ -235,14 +235,24 @@ static WRITE16_HANDLER( tv_vcf_bankselect_w )
}
-static WRITE16_DEVICE_HANDLER( tv_oki6395_w )
+static WRITE16_DEVICE_HANDLER( tv_oki6376_w )
{
static int okidata;
- if (ACCESSING_BITS_0_7 && okidata != data) {
+ if (ACCESSING_BITS_0_7 && okidata != data)
+ {
okidata = data;
- okim6376_w(device, 0, data);
- okim6376_w(device, 0, (1 << 4));
+ okim6376_w(device, 0, data & ~0x80);
+ okim6376_st_w (device, data & 0x80);
+ }
+}
+
+static READ16_DEVICE_HANDLER( tv_oki6376_r )
+{
+ if (ACCESSING_BITS_0_7)
+ {
+ return okim6376_busy_r(device);
}
+ return 0xff;
}
static WRITE16_HANDLER( write1_w )
@@ -278,12 +288,12 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tv_vcf_io, AS_IO, 16 )
AM_RANGE(0x0000, 0x0001) AM_WRITE( write1_w ) // lamps
- AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6395_w )
+ AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6376_w )
AM_RANGE(0x0008, 0x0009) AM_READ( read1_r )
AM_RANGE(0x000a, 0x000b) AM_READ( read2_r )
AM_RANGE(0x000c, 0x000d) AM_READ( read3_r )
AM_RANGE(0x0010, 0x0015) AM_WRITE( tv_vcf_paletteram_w )
- AM_RANGE(0x0030, 0x0031) AM_WRITE( tv_vcf_bankselect_w ) AM_DEVREAD8( "oki", okim6376_r, 0x00ff )
+ AM_RANGE(0x0030, 0x0031) AM_WRITE( tv_vcf_bankselect_w ) AM_DEVREAD( "oki", tv_oki6376_r )
ADDRESS_MAP_END
@@ -298,15 +308,23 @@ static READ16_HANDLER( tv_ncf_read2_r )
return (input_port_read(space->machine(), "IN1") & 0xbf) | resetpulse;
}
-static WRITE16_DEVICE_HANDLER( tv_ncf_oki6395_w )
+static WRITE16_DEVICE_HANDLER( tv_ncf_oki6376_w )
{
static int okidata;
if (ACCESSING_BITS_0_7 && okidata != data) {
okidata = data;
- okim6376_w(device, 0, data | 0x80);
- okim6376_w(device, 0, (1 << 4));
+ okim6376_w(device, 0, data );
}
}
+
+static WRITE16_DEVICE_HANDLER( tv_ncf_oki6376_st_w )
+{
+ if (ACCESSING_BITS_0_7)
+ {
+ okim6376_st_w(device, (data & 0x80) );
+ }
+}
+
static ADDRESS_MAP_START( tv_ncf_map, AS_PROGRAM, 16 )
AM_RANGE(0x00000, 0x003ff) AM_RAM /*irq vector area*/
AM_RANGE(0x00400, 0x03fff) AM_RAM AM_SHARE("nvram")
@@ -317,7 +335,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tv_ncf_io, AS_IO, 16 )
AM_RANGE(0x0000, 0x0001) AM_WRITE( write1_w ) // lamps
- AM_RANGE(0x0008, 0x0009) AM_DEVWRITE( "oki", tv_ncf_oki6395_w )
+ AM_RANGE(0x0008, 0x0009) AM_DEVWRITE( "oki", tv_ncf_oki6376_w )
+ AM_RANGE(0x000a, 0x000b) AM_DEVWRITE( "oki", tv_ncf_oki6376_st_w )
AM_RANGE(0x000c, 0x000d) AM_READ( read1_r )
AM_RANGE(0x0010, 0x0011) AM_READ( tv_ncf_read2_r )
AM_RANGE(0x0012, 0x0013) AM_READ( read3_r )
@@ -361,7 +380,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( tv_tcf_io, AS_IO, 16 )
AM_RANGE(0x0000, 0x0001) AM_WRITE( write1_w ) // lamps
- AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6395_w )
+ AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6376_w )
AM_RANGE(0x0008, 0x0009) AM_READ( read1_r )
AM_RANGE(0x000a, 0x000b) AM_READ( read2_r )
AM_RANGE(0x0030, 0x0031) AM_READ( read3_r ) AM_WRITE( tv_tcf_bankselect_w )
@@ -423,7 +442,7 @@ static ADDRESS_MAP_START( newmcard_io, AS_IO, 16 )
AM_RANGE(0x0000, 0x0001) AM_WRITE( write1_w ) // lamps
AM_RANGE(0x0002, 0x0003) AM_WRITE( write2_w ) // coin counter & coin lockout
AM_RANGE(0x0004, 0x0005) AM_WRITE( newmcard_vblank_w )
- AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6395_w )
+ AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6376_w )
AM_RANGE(0x0008, 0x0009) AM_READ( read1_r )
AM_RANGE(0x000a, 0x000b) AM_READ( read2_r )
AM_RANGE(0x000c, 0x000d) AM_READ( newmcard_vblank_r )
@@ -491,7 +510,7 @@ static ADDRESS_MAP_START( brasil_io, AS_IO, 16 )
AM_RANGE(0x0030, 0x0031) AM_WRITE( brasil_status_w )
AM_RANGE(0x0000, 0x0001) AM_WRITE( write1_w ) // lamps
AM_RANGE(0x0002, 0x0003) AM_WRITE( write2_w ) // coin counter & coin lockout
- AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6395_w )
+ AM_RANGE(0x0006, 0x0007) AM_DEVWRITE( "oki", tv_oki6376_w )
AM_RANGE(0x0008, 0x0009) AM_READ( read1_r )
AM_RANGE(0x000a, 0x000b) AM_READ( read2_r )
AM_RANGE(0x000e, 0x000f) AM_READ( read3_r )