summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author dankan1890 <mewuidev2@gmail.com>2016-02-07 03:33:24 +0100
committer dankan1890 <mewuidev2@gmail.com>2016-02-07 03:33:24 +0100
commit14b2b34022c359851a0b25ca4ce9c2bd04a6f52e (patch)
treeb498189ab75cca1453ac2a2660e1d6182e317825
parente15dca747c4840bcb039bdbee074f410d622c85a (diff)
parent45b5f1e5d2e95e44fa852f7a9598ac253d5af562 (diff)
Merge branch 'master' of https://github.com/mamedev/mame
-rw-r--r--hash/casloopy.xml2
-rw-r--r--hash/k28.xml81
-rw-r--r--hash/pico.xml2
-rw-r--r--src/mame/arcade.lst5
-rw-r--r--src/mame/drivers/deco156.cpp32
-rw-r--r--src/mame/drivers/fidelz80.cpp28
-rw-r--r--src/mame/drivers/hh_tms1k.cpp2
-rw-r--r--src/mame/drivers/merit.cpp14
-rw-r--r--src/mame/drivers/tispeak.cpp176
-rw-r--r--src/mame/layout/k28.lay26
-rw-r--r--src/mame/mess.lst9
-rw-r--r--src/osd/modules/sound/js_sound.js312
12 files changed, 497 insertions, 192 deletions
diff --git a/hash/casloopy.xml b/hash/casloopy.xml
index 6573fddaa37..26e36c95a97 100644
--- a/hash/casloopy.xml
+++ b/hash/casloopy.xml
@@ -91,7 +91,7 @@
<year>1996</year>
<publisher>Casio</publisher>
<info name="serial" value="XK-504"/>
- <info name="alt_name" value="ルーピータウンのおへやがほしい!"/>
+ <info name="alt_name" value="ルーピータウンのおへやがほしい!"/>
<part name="cart" interface="loopy_cart">
<dataarea name="rom" size="0x300000">
<rom name="CHIP1.IC104" size="0x200000" crc="bae71d45" sha1="79628715ccedd9bc3fd72d21fa9ea6513b88cf51" offset="0x000000" />
diff --git a/hash/k28.xml b/hash/k28.xml
new file mode 100644
index 00000000000..842c7da0312
--- /dev/null
+++ b/hash/k28.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
+
+<softwarelist name="k28" description="Tiger K28 modules">
+
+ <software name="m1">
+ <description>Expansion Module 1</description>
+ <year>1986?</year>
+ <publisher>Tiger Electronics</publisher>
+ <info name="serial" value="CM62086"/>
+ <part name="cart" interface="k28">
+ <dataarea name="rom" size="0x4000">
+ <rom name="cm62086.vsm" size="0x4000" crc="0349798b" sha1="afdad242f9c7dec0c5fd83670e3d8f1637140e76" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="m2">
+ <description>Expansion Module 2</description>
+ <year>1986</year>
+ <publisher>Tiger Electronics</publisher>
+ <info name="serial" value="CM62216"/>
+ <part name="cart" interface="k28">
+ <dataarea name="rom" size="0x4000">
+ <rom name="cm62216.vsm" size="0x4000" crc="1c99306f" sha1="7bfadeec79bdc231c4e3447149e2f6542cfe077d" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="m3">
+ <description>Expansion Module 3</description>
+ <year>1986</year>
+ <publisher>Tiger Electronics</publisher>
+ <info name="serial" value="CM62215"/>
+ <part name="cart" interface="k28">
+ <dataarea name="rom" size="0x4000">
+ <rom name="cm62215.vsm" size="0x4000" crc="f2deb9a2" sha1="9fb264b869d1298ebd76811931bed83ac122fe4b" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+ <software name="m4">
+ <description>Expansion Module 4</description>
+ <year>1986</year>
+ <publisher>Tiger Electronics</publisher>
+ <info name="serial" value="CM62217"/>
+ <part name="cart" interface="k28">
+ <dataarea name="rom" size="0x4000">
+ <rom name="cm62217.vsm" size="0x4000" crc="995936b2" sha1="8bd0fea4ade9972d1d6cb521f9367c971c7eead6" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+<!--
+ <software name="m5">
+ <description>Expansion Module 5</description>
+ <year>1987</year>
+ <publisher>Tiger Electronics</publisher>
+ <info name="serial" value="CM62218"/>
+ <part name="cart" interface="k28">
+ <dataarea name="rom" size="0x4000">
+ <rom name="cm62217.vsm" size="0x4000" crc="x" sha1="x" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+-->
+
+ <software name="m6">
+ <description>Expansion Module 6</description>
+ <year>1987</year>
+ <publisher>Tiger Electronics</publisher>
+ <info name="serial" value="CM62219"/>
+ <part name="cart" interface="k28">
+ <dataarea name="rom" size="0x4000">
+ <rom name="cm62219.vsm" size="0x4000" crc="177b5cb5" sha1="2ed44fea8f931fc8aa46dafdda1c6c30b8c9dc01" offset="0" />
+ </dataarea>
+ </part>
+ </software>
+
+
+</softwarelist>
diff --git a/hash/pico.xml b/hash/pico.xml
index 71ba190c791..08dc5b5ec30 100644
--- a/hash/pico.xml
+++ b/hash/pico.xml
@@ -1818,7 +1818,7 @@ Published by Others (T-yyy*** serial codes, for yyy depending on the publisher)
<year>1995</year>
<publisher>Imagineer</publisher>
<part name="cart" interface="pico_cart">
- <feature name="pcb" value="171-6882A" />
+ <feature name="pcb" value="171-6882A" />
<dataarea name="rom" size="524288">
<rom name="mpr-18565-t.ic1" size="524288" crc="8ba23bbe" sha1="85e6ed98f5e7bfa04c1b099bba79ddd34ccdd40e" offset="000000" loadflag="load16_word_swap" />
</dataarea>
diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst
index c460da1fea6..45f41a0882a 100644
--- a/src/mame/arcade.lst
+++ b/src/mame/arcade.lst
@@ -6367,6 +6367,7 @@ charlien // MBR (c) 1994 Mitchell
// MBV ??
// MBW ??
wcvol95 // MBX (c) 1993 Data East
+wcvol95x // ?
// MBY ??
backfire // MBZ (c) 1995
backfirea // MBZ (c) 1995
@@ -10978,8 +10979,8 @@ phrcrazea // (c) 1986 Merit
phrcrazeb // (c) 1986 Merit
phrcrazec // (c) 1986 Merit
phrcrazev // (c) 1986 Merit
-bigappg // (c) 1986 Merit
-bigappga //
+bigappg // (c) 1986 Merit / Big Apple Games
+misdraw // (c) 1986 Merit / Big Apple Games
riviera // (c) 1987 Merit
rivieraa // (c) 1986 Merit
rivierab // (c) 1986 Merit
diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp
index faa0f3bb6a5..b8ab102bee1 100644
--- a/src/mame/drivers/deco156.cpp
+++ b/src/mame/drivers/deco156.cpp
@@ -8,9 +8,6 @@
See also deco32.c, deco_mlc.c, backfire.c
- Todo:
- complete co-processor emulation for wcvol95
-
Emulation by Bryan McPhail, mish@tendril.co.uk
*/
@@ -628,8 +625,36 @@ ROM_START( wcvol95 )
// ROM_REGION( 0x80, "user1", 0 ) /* eeprom */
// ROM_LOAD( "93c46.3k", 0x00, 0x80, CRC(88f8e270) SHA1(cb82203ad38e0c12ea998562b7b785979726afe5) )
+
+ ROM_REGION( 0x200, "gals", 0 )
+ ROM_LOAD( "GAL16V8B.10J.bin", 0x000, 0x117, CRC(06bbcbd5) SHA1(f7adb4bca13bb799bc42411eb178edfdc11a76c7) )
+ ROM_LOAD( "GAL16V8B.5D.bin", 0x000, 0x117, CRC(117784f0) SHA1(daf3720740621fc3af49333c96795718b693f4d2))
ROM_END
+
+
+ROM_START( wcvol95x )
+ ROM_REGION( 0x100000, "maincpu", 0 ) /* DE156 code (encrypted) */
+ // no label markings were present
+ ROM_LOAD32_WORD( "2f.bin", 0x000002, 0x080000, CRC(ac06633d) SHA1(5d37ca3050f35d5fc06f70e91b1522e325471585) )
+ ROM_LOAD32_WORD( "4f.bin", 0x000000, 0x080000, CRC(e211f67a) SHA1(d008c2b809482f17ada608134357fa1205d767d4) )
+
+ ROM_REGION( 0x080000, "gfx1", 0 )
+ ROM_LOAD( "mbx-00.9a", 0x000000, 0x080000, CRC(a0b24204) SHA1(cec8089c6c635f23b3a4aeeef2c43f519568ad70) )
+
+ ROM_REGION( 0x200000, "gfx2", 0 )
+ ROM_LOAD16_BYTE( "mbx-01.12a", 0x000000, 0x100000, CRC(73deb3f1) SHA1(c0cabecfd88695afe0f27c5bb115b4973907207d) )
+ ROM_LOAD16_BYTE( "mbx-02.13a", 0x000001, 0x100000, CRC(3204d324) SHA1(44102f71bae44bf3a9bd2de7e5791d959a2c9bdd) )
+
+ ROM_REGION( 0x200000, "ymz", 0 ) /* YMZ280B-F samples */
+ ROM_LOAD( "mbx-03.13j", 0x00000, 0x200000, CRC(061632bc) SHA1(7900ac56e59f4a4e5768ce72f4a4b7c5875f5ae8) )
+
+ ROM_REGION( 0x200, "gals", 0 )
+ ROM_LOAD( "GAL16V8B.10J.bin", 0x000, 0x117, CRC(06bbcbd5) SHA1(f7adb4bca13bb799bc42411eb178edfdc11a76c7) )
+ ROM_LOAD( "GAL16V8B.5D.bin", 0x000, 0x117, CRC(117784f0) SHA1(daf3720740621fc3af49333c96795718b693f4d2))
+ROM_END
+
+
/**********************************************************************************/
void deco156_state::descramble_sound( const char *tag )
@@ -677,3 +702,4 @@ GAME( 1993, hvysmsh, 0, hvysmsh, hvysmsh, deco156_state, hvysmsh, ROT0,
GAME( 1993, hvysmsha, hvysmsh, hvysmsh, hvysmsh, deco156_state, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Asia version -4)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, hvysmshj, hvysmsh, hvysmsh, hvysmsh, deco156_state, hvysmsh, ROT0, "Data East Corporation", "Heavy Smash (Japan version -2)", MACHINE_SUPPORTS_SAVE )
GAME( 1995, wcvol95, 0, wcvol95, wcvol95, deco156_state, wcvol95, ROT0, "Data East Corporation", "World Cup Volley '95 (Japan v1.0)", MACHINE_SUPPORTS_SAVE )
+GAME( 1995, wcvol95x, wcvol95, wcvol95, wcvol95, deco156_state, wcvol95, ROT0, "Data East Corporation", "World Cup Volley '95 Extra Version (Asia v2.0B)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index 7fdf806f635..3ebb4f2919e 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -10,7 +10,7 @@
It sometimes does this on Voice Sensory Chess Challenger real hardware.
It can also be heard on Advanced Voice Chess Challenger real hardware, but not the whole line:
"I I am Fidelity's chess challenger", instead.
- - correctly hook up VBRC speech so that the z80 is halted while words are being spoken
+ - VBRC card scanner
Chess pieces are required, but theoretically blindfold chess is possible.
Chessboard artwork is provided for boards with pressure/magnet sensors.
@@ -1327,21 +1327,16 @@ ADDRESS_MAP_END
WRITE8_MEMBER(fidelz80_state::vbrc_speech_w)
{
- //printf("%X ",data);
-
- // todo: HALT THE z80 here, and set up a callback to poll the s14001a BUSY line to resume z80
m_speech->data_w(space, 0, data & 0x3f);
m_speech->start_w(1);
m_speech->start_w(0);
-
- //m_speech->start_w(BIT(data, 7));
}
static ADDRESS_MAP_START( vbrc_main_map, AS_PROGRAM, 8, fidelz80_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x5fff) AM_ROM
AM_RANGE(0x6000, 0x63ff) AM_MIRROR(0x1c00) AM_RAM
- AM_RANGE(0xe000, 0xffff) AM_MIRROR(0x1fff) AM_WRITE(vbrc_speech_w)
+ AM_RANGE(0xe000, 0xe000) AM_MIRROR(0x1fff) AM_WRITE(vbrc_speech_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( vbrc_main_io, AS_IO, 8, fidelz80_state )
@@ -1408,13 +1403,13 @@ static INPUT_PORTS_START( vcc )
PORT_INCLUDE( vcc_base )
PORT_START("IN.4") // PCB jumpers, not consumer accessible
- PORT_CONFNAME( 0x01, 0x00, "Language: French" )
+ PORT_CONFNAME( 0x01, 0x00, "Language: German" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
PORT_CONFSETTING( 0x01, DEF_STR( On ) )
- PORT_CONFNAME( 0x02, 0x00, "Language: Spanish" )
+ PORT_CONFNAME( 0x02, 0x00, "Language: French" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
PORT_CONFSETTING( 0x02, DEF_STR( On ) )
- PORT_CONFNAME( 0x04, 0x00, "Language: German" )
+ PORT_CONFNAME( 0x04, 0x00, "Language: Spanish" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
PORT_CONFSETTING( 0x04, DEF_STR( On ) )
PORT_CONFNAME( 0x08, 0x00, "Language: Special" )
@@ -1426,27 +1421,27 @@ static INPUT_PORTS_START( vccfr )
PORT_INCLUDE( vcc )
PORT_MODIFY("IN.4")
- PORT_CONFNAME( 0x01, 0x01, "Language: French" )
+ PORT_CONFNAME( 0x02, 0x02, "Language: French" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
- PORT_CONFSETTING( 0x01, DEF_STR( On ) )
+ PORT_CONFSETTING( 0x02, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( vccsp )
PORT_INCLUDE( vcc )
PORT_MODIFY("IN.4")
- PORT_CONFNAME( 0x02, 0x02, "Language: Spanish" )
+ PORT_CONFNAME( 0x04, 0x04, "Language: Spanish" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
- PORT_CONFSETTING( 0x02, DEF_STR( On ) )
+ PORT_CONFSETTING( 0x04, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( vccg )
PORT_INCLUDE( vcc )
PORT_MODIFY("IN.4")
- PORT_CONFNAME( 0x04, 0x04, "Language: German" )
+ PORT_CONFNAME( 0x01, 0x01, "Language: German" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
- PORT_CONFSETTING( 0x04, DEF_STR( On ) )
+ PORT_CONFSETTING( 0x01, DEF_STR( On ) )
INPUT_PORTS_END
@@ -1766,6 +1761,7 @@ static MACHINE_CONFIG_START( vbrc, fidelz80_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speech", S14001A, 25000) // R/C circuit, around 25khz
+ MCFG_S14001A_BSY_HANDLER(INPUTLINE("maincpu", Z80_INPUT_LINE_WAIT))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp
index 9b30fd89b66..68e14d4514b 100644
--- a/src/mame/drivers/hh_tms1k.cpp
+++ b/src/mame/drivers/hh_tms1k.cpp
@@ -74,7 +74,7 @@
*MP7303 TMS1400? 19??, Tiger 7-in-1 Sports Stadium
@MP7313 TMS1400 1980, Parker Brothers Bank Shot
@MP7314 TMS1400 1980, Parker Brothers Split Second
- *MP7324 TMS1400? 1985, Coleco Talking Teacher
+ MP7324 TMS1400 1985, Tiger K28/Coleco Talking Teacher -> tispeak.cpp
MP7332 TMS1400 1981, Milton Bradley Dark Tower -> mbdtower.cpp
@MP7334 TMS1400 1981, Coleco Total Control 4
@MP7351 TMS1400CR 1982, Parker Brothers Master Merlin
diff --git a/src/mame/drivers/merit.cpp b/src/mame/drivers/merit.cpp
index daf603d10f5..f438e37dea9 100644
--- a/src/mame/drivers/merit.cpp
+++ b/src/mame/drivers/merit.cpp
@@ -59,7 +59,7 @@ Merit Riviera Notes - There are several known versions:
Riviera Super Star (not dumped)
Riviera Montana Version (with journal printer, not dumped)
Riviera Tennessee Draw (not dumped)
- Michigan Superstar Draw Poker (not dumped)
+ Michigan Super Draw Poker (Is there a "Superstar" version?)
Americana
There are several law suites over the Riviera games. Riviera Distributors Inc. bought earlier versions
@@ -422,7 +422,7 @@ static ADDRESS_MAP_START( bigappg_map, AS_PROGRAM, 8, merit_state )
AM_RANGE(0xf800, 0xfbff) AM_READWRITE(palette_r, palette_w)
ADDRESS_MAP_END
-static ADDRESS_MAP_START( bigappga_map, AS_PROGRAM, 8, merit_state )
+static ADDRESS_MAP_START( misdraw_map, AS_PROGRAM, 8, merit_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_SHARE("cpunvram") // overlays other NVRAM? or is it banked?
AM_RANGE(0xa000, 0xbfff) AM_RAM AM_SHARE("nvram")
@@ -1275,10 +1275,10 @@ static MACHINE_CONFIG_DERIVED( bigappg, pitboss )
MCFG_NVRAM_ADD_0FILL("nvram")
MACHINE_CONFIG_END
-static MACHINE_CONFIG_DERIVED( bigappga, bigappg )
+static MACHINE_CONFIG_DERIVED( misdraw, bigappg )
MCFG_CPU_MODIFY("maincpu")
- MCFG_CPU_PROGRAM_MAP(bigappga_map)
+ MCFG_CPU_PROGRAM_MAP(misdraw_map)
MCFG_NVRAM_ADD_0FILL("cpunvram")
MACHINE_CONFIG_END
@@ -1502,9 +1502,9 @@ ROM_START( bigappg )
ROM_LOAD( "haip_u40.u40", 0x0000, 0x2000, CRC(ac4983b8) SHA1(a552a15f813c331de67eaae2ed42cc037b26c5bd) )
ROM_END
-ROM_START( bigappga )
+ROM_START( misdraw )
ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "2131-16_u5-2.u5", 0x0000, 0x8000, CRC(fc756320) SHA1(6b810c57ed1be844a04a6081d727e182509604b4) ) /* 2131-16 U5-0 081889 */
+ ROM_LOAD( "2131-16_u5-2.u5", 0x0000, 0x8000, CRC(fc756320) SHA1(6b810c57ed1be844a04a6081d727e182509604b4) ) /* 2131-16 U5-2 081889 */
ROM_REGION( 0x6000, "gfx1", 0 )
ROM_LOAD( "u39.u39", 0x0000, 0x2000, CRC(0f09d19b) SHA1(1f98559d5bad7c84d92ecea5a6df9429914a47f0) )
@@ -2225,7 +2225,7 @@ GAME( 1986, rivieraa, riviera, dodge, riviera, driver_device, 0, ROT0, "
GAME( 1986, rivierab, riviera, dodge, rivierab, driver_device, 0, ROT0, "Merit", "Riviera Hi-Score (2131-08, U5-2D)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1986, bigappg, 0, bigappg, bigappg, driver_device, 0, ROT0, "Big Apple Games / Merit", "The Big Apple (2131-13, U5-0)", MACHINE_SUPPORTS_SAVE )
-GAME( 1986, bigappga, bigappg, bigappga, bigappg, driver_device, 0, ROT0, "Big Apple Games / Merit", "The Big Apple (2131-16, U5-0 081889)", MACHINE_SUPPORTS_SAVE )
+GAME( 1986, misdraw, 0, misdraw, bigappg, driver_device, 0, ROT0, "Big Apple Games / Merit", "Michigan Super Draw (2131-16, U5-2)", MACHINE_SUPPORTS_SAVE )
GAME( 1986, dodgectya,dodgecty,dodge, dodge, driver_device, 0, ROT0, "Merit", "Dodge City (2131-82, U5-0D)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
GAME( 1986, dodgectyb,dodgecty,dodge, dodge, driver_device, 0, ROT0, "Merit", "Dodge City (2131-82, U5-50)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/tispeak.cpp b/src/mame/drivers/tispeak.cpp
index 94d62dd1350..0bfc1888c5c 100644
--- a/src/mame/drivers/tispeak.cpp
+++ b/src/mame/drivers/tispeak.cpp
@@ -351,10 +351,38 @@ Language Tutor modules:
- English(4/4): VSM: 16KB CD3529
+Other manufacturers:
+
+Tiger Electronics K28 (model 7-232) Sold in Hong Kong, distributed in US as:
+- Coleco: Talking Teacher
+- Sears: Talkatron - Learning Computer
+
+Earlier K28 models 7-230 and 7-231 are on different hardware, showing a different
+keyboard, VFD display, and use the SC-01 speech chip.
+
+ K28 model 7-232 (HK), 1985
+ - MCU: TMS1400 MP7324
+ - TMS51xx: TMS5110A
+ - VSM: 16KB CM62084
+ - LCD: unknown 8*16-seg
+
+K28 modules:
+
+ - Spelling I: VSM: 16KB CM62086
+ - Spelling II: VSM: 16KB CM62085?
+ - Spelling III: VSM: 16KB CM62087
+ - Expansion Module 1: VSM: 16KB CM62214? - assumed same VSM as CM62086
+ - Expansion Module 2: VSM: 16KB CM62216 - assumed same VSM as the one in Spelling II
+ - Expansion Module 3: VSM: 16KB CM62215 - same VSM as CM62087
+ - Expansion Module 4: VSM: 16KB CM62217
+ - Expansion Module 5: VSM: 16KB CM62218*
+ - Expansion Module 6: VSM: 16KB CM62219
+
----------------------------------------------------------------------------
TODO:
- why doesn't lantutor work?
+ - identify and emulate k28 LCD
- emulate other known devices
@@ -368,6 +396,7 @@ Language Tutor modules:
#include "softlist.h"
// internal artwork
+#include "k28.lh"
#include "lantutor.lh"
#include "snmath.lh"
#include "snspell.lh"
@@ -412,6 +441,11 @@ public:
DECLARE_WRITE16_MEMBER(snspellc_write_r);
DECLARE_READ8_MEMBER(tntell_read_k);
+ void k28_prepare_display(UINT8 old, UINT8 data);
+ DECLARE_READ8_MEMBER(k28_read_k);
+ DECLARE_WRITE16_MEMBER(k28_write_o);
+ DECLARE_WRITE16_MEMBER(k28_write_r);
+
// cartridge
UINT32 m_cart_max_size;
UINT8* m_cart_base;
@@ -631,6 +665,46 @@ TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::tntell_get_overlay)
}
+// k28 specific
+
+void tispeak_state::k28_prepare_display(UINT8 old, UINT8 data)
+{
+ // ?
+}
+
+WRITE16_MEMBER(tispeak_state::k28_write_r)
+{
+ // R1234: TMS5100 CTL8421
+ m_tms5100->ctl_w(space, 0, BITSWAP8(data,0,0,0,0,1,2,3,4) & 0xf);
+
+ // R0: TMS5100 PDC pin
+ m_tms5100->pdc_w(data & 1);
+
+ // R5: input mux high bit
+ m_inp_mux = (m_inp_mux & 0xff) | (data << 3 & 0x100);
+
+ // R6: power-off request, on falling edge
+ if ((m_r >> 6 & 1) && !(data >> 6 & 1))
+ power_off();
+
+ // R7-R10: LCD data
+ k28_prepare_display(m_r >> 7 & 0xf, data >> 7 & 0xf);
+ m_r = data;
+}
+
+WRITE16_MEMBER(tispeak_state::k28_write_o)
+{
+ // O0-O7: input mux low
+ m_inp_mux = (m_inp_mux & ~0xff) | data;
+}
+
+READ8_MEMBER(tispeak_state::k28_read_k)
+{
+ // K: TMS5100 CTL, multiplexed inputs
+ return m_tms5100->ctl_r(space, 0) | read_inputs(9);
+}
+
+
/***************************************************************************
@@ -799,7 +873,7 @@ static INPUT_PORTS_START( snmath )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_NAME("+")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_MINUS_PAD) PORT_NAME("-")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ASTERISK) PORT_NAME(UTF8_MULTIPLY)
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE) // /
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_SLASH_PAD) PORT_NAME(UTF8_DIVIDE)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("Mix It")
PORT_START("IN.6") // R6
@@ -1031,6 +1105,63 @@ static INPUT_PORTS_START( tntell )
INPUT_PORTS_END
+static INPUT_PORTS_START( k28 )
+ PORT_START("IN.0") // O0
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") // -> auto_power_off
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('A') PORT_NAME("A/1")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('J') PORT_NAME("J/0")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
+
+ PORT_START("IN.1") // O1
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PGUP) PORT_NAME("On") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, power_button, (void *)true)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('B') PORT_NAME("B/2")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR('K') PORT_NAME("K/+")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
+
+ PORT_START("IN.2") // O2
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Repeat")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR('C') PORT_NAME("C/3")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR('L') PORT_NAME("L/-")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
+
+ PORT_START("IN.3") // O3
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Prompt")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR('D') PORT_NAME("D/4")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('M') PORT_NAME("M/" UTF8_MULTIPLY)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
+
+ PORT_START("IN.4") // O4
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_NAME("Menu")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('E') PORT_NAME("E/5")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR('N') PORT_NAME("N/" UTF8_DIVIDE)
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
+
+ PORT_START("IN.5") // O5
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_NAME("Module")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('F') PORT_NAME("F/6")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
+
+ PORT_START("IN.6") // O6
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_NAME("Select")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('G') PORT_NAME("G/7")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
+
+ PORT_START("IN.7") // O7
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Clear")
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('H') PORT_NAME("H/8")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
+
+ PORT_START("IN.8") // R5
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'')
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('I') PORT_NAME("I/9")
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter")
+INPUT_PORTS_END
+
+
/***************************************************************************
@@ -1210,6 +1341,33 @@ static MACHINE_CONFIG_DERIVED( tntell, vocaid )
MACHINE_CONFIG_END
+static MACHINE_CONFIG_START( k28, tispeak_state )
+
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", TMS1400, MASTER_CLOCK/2)
+ MCFG_TMS1XXX_READ_K_CB(READ8(tispeak_state, k28_read_k))
+ MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, k28_write_o))
+ MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tispeak_state, k28_write_r))
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
+ MCFG_DEFAULT_LAYOUT(layout_k28)
+
+ /* sound hardware */
+ MCFG_DEVICE_ADD("tms6100", TMS6100, MASTER_CLOCK/4)
+
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("tms5100", TMS5110A, MASTER_CLOCK)
+ MCFG_FRAGMENT_ADD(tms5110_route)
+
+ /* cartridge */
+ MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "k28")
+ MCFG_GENERIC_EXTENSIONS("vsm")
+ MCFG_GENERIC_LOAD(tispeak_state, tispeak_cartridge)
+
+ MCFG_SOFTWARE_LIST_ADD("cart_list", "k28")
+MACHINE_CONFIG_END
+
+
/***************************************************************************
@@ -1551,6 +1709,20 @@ ROM_START( vocaid )
ROM_END
+ROM_START( k28 )
+ ROM_REGION( 0x1000, "maincpu", 0 )
+ ROM_LOAD( "mp7324", 0x0000, 0x1000, CRC(08d15ab6) SHA1(5b0f6c53e6732a362c4bb25d966d4072fdd33db8) )
+
+ ROM_REGION( 867, "maincpu:mpla", 0 )
+ ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) )
+ ROM_REGION( 557, "maincpu:opla", 0 )
+ ROM_LOAD( "tms1400_k28_output.pla", 0, 557, CRC(3a5c7005) SHA1(3fe5819c138a90e7fc12817415f2622ca81b40b2) )
+
+ ROM_REGION( 0x10000, "tms6100", ROMREGION_ERASEFF ) // 8000-bfff? = space reserved for cartridge
+ ROM_LOAD( "cm62084.vsm", 0x0000, 0x4000, CRC(cd1376f7) SHA1(96fa484c392c451599bc083b8376cad9c998df7d) )
+ROM_END
+
+
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
COMP( 1979, snspell, 0, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1979 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
@@ -1581,3 +1753,5 @@ COMP( 1981, tntelluk, tntell, 0, tntell, tntell, tispeak_state, tn
COMP( 1981, tntellfr, tntell, 0, tntell, tntell, tispeak_state, tntell, "Texas Instruments", "Le Livre Magique (France)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_CLICKABLE_ARTWORK | MACHINE_REQUIRES_ARTWORK )
COMP( 1982, vocaid, 0, 0, vocaid, tntell, driver_device, 0, "Texas Instruments", "Vocaid", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK )
+
+COMP( 1985, k28, 0, 0, k28, k28, tispeak_state, snspell, "Tiger Electronics", "K28: Talking Learning Computer (model 7-232)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
diff --git a/src/mame/layout/k28.lay b/src/mame/layout/k28.lay
new file mode 100644
index 00000000000..dde1a20e295
--- /dev/null
+++ b/src/mame/layout/k28.lay
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="digit" defstate="0">
+ <led16seg><color red="0.5" green="0.5" blue="0.5" /></led16seg>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="0" right="80" top="0" bottom="15" />
+
+ <bezel name="digit0" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit1" element="digit"><bounds x="10" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit2" element="digit"><bounds x="20" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit3" element="digit"><bounds x="30" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit4" element="digit"><bounds x="40" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit5" element="digit"><bounds x="50" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit6" element="digit"><bounds x="60" y="0" width="10" height="15" /></bezel>
+ <bezel name="digit7" element="digit"><bounds x="70" y="0" width="10" height="15" /></bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mame/mess.lst b/src/mame/mess.lst
index 9f41ab0709e..d43909d9e41 100644
--- a/src/mame/mess.lst
+++ b/src/mame/mess.lst
@@ -2332,6 +2332,10 @@ lilprof
lilprof78
dataman
+// hh_tms1k tispellb.cpp
+spellb
+mrchalgr
+
// hh_tms1k tispeak.cpp
snspell
snspellp
@@ -2355,10 +2359,7 @@ tntelluk
tntellfr
tntellp
vocaid
-
-// hh_tms1k tispellb.cpp
-spellb
-mrchalgr
+k28 // Tiger Electronics
// hh_ucom4
ufombs // Bambino
diff --git a/src/osd/modules/sound/js_sound.js b/src/osd/modules/sound/js_sound.js
index 393bcd66e93..b06cbb44365 100644
--- a/src/osd/modules/sound/js_sound.js
+++ b/src/osd/modules/sound/js_sound.js
@@ -2,10 +2,10 @@
// copyright-holders:Grant Galitz, Katelyn Gadd
/***************************************************************************
- JSMAME web audio backend v0.3
+ JSMAME web audio backend v0.3
- Original by katelyn gadd - kg at luminance dot org ; @antumbral on twitter
- Substantial changes by taisel
+ Original by katelyn gadd - kg at luminance dot org ; @antumbral on twitter
+ Substantial changes by taisel
***************************************************************************/
@@ -23,187 +23,187 @@ var watchDogDateLast = null;
var watchDogTimerEvent = null;
function lazy_init () {
- //Make
- if (context) {
- //Return if already created:
- return;
- }
- if (typeof AudioContext != "undefined") {
- //Standard context creation:
- context = new AudioContext();
- }
- else if (typeof webkitAudioContext != "undefined") {
- //Older webkit context creation:
- context = new webkitAudioContext();
- }
- else {
- //API not found!
- return;
- }
- //Generate a volume control node:
- gain_node = context.createGain();
- //Set initial volume to 1:
- gain_node.gain.value = 1.0;
- //Connect volume node to output:
- gain_node.connect(context.destination);
- //Initialize the streaming event:
- init_event();
+ //Make
+ if (context) {
+ //Return if already created:
+ return;
+ }
+ if (typeof AudioContext != "undefined") {
+ //Standard context creation:
+ context = new AudioContext();
+ }
+ else if (typeof webkitAudioContext != "undefined") {
+ //Older webkit context creation:
+ context = new webkitAudioContext();
+ }
+ else {
+ //API not found!
+ return;
+ }
+ //Generate a volume control node:
+ gain_node = context.createGain();
+ //Set initial volume to 1:
+ gain_node.gain.value = 1.0;
+ //Connect volume node to output:
+ gain_node.connect(context.destination);
+ //Initialize the streaming event:
+ init_event();
};
function init_event() {
- //Generate a streaming node point:
- if (typeof context.createScriptProcessor == "function") {
- //Current standard compliant way:
- eventNode = context.createScriptProcessor(4096, 0, 2);
- }
- else {
- //Deprecated way:
- eventNode = context.createJavaScriptNode(4096, 0, 2);
- }
- //Make our tick function the audio callback function:
- eventNode.onaudioprocess = tick;
- //Connect stream to volume control node:
- eventNode.connect(gain_node);
- //WORKAROUND FOR FIREFOX BUG:
- initializeWatchDogForFirefoxBug();
+ //Generate a streaming node point:
+ if (typeof context.createScriptProcessor == "function") {
+ //Current standard compliant way:
+ eventNode = context.createScriptProcessor(4096, 0, 2);
+ }
+ else {
+ //Deprecated way:
+ eventNode = context.createJavaScriptNode(4096, 0, 2);
+ }
+ //Make our tick function the audio callback function:
+ eventNode.onaudioprocess = tick;
+ //Connect stream to volume control node:
+ eventNode.connect(gain_node);
+ //WORKAROUND FOR FIREFOX BUG:
+ initializeWatchDogForFirefoxBug();
};
function initializeWatchDogForFirefoxBug() {
- //TODO: decide if we want to user agent sniff firefox here,
- //since Google Chrome doesn't need this:
- watchDogDateLast = (new Date()).getTime();
- if (watchDogTimerEvent === null) {
- watchDogTimerEvent = setInterval(function () {
- var timeDiff = (new Date()).getTime() - watchDogDateLast;
- if (timeDiff > 500) {
- disconnect_old_event();
- init_event();
- }
- }, 500);
- }
+ //TODO: decide if we want to user agent sniff firefox here,
+ //since Google Chrome doesn't need this:
+ watchDogDateLast = (new Date()).getTime();
+ if (watchDogTimerEvent === null) {
+ watchDogTimerEvent = setInterval(function () {
+ var timeDiff = (new Date()).getTime() - watchDogDateLast;
+ if (timeDiff > 500) {
+ disconnect_old_event();
+ init_event();
+ }
+ }, 500);
+ }
};
function disconnect_old_event() {
- //Disconnect from audio graph:
- eventNode.disconnect();
- //IIRC there was a firefox bug that did not GC this event when nulling the node itself:
- eventNode.onaudioprocess = null;
- //Null the glitched/unused node:
- eventNode = null;
+ //Disconnect from audio graph:
+ eventNode.disconnect();
+ //IIRC there was a firefox bug that did not GC this event when nulling the node itself:
+ eventNode.onaudioprocess = null;
+ //Null the glitched/unused node:
+ eventNode = null;
};
function set_mastervolume (
- // even though it's 'attenuation' the value is negative, so...
- attenuation_in_decibels
+ // even though it's 'attenuation' the value is negative, so...
+ attenuation_in_decibels
) {
- lazy_init();
- if (!context) return;
-
- // http://stackoverflow.com/questions/22604500/web-audio-api-working-with-decibels
- // seemingly incorrect/broken. figures. welcome to Web Audio
- // var gain_web_audio = 1.0 - Math.pow(10, 10 / attenuation_in_decibels);
-
- // HACK: Max attenuation in JSMESS appears to be 32.
- // Hit ' then left/right arrow to test.
- // FIXME: This is linear instead of log10 scale.
- var gain_web_audio = 1.0 + (+attenuation_in_decibels / +32);
- if (gain_web_audio < +0)
- gain_web_audio = +0;
- else if (gain_web_audio > +1)
- gain_web_audio = +1;
-
- gain_node.gain.value = gain_web_audio;
+ lazy_init();
+ if (!context) return;
+
+ // http://stackoverflow.com/questions/22604500/web-audio-api-working-with-decibels
+ // seemingly incorrect/broken. figures. welcome to Web Audio
+ // var gain_web_audio = 1.0 - Math.pow(10, 10 / attenuation_in_decibels);
+
+ // HACK: Max attenuation in JSMESS appears to be 32.
+ // Hit ' then left/right arrow to test.
+ // FIXME: This is linear instead of log10 scale.
+ var gain_web_audio = 1.0 + (+attenuation_in_decibels / +32);
+ if (gain_web_audio < +0)
+ gain_web_audio = +0;
+ else if (gain_web_audio > +1)
+ gain_web_audio = +1;
+
+ gain_node.gain.value = gain_web_audio;
};
function update_audio_stream (
- pBuffer, // pointer into emscripten heap. int16 samples
- samples_this_frame // int. number of samples at pBuffer address.
+ pBuffer, // pointer into emscripten heap. int16 samples
+ samples_this_frame // int. number of samples at pBuffer address.
) {
- lazy_init();
- if (!context) return;
-
- for (
- var i = 0,
- l = samples_this_frame | 0;
- i < l;
- i++
- ) {
- var offset =
- // divide by sizeof(INT16) since pBuffer is offset
- // in bytes
- ((pBuffer / 2) | 0) +
- ((i * 2) | 0);
-
- var left_sample = HEAP16[offset];
- var right_sample = HEAP16[(offset + 1) | 0];
-
- // normalize from signed int16 to signed float
- var left_sample_float = left_sample / sampleScale;
- var right_sample_float = right_sample / sampleScale;
-
- inputBuffer[rear++] = left_sample_float;
- inputBuffer[rear++] = right_sample_float;
- if (rear == bufferSize) {
- rear = 0;
- }
- if (start == rear) {
- start += 2;
- if (start == bufferSize) {
- start = 0;
- }
- }
- }
+ lazy_init();
+ if (!context) return;
+
+ for (
+ var i = 0,
+ l = samples_this_frame | 0;
+ i < l;
+ i++
+ ) {
+ var offset =
+ // divide by sizeof(INT16) since pBuffer is offset
+ // in bytes
+ ((pBuffer / 2) | 0) +
+ ((i * 2) | 0);
+
+ var left_sample = HEAP16[offset];
+ var right_sample = HEAP16[(offset + 1) | 0];
+
+ // normalize from signed int16 to signed float
+ var left_sample_float = left_sample / sampleScale;
+ var right_sample_float = right_sample / sampleScale;
+
+ inputBuffer[rear++] = left_sample_float;
+ inputBuffer[rear++] = right_sample_float;
+ if (rear == bufferSize) {
+ rear = 0;
+ }
+ if (start == rear) {
+ start += 2;
+ if (start == bufferSize) {
+ start = 0;
+ }
+ }
+ }
};
function tick (event) {
- //Find all output channels:
- for (var bufferCount = 0, buffers = []; bufferCount < 2; ++bufferCount) {
- buffers[bufferCount] = event.outputBuffer.getChannelData(bufferCount);
- }
- //Copy samples from the input buffer to the Web Audio API:
- for (var index = 0; index < 4096 && start != rear; ++index) {
- buffers[0][index] = inputBuffer[start++];
- buffers[1][index] = inputBuffer[start++];
- if (start == bufferSize) {
- start = 0;
- }
- }
- //Pad with silence if we're underrunning:
- while (index < 4096) {
- buffers[0][index] = 0;
- buffers[1][index++] = 0;
- }
- //Deep inside the bowels of vendors bugs,
- //we're using watchdog for a firefox bug,
- //where the user agent decides to stop firing events
- //if the user agent lags out due to system load.
- //Don't even ask....
- watchDogDateLast = (new Date()).getTime();
+ //Find all output channels:
+ for (var bufferCount = 0, buffers = []; bufferCount < 2; ++bufferCount) {
+ buffers[bufferCount] = event.outputBuffer.getChannelData(bufferCount);
+ }
+ //Copy samples from the input buffer to the Web Audio API:
+ for (var index = 0; index < 4096 && start != rear; ++index) {
+ buffers[0][index] = inputBuffer[start++];
+ buffers[1][index] = inputBuffer[start++];
+ if (start == bufferSize) {
+ start = 0;
+ }
+ }
+ //Pad with silence if we're underrunning:
+ while (index < 4096) {
+ buffers[0][index] = 0;
+ buffers[1][index++] = 0;
+ }
+ //Deep inside the bowels of vendors bugs,
+ //we're using watchdog for a firefox bug,
+ //where the user agent decides to stop firing events
+ //if the user agent lags out due to system load.
+ //Don't even ask....
+ watchDogDateLast = (new Date()).getTime();
}
function get_context() {
- return context;
+ return context;
};
function sample_count() {
- //TODO get someone to call this from the emulator,
- //so the emulator can do proper audio buffering by
- //knowing how many samples are left:
- if (!context) {
- //Use impossible value as an error code:
- return -1;
- }
- var count = rear - start;
- if (start > rear) {
- count += bufferSize;
- }
- return count;
+ //TODO get someone to call this from the emulator,
+ //so the emulator can do proper audio buffering by
+ //knowing how many samples are left:
+ if (!context) {
+ //Use impossible value as an error code:
+ return -1;
+ }
+ var count = rear - start;
+ if (start > rear) {
+ count += bufferSize;
+ }
+ return count;
}
return {
- set_mastervolume: set_mastervolume,
- update_audio_stream: update_audio_stream,
- get_context: get_context,
- sample_count: sample_count
+ set_mastervolume: set_mastervolume,
+ update_audio_stream: update_audio_stream,
+ get_context: get_context,
+ sample_count: sample_count
};
})();