summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/attotime.c36
-rw-r--r--src/emu/attotime.h132
-rw-r--r--src/emu/bus/c64/c128_partner.c164
-rw-r--r--src/emu/bus/c64/c128_partner.h14
-rw-r--r--src/emu/bus/isa/gus.c2
-rw-r--r--src/emu/bus/msx_cart/moonsound.c2
-rw-r--r--src/emu/bus/pc_joy/pc_joy.c2
-rw-r--r--src/emu/bus/ti99_peb/bwg.c4
-rw-r--r--src/emu/bus/ti99_peb/hfdc.c4
-rw-r--r--src/emu/bus/ti99_peb/hsgpl.c18
-rw-r--r--src/emu/bus/ti99_peb/hsgpl.h10
-rw-r--r--src/emu/bus/ti99_peb/ti_fdc.c3
-rw-r--r--src/emu/bus/ti99x/datamux.c2
-rw-r--r--src/emu/bus/ti99x/genboard.c351
-rw-r--r--src/emu/bus/ti99x/genboard.h36
-rw-r--r--src/emu/bus/ti99x/gromport.c216
-rw-r--r--src/emu/bus/ti99x/gromport.h28
-rw-r--r--src/emu/bus/ti99x/ti99defs.h6
-rw-r--r--src/emu/cpu/h6280/6280dasm.c5
-rw-r--r--src/emu/cpu/powerpc/ppccom.c2
-rw-r--r--src/emu/cpu/psx/psx.c8
-rw-r--r--src/emu/cpu/psx/psx.h4
-rw-r--r--src/emu/cpu/tms32082/mp_ops.c67
-rw-r--r--src/emu/cpu/tms32082/tms32082.c66
-rw-r--r--src/emu/cpu/tms32082/tms32082.h7
-rw-r--r--src/emu/cpu/tms9900/tms9995.c2
-rw-r--r--src/emu/cpu/v60/v60.c65
-rw-r--r--src/emu/device.c2
-rw-r--r--src/emu/imagedev/floppy.c184
-rw-r--r--src/emu/imagedev/floppy.h53
-rw-r--r--src/emu/imagedev/mfmhd.c4
-rw-r--r--src/emu/ioport.c12
-rw-r--r--src/emu/machine.c2
-rw-r--r--src/emu/machine/at29040a.c446
-rw-r--r--src/emu/machine/at29040a.h90
-rw-r--r--src/emu/machine/at29x.c525
-rw-r--r--src/emu/machine/at29x.h116
-rw-r--r--src/emu/machine/fdc_pll.c8
-rw-r--r--src/emu/machine/hdc92x4.c42
-rw-r--r--src/emu/machine/i8251.c18
-rw-r--r--src/emu/machine/i8251.h3
-rw-r--r--src/emu/machine/intelfsh.c28
-rw-r--r--src/emu/machine/intelfsh.h12
-rw-r--r--src/emu/machine/jvsdev.c7
-rw-r--r--src/emu/machine/jvsdev.h2
-rw-r--r--src/emu/machine/ldpr8210.c2
-rw-r--r--src/emu/machine/netlist.c76
-rw-r--r--src/emu/machine/netlist.h16
-rw-r--r--src/emu/machine/pit8253.c18
-rw-r--r--src/emu/machine/pit8253.h3
-rw-r--r--src/emu/machine/tmp68301.c11
-rw-r--r--src/emu/machine/tmp68301.h1
-rw-r--r--src/emu/machine/tms6100.c23
-rw-r--r--src/emu/machine/tms6100.h3
-rw-r--r--src/emu/machine/upd765.c6
-rw-r--r--src/emu/machine/wd_fdc.c4
-rw-r--r--src/emu/machine/z80ctc.c2
-rw-r--r--src/emu/netlist/analog/nld_fourterm.c3
-rw-r--r--src/emu/netlist/analog/nld_opamps.c3
-rw-r--r--src/emu/netlist/analog/nld_twoterm.c3
-rw-r--r--src/emu/netlist/analog/nld_twoterm.h1
-rw-r--r--src/emu/netlist/build/makefile166
-rw-r--r--src/emu/netlist/devices/nld_74123.c1
-rw-r--r--src/emu/netlist/devices/nld_74ls629.c3
-rw-r--r--src/emu/netlist/devices/nld_log.c9
-rw-r--r--src/emu/netlist/devices/nld_r2r_dac.c2
-rw-r--r--src/emu/netlist/devices/nld_system.c4
-rw-r--r--src/emu/netlist/devices/nld_system.h3
-rw-r--r--src/emu/netlist/devices/nld_truthtable.c8
-rw-r--r--src/emu/netlist/devices/nld_truthtable.h1
-rw-r--r--src/emu/netlist/nl_base.c65
-rw-r--r--src/emu/netlist/nl_base.h41
-rw-r--r--src/emu/netlist/nl_config.h23
-rw-r--r--src/emu/netlist/nl_factory.c4
-rw-r--r--src/emu/netlist/nl_parser.c41
-rw-r--r--src/emu/netlist/nl_parser.h2
-rw-r--r--src/emu/netlist/nl_setup.c176
-rw-r--r--src/emu/netlist/nl_setup.h3
-rw-r--r--src/emu/netlist/nl_time.h73
-rw-r--r--src/emu/netlist/plib/palloc.c3
-rw-r--r--src/emu/netlist/plib/palloc.h2
-rw-r--r--src/emu/netlist/plib/pconfig.h51
-rw-r--r--src/emu/netlist/plib/plists.h6
-rw-r--r--src/emu/netlist/plib/pparser.c36
-rw-r--r--src/emu/netlist/plib/pparser.h6
-rw-r--r--src/emu/netlist/plib/pstate.c3
-rw-r--r--src/emu/netlist/plib/pstate.h7
-rw-r--r--src/emu/netlist/plib/pstream.h63
-rw-r--r--src/emu/netlist/plib/pstring.c93
-rw-r--r--src/emu/netlist/plib/pstring.h277
-rw-r--r--src/emu/netlist/prg/nltool.c (renamed from src/tools/nltool.c)53
-rw-r--r--src/emu/netlist/prg/nlwav.c (renamed from src/tools/nlwav.c)0
-rw-r--r--src/emu/netlist/solver/mat_cr.h7
-rw-r--r--src/emu/netlist/solver/nld_ms_direct.h252
-rw-r--r--src/emu/netlist/solver/nld_ms_direct1.h4
-rw-r--r--src/emu/netlist/solver/nld_ms_direct2.h8
-rw-r--r--src/emu/netlist/solver/nld_ms_direct_lu.h652
-rw-r--r--src/emu/netlist/solver/nld_ms_gmres.h59
-rw-r--r--src/emu/netlist/solver/nld_ms_sor.h2
-rw-r--r--src/emu/netlist/solver/nld_ms_sor_mat.h26
-rw-r--r--src/emu/netlist/solver/nld_solver.c111
-rw-r--r--src/emu/netlist/solver/nld_solver.h26
-rw-r--r--src/emu/netlist/solver/vector_base.h29
-rw-r--r--src/emu/netlist/tools/nl_convert.c72
-rw-r--r--src/emu/netlist/tools/nl_convert.h13
-rw-r--r--src/emu/render.h2
-rw-r--r--src/emu/romload.h1
-rw-r--r--src/emu/save.h4
-rw-r--r--src/emu/schedule.c21
-rw-r--r--src/emu/sound.c24
-rw-r--r--src/emu/sound/digitalk.c4
-rw-r--r--src/emu/sound/nes_apu.c4
-rw-r--r--src/emu/sound/samples.c12
-rw-r--r--src/emu/sound/samples.h3
-rw-r--r--src/emu/sound/tms5110.c971
-rw-r--r--src/emu/sound/tms5110.h95
-rw-r--r--src/emu/sound/tms5110r.inc63
-rw-r--r--src/emu/sound/tms5220.c40
-rw-r--r--src/emu/ui/devopt.c2
-rw-r--r--src/emu/ui/miscmenu.c8
-rw-r--r--src/emu/ui/sliders.c3
-rw-r--r--src/emu/ui/ui.c6
-rw-r--r--src/emu/video.c14
-rw-r--r--src/emu/video/315_5313.c6
-rw-r--r--src/emu/video/ef9345.c2
-rw-r--r--src/emu/video/h63484.c2
-rw-r--r--src/emu/video/i8275.c2
-rw-r--r--src/emu/video/scn2674.c2
-rw-r--r--src/emu/video/voodoo.c20
-rw-r--r--src/mame/arcade.lst145
-rw-r--r--src/mame/audio/atarijsa.c10
-rw-r--r--src/mame/audio/atarijsa.h5
-rw-r--r--src/mame/audio/cage.c4
-rw-r--r--src/mame/audio/dcs.c2
-rw-r--r--src/mame/audio/leland.c162
-rw-r--r--src/mame/audio/micro3d.c4
-rw-r--r--src/mame/audio/targ.c17
-rw-r--r--src/mame/drivers/88games.c1
-rw-r--r--src/mame/drivers/aerofgt.c2
-rw-r--r--src/mame/drivers/ajax.c12
-rw-r--r--src/mame/drivers/alg.c28
-rw-r--r--src/mame/drivers/aliens.c25
-rw-r--r--src/mame/drivers/astrcorp.c74
-rw-r--r--src/mame/drivers/astrocde.c126
-rw-r--r--src/mame/drivers/battlnts.c3
-rw-r--r--src/mame/drivers/bladestl.c3
-rw-r--r--src/mame/drivers/blockhl.c31
-rw-r--r--src/mame/drivers/bottom9.c1
-rw-r--r--src/mame/drivers/chqflag.c24
-rw-r--r--src/mame/drivers/cinemat.c2
-rw-r--r--src/mame/drivers/cps1.c35
-rw-r--r--src/mame/drivers/cps2.c35
-rw-r--r--src/mame/drivers/cps3.c2
-rw-r--r--src/mame/drivers/crimfght.c255
-rw-r--r--src/mame/drivers/ddenlovr.c433
-rw-r--r--src/mame/drivers/deco32.c193
-rw-r--r--src/mame/drivers/faceoffh.c375
-rw-r--r--src/mame/drivers/firebeat.c20
-rw-r--r--src/mame/drivers/gaelco2.c26
-rw-r--r--src/mame/drivers/gaelco3d.c2
-rw-r--r--src/mame/drivers/goldstar.c32
-rw-r--r--src/mame/drivers/gradius3.c83
-rw-r--r--src/mame/drivers/harddriv.c204
-rw-r--r--src/mame/drivers/hng64.c2
-rw-r--r--src/mame/drivers/igs_m027.c63
-rw-r--r--src/mame/drivers/joystand.c687
-rw-r--r--src/mame/drivers/konamigx.c14
-rw-r--r--src/mame/drivers/konendev.c90
-rw-r--r--src/mame/drivers/lethalj.c9
-rw-r--r--src/mame/drivers/mainevt.c72
-rw-r--r--src/mame/drivers/mediagx.c2
-rw-r--r--src/mame/drivers/meritm.c22
-rw-r--r--src/mame/drivers/minivadr.c22
-rw-r--r--src/mame/drivers/monzagp.c154
-rw-r--r--src/mame/drivers/namcops2.c374
-rw-r--r--src/mame/drivers/namcos10.c204
-rw-r--r--src/mame/drivers/pinball2k.c2
-rw-r--r--src/mame/drivers/qix.c2
-rw-r--r--src/mame/drivers/rockrage.c2
-rw-r--r--src/mame/drivers/rocnrope.c17
-rw-r--r--src/mame/drivers/rollext.c366
-rw-r--r--src/mame/drivers/scramble.c29
-rw-r--r--src/mame/drivers/segas32.c29
-rw-r--r--src/mame/drivers/simpsons.c7
-rw-r--r--src/mame/drivers/spcforce.c37
-rw-r--r--src/mame/drivers/splus.c28
-rw-r--r--src/mame/drivers/spy.c1
-rw-r--r--src/mame/drivers/taito_b.c2
-rw-r--r--src/mame/drivers/thunderx.c1
-rw-r--r--src/mame/drivers/tmnt.c5
-rw-r--r--src/mame/drivers/toaplan2.c43
-rw-r--r--src/mame/drivers/ultraman.c1
-rw-r--r--src/mame/drivers/vegas.c107
-rw-r--r--src/mame/drivers/vicdual.c68
-rw-r--r--src/mame/drivers/warpwarp.c12
-rw-r--r--src/mame/drivers/wgp.c10
-rw-r--r--src/mame/drivers/xmen.c52
-rw-r--r--src/mame/etc/template_driver.c2
-rw-r--r--src/mame/includes/ajax.h1
-rw-r--r--src/mame/includes/aliens.h12
-rw-r--r--src/mame/includes/astrocde.h41
-rw-r--r--src/mame/includes/battlnts.h1
-rw-r--r--src/mame/includes/bladestl.h1
-rw-r--r--src/mame/includes/chqflag.h1
-rw-r--r--src/mame/includes/crimfght.h29
-rw-r--r--src/mame/includes/gaelco2.h63
-rw-r--r--src/mame/includes/gradius3.h6
-rw-r--r--src/mame/includes/harddriv.h9
-rw-r--r--src/mame/includes/leland.h13
-rw-r--r--src/mame/includes/lethalj.h19
-rw-r--r--src/mame/includes/mainevt.h12
-rw-r--r--src/mame/includes/micro3d.h18
-rw-r--r--src/mame/includes/rockrage.h1
-rw-r--r--src/mame/includes/rocnrope.h28
-rw-r--r--src/mame/includes/rollerg.h5
-rw-r--r--src/mame/includes/ultraman.h4
-rw-r--r--src/mame/includes/vicdual.h17
-rw-r--r--src/mame/includes/warpwarp.h19
-rw-r--r--src/mame/includes/wgp.h11
-rw-r--r--src/mame/includes/xmen.h7
-rw-r--r--src/mame/layout/monzagp.lay106
-rw-r--r--src/mame/machine/ajax.c6
-rw-r--r--src/mame/machine/gaelco2.c18
-rw-r--r--src/mame/machine/harddriv.c17
-rw-r--r--src/mame/machine/jvs13551.c17
-rw-r--r--src/mame/machine/jvs13551.h1
-rw-r--r--src/mame/machine/micro3d.c18
-rw-r--r--src/mame/machine/mie.c11
-rw-r--r--src/mame/machine/mie.h1
-rw-r--r--src/mame/machine/n64.c2
-rw-r--r--src/mame/machine/ns10crypt.c132
-rw-r--r--src/mame/machine/ns10crypt.h7
-rw-r--r--src/mame/machine/pgmcrypt.c5
-rw-r--r--src/mame/machine/pgmcrypt.h1
-rw-r--r--src/mame/machine/snes.c4
-rw-r--r--src/mame/mess.lst4
-rw-r--r--src/mame/video/aliens.c35
-rw-r--r--src/mame/video/antic.c9
-rw-r--r--src/mame/video/antic.h3
-rw-r--r--src/mame/video/astrocde.c27
-rw-r--r--src/mame/video/atarimo.c12
-rw-r--r--src/mame/video/battlnts.c2
-rw-r--r--src/mame/video/bladestl.c2
-rw-r--r--src/mame/video/cps1.c22
-rw-r--r--src/mame/video/crimfght.c58
-rw-r--r--src/mame/video/deco16ic.c16
-rw-r--r--src/mame/video/gradius3.c29
-rw-r--r--src/mame/video/gtia.c2
-rw-r--r--src/mame/video/k051960.c99
-rw-r--r--src/mame/video/k051960.h33
-rw-r--r--src/mame/video/k052109.c48
-rw-r--r--src/mame/video/k052109.h23
-rw-r--r--src/mame/video/k057714.c65
-rw-r--r--src/mame/video/k057714.h18
-rw-r--r--src/mame/video/lethalj.c13
-rw-r--r--src/mame/video/mainevt.c34
-rw-r--r--src/mame/video/mcd212.c2
-rw-r--r--src/mame/video/midzeus.c508
-rw-r--r--src/mame/video/powervr2.c5
-rw-r--r--src/mame/video/powervr2.h1
-rw-r--r--src/mame/video/rdptpipe.c23
-rw-r--r--src/mame/video/rockrage.c2
-rw-r--r--src/mame/video/rollerg.c18
-rw-r--r--src/mame/video/spy.c6
-rw-r--r--src/mame/video/ultraman.c40
-rw-r--r--src/mame/video/vicdual.c2
-rw-r--r--src/mess/drivers/4004clk.c7
-rw-r--r--src/mess/drivers/altos5.c2
-rw-r--r--src/mess/drivers/ampro.c1
-rw-r--r--src/mess/drivers/amust.c9
-rw-r--r--src/mess/drivers/apf.c2
-rw-r--r--src/mess/drivers/apple2.c29
-rw-r--r--src/mess/drivers/apple2e.c9
-rw-r--r--src/mess/drivers/applix.c2
-rw-r--r--src/mess/drivers/aussiebyte.c4
-rw-r--r--src/mess/drivers/c128.c60
-rw-r--r--src/mess/drivers/c64.c50
-rw-r--r--src/mess/drivers/ccs2810.c1
-rw-r--r--src/mess/drivers/excali64.c2
-rw-r--r--src/mess/drivers/gba.c2
-rw-r--r--src/mess/drivers/geneve.c97
-rw-r--r--src/mess/drivers/hh_cop400.c2
-rw-r--r--src/mess/drivers/hh_hmcs40.c58
-rw-r--r--src/mess/drivers/hh_melps4.c4
-rw-r--r--src/mess/drivers/hh_tms1k.c8
-rw-r--r--src/mess/drivers/hh_ucom4.c32
-rw-r--r--src/mess/drivers/hp64k.c254
-rw-r--r--src/mess/drivers/hp_ipc.c359
-rw-r--r--src/mess/drivers/kaypro.c4
-rw-r--r--src/mess/drivers/laser3k.c2
-rw-r--r--src/mess/drivers/mbee.c6
-rw-r--r--src/mess/drivers/mycom.c2
-rw-r--r--src/mess/drivers/mz2500.c2
-rw-r--r--src/mess/drivers/pc6001.c2
-rw-r--r--src/mess/drivers/pcd.c87
-rw-r--r--src/mess/drivers/pdp1.c2
-rw-r--r--src/mess/drivers/pet.c27
-rw-r--r--src/mess/drivers/riscpc.c2
-rw-r--r--src/mess/drivers/socrates.c2
-rw-r--r--src/mess/drivers/super80.c2
-rw-r--r--src/mess/drivers/supercon.c8
-rw-r--r--src/mess/drivers/supracan.c2
-rw-r--r--src/mess/drivers/tavernie.c1
-rw-r--r--src/mess/drivers/tispeak.c63
-rw-r--r--src/mess/drivers/trs80.c2
-rw-r--r--src/mess/drivers/ts802.c1
-rw-r--r--src/mess/drivers/v6809.c1
-rw-r--r--src/mess/drivers/wildfire.c2
-rw-r--r--src/mess/drivers/zorba.c3
-rw-r--r--src/mess/includes/c128.h1
-rw-r--r--src/mess/includes/c64.h73
-rw-r--r--src/mess/includes/coco.h9
-rw-r--r--src/mess/includes/coco12.h2
-rw-r--r--src/mess/includes/dragon.h4
-rw-r--r--src/mess/includes/hh_tms1k.h3
-rw-r--r--src/mess/layout/4004clk.lay55
-rw-r--r--src/mess/layout/aim65.lay101
-rw-r--r--src/mess/layout/lantutor.lay2
-rw-r--r--src/mess/layout/snmath.lay68
-rw-r--r--src/mess/layout/snspell.lay8
-rw-r--r--src/mess/layout/supercon.lay18
-rw-r--r--src/mess/machine/apple2gs.c2
-rw-r--r--src/mess/machine/coco.c50
-rw-r--r--src/mess/machine/coco12.c5
-rw-r--r--src/mess/machine/dragon.c12
-rw-r--r--src/mess/machine/mega32x.c4
-rw-r--r--src/mess/machine/orion.c2
-rw-r--r--src/mess/machine/vector06.c2
-rw-r--r--src/mess/video/apple2.c69
-rw-r--r--src/mess/video/apple2.h2
-rw-r--r--src/mess/video/thomson.c2
-rw-r--r--src/osd/modules/render/d3d/d3dhlsl.c2
332 files changed, 10877 insertions, 4357 deletions
diff --git a/src/emu/attotime.c b/src/emu/attotime.c
index 7eec042e8dd..7f7b2005b94 100644
--- a/src/emu/attotime.c
+++ b/src/emu/attotime.c
@@ -20,8 +20,6 @@
const attotime attotime::zero(0, 0);
const attotime attotime::never(ATTOTIME_MAX_SECONDS, 0);
-
-
//**************************************************************************
// CORE MATH FUNCTIONS
//**************************************************************************
@@ -34,7 +32,7 @@ const attotime attotime::never(ATTOTIME_MAX_SECONDS, 0);
attotime &attotime::operator*=(UINT32 factor)
{
// if one of the items is attotime::never, return attotime::never
- if (seconds >= ATTOTIME_MAX_SECONDS)
+ if (m_seconds >= ATTOTIME_MAX_SECONDS)
return *this = never;
// 0 times anything is zero
@@ -43,7 +41,7 @@ attotime &attotime::operator*=(UINT32 factor)
// split attoseconds into upper and lower halves which fit into 32 bits
UINT32 attolo;
- UINT32 attohi = divu_64x32_rem(attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
+ UINT32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
// scale the lower half, then split into high/low parts
UINT64 temp = mulu_32x32(attolo, factor);
@@ -56,13 +54,13 @@ attotime &attotime::operator*=(UINT32 factor)
temp = divu_64x32_rem(temp, ATTOSECONDS_PER_SECOND_SQRT, &reshi);
// scale the seconds
- temp += mulu_32x32(seconds, factor);
+ temp += mulu_32x32(m_seconds, factor);
if (temp >= ATTOTIME_MAX_SECONDS)
return *this = never;
// build the result
- seconds = temp;
- attoseconds = (attoseconds_t)reslo + mul_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT);
+ m_seconds = temp;
+ m_attoseconds = (attoseconds_t)reslo + mul_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT);
return *this;
}
@@ -74,7 +72,7 @@ attotime &attotime::operator*=(UINT32 factor)
attotime &attotime::operator/=(UINT32 factor)
{
// if one of the items is attotime::never, return attotime::never
- if (seconds >= ATTOTIME_MAX_SECONDS)
+ if (m_seconds >= ATTOTIME_MAX_SECONDS)
return *this = never;
// ignore divide by zero
@@ -83,11 +81,11 @@ attotime &attotime::operator/=(UINT32 factor)
// split attoseconds into upper and lower halves which fit into 32 bits
UINT32 attolo;
- UINT32 attohi = divu_64x32_rem(attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
+ UINT32 attohi = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &attolo);
// divide the seconds and get the remainder
UINT32 remainder;
- seconds = divu_64x32_rem(seconds, factor, &remainder);
+ m_seconds = divu_64x32_rem(m_seconds, factor, &remainder);
// combine the upper half of attoseconds with the remainder and divide that
UINT64 temp = (INT64)attohi + mulu_32x32(remainder, ATTOSECONDS_PER_SECOND_SQRT);
@@ -98,12 +96,12 @@ attotime &attotime::operator/=(UINT32 factor)
UINT32 reslo = divu_64x32_rem(temp, factor, &remainder);
// round based on the remainder
- attoseconds = (attoseconds_t)reslo + mulu_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT);
+ m_attoseconds = (attoseconds_t)reslo + mulu_32x32(reshi, ATTOSECONDS_PER_SECOND_SQRT);
if (remainder >= factor / 2)
- if (++attoseconds >= ATTOSECONDS_PER_SECOND)
+ if (++m_attoseconds >= ATTOSECONDS_PER_SECOND)
{
- attoseconds = 0;
- seconds++;
+ m_attoseconds = 0;
+ m_seconds++;
}
return *this;
}
@@ -126,33 +124,33 @@ const char *attotime::as_string(int precision) const
// case 1: we want no precision; seconds only
else if (precision == 0)
- sprintf(buffer, "%d", seconds);
+ sprintf(buffer, "%d", m_seconds);
// case 2: we want 9 or fewer digits of precision
else if (precision <= 9)
{
- UINT32 upper = attoseconds / ATTOSECONDS_PER_SECOND_SQRT;
+ UINT32 upper = m_attoseconds / ATTOSECONDS_PER_SECOND_SQRT;
int temp = precision;
while (temp < 9)
{
upper /= 10;
temp++;
}
- sprintf(buffer, "%d.%0*d", seconds, precision, upper);
+ sprintf(buffer, "%d.%0*d", m_seconds, precision, upper);
}
// case 3: more than 9 digits of precision
else
{
UINT32 lower;
- UINT32 upper = divu_64x32_rem(attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower);
+ UINT32 upper = divu_64x32_rem(m_attoseconds, ATTOSECONDS_PER_SECOND_SQRT, &lower);
int temp = precision;
while (temp < 18)
{
lower /= 10;
temp++;
}
- sprintf(buffer, "%d.%09d%0*d", seconds, upper, precision - 9, lower);
+ sprintf(buffer, "%d.%09d%0*d", m_seconds, upper, precision - 9, lower);
}
return buffer;
}
diff --git a/src/emu/attotime.h b/src/emu/attotime.h
index e2bdf19adaf..845bcb365b2 100644
--- a/src/emu/attotime.h
+++ b/src/emu/attotime.h
@@ -39,8 +39,6 @@
#undef min
#undef max
-
-
//**************************************************************************
// CONSTANTS
//**************************************************************************
@@ -90,35 +88,49 @@ class attotime
public:
// construction/destruction
attotime()
- : seconds(0),
- attoseconds(0) { }
+ : m_seconds(0),
+ m_attoseconds(0) { }
attotime(seconds_t secs, attoseconds_t attos)
- : seconds(secs),
- attoseconds(attos) { }
+ : m_seconds(secs),
+ m_attoseconds(attos) { }
attotime(const attotime& that)
- : seconds(that.seconds),
- attoseconds(that.attoseconds) { }
+ : m_seconds(that.m_seconds),
+ m_attoseconds(that.m_attoseconds) { }
// assignment
attotime& operator=(const attotime& that)
{
- this->seconds = that.seconds;
- this->attoseconds = that.attoseconds;
+ this->m_seconds = that.m_seconds;
+ this->m_attoseconds = that.m_attoseconds;
return *this;
}
// queries
- bool is_zero() const { return (seconds == 0 && attoseconds == 0); }
- bool is_never() const { return (seconds >= ATTOTIME_MAX_SECONDS); }
+ bool is_zero() const { return (m_seconds == 0 && m_attoseconds == 0); }
+ bool is_never() const { return (m_seconds >= ATTOTIME_MAX_SECONDS); }
// conversion to other forms
- double as_double() const { return double(seconds) + ATTOSECONDS_TO_DOUBLE(attoseconds); }
+ double as_double() const { return double(m_seconds) + ATTOSECONDS_TO_DOUBLE(m_attoseconds); }
attoseconds_t as_attoseconds() const;
UINT64 as_ticks(UINT32 frequency) const;
const char *as_string(int precision = 9) const;
+ // Needed by gba.c FIXME: this shouldn't be necessary?
+
+ void normalize()
+ {
+ while (m_attoseconds >= ATTOSECONDS_PER_SECOND)
+ {
+ m_seconds++;
+ m_attoseconds -= ATTOSECONDS_PER_SECOND;
+ }
+ }
+
+ attoseconds_t attoseconds() const { return m_attoseconds; }
+ seconds_t seconds() const { return m_seconds; }
+
// conversion from other forms
static attotime from_double(double _time);
static attotime from_ticks(UINT64 ticks, UINT32 frequency);
@@ -135,8 +147,8 @@ public:
attotime &operator/=(UINT32 factor);
// members
- seconds_t seconds;
- attoseconds_t attoseconds;
+ seconds_t m_seconds;
+ attoseconds_t m_attoseconds;
// constants
static const attotime never;
@@ -159,22 +171,22 @@ inline attotime operator+(const attotime &left, const attotime &right)
attotime result;
// if one of the items is never, return never
- if (left.seconds >= ATTOTIME_MAX_SECONDS || right.seconds >= ATTOTIME_MAX_SECONDS)
+ if (left.m_seconds >= ATTOTIME_MAX_SECONDS || right.m_seconds >= ATTOTIME_MAX_SECONDS)
return attotime::never;
// add the seconds and attoseconds
- result.attoseconds = left.attoseconds + right.attoseconds;
- result.seconds = left.seconds + right.seconds;
+ result.m_attoseconds = left.m_attoseconds + right.m_attoseconds;
+ result.m_seconds = left.m_seconds + right.m_seconds;
// normalize and return
- if (result.attoseconds >= ATTOSECONDS_PER_SECOND)
+ if (result.m_attoseconds >= ATTOSECONDS_PER_SECOND)
{
- result.attoseconds -= ATTOSECONDS_PER_SECOND;
- result.seconds++;
+ result.m_attoseconds -= ATTOSECONDS_PER_SECOND;
+ result.m_seconds++;
}
// overflow
- if (result.seconds >= ATTOTIME_MAX_SECONDS)
+ if (result.m_seconds >= ATTOTIME_MAX_SECONDS)
return attotime::never;
return result;
}
@@ -182,22 +194,22 @@ inline attotime operator+(const attotime &left, const attotime &right)
inline attotime &attotime::operator+=(const attotime &right)
{
// if one of the items is never, return never
- if (this->seconds >= ATTOTIME_MAX_SECONDS || right.seconds >= ATTOTIME_MAX_SECONDS)
+ if (this->m_seconds >= ATTOTIME_MAX_SECONDS || right.m_seconds >= ATTOTIME_MAX_SECONDS)
return *this = never;
// add the seconds and attoseconds
- attoseconds += right.attoseconds;
- seconds += right.seconds;
+ m_attoseconds += right.m_attoseconds;
+ m_seconds += right.m_seconds;
// normalize and return
- if (this->attoseconds >= ATTOSECONDS_PER_SECOND)
+ if (this->m_attoseconds >= ATTOSECONDS_PER_SECOND)
{
- this->attoseconds -= ATTOSECONDS_PER_SECOND;
- this->seconds++;
+ this->m_attoseconds -= ATTOSECONDS_PER_SECOND;
+ this->m_seconds++;
}
// overflow
- if (this->seconds >= ATTOTIME_MAX_SECONDS)
+ if (this->m_seconds >= ATTOTIME_MAX_SECONDS)
return *this = never;
return *this;
}
@@ -213,18 +225,18 @@ inline attotime operator-(const attotime &left, const attotime &right)
attotime result;
// if time1 is never, return never
- if (left.seconds >= ATTOTIME_MAX_SECONDS)
+ if (left.m_seconds >= ATTOTIME_MAX_SECONDS)
return attotime::never;
// add the seconds and attoseconds
- result.attoseconds = left.attoseconds - right.attoseconds;
- result.seconds = left.seconds - right.seconds;
+ result.m_attoseconds = left.m_attoseconds - right.m_attoseconds;
+ result.m_seconds = left.m_seconds - right.m_seconds;
// normalize and return
- if (result.attoseconds < 0)
+ if (result.m_attoseconds < 0)
{
- result.attoseconds += ATTOSECONDS_PER_SECOND;
- result.seconds--;
+ result.m_attoseconds += ATTOSECONDS_PER_SECOND;
+ result.m_seconds--;
}
return result;
}
@@ -232,18 +244,18 @@ inline attotime operator-(const attotime &left, const attotime &right)
inline attotime &attotime::operator-=(const attotime &right)
{
// if time1 is never, return never
- if (this->seconds >= ATTOTIME_MAX_SECONDS)
+ if (this->m_seconds >= ATTOTIME_MAX_SECONDS)
return *this = never;
// add the seconds and attoseconds
- attoseconds -= right.attoseconds;
- seconds -= right.seconds;
+ m_attoseconds -= right.m_attoseconds;
+ m_seconds -= right.m_seconds;
// normalize and return
- if (this->attoseconds < 0)
+ if (this->m_attoseconds < 0)
{
- this->attoseconds += ATTOSECONDS_PER_SECOND;
- this->seconds--;
+ this->m_attoseconds += ATTOSECONDS_PER_SECOND;
+ this->m_seconds--;
}
return *this;
}
@@ -284,32 +296,32 @@ inline attotime operator/(const attotime &left, UINT32 factor)
inline bool operator==(const attotime &left, const attotime &right)
{
- return (left.seconds == right.seconds && left.attoseconds == right.attoseconds);
+ return (left.m_seconds == right.m_seconds && left.m_attoseconds == right.m_attoseconds);
}
inline bool operator!=(const attotime &left, const attotime &right)
{
- return (left.seconds != right.seconds || left.attoseconds != right.attoseconds);
+ return (left.m_seconds != right.m_seconds || left.m_attoseconds != right.m_attoseconds);
}
inline bool operator<(const attotime &left, const attotime &right)
{
- return (left.seconds < right.seconds || (left.seconds == right.seconds && left.attoseconds < right.attoseconds));
+ return (left.m_seconds < right.m_seconds || (left.m_seconds == right.m_seconds && left.m_attoseconds < right.m_attoseconds));
}
inline bool operator<=(const attotime &left, const attotime &right)
{
- return (left.seconds < right.seconds || (left.seconds == right.seconds && left.attoseconds <= right.attoseconds));
+ return (left.m_seconds < right.m_seconds || (left.m_seconds == right.m_seconds && left.m_attoseconds <= right.m_attoseconds));
}
inline bool operator>(const attotime &left, const attotime &right)
{
- return (left.seconds > right.seconds || (left.seconds == right.seconds && left.attoseconds > right.attoseconds));
+ return (left.m_seconds > right.m_seconds || (left.m_seconds == right.m_seconds && left.m_attoseconds > right.m_attoseconds));
}
inline bool operator>=(const attotime &left, const attotime &right)
{
- return (left.seconds > right.seconds || (left.seconds == right.seconds && left.attoseconds >= right.attoseconds));
+ return (left.m_seconds > right.m_seconds || (left.m_seconds == right.m_seconds && left.m_attoseconds >= right.m_attoseconds));
}
@@ -319,11 +331,11 @@ inline bool operator>=(const attotime &left, const attotime &right)
inline attotime min(const attotime &left, const attotime &right)
{
- if (left.seconds > right.seconds)
+ if (left.m_seconds > right.m_seconds)
return right;
- if (left.seconds < right.seconds)
+ if (left.m_seconds < right.m_seconds)
return left;
- if (left.attoseconds > right.attoseconds)
+ if (left.m_attoseconds > right.m_attoseconds)
return right;
return left;
}
@@ -335,11 +347,11 @@ inline attotime min(const attotime &left, const attotime &right)
inline attotime max(const attotime &left, const attotime &right)
{
- if (left.seconds > right.seconds)
+ if (left.m_seconds > right.m_seconds)
return left;
- if (left.seconds < right.seconds)
+ if (left.m_seconds < right.m_seconds)
return right;
- if (left.attoseconds > right.attoseconds)
+ if (left.m_attoseconds > right.m_attoseconds)
return left;
return right;
}
@@ -353,15 +365,15 @@ inline attotime max(const attotime &left, const attotime &right)
inline attoseconds_t attotime::as_attoseconds() const
{
// positive values between 0 and 1 second
- if (seconds == 0)
- return attoseconds;
+ if (m_seconds == 0)
+ return m_attoseconds;
// negative values between -1 and 0 seconds
- else if (seconds == -1)
- return attoseconds - ATTOSECONDS_PER_SECOND;
+ else if (m_seconds == -1)
+ return m_attoseconds - ATTOSECONDS_PER_SECOND;
// out-of-range positive values
- else if (seconds > 0)
+ else if (m_seconds > 0)
return ATTOSECONDS_PER_SECOND;
// out-of-range negative values
@@ -377,8 +389,8 @@ inline attoseconds_t attotime::as_attoseconds() const
inline UINT64 attotime::as_ticks(UINT32 frequency) const
{
- UINT32 fracticks = (attotime(0, attoseconds) * frequency).seconds;
- return mulu_32x32(seconds, frequency) + fracticks;
+ UINT32 fracticks = (attotime(0, m_attoseconds) * frequency).m_seconds;
+ return mulu_32x32(m_seconds, frequency) + fracticks;
}
diff --git a/src/emu/bus/c64/c128_partner.c b/src/emu/bus/c64/c128_partner.c
index 07848e1c7d9..e9a0e922007 100644
--- a/src/emu/bus/c64/c128_partner.c
+++ b/src/emu/bus/c64/c128_partner.c
@@ -2,29 +2,29 @@
// copyright-holders:Curt Coder
/**********************************************************************
- Timeworks PARTNER 128 cartridge emulation
+ Timeworks PARTNER 128 cartridge emulation
**********************************************************************/
/*
- PCB Layout
- ----------
+ PCB Layout
+ ----------
- |---------------|
- |LS74 SW CN|
- |LS09 LS273|
- |LS139 RAM |
- |LS133 |
- | LS240 |
- |LS33 ROM |
- |LS09 |
- |||||||||||||||
+ |---------------|
+ |LS74 SW * |
+ |LS09 LS273|
+ |LS139 RAM |
+ |LS133 |
+ | LS240 |
+ |LS33 ROM |
+ |LS09 |
+ |||||||||||||||
- ROM - Toshiba TMM24128AP 16Kx8 EPROM (blank label)
- RAM - Sony CXK5864PN-15L 8Kx8 SRAM
- SW - push button switch
- CN - lead out to joystick port dongle
+ ROM - Toshiba TMM24128AP 16Kx8 EPROM (blank label)
+ RAM - Sony CXK5864PN-15L 8Kx8 SRAM
+ SW - push button switch
+ * - solder point for joystick port dongle
*/
@@ -45,11 +45,15 @@ const device_type C128_PARTNER = &device_creator<partner128_t>;
WRITE_LINE_MEMBER( partner128_t::nmi_w )
{
+ if (state)
+ {
+ m_ls74_q1 = 1;
+ }
}
static INPUT_PORTS_START( c128_partner )
PORT_START("NMI")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Menu") PORT_CODE(KEYCODE_F11) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, partner128_t, nmi_w)
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Menu") PORT_CODE(KEYCODE_END) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, partner128_t, nmi_w)
INPUT_PORTS_END
@@ -75,8 +79,13 @@ ioport_constructor partner128_t::device_input_ports() const
partner128_t::partner128_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, C128_PARTNER, "PARTNER 128", tag, owner, clock, "c128_partner", __FILE__),
device_c64_expansion_card_interface(mconfig, *this),
- device_vcs_control_port_interface(mconfig, *this),
- m_ram(*this, "ram")
+ //device_vcs_control_port_interface(mconfig, *this),
+ m_ram(*this, "ram"),
+ m_ram_a12_a7(0),
+ m_ls74_cd(0),
+ m_ls74_q1(0),
+ m_ls74_q2(0),
+ m_joyb2(0)
{
}
@@ -89,6 +98,17 @@ void partner128_t::device_start()
{
// allocate memory
m_ram.allocate(0x2000);
+
+ // simulate the 16.7ms pulse from CIA1 PB2 that would arrive thru the joystick port dongle
+ t_joyb2 = timer_alloc();
+ t_joyb2->adjust(attotime::from_msec(16), 0, attotime::from_msec(16));
+
+ // state saving
+ save_item(NAME(m_ram_a12_a7));
+ save_item(NAME(m_ls74_cd));
+ save_item(NAME(m_ls74_q1));
+ save_item(NAME(m_ls74_q2));
+ save_item(NAME(m_joyb2));
}
@@ -98,6 +118,28 @@ void partner128_t::device_start()
void partner128_t::device_reset()
{
+ m_ram_a12_a7 = 0;
+
+ m_ls74_cd = 0;
+ m_ls74_q1 = 0;
+ m_ls74_q2 = 0;
+
+ nmi_w(CLEAR_LINE);
+}
+
+
+//-------------------------------------------------
+// device_timer -
+//-------------------------------------------------
+
+void partner128_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ if (m_ls74_cd)
+ {
+ m_ls74_q2 = m_ls74_q1;
+
+ nmi_w(m_ls74_q2 ? ASSERT_LINE : CLEAR_LINE);
+ }
}
@@ -107,6 +149,34 @@ void partner128_t::device_reset()
UINT8 partner128_t::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
{
+ if (!roml)
+ {
+ data = m_roml[offset & 0x3fff];
+ }
+
+ if (!io1)
+ {
+ if (BIT(offset, 7))
+ {
+ data = m_roml[offset & 0x3fff];
+
+ if (m_ls74_cd)
+ {
+ m_ls74_q1 = 0;
+ }
+ }
+ else
+ {
+ data = m_ram[(m_ram_a12_a7 << 7) | (offset & 0x7f)];
+ }
+ }
+
+ if (m_ls74_q2 && ((offset & 0xfffa) == 0xfffa))
+ {
+ // override the 8502 NMI/IRQ vectors with 0xdede
+ data = 0xde;
+ }
+
return data;
}
@@ -117,14 +187,64 @@ UINT8 partner128_t::c64_cd_r(address_space &space, offs_t offset, UINT8 data, in
void partner128_t::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
{
+ if (!io1)
+ {
+ if (BIT(offset, 7))
+ {
+ /*
+
+ bit description
+
+ 0 RAM A7
+ 1 RAM A8
+ 2 RAM A9
+ 3 RAM A10
+ 4 RAM A11
+ 5 RAM A12
+ 6 LS74 1Cd,2Cd
+ 7 N/C
+
+ */
+
+ m_ram_a12_a7 = data & 0x3f;
+
+ m_ls74_cd = BIT(data, 6);
+
+ if (!m_ls74_cd)
+ {
+ m_ls74_q1 = 0;
+ m_ls74_q2 = 0;
+
+ nmi_w(CLEAR_LINE);
+ }
+ }
+ else
+ {
+ m_ram[(m_ram_a12_a7 << 7) | (offset & 0x7f)] = data;
+ }
+ }
+
+ if (sphi2 && ((offset & 0xfff0) == 0xd600))
+ {
+ m_ram[(m_ram_a12_a7 << 7) | (offset & 0x7f)] = data;
+ }
}
//-------------------------------------------------
-// c64_game_r - GAME read
+// vcs_joy_w - joystick write
//-------------------------------------------------
-int partner128_t::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
+void partner128_t::vcs_joy_w(UINT8 data)
{
- return 1;
+ int joyb2 = BIT(data, 2);
+
+ if (!m_joyb2 && joyb2 && m_ls74_cd)
+ {
+ m_ls74_q2 = m_ls74_q1;
+
+ nmi_w(m_ls74_q2 ? ASSERT_LINE : CLEAR_LINE);
+ }
+
+ m_joyb2 = joyb2;
}
diff --git a/src/emu/bus/c64/c128_partner.h b/src/emu/bus/c64/c128_partner.h
index b91c92026dd..d459af4124d 100644
--- a/src/emu/bus/c64/c128_partner.h
+++ b/src/emu/bus/c64/c128_partner.h
@@ -24,8 +24,8 @@
// ======================> partner128_t
class partner128_t : public device_t,
- public device_c64_expansion_card_interface,
- public device_vcs_control_port_interface
+ public device_c64_expansion_card_interface
+ //public device_vcs_control_port_interface
{
public:
// construction/destruction
@@ -40,16 +40,24 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
// device_c64_expansion_card_interface overrides
virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
- virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
// device_vcs_control_port_interface overrides
+ virtual void vcs_joy_w(UINT8 data);
private:
optional_shared_ptr<UINT8> m_ram;
+
+ emu_timer *t_joyb2;
+ int m_ram_a12_a7;
+ int m_ls74_cd;
+ int m_ls74_q1;
+ int m_ls74_q2;
+ int m_joyb2;
};
diff --git a/src/emu/bus/isa/gus.c b/src/emu/bus/isa/gus.c
index f9cba907c81..ad7d034a183 100644
--- a/src/emu/bus/isa/gus.c
+++ b/src/emu/bus/isa/gus.c
@@ -1438,7 +1438,7 @@ READ8_MEMBER(isa16_gus_device::joy_r)
data = ioport("gus_joy")->read() | 0x0f;
{
- delta = ((new_time - m_joy_time) * 256 * 1000).seconds;
+ delta = ((new_time - m_joy_time) * 256 * 1000).seconds();
if (ioport("gus_joy_1")->read() < delta) data &= ~0x01;
if (ioport("gus_joy_2")->read() < delta) data &= ~0x02;
diff --git a/src/emu/bus/msx_cart/moonsound.c b/src/emu/bus/msx_cart/moonsound.c
index d2b222f07de..cdae9385815 100644
--- a/src/emu/bus/msx_cart/moonsound.c
+++ b/src/emu/bus/msx_cart/moonsound.c
@@ -20,7 +20,7 @@ const device_type MSX_CART_MOONSOUND = &device_creator<msx_cart_moonsound>;
msx_cart_moonsound::msx_cart_moonsound(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, MSX_CART_MOONSOUND, "MSX Cartridge - MoonSound", tag, owner, clock, "msx_cart_moonsound", __FILE__)
+ : device_t(mconfig, MSX_CART_MOONSOUND, "MSX Cartridge - MoonSound", tag, owner, clock, "msx_moonsound", __FILE__)
, msx_cart_interface(mconfig, *this)
, m_ymf278b(*this, "ymf278b")
{
diff --git a/src/emu/bus/pc_joy/pc_joy.c b/src/emu/bus/pc_joy/pc_joy.c
index a8059c2f6da..99c3f5c1957 100644
--- a/src/emu/bus/pc_joy/pc_joy.c
+++ b/src/emu/bus/pc_joy/pc_joy.c
@@ -21,7 +21,7 @@ pc_joy_device::pc_joy_device(const machine_config &mconfig, const char *tag, dev
READ8_MEMBER ( pc_joy_device::joy_port_r )
{
- int delta = ((machine().time() - m_stime) * 256 * 1000).seconds;
+ int delta = ((machine().time() - m_stime) * 256 * 1000).seconds();
if(!m_dev)
return 0xf0;
diff --git a/src/emu/bus/ti99_peb/bwg.c b/src/emu/bus/ti99_peb/bwg.c
index d5504ff2283..55a1150f972 100644
--- a/src/emu/bus/ti99_peb/bwg.c
+++ b/src/emu/bus/ti99_peb/bwg.c
@@ -670,9 +670,13 @@ MACHINE_CONFIG_FRAGMENT( bwg_fdc )
MCFG_MM58274C_DAY1(0) // sunday
MCFG_FLOPPY_DRIVE_ADD("0", bwg_floppies, "525dd", snug_bwg_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("1", bwg_floppies, "525dd", snug_bwg_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("2", bwg_floppies, NULL, snug_bwg_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("3", bwg_floppies, NULL, snug_bwg_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
ROM_START( bwg_fdc )
diff --git a/src/emu/bus/ti99_peb/hfdc.c b/src/emu/bus/ti99_peb/hfdc.c
index 5bbac318b6c..188cfed82e2 100644
--- a/src/emu/bus/ti99_peb/hfdc.c
+++ b/src/emu/bus/ti99_peb/hfdc.c
@@ -1027,9 +1027,13 @@ MACHINE_CONFIG_FRAGMENT( ti99_hfdc )
MCFG_HDC92X4_DMA_OUT_CALLBACK(WRITE8(myarc_hfdc_device, write_buffer))
MCFG_FLOPPY_DRIVE_ADD("f1", hfdc_floppies, "525dd", myarc_hfdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("f2", hfdc_floppies, "525dd", myarc_hfdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("f3", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("f4", hfdc_floppies, NULL, myarc_hfdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
// NB: Hard disks don't go without image (other than floppy drives)
MCFG_MFM_HARDDISK_CONN_ADD("h1", hfdc_harddisks, NULL, MFM_BYTE, 3000, 20, MFMHD_GEN_FORMAT)
diff --git a/src/emu/bus/ti99_peb/hsgpl.c b/src/emu/bus/ti99_peb/hsgpl.c
index 7a7f09d5311..8cfe1c9ede7 100644
--- a/src/emu/bus/ti99_peb/hsgpl.c
+++ b/src/emu/bus/ti99_peb/hsgpl.c
@@ -476,7 +476,7 @@ void snug_high_speed_gpl_device::cartspace_write(address_space& space, offs_t of
{
logerror("%s: invalid write %04x <- %02x\n", tag(), offset, data);
// feeprom is normally written to using GPL ports, and I don't know
- // writing through >6000 page is enabled
+ // whether writing through >6000 page is enabled
/*
at29c040a_w(feeprom_rom6, 1 + 2*offset + 0x2000*hsgpl.cur_bank + 0x8000*port, data);
at29c040a_w(feeprom_rom6, 2*offset + 0x2000*hsgpl.cur_bank + 0x8000*port, data >> 8);
@@ -640,10 +640,10 @@ void snug_high_speed_gpl_device::device_reset()
void snug_high_speed_gpl_device::device_config_complete(void)
{
- m_dsr_eeprom = subdevice<at29040a_device>(DSR_EEPROM);
- m_rom6_eeprom = subdevice<at29040a_device>(ROM6_EEPROM);
- m_grom_a_eeprom = subdevice<at29040a_device>(GROM_A_EEPROM);
- m_grom_b_eeprom = subdevice<at29040a_device>(GROM_B_EEPROM);
+ m_dsr_eeprom = subdevice<at29c040a_device>(DSR_EEPROM);
+ m_rom6_eeprom = subdevice<at29c040a_device>(ROM6_EEPROM);
+ m_grom_a_eeprom = subdevice<at29c040a_device>(GROM_A_EEPROM);
+ m_grom_b_eeprom = subdevice<at29c040a_device>(GROM_B_EEPROM);
}
void snug_high_speed_gpl_device::device_stop()
@@ -661,10 +661,10 @@ INPUT_PORTS_START( ti99_hsgpl)
INPUT_PORTS_END
MACHINE_CONFIG_FRAGMENT( ti99_hsgpl )
- MCFG_AT29040A_ADD( DSR_EEPROM )
- MCFG_AT29040A_ADD( GROM_B_EEPROM )
- MCFG_AT29040A_ADD( GROM_A_EEPROM )
- MCFG_AT29040A_ADD( ROM6_EEPROM )
+ MCFG_AT29C040A_ADD( DSR_EEPROM )
+ MCFG_AT29C040A_ADD( GROM_B_EEPROM )
+ MCFG_AT29C040A_ADD( GROM_A_EEPROM )
+ MCFG_AT29C040A_ADD( ROM6_EEPROM )
MACHINE_CONFIG_END
machine_config_constructor snug_high_speed_gpl_device::device_mconfig_additions() const
diff --git a/src/emu/bus/ti99_peb/hsgpl.h b/src/emu/bus/ti99_peb/hsgpl.h
index a662b69c8e2..bb87cc77a38 100644
--- a/src/emu/bus/ti99_peb/hsgpl.h
+++ b/src/emu/bus/ti99_peb/hsgpl.h
@@ -18,7 +18,7 @@
#include "emu.h"
#include "peribox.h"
-#include "machine/at29040a.h"
+#include "machine/at29x.h"
extern const device_type TI99_HSGPL;
@@ -42,10 +42,10 @@ protected:
virtual machine_config_constructor device_mconfig_additions() const;
private:
- at29040a_device* m_dsr_eeprom;
- at29040a_device* m_rom6_eeprom;
- at29040a_device* m_grom_a_eeprom;
- at29040a_device* m_grom_b_eeprom;
+ at29c040a_device* m_dsr_eeprom;
+ at29c040a_device* m_rom6_eeprom;
+ at29c040a_device* m_grom_a_eeprom;
+ at29c040a_device* m_grom_b_eeprom;
UINT8* m_ram6_memory;
UINT8* m_gram_memory;
diff --git a/src/emu/bus/ti99_peb/ti_fdc.c b/src/emu/bus/ti99_peb/ti_fdc.c
index 610832e2539..e43a1be2475 100644
--- a/src/emu/bus/ti99_peb/ti_fdc.c
+++ b/src/emu/bus/ti99_peb/ti_fdc.c
@@ -407,8 +407,11 @@ MACHINE_CONFIG_FRAGMENT( ti_fdc )
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(ti_fdc_device, fdc_irq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(ti_fdc_device, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD("0", tifdc_floppies, "525dd", ti_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("1", tifdc_floppies, "525dd", ti_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("2", tifdc_floppies, NULL, ti_fdc_device::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
ROM_START( ti_fdc )
diff --git a/src/emu/bus/ti99x/datamux.c b/src/emu/bus/ti99x/datamux.c
index a18b448f354..c9db97f1788 100644
--- a/src/emu/bus/ti99x/datamux.c
+++ b/src/emu/bus/ti99x/datamux.c
@@ -470,7 +470,7 @@ void ti99_datamux_device::device_reset(void)
INPUT_PORTS_START( datamux )
PORT_START( "RAM" ) /* config */
- PORT_CONFNAME( 0x01, 0x01, "Console 32 KiB RAM upgrade (16 bit)" )
+ PORT_CONFNAME( 0x01, 0x00, "Console 32 KiB RAM upgrade (16 bit)" )
PORT_CONFSETTING( 0x00, DEF_STR( Off ) )
PORT_CONFSETTING( 0x01, DEF_STR( On ) )
diff --git a/src/emu/bus/ti99x/genboard.c b/src/emu/bus/ti99x/genboard.c
index 76c5695f178..0c021bd0234 100644
--- a/src/emu/bus/ti99x/genboard.c
+++ b/src/emu/bus/ti99x/genboard.c
@@ -168,17 +168,42 @@
Waitstate behavior (Nov 2013)
Almost perfect. Only video read access from code in DRAM is too fast by one WS
+ ==========================
+ PFM expansion
+ ==========================
+ The "Programmable Flash Memory expansion" is a replacement for the boot
+ EPROM.
+
+ PFM: Original version, 128 KiB
+ PFM+: Expansion of the original version, piggybacked, adds another 128KiB
+ PFM512: Using an AT29C040 (not A), 512 KiB
+
+ The PFM is visible as four banks in memory pages 0xF0 - 0xFF.
+
+ Bank switching is done by four 9901 pins:
+
+ 0028: LSB of bank number
+ 003A: MSB of bank number
+
+ Bank 0 is the boot code, while banks 1-3 can be used as flash drives
Michael Zapf, October 2011
February 2012: rewritten as class, restructured
+ Aug 2015: PFM added
***************************************************************************/
#include "genboard.h"
-#define VERBOSE 1
-#define LOG logerror
+#define TRACE_READ 0
+#define TRACE_WRITE 0
+#define TRACE_DETAIL 0
+#define TRACE_KEYBOARD 0
+#define TRACE_CLOCK 0
+#define TRACE_LINES 0
+#define TRACE_SETTING 1
+#define TRACE_PFM 0
geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, GENEVE_MAPPER, "Geneve Gate Array", tag, owner, clock, "geneve_mapper", __FILE__),
@@ -187,23 +212,30 @@ geneve_mapper_device::geneve_mapper_device(const machine_config &mconfig, const
m_eprom = NULL;
}
-INPUT_CHANGED_MEMBER( geneve_mapper_device::gm_changed )
+INPUT_CHANGED_MEMBER( geneve_mapper_device::settings_changed )
{
int number = (int)((UINT64)param&0x03);
int value = newval;
- if (number==1)
+ switch (number)
{
+ case 1:
// Turbo switch. May be changed at any time.
- if (VERBOSE>0) LOG("genboard: Setting turbo flag to %d\n", value);
+ if (TRACE_SETTING) logerror("%s: Setting turbo flag to %d\n", tag(), value);
m_turbo = (value!=0);
- }
- else
- {
+ break;
+ case 2:
// TIMode switch. Causes reset when changed.
- if (VERBOSE>0) LOG("genboard: Setting timode flag to %d\n", value);
+ if (TRACE_SETTING) logerror("%s: Setting timode flag to %d\n", tag(), value);
m_timode = (value!=0);
machine().schedule_hard_reset();
+ break;
+ case 3:
+ // Used when switching the boot ROMs during runtime, especially the PFM
+ set_boot_rom(value);
+ break;
+ default:
+ logerror("%s: Unknown setting %d ignored\n", tag(), number);
}
}
@@ -294,7 +326,7 @@ void geneve_mapper_device::set_wait(int min)
m_waitcount = min + 1;
if (m_waitcount > 1)
{
- if (VERBOSE>7) LOG("genboard: Pulling down READY line for %d cycles\n", min);
+ if (TRACE_LINES) logerror("%s: Pulling down READY line for %d cycles\n", tag(), min);
m_ready(CLEAR_LINE);
m_ready_asserted = false;
}
@@ -306,6 +338,71 @@ void geneve_mapper_device::set_ext_wait(int min)
m_ext_waitcount = min;
}
+void geneve_mapper_device::set_boot_rom(int selection)
+{
+ switch (selection)
+ {
+ case GENEVE_098:
+ logerror("%s: Using 0.98 boot eprom\n", tag());
+ m_eprom = machine().root_device().memregion("maincpu")->base() + 0x4000;
+ m_pfm_mode = 0;
+ break;
+ case GENEVE_100:
+ logerror("%s: Using 1.00 boot eprom\n", tag());
+ m_eprom = machine().root_device().memregion("maincpu")->base();
+ m_pfm_mode = 0;
+ break;
+ case GENEVE_PFM512:
+ logerror("%s: Using PFM512 (AT29C040)\n", tag());
+ m_pfm_mode = 1;
+ break;
+ case GENEVE_PFM512A:
+ logerror("%s: Using PFM512A (AT29C040A)\n", tag());
+ m_pfm_mode = 2;
+ break;
+ default:
+ logerror("%s: Unknown boot ROM selection\n", tag());
+ }
+}
+
+void geneve_mapper_device::set_geneve_mode(bool geneve)
+{
+ if (TRACE_SETTING) logerror("%s: Setting Geneve mode = %d\n", tag(), geneve);
+ m_geneve_mode = geneve;
+}
+
+void geneve_mapper_device::set_direct_mode(bool direct)
+{
+ if (TRACE_SETTING) logerror("%s: Setting direct mode = %d\n", tag(), direct);
+ m_direct_mode = direct;
+}
+
+void geneve_mapper_device::set_cartridge_size(int size)
+{
+ if (TRACE_SETTING) logerror("%s: Setting cartridge size to %d\n", tag(), size);
+ m_cartridge_size = size;
+}
+
+void geneve_mapper_device::set_cartridge_writable(int base, bool write)
+{
+ if (TRACE_SETTING) logerror("%s: Cartridge %04x space writable = %d\n", tag(), base, write);
+ if (base==0x6000) m_cartridge6_writable = write;
+ else m_cartridge7_writable = write;
+}
+
+void geneve_mapper_device::set_video_waitstates(bool wait)
+{
+ if (TRACE_SETTING) logerror("%s: Setting video waitstates = %d\n", tag(), wait);
+ m_video_waitstates = wait;
+}
+
+void geneve_mapper_device::set_extra_waitstates(bool wait)
+{
+ if (TRACE_SETTING) logerror("%s: Setting extra waitstates = %d\n", tag(), wait);
+ m_extra_waitstates = wait;
+}
+
+
/************************************************************************
Called by the address map
************************************************************************/
@@ -347,7 +444,6 @@ enum
READ8_MEMBER( geneve_mapper_device::readm )
{
UINT8 value = 0;
- assert (m_eprom!=NULL);
decdata *dec;
decdata debug;
@@ -371,7 +467,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
{
case MLGVIDEO:
m_video->readz(space, dec->offset, &value, 0xff);
- if (VERBOSE>7) LOG("genboard: Read video %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value);
// Video wait states are created *after* the access
// Accordingly, they have no effect when execution is in onchip RAM
if (m_video_waitstates) set_ext_wait(15);
@@ -380,13 +476,13 @@ READ8_MEMBER( geneve_mapper_device::readm )
case MLGMAPPER:
// mapper
value = m_map[dec->offset];
- if (VERBOSE>7) LOG("genboard: read mapper %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: read mapper %04x -> %02x\n", tag(), dec->offset, value);
break;
case MLGKEY:
// key
if (!space.debugger_access()) value = m_keyboard->get_recent_key();
- if (VERBOSE>7) LOG("genboard: Read keyboard -> %02x\n", value);
+ if (TRACE_READ) logerror("%s: Read keyboard -> %02x\n", tag(), value);
break;
case MLGCLOCK:
@@ -394,19 +490,19 @@ READ8_MEMBER( geneve_mapper_device::readm )
// tests on the real machine showed that
// upper nibble is 0xf (probably because of the location at 0xf130?)
value = m_clock->read(space, dec->offset) | 0xf0;
- if (VERBOSE>7) LOG("genboard: Read clock %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: Read clock %04x -> %02x\n", tag(), dec->offset, value);
break;
case MLTMAPPER:
// mapper
value = m_map[dec->offset];
- if (VERBOSE>7) LOG("genboard: Read mapper %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: Read mapper %04x -> %02x\n", tag(), dec->offset, value);
break;
case MLTKEY:
// key
if (!space.debugger_access()) value = m_keyboard->get_recent_key();
- if (VERBOSE>7) LOG("genboard: Read keyboard -> %02x\n", value);
+ if (TRACE_READ) logerror("%s: Read keyboard -> %02x\n", tag(), value);
break;
case MLTCLOCK:
@@ -420,7 +516,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// value floating around.
value = m_clock->read(space, dec->offset);
value |= (dec->offset==0x000f)? 0x20 : 0x10;
- if (VERBOSE>7) LOG("genboard: Read clock %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: Read clock %04x -> %02x\n", tag(), dec->offset, value);
break;
case MLTVIDEO:
@@ -428,7 +524,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// ++++ ++-- ---- ---+
// 1000 1000 0000 00x0
m_video->readz(space, dec->offset, &value, 0xff);
- if (VERBOSE>7) LOG("genboard: Read video %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value);
// See above
if (m_video_waitstates) set_ext_wait(15);
break;
@@ -439,7 +535,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// 1001 0000 0000 0000
// We need to add the address prefix bits
m_peribox->readz(space, dec->offset, &value, 0xff);
- if (VERBOSE>7) LOG("genboard: Read speech -> %02x\n", value);
+ if (TRACE_READ) logerror("%s: Read speech -> %02x\n", tag(), value);
break;
case MLTGROM:
@@ -447,7 +543,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// ++++ ++-- ---- ---+
// 1001 1000 0000 00x0
if (!space.debugger_access()) value = read_grom(space, dec->offset, 0xff);
- if (VERBOSE>7) LOG("genboard: Read GROM %04x -> %02x\n", dec->offset, value);
+ if (TRACE_READ) logerror("%s: Read GROM %04x -> %02x\n", tag(), dec->offset, value);
break;
case MLGSOUND:
@@ -460,20 +556,25 @@ READ8_MEMBER( geneve_mapper_device::readm )
// DRAM.
value = m_dram[dec->physaddr];
// LOG("dram read physaddr = %06x logaddr = %04x value = %02x\n", dec->physaddr, dec->offset, value);
- if (VERBOSE>7) LOG("genboard: Read DRAM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
+ if (TRACE_READ) logerror("%s: Read DRAM %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
break;
case MPGEXP:
// On-board memory expansion for standard Geneve (never used)
- if (VERBOSE>7) LOG("genboard: Read unmapped area %06x\n", dec->physaddr);
+ if (TRACE_READ) logerror("%s: Read unmapped area %06x\n", tag(), dec->physaddr);
value = 0;
break;
case MPGEPROM:
// 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
// mirrored for f0, f2, f4, ...; f1, f3, f5, ...
- value = m_eprom[dec->physaddr];
- if (VERBOSE>7) LOG("genboard: Read EPROM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
+ if (m_pfm_mode == 0)
+ {
+ value = m_eprom[dec->physaddr & 0x003fff];
+ if (TRACE_READ) logerror("%s: Read EPROM %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
+ }
+ else value = read_from_pfm(space, dec->physaddr, 0xff);
+
break;
case MPGSRAM:
@@ -484,7 +585,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
else value = 0;
// Return in any case
// LOG("sram read physaddr = %06x logaddr = %04x value = %02x\n", dec->physaddr, dec->offset, value);
- if (VERBOSE>7) LOG("genboard: Read SRAM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
+ if (TRACE_READ) logerror("%s: Read SRAM %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
break;
case MPGBOX:
@@ -493,7 +594,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// 0x000000-0x1fffff for the GenMod.(AME,AMD,AMC,AMB,AMA,A0 ...,A15)
m_peribox->readz(space, dec->physaddr, &value, 0xff);
- if (VERBOSE>7) LOG("genboard: Read P-Box %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
+ if (TRACE_READ) logerror("%s: Read P-Box %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
break;
case MPGMDRAM:
@@ -504,7 +605,12 @@ READ8_MEMBER( geneve_mapper_device::readm )
case MPGMEPROM:
// 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
// mirrored for f0, f2, f4, ...; f1, f3, f5, ...
- value = m_eprom[dec->physaddr];
+ if (m_pfm_mode == 0)
+ {
+ value = m_eprom[dec->physaddr & 0x003fff];
+ if (TRACE_READ) logerror("%s: Read EPROM %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
+ }
+ else value = read_from_pfm(space, dec->physaddr, 0xff);
break;
case MPGMBOX:
@@ -541,7 +647,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// ++++ ++++ ++++ ---+
// 1111 0001 0000 .cc0
m_video->write(space, dec->offset, data, 0xff);
- if (VERBOSE>7) LOG("genboard: Write video %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data);
// See above
if (m_video_waitstates) set_ext_wait(15);
break;
@@ -549,33 +655,33 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
case MLGMAPPER:
// mapper
m_map[dec->offset] = data;
- if (VERBOSE>7) LOG("genboard: Write mapper %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write mapper %04x <- %02x\n", tag(), offset, data);
break;
case MLGCLOCK:
// clock
// ++++ ++++ ++++ ----
m_clock->write(space, dec->offset, data);
- if (VERBOSE>7) LOG("genboard: Write clock %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write clock %04x <- %02x\n", tag(), offset, data);
break;
case MLGSOUND:
// sound
// ++++ ++++ ++++ ---+
m_sound->write(space, 0, data, 0xff);
- if (VERBOSE>7) LOG("genboard: Write sound <- %02x\n", data);
+ if (TRACE_WRITE) logerror("%s: Write sound <- %02x\n", tag(), data);
break;
case MLTMAPPER:
// mapper
m_map[dec->offset] = data;
- if (VERBOSE>7) LOG("genboard: Write mapper %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write mapper %04x <- %02x\n", tag(), offset, data);
break;
case MLTCLOCK:
// clock
m_clock->write(space, dec->offset, data);
- if (VERBOSE>7) LOG("genboard: Write clock %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write clock %04x <- %02x\n", tag(), offset, data);
break;
case MLTVIDEO:
@@ -584,7 +690,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// 1000 1100 0000 00c0
// Initialize waitstate timer
m_video->write(space, dec->offset, data, 0xff);
- if (VERBOSE>7) LOG("genboard: Write video %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data);
// See above
if (m_video_waitstates) set_ext_wait(15);
break;
@@ -595,7 +701,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// 1001 0100 0000 0000
// We need to add the address prefix bits
m_peribox->write(space, dec->offset, data, 0xff);
- if (VERBOSE>7) LOG("genboard: Write speech <- %02x\n", data);
+ if (TRACE_WRITE) logerror("%s: Write speech <- %02x\n", tag(), data);
break;
case MLTGROM:
@@ -603,7 +709,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// ++++ ++-- ---- ---+
// 1001 1100 0000 00c0
write_grom(space, dec->offset, data, 0xff);
- if (VERBOSE>7) LOG("genboard: Write GROM %04x <- %02x\n", offset, data);
+ if (TRACE_WRITE) logerror("%s: Write GROM %04x <- %02x\n", tag(), offset, data);
break;
case MLTSOUND:
@@ -611,7 +717,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// ++++ ++-- ---- ---+
// 1000 0100 0000 0000
m_sound->write(space, 0, data, 0xff);
- if (VERBOSE>7) LOG("genboard: Write sound <- %02x\n", data);
+ if (TRACE_WRITE) logerror("%s: Write sound <- %02x\n", tag(), data);
break;
case MLTKEY:
@@ -621,19 +727,21 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
case MPGDRAM:
// DRAM write. One wait state. (only for normal Geneve)
m_dram[dec->physaddr] = data;
- if (VERBOSE>7) LOG("genboard: Write DRAM %04x (%06x) <- %02x\n", offset, dec->physaddr, data);
+ if (TRACE_WRITE) logerror("%s: Write DRAM %04x (%06x) <- %02x\n", tag(), offset, dec->physaddr, data);
break;
case MPGEXP:
// On-board memory expansion for standard Geneve (never used)
- if (VERBOSE>7) LOG("genboard: Write unmapped area %06x\n", dec->physaddr);
+ if (TRACE_WRITE) logerror("%s: Write unmapped area %06x\n", tag(), dec->physaddr);
break;
case MPGEPROM:
// 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
// mirrored for f0, f2, f4, ...; f1, f3, f5, ...
- // Ignore EPROM write
- if (VERBOSE>7) LOG("genboard: Write EPROM %04x (%06x) <- %02x, ignored\n", offset, dec->physaddr, data);
+ // Ignore EPROM write (unless PFM)
+ if (m_pfm_mode != 0) write_to_pfm(space, dec->physaddr, data, 0xff);
+ else
+ logerror("%s: Write EPROM %04x (%06x) <- %02x, ignored\n", tag(), offset, dec->physaddr, data);
break;
case MPGSRAM:
@@ -641,12 +749,12 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
{
m_sram[dec->physaddr & ~m_sram_mask] = data;
}
- if (VERBOSE>7) LOG("genboard: Write SRAM %04x (%06x) <- %02x\n", offset, dec->physaddr, data);
+ if (TRACE_WRITE) logerror("%s: Write SRAM %04x (%06x) <- %02x\n", tag(), offset, dec->physaddr, data);
break;
case MPGBOX:
dec->physaddr = (dec->physaddr & 0x0007ffff); // 19 bit address
- if (VERBOSE>7) LOG("genboard: Write P-Box %04x (%06x) <- %02x\n", offset, dec->physaddr, data);
+ if (TRACE_WRITE) logerror("%s: Write P-Box %04x (%06x) <- %02x\n", tag(), offset, dec->physaddr, data);
m_peribox->write(space, dec->physaddr, data, 0xff);
break;
@@ -659,6 +767,9 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
// mirrored for f0, f2, f4, ...; f1, f3, f5, ...
// Ignore EPROM write
+ if (m_pfm_mode != 0) write_to_pfm(space, dec->physaddr, data, 0xff);
+ else
+ logerror("%s: Write EPROM %04x (%06x) <- %02x, ignored\n", tag(), offset, dec->physaddr, data);
break;
case MPGMBOX:
@@ -784,7 +895,7 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
// Determine physical address
if (m_direct_mode)
{
- dec->physaddr = 0x1e0000; // points to boot eprom
+ dec->physaddr = 0x1f0000; // points to boot eprom (page F8)
}
else
{
@@ -822,9 +933,8 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
if ((dec->physaddr & 0x1e0000)==0x1e0000)
{
// 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
- // mirrored for f0, f2, f4, ...; f1, f3, f5, ...
+ // mirrored for f0, f2, f4, ...; f1, f3, f5, ... unless using PFM
dec->function = MPGEPROM;
- dec->physaddr = dec->physaddr & 0x003fff;
set_wait(0);
return;
}
@@ -862,9 +972,8 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
if ((dec->physaddr & 0x1e0000)==0x1e0000)
{
// 1 111. ..xx xxxx xxxx xxxx on-board eprom (16K)
- // mirrored for f0, f2, f4, ...; f1, f3, f5, ...
+ // mirrored for f0, f2, f4, ...; f1, f3, f5, ... unless using PFM
dec->function = MPGMEPROM;
- dec->physaddr = dec->physaddr & 0x003fff;
set_wait(0);
return;
}
@@ -983,7 +1092,7 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
if (m_cartridge_size==0x4000)
{
m_cartridge_secondpage = ((dec->offset & 0x0002)!=0);
- if (VERBOSE>7) LOG("genboard: Set cartridge page %02x\n", m_cartridge_secondpage);
+ if (TRACE_WRITE) logerror("%s: Set cartridge page %02x\n", tag(), m_cartridge_secondpage);
set_wait(1);
return;
}
@@ -993,7 +1102,7 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
if ((((dec->offset & 0x1000)==0x0000) && !m_cartridge6_writable)
|| (((dec->offset & 0x1000)==0x1000) && !m_cartridge7_writable))
{
- if (VERBOSE>0) LOG("genboard: Writing to protected cartridge space %04x ignored\n", dec->offset);
+ logerror("%s: Writing to protected cartridge space %04x ignored\n", tag(), dec->offset);
return;
}
else
@@ -1049,7 +1158,7 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
{
// GenMod mode
if ((dec->physaddr & 0x1e0000)==0x1e0000)
- { // EPROM, ignore
+ { // EPROM, ignore (unless PFM)
dec->function = MPGMEPROM;
set_wait(0);
return;
@@ -1073,13 +1182,61 @@ void geneve_mapper_device::decode(address_space& space, offs_t offset, bool read
}
/*
+ Read from PFM.
+*/
+READ8_MEMBER( geneve_mapper_device::read_from_pfm )
+{
+ UINT8 value = 0;
+ if (!m_pfm_output_enable) return 0;
+
+ int address = (offset & 0x01ffff) | (m_pfm_bank<<17);
+
+ switch (m_pfm_mode)
+ {
+ case 1:
+ value = m_pfm512->read(space, address, mem_mask);
+ break;
+ case 2:
+ value = m_pfm512a->read(space, address, mem_mask);
+ break;
+ default:
+ logerror("%s: Illegal mode for reading PFM: %d\n", tag(), m_pfm_mode);
+ return 0;
+ }
+
+ if (TRACE_PFM) logerror("%s: Reading from PFM at address %05x -> %02x\n", tag(), address, value);
+ return value;
+}
+
+WRITE8_MEMBER( geneve_mapper_device::write_to_pfm )
+{
+ // Nota bene: The PFM must be write protected on startup, or the RESET
+ // of the 9995 will attempt to write the return vector into the flash EEPROM
+ int address = (offset & 0x01ffff) | (m_pfm_bank<<17);
+ if (TRACE_PFM) logerror("%s: Writing to PFM at address %05x <- %02x\n", tag(), address, data);
+
+ switch (m_pfm_mode)
+ {
+ case 1:
+ m_pfm512->write(space, address, data, mem_mask);
+ break;
+ case 2:
+ m_pfm512a->write(space, address, data, mem_mask);
+ break;
+ default:
+ logerror("%s: Illegal mode for writing to PFM: %d\n", tag(), m_pfm_mode);
+ }
+}
+
+
+/*
Accept the address passed over the address bus and decode it appropriately.
This decoding will later be used in the READ/WRITE member functions. Also,
we initiate wait state creation here.
*/
SETOFFSET_MEMBER( geneve_mapper_device::setoffset )
{
- if (VERBOSE>7) LOG("genboard: setoffset = %04x\n", offset);
+ if (TRACE_DETAIL) logerror("%s: setoffset = %04x\n", tag(), offset);
m_debug_no_ws = false;
decode(space, offset, m_read_mode, &m_decoded);
}
@@ -1108,14 +1265,14 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
m_waitcount--;
if (m_waitcount == 0)
{
- if (VERBOSE>5) LOG("genboard: clock, READY asserted\n");
+ if (TRACE_CLOCK) logerror("%s: clock, READY asserted\n", tag());
m_ready(ASSERT_LINE);
m_ready_asserted = true;
}
- else
- {
- if (VERBOSE>5) LOG("genboard: clock\n");
- }
+ else
+ {
+ if (TRACE_CLOCK) logerror("%s: clock\n", tag());
+ }
}
else
{
@@ -1124,13 +1281,13 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
m_ext_waitcount--;
if (m_ext_waitcount == 0)
{
- if (VERBOSE>5) LOG("genboard: clock, READY asserted after video\n");
+ if (TRACE_CLOCK) logerror("%s: clock, READY asserted after video\n", tag());
m_ready(ASSERT_LINE);
m_ready_asserted = true;
}
else
{
- if (VERBOSE>5) LOG("genboard: vclock, ew=%d\n", m_ext_waitcount);
+ if (TRACE_CLOCK) logerror("%s: vclock, ew=%d\n", tag(), m_ext_waitcount);
}
}
}
@@ -1142,7 +1299,7 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
// Do we have video wait states? In that case, clear the line again
if ((m_waitcount == 0) && (m_ext_waitcount > 0) && m_ready_asserted)
{
- if (VERBOSE>5) LOG("genboard: clock, READY cleared for video\n");
+ if (TRACE_CLOCK) logerror("%s: clock, READY cleared for video\n", tag());
m_ready(CLEAR_LINE);
m_ready_asserted = false;
}
@@ -1155,14 +1312,39 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
WRITE_LINE_MEMBER( geneve_mapper_device::dbin_in )
{
m_read_mode = (state==ASSERT_LINE);
- if (VERBOSE>7) LOG("genboard: dbin = %02x\n", m_read_mode? 1:0);
+ if (TRACE_DETAIL) logerror("%s: dbin = %02x\n", tag(), m_read_mode? 1:0);
+}
+
+/*
+ PFM expansion: Setting the bank.
+*/
+WRITE_LINE_MEMBER( geneve_mapper_device::pfm_select_lsb )
+{
+ if (state==ASSERT_LINE) m_pfm_bank |= 1;
+ else m_pfm_bank &= 0xfe;
+ if (TRACE_PFM) logerror("%s: Setting bank (l) = %d\n", tag(), m_pfm_bank);
+}
+
+WRITE_LINE_MEMBER( geneve_mapper_device::pfm_select_msb )
+{
+ if (state==ASSERT_LINE) m_pfm_bank |= 2;
+ else m_pfm_bank &= 0xfd;
+ if (TRACE_PFM) logerror("%s: Setting bank (u) = %d\n", tag(), m_pfm_bank);
+}
+
+WRITE_LINE_MEMBER( geneve_mapper_device::pfm_output_enable )
+{
+ // Negative logic
+ m_pfm_output_enable = (state==CLEAR_LINE);
+ if (TRACE_PFM) logerror("%s: PFM output %s\n", tag(), m_pfm_output_enable? "enable" : "disable");
}
-/*** DEVICE LIFECYCLE FUNCTIONS ***/
+//====================================================================
+// Common device lifecycle
+//====================================================================
void geneve_mapper_device::device_start()
{
- if (VERBOSE>0) LOG("genboard: Starting Geneve mapper\n");
// Get pointers
m_peribox = machine().device<bus8z_device>(PERIBOX_TAG);
m_keyboard = machine().device<geneve_keyboard_device>(GKEYBOARD_TAG);
@@ -1170,6 +1352,10 @@ void geneve_mapper_device::device_start()
m_sound = machine().device<bus8z_device>(TISOUND_TAG);
m_clock = machine().device<mm58274c_device>(GCLOCK_TAG);
+ // PFM expansion
+ m_pfm512 = machine().device<at29c040_device>(PFM512_TAG);
+ m_pfm512a = machine().device<at29c040a_device>(PFM512A_TAG);
+
m_ready.resolve();
m_sram = machine().root_device().memregion(SRAM_TAG)->base();
@@ -1182,8 +1368,6 @@ void geneve_mapper_device::device_start()
void geneve_mapper_device::device_reset()
{
- if (VERBOSE>1) LOG("genboard: Resetting mapper\n");
-
m_extra_waitstates = false;
m_video_waitstates = true;
m_read_mode = false;
@@ -1198,33 +1382,25 @@ void geneve_mapper_device::device_reset()
m_cartridge6_writable = false;
m_cartridge7_writable = false;
m_grom_address = 0;
+ m_pfm_bank = 0;
+ m_pfm_output_enable = true;
// Clear map
for (int i=0; i < 8; i++) m_map[i] = 0;
m_genmod = false;
- if (machine().root_device().ioport("MODE")->read()==0)
- {
- switch (machine().root_device().ioport("BOOTROM")->read())
- {
- case GENEVE_098:
- if (VERBOSE>0) LOG("genboard: Using 0.98 boot eprom\n");
- m_eprom = machine().root_device().memregion("maincpu")->base() + 0x4000;
- break;
- case GENEVE_100:
- if (VERBOSE>0) LOG("genboard: Using 1.00 boot eprom\n");
- m_eprom = machine().root_device().memregion("maincpu")->base();
- break;
- }
- }
- else
+ // Check which boot EPROM we are using (or PFM)
+ set_boot_rom(machine().root_device().ioport("BOOTROM")->read());
+
+ // Check for GenMod. We assume that GenMod can be combined with PFM.
+ if (machine().root_device().ioport("MODE")->read()!=0)
{
- if (VERBOSE>0) LOG("genboard: Using GenMod modification\n");
+ logerror("%s: Using GenMod modification\n", tag());
m_eprom = machine().root_device().memregion("maincpu")->base() + 0x8000;
if (m_eprom[0] != 0xf0)
{
- fatalerror("genboard: GenMod boot rom missing.\n");
+ fatalerror("genboard: GenMod boot ROM missing\n");
}
m_genmod = true;
m_turbo = ((machine().root_device().ioport("GENMODDIPS")->read() & GM_TURBO)!=0);
@@ -1301,7 +1477,7 @@ void geneve_keyboard_device::post_in_key_queue(int keycode)
m_key_queue[(m_key_queue_head + m_key_queue_length) % KEYQUEUESIZE] = keycode;
m_key_queue_length++;
- if (VERBOSE>5) LOG("genboard: posting keycode %02x\n", keycode);
+ if (TRACE_KEYBOARD) logerror("%s: Posting keycode %02x\n", tag(), keycode);
}
void geneve_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -1316,7 +1492,7 @@ void geneve_keyboard_device::poll()
int i, j;
int keycode;
int pressed;
- if (VERBOSE>7) LOG("genboard: poll keyboard\n");
+ if (TRACE_KEYBOARD) logerror("%s: Poll keyboard\n", tag());
if (m_key_reset) return;
/* Poll keyboard */
@@ -1522,7 +1698,7 @@ void geneve_keyboard_device::signal_when_key_available()
// buffer clear is disabled, and key queue is not empty. */
if ((!m_key_reset) && (m_keyboard_clock) && (m_keep_keybuf) && (m_key_queue_length != 0))
{
- if (VERBOSE>6) LOG("genboard: signalling key available\n");
+ if (TRACE_KEYBOARD) logerror("%s: Signalling key available\n", tag());
m_interrupt(ASSERT_LINE);
m_key_in_buffer = true;
}
@@ -1532,7 +1708,7 @@ WRITE_LINE_MEMBER( geneve_keyboard_device::clock_control )
{
bool rising_edge = (!m_keyboard_clock && (state==ASSERT_LINE));
m_keyboard_clock = (state==ASSERT_LINE);
- if (VERBOSE>5) LOG("genboard: keyboard clock_control state=%d\n", m_keyboard_clock);
+ if (TRACE_KEYBOARD) logerror("%s: Keyboard clock_control state=%d\n", tag(), m_keyboard_clock);
if (rising_edge)
signal_when_key_available();
}
@@ -1582,7 +1758,6 @@ WRITE_LINE_MEMBER( geneve_keyboard_device::reset_line )
void geneve_keyboard_device::device_start()
{
- if (VERBOSE>2) LOG("genboard: Keyboard started\n");
m_timer = timer_alloc(0);
m_interrupt.resolve();
}
diff --git a/src/emu/bus/ti99x/genboard.h b/src/emu/bus/ti99x/genboard.h
index 7728552aea8..d9905ba9168 100644
--- a/src/emu/bus/ti99x/genboard.h
+++ b/src/emu/bus/ti99x/genboard.h
@@ -18,6 +18,7 @@
#include "machine/mm58274c.h"
#include "video/v9938.h"
#include "cpu/tms9900/tms9995.h"
+#include "machine/at29x.h"
extern const device_type GENEVE_MOUSE;
extern const device_type GENEVE_KEYBOARD;
@@ -109,25 +110,27 @@ class geneve_mapper_device : public device_t
{
public:
geneve_mapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- inline void set_geneve_mode(bool geneve) { m_geneve_mode = geneve; }
- inline void set_direct_mode(bool direct) { m_direct_mode = direct; }
- inline void set_cartridge_size(int size) { m_cartridge_size = size; }
- inline void set_cartridge_writable(int base, bool write)
- {
- if (base==0x6000) m_cartridge6_writable = write;
- else m_cartridge7_writable = write;
- }
- inline void set_video_waitstates(bool wait) { m_video_waitstates = wait; }
- inline void set_extra_waitstates(bool wait) { m_extra_waitstates = wait; }
+ void set_geneve_mode(bool geneve);
+ void set_direct_mode(bool direct);
+ void set_cartridge_size(int size);
+ void set_cartridge_writable(int base, bool write);
+ void set_video_waitstates(bool wait);
+ void set_extra_waitstates(bool wait);
DECLARE_READ8_MEMBER( readm );
DECLARE_WRITE8_MEMBER( writem );
DECLARE_SETOFFSET_MEMBER( setoffset );
- DECLARE_INPUT_CHANGED_MEMBER( gm_changed );
+ DECLARE_INPUT_CHANGED_MEMBER( settings_changed );
DECLARE_WRITE_LINE_MEMBER( clock_in );
DECLARE_WRITE_LINE_MEMBER( dbin_in );
+
+ // PFM support
+ DECLARE_WRITE_LINE_MEMBER( pfm_select_lsb );
+ DECLARE_WRITE_LINE_MEMBER( pfm_select_msb );
+ DECLARE_WRITE_LINE_MEMBER( pfm_output_enable );
+
template<class _Object> static devcb_base &static_set_ready_callback(device_t &device, _Object object) { return downcast<geneve_mapper_device &>(device).m_ready.set_callback(object); }
protected:
@@ -177,6 +180,15 @@ private:
bool m_genmod;
bool m_timode;
+ // PFM mod (0 = none, 1 = AT29C040, 2 = AT29C040A)
+ DECLARE_READ8_MEMBER( read_from_pfm );
+ DECLARE_WRITE8_MEMBER( write_to_pfm );
+ void set_boot_rom(int selection);
+ int m_pfm_mode;
+ int m_pfm_bank;
+ bool m_pfm_output_enable;
+
+ // SRAM access
int m_sram_mask;
int m_sram_val;
@@ -190,6 +202,8 @@ private:
// Devices
mm58274c_device* m_clock;
tms9995_device* m_cpu;
+ at29c040_device* m_pfm512;
+ at29c040a_device* m_pfm512a;
geneve_keyboard_device* m_keyboard;
bus8z_device* m_video;
diff --git a/src/emu/bus/ti99x/gromport.c b/src/emu/bus/ti99x/gromport.c
index 427dc929b8a..2119a93c348 100644
--- a/src/emu/bus/ti99x/gromport.c
+++ b/src/emu/bus/ti99x/gromport.c
@@ -112,8 +112,14 @@
***************************************************************************/
#include "gromport.h"
-#define VERBOSE 1
-#define LOG logerror
+#define TRACE_RPK 0
+#define TRACE_CHANGE 0
+#define TRACE_ILLWRITE 0
+#define TRACE_CONFIG 0
+#define TRACE_READ 0
+#define TRACE_GROM 0
+#define TRACE_GKRACKER 0
+#define TRACE_CRU 0
#define GROM3_TAG "grom3"
#define GROM4_TAG "grom4"
@@ -123,7 +129,6 @@
#define CARTGROM_TAG "grom_contents"
#define CARTROM_TAG "rom_contents"
-#define CARTROM2_TAG "rom2_contents"
#define GKRACKER_ROM_TAG "gkracker_rom"
#define GKRACKER_NVRAM_TAG "gkracker_nvram"
@@ -407,8 +412,8 @@ multi_conn_device::multi_conn_device(const machine_config &mconfig, const char *
*/
void multi_conn_device::set_slot(int slotnumber)
{
- if (VERBOSE>7)
- if (m_active_slot != slotnumber) LOG("multi_conn_device: Setting cartslot to %d\n", slotnumber);
+ if (TRACE_CHANGE)
+ if (m_active_slot != slotnumber) logerror("%s: Setting cartslot to %d\n", tag(), slotnumber);
if (m_fixed_slot==AUTO)
m_active_slot = slotnumber;
@@ -432,14 +437,14 @@ int multi_conn_device::get_active_slot(bool changebase, offs_t offset)
void multi_conn_device::insert(int index, ti99_cartridge_device* cart)
{
- if (VERBOSE>3) LOG("multi_conn_device: insert slot %d\n", index);
+ if (TRACE_CHANGE) logerror("%s: Insert slot %d\n", tag(), index);
m_cartridge[index] = cart;
m_gromport->cartridge_inserted();
}
void multi_conn_device::remove(int index)
{
- if (VERBOSE>3) LOG("multi_conn_device: remove slot %d\n", index);
+ if (TRACE_CHANGE) logerror("%s: Remove slot %d\n", tag(), index);
m_cartridge[index] = NULL;
}
@@ -494,7 +499,7 @@ WRITE8_MEMBER(multi_conn_device::write)
{
if (slot < NUMBER_OF_CARTRIDGE_SLOTS && m_cartridge[slot] != NULL)
{
- // LOG("try it on slot %d\n", slot);
+ // logerror("%s: try it on slot %d\n", tag(), slot);
m_cartridge[slot]->write(space, offset, data, mem_mask);
}
}
@@ -798,7 +803,7 @@ READ8Z_MEMBER(gkracker_device::readz)
}
}
}
- if (VERBOSE>8) LOG("gkracker_device: read %04x -> %02x\n", offset, *value);
+ if (TRACE_READ) logerror("%s: Read %04x -> %02x\n", tag(), offset, *value);
}
WRITE8_MEMBER(gkracker_device::write)
@@ -820,7 +825,7 @@ WRITE8_MEMBER(gkracker_device::write)
// Accept low address byte (second write)
m_grom_address = (m_grom_address & 0xff00) | data;
m_waddr_LSB = false;
- if (VERBOSE>8) LOG("gkracker_device: set grom address %04x\n", m_grom_address);
+ if (TRACE_GROM) logerror("%s: Set grom address %04x\n", tag(), m_grom_address);
}
else
{
@@ -832,7 +837,7 @@ WRITE8_MEMBER(gkracker_device::write)
else
{
// Write data byte to GRAM area.
- if (VERBOSE>7) LOG("gkracker_device: gwrite %04x(%04x) <- %02x\n", offset, m_grom_address, data);
+ if (TRACE_GROM) logerror("%s: gwrite %04x(%04x) <- %02x\n", tag(), offset, m_grom_address, data);
// According to manual:
// Writing to GRAM 0: switch 2 set to GRAM 0 + Write protect switch (4) in 1 or 2 position
@@ -871,7 +876,7 @@ WRITE8_MEMBER(gkracker_device::write)
{
// Write to the RAM space of the GRAM Kracker
// (only if no cartridge is present)
- if (VERBOSE>7) LOG("gkracker_device: write %04x <- %02x\n", offset, data);
+ if (TRACE_GROM) logerror("%s: write %04x <- %02x\n", tag(), offset, data);
if (m_cartridge == NULL)
{
if (m_gk_switch[1] == GK_OFF) return; // just don't do anything
@@ -908,13 +913,13 @@ WRITE8_MEMBER( gkracker_device::cruwrite )
INPUT_CHANGED_MEMBER( gkracker_device::gk_changed )
{
- if (VERBOSE>7) LOG("gkracker_device: input changed %d - %d\n", (int)((UINT64)param & 0x07), newval);
+ if (TRACE_GKRACKER) logerror("%s: Input changed %d - %d\n", tag(), (int)((UINT64)param & 0x07), newval);
m_gk_switch[(UINT64)param & 0x07] = newval;
}
void gkracker_device::insert(int index, ti99_cartridge_device* cart)
{
- if (VERBOSE>3) LOG("gkracker_device: insert cartridge\n");
+ if (TRACE_CHANGE) logerror("%s: Insert cartridge\n", tag());
m_cartridge = cart;
// Switch 1 has a third location for resetting. We do the reset by default
// here. It can be turned off in the configuration.
@@ -923,7 +928,7 @@ void gkracker_device::insert(int index, ti99_cartridge_device* cart)
void gkracker_device::remove(int index)
{
- if (VERBOSE>3) LOG("gkracker_device: remove cartridge\n");
+ if (TRACE_CHANGE) logerror("%s: Remove cartridge\n", tag());
m_cartridge = NULL;
}
@@ -946,7 +951,7 @@ void gkracker_device::gk_install_menu(const char* menutext, int len, int ptr, in
*/
void gkracker_device::nvram_default()
{
- if (VERBOSE>3) LOG("gkracker_device: Creating default NVRAM\n");
+ if (TRACE_GKRACKER) logerror("%s: Creating default NVRAM\n", tag());
memset(m_ram_ptr, 0, 81920);
m_ram_ptr[0x6000] = 0xaa;
@@ -970,7 +975,7 @@ void gkracker_device::nvram_default()
void gkracker_device::nvram_read(emu_file &file)
{
int readsize = file.read(m_ram_ptr, 81920);
- if (VERBOSE>3) LOG("gkracker_device: reading NVRAM\n");
+ if (TRACE_GKRACKER) logerror("%s: Reading NVRAM\n", tag());
// If we increased the size, fill the remaining parts with 0
if (readsize < 81920)
{
@@ -980,7 +985,7 @@ void gkracker_device::nvram_read(emu_file &file)
void gkracker_device::nvram_write(emu_file &file)
{
- if (VERBOSE>3) LOG("gkracker_device: writing NVRAM\n");
+ if (TRACE_GKRACKER) logerror("%s: Writing NVRAM\n", tag());
file.write(m_ram_ptr, 81920);
}
@@ -1080,6 +1085,8 @@ enum
PCB_SUPER,
PCB_MBX,
PCB_PAGED379I,
+ PCB_PAGED378,
+ PCB_PAGED377,
PCB_PAGEDCRU,
PCB_GROMEMU
};
@@ -1092,6 +1099,8 @@ static const pcb_type pcbdefs[] =
{ PCB_SUPER, "super" },
{ PCB_MBX, "mbx" },
{ PCB_PAGED379I, "paged379i" },
+ { PCB_PAGED378, "paged378" },
+ { PCB_PAGED377, "paged377" },
{ PCB_PAGEDCRU, "pagedcru" },
{ PCB_GROMEMU, "gromemu" },
{ 0, NULL}
@@ -1123,15 +1132,14 @@ void ti99_cartridge_device::prepare_cartridge()
int rom2_length;
UINT8* grom_ptr;
+ UINT8* rom_ptr;
memory_region *regg;
memory_region *regr;
- memory_region *regr2;
// Initialize some values.
m_pcb->m_rom_page = 0;
m_pcb->m_rom_ptr = NULL;
- m_pcb->m_rom2_ptr = NULL;
m_pcb->m_ram_size = 0;
m_pcb->m_ram_ptr = NULL;
m_pcb->m_ram_page = 0;
@@ -1139,7 +1147,7 @@ void ti99_cartridge_device::prepare_cartridge()
for (int i=0; i < 5; i++) m_pcb->m_grom[i] = NULL;
m_pcb->m_grom_size = m_softlist? get_software_region_length("grom_socket") : m_rpk->get_resource_length("grom_socket");
- if (VERBOSE>6) LOG("gromport: grom_socket.size=0x%04x\n", m_pcb->m_grom_size);
+ if (TRACE_CONFIG) logerror("%s: grom_socket.size=0x%04x\n", tag(), m_pcb->m_grom_size);
if (m_pcb->m_grom_size > 0)
{
@@ -1160,22 +1168,22 @@ void ti99_cartridge_device::prepare_cartridge()
m_pcb->m_rom_size = m_softlist? get_software_region_length("rom_socket") : m_rpk->get_resource_length("rom_socket");
if (m_pcb->m_rom_size > 0)
{
- if (VERBOSE>6) LOG("gromport: rom_socket.size=0x%04x\n", m_pcb->m_rom_size);
+ if (TRACE_CONFIG) logerror("%s: rom_socket.size=0x%04x\n", tag(), m_pcb->m_rom_size);
regr = memregion(CARTROM_TAG);
- m_pcb->m_rom_ptr = m_softlist? get_software_region("rom_socket") : m_rpk->get_contents_of_socket("rom_socket");
- memcpy(regr->base(), m_pcb->m_rom_ptr, m_pcb->m_rom_size);
+ rom_ptr = m_softlist? get_software_region("rom_socket") : m_rpk->get_contents_of_socket("rom_socket");
+ memcpy(regr->base(), rom_ptr, m_pcb->m_rom_size);
// Set both pointers to the same region for now
- m_pcb->m_rom_ptr = m_pcb->m_rom2_ptr = regr->base();
+ m_pcb->m_rom_ptr = regr->base();
}
rom2_length = m_softlist? get_software_region_length("rom2_socket") : m_rpk->get_resource_length("rom2_socket");
if (rom2_length > 0)
{
// sizes do not differ between rom and rom2
- regr2 = memregion(CARTROM2_TAG);
- m_pcb->m_rom2_ptr = m_softlist? get_software_region("rom2_socket") : m_rpk->get_contents_of_socket("rom2_socket");
- memcpy(regr2->base(), m_pcb->m_rom2_ptr, rom2_length);
- m_pcb->m_rom2_ptr = regr2->base();
+ // We use the large cartrom space for the second bank as well
+ regr = memregion(CARTROM_TAG);
+ rom_ptr = m_softlist? get_software_region("rom2_socket") : m_rpk->get_contents_of_socket("rom2_socket");
+ memcpy(regr->base() + 0x2000, rom_ptr, rom2_length);
}
// NVRAM cartridges are not supported by softlists (we need to find a way to load the nvram contents first)
@@ -1227,11 +1235,11 @@ bool ti99_cartridge_device::call_load()
{
// File name is in m_basename
// return true = error
- if (VERBOSE>8) LOG("cartridge_device: loading %s in slot %s\n", m_basename.c_str(), tag());
+ if (TRACE_CHANGE) logerror("%s: Loading %s in slot %s\n", tag(), m_basename.c_str(), tag());
if (m_softlist)
{
- if (VERBOSE>7) LOG("using softlists\n");
+ if (TRACE_CONFIG) logerror("%s: Using softlists\n", tag());
int i = 0;
const char* pcb = get_feature("pcb");
do
@@ -1243,7 +1251,7 @@ bool ti99_cartridge_device::call_load()
}
i++;
} while (sw_pcbdefs[i].id != 0);
- if (VERBOSE>5) LOG("gromport.cartridge_device: Cartridge type is %s (%d)\n", pcb, m_pcbtype);
+ if (TRACE_CONFIG) logerror("%s: Cartridge type is %s (%d)\n", tag(), pcb, m_pcbtype);
}
else
{
@@ -1255,7 +1263,7 @@ bool ti99_cartridge_device::call_load()
}
catch (rpk_exception& err)
{
- LOG("gromport.cartridge_device: Failed to load cartridge '%s': %s\n", basename(), err.to_string());
+ logerror("%s: Failed to load cartridge '%s': %s\n", tag(), basename(), err.to_string());
m_rpk = NULL;
m_err = IMAGE_ERROR_INVALIDIMAGE;
return true;
@@ -1265,41 +1273,50 @@ bool ti99_cartridge_device::call_load()
switch (m_pcbtype)
{
case PCB_STANDARD:
- if (VERBOSE>6) LOG("gromport.cartridge_device: standard PCB\n");
+ if (TRACE_CONFIG) logerror("%s: Standard PCB\n", tag());
m_pcb = new ti99_standard_cartridge();
break;
case PCB_PAGED:
- if (VERBOSE>6) LOG("gromport.cartridge_device: paged PCB\n");
+ if (TRACE_CONFIG) logerror("%s: Paged PCB\n", tag());
m_pcb = new ti99_paged_cartridge();
break;
case PCB_MINIMEM:
- if (VERBOSE>6) LOG("gromport.cartridge_device: minimem PCB\n");
+ if (TRACE_CONFIG) logerror("%s: Minimem PCB\n", tag());
m_pcb = new ti99_minimem_cartridge();
break;
case PCB_SUPER:
- if (VERBOSE>6) LOG("gromport.cartridge_device: superspace PCB\n");
+ if (TRACE_CONFIG) logerror("%s: Superspace PCB\n", tag());
m_pcb = new ti99_super_cartridge();
break;
case PCB_MBX:
- if (VERBOSE>6) LOG("gromport.cartridge_device: MBX PCB\n");
+ if (TRACE_CONFIG) logerror("%s: MBX PCB\n", tag());
m_pcb = new ti99_mbx_cartridge();
break;
case PCB_PAGED379I:
- if (VERBOSE>6) LOG("gromport.cartridge_device: Paged379i PCB\n");
+ if (TRACE_CONFIG) logerror("%s: Paged379i PCB\n", tag());
m_pcb = new ti99_paged379i_cartridge();
break;
+ case PCB_PAGED378:
+ if (TRACE_CONFIG) logerror("%s: Paged378 PCB\n", tag());
+ m_pcb = new ti99_paged378_cartridge();
+ break;
+ case PCB_PAGED377:
+ if (TRACE_CONFIG) logerror("%s: Paged377 PCB\n", tag());
+ m_pcb = new ti99_paged377_cartridge();
+ break;
case PCB_PAGEDCRU:
- if (VERBOSE>6) LOG("gromport.cartridge_device: PagedCRU PCB\n");
+ if (TRACE_CONFIG) logerror("%s: PagedCRU PCB\n", tag());
m_pcb = new ti99_pagedcru_cartridge();
break;
case PCB_GROMEMU:
- if (VERBOSE>6) LOG("gromport.cartridge_device: GromEmulation PCB\n");
+ if (TRACE_CONFIG) logerror("%s: Grom Emulation PCB\n", tag());
m_pcb = new ti99_gromemu_cartridge();
break;
}
prepare_cartridge();
m_pcb->set_cartridge(this);
+ m_pcb->set_tag(tag());
m_slot = get_index_from_tagname();
m_connector->insert(m_slot, this);
return false;
@@ -1307,7 +1324,7 @@ bool ti99_cartridge_device::call_load()
void ti99_cartridge_device::call_unload()
{
- if (VERBOSE>7) LOG("ti99_cartridge_device: unload\n");
+ if (TRACE_CHANGE) logerror("%s: Unload\n", tag());
if (m_rpk != NULL)
{
m_rpk->close(); // will write NVRAM contents
@@ -1326,7 +1343,7 @@ void ti99_cartridge_device::set_slot(int i)
bool ti99_cartridge_device::call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry)
{
- if (VERBOSE>8) LOG("ti99_cartridge_device: swlist = %s, swname = %s\n", swlist.list_name(), swname);
+ if (TRACE_CONFIG) logerror("%s: swlist = %s, swname = %s\n", tag(), swlist.list_name(), swname);
load_software_part_region(*this, swlist, swname, start_entry);
m_softlist = true;
m_rpk = NULL;
@@ -1409,13 +1426,12 @@ machine_config_constructor ti99_cartridge_device::device_mconfig_additions() con
/*
Memory area for one cartridge. For most cartridges we only need 8 KiB for
- ROM contents, but cartridges of the "paged379i" type have up to 128 KiB
+ ROM contents, but cartridges of the "paged377" type have up to 2 MiB
organised as selectable banks, so we must be sure there is enough space.
*/
ROM_START( cartridge_memory )
ROM_REGION(0xa000, CARTGROM_TAG, ROMREGION_ERASE00)
- ROM_REGION(0x20000, CARTROM_TAG, ROMREGION_ERASE00)
- ROM_REGION(0x2000, CARTROM2_TAG, ROMREGION_ERASE00)
+ ROM_REGION(0x200000, CARTROM_TAG, ROMREGION_ERASE00)
ROM_END
const rom_entry *ti99_cartridge_device::device_rom_region() const
@@ -1486,19 +1502,19 @@ READ8Z_MEMBER(ti99_cartridge_pcb::readz)
// For TI-99/8 we should plan for 16K cartridges. However, none was ever produced.
// Well, forget about that.
*value = m_rom_ptr[offset & 0x1fff];
- // LOG("read cartridge rom space %04x = %02x\n", offset, *value);
+ // logerror("%s: read cartridge rom space %04x = %02x\n", tag(), offset, *value);
}
}
}
WRITE8_MEMBER(ti99_cartridge_pcb::write)
{
- // LOG("write standard\n");
+ // logerror("%s: write standard\n", tag());
if ((offset & grom_mask())==grom_base())
gromwrite(space, offset, data, mem_mask);
else
{
- if (VERBOSE>5) LOG("cartridge_pcb_device: Cannot write to ROM space at %04x\n", offset);
+ if (TRACE_ILLWRITE) logerror("%s: Cannot write to ROM space at %04x\n", tag(), offset);
}
}
@@ -1530,20 +1546,13 @@ READ8Z_MEMBER(ti99_paged_cartridge::readz)
gromreadz(space, offset, value, mem_mask);
else
{
- if (m_rom_page==0)
- {
- *value = m_rom_ptr[offset & 0x1fff];
- }
- else
- {
- *value = m_rom2_ptr[offset & 0x1fff];
- }
+ *value = m_rom_ptr[(offset & 0x1fff) | (m_rom_page << 13)];
}
}
WRITE8_MEMBER(ti99_paged_cartridge::write)
{
- // LOG("write standard\n");
+ // logerror("%s: write standard\n", tag());
if ((offset & grom_mask())==grom_base())
gromwrite(space, offset, data, mem_mask);
@@ -1584,7 +1593,7 @@ READ8Z_MEMBER(ti99_minimem_cartridge::readz)
/* Write function for the minimem cartridge. */
WRITE8_MEMBER(ti99_minimem_cartridge::write)
{
- // LOG("write standard\n");
+ // logerror("%s: write standard\n", tag());
if ((offset & grom_mask())==grom_base())
gromwrite(space, offset, data, mem_mask);
@@ -1592,7 +1601,7 @@ WRITE8_MEMBER(ti99_minimem_cartridge::write)
{
if ((offset & 0x1000)==0x0000)
{
- if (VERBOSE>1) LOG("ti99: gromport: Write access to cartridge ROM at address %04x ignored", offset);
+ if (TRACE_ILLWRITE) logerror("%s: Write access to cartridge ROM at address %04x ignored", tag(), offset);
}
else
{
@@ -1674,7 +1683,7 @@ READ8Z_MEMBER(ti99_super_cartridge::crureadz)
if ((offset & 0xfff0) == 0x0800)
{
- if (VERBOSE>2) LOG("ti99_super_cartridge: CRU accessed at %04x\n", offset);
+ if (TRACE_CRU) logerror("%s: CRU accessed at %04x\n", tag(), offset);
UINT8 val = 0x02 << (m_ram_page << 1);
*value = (val >> ((offset - 0x0800)>>1)) & 0xff;
}
@@ -1684,7 +1693,7 @@ WRITE8_MEMBER(ti99_super_cartridge::cruwrite)
{
if ((offset & 0xfff0) == 0x0800)
{
- if (VERBOSE>2) LOG("ti99_super_cartridge: CRU accessed at %04x\n", offset);
+ if (TRACE_CRU) logerror("%s: CRU accessed at %04x\n", tag(), offset);
if (data != 0)
m_ram_page = (offset-0x0802)>>2;
}
@@ -1824,6 +1833,64 @@ WRITE8_MEMBER(ti99_paged379i_cartridge::write)
}
/*****************************************************************************
+ Cartridge type: paged378
+ This type is intended for high-capacity cartridges of up to 512 KiB
+ plus GROM space of 120KiB (not supported yet)
+
+ Due to its huge GROM space it is also called the "UberGROM"
+
+ The cartridge may also be used without GROM.
+
+ The selection scheme is much simpler than in the 379i type.
+
+******************************************************************************/
+
+/* Read function for the paged378 cartridge. */
+READ8Z_MEMBER(ti99_paged378_cartridge::readz)
+{
+ if ((offset & 0xe000)==0x6000)
+ *value = m_rom_ptr[(m_rom_page<<13) | (offset & 0x1fff)];
+}
+
+/* Write function for the paged378 cartridge. Only used to set the bank. */
+WRITE8_MEMBER(ti99_paged378_cartridge::write)
+{
+ // Bits: 0110 0000 0bbb bbbx
+ // x = don't care, bbbb = bank
+ if ((offset & 0xff80)==0x6000)
+ {
+ // Set bank
+ m_rom_page = ((offset >> 1)&0x003f);
+ }
+}
+
+/*****************************************************************************
+ Cartridge type: paged377
+ This type is intended for high-capacity cartridges of up to 2 MiB
+
+ The paged379i cartrige does not have any GROMs.
+******************************************************************************/
+
+/* Read function for the paged377 cartridge. */
+READ8Z_MEMBER(ti99_paged377_cartridge::readz)
+{
+ if ((offset & 0xe000)==0x6000)
+ *value = m_rom_ptr[(m_rom_page<<13) | (offset & 0x1fff)];
+}
+
+/* Write function for the paged377 cartridge. Only used to set the bank. */
+WRITE8_MEMBER(ti99_paged377_cartridge::write)
+{
+ // Bits: 0110 000b bbbb bbbx
+ // x = don't care, bbbb = bank
+ if ((offset & 0xfe00)==0x6000)
+ {
+ // Set bank
+ m_rom_page = ((offset >> 1)&0x00ff);
+ }
+}
+
+/*****************************************************************************
Cartridge type: pagedcru
This cartridge consists of one 16 KiB, 32 KiB, or 64 KiB EEPROM which is
organised in 2, 4, or 8 pages of 8 KiB each. We assume there is only one
@@ -1933,20 +2000,13 @@ READ8Z_MEMBER(ti99_gromemu_cartridge::readz)
}
if (m_rom_ptr == NULL) return;
- if (m_rom_page==0)
- {
- *value = m_rom_ptr[offset & 0x1fff];
- }
- else
- {
- *value = m_rom2_ptr[offset & 0x1fff];
- }
+ *value = m_rom_ptr[(offset & 0x1fff) | (m_rom_page << 13)];
}
}
WRITE8_MEMBER(ti99_gromemu_cartridge::write)
{
- // LOG("write standard\n");
+ // logerror("%s: write standard\n", tag());
if ((offset & grom_mask())==grom_base())
gromemuwrite(space, offset, data, mem_mask);
@@ -1991,7 +2051,7 @@ WRITE8_MEMBER(ti99_gromemu_cartridge::gromemuwrite)
// Accept low address byte (second write)
m_grom_address = (m_grom_address & 0xff00) | data;
m_waddr_LSB = false;
- if (VERBOSE>8) LOG("ti99_gromemu_cartridge: set grom address %04x\n", m_grom_address);
+ if (TRACE_GROM) logerror("%s: Set grom address %04x\n", tag(), m_grom_address);
}
else
{
@@ -2001,7 +2061,7 @@ WRITE8_MEMBER(ti99_gromemu_cartridge::gromemuwrite)
}
}
else {
- if (VERBOSE>2) LOG("ti99_gromemu_cartridge: ignoring write to GROM area at address %04x\n", m_grom_address);
+ if (TRACE_ILLWRITE) logerror("%s: Ignoring write to GROM area at address %04x\n", tag(), m_grom_address);
}
}
@@ -2070,7 +2130,7 @@ rpk::rpk(emu_options& options, const char* sysname)
rpk::~rpk()
{
- if (VERBOSE>6) LOG("rpk: Destroy RPK\n");
+ if (TRACE_RPK) logerror("gromport/RPK: Destroy RPK\n");
}
/*
@@ -2178,7 +2238,7 @@ rpk_socket* rpk_reader::load_rom_resource(zip_file* zip, xml_data_node* rom_reso
file = xml_get_attribute_string(rom_resource_node, "file", NULL);
if (file == NULL) throw rpk_exception(RPK_INVALID_LAYOUT, "<rom> must have a 'file' attribute");
- if (VERBOSE>6) LOG("gromport/RPK: Loading ROM contents for socket '%s' from file %s\n", socketname, file);
+ if (TRACE_RPK) logerror("gromport/RPK: Loading ROM contents for socket '%s' from file %s\n", socketname, file);
// check for crc
crcstr = xml_get_attribute_string(rom_resource_node, "crc", NULL);
@@ -2266,7 +2326,7 @@ rpk_socket* rpk_reader::load_ram_resource(emu_options &options, xml_data_node* r
contents = global_alloc_array_clear(UINT8, length);
if (contents==NULL) throw rpk_exception(RPK_OUT_OF_MEMORY);
- if (VERBOSE>6) LOG("gromport/RPK: Allocating RAM buffer (%d bytes) for socket '%s'\n", length, socketname);
+ if (TRACE_RPK) logerror("gromport/RPK: Allocating RAM buffer (%d bytes) for socket '%s'\n", length, socketname);
ram_pname = NULL;
@@ -2288,7 +2348,7 @@ rpk_socket* rpk_reader::load_ram_resource(emu_options &options, xml_data_node* r
std::string ram_pathname = std::string(system_name).append(PATH_SEPARATOR).append(ram_filename);
ram_pname = core_strdup(ram_pathname.c_str());
// load, and fill rest with 00
- if (VERBOSE>6) LOG("gromport/RPK: Loading NVRAM contents from '%s'\n", ram_pname);
+ if (TRACE_RPK) logerror("gromport/RPK: Loading NVRAM contents from '%s'\n", ram_pname);
image_battery_load_by_name(options, ram_pname, contents, length, 0x00);
}
}
@@ -2378,7 +2438,7 @@ rpk* rpk_reader::open(emu_options &options, const char *filename, const char *sy
// We'll try to find the PCB type on the provided type list.
pcb_type = xml_get_attribute_string(pcb_node, "type", NULL);
if (pcb_type==NULL) throw rpk_exception(RPK_INVALID_LAYOUT, "<pcb> must have a 'type' attribute");
- if (VERBOSE>6) LOG("gromport/RPK: Cartridge says it has PCB type '%s'\n", pcb_type);
+ if (TRACE_RPK) logerror("gromport/RPK: Cartridge says it has PCB type '%s'\n", pcb_type);
i=0;
do
diff --git a/src/emu/bus/ti99x/gromport.h b/src/emu/bus/ti99x/gromport.h
index 367b68ba2b6..a6c0c1c3c8f 100644
--- a/src/emu/bus/ti99x/gromport.h
+++ b/src/emu/bus/ti99x/gromport.h
@@ -282,6 +282,8 @@ protected:
void set_cartridge(ti99_cartridge_device *cart);
UINT16 grom_base();
UINT16 grom_mask();
+ const char* tag() { return m_tag; }
+ void set_tag(const char* tag) { m_tag = tag; }
ti99_cartridge_device* m_cart;
ti99_grom_device* m_grom[5];
@@ -290,12 +292,12 @@ protected:
int m_ram_size;
UINT8* m_rom_ptr;
- UINT8* m_rom2_ptr;
UINT8* m_ram_ptr;
int m_rom_page; // for some cartridge types
UINT8* m_grom_ptr; // for gromemu
int m_grom_address; // for gromemu
int m_ram_page; // for super
+ const char* m_tag;
private:
};
@@ -361,6 +363,30 @@ private:
int get_paged379i_bank(int rompage);
};
+/********************** Paged 378 ************************************/
+
+class ti99_paged378_cartridge : public ti99_cartridge_pcb
+{
+public:
+ ~ti99_paged378_cartridge() { };
+ DECLARE_READ8Z_MEMBER(readz);
+ DECLARE_WRITE8_MEMBER(write);
+private:
+ int get_paged378_bank(int rompage);
+};
+
+/********************** Paged 377 ************************************/
+
+class ti99_paged377_cartridge : public ti99_cartridge_pcb
+{
+public:
+ ~ti99_paged377_cartridge() { };
+ DECLARE_READ8Z_MEMBER(readz);
+ DECLARE_WRITE8_MEMBER(write);
+private:
+ int get_paged377_bank(int rompage);
+};
+
/********************** Paged CRU ************************************/
class ti99_pagedcru_cartridge : public ti99_cartridge_pcb
diff --git a/src/emu/bus/ti99x/ti99defs.h b/src/emu/bus/ti99x/ti99defs.h
index fbb7c73645c..543b5ad04ba 100644
--- a/src/emu/bus/ti99x/ti99defs.h
+++ b/src/emu/bus/ti99x/ti99defs.h
@@ -51,6 +51,8 @@
#define GMAPPER_TAG "gmapper"
#define GMOUSE_TAG "gmouse"
#define GCLOCK_TAG "mm58274c"
+#define PFM512_TAG "pfm512"
+#define PFM512A_TAG "pfm512a"
#define READ16Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 *value, ATTR_UNUSED UINT16 mem_mask)
#define DECLARE_READ16Z_MEMBER(name) void name(ATTR_UNUSED address_space &space, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16 *value, ATTR_UNUSED UINT16 mem_mask = 0xffff)
@@ -106,7 +108,9 @@ enum
enum
{
GENEVE_098 = 0,
- GENEVE_100 = 1
+ GENEVE_100,
+ GENEVE_PFM512,
+ GENEVE_PFM512A
};
#endif
diff --git a/src/emu/cpu/h6280/6280dasm.c b/src/emu/cpu/h6280/6280dasm.c
index 7dbafd939c4..4a9923ae0dc 100644
--- a/src/emu/cpu/h6280/6280dasm.c
+++ b/src/emu/cpu/h6280/6280dasm.c
@@ -18,6 +18,11 @@
******************************************************************************/
+#ifdef __OS2__
+/* To avoid name clash of _brk */
+#define __STRICT_ANSI__
+#endif
+
#include "emu.h"
#define RDOP(addr) (oprom[addr - pc])
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index 6f91b4a96e8..a98872029ec 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -2650,7 +2650,7 @@ void ppc_device::ppc4xx_spu_timer_reset()
attotime charperiod = clockperiod * (divisor * 16 * bpc);
m_spu.timer->adjust(charperiod, 0, charperiod);
if (PRINTF_SPU)
- printf("ppc4xx_spu_timer_reset: baud rate = %.0f\n", ATTOSECONDS_TO_HZ(charperiod.attoseconds) * bpc);
+ printf("ppc4xx_spu_timer_reset: baud rate = %.0f\n", ATTOSECONDS_TO_HZ(charperiod.attoseconds()) * bpc);
}
/* otherwise, disable the timer */
diff --git a/src/emu/cpu/psx/psx.c b/src/emu/cpu/psx/psx.c
index a60a1204b9f..a262c9bd42c 100644
--- a/src/emu/cpu/psx/psx.c
+++ b/src/emu/cpu/psx/psx.c
@@ -1417,7 +1417,7 @@ void psxcpu_device::update_rom_config()
}
}
- if( window_size < max_window_size )
+ if( window_size < max_window_size && !m_disable_rom_berr)
{
m_program->install_readwrite_handler( 0x1fc00000 + window_size, 0x1fffffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
m_program->install_readwrite_handler( 0x9fc00000 + window_size, 0x9fffffff, read32_delegate( FUNC( psxcpu_device::berr_r ), this ), write32_delegate( FUNC( psxcpu_device::berr_w ), this ) );
@@ -1756,6 +1756,7 @@ psxcpu_device::psxcpu_device( const machine_config &mconfig, device_type type, c
m_cd_write_handler( *this ),
m_ram( *this, "ram" )
{
+ m_disable_rom_berr = false;
}
cxd8530aq_device::cxd8530aq_device( const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock )
@@ -3374,6 +3375,11 @@ WRITE8_MEMBER( psxcpu_device::cd_w )
m_cd_write_handler( space, offset, data, mem_mask );
}
+void psxcpu_device::set_disable_rom_berr(bool mode)
+{
+ m_disable_rom_berr = mode;
+}
+
static MACHINE_CONFIG_FRAGMENT( psx )
MCFG_DEVICE_ADD( "irq", PSX_IRQ, 0 )
MCFG_PSX_IRQ_HANDLER( INPUTLINE( DEVICE_SELF, PSXCPU_IRQ0 ) )
diff --git a/src/emu/cpu/psx/psx.h b/src/emu/cpu/psx/psx.h
index 4f5895bf4e9..21b6d8adc55 100644
--- a/src/emu/cpu/psx/psx.h
+++ b/src/emu/cpu/psx/psx.h
@@ -128,6 +128,8 @@ enum
devcb = &psxcpu_device::set_cd_read_handler(*device, DEVCB_##_devcb);
#define MCFG_PSX_CD_WRITE_HANDLER(_devcb) \
devcb = &psxcpu_device::set_cd_write_handler(*device, DEVCB_##_devcb);
+#define MCFG_PSX_DISABLE_ROM_BERR \
+ downcast<psxcpu_device *>(device)->set_disable_rom_berr(true);
//**************************************************************************
// TYPE DEFINITIONS
@@ -196,6 +198,7 @@ public:
DECLARE_READ32_MEMBER( com_delay_r );
static psxcpu_device *getcpu( device_t &device, const char *cputag );
+ void set_disable_rom_berr(bool mode);
protected:
psxcpu_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
@@ -346,6 +349,7 @@ protected:
devcb_write8 m_cd_write_handler;
required_device<ram_device> m_ram;
memory_region *m_rom;
+ bool m_disable_rom_berr;
private:
// disassembler interface
diff --git a/src/emu/cpu/tms32082/mp_ops.c b/src/emu/cpu/tms32082/mp_ops.c
index eb59ca228f1..c6e9321ce24 100644
--- a/src/emu/cpu/tms32082/mp_ops.c
+++ b/src/emu/cpu/tms32082/mp_ops.c
@@ -465,6 +465,17 @@ void tms32082_mp_device::execute_short_imm()
break;
}
+ case 0x12: // and.tf
+ {
+ int rd = OP_RD();
+ int rs = OP_RS();
+ UINT32 imm = OP_UIMM15();
+
+ if (rd)
+ m_reg[rd] = ~m_reg[rs] & imm;
+ break;
+ }
+
case 0x14: // and.ft
{
int rd = OP_RD();
@@ -681,6 +692,19 @@ void tms32082_mp_device::execute_short_imm()
break;
}
+ case 0x45: // jsr.a
+ {
+ int link = OP_LINK();
+ int base = OP_BASE();
+ INT32 offset = OP_SIMM15();
+
+ if (link)
+ m_reg[link] = m_fetchpc;
+
+ m_fetchpc = m_reg[base] + offset;
+ break;
+ }
+
case 0x48: // bbz
{
int bitnum = OP_BITNUM() ^ 0x1f;
@@ -888,6 +912,38 @@ void tms32082_mp_device::execute_reg_long_imm()
break;
}
+ case 0x1a: // shift.es
+ {
+ int r = (m_ir & (1 << 10));
+ int inv = (m_ir & (1 << 11));
+ int rot = m_reg[OP_ROTATE()];
+ int end = OP_ENDMASK();
+ UINT32 source = m_reg[OP_RS()];
+ int rd = OP_RD();
+
+ UINT32 endmask = end ? SHIFT_MASK[end ? end : 32] : m_reg[OP_ROTATE()+1];
+ if (inv) endmask = ~endmask;
+
+ int shift = r ? 32-rot : rot;
+ UINT32 shiftmask = SHIFT_MASK[shift ? shift : 32];
+ UINT32 compmask = endmask & shiftmask;
+
+ UINT32 res = 0;
+ if (r) // right
+ {
+ res = ROTATE_R(source, rot) & compmask;
+ res = SIGN_EXTEND(res, rot);
+ }
+ else // left
+ {
+ res = ROTATE_L(source, rot) & compmask;
+ }
+
+ if (rd)
+ m_reg[rd] = res;
+ break;
+ }
+
case 0x1c: // shift.iz
{
int r = (m_ir & (1 << 10));
@@ -965,6 +1021,17 @@ void tms32082_mp_device::execute_reg_long_imm()
break;
}
+ case 0x3a:
+ case 0x3b: // or.ft
+ {
+ int rd = OP_RD();
+ int rs = OP_RS();
+
+ if (rd)
+ m_reg[rd] = m_reg[rs] | ~(has_imm ? imm32 : m_reg[OP_SRC1()]);
+ break;
+ }
+
case 0x40:
case 0x41:
case 0x48:
diff --git a/src/emu/cpu/tms32082/tms32082.c b/src/emu/cpu/tms32082/tms32082.c
index 56d97713b45..8b3d041ba4f 100644
--- a/src/emu/cpu/tms32082/tms32082.c
+++ b/src/emu/cpu/tms32082/tms32082.c
@@ -197,6 +197,9 @@ void tms32082_mp_device::device_start()
state_add(MP_IE, "ie", m_ie).formatstr("%08X");
state_add(MP_INTPEN, "intpen", m_intpen).formatstr("%08X");
+ state_add(MP_TCOUNT, "tcount", m_tcount).formatstr("%08X");
+ state_add(MP_TSCALE, "tscale", m_tscale).formatstr("%08X");
+
state_add(STATE_GENPC, "curpc", m_pc).noshow();
m_program = &space(AS_PROGRAM);
@@ -283,6 +286,55 @@ void tms32082_mp_device::processor_command(UINT32 command)
{
// simulate PP behavior for now...
m_program->write_dword(0x00000084, 3);
+
+ UINT32 num = m_program->read_dword(0x90);
+
+ printf("PP num %d\n", num);
+
+ /*
+ UINT32 ra = 0x1000280;
+
+ printf("FIFO push:\n");
+
+ for (int i=0; i < num; i++)
+ {
+ printf("Entry %d:\n", i);
+ for (int k=0; k < 6; k++)
+ {
+ for (int l=0; l < 4; l++)
+ {
+ UINT32 dd = m_program->read_dword(ra);
+ ra += 4;
+
+ printf("%08X(%f) ", dd, u2f(dd));
+ }
+ printf("\n");
+ }
+ printf("\n");
+ }
+ */
+
+ UINT32 ra = 0x1000280;
+
+ int oldnum = m_program->read_dword(0x600ffffc);
+ UINT32 rb = 0x60000000 + (oldnum * 0x60);
+
+ for (int i=0; i < num; i++)
+ {
+ for (int k=0; k < 24; k++)
+ {
+ UINT32 dd = m_program->read_dword(ra);
+ ra += 4;
+
+ m_program->write_dword(rb, dd);
+ rb += 4;
+ }
+ }
+ m_program->write_dword(0x600ffffc, oldnum+num);
+
+ m_program->write_dword(0x00000090, 0);
+ m_program->write_dword(0x00000094, num);
+
}
}
// PP1
@@ -315,6 +367,9 @@ UINT32 tms32082_mp_device::read_creg(int reg)
case 0xa: // PPERROR
return 0xe0000;
+ case 0xe: // TCOUNT
+ return m_tcount;
+
case 0x4000: // IN0P
return m_in0p;
@@ -358,6 +413,10 @@ void tms32082_mp_device::write_creg(int reg, UINT32 data)
printf("IE = %08X\n", data);
break;
+ case 0xe: // TCOUNT
+ m_tcount = data;
+ break;
+
case 0x4000: // IN0P
m_in0p = data;
break;
@@ -453,6 +512,13 @@ void tms32082_mp_device::execute_run()
m_ir = fetch();
execute();
+ m_tcount--;
+ if (m_tcount < 0)
+ {
+ // TODO: timer interrupt
+ m_tcount = m_tscale;
+ }
+
m_icount--;
};
diff --git a/src/emu/cpu/tms32082/tms32082.h b/src/emu/cpu/tms32082/tms32082.h
index c08fffa3640..494f1580504 100644
--- a/src/emu/cpu/tms32082/tms32082.h
+++ b/src/emu/cpu/tms32082/tms32082.h
@@ -55,7 +55,9 @@ public:
MP_IN1P,
MP_OUTP,
MP_IE,
- MP_INTPEN
+ MP_INTPEN,
+ MP_TCOUNT,
+ MP_TSCALE
};
enum
@@ -127,6 +129,9 @@ protected:
UINT32 m_epc;
UINT32 m_eip;
+ UINT32 m_tcount;
+ UINT32 m_tscale;
+
UINT32 m_param_ram[0x800];
int m_icount;
diff --git a/src/emu/cpu/tms9900/tms9995.c b/src/emu/cpu/tms9900/tms9995.c
index d561a0550c9..ae9248fd82d 100644
--- a/src/emu/cpu/tms9900/tms9995.c
+++ b/src/emu/cpu/tms9900/tms9995.c
@@ -1412,7 +1412,7 @@ void tms9995_device::decode(UINT16 inst)
if (decoded == NULL)
{
// not found
- logerror("tms9995: Unknown opcode %04x, will trigger MID\n", inst);
+ logerror("tms9995: Undefined opcode %04x at logical address %04x, will trigger MID\n", inst, PC);
m_decoded[dindex].IR = 0;
m_decoded[dindex].command = MID;
}
diff --git a/src/emu/cpu/v60/v60.c b/src/emu/cpu/v60/v60.c
index 38b17139fb7..2a770739e25 100644
--- a/src/emu/cpu/v60/v60.c
+++ b/src/emu/cpu/v60/v60.c
@@ -8,6 +8,71 @@
// Emulation for the NEC V60 (uPD70615) and V70 (uPD70632) CPUs
//
+/*
+Taken from the NEC Semiconductor Selection Guide Guide Book (Oct. 1995):
+
+uPD70615 (V60)
+Features:
+- Virtual memory (paging method)
+- Level protection architecture - 4-level hierarchical protection function
+ for system multi-programming.
+- Abundant general registers - Thirty two 32-bit general registers for
+ optimizing compiler
+- Refined instruction set - 2-address method: Arbitrary addressing mode
+ can be used independently for source operand and destination operand.
+- Abundant address modes and data types - Auto increment/decrement mode
+ for string process, and memory indirect addressing for pointer operation
+- High cost-to performance chip
+- No multiprocessor system - no FRM function for increasing system
+ reliability using two or more processors.
+- No V20/V30 simulation mode
+Address bus: 24 bits
+Data bus: 16 bits
+Memory space: 4G bytes
+Operating frequency: 16 MHz
+Package: 120-pin QFP
+
+uPD70616 (V60)
+Features:
+- Virtual memory (paging method)
+- Level protection architecture - 4-level hierarchical protection function
+ for system multi-programming.
+- Abundant general registers - Thirty two 32-bit general registers for
+ optimizing compiler
+- Refined instruction set - 2-address method: Arbitrary addressing mode
+ can be used independently for source operand and destination operand.
+- Abundant address modes and data types - Auto increment/decrement mode
+ for string process, and memory indirect addressing for pointer operation
+- Multiprocessor system - FRM function for increasing system reliability
+ using two or more processors.
+- V20/V30 simulation mode
+Address bus: 24 bits
+Data bus: 16 bits
+Memory space: 4G bytes
+Operating frequency: 16 MHz
+Package: 68-pin PGA
+
+uPD70632 (V70)
+Features:
+- Virtual memory (paging method)
+- Level protection architecture - 4-level hierarchical protection function
+ for system multi-programming.
+- Abundant general registers - Thirty two 32-bit general registers for
+ optimizing compiler
+- Refined instruction set - 2-address method: Arbitrary addressing mode
+ can be used independently for source operand and destination operand.
+- Abundant address modes and data types - Auto increment/decrement mode
+ for string process, and memory indirect addressing for pointer operation
+- Multiprocessor system - FRM function for increasing system reliability
+ using two or more processors.
+- V20/V30 simulation mode
+Address bus: 32 bits
+Data bus: 32 bits
+Memory space: 4G bytes
+Operating frequency: 20 MHz
+Package: 132-pin PGA, 200-pin QFP
+*/
+
#include "emu.h"
#include "debugger.h"
#include "v60.h"
diff --git a/src/emu/device.c b/src/emu/device.c
index 6e4385b510b..2fd68e6ed8e 100644
--- a/src/emu/device.c
+++ b/src/emu/device.c
@@ -333,7 +333,7 @@ attotime device_t::clocks_to_attotime(UINT64 numclocks) const
UINT64 device_t::attotime_to_clocks(const attotime &duration) const
{
- return mulu_32x32(duration.seconds, m_clock) + (UINT64)duration.attoseconds / (UINT64)m_attoseconds_per_clock;
+ return mulu_32x32(duration.seconds(), m_clock) + (UINT64)duration.attoseconds() / (UINT64)m_attoseconds_per_clock;
}
diff --git a/src/emu/imagedev/floppy.c b/src/emu/imagedev/floppy.c
index c4a61514b89..b85f60d7ef7 100644
--- a/src/emu/imagedev/floppy.c
+++ b/src/emu/imagedev/floppy.c
@@ -18,7 +18,9 @@
*/
// Show step operation
-#define TRACE_STEP 0
+#define TRACE_STEP 1
+
+#define FLOPSND_TAG "floppysound"
// device type definition
const device_type FLOPPY_CONNECTOR = &device_creator<floppy_connector>;
@@ -123,7 +125,8 @@ const floppy_format_type floppy_image_device::default_floppy_formats[] = {
floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock, "floppy_connector", __FILE__),
- device_slot_interface(mconfig, *this)
+ device_slot_interface(mconfig, *this),
+ m_enable_sound(false)
{
}
@@ -144,7 +147,10 @@ void floppy_connector::device_config_complete()
{
floppy_image_device *dev = dynamic_cast<floppy_image_device *>(get_card_device());
if(dev)
+ {
dev->set_formats(formats);
+ dev->enable_sound(m_enable_sound);
+ }
}
floppy_image_device *floppy_connector::get_device()
@@ -161,7 +167,8 @@ floppy_image_device::floppy_image_device(const machine_config &mconfig, device_t
device_image_interface(mconfig, *this),
device_slot_card_interface(mconfig, *this),
image(NULL),
- fif_list(NULL)
+ fif_list(NULL),
+ m_make_sound(false)
{
extension_list[0] = '\0';
m_err = IMAGE_ERROR_INVALIDIMAGE;
@@ -304,12 +311,20 @@ void floppy_image_device::device_start()
setup_characteristics();
+ if (m_make_sound) m_sound_out = subdevice<floppy_sound_device>(FLOPSND_TAG);
+
save_item(NAME(cyl));
save_item(NAME(subcyl));
}
void floppy_image_device::device_reset()
{
+ if (m_make_sound)
+ {
+ // Have we loaded all samples? Otherwise mute the floppy.
+ m_make_sound = m_sound_out->samples_loaded();
+ }
+
revolution_start_time = attotime::never;
revolution_count = 0;
mon = 1;
@@ -358,6 +373,7 @@ floppy_image_format_t *floppy_image_device::identify(std::string filename)
bool floppy_image_device::call_load()
{
io_generic io;
+
// Do _not_ remove this cast otherwise the pointer will be incorrect when used by the ioprocs.
io.file = (device_image_interface *)this;
io.procs = &image_ioprocs;
@@ -490,6 +506,8 @@ void floppy_image_device::mon_w(int state)
cur_ready_cb(this, ready);
}
}
+
+ if (m_make_sound) m_sound_out->motor(state==0);
}
attotime floppy_image_device::time_next_index()
@@ -573,7 +591,11 @@ void floppy_image_device::stp_w(int state)
if ( cyl < tracks-1 ) cyl++;
}
if(ocyl != cyl)
+ {
if (TRACE_STEP) logerror("%s: track %d\n", tag(), cyl);
+ // Do we want a stepper sound?
+ if (m_make_sound) m_sound_out->step();
+ }
/* Update disk detection if applicable */
if (exists())
{
@@ -1032,6 +1054,162 @@ void ui_menu_control_floppy_image::handle()
}
}
+//===================================================================
+// Floppy sound
+//
+// In order to enable floppy sound you must add the line
+// MCFG_FLOPPY_DRIVE_SOUND(true)
+// after MCFG_FLOPPY_DRIVE_ADD
+// and you must put audio samples (44100Hz, mono) with names as
+// shown in floppy_sample_names into the directory samples/floppy
+// Sound will be disabled when these samples are missing.
+//
+// MZ, Aug 2015
+//===================================================================
+
+floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__)
+{
+ m_motor = false;
+ m_loaded = false;
+}
+
+void floppy_sound_device::register_for_save_states()
+{
+ save_item(NAME(m_sampleend_motor));
+ save_item(NAME(m_samplepos_motor));
+ save_item(NAME(m_motor_mintime));
+ save_item(NAME(m_motor_time));
+ save_item(NAME(m_motor));
+ save_item(NAME(m_sampleend_step));
+ save_item(NAME(m_samplestart_step));
+ save_item(NAME(m_samplepos_step));
+ save_item(NAME(m_step_mintime));
+ save_item(NAME(m_step_time));
+}
+
+void floppy_sound_device::device_start()
+{
+ // Read audio samples. The samples are stored in the list m_samples.
+ m_loaded = load_samples();
+
+ // The per-floppy stream. If we don't have all samples, don't allocate a stream.
+ if (m_loaded) m_sound = machine().sound().stream_alloc(*this, 0, 1, clock());
+
+ // Of course, we can read the length from the sample_t, but we want to
+ // be able to fine-tune it, for instance, choose different start and end points
+ m_samplestart_motor = 0;
+ m_sampleend_motor = 8820; // 200ms
+ m_samplestart_step = 0;
+ m_sampleend_step = 2205; // 50ms
+
+ // Mintime says how long the sound persists after the initiating signal
+ // is cleared (important for short step pulses)
+ m_motor_mintime = 8820;
+ m_step_mintime = 1500;
+
+ // Number of updates until the sample stops
+ m_motor_time = 0;
+ m_step_time = 0;
+
+ // Initialize position
+ m_samplepos_step = m_samplestart_step;
+ m_samplepos_motor = m_samplestart_motor;
+ register_for_save_states();
+}
+
+void floppy_sound_device::motor(bool state)
+{
+ m_sound->update();
+ // We do not reset the motor sample on state==true because we don't want
+ // the sound to "jump"
+ if (state==true) m_motor_time = m_motor_mintime;
+ m_motor = state;
+}
+
+/*
+ Activate the step sound.
+*/
+void floppy_sound_device::step()
+{
+ m_sound->update(); // required
+ m_step_time = m_step_mintime;
+ m_samplepos_step = m_samplestart_step;
+}
+
+//-------------------------------------------------
+// sound_stream_update - update the sound stream
+//-------------------------------------------------
+
+void floppy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+ // We are using only one stream, unlike the parent class
+ // Also, there is no need for interpolation, as we only expect
+ // one sample rate of 44100 for all samples
+
+ INT16 out = 0;
+
+ stream_sample_t *samplebuffer = outputs[0];
+ sample_t& motor_sample = m_sample[0];
+ sample_t& step_sample = m_sample[1];
+
+ while (samples-- > 0)
+ {
+ out = 0;
+ // Motor sound
+ if (m_motor_time > 0)
+ {
+ if (m_samplepos_motor < m_sampleend_motor)
+ // Stream value
+ out = motor_sample.data[m_samplepos_motor++];
+ else
+ m_samplepos_motor = m_samplestart_motor;
+
+ // When the motor is turned off, count down the samples
+ if (!m_motor) m_motor_time--;
+ }
+
+ // Stepper sound
+ if (m_step_time > 0)
+ {
+ if (m_samplepos_step < m_sampleend_step)
+ // Mix it into the stream value
+ out = out + step_sample.data[m_samplepos_step++];
+ else
+ m_samplepos_step = m_samplestart_step;
+
+ // Count down the samples
+ m_step_time--;
+ }
+ // Write to the stream buffer
+ *(samplebuffer++) = out;
+ }
+}
+
+static const char *const floppy_sample_names[] =
+{
+ "*floppy",
+ "floppy_35_motor",
+ "floppy_35_step",
+ 0
+};
+
+#define FLOPSPK "flopsndout"
+
+MACHINE_CONFIG_FRAGMENT( floppy_img )
+ MCFG_SPEAKER_STANDARD_MONO(FLOPSPK)
+ MCFG_SOUND_ADD(FLOPSND_TAG, FLOPPYSOUND, 44100)
+ MCFG_SAMPLES_NAMES(floppy_sample_names)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, FLOPSPK, 0.75)
+MACHINE_CONFIG_END
+
+machine_config_constructor floppy_image_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( floppy_img );
+}
+
+const device_type FLOPPYSOUND = &device_creator<floppy_sound_device>;
+
//**************************************************************************
// GENERIC FLOPPY DRIVE DEFINITIONS
diff --git a/src/emu/imagedev/floppy.h b/src/emu/imagedev/floppy.h
index 5b230ae9e49..95f2442d308 100644
--- a/src/emu/imagedev/floppy.h
+++ b/src/emu/imagedev/floppy.h
@@ -20,12 +20,16 @@
#include "formats/cqm_dsk.h"
#include "formats/dsk_dsk.h"
#include "ui/imgcntrl.h"
+#include "sound/samples.h"
#define MCFG_FLOPPY_DRIVE_ADD(_tag, _slot_intf, _def_slot, _formats) \
MCFG_DEVICE_ADD(_tag, FLOPPY_CONNECTOR, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
static_cast<floppy_connector *>(device)->set_formats(_formats);
+#define MCFG_FLOPPY_DRIVE_SOUND(_doit) \
+ static_cast<floppy_connector *>(device)->enable_sound(_doit);
+
#define DECLARE_FLOPPY_FORMATS(_name) \
static const floppy_format_type _name []
@@ -44,6 +48,7 @@
FLOPPY_DSK_FORMAT, \
NULL };
+class floppy_sound_device;
/***************************************************************************
TYPE DEFINITIONS
@@ -129,6 +134,9 @@ public:
static const floppy_format_type default_floppy_formats[];
+ // Enable sound
+ void enable_sound(bool doit) { m_make_sound = doit; }
+
protected:
// device-level overrides
virtual void device_config_complete();
@@ -136,6 +144,8 @@ protected:
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual machine_config_constructor device_mconfig_additions() const;
+
virtual void setup_characteristics() = 0;
floppy_image_format_t *input_format;
@@ -187,6 +197,10 @@ protected:
void write_zone(UINT32 *buf, int &cells, int &index, UINT32 spos, UINT32 epos, UINT32 mg);
void commit_image();
attotime get_next_index_time(std::vector<UINT32> &buf, int index, int delta, attotime base);
+
+ // Sound
+ bool m_make_sound;
+ floppy_sound_device* m_sound_out;
};
class ui_menu_control_floppy_image : public ui_menu_control_device_image {
@@ -249,6 +263,43 @@ DECLARE_FLOPPY_IMAGE_DEVICE(teac_fd_55f, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(teac_fd_55g, "floppy_5_25")
DECLARE_FLOPPY_IMAGE_DEVICE(alps_3255190x, "floppy_5_25")
+extern const device_type FLOPPYSOUND;
+
+/*
+ Floppy drive sound
+*/
+class floppy_sound_device : public samples_device
+{
+public:
+ floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ void motor(bool on);
+ void step();
+ bool samples_loaded() { return m_loaded; }
+ void register_for_save_states();
+
+protected:
+ void device_start();
+
+private:
+ // device_sound_interface overrides
+ void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+ sound_stream* m_sound;
+ bool m_loaded;
+
+ int m_sampleend_motor;
+ int m_samplepos_motor;
+ int m_samplestart_motor;
+ int m_motor_mintime; // min time for the samples; sound persists for that time
+ int m_motor_time;
+ bool m_motor;
+
+ int m_sampleend_step;
+ int m_samplestart_step;
+ int m_samplepos_step;
+ int m_step_mintime;
+ int m_step_time;
+};
class floppy_connector: public device_t,
public device_slot_interface
@@ -259,6 +310,7 @@ public:
void set_formats(const floppy_format_type *formats);
floppy_image_device *get_device();
+ void enable_sound(bool doit) { m_enable_sound = doit; }
protected:
virtual void device_start();
@@ -266,6 +318,7 @@ protected:
private:
const floppy_format_type *formats;
+ bool m_enable_sound;
};
diff --git a/src/emu/imagedev/mfmhd.c b/src/emu/imagedev/mfmhd.c
index 2a76b0d70e4..cfcdbed0353 100644
--- a/src/emu/imagedev/mfmhd.c
+++ b/src/emu/imagedev/mfmhd.c
@@ -303,8 +303,8 @@ enum
std::string mfm_harddisk_device::tts(const attotime &t)
{
char buf[256];
- int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
- sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
+ int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
return buf;
}
diff --git a/src/emu/ioport.c b/src/emu/ioport.c
index 9777d123cfc..1514462e579 100644
--- a/src/emu/ioport.c
+++ b/src/emu/ioport.c
@@ -3442,9 +3442,11 @@ void ioport_manager::playback_frame(const attotime &curtime)
if (m_playback_file.is_open())
{
// first the absolute time
- attotime readtime;
- playback_read(readtime.seconds);
- playback_read(readtime.attoseconds);
+ seconds_t seconds_temp;
+ attoseconds_t attoseconds_temp;
+ playback_read(seconds_temp);
+ playback_read(attoseconds_temp);
+ attotime readtime(seconds_temp, attoseconds_temp);
if (readtime != curtime)
playback_end("Out of sync");
@@ -3581,8 +3583,8 @@ void ioport_manager::record_frame(const attotime &curtime)
if (m_record_file.is_open())
{
// first the absolute time
- record_write(curtime.seconds);
- record_write(curtime.attoseconds);
+ record_write(curtime.seconds());
+ record_write(curtime.attoseconds());
// then the current speed
record_write(UINT32(machine().video().speed_percent() * double(1 << 20)));
diff --git a/src/emu/machine.c b/src/emu/machine.c
index e36f3c41fe9..06e112e758d 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -850,7 +850,7 @@ void running_machine::base_datetime(system_time &systime)
void running_machine::current_datetime(system_time &systime)
{
- systime.set(m_base_time + this->time().seconds);
+ systime.set(m_base_time + this->time().seconds());
}
diff --git a/src/emu/machine/at29040a.c b/src/emu/machine/at29040a.c
deleted file mode 100644
index 3285b265792..00000000000
--- a/src/emu/machine/at29040a.c
+++ /dev/null
@@ -1,446 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Raphael Nabet, Michael Zapf
-/*
- Atmel at29c040a flash EEPROM
-
- 512k*8 FEEPROM, organized in pages of 256 bytes.
-
- References:
- Datasheets were found on Atmel's site (www.atmel.com)
-
- Raphael Nabet 2003
-
- September 2010: Rewritten as device
- February 2012: Rewritten as class
-*/
-
-#include "at29040a.h"
-
-#define VERBOSE 2
-#define LOG logerror
-
-#define FEEPROM_SIZE 0x80000
-#define SECTOR_SIZE 0x00100
-#define BOOT_BLOCK_SIZE 0x04000
-
-#define ADDRESS_MASK 0x7ffff
-#define SECTOR_ADDRESS_MASK 0x7ff00
-#define BYTE_ADDRESS_MASK 0x000ff
-
-#define PRG_TIMER 1
-
-#define VERSION 0
-
-/*
- Constructor.
-*/
-at29040a_device::at29040a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
-: device_t(mconfig, AT29040A, "ATMEL 29040A 512K*8 FEEPROM", tag, owner, clock, "at29040a", __FILE__),
- device_nvram_interface(mconfig, *this)
-{
-}
-
-//-------------------------------------------------
-// nvram_default - called to initialize NVRAM to
-// its default state
-//-------------------------------------------------
-
-void at29040a_device::nvram_default()
-{
- memset(m_eememory, 0, FEEPROM_SIZE+2);
-}
-
-//-------------------------------------------------
-// nvram_read - called to read NVRAM from the
-// .nv file
-//-------------------------------------------------
-
-void at29040a_device::nvram_read(emu_file &file)
-{
- file.read(m_eememory, FEEPROM_SIZE+2);
-}
-
-//-------------------------------------------------
-// nvram_write - called to write NVRAM to the
-// .nv file
-//-------------------------------------------------
-
-void at29040a_device::nvram_write(emu_file &file)
-{
- m_eememory[0] = VERSION;
- file.write(m_eememory, FEEPROM_SIZE+2);
-}
-
-/*
- programming timer callback
-*/
-void at29040a_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- switch (m_pgm)
- {
- case PGM_1:
- /* programming cycle timeout */
- if (VERBOSE>7) LOG("at29040a: Programming cycle timeout\n");
- m_pgm = PGM_0;
- break;
-
- case PGM_2:
- /* programming cycle start */
- if (VERBOSE>7) LOG("at29040a: Sector write start\n");
- m_pgm = PGM_3;
- /* max delay 10ms, typical delay 5 to 7 ms */
- m_programming_timer->adjust(attotime::from_msec(5));
- break;
-
- case PGM_3:
- /* programming cycle end */
- memcpy(m_eememory + 2 + (m_programming_last_offset & ~0xff), m_programming_buffer, SECTOR_SIZE);
- if (VERBOSE>7) LOG("at29040a: Sector write completed at location %04x + 2\n", (m_programming_last_offset & ~0xff));
- if (m_enabling_sdb)
- {
- m_sdp = true;
- }
- if (m_disabling_sdb)
- {
- m_sdp = false;
- }
- if (VERBOSE>7) LOG("at29040a: Software data protection = %d\n", m_sdp);
-
- m_pgm = PGM_0;
- m_enabling_sdb = false;
- m_disabling_sdb = false;
-
- break;
-
- default:
- if (VERBOSE>1) LOG("internal error in %s %d\n", __FILE__, __LINE__);
- break;
- }
-}
-
-void at29040a_device::sync_flags()
-{
- if (m_lower_bbl) m_eememory[1] |= 0x04;
- else m_eememory[1] &= ~0x04;
-
- if (m_higher_bbl) m_eememory[1] |= 0x02;
- else m_eememory[1] &= ~0x02;
-
- if (m_sdp) m_eememory[1] |= 0x01;
- else m_eememory[1] &= ~0x01;
-}
-
-/*
- read a byte from FEEPROM
-*/
-READ8_MEMBER( at29040a_device::read )
-{
- int reply;
-
- offset &= ADDRESS_MASK;
-
- /* reading in the midst of any command sequence cancels it (right???) */
- m_cmd = CMD_0;
- m_long_sequence = false;
- // m_higher_bbl = true; // who says that?
-
- sync_flags();
-
- /* reading before the start of a programming cycle cancels it (right???) */
- if (m_pgm == PGM_1)
- {
- // attempt to access a locked out boot block: cancel programming
- // command if necessary
- m_pgm = PGM_0;
- m_enabling_sdb = false;
- m_disabling_sdb = false;
- m_programming_timer->adjust(attotime::never);
- }
-
- if (m_id_mode)
- {
- switch (offset)
- {
- case 0x00000:
- reply = 0x1f; // Manufacturer code
- break;
-
- case 0x00001:
- reply = 0xa4; // Device code
- break;
-
- case 0x00002:
- reply = m_lower_bbl? 0xff : 0xfe;
- break;
-
- case 0x7fff2:
- reply = m_higher_bbl? 0xff : 0xfe;
- break;
-
- default:
- reply = 0;
- break;
- }
- }
- else if ((m_pgm == PGM_2) || (m_pgm == PGM_3))
- {
- if (m_pgm == PGM_2)
- { // DATA* polling starts the programming cycle (right???)
- m_pgm = PGM_3;
- /* max delay 10ms, typical delay 5 to 7 ms */
- m_programming_timer->adjust(attotime::from_msec(5));
- }
-
- reply = m_toggle_bit? 0x02 : 0x00;
- m_toggle_bit = !m_toggle_bit;
-
- if ((offset == m_programming_last_offset) && (! (m_programming_buffer[m_programming_last_offset & 0xff] & 0x01)))
- reply |= 0x01;
- }
- else
- reply = m_eememory[offset+2];
-
- if (VERBOSE>7) LOG("at29040a: %05x -> %02x\n", offset, reply);
-
- return reply;
-}
-
-/*
- Write a byte to FEEPROM
-*/
-WRITE8_MEMBER( at29040a_device::write )
-{
- offset &= ADDRESS_MASK;
- if (VERBOSE>7) LOG("at29040a: %05x <- %02x\n", offset, data);
-
- /* The special CFI commands assume a smaller address space according */
- /* to the specification ("address format A14-A0") */
- offs_t cfi_offset = offset & 0x7fff;
-
- if (m_enabling_bbl)
- {
- if (VERBOSE>7) LOG("at29040a: Enabling boot block lockout\n");
- m_enabling_bbl = false;
-
- if ((offset == 0x00000) && (data == 0x00))
- {
- if (VERBOSE>7) LOG("at29040a: Enabling lower boot block lockout\n");
- m_lower_bbl = true;
- sync_flags();
- return;
- }
- else
- {
- if ((offset == 0x7ffff) && (data == 0xff))
- {
- if (VERBOSE>7) LOG("at29040a: Enabling higher boot block lockout\n");
- m_higher_bbl = true;
- sync_flags();
- return;
- }
- else
- {
- if (VERBOSE>1) LOG("at29040a: Invalid boot block specification: %05x/%02x\n", offset, data);
- }
- }
- }
-
- switch (m_cmd)
- {
- case CMD_0:
- if ((cfi_offset == 0x5555) && (data == 0xaa))
- {
- if (VERBOSE>7) LOG("at29040a: Command sequence started\n");
- m_cmd = CMD_1;
- }
- else
- {
- m_cmd = CMD_0;
- m_long_sequence = false;
- }
- break;
-
- case CMD_1:
- if ((cfi_offset == 0x2aaa) && (data == 0x55))
- {
- m_cmd = CMD_2;
- }
- else
- {
- m_cmd = CMD_0;
- m_long_sequence = false;
- if (VERBOSE>7) LOG("at29040a: Command sequence aborted\n");
- }
- break;
-
- case CMD_2:
- if (cfi_offset == 0x5555)
- {
- if (!m_long_sequence)
- if (VERBOSE>7) LOG("at29040a: Command sequence completed\n");
-
- m_pgm = PGM_0;
- m_enabling_sdb = false;
- m_disabling_sdb = false;
- m_programming_timer->adjust(attotime::never);
-
- /* process command */
- switch (data)
- {
- case 0x10:
- /* Software chip erase */
- if (m_long_sequence)
- {
- if (m_lower_bbl || m_higher_bbl)
- {
- if (VERBOSE>1) LOG("at29040a: Chip erase sequence deactivated due to previous boot block lockout.\n");
- }
- else
- {
- if (VERBOSE>7) LOG("at29040a: Erase chip\n");
- memset(m_eememory+2, 0xff, FEEPROM_SIZE);
- }
- }
- break;
-
- case 0x20:
- /* Software data protection disable */
- if (VERBOSE>7) LOG("at29040a: Software data protection disable\n");
- // The complete sequence is aa-55-80-aa-55-20
- // so we need a 80 before, else the sequence is invalid
- if (m_long_sequence)
- {
- m_pgm = PGM_1;
- m_disabling_sdb = true;
- /* set command timeout (right???) */
- //m_programming_timer->adjust(attotime::from_usec(150), id, 0.);
- }
- break;
-
- case 0x40:
- /* Boot block lockout enable */
- // Complete sequence is aa-55-80-aa-55-40
- if (VERBOSE>7) LOG("at29040a: Boot block lockout enable\n");
- if (m_long_sequence) m_enabling_bbl = true;
- break;
-
- case 0x80:
- m_long_sequence = true;
- break;
-
- case 0x90:
- /* Software product identification entry */
- if (VERBOSE>7) LOG("at29040a: Identification mode (start)\n");
- m_id_mode = true;
- break;
-
- case 0xa0:
- /* Software data protection enable */
- if (VERBOSE>7) LOG("at29040a: Software data protection enable\n");
- m_pgm = PGM_1;
- m_enabling_sdb = true;
- /* set command timeout (right???) */
- //m_programming_timer->adjust(attotime::from_usec(150), id, 0.);
- break;
-
- case 0xf0:
- /* Software product identification exit */
- if (VERBOSE>7) LOG("at29040a: Identification mode (end)\n");
- m_id_mode = false;
- break;
- }
- m_cmd = CMD_0;
- if (data != 0x80) m_long_sequence = false;
-
- /* return, because we don't want to write the EEPROM with the command byte */
- return;
- }
- else
- {
- m_cmd = CMD_0;
- m_long_sequence = false;
- }
- }
- if ((m_pgm == PGM_2)
- && ((offset & ~0xff) != (m_programming_last_offset & ~0xff)))
- {
- /* cancel current programming cycle */
- if (VERBOSE>7) LOG("at29040a: invalid sector change (from %05x to %05x); cancel programming cycle\n",(offset & ~0xff), (m_programming_last_offset & ~0xff));
- m_pgm = PGM_0;
- m_enabling_sdb = false;
- m_disabling_sdb = false;
- m_programming_timer->adjust(attotime::never);
- }
-
- if (((m_pgm == PGM_0) && !m_sdp) // write directly
- || (m_pgm == PGM_1)) // write after unlocking
- {
- if (((offset < BOOT_BLOCK_SIZE) && m_lower_bbl)
- || ((offset >= FEEPROM_SIZE-BOOT_BLOCK_SIZE) && m_higher_bbl))
- {
- // attempt to access a locked out boot block: cancel programming
- // command if necessary
- if (VERBOSE>7) LOG("at29040a: attempt to access a locked out boot block: offset = %05x, lowblock=%d, highblock=%d\n", offset, m_lower_bbl, m_higher_bbl);
-
- m_pgm = PGM_0;
- m_enabling_sdb = false;
- m_disabling_sdb = false;
- }
- else
- { /* enter programming mode */
- if (VERBOSE>7) LOG("at29040a: enter programming mode (m_pgm=%d)\n", m_pgm);
- memset(m_programming_buffer, 0xff, SECTOR_SIZE);
- m_pgm = PGM_2;
- }
- }
- if (m_pgm == PGM_2)
- {
- /* write data to programming buffer */
- if (VERBOSE>7) LOG("at29040a: Write data to programming buffer\n");
- m_programming_buffer[offset & 0xff] = data;
- m_programming_last_offset = offset;
- m_programming_timer->adjust(attotime::from_usec(150)); // next byte must be written before the timer expires
- }
-}
-
-void at29040a_device::device_start(void)
-{
- m_programming_buffer = global_alloc_array(UINT8, SECTOR_SIZE);
- m_programming_timer = timer_alloc(PRG_TIMER);
-
- m_eememory = global_alloc_array(UINT8, FEEPROM_SIZE+2);
-}
-
-void at29040a_device::device_stop(void)
-{
- global_free_array(m_programming_buffer);
- global_free_array(m_eememory);
-}
-
-void at29040a_device::device_reset(void)
-{
- if (m_eememory[0] != VERSION)
- {
- if (VERBOSE>1) LOG("AT29040A: Warning: Version mismatch; expected %d but found %d for %s. Resetting.\n", VERSION, m_eememory[0], tag());
- m_eememory[0] = 0;
- m_eememory[1] = 0;
- }
-
- m_lower_bbl = ((m_eememory[1] & 0x04)!=0);
- m_higher_bbl = ((m_eememory[1] & 0x02)!=0);
- m_sdp = ((m_eememory[1] & 0x01)!=0);
-
- if (VERBOSE>7) LOG("at29040a (%s): LowerBBL = %d, HigherBBL = %d, SoftDataProt = %d\n", tag(), m_lower_bbl, m_higher_bbl, m_sdp);
-
- m_id_mode = false;
- m_cmd = CMD_0;
- m_enabling_bbl = false;
- m_long_sequence = false;
- m_pgm = PGM_0;
- m_enabling_sdb = false;
- m_disabling_sdb = false;
- m_toggle_bit = false;
- m_programming_last_offset = 0;
-}
-
-const device_type AT29040A = &device_creator<at29040a_device>;
diff --git a/src/emu/machine/at29040a.h b/src/emu/machine/at29040a.h
deleted file mode 100644
index 1af258fb719..00000000000
--- a/src/emu/machine/at29040a.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Raphael Nabet, Michael Zapf
-/*
- ATMEL 29040a
-
- Michael Zapf
- September 2010: Rewritten as device
- February 2012: Rewritten as class
-*/
-
-#ifndef __AT29040__
-#define __AT29040__
-
-#include "emu.h"
-
-extern const device_type AT29040A;
-
-/*
- at29c40a state
-
- Command states (CMD_0 is the initial state):
- CMD_0: default state
- CMD_1: state after writing aa to 5555
- CMD_2: state after writing 55 to 2aaa
-
- Programming states (s_programming_0 is the initial state):
- PGM_0: default state
- PGM_1: a program and enable/disable lock command has been executed, but programming has not actually started.
- PGM_2: the programming buffer is being written to
- PGM_3: the programming buffer is being burnt to flash ROM
-*/
-enum s_cmd_t
-{
- CMD_0 = 0x0,
- CMD_1 = 0x1,
- CMD_2 = 0x2
-};
-
-enum s_pgm_t
-{
- PGM_0 = 0x0,
- PGM_1 = 0x1,
- PGM_2 = 0x2,
- PGM_3 = 0x3
-};
-
-class at29040a_device : public device_t, public device_nvram_interface
-{
-public:
- at29040a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- DECLARE_READ8_MEMBER( read );
- DECLARE_WRITE8_MEMBER( write );
-
-protected:
- virtual void device_start(void);
- virtual void device_reset(void);
- virtual void device_stop(void);
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
-
- void nvram_default();
- void nvram_read(emu_file &file);
- void nvram_write(emu_file &file);
-
-private:
- void sync_flags(void);
-
- UINT8* m_eememory;
-
- bool m_lower_bbl; /* set when lower boot block lockout is enabled */
- bool m_higher_bbl; /* set when upper boot block lockout is enabled */
- bool m_sdp; /* set when in software data protect mode */
-
- bool m_id_mode; /* set when in chip id mode */
- s_cmd_t m_cmd; /* command state */
- bool m_enabling_bbl; /* set when a boot block lockout command is expecting its parameter */
- bool m_long_sequence; /* set if 0x80 command has just been executed (some command require this prefix) */
- s_pgm_t m_pgm; /* programming state */
- bool m_enabling_sdb; /* set when a sdp enable command is in progress */
- bool m_disabling_sdb; /* set when a sdp disable command is in progress */
- //bool m_dirty; /* set when the memory contents should be set */
- bool m_toggle_bit; // indicates flashing in progress (toggles for each query)
- UINT8* m_programming_buffer;
- int m_programming_last_offset;
- emu_timer* m_programming_timer;
-};
-
-#define MCFG_AT29040A_ADD(_tag ) \
- MCFG_DEVICE_ADD(_tag, AT29040A, 0)
-
-#endif
diff --git a/src/emu/machine/at29x.c b/src/emu/machine/at29x.c
new file mode 100644
index 00000000000..440645b4c00
--- /dev/null
+++ b/src/emu/machine/at29x.c
@@ -0,0 +1,525 @@
+// license:BSD-3-Clause
+// copyright-holders:Michael Zapf
+/*
+ ATMEL AT29 family of Flash EEPROM
+
+ References:
+ [1] ATMEL: 4-megabit (512K x 8) 5-volt Only 256-byte sector Flash Memory
+ [2] ATMEL: Programming Atmel's AT29 Flash Family
+
+
+ AT29 family
+
+ Device Memory ID Sectors Sector Size Write Cycle Time Comments
+ ------------------------------------------------------------------------------------------
+ AT29C256 32K x 8 DC 512 64 bytes 10 ms
+ AT29LV256 32K x 8 BC 512 64 bytes 20 ms
+ AT29C257 32K x 8 DC 512 64 bytes 10 ms
+ AT29C512 64K x 8 5D 512 128 bytes 10 ms
+ AT29LV512 64K x 8 3D 512 128 bytes 20 ms
+ AT29C010A 128K x 8 D5 1024 128 bytes 10 ms
+ AT29LV010A 128K x 8 35 1024 128 bytes 20 ms
+ AT29BV010A 128K x 8 35 1024 128 bytes 20 ms
+ AT29C1024 64K x 16 25 512 128 words 10 ms
+ AT29LV1024 64K x 16 26 512 128 words 20 ms
+ AT29C020 256K x 8 DA 1024 256 bytes 10 ms
+ AT29LV020 256K x 8 BA 1024 256 bytes 20 ms
+ AT29BV020 256K x 8 BA 1024 256 bytes 20 ms
+ AT29C040 512K x 8 5B 1024 512 bytes 10 ms Use AT29C040A for new designs
+ AT29LV040 512K x 8 3B 1024 512 bytes 20 ms Use AT29LV040A for new designs
+ AT29BV040 512K x 8 3B 1024 512 bytes 20 ms Use AT29BV040A for new designs
+ AT29C040A 512K x 8 A4 2048 256 bytes 10 ms
+ AT29LV040A 512K x 8 C4 2048 256 bytes 20 ms
+ AT29BV040A 512K x 8 C4 2048 256 bytes 20 ms
+
+ TODO: Implement remaining variants
+
+ MZ, Aug 2015
+*/
+
+#include "at29x.h"
+
+#define TRACE_PRG 0
+#define TRACE_READ 0
+#define TRACE_WRITE 0
+#define TRACE_CONFIG 0
+#define TRACE_STATE 0
+
+enum
+{
+ PRGTIMER = 1
+};
+
+/*
+ Constructor for all variants
+*/
+
+at29x_device::at29x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
+ : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ device_nvram_interface(mconfig, *this),
+ m_memory_size(0), // bytes
+ m_word_width(8),
+ m_device_id(0),
+ m_sector_size(0),
+ m_cycle_time(10), // ms
+ m_boot_block_size(16*1024),
+ m_version(0)
+{
+}
+
+/*
+ Constructor for AT29C020
+*/
+at29c020_device::at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : at29x_device(mconfig, AT29C020, "ATMEL 29C020 256K x 8 FEEPROM", tag, owner, clock, "at29c020", __FILE__)
+{
+ m_memory_size = 256*1024;
+ m_device_id = 0xda;
+ m_sector_size = 256;
+}
+
+/*
+ Constructor for AT29C040
+*/
+at29c040_device::at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : at29x_device(mconfig, AT29C040, "ATMEL 29C040 512K x 8 FEEPROM", tag, owner, clock, "at29c040", __FILE__)
+{
+ m_memory_size = 512*1024;
+ m_device_id = 0x5b;
+ m_sector_size = 512;
+}
+
+/*
+ Constructor for AT29C040A
+*/
+at29c040a_device::at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : at29x_device(mconfig, AT29C040A, "ATMEL 29C040A 512K x 8 FEEPROM", tag, owner, clock, "at29c040a", __FILE__)
+{
+ m_memory_size = 512*1024;
+ m_device_id = 0xa4;
+ m_sector_size = 256;
+}
+
+
+//-------------------------------------------------
+// nvram_default - called to initialize NVRAM to
+// its default state
+//-------------------------------------------------
+
+void at29x_device::nvram_default()
+{
+ memset(m_eememory, 0, m_memory_size+2);
+}
+
+//-------------------------------------------------
+// nvram_read - called to read NVRAM from the
+// .nv file
+//-------------------------------------------------
+
+void at29x_device::nvram_read(emu_file &file)
+{
+ file.read(m_eememory, m_memory_size+2);
+}
+
+//-------------------------------------------------
+// nvram_write - called to write NVRAM to the
+// .nv file
+//-------------------------------------------------
+
+void at29x_device::nvram_write(emu_file &file)
+{
+ // If we don't write (because there were no changes), the file will be wiped
+ if (TRACE_PRG) logerror("%s: Write to NVRAM file\n", tag());
+ m_eememory[0] = m_version;
+ file.write(m_eememory, m_memory_size+2);
+}
+
+/*
+ Programming timer callback
+*/
+void at29x_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ switch (m_pgm)
+ {
+ case PGM_1:
+ // Programming cycle timeout
+ logerror("%s: Programming cycle timeout\n", tag());
+ m_pgm = PGM_0;
+ break;
+
+ case PGM_2:
+ // Programming cycle start
+ if (TRACE_PRG) logerror("%s: Sector write start\n", tag());
+ m_pgm = PGM_3;
+ // We assume a typical delay of 70% of the max value
+ m_programming_timer->adjust(attotime::from_msec(m_cycle_time*7/10));
+ break;
+
+ case PGM_3:
+ // Programming cycle end; now burn the buffer into the flash EEPROM
+ memcpy(m_eememory + 2 + get_sector_number(m_programming_last_offset) * m_sector_size, m_programming_buffer, m_sector_size);
+
+ if (TRACE_PRG) logerror("%s: Sector write completed at location %04x\n", tag(), m_programming_last_offset);
+
+ // Data protect state will be activated at the end of the program cycle [1]
+ if (m_enabling_sdb) m_sdp = true;
+
+ // Data protect state will be deactivated at the end of the program period [1]
+ if (m_disabling_sdb) m_sdp = false;
+
+ if (TRACE_PRG) logerror("%s: Software data protection = %d\n", tag(), m_sdp);
+
+ m_pgm = PGM_0;
+ m_enabling_sdb = false;
+ m_disabling_sdb = false;
+ sync_flags();
+ break;
+
+ default:
+ logerror("%s: Invalid state %d during programming\n", tag(), m_pgm);
+ m_pgm = PGM_0;
+ break;
+ }
+}
+
+void at29x_device::sync_flags()
+{
+ if (m_lower_bbl) m_eememory[1] |= 0x04;
+ else m_eememory[1] &= ~0x04;
+
+ if (m_higher_bbl) m_eememory[1] |= 0x02;
+ else m_eememory[1] &= ~0x02;
+
+ if (m_sdp) m_eememory[1] |= 0x01;
+ else m_eememory[1] &= ~0x01;
+}
+
+/*
+ read a byte from FEEPROM
+*/
+READ8_MEMBER( at29x_device::read )
+{
+ int reply;
+
+ offset &= m_address_mask;
+
+ // Reading in the midst of any command sequence cancels it (not verified)
+ m_cmd = CMD_0;
+ m_long_sequence = false;
+
+ sync_flags();
+
+ // Reading before the start of a programming cycle cancels it (not verified)
+ if (m_pgm == PGM_1)
+ {
+ // Attempt to access a locked out boot block: cancel programming command if necessary
+ m_pgm = PGM_0;
+ m_enabling_sdb = false;
+ m_disabling_sdb = false;
+ m_programming_timer->adjust(attotime::never);
+ }
+
+ if (m_id_mode)
+ {
+ // Experiments showed that the manufacturer code and device code
+ // are returned for every address 0 and 1 modulo sector_size.
+ //
+ if ((offset % m_sector_size)==0) reply = 0x1f; // Manufacturer code
+ else
+ {
+ if ((offset % m_sector_size)==1) reply = m_device_id; // Device code
+ else
+ {
+ // Boot block lockout detection [1]
+ if (offset == 0x00002) reply = m_lower_bbl? 0xff : 0xfe;
+ else
+ {
+ if (offset == 0x7fff2) reply = m_higher_bbl? 0xff : 0xfe;
+ else reply = 0;
+ }
+ }
+ }
+ }
+ else if ((m_pgm == PGM_2) || (m_pgm == PGM_3))
+ {
+ if (m_pgm == PGM_2)
+ {
+ // DATA* polling starts the programming cycle (not verified)
+ m_pgm = PGM_3;
+
+ // We assume a typical delay of 70% of the max value
+ m_programming_timer->adjust(attotime::from_msec(m_cycle_time*7/10));
+ }
+
+ if (TRACE_READ) logerror("%s: DATA poll; toggle bit 1\n", tag());
+ reply = m_toggle_bit? 0x02 : 0x00;
+ m_toggle_bit = !m_toggle_bit;
+
+ // When we read the byte on the last position, we get the inverse of the last bit [1]
+ if (offset == m_programming_last_offset)
+ {
+ reply |= ((~m_programming_buffer[m_programming_last_offset & m_sector_mask]) & 0x01);
+ }
+ }
+ else
+ // Simple case: just read the memory contents
+ reply = m_eememory[offset+2];
+
+ if (TRACE_READ) logerror("%s: %05x -> %02x (PGM=%d)\n", tag(), offset, reply, m_pgm);
+
+ return reply;
+}
+
+/*
+ Write a byte to FEEPROM
+*/
+WRITE8_MEMBER( at29x_device::write )
+{
+ offset &= m_address_mask;
+ if (TRACE_WRITE) logerror("%s: %05x <- %02x\n", tag(), offset, data);
+
+ // The special CFI commands assume a smaller address space according
+ // to the specification ("address format A14-A0")
+ offs_t cfi_offset = offset & 0x7fff;
+
+ if (m_enabling_bbl)
+ {
+ // Determine whether we lock the upper or lower boot block
+ if (TRACE_STATE) logerror("%s: Enabling boot block lockout\n", tag());
+ m_enabling_bbl = false;
+
+ if ((offset == 0x00000) && (data == 0x00))
+ {
+ if (TRACE_STATE) logerror("%s: Enabling lower boot block lockout\n", tag());
+ m_lower_bbl = true;
+ sync_flags();
+ return;
+ }
+ else
+ {
+ if ((offset == 0x7ffff) && (data == 0xff))
+ {
+ if (TRACE_STATE) logerror("%s: Enabling higher boot block lockout\n", tag());
+ m_higher_bbl = true;
+ sync_flags();
+ return;
+ }
+ else
+ {
+ logerror("%s: Invalid boot block specification: %05x/%02x\n", tag(), offset, data);
+ }
+ }
+ }
+
+ switch (m_cmd)
+ {
+ case CMD_0:
+ // CMD_0: start state
+ if ((cfi_offset == 0x5555) && (data == 0xaa))
+ {
+ if (TRACE_STATE) logerror("%s: Command sequence started (aa)\n", tag());
+ m_cmd = CMD_1;
+ return;
+ }
+ else
+ {
+ m_cmd = CMD_0;
+ m_long_sequence = false;
+ }
+ break;
+
+ case CMD_1:
+ // CMD_1: state after writing aa to 5555
+ if ((cfi_offset == 0x2aaa) && (data == 0x55))
+ {
+ if (TRACE_STATE) logerror("%s: Command sequence continued (55)\n", tag());
+ m_cmd = CMD_2;
+ return;
+ }
+ else
+ {
+ m_cmd = CMD_0;
+ m_long_sequence = false;
+ if (TRACE_STATE) logerror("%s: Command sequence aborted\n", tag());
+ }
+ break;
+
+ case CMD_2:
+ // CMD_2: state after writing 55 to 2aaa
+ if (cfi_offset == 0x5555)
+ {
+ m_pgm = PGM_0;
+ m_enabling_sdb = false;
+ m_disabling_sdb = false;
+ m_programming_timer->adjust(attotime::never);
+
+ // Process command
+ if (TRACE_STATE) logerror("%s: Command sequence continued (%2x)\n", tag(), data);
+ switch (data)
+ {
+ case 0x10:
+ // Software chip erase (optional feature, see [1])
+ if (m_long_sequence)
+ {
+ if (m_lower_bbl || m_higher_bbl)
+ logerror("%s: Boot block lockout active; chip cannot be erased.\n", tag());
+ else
+ {
+ if (TRACE_STATE) logerror("%s: Erase chip\n", tag());
+ memset(m_eememory+2, 0xff, m_memory_size);
+ }
+ }
+ break;
+
+ case 0x20:
+ // Software data protection disable
+ // The complete sequence is aa-55-80-aa-55-20
+ // so we need a 80 before, else the sequence is invalid
+ if (m_long_sequence)
+ {
+ if (TRACE_STATE) logerror("%s: Software data protection disable\n", tag());
+ m_pgm = PGM_1;
+ m_disabling_sdb = true;
+ // It is not clear from the specification whether the byte cycle timer
+ // is already started here or when the first data byte is written
+ }
+ break;
+
+ case 0x40:
+ // Boot block lockout enable
+ // Complete sequence is aa-55-80-aa-55-40
+ if (TRACE_STATE) logerror("%s: Boot block lockout enable\n", tag());
+ if (m_long_sequence) m_enabling_bbl = true;
+ // We'll know which boot block is affected on the next write
+ break;
+
+ case 0x80:
+ // Long sequences are those that contain aa55 twice
+ m_long_sequence = true;
+ break;
+
+ case 0x90:
+ // Software product identification entry
+ if (TRACE_STATE) logerror("%s: Entering Identification mode\n", tag());
+ m_id_mode = true;
+ break;
+
+ case 0xa0:
+ // Software data protection enable
+ if (TRACE_STATE) logerror("%s: Software data protection enable\n", tag());
+ m_pgm = PGM_1;
+ m_enabling_sdb = true;
+ // It is not clear from the specification whether the byte cycle timer
+ // is already started here or when the first data byte is written
+ break;
+
+ case 0xf0:
+ // Software product identification exit
+ if (TRACE_STATE) logerror("%s: Exiting Identification mode\n", tag());
+ m_id_mode = false;
+ break;
+ }
+ m_cmd = CMD_0;
+ if (data != 0x80) m_long_sequence = false;
+
+ // Return, because we don't want to write the EEPROM with the command byte
+ return;
+ }
+ else
+ {
+ m_cmd = CMD_0;
+ m_long_sequence = false;
+ }
+ }
+
+ if ((m_pgm == PGM_2) && (get_sector_number(offset) != get_sector_number(m_programming_last_offset)))
+ {
+ // cancel current programming cycle
+ if (TRACE_WRITE) logerror("%s: Invalid sector change (from sector 0x%04x to 0x%04x); cancel programming cycle\n", tag(), get_sector_number(m_programming_last_offset), get_sector_number(offset));
+ m_pgm = PGM_0;
+ m_enabling_sdb = false;
+ m_disabling_sdb = false;
+ m_programming_timer->adjust(attotime::never);
+ }
+
+ if (((m_pgm == PGM_0) && !m_sdp) // write directly
+ || (m_pgm == PGM_1)) // write after unlocking
+ {
+ if (((offset < m_boot_block_size) && m_lower_bbl)
+ || ((offset >= m_memory_size-m_boot_block_size) && m_higher_bbl))
+ {
+ // attempt to access a locked out boot block: cancel programming
+ // command if necessary
+ if (TRACE_WRITE) logerror("%s: Attempt to access a locked out boot block: offset = %05x, lowblock=%d, highblock=%d\n", tag(), offset, m_lower_bbl, m_higher_bbl);
+
+ m_pgm = PGM_0;
+ m_enabling_sdb = false;
+ m_disabling_sdb = false;
+ }
+ else
+ { // enter programming mode
+ if (TRACE_STATE) logerror("%s: Enter programming mode (m_pgm=%d, m_sdp=%d)\n", tag(), m_pgm, m_sdp);
+ // Clear the programming buffer
+ memset(m_programming_buffer, 0xff, m_sector_size);
+ m_pgm = PGM_2;
+ }
+ }
+ // TODO: If data protection is active and bytes are written, the device
+ // enters a dummy write mode
+
+ if (m_pgm == PGM_2)
+ {
+ // write data to programming buffer
+ if (TRACE_PRG) logerror("%s: Write data to programming buffer: buf[%x] = %02x\n", tag(), offset & m_sector_mask, data);
+ m_programming_buffer[offset & m_sector_mask] = data;
+ m_programming_last_offset = offset;
+ m_programming_timer->adjust(attotime::from_usec(150)); // next byte must be written before the timer expires
+ }
+}
+
+void at29x_device::device_start(void)
+{
+ m_programming_buffer = global_alloc_array(UINT8, m_sector_size);
+ m_eememory = global_alloc_array(UINT8, m_memory_size+2);
+ m_programming_timer = timer_alloc(PRGTIMER);
+
+ // TODO: Complete 16-bit handling
+ m_address_mask = m_memory_size/(m_word_width/8) - 1;
+ m_sector_mask = m_sector_size - 1;
+}
+
+void at29x_device::device_stop(void)
+{
+ global_free_array(m_programming_buffer);
+ global_free_array(m_eememory);
+}
+
+void at29x_device::device_reset(void)
+{
+ if (m_eememory[0] != m_version)
+ {
+ logerror("%s: Warning: Version mismatch; expected %d but found %d in file. Resetting.\n", tag(), m_version, m_eememory[0]);
+ m_eememory[0] = 0;
+ m_eememory[1] = 0;
+ }
+
+ m_lower_bbl = ((m_eememory[1] & 0x04)!=0);
+ m_higher_bbl = ((m_eememory[1] & 0x02)!=0);
+ m_sdp = ((m_eememory[1] & 0x01)!=0);
+
+ if (TRACE_CONFIG) logerror("%s: LowerBBL = %d, HigherBBL = %d, SoftDataProt = %d\n", tag(), m_lower_bbl, m_higher_bbl, m_sdp);
+
+ m_id_mode = false;
+ m_cmd = CMD_0;
+ m_enabling_bbl = false;
+ m_long_sequence = false;
+ m_pgm = PGM_0;
+ m_enabling_sdb = false;
+ m_disabling_sdb = false;
+ m_toggle_bit = false;
+ m_programming_last_offset = 0;
+}
+
+const device_type AT29C020 = &device_creator<at29c020_device>;
+const device_type AT29C040 = &device_creator<at29c040_device>;
+const device_type AT29C040A = &device_creator<at29c040a_device>;
diff --git a/src/emu/machine/at29x.h b/src/emu/machine/at29x.h
new file mode 100644
index 00000000000..91c81c585cf
--- /dev/null
+++ b/src/emu/machine/at29x.h
@@ -0,0 +1,116 @@
+// license:BSD-3-Clause
+// copyright-holders:Raphael Nabet, Michael Zapf
+/*
+ ATMEL AT29 family
+
+ Michael Zapf
+ August 2015
+*/
+
+#ifndef __AT29X__
+#define __AT29X__
+
+#include "emu.h"
+
+extern const device_type AT29C020;
+extern const device_type AT29C040;
+extern const device_type AT29C040A;
+
+enum s_cmd_t
+{
+ CMD_0 = 0,
+ CMD_1,
+ CMD_2
+};
+
+enum s_pgm_t
+{
+ PGM_0 = 0,
+ PGM_1,
+ PGM_2,
+ PGM_3
+};
+
+class at29x_device : public device_t, public device_nvram_interface
+{
+public:
+ at29x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+protected:
+ virtual void device_start(void);
+ virtual void device_reset(void);
+ virtual void device_stop(void);
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ void nvram_default();
+ void nvram_read(emu_file &file);
+ void nvram_write(emu_file &file);
+
+ int get_sector_number(offs_t address) { return address / m_sector_size; }
+
+ int m_memory_size; // bytes
+ int m_word_width;
+ int m_device_id;
+ int m_sector_size;
+ int m_cycle_time; // ms
+ int m_boot_block_size;
+ int m_version;
+ int m_address_mask;
+ int m_sector_mask;
+
+private:
+ void sync_flags(void);
+
+ UINT8* m_eememory;
+
+ bool m_lower_bbl; // set when lower boot block lockout is enabled
+ bool m_higher_bbl; // set when upper boot block lockout is enabled
+ bool m_sdp; // set when in software data protect mode
+
+ bool m_id_mode; // set when in chip id mode
+ s_cmd_t m_cmd; // command state
+ bool m_enabling_bbl; // set when a boot block lockout command is expecting its parameter
+ bool m_long_sequence; // set if 0x80 command has just been executed (some command require this prefix)
+ s_pgm_t m_pgm; // programming state
+ bool m_enabling_sdb; // set when a sdp enable command is in progress
+ bool m_disabling_sdb; // set when a sdp disable command is in progress
+ bool m_toggle_bit; // indicates flashing in progress (toggles for each query)
+
+ UINT8* m_programming_buffer;
+ int m_programming_last_offset;
+ emu_timer* m_programming_timer;
+};
+
+/*
+ Variants
+*/
+class at29c020_device : public at29x_device
+{
+public:
+ at29c020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class at29c040_device : public at29x_device
+{
+public:
+ at29c040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+class at29c040a_device : public at29x_device
+{
+public:
+ at29c040a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
+#define MCFG_AT29C020_ADD(_tag ) \
+ MCFG_DEVICE_ADD(_tag, AT29C020, 0)
+
+#define MCFG_AT29C040_ADD(_tag ) \
+ MCFG_DEVICE_ADD(_tag, AT29C040, 0)
+
+#define MCFG_AT29C040A_ADD(_tag ) \
+ MCFG_DEVICE_ADD(_tag, AT29C040A, 0)
+
+#endif
diff --git a/src/emu/machine/fdc_pll.c b/src/emu/machine/fdc_pll.c
index 32df60be493..cf616468a12 100644
--- a/src/emu/machine/fdc_pll.c
+++ b/src/emu/machine/fdc_pll.c
@@ -5,11 +5,11 @@
std::string fdc_pll_t::tts(attotime t)
{
char buf[256];
- bool neg = t.seconds < 0;
+ bool neg = t.seconds() < 0;
if(neg)
t = attotime::zero - t;
- int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
- sprintf(buf, "%c%3d.%03d,%03d,%03d", neg ? '-' : ' ', int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
+ int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ sprintf(buf, "%c%3d.%03d,%03d,%03d", neg ? '-' : ' ', int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
return buf;
}
@@ -80,7 +80,7 @@ int fdc_pll_t::get_next_bit(attotime &tm, floppy_image_device *floppy, const att
attotime delta = edge - (next - period/2);
- if(delta.seconds < 0)
+ if(delta.seconds() < 0)
phase_adjust = attotime::zero - ((attotime::zero - delta)*65)/100;
else
phase_adjust = (delta*65)/100;
diff --git a/src/emu/machine/hdc92x4.c b/src/emu/machine/hdc92x4.c
index f9b77b63fb0..f887c9a7bbb 100644
--- a/src/emu/machine/hdc92x4.c
+++ b/src/emu/machine/hdc92x4.c
@@ -23,6 +23,7 @@
#include "formats/imageutl.h"
// Per-command debugging
+#define TRACE_COMMAND 0
#define TRACE_SELECT 0
#define TRACE_STEP 0
#define TRACE_RESTORE 0
@@ -787,7 +788,7 @@ void hdc92x4_device::read_id(int& cont, bool implied_seek, bool wait_seek_comple
break;
default:
- logerror("%s: unknown substate %02x in read_id\n", tag(), m_substate);
+ logerror("%s: BUG: Unknown substate %02x in read_id, aborting command\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -899,7 +900,7 @@ void hdc92x4_device::verify(int& cont)
break;
default:
- logerror("%s: unknown substate %02x in verify\n", tag(), m_substate);
+ logerror("%s: BUG: Unknown substate %02x in verify, aborting command\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -1071,7 +1072,7 @@ void hdc92x4_device::data_transfer(int& cont)
break;
default:
- logerror("%s: unknown substate %02x in data_transfer\n", tag(), m_substate);
+ logerror("%s: BUG: Unknown substate %02x in data_transfer, aborting command\n", tag(), m_substate);
cont = ERROR;
}
}
@@ -1522,7 +1523,8 @@ void hdc92x4_device::seek_read_id()
cont = SUCCESS;
break;
default:
- logerror("%s: unknown substate %02x in seek_read_id\n", tag(), m_substate);
+ logerror("%s: BUG: Unknown substate %02x in seek_read_id, aborting command\n", tag(), m_substate);
+ set_command_done(TC_DATAERR);
cont = ERROR;
}
}
@@ -1584,7 +1586,8 @@ void hdc92x4_device::read_sectors()
data_transfer(cont);
break;
default:
- logerror("%s: unknown substate %02x in read_sectors\n", tag(), m_substate);
+ logerror("%s: BUG: Unknown substate %02x in read_sectors, aborting command\n", tag(), m_substate);
+ set_command_done(TC_DATAERR);
cont = ERROR;
}
}
@@ -1866,7 +1869,8 @@ void hdc92x4_device::write_sectors()
data_transfer(cont);
break;
default:
- logerror("%s: unknown substate %02x in write_sectors\n", tag(), m_substate);
+ logerror("%s: BUG: Unknown substate %02x in write_sectors, aborting command\n", tag(), m_substate);
+ set_command_done(TC_DATAERR);
cont = ERROR;
}
}
@@ -1892,8 +1896,8 @@ void hdc92x4_device::write_sectors()
std::string hdc92x4_device::tts(const attotime &t)
{
char buf[256];
- int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
- sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
+ int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
return buf;
}
@@ -3558,7 +3562,7 @@ bool hdc92x4_device::read_one_bit(const attotime &limit)
// value < 100: big trouble for controller, will fail
if (UNRELIABLE_MEDIA)
{
- if ((machine().time().attoseconds % 1009)==0) bit = 0;
+ if ((machine().time().attoseconds() % 1009)==0) bit = 0;
}
// Push into shift register
@@ -3898,12 +3902,11 @@ UINT16 hdc92x4_device::encode_a1_hd()
READ8_MEMBER( hdc92x4_device::read )
{
UINT8 reply = 0;
-
if ((offset & 1) == 0)
{
// Data register
reply = m_register_r[m_register_pointer];
- if (TRACE_READREG) logerror("%s: read register[%d] -> %02x\n", tag(), m_register_pointer, reply);
+ if (TRACE_READREG) logerror("%s: Read register[%d] -> %02x\n", tag(), m_register_pointer, reply);
// Autoincrement until DATA is reached.
if (m_register_pointer < DATA) m_register_pointer++;
@@ -3915,7 +3918,7 @@ READ8_MEMBER( hdc92x4_device::read )
// "The interrupt pin is reset to its inactive state
// when the UDC interrupt status register is read." [1] (p.3)
- if (TRACE_READREG) logerror("%s: read interrupt status register -> %02x\n", tag(), reply);
+ if (TRACE_READREG) logerror("%s: Read interrupt status register -> %02x\n", tag(), reply);
set_interrupt(CLEAR_LINE);
// Clear the bits due to interrupt status register read.
@@ -3935,15 +3938,18 @@ WRITE8_MEMBER( hdc92x4_device::write )
{
if ((offset & 1) == 0)
{
- m_regvalue = data & 0xff;
- wait_time(m_cmd_timer, attotime::from_nsec(REGISTER_COMMIT), REGISTER_ACCESS);
+ if (TRACE_COMMAND) logerror("%s: New register write access %02x\n", tag(), data & 0xff);
+ if (m_executing) logerror("%s: Error - previous command %02x not completed; register access ignored\n", tag(), current_command());
+ else
+ {
+ m_regvalue = data & 0xff;
+ wait_time(m_cmd_timer, attotime::from_nsec(REGISTER_COMMIT), REGISTER_ACCESS);
+ }
}
else
{
- if (m_executing)
- {
- logerror("%s: [%s] Error - previous command %02x not completed; new command %02x ignored\n", tag(), ttsn().c_str(), current_command(), data);
- }
+ if (TRACE_COMMAND) logerror("%s: New incoming command %02x\n", tag(), data);
+ if (m_executing) logerror("%s: Error - previous command %02x not completed; new command %02x ignored\n", tag(), current_command(), data);
else
{
m_register_w[COMMAND] = data;
diff --git a/src/emu/machine/i8251.c b/src/emu/machine/i8251.c
index 362b3372574..e37da9fcb6b 100644
--- a/src/emu/machine/i8251.c
+++ b/src/emu/machine/i8251.c
@@ -107,7 +107,8 @@ void i8251_device::device_start()
save_item(NAME(m_rxc_count));
save_item(NAME(m_txc_count));
save_item(NAME(m_br_factor));
- save_item(NAME(m_data));
+ save_item(NAME(m_rx_data));
+ save_item(NAME(m_tx_data));
save_item(NAME(m_tx_busy));
save_item(NAME(m_disable_tx_pending));
device_serial_interface::register_save_state(machine().save(), this);
@@ -190,7 +191,7 @@ void i8251_device::transmit_clock()
if (is_transmit_register_empty())
{
/* set it up */
- transmit_register_setup(m_data);
+ transmit_register_setup(m_tx_data);
/* i8251 transmit reg now empty */
m_status |=I8251_STATUS_TX_EMPTY;
/* ready for next transmit */
@@ -339,7 +340,8 @@ void i8251_device::device_reset()
m_status = I8251_STATUS_TX_EMPTY | I8251_STATUS_TX_READY;
m_mode_byte = 0;
m_command = 0;
- m_data = 0;
+ m_rx_data = 0;
+ m_tx_data = 0;
m_rxc_count = m_txc_count = 0;
m_br_factor = 1;
m_tx_busy = m_disable_tx_pending = false;
@@ -688,8 +690,9 @@ READ8_MEMBER(i8251_device::status_r)
WRITE8_MEMBER(i8251_device::data_w)
{
- m_data = data;
+ m_tx_data = data;
+ LOG(("data_w %02x\n" , data));
// printf("i8251 transmit char: %02x\n",data);
/* writing clears */
@@ -711,9 +714,8 @@ WRITE8_MEMBER(i8251_device::data_w)
void i8251_device::receive_character(UINT8 ch)
{
-// printf("i8251 receive char: %02x\n",ch);
- m_data = ch;
+ m_rx_data = ch;
/* char has not been read and another has arrived! */
if (m_status & I8251_STATUS_RX_READY)
@@ -733,12 +735,12 @@ void i8251_device::receive_character(UINT8 ch)
READ8_MEMBER(i8251_device::data_r)
{
- //logerror("read data: %02x, STATUS=%02x\n",m_data,m_status);
+ LOG(("read data: %02x, STATUS=%02x\n",m_rx_data,m_status));
/* reading clears */
m_status &= ~I8251_STATUS_RX_READY;
update_rx_ready();
- return m_data;
+ return m_rx_data;
}
diff --git a/src/emu/machine/i8251.h b/src/emu/machine/i8251.h
index 7f51f0dfff2..e2d271a31c3 100644
--- a/src/emu/machine/i8251.h
+++ b/src/emu/machine/i8251.h
@@ -132,7 +132,8 @@ private:
int m_br_factor;
/* data being received */
- UINT8 m_data;
+ UINT8 m_rx_data;
+ UINT8 m_tx_data;
bool m_tx_busy;
bool m_disable_tx_pending;
};
diff --git a/src/emu/machine/intelfsh.c b/src/emu/machine/intelfsh.c
index fa5a6abfdbd..b7e6e00601e 100644
--- a/src/emu/machine/intelfsh.c
+++ b/src/emu/machine/intelfsh.c
@@ -93,6 +93,7 @@ const device_type FUJITSU_29DL16X = &device_creator<fujitsu_29dl16x_device>;
const device_type INTEL_E28F400B = &device_creator<intel_e28f400b_device>;
const device_type MACRONIX_29L001MC = &device_creator<macronix_29l001mc_device>;
const device_type MACRONIX_29LV160TMC = &device_creator<macronix_29lv160tmc_device>;
+const device_type TMS_29F040 = &device_creator<tms_29f040_device>;
const device_type PANASONIC_MN63F805MNP = &device_creator<panasonic_mn63f805mnp_device>;
const device_type SANYO_LE26FV10N1TS = &device_creator<sanyo_le26fv10n1ts_device>;
@@ -166,6 +167,7 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type
m_type(variant),
m_size(0),
m_bits(8),
+ m_addrmask(0),
m_device_id(0),
m_maker_id(0),
m_sector_is_4k(false),
@@ -215,6 +217,7 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type
case FLASH_AMD_29F080:
m_bits = 8;
m_size = 0x100000;
+ m_addrmask = 0x7ff;
m_maker_id = MFG_AMD;
m_device_id = 0xd5;
map = ADDRESS_MAP_NAME( memory_map8_8Mb );
@@ -369,6 +372,14 @@ intelfsh_device::intelfsh_device(const machine_config &mconfig, device_type type
m_device_id = 0x04;
map = ADDRESS_MAP_NAME( memory_map8_4Mb );
break;
+ case FLASH_TMS_29F040:
+ m_bits = 8;
+ m_addrmask = 0x7fff;
+ m_size = 0x80000;
+ m_maker_id = MFG_AMD;
+ m_device_id = 0xa4;
+ map = ADDRESS_MAP_NAME( memory_map8_4Mb );
+ break;
}
int addrbits;
@@ -465,6 +476,10 @@ intel_28f320j5_device::intel_28f320j5_device(const machine_config &mconfig, cons
sst_39vf400a_device::sst_39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: intelfsh16_device(mconfig, SST_39VF400A, "SST 39VF400A Flash", tag, owner, clock, FLASH_SST_39VF400A, "sst_39vf400a", __FILE__) { }
+
+tms_29f040_device::tms_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : intelfsh8_device(mconfig, TMS_29F040, "Texas Instruments 29F040 Flash", tag, owner, clock, FLASH_TMS_29F040, "tms_29f040", __FILE__) { }
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -761,7 +776,8 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
{
m_flash_mode = FM_READAMDID2;
}
- else if( ( address & 0x7ff ) == 0x2aa && ( data & 0xff ) == 0x55 && m_type == FLASH_AMD_29F080 )
+ // for AMD 29F080 address bits A11-A19 don't care, for TMS 29F040 address bits A15-A18 don't care
+ else if( ( address & m_addrmask ) == ( 0xaaaa & m_addrmask ) && ( data & 0xff ) == 0x55 && m_addrmask )
{
m_flash_mode = FM_READAMDID2;
}
@@ -833,20 +849,20 @@ void intelfsh_device::write_full(UINT32 address, UINT32 data)
m_flash_mode = FM_BANKSELECT;
}
- // for AMD 29F080 address bits A11-A19 don't care
- else if(( address & 0x7ff ) == 0x555 && ( data & 0xff ) == 0x80 && m_type == FLASH_AMD_29F080 )
+ // for AMD 29F080 address bits A11-A19 don't care, for TMS 29F040 address bits A15-A18 don't care
+ else if(( address & m_addrmask ) == ( 0x5555 & m_addrmask ) && ( data & 0xff ) == 0x80 && m_addrmask )
{
m_flash_mode = FM_ERASEAMD1;
}
- else if(( address & 0x7ff ) == 0x555 && ( data & 0xff ) == 0x90 && m_type == FLASH_AMD_29F080 )
+ else if(( address & m_addrmask ) == ( 0x5555 & m_addrmask ) && ( data & 0xff ) == 0x90 && m_addrmask )
{
m_flash_mode = FM_READAMDID3;
}
- else if(( address & 0x7ff ) == 0x555 && ( data & 0xff ) == 0xa0 && m_type == FLASH_AMD_29F080 )
+ else if(( address & m_addrmask ) == ( 0x5555 & m_addrmask ) && ( data & 0xff ) == 0xa0 && m_addrmask )
{
m_flash_mode = FM_BYTEPROGRAM;
}
- else if(( address & 0x7ff ) == 0x555 && ( data & 0xff ) == 0xf0 && m_type == FLASH_AMD_29F080 )
+ else if(( address & m_addrmask ) == ( 0x5555 & m_addrmask ) && ( data & 0xff ) == 0xf0 && m_addrmask )
{
m_flash_mode = FM_NORMAL;
}
diff --git a/src/emu/machine/intelfsh.h b/src/emu/machine/intelfsh.h
index 1dbaab76fea..5e4b86f10d2 100644
--- a/src/emu/machine/intelfsh.h
+++ b/src/emu/machine/intelfsh.h
@@ -90,6 +90,9 @@
#define MCFG_SST_39VF400A_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, SST_39VF400A, 0)
+#define MCFG_TMS_29F040_ADD(_tag) \
+ MCFG_DEVICE_ADD(_tag, TMS_29F040, 0)
+
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -126,6 +129,7 @@ public:
FLASH_SANYO_LE26FV10N1TS,
FLASH_SST_28SF040,
FLASH_SST_39VF020,
+ FLASH_TMS_29F040,
// 16-bit variants
FLASH_SHARP_LH28F400 = 0x1000,
@@ -163,6 +167,7 @@ protected:
UINT32 m_type;
INT32 m_size;
UINT8 m_bits;
+ UINT32 m_addrmask;
UINT16 m_device_id;
UINT8 m_maker_id;
bool m_sector_is_4k;
@@ -338,6 +343,12 @@ public:
sst_39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
+class tms_29f040_device : public intelfsh8_device
+{
+public:
+ tms_29f040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
// 16-bit variants
class sharp_lh28f400_device : public intelfsh16_device
{
@@ -398,6 +409,7 @@ extern const device_type FUJITSU_29DL16X;
extern const device_type INTEL_E28F400B;
extern const device_type MACRONIX_29L001MC;
extern const device_type MACRONIX_29LV160TMC;
+extern const device_type TMS_29F040;
extern const device_type PANASONIC_MN63F805MNP;
extern const device_type SANYO_LE26FV10N1TS;
diff --git a/src/emu/machine/jvsdev.c b/src/emu/machine/jvsdev.c
index 204d874ca9a..3357ce90f55 100644
--- a/src/emu/machine/jvsdev.c
+++ b/src/emu/machine/jvsdev.c
@@ -244,7 +244,7 @@ bool jvs_device::swoutputs(UINT8 id, UINT8 val)
return false;
}
-void jvs_device::handle_output(const char *tag, UINT8 id, UINT8 val)
+void jvs_device::handle_output(ioport_port *port, UINT8 id, UINT8 val)
{
UINT32 m = 1 << id;
switch(val) {
@@ -253,5 +253,8 @@ void jvs_device::handle_output(const char *tag, UINT8 id, UINT8 val)
case 2: jvs_outputs ^= m; break;
}
- machine().root_device().ioport(tag)->write_safe(jvs_outputs, m);
+ if (port)
+ {
+ port->write(jvs_outputs, m);
+ }
}
diff --git a/src/emu/machine/jvsdev.h b/src/emu/machine/jvsdev.h
index fcbb8c08926..97382ea1655 100644
--- a/src/emu/machine/jvsdev.h
+++ b/src/emu/machine/jvsdev.h
@@ -23,7 +23,7 @@ public:
protected:
UINT32 jvs_outputs;
- void handle_output(const char *tag, UINT8 id, UINT8 val);
+ void handle_output(ioport_port *port, UINT8 id, UINT8 val);
// device-level overrides
virtual void device_start();
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c
index b52b3b38f4d..967dac974e7 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -249,7 +249,7 @@ void pioneer_pr8210_device::control_w(UINT8 data)
// log the deltas for debugging
if (LOG_SERIAL)
{
- int usecdiff = (int)(delta.attoseconds / ATTOSECONDS_IN_USEC(1));
+ int usecdiff = (int)(delta.attoseconds() / ATTOSECONDS_IN_USEC(1));
printf("bitdelta = %5d (%d) - accum = %04X\n", usecdiff, longpulse, m_accumulator);
}
diff --git a/src/emu/machine/netlist.c b/src/emu/machine/netlist.c
index 79d3b4e6943..cdbfe89d91b 100644
--- a/src/emu/machine/netlist.c
+++ b/src/emu/machine/netlist.c
@@ -175,11 +175,11 @@ void netlist_mame_stream_input_t::custom_netlist_additions(netlist::setup_t &set
if (snd_in == NULL)
snd_in = dynamic_cast<NETLIB_NAME(sound_in) *>(setup.register_dev("NETDEV_SOUND_IN", "STREAM_INPUT"));
- pstring sparam = pformat("STREAM_INPUT.CHAN%1")(m_channel);
+ pstring sparam = pfmt("STREAM_INPUT.CHAN{1}")(m_channel);
setup.register_param(sparam, m_param_name);
- sparam = pformat("STREAM_INPUT.MULT%1")(m_channel);
+ sparam = pfmt("STREAM_INPUT.MULT{1}")(m_channel);
setup.register_param(sparam, m_mult);
- sparam = pformat("STREAM_INPUT.OFFSET%1")(m_channel);
+ sparam = pfmt("STREAM_INPUT.OFFSET{1}")(m_channel);
setup.register_param(sparam, m_offset);
}
@@ -210,7 +210,7 @@ void netlist_mame_stream_output_t::device_start()
void netlist_mame_stream_output_t::custom_netlist_additions(netlist::setup_t &setup)
{
//NETLIB_NAME(sound_out) *snd_out;
- pstring sname = pformat("STREAM_OUT_%1")(m_channel);
+ pstring sname = pfmt("STREAM_OUT_{1}")(m_channel);
//snd_out = dynamic_cast<NETLIB_NAME(sound_out) *>(setup.register_dev("nld_sound_out", sname));
setup.register_dev("NETDEV_SOUND_OUT", sname);
@@ -226,19 +226,28 @@ void netlist_mame_stream_output_t::custom_netlist_additions(netlist::setup_t &se
// netlist_mame_t
// ----------------------------------------------------------------------------------------
-void netlist_mame_t::verror(const loglevel_e level, const char *format, va_list ap) const
+void netlist_mame_t::vlog(const plog_level &l, const pstring &ls) const
{
- pstring errstr = pstring(format).vprintf(ap);
+ pstring errstr = ls;
- switch (level)
+ switch (l)
{
- case NL_WARNING:
+ case DEBUG:
+ logerror("netlist DEBUG: %s\n", errstr.cstr());
+ break;
+ case INFO:
+ logerror("netlist INFO: %s\n", errstr.cstr());
+ break;
+ case VERBOSE:
+ logerror("netlist VERBOSE: %s\n", errstr.cstr());
+ break;
+ case WARNING:
logerror("netlist WARNING: %s\n", errstr.cstr());
break;
- case NL_LOG:
- logerror("netlist LOG: %s\n", errstr.cstr());
+ case ERROR:
+ logerror("netlist ERROR: %s\n", errstr.cstr());
break;
- case NL_ERROR:
+ case FATAL:
emu_fatalerror error("netlist ERROR: %s\n", errstr.cstr());
throw error;
}
@@ -255,8 +264,6 @@ ADDRESS_MAP_END
netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, NETLIST_CORE, "Netlist core device", tag, owner, clock, "netlist_core", __FILE__),
m_icount(0),
- m_div(0),
- m_rem(0),
m_old(netlist::netlist_time::zero),
m_netlist(NULL),
m_setup(NULL),
@@ -267,8 +274,6 @@ netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, cons
netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file)
: device_t(mconfig, type, name, tag, owner, clock, shortname, file),
m_icount(0),
- m_div(0),
- m_rem(0),
m_old(netlist::netlist_time::zero),
m_netlist(NULL),
m_setup(NULL),
@@ -326,18 +331,14 @@ void netlist_mame_device_t::device_start()
save_state();
m_old = netlist::netlist_time::zero;
- m_rem = 0;
+ m_rem = netlist::netlist_time::zero;
}
void netlist_mame_device_t::device_clock_changed()
{
- //printf("device_clock_changed\n");
- m_div = netlist::netlist_time::from_hz(clock()).as_raw();
- //m_rem = 0;
- //NL_VERBOSE_OUT(("Setting clock %" I64FMT "d and divisor %d\n", clock(), m_div));
- NL_VERBOSE_OUT(("Setting clock %d and divisor %d\n", clock(), m_div));
- //printf("Setting clock %d and divisor %d\n", clock(), m_div);
+ m_div = netlist::netlist_time::from_hz(clock());
+ netlist().log().debug("Setting clock {1} and divisor {2}\n", clock(), m_div.as_double());
}
@@ -345,7 +346,7 @@ void netlist_mame_device_t::device_reset()
{
LOG_DEV_CALLS(("device_reset\n"));
m_old = netlist::netlist_time::zero;
- m_rem = 0;
+ m_rem = netlist::netlist_time::zero;
netlist().do_reset();
}
@@ -383,9 +384,12 @@ void netlist_mame_device_t::device_timer(emu_timer &timer, device_timer_id id, i
ATTR_HOT ATTR_ALIGN void netlist_mame_device_t::update_time_x()
{
- const netlist::netlist_time delta = netlist().time() - m_old + netlist::netlist_time::from_raw(m_rem);
- m_old = netlist().time();
- m_icount -= divu_64x32_rem(delta.as_raw(), m_div, &m_rem);
+ const netlist::netlist_time newt = netlist().time();
+ const netlist::netlist_time delta = newt - m_old + m_rem;
+ const UINT64 d = delta / m_div;
+ m_old = newt;
+ m_rem = delta - (m_div * d);
+ m_icount -= d;
}
ATTR_HOT ATTR_ALIGN void netlist_mame_device_t::check_mame_abort_slice()
@@ -399,7 +403,7 @@ ATTR_COLD void netlist_mame_device_t::save_state()
for (int i=0; i< netlist().save_list().size(); i++)
{
pstate_entry_t *s = netlist().save_list()[i];
- NL_VERBOSE_OUT(("saving state for %s\n", s->m_name.cstr()));
+ netlist().log().debug("saving state for {1}\n", s->m_name.cstr());
switch (s->m_dt)
{
case DT_DOUBLE:
@@ -414,6 +418,12 @@ ATTR_COLD void netlist_mame_device_t::save_state()
if (td != NULL) save_pointer(td, s->m_name.cstr(), s->m_count);
}
break;
+#if (PHAS_INT128)
+ case DT_INT128:
+ // FIXME: we are cheating here
+ save_pointer((char *) s->m_ptr, s->m_name.cstr(), s->m_count * sizeof(INT128));
+ break;
+#endif
case DT_INT64:
save_pointer((INT64 *) s->m_ptr, s->m_name.cstr(), s->m_count);
break;
@@ -433,7 +443,7 @@ ATTR_COLD void netlist_mame_device_t::save_state()
break;
case NOT_SUPPORTED:
default:
- netlist().error("found unsupported save element %s\n", s->m_name.cstr());
+ netlist().log().fatal("found unsupported save element %s\n", s->m_name);
break;
}
}
@@ -529,13 +539,13 @@ ATTR_HOT void netlist_mame_cpu_device_t::execute_run()
m_genPC++;
m_genPC &= 255;
debugger_instruction_hook(this, m_genPC);
- netlist().process_queue(netlist::netlist_time::from_raw(m_div));
+ netlist().process_queue(m_div);
update_time_x();
}
}
else
{
- netlist().process_queue(netlist::netlist_time::from_raw(m_div) * m_icount);
+ netlist().process_queue(m_div * m_icount);
update_time_x();
}
}
@@ -570,7 +580,7 @@ void netlist_mame_sound_device_t::device_start()
{
int chan = outdevs[i]->m_channel.Value();
- netlist().log("Output %d on channel %d", i, chan);
+ netlist().log().verbose("Output %d on channel %d", i, chan);
if (chan < 0 || chan >= MAX_OUT || chan >= outdevs.size())
fatalerror("illegal channel number");
@@ -623,9 +633,9 @@ void netlist_mame_sound_device_t::sound_stream_update(sound_stream &stream, stre
netlist::netlist_time cur = netlist().time();
- netlist().process_queue(netlist::netlist_time::from_raw(m_div) * samples);
+ netlist().process_queue(m_div * samples);
- cur += (netlist::netlist_time::from_raw(m_div) * samples);
+ cur += (m_div * samples);
for (int i=0; i < m_num_outputs; i++)
{
diff --git a/src/emu/machine/netlist.h b/src/emu/machine/netlist.h
index 73ad52b0ddd..32b19070d4e 100644
--- a/src/emu/machine/netlist.h
+++ b/src/emu/machine/netlist.h
@@ -97,7 +97,7 @@ public:
protected:
- void verror(const loglevel_e level, const char *format, va_list ap) const;
+ void vlog(const plog_level &l, const pstring &ls) const;
private:
netlist_mame_device_t &m_parent;
@@ -143,13 +143,13 @@ protected:
//virtual void device_debug_setup();
virtual void device_clock_changed();
- UINT32 m_div;
+ netlist::netlist_time m_div;
private:
void save_state();
/* timing support here - so sound can hijack it ... */
- UINT32 m_rem;
+ netlist::netlist_time m_rem;
netlist::netlist_time m_old;
netlist_mame_t * m_netlist;
@@ -583,7 +583,7 @@ public:
{
int pos = (upto - m_last_buffer) / m_sample;
if (pos >= BUFSIZE)
- netlist().error("sound %s: exceeded BUFSIZE\n", name().cstr());
+ netlist().log().fatal("sound {1}: exceeded BUFSIZE\n", name().cstr());
while (m_last_pos < pos )
{
m_buffer[m_last_pos++] = (stream_sample_t) m_cur;
@@ -648,9 +648,9 @@ public:
for (int i = 0; i < MAX_INPUT_CHANNELS; i++)
{
- register_param(pformat("CHAN%1")(i), m_param_name[i], "");
- register_param(pformat("MULT%1")(i), m_param_mult[i], 1.0);
- register_param(pformat("OFFSET%1")(i), m_param_offset[i], 0.0);
+ register_param(pfmt("CHAN{1}")(i), m_param_name[i], "");
+ register_param(pfmt("MULT{1}")(i), m_param_mult[i], 1.0);
+ register_param(pfmt("OFFSET{1}")(i), m_param_offset[i], 0.0);
}
m_num_channel = 0;
}
@@ -670,7 +670,7 @@ public:
if (m_param_name[i].Value() != "")
{
if (i != m_num_channel)
- netlist().error("sound input numbering has to be sequential!");
+ netlist().log().fatal("sound input numbering has to be sequential!");
m_num_channel++;
m_param[i] = dynamic_cast<netlist::param_double_t *>(setup().find_param(m_param_name[i].Value(), true));
}
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index 006992f7073..1ad506686e0 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -113,7 +113,7 @@ void pit8253_device::device_start()
pit8253_timer *timer = get_timer(timerno);
/* initialize timer */
- timer->updatetimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pit8253_device::update_timer_cb),this));
+ timer->updatetimer = timer_alloc(timerno);
timer->updatetimer->adjust(attotime::never, timerno);
/* set up state save values */
@@ -513,7 +513,7 @@ void pit8253_device::simulate2(pit8253_timer *timer, INT64 elapsed_cycles)
if (elapsed_cycles > 0 && timer->phase == 3)
{
/* Reload counter, output goes high */
- --elapsed_cycles;
+ elapsed_cycles -= adjusted_value;
timer->phase = 2;
load_counter_value(timer);
adjusted_value = adjusted_count(bcd, timer->value);
@@ -741,16 +741,6 @@ void pit8253_device::update(pit8253_timer *timer)
}
-TIMER_CALLBACK_MEMBER( pit8253_device::update_timer_cb )
-{
- pit8253_timer *timer = get_timer(param);
-
- LOG2(("pit8253: output_changed(): timer %d\n", param));
-
- update(timer);
-}
-
-
/* We recycle bit 0 of timer->value to hold the phase in mode 3 when count is
odd. Since read commands in mode 3 always return even numbers, we need to
mask this bit off. */
@@ -941,6 +931,10 @@ void pit8254_device::readback_command(UINT8 data)
readback(get_timer(2), read_command);
}
+void pit8253_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+{
+ update(get_timer(id));
+}
WRITE8_MEMBER( pit8253_device::write )
{
diff --git a/src/emu/machine/pit8253.h b/src/emu/machine/pit8253.h
index a5ced426044..67e3f86b23b 100644
--- a/src/emu/machine/pit8253.h
+++ b/src/emu/machine/pit8253.h
@@ -93,6 +93,7 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
// internal state
struct pit8253_timer
@@ -141,8 +142,6 @@ private:
pit8253_timer m_timers[PIT8253_MAX_TIMER];
- TIMER_CALLBACK_MEMBER(update_timer_cb);
-
inline UINT32 adjusted_count(int bcd, UINT16 val);
void decrease_counter_value(pit8253_timer *timer, INT64 cycles);
void load_counter_value(pit8253_timer *timer);
diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c
index 26a4d2fea70..955a10c463b 100644
--- a/src/emu/machine/tmp68301.c
+++ b/src/emu/machine/tmp68301.c
@@ -82,17 +82,20 @@ READ16_MEMBER(tmp68301_device::pdir_r)
WRITE16_MEMBER(tmp68301_device::pdir_w)
{
- m_pdir = data;
+ COMBINE_DATA(&m_pdir);
}
READ16_MEMBER(tmp68301_device::pdr_r)
{
- return m_in_parallel_cb(0) & ~m_pdir;
+ return (m_in_parallel_cb(0) & ~m_pdir) | (m_pdr & m_pdir);
}
WRITE16_MEMBER(tmp68301_device::pdr_w)
{
- m_out_parallel_cb(0, data & m_pdir, mem_mask);
+ UINT16 old = m_pdr;
+ COMBINE_DATA(&m_pdr);
+ m_pdr = (old & ~m_pdir) | (m_pdr & m_pdir);
+ m_out_parallel_cb(0, m_pdr, mem_mask);
}
@@ -105,6 +108,7 @@ tmp68301_device::tmp68301_device(const machine_config &mconfig, const char *tag,
m_iisr(0),
m_scr(0),
m_pdir(0),
+ m_pdr(0),
m_space_config("regs", ENDIANNESS_LITTLE, 16, 10, 0, NULL, *ADDRESS_MAP_NAME(tmp68301_regs))
{
memset(m_regs, 0, sizeof(m_regs));
@@ -133,6 +137,7 @@ void tmp68301_device::device_start()
save_item(NAME(m_iisr));
save_item(NAME(m_scr));
save_item(NAME(m_pdir));
+ save_item(NAME(m_pdr));
}
//-------------------------------------------------
diff --git a/src/emu/machine/tmp68301.h b/src/emu/machine/tmp68301.h
index d7a49a434b7..b96296d31f2 100644
--- a/src/emu/machine/tmp68301.h
+++ b/src/emu/machine/tmp68301.h
@@ -78,6 +78,7 @@ private:
UINT16 m_iisr;
UINT16 m_scr;
UINT16 m_pdir;
+ UINT16 m_pdr;
inline UINT16 read_word(offs_t address);
inline void write_word(offs_t address, UINT16 data);
diff --git a/src/emu/machine/tms6100.c b/src/emu/machine/tms6100.c
index 9cedc12c10a..6c5a58673dd 100644
--- a/src/emu/machine/tms6100.c
+++ b/src/emu/machine/tms6100.c
@@ -88,6 +88,11 @@
#define TMS6100_READ_PENDING 0x01
#define TMS6100_NEXT_READ_IS_DUMMY 0x02
+/* Variants */
+
+#define TMS6110_IS_TMS6100 (1)
+#define TMS6110_IS_M58819 (2)
+
const device_type TMS6100 = &device_creator<tms6100_device>;
@@ -136,15 +141,15 @@ void tms6100_device::device_start()
save_item(NAME(m_m0));
save_item(NAME(m_m1));
save_item(NAME(m_state));
- //save_item(NAME(m_variant));
- //tms6100_set_variant(tms, TMS6110_IS_TMS6100);
+ save_item(NAME(m_variant));
+ set_variant(TMS6110_IS_TMS6100);
}
void m58819_device::device_start()
{
tms6100_device::device_start();
- //tms6100_set_variant(tms, TMS6110_IS_M58819);
+ set_variant(TMS6110_IS_M58819);
}
//-------------------------------------------------
@@ -165,6 +170,11 @@ void tms6100_device::device_reset()
m_data = 0;
}
+void tms6100_device::set_variant(int variant)
+{
+ m_variant = variant;
+}
+
WRITE_LINE_MEMBER(tms6100_device::tms6100_m0_w)
{
if (state != m_m0)
@@ -199,15 +209,14 @@ WRITE_LINE_MEMBER(tms6100_device::tms6100_romclock_w)
else
{
/* read bit at address */
- /* if (m_variant == TMS6110_IS_M58819)
+ if (m_variant == TMS6110_IS_M58819)
{
m_data = (m_rom[m_address >> 3] >> (7-(m_address & 0x07))) & 1;
}
else // m_variant == (TMS6110_IS_TMS6100 || TMS6110_IS_TMS6125)
{
- */
- m_data = (m_rom[m_address >> 3] >> (m_address & 0x07)) & 1;
- /* } */
+ m_data = (m_rom[m_address >> 3] >> (m_address & 0x07)) & 1;
+ }
m_address++;
}
m_state &= ~TMS6100_READ_PENDING;
diff --git a/src/emu/machine/tms6100.h b/src/emu/machine/tms6100.h
index 2838adf63cf..4aed02a846b 100644
--- a/src/emu/machine/tms6100.h
+++ b/src/emu/machine/tms6100.h
@@ -25,6 +25,7 @@ protected:
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
+ void set_variant(int variant);
private:
// internal state
required_region_ptr<UINT8> m_rom;
@@ -37,7 +38,7 @@ private:
UINT8 m_tms_clock;
UINT8 m_data;
UINT8 m_state;
- //UINT8 m_variant;
+ UINT8 m_variant;
};
diff --git a/src/emu/machine/upd765.c b/src/emu/machine/upd765.c
index 5a40d63aad3..e1ce769880e 100644
--- a/src/emu/machine/upd765.c
+++ b/src/emu/machine/upd765.c
@@ -2187,12 +2187,12 @@ std::string upd765_family_device::tts(attotime t)
{
char buf[256];
const char *sign = "";
- if(t.seconds < 0) {
+ if(t.seconds() < 0) {
t = attotime::zero-t;
sign = "-";
}
- int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
- sprintf(buf, "%s%04d.%03d,%03d,%03d", sign, int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
+ int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ sprintf(buf, "%s%04d.%03d,%03d,%03d", sign, int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
return buf;
}
diff --git a/src/emu/machine/wd_fdc.c b/src/emu/machine/wd_fdc.c
index 06d6df35f92..8b27486c79a 100644
--- a/src/emu/machine/wd_fdc.c
+++ b/src/emu/machine/wd_fdc.c
@@ -203,8 +203,8 @@ void wd_fdc_t::dden_w(bool _dden)
std::string wd_fdc_t::tts(const attotime &t)
{
char buf[256];
- int nsec = t.attoseconds / ATTOSECONDS_PER_NANOSECOND;
- sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
+ int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ sprintf(buf, "%4d.%03d,%03d,%03d", int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000);
return buf;
}
diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c
index aee057c2c1a..8ab638a5e8d 100644
--- a/src/emu/machine/z80ctc.c
+++ b/src/emu/machine/z80ctc.c
@@ -364,7 +364,7 @@ UINT8 z80ctc_device::ctc_channel::read()
{
attotime period = ((m_mode & PRESCALER) == PRESCALER_16) ? m_device->m_period16 : m_device->m_period256;
- VPRINTF(("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds)));
+ VPRINTF(("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds())));
if (m_timer != NULL)
return ((int)(m_timer->remaining().as_double() / period.as_double()) + 1) & 0xff;
diff --git a/src/emu/netlist/analog/nld_fourterm.c b/src/emu/netlist/analog/nld_fourterm.c
index b217ff21f3a..d7fd828e1f3 100644
--- a/src/emu/netlist/analog/nld_fourterm.c
+++ b/src/emu/netlist/analog/nld_fourterm.c
@@ -52,7 +52,6 @@ NETLIB_RESET(VCCS)
const nl_double m_mult = m_G.Value() * m_gfac; // 1.0 ==> 1V ==> 1A
const nl_double GI = NL_FCONST(1.0) / m_RI.Value();
- //printf("VCCS %s RI %f\n", name().cstr(), m_RI.Value());
m_IP.set(GI);
m_IN.set(GI);
@@ -127,8 +126,6 @@ NETLIB_UPDATE_TERMINALS(LVCCS)
m_ON.set(-beta, NL_FCONST(0.0), -I);
m_ON1.set(beta, NL_FCONST(0.0));
- //printf("vi %f beta %f I %f\n", vi, beta, I);
-
}
// ----------------------------------------------------------------------------------------
diff --git a/src/emu/netlist/analog/nld_opamps.c b/src/emu/netlist/analog/nld_opamps.c
index d0b9e5da023..38a32b0d211 100644
--- a/src/emu/netlist/analog/nld_opamps.c
+++ b/src/emu/netlist/analog/nld_opamps.c
@@ -103,7 +103,7 @@ NETLIB_START(OPAMP)
connect_late("EBUF.IP", "RP1.1");
}
else
- netlist().error("Unknown opamp type: %d", m_type);
+ netlist().log().fatal("Unknown opamp type: {1}", m_type);
}
/* .model abc OPAMP(VLH=2.0 VLL=0.2 FPF=5 UGF=10k SLEW=0.6u RI=1000k RO=50 DAB=0.002)
@@ -150,7 +150,6 @@ NETLIB_RESET(OPAMP)
double RP = 0.5 / 3.1459 / CP / m_model.model_value("FPF");
double G = m_model.model_value("UGF") / m_model.model_value("FPF") / RP;
- //printf("CP=%e RP=%f G=%f\n", CP, RP, G);
m_CP.m_C.setTo(CP);
m_RP.set_R(RP);
m_G1.m_G.setTo(G);
diff --git a/src/emu/netlist/analog/nld_twoterm.c b/src/emu/netlist/analog/nld_twoterm.c
index 88f1cfaf257..7c54910612f 100644
--- a/src/emu/netlist/analog/nld_twoterm.c
+++ b/src/emu/netlist/analog/nld_twoterm.c
@@ -169,7 +169,7 @@ NETLIB_UPDATE_PARAM(POT)
m_R2.update_dev();
m_R1.set_R(std::max(m_R.Value() * v, netlist().gmin()));
- m_R2.set_R(std::max(m_R.Value() * (1.0 - v), netlist().gmin()));
+ m_R2.set_R(std::max(m_R.Value() * (NL_FCONST(1.0) - v), netlist().gmin()));
}
@@ -333,7 +333,6 @@ NETLIB_START(CS)
NETLIB_RESET(CS)
{
NETLIB_NAME(twoterm)::reset();
- printf("m_I %f\n", m_I.Value());
this->set(0.0, 0.0, m_I);
}
diff --git a/src/emu/netlist/analog/nld_twoterm.h b/src/emu/netlist/analog/nld_twoterm.h
index c38242cd90f..27da8ba258e 100644
--- a/src/emu/netlist/analog/nld_twoterm.h
+++ b/src/emu/netlist/analog/nld_twoterm.h
@@ -257,7 +257,6 @@ public:
m_Id = m_Is * (eVDVt - NL_FCONST(1.0));
m_G = m_Is * m_VtInv * eVDVt + m_gmin;
#endif
- //printf("%p nVd %f m_Vd %f Vcrit %f\n", this, nVd, m_Vd, m_Vcrit);
}
ATTR_COLD void set_param(const nl_double Is, const nl_double n, nl_double gmin);
diff --git a/src/emu/netlist/build/makefile b/src/emu/netlist/build/makefile
new file mode 100644
index 00000000000..162b21a0ce6
--- /dev/null
+++ b/src/emu/netlist/build/makefile
@@ -0,0 +1,166 @@
+###########################################################################
+#
+# makefile
+#
+# Core makefile for building MAME and derivatives
+#
+# Copyright (c) Nicola Salmoria and the MAME Team.
+# Visit http://mamedev.org for licensing and usage restrictions.
+#
+###########################################################################
+
+OBJ = obj
+SRC = ..
+
+#-fuse-ld=gold -Wpedantic -march=native -march=native
+
+# LTO = -flto=4 -fuse-linker-plugin -flto-partition=balanced -Wodr
+
+CDEFS = -DPSTANDALONE=1 -DPTR64=1
+#-Werror
+CFLAGS = $(LTO) -g -O3 -std=c++98 -march=native -msse4.2 -Wall -Wpedantic -Wsign-compare -Wextra -Wno-long-long -Wno-unused-parameter -Wno-unused-result -Wno-variadic-macros -I..
+LDFLAGS = $(LTO) -g -O3 -std=c++98
+#CFLAGS = $(LTO) -g -O3 -std=c++11 -Wall -Wpedantic -Wsign-compare -Wextra -Isrc
+#LDFLAGS = $(LTO) -g -O3 -std=c++11
+
+CC = @g++-5
+LD = @g++-5
+MD = @mkdir
+RM = @rm
+
+TARGETS = nltool nlwav
+
+NLOBJ = $(OBJ)
+POBJ = $(OBJ)/plib
+
+OBJDIRS = $(OBJ) \
+ $(OBJ)/analog \
+ $(OBJ)/solver \
+ $(OBJ)/devices \
+ $(OBJ)/plib \
+ $(OBJ)/devices \
+ $(OBJ)/macro \
+ $(OBJ)/tools \
+ $(OBJ)/prg \
+
+
+OBJS = $(POBJS) $(NLOBJS)
+
+POBJS := \
+ $(POBJ)/pstring.o \
+ $(POBJ)/palloc.o \
+ $(POBJ)/pparser.o \
+ $(POBJ)/pstate.o \
+ $(POBJ)/pstream.o \
+
+NLOBJS := \
+ $(NLOBJ)/nl_base.o \
+ $(NLOBJ)/nl_parser.o \
+ $(NLOBJ)/nl_setup.o \
+ $(NLOBJ)/nl_factory.o \
+ $(NLOBJ)/analog/nld_bjt.o \
+ $(NLOBJ)/analog/nld_fourterm.o \
+ $(NLOBJ)/analog/nld_switches.o \
+ $(NLOBJ)/analog/nld_twoterm.o \
+ $(NLOBJ)/analog/nld_opamps.o \
+ $(NLOBJ)/devices/nld_4020.o \
+ $(NLOBJ)/devices/nld_4066.o \
+ $(NLOBJ)/devices/nld_7400.o \
+ $(NLOBJ)/devices/nld_7402.o \
+ $(NLOBJ)/devices/nld_7404.o \
+ $(NLOBJ)/devices/nld_7408.o \
+ $(NLOBJ)/devices/nld_7410.o \
+ $(NLOBJ)/devices/nld_7411.o \
+ $(NLOBJ)/devices/nld_7420.o \
+ $(NLOBJ)/devices/nld_7425.o \
+ $(NLOBJ)/devices/nld_7427.o \
+ $(NLOBJ)/devices/nld_7430.o \
+ $(NLOBJ)/devices/nld_7432.o \
+ $(NLOBJ)/devices/nld_7437.o \
+ $(NLOBJ)/devices/nld_7448.o \
+ $(NLOBJ)/devices/nld_7450.o \
+ $(NLOBJ)/devices/nld_7474.o \
+ $(NLOBJ)/devices/nld_7483.o \
+ $(NLOBJ)/devices/nld_7486.o \
+ $(NLOBJ)/devices/nld_7490.o \
+ $(NLOBJ)/devices/nld_7493.o \
+ $(NLOBJ)/devices/nld_74107.o \
+ $(NLOBJ)/devices/nld_74123.o \
+ $(NLOBJ)/devices/nld_74153.o \
+ $(NLOBJ)/devices/nld_74175.o \
+ $(NLOBJ)/devices/nld_74192.o \
+ $(NLOBJ)/devices/nld_74193.o \
+ $(NLOBJ)/devices/nld_74279.o \
+ $(NLOBJ)/devices/nld_74ls629.o \
+ $(NLOBJ)/devices/nld_82S16.o \
+ $(NLOBJ)/devices/nld_9310.o \
+ $(NLOBJ)/devices/nld_9312.o \
+ $(NLOBJ)/devices/nld_9316.o \
+ $(NLOBJ)/devices/nld_mm5837.o \
+ $(NLOBJ)/devices/nld_ne555.o \
+ $(NLOBJ)/devices/nld_r2r_dac.o \
+ $(NLOBJ)/devices/nld_legacy.o \
+ $(NLOBJ)/devices/net_lib.o \
+ $(NLOBJ)/devices/nld_log.o \
+ $(NLOBJ)/devices/nld_system.o \
+ $(NLOBJ)/devices/nld_truthtable.o \
+ $(NLOBJ)/macro/nlm_cd4xxx.o \
+ $(NLOBJ)/macro/nlm_opamp.o \
+ $(NLOBJ)/macro/nlm_other.o \
+ $(NLOBJ)/macro/nlm_ttl74xx.o \
+ $(NLOBJ)/solver/nld_solver.o \
+ $(NLOBJ)/tools/nl_convert.o \
+
+all: maketree $(TARGETS)
+
+#-------------------------------------------------
+# clean
+#-------------------------------------------------
+
+clean:
+ $(RM) -rf $(OBJS) $(TARGETS)
+
+#-------------------------------------------------
+# nltool
+#-------------------------------------------------
+
+nltool: $(OBJ)/prg/nltool.o $(OBJS)
+ @echo Linking $@...
+ $(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
+
+nlwav: $(OBJ)/prg/nlwav.o $(OBJS)
+ @echo Linking $@...
+ $(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
+
+#-------------------------------------------------
+# directories
+#-------------------------------------------------
+
+$(sort $(OBJDIRS)):
+ $(MD) -p $@
+
+maketree: $(sort $(OBJDIRS))
+
+
+#-------------------------------------------------
+# generic rules
+#-------------------------------------------------
+
+$(OBJ)/%.o: $(SRC)/%.c
+ @echo Compiling $<...
+ $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
+
+$(OBJ)/%.pp: $(SRC)/%.c | $(OSPREBUILD)
+ @echo Compiling $<...
+ $(CC) $(CDEFS) $(CFLAGS) -E $< -o $@
+
+$(OBJ)/%.s: $(SRC)/%.c | $(OSPREBUILD)
+ @echo Compiling $<...
+ $(CC) $(CDEFS) $(CFLAGS) -S $< -o $@
+
+$(OBJ)/%.a:
+ @echo Archiving $@...
+ $(RM) $@
+ $(AR) $(ARFLAGS) $@ $^
+
+
diff --git a/src/emu/netlist/devices/nld_74123.c b/src/emu/netlist/devices/nld_74123.c
index 59a9ed16ce4..ccd8eba012e 100644
--- a/src/emu/netlist/devices/nld_74123.c
+++ b/src/emu/netlist/devices/nld_74123.c
@@ -77,7 +77,6 @@ NETLIB_UPDATE(74123)
//res = res | INPLOGIC(m_A) | (INPLOGIC(m_B) ^ 1);
t_AB_to_Q = NLTIME_FROM_NS(300);
t_C_to_Q = NLTIME_FROM_NS(250);
- //printf("m_trig %d res %d\n", m_trig, res);
}
if (res)
diff --git a/src/emu/netlist/devices/nld_74ls629.c b/src/emu/netlist/devices/nld_74ls629.c
index ce8a0dd3b79..a659fef032b 100644
--- a/src/emu/netlist/devices/nld_74ls629.c
+++ b/src/emu/netlist/devices/nld_74ls629.c
@@ -150,7 +150,7 @@ NETLIB_UPDATE(SN74LS629)
m_clock.m_inc = netlist_time::from_double(0.5 / (double) freq);
//m_clock.update();
- //NL_VERBOSE_OUT(("%s %f %f %f\n", name().cstr(), v_freq, v_rng, freq));
+ //NL_VERBOSE_OUT(("{1} {2} {3} {4}\n", name(), v_freq, v_rng, freq));
}
if (!m_clock.m_enableq && INPLOGIC(m_ENQ))
@@ -169,7 +169,6 @@ NETLIB_UPDATE(SN74LS629)
NETLIB_UPDATE_PARAM(SN74LS629)
{
- //printf("updating %s to %f\n", name().cstr(), m_R.Value());
update_dev();
}
diff --git a/src/emu/netlist/devices/nld_log.c b/src/emu/netlist/devices/nld_log.c
index ac8a3fdbbc6..db96664661b 100644
--- a/src/emu/netlist/devices/nld_log.c
+++ b/src/emu/netlist/devices/nld_log.c
@@ -16,7 +16,7 @@ NETLIB_START(log)
{
register_input("I", m_I);
- pstring filename = pformat("%1.log")(name());
+ pstring filename = pfmt("{1}.log")(name());
m_strm = palloc(pofilestream(filename));
}
@@ -27,8 +27,7 @@ NETLIB_RESET(log)
NETLIB_UPDATE(log)
{
/* use pstring::sprintf, it is a LOT faster */
-// m_strm->writeline(pstring::sprintf("%20.9e %e", netlist().time().as_double(), (nl_double) INPANALOG(m_I)).cstr());
- m_strm->writeline(pformat("%1 %2").e(netlist().time().as_double(),".9").e((nl_double) INPANALOG(m_I)).cstr());
+ m_strm->writeline(pfmt("{1} {2}").e(netlist().time().as_double(),".9").e((nl_double) INPANALOG(m_I)));
}
NETLIB_NAME(log)::~NETLIB_NAME(log)()
@@ -49,11 +48,11 @@ NETLIB_RESET(logD)
NETLIB_UPDATE(logD)
{
- m_strm->writeline(pstring::sprintf("%e %e", netlist().time().as_double(), (nl_double) (INPANALOG(m_I) - INPANALOG(m_I2))).cstr());
+ m_strm->writeline(pfmt("{1} {2}").e(netlist().time().as_double(),".9").e((nl_double) (INPANALOG(m_I) - INPANALOG(m_I2))));
}
// FIXME: Implement wav later, this must be clock triggered device where the input to be written
-// is on a subdevice ...
+// is on a subdevice ..
#if 0
NETLIB_START(wav)
{
diff --git a/src/emu/netlist/devices/nld_r2r_dac.c b/src/emu/netlist/devices/nld_r2r_dac.c
index c1f05837d4c..8ad59dfc9f8 100644
--- a/src/emu/netlist/devices/nld_r2r_dac.c
+++ b/src/emu/netlist/devices/nld_r2r_dac.c
@@ -32,8 +32,6 @@ NETLIB_UPDATE(r2r_dac)
NETLIB_UPDATE_PARAM(r2r_dac)
{
- //printf("updating %s to %f\n", name().cstr(), m_R.Value());
-
update_dev();
nl_double V = m_VIN.Value() / (nl_double) (1 << m_num.Value()) * (nl_double) m_val.Value();
diff --git a/src/emu/netlist/devices/nld_system.c b/src/emu/netlist/devices/nld_system.c
index 565b1c81dd1..628ec617cb1 100644
--- a/src/emu/netlist/devices/nld_system.c
+++ b/src/emu/netlist/devices/nld_system.c
@@ -299,7 +299,7 @@ NETLIB_START(function)
register_output("Q", m_Q);
for (int i=0; i < m_N; i++)
- register_input(pformat("A%1")(i), m_I[i]);
+ register_input(pfmt("A{1}")(i), m_I[i]);
pstring_list_t cmds(m_func.Value(), " ");
m_precompiled.clear();
@@ -329,7 +329,7 @@ NETLIB_START(function)
rc.m_cmd = PUSH_CONST;
rc.m_param = cmd.as_double(&err);
if (err)
- netlist().error("nld_function: unknown/misformatted token <%s> in <%s>", cmd.cstr(), m_func.Value().cstr());
+ netlist().log().fatal("nld_function: unknown/misformatted token <{1}> in <{2}>", cmd, m_func.Value());
}
m_precompiled.add(rc);
}
diff --git a/src/emu/netlist/devices/nld_system.h b/src/emu/netlist/devices/nld_system.h
index d3f1aff8935..2ea6fbed4d4 100644
--- a/src/emu/netlist/devices/nld_system.h
+++ b/src/emu/netlist/devices/nld_system.h
@@ -403,7 +403,6 @@ protected:
ATTR_HOT void update()
{
- //printf("%s: %f\n", name().cstr(), m_I.Q_Analog());
if (m_I.Q_Analog() > logic_family().m_high_thresh_V)
OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(1));
else if (m_I.Q_Analog() < logic_family().m_low_thresh_V)
@@ -478,7 +477,7 @@ public:
ATTR_COLD factory_lib_entry_t(setup_t &setup, const pstring &name, const pstring &classname,
const pstring &def_param)
- : base_factory_t(name, classname, def_param), m_setup(setup) { printf("devname %s\n", classname.cstr()); }
+ : base_factory_t(name, classname, def_param), m_setup(setup) { }
class dummy : public device_t
{
diff --git a/src/emu/netlist/devices/nld_truthtable.c b/src/emu/netlist/devices/nld_truthtable.c
index 1f6a9a19117..1f671b23108 100644
--- a/src/emu/netlist/devices/nld_truthtable.c
+++ b/src/emu/netlist/devices/nld_truthtable.c
@@ -135,7 +135,7 @@ void truthtable_desc_t::help(unsigned cur, pstring_list_t list,
{
// cutoff previous inputs and outputs for ignore
if (m_outs[nstate] != ~0U && m_outs[nstate] != val)
- fatalerror_e(pformat("Error in truthtable: State %1 already set, %2 != %3\n")
+ fatalerror_e(pfmt("Error in truthtable: State {1} already set, {2} != {3}\n")
.x(nstate,"04")(m_outs[nstate])(val) );
m_outs[nstate] = val;
for (unsigned j=0; j<m_NO; j++)
@@ -231,7 +231,7 @@ void truthtable_desc_t::setup(const pstring_list_t &truthtable, UINT32 disabled_
for (UINT32 i=0; i<m_size; i++)
{
if (m_outs[i] == ~0U)
- throw fatalerror_e(pformat("truthtable: found element not set %1\n").x(i) );
+ throw fatalerror_e(pfmt("truthtable: found element not set {1}\n").x(i) );
m_outs[i] |= ((ign[i] & ~disabled_ignore) << m_NO);
}
*m_initialized = true;
@@ -264,8 +264,8 @@ netlist_base_factory_truthtable_t *nl_tt_factory_create(const unsigned ni, const
ENTRY(9);
ENTRY(10);
default:
- pstring msg = pformat("unable to create truthtable<%1,%2,%3>")(ni)(no)(has_state);
- nl_assert_always(false, msg.cstr());
+ pstring msg = pfmt("unable to create truthtable<{1},{2},{3}>")(ni)(no)(has_state);
+ nl_assert_always(false, msg);
}
return NULL;
}
diff --git a/src/emu/netlist/devices/nld_truthtable.h b/src/emu/netlist/devices/nld_truthtable.h
index 1044d58e9b2..b5a90d8125c 100644
--- a/src/emu/netlist/devices/nld_truthtable.h
+++ b/src/emu/netlist/devices/nld_truthtable.h
@@ -157,7 +157,6 @@ public:
const int idx = inout.indexof(tmp);
if (idx>=0)
{
- //printf("connecting %s %d\n", out[i].cstr(), idx);
connect_late(m_Q[i], m_I[idx]);
// disable ignore for this inputs altogether.
// FIXME: This shouldn't be necessary
diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c
index e7ef9d66a64..31fc8983d6c 100644
--- a/src/emu/netlist/nl_base.c
+++ b/src/emu/netlist/nl_base.c
@@ -85,7 +85,7 @@ queue_t::queue_t(netlist_t &nl)
void queue_t::register_state(pstate_manager_t &manager, const pstring &module)
{
- NL_VERBOSE_OUT(("register_state\n"));
+ netlist().log().debug("register_state\n");
manager.save_item(m_qsize, this, module + "." + "qsize");
manager.save_item(&m_times[0], this, module + "." + "times", m_times.size());
manager.save_item(&(m_names[0].m_buf[0]), this, module + "." + "names", m_names.size() * sizeof(names_t));
@@ -93,9 +93,9 @@ void queue_t::register_state(pstate_manager_t &manager, const pstring &module)
void queue_t::on_pre_save()
{
- NL_VERBOSE_OUT(("on_pre_save\n"));
+ netlist().log().debug("on_pre_save\n");
m_qsize = this->count();
- NL_VERBOSE_OUT(("current time %f qsize %d\n", netlist().time().as_double(), m_qsize));
+ netlist().log().debug("current time {1} qsize {2}\n", netlist().time().as_double(), m_qsize);
for (int i = 0; i < m_qsize; i++ )
{
m_times[i] = this->listptr()[i].exec_time().as_raw();
@@ -111,12 +111,12 @@ void queue_t::on_pre_save()
void queue_t::on_post_load()
{
this->clear();
- NL_VERBOSE_OUT(("current time %f qsize %d\n", netlist().time().as_double(), m_qsize));
+ netlist().log().debug("current time {1} qsize {2}\n", netlist().time().as_double(), m_qsize);
for (int i = 0; i < m_qsize; i++ )
{
net_t *n = netlist().find_net(m_names[i].m_buf);
- //NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n));
- //NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double()));
+ //log().debug("Got {1} ==> {2}\n", qtemp[i].m_name, n));
+ //log().debug("schedule time {1} ({2})\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double()));
this->push(queue_t::entry_t(netlist_time::from_raw(m_times[i]), n));
}
}
@@ -145,7 +145,7 @@ ATTR_COLD void object_t::init_object(netlist_t &nl, const pstring &aname)
ATTR_COLD const pstring &object_t::name() const
{
if (m_name == "")
- netlist().error("object not initialized");
+ netlist().log().fatal("object not initialized");
return m_name;
}
@@ -180,7 +180,8 @@ netlist_t::netlist_t()
m_mainclock(NULL),
m_solver(NULL),
m_gnd(NULL),
- m_setup(NULL)
+ m_setup(NULL),
+ m_log(this)
{
}
@@ -217,7 +218,7 @@ ATTR_COLD void netlist_t::start()
{
/* find the main clock and solver ... */
- NL_VERBOSE_OUT(("Searching for mainclock and solver ...\n"));
+ log().debug("Searching for mainclock and solver ...\n");
m_mainclock = get_single_device<devices:: NETLIB_NAME(mainclock)>("mainclock");
m_solver = get_single_device<devices::NETLIB_NAME(solver)>("solver");
@@ -236,7 +237,7 @@ ATTR_COLD void netlist_t::start()
m_use_deactivate = (m_params->m_use_deactivate.Value() ? true : false);
- NL_VERBOSE_OUT(("Initializing devices ...\n"));
+ log().debug("Initializing devices ...\n");
for (std::size_t i = 0; i < m_devices.size(); i++)
{
device_t *dev = m_devices[i];
@@ -250,7 +251,7 @@ ATTR_COLD void netlist_t::stop()
{
/* find the main clock and solver ... */
- NL_VERBOSE_OUT(("Stopping all devices ...\n"));
+ log().debug("Stopping all devices ...\n");
// Step all devices once !
for (std::size_t i = 0; i < m_devices.size(); i++)
@@ -360,31 +361,6 @@ ATTR_HOT void netlist_t::process_queue(const netlist_time &delta)
}
}
-ATTR_COLD void netlist_t::error(const char *format, ...) const
-{
- va_list ap;
- va_start(ap, format);
- verror(NL_ERROR, format, ap);
- va_end(ap);
-}
-
-ATTR_COLD void netlist_t::warning(const char *format, ...) const
-{
- va_list ap;
- va_start(ap, format);
- verror(NL_WARNING, format, ap);
- va_end(ap);
-}
-
-ATTR_COLD void netlist_t::log(const char *format, ...) const
-{
- va_list ap;
- va_start(ap, format);
- verror(NL_LOG, format, ap);
- va_end(ap);
-}
-
-
// ----------------------------------------------------------------------------------------
// Default netlist elements ...
// ----------------------------------------------------------------------------------------
@@ -473,7 +449,7 @@ device_t::device_t(const family_t afamily)
device_t::~device_t()
{
- //NL_VERBOSE_OUT(("~net_device_t\n");
+ //log().debug("~net_device_t\n");
}
ATTR_COLD setup_t &device_t::setup()
@@ -563,7 +539,7 @@ ATTR_COLD void device_t::connect_late(const pstring &t1, const pstring &t2)
ATTR_COLD void device_t::connect_direct(core_terminal_t &t1, core_terminal_t &t2)
{
if (!setup().connect(t1, t2))
- netlist().error("Error connecting %s to %s\n", t1.name().cstr(), t2.name().cstr());
+ netlist().log().fatal("Error connecting {1} to {2}\n", t1.name(), t2.name());
}
@@ -670,8 +646,6 @@ ATTR_COLD void net_t::rebuild_list()
m_list_active.add(*m_core_terms[i]);
cnt++;
}
- //if (cnt != m_active)
- //printf("ARgh %s ==> %d != %d\n", name().cstr(), cnt, m_active);
m_active = cnt;
}
@@ -784,22 +758,22 @@ ATTR_COLD void net_t::move_connections(net_t *dest_net)
ATTR_COLD void net_t::merge_net(net_t *othernet)
{
- NL_VERBOSE_OUT(("merging nets ...\n"));
+ netlist().log().debug("merging nets ...\n");
if (othernet == NULL)
return; // Nothing to do
if (othernet == this)
{
- netlist().warning("Connecting %s to itself. This may be right, though\n", this->name().cstr());
+ netlist().log().warning("Connecting {1} to itself. This may be right, though\n", this->name());
return; // Nothing to do
}
if (this->isRailNet() && othernet->isRailNet())
- netlist().error("Trying to merge two rail nets: %s and %s\n", this->name().cstr(), othernet->name().cstr());
+ netlist().log().fatal("Trying to merge two rail nets: {1} and {2}\n", this->name(), othernet->name());
if (othernet->isRailNet())
{
- NL_VERBOSE_OUT(("othernet is railnet\n"));
+ netlist().log().debug("othernet is railnet\n");
othernet->merge_net(this);
}
else
@@ -870,15 +844,12 @@ ATTR_COLD void analog_net_t::process_net(list_t *groups, int &cur_group)
if (num_cons() == 0)
return;
/* add the net */
- //SOLVER_VERBOSE_OUT(("add %d - %s\n", cur_group, name().cstr()));
groups[cur_group].add(this);
for (std::size_t i = 0; i < m_core_terms.size(); i++)
{
core_terminal_t *p = m_core_terms[i];
- //SOLVER_VERBOSE_OUT(("terminal %s\n", p->name().cstr()));
if (p->isType(terminal_t::TERMINAL))
{
- //SOLVER_VERBOSE_OUT(("isterminal\n"));
terminal_t *pt = static_cast<terminal_t *>(p);
analog_net_t *other_net = &pt->m_otherterm->net().as_analog();
if (!other_net->already_processed(groups, cur_group))
diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h
index bfaaee9b44f..9e4b90df9ba 100644
--- a/src/emu/netlist/nl_base.h
+++ b/src/emu/netlist/nl_base.h
@@ -252,11 +252,11 @@ virtual logic_family_desc_t *default_logic_family()
//============================================================
#if defined(MAME_DEBUG)
-#define nl_assert(x) do { if (1) if (!(x)) throw fatalerror_e(pformat("assert: %1:%2: %3")(__FILE__)(__LINE__)(#x) ); } while (0)
+#define nl_assert(x) do { if (1) if (!(x)) throw fatalerror_e(pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); } while (0)
#else
-#define nl_assert(x) do { if (0) if (!(x)) throw fatalerror_e(pformat("assert: %1:%2: %3")(__FILE__)(__LINE__)(#x) ); } while (0)
+#define nl_assert(x) do { if (0) if (!(x)) throw fatalerror_e(pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); } while (0)
#endif
-#define nl_assert_always(x, msg) do { if (!(x)) throw fatalerror_e(pformat("Fatal error: %1\nCaused by assert: %2:%3: %4")(msg)(__FILE__)(__LINE__)(#x)); } while (0)
+#define nl_assert_always(x, msg) do { if (!(x)) throw fatalerror_e(pfmt("Fatal error: {1}\nCaused by assert: {2}:{3}: {4}")(msg)(__FILE__)(__LINE__)(#x)); } while (0)
// -----------------------------------------------------------------------------
@@ -444,7 +444,7 @@ namespace netlist
ATTR_COLD void init_object(core_device_t &dev, const pstring &aname);
- core_device_t &device() const { return *m_device; }
+ ATTR_HOT core_device_t &device() const { return *m_device; }
private:
core_device_t * m_device;
};
@@ -1019,7 +1019,6 @@ namespace netlist
ATTR_HOT netlist_sig_t INPLOGIC(const logic_input_t &inp) const
{
- //printf("%s %d\n", inp.name().cstr(), inp.state());
nl_assert(inp.state() != logic_t::STATE_INP_PASSIVE);
return inp.Q();
}
@@ -1152,7 +1151,7 @@ namespace netlist
// -----------------------------------------------------------------------------
- class netlist_t : public object_t, public pstate_manager_t
+ class netlist_t : public object_t, public pstate_manager_t, public plog_dispatch_intf
{
P_PREVENT_COPYING(netlist_t)
public:
@@ -1185,12 +1184,8 @@ namespace netlist
ATTR_COLD net_t *find_net(const pstring &name);
- ATTR_COLD void error(const char *format, ...) const ATTR_PRINTF(2,3);
- ATTR_COLD void warning(const char *format, ...) const ATTR_PRINTF(2,3);
- ATTR_COLD void log(const char *format, ...) const ATTR_PRINTF(2,3);
-
template<class _C>
- plist_t<_C *> get_device_list()
+ ATTR_COLD plist_t<_C *> get_device_list()
{
plist_t<_C *> tmp;
for (std::size_t i = 0; i < m_devices.size(); i++)
@@ -1203,7 +1198,7 @@ namespace netlist
}
template<class _C>
- _C *get_first_device()
+ ATTR_COLD _C *get_first_device()
{
for (std::size_t i = 0; i < m_devices.size(); i++)
{
@@ -1215,7 +1210,7 @@ namespace netlist
}
template<class _C>
- _C *get_single_device(const char *classname)
+ ATTR_COLD _C *get_single_device(const char *classname)
{
_C *ret = NULL;
for (std::size_t i = 0; i < m_devices.size(); i++)
@@ -1224,7 +1219,7 @@ namespace netlist
if (dev != NULL)
{
if (ret != NULL)
- this->error("more than one %s device found", classname);
+ this->log().fatal("more than one {1} device found", classname);
else
ret = dev;
}
@@ -1238,18 +1233,12 @@ namespace netlist
pnamedlist_t<core_device_t *> m_started_devices;
#endif
- protected:
+ ATTR_COLD const plog_base<NL_DEBUG> &log() const { return m_log; }
- enum loglevel_e
- {
- NL_ERROR,
- NL_WARNING,
- NL_LOG
- };
+ protected:
- // any derived netlist must override this ...
- virtual void verror(const loglevel_e level,
- const char *format, va_list ap) const = 0;
+ // any derived netlist must override vlog inherited from plog_base
+ // virtual void vlog(const plog_level &l, const pstring &ls) = 0;
/* from netlist_object */
virtual void reset();
@@ -1267,7 +1256,7 @@ namespace netlist
netlist_time m_time;
bool m_use_deactivate;
- queue_t m_queue;
+ queue_t m_queue;
devices::NETLIB_NAME(mainclock) * m_mainclock;
@@ -1277,6 +1266,7 @@ namespace netlist
devices::NETLIB_NAME(netlistparams) *m_params;
setup_t *m_setup;
+ plog_base<NL_DEBUG> m_log;
};
// -----------------------------------------------------------------------------
@@ -1325,7 +1315,6 @@ namespace netlist
{
if (EXPECTED(!is_state(STATE_INP_PASSIVE)))
{
- //printf("inactivate %s\n", name().cstr());
set_state(STATE_INP_PASSIVE);
net().as_logic().dec_active(*this);
}
diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h
index 5fceb40d3bf..41d2989bd2f 100644
--- a/src/emu/netlist/nl_config.h
+++ b/src/emu/netlist/nl_config.h
@@ -47,7 +47,7 @@
*/
// This will be autodetected
-//#define NL_PMF_TYPE 3
+// #define NL_PMF_TYPE 2
#define NL_PMF_TYPE_VIRTUAL 0
#define NL_PMF_TYPE_GNUC_PMF 1
@@ -66,18 +66,6 @@
#pragma GCC diagnostic ignored "-Wpmf-conversions"
#endif
-/*
- * This increases performance in circuits with a lot of gates
- * but is not guaranteed to be absolutely timing correct.
- *
- * Performance increase about 10% (breakout) to 20% (pong)
- *
- */
-
-
-// moved to parameter NETLIST.USE_DEACTIVATE
-// #define USE_DEACTIVE_DEVICE (0)
-
#define USE_TRUTHTABLE (1)
// The following adds about 10% performance ...
@@ -106,7 +94,6 @@
//============================================================
#define USE_MATRIX_GS (0)
-#define USE_PIVOT_SEARCH (0)
#define USE_GABS (1)
// savings are eaten up by effort
// FIXME: Convert into solver parameter
@@ -117,15 +104,9 @@
// DEBUGGING
//============================================================
-#define NL_VERBOSE (0)
+#define NL_DEBUG (false)
#define NL_KEEP_STATISTICS (0)
-#if (NL_VERBOSE)
- #define NL_VERBOSE_OUT(x) netlist().log x
-#else
- #define NL_VERBOSE_OUT(x) do { if(0) netlist().log x ; } while (0)
-#endif
-
//============================================================
// General Macros
//============================================================
diff --git a/src/emu/netlist/nl_factory.c b/src/emu/netlist/nl_factory.c
index edc55af9732..5f6762c4d05 100644
--- a/src/emu/netlist/nl_factory.c
+++ b/src/emu/netlist/nl_factory.c
@@ -68,7 +68,7 @@ device_t *factory_list_t::new_device_by_classname(const pstring &classname) cons
void factory_list_t::error(const pstring &s)
{
- m_setup.netlist().error("%s", s.cstr());
+ m_setup.log().fatal("{1}", s);
}
device_t *factory_list_t::new_device_by_name(const pstring &name)
@@ -83,7 +83,7 @@ base_factory_t * factory_list_t::factory_by_name(const pstring &name)
return (*this)[name];
else
{
- m_setup.netlist().error("Class %s not found!\n", name.cstr());
+ m_setup.log().fatal("Class {1} not found!\n", name);
return NULL; // appease code analysis
}
}
diff --git a/src/emu/netlist/nl_parser.c b/src/emu/netlist/nl_parser.c
index 2872648aa52..32609079ba6 100644
--- a/src/emu/netlist/nl_parser.c
+++ b/src/emu/netlist/nl_parser.c
@@ -16,19 +16,16 @@
#pragma GCC diagnostic ignored "-Wformat-extra-args"
#endif
-//#undef NL_VERBOSE_OUT
-//#define NL_VERBOSE_OUT(x) printf x
-
namespace netlist
{
// ----------------------------------------------------------------------------------------
// A netlist parser
// ----------------------------------------------------------------------------------------
-ATTR_COLD void parser_t::verror(pstring msg, int line_num, pstring line)
+ATTR_COLD void parser_t::verror(const pstring &msg, int line_num, const pstring &line)
{
- m_setup.netlist().error("line %d: error: %s\n\t\t%s\n", line_num,
- msg.cstr(), line.cstr());
+ m_setup.log().fatal("line {1}: error: {2}\n\t\t{3}\n", line_num,
+ msg, line);
//throw error;
}
@@ -77,7 +74,7 @@ bool parser_t::parse(const pstring nlname)
if (token.is_type(ENDOFFILE))
{
return false;
- //error("EOF while searching for <%s>", nlname.cstr());
+ //error("EOF while searching for <{1}>", nlname);
}
if (token.is(m_tok_NETLIST_END))
@@ -118,7 +115,7 @@ void parser_t::parse_netlist(ATTR_UNUSED const pstring &nlname)
return;
require_token(m_tok_param_left);
- NL_VERBOSE_OUT(("Parser: Device: %s\n", token.str().cstr()));
+ m_setup.log().debug("Parser: Device: {1}\n", token.str());
if (token.is(m_tok_ALIAS))
net_alias();
@@ -279,7 +276,7 @@ void parser_t::net_alias()
require_token(m_tok_param_right);
- NL_VERBOSE_OUT(("Parser: Alias: %s %s\n", alias.cstr(), out.cstr()));
+ m_setup.log().debug("Parser: Alias: {1} {2}\n", alias, out);
m_setup.register_alias(alias, out);
}
@@ -292,12 +289,12 @@ void parser_t::net_c()
{
pstring t1 = get_identifier();
m_setup.register_link(first , t1);
- NL_VERBOSE_OUT(("Parser: Connect: %s %s\n", first.cstr(), t1.cstr()));
+ m_setup.log().debug("Parser: Connect: {1} {2}\n", first, t1);
token_t n = get_token();
if (n.is(m_tok_param_right))
break;
if (!n.is(m_tok_comma))
- error("expected a comma, found <%s>", n.str().cstr());
+ error(pfmt("expected a comma, found <{1}>")(n.str()) );
}
}
@@ -317,15 +314,15 @@ void parser_t::dippins()
if (n.is(m_tok_param_right))
break;
if (!n.is(m_tok_comma))
- error("expected a comma, found <%s>", n.str().cstr());
+ error(pfmt("expected a comma, found <{1}>")(n.str()) );
}
if ((pins.size() % 2) == 1)
error("You must pass an equal number of pins to DIPPINS");
unsigned n = pins.size();
for (unsigned i = 0; i < n / 2; i++)
{
- m_setup.register_alias(pformat("%1")(i+1), pins[i*2]);
- m_setup.register_alias(pformat("%1")(n-i), pins[i*2 + 1]);
+ m_setup.register_alias(pfmt("{1}")(i+1), pins[i*2]);
+ m_setup.register_alias(pfmt("{1}")(n-i), pins[i*2 + 1]);
}
}
@@ -337,14 +334,14 @@ void parser_t::netdev_param()
token_t tok = get_token();
if (tok.is_type(STRING))
{
- NL_VERBOSE_OUT(("Parser: Param: %s %s\n", param.cstr(), tok.str().cstr()));
+ m_setup.log().debug("Parser: Param: {1} {2}\n", param, tok.str());
m_setup.register_param(param, tok.str());
}
else
{
nl_double val = eval_param(tok);
- NL_VERBOSE_OUT(("Parser: Param: %s %f\n", param.cstr(), val));
- m_setup.register_param(param, val);
+ m_setup.log().debug("Parser: Param: {1} {2}\n", param, val);
+ m_setup.register_param(param, val);
}
require_token(m_tok_param_right);
}
@@ -373,14 +370,14 @@ void parser_t::device(const pstring &dev_type)
dev = f->Create();
m_setup.register_dev(dev, devname);
- NL_VERBOSE_OUT(("Parser: IC: %s\n", devname.cstr()));
+ m_setup.log().debug("Parser: IC: {1}\n", devname);
cnt = 0;
while (cnt < def_params.size())
{
pstring paramfq = devname + "." + def_params[cnt];
- NL_VERBOSE_OUT(("Defparam: %s\n", paramfq.cstr()));
+ m_setup.log().debug("Defparam: {1}\n", paramfq);
require_token(m_tok_comma);
token_t tok = get_token();
if (tok.is_type(STRING))
@@ -407,7 +404,7 @@ void parser_t::device(const pstring &dev_type)
tok = get_token();
}
if (cnt != termlist.size())
- m_setup.netlist().error("netlist: input count mismatch for %s - expected %" SIZETFMT " found %" SIZETFMT "\n", devname.cstr(), SIZET_PRINTF(termlist.size()), SIZET_PRINTF(cnt));
+ m_setup.log().fatal("netlist: input count mismatch for {1} - expected {2} found {3}\n", devname, termlist.size(), cnt);
require_token(tok, m_tok_param_right);
}
}
@@ -428,7 +425,7 @@ nl_double parser_t::eval_param(const token_t tok)
nl_double ret;
pstring val;
- //printf("param %s\n", tok.m_token.cstr());
+ //printf("param {1}\n", tok.m_token);
for (i=1; i<6;i++)
if (tok.str().equals(macs[i]))
f = i;
@@ -460,7 +457,7 @@ nl_double parser_t::eval_param(const token_t tok)
ret = val.as_double(&e);
if (e)
- error("Error with parameter ...\n");
+ fatal("Error with parameter ...\n");
if (f>0)
require_token(m_tok_param_right);
return ret * facs[f];
diff --git a/src/emu/netlist/nl_parser.h b/src/emu/netlist/nl_parser.h
index 2a2086a0d72..73c6cf66837 100644
--- a/src/emu/netlist/nl_parser.h
+++ b/src/emu/netlist/nl_parser.h
@@ -42,7 +42,7 @@ namespace netlist
/* for debugging messages */
netlist_t &netlist() { return m_setup.netlist(); }
- virtual void verror(pstring msg, int line_num, pstring line);
+ virtual void verror(const pstring &msg, int line_num, const pstring &line);
private:
nl_double eval_param(const token_t tok);
diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c
index a25566d3d85..94cb85ced03 100644
--- a/src/emu/netlist/nl_setup.c
+++ b/src/emu/netlist/nl_setup.c
@@ -5,6 +5,8 @@
*
*/
+#include <cstdio>
+
#include "solver/nld_solver.h"
#include "plib/palloc.h"
@@ -107,14 +109,14 @@ device_t *setup_t::register_dev(device_t *dev, const pstring &name)
dev->init(netlist(), fqn);
if (!(netlist().m_devices.add(dev, false)==true))
- netlist().error("Error adding %s to device list\n", name.cstr());
+ log().fatal("Error adding {1} to device list\n", name);
return dev;
}
void setup_t::register_lib_entry(const pstring &name)
{
if (m_lib.contains(name))
- netlist().warning("Lib entry collection already contains %s. IGNORED", name.cstr());
+ log().warning("Lib entry collection already contains {1}. IGNORED", name);
else
m_lib.add(name);
}
@@ -133,7 +135,7 @@ device_t *setup_t::register_dev(const pstring &classname, const pstring &name)
device_t *dev = factory().new_device_by_name(classname);
//device_t *dev = factory().new_device_by_classname(classname);
if (dev == NULL)
- netlist().error("Class %s not found!\n", classname.cstr());
+ log().fatal("Class {1} not found!\n", classname);
return register_dev(dev, name);
}
}
@@ -142,17 +144,17 @@ void setup_t::register_model(const pstring &model_in)
{
int pos = model_in.find(" ");
if (pos < 0)
- netlist().error("Unable to parse model: %s", model_in.cstr());
+ log().fatal("Unable to parse model: {1}", model_in);
pstring model = model_in.left(pos).trim().ucase();
pstring def = model_in.substr(pos + 1).trim();
if (!m_models.add(model, def))
- netlist().error("Model already exists: %s", model_in.cstr());
+ log().fatal("Model already exists: {1}", model_in);
}
void setup_t::register_alias_nofqn(const pstring &alias, const pstring &out)
{
if (!m_alias.add(alias, out))
- netlist().error("Error adding alias %s to alias list\n", alias.cstr());
+ log().fatal("Error adding alias {1} to alias list\n", alias);
}
void setup_t::register_alias(const pstring &alias, const pstring &out)
@@ -166,12 +168,12 @@ void setup_t::register_dippins_arr(const pstring &terms)
{
pstring_list_t list(terms,", ");
if (list.size() == 0 || (list.size() % 2) == 1)
- netlist().error("You must pass an equal number of pins to DIPPINS");
+ log().fatal("You must pass an equal number of pins to DIPPINS");
unsigned n = list.size();
for (unsigned i = 0; i < n / 2; i++)
{
- register_alias(pformat("%1")(i+1), list[i * 2]);
- register_alias(pformat("%1")(n-i), list[i * 2 + 1]);
+ register_alias(pfmt("{1}")(i+1), list[i * 2]);
+ register_alias(pfmt("{1}")(n-i), list[i * 2 + 1]);
}
}
@@ -197,7 +199,7 @@ pstring setup_t::objtype_as_astr(object_t &in) const
return "QUEUE";
}
// FIXME: noreturn
- netlist().error("Unknown object type %d\n", in.type());
+ log().fatal("Unknown object type {1}\n", (unsigned) in.type());
return "Error";
}
@@ -218,14 +220,14 @@ void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj)
else if (obj.isFamily(terminal_t::ANALOG))
dynamic_cast<analog_output_t &>(term).init_object(dev, dev.name() + "." + name);
else
- netlist().error("Error adding %s %s to terminal list, neither LOGIC nor ANALOG\n", objtype_as_astr(term).cstr(), term.name().cstr());
+ log().fatal("Error adding {1} {2} to terminal list, neither LOGIC nor ANALOG\n", objtype_as_astr(term), term.name());
}
else
term.init_object(dev, dev.name() + "." + name);
if (!m_terminals.add(term.name(), &term))
- netlist().error("Error adding %s %s to terminal list\n", objtype_as_astr(term).cstr(), term.name().cstr());
- NL_VERBOSE_OUT(("%s %s\n", objtype_as_astr(term).cstr(), name.cstr()));
+ log().fatal("Error adding {1} {2} to terminal list\n", objtype_as_astr(term), term.name());
+ log().debug("{1} {2}\n", objtype_as_astr(term), name);
}
break;
case terminal_t::NET:
@@ -233,7 +235,7 @@ void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj)
case terminal_t::PARAM:
{
param_t &param = dynamic_cast<param_t &>(obj);
- //printf("name: %s\n", name.cstr());
+ //printf("name: {1}\n", name);
if (m_params_temp.contains(name))
{
const pstring val = m_params_temp[name];
@@ -241,20 +243,20 @@ void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj)
{
case param_t::DOUBLE:
{
- NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", name.cstr(), val.cstr()));
+ log().debug("Found parameter ... {1} : {1}\n", name, val);
double vald = 0;
if (sscanf(val.cstr(), "%lf", &vald) != 1)
- netlist().error("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
+ log().fatal("Invalid number conversion {1} : {2}\n", name, val);
dynamic_cast<param_double_t &>(param).initial(vald);
}
break;
case param_t::INTEGER:
case param_t::LOGIC:
{
- NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", name.cstr(), val.cstr()));
+ log().debug("Found parameter ... {1} : {2}\n", name, val);
double vald = 0;
if (sscanf(val.cstr(), "%lf", &vald) != 1)
- netlist().error("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
+ log().fatal("Invalid number conversion {1} : {2}\n", name, val);
dynamic_cast<param_int_t &>(param).initial((int) vald);
}
break;
@@ -268,21 +270,21 @@ void setup_t::register_object(device_t &dev, const pstring &name, object_t &obj)
dynamic_cast<param_model_t &>(param).initial(val);
break;
default:
- netlist().error("Parameter is not supported %s : %s\n", name.cstr(), val.cstr());
+ log().fatal("Parameter is not supported {1} : {2}\n", name, val);
}
}
if (!m_params.add(param.name(), &param))
- netlist().error("Error adding parameter %s to parameter list\n", name.cstr());
+ log().fatal("Error adding parameter {1} to parameter list\n", name);
}
break;
case terminal_t::DEVICE:
- netlist().error("Device registration not yet supported - %s\n", name.cstr());
+ log().fatal("Device registration not yet supported - {1}\n", name);
break;
case terminal_t::NETLIST:
- netlist().error("Netlist registration not yet supported - %s\n", name.cstr());
+ log().fatal("Netlist registration not yet supported - {1}\n", name);
break;
case terminal_t::QUEUE:
- netlist().error("QUEUE registration not yet supported - %s\n", name.cstr());
+ log().fatal("QUEUE registration not yet supported - {1}\n", name);
break;
}
}
@@ -291,7 +293,7 @@ void setup_t::register_link_arr(const pstring &terms)
{
pstring_list_t list(terms,", ");
if (list.size() < 2)
- netlist().error("You must pass at least 2 terminals to NET_C");
+ log().fatal("You must pass at least 2 terminals to NET_C");
for (std::size_t i = 1; i < list.size(); i++)
{
register_link(list[0], list[i]);
@@ -302,7 +304,7 @@ void setup_t::register_link_arr(const pstring &terms)
void setup_t::register_link_fqn(const pstring &sin, const pstring &sout)
{
link_t temp = link_t(sin, sout);
- NL_VERBOSE_OUT(("link %s <== %s\n", sin.cstr(), sout.cstr()));
+ log().debug("link {1} <== {2}\n", sin, sout);
m_links.add(temp);
}
@@ -319,20 +321,20 @@ void setup_t::remove_connections(const pstring pin)
{
if ((m_links[i].e1 == pinfn) || (m_links[i].e2 == pinfn))
{
- netlist().log("removing connection: %s <==> %s\n", m_links[i].e1.cstr(), m_links[i].e2.cstr());
+ log().verbose("removing connection: {1} <==> {2}\n", m_links[i].e1, m_links[i].e2);
m_links.remove_at(i);
found = true;
}
}
if (!found)
- netlist().error("remove_connections: found no occurrence of %s\n", pin.cstr());
+ log().fatal("remove_connections: found no occurrence of {1}\n", pin);
}
void setup_t::register_frontier(const pstring attach, const double r_IN, const double r_OUT)
{
static int frontier_cnt = 0;
- pstring frontier_name = pformat("frontier_%1")(frontier_cnt);
+ pstring frontier_name = pfmt("frontier_{1}")(frontier_cnt);
frontier_cnt++;
device_t *front = register_dev("FRONTIER_DEV", frontier_name);
register_param(frontier_name + ".RIN", r_IN);
@@ -354,7 +356,7 @@ void setup_t::register_frontier(const pstring attach, const double r_IN, const d
}
}
if (!found)
- netlist().error("Frontier setup: found no occurrence of %s\n", attach.cstr());
+ log().fatal("Frontier setup: found no occurrence of {1}\n", attach);
register_link(attach, frontier_name + ".Q");
}
@@ -362,7 +364,7 @@ void setup_t::register_frontier(const pstring attach, const double r_IN, const d
void setup_t::register_param(const pstring &param, const double value)
{
// FIXME: there should be a better way
- register_param(param, pformat("%1").e(value,".9"));
+ register_param(param, pfmt("{1}").e(value,".9"));
}
void setup_t::register_param(const pstring &param, const pstring &value)
@@ -373,11 +375,11 @@ void setup_t::register_param(const pstring &param, const pstring &value)
if (idx < 0)
{
if (!m_params_temp.add(fqn, value))
- netlist().error("Unexpected error adding parameter %s to parameter list\n", param.cstr());
+ log().fatal("Unexpected error adding parameter {1} to parameter list\n", param);
}
else
{
- netlist().warning("Overwriting %s old <%s> new <%s>\n", fqn.cstr(), m_params_temp.value_at(idx).cstr(), value.cstr());
+ log().warning("Overwriting {1} old <{2}> new <{3}>\n", fqn, m_params_temp.value_at(idx), value);
m_params_temp[fqn] = value;
}
}
@@ -394,7 +396,7 @@ const pstring setup_t::resolve_alias(const pstring &name) const
temp = (p>=0 ? m_alias.value_at(p) : "");
} while (temp != "");
- NL_VERBOSE_OUT(("%s==>%s\n", name.cstr(), ret.cstr()));
+ log().debug("{1}==>{2}\n", name, ret);
return ret;
}
@@ -414,9 +416,9 @@ core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool require
core_terminal_t *term = (ret < 0 ? NULL : m_terminals.value_at(ret));
if (term == NULL && required)
- netlist().error("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
+ log().fatal("terminal {1}({2}) not found!\n", terminal_in, tname);
if (term != NULL)
- NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
+ log().debug("Found input {1}\n", tname);
return term;
}
@@ -433,19 +435,19 @@ core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, object_t::ty
ret = m_terminals.index_of(tname + ".Q");
}
if (ret < 0 && required)
- netlist().error("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
+ log().fatal("terminal {1}({2}) not found!\n", terminal_in, tname);
core_terminal_t *term = (ret < 0 ? NULL : m_terminals.value_at(ret));
if (term != NULL && term->type() != atype)
{
if (required)
- netlist().error("object %s(%s) found but wrong type\n", terminal_in.cstr(), tname.cstr());
+ log().fatal("object {1}({2}) found but wrong type\n", terminal_in, tname);
else
term = NULL;
}
if (term != NULL)
- NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
+ log().debug("Found input {1}\n", tname);
return term;
}
@@ -459,9 +461,9 @@ param_t *setup_t::find_param(const pstring &param_in, bool required)
ret = m_params.index_of(outname);
if (ret < 0 && required)
- netlist().error("parameter %s(%s) not found!\n", param_in_fqn.cstr(), outname.cstr());
+ log().fatal("parameter {1}({2}) not found!\n", param_in_fqn, outname);
if (ret != -1)
- NL_VERBOSE_OUT(("Found parameter %s\n", outname.cstr()));
+ log().debug("Found parameter {1}\n", outname);
return (ret == -1 ? NULL : m_params.value_at(ret));
}
@@ -470,7 +472,7 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out)
{
nl_assert(out.isFamily(terminal_t::LOGIC));
- //printf("proxy for %s\n", out.name().cstr());;
+ //printf("proxy for {1}\n", out.name());;
logic_output_t &out_cast = dynamic_cast<logic_output_t &>(out);
devices::nld_base_proxy *proxy = out_cast.get_proxy();
@@ -478,7 +480,7 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out)
{
// create a new one ...
devices::nld_base_d_to_a_proxy *new_proxy = out_cast.logic_family()->create_d_a_proxy(&out_cast);
- pstring x = pformat("proxy_da_%1_%2")(out.name())(m_proxy_cnt);
+ pstring x = pfmt("proxy_da_{1}_{2}")(out.name())(m_proxy_cnt);
m_proxy_cnt++;
register_dev(new_proxy, x);
@@ -492,7 +494,7 @@ devices::nld_base_proxy *setup_t::get_d_a_proxy(core_terminal_t &out)
core_terminal_t *p = out.net().m_core_terms[i];
p->clear_net(); // de-link from all nets ...
if (!connect(new_proxy->proxy_term(), *p))
- netlist().error("Error connecting %s to %s\n", new_proxy->proxy_term().name().cstr(), (*p).name().cstr());
+ log().fatal("Error connecting {1} to {2}\n", new_proxy->proxy_term().name(), (*p).name());
}
out.net().m_core_terms.clear(); // clear the list
#endif
@@ -510,7 +512,7 @@ void setup_t::connect_input_output(core_terminal_t &in, core_terminal_t &out)
logic_input_t &incast = dynamic_cast<logic_input_t &>(in);
devices::nld_a_to_d_proxy *proxy = palloc(devices::nld_a_to_d_proxy(&incast));
incast.set_proxy(proxy);
- pstring x = pformat("proxy_ad_%1_%2")(in.name())( m_proxy_cnt);
+ pstring x = pfmt("proxy_ad_{1}_{2}")(in.name())( m_proxy_cnt);
m_proxy_cnt++;
register_dev(proxy, x);
@@ -546,10 +548,10 @@ void setup_t::connect_terminal_input(terminal_t &term, core_terminal_t &inp)
else if (inp.isFamily(terminal_t::LOGIC))
{
logic_input_t &incast = dynamic_cast<logic_input_t &>(inp);
- NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n"));
+ log().debug("connect_terminal_input: connecting proxy\n");
devices::nld_a_to_d_proxy *proxy = palloc(devices::nld_a_to_d_proxy(&incast));
incast.set_proxy(proxy);
- pstring x = pformat("proxy_ad_%1_%2")(inp.name())(m_proxy_cnt);
+ pstring x = pfmt("proxy_ad_{1}_{2}")(inp.name())(m_proxy_cnt);
m_proxy_cnt++;
register_dev(proxy, x);
@@ -565,7 +567,7 @@ void setup_t::connect_terminal_input(terminal_t &term, core_terminal_t &inp)
}
else
{
- netlist().error("Netlist: Severe Error");
+ log().fatal("Netlist: Severe Error");
}
}
@@ -573,7 +575,7 @@ void setup_t::connect_terminal_output(terminal_t &in, core_terminal_t &out)
{
if (out.isFamily(terminal_t::ANALOG))
{
- NL_VERBOSE_OUT(("connect_terminal_output: %s %s\n", in.name().cstr(), out.name().cstr()));
+ log().debug("connect_terminal_output: {1} {2}\n", in.name(), out.name());
/* no proxy needed, just merge existing terminal net */
if (in.has_net())
out.net().merge_net(&in.net());
@@ -582,14 +584,14 @@ void setup_t::connect_terminal_output(terminal_t &in, core_terminal_t &out)
}
else if (out.isFamily(terminal_t::LOGIC))
{
- NL_VERBOSE_OUT(("connect_terminal_output: connecting proxy\n"));
+ log().debug("connect_terminal_output: connecting proxy\n");
devices::nld_base_proxy *proxy = get_d_a_proxy(out);
connect_terminals(proxy->proxy_term(), in);
}
else
{
- netlist().error("Netlist: Severe Error");
+ log().fatal("Netlist: Severe Error");
}
}
@@ -600,22 +602,22 @@ void setup_t::connect_terminals(core_terminal_t &t1, core_terminal_t &t2)
if (t1.has_net() && t2.has_net())
{
- NL_VERBOSE_OUT(("T2 and T1 have net\n"));
+ log().debug("T2 and T1 have net\n");
t1.net().merge_net(&t2.net());
}
else if (t2.has_net())
{
- NL_VERBOSE_OUT(("T2 has net\n"));
+ log().debug("T2 has net\n");
t2.net().register_con(t1);
}
else if (t1.has_net())
{
- NL_VERBOSE_OUT(("T1 has net\n"));
+ log().debug("T1 has net\n");
t1.net().register_con(t2);
}
else
{
- NL_VERBOSE_OUT(("adding net ...\n"));
+ log().debug("adding net ...\n");
analog_net_t *anet = palloc(analog_net_t);
t1.set_net(*anet);
//m_netlist.solver()->m_nets.add(anet);
@@ -683,7 +685,7 @@ bool setup_t::connect_input_input(core_terminal_t &t1, core_terminal_t &t2)
bool setup_t::connect(core_terminal_t &t1_in, core_terminal_t &t2_in)
{
- NL_VERBOSE_OUT(("Connecting %s to %s\n", t1_in.name().cstr(), t2_in.name().cstr()));
+ log().debug("Connecting {1} to {2}\n", t1_in.name(), t2_in.name());
core_terminal_t &t1 = resolve_proxy(t1_in);
core_terminal_t &t2 = resolve_proxy(t2_in);
bool ret = true;
@@ -691,13 +693,13 @@ bool setup_t::connect(core_terminal_t &t1_in, core_terminal_t &t2_in)
if (t1.isType(core_terminal_t::OUTPUT) && t2.isType(core_terminal_t::INPUT))
{
if (t2.has_net() && t2.net().isRailNet())
- netlist().error("Input %s already connected\n", t2.name().cstr());
+ log().fatal("Input {1} already connected\n", t2.name());
connect_input_output(t2, t1);
}
else if (t1.isType(core_terminal_t::INPUT) && t2.isType(core_terminal_t::OUTPUT))
{
if (t1.has_net() && t1.net().isRailNet())
- netlist().error("Input %s already connected\n", t1.name().cstr());
+ log().fatal("Input {1} already connected\n", t1.name());
connect_input_output(t1, t2);
}
else if (t1.isType(core_terminal_t::OUTPUT) && t2.isType(core_terminal_t::TERMINAL))
@@ -726,7 +728,7 @@ bool setup_t::connect(core_terminal_t &t1_in, core_terminal_t &t2_in)
}
else
ret = false;
- //netlist().error("Connecting %s to %s not supported!\n", t1.name().cstr(), t2.name().cstr());
+ //netlist().error("Connecting {1} to {2} not supported!\n", t1.name(), t2.name());
return ret;
}
@@ -734,7 +736,7 @@ void setup_t::resolve_inputs()
{
bool has_twoterms = false;
- netlist().log("Resolving inputs ...");
+ log().verbose("Resolving inputs ...");
/* Netlist can directly connect input to input.
* We therefore first park connecting inputs and retry
@@ -761,12 +763,12 @@ void setup_t::resolve_inputs()
if (tries == 0)
{
for (std::size_t i = 0; i < m_links.size(); i++ )
- netlist().warning("Error connecting %s to %s\n", m_links[i].e1.cstr(), m_links[i].e2.cstr());
+ log().warning("Error connecting {1} to {2}\n", m_links[i].e1, m_links[i].e2);
- netlist().error("Error connecting -- bailing out\n");
+ log().fatal("Error connecting -- bailing out\n");
}
- netlist().log("deleting empty nets ...");
+ log().verbose("deleting empty nets ...");
// delete empty nets ... and save m_list ...
@@ -786,7 +788,7 @@ void setup_t::resolve_inputs()
for (std::size_t i=0; i < todelete.size(); i++)
{
- netlist().log("Deleting net %s ...", todelete[i]->name().cstr());
+ log().verbose("Deleting net {1} ...", todelete[i]->name());
netlist().m_nets.remove(todelete[i]);
if (!todelete[i]->isRailNet())
pfree(todelete[i]);
@@ -794,21 +796,21 @@ void setup_t::resolve_inputs()
pstring errstr("");
- netlist().log("looking for terminals not connected ...");
+ log().verbose("looking for terminals not connected ...");
for (std::size_t i = 0; i < m_terminals.size(); i++)
{
core_terminal_t *term = m_terminals.value_at(i);
if (!term->has_net())
- errstr += pformat("Found terminal %1 without a net\n")(term->name());
+ errstr += pfmt("Found terminal {1} without a net\n")(term->name());
else if (term->net().num_cons() == 0)
- netlist().warning("Found terminal %s without connections",
- term->name().cstr());
+ log().warning("Found terminal {1} without connections",
+ term->name());
}
if (errstr != "")
- netlist().error("%s", errstr.cstr());
+ log().fatal("{1}", errstr);
- netlist().log("looking for two terms connected to rail nets ...\n");
+ log().verbose("looking for two terms connected to rail nets ...\n");
// FIXME: doesn't find internal devices. This needs to be more clever
for (std::size_t i=0; i < netlist().m_devices.size(); i++)
{
@@ -818,21 +820,21 @@ void setup_t::resolve_inputs()
has_twoterms = true;
if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
#if 0
- netlist().error("Found device %s connected only to railterminals %s/%s\n",
- t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
+ netlist().fatal("Found device {1} connected only to railterminals {2}/{3}\n",
+ t->name(), t->m_N.net().name(), t->m_P.net().name());
#else
- netlist().warning("Found device %s connected only to railterminals %s/%s\n",
- t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
+ log().warning("Found device {1} connected only to railterminals {2}/{3}\n",
+ t->name(), t->m_N.net().name(), t->m_P.net().name());
#endif
}
}
- netlist().log("initialize solver ...\n");
+ log().verbose("initialize solver ...\n");
if (netlist().solver() == NULL)
{
if (has_twoterms)
- netlist().error("No solver found for this net although analog elements are present\n");
+ log().fatal("No solver found for this net although analog elements are present\n");
}
else
netlist().solver()->post_start();
@@ -845,12 +847,12 @@ void setup_t::start_devices()
if (env != "")
{
- NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
+ log().debug("Creating dynamic logs ...\n");
pstring_list_t ll(env, ":");
for (unsigned i=0; i < ll.size(); i++)
{
- NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
- NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
+ log().debug("{1}: <{2}>\n",i, ll[i]);
+ log().debug("{1}: <{2}>\n",i, ll[i]);
device_t *nc = factory().new_device_by_name("LOG");
pstring name = "log_" + ll[i];
register_dev(nc, name);
@@ -868,7 +870,7 @@ void setup_t::print_stats() const
for (std::size_t i = 0; i < netlist().m_started_devices.size(); i++)
{
core_device_t *entry = netlist().m_started_devices[i];
- printf("Device %20s : %12d %12d %15ld\n", entry->name().cstr(), entry->stat_call_count, entry->stat_update_count, (long int) entry->stat_total_time / (entry->stat_update_count + 1));
+ printf("Device %20s : %12d %12d %15ld\n", entry->name(), entry->stat_call_count, entry->stat_update_count, (long int) entry->stat_total_time / (entry->stat_update_count + 1));
}
printf("Queue Pushes %15d\n", netlist().queue().m_prof_call);
printf("Queue Moves %15d\n", netlist().queue().m_prof_sortmove);
@@ -935,7 +937,7 @@ void setup_t::model_parse(const pstring &model_in, model_map_t &map)
key = model.ucase();
if (!m_models.contains(key))
- netlist().error("Model %s not found\n", model.cstr());
+ log().fatal("Model {1} not found\n", model);
model = m_models[key];
}
pstring xmodel = model.left(pos);
@@ -947,12 +949,12 @@ void setup_t::model_parse(const pstring &model_in, model_map_t &map)
if (m_models.contains(xmodel))
model_parse(xmodel, map);
else
- netlist().error("Model doesn't exist %s\n", xmodel.cstr());
+ log().fatal("Model doesn't exist {1}\n", xmodel);
}
pstring remainder=model.substr(pos+1).trim();
if (!remainder.endsWith(")"))
- netlist().error("Model error %s\n", model.cstr());
+ log().fatal("Model error {1}\n", model);
remainder = remainder.left(remainder.len() - 1);
pstring_list_t pairs(remainder," ", true);
@@ -960,7 +962,7 @@ void setup_t::model_parse(const pstring &model_in, model_map_t &map)
{
int pose = pairs[i].find("=");
if (pose < 0)
- netlist().error("Model error on pair %s\n", model.cstr());
+ log().fatal("Model error on pair {1}\n", model);
map[pairs[i].left(pose).ucase()] = pairs[i].substr(pose+1);
}
}
@@ -970,9 +972,9 @@ const pstring setup_t::model_value_str(model_map_t &map, const pstring &entity)
pstring ret;
if (entity != entity.ucase())
- netlist().error("model parameters should be uppercase:%s %s\n", entity.cstr(), model_string(map).cstr());
+ log().fatal("model parameters should be uppercase:{1} {2}\n", entity, model_string(map));
if (!map.contains(entity))
- netlist().error("Entity %s not found in model %s\n", entity.cstr(), model_string(map).cstr());
+ log().fatal("Entity {1} not found in model {2}\n", entity, model_string(map));
else
ret = map[entity];
@@ -997,7 +999,7 @@ nl_double setup_t::model_value(model_map_t &map, const pstring &entity)
case 'a': factor = 1e-18; break;
default:
if (numfac < "0" || numfac > "9")
- fatalerror_e(pformat("Unknown number factor <%1> in: %2")(numfac)(entity));
+ fatalerror_e(pfmt("Unknown number factor <{1}> in: {2}")(numfac)(entity));
}
if (factor != NL_FCONST(1.0))
tmp = tmp.left(tmp.len() - 1);
@@ -1015,7 +1017,7 @@ void setup_t::include(const pstring &netlist_name)
if (m_sources[i]->parse(*this, netlist_name))
return;
}
- netlist().error("unable to find %s in source collection", netlist_name.cstr());
+ log().fatal("unable to find {1} in source collection", netlist_name);
}
// ----------------------------------------------------------------------------------------
diff --git a/src/emu/netlist/nl_setup.h b/src/emu/netlist/nl_setup.h
index 9f1fbdb9e6f..adb3ccebb5d 100644
--- a/src/emu/netlist/nl_setup.h
+++ b/src/emu/netlist/nl_setup.h
@@ -197,6 +197,9 @@ namespace netlist
nl_double model_value(model_map_t &map, const pstring &entity);
void model_parse(const pstring &model, model_map_t &map);
+
+ const plog_base<NL_DEBUG> &log() const { return netlist().log(); }
+
protected:
private:
diff --git a/src/emu/netlist/nl_time.h b/src/emu/netlist/nl_time.h
index 4473b67d2c8..ddb3c85d14e 100644
--- a/src/emu/netlist/nl_time.h
+++ b/src/emu/netlist/nl_time.h
@@ -23,7 +23,8 @@
// net_list_time
// ----------------------------------------------------------------------------------------
-#define RESOLUTION NETLIST_INTERNAL_RES
+#undef ATTR_HOT
+#define ATTR_HOT
namespace netlist
{
@@ -31,71 +32,73 @@ namespace netlist
{
public:
+#if (PHAS_INT128)
+ typedef UINT128 INTERNALTYPE;
+ static const pstate_data_type_e STATETYPE = DT_INT128;
+#else
typedef UINT64 INTERNALTYPE;
+ static const pstate_data_type_e STATETYPE = DT_INT64;
+#endif
+ static const INTERNALTYPE RESOLUTION = NETLIST_INTERNAL_RES;
- ATTR_HOT /* inline */ netlist_time() : m_time(0) {}
+ ATTR_HOT netlist_time() : m_time(0) {}
+ ATTR_HOT netlist_time(const netlist_time &rhs) : m_time(rhs.m_time) {}
- ATTR_HOT friend /* inline */ const netlist_time operator-(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ const netlist_time operator+(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ const netlist_time operator*(const netlist_time &left, const UINT32 factor);
- ATTR_HOT friend /* inline */ UINT32 operator/(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ bool operator>(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ bool operator<(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ bool operator>=(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ bool operator<=(const netlist_time &left, const netlist_time &right);
- ATTR_HOT friend /* inline */ bool operator!=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend const netlist_time operator-(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend const netlist_time operator+(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend const netlist_time operator*(const netlist_time &left, const UINT64 factor);
+ ATTR_HOT friend UINT64 operator/(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend bool operator>(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend bool operator<(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend bool operator>=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend bool operator<=(const netlist_time &left, const netlist_time &right);
+ ATTR_HOT friend bool operator!=(const netlist_time &left, const netlist_time &right);
- ATTR_HOT /* inline */ const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
- ATTR_HOT /* inline */ const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; }
+ ATTR_HOT const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
- // issues with ISO C++ standard
- //ATTR_HOT /* inline */ operator double() const { return as_double(); }
+ ATTR_HOT const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; }
- ATTR_HOT /* inline */ const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; }
-
- ATTR_HOT /* inline */ INTERNALTYPE as_raw() const { return m_time; }
- ATTR_HOT /* inline */ double as_double() const { return (double) m_time / (double) RESOLUTION; }
+ ATTR_HOT INTERNALTYPE as_raw() const { return m_time; }
+ ATTR_HOT double as_double() const { return (double) m_time / (double) RESOLUTION; }
// for save states ....
- ATTR_HOT /* inline */ INTERNALTYPE *get_internaltype_ptr() { return &m_time; }
+ ATTR_HOT INTERNALTYPE *get_internaltype_ptr() { return &m_time; }
- ATTR_HOT static /* inline */ const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); }
- ATTR_HOT static /* inline */ const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); }
- ATTR_HOT static /* inline */ const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); }
- ATTR_HOT static /* inline */ const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); }
- ATTR_HOT static /* inline */ const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); }
- ATTR_HOT static /* inline */ const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); }
+ ATTR_HOT static const netlist_time from_nsec(const INTERNALTYPE ns) { return netlist_time(ns * (RESOLUTION / U64(1000000000))); }
+ ATTR_HOT static const netlist_time from_usec(const INTERNALTYPE us) { return netlist_time(us * (RESOLUTION / U64(1000000))); }
+ ATTR_HOT static const netlist_time from_msec(const INTERNALTYPE ms) { return netlist_time(ms * (RESOLUTION / U64(1000))); }
+ ATTR_HOT static const netlist_time from_hz(const INTERNALTYPE hz) { return netlist_time(RESOLUTION / hz); }
+ ATTR_HOT static const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); }
+ ATTR_HOT static const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); }
static const netlist_time zero;
protected:
- ATTR_HOT /* inline */ netlist_time(const INTERNALTYPE val) : m_time(val) {}
+ ATTR_HOT netlist_time(const INTERNALTYPE val) : m_time(val) {}
private:
INTERNALTYPE m_time;
};
- #undef RESOLUTION
-
ATTR_HOT inline const netlist_time operator-(const netlist_time &left, const netlist_time &right)
{
- return netlist_time::from_raw(left.m_time - right.m_time);
+ return netlist_time(left.m_time - right.m_time);
}
- ATTR_HOT inline const netlist_time operator*(const netlist_time &left, const UINT32 factor)
+ ATTR_HOT inline const netlist_time operator*(const netlist_time &left, const UINT64 factor)
{
- return netlist_time::from_raw(left.m_time * factor);
+ return netlist_time(left.m_time * factor);
}
- ATTR_HOT inline UINT32 operator/(const netlist_time &left, const netlist_time &right)
+ ATTR_HOT inline UINT64 operator/(const netlist_time &left, const netlist_time &right)
{
return left.m_time / right.m_time;
}
ATTR_HOT inline const netlist_time operator+(const netlist_time &left, const netlist_time &right)
{
- return netlist_time::from_raw(left.m_time + right.m_time);
+ return netlist_time(left.m_time + right.m_time);
}
ATTR_HOT inline bool operator<(const netlist_time &left, const netlist_time &right)
@@ -127,7 +130,7 @@ namespace netlist
template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist::netlist_time &nlt, const void *owner, const pstring &stname)
{
- save_state_ptr(stname, DT_INT64, owner, sizeof(netlist::netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr(), false);
+ save_state_ptr(stname, netlist::netlist_time::STATETYPE, owner, sizeof(netlist::netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr(), false);
}
diff --git a/src/emu/netlist/plib/palloc.c b/src/emu/netlist/plib/palloc.c
index 5746264322b..9b0ee555cbb 100644
--- a/src/emu/netlist/plib/palloc.c
+++ b/src/emu/netlist/plib/palloc.c
@@ -5,9 +5,10 @@
*
*/
+#include <cstdio>
+
#include "pconfig.h"
#include "palloc.h"
-
//============================================================
// Exceptions
//============================================================
diff --git a/src/emu/netlist/plib/palloc.h b/src/emu/netlist/plib/palloc.h
index 26f76255e76..01193998392 100644
--- a/src/emu/netlist/plib/palloc.h
+++ b/src/emu/netlist/plib/palloc.h
@@ -68,7 +68,6 @@ inline void pfree_t(T *p)
template <typename T>
inline T *palloc_array_t(size_t N)
{
- //printf("here palloc_array %d\n", (unsigned) N);
char *buf = reinterpret_cast<char *>(palloc_raw(N * sizeof(T) + 64*2));
size_t *s = reinterpret_cast<size_t *>(buf);
*s = N;
@@ -86,7 +85,6 @@ inline void pfree_array_t(T *p)
buf -= 64;
size_t *s = reinterpret_cast<size_t *>(buf);
size_t N = *s;
- //printf("here pfree_array %d\n", (unsigned) N);
while (N > 0)
{
p->~T();
diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h
index 434a59e2df1..cb7c7111cd2 100644
--- a/src/emu/netlist/plib/pconfig.h
+++ b/src/emu/netlist/plib/pconfig.h
@@ -19,6 +19,18 @@
#define PSTANDALONE (0)
#endif
+//#define PHAS_INT128 (0)
+
+#ifndef PHAS_INT128
+#define PHAS_INT128 (0)
+#endif
+
+#if (PHAS_INT128)
+typedef __uint128_t UINT128;
+typedef __int128_t INT128;
+#endif
+
+
#if !(PSTANDALONE)
#include "osdcore.h"
#include "eminline.h"
@@ -51,14 +63,6 @@
#if !(PSTANDALONE)
-#undef ATTR_COLD
-#define ATTR_COLD
-
-static inline std::size_t SIZET_PRINTF(const std::size_t &v)
-{
- return (unsigned) v;
-}
-
/* use MAME */
#if (USE_DELEGATE_TYPE == DELEGATE_TYPE_INTERNAL)
#define PHAS_PMF_INTERNAL 1
@@ -94,10 +98,10 @@ static inline std::size_t SIZET_PRINTF(const std::size_t &v)
/* ATTR_HOT and ATTR_COLD cause performance degration in 5.1 */
//#define ATTR_HOT
//#define ATTR_COLD
-#define ATTR_HOT __attribute__((hot))
+#define ATTR_HOT __attribute__((hot))
#define ATTR_COLD __attribute__((cold))
-#define RESTRICT
+#define RESTRICT __restrict__
#define EXPECTED(x) (x)
#define UNEXPECTED(x) (x)
#define ATTR_PRINTF(x,y) __attribute__((format(printf, x, y)))
@@ -137,33 +141,6 @@ typedef int64_t INT64;
#define S64(val) val
#endif
-/* MINGW has adopted the MSVC formatting for 64-bit ints as of gcc 4.4 */
-#if (defined(__MINGW32__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))) || defined(_MSC_VER)
-#define I64FMT "I64"
-#else
-#define I64FMT "ll"
-#endif
-
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#if (PTR64)
-#define SIZETFMT "I64u"
-#else
-#define SIZETFMT "u"
-#endif
-#else
-//#define SIZETFMT "zu"
-#if (PTR64)
-#define SIZETFMT "lu"
-#else
-#define SIZETFMT "u"
-#endif
-#endif
-
-static inline std::size_t SIZET_PRINTF(const std::size_t &v)
-{
- return (unsigned) v;
-}
-
#endif
/*
diff --git a/src/emu/netlist/plib/plists.h b/src/emu/netlist/plib/plists.h
index af3521bd7db..dd26cfb963b 100644
--- a/src/emu/netlist/plib/plists.h
+++ b/src/emu/netlist/plib/plists.h
@@ -566,7 +566,7 @@ public:
p = pn + onstr.len();
pn = str.find(onstr, p);
}
- if (p<str.len())
+ if (p < (int) str.len())
{
pstring t = str.substr(p);
if (!ignore_empty || t.len() != 0)
@@ -579,7 +579,7 @@ public:
pstring_list_t temp;
pstring col = "";
- int i = 0;
+ unsigned i = 0;
while (i<str.blen())
{
int p = -1;
@@ -715,6 +715,7 @@ public:
void clear()
{
+#if 0
if (0)
{
unsigned cnt = 0;
@@ -727,6 +728,7 @@ public:
else
printf("phashmap: No elements .. \n");
}
+#endif
m_values.clear();
for (unsigned i=0; i<m_hash.size(); i++)
m_hash[i] = -1;
diff --git a/src/emu/netlist/plib/pparser.c b/src/emu/netlist/plib/pparser.c
index 6355894bd56..aa11c30cfa9 100644
--- a/src/emu/netlist/plib/pparser.c
+++ b/src/emu/netlist/plib/pparser.c
@@ -16,9 +16,6 @@
#pragma GCC diagnostic ignored "-Wformat-extra-args"
#endif
-//#undef NL_VERBOSE_OUT
-//#define NL_VERBOSE_OUT(x) printf x
-
// ----------------------------------------------------------------------------------------
// A simple tokenizer
// ----------------------------------------------------------------------------------------
@@ -75,7 +72,7 @@ void ptokenizer::require_token(const token_t tok, const token_id_t &token_num)
{
if (!tok.is(token_num))
{
- error("Error: expected token <%s> got <%s>\n", m_tokens[token_num.id()].cstr(), tok.str().cstr());
+ error(pfmt("Expected token <{1}> got <{2}>")(m_tokens[token_num.id()])(tok.str()) );
}
}
@@ -84,7 +81,7 @@ pstring ptokenizer::get_string()
token_t tok = get_token();
if (!tok.is_type(STRING))
{
- error("Error: expected a string, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected a string, got <{1}>")(tok.str()) );
}
return tok.str();
}
@@ -94,7 +91,7 @@ pstring ptokenizer::get_identifier()
token_t tok = get_token();
if (!tok.is_type(IDENTIFIER))
{
- error("Error: expected an identifier, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected an identifier, got <{1}>")(tok.str()) );
}
return tok.str();
}
@@ -104,7 +101,7 @@ pstring ptokenizer::get_identifier_or_number()
token_t tok = get_token();
if (!(tok.is_type(IDENTIFIER) || tok.is_type(NUMBER)))
{
- error("Error: expected an identifier, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected an identifier, got <{1}>")(tok.str()) );
}
return tok.str();
}
@@ -114,12 +111,12 @@ double ptokenizer::get_number_double()
token_t tok = get_token();
if (!tok.is_type(NUMBER))
{
- error("Error: expected a number, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected a number, got <{1}>")(tok.str()) );
}
bool err = false;
double ret = tok.str().as_double(&err);
if (err)
- error("Error: expected a number, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected a number, got <{1}>")(tok.str()) );
return ret;
}
@@ -128,12 +125,12 @@ long ptokenizer::get_number_long()
token_t tok = get_token();
if (!tok.is_type(NUMBER))
{
- error("Error: expected a long int, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected a long int, got <{1}>")(tok.str()) );
}
bool err = false;
long ret = tok.str().as_long(&err);
if (err)
- error("Error: expected a long int, got <%s>\n", tok.str().cstr());
+ error(pfmt("Expected a long int, got <{1}>")(tok.str()) );
return ret;
}
@@ -252,16 +249,9 @@ ptokenizer::token_t ptokenizer::get_token_internal()
}
-ATTR_COLD void ptokenizer::error(const char *format, ...)
+ATTR_COLD void ptokenizer::error(const pstring &errs)
{
- va_list ap;
- va_start(ap, format);
-
- pstring errmsg1 = pstring(format).vprintf(ap);
- va_end(ap);
-
- verror(errmsg1, currentline_no(), currentline_str());
-
+ verror("Error: " + errs, currentline_no(), currentline_str());
//throw error;
}
@@ -395,7 +385,7 @@ static pstring catremainder(const pstring_list_t &elems, std::size_t start, pstr
ret.cat(elems[i]);
ret.cat(sep);
}
- return pstring(ret.cstr());
+ return ret;
}
pstring ppreprocessor::process_line(const pstring &line)
@@ -455,12 +445,12 @@ pstring ppreprocessor::process_line(const pstring &line)
if (m_ifflag == 0)
{
if (lti.size() != 3)
- error("PREPRO: only simple defines allowed: %s" + line);
+ error("PREPRO: only simple defines allowed: " + line);
m_defines.add(lti[1], define_t(lti[1], lti[2]));
}
}
else
- error(pformat("unknown directive on line %1: %2\n")(m_lineno)(line));
+ error(pfmt("unknown directive on line {1}: {2}")(m_lineno)(line));
}
else
{
diff --git a/src/emu/netlist/plib/pparser.h b/src/emu/netlist/plib/pparser.h
index 95356dae224..34dfdbfcff3 100644
--- a/src/emu/netlist/plib/pparser.h
+++ b/src/emu/netlist/plib/pparser.h
@@ -112,10 +112,10 @@ public:
}
token_t get_token_internal();
- void error(const char *format, ...) ATTR_PRINTF(2,3);
+ void error(const pstring &errs);
protected:
- virtual void verror(pstring msg, int line_num, pstring line) = 0;
+ virtual void verror(const pstring &msg, int line_num, const pstring &line) = 0;
private:
void skipeol();
@@ -138,7 +138,7 @@ private:
pstring m_number_chars_start;
plist_t<pstring> m_tokens;
pstring m_whitespace;
- char m_string;
+ pstring::code_t m_string;
token_id_t m_tok_comment_start;
token_id_t m_tok_comment_end;
diff --git a/src/emu/netlist/plib/pstate.c b/src/emu/netlist/plib/pstate.c
index 326eb13fe49..cf2c863ed11 100644
--- a/src/emu/netlist/plib/pstate.c
+++ b/src/emu/netlist/plib/pstate.c
@@ -25,6 +25,9 @@ ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const pst
"NOT_SUPPORTED",
"DT_CUSTOM",
"DT_DOUBLE",
+#if (PHAS_INT128)
+ "DT_INT128",
+#endif
"DT_INT64",
"DT_INT16",
"DT_INT8",
diff --git a/src/emu/netlist/plib/pstate.h b/src/emu/netlist/plib/pstate.h
index 0350b0fe309..b42d3dac882 100644
--- a/src/emu/netlist/plib/pstate.h
+++ b/src/emu/netlist/plib/pstate.h
@@ -32,6 +32,9 @@ enum pstate_data_type_e {
NOT_SUPPORTED,
DT_CUSTOM,
DT_DOUBLE,
+#if (PHAS_INT128)
+ DT_INT128,
+#endif
DT_INT64,
DT_INT16,
DT_INT8,
@@ -63,6 +66,10 @@ NETLIST_SAVE_TYPE(double, DT_DOUBLE);
NETLIST_SAVE_TYPE(float, DT_FLOAT);
NETLIST_SAVE_TYPE(INT8, DT_INT8);
NETLIST_SAVE_TYPE(UINT8, DT_INT8);
+#if (PHAS_INT128)
+NETLIST_SAVE_TYPE(INT128, DT_INT128);
+NETLIST_SAVE_TYPE(UINT128, DT_INT128);
+#endif
NETLIST_SAVE_TYPE(INT64, DT_INT64);
NETLIST_SAVE_TYPE(UINT64, DT_INT64);
NETLIST_SAVE_TYPE(bool, DT_BOOLEAN);
diff --git a/src/emu/netlist/plib/pstream.h b/src/emu/netlist/plib/pstream.h
index d0cfd8e21d8..af9f939cc6c 100644
--- a/src/emu/netlist/plib/pstream.h
+++ b/src/emu/netlist/plib/pstream.h
@@ -21,7 +21,7 @@
class pstream
{
- P_PREVENT_COPYING(pstream);
+ P_PREVENT_COPYING(pstream)
public:
typedef long unsigned pos_type;
@@ -93,7 +93,7 @@ private:
class pistream : public pstream
{
- P_PREVENT_COPYING(pistream);
+ P_PREVENT_COPYING(pistream)
public:
pistream(unsigned flags) : pstream(flags) {}
@@ -148,7 +148,7 @@ private:
class postream : public pstream
{
- P_PREVENT_COPYING(postream);
+ P_PREVENT_COPYING(postream)
public:
postream(unsigned flags) : pstream(flags) {}
@@ -158,7 +158,7 @@ public:
void writeline(const pstring &line)
{
- write(line.cstr(), line.blen());
+ write(line);
write(10);
}
@@ -190,7 +190,7 @@ private:
class pomemstream : public postream
{
- P_PREVENT_COPYING(pomemstream);
+ P_PREVENT_COPYING(pomemstream)
public:
pomemstream();
@@ -212,13 +212,37 @@ private:
char *m_mem;
};
+class postringstream : public postream
+{
+ P_PREVENT_COPYING(postringstream )
+
+public:
+
+ postringstream() : postream(0) { }
+ virtual ~postringstream() { }
+
+ const pstringbuffer &str() { return m_buf; }
+
+protected:
+ /* write n bytes to stream */
+ virtual void vwrite(const void *buf, unsigned n)
+ {
+ m_buf.cat(buf, n);
+ }
+ virtual void vseek(pos_type n) { }
+ virtual pos_type vtell() { return m_buf.len(); }
+
+private:
+ pstringbuffer m_buf;
+};
+
// -----------------------------------------------------------------------------
// pofilestream: file output stream
// -----------------------------------------------------------------------------
class pofilestream : public postream
{
- P_PREVENT_COPYING(pofilestream);
+ P_PREVENT_COPYING(pofilestream)
public:
pofilestream(const pstring &fname);
@@ -243,7 +267,7 @@ private:
class pifilestream : public pistream
{
- P_PREVENT_COPYING(pifilestream);
+ P_PREVENT_COPYING(pifilestream)
public:
pifilestream(const pstring &fname);
@@ -268,7 +292,7 @@ private:
class pimemstream : public pistream
{
- P_PREVENT_COPYING(pimemstream);
+ P_PREVENT_COPYING(pimemstream)
public:
pimemstream(const void *mem, const pos_type len);
@@ -293,7 +317,7 @@ private:
class pistringstream : public pimemstream
{
- P_PREVENT_COPYING(pistringstream);
+ P_PREVENT_COPYING(pistringstream)
public:
pistringstream(const pstring &str) : pimemstream(str.cstr(), str.len()), m_str(str) { }
@@ -303,5 +327,26 @@ private:
pstring m_str;
};
+// -----------------------------------------------------------------------------
+// pstream_fmt_writer_t: writer on top of ostream
+// -----------------------------------------------------------------------------
+
+class pstream_fmt_writer_t : public pfmt_writer_t<>
+{
+ P_PREVENT_COPYING(pstream_fmt_writer_t)
+public:
+
+ pstream_fmt_writer_t(postream &strm) : m_strm(strm) {}
+ virtual ~pstream_fmt_writer_t() { }
+
+protected:
+ virtual void vdowrite(const pstring &ls) const
+ {
+ m_strm.write(ls);
+ }
+
+private:
+ postream &m_strm;
+};
#endif /* _PSTREAM_H_ */
diff --git a/src/emu/netlist/plib/pstring.c b/src/emu/netlist/plib/pstring.c
index d0a45607244..00f075d299d 100644
--- a/src/emu/netlist/plib/pstring.c
+++ b/src/emu/netlist/plib/pstring.c
@@ -118,7 +118,7 @@ template<typename F>
const pstring_t<F> pstring_t<F>::substr(int start, int count) const
{
pstring_t ret;
- unsigned alen = len();
+ int alen = (int) len();
if (start < 0)
start = 0;
if (start >= alen)
@@ -148,7 +148,7 @@ const pstring_t<F> pstring_t<F>::ucase() const
{
pstring_t ret = *this;
ret.pcopy(cstr(), blen());
- for (int i=0; i<ret.len(); i++)
+ for (unsigned i=0; i<ret.len(); i++)
ret.m_ptr->str()[i] = toupper((unsigned) ret.m_ptr->str()[i]);
return ret;
}
@@ -159,11 +159,11 @@ int pstring_t<F>::find_first_not_of(const pstring_t &no) const
char *t = m_ptr->str();
unsigned nolen = no.len();
unsigned tlen = len();
- for (int i=0; i < tlen; i++)
+ for (unsigned i=0; i < tlen; i++)
{
char *n = no.m_ptr->str();
bool f = true;
- for (int j=0; j < nolen; j++)
+ for (unsigned j=0; j < nolen; j++)
{
if (F::code(t) == F::code(n))
f = false;
@@ -183,11 +183,11 @@ int pstring_t<F>::find_last_not_of(const pstring_t &no) const
unsigned nolen = no.len();
unsigned tlen = len();
int last_found = -1;
- for (int i=0; i < tlen; i++)
+ for (unsigned i=0; i < tlen; i++)
{
char *n = no.m_ptr->str();
bool f = true;
- for (int j=0; j < nolen; j++)
+ for (unsigned j=0; j < nolen; j++)
{
if (F::code(t) == F::code(n))
f = false;
@@ -251,7 +251,7 @@ const pstring_t<F> pstring_t<F>::rtrim(const pstring_t &ws) const
}
template<typename F>
-const pstring_t<F> pstring_t<F>::rpad(const pstring_t &ws, const int cnt) const
+const pstring_t<F> pstring_t<F>::rpad(const pstring_t &ws, const unsigned cnt) const
{
// FIXME: pstringbuffer ret(*this);
@@ -342,7 +342,7 @@ const pstring::type_t pstring::vprintf(va_list args) const
char tempbuf[4096];
std::vsprintf(tempbuf, cstr(), args);
- return pstring_t(tempbuf);
+ return type_t(tempbuf);
}
@@ -350,7 +350,7 @@ const pstring::type_t pstring::sprintf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
- pstring_t ret = pstring(format).vprintf(ap);
+ type_t ret = pstring(format).vprintf(ap);
va_end(ap);
return ret;
}
@@ -363,7 +363,7 @@ int pstring_t<F>::find(const pstring_t &search, unsigned start) const
const char *s = search.cstr();
const unsigned startt = std::min(start, tlen);
const char *t = cstr();
- for (int i=0; i<startt; i++)
+ for (unsigned i=0; i<startt; i++)
t += F::codelen(t);
for (int i=0; i <= (int) tlen - (int) startt - (int) slen; i++)
{
@@ -392,7 +392,7 @@ int pstring_t<F>::find(const mem_t *search, unsigned start) const
const char *s = search;
const unsigned startt = std::min(start, tlen);
const char *t = cstr();
- for (int i=0; i<startt; i++)
+ for (unsigned i=0; i<startt; i++)
t += F::codelen(t);
for (int i=0; i <= (int) tlen - (int) startt - (int) slen; i++)
{
@@ -426,7 +426,7 @@ bool pstring_t<F>::endsWith(const pstring_t &arg) const
template<typename F>
bool pstring_t<F>::startsWith(const mem_t *arg) const
{
- int alen = strlen(arg);
+ unsigned alen = strlen(arg);
if (alen > blen())
return false;
else
@@ -494,6 +494,15 @@ void pstringbuffer::pcat(const char *s)
m_len += slen;
}
+void pstringbuffer::pcat(const void *m, unsigned l)
+{
+ const std::size_t nl = m_len + l + 1;
+ resize(nl);
+ std::memcpy(m_ptr + m_len, m, l);
+ m_len += l;
+ *(m_ptr + m_len) = 0;
+}
+
void pstringbuffer::pcat(const pstring &s)
{
const std::size_t slen = s.blen();
@@ -504,28 +513,30 @@ void pstringbuffer::pcat(const pstring &s)
m_ptr[m_len] = 0;
}
-pformat::pformat(const pstring &fmt)
+pfmt::pfmt(const pstring &fmt)
: m_arg(0)
{
memcpy(m_str, fmt.cstr(), fmt.blen() + 1);
}
-pformat::pformat(const char *fmt)
+pfmt::pfmt(const char *fmt)
: m_arg(0)
{
strncpy(m_str, fmt, sizeof(m_str) - 1);
m_str[sizeof(m_str) - 1] = 0;
}
-pformat &pformat::update(const char *f, const char *l, ...)
+#if 0
+void pformat::format_element(const char *f, const char *l, const char *fmt_spec, ...)
{
va_list ap;
- va_start(ap, l);
+ va_start(ap, fmt_spec);
char fmt[30] = "%";
char search[10] = "";
char buf[1024];
strcat(fmt, f);
strcat(fmt, l);
+ strcat(fmt, fmt_spec);
int nl = vsprintf(buf, fmt, ap);
m_arg++;
int sl = sprintf(search, "%%%d", m_arg);
@@ -537,9 +548,55 @@ pformat &pformat::update(const char *f, const char *l, ...)
memcpy(p, buf, nl);
}
va_end(ap);
- return *this;
}
-
+#else
+void pfmt::format_element(const char *f, const char *l, const char *fmt_spec, ...)
+{
+ va_list ap;
+ va_start(ap, fmt_spec);
+ char fmt[30] = "%";
+ char search[10] = "";
+ char buf[1024];
+ m_arg++;
+ int sl = sprintf(search, "{%d:", m_arg);
+ char *p = strstr(m_str, search);
+ if (p == NULL)
+ {
+ sl = sprintf(search, "{%d}", m_arg);
+ p = strstr(m_str, search);
+ if (p == NULL)
+ {
+ sl = 2;
+ p = strstr(m_str, "{}");
+ }
+ strcat(fmt, f);
+ }
+ else
+ {
+ char *p1 = strstr(p, "}");
+ if (p1 != NULL)
+ {
+ sl = p1 - p + 1;
+ if (m_arg>=10)
+ strncat(fmt, p+4, p1 - p - 4);
+ else
+ strncat(fmt, p+3, p1 - p - 3);
+ }
+ else
+ strcat(fmt, f);
+ }
+ strcat(fmt, l);
+ strcat(fmt, fmt_spec);
+ int nl = vsprintf(buf, fmt, ap);
+ if (p != NULL)
+ {
+ // Make room
+ memmove(p+nl, p+sl, strlen(p) + 1 - sl);
+ memcpy(p, buf, nl);
+ }
+ va_end(ap);
+}
+#endif
template struct pstring_t<pu8_traits>;
template struct pstring_t<putf8_traits>;
diff --git a/src/emu/netlist/plib/pstring.h b/src/emu/netlist/plib/pstring.h
index 074201deee3..ecd4dd4907e 100644
--- a/src/emu/netlist/plib/pstring.h
+++ b/src/emu/netlist/plib/pstring.h
@@ -145,7 +145,7 @@ public:
const pstring_t rtrim(const pstring_t &ws = " \t\n\r") const;
const pstring_t trim(const pstring_t &ws = " \t\n\r") const { return this->ltrim(ws).rtrim(ws); }
- const pstring_t rpad(const pstring_t &ws, const int cnt) const;
+ const pstring_t rpad(const pstring_t &ws, const unsigned cnt) const;
const pstring_t ucase() const;
@@ -348,7 +348,7 @@ public:
operator pstring() const { return pstring(m_ptr); }
// concatenation operators
- pstringbuffer& operator+=(const UINT8 c) { char buf[2] = { c, 0 }; pcat(buf); return *this; }
+ pstringbuffer& operator+=(const UINT8 c) { UINT8 buf[2] = { c, 0 }; pcat((char *) buf); return *this; }
pstringbuffer& operator+=(const pstring &string) { pcat(string); return *this; }
pstringbuffer& operator+=(const char *string) { pcat(string); return *this; }
@@ -356,6 +356,7 @@ public:
void cat(const pstring &s) { pcat(s); }
void cat(const char *s) { pcat(s); }
+ void cat(const void *m, unsigned l) { pcat(m, l); }
private:
@@ -372,6 +373,7 @@ private:
void pcopy(const pstring &from);
void pcat(const char *s);
void pcat(const pstring &s);
+ void pcat(const void *m, unsigned l);
char *m_ptr;
std::size_t m_size;
@@ -379,51 +381,268 @@ private:
};
-class pformat
+template <typename T>
+struct ptype_treats
+{
+};
+
+template<>
+struct ptype_treats<char>
+{
+ static short cast(char x) { return x; }
+ static const bool is_signed = true;
+ static const char *size_specifier() { return "h"; }
+};
+
+template<>
+struct ptype_treats<short>
+{
+ static short cast(short x) { return x; }
+ static const bool is_signed = true;
+ static const char *size_specifier() { return "h"; }
+};
+
+template<>
+struct ptype_treats<int>
+{
+ static int cast(int x) { return x; }
+ static const bool is_signed = true;
+ static const char *size_specifier() { return ""; }
+};
+
+template<>
+struct ptype_treats<long>
+{
+ static long cast(long x) { return x; }
+ static const bool is_signed = true;
+ static const char *size_specifier() { return "l"; }
+};
+
+template<>
+struct ptype_treats<long long>
+{
+ static long long cast(long long x) { return x; }
+ static const bool is_signed = true;
+ static const char *size_specifier() { return "ll"; }
+};
+
+template<>
+struct ptype_treats<unsigned char>
+{
+ static unsigned short cast(unsigned char x) { return x; }
+ static const bool is_signed = false;
+ static const char *size_specifier() { return "h"; }
+};
+
+template<>
+struct ptype_treats<unsigned short>
+{
+ static unsigned short cast(unsigned short x) { return x; }
+ static const bool is_signed = false;
+ static const char *size_specifier() { return "h"; }
+};
+
+template<>
+struct ptype_treats<unsigned int>
+{
+ static unsigned int cast(unsigned int x) { return x; }
+ static const bool is_signed = false;
+ static const char *size_specifier() { return ""; }
+};
+
+template<>
+struct ptype_treats<unsigned long>
+{
+ static unsigned long cast(unsigned long x) { return x; }
+ static const bool is_signed = false;
+ static const char *size_specifier() { return "l"; }
+};
+
+template<>
+struct ptype_treats<unsigned long long>
+{
+ static unsigned long long cast(unsigned long long x) { return x; }
+ static const bool is_signed = false;
+ static const char *size_specifier() { return "ll"; }
+};
+
+template <typename P>
+class pformat_base
{
public:
- pformat(const pstring &fmt);
- pformat(const char *fmt);
+
+ virtual ~pformat_base() { }
+
+ ATTR_COLD P &operator ()(const double x, const char *f = "") { format_element(f, "", "f", x); return static_cast<P &>(*this); }
+ ATTR_COLD P & e(const double x, const char *f = "") { format_element(f, "", "e", x); return static_cast<P &>(*this); }
+ ATTR_COLD P & g(const double x, const char *f = "") { format_element(f, "", "g", x); return static_cast<P &>(*this); }
+
+ ATTR_COLD P &operator ()(const char *x, const char *f = "") { format_element(f, "", "s", x); return static_cast<P &>(*this); }
+ ATTR_COLD P &operator ()(char *x, const char *f = "") { format_element(f, "", "s", x); return static_cast<P &>(*this); }
+ ATTR_COLD P &operator ()(const void *x, const char *f = "") { format_element(f, "", "p", x); return static_cast<P &>(*this); }
+ ATTR_COLD P &operator ()(const pstring &x, const char *f = "") { format_element(f, "", "s", x.cstr() ); return static_cast<P &>(*this); }
+
+ template<typename T>
+ ATTR_COLD P &operator ()(const T x, const char *f = "")
+ {
+ if (ptype_treats<T>::is_signed)
+ format_element(f, ptype_treats<T>::size_specifier(), "d", ptype_treats<T>::cast(x));
+ else
+ format_element(f, ptype_treats<T>::size_specifier(), "u", ptype_treats<T>::cast(x));
+ return static_cast<P &>(*this);
+ }
+
+ template<typename T>
+ ATTR_COLD P &x(const T x, const char *f = "")
+ {
+ format_element(f, ptype_treats<T>::size_specifier(), "x", x);
+ return static_cast<P &>(*this);
+ }
+
+ template<typename T>
+ ATTR_COLD P &o(const T x, const char *f = "")
+ {
+ format_element(f, ptype_treats<T>::size_specifier(), "o", x);
+ return static_cast<P &>(*this);
+ }
+
+protected:
+
+ virtual void format_element(const char *f, const char *l, const char *fmt_spec, ...) = 0;
+
+};
+
+class pfmt : public pformat_base<pfmt>
+{
+public:
+ ATTR_COLD pfmt(const pstring &fmt);
+ ATTR_COLD pfmt(const char *fmt);
operator pstring() const { return m_str; }
const char *cstr() { return m_str; }
- pformat &operator ()(const INT64 x, const char *f = "") { return update(f, I64FMT "d", x); }
- pformat &operator ()(const UINT64 x, const char *f = "") { return update(f, I64FMT "u", x); }
- pformat &x (const INT64 x, const char *f = "") { return update(f, I64FMT "x", x); }
- pformat &x (const UINT64 x, const char *f = "") { return update(f, I64FMT "x", x); }
+protected:
+ void format_element(const char *f, const char *l, const char *fmt_spec, ...);
+
+private:
+
+ char m_str[2048];
+ unsigned m_arg;
+};
+
+enum plog_level
+{
+ DEBUG,
+ INFO,
+ VERBOSE,
+ WARNING,
+ ERROR,
+ FATAL
+};
+
+class plog_dispatch_intf;
+
+template <bool build_enabled = true>
+class pfmt_writer_t
+{
+public:
+ pfmt_writer_t() { }
+ virtual ~pfmt_writer_t() { }
- pformat &operator ()(const INT32 x, const char *f = "") { return update(f, "d", x); }
- pformat &operator ()(const UINT32 x, const char *f = "") { return update(f, "u", x); }
+ ATTR_COLD void operator ()(const char *fmt) const
+ {
+ if (build_enabled) vdowrite(fmt);
+ }
- pformat &x (const INT32 x, const char *f = "") { return update(f, "x", x); }
- pformat &x (const UINT32 x, const char *f = "") { return update(f, "x", x); }
+ template<typename T1>
+ ATTR_COLD void operator ()(const char *fmt, const T1 &v1) const
+ {
+ if (build_enabled) vdowrite(pfmt(fmt)(v1));
+ }
- pformat &operator ()(const INT16 x, const char *f = "") { return update(f, "hd", x); }
- pformat &operator ()(const UINT16 x, const char *f = "") { return update(f, "hu", x); }
+ template<typename T1, typename T2>
+ ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2) const
+ {
+ if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2));
+ }
-#if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(EMSCRIPTEN)
- pformat &operator ()(const std::size_t x, const char *f = "") { return update(f, SIZETFMT, x); }
-#endif
- pformat &operator ()(const double x, const char *f = "") { return update(f, "g", x); }
- pformat & e(const double x, const char *f = "") { return update(f, "e", x); }
- pformat & f(const double x, const char *f = "") { return update(f, "f", x); }
+ template<typename T1, typename T2, typename T3>
+ ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3) const
+ {
+ if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3));
+ }
- pformat &operator ()(const char *x, const char *f = "") { return update(f, "s", x); }
- pformat &operator ()(const void *x, const char *f = "") { return update(f, "p", x); }
- pformat &operator ()(const pstring &x, const char *f = "") { return update(f, "s", x.cstr() ); }
+ template<typename T1, typename T2, typename T3, typename T4>
+ ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4) const
+ {
+ if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4));
+ }
+
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ ATTR_COLD void operator ()(const char *fmt, const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4, const T5 &v5) const
+ {
+ if (build_enabled) vdowrite(pfmt(fmt)(v1)(v2)(v3)(v4)(v5));
+ }
+
+protected:
+ virtual void vdowrite(const pstring &ls) const {}
+
+};
+
+template <plog_level L, bool build_enabled = true>
+class plog_channel : public pfmt_writer_t<build_enabled>
+{
+public:
+ plog_channel(plog_dispatch_intf *b) : pfmt_writer_t<build_enabled>(), m_base(b) { }
+ virtual ~plog_channel() { }
+
+protected:
+ virtual void vdowrite(const pstring &ls) const;
private:
+ plog_dispatch_intf *m_base;
+};
- pformat &update(const char *f, const char *l, ...);
+class plog_dispatch_intf
+{
+ template<plog_level, bool> friend class plog_channel;
- char m_str[2048];
- unsigned m_arg;
+public:
+ virtual ~plog_dispatch_intf() { }
+protected:
+ virtual void vlog(const plog_level &l, const pstring &ls) const = 0;
+};
+
+template<bool debug_enabled>
+class plog_base
+{
+public:
+
+ plog_base(plog_dispatch_intf *proxy)
+ : debug(proxy),
+ info(proxy),
+ verbose(proxy),
+ warning(proxy),
+ error(proxy),
+ fatal(proxy)
+ {}
+ virtual ~plog_base() {};
+
+ plog_channel<DEBUG, debug_enabled> debug;
+ plog_channel<INFO> info;
+ plog_channel<VERBOSE> verbose;
+ plog_channel<WARNING> warning;
+ plog_channel<ERROR> error;
+ plog_channel<FATAL> fatal;
};
-//const type_t vprintf(va_list args) const;
-//static const type_t sprintf(const char *format, ...) ATTR_PRINTF(1,2);
+template <plog_level L, bool build_enabled>
+void plog_channel<L, build_enabled>::vdowrite(const pstring &ls) const
+{
+ m_base->vlog(L, ls);
+}
+
#endif /* _PSTRING_H_ */
diff --git a/src/tools/nltool.c b/src/emu/netlist/prg/nltool.c
index ed9473efc02..9568ff0bfc0 100644
--- a/src/tools/nltool.c
+++ b/src/emu/netlist/prg/nltool.c
@@ -11,9 +11,9 @@
#include <cstdio>
#ifdef PSTANDALONE
- #if (PSTANDALONE)
+#if (PSTANDALONE)
#define PSTANDALONE_PROVIDED
- #endif
+#endif
#endif
#include "plib/poptions.h"
@@ -30,7 +30,7 @@
#include <ctime>
-#define osd_ticks_t clock_t
+#define osd_ticks_t clock_t
inline osd_ticks_t osd_ticks_per_second() { return CLOCKS_PER_SEC; }
@@ -98,12 +98,12 @@ class tool_options_t : public poptions
public:
tool_options_t() :
poptions(),
- opt_ttr ("t", "time_to_run", 1.0, "time to run the emulation (seconds)", this),
+ opt_ttr ("t", "time_to_run", 1.0, "time to run the emulation (seconds)", this),
opt_name("n", "name", "", "netlist in file to run; default is first one", this),
opt_logs("l", "logs", "", "colon separated list of terminals to log", this),
opt_file("f", "file", "-", "file to process (default is stdin)", this),
opt_type("y", "type", "spice", "spice:eagle", "type of file to be converted: spice,eagle", this),
- opt_cmd ("c", "cmd", "run", "run|convert|listdevices", this),
+ opt_cmd ("c", "cmd", "run", "run|convert|listdevices", this),
opt_inp( "i", "input", "", "input file to process (default is none)", this),
opt_verb("v", "verbose", "be verbose - this produces lots of output", this),
opt_quiet("q", "quiet", "be quiet - no warnings", this),
@@ -113,7 +113,7 @@ public:
poption_double opt_ttr;
poption_str opt_name;
poption_str opt_logs;
- poption_str opt_file;
+ poption_str opt_file;
poption_str_limit opt_type;
poption_str opt_cmd;
poption_str opt_inp;
@@ -209,9 +209,9 @@ public:
void log_setup()
{
- NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
+ log().debug("Creating dynamic logs ...\n");
pstring_list_t ll(m_opts ? m_opts->opt_logs() : "" , ":");
- for (int i=0; i < ll.size(); i++)
+ for (unsigned i=0; i < ll.size(); i++)
{
pstring name = "log_" + ll[i];
/*netlist_device_t *nc = */ m_setup->register_dev("LOG", name);
@@ -223,27 +223,30 @@ public:
protected:
- void verror(const loglevel_e level, const char *format, va_list ap) const
+ void vlog(const plog_level &l, const pstring &ls) const
{
- switch (level)
+ switch (l)
{
- case NL_LOG:
+ case DEBUG:
+ case INFO:
+ break;
+ case VERBOSE:
if (m_opts ? m_opts->opt_verb() : false)
{
- vprintf(format, ap);
- printf("\n");
+ printf("%s\n", ls.cstr());
}
break;
- case NL_WARNING:
+ case WARNING:
if (!(m_opts ? m_opts->opt_quiet() : false))
{
- vprintf(format, ap);
- printf("\n");
+ printf("%s\n", ls.cstr());
}
break;
- case NL_ERROR:
- vprintf(format, ap);
- printf("\n");
+ case ERROR:
+ printf("%s\n", ls.cstr());
+ break;
+ case FATAL:
+ printf("%s\n", ls.cstr());
throw;
}
}
@@ -277,7 +280,7 @@ struct input_t
double t;
int e = sscanf(line.cstr(), "%lf,%[^,],%lf", &t, buf, &m_value);
if ( e!= 3)
- throw netlist::fatalerror_e(pformat("error %1 scanning line %2\n")(e)(line));
+ throw netlist::fatalerror_e(pfmt("error {1} scanning line {2}\n")(e)(line));
m_time = netlist::netlist_time::from_double(t);
m_param = netlist->setup().find_param(buf, true);
}
@@ -288,7 +291,7 @@ struct input_t
{
case netlist::param_t::MODEL:
case netlist::param_t::STRING:
- throw netlist::fatalerror_e(pformat("param %1 is not numeric\n")(m_param->name()));
+ throw netlist::fatalerror_e(pfmt("param {1} is not numeric\n")(m_param->name()));
case netlist::param_t::DOUBLE:
static_cast<netlist::param_double_t*>(m_param)->setTo(m_value);
break;
@@ -377,18 +380,18 @@ static void listdevices()
nt.setup().start_devices();
nt.setup().resolve_inputs();
- for (int i=0; i < list.size(); i++)
+ for (unsigned i=0; i < list.size(); i++)
{
netlist::base_factory_t *f = list.value_at(i);
- pstring out = pformat("%1 %2(<id>")(f->classname(),"-20")(f->name());
+ pstring out = pfmt("{1} {2}(<id>")(f->classname(),"-20")(f->name());
pstring terms("");
netlist::device_t *d = f->Create();
- d->init(nt, pformat("dummy%1")(i));
+ d->init(nt, pfmt("dummy{1}")(i));
d->start_dev();
// get the list of terminals ...
- for (int j=0; j < d->m_terminals.size(); j++)
+ for (unsigned j=0; j < d->m_terminals.size(); j++)
{
pstring inp = d->m_terminals[j];
if (inp.startsWith(d->name() + "."))
diff --git a/src/tools/nlwav.c b/src/emu/netlist/prg/nlwav.c
index 8f9c57c7ac5..8f9c57c7ac5 100644
--- a/src/tools/nlwav.c
+++ b/src/emu/netlist/prg/nlwav.c
diff --git a/src/emu/netlist/solver/mat_cr.h b/src/emu/netlist/solver/mat_cr.h
index 21f68366bc9..ea72884c1de 100644
--- a/src/emu/netlist/solver/mat_cr.h
+++ b/src/emu/netlist/solver/mat_cr.h
@@ -21,7 +21,8 @@ struct mat_cr_t
unsigned ja[_storage_N * _storage_N];
unsigned diag[_storage_N]; /* n */
- void mult_vec(const double * RESTRICT A, const double * RESTRICT x, double * RESTRICT res)
+ template<typename T>
+ void mult_vec(const T * RESTRICT A, const T * RESTRICT x, T * RESTRICT res)
{
/*
* res = A * x
@@ -41,7 +42,7 @@ struct mat_cr_t
}
}
- void incomplete_LU_factorization(const double * RESTRICT A, double * RESTRICT LU)
+ void incomplete_LU_factorization(const nl_double * RESTRICT A, nl_double * RESTRICT LU)
{
/*
* incomplete LU Factorization according to http://de.wikipedia.org/wiki/ILU-Zerlegung
@@ -80,7 +81,7 @@ struct mat_cr_t
}
}
- void solveLUx (const double * RESTRICT LU, double * RESTRICT r)
+ void solveLUx (const nl_double * RESTRICT LU, nl_double * RESTRICT r)
{
/*
* Solve a linear equation Ax = r
diff --git a/src/emu/netlist/solver/nld_ms_direct.h b/src/emu/netlist/solver/nld_ms_direct.h
index 5263c3e5f9c..d05480b2715 100644
--- a/src/emu/netlist/solver/nld_ms_direct.h
+++ b/src/emu/netlist/solver/nld_ms_direct.h
@@ -45,6 +45,11 @@ protected:
ATTR_HOT void build_LE_RHS(nl_double * RESTRICT rhs);
ATTR_HOT void LE_solve();
ATTR_HOT void LE_back_subst(nl_double * RESTRICT x);
+
+ /* Full LU back substitution, not used currently, in for future use */
+
+ ATTR_HOT void LE_back_subst_full(nl_double * RESTRICT x);
+
ATTR_HOT nl_double delta(const nl_double * RESTRICT V);
ATTR_HOT void store(const nl_double * RESTRICT V);
@@ -54,8 +59,9 @@ protected:
*/
ATTR_HOT nl_double compute_next_timestep();
- ATTR_ALIGN nl_ext_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
- //ATTR_ALIGN nl_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
+ template <typename T1, typename T2>
+ inline nl_ext_double &A(const T1 r, const T2 c) { return m_A[r][c]; }
+
ATTR_ALIGN nl_double m_RHS[_storage_N];
ATTR_ALIGN nl_double m_last_RHS[_storage_N]; // right hand side - contains currents
ATTR_ALIGN nl_double m_last_V[_storage_N];
@@ -64,9 +70,9 @@ protected:
terms_t *m_rails_temp;
private:
+ ATTR_ALIGN nl_ext_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
const unsigned m_dim;
- nl_double m_lp_fact;
};
// ----------------------------------------------------------------------------------------
@@ -136,13 +142,12 @@ ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::add_term(int k, terminal
if (ot>=0)
{
m_terms[k]->add(term, ot, true);
- SOLVER_VERBOSE_OUT(("Net %d Term %s %f %f\n", k, terms[i]->name().cstr(), terms[i]->m_gt, terms[i]->m_go));
}
/* Should this be allowed ? */
else // if (ot<0)
{
m_rails_temp[k].add(term, ot, true);
- netlist().error("found term with missing othernet %s\n", term->name().cstr());
+ log().fatal("found term with missing othernet {1}\n", term->name());
}
}
}
@@ -152,7 +157,7 @@ template <unsigned m_N, unsigned _storage_N>
ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
{
if (m_dim < nets.size())
- netlist().error("Dimension %d less than %" SIZETFMT, m_dim, SIZET_PRINTF(nets.size()));
+ log().fatal("Dimension {1} less than {2}", m_dim, nets.size());
for (unsigned k = 0; k < N(); k++)
{
@@ -259,13 +264,40 @@ ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::lis
psort_list(t->m_nz);
}
- if(0)
+ /* create a list of non zero elements below diagonal k
+ * This should reduce cache misses ...
+ */
+
+ bool touched[_storage_N][_storage_N] = { { false } };
+ for (unsigned k = 0; k < N(); k++)
+ {
+ m_terms[k]->m_nzbd.clear();
+ for (unsigned j = 0; j < m_terms[k]->m_nz.size(); j++)
+ touched[k][m_terms[k]->m_nz[j]] = true;
+ }
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ for (unsigned row = k + 1; row < N(); row++)
+ {
+ if (touched[row][k])
+ {
+ if (!m_terms[k]->m_nzbd.contains(row))
+ m_terms[k]->m_nzbd.add(row);
+ for (unsigned col = k; col < N(); col++)
+ if (touched[k][col])
+ touched[row][col] = true;
+ }
+ }
+ }
+
+ if (0)
for (unsigned k = 0; k < N(); k++)
{
- netlist().log("%3d: ", k);
+ pstring line = pfmt("{1}")(k, "3");
for (unsigned j = 0; j < m_terms[k]->m_nzrd.size(); j++)
- netlist().log(" %3d", m_terms[k]->m_nzrd[j]);
- netlist().log("\n");
+ line += pfmt(" {1}")(m_terms[k]->m_nzrd[j], "3");
+ log().verbose("{1}", line);
}
/*
@@ -277,7 +309,7 @@ ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::lis
for (unsigned k = 0; k < N(); k++)
{
- pstring num = pformat("%1")(k);
+ pstring num = pfmt("{1}")(k);
save(m_terms[k]->go(),"GO" + num, m_terms[k]->count());
save(m_terms[k]->gt(),"GT" + num, m_terms[k]->count());
@@ -294,22 +326,25 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_A()
for (unsigned k = 0; k < iN; k++)
{
for (unsigned i=0; i < iN; i++)
- m_A[k][i] = 0.0;
+ A(k,i) = 0.0;
- nl_double akk = 0.0;
const unsigned terms_count = m_terms[k]->count();
const unsigned railstart = m_terms[k]->m_railstart;
const nl_double * RESTRICT gt = m_terms[k]->gt();
- const nl_double * RESTRICT go = m_terms[k]->go();
- const int * RESTRICT net_other = m_terms[k]->net_other();
- for (unsigned i = 0; i < terms_count; i++)
- akk = akk + gt[i];
+ {
+ nl_double akk = 0.0;
+ for (unsigned i = 0; i < terms_count; i++)
+ akk += gt[i];
- m_A[k][k] += akk;
+ A(k,k) = akk;
+ }
+
+ const nl_double * RESTRICT go = m_terms[k]->go();
+ const int * RESTRICT net_other = m_terms[k]->net_other();
for (unsigned i = 0; i < railstart; i++)
- m_A[k][net_other[i]] -= go[i];
+ A(k,net_other[i]) -= go[i];
}
}
@@ -341,54 +376,41 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS(nl_double *
template <unsigned m_N, unsigned _storage_N>
ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
{
-#if 0
- for (int i = 0; i < N(); i++)
- {
- for (int k = 0; k < N(); k++)
- printf("%f ", m_A[i][k]);
- printf("| %f = %f \n", x[i], m_RHS[i]);
- }
- printf("\n");
-#endif
-
const unsigned kN = N();
for (unsigned i = 0; i < kN; i++) {
- // FIXME: use a parameter to enable pivoting?
- if (USE_PIVOT_SEARCH)
+ // FIXME: use a parameter to enable pivoting? m_pivot
+ if (m_params.m_pivot)
{
/* Find the row with the largest first value */
unsigned maxrow = i;
for (unsigned j = i + 1; j < kN; j++)
{
//if (std::abs(m_A[j][i]) > std::abs(m_A[maxrow][i]))
- if (m_A[j][i] * m_A[j][i] > m_A[maxrow][i] * m_A[maxrow][i])
+ if (A(j,i) * A(j,i) > A(maxrow,i) * A(maxrow,i))
maxrow = j;
}
if (maxrow != i)
{
/* Swap the maxrow and ith row */
- for (unsigned k = i; k < kN; k++) {
- std::swap(m_A[i][k], m_A[maxrow][k]);
+ for (unsigned k = 0; k < kN; k++) {
+ std::swap(A(i,k), A(maxrow,k));
}
std::swap(m_RHS[i], m_RHS[maxrow]);
}
/* FIXME: Singular matrix? */
- const nl_double f = 1.0 / m_A[i][i];
- const nl_ext_double * RESTRICT s = &m_A[i][i+1];
+ const nl_double f = 1.0 / A(i,i);
/* Eliminate column i from row j */
for (unsigned j = i + 1; j < kN; j++)
{
- nl_ext_double * RESTRICT d = &m_A[j][i+1];
- const nl_double f1 = - m_A[j][i] * f;
+ const nl_double f1 = - A(j,i) * f;
if (f1 != NL_FCONST(0.0))
{
- const unsigned e = kN - i - 1;
- for (unsigned k = 0; k < e; k++)
- d[k] = d[k] + s[k] * f1;
+ for (unsigned k = i+1; k < kN; k++)
+ A(j,k) += A(i,k) * f1;
m_RHS[j] += m_RHS[i] * f1;
}
}
@@ -396,41 +418,23 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
else
{
/* FIXME: Singular matrix? */
- const nl_double f = 1.0 / m_A[i][i];
- const nl_ext_double * RESTRICT s = &m_A[i][0];
- const unsigned *p = m_terms[i]->m_nzrd.data();
+ const nl_double f = 1.0 / A(i,i);
+ const unsigned * RESTRICT const p = m_terms[i]->m_nzrd.data();
const unsigned e = m_terms[i]->m_nzrd.size();
/* Eliminate column i from row j */
- for (unsigned j = i + 1; j < kN; j++)
+ const unsigned * RESTRICT const pb = m_terms[i]->m_nzbd.data();
+ const unsigned eb = m_terms[i]->m_nzbd.size();
+ for (unsigned jb = 0; jb < eb; jb++)
{
- nl_ext_double * RESTRICT d = &m_A[j][0];
- const nl_double f1 = - d[i] * f;
- if (f1 != NL_FCONST(0.0))
+ const unsigned j = pb[jb];
+ const nl_double f1 = - A(j,i) * f;
+ for (unsigned k = 0; k < e; k++)
{
- #if 0
- /* The code below is 30% faster than the original
- * implementation which is given here for reference.
- *
- * for (unsigned k = i + 1; k < kN; k++)
- * m_A[j][k] = m_A[j][k] + m_A[i][k] * f1;
- */
- double * RESTRICT d = &m_A[j][i+1];
- const double * RESTRICT s = &m_A[i][i+1];
- const int e = kN - i - 1;
-
- for (int k = 0; k < e; k++)
- d[k] = d[k] + s[k] * f1;
- #else
- for (unsigned k = 0; k < e; k++)
- {
- const unsigned pk = p[k];
- d[pk] += s[pk] * f1;
- }
- #endif
- m_RHS[j] += m_RHS[i] * f1;
+ A(j,p[k]) += A(i,p[k]) * f1;
}
+ m_RHS[j] += m_RHS[i] * f1;
}
}
}
@@ -443,44 +447,66 @@ ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst(
const unsigned kN = N();
/* back substitution */
- for (int j = kN - 1; j >= 0; j--)
+ if (m_params.m_pivot)
{
- nl_double tmp = 0;
-
-#if 1
-#if (USE_PIVOT_SEARCH)
- const nl_ext_double * RESTRICT A = &m_A[j][j+1];
- const nl_double * RESTRICT xp = &x[j+1];
- const unsigned e = kN - j - 1;
- for (unsigned k = 0; k < e; k++)
- tmp += A[k] * xp[k];
-#else
- const nl_ext_double * RESTRICT A = &m_A[j][0];
- const unsigned *p = m_terms[j]->m_nzrd.data();
- const unsigned e = m_terms[j]->m_nzrd.size();
-
- for (unsigned k = 0; k < e; k++)
+ for (int j = kN - 1; j >= 0; j--)
{
- const unsigned pk = p[k];
- tmp += A[pk] * x[pk];
+ nl_double tmp = 0;
+ for (unsigned k = j+1; k < kN; k++)
+ tmp += A(j,k) * x[k];
+ x[j] = (m_RHS[j] - tmp) / A(j,j);
}
-#endif
-#else
- for (unsigned k = j + 1; k < kN; k++)
- tmp += m_A[j][k] * x[k];
-#endif
- x[j] = (m_RHS[j] - tmp) / m_A[j][j];
}
-#if 0
- printf("Solution:\n");
- for (unsigned i = 0; i < N(); i++)
+ else
{
- for (unsigned k = 0; k < N(); k++)
- printf("%f ", m_A[i][k]);
- printf("| %f = %f \n", x[i], m_RHS[i]);
+ for (int j = kN - 1; j >= 0; j--)
+ {
+ nl_double tmp = 0;
+
+ const unsigned *p = m_terms[j]->m_nzrd.data();
+ const unsigned e = m_terms[j]->m_nzrd.size();
+
+ for (unsigned k = 0; k < e; k++)
+ {
+ const unsigned pk = p[k];
+ tmp += A(j,pk) * x[pk];
+ }
+ x[j] = (m_RHS[j] - tmp) / A(j,j);
+ }
+ }
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst_full(
+ nl_double * RESTRICT x)
+{
+ const unsigned kN = N();
+
+ /* back substitution */
+
+ // int ip;
+ // ii=-1
+
+ //for (int i=0; i < kN; i++)
+ // x[i] = m_RHS[i];
+
+ for (int i=0; i < kN; i++)
+ {
+ //ip=indx[i]; USE_PIVOT_SEARCH
+ //sum=b[ip];
+ //b[ip]=b[i];
+ double sum=m_RHS[i];//x[i];
+ for (int j=0; j < i; j++)
+ sum -= A(i,j) * x[j];
+ x[i]=sum;
+ }
+ for (int i=kN-1; i >= 0; i--)
+ {
+ double sum=x[i];
+ for (int j = i+1; j < kN; j++)
+ sum -= A(i,j)*x[j];
+ x[i] = sum / A(i,i);
}
- printf("\n");
-#endif
}
@@ -527,33 +553,11 @@ ATTR_HOT int matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(ATTR_UNU
if (newton_raphson)
{
-#if 0
- /* limiting just doesn't work. */
- const unsigned iN = this->N();
- double err = 0;
- for (unsigned k = 0; k < iN; k++)
- {
- const double ov = this->m_nets[k]->m_cur_Analog;
- double d = new_V[k] - ov;
- err = std::max(nl_math::abs(d), err);
- }
- double a = 1.05;
- for (unsigned k = 0; k < iN; k++)
- {
- const double ov = this->m_nets[k]->m_cur_Analog;
- double d = new_V[k] - ov;
- const double nv = ov + a * d;
- this->m_nets[k]->m_cur_Analog = nv;
- }
-
- return (err > this->m_params.m_accuracy) ? 2 : 1;
-#else
nl_double err = delta(new_V);
store(new_V);
return (err > this->m_params.m_accuracy) ? 2 : 1;
-#endif
}
else
{
@@ -580,7 +584,6 @@ template <unsigned m_N, unsigned _storage_N>
matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const solver_parameters_t *params, const int size)
: matrix_solver_t(GAUSSIAN_ELIMINATION, params)
, m_dim(size)
-, m_lp_fact(0)
{
m_terms = palloc_array(terms_t *, N());
m_rails_temp = palloc_array(terms_t, N());
@@ -597,7 +600,6 @@ template <unsigned m_N, unsigned _storage_N>
matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size)
: matrix_solver_t(type, params)
, m_dim(size)
-, m_lp_fact(0)
{
m_terms = palloc_array(terms_t *, N());
m_rails_temp = palloc_array(terms_t, N());
diff --git a/src/emu/netlist/solver/nld_ms_direct1.h b/src/emu/netlist/solver/nld_ms_direct1.h
index 85bb0388168..9f895a6c3f3 100644
--- a/src/emu/netlist/solver/nld_ms_direct1.h
+++ b/src/emu/netlist/solver/nld_ms_direct1.h
@@ -41,9 +41,9 @@ ATTR_HOT inline int matrix_solver_direct1_t::vsolve_non_dynamic(ATTR_UNUSED cons
analog_net_t *net = m_nets[0];
this->build_LE_A();
this->build_LE_RHS(m_RHS);
- //NL_VERBOSE_OUT(("%f %f\n", new_val, m_RHS[0] / m_A[0][0]);
+ //NL_VERBOSE_OUT(("{1} {2}\n", new_val, m_RHS[0] / m_A[0][0]);
- nl_double new_val = m_RHS[0] / m_A[0][0];
+ nl_double new_val = m_RHS[0] / A(0,0);
nl_double e = (new_val - net->m_cur_Analog);
nl_double cerr = nl_math::abs(e);
diff --git a/src/emu/netlist/solver/nld_ms_direct2.h b/src/emu/netlist/solver/nld_ms_direct2.h
index 10060f2a767..f78c36770e6 100644
--- a/src/emu/netlist/solver/nld_ms_direct2.h
+++ b/src/emu/netlist/solver/nld_ms_direct2.h
@@ -41,10 +41,10 @@ ATTR_HOT inline int matrix_solver_direct2_t::vsolve_non_dynamic(ATTR_UNUSED cons
build_LE_A();
build_LE_RHS(m_RHS);
- const nl_double a = m_A[0][0];
- const nl_double b = m_A[0][1];
- const nl_double c = m_A[1][0];
- const nl_double d = m_A[1][1];
+ const nl_double a = A(0,0);
+ const nl_double b = A(0,1);
+ const nl_double c = A(1,0);
+ const nl_double d = A(1,1);
nl_double new_val[2];
new_val[1] = (a * m_RHS[1] - c * m_RHS[0]) / (a * d - b * c);
diff --git a/src/emu/netlist/solver/nld_ms_direct_lu.h b/src/emu/netlist/solver/nld_ms_direct_lu.h
new file mode 100644
index 00000000000..633e135cbe4
--- /dev/null
+++ b/src/emu/netlist/solver/nld_ms_direct_lu.h
@@ -0,0 +1,652 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * nld_ms_direct.h
+ *
+ */
+
+#ifndef NLD_MS_DIRECT_H_
+#define NLD_MS_DIRECT_H_
+
+#include <algorithm>
+
+#include "solver/nld_solver.h"
+
+//#define A(_r, _c) m_A[_r][_c]
+
+NETLIB_NAMESPACE_DEVICES_START()
+
+//#define nl_ext_double __float128 // slow, very slow
+//#define nl_ext_double long double // slightly slower
+#define nl_ext_double double
+
+template <unsigned m_N, unsigned _storage_N>
+class matrix_solver_direct_t: public matrix_solver_t
+{
+public:
+
+ matrix_solver_direct_t(const solver_parameters_t *params, const int size);
+ matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size);
+
+ virtual ~matrix_solver_direct_t();
+
+ virtual void vsetup(analog_net_t::list_t &nets);
+ virtual void reset() { matrix_solver_t::reset(); }
+
+ ATTR_HOT inline unsigned N() const { if (m_N == 0) return m_dim; else return m_N; }
+
+ ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
+
+protected:
+ virtual void add_term(int net_idx, terminal_t *term);
+
+ ATTR_HOT virtual nl_double vsolve();
+
+ ATTR_HOT int solve_non_dynamic(const bool newton_raphson);
+ ATTR_HOT void build_LE_A();
+ ATTR_HOT void build_LE_RHS(nl_double * RESTRICT rhs);
+
+ template<unsigned k>
+ void LEk()
+ {
+ //const unsigned kN = N();
+
+ const double akki = 1.0 / A(k,k);
+ const unsigned * const p = m_terms[k]->m_nzrd.data();
+ const unsigned e = m_terms[k]->m_nzrd.size();
+
+ for (int i = k+1; i < _storage_N;i++)
+ {
+ const double alpha = A(i,k) * akki;
+ A(i,k) = alpha;
+ if (alpha != 0.0)
+ for (int j = 0; j < e; j++)
+ {
+ const int pk = p[j];
+ A(i,pk) -= A(k,pk) * alpha;
+ }
+ }
+ }
+
+ ATTR_HOT void LE_solve()
+ {
+ const unsigned kN = N();
+ unsigned sk = 1;
+
+ if (1 && kN == _storage_N)
+ {
+ if (kN> 0 ) LEk<0>();
+ if (kN> 1 ) LEk<1>();
+ if (kN> 2 ) LEk<2>();
+ if (kN> 3 ) LEk<3>();
+ if (kN> 4 ) LEk<4>();
+ if (kN> 5 ) LEk<5>();
+ if (kN> 6 ) LEk<6>();
+ if (kN> 7 ) LEk<7>();
+ if (kN> 8 ) LEk<8>();
+ if (kN> 9 ) LEk<9>();
+ if (kN>10 ) LEk<10>();
+ if (kN>11 ) LEk<11>();
+ if (kN>12 ) LEk<12>();
+ if (kN>13 ) LEk<13>();
+ if (kN>14 ) LEk<14>();
+ if (kN>15 ) LEk<15>();
+ if (kN>16 ) LEk<16>();
+ if (kN>17 ) LEk<17>();
+ if (kN>18 ) LEk<18>();
+ if (kN>19 ) LEk<19>();
+ if (kN>20 ) LEk<20>();
+ if (kN>21 ) LEk<21>();
+ if (kN>22 ) LEk<22>();
+ if (kN>23 ) LEk<23>();
+ if (kN>24 ) LEk<24>();
+ if (kN>25 ) LEk<25>();
+ if (kN>26 ) LEk<26>();
+ if (kN>27 ) LEk<27>();
+ if (kN>28 ) LEk<28>();
+ if (kN>29 ) LEk<29>();
+ sk = 30;
+ }
+
+ for (int k = sk; k < kN - 1; k++)
+ {
+ const double akki = 1.0 / A(k,k);
+ const unsigned * const p = m_terms[k]->m_nzrd.data();
+ const unsigned e = m_terms[k]->m_nzrd.size();
+
+ for (int i = k+1; i < kN;i++)
+ {
+ const double alpha = A(i,k) * akki;
+ A(i,k) = alpha;
+ if (alpha != 0.0)
+ for (int j = 0; j < e; j++)
+ {
+ const int pk = p[j];
+ A(i,pk) -= A(k,pk) * alpha;
+ }
+ }
+ }
+ }
+ ATTR_HOT void LE_back_subst(nl_double * RESTRICT x);
+ ATTR_HOT nl_double delta(const nl_double * RESTRICT V);
+ ATTR_HOT void store(const nl_double * RESTRICT V);
+
+ /* bring the whole system to the current time
+ * Don't schedule a new calculation time. The recalculation has to be
+ * triggered by the caller after the netlist element was changed.
+ */
+ ATTR_HOT nl_double compute_next_timestep();
+
+ template <typename T1, typename T2>
+ inline nl_ext_double &A(const T1 r, const T2 c) { return m_A[r][c]; }
+
+ //ATTR_ALIGN nl_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
+ ATTR_ALIGN nl_double m_RHS[_storage_N];
+ ATTR_ALIGN nl_double m_last_RHS[_storage_N]; // right hand side - contains currents
+ ATTR_ALIGN nl_double m_last_V[_storage_N];
+
+ terms_t **m_terms;
+ terms_t *m_rails_temp;
+
+private:
+ ATTR_ALIGN nl_ext_double m_A[_storage_N][((_storage_N + 7) / 8) * 8];
+
+ const unsigned m_dim;
+ nl_double m_lp_fact;
+};
+
+// ----------------------------------------------------------------------------------------
+// matrix_solver_direct
+// ----------------------------------------------------------------------------------------
+
+template <unsigned m_N, unsigned _storage_N>
+matrix_solver_direct_t<m_N, _storage_N>::~matrix_solver_direct_t()
+{
+ for (unsigned k = 0; k < N(); k++)
+ {
+ pfree(m_terms[k]);
+ }
+ pfree_array(m_terms);
+ pfree_array(m_rails_temp);
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT nl_double matrix_solver_direct_t<m_N, _storage_N>::compute_next_timestep()
+{
+ nl_double new_solver_timestep = m_params.m_max_timestep;
+
+ if (m_params.m_dynamic)
+ {
+ /*
+ * FIXME: We should extend the logic to use either all nets or
+ * only output nets.
+ */
+ for (unsigned k = 0, iN=N(); k < iN; k++)
+ {
+ analog_net_t *n = m_nets[k];
+
+ const nl_double DD_n = (n->m_cur_Analog - m_last_V[k]);
+ const nl_double hn = current_timestep();
+
+ nl_double DD2 = (DD_n / hn - n->m_DD_n_m_1 / n->m_h_n_m_1) / (hn + n->m_h_n_m_1);
+ nl_double new_net_timestep;
+
+ n->m_h_n_m_1 = hn;
+ n->m_DD_n_m_1 = DD_n;
+ if (nl_math::abs(DD2) > NL_FCONST(1e-30)) // avoid div-by-zero
+ new_net_timestep = nl_math::sqrt(m_params.m_lte / nl_math::abs(NL_FCONST(0.5)*DD2));
+ else
+ new_net_timestep = m_params.m_max_timestep;
+
+ if (new_net_timestep < new_solver_timestep)
+ new_solver_timestep = new_net_timestep;
+ }
+ if (new_solver_timestep < m_params.m_min_timestep)
+ new_solver_timestep = m_params.m_min_timestep;
+ }
+ //if (new_solver_timestep > 10.0 * hn)
+ // new_solver_timestep = 10.0 * hn;
+ return new_solver_timestep;
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::add_term(int k, terminal_t *term)
+{
+ if (term->m_otherterm->net().isRailNet())
+ {
+ m_rails_temp[k].add(term, -1, false);
+ }
+ else
+ {
+ int ot = get_net_idx(&term->m_otherterm->net());
+ if (ot>=0)
+ {
+ m_terms[k]->add(term, ot, true);
+ }
+ /* Should this be allowed ? */
+ else // if (ot<0)
+ {
+ m_rails_temp[k].add(term, ot, true);
+ netlist().error("found term with missing othernet {1}\n", term->name());
+ }
+ }
+}
+
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_COLD void matrix_solver_direct_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
+{
+ if (m_dim < nets.size())
+ netlist().error("Dimension {1} less than {2}", m_dim, SIZET_PRINTF(nets.size()));
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ m_terms[k]->clear();
+ m_rails_temp[k].clear();
+ }
+
+ matrix_solver_t::setup(nets);
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ m_terms[k]->m_railstart = m_terms[k]->count();
+ for (unsigned i = 0; i < m_rails_temp[k].count(); i++)
+ this->m_terms[k]->add(m_rails_temp[k].terms()[i], m_rails_temp[k].net_other()[i], false);
+
+ m_rails_temp[k].clear(); // no longer needed
+ m_terms[k]->set_pointers();
+ }
+
+#if 1
+
+ /* Sort in descending order by number of connected matrix voltages.
+ * The idea is, that for Gauss-Seidel algo the first voltage computed
+ * depends on the greatest number of previous voltages thus taking into
+ * account the maximum amout of information.
+ *
+ * This actually improves performance on popeye slightly. Average
+ * GS computations reduce from 2.509 to 2.370
+ *
+ * Smallest to largest : 2.613
+ * Unsorted : 2.509
+ * Largest to smallest : 2.370
+ *
+ * Sorting as a general matrix pre-conditioning is mentioned in
+ * literature but I have found no articles about Gauss Seidel.
+ *
+ * For Gaussian Elimination however increasing order is better suited.
+ * FIXME: Even better would be to sort on elements right of the matrix diagonal.
+ *
+ */
+
+ int sort_order = (type() == GAUSS_SEIDEL ? 1 : -1);
+
+ for (unsigned k = 0; k < N() / 2; k++)
+ for (unsigned i = 0; i < N() - 1; i++)
+ {
+ if ((m_terms[i]->m_railstart - m_terms[i+1]->m_railstart) * sort_order < 0)
+ {
+ std::swap(m_terms[i],m_terms[i+1]);
+ m_nets.swap(i, i+1);
+ }
+ }
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ int *other = m_terms[k]->net_other();
+ for (unsigned i = 0; i < m_terms[k]->count(); i++)
+ if (other[i] != -1)
+ other[i] = get_net_idx(&m_terms[k]->terms()[i]->m_otherterm->net());
+ }
+
+#endif
+
+ /* create a list of non zero elements right of the diagonal
+ * These list anticipate the population of array elements by
+ * Gaussian elimination.
+ */
+ for (unsigned k = 0; k < N(); k++)
+ {
+ terms_t * t = m_terms[k];
+ /* pretty brutal */
+ int *other = t->net_other();
+
+ t->m_nz.clear();
+
+ if (k==0)
+ t->m_nzrd.clear();
+ else
+ {
+ t->m_nzrd = m_terms[k-1]->m_nzrd;
+ unsigned j=0;
+ while(j < t->m_nzrd.size())
+ {
+ if (t->m_nzrd[j] < k + 1)
+ t->m_nzrd.remove_at(j);
+ else
+ j++;
+ }
+ }
+
+ for (unsigned j = 0; j < N(); j++)
+ {
+ for (unsigned i = 0; i < t->m_railstart; i++)
+ {
+ if (!t->m_nzrd.contains(other[i]) && other[i] >= (int) (k + 1))
+ t->m_nzrd.add(other[i]);
+ if (!t->m_nz.contains(other[i]))
+ t->m_nz.add(other[i]);
+ }
+ }
+ psort_list(t->m_nzrd);
+
+ t->m_nz.add(k); // add diagonal
+ psort_list(t->m_nz);
+ }
+
+ if(0)
+ for (unsigned k = 0; k < N(); k++)
+ {
+ netlist().log("{1:3}: ", k);
+ for (unsigned j = 0; j < m_terms[k]->m_nzrd.size(); j++)
+ netlist().log(" {1:3}", m_terms[k]->m_nzrd[j]);
+ netlist().log("\n");
+ }
+
+ /*
+ * save states
+ */
+ save(NLNAME(m_RHS));
+ save(NLNAME(m_last_RHS));
+ save(NLNAME(m_last_V));
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ pstring num = pfmt("{1}")(k);
+
+ save(m_terms[k]->go(),"GO" + num, m_terms[k]->count());
+ save(m_terms[k]->gt(),"GT" + num, m_terms[k]->count());
+ save(m_terms[k]->Idr(),"IDR" + num , m_terms[k]->count());
+ }
+
+}
+
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_A()
+{
+ const unsigned iN = N();
+ for (unsigned k = 0; k < iN; k++)
+ {
+ for (unsigned i=0; i < iN; i++)
+ A(k,i) = 0.0;
+
+ nl_double akk = 0.0;
+ const unsigned terms_count = m_terms[k]->count();
+ const unsigned railstart = m_terms[k]->m_railstart;
+ const nl_double * RESTRICT gt = m_terms[k]->gt();
+ const nl_double * RESTRICT go = m_terms[k]->go();
+ const int * RESTRICT net_other = m_terms[k]->net_other();
+
+ for (unsigned i = 0; i < terms_count; i++)
+ akk = akk + gt[i];
+
+ A(k,k) += akk;
+
+ for (unsigned i = 0; i < railstart; i++)
+ A(k, net_other[i]) -= go[i];
+ }
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::build_LE_RHS(nl_double * RESTRICT rhs)
+{
+ const unsigned iN = N();
+ for (unsigned k = 0; k < iN; k++)
+ {
+ nl_double rhsk_a = 0.0;
+ nl_double rhsk_b = 0.0;
+
+ const int terms_count = m_terms[k]->count();
+ const nl_double * RESTRICT go = m_terms[k]->go();
+ const nl_double * RESTRICT Idr = m_terms[k]->Idr();
+ const nl_double * const * RESTRICT other_cur_analog = m_terms[k]->other_curanalog();
+
+ for (int i = 0; i < terms_count; i++)
+ rhsk_a = rhsk_a + Idr[i];
+
+ for (int i = m_terms[k]->m_railstart; i < terms_count; i++)
+ //rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog();
+ rhsk_b = rhsk_b + go[i] * *other_cur_analog[i];
+
+ rhs[k] = rhsk_a + rhsk_b;
+ }
+}
+
+#if 1
+#else
+// Crout algo
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_solve()
+{
+
+ const unsigned kN = N();
+
+ ATTR_UNUSED int imax;
+ ATTR_UNUSED double big,temp;
+
+#if 0
+ double vv[_storage_N];
+
+ for (i=0;i<kN;i++)
+ {
+ big=0.0;
+ for (j=0;j<kN;j++)
+ if ((temp=fabs(m_A[i][j])) > big)
+ big=temp;
+ //if (big == 0.0) nrerror("Singular matrix in routine LUDCMP");
+ vv[i]=1.0/big;
+ }
+#endif
+ for (int j = 0; j < kN; j++)
+ {
+#if 1
+ for (int i=0; i < kN;i++)
+ {
+ double sum = 0.0;
+ const int e = (i<j ? i : j);
+ for (int k=0; k < e; k++)
+ sum += A(i,k) * A(k,j);
+ A(i,j) -= sum;
+ }
+#else
+ for (int i=0; i < j;i++)
+ {
+ double * RESTRICT p = m_A[i];
+ double sum = 0.0;
+ for (int k=0; k < i; k++)
+ sum += p[k] * m_A[k][j];
+ p[j] -= sum;
+ }
+ big=0.0;
+ for (int i = j; i < kN; i++)
+ {
+ double * RESTRICT p = m_A[i];
+ double sum = 0.0;
+ for (int k = 0; k < j; k++)
+ sum += p[k] * m_A[k][j];
+ p[j] -= sum;
+#if 0
+ if ( (dum=vv[i]*fabs(sum)) >= big) {
+ big=dum;
+ imax=i;
+ }
+#endif
+ }
+#endif
+#if 0
+ // USE_PIVOT_SEARCH
+ // omit pivoting for now
+ if (j != imax)
+ {
+ for (k=0;k<kN;k++)
+ {
+ dum=m_A[imax][k];
+ m_A[imax][k]=m_A[j][k];
+ m_A[j][k]=dum;
+ }
+ //*d = -(*d);
+ vv[imax]=vv[j];
+ }
+ indx[j]=imax;
+#endif
+ //if (m_A[j][j] == 0.0)
+ // m_A[j][j] = 1e-20;
+ double dum = 1.0 / A(j,j);
+ for (int i = j+1; i < kN; i++)
+ A(i,j) *= dum;
+ }
+}
+#endif
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::LE_back_subst(
+ nl_double * RESTRICT x)
+{
+ const unsigned kN = N();
+
+ /* back substitution */
+
+ // int ip;
+ // ii=-1
+
+ //for (int i=0; i < kN; i++)
+ // x[i] = m_RHS[i];
+
+ for (int i=0; i < kN; i++)
+ {
+ //ip=indx[i]; USE_PIVOT_SEARCH
+ //sum=b[ip];
+ //b[ip]=b[i];
+ double sum=m_RHS[i];//x[i];
+ for (int j=0; j < i; j++)
+ sum -= A(i,j) * x[j];
+ x[i]=sum;
+ }
+ for (int i=kN-1; i >= 0; i--)
+ {
+ double sum=x[i];
+ for (int j = i+1; j < kN; j++)
+ sum -= A(i,j)*x[j];
+ x[i] = sum / A(i,i);
+ }
+
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT nl_double matrix_solver_direct_t<m_N, _storage_N>::delta(
+ const nl_double * RESTRICT V)
+{
+ /* FIXME: Ideally we should also include currents (RHS) here. This would
+ * need a revaluation of the right hand side after voltages have been updated
+ * and thus belong into a different calculation. This applies to all solvers.
+ */
+
+ const unsigned iN = this->N();
+ nl_double cerr = 0;
+ for (unsigned i = 0; i < iN; i++)
+ cerr = std::max(cerr, nl_math::abs(V[i] - this->m_nets[i]->m_cur_Analog));
+ return cerr;
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT void matrix_solver_direct_t<m_N, _storage_N>::store(
+ const nl_double * RESTRICT V)
+{
+ for (unsigned i = 0, iN=N(); i < iN; i++)
+ {
+ this->m_nets[i]->m_cur_Analog = V[i];
+ }
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT nl_double matrix_solver_direct_t<m_N, _storage_N>::vsolve()
+{
+ this->solve_base(this);
+ return this->compute_next_timestep();
+}
+
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT int matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(ATTR_UNUSED const bool newton_raphson)
+{
+ nl_double new_V[_storage_N]; // = { 0.0 };
+
+ this->LE_back_subst(new_V);
+
+ if (newton_raphson)
+ {
+ nl_double err = delta(new_V);
+
+ store(new_V);
+
+ return (err > this->m_params.m_accuracy) ? 2 : 1;
+ }
+ else
+ {
+ store(new_V);
+ return 1;
+ }
+}
+
+template <unsigned m_N, unsigned _storage_N>
+ATTR_HOT inline int matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(const bool newton_raphson)
+{
+ this->build_LE_A();
+ this->build_LE_RHS(m_last_RHS);
+
+ for (unsigned i=0, iN=N(); i < iN; i++)
+ m_RHS[i] = m_last_RHS[i];
+
+ this->LE_solve();
+
+ return this->solve_non_dynamic(newton_raphson);
+}
+
+template <unsigned m_N, unsigned _storage_N>
+matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const solver_parameters_t *params, const int size)
+: matrix_solver_t(GAUSSIAN_ELIMINATION, params)
+, m_dim(size)
+, m_lp_fact(0)
+{
+ m_terms = palloc_array(terms_t *, N());
+ m_rails_temp = palloc_array(terms_t, N());
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ m_terms[k] = palloc(terms_t);
+ m_last_RHS[k] = 0.0;
+ m_last_V[k] = 0.0;
+ }
+}
+
+template <unsigned m_N, unsigned _storage_N>
+matrix_solver_direct_t<m_N, _storage_N>::matrix_solver_direct_t(const eSolverType type, const solver_parameters_t *params, const int size)
+: matrix_solver_t(type, params)
+, m_dim(size)
+, m_lp_fact(0)
+{
+ m_terms = palloc_array(terms_t *, N());
+ m_rails_temp = palloc_array(terms_t, N());
+
+ for (unsigned k = 0; k < N(); k++)
+ {
+ m_terms[k] = palloc(terms_t);
+ m_last_RHS[k] = 0.0;
+ m_last_V[k] = 0.0;
+ }
+}
+
+NETLIB_NAMESPACE_DEVICES_END()
+
+#endif /* NLD_MS_DIRECT_H_ */
diff --git a/src/emu/netlist/solver/nld_ms_gmres.h b/src/emu/netlist/solver/nld_ms_gmres.h
index 9b8eca08b78..5983cb1a968 100644
--- a/src/emu/netlist/solver/nld_ms_gmres.h
+++ b/src/emu/netlist/solver/nld_ms_gmres.h
@@ -35,10 +35,10 @@ public:
unsigned mr=this->N(); /* FIXME: maximum iterations locked in here */
for (unsigned i = 0; i < mr + 1; i++)
- m_ht[i] = new double[mr];
+ m_ht[i] = new nl_double[mr];
for (unsigned i = 0; i < this->N(); i++)
- m_v[i] = new double[_storage_N];
+ m_v[i] = new nl_double[_storage_N];
}
@@ -60,7 +60,7 @@ protected:
private:
- int solve_ilu_gmres(double * RESTRICT x, double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, double accuracy);
+ int solve_ilu_gmres(nl_double * RESTRICT x, nl_double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, nl_double accuracy);
plist_t<int> m_term_cr[_storage_N];
@@ -69,17 +69,17 @@ private:
mat_cr_t<_storage_N> mat;
- double m_A[_storage_N * _storage_N];
- double m_LU[_storage_N * _storage_N];
+ nl_double m_A[_storage_N * _storage_N];
+ nl_double m_LU[_storage_N * _storage_N];
- double m_c[_storage_N + 1]; /* mr + 1 */
- double m_g[_storage_N + 1]; /* mr + 1 */
- double * RESTRICT m_ht[_storage_N + 1]; /* (mr + 1), mr */
- double m_s[_storage_N]; /* mr + 1 */
- double * RESTRICT m_v[_storage_N + 1]; /*(mr + 1), n */
+ nl_double m_c[_storage_N + 1]; /* mr + 1 */
+ nl_double m_g[_storage_N + 1]; /* mr + 1 */
+ nl_double * RESTRICT m_ht[_storage_N + 1]; /* (mr + 1), mr */
+ nl_double m_s[_storage_N]; /* mr + 1 */
+ nl_double * RESTRICT m_v[_storage_N + 1]; /*(mr + 1), n */
//double m_y[_storage_N]; /* mr + 1 */
- double m_accuracy_mult; // FXIME: Save state
+ nl_double m_accuracy_mult; // FXIME: Save state
};
// ----------------------------------------------------------------------------------------
@@ -190,7 +190,9 @@ ATTR_HOT inline int matrix_solver_GMRES_t<m_N, _storage_N>::vsolve_non_dynamic(c
const nl_double accuracy = this->m_params.m_accuracy;
#if 1
- int mr = std::min((int) iN-1,(int) sqrt(iN));
+ int mr = _storage_N;
+ if (_storage_N > 3 )
+ mr = (int) sqrt(iN);
mr = std::min(mr, this->m_params.m_gs_loops);
int iter = 4;
int gsl = solve_ilu_gmres(new_V, RHS, iter, mr, accuracy);
@@ -214,11 +216,10 @@ ATTR_HOT inline int matrix_solver_GMRES_t<m_N, _storage_N>::vsolve_non_dynamic(c
if (newton_raphson)
{
- double err = 0;
+ nl_double err = 0;
for (unsigned k = 0; k < iN; k++)
err = std::max(nl_math::abs(l_V[k] - new_V[k]), err);
- //printf("here %s\n", this->name().cstr());
for (unsigned k = 0; k < iN; k++)
this->m_nets[k]->m_cur_Analog += 1.0 * (new_V[k] - this->m_nets[k]->m_cur_Analog);
if (err > accuracy)
@@ -234,7 +235,7 @@ ATTR_HOT inline int matrix_solver_GMRES_t<m_N, _storage_N>::vsolve_non_dynamic(c
}
}
-static inline void givens_mult( const double c, const double s, double * RESTRICT g0, double * RESTRICT g1 )
+static inline void givens_mult( const nl_double c, const nl_double s, nl_double * RESTRICT g0, nl_double * RESTRICT g1 )
{
const double tg0 = c * *g0 - s * *g1;
const double tg1 = s * *g0 + c * *g1;
@@ -244,7 +245,7 @@ static inline void givens_mult( const double c, const double s, double * RESTRIC
}
template <unsigned m_N, unsigned _storage_N>
-int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x, double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, double accuracy)
+int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (nl_double * RESTRICT x, nl_double * RESTRICT rhs, const unsigned restart_max, const unsigned mr, nl_double accuracy)
{
/*-------------------------------------------------------------------------
* The code below was inspired by code published by John Burkardt under
@@ -289,15 +290,13 @@ int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x
* differently: The invest doesn't pay off.
* Therefore we use the approach in the else part.
*/
- double t[_storage_N];
- double Ax[_storage_N];
+ nl_double t[_storage_N];
+ nl_double Ax[_storage_N];
vec_set(n, accuracy, t);
mat.mult_vec(m_A, t, Ax);
mat.solveLUx(m_LU, Ax);
- const double rho_to_accuracy = std::sqrt(vecmult2(n, Ax)) / accuracy;
-
- //printf("rho/accuracy = %f\n", rho_to_accuracy);
+ const nl_double rho_to_accuracy = std::sqrt(vecmult2(n, Ax)) / accuracy;
rho_delta = accuracy * rho_to_accuracy;
}
@@ -307,11 +306,11 @@ int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x
for (unsigned itr = 0; itr < restart_max; itr++)
{
unsigned last_k = mr;
- double mu;
- double rho;
+ nl_double mu;
+ nl_double rho;
- double Ax[_storage_N];
- double residual[_storage_N];
+ nl_double Ax[_storage_N];
+ nl_double residual[_storage_N];
mat.mult_vec(m_A, x, Ax);
@@ -324,13 +323,13 @@ int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x
rho = std::sqrt(vecmult2(n, residual));
- vec_mult_scalar(n, residual, 1.0 / rho, m_v[0]);
+ vec_mult_scalar(n, residual, NL_FCONST(1.0) / rho, m_v[0]);
- vec_set(mr+1, 0.0, m_g);
+ vec_set(mr+1, NL_FCONST(0.0), m_g);
m_g[0] = rho;
for (unsigned i = 0; i < mr; i++)
- vec_set(mr + 1, 0.0, m_ht[i]);
+ vec_set(mr + 1, NL_FCONST(0.0), m_ht[i]);
for (unsigned k = 0; k < mr; k++)
{
@@ -349,7 +348,7 @@ int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x
m_ht[k1][k] = std::sqrt(vecmult2(n, m_v[k1]));
if (m_ht[k1][k] != 0.0)
- vec_scale(n, m_v[k1], 1.0 / m_ht[k1][k]);
+ vec_scale(n, m_v[k1], NL_FCONST(1.0) / m_ht[k1][k]);
for (unsigned j = 0; j < k; j++)
givens_mult(m_c[j], m_s[j], &m_ht[j][k], &m_ht[j+1][k]);
@@ -378,7 +377,7 @@ int matrix_solver_GMRES_t<m_N, _storage_N>::solve_ilu_gmres (double * RESTRICT x
/* didn't converge within accuracy */
last_k = mr - 1;
- double m_y[_storage_N + 1];
+ nl_double m_y[_storage_N + 1];
/* Solve the system H * y = g */
/* x += m_v[j] * m_y[j] */
diff --git a/src/emu/netlist/solver/nld_ms_sor.h b/src/emu/netlist/solver/nld_ms_sor.h
index d91fe1d1412..41074284152 100644
--- a/src/emu/netlist/solver/nld_ms_sor.h
+++ b/src/emu/netlist/solver/nld_ms_sor.h
@@ -143,7 +143,7 @@ ATTR_HOT inline int matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dynamic(con
do {
resched = false;
- double err = 0;
+ nl_double err = 0;
for (unsigned k = 0; k < iN; k++)
{
const int * RESTRICT net_other = this->m_terms[k]->net_other();
diff --git a/src/emu/netlist/solver/nld_ms_sor_mat.h b/src/emu/netlist/solver/nld_ms_sor_mat.h
index ffdb2813f89..bbf8706a139 100644
--- a/src/emu/netlist/solver/nld_ms_sor_mat.h
+++ b/src/emu/netlist/solver/nld_ms_sor_mat.h
@@ -35,7 +35,6 @@ public:
virtual ~matrix_solver_SOR_mat_t() {}
- virtual void log_stats();
virtual void vsetup(analog_net_t::list_t &nets);
ATTR_HOT inline int vsolve_non_dynamic(const bool newton_raphson);
@@ -56,26 +55,6 @@ private:
// ----------------------------------------------------------------------------------------
template <unsigned m_N, unsigned _storage_N>
-void matrix_solver_SOR_mat_t<m_N, _storage_N>::log_stats()
-{
- if (this->m_stat_calculations != 0 && this->m_params.m_log_stats)
- {
- this->netlist().log("==============================================");
- this->netlist().log("Solver %s", this->name().cstr());
- this->netlist().log(" ==> %d nets", this->N()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
- this->netlist().log(" has %s elements", this->is_dynamic() ? "dynamic" : "no dynamic");
- this->netlist().log(" has %s elements", this->is_timestep() ? "timestep" : "no timestep");
- this->netlist().log(" %6.3f average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
- this->netlist().log(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average",
- this->m_stat_calculations,
- this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
- this->m_gs_fail,
- 100.0 * (double) this->m_gs_fail / (double) this->m_stat_calculations,
- (double) this->m_gs_total / (double) this->m_stat_calculations);
- }
-}
-
-template <unsigned m_N, unsigned _storage_N>
void matrix_solver_SOR_mat_t<m_N, _storage_N>::vsetup(analog_net_t::list_t &nets)
{
matrix_solver_direct_t<m_N, _storage_N>::vsetup(nets);
@@ -199,14 +178,13 @@ ATTR_HOT inline int matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non_dynamic
{
nl_double Idrive = 0;
- const nl_ext_double * RESTRICT A = &this->m_A[k][0];
const unsigned *p = this->m_terms[k]->m_nz.data();
const unsigned e = this->m_terms[k]->m_nz.size();
for (unsigned i = 0; i < e; i++)
- Idrive = Idrive + A[p[i]] * new_v[p[i]];
+ Idrive = Idrive + this->A(k,p[i]) * new_v[p[i]];
- const nl_double delta = m_omega * (this->m_RHS[k] - Idrive) / A[k];
+ const nl_double delta = m_omega * (this->m_RHS[k] - Idrive) / this->A(k,k);
cerr = std::max(cerr, nl_math::abs(delta));
new_v[k] += delta;
}
diff --git a/src/emu/netlist/solver/nld_solver.c b/src/emu/netlist/solver/nld_solver.c
index 631ec438458..a3877b7eaa7 100644
--- a/src/emu/netlist/solver/nld_solver.c
+++ b/src/emu/netlist/solver/nld_solver.c
@@ -17,7 +17,6 @@
#endif
-//#pragma GCC optimize "-ffast-math"
#if 0
#pragma GCC optimize "-ffast-math"
//#pragma GCC optimize "-ftree-parallelize-loops=4"
@@ -37,7 +36,11 @@
#include <iostream>
#include <algorithm>
#include "nld_solver.h"
+#if 1
#include "nld_ms_direct.h"
+#else
+#include "nld_ms_direct_lu.h"
+#endif
#include "nld_ms_direct1.h"
#include "nld_ms_direct2.h"
#include "nld_ms_sor.h"
@@ -110,7 +113,7 @@ ATTR_COLD matrix_solver_t::~matrix_solver_t()
ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
{
- NL_VERBOSE_OUT(("New solver setup\n"));
+ log().debug("New solver setup\n");
m_nets.clear();
@@ -121,7 +124,7 @@ ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
for (std::size_t k = 0; k < nets.size(); k++)
{
- NL_VERBOSE_OUT(("setting up net\n"));
+ log().debug("setting up net\n");
analog_net_t *net = nets[k];
@@ -130,7 +133,7 @@ ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
for (std::size_t i = 0; i < net->m_core_terms.size(); i++)
{
core_terminal_t *p = net->m_core_terms[i];
- NL_VERBOSE_OUT(("%s %s %d\n", p->name().cstr(), net->name().cstr(), (int) net->isRailNet()));
+ log().debug("{1} {2} {3}\n", p->name(), net->name(), (int) net->isRailNet());
switch (p->type())
{
case terminal_t::TERMINAL:
@@ -144,7 +147,7 @@ ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
case device_t::DIODE:
case device_t::LVCCS:
case device_t::BJT_SWITCH:
- NL_VERBOSE_OUT(("found BJT/Diode/LVCCS\n"));
+ log().debug("found BJT/Diode/LVCCS\n");
if (!m_dynamic_devices.contains(&p->device()))
m_dynamic_devices.add(&p->device());
break;
@@ -155,7 +158,7 @@ ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
terminal_t *pterm = dynamic_cast<terminal_t *>(p);
add_term(k, pterm);
}
- NL_VERBOSE_OUT(("Added terminal\n"));
+ log().debug("Added terminal\n");
break;
case terminal_t::INPUT:
{
@@ -170,22 +173,22 @@ ATTR_COLD void matrix_solver_t::setup(analog_net_t::list_t &nets)
if (net_proxy_output == NULL)
{
net_proxy_output = palloc(analog_output_t);
- net_proxy_output->init_object(*this, this->name() + "." + pformat("m%1")(m_inps.size()));
+ net_proxy_output->init_object(*this, this->name() + "." + pfmt("m{1}")(m_inps.size()));
m_inps.add(net_proxy_output);
net_proxy_output->m_proxied_net = &p->net().as_analog();
}
net_proxy_output->net().register_con(*p);
// FIXME: repeated
net_proxy_output->net().rebuild_list();
- NL_VERBOSE_OUT(("Added input\n"));
+ log().debug("Added input\n");
}
break;
default:
- netlist().error("unhandled element found\n");
+ log().fatal("unhandled element found\n");
break;
}
}
- NL_VERBOSE_OUT(("added net with %" SIZETFMT " populated connections\n", net->m_core_terms.size()));
+ log().debug("added net with {1} populated connections\n", net->m_core_terms.size());
}
}
@@ -196,7 +199,6 @@ ATTR_HOT void matrix_solver_t::update_inputs()
// avoid recursive calls. Inputs are updated outside this call
for (std::size_t i=0; i<m_inps.size(); i++)
m_inps[i]->set_Q(m_inps[i]->m_proxied_net->m_cur_Analog);
-
}
ATTR_HOT void matrix_solver_t::update_dynamic()
@@ -270,7 +272,7 @@ void matrix_solver_t::solve_base(C *p)
// reschedule ....
if (this_resched > 1 && !m_Q_sync.net().is_queued())
{
- netlist().warning("NEWTON_LOOPS exceeded on net %s... reschedule", this->name().cstr());
+ log().warning("NEWTON_LOOPS exceeded on net {1}... reschedule", this->name());
m_Q_sync.net().reschedule_in_queue(m_params.m_nt_sync_delay);
}
}
@@ -302,11 +304,6 @@ ATTR_HOT nl_double matrix_solver_t::solve()
return next_time_step;
}
-
-// ----------------------------------------------------------------------------------------
-// matrix_solver - Direct base
-// ----------------------------------------------------------------------------------------
-
ATTR_COLD int matrix_solver_t::get_net_idx(net_t *net)
{
for (std::size_t k = 0; k < m_nets.size(); k++)
@@ -315,6 +312,25 @@ ATTR_COLD int matrix_solver_t::get_net_idx(net_t *net)
return -1;
}
+void matrix_solver_t::log_stats()
+{
+ if (this->m_stat_calculations != 0 && this->m_params.m_log_stats)
+ {
+ log().verbose("==============================================");
+ log().verbose("Solver {1}", this->name());
+ log().verbose(" ==> {1} nets", this->m_nets.size()); //, (*(*groups[i].first())->m_core_terms.first())->name());
+ log().verbose(" has {1} elements", this->is_dynamic() ? "dynamic" : "no dynamic");
+ log().verbose(" has {1} elements", this->is_timestep() ? "timestep" : "no timestep");
+ log().verbose(" {1:6.3} average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
+ log().verbose(" {1:10} invocations ({2:6} Hz) {3:10} gs fails ({4:6.2} %) {5:6.3} average",
+ this->m_stat_calculations,
+ this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
+ this->m_iterative_fail,
+ 100.0 * (double) this->m_iterative_fail / (double) this->m_stat_calculations,
+ (double) this->m_iterative_total / (double) this->m_stat_calculations);
+ }
+}
+
@@ -335,15 +351,21 @@ NETLIB_START(solver)
register_param("FREQ", m_freq, 48000.0);
- register_param("ITERATIVE", m_iterative_solver, "SOR");
+ /* iteration parameters */
+ register_param("SOR_FACTOR", m_sor, 1.059);
+ register_param("ITERATIVE", m_iterative_solver, "SOR");
register_param("ACCURACY", m_accuracy, 1e-7);
- register_param("GS_LOOPS", m_gs_loops, 9); // Gauss-Seidel loops
register_param("GS_THRESHOLD", m_gs_threshold, 6); // below this value, gaussian elimination is used
+ register_param("GS_LOOPS", m_gs_loops, 9); // Gauss-Seidel loops
+
+ /* general parameters */
+ register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT);
+ register_param("PIVOT", m_pivot, 0); // use pivoting - on supported solvers
register_param("NR_LOOPS", m_nr_loops, 250); // Newton-Raphson loops
register_param("PARALLEL", m_parallel, 0);
- register_param("SOR_FACTOR", m_sor, 1.059);
- register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT);
+
+ /* automatic time step */
register_param("DYNAMIC_TS", m_dynamic, 0);
register_param("LTE", m_lte, 5e-5); // diff/timestep
register_param("MIN_TIMESTEP", m_min_timestep, 1e-6); // nl_double timestep resolution
@@ -456,7 +478,7 @@ matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const bool use_sp
}
else
{
- netlist().error("Unknown solver type: %s\n", m_iterative_solver.Value().cstr());
+ netlist().log().fatal("Unknown solver type: {1}\n", m_iterative_solver.Value());
return NULL;
}
}
@@ -474,10 +496,11 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
int cur_group = -1;
const bool use_specific = true;
+ m_params.m_pivot = m_pivot.Value();
m_params.m_accuracy = m_accuracy.Value();
m_params.m_gs_loops = m_gs_loops.Value();
m_params.m_nr_loops = m_nr_loops.Value();
- m_params.m_nt_sync_delay = m_sync_delay.Value();
+ m_params.m_nt_sync_delay = netlist_time::from_double(m_sync_delay.Value());
m_params.m_lte = m_lte.Value();
m_params.m_sor = m_sor.Value();
@@ -501,14 +524,14 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
else
m_params.m_log_stats = (bool) m_log_stats.Value();
- netlist().log("Scanning net groups ...");
+ netlist().log().verbose("Scanning net groups ...");
// determine net groups
for (std::size_t i=0; i<netlist().m_nets.size(); i++)
{
- SOLVER_VERBOSE_OUT(("processing %s\n", netlist().m_nets[i]->name().cstr()));
+ netlist().log().debug("processing {1}\n", netlist().m_nets[i]->name());
if (!netlist().m_nets[i]->isRailNet())
{
- SOLVER_VERBOSE_OUT((" ==> not a rail net\n"));
+ netlist().log().debug(" ==> not a rail net\n");
analog_net_t *n = &netlist().m_nets[i]->as_analog();
if (!n->already_processed(groups, cur_group))
{
@@ -519,7 +542,7 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
}
// setup the solvers
- netlist().log("Found %d net groups in %" SIZETFMT " nets\n", cur_group + 1, SIZET_PRINTF(netlist().m_nets.size()));
+ netlist().log().verbose("Found {1} net groups in {2} nets\n", cur_group + 1, netlist().m_nets.size());
for (int i = 0; i <= cur_group; i++)
{
matrix_solver_t *ms;
@@ -551,13 +574,31 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
case 8:
ms = create_solver<8,8>(8, use_specific);
break;
+ case 10:
+ ms = create_solver<10,10>(10, use_specific);
+ break;
+ case 11:
+ ms = create_solver<11,11>(11, use_specific);
+ break;
case 12:
ms = create_solver<12,12>(12, use_specific);
break;
+ case 15:
+ ms = create_solver<15,15>(15, use_specific);
+ break;
+ case 31:
+ ms = create_solver<31,31>(31, use_specific);
+ break;
+ case 49:
+ ms = create_solver<49,49>(49, use_specific);
+ break;
+#if 0
case 87:
ms = create_solver<87,87>(87, use_specific);
break;
+#endif
default:
+ netlist().log().warning("No specific solver found for netlist of size {1}", (unsigned) net_count);
if (net_count <= 16)
{
ms = create_solver<0,16>(net_count, use_specific);
@@ -577,31 +618,31 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start()
}
else
{
- netlist().error("Encountered netgroup with > 128 nets");
+ netlist().log().fatal("Encountered netgroup with > 128 nets");
ms = NULL; /* tease compilers */
}
break;
}
- register_sub(pformat("Solver_%1")(m_mat_solvers.size()), *ms);
+ register_sub(pfmt("Solver_{1}")(m_mat_solvers.size()), *ms);
ms->vsetup(groups[i]);
m_mat_solvers.add(ms);
- netlist().log("Solver %s", ms->name().cstr());
- netlist().log(" # %d ==> %" SIZETFMT " nets", i, SIZET_PRINTF(groups[i].size())); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
- netlist().log(" has %s elements", ms->is_dynamic() ? "dynamic" : "no dynamic");
- netlist().log(" has %s elements", ms->is_timestep() ? "timestep" : "no timestep");
+ netlist().log().verbose("Solver {1}", ms->name());
+ netlist().log().verbose(" # {1} ==> {2} nets", i, groups[i].size());
+ netlist().log().verbose(" has {1} elements", ms->is_dynamic() ? "dynamic" : "no dynamic");
+ netlist().log().verbose(" has {1} elements", ms->is_timestep() ? "timestep" : "no timestep");
for (std::size_t j=0; j<groups[i].size(); j++)
{
- netlist().log("Net %" SIZETFMT ": %s", SIZET_PRINTF(j), groups[i][j]->name().cstr());
+ netlist().log().verbose("Net {1}: {2}", j, groups[i][j]->name());
net_t *n = groups[i][j];
for (std::size_t k = 0; k < n->m_core_terms.size(); k++)
{
const core_terminal_t *p = n->m_core_terms[k];
- netlist().log(" %s", p->name().cstr());
+ netlist().log().verbose(" {1}", p->name());
}
}
}
diff --git a/src/emu/netlist/solver/nld_solver.h b/src/emu/netlist/solver/nld_solver.h
index 67e76f45e1c..6da438b19cb 100644
--- a/src/emu/netlist/solver/nld_solver.h
+++ b/src/emu/netlist/solver/nld_solver.h
@@ -37,6 +37,7 @@ class NETLIB_NAME(solver);
struct solver_parameters_t
{
+ int m_pivot;
nl_double m_accuracy;
nl_double m_lte;
nl_double m_min_timestep;
@@ -83,8 +84,9 @@ class terms_t
unsigned m_railstart;
- plist_t<unsigned> m_nzrd; /* non zero right of the diagonal for elimination */
plist_t<unsigned> m_nz; /* all non zero for multiplication */
+ plist_t<unsigned> m_nzrd; /* non zero right of the diagonal for elimination */
+ plist_t<unsigned> m_nzbd; /* non zero below of the diagonal for elimination */
private:
plist_t<terminal_t *> m_term;
plist_t<int> m_net_other;
@@ -133,26 +135,9 @@ public:
ATTR_COLD int get_net_idx(net_t *net);
inline eSolverType type() const { return m_type; }
+ const plog_base<NL_DEBUG> &log() const { return netlist().log(); }
- virtual void log_stats()
- {
- if (this->m_stat_calculations != 0 && this->m_params.m_log_stats)
- {
- this->netlist().log("==============================================");
- this->netlist().log("Solver %s", this->name().cstr());
- this->netlist().log(" ==> %d nets", (unsigned) this->m_nets.size()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr());
- this->netlist().log(" has %s elements", this->is_dynamic() ? "dynamic" : "no dynamic");
- this->netlist().log(" has %s elements", this->is_timestep() ? "timestep" : "no timestep");
- this->netlist().log(" %6.3f average newton raphson loops", (double) this->m_stat_newton_raphson / (double) this->m_stat_vsolver_calls);
- this->netlist().log(" %10d invocations (%6d Hz) %10d gs fails (%6.2f%%) %6.3f average",
- this->m_stat_calculations,
- this->m_stat_calculations * 10 / (int) (this->netlist().time().as_double() * 10.0),
- this->m_iterative_fail,
- 100.0 * (double) this->m_iterative_fail / (double) this->m_stat_calculations,
- (double) this->m_iterative_total / (double) this->m_stat_calculations);
- }
- }
-
+ virtual void log_stats();
protected:
@@ -217,6 +202,7 @@ protected:
logic_input_t m_fb_step;
logic_output_t m_Q_step;
+ param_logic_t m_pivot;
param_double_t m_freq;
param_double_t m_sync_delay;
param_double_t m_accuracy;
diff --git a/src/emu/netlist/solver/vector_base.h b/src/emu/netlist/solver/vector_base.h
index be0d59692a3..c1449aad595 100644
--- a/src/emu/netlist/solver/vector_base.h
+++ b/src/emu/netlist/solver/vector_base.h
@@ -35,32 +35,36 @@ private:
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
-inline void vec_set (const std::size_t n, const double &scalar, double * RESTRICT result)
+template<typename T>
+inline void vec_set (const std::size_t n, const T &scalar, T * RESTRICT result)
{
for ( std::size_t i = 0; i < n; i++ )
result[i] = scalar;
}
-inline double vecmult (const std::size_t n, const double * RESTRICT a1, const double * RESTRICT a2 )
+
+template<typename T>
+inline T vecmult (const std::size_t n, const T * RESTRICT a1, const T * RESTRICT a2 )
{
- double value = 0.0;
+ T value = 0.0;
for ( std::size_t i = 0; i < n; i++ )
value = value + a1[i] * a2[i];
return value;
}
-
-inline double vecmult2 (const std::size_t n, const double *a1)
+template<typename T>
+inline T vecmult2 (const std::size_t n, const T *a1)
{
- double value = 0.0;
+ T value = 0.0;
for ( std::size_t i = 0; i < n; i++ )
{
- const double temp = a1[i];
+ const T temp = a1[i];
value = value + temp * temp;
}
return value;
}
-inline void vec_mult_scalar (const std::size_t n, const double * RESTRICT v, const double scalar, double * RESTRICT result)
+template<typename T>
+inline void vec_mult_scalar (const std::size_t n, const T * RESTRICT v, const T scalar, T * RESTRICT result)
{
for ( std::size_t i = 0; i < n; i++ )
{
@@ -68,7 +72,8 @@ inline void vec_mult_scalar (const std::size_t n, const double * RESTRICT v, con
}
}
-inline void vec_add_mult_scalar (const std::size_t n, const double * RESTRICT v, const double scalar, double * RESTRICT result)
+template<typename T>
+inline void vec_add_mult_scalar (const std::size_t n, const T * RESTRICT v, const T scalar, T * RESTRICT result)
{
for ( std::size_t i = 0; i < n; i++ )
result[i] += scalar * v[i];
@@ -80,13 +85,15 @@ inline void vec_add_ip(const std::size_t n, const double * RESTRICT v, double *
result[i] += v[i];
}
-inline void vec_sub(const std::size_t n, const double * RESTRICT v1, const double * RESTRICT v2, double * RESTRICT result)
+template<typename T>
+inline void vec_sub(const std::size_t n, const T * RESTRICT v1, const T * RESTRICT v2, T * RESTRICT result)
{
for ( std::size_t i = 0; i < n; i++ )
result[i] = v1[i] - v2[i];
}
-inline void vec_scale (const std::size_t n, double * RESTRICT v, const double scalar)
+template<typename T>
+inline void vec_scale (const std::size_t n, T * RESTRICT v, const T scalar)
{
for ( std::size_t i = 0; i < n; i++ )
v[i] = scalar * v[i];
diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c
index 191cc1a7c99..dae68968445 100644
--- a/src/emu/netlist/tools/nl_convert.c
+++ b/src/emu/netlist/tools/nl_convert.c
@@ -42,15 +42,6 @@ static plist_t<int> bubble(const pnamedlist_t<Class *> &sl)
convert - convert a spice netlist
-------------------------------------------------*/
-
-void nl_convert_base_t::out(const char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- m_buf += pstring(format).vprintf(ap);
- va_end(ap);
-}
-
void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias)
{
m_pins.add(palloc(pin_alias_t(devname + "." + name, devname + "." + alias)), false);
@@ -98,7 +89,7 @@ void nl_convert_base_t::dump_nl()
{
net_t *net = m_nets.find_by_name(m_ext_alias[i]);
// use the first terminal ...
- out("ALIAS(%s, %s)\n", m_ext_alias[i].cstr(), net->terminals()[0].cstr());
+ out("ALIAS({}, {})\n", m_ext_alias[i].cstr(), net->terminals()[0].cstr());
// if the aliased net only has this one terminal connected ==> don't dump
if (net->terminals().size() == 1)
net->set_no_export();
@@ -109,13 +100,13 @@ void nl_convert_base_t::dump_nl()
std::size_t j = sorted[i];
if (m_devs[j]->has_value())
- out("%s(%s, %s)\n", m_devs[j]->type().cstr(),
+ out("{}({}, {})\n", m_devs[j]->type().cstr(),
m_devs[j]->name().cstr(), get_nl_val(m_devs[j]->value()).cstr());
else if (m_devs[j]->has_model())
- out("%s(%s, \"%s\")\n", m_devs[j]->type().cstr(),
+ out("{}({}, \"{}\")\n", m_devs[j]->type().cstr(),
m_devs[j]->name().cstr(), m_devs[j]->model().cstr());
else
- out("%s(%s)\n", m_devs[j]->type().cstr(),
+ out("{}({})\n", m_devs[j]->type().cstr(),
m_devs[j]->name().cstr());
}
// print nets
@@ -124,11 +115,11 @@ void nl_convert_base_t::dump_nl()
net_t * net = m_nets[i];
if (!net->is_no_export())
{
- //printf("Net %s\n", net->name().cstr());
- out("NET_C(%s", net->terminals()[0].cstr() );
+ //printf("Net {}\n", net->name().cstr());
+ out("NET_C({}", net->terminals()[0].cstr() );
for (std::size_t j=1; j<net->terminals().size(); j++)
{
- out(", %s", net->terminals()[j].cstr() );
+ out(", {}", net->terminals()[j].cstr() );
}
out(")\n");
}
@@ -149,7 +140,7 @@ const pstring nl_convert_base_t::get_nl_val(const double val)
break;
i++;
}
- return pformat(m_units[i].m_func.cstr())(val / m_units[i].m_mult);
+ return pfmt(m_units[i].m_func.cstr())(val / m_units[i].m_mult);
}
}
double nl_convert_base_t::get_sp_unit(const pstring &unit)
@@ -174,28 +165,27 @@ double nl_convert_base_t::get_sp_val(const pstring &sin)
pstring unit = sin.substr(p + 1);
double ret = get_sp_unit(unit) * val.as_double();
- //printf("<%s> %s %d ==> %f\n", sin.cstr(), unit.cstr(), p, ret);
return ret;
}
nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = {
{"T", "", 1.0e12 },
{"G", "", 1.0e9 },
- {"MEG", "RES_M(%1)", 1.0e6 },
- {"k", "RES_K(%1)", 1.0e3 }, /* eagle */
- {"K", "RES_K(%1)", 1.0e3 },
- {"", "%1", 1.0e0 },
- {"M", "CAP_M(%1)", 1.0e-3 },
- {"u", "CAP_U(%1)", 1.0e-6 }, /* eagle */
- {"U", "CAP_U(%1)", 1.0e-6 },
- {"??", "CAP_U(%1)", 1.0e-6 },
- {"N", "CAP_N(%1)", 1.0e-9 },
- {"P", "CAP_P(%1)", 1.0e-12},
- {"F", "%1e-15", 1.0e-15},
-
- {"MIL", "%1", 25.4e-6},
-
- {"-", "%1", 1.0 }
+ {"MEG", "RES_M({1})", 1.0e6 },
+ {"k", "RES_K({1})", 1.0e3 }, /* eagle */
+ {"K", "RES_K({1})", 1.0e3 },
+ {"", "{1}", 1.0e0 },
+ {"M", "CAP_M({1})", 1.0e-3 },
+ {"u", "CAP_U({1})", 1.0e-6 }, /* eagle */
+ {"U", "CAP_U({1})", 1.0e-6 },
+ {"??", "CAP_U({1})", 1.0e-6 },
+ {"N", "CAP_N({1})", 1.0e-9 },
+ {"P", "CAP_P({1})", 1.0e-12},
+ {"F", "{1}e-15", 1.0e-15},
+
+ {"MIL", "{1}", 25.4e-6},
+
+ {"-", "{1}", 1.0 }
};
@@ -238,15 +228,15 @@ void nl_convert_spice_t::process_line(const pstring &line)
switch (tt[0].code_at(0))
{
case ';':
- out("// %s\n", line.substr(1).cstr());
+ out("// {}\n", line.substr(1).cstr());
break;
case '*':
- out("// %s\n", line.substr(1).cstr());
+ out("// {}\n", line.substr(1).cstr());
break;
case '.':
if (tt[0].equals(".SUBCKT"))
{
- out("NETLIST_START(%s)\n", tt[1].cstr());
+ out("NETLIST_START({})\n", tt[1].cstr());
for (std::size_t i=2; i<tt.size(); i++)
add_ext_alias(tt[i]);
}
@@ -256,7 +246,7 @@ void nl_convert_spice_t::process_line(const pstring &line)
out("NETLIST_END()\n");
}
else
- out("// %s\n", line.cstr());
+ out("// {}\n", line.cstr());
break;
case 'Q':
{
@@ -345,13 +335,13 @@ void nl_convert_spice_t::process_line(const pstring &line)
add_device(tname, xname);
for (std::size_t i=1; i < tt.size() - 1; i++)
{
- pstring term = pformat("%1.%2")(xname)(i);
+ pstring term = pfmt("{1}.{2}")(xname)(i);
add_term(tt[i], term);
}
break;
}
default:
- out("// IGNORED %s: %s\n", tt[0].cstr(), line.cstr());
+ out("// IGNORED {}: {}\n", tt[0].cstr(), line.cstr());
}
}
}
@@ -439,7 +429,7 @@ void nl_convert_eagle_t::convert(const pstring &contents)
break;
}
default:
- tok.error("// IGNORED %s\n", name.cstr());
+ tok.error("// IGNORED " + name);
}
}
@@ -457,7 +447,7 @@ void nl_convert_eagle_t::convert(const pstring &contents)
}
else
{
- out("Unexpected %s\n", token.str().cstr());
+ out("Unexpected {}\n", token.str().cstr());
return;
}
}
diff --git a/src/emu/netlist/tools/nl_convert.h b/src/emu/netlist/tools/nl_convert.h
index 650d23dcff6..7a410bb2f47 100644
--- a/src/emu/netlist/tools/nl_convert.h
+++ b/src/emu/netlist/tools/nl_convert.h
@@ -22,7 +22,7 @@ class nl_convert_base_t
{
public:
- nl_convert_base_t() {};
+ nl_convert_base_t() : out(m_buf) {};
virtual ~nl_convert_base_t()
{
m_nets.clear_and_free();
@@ -30,12 +30,12 @@ public:
m_pins.clear_and_free();
}
- const pstringbuffer &result() { return m_buf; }
+ const pstringbuffer &result() { return m_buf.str(); }
+
virtual void convert(const pstring &contents) = 0;
protected:
- void out(const char *format, ...) ATTR_PRINTF(2,3);
void add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias);
void add_ext_alias(const pstring &alias);
@@ -53,6 +53,7 @@ protected:
double get_sp_val(const pstring &sin);
+ pstream_fmt_writer_t out;
private:
struct net_t
{
@@ -123,7 +124,7 @@ private:
private:
- pstringbuffer m_buf;
+ postringstream m_buf;
pnamedlist_t<dev_t *> m_devs;
pnamedlist_t<net_t *> m_nets;
@@ -196,9 +197,9 @@ public:
protected:
- void verror(pstring msg, int line_num, pstring line)
+ void verror(const pstring &msg, int line_num, const pstring &line)
{
- m_convert.out("%s (line %d): %s\n", msg.cstr(), line_num, line.cstr());
+ m_convert.out("{} (line {}): {}\n", msg.cstr(), line_num, line.cstr());
}
diff --git a/src/emu/render.h b/src/emu/render.h
index 898b412d69d..ada65f344f2 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -436,7 +436,7 @@ private:
void get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &texinfo, render_primitive_list &primlist);
const rgb_t *get_adjusted_palette(render_container &container);
- static const int MAX_TEXTURE_SCALES = 8;
+ static const int MAX_TEXTURE_SCALES = 16;
// a scaled_texture contains a single scaled entry for a texture
struct scaled_texture
diff --git a/src/emu/romload.h b/src/emu/romload.h
index 3628d72701d..ec0e3375cdd 100644
--- a/src/emu/romload.h
+++ b/src/emu/romload.h
@@ -225,6 +225,7 @@ struct rom_entry
#define ROM_LOAD32_DWORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD)
#define ROM_LOAD64_WORD(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_SKIP(6))
#define ROM_LOAD64_WORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPWORD | ROM_REVERSE | ROM_SKIP(6))
+#define ROM_LOAD64_DWORD_SWAP(name,offset,length,hash) ROMX_LOAD(name, offset, length, hash, ROM_GROUPDWORD | ROM_REVERSE | ROM_SKIP(4))
/* ----- ROM_RELOAD related macros ----- */
diff --git a/src/emu/save.h b/src/emu/save.h
index 85bb660540c..41cc4a07fb4 100644
--- a/src/emu/save.h
+++ b/src/emu/save.h
@@ -250,9 +250,9 @@ template<>
inline void save_manager::save_item(device_t *device, const char *module, const char *tag, int index, attotime &value, const char *name)
{
std::string tempstr = std::string(name).append(".attoseconds");
- save_memory(device, module, tag, index, tempstr.c_str(), &value.attoseconds, sizeof(value.attoseconds));
+ save_memory(device, module, tag, index, tempstr.c_str(), &value.m_attoseconds, sizeof(value.m_attoseconds));
tempstr.assign(name).append(".seconds");
- save_memory(device, module, tag, index, tempstr.c_str(), &value.seconds, sizeof(value.seconds));
+ save_memory(device, module, tag, index, tempstr.c_str(), &value.m_seconds, sizeof(value.m_seconds));
}
diff --git a/src/emu/schedule.c b/src/emu/schedule.c
index dbd22f24960..3b480d4c3c3 100644
--- a/src/emu/schedule.c
+++ b/src/emu/schedule.c
@@ -194,7 +194,7 @@ void emu_timer::adjust(attotime start_delay, INT32 param, const attotime &period
m_enabled = true;
// clamp negative times to 0
- if (start_delay.seconds < 0)
+ if (start_delay.seconds() < 0)
start_delay = attotime::zero;
// set the start and expire times
@@ -452,11 +452,11 @@ void device_scheduler::timeslice()
{
// only process if this CPU is executing or truly halted (not yielding)
// and if our target is later than the CPU's current time (coarse check)
- if (EXPECTED((exec->m_suspend == 0 || exec->m_eatcycles) && target.seconds >= exec->m_localtime.seconds))
+ if (EXPECTED((exec->m_suspend == 0 || exec->m_eatcycles) && target.seconds() >= exec->m_localtime.seconds()))
{
// compute how many attoseconds to execute this CPU
- attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds;
- if (delta < 0 && target.seconds > exec->m_localtime.seconds)
+ attoseconds_t delta = target.attoseconds() - exec->m_localtime.attoseconds();
+ if (delta < 0 && target.seconds() > exec->m_localtime.seconds())
delta += ATTOSECONDS_PER_SECOND;
assert(delta == (target - exec->m_localtime).as_attoseconds());
@@ -564,7 +564,7 @@ void device_scheduler::trigger(int trigid, const attotime &after)
void device_scheduler::boost_interleave(const attotime &timeslice_time, const attotime &boost_duration)
{
// ignore timeslices > 1 second
- if (timeslice_time.seconds > 0)
+ if (timeslice_time.seconds() > 0)
return;
add_scheduling_quantum(timeslice_time, boost_duration);
}
@@ -941,10 +941,11 @@ inline void device_scheduler::execute_timers()
void device_scheduler::add_scheduling_quantum(const attotime &quantum, const attotime &duration)
{
- assert(quantum.seconds == 0);
+ assert(quantum.seconds() == 0);
attotime curtime = time();
attotime expire = curtime + duration;
+ const attoseconds_t quantum_attos = quantum.attoseconds();
// figure out where to insert ourselves, expiring any quanta that are out-of-date
quantum_slot *insert_after = NULL;
@@ -957,20 +958,20 @@ void device_scheduler::add_scheduling_quantum(const attotime &quantum, const att
m_quantum_allocator.reclaim(m_quantum_list.detach(*quant));
// if this quantum is shorter than us, we need to be inserted afterwards
- else if (quant->m_requested <= quantum.attoseconds)
+ else if (quant->m_requested <= quantum_attos)
insert_after = quant;
}
// if we found an exact match, just take the maximum expiry time
- if (insert_after != NULL && insert_after->m_requested == quantum.attoseconds)
+ if (insert_after != NULL && insert_after->m_requested == quantum_attos)
insert_after->m_expire = max(insert_after->m_expire, expire);
// otherwise, allocate a new quantum and insert it after the one we picked
else
{
quantum_slot &quant = *m_quantum_allocator.alloc();
- quant.m_requested = quantum.attoseconds;
- quant.m_actual = MAX(quantum.attoseconds, m_quantum_minimum);
+ quant.m_requested = quantum_attos;
+ quant.m_actual = MAX(quantum_attos, m_quantum_minimum);
quant.m_expire = expire;
m_quantum_list.insert_after(quant, insert_after);
}
diff --git a/src/emu/sound.c b/src/emu/sound.c
index d2543154bf6..84ab4821c7c 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -118,7 +118,7 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
attotime sound_stream::sample_time() const
{
- return attotime(m_device.machine().sound().last_update().seconds, 0) + attotime(0, m_output_sampindex * m_attoseconds_per_sample);
+ return attotime(m_device.machine().sound().last_update().seconds(), 0) + attotime(0, m_output_sampindex * m_attoseconds_per_sample);
}
@@ -264,20 +264,20 @@ void sound_stream::update()
{
// determine the number of samples since the start of this second
attotime time = m_device.machine().time();
- INT32 update_sampindex = INT32(time.attoseconds / m_attoseconds_per_sample);
+ INT32 update_sampindex = INT32(time.attoseconds() / m_attoseconds_per_sample);
// if we're ahead of the last update, then adjust upwards
attotime last_update = m_device.machine().sound().last_update();
- if (time.seconds > last_update.seconds)
+ if (time.seconds() > last_update.seconds())
{
- assert(time.seconds == last_update.seconds + 1);
+ assert(time.seconds() == last_update.seconds() + 1);
update_sampindex += m_sample_rate;
}
// if we're behind the last update, then adjust downwards
- if (time.seconds < last_update.seconds)
+ if (time.seconds() < last_update.seconds())
{
- assert(time.seconds == last_update.seconds - 1);
+ assert(time.seconds() == last_update.seconds() - 1);
update_sampindex -= m_sample_rate;
}
@@ -297,7 +297,7 @@ void sound_stream::sync_update(void *, INT32)
{
update();
attotime time = m_device.machine().time();
- attoseconds_t next_edge = m_attoseconds_per_sample - (time.attoseconds % m_attoseconds_per_sample);
+ attoseconds_t next_edge = m_attoseconds_per_sample - (time.attoseconds() % m_attoseconds_per_sample);
m_sync_timer->adjust(attotime(0, next_edge));
}
@@ -514,7 +514,7 @@ void sound_stream::recompute_sample_rate_data()
if (m_synchronous)
{
attotime time = m_device.machine().time();
- attoseconds_t next_edge = m_attoseconds_per_sample - (time.attoseconds % m_attoseconds_per_sample);
+ attoseconds_t next_edge = m_attoseconds_per_sample - (time.attoseconds() % m_attoseconds_per_sample);
m_sync_timer->adjust(attotime(0, next_edge));
}
}
@@ -584,7 +584,7 @@ void sound_stream::postload()
memset(&m_output[outputnum].m_buffer[0], 0, m_output_bufalloc * sizeof(m_output[outputnum].m_buffer[0]));
// recompute the sample indexes to make sense
- m_output_sampindex = m_device.machine().sound().last_update().attoseconds / m_attoseconds_per_sample;
+ m_output_sampindex = m_device.machine().sound().last_update().attoseconds() / m_attoseconds_per_sample;
m_output_update_sampindex = m_output_sampindex;
m_output_base_sampindex = m_output_sampindex - m_max_samples_per_update;
}
@@ -817,7 +817,7 @@ sound_manager::sound_manager(running_machine &machine)
m_attenuation(0),
m_nosound_mode(machine.osd().no_sound()),
m_wavfile(NULL),
- m_update_attoseconds(STREAMS_UPDATE_ATTOTIME.attoseconds),
+ m_update_attoseconds(STREAMS_UPDATE_ATTOTIME.attoseconds()),
m_last_update(attotime::zero)
{
// get filename for WAV file or AVI file if specified
@@ -1083,9 +1083,9 @@ void sound_manager::update(void *ptr, int param)
// see if we ticked over to the next second
attotime curtime = machine().time();
bool second_tick = false;
- if (curtime.seconds != m_last_update.seconds)
+ if (curtime.seconds() != m_last_update.seconds())
{
- assert(curtime.seconds == m_last_update.seconds + 1);
+ assert(curtime.seconds() == m_last_update.seconds() + 1);
second_tick = true;
}
diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c
index cf5d99d0c07..dcd0a965408 100644
--- a/src/emu/sound/digitalk.c
+++ b/src/emu/sound/digitalk.c
@@ -169,7 +169,7 @@ period.
- Rom organization
-The rom starts with a vector of 16-bits little endian values which are
+The rom starts with a vector of 16-bits big endian values which are
the addresses of the segments table for the samples. The segments data
is a vector of 24-bits little-endian values organized as such:
@@ -385,7 +385,7 @@ void digitalker_device::digitalker_step_mode_0()
void digitalker_device::digitalker_step_mode_1()
{
- logerror("Digitalker mode 1 unsupported");
+ logerror("Digitalker mode 1 unsupported\n");
m_zero_count = 1;
m_cur_segment = m_segments;
}
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index 95a68e9c3b1..cd2dfa8e4cb 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -143,9 +143,9 @@ void nesapu_device::device_start()
int rate = clock() / 4;
/* Initialize global variables */
- m_samps_per_sync = rate / ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds);
+ m_samps_per_sync = rate / ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds());
m_buffer_size = m_samps_per_sync;
- m_real_rate = m_samps_per_sync * ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds);
+ m_real_rate = m_samps_per_sync * ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds());
m_apu_incsize = (float) (clock() / (float) m_real_rate);
/* Use initializer calls */
diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c
index 5a47e5d27da..863e30f0832 100644
--- a/src/emu/sound/samples.c
+++ b/src/emu/sound/samples.c
@@ -595,13 +595,15 @@ bool samples_device::read_flac_sample(emu_file &file, sample_t &sample)
//-------------------------------------------------
// load_samples - load all the samples in our
// attached interface
+// Returns true when all samples were successfully read, else false
//-------------------------------------------------
-void samples_device::load_samples()
+bool samples_device::load_samples()
{
+ bool ok = true;
// if the user doesn't want to use samples, bail
if (!machine().options().samples())
- return;
+ return false;
// iterate over ourself
const char *basename = machine().basename();
@@ -631,6 +633,10 @@ void samples_device::load_samples()
if (filerr == FILERR_NONE)
read_sample(file, m_sample[index]);
else if (filerr == FILERR_NOT_FOUND)
- osd_printf_warning("Sample '%s' NOT FOUND\n", samplename);
+ {
+ logerror("%s: Sample '%s' NOT FOUND\n", tag(), samplename);
+ ok = false;
+ }
}
+ return ok;
}
diff --git a/src/emu/sound/samples.h b/src/emu/sound/samples.h
index 45770e127ed..24bb4541766 100644
--- a/src/emu/sound/samples.h
+++ b/src/emu/sound/samples.h
@@ -92,7 +92,6 @@ protected:
// device_sound_interface overrides
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
-private:
// internal classes
struct channel_t
{
@@ -111,7 +110,7 @@ private:
// internal helpers
static bool read_wav_sample(emu_file &file, sample_t &sample);
static bool read_flac_sample(emu_file &file, sample_t &sample);
- void load_samples();
+ bool load_samples();
// internal state
std::vector<channel_t> m_channel;
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index c5861e2d7c6..1d6ea4876df 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -66,6 +66,52 @@
#include "emu.h"
#include "tms5110.h"
+static INT16 clip_analog(INT16 cliptemp);
+
+/* *****optional defines***** */
+
+/* Hacky improvements which don't match patent: */
+/* Interpolation shift logic:
+ * One of the following two lines should be used, and the other commented
+ * The second line is more accurate mathematically but not accurate to the patent
+ */
+#define INTERP_SHIFT >> m_coeff->interp_coeff[m_IP]
+//define INTERP_SHIFT / (1<<m_coeff->interp_coeff[m_IP])
+
+/* Other hacks */
+/* HACK?: if defined, outputs the low 4 bits of the lattice filter to the i/o
+ * or clip logic, even though the real hardware doesn't do this, partially verified by decap */
+#undef ALLOW_4_LSB
+
+
+/* *****configuration of chip connection stuff***** */
+/* must be defined; if 0, output the waveform as if it was tapped on the speaker pin as usual, if 1, output the waveform as if it was tapped on the i/o pin (volume is much lower in the latter case) */
+#define FORCE_DIGITAL 0
+
+
+/* *****debugging defines***** */
+#undef VERBOSE
+// above is general, somewhat obsolete, catch all for debugs which don't fit elsewhere
+#undef DEBUG_PARSE_FRAME_DUMP
+// above dumps each frame to stderr: be sure to select one of the options below if you define it!
+#undef DEBUG_PARSE_FRAME_DUMP_BIN
+// dumps each speech frame as binary
+#undef DEBUG_PARSE_FRAME_DUMP_HEX
+// dumps each speech frame as hex
+#undef DEBUG_FRAME_ERRORS
+// above dumps info if a frame ran out of data
+#undef DEBUG_COMMAND_DUMP
+// above dumps all command writes and PDC-related state machine changes, plus command writes to VSMs
+#undef DEBUG_GENERATION
+// above dumps debug information related to the sample generation loop, i.e. whether interpolation is inhibited or not, and what the current and target values for each frame are.
+#undef DEBUG_GENERATION_VERBOSE
+// above dumps MUCH MORE debug information related to the sample generation loop, namely the excitation, energy, pitch, k*, and output values for EVERY SINGLE SAMPLE during a frame.
+#undef DEBUG_LATTICE
+// above dumps the lattice filter state data each sample.
+#undef DEBUG_CLIP
+// above dumps info to stderr whenever the analog clip hardware is (or would be) clipping the signal.
+
+
#define MAX_SAMPLE_CHUNK 512
/* 6 Variants, from tms5110r.inc */
@@ -164,6 +210,8 @@ UINT8 tms5110_device::new_int_read()
void tms5110_device::register_for_save_states()
{
+ save_item(NAME(m_variant));
+
save_item(NAME(m_fifo));
save_item(NAME(m_fifo_head));
save_item(NAME(m_fifo_tail));
@@ -171,42 +219,95 @@ void tms5110_device::register_for_save_states()
save_item(NAME(m_PDC));
save_item(NAME(m_CTL_pins));
- save_item(NAME(m_speaking_now));
- save_item(NAME(m_talk_status));
+ save_item(NAME(m_SPEN));
+ save_item(NAME(m_TALK));
+ save_item(NAME(m_TALKD));
save_item(NAME(m_state));
- save_item(NAME(m_old_energy));
- save_item(NAME(m_old_pitch));
- save_item(NAME(m_old_k));
+ save_item(NAME(m_address));
+ save_item(NAME(m_next_is_address));
+ save_item(NAME(m_schedule_dummy_read));
+ save_item(NAME(m_addr_bit));
+ save_item(NAME(m_CTL_buffer));
- save_item(NAME(m_new_energy));
- save_item(NAME(m_new_pitch));
- save_item(NAME(m_new_k));
+ save_item(NAME(m_OLDE));
+ save_item(NAME(m_OLDP));
+ save_item(NAME(m_new_frame_energy_idx));
+ save_item(NAME(m_new_frame_pitch_idx));
+ save_item(NAME(m_new_frame_k_idx));
+#ifdef PERFECT_INTERPOLATION_HACK
+ save_item(NAME(m_old_frame_energy_idx));
+ save_item(NAME(m_old_frame_pitch_idx));
+ save_item(NAME(m_old_frame_k_idx));
+#endif
save_item(NAME(m_current_energy));
save_item(NAME(m_current_pitch));
save_item(NAME(m_current_k));
- save_item(NAME(m_target_energy));
- save_item(NAME(m_target_pitch));
- save_item(NAME(m_target_k));
+ save_item(NAME(m_previous_energy));
- save_item(NAME(m_interp_count));
- save_item(NAME(m_sample_count));
+ save_item(NAME(m_subcycle));
+ save_item(NAME(m_subc_reload));
+ save_item(NAME(m_PC));
+ save_item(NAME(m_IP));
+ save_item(NAME(m_inhibit));
+ save_item(NAME(m_uv_zpar));
+ save_item(NAME(m_zpar));
+ save_item(NAME(m_pitch_zero));
save_item(NAME(m_pitch_count));
- save_item(NAME(m_next_is_address));
- save_item(NAME(m_address));
- save_item(NAME(m_schedule_dummy_read));
- save_item(NAME(m_addr_bit));
- save_item(NAME(m_CTL_buffer));
-
+ save_item(NAME(m_u));
save_item(NAME(m_x));
save_item(NAME(m_RNG));
+ save_item(NAME(m_excitation_data));
+
+ save_item(NAME(m_digital_select));
+
+ save_item(NAME(m_speech_rom_bitnum));
+
+ save_item(NAME(m_romclk_hack_timer_started));
+ save_item(NAME(m_romclk_hack_state));
}
+/**********************************************************************************************
+ printbits helper function: takes a long int input and prints the resulting bits to stderr
+
+***********************************************************************************************/
+
+#ifdef DEBUG_PARSE_FRAME_DUMP_BIN
+static void printbits(long data, int num)
+{
+ int i;
+ for (i=(num-1); i>=0; i--)
+ fprintf(stderr,"%0ld", (data>>i)&1);
+}
+#endif
+#ifdef DEBUG_PARSE_FRAME_DUMP_HEX
+static void printbits(long data, int num)
+{
+ switch((num-1)&0xFC)
+ {
+ case 0:
+ fprintf(stderr,"%0lx", data);
+ break;
+ case 4:
+ fprintf(stderr,"%02lx", data);
+ break;
+ case 8:
+ fprintf(stderr,"%03lx", data);
+ break;
+ case 12:
+ fprintf(stderr,"%04lx", data);
+ break;
+ default:
+ fprintf(stderr,"%04lx", data);
+ break;
+ }
+}
+#endif
/******************************************************************************************
@@ -284,218 +385,163 @@ void tms5110_device::perform_dummy_read()
void tms5110_device::process(INT16 *buffer, unsigned int size)
{
int buf_count=0;
- int i, interp_period, bitout;
- INT16 Y11, cliptemp;
+ int i, bitout;
+ INT32 this_sample;
/* if we're not speaking, fill with nothingness */
- if (!m_speaking_now)
+ if (!m_TALKD)
goto empty;
- /* if we're to speak, but haven't started */
- if (!m_talk_status)
- {
- /* a "dummy read" is mentioned in the tms5200 datasheet */
- /* The Bagman speech roms data are organized in such a way that
- ** the bit at address 0 is NOT a speech data. The bit at address 1
- ** is the speech data. It seems that the tms5110 performs a dummy read
- ** just before it executes a SPEAK command.
- ** This has been moved to command logic ...
- ** perform_dummy_read();
- */
-
- /* clear out the new frame parameters (it will become old frame just before the first call to parse_frame() ) */
- m_new_energy = 0;
- m_new_pitch = 0;
- for (i = 0; i < m_coeff->num_k; i++)
- m_new_k[i] = 0;
-
- m_talk_status = 1;
- }
-
-
/* loop until the buffer is full or we've stopped speaking */
- while ((size > 0) && m_speaking_now)
+ while ((size > 0) && m_TALKD)
{
- int current_val;
+ /* if it is the appropriate time to update the old energy/pitch indices,
+ * i.e. when IP=7, PC=12, T=17, subcycle=2, do so. Since IP=7 PC=12 T=17
+ * is JUST BEFORE the transition to IP=0 PC=0 T=0 sybcycle=(0 or 1),
+ * which happens 4 T-cycles later), we change on the latter.
+ * The indices are updated here ~12 PCs before the new frame is applied.
+ */
+ /** TODO: the patents 4331836, 4335277, and 4419540 disagree about the timing of this **/
+ if ((m_IP == 0) && (m_PC == 0) && (m_subcycle < 2))
+ {
+ m_OLDE = (m_new_frame_energy_idx == 0);
+ m_OLDP = (m_new_frame_pitch_idx == 0);
+ }
- /* if we're ready for a new frame */
- if ((m_interp_count == 0) && (m_sample_count == 0))
+ /* if we're ready for a new frame to be applied, i.e. when IP=0, PC=12, Sub=1
+ * (In reality, the frame was really loaded incrementally during the entire IP=0
+ * PC=x time period, but it doesn't affect anything until IP=0 PC=12 happens)
+ */
+ if ((m_IP == 0) && (m_PC == 12) && (m_subcycle == 1))
{
- /* remember previous frame */
- m_old_energy = m_new_energy;
- m_old_pitch = m_new_pitch;
+ // HACK for regression testing, be sure to comment out before release!
+ //m_RNG = 0x1234;
+ // end HACK
+
+#ifdef PERFECT_INTERPOLATION_HACK
+ /* remember previous frame energy, pitch, and coefficients */
+ m_old_frame_energy_idx = m_new_frame_energy_idx;
+ m_old_frame_pitch_idx = m_new_frame_pitch_idx;
for (i = 0; i < m_coeff->num_k; i++)
- m_old_k[i] = m_new_k[i];
+ m_old_frame_k_idx[i] = m_new_frame_k_idx[i];
+#endif
+ /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */
+ parse_frame();
+#ifdef DEBUG_PARSE_FRAME_DUMP
+ fprintf(stderr,"\n");
+#endif
+ /* if the new frame is unvoiced (or silenced via ZPAR), be sure to zero out the k5-k10 parameters */
+ m_uv_zpar = NEW_FRAME_UNVOICED_FLAG | m_zpar;
- /* if the old frame was a stop frame, exit and do not process any more frames */
- if (m_old_energy == COEFF_ENERGY_SENTINEL)
+ /* if the new frame is a stop frame, unset both TALK and SPEN. TALKD remains active while the energy is ramping to 0. */
+ if (NEW_FRAME_STOP_FLAG == 1)
{
- if (DEBUG_5110) logerror("processing frame: stop frame\n");
- m_target_energy = m_current_energy = 0;
- m_speaking_now = m_talk_status = 0;
- m_interp_count = m_sample_count = m_pitch_count = 0;
- goto empty;
+ m_TALK = m_SPEN = 0;
}
+ /* in all cases where interpolation would be inhibited, set the inhibit flag; otherwise clear it.
+ Interpolation inhibit cases:
+ * Old frame was voiced, new is unvoiced
+ * Old frame was silence/zero energy, new has nonzero energy
+ * Old frame was unvoiced, new is voiced (note this is the case on the patent but may not be correct on the real final chip)
+ */
+ if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
+ || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) /* this line needs further investigation, starwars tie fighters may sound better without it */
+ || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) )
+ m_inhibit = 1;
+ else // normal frame, normal interpolation
+ m_inhibit = 0;
+
+#ifdef DEBUG_GENERATION
+ /* Debug info for current parsed frame */
+ fprintf(stderr, "OLDE: %d; OLDP: %d; ", m_OLDE, m_OLDP);
+ fprintf(stderr,"Processing frame: ");
+ if (m_inhibit == 0)
+ fprintf(stderr, "Normal Frame\n");
+ else
+ fprintf(stderr,"Interpolation Inhibited\n");
+ fprintf(stderr,"*** current Energy, Pitch and Ks = %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",m_current_energy, m_current_pitch, m_current_k[0], m_current_k[1], m_current_k[2], m_current_k[3], m_current_k[4], m_current_k[5], m_current_k[6], m_current_k[7], m_current_k[8], m_current_k[9]);
+ fprintf(stderr,"*** target Energy(idx), Pitch, and Ks = %04d(%x),%04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d, %04d\n",
+ (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)),
+ m_new_frame_energy_idx,
+ (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)),
+ (m_coeff->ktable[0][m_new_frame_k_idx[0]] * (1-m_zpar)),
+ (m_coeff->ktable[1][m_new_frame_k_idx[1]] * (1-m_zpar)),
+ (m_coeff->ktable[2][m_new_frame_k_idx[2]] * (1-m_zpar)),
+ (m_coeff->ktable[3][m_new_frame_k_idx[3]] * (1-m_zpar)),
+ (m_coeff->ktable[4][m_new_frame_k_idx[4]] * (1-m_uv_zpar)),
+ (m_coeff->ktable[5][m_new_frame_k_idx[5]] * (1-m_uv_zpar)),
+ (m_coeff->ktable[6][m_new_frame_k_idx[6]] * (1-m_uv_zpar)),
+ (m_coeff->ktable[7][m_new_frame_k_idx[7]] * (1-m_uv_zpar)),
+ (m_coeff->ktable[8][m_new_frame_k_idx[8]] * (1-m_uv_zpar)),
+ (m_coeff->ktable[9][m_new_frame_k_idx[9]] * (1-m_uv_zpar)) );
+#endif
- /* Parse a new frame into the new_energy, new_pitch and new_k[] */
- parse_frame();
-
-
- /* Set old target as new start of frame */
- m_current_energy = m_old_energy;
- m_current_pitch = m_old_pitch;
-
- for (i = 0; i < m_coeff->num_k; i++)
- m_current_k[i] = m_old_k[i];
-
-
- /* is this the stop (ramp down) frame? */
- if (m_new_energy == COEFF_ENERGY_SENTINEL)
- {
- /*logerror("processing frame: ramp down\n");*/
- m_target_energy = 0;
- m_target_pitch = m_old_pitch;
- for (i = 0; i < m_coeff->num_k; i++)
- m_target_k[i] = m_old_k[i];
- }
- else if ((m_old_energy == 0) && (m_new_energy != 0)) /* was the old frame a zero-energy frame? */
- {
- /* if so, and if the new frame is non-zero energy frame then the new parameters
- should become our current and target parameters immediately,
- i.e. we should NOT interpolate them slowly in.
- */
-
- /*logerror("processing non-zero energy frame after zero-energy frame\n");*/
- m_target_energy = m_new_energy;
- m_target_pitch = m_current_pitch = m_new_pitch;
- for (i = 0; i < m_coeff->num_k; i++)
- m_target_k[i] = m_current_k[i] = m_new_k[i];
- }
- else if ((m_old_pitch == 0) && (m_new_pitch != 0)) /* is this a change from unvoiced to voiced frame ? */
+ }
+ else // Not a new frame, just interpolate the existing frame.
+ {
+ int inhibit_state = ((m_inhibit==1)&&(m_IP != 0)); // disable inhibit when reaching the last interp period, but don't overwrite the m_inhibit value
+#ifdef PERFECT_INTERPOLATION_HACK
+ int samples_per_frame = m_subc_reload?175:266; // either (13 A cycles + 12 B cycles) * 7 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 7 interps for SPKSLOW
+ //int samples_per_frame = m_subc_reload?200:304; // either (13 A cycles + 12 B cycles) * 8 interps for normal SPEAK/SPKEXT, or (13*2 A cycles + 12 B cycles) * 8 interps for SPKSLOW
+ int current_sample = (m_subcycle - m_subc_reload)+(m_PC*(3-m_subc_reload))+((m_subc_reload?25:38)*((m_IP-1)&7));
+ //fprintf(stderr, "CS: %03d", current_sample);
+ // reset the current energy, pitch, etc to what it was at frame start
+ m_current_energy = (m_coeff->energytable[m_old_frame_energy_idx] * (1-m_zpar));
+ m_current_pitch = (m_coeff->pitchtable[m_old_frame_pitch_idx] * (1-m_old_zpar));
+ for (i = 0; i < 4; i++)
+ m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-m_old_zpar));
+ for (i = 4; i < m_coeff->num_k; i++)
+ m_current_k[i] = (m_coeff->ktable[i][m_old_frame_k_idx[i]] * (1-m_uv_zpar));
+ // now adjust each value to be exactly correct for each of the samples per frame
+ if (m_IP != 0) // if we're still interpolating...
{
- /* if so, then the new parameters should become our current and target parameters immediately,
- i.e. we should NOT interpolate them slowly in.
- */
- /*if (DEBUG_5110) logerror("processing frame: UNVOICED->VOICED frame change\n");*/
- m_target_energy = m_new_energy;
- m_target_pitch = m_current_pitch = m_new_pitch;
+ m_current_energy += ((((m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)) - m_current_energy)*(1-inhibit_state))*current_sample)/samples_per_frame;
+ m_current_pitch += ((((m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)) - m_current_pitch)*(1-inhibit_state))*current_sample)/samples_per_frame;
for (i = 0; i < m_coeff->num_k; i++)
- m_target_k[i] = m_current_k[i] = m_new_k[i];
+ m_current_k[i] += ((((m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-((i<4)?m_zpar:m_uv_zpar))) - m_current_k[i])*(1-inhibit_state))*current_sample)/samples_per_frame;
}
- else if ((m_old_pitch != 0) && (m_new_pitch == 0)) /* is this a change from voiced to unvoiced frame ? */
+ else // we're done, play this frame for 1/8 frame.
{
- /* if so, then the new parameters should become our current and target parameters immediately,
- i.e. we should NOT interpolate them slowly in.
- */
- /*if (DEBUG_5110) logerror("processing frame: VOICED->UNVOICED frame change\n");*/
- m_target_energy = m_new_energy;
- m_target_pitch = m_current_pitch = m_new_pitch;
+ m_current_energy = (m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar));
+ m_current_pitch = (m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar));
for (i = 0; i < m_coeff->num_k; i++)
- m_target_k[i] = m_current_k[i] = m_new_k[i];
+ m_current_k[i] = (m_coeff->ktable[i][m_new_frame_k_idx[i]] * (1-((i<4)?m_zpar:m_uv_zpar)));
}
- else
- {
- /*logerror("processing frame: Normal\n");*/
- /*logerror("*** Energy = %d\n",current_energy);*/
- /*logerror("proc: %d %d\n",last_fbuf_head,fbuf_head);*/
-
- m_target_energy = m_new_energy;
- m_target_pitch = m_new_pitch;
- for (i = 0; i < m_coeff->num_k; i++)
- m_target_k[i] = m_new_k[i];
- }
- }
- else
- {
- interp_period = m_sample_count / 25;
- switch(m_interp_count)
+#else
+ //Updates to parameters only happen on subcycle '2' (B cycle) of PCs.
+ if (m_subcycle == 2)
{
- /* PC=X X cycle, rendering change (change for next cycle which chip is actually doing) */
- case 0: /* PC=0, A cycle, nothing happens (calc energy) */
- break;
- case 1: /* PC=0, B cycle, nothing happens (update energy) */
- break;
- case 2: /* PC=1, A cycle, update energy (calc pitch) */
- m_current_energy += ((m_target_energy - m_current_energy) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 3: /* PC=1, B cycle, nothing happens (update pitch) */
- break;
- case 4: /* PC=2, A cycle, update pitch (calc K1) */
- m_current_pitch += ((m_target_pitch - m_current_pitch) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 5: /* PC=2, B cycle, nothing happens (update K1) */
- break;
- case 6: /* PC=3, A cycle, update K1 (calc K2) */
- m_current_k[0] += ((m_target_k[0] - m_current_k[0]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 7: /* PC=3, B cycle, nothing happens (update K2) */
- break;
- case 8: /* PC=4, A cycle, update K2 (calc K3) */
- m_current_k[1] += ((m_target_k[1] - m_current_k[1]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 9: /* PC=4, B cycle, nothing happens (update K3) */
- break;
- case 10: /* PC=5, A cycle, update K3 (calc K4) */
- m_current_k[2] += ((m_target_k[2] - m_current_k[2]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 11: /* PC=5, B cycle, nothing happens (update K4) */
- break;
- case 12: /* PC=6, A cycle, update K4 (calc K5) */
- m_current_k[3] += ((m_target_k[3] - m_current_k[3]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 13: /* PC=6, B cycle, nothing happens (update K5) */
- break;
- case 14: /* PC=7, A cycle, update K5 (calc K6) */
- m_current_k[4] += ((m_target_k[4] - m_current_k[4]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 15: /* PC=7, B cycle, nothing happens (update K6) */
- break;
- case 16: /* PC=8, A cycle, update K6 (calc K7) */
- m_current_k[5] += ((m_target_k[5] - m_current_k[5]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 17: /* PC=8, B cycle, nothing happens (update K7) */
- break;
- case 18: /* PC=9, A cycle, update K7 (calc K8) */
- m_current_k[6] += ((m_target_k[6] - m_current_k[6]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 19: /* PC=9, B cycle, nothing happens (update K8) */
- break;
- case 20: /* PC=10, A cycle, update K8 (calc K9) */
- m_current_k[7] += ((m_target_k[7] - m_current_k[7]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 21: /* PC=10, B cycle, nothing happens (update K9) */
- break;
- case 22: /* PC=11, A cycle, update K9 (calc K10) */
- m_current_k[8] += ((m_target_k[8] - m_current_k[8]) >> m_coeff->interp_coeff[interp_period]);
- break;
- case 23: /* PC=11, B cycle, nothing happens (update K10) */
- break;
- case 24: /* PC=12, A cycle, update K10 (do nothing) */
- m_current_k[9] += ((m_target_k[9] - m_current_k[9]) >> m_coeff->interp_coeff[interp_period]);
- break;
+ switch(m_PC)
+ {
+ case 0: /* PC = 0, B cycle, write updated energy */
+ m_current_energy += ((((m_coeff->energytable[m_new_frame_energy_idx] * (1-m_zpar)) - m_current_energy)*(1-inhibit_state)) INTERP_SHIFT);
+ break;
+ case 1: /* PC = 1, B cycle, write updated pitch */
+ m_current_pitch += ((((m_coeff->pitchtable[m_new_frame_pitch_idx] * (1-m_zpar)) - m_current_pitch)*(1-inhibit_state)) INTERP_SHIFT);
+ break;
+ case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: case 11:
+ /* PC = 2 through 11, B cycle, write updated K1 through K10 */
+ m_current_k[m_PC-2] += ((((m_coeff->ktable[m_PC-2][m_new_frame_k_idx[m_PC-2]] * (1-(((m_PC-2)<4)?m_zpar:m_uv_zpar))) - m_current_k[m_PC-2])*(1-inhibit_state)) INTERP_SHIFT);
+ break;
+ case 12: /* PC = 12, do nothing */
+ break;
+ }
}
+#endif
}
-
- /* calculate the output */
-
- if (m_current_energy == 0)
+ // calculate the output
+ if (OLD_FRAME_UNVOICED_FLAG == 1)
{
- /* generate silent samples here */
- current_val = 0x00;
- }
- else if (m_old_pitch == 0)
- {
- /* generate unvoiced samples here */
- if (m_RNG&1)
- current_val = -64; /* according to the patent it is (either + or -) half of the maximum value in the chirp table */
+ // generate unvoiced samples here
+ if (m_RNG & 1)
+ m_excitation_data = ~0x3F; /* according to the patent it is (either + or -) half of the maximum value in the chirp table, so either 01000000(0x40) or 11000000(0xC0)*/
else
- current_val = 64;
-
+ m_excitation_data = 0x40;
}
- else
+ else /* (OLD_FRAME_UNVOICED_FLAG == 0) */
{
// generate voiced samples here
/* US patent 4331836 Figure 14B shows, and logic would hold, that a pitch based chirp
@@ -505,88 +551,257 @@ void tms5110_device::process(INT16 *buffer, unsigned int size)
* disabled, forcing all samples beyond 51d to be == 51d
*/
if (m_pitch_count >= 51)
- current_val = (INT8)m_coeff->chirptable[51];
+ m_excitation_data = (INT8)m_coeff->chirptable[51];
else /*m_pitch_count < 51*/
- current_val = (INT8)m_coeff->chirptable[m_pitch_count];
+ m_excitation_data = (INT8)m_coeff->chirptable[m_pitch_count];
}
- /* Update LFSR *20* times every sample, like patent shows */
- for (i=0; i<20; i++)
+ // Update LFSR *20* times every sample (once per T cycle), like patent shows
+ for (i=0; i<20; i++)
+ {
+ bitout = ((m_RNG >> 12) & 1) ^
+ ((m_RNG >> 3) & 1) ^
+ ((m_RNG >> 2) & 1) ^
+ ((m_RNG >> 0) & 1);
+ m_RNG <<= 1;
+ m_RNG |= bitout;
+ }
+ this_sample = lattice_filter(); /* execute lattice filter */
+#ifdef DEBUG_GENERATION_VERBOSE
+ //fprintf(stderr,"C:%01d; ",m_subcycle);
+ fprintf(stderr,"IP:%01d PC:%02d X:%04d E:%03d P:%03d Pc:%03d ",m_IP, m_PC, m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
+ //fprintf(stderr,"X:%04d E:%03d P:%03d Pc:%03d ", m_excitation_data, m_current_energy, m_current_pitch, m_pitch_count);
+ for (i=0; i<10; i++)
+ fprintf(stderr,"K%d:%04d ", i+1, m_current_k[i]);
+ fprintf(stderr,"Out:%06d", this_sample);
+ fprintf(stderr,"\n");
+#endif
+ /* next, force result to 14 bits (since its possible that the addition at the final (k1) stage of the lattice overflowed) */
+ while (this_sample > 16383) this_sample -= 32768;
+ while (this_sample < -16384) this_sample += 32768;
+ if (m_digital_select == 0) // analog SPK pin output is only 8 bits, with clipping
+ buffer[buf_count] = clip_analog(this_sample);
+ else // digital I/O pin output is 12 bits
{
- bitout = ((m_RNG>>12)&1) ^
- ((m_RNG>>10)&1) ^
- ((m_RNG>> 9)&1) ^
- ((m_RNG>> 0)&1);
- m_RNG >>= 1;
- m_RNG |= (bitout<<12);
+#ifdef ALLOW_4_LSB
+ // input: ssss ssss ssss ssss ssnn nnnn nnnn nnnn
+ // N taps: ^ = 0x2000;
+ // output: ssss ssss ssss ssss snnn nnnn nnnn nnnN
+ buffer[buf_count] = (this_sample<<1)|((this_sample&0x2000)>>13);
+#else
+ this_sample &= ~0xF;
+ // input: ssss ssss ssss ssss ssnn nnnn nnnn 0000
+ // N taps: ^^ ^^^ = 0x3E00;
+ // output: ssss ssss ssss ssss snnn nnnn nnnN NNNN
+ buffer[buf_count] = (this_sample<<1)|((this_sample&0x3E00)>>9);
+#endif
}
+ // Update all counts
- /* Lattice filter here */
-
- Y11 = (current_val * 64 * m_current_energy) / 512;
-
- for (i = m_coeff->num_k - 1; i >= 0; i--)
+ m_subcycle++;
+ if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
{
- Y11 = Y11 - ((m_current_k[i] * m_x[i]) / 512);
- m_x[i+1] = m_x[i] + ((m_current_k[i] * Y11) / 512);
+ /* Circuit 412 in the patent acts a reset, resetting the pitch counter to 0
+ * if INHIBIT was true during the most recent frame transition.
+ * The exact time this occurs is betwen IP=7, PC=12 sub=0, T=t12
+ * and m_IP = 0, PC=0 sub=0, T=t12, a period of exactly 20 cycles,
+ * which overlaps the time OLDE and OLDP are updated at IP=7 PC=12 T17
+ * (and hence INHIBIT itself 2 t-cycles later). We do it here because it is
+ * convenient and should make no difference in output.
+ */
+ if ((m_IP == 7)&&(m_inhibit==1)) m_pitch_zero = 1;
+ if ((m_IP == 0)&&(m_pitch_zero==1)) m_pitch_zero = 0;
+#ifdef PERFECT_INTERPOLATION_HACK
+ m_old_zpar = m_zpar;
+#endif
+ m_zpar = 0; /* this gets effectively reset by resetf3, same signal which resets m_PC to 0 */
+ if (m_IP == 7) // RESETL4
+ {
+ /* if TALK was clear last frame, halt speech now, since TALKD (latched from TALK on new frame) just went inactive. */
+#ifdef DEBUG_GENERATION
+ if (m_TALK == 0)
+ fprintf(stderr,"tms5110_process: processing frame: TALKD = 0 caused by stop frame or buffer empty, halting speech.\n");
+#endif
+ m_TALKD = m_TALK; // TALKD is latched from TALK
+ m_TALK = m_SPEN; // TALK is latched from SPEN
+ }
+ m_subcycle = m_subc_reload;
+ m_PC = 0;
+ m_IP++;
+ m_IP&=0x7;
}
+ else if (m_subcycle == 3)
+ {
+ m_subcycle = m_subc_reload;
+ m_PC++;
+ }
+ m_pitch_count++;
+ if ((m_pitch_count >= m_current_pitch)||(m_pitch_zero == 1)) m_pitch_count = 0;
+ m_pitch_count &= 0x1FF;
+ buf_count++;
+ size--;
+ }
- m_x[0] = Y11;
-
+empty:
- /* clipping & wrapping, just like the patent */
+ while (size > 0)
+ {
+ m_subcycle++;
+ if ((m_subcycle == 2) && (m_PC == 12)) // RESETF3
+ {
+ if (m_IP == 7) // RESETL4
+ {
+ m_TALKD = m_TALK; // TALKD is latched from TALK
+ m_TALK = m_SPEN; // TALK is latched from SPEN
+ }
+ m_subcycle = m_subc_reload;
+ m_PC = 0;
+ m_IP++;
+ m_IP&=0x7;
+ }
+ else if (m_subcycle == 3)
+ {
+ m_subcycle = m_subc_reload;
+ m_PC++;
+ }
+ buffer[buf_count] = -1; /* should be just -1; actual chip outputs -1 every idle sample; (cf note in data sheet, p 10, table 4) */
+ buf_count++;
+ size--;
+ }
+}
- /* YL10 - YL4 ==> DA6 - DA0 */
- cliptemp = Y11 / 16;
+/**********************************************************************************************
- /* M58817 seems to be different */
- if (m_coeff->subtype & (SUBTYPE_M58817))
- cliptemp = cliptemp / 2;
+ clip_analog -- clips the 14 bit return value from the lattice filter to its final 10 bit value (-512 to 511), and upshifts/range extends this to 16 bits
- if (cliptemp > 511) cliptemp = -512 + (cliptemp-511);
- else if (cliptemp < -512) cliptemp = 511 - (cliptemp+512);
+***********************************************************************************************/
- if (cliptemp > 127)
- buffer[buf_count] = 127*256;
- else if (cliptemp < -128)
- buffer[buf_count] = -128*256;
- else
- buffer[buf_count] = cliptemp *256;
+static INT16 clip_analog(INT16 cliptemp)
+{
+ /* clipping, just like the patent shows:
+ * the top 10 bits of this result are visible on the digital output IO pin.
+ * next, if the top 3 bits of the 14 bit result are all the same, the lowest of those 3 bits plus the next 7 bits are the signed analog output, otherwise the low bits are all forced to match the inverse of the topmost bit, i.e.:
+ * 1x xxxx xxxx xxxx -> 0b10000000
+ * 11 1bcd efgh xxxx -> 0b1bcdefgh
+ * 00 0bcd efgh xxxx -> 0b0bcdefgh
+ * 0x xxxx xxxx xxxx -> 0b01111111
+ */
+#ifdef DEBUG_CLIP
+ if ((cliptemp > 2047) || (cliptemp < -2048)) fprintf(stderr,"clipping cliptemp to range; was %d\n", cliptemp);
+#endif
+ if (cliptemp > 2047) cliptemp = 2047;
+ else if (cliptemp < -2048) cliptemp = -2048;
+ /* at this point the analog output is tapped */
+#ifdef ALLOW_4_LSB
+ // input: ssss snnn nnnn nnnn
+ // N taps: ^^^ ^ = 0x0780
+ // output: snnn nnnn nnnn NNNN
+ return (cliptemp << 4)|((cliptemp&0x780)>>7); // upshift and range adjust
+#else
+ cliptemp &= ~0xF;
+ // input: ssss snnn nnnn 0000
+ // N taps: ^^^ ^^^^ = 0x07F0
+ // P taps: ^ = 0x0400
+ // output: snnn nnnn NNNN NNNP
+ return (cliptemp << 4)|((cliptemp&0x7F0)>>3)|((cliptemp&0x400)>>10); // upshift and range adjust
+#endif
+}
- /* Update all counts */
- m_sample_count = (m_sample_count + 1) % 200;
+/**********************************************************************************************
- if (m_current_pitch != 0)
- {
- m_pitch_count++;
- if (m_pitch_count >= m_current_pitch)
- m_pitch_count = 0;
- }
- else
- m_pitch_count = 0;
+ matrix_multiply -- does the proper multiply and shift
+ a is the k coefficient and is clamped to 10 bits (9 bits plus a sign)
+ b is the running result and is clamped to 14 bits.
+ output is 14 bits, but note the result LSB bit is always 1.
+ Because the low 4 bits of the result are trimmed off before
+ output, this makes almost no difference in the computation.
- m_interp_count = (m_interp_count + 1) % 25;
+**********************************************************************************************/
+static INT32 matrix_multiply(INT32 a, INT32 b)
+{
+ INT32 result;
+ while (a>511) { a-=1024; }
+ while (a<-512) { a+=1024; }
+ while (b>16383) { b-=32768; }
+ while (b<-16384) { b+=32768; }
+ result = ((a*b)>>9)|1;//&(~1);
+#ifdef VERBOSE
+ if (result>16383) fprintf(stderr,"matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result);
+ if (result<-16384) fprintf(stderr,"matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result);
+#endif
+ return result;
+}
- buf_count++;
- size--;
- }
+/**********************************************************************************************
-empty:
+ lattice_filter -- executes one 'full run' of the lattice filter on a specific byte of
+ excitation data, and specific values of all the current k constants, and returns the
+ resulting sample.
- while (size > 0)
- {
- m_sample_count = (m_sample_count + 1) % 200;
- m_interp_count = (m_interp_count + 1) % 25;
+***********************************************************************************************/
- buffer[buf_count] = 0x00;
- buf_count++;
- size--;
- }
+INT32 tms5110_device::lattice_filter()
+{
+ // Lattice filter here
+ // Aug/05/07: redone as unrolled loop, for clarity - LN
+ /* Originally Copied verbatim from table I in US patent 4,209,804, now updated to be in same order as the actual chip does it, not that it matters.
+ notation equivalencies from table:
+ Yn(i) == m_u[n-1]
+ Kn = m_current_k[n-1]
+ bn = m_x[n-1]
+ */
+ /*
+ int ep = matrix_multiply(m_previous_energy, (m_excitation_data<<6)); //Y(11)
+ m_u[10] = ep;
+ for (int i = 0; i < 10; i++)
+ {
+ int ii = 10-i; // for m = 10, this would be 11 - i, and since i is from 1 to 10, then ii ranges from 10 to 1
+ //int jj = ii+1; // this variable, even on the fortran version, is never used. it probably was intended to be used on the two lines below the next one to save some redundant additions on each.
+ ep = ep - (((m_current_k[ii-1] * m_x[ii-1])>>9)|1); // subtract reflection from lower stage 'top of lattice'
+ m_u[ii-1] = ep;
+ m_x[ii] = m_x[ii-1] + (((m_current_k[ii-1] * ep)>>9)|1); // add reflection from upper stage 'bottom of lattice'
+ }
+ m_x[0] = ep; // feed the last section of the top of the lattice directly to the bottom of the lattice
+ */
+ m_u[10] = matrix_multiply(m_previous_energy, (m_excitation_data<<6)); //Y(11)
+ m_u[9] = m_u[10] - matrix_multiply(m_current_k[9], m_x[9]);
+ m_u[8] = m_u[9] - matrix_multiply(m_current_k[8], m_x[8]);
+ m_u[7] = m_u[8] - matrix_multiply(m_current_k[7], m_x[7]);
+ m_u[6] = m_u[7] - matrix_multiply(m_current_k[6], m_x[6]);
+ m_u[5] = m_u[6] - matrix_multiply(m_current_k[5], m_x[5]);
+ m_u[4] = m_u[5] - matrix_multiply(m_current_k[4], m_x[4]);
+ m_u[3] = m_u[4] - matrix_multiply(m_current_k[3], m_x[3]);
+ m_u[2] = m_u[3] - matrix_multiply(m_current_k[2], m_x[2]);
+ m_u[1] = m_u[2] - matrix_multiply(m_current_k[1], m_x[1]);
+ m_u[0] = m_u[1] - matrix_multiply(m_current_k[0], m_x[0]);
+ m_x[9] = m_x[8] + matrix_multiply(m_current_k[8], m_u[8]);
+ m_x[8] = m_x[7] + matrix_multiply(m_current_k[7], m_u[7]);
+ m_x[7] = m_x[6] + matrix_multiply(m_current_k[6], m_u[6]);
+ m_x[6] = m_x[5] + matrix_multiply(m_current_k[5], m_u[5]);
+ m_x[5] = m_x[4] + matrix_multiply(m_current_k[4], m_u[4]);
+ m_x[4] = m_x[3] + matrix_multiply(m_current_k[3], m_u[3]);
+ m_x[3] = m_x[2] + matrix_multiply(m_current_k[2], m_u[2]);
+ m_x[2] = m_x[1] + matrix_multiply(m_current_k[1], m_u[1]);
+ m_x[1] = m_x[0] + matrix_multiply(m_current_k[0], m_u[0]);
+ m_x[0] = m_u[0];
+ m_previous_energy = m_current_energy;
+#ifdef DEBUG_LATTICE
+ int i;
+ fprintf(stderr,"V:%04d ", m_u[10]);
+ for (i = 9; i >= 0; i--)
+ {
+ fprintf(stderr,"Y%d:%04d ", i+1, m_u[i]);
+ fprintf(stderr,"b%d:%04d ", i+1, m_x[i]);
+ if ((i % 5) == 0) fprintf(stderr,"\n");
+ }
+#endif
+ return m_u[0];
}
+
/******************************************************************************************
PDC_set -- set Processor Data Clock. Execute CTL_pins command on hi-lo transition.
@@ -600,7 +815,9 @@ void tms5110_device::PDC_set(int data)
m_PDC = data & 0x1;
if (m_PDC == 0) /* toggling 1->0 processes command on CTL_pins */
{
- if (DEBUG_5110) logerror("PDC falling edge: ");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"PDC falling edge(%02X): ",m_state);
+#endif
/* first pdc toggles output, next toggles input */
switch (m_state)
{
@@ -608,26 +825,36 @@ void tms5110_device::PDC_set(int data)
/* continue */
break;
case CTL_STATE_NEXT_TTALK_OUTPUT:
- if (DEBUG_5110) logerror("Switching CTL bus direction to output for Test Talk\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"Switching CTL bus direction to output for Test Talk\n");
+#endif
m_state = CTL_STATE_TTALK_OUTPUT;
return;
case CTL_STATE_TTALK_OUTPUT:
- if (DEBUG_5110) logerror("Switching CTL bus direction back to input from Test Talk\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"Switching CTL bus direction back to input from Test Talk\n");
+#endif
m_state = CTL_STATE_INPUT;
return;
case CTL_STATE_NEXT_OUTPUT:
- if (DEBUG_5110) logerror("Switching CTL bus direction for Read Bit Buffer Output\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"Switching CTL bus direction for Read Bit Buffer Output\n");
+#endif
m_state = CTL_STATE_OUTPUT;
return;
case CTL_STATE_OUTPUT:
- if (DEBUG_5110) logerror("Switching CTL bus direction back to input from Read Bit Buffer Output\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"Switching CTL bus direction back to input from Read Bit Buffer Output\n");
+#endif
m_state = CTL_STATE_INPUT;
return;
}
/* the only real commands we handle now are SPEAK and RESET */
if (m_next_is_address)
{
- if (DEBUG_5110) logerror("Loading address nybble %02x to VSMs\n", m_CTL_pins);
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"Loading address nybble %02x to VSMs\n", m_CTL_pins);
+#endif
m_next_is_address = FALSE;
m_address = m_address | ((m_CTL_pins & 0x0F)<<m_addr_bit);
m_addr_bit = (m_addr_bit + 4) % 12;
@@ -636,39 +863,58 @@ void tms5110_device::PDC_set(int data)
}
else
{
- if (DEBUG_5110) logerror("Got command nybble %02x: ", m_CTL_pins);
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"Got command nybble %02x: ", m_CTL_pins);
+#endif
switch (m_CTL_pins & 0xe) /*CTL1 - don't care*/
{
case TMS5110_CMD_RESET:
- if (DEBUG_5110) logerror("RESET\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"RESET\n");
+#endif
perform_dummy_read();
reset();
break;
case TMS5110_CMD_LOAD_ADDRESS:
- if (DEBUG_5110) logerror("LOAD ADDRESS\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"LOAD ADDRESS\n");
+#endif
m_next_is_address = TRUE;
break;
case TMS5110_CMD_OUTPUT:
- if (DEBUG_5110) logerror("OUTPUT (from read-bit buffer)\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"OUTPUT (from read-bit buffer)\n");
+#endif
m_state = CTL_STATE_NEXT_OUTPUT;
break;
case TMS5110_CMD_SPKSLOW:
- if (DEBUG_5110) logerror("SPKSLOW (todo: this isn't implemented right yet)\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"SPKSLOW\n");
+#endif
perform_dummy_read();
- m_speaking_now = 1;
- //should FIFO be cleared now ????? there is no fifo! the fifo is a lie!
+ m_SPEN = 1; /* start immediately */
+ /* clear out variables before speaking */
+ m_zpar = 1; // zero all the parameters
+ m_subc_reload = 0; // SPKSLOW means this is 0
+ m_subcycle = m_subc_reload;
+ m_PC = 0;
+ m_IP = 0;
break;
case TMS5110_CMD_READ_BIT:
- if (DEBUG_5110) logerror("READ BIT\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"READ BIT\n");
+#endif
if (m_schedule_dummy_read)
perform_dummy_read();
else
{
- if (DEBUG_5110) logerror("actually reading a bit now\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"actually reading a bit now\n");
+#endif
request_bits(1);
m_CTL_buffer >>= 1;
m_CTL_buffer |= (extract_bits(1)<<3);
@@ -677,14 +923,23 @@ void tms5110_device::PDC_set(int data)
break;
case TMS5110_CMD_SPEAK:
- if (DEBUG_5110) logerror("SPEAK\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"SPEAK\n");
+#endif
perform_dummy_read();
- m_speaking_now = 1;
- //should FIFO be cleared now ????? there is no fifo! the fifo is a lie!
+ m_SPEN = 1; /* start immediately */
+ /* clear out variables before speaking */
+ m_zpar = 1; // zero all the parameters
+ m_subc_reload = 1; // SPEAK means this is 1
+ m_subcycle = m_subc_reload;
+ m_PC = 0;
+ m_IP = 0;
break;
case TMS5110_CMD_READ_BRANCH:
- if (DEBUG_5110) logerror("READ AND BRANCH\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"READ AND BRANCH\n");
+#endif
new_int_write(0,1,1,0);
new_int_write(1,1,1,0);
new_int_write(0,1,1,0);
@@ -695,12 +950,16 @@ void tms5110_device::PDC_set(int data)
break;
case TMS5110_CMD_TEST_TALK:
- if (DEBUG_5110) logerror("TEST TALK\n");
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"TEST TALK\n");
+#endif
m_state = CTL_STATE_NEXT_TTALK_OUTPUT;
break;
default:
- logerror("tms5110.c: unknown command: 0x%02x\n", m_CTL_pins);
+#ifdef DEBUG_COMMAND_DUMP
+ fprintf(stderr,"tms5110.c: unknown command: 0x%02x\n", m_CTL_pins);
+#endif
break;
}
@@ -719,15 +978,11 @@ void tms5110_device::PDC_set(int data)
void tms5110_device::parse_frame()
{
- int bits, indx, i, rep_flag;
-#if (DEBUG_5110)
- int ene;
-#endif
-
+ int bits, i, rep_flag;
+ /** TODO: get rid of bits handling here and move into extract_bits (as in tms5220.c) **/
/* count the total number of bits available */
bits = m_fifo_count;
-
/* attempt to extract the energy index */
bits -= m_coeff->energy_bits;
if (bits < 0)
@@ -735,33 +990,37 @@ void tms5110_device::parse_frame()
request_bits( -bits ); /* toggle M0 to receive needed bits */
bits = 0;
}
- indx = extract_bits(m_coeff->energy_bits);
- m_new_energy = m_coeff->energytable[indx];
-#if (DEBUG_5110)
- ene = indx;
+ // attempt to extract the energy index
+ m_new_frame_energy_idx = extract_bits(m_coeff->energy_bits);
+#ifdef DEBUG_PARSE_FRAME_DUMP
+ printbits(m_new_frame_energy_idx,m_coeff->energy_bits);
+ fprintf(stderr," ");
#endif
- /* if the energy index is 0 or 15, we're done */
+ /* if the energy index is 0 or 15, we're done
if ((indx == 0) || (indx == 15))
{
if (DEBUG_5110) logerror(" (4-bit energy=%d frame)\n",m_new_energy);
- /* clear the k's */
+ // clear the k's
if (indx == 0)
{
for (i = 0; i < m_coeff->num_k; i++)
m_new_k[i] = 0;
}
- /* clear fifo if stop frame encountered */
+ // clear fifo if stop frame encountered
if (indx == 15)
{
if (DEBUG_5110) logerror(" (4-bit energy=%d STOP frame)\n",m_new_energy);
m_fifo_head = m_fifo_tail = m_fifo_count = 0;
}
return;
- }
+ }*/
+ // if the energy index is 0 or 15, we're done
+ if ((m_new_frame_energy_idx == 0) || (m_new_frame_energy_idx == 15))
+ return;
/* attempt to extract the repeat flag */
@@ -772,6 +1031,10 @@ void tms5110_device::parse_frame()
bits = 0;
}
rep_flag = extract_bits(1);
+#ifdef DEBUG_PARSE_FRAME_DUMP
+ printbits(rep_flag, 1);
+ fprintf(stderr," ");
+#endif
/* attempt to extract the pitch */
bits -= m_coeff->pitch_bits;
@@ -780,71 +1043,64 @@ void tms5110_device::parse_frame()
request_bits( -bits ); /* toggle M0 to receive needed bits */
bits = 0;
}
- indx = extract_bits(m_coeff->pitch_bits);
- m_new_pitch = m_coeff->pitchtable[indx];
-
- /* if this is a repeat frame, just copy the k's */
+ m_new_frame_pitch_idx = extract_bits(m_coeff->pitch_bits);
+#ifdef DEBUG_PARSE_FRAME_DUMP
+ printbits(m_new_frame_pitch_idx,m_coeff->pitch_bits);
+ fprintf(stderr," ");
+#endif
+ // if this is a repeat frame, just do nothing, it will reuse the old coefficients
if (rep_flag)
- {
- //actually, we do nothing because the k's were already loaded (on parsing the previous frame)
-
- if (DEBUG_5110) logerror(" (10-bit energy=%d pitch=%d rep=%d frame)\n", m_new_energy, m_new_pitch, rep_flag);
return;
- }
-
- /* if the pitch index was zero, we need 4 k's */
- if (indx == 0)
+ // extract first 4 K coefficients
+ for (i = 0; i < 4; i++)
{
/* attempt to extract 4 K's */
- bits -= 18;
+ bits -= m_coeff->kbits[i];
if (bits < 0)
{
- request_bits( -bits ); /* toggle M0 to receive needed bits */
- bits = 0;
+ request_bits( -bits ); /* toggle M0 to receive needed bits */
+ bits = 0;
}
- for (i = 0; i < 4; i++)
- m_new_k[i] = m_coeff->ktable[i][extract_bits(m_coeff->kbits[i])];
-
- /* and clear the rest of the new_k[] */
- for (i = 4; i < m_coeff->num_k; i++)
- m_new_k[i] = 0;
+ m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]);
+#ifdef DEBUG_PARSE_FRAME_DUMP
+ printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]);
+ fprintf(stderr," ");
+#endif
+ }
- if (DEBUG_5110) logerror(" (28-bit energy=%d pitch=%d rep=%d 4K frame)\n", m_new_energy, m_new_pitch, rep_flag);
+ // if the pitch index was zero, we only need 4 K's...
+ if (m_new_frame_pitch_idx == 0)
+ {
+ /* and the rest of the coefficients are zeroed, but that's done in the generator code */
return;
}
- /* else we need 10 K's */
- bits -= 39;
- if (bits < 0)
+ // If we got here, we need the remaining 6 K's
+ for (i = 4; i < m_coeff->num_k; i++)
{
+ bits -= m_coeff->kbits[i];
+ if (bits < 0)
+ {
request_bits( -bits ); /* toggle M0 to receive needed bits */
- bits = 0;
- }
-#if (DEBUG_5110)
- printf("FrameDump %02d ", ene);
- for (i = 0; i < m_coeff->num_k; i++)
- {
- int x;
- x = extract_bits( m_coeff->kbits[i]);
- m_new_k[i] = m_coeff->ktable[i][x];
- printf("%02d ", x);
- }
- printf("\n");
-#else
- for (i = 0; i < m_coeff->num_k; i++)
- {
- int x;
- x = extract_bits( m_coeff->kbits[i]);
- m_new_k[i] = m_coeff->ktable[i][x];
+ bits = 0;
+ }
+ m_new_frame_k_idx[i] = extract_bits(m_coeff->kbits[i]);
+#ifdef DEBUG_PARSE_FRAME_DUMP
+ printbits(m_new_frame_k_idx[i],m_coeff->kbits[i]);
+ fprintf(stderr," ");
+#endif
}
+#ifdef VERBOSE
+ if (m_speak_external)
+ logerror("Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken));
+ else
+ logerror("Parsed a frame successfully in ROM\n");
#endif
- if (DEBUG_5110) logerror(" (49-bit energy=%d pitch=%d rep=%d 10K frame)\n", m_new_energy, m_new_pitch, rep_flag);
-
+ return;
}
-
#if 0
/*This is an example word TEN taken from the TMS5110A datasheet*/
static const unsigned int example_word_TEN[619]={
@@ -981,30 +1237,39 @@ void m58817_device::device_start()
void tms5110_device::device_reset()
{
+ m_digital_select = FORCE_DIGITAL; // assume analog output
/* initialize the FIFO */
memset(m_fifo, 0, sizeof(m_fifo));
m_fifo_head = m_fifo_tail = m_fifo_count = 0;
/* initialize the chip state */
- m_speaking_now = m_talk_status = 0;
+ m_SPEN = m_TALK = m_TALKD = 0;
m_CTL_pins = 0;
m_RNG = 0x1fff;
m_CTL_buffer = 0;
m_PDC = 0;
/* initialize the energy/pitch/k states */
- m_old_energy = m_new_energy = m_current_energy = m_target_energy = 0;
- m_old_pitch = m_new_pitch = m_current_pitch = m_target_pitch = 0;
- memset(m_old_k, 0, sizeof(m_old_k));
- memset(m_new_k, 0, sizeof(m_new_k));
+#ifdef PERFECT_INTERPOLATION_HACK
+ m_old_frame_energy_idx = m_old_frame_pitch_idx = 0;
+ memset(m_old_frame_k_idx, 0, sizeof(m_old_frame_k_idx));
+ m_old_zpar = 0;
+#endif
+ m_new_frame_energy_idx = m_current_energy = m_previous_energy = 0;
+ m_new_frame_pitch_idx = m_current_pitch = 0;
+ m_zpar = m_uv_zpar = 0;
+ memset(m_new_frame_k_idx, 0, sizeof(m_new_frame_k_idx));
memset(m_current_k, 0, sizeof(m_current_k));
- memset(m_target_k, 0, sizeof(m_target_k));
/* initialize the sample generators */
- m_interp_count = m_sample_count = m_pitch_count = 0;
+ m_inhibit = 1;
+ m_subcycle = m_pitch_count = m_pitch_zero = m_PC = m_zpar = 0;
+ m_subc_reload = 1;
+ m_OLDE = m_OLDP = 1;
+ m_IP = 0;
+ m_RNG = 0x1FFF;
+ memset(m_u, 0, sizeof(m_u));
memset(m_x, 0, sizeof(m_x));
- m_next_is_address = FALSE;
- m_address = 0;
if (m_table != NULL)
{
/* legacy interface */
@@ -1017,6 +1282,8 @@ void tms5110_device::device_reset()
*/
m_schedule_dummy_read = FALSE;
}
+ m_next_is_address = FALSE;
+ m_address = 0;
m_addr_bit = 0;
}
@@ -1075,8 +1342,8 @@ READ8_MEMBER( tms5110_device::ctl_r )
m_stream->update();
if (m_state == CTL_STATE_TTALK_OUTPUT)
{
- if (DEBUG_5110) logerror("Status read while outputting Test Talk (status=%2d)\n", m_talk_status);
- return (m_talk_status << 0); /*CTL1 = still talking ? */
+ if (DEBUG_5110) logerror("Status read while outputting Test Talk (status=%2d)\n", TALK_STATUS);
+ return (TALK_STATUS << 0); /*CTL1 = still talking ? */
}
else if (m_state == CTL_STATE_OUTPUT)
{
@@ -1094,7 +1361,7 @@ READ8_MEMBER( m58817_device::status_r )
{
/* bring up to date first */
m_stream->update();
- return (m_talk_status << 0); /*CTL1 = still talking ? */
+ return (TALK_STATUS << 0); /*CTL1 = still talking ? */
}
/******************************************************************************
diff --git a/src/emu/sound/tms5110.h b/src/emu/sound/tms5110.h
index 43863042940..ffd9b8f5150 100644
--- a/src/emu/sound/tms5110.h
+++ b/src/emu/sound/tms5110.h
@@ -82,7 +82,10 @@ protected:
void set_variant(int variant);
- UINT8 m_talk_status;
+ UINT8 m_SPEN; /* set on speak command, cleared on stop command or reset command */
+ UINT8 m_TALK; /* set on SPEN & RESETL4(pc12->pc0 transition), cleared on stop command or reset command */
+#define TALK_STATUS (m_SPEN|m_TALKD)
+ UINT8 m_TALKD; /* TALK(TCON) value, latched every RESETL4 */
sound_stream *m_stream;
private:
@@ -94,11 +97,19 @@ private:
int extract_bits(int count);
void request_bits(int no);
void perform_dummy_read();
+ INT32 lattice_filter();
void process(INT16 *buffer, unsigned int size);
void PDC_set(int data);
void parse_frame();
- /* these contain data that describes the 64 bits FIFO */
+ // internal state
+ /* coefficient tables */
+ int m_variant; /* Variant of the 5110 - see tms5110.h */
+
+ /* coefficient tables */
+ const struct tms5100_coeffs *m_coeff;
+
+ /* these contain data that describes the 4 bit "FIFO" */
UINT8 m_fifo[FIFO_SIZE];
UINT8 m_fifo_head;
UINT8 m_fifo_tail;
@@ -107,9 +118,6 @@ private:
/* these contain global status bits */
UINT8 m_PDC;
UINT8 m_CTL_pins;
- UINT8 m_speaking_now;
-
-
UINT8 m_state;
/* Rom interface */
@@ -131,43 +139,68 @@ private:
devcb_write_line m_romclk_cb; // rom clock - Only used to drive the data lines
/* these contain data describing the current and previous voice frames */
- UINT16 m_old_energy;
- UINT16 m_old_pitch;
- INT32 m_old_k[10];
+#define OLD_FRAME_SILENCE_FLAG m_OLDE // 1 if E=0, 0 otherwise.
+#define OLD_FRAME_UNVOICED_FLAG m_OLDP // 1 if P=0 (unvoiced), 0 if voiced
+ UINT8 m_OLDE;
+ UINT8 m_OLDP;
- UINT16 m_new_energy;
- UINT16 m_new_pitch;
- INT32 m_new_k[10];
+#define NEW_FRAME_STOP_FLAG (m_new_frame_energy_idx == 0xF) // 1 if this is a stop (Energy = 0xF) frame
+#define NEW_FRAME_SILENCE_FLAG (m_new_frame_energy_idx == 0) // ditto as above
+#define NEW_FRAME_UNVOICED_FLAG (m_new_frame_pitch_idx == 0) // ditto as above
+ UINT8 m_new_frame_energy_idx;
+ UINT8 m_new_frame_pitch_idx;
+ UINT8 m_new_frame_k_idx[10];
/* these are all used to contain the current state of the sound generation */
- UINT16 m_current_energy;
- UINT16 m_current_pitch;
+#ifndef PERFECT_INTERPOLATION_HACK
+ INT16 m_current_energy;
+ INT16 m_current_pitch;
+ INT16 m_current_k[10];
+#else
+ UINT8 m_old_frame_energy_idx;
+ UINT8 m_old_frame_pitch_idx;
+ UINT8 m_old_frame_k_idx[10];
+ UINT8 m_old_zpar;
+
+ INT32 m_current_energy;
+ INT32 m_current_pitch;
INT32 m_current_k[10];
-
- UINT16 m_target_energy;
- UINT16 m_target_pitch;
- INT32 m_target_k[10];
-
- UINT8 m_interp_count; /* number of interp periods (0-7) */
- UINT8 m_sample_count; /* sample number within interp (0-24) */
- INT32 m_pitch_count;
-
- INT32 m_x[11];
-
- INT32 m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 */
+#endif
+
+ UINT16 m_previous_energy; /* needed for lattice filter to match patent */
+
+ UINT8 m_subcycle; /* contains the current subcycle for a given PC: 0 is A' (only used on SPKSLOW mode on 51xx), 1 is A, 2 is B */
+ UINT8 m_subc_reload; /* contains 1 for normal speech, 0 when SPKSLOW is active */
+ UINT8 m_PC; /* current parameter counter (what param is being interpolated), ranges from 0 to 12 */
+ /* NOTE: the interpolation period counts 1,2,3,4,5,6,7,0 for divide by 8,8,8,4,4,2,2,1 */
+ UINT8 m_IP; /* the current interpolation period */
+ UINT8 m_inhibit; /* If 1, interpolation is inhibited until the DIV1 period */
+ UINT8 m_uv_zpar; /* If 1, zero k5 thru k10 coefficients */
+ UINT8 m_zpar; /* If 1, zero ALL parameters. */
+ UINT8 m_pitch_zero; /* circuit 412; pitch is forced to zero under certain circumstances */
+ UINT16 m_pitch_count; /* pitch counter; provides chirp rom address */
+
+ INT32 m_u[11];
+ INT32 m_x[10];
+
+ UINT16 m_RNG; /* the random noise generator configuration is: 1 + x + x^3 + x^4 + x^13 TODO: no it isn't */
+ INT16 m_excitation_data;
+
+ /* The TMS51xx has two different ways of providing output data: the
+ analog speaker pins (which were usually used) and the Digital I/O pin.
+ The internal DAC used to feed the analog pins is only 8 bits, and has the
+ funny clipping/clamping logic, while the digital pin gives full 10 bit
+ resolution of the output data.
+ TODO: add a way to set/reset this other than the FORCE_DIGITAL define
+ */
+ UINT8 m_digital_select;
INT32 m_speech_rom_bitnum;
UINT8 m_romclk_hack_timer_started;
UINT8 m_romclk_hack_state;
- /* coefficient tables */
- int m_variant; /* Variant of the 5110 - see tms5110.h */
-
- /* coefficient tables */
- const struct tms5100_coeffs *m_coeff;
-
emu_timer *m_romclk_hack_timer;
const UINT8 *m_table;
};
diff --git a/src/emu/sound/tms5110r.inc b/src/emu/sound/tms5110r.inc
index 5dfb624ff8d..7e370853db0 100644
--- a/src/emu/sound/tms5110r.inc
+++ b/src/emu/sound/tms5110r.inc
@@ -47,7 +47,7 @@
T0280B 0281A = 1979 speak & spell, also == TMS5100, uses old chirp
?????? ????? (no decap; likely 'T0280D 0281D') = 1980 speak & spell, 1981 speak & spell compact, changed energy table, otherwise same as above, uses old chirp
T0280F 2801A = 1980 speak & math, 1980 speak and read, uses old chirp
- ?????? ????? (no decap; likely 'T0280F 2802') = touch and tell, language translator; uses a unique chirp rom.
+ T0280F 2802 = touch and tell, language translator; uses a unique chirp rom.
?????? ????? = TMS5110
T0280F 5110A = TMS5110AN2L
@@ -70,7 +70,6 @@
#define MAX_K 10
#define MAX_SCALE_BITS 6
#define MAX_SCALE (1<<MAX_SCALE_BITS)
-#define COEFF_ENERGY_SENTINEL (511)
#define MAX_CHIRP_SIZE 52
struct tms5100_coeffs
@@ -92,21 +91,13 @@ struct tms5100_coeffs
#define TI_0280_PATENT_ENERGY \
/* E */\
{ 0, 0, 1, 1, 2, 3, 5, 7, \
- 10, 15, 21, 30, 43, 61, 86, COEFF_ENERGY_SENTINEL }, // last rom value is actually really 0, but the tms5110.c code still requires the sentinel value to function correctly, until it is properly updated or merged with tms5220.c
+ 10, 15, 21, 30, 43, 61, 86, 0 },
-#define TI_0280_LATER_ENERGY \
- /* E */\
- { 0, 1, 2, 3, 4, 6, 8, 11, \
- 16, 23, 33, 47, 63, 85,114, COEFF_ENERGY_SENTINEL }, // last rom value is actually really 0, but the tms5110.c code still requires the sentinel value to function correctly, until it is properly updated or merged with tms5220.c
-
-//technically this is the same as above, but tms5220.c expects the 0 rather than needing a sentinel value
-//TODO: when tms5110.c no longer needs sentinel, get rid of this and merge with above.
-#define TI_0285_LATER_ENERGY \
+#define TI_028X_LATER_ENERGY \
/* E */\
{ 0, 1, 2, 3, 4, 6, 8, 11, \
16, 23, 33, 47, 63, 85,114, 0 },
-
/* pitch */
#define TI_0280_2801_PATENT_PITCH \
/* P */\
@@ -327,6 +318,11 @@ struct tms5100_coeffs
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
0x00, 0x00, 0x00, 0x00 },
+/* Interpolation Table */
+#define TI_INTERP \
+ /* interpolation shift coefficients */\
+ { 0, 3, 3, 3, 2, 2, 1, 1 }
+
/* TMS5100/TMC0281:
(Die revs A, B; 1977?-1981?)
The TMS5100NL was decapped and imaged by digshadow in April, 2013.
@@ -356,8 +352,7 @@ static const struct tms5100_coeffs T0280B_0281A_coeff =
TI_0280_PATENT_LPC
},
TI_0280_PATENT_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* TMS5110A/TMC0281D:
@@ -375,14 +370,13 @@ static const struct tms5100_coeffs T0280D_0281D_coeff =
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0280_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_0280_2801_PATENT_PITCH
{
TI_0280_PATENT_LPC
},
TI_0280_PATENT_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* TMC0280/CD2801:
@@ -411,14 +405,13 @@ static const struct tms5100_coeffs T0280F_2801A_coeff =
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0280_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_0280_2801_PATENT_PITCH
{
TI_2801_2501E_LPC
},
TI_2801_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* Mitsubishi M58817
@@ -435,14 +428,13 @@ static const struct tms5100_coeffs M58817_coeff =
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0280_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_0280_2801_PATENT_PITCH
{
TI_2801_2501E_LPC
},
TI_2801_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* CD2802:
@@ -460,14 +452,13 @@ static const struct tms5100_coeffs T0280F_2802_coeff =
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0280_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_2802_PITCH
{
TI_2802_LPC
},
TI_2802_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* TMS5110A:
@@ -492,14 +483,13 @@ static const struct tms5100_coeffs tms5110a_coeff =
4,
5,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0280_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_5110_PITCH
{
TI_5110_5220_LPC
},
TI_LATER_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* The following coefficients come from US Patent 4,335,277 and 4,581,757.
@@ -518,7 +508,7 @@ static const struct tms5100_coeffs pat4335277_coeff =
4,
6,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0285_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_2501E_PITCH
{
/* K1dc */
@@ -554,8 +544,7 @@ static const struct tms5100_coeffs pat4335277_coeff =
{ -205, -132, -59, 14, 87, 160, 234, 307 },
},
TI_0280_PATENT_CHIRP
- /* interpolation coefficients */
- { 3, 3, 3, 2, 2, 1, 1, 0 }
+ TI_INTERP
};
/* TMS5200/CD2501E
@@ -591,14 +580,13 @@ static const struct tms5100_coeffs T0285_2501E_coeff =
4,
6,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0285_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_2501E_PITCH
{
TI_2801_2501E_LPC
},
TI_LATER_CHIRP
- /* interpolation coefficients */
- { 0, 3, 3, 3, 2, 2, 1, 1 }
+ TI_INTERP
};
/* TMS5220/5220C:
@@ -620,14 +608,13 @@ static const struct tms5100_coeffs tms5220_coeff =
4,
6,
{ 5, 5, 4, 4, 4, 4, 4, 3, 3, 3 },
- TI_0285_LATER_ENERGY
+ TI_028X_LATER_ENERGY
TI_5220_PITCH
{
TI_5110_5220_LPC
},
TI_LATER_CHIRP
- /* interpolation coefficients */
- { 0, 3, 3, 3, 2, 2, 1, 1 }
+ TI_INTERP
};
/* The following Sanyo VLM5030 coefficients are derived from decaps of the chip
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index c948640972a..8b8f5190de3 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -749,10 +749,13 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
/* loop until the buffer is full or we've stopped speaking */
while ((size > 0) && m_speaking_now)
{
- /* if it is the appropriate time to update the old energy/pitch idxes,
+ /* if it is the appropriate time to update the old energy/pitch indices,
* i.e. when IP=7, PC=12, T=17, subcycle=2, do so. Since IP=7 PC=12 T=17
* is JUST BEFORE the transition to IP=0 PC=0 T=0 sybcycle=(0 or 1),
- * which happens 4 T-cycles later), we change on the latter.*/
+ * which happens 4 T-cycles later), we change on the latter.
+ * The indices are updated here ~12 PCs before the new frame is applied.
+ */
+ /** TODO: the patents 4331836, 4335277, and 4419540 disagree about the timing of this **/
if ((m_IP == 0) && (m_PC == 0) && (m_subcycle < 2))
{
m_OLDE = (m_new_frame_energy_idx == 0);
@@ -786,13 +789,30 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
#ifdef DEBUG_GENERATION
fprintf(stderr,"tms5220_process: processing frame: talk status = 0 caused by stop frame or buffer empty, halting speech.\n");
#endif
- m_speaking_now = 0; // finally halt speech
- goto empty;
+ if (m_speaking_now == 1) // we're done, set all coeffs to idle state but keep going for a bit...
+ {
+ /**TODO: should index clearing be done here, or elsewhere? **/
+ m_new_frame_energy_idx = 0;
+ m_new_frame_pitch_idx = 0;
+ for (i = 0; i < 4; i++)
+ m_new_frame_k_idx[i] = 0;
+ for (i = 4; i < 7; i++)
+ m_new_frame_k_idx[i] = 0xF;
+ for (i = 7; i < m_coeff->num_k; i++)
+ m_new_frame_k_idx[i] = 0x7;
+ m_speaking_now = 2; // wait 8 extra interp periods before shutting down so we can interpolate everything to zero state
+ }
+ else // m_speaking_now == 2 // now we're really done.
+ {
+ m_speaking_now = 0; // finally halt speech
+ goto empty;
+ }
}
- /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[] */
- parse_frame();
+ /* Parse a new frame into the new_target_energy, new_target_pitch and new_target_k[],
+ * but only if we're not just about to end speech */
+ if (m_speaking_now == 1) parse_frame();
#ifdef DEBUG_PARSE_FRAME_DUMP
fprintf(stderr,"\n");
#endif
@@ -810,11 +830,13 @@ void tms5220_device::process(INT16 *buffer, unsigned int size)
Interpolation inhibit cases:
* Old frame was voiced, new is unvoiced
* Old frame was silence/zero energy, new has nonzero energy
- * Old frame was unvoiced, new is voiced (note this is the case on the patent but may not be correct on the real final chip)
+ * Old frame was unvoiced, new is voiced
+ * Old frame was unvoiced, new frame is silence/zero energy (unique to tms52xx)
*/
if ( ((OLD_FRAME_UNVOICED_FLAG == 0) && (NEW_FRAME_UNVOICED_FLAG == 1))
- || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0)) /* this line needs further investigation, starwars tie fighters may sound better without it */
- || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0)) )
+ || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_UNVOICED_FLAG == 0))
+ || ((OLD_FRAME_SILENCE_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 0))
+ || ((OLD_FRAME_UNVOICED_FLAG == 1) && (NEW_FRAME_SILENCE_FLAG == 1)) )
m_inhibit = 1;
else // normal frame, normal interpolation
m_inhibit = 0;
diff --git a/src/emu/ui/devopt.c b/src/emu/ui/devopt.c
index 0bf4e5f40c3..75b6c899576 100644
--- a/src/emu/ui/devopt.c
+++ b/src/emu/ui/devopt.c
@@ -110,7 +110,7 @@ void ui_menu_device_config::populate()
strcatprintf(str,"%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
visarea.width(), visarea.height(),
(machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
- ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
+ ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds()));
}
}
}
diff --git a/src/emu/ui/miscmenu.c b/src/emu/ui/miscmenu.c
index be611f9c6e6..88e74458c5e 100644
--- a/src/emu/ui/miscmenu.c
+++ b/src/emu/ui/miscmenu.c
@@ -205,7 +205,7 @@ void ui_menu_bookkeeping::handle()
/* if the time has rolled over another second, regenerate */
curtime = machine().time();
- if (prevtime.seconds != curtime.seconds)
+ if (prevtime.seconds() != curtime.seconds())
{
reset(UI_MENU_RESET_SELECT_FIRST);
prevtime = curtime;
@@ -236,10 +236,10 @@ void ui_menu_bookkeeping::populate()
int ctrnum;
/* show total time first */
- if (prevtime.seconds >= 60 * 60)
- strcatprintf(tempstring, "Uptime: %d:%02d:%02d\n\n", prevtime.seconds / (60 * 60), (prevtime.seconds / 60) % 60, prevtime.seconds % 60);
+ if (prevtime.seconds() >= 60 * 60)
+ strcatprintf(tempstring, "Uptime: %d:%02d:%02d\n\n", prevtime.seconds() / (60 * 60), (prevtime.seconds() / 60) % 60, prevtime.seconds() % 60);
else
- strcatprintf(tempstring,"Uptime: %d:%02d\n\n", (prevtime.seconds / 60) % 60, prevtime.seconds % 60);
+ strcatprintf(tempstring,"Uptime: %d:%02d\n\n", (prevtime.seconds() / 60) % 60, prevtime.seconds() % 60);
/* show tickets at the top */
if (tickets > 0)
diff --git a/src/emu/ui/sliders.c b/src/emu/ui/sliders.c
index 58c67a77bf4..21037c72827 100644
--- a/src/emu/ui/sliders.c
+++ b/src/emu/ui/sliders.c
@@ -141,9 +141,6 @@ void ui_menu_sliders::populate()
if (curval < curslider->maxval)
flags |= MENU_FLAG_RIGHT_ARROW;
item_append(curslider->description, tempstring.c_str(), flags, (void *)curslider);
-
- if (menuless_mode)
- break;
}
/* add OSD sliders */
diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c
index 8cb98399b04..95b51f24bab 100644
--- a/src/emu/ui/ui.c
+++ b/src/emu/ui/ui.c
@@ -1251,7 +1251,7 @@ std::string &ui_manager::game_info_astring(std::string &str)
strcatprintf(str, "%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
visarea.width(), visarea.height(),
(machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
- ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
+ ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds()));
}
}
}
@@ -2084,8 +2084,8 @@ static INT32 slider_refresh(running_machine &machine, void *arg, std::string *st
screen->configure(width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
}
if (str != NULL)
- strprintf(*str,"%.3ffps", ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds));
- refresh = ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds);
+ strprintf(*str,"%.3ffps", ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds()));
+ refresh = ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds());
return floor((refresh - defrefresh) * 1000.0 + 0.5);
}
diff --git a/src/emu/video.c b/src/emu/video.c
index 2ce890d44e4..adc2888b2e7 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -239,7 +239,7 @@ void video_manager::frame_update(bool debug)
update_frameskip();
// update speed computations
- if (!debug)
+ if (!debug && !skipped_it)
recompute_speed(current_time);
// call the end-of-frame callback
@@ -381,7 +381,7 @@ void video_manager::begin_recording(const char *name, movie_format format)
// build up information about this new movie
avi_movie_info info;
info.video_format = 0;
- info.video_timescale = 1000 * ((machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
+ info.video_timescale = 1000 * ((machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds()) : screen_device::DEFAULT_FRAME_RATE);
info.video_sampletime = 1000;
info.video_numsamples = 0;
info.video_width = m_snap_bitmap.width();
@@ -447,7 +447,7 @@ void video_manager::begin_recording(const char *name, movie_format format)
if (filerr == FILERR_NONE)
{
// start the capture
- int rate = (machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE;
+ int rate = (machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds()) : screen_device::DEFAULT_FRAME_RATE;
png_error pngerr = mng_capture_start(*m_mng_file, m_snap_bitmap, rate);
if (pngerr != PNGERR_NONE)
{
@@ -540,12 +540,12 @@ void video_manager::exit()
m_snap_bitmap.reset();
// print a final result if we have at least 2 seconds' worth of data
- if (m_overall_emutime.seconds >= 1)
+ if (m_overall_emutime.seconds() >= 1)
{
osd_ticks_t tps = osd_ticks_per_second();
double final_real_time = (double)m_overall_real_seconds + (double)m_overall_real_ticks / (double)tps;
double final_emu_time = m_overall_emutime.as_double();
- osd_printf_info("Average speed: %.2f%% (%d seconds)\n", 100 * final_emu_time / final_real_time, (m_overall_emutime + attotime(0, ATTOSECONDS_PER_SECOND / 2)).seconds);
+ osd_printf_info("Average speed: %.2f%% (%d seconds)\n", 100 * final_emu_time / final_real_time, (m_overall_emutime + attotime(0, ATTOSECONDS_PER_SECOND / 2)).seconds());
}
}
@@ -962,7 +962,7 @@ void video_manager::update_refresh_speed()
screen_device_iterator iter(machine().root_device());
for (screen_device *screen = iter.first(); screen != NULL; screen = iter.next())
{
- attoseconds_t period = screen->frame_period().attoseconds;
+ attoseconds_t period = screen->frame_period().attoseconds();
if (period != 0)
min_frame_period = MIN(min_frame_period, period);
}
@@ -1034,7 +1034,7 @@ void video_manager::recompute_speed(const attotime &emutime)
}
// if we're past the "time-to-execute" requested, signal an exit
- if (m_seconds_to_run != 0 && emutime.seconds >= m_seconds_to_run)
+ if (m_seconds_to_run != 0 && emutime.seconds() >= m_seconds_to_run)
{
#ifdef MAME_DEBUG
if (g_tagmap_counter_enabled)
diff --git a/src/emu/video/315_5313.c b/src/emu/video/315_5313.c
index 0153c2ad05b..a612c384e99 100644
--- a/src/emu/video/315_5313.c
+++ b/src/emu/video/315_5313.c
@@ -1141,9 +1141,9 @@ UINT16 sega315_5313_device::get_hposition()
time_elapsed_since_megadriv_scanline_timer = m_megadriv_scanline_timer->time_elapsed();
- if (time_elapsed_since_megadriv_scanline_timer.attoseconds<(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines))
+ if (time_elapsed_since_megadriv_scanline_timer.attoseconds() < (ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines))
{
- value4 = (UINT16)(MAX_HPOSITION*((double)(time_elapsed_since_megadriv_scanline_timer.attoseconds) / (double)(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines)));
+ value4 = (UINT16)(MAX_HPOSITION*((double)(time_elapsed_since_megadriv_scanline_timer.attoseconds()) / (double)(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines)));
}
else /* in some cases (probably due to rounding errors) we get some stupid results (the odd huge value where the time elapsed is much higher than the scanline time??!).. hopefully by clamping the result to the maximum we limit errors */
{
@@ -2735,7 +2735,7 @@ void sega315_5313_device::vdp_handle_eof()
visarea.set(0, scr_width - 1, 0, m_visible_scanlines - 1);
- m_screen->configure(480, m_total_scanlines, visarea, m_screen->frame_period().attoseconds);
+ m_screen->configure(480, m_total_scanlines, visarea, m_screen->frame_period().attoseconds());
}
diff --git a/src/emu/video/ef9345.c b/src/emu/video/ef9345.c
index 22ade42300c..ca8062bbb95 100644
--- a/src/emu/video/ef9345.c
+++ b/src/emu/video/ef9345.c
@@ -244,7 +244,7 @@ void ef9345_device::set_video_mode(void)
rectangle visarea = m_screen->visible_area();
visarea.max_x = new_width - 1;
- m_screen->configure(new_width, m_screen->height(), visarea, m_screen->frame_period().attoseconds);
+ m_screen->configure(new_width, m_screen->height(), visarea, m_screen->frame_period().attoseconds());
}
//border color
diff --git a/src/emu/video/h63484.c b/src/emu/video/h63484.c
index dd949cbc222..906c01573e4 100644
--- a/src/emu/video/h63484.c
+++ b/src/emu/video/h63484.c
@@ -531,7 +531,7 @@ inline void h63484_device::recompute_parameters()
rectangle visarea = m_screen->visible_area();
visarea.set((m_hsw + m_hds) * ppmc, (m_hsw + m_hds + m_hdw) * ppmc - 1, m_vds, vbstart - 1);
- attoseconds_t frame_period = m_screen->frame_period().attoseconds; // TODO: use clock() to calculate the frame_period
+ attoseconds_t frame_period = m_screen->frame_period().attoseconds(); // TODO: use clock() to calculate the frame_period
m_screen->configure(m_hc * ppmc, m_vc, visarea, frame_period);
}
diff --git a/src/emu/video/i8275.c b/src/emu/video/i8275.c
index 59f50b04f70..4f75d7cbc1a 100644
--- a/src/emu/video/i8275.c
+++ b/src/emu/video/i8275.c
@@ -666,7 +666,7 @@ void i8275_device::recompute_parameters()
int horiz_pix_total = (CHARACTERS_PER_ROW + HRTC_COUNT) * m_hpixels_per_column;
int vert_pix_total = (CHARACTER_ROWS_PER_FRAME + VRTC_ROW_COUNT) * SCANLINES_PER_ROW;
- attoseconds_t refresh = m_screen->frame_period().attoseconds;
+ attoseconds_t refresh = m_screen->frame_period().attoseconds();
int max_visible_x = (CHARACTERS_PER_ROW * m_hpixels_per_column) - 1;
int max_visible_y = (CHARACTER_ROWS_PER_FRAME * SCANLINES_PER_ROW) - 1;
diff --git a/src/emu/video/scn2674.c b/src/emu/video/scn2674.c
index ee1b9a10d79..8dbc0f403e0 100644
--- a/src/emu/video/scn2674.c
+++ b/src/emu/video/scn2674.c
@@ -568,7 +568,7 @@ void scn2674_device::recompute_parameters()
m_hpixels_per_column = m_gfx_enabled ? m_gfx_hpixels_per_column : m_text_hpixels_per_column;
int horiz_pix_total = ((m_IR1_equalizing_constant + (m_IR2_horz_sync_width << 1)) << 1) * m_hpixels_per_column;
int vert_pix_total = m_IR4_rows_per_screen * m_IR0_scanline_per_char_row + m_IR3_vert_front_porch + m_IR3_vert_back_porch + m_IR7_vsync_width;
- attoseconds_t refresh = m_screen->frame_period().attoseconds;
+ attoseconds_t refresh = m_screen->frame_period().attoseconds();
int max_visible_x = (m_IR5_character_per_row * m_hpixels_per_column) - 1;
int max_visible_y = (m_IR4_rows_per_screen * m_IR0_scanline_per_char_row) - 1;
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index db140118995..1874fccad29 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -2095,8 +2095,8 @@ static void cmdfifo_w(voodoo_state *v, cmdfifo_info *f, offs_t offset, UINT32 da
v->pci.op_end_time = v->device->machine().time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index,
- v->device->machine().time().seconds, (UINT32)(v->device->machine().time().attoseconds >> 32), (UINT32)v->device->machine().time().attoseconds,
- v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
+ v->device->machine().time().seconds(), (UINT32)(v->device->machine().time().attoseconds() >> 32), (UINT32)v->device->machine().time().attoseconds(),
+ v->pci.op_end_time.seconds(), (UINT32)(v->pci.op_end_time.attoseconds() >> 32), (UINT32)v->pci.op_end_time.attoseconds());
}
}
}
@@ -2585,7 +2585,7 @@ static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data)
if (v->reg[hSync].u != 0 && v->reg[vSync].u != 0 && v->reg[videoDimensions].u != 0)
{
int hvis, vvis, htotal, vtotal, hbp, vbp;
- attoseconds_t refresh = v->screen->frame_period().attoseconds;
+ attoseconds_t refresh = v->screen->frame_period().attoseconds();
attoseconds_t stdperiod, medperiod, vgaperiod;
attoseconds_t stddiff, meddiff, vgadiff;
rectangle visarea;
@@ -3569,8 +3569,8 @@ static void flush_fifos(voodoo_state *v, attotime current_time)
if (!v->pci.op_pending) fatalerror("flush_fifos called with no pending operation\n");
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:flush_fifos start -- pending=%d.%08X%08X cur=%d.%08X%08X\n", v->index,
- v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds,
- current_time.seconds, (UINT32)(current_time.attoseconds >> 32), (UINT32)current_time.attoseconds);
+ v->pci.op_end_time.seconds(), (UINT32)(v->pci.op_end_time.attoseconds() >> 32), (UINT32)v->pci.op_end_time.attoseconds(),
+ current_time.seconds(), (UINT32)(current_time.attoseconds() >> 32), (UINT32)current_time.attoseconds());
/* loop while we still have cycles to burn */
while (v->pci.op_end_time <= current_time)
@@ -3667,12 +3667,12 @@ static void flush_fifos(voodoo_state *v, attotime current_time)
v->pci.op_end_time += attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:update -- pending=%d.%08X%08X cur=%d.%08X%08X\n", v->index,
- v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds,
- current_time.seconds, (UINT32)(current_time.attoseconds >> 32), (UINT32)current_time.attoseconds);
+ v->pci.op_end_time.seconds(), (UINT32)(v->pci.op_end_time.attoseconds() >> 32), (UINT32)v->pci.op_end_time.attoseconds(),
+ current_time.seconds(), (UINT32)(current_time.attoseconds() >> 32), (UINT32)current_time.attoseconds());
}
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:flush_fifos end -- pending command complete at %d.%08X%08X\n", v->index,
- v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
+ v->pci.op_end_time.seconds(), (UINT32)(v->pci.op_end_time.attoseconds() >> 32), (UINT32)v->pci.op_end_time.attoseconds());
in_flush = FALSE;
}
@@ -3782,8 +3782,8 @@ WRITE32_MEMBER( voodoo_device::voodoo_w )
v->pci.op_end_time = machine().time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index,
- machine().time().seconds, (UINT32)(machine().time().attoseconds >> 32), (UINT32)machine().time().attoseconds,
- v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
+ machine().time().seconds(), (UINT32)(machine().time().attoseconds() >> 32), (UINT32)machine().time().attoseconds(),
+ v->pci.op_end_time.seconds(), (UINT32)(v->pci.op_end_time.attoseconds() >> 32), (UINT32)v->pci.op_end_time.attoseconds());
}
g_profiler.stop();
return;
diff --git a/src/mame/arcade.lst b/src/mame/arcade.lst
index d8bd51ffbff..07517095200 100644
--- a/src/mame/arcade.lst
+++ b/src/mame/arcade.lst
@@ -333,9 +333,10 @@ cavelon // (c) 1983 Jetsoft
sfx // (c) 1983 Nichibutsu
skelagon // (c) 1983 Nichibutsu USA
monsterz // (c) 1982 Nihon (Arcade TV Game List - P.102, Left, 20 from top)
-mimonscr // (c) 1982 Universal Video Games (US Copyright Office info - http://cocatalog.loc.gov)
-mimonkey // (c) 1982 bootleg
+mimonkey // (c) 1982 Universal Video Games (US Copyright Office info - http://cocatalog.loc.gov)
mimonsco // (c) 1982 bootleg
+mimonscr // (c) 1982 bootleg
+mimonscra // (c) 1982 bootleg
scobra // GX316 (c) 1981 Konami
scobras // GX316 (c) 1981 Stern
scobrase // GX316 (c) 1981 Sega
@@ -2707,6 +2708,7 @@ dogyuun // TP-022 (c) 1992 Toaplan
dogyuuna // TP-022 (c) 1992 Toaplan
dogyuunt // TP-022 (c) 1992 Toaplan
kbash // TP-023 (c) 1993 Toaplan
+kbashk // TP-023 (c) 1993 Toaplan
kbash2 // bootleg
truxton2 // TP-024 (c) 1992 Toaplan
pipibibs // TP-025
@@ -3512,6 +3514,7 @@ mvscb // 23/01/1998 (c) 1998 (Brazil)
sfa3 // 04/09/1998 (c) 1998 (USA)
sfa3u // 04/09/1998 (c) 1998 (USA)
sfa3ur1 // 29/06/1998 (c) 1998 (USA)
+sfa3us // 16/06/1998 (c) 1998 (USA)
sfa3h // 04/09/1998 (c) 1998 (Hispanic)
sfa3hr1 // 29/06/1998 (c) 1998 (Hispanic)
sfa3b // 29/06/1998 (c) 1998 (Brazil)
@@ -6144,10 +6147,11 @@ ragtimea // MBD (c) 1992 (Japan, v1.3)
dblewing // MBE (c) 1993 Mitchell
fghthist // MBF (c) 1993 Data East Corporation (World) DE-0380-2 PCB
fghthista // MBF (c) 1993 Data East Corporation (World) DE-0380-2 PCB
-fghthistu // MBF (c) 1993 Data East Corporation (US) DE-0395-1 PCB
+fghthistu // MBF (c) 1993 Data East Corporation (US) DE-0396-0 PCB
fghthistua // MBF (c) 1993 Data East Corporation (US) DE-0395-1 PCB
+fghthistub // MBF (c) 1993 Data East Corporation (US) DE-0395-1 PCB
+fghthistuc // MBF (c) 1993 Data East Corporation (US) DE-0380-2 PCB
fghthistj // MBF (c) 1993 Data East Corporation (Japan) DE-0395-1 PCB
-fghthistub // MBF (c) 1993 Data East Corporation (US) DE-0380-2 PCB
fghthistja // MBF (c) 1993 Data East Corporation (Japan) DE-0380-2 PCB
fghthistjb // MBF (c) 1993 Data East Corporation (Japan) DE-0380-1 PCB
hvysmsh // MBG (c) 1993 Data East Corporation (World)
@@ -8983,6 +8987,7 @@ surfplnt // (c) 1997 - Ref 971223
surfplnt40 // (c) 1997 - Ref 970514
radikalb // (c) 1998 - Ref ???
radikalba // (c) 1998 - Ref ???
+rollext // (c) 1999 - Ref 991015
// SH-4 hardware
atvtrack // (c) 2002 - Ref 020419
@@ -9530,6 +9535,7 @@ puzzlet // (c) 2000 Yunizu Corporation (Japan)
spcforce // (c) 1980 Venture Line
spcforc2 // bootleg
meteor // (c) 1981 Venture Line
+meteors // (c) 1981 Amusement World
looping // (c) 1982 Video Games GmbH
loopingv // (c) 1982 Video Games GmbH (Venture Line license)
loopingva // (c) 1982 Video Games GmbH (Venture Line license)
@@ -9658,104 +9664,106 @@ mjsenka // (c) 1986 Visco
mjyarou // (c) 1986 Visco / Video System
mjclub // (c) 1986 Xex
daisyari // (c) 1989 Best System
-suzume // ?? (c) 1986 Dyna Electronics
+ippatsu // 01? (c) 1986 Dyna Electronics
hnayayoi // "02" (c) 1987 Dyna Electronics
dondenmj // "03" (c) 1986 Dyna Electronics
-ippatsu // ?? (c) 1986 Dyna Electronics
+suzume // 04? (c) 1986 Dyna Electronics
+makaijan // "05" (c) 1987 Dynax
hnfubuki // "06" (c) 1987 Dynax
mjdiplob // "07" (c) 1987 Dynax
untoucha // "08" (c) 1987 Dynax
tontonb // "09" (c) 1987 Dynax
-makaijan // ?? (c) 1987 Dynax
+mjapinky // "14" (c) 1988 Dynax
hanamai // "16" (c) 1988 Dynax
majs101b // "17" (c) [1988] Dynax
-janyuki // "??" (c) 1988 Dynax
-mjapinky // 1988 Dynax
-mjdejavu // 1989 Dynax
-mjdejav2 // 1989 Dynax
+janyuki // ?? (c) 1988 Dynax
hnkochou // "20" (c) 1989 Dynax
+mjdejavu // "21" (c) 1989 Dynax
+mjdejav2 // "21" (c) 1989 Dynax
mjderngr // "22" (c) 1989 Dynax
hnoridur // "23" (c) 1989 Dynax
drgpunch // "24" (c) 1989 Dynax
-mjfriday // "26" (c) [1989] Dynax
+mjfriday // "26" (c) 1989 Dynax
jantouki // "27" Jantouki 1989 Dynax
-gekisha // "28" 1989 Dynax
-mjifb // "29" 1990 Dynax
-mjifb2 // "29" 1990 Dynax
-mjifb3 // "29" 1990 Dynax
-mjvegas // 1991 Dynax
-mjvegasa // 1991 Dynax
-cafetime // 1992 Dynax
-cafedoll // 1993 Dynax
-janptr96 // 1996 Dynax
-janptrsp // 1997 Dynax
+gekisha // "28" (c) 1989 Dynax
+mjifb // "29" (c) 1990 Dynax
+mjifb2 // "29" (c) 1990 Dynax
+mjifb3 // "29" (c) 1990 Dynax
sprtmtch // "31" (c) 1989 Dynax + Fabtek license
-maya // (c) 1994 Promat
-mayaa // (c) 1994 Promat
-mayab // (c) 1994 Promat
-mayac // (c) 1994 Promat
-inca // (c) 199? ????
-blktouch // (c) Yang Gi Co Ltd.
mcnpshnt // "33" Mahjong Campus Hunting 1990 Dynax
7jigen // "37" 7jigen no Youseitachi 1990 Dynax
mjembase // "38" Mahjong Electromagnetic Base 1989 Dynax
+majxtal7 // "40" (c) 1990 Dynax
neruton // "45" Mahjong Neruton Haikujiradan 1990 Dynax
nerutona // "45" Mahjong Neruton Haikujiradan 1990 Dynax
-mjcomv1 // 1991 Dynax
-shpeng // (c) 1995 WSAC Systems
-tenkai // 1991 Dynax
-tenkai2b // 1991 Dynax
-tenkaibb // 1991 Dynax
-tenkaicb // 1991 Dynax
-tenkaie // 1991 Dynax
-ougonpai // 1991 Dynax
-ougonpaib // bootleg
-htengoku // 1992 Dynax
-cdracula // 1994 Y.S.E.
-mjreach // 1994 Dynax
+hjingi // ?? (c) 1990 Dynax
+hjingia // ?? (c) 1990 Dynax
+tenkai // (c) 1991 Dynax
+tenkai2b // (c) 1991 bootleg
+tenkaibb // (c) 1991 bootleg
+tenkaicb // (c) 1991 bootleg
+tenkaie // (c) 1991 Dynax
+mjvegas // "50" 1991 Dynax
+mjvegasa // "50" 1991 Dynax
mjdialq2 // "52" (c) 1991 Dynax
mjdialq2a // "52" (c) 1991 Dynax
yarunara // "55" Mahjong Yarunara 1991 Dynax
-mjangels // "61" Mahjong Angels 1991 Dynax
+hanayara // "55" (c) 1991 Dynax
+mjcomv1 // "61" (c) 1991 Dynax
+mjangels // "612" Mahjong Angels 1991 Dynax
+ougonpai // "62" (c) 1991 Dynax
+ougonpaib // "62" (c) 1991 bootleg
+cafetime // "63" (c) 1992 Dynax
quiztvqq // "64" Quiz TV Gassyuukoku Q&Q 1992 Dynax
-mmpanic // "70" 1992 Nakanihon/Taito
+htengoku // "65" (c) 1992 Dynax
+mmpanic // "70" (c) 1992 Nakanihon/Taito
+mjmyornt // "71" (c) 1992 Dynax
+mjmyorn2 // "71?" (c) 1993 Dynax
+mjelctrn // ?? Mahjong Electron Base parts 2 & 4
+mjelct3 // ?? Mahjong Electron Base parts 2 & 3
+mjelct3a // ?? Mahjong Electron Base parts 2 & 3
+mjelctrb // ?? (c) 1993 bootleg Mahjong Electron Base parts 2 & 4
quizchq // "73" (c) 1993 Nakanihon
quizchql // "73" (c) 1993 Laxan
funkyfig // "74" (c) 1993 Nakanihon + East Technology
-funkyfiga //
-animaljr // "75" 1993 Nakanihon/Taito (USA)
-animaljrs // "75" 1993 Nakanihon/Taito (Spanish version)
-animaljrj // "75" 1993 Nakanihon/Taito (Japan)
-hginga // 1994 Dynax
-mjmyster // "?7" 1994 Dynax
-mjmywrld // "?7" 1994 Dynax
-mjmyornt // 1994 Dynax
-mjmyuniv // 1994 Dynax
+funkyfiga // "74" (c) 1993 Nakanihon + East Technology
+animaljr // "75" (c) 1993 Nakanihon/Taito (USA)
+animaljrs // "75" (c) 1993 Nakanihon/Taito (Spanish version)
+animaljrj // "75" (c) 1993 Nakanihon/Taito (Japan)
+cafedoll // "76" (c) 1993 Dynax
+mjmyster // "77" (c) 1994 Dynax
+mjmywrld // "77" (c) 1994 Dynax
quiz365 // "78" (c) 1994 Nakanihon
quiz365t // "78" (c) 1994 Nakanihon (Taiwan)
rongrong // "80" (c) 1994 Nakanihon
rongrongj // "80" (c) 1994 Nakanihon
rongrongg // "80" (c) 1994 Nakanihon
-hgokbang // "116" (c) 1995 Dynax
-mjtensin // "100" 1995 Dynax
+hginga // "81" (c) 1994 Dynax
+mjmyuniv // "85" (c) 1994 Dynax
+mjreach // (c) 1994 bootleg
+cdracula // (c) 1994 Y.S.E.
+mjtensin // "100" (c) 1995 Dynax
hparadis // "101" (c) 1994 Nakanihon
nettoqc // "103" (c) 1995 Nakanihon
ultrchmp // "104" (c) 1995 Nakanihon
ultrchmph // "114" (c) 1995 Nakanihon
-majrjhdx // "105" 1996 Dynax
+majrjhdx // "105" (c) 1996 Dynax
hgokou // "108" (c) 1995 Dynax (Alba license)
mjdchuka // "111" (c) 1995 Nakanihon
ddenlovj // "112" (c) 1995 Dynax (Japan)
ddenlovrk // "113" (c) 1995 Dynax (Korea)
ddenlovr // "113" (c) 1996 Dynax (Hong Kong)
mjschuka // "115" (c) 1995 Dynax
+hgokbang // "116" (c) 1995 Dynax
mjchuuka // "121" (c) 1998 Dynax
ddenlovrb // bootleg
-mjflove // "500" 1996 Dynax
-akamaru // "501" 1996 Dynax
-sryudens // "502" 1996 Dynax / Face
-hanakanz // "507" 1996 Dynax
+mjflove // "500" (c) 1996 Dynax
+akamaru // "501" (c) 1996 Dynax
+sryudens // "502" (c) 1996 Dynax / Face
+janptr96 // "503" (c) 1996 Dynax
+hanakanz // "507" (c) 1996 Dynax
hkagerou // "510" Hana Kagerou 1996 Nakanihon
+janptrsp // "511" (c) 1997 Dynax
realbrkj // "523" Billiard Academy Real Break 1998 (Japan)
dai2kaku // "522" DaiDaiKakumei (Japan)
mjreach1 // "526" Mahjong Reach Ippatsu 1998 Nihon System/Dynax
@@ -9777,14 +9785,13 @@ kotbinsp // "909" 1997 Dynax / Shinwhajin
pkgnsh // "505" Pachinko Gindama Shoubu 1998 (Japan)
pkgnshdx // "522" Pachinko Gindama Shoubu DX 1998 (Japan)
-hjingi // "???" 1990 Dynax
-hjingia // "???" 1990 Dynax
-hanayara // "???"
-mjelctrn // "???" Mahjong Electron Base parts 2 & 4
-mjelct3 // "???" Mahjong Electron Base parts 2 & 3
-mjelct3a // "???" Mahjong Electron Base parts 2 & 3
-mjelctrb // (c) 1993 Dynax Mahjong Electron Base parts 4
-majxtal7 // "???"
+maya // (c) 1994 Promat
+mayaa // (c) 1994 Promat
+mayab // (c) 1994 Promat
+mayac // (c) 1994 Promat
+inca // (c) 199? ????
+blktouch // (c) Yang Gi Co Ltd.
+shpeng // (c) 1995 WSAC Systems
// Sigma games
nyny // (c) 1980 Sigma Ent. Inc.
@@ -9900,6 +9907,7 @@ starzan // (c) 2000?
// IGS027A Cpu Games
slqz3 // (c) 1999
+fruitpar // (c) 200?
zhongguo // (c) 2000
sdwx // (c) 2002
sddz // (c) 200?
@@ -10719,6 +10727,7 @@ riviera // (c) 1987 Merit
rivieraa // (c) 1986 Merit
rivierab // (c) 1986 Merit
americna // (c) 1987 Merit
+americnaa // (c) 1987 Merit
meritjp // (c) 1987 Merit
dodgecty // (c) 1988 Merit
dodgectya // (c) 1986 Merit
@@ -11793,6 +11802,7 @@ showhand // (c) 2000 Astro Corp.
showhanc // (c) 2000 Astro Corp.
skilldrp // (c) 2002 Astro Corp.
speeddrp // (c) 2003 Astro Corp.
+dinodino // (c) 2003? Astro Corp.
astoneag // (c) 2004? Astro Corp.
winbingo // (c) 2005? Astro Corp.
winbingoa // (c) 2005? Astro Corp.
@@ -32172,3 +32182,6 @@ amusco // 1987, Amusco.
cocoloco // 198?, Petaco S.A.
alinvade
+
+joystand // 1997 Yuvo
+faceoffh // 1993 SoftLogic / Entertainment Enterprises
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 69180d61031..b4a8cc67501 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -629,6 +629,7 @@ atari_jsa_i_device::atari_jsa_i_device(const machine_config &mconfig, const char
: atari_jsa_base_device(mconfig, ATARI_JSA_I, "Atari JSA I Sound Board", tag, owner, clock, "atjsa1", 2),
m_pokey(*this, "pokey"),
m_tms5220(*this, "tms"),
+ m_jsai(*this, "JSAI"),
m_pokey_volume(1.0),
m_tms5220_volume(1.0)
{
@@ -653,7 +654,7 @@ READ8_MEMBER( atari_jsa_i_device::rdio_r )
// 0x01 = coin 1
//
- UINT8 result = ioport("JSAI")->read();
+ UINT8 result = m_jsai->read();
if (!m_test_read_cb())
result ^= 0x80;
if (m_tms5220 != NULL && m_tms5220->readyq_r() == 0)
@@ -841,6 +842,7 @@ void atari_jsa_i_device::update_all_volumes()
atari_jsa_ii_device::atari_jsa_ii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: atari_jsa_oki_base_device(mconfig, ATARI_JSA_II, "Atari JSA II Sound Board", tag, owner, clock, "atjsa2", 1)
+ , m_jsaii(*this, "JSAII")
{
}
@@ -863,7 +865,7 @@ READ8_MEMBER( atari_jsa_ii_device::rdio_r )
// 0x01 = coin 1
//
- UINT8 result = ioport("JSAII")->read();
+ UINT8 result = m_jsaii->read();
if (!m_test_read_cb())
result ^= 0x80;
@@ -904,11 +906,13 @@ ioport_constructor atari_jsa_ii_device::device_input_ports() const
atari_jsa_iii_device::atari_jsa_iii_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: atari_jsa_oki_base_device(mconfig, ATARI_JSA_III, "Atari JSA III Sound Board", tag, owner, clock, "atjsa3", 1)
+ , m_jsaiii(*this, "JSAIII")
{
}
atari_jsa_iii_device::atari_jsa_iii_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, int channels)
: atari_jsa_oki_base_device(mconfig, devtype, name, tag, owner, clock, shortname, channels)
+ , m_jsaiii(*this, "JSAIII")
{
}
@@ -931,7 +935,7 @@ READ8_MEMBER( atari_jsa_iii_device::rdio_r )
// 0x01 = coin R (active high)
//
- UINT8 result = ioport("JSAIII")->read();
+ UINT8 result = m_jsaiii->read();
if (!m_test_read_cb())
result ^= 0x90;
return result;
diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h
index e1866d1c75c..3ae12a653dc 100644
--- a/src/mame/audio/atarijsa.h
+++ b/src/mame/audio/atarijsa.h
@@ -200,6 +200,7 @@ protected:
// devices
optional_device<pokey_device> m_pokey;
optional_device<tms5220_device> m_tms5220;
+ required_ioport m_jsai;
// internal state
double m_pokey_volume;
@@ -222,6 +223,8 @@ protected:
// device level overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
+
+ required_ioport m_jsaii;
};
@@ -245,6 +248,8 @@ protected:
// device level overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual ioport_constructor device_input_ports() const;
+
+ required_ioport m_jsaiii;
};
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index 9f3718e5114..7253f46de74 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -337,7 +337,7 @@ void atari_cage_device::update_serial()
m_serial_period_per_word = bit_clock_period * (8 * (((tms32031_io_regs[SPORT_GLOBAL_CTL] >> 18) & 3) + 1));
/* compute the step value to stretch this to the sample_rate */
- freq = ATTOSECONDS_TO_HZ(m_serial_period_per_word.attoseconds) / DAC_BUFFER_CHANNELS;
+ freq = ATTOSECONDS_TO_HZ(m_serial_period_per_word.attoseconds()) / DAC_BUFFER_CHANNELS;
if (freq > 0 && freq < 100000)
{
dmadac_set_frequency(&m_dmadac[0], DAC_BUFFER_CHANNELS, freq);
@@ -409,7 +409,7 @@ WRITE32_MEMBER( atari_cage_device::tms32031_io_w )
case SPORT_DATA_TX:
#if (DAC_BUFFER_CHANNELS == 4)
- if ((int)ATTOSECONDS_TO_HZ(m_serial_period_per_word.attoseconds) == 22050*4 && (tms32031_io_regs[SPORT_RX_CTL] & 0xff) == 0x62)
+ if ((int)ATTOSECONDS_TO_HZ(m_serial_period_per_word.attoseconds()) == 22050*4 && (tms32031_io_regs[SPORT_RX_CTL] & 0xff) == 0x62)
tms32031_io_regs[SPORT_RX_CTL] ^= 0x800;
#endif
break;
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index 591a17647eb..3e41f761ade 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -1955,7 +1955,7 @@ void dcs_audio_device::recompute_sample_rate()
/* now put it down to samples, so we know what the channel frequency has to be */
sample_period = sample_period * (16 * m_channels);
- dmadac_set_frequency(&m_dmadac[0], m_channels, ATTOSECONDS_TO_HZ(sample_period.attoseconds));
+ dmadac_set_frequency(&m_dmadac[0], m_channels, ATTOSECONDS_TO_HZ(sample_period.attoseconds()));
dmadac_enable(&m_dmadac[0], m_channels, 1);
/* fire off a timer which will hit every half-buffer */
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index 1e3ba863bce..d860cf43a2a 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -128,7 +128,7 @@ WRITE_LINE_MEMBER(leland_80186_sound_device::i80186_tmr1_w)
{
if (m_ext_active && (m_ext_start < m_ext_stop))
{
- m_dac_sample[7] = (m_ext_base[m_ext_start] << 8) - 0x8000;
+ m_dac4->write_signed8(m_ext_base[m_ext_start]);
m_ext_start++;
}
}
@@ -137,7 +137,19 @@ WRITE_LINE_MEMBER(leland_80186_sound_device::i80186_tmr1_w)
static MACHINE_CONFIG_FRAGMENT( leland_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac", DAC, 0)
+ MCFG_SOUND_ADD("dac1", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac2", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac3", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac4", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac5", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac6", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac7", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
MCFG_DEVICE_ADD("pit0", PIT8254, 0)
@@ -159,8 +171,22 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( redline_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac", DAC, 0)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
+ MCFG_SOUND_ADD("dac1", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac2", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac3", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac4", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac5", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac6", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac7", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac8", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
MCFG_DEVICE_ADD("pit0", PIT8254, 0)
MCFG_PIT8253_CLK0(7000000)
@@ -186,7 +212,15 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( ataxx_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac", DAC, 0)
+ MCFG_SOUND_ADD("dac1", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac2", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac3", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac4", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac7", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
MCFG_DEVICE_ADD("pit0", PIT8254, 0)
@@ -200,7 +234,15 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( wsf_80186_sound )
MCFG_SPEAKER_STANDARD_MONO("speaker")
- MCFG_SOUND_ADD("dac", DAC, 0)
+ MCFG_SOUND_ADD("dac1", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac2", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac3", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac4", DAC, 0)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.40)
+ MCFG_SOUND_ADD("dac7", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.00)
/* sound hardware */
@@ -255,8 +297,6 @@ void leland_80186_sound_device::device_start()
save_item(NAME(m_ext_start));
save_item(NAME(m_ext_stop));
save_item(NAME(m_ext_active));
- save_item(NAME(m_dac_sample));
- save_item(NAME(m_dac_volume));
// zerofill
m_peripheral = 0;
@@ -269,25 +309,12 @@ void leland_80186_sound_device::device_start()
m_ext_stop = 0;
m_ext_active = 0;
m_ext_base = NULL;
- memset(m_dac_sample, 0, sizeof(m_dac_sample));
- memset(m_dac_volume, 0x80, sizeof(m_dac_volume));
m_audiocpu = downcast<i80186_cpu_device *>(machine().device("audiocpu"));
/* determine which sound hardware is installed */
if (m_type == TYPE_WSF)
m_ext_base = machine().root_device().memregion("dac")->base();
-
- m_dac_timer = timer_alloc();
-}
-
-void leland_80186_sound_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- INT32 out = 0;
- for (int i = 0; i < 8; i++)
- out += m_dac_sample[i] * m_dac_volume[i];
-
- m_dac->write(out >> 10);
}
void leland_80186_sound_device::device_reset()
@@ -298,17 +325,20 @@ void leland_80186_sound_device::device_reset()
m_ext_start = 0;
m_ext_stop = 0;
m_ext_active = 0;
- memset(m_dac_sample, 0, sizeof(m_dac_sample));
- memset(m_dac_volume, 0x80, sizeof(m_dac_volume));
-
- m_dac_timer->adjust(attotime::from_hz(48000), 0, attotime::from_hz(48000));
}
const device_type LELAND_80186 = &device_creator<leland_80186_sound_device>;
leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, LELAND_80186, "80186 DAC (Leland)", tag, owner, clock, "leland_80186_sound", __FILE__),
- m_dac(*this, "dac"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"),
+ m_dac3(*this, "dac3"),
+ m_dac4(*this, "dac4"),
+ m_dac5(*this, "dac5"),
+ m_dac6(*this, "dac6"),
+ m_dac7(*this, "dac7"),
+ m_dac8(*this, "dac8"),
m_pit0(*this, "pit0"),
m_pit1(*this, "pit1"),
m_pit2(*this, "pit2"),
@@ -319,7 +349,14 @@ leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconf
leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
: device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- m_dac(*this, "dac"),
+ m_dac1(*this, "dac1"),
+ m_dac2(*this, "dac2"),
+ m_dac3(*this, "dac3"),
+ m_dac4(*this, "dac4"),
+ m_dac5(*this, "dac5"),
+ m_dac6(*this, "dac6"),
+ m_dac7(*this, "dac7"),
+ m_dac8(*this, "dac8"),
m_pit0(*this, "pit0"),
m_pit1(*this, "pit1"),
m_pit2(*this, "pit2"),
@@ -395,7 +432,7 @@ WRITE8_MEMBER( leland_80186_sound_device::leland_80186_control_w )
if (LOG_COMM)
{
- logerror("%04X:80186 control = %02X", m_audiocpu->device_t::safe_pcbase(), data);
+ logerror("%04X:80186 control = %02X", m_audiocpu->device_t::safe_pc(), data);
if (!(data & 0x80)) logerror(" /RESET");
if (!(data & 0x40)) logerror(" ZNMI");
if (!(data & 0x20)) logerror(" INT0");
@@ -447,7 +484,7 @@ WRITE8_MEMBER( leland_80186_sound_device::leland_80186_command_lo_w )
WRITE8_MEMBER( leland_80186_sound_device::leland_80186_command_hi_w )
{
- if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", m_audiocpu->device_t::safe_pcbase(), data);
+ if (LOG_COMM) logerror("%04X:Write sound command latch hi = %02X\n", m_audiocpu->device_t::safe_pc(), data);
m_sound_command = (m_sound_command & 0x00ff) | (data << 8);
}
@@ -494,7 +531,8 @@ void leland_80186_sound_device::delayed_response_r(void *ptr, int param)
READ8_MEMBER( leland_80186_sound_device::leland_80186_response_r )
{
- offs_t pc = m_audiocpu->device_t::safe_pcbase();
+ cpu_device *master = machine().device<cpu_device>("master");
+ offs_t pc = master->device_t::safe_pcbase();
if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, m_sound_response);
@@ -525,13 +563,65 @@ WRITE16_MEMBER( leland_80186_sound_device::dac_w )
/* handle value changes */
if (ACCESSING_BITS_0_7)
{
- m_dac_sample[which] = (data << 8 & 0xff00) - 0x8000;
+ switch(which)
+ {
+ case 0:
+ m_dac1->write_signed8(data & 0xff);
+ break;
+ case 1:
+ m_dac2->write_signed8(data & 0xff);
+ break;
+ case 2:
+ m_dac3->write_signed8(data & 0xff);
+ break;
+ case 3:
+ m_dac4->write_signed8(data & 0xff);
+ break;
+ case 4:
+ m_dac5->write_signed8(data & 0xff);
+ break;
+ case 5:
+ m_dac6->write_signed8(data & 0xff);
+ break;
+ case 6:
+ m_dac7->write_signed8(data & 0xff);
+ break;
+ case 7:
+ m_dac8->write_signed8(data & 0xff);
+ break;
+ }
m_clock_active &= ~(1<<which);
}
/* handle volume changes */
if (ACCESSING_BITS_8_15)
- m_dac_volume[which] = data >> 8;
+ switch(which)
+ {
+ case 0:
+ m_dac1->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 1:
+ m_dac2->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 2:
+ m_dac3->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 3:
+ m_dac4->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 4:
+ m_dac5->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 5:
+ m_dac6->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 6:
+ m_dac7->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ case 7:
+ m_dac8->set_output_gain(ALL_OUTPUTS, (data >> 8)/255.0f);
+ break;
+ }
}
@@ -556,9 +646,9 @@ WRITE16_MEMBER( leland_80186_sound_device::ataxx_dac_control )
case 0x03:
if(ACCESSING_BITS_0_7)
{
- m_dac_volume[0] = ((data & 7) * 0x49) >> 1;
- m_dac_volume[1] = (((data >> 3) & 7) * 0x49) >> 1;
- m_dac_volume[2] = ((data >> 6) & 3) * 0x55;
+ m_dac1->set_output_gain(ALL_OUTPUTS, (((data & 7) * 0x49) >> 1) / 255.0f);
+ m_dac2->set_output_gain(ALL_OUTPUTS, ((((data >> 3) & 7) * 0x49) >> 1) / 255.0f);
+ m_dac3->set_output_gain(ALL_OUTPUTS, (((data >> 6) & 3) * 0x55) / 255.0f);
}
return;
@@ -704,7 +794,7 @@ WRITE16_MEMBER( leland_80186_sound_device::peripheral_w )
}
else if (mem_mask == 0xffff)
{
- m_dac_sample[6] = (data << 6) - 0x8000;
+ m_dac7->write_signed16(data << 6);
m_clock_active &= ~(1<<6);
}
break;
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index e0ba3722bc9..b2bd2cb09ec 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -343,7 +343,7 @@ WRITE8_MEMBER(micro3d_state::micro3d_sound_io_w)
{
case 0x01:
{
- micro3d_sound_device *noise = machine().device<micro3d_sound_device>(data & 4 ? "noise_2" : "noise_1");
+ micro3d_sound_device *noise = (data & 4) ? m_noise_2 : m_noise_1;
noise->noise_sh_w(data);
break;
}
@@ -360,7 +360,7 @@ READ8_MEMBER(micro3d_state::micro3d_sound_io_r)
{
switch (offset)
{
- case 0x01: return (m_sound_port_latch[offset] & 0x7f) | ioport("SOUND_SW")->read();
+ case 0x01: return (m_sound_port_latch[offset] & 0x7f) | m_sound_sw->read();
case 0x03: return (m_sound_port_latch[offset] & 0xf7) | (m_upd7759->busy_r() ? 0x08 : 0);
default: return 0;
}
diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c
index 3ebfe9b2708..ab66fe7246b 100644
--- a/src/mame/audio/targ.c
+++ b/src/mame/audio/targ.c
@@ -36,7 +36,13 @@ static const INT16 sine_wave[32] =
void exidy_state::adjust_sample(UINT8 freq)
{
m_tone_freq = freq;
-
+
+ if (!m_samples->playing(3))
+ {
+ m_samples->set_volume(3, 0);
+ m_samples->start_raw(3, sine_wave, 32, 1000, true);
+ }
+
if ((m_tone_freq == 0xff) || (m_tone_freq == 0x00))
m_samples->set_volume(3, 0);
else
@@ -136,8 +142,13 @@ void exidy_state::common_audio_start(int freq)
m_tone_freq = 0;
m_tone_active = 0;
- m_samples->set_volume(3, 0);
- m_samples->start_raw(3, sine_wave, 32, 1000, true);
+ /* start_raw can't be called here: chan.source will be set by
+ samples_device::device_start and then nulled out by samples_device::device_reset
+ at the soft_reset stage of init_machine() and will never be set again.
+ Thus, I've moved it to exidy_state::adjust_sample() were it will be set after
+ machine initialization. */
+ //m_samples->set_volume(3, 0);
+ //m_samples->start_raw(3, sine_wave, 32, 1000, true);
save_item(NAME(m_port_1_last));
save_item(NAME(m_port_2_last));
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index 386909cc5d0..81695376892 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -328,6 +328,7 @@ static MACHINE_CONFIG_START( 88games, _88games_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(_88games_state, sprite_callback)
MCFG_DEVICE_ADD("k051316", K051316, 0)
diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c
index 9a758583b3c..29d55d4fb3c 100644
--- a/src/mame/drivers/aerofgt.c
+++ b/src/mame/drivers/aerofgt.c
@@ -2739,7 +2739,7 @@ GAME( 1997, wbbc97, 0, wbbc97, wbbc97, driver_device, 0, ROT0, "C
GAME( 1991, karatblz, 0, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Karate Blazers (World)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1991, karatblzu,karatblz, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Karate Blazers (US)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
-GAME( 1991, karatblzj,karatblz, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Karate Blazers (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
+GAME( 1991, karatblzj,karatblz, karatblz, karatblz, driver_device, 0, ROT0, "Video System Co.", "Toushin Blazers (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1991, karatblzbl,karatblz,karatblzbl,karatblz,driver_device, 0, ROT0, "bootleg", "Karate Blazers (bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_NO_SOUND )
GAME( 1991, turbofrc, 0, turbofrc, turbofrc, driver_device, 0, ROT270, "Video System Co.", "Turbo Force (old revision)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
diff --git a/src/mame/drivers/ajax.c b/src/mame/drivers/ajax.c
index 00f89e2a64d..f9a8bcb9e6c 100644
--- a/src/mame/drivers/ajax.c
+++ b/src/mame/drivers/ajax.c
@@ -167,9 +167,8 @@ WRITE8_MEMBER(ajax_state::volume_callback1)
static MACHINE_CONFIG_START( ajax, ajax_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", KONAMI, 3000000) /* 12/4 MHz*/
+ MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 052001 12/4 MHz*/
MCFG_CPU_PROGRAM_MAP(ajax_main_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", ajax_state, ajax_interrupt) /* IRQs triggered by the 051960 */
MCFG_CPU_ADD("sub", M6809, 3000000) /* ? */
MCFG_CPU_PROGRAM_MAP(ajax_sub_map)
@@ -181,10 +180,9 @@ static MACHINE_CONFIG_START( ajax, ajax_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
+// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
+// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_UPDATE_DRIVER(ajax_state, screen_update_ajax)
MCFG_SCREEN_PALETTE("palette")
@@ -198,7 +196,9 @@ static MACHINE_CONFIG_START( ajax, ajax_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(ajax_state, sprite_callback)
+ MCFG_K051960_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
MCFG_DEVICE_ADD("k051316", K051316, 0)
MCFG_GFX_PALETTE("palette")
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index b53e1f9b1e7..bedde2b9362 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -36,7 +36,13 @@ class alg_state : public amiga_state
public:
alg_state(const machine_config &mconfig, device_type type, const char *tag)
: amiga_state(mconfig, type, tag),
- m_laserdisc(*this, "laserdisc") { }
+ m_laserdisc(*this, "laserdisc"),
+ m_gun1x(*this, "GUN1X"),
+ m_gun1y(*this, "GUN1Y"),
+ m_gun2x(*this, "GUN2X"),
+ m_gun2y(*this, "GUN2Y"),
+ m_triggers(*this, "TRIGGERS")
+ { }
DECLARE_CUSTOM_INPUT_MEMBER(lightgun_pos_r);
DECLARE_CUSTOM_INPUT_MEMBER(lightgun_trigger_r);
@@ -55,9 +61,15 @@ public:
protected:
// amiga_state overrides
virtual void potgo_w(UINT16 data);
+ int get_lightgun_pos(int player, int *x, int *y);
private:
required_device<sony_ldp1450_device> m_laserdisc;
+ required_ioport m_gun1x;
+ required_ioport m_gun1y;
+ optional_ioport m_gun2x;
+ optional_ioport m_gun2y;
+ optional_ioport m_triggers;
UINT16 m_input_select;
};
@@ -72,12 +84,12 @@ private:
*
*************************************/
-static int get_lightgun_pos(screen_device &screen, int player, int *x, int *y)
+int alg_state::get_lightgun_pos(int player, int *x, int *y)
{
- const rectangle &visarea = screen.visible_area();
+ const rectangle &visarea = m_screen->visible_area();
- int xpos = screen.ioport((player == 0) ? "GUN1X" : "GUN2X")->read_safe(0xffffffff);
- int ypos = screen.ioport((player == 0) ? "GUN1Y" : "GUN2Y")->read_safe(0xffffffff);
+ int xpos = (player == 0) ? m_gun1x->read() : (m_gun2x ? m_gun2x->read() : 0xffffffff);
+ int ypos = (player == 0) ? m_gun1y->read() : (m_gun2y ? m_gun2y->read() : 0xffffffff);
if (xpos == -1 || ypos == -1)
return FALSE;
@@ -128,7 +140,7 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_pos_r)
int x = 0, y = 0;
/* get the position based on the input select */
- get_lightgun_pos(*m_screen, m_input_select, &x, &y);
+ get_lightgun_pos(m_input_select, &x, &y);
return (y << 8) | (x >> 2);
}
@@ -136,14 +148,14 @@ CUSTOM_INPUT_MEMBER(alg_state::lightgun_pos_r)
CUSTOM_INPUT_MEMBER(alg_state::lightgun_trigger_r)
{
/* read the trigger control based on the input select */
- return (ioport("TRIGGERS")->read() >> m_input_select) & 1;
+ return (m_triggers->read() >> m_input_select) & 1;
}
CUSTOM_INPUT_MEMBER(alg_state::lightgun_holster_r)
{
/* read the holster control based on the input select */
- return (ioport("TRIGGERS")->read() >> (2 + m_input_select)) & 1;
+ return (m_triggers->read() >> (2 + m_input_select)) & 1;
}
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 83731fc67d0..79c0776aea3 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -16,11 +16,6 @@ Preliminary driver by:
#include "includes/konamipt.h"
#include "includes/aliens.h"
-INTERRUPT_GEN_MEMBER(aliens_state::aliens_interrupt)
-{
- if (m_k051960->k051960_is_irq_enabled())
- device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
-}
WRITE8_MEMBER(aliens_state::aliens_coin_counter_w)
{
@@ -90,7 +85,7 @@ WRITE8_MEMBER(aliens_state::k052109_051960_w)
static ADDRESS_MAP_START( aliens_map, AS_PROGRAM, 8, aliens_state )
AM_RANGE(0x0000, 0x03ff) AM_DEVICE("bank0000", address_map_bank_device, amap8)
AM_RANGE(0x0400, 0x1fff) AM_RAM
- AM_RANGE(0x2000, 0x3fff) AM_ROMBANK("bank1") /* banked ROM */
+ AM_RANGE(0x2000, 0x3fff) AM_ROMBANK("rombank") /* banked ROM */
AM_RANGE(0x5f80, 0x5f80) AM_READ_PORT("DSW3")
AM_RANGE(0x5f81, 0x5f81) AM_READ_PORT("P1")
AM_RANGE(0x5f82, 0x5f82) AM_READ_PORT("P2")
@@ -179,8 +174,8 @@ WRITE8_MEMBER(aliens_state::volume_callback)
void aliens_state::machine_start()
{
- membank("bank1")->configure_entries(0, 24, memregion("maincpu")->base(), 0x2000);
- membank("bank1")->set_entry(0);
+ m_rombank->configure_entries(0, 24, memregion("maincpu")->base(), 0x2000);
+ m_rombank->set_entry(0);
}
void aliens_state::machine_reset()
@@ -190,15 +185,14 @@ void aliens_state::machine_reset()
WRITE8_MEMBER( aliens_state::banking_callback )
{
- membank("bank1")->set_entry(data & 0x1f);
+ m_rombank->set_entry(data & 0x1f);
}
static MACHINE_CONFIG_START( aliens, aliens_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */
+ MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 052001 (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(aliens_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", aliens_state, aliens_interrupt)
MCFG_KONAMICPU_LINE_CB(WRITE8(aliens_state, banking_callback))
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
@@ -213,10 +207,9 @@ static MACHINE_CONFIG_START( aliens, aliens_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240) // measured 59.17
+// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
+// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_UPDATE_DRIVER(aliens_state, screen_update_aliens)
MCFG_SCREEN_PALETTE("palette")
@@ -230,7 +223,9 @@ static MACHINE_CONFIG_START( aliens, aliens_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(aliens_state, sprite_callback)
+ MCFG_K051960_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
diff --git a/src/mame/drivers/astrcorp.c b/src/mame/drivers/astrcorp.c
index 76cf1ad76b2..caa7bbfe118 100644
--- a/src/mame/drivers/astrcorp.c
+++ b/src/mame/drivers/astrcorp.c
@@ -21,6 +21,7 @@ Year + Game PCB ID CPU Video Chips
02 Skill Drop GA None JX-1689F1028N ASTRO V02 pLSI1016-60LJ
02? Keno 21 ? ASTRO V102? ASTRO V05 ASTRO F02? not dumped
03 Speed Drop None JX-1689HP ASTRO V05 pLSI1016-60LJ
+03? Dino Dino T-3802A ASTRO V102PX-010? ASTRO V05 ASTRO F02 2003-03-12 Encrypted
04? Stone Age L1 ASTRO V102PX-012? ASTRO V05x2 ASTRO F02 2004-09-04 Encrypted
05? Zoo M1.1 ASTRO V102PX-005? ASTRO V06 ASTRO F02 2005-02-18 Encrypted
05? Win Win Bingo M1.2 ASTRO V102PX-006? ASTRO V06 ASTRO F02 2005-09-17 Encrypted
@@ -47,17 +48,25 @@ class astrocorp_state : public driver_device
public:
astrocorp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_spriteram(*this, "spriteram"),
m_maincpu(*this, "maincpu"),
m_oki(*this, "oki"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_spriteram(*this, "spriteram")
+ { }
- /* memory pointers */
+ // devices
+ required_device<cpu_device> m_maincpu;
+ required_device<okim6295_device> m_oki;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<screen_device> m_screen;
+ required_device<palette_device> m_palette;
+
+ // memory pointers
required_shared_ptr<UINT16> m_spriteram;
- /* video-related */
+ // video-related
bitmap_ind16 m_bitmap;
UINT16 m_screen_enable;
UINT16 m_draw_sprites;
@@ -76,11 +85,6 @@ public:
UINT32 screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(skilldrp_scanline);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
- required_device<okim6295_device> m_oki;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<screen_device> m_screen;
- required_device<palette_device> m_palette;
};
/***************************************************************************
@@ -92,8 +96,8 @@ VIDEO_START_MEMBER(astrocorp_state,astrocorp)
m_screen->register_screen_bitmap(m_bitmap);
save_item(NAME(m_bitmap));
- save_item (NAME(m_screen_enable));
- save_item (NAME(m_draw_sprites));
+ save_item(NAME(m_screen_enable));
+ save_item(NAME(m_draw_sprites));
}
/***************************************************************************
@@ -1121,6 +1125,53 @@ ROM_START( astoneag )
ROM_LOAD( "93c46.ic99", 0x0000, 0x0080, CRC(2fd85a9b) SHA1(3240e40debf5af15f08072b76d6910808d3d282f) )
ROM_END
+/***************************************************************************
+
+Dino Dino
+Astro Corp.
+
+PCB Layout
+----------
+
+ASTRO T-3802A PCB with ASTRO F02 2003-03-12
+|--------------------------------------------|
+| |------| TDA2003 |
+|ULN2003 |ASTRO | V62C51864 VOL |
+| |F02 | ROM4 |
+| |------| ROM2 |
+|ULN2003 ROM3 M6295 |
+| |-------| |
+|8 |ASTRO | |
+|L |V102PX | ROM5|
+|I |-010 | |
+|N |-------| |------| |
+|E |ASTRO | |
+|R ROM1 |V05 | |
+| |------| |
+| V62C51864 |
+| 24MHz|
+| 93C46 6116 6116 HM628128 |
+| SW1 6116 6116 HM628128 |
+|--------------------------------------------|
+
+***************************************************************************/
+
+ROM_START( dinodino )
+ ROM_REGION( 0x40000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "dd_rom1.u20", 0x00000, 0x20000, CRC(056613dd) SHA1(e8481177b1dacda222fe4fae2b50841ddb0c87ba) )
+ ROM_LOAD16_BYTE( "dd_rom2.u19", 0x00001, 0x20000, CRC(575519c5) SHA1(249fe33b6ea0bc154125a988315f571a30b9375c) )
+
+ ROM_REGION( 0x400000, "sprites", 0 )
+ ROM_LOAD( "dd_rom3.u26", 0x000000, 0x200000, CRC(47c95b43) SHA1(43e9a13c38f2f7d13dd4dcb105c65e43b18ccdbf) )
+ ROM_LOAD( "dd_rom4.u24", 0x200000, 0x200000, CRC(2cf4be21) SHA1(831d7d125c4161b42b017a69fc05e30a51172620) )
+
+ ROM_REGION( 0x80000, "oki", 0 )
+ ROM_LOAD( "dd_rom5.u33", 0x00000, 0x80000, CRC(482e456a) SHA1(c7111522383c4e1fd98b0f759153be98dcbe06c1) )
+
+ ROM_REGION16_BE( 0x80, "eeprom", 0 )
+ ROM_LOAD( "93c46.u10", 0x0000, 0x0080, CRC(6769bfb8) SHA1(bf6b905805c2c61a89fbc4c046b23069431e4709) )
+ROM_END
+
DRIVER_INIT_MEMBER(astrocorp_state,showhand)
{
@@ -1308,6 +1359,7 @@ GAME( 2002, skilldrp, 0, skilldrp, skilldrp, driver_device, 0,
GAME( 2003, speeddrp, 0, speeddrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Speed Drop (Ver. 1.06)", MACHINE_SUPPORTS_SAVE )
// Encrypted games (not working):
+GAME( 2003?, dinodino, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Dino Dino", MACHINE_NOT_WORKING )
GAME( 2004?, astoneag, 0, skilldrp, skilldrp, astrocorp_state, astoneag, ROT0, "Astro Corp.", "Stone Age (Astro, Ver. ENG.03.A)", MACHINE_NOT_WORKING )
GAME( 2005?, winbingo, 0, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 1)", MACHINE_NOT_WORKING )
GAME( 2005?, winbingoa, winbingo, skilldrp, skilldrp, driver_device, 0, ROT0, "Astro Corp.", "Win Win Bingo (set 2)", MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index 3b5544c8785..0012d083afd 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -231,10 +231,11 @@ WRITE8_MEMBER(astrocde_state::seawolf2_sound_2_w)// Port 41
*
*************************************/
+IOPORT_ARRAY_MEMBER(astrocde_state::trackball_inputs) { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
+
CUSTOM_INPUT_MEMBER(astrocde_state::ebases_trackball_r)
{
- static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
- return ioport(names[m_input_select])->read();
+ return m_trackball[m_input_select]->read();
}
@@ -261,7 +262,7 @@ READ8_MEMBER(astrocde_state::spacezap_io_r)
{
coin_counter_w(machine(), 0, (offset >> 8) & 1);
coin_counter_w(machine(), 1, (offset >> 9) & 1);
- return ioport("P3HANDLE")->read_safe(0xff);
+ return m_p3handle ? m_p3handle->read() : 0xff;
}
@@ -394,51 +395,32 @@ READ8_MEMBER(astrocde_state::profpac_io_2_r)
}
-WRITE8_MEMBER(astrocde_state::profpac_banksw_w)
+WRITE8_MEMBER(astrocde_state::demndrgn_banksw_w)
{
int bank = (data >> 5) & 3;
+ m_bank4000->set_bank(bank);
+ m_bank8000->set_entry(bank);
+}
- /* this is accessed from I/O space but modifies program space, so we normalize here */
- address_space &prog_space = space.device().memory().space(AS_PROGRAM);
-
- /* remember the banking bits for save state support */
- m_profpac_bank = data;
-
- /* set the main banking */
- prog_space.install_read_bank(0x4000, 0xbfff, "bank1");
- membank("bank1")->set_base(memregion("user1")->base() + 0x8000 * bank);
- /* bank 0 reads video RAM in the 4000-7FFF range */
- if (bank == 0)
- prog_space.install_read_handler(0x4000, 0x7fff, read8_delegate(FUNC(astrocde_state::profpac_videoram_r), this));
+WRITE8_MEMBER(astrocde_state::profpac_banksw_w)
+{
+ demndrgn_banksw_w(space, 0, data);
- /* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
- if ((data & 0x80) && memregion("user2")->base() != NULL)
+ if (data & 0x80)
{
/* Note: There is a jumper which could change the base offset to 0xa8 instead */
- bank = data - 0x80;
+ int bank = data - 0x80;
/* if the bank is in range, map the appropriate bank */
if (bank < 0x28)
- {
- prog_space.install_read_bank(0x4000, 0x7fff, "bank2");
- membank("bank2")->set_base(memregion("user2")->base() + 0x4000 * bank);
- }
+ m_bank4000->set_bank(4 + bank);
else
- prog_space.unmap_read(0x4000, 0x7fff);
+ m_bank4000->set_bank(4 + 0x28);
}
}
-void astrocde_state::profbank_banksw_restore()
-{
- address_space &space = m_maincpu->space(AS_IO);
-
- profpac_banksw_w(space, 0, m_profpac_bank);
-}
-
-
-
/*************************************
*
* Demons & Dragons specific input/output
@@ -456,10 +438,12 @@ READ8_MEMBER(astrocde_state::demndrgn_io_r)
}
+IOPORT_ARRAY_MEMBER(astrocde_state::joystick_inputs) { "MOVEX", "MOVEY" };
+
+
CUSTOM_INPUT_MEMBER(astrocde_state::demndragn_joystick_r)
{
- static const char *const names[] = { "MOVEX", "MOVEY" };
- return ioport(names[m_input_select])->read();
+ return m_joystick[m_input_select]->read();
}
@@ -581,26 +565,35 @@ static ADDRESS_MAP_START( robby_map, AS_PROGRAM, 8, astrocde_state )
ADDRESS_MAP_END
-static ADDRESS_MAP_START( profpac_map, AS_PROGRAM, 8, astrocde_state )
+static ADDRESS_MAP_START( demndrgn_map, AS_PROGRAM, 8, astrocde_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_READWRITE(profpac_videoram_r, profpac_videoram_w)
- AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank1")
+ AM_RANGE(0x4000, 0x7fff) AM_DEVREAD("bank4000", address_map_bank_device, read8) AM_WRITE(profpac_videoram_w)
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank8000")
AM_RANGE(0xc000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(protected_ram_r, protected_ram_w) AM_SHARE("protected_ram")
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram")
AM_RANGE(0xe800, 0xffff) AM_RAM
ADDRESS_MAP_END
-static ADDRESS_MAP_START( demndrgn_map, AS_PROGRAM, 8, astrocde_state )
- AM_RANGE(0x0000, 0x3fff) AM_ROM
- AM_RANGE(0x0000, 0x3fff) AM_WRITE(astrocade_funcgen_w)
- AM_RANGE(0x4000, 0x7fff) AM_READWRITE(profpac_videoram_r, profpac_videoram_w)
- AM_RANGE(0x4000, 0xbfff) AM_ROMBANK("bank1")
- AM_RANGE(0xc000, 0xdfff) AM_ROM
- AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("nvram")
- AM_RANGE(0xe800, 0xffff) AM_RAM
+static ADDRESS_MAP_START( profpac_map, AS_PROGRAM, 8, astrocde_state )
+ AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(protected_ram_r, protected_ram_w) AM_SHARE("protected_ram")
+ AM_IMPORT_FROM(demndrgn_map)
+ADDRESS_MAP_END
+
+
+static ADDRESS_MAP_START( bank4000_map, AS_PROGRAM, 8, astrocde_state )
+ AM_RANGE(0x0000, 0x3fff) AM_READ(profpac_videoram_r)
+ AM_RANGE(0x4000, 0x7fff) AM_ROM AM_REGION("banks", 0x08000)
+ AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("banks", 0x10000)
+ AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION("banks", 0x18000)
+ADDRESS_MAP_END
+
+
+static ADDRESS_MAP_START( profpac_bank4000_map, AS_PROGRAM, 8, astrocde_state )
+ AM_RANGE(0x10000, 0xaffff) AM_ROM AM_REGION("epromboard", 0)
+ AM_RANGE(0xb0000, 0xb3fff) AM_READNOP
+ AM_IMPORT_FROM(bank4000_map)
ADDRESS_MAP_END
@@ -656,7 +649,7 @@ static ADDRESS_MAP_START( port_map_16col_pattern_nosound, AS_IO, 8, astrocde_sta
AM_RANGE(0x00bf, 0x00bf) AM_MIRROR(0xff00) AM_WRITE(profpac_page_select_w)
AM_RANGE(0x00c3, 0x00c3) AM_MIRROR(0xff00) AM_READ(profpac_intercept_r)
AM_RANGE(0x00c0, 0x00c5) AM_MIRROR(0xff00) AM_WRITE(profpac_screenram_ctrl_w)
- AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE(profpac_banksw_w)
+ AM_RANGE(0x00f3, 0x00f3) AM_MIRROR(0xff00) AM_WRITE(demndrgn_banksw_w)
AM_RANGE(0xa55b, 0xa55b) AM_WRITE(protected_ram_enable_w)
ADDRESS_MAP_END
@@ -1250,6 +1243,13 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( astrocade_16color_base, astrocade_base )
/* basic machine hardware */
+ MCFG_DEVICE_ADD("bank4000", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(bank4000_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(16)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
+
MCFG_NVRAM_ADD_0FILL("nvram")
/* video hardware */
@@ -1417,6 +1417,10 @@ static MACHINE_CONFIG_DERIVED( profpac, astrocade_16color_base )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(profpac_map)
MCFG_CPU_IO_MAP(port_map_16col_pattern)
+
+ MCFG_DEVICE_MODIFY("bank4000")
+ MCFG_DEVICE_PROGRAM_MAP(profpac_bank4000_map)
+ MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(20)
MACHINE_CONFIG_END
@@ -1573,7 +1577,7 @@ ROM_START( profpac )
ROM_LOAD( "pps2", 0x2000, 0x2000, CRC(8a9a6653) SHA1(b730b24088dcfddbe954670ff9212b7383c923f6) )
ROM_LOAD( "pps9", 0xc000, 0x2000, CRC(17a0b418) SHA1(8b7ed84090dbc5181deef6f55ec755c05d4c0d5e) )
- ROM_REGION( 0x20000, "user1", ROMREGION_ERASEFF )
+ ROM_REGION( 0x20000, "banks", ROMREGION_ERASEFF )
ROM_LOAD( "pps3", 0x04000, 0x2000, CRC(15717fd8) SHA1(ffbb156f417d20478117b39de28a15680993b528) )
ROM_LOAD( "pps4", 0x06000, 0x2000, CRC(36540598) SHA1(33c797c690801afded45091d822347e1ecc72b54) )
ROM_LOAD( "pps5", 0x08000, 0x2000, CRC(8dc89a59) SHA1(fb4d3ba40697425d69ee19bfdcf00aea1df5fa80) )
@@ -1581,7 +1585,7 @@ ROM_START( profpac )
ROM_LOAD( "pps7", 0x0c000, 0x2000, CRC(f9c26aba) SHA1(201b930cca9669114ffc97978cade69587e34a0f) )
ROM_LOAD( "pps8", 0x0e000, 0x2000, CRC(4d201e41) SHA1(786b30cd7a7db55bdde05909d7a1a7f122b6e546) )
- ROM_REGION( 0xa0000, "user2", ROMREGION_ERASEFF )
+ ROM_REGION( 0xa0000, "epromboard", ROMREGION_ERASEFF )
ROM_LOAD( "ppq1", 0x00000, 0x4000, CRC(dddc2ccc) SHA1(d81caaa639f63d971a0d3199b9da6359211edf3d) )
ROM_LOAD( "ppq2", 0x04000, 0x4000, CRC(33bbcabe) SHA1(f9455868c70f479ede0e0621f21f69da165d9b7a) )
ROM_LOAD( "ppq3", 0x08000, 0x4000, CRC(3534d895) SHA1(24fb14c6b31b7f27e0737605cfbf963d29dd3fc5) )
@@ -1617,7 +1621,7 @@ ROM_START( demndrgn )
ROM_LOAD( "dd-x2.bin", 0x2000, 0x2000, CRC(0c63b624) SHA1(3eaeb4e0820e9dda7233a13bb146acc44402addd) )
ROM_LOAD( "dd-x9.bin", 0xc000, 0x2000, CRC(3792d632) SHA1(da053df344f39a8f25a2c57fb1a908131c10f248) )
- ROM_REGION( 0x20000, "user1", ROMREGION_ERASEFF )
+ ROM_REGION( 0x20000, "banks", ROMREGION_ERASEFF )
ROM_LOAD( "dd-x5.bin", 0x08000, 0x2000, CRC(e377e831) SHA1(f53e74b3138611f9385845d6bdeab891b5d15931) )
ROM_LOAD( "dd-x6.bin", 0x0a000, 0x2000, CRC(0fcb46ad) SHA1(5611135f9e341bd394d6da7912167b05fff17a93) )
ROM_LOAD( "dd-x7.bin", 0x0c000, 0x2000, CRC(0675e4fa) SHA1(59668e32271ff9bac0b4411cc0c541d2825ee145) )
@@ -1640,7 +1644,7 @@ ROM_START( tenpindx )
ROM_REGION( 0x4000, "sub", 0 )
ROM_LOAD( "tpd_axfd.bin", 0x0000, 0x4000, CRC(0aed11f3) SHA1(09575cceda38178a77c6753074be82825d368334) )
- ROM_REGION( 0x20000, "user1", ROMREGION_ERASEFF )
+ ROM_REGION( 0x20000, "banks", ROMREGION_ERASEFF )
ROM_LOAD( "tpd_x3.bin", 0x04000, 0x2000, CRC(d4645f6d) SHA1(185bcd58f1ba69e26274475c57219de0353267e1) )
ROM_LOAD( "tpd_x4.bin", 0x06000, 0x2000, CRC(acf474ba) SHA1(b324dccac0991660f8ba2a70cbbdb06c9d25c361) )
ROM_LOAD( "tpd_x5.bin", 0x08000, 0x2000, CRC(e206913f) SHA1(bb9476516bca7bf7066df058db36e4fdd52a6ed2) )
@@ -1731,9 +1735,9 @@ DRIVER_INIT_MEMBER(astrocde_state,profpac)
iospace.install_read_handler(0x14, 0x14, 0x0fff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_1_r), this));
iospace.install_read_handler(0x15, 0x15, 0x77ff, 0xff00, read8_delegate(FUNC(astrocde_state::profpac_io_2_r), this));
- /* reset banking */
- profpac_banksw_w(iospace, 0, 0);
- machine().save().register_postload(save_prepost_delegate(FUNC(astrocde_state::profbank_banksw_restore), this));
+ /* configure banking */
+ m_bank8000->configure_entries(0, 4, memregion("banks")->base() + 0x4000, 0x8000);
+ m_bank8000->set_entry(0);
}
@@ -1747,9 +1751,9 @@ DRIVER_INIT_MEMBER(astrocde_state,demndrgn)
iospace.install_read_port(0x1d, 0x1d, 0x0000, 0xff00, "FIREY");
iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::demndrgn_sound_w), this));
- /* reset banking */
- profpac_banksw_w(iospace, 0, 0);
- machine().save().register_postload(save_prepost_delegate(FUNC(astrocde_state::profbank_banksw_restore), this));
+ /* configure banking */
+ m_bank8000->configure_entries(0, 4, memregion("banks")->base() + 0x4000, 0x8000);
+ m_bank8000->set_entry(0);
}
@@ -1768,9 +1772,9 @@ DRIVER_INIT_MEMBER(astrocde_state,tenpindx)
iospace.install_write_handler(0x68, 0x68, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_lights_w), this));
iospace.install_write_handler(0x97, 0x97, 0x0000, 0xff00, write8_delegate(FUNC(astrocde_state::tenpindx_sound_w), this));
- /* reset banking */
- profpac_banksw_w(iospace, 0, 0);
- machine().save().register_postload(save_prepost_delegate(FUNC(astrocde_state::profbank_banksw_restore), this));
+ /* configure banking */
+ m_bank8000->configure_entries(0, 4, memregion("banks")->base() + 0x4000, 0x8000);
+ m_bank8000->set_entry(0);
}
diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c
index 48a22234455..d3596e2d1b5 100644
--- a/src/mame/drivers/battlnts.c
+++ b/src/mame/drivers/battlnts.c
@@ -217,13 +217,10 @@ void battlnts_state::machine_start()
m_rombank->configure_entries(0, 4, &ROM[0x10000], 0x4000);
save_item(NAME(m_spritebank));
- save_item(NAME(m_layer_colorbase));
}
void battlnts_state::machine_reset()
{
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 0;
m_spritebank = 0;
}
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index 263f39aed2b..14f8fc0a641 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -282,7 +282,6 @@ void bladestl_state::machine_start()
m_rombank->configure_entries(0, 4, memregion("maincpu")->base(), 0x2000);
save_item(NAME(m_spritebank));
- save_item(NAME(m_layer_colorbase));
save_item(NAME(m_last_track));
}
@@ -290,8 +289,6 @@ void bladestl_state::machine_reset()
{
int i;
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 1;
m_spritebank = 0;
for (i = 0; i < 4 ; i++)
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index d78c4fb4950..3c258d3f7d7 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -13,10 +13,7 @@
Todo:
- How is the sound irq cleared (currently using HOLD_LINE)?
- Do bit 2 and 7 of the bankswitch port have any meaning?
- - Use raw screen parameters
- - When entering a highscore, some letters will appear partially behind
- the blocks. Driver problem or original game bug?
- - Verify exact XTAL values
+ - Verify raw screen parameters
*******************************************************************************/
@@ -54,7 +51,6 @@ public:
DECLARE_WRITE8_MEMBER(sound_irq_w);
- INTERRUPT_GEN_MEMBER(blockhl_interrupt);
DECLARE_WRITE8_MEMBER(banking_callback);
protected:
@@ -170,7 +166,7 @@ WRITE8_MEMBER( blockhl_state::k052109_051960_w )
WRITE8_MEMBER( blockhl_state::sound_irq_w )
{
- m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
+ m_audiocpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
}
@@ -178,12 +174,6 @@ WRITE8_MEMBER( blockhl_state::sound_irq_w )
// MACHINE EMULATION
//**************************************************************************
-INTERRUPT_GEN_MEMBER( blockhl_state::blockhl_interrupt )
-{
- if (m_k052109->is_irq_enabled())
- device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
-}
-
void blockhl_state::machine_start()
{
// the first 0x8000 are banked, the remaining 0x8000 are directly accessible
@@ -277,9 +267,8 @@ INPUT_PORTS_END
static MACHINE_CONFIG_START( blockhl, blockhl_state )
// basic machine hardware
- MCFG_CPU_ADD("maincpu", KONAMI, 3000000) // Konami custom 052526
+ MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) // Konami 052526
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", blockhl_state, blockhl_interrupt)
MCFG_KONAMICPU_LINE_CB(WRITE8(blockhl_state, banking_callback))
MCFG_DEVICE_ADD("bank5800", ADDRESS_MAP_BANK, 0)
@@ -289,15 +278,14 @@ static MACHINE_CONFIG_START( blockhl, blockhl_state )
MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(12)
MCFG_ADDRESS_MAP_BANK_STRIDE(0x0800)
- MCFG_CPU_ADD("audiocpu", Z80, 3579545)
+ MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(audio_map)
// video hardware
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
+// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
+// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_UPDATE_DRIVER(blockhl_state, screen_update_blockhl)
MCFG_SCREEN_PALETTE("palette")
@@ -307,16 +295,19 @@ static MACHINE_CONFIG_START( blockhl, blockhl_state )
MCFG_DEVICE_ADD("k052109", K052109, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K052109_SCREEN_TAG("screen")
MCFG_K052109_CB(blockhl_state, tile_callback)
+ MCFG_K052109_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(blockhl_state, sprite_callback)
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_YM2151_ADD("ymsnd", 3579545)
+ MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(0, "mono", 0.60)
MCFG_SOUND_ROUTE(1, "mono", 0.60)
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c
index 910eef0e07a..d5e1fa3479c 100644
--- a/src/mame/drivers/bottom9.c
+++ b/src/mame/drivers/bottom9.c
@@ -323,6 +323,7 @@ static MACHINE_CONFIG_START( bottom9, bottom9_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(bottom9_state, sprite_callback)
MCFG_DEVICE_ADD("k051316", K051316, 0)
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index 06213dea834..4c9761dedf7 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -23,16 +23,6 @@
#include "chqflag.lh"
-TIMER_DEVICE_CALLBACK_MEMBER(chqflag_state::chqflag_scanline)
-{
- int scanline = param;
-
- if(scanline == 240 && m_k051960->k051960_is_irq_enabled()) // vblank irq
- m_maincpu->set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
- else if(((scanline % 32) == 0) && (m_k051960->k051960_is_nmi_enabled())) // timer irq
- m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
-}
-
/* these trampolines are less confusing than nested address_map_bank_devices */
READ8_MEMBER(chqflag_state::k051316_1_ramrom_r)
{
@@ -297,9 +287,8 @@ void chqflag_state::machine_reset()
static MACHINE_CONFIG_START( chqflag, chqflag_state )
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu", KONAMI,XTAL_24MHz/8) /* 052001 (verified on pcb) */
+ MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/2/4) /* 052001 (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(chqflag_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", chqflag_state, chqflag_scanline, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(chqflag_sound_map)
@@ -314,12 +303,10 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state )
MCFG_QUANTUM_TIME(attotime::from_hz(600))
/* video hardware */
- //TODO: Vsync 59.17hz Hsync 15.13 / 15.19khz
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(12*8, (64-14)*8-1, 2*8, 30*8-1 )
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 96, 400, 256, 16, 240) // measured Vsync 59.17hz Hsync 15.13 / 15.19khz
+// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
+// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_UPDATE_DRIVER(chqflag_state, screen_update_chqflag)
MCFG_SCREEN_PALETTE("palette")
@@ -329,7 +316,10 @@ static MACHINE_CONFIG_START( chqflag, chqflag_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(chqflag_state, sprite_callback)
+ MCFG_K051960_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
+ MCFG_K051960_NMI_HANDLER(INPUTLINE("maincpu", INPUT_LINE_NMI))
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
MCFG_GFX_PALETTE("palette")
diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c
index bf7f197536d..5729cfefa4d 100644
--- a/src/mame/drivers/cinemat.c
+++ b/src/mame/drivers/cinemat.c
@@ -266,7 +266,7 @@ READ8_MEMBER(cinemat_state::qb3_frame_r)
{
attotime next_update = m_screen->time_until_update();
attotime frame_period = m_screen->frame_period();
- int percent = next_update.attoseconds / (frame_period.attoseconds / 100);
+ int percent = next_update.attoseconds() / (frame_period.attoseconds() / 100);
/* note this is just an approximation... */
return (percent >= 10);
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 39be29b31be..0b9504d74c8 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -3053,7 +3053,7 @@ static INPUT_PORTS_START( sfzch )
PORT_DIPSETTING( 0xff, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_START("IN1") /* Player 1 */
+ PORT_START("IN1") /* Player 1 & 2 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_8WAY
@@ -3062,16 +3062,17 @@ static INPUT_PORTS_START( sfzch )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(1)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(1)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(1)
-
- PORT_START("IN2") /* Player 2 */
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_8WAY
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_8WAY
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_8WAY
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_8WAY
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2)
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_8WAY
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_8WAY
+ PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_8WAY
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_8WAY
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2)
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2)
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2)
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2)
+
+ PORT_START("IN2") /* Read by wofch */
+ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("IN3") /* Player 4 - not used */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -11800,7 +11801,7 @@ GAME( 1991, 3wonders, 0, cps1_10MHz, 3wonders, cps_state, cps1,
GAME( 1991, 3wondersr1, 3wonders, cps1_10MHz, 3wonders, cps_state, cps1, ROT0, "Capcom", "Three Wonders (World 910513)", MACHINE_SUPPORTS_SAVE ) // "ETC"
GAME( 1991, 3wondersu, 3wonders, cps1_10MHz, 3wonders, cps_state, cps1, ROT0, "Capcom", "Three Wonders (USA 910520)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, wonder3, 3wonders, cps1_10MHz, 3wonders, cps_state, cps1, ROT0, "Capcom", "Wonder 3 (Japan 910520)", MACHINE_SUPPORTS_SAVE )
-GAME( 1991, 3wondersb, 3wonders, cps1_10MHz, 3wonders, cps_state, cps1, ROT0, "bootleg", "Three Wonders (bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version
+GAME( 1991, 3wondersb, 3wonders, cps1_10MHz, 3wonders, cps_state, cps1, ROT0, "bootleg", "Three Wonders (bootleg)", MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version
GAME( 1991, 3wondersh, 3wonders, cps1_10MHz, 3wonders, cps_state, cps1, ROT0, "bootleg", "Three Wonders (hack)", MACHINE_SUPPORTS_SAVE ) // 910520 - based on World version
GAME( 1991, kod, 0, cps1_10MHz, kod, cps_state, cps1, ROT0, "Capcom", "The King of Dragons (World 910805)", MACHINE_SUPPORTS_SAVE ) // "ETC"
GAME( 1991, kodr1, kod, cps1_10MHz, kodr1, cps_state, cps1, ROT0, "Capcom", "The King of Dragons (World 910711)", MACHINE_SUPPORTS_SAVE ) // "ETC"
@@ -11870,7 +11871,7 @@ GAME( 1992, sf2hfj, sf2hf, cps1_12MHz, sf2j, cps_state, cps1,
GAME( 1993, dino, 0, qsound, dino, cps_state, dino, ROT0, "Capcom", "Cadillacs and Dinosaurs (World 930201)", MACHINE_SUPPORTS_SAVE ) // "ETC"
GAME( 1993, dinou, dino, qsound, dino, cps_state, dino, ROT0, "Capcom", "Cadillacs and Dinosaurs (USA 930201)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, dinoj, dino, qsound, dino, cps_state, dino, ROT0, "Capcom", "Cadillacs: Kyouryuu Shin Seiki (Japan 930201)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, dinohunt, dino, wofhfh, dinoh, cps_state, dinohunt, ROT0, "bootleg", "Dinosaur Hunter (Chinese bootleg of Cadillacs and Dinosaurs)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // 930223 - based on Asia TW version, the original is still undumped
+GAME( 1993, dinohunt, dino, wofhfh, dinoh, cps_state, dinohunt, ROT0, "bootleg", "Dinosaur Hunter (Chinese bootleg of Cadillacs and Dinosaurs)", MACHINE_SUPPORTS_SAVE ) // 930223 - based on Asia TW version, the original is still undumped
GAME( 1993, punisher, 0, qsound, punisher, cps_state, punisher, ROT0, "Capcom", "The Punisher (World 930422)", MACHINE_SUPPORTS_SAVE ) // "ETC"
GAME( 1993, punisheru, punisher, qsound, punisher, cps_state, punisher, ROT0, "Capcom", "The Punisher (USA 930422)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, punisherh, punisher, qsound, punisher, cps_state, punisher, ROT0, "Capcom", "The Punisher (Hispanic 930422)", MACHINE_SUPPORTS_SAVE )
@@ -11897,10 +11898,10 @@ GAME( 1995, pang3b, pang3, pang3, pang3b, cps_state, pang3b,
/* Home 'CPS Changer' Unit - For MESS */
-CONS( 1994, wofch, 0, 0, qsound, wofch, cps_state, wof, "Capcom", "Tenchi wo Kurau II: Sekiheki no Tatakai (CPS Changer, Japan 921031)", 0 )
-CONS( 1995, sfzch, 0, 0, cps1_12MHz, sfzch, cps_state, cps1, "Capcom", "Street Fighter Zero (CPS Changer, Japan 951020)", 0 )
+CONS( 1994, wofch, 0, 0, qsound, wofch, cps_state, wof, "Capcom", "Tenchi wo Kurau II: Sekiheki no Tatakai (CPS Changer, Japan 921031)", MACHINE_SUPPORTS_SAVE )
+CONS( 1995, sfzch, 0, 0, cps1_12MHz, sfzch, cps_state, cps1, "Capcom", "Street Fighter Zero (CPS Changer, Japan 951020)", MACHINE_SUPPORTS_SAVE )
// are these 2 legit sets, or did somebody region hack it?
-CONS( 1995, sfach, sfzch, 0, cps1_12MHz, sfzch, cps_state, cps1, "Capcom", "Street Fighter Alpha: Warriors' Dreams (CPS Changer, Publicity USA 950727)", 0 )
-CONS( 1995, sfzbch, sfzch, 0, cps1_12MHz, sfzch, cps_state, cps1, "Capcom", "Street Fighter Zero (CPS Changer, Brazil 950727)", 0 )
+CONS( 1995, sfach, sfzch, 0, cps1_12MHz, sfzch, cps_state, cps1, "Capcom", "Street Fighter Alpha: Warriors' Dreams (CPS Changer, Publicity USA 950727)", MACHINE_SUPPORTS_SAVE )
+CONS( 1995, sfzbch, sfzch, 0, cps1_12MHz, sfzch, cps_state, cps1, "Capcom", "Street Fighter Zero (CPS Changer, Brazil 950727)", MACHINE_SUPPORTS_SAVE )
// Ken Sei Mogura: Street Fighter II - see kenseim.c
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index 0070318776e..47999a2d659 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -6761,6 +6761,7 @@ ROM_START( sfa3u )
SFA3_USA_KEY
ROM_END
+
ROM_START( sfa3ur1 )
ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_WORD_SWAP( "sz3u.03", 0x000000, 0x80000, CRC(b5984a19) SHA1(e225dd1d3a5d1b94adcfc5f720775e9ba321996e) )
@@ -6794,6 +6795,39 @@ ROM_START( sfa3ur1 )
SFA3_USA_KEY
ROM_END
+ROM_START( sfa3us )
+ ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_03.6a", 0x000000, 0x80000, CRC(14319e29) SHA1(6de0c08f887d334d720d4c8ba7d5745f5282adfb) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_04.7a", 0x080000, 0x80000, CRC(65fbc272) SHA1(d320a3c0dae03ea7c32cd521b99afb0e2d62dfaf) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_05.8a", 0x100000, 0x80000, CRC(e93c47d1) SHA1(18c388e55b852ad46b784e0cf3fd4c72e8bb6850) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_06.9a", 0x180000, 0x80000, CRC(1bf09de3) SHA1(8bd7f5ae7dbaccc65af835f166134f1bb44e6aae) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_07.6d", 0x200000, 0x80000, CRC(f6296d96) SHA1(ff9376544968c6783fd98b9a714f0c25174f027a) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_08.7d", 0x280000, 0x80000, CRC(1f4008ff) SHA1(f3fe9d6560bf97e7a3a15c1c43f74ac9ef3d5fbb) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_09.8d", 0x300000, 0x80000, CRC(822fc451) SHA1(49ec9e3f33d6023b59b350a79fe2299f6ac90251) )
+ ROM_LOAD16_WORD_SWAP( "sz3-usam_10.9d", 0x380000, 0x80000, CRC(92713468) SHA1(9855bb1dd54190e29c5935be4a6529ac0936a628))
+
+ ROM_REGION( 0x2000000, "gfx", 0 )
+ ROMX_LOAD( "sz3.13m", 0x0000000, 0x400000, CRC(0f7a60d9) SHA1(c69e0ee22537312909dacc86d2e4be319d54e426) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.15m", 0x0000002, 0x400000, CRC(8e933741) SHA1(f4ac4bfe830dc7df9fe4f680e4e0c053e7cbd8fe) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.17m", 0x0000004, 0x400000, CRC(d6e98147) SHA1(37f331fbb1284db446faecade6f484f58c0e1b2a) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.19m", 0x0000006, 0x400000, CRC(f31a728a) SHA1(f14136564648f006c1b74afda78349f260524b5f) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.14m", 0x1000000, 0x400000, CRC(5ff98297) SHA1(9e0ce43380b776c7a03872bafd4856f6fa60bda7) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.16m", 0x1000002, 0x400000, CRC(52b5bdee) SHA1(7918204dc457f7a146d8fb8cf7242dfed3109fd8) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.18m", 0x1000004, 0x400000, CRC(40631ed5) SHA1(c18c56822b90a71ca5fbdf3440eb2671011f3d8f) , ROM_GROUPWORD | ROM_SKIP(6) )
+ ROMX_LOAD( "sz3.20m", 0x1000006, 0x400000, CRC(763409b4) SHA1(af60a5116c1ca9050366a35ea29128921867f3cc) , ROM_GROUPWORD | ROM_SKIP(6) )
+
+ ROM_REGION( QSOUND_SIZE, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */
+ ROM_LOAD( "sz3-usam_01.1a", 0x00000, 0x08000, CRC(c180947d) SHA1(829c8cf45029676acde369b890ac1b941981f750) )
+ ROM_CONTINUE( 0x10000, 0x18000 )
+ ROM_LOAD( "sz3-usam_02.2a", 0x28000, 0x20000, CRC(9ebc280f) SHA1(33fa0934c046eaae3c841d5be0bbdf7b190ef5e7) )
+
+ ROM_REGION( 0x800000, "qsound", 0 ) /* QSound samples */
+ ROM_LOAD16_WORD_SWAP( "sz3.11m", 0x000000, 0x400000, CRC(1c89eed1) SHA1(649a0b0a3eb72e2e69e9fb1ac51a58b70daa39f3) )
+ ROM_LOAD16_WORD_SWAP( "sz3.12m", 0x400000, 0x400000, CRC(f392b13a) SHA1(fa04ce0370144a49bd1d5acd873eef87b0dc9d15) )
+
+ SFA3_USA_KEY
+ROM_END
+
ROM_START( sfz3j )
ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */
ROM_LOAD16_WORD_SWAP( "sz3j.03c", 0x000000, 0x80000, CRC(cadf4a51) SHA1(a0511512f55c0befa4a905ceff8c6f5775cf40ba) )
@@ -9442,6 +9476,7 @@ GAME( 1998, mvscb, mvsc, cps2, cps2_2p6b, cps_state, cps2, ROT0,
GAME( 1998, sfa3, 0, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Euro 980904)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, sfa3u, sfa3, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980904)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, sfa3ur1, sfa3, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980629)", MACHINE_SUPPORTS_SAVE )
+GAME( 1998, sfa3us, sfa3, cps2, cps2_2p6b, cps_state, cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (USA 980616, SAMPLE Version)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, sfa3h, sfa3, cps2, cps2_2p6bt, cps_state,cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Hispanic 980904)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, sfa3hr1, sfa3, cps2, cps2_2p6bt, cps_state,cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Hispanic 980629)", MACHINE_SUPPORTS_SAVE )
GAME( 1998, sfa3b, sfa3, cps2, cps2_2p6bt, cps_state,cps2, ROT0, "Capcom", "Street Fighter Alpha 3 (Brazil 980629)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 4381da90605..0ceb465acb9 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -1011,7 +1011,7 @@ void cps3_state::cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_rg
UINT32 cps3_state::screen_update_cps3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int y,x, count;
- attoseconds_t period = screen.frame_period().attoseconds;
+ attoseconds_t period = screen.frame_period().attoseconds();
rectangle visarea = screen.visible_area();
int bg_drawn[4] = { 0, 0, 0, 0 };
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index 3ad21a566b7..7624d29161e 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -16,16 +16,10 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6809/konami.h" /* for the callback and the firq irq definition */
-
#include "sound/2151intf.h"
#include "includes/konamipt.h"
#include "includes/crimfght.h"
-INTERRUPT_GEN_MEMBER(crimfght_state::crimfght_interrupt)
-{
- if (m_k051960->k051960_is_irq_enabled())
- device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
-}
WRITE8_MEMBER(crimfght_state::crimfght_coin_w)
{
@@ -33,23 +27,6 @@ WRITE8_MEMBER(crimfght_state::crimfght_coin_w)
coin_counter_w(machine(), 1, data & 2);
}
-WRITE8_MEMBER(crimfght_state::crimfght_sh_irqtrigger_w)
-{
- soundlatch_byte_w(space, offset, data);
- m_audiocpu->set_input_line(0, HOLD_LINE);
-}
-
-WRITE8_MEMBER(crimfght_state::crimfght_snd_bankswitch_w)
-{
- /* b1: bank for channel A */
- /* b0: bank for channel B */
-
- int bank_A = BIT(data, 1);
- int bank_B = BIT(data, 0);
-
- m_k007232->set_bank(bank_A, bank_B );
-}
-
READ8_MEMBER(crimfght_state::k052109_051960_r)
{
if (m_k052109->get_rmrd_line() == CLEAR_LINE)
@@ -75,11 +52,35 @@ WRITE8_MEMBER(crimfght_state::k052109_051960_w)
m_k051960->k051960_w(space, offset - 0x3c00, data);
}
-/********************************************/
+WRITE8_MEMBER(crimfght_state::sound_w)
+{
+ // writing the latch asserts the irq line
+ soundlatch_write(0, data);
+ m_audiocpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
+}
+
+IRQ_CALLBACK_MEMBER( crimfght_state::audiocpu_irq_ack )
+{
+ // irq ack cycle clears irq via flip-flop u86
+ m_audiocpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+ return 0xff;
+}
+
+WRITE8_MEMBER(crimfght_state::ym2151_ct_w)
+{
+ // ne output from the 007232 is connected to a ls399 which
+ // has inputs connected to the ct1 and ct2 outputs from
+ // the ym2151 used to select the bank
+
+ int bank_a = BIT(data, 1);
+ int bank_b = BIT(data, 0);
+
+ m_k007232->set_bank(bank_a, bank_b);
+}
static ADDRESS_MAP_START( crimfght_map, AS_PROGRAM, 8, crimfght_state )
- AM_RANGE(0x0000, 0x03ff) AM_RAMBANK("bank1") /* banked RAM */
- AM_RANGE(0x0400, 0x1fff) AM_RAM /* RAM */
+ AM_RANGE(0x0000, 0x03ff) AM_DEVICE("bank0000", address_map_bank_device, amap8)
+ AM_RANGE(0x0400, 0x1fff) AM_RAM
AM_RANGE(0x3f80, 0x3f80) AM_READ_PORT("SYSTEM")
AM_RANGE(0x3f81, 0x3f81) AM_READ_PORT("P1")
AM_RANGE(0x3f82, 0x3f82) AM_READ_PORT("P2")
@@ -88,19 +89,25 @@ static ADDRESS_MAP_START( crimfght_map, AS_PROGRAM, 8, crimfght_state )
AM_RANGE(0x3f85, 0x3f85) AM_READ_PORT("P3")
AM_RANGE(0x3f86, 0x3f86) AM_READ_PORT("P4")
AM_RANGE(0x3f87, 0x3f87) AM_READ_PORT("DSW1")
- AM_RANGE(0x3f88, 0x3f88) AM_READ(watchdog_reset_r) AM_WRITE(crimfght_coin_w) /* watchdog reset */
- AM_RANGE(0x3f8c, 0x3f8c) AM_WRITE(crimfght_sh_irqtrigger_w) /* cause interrupt on audio CPU? */
+ AM_RANGE(0x3f88, 0x3f88) AM_MIRROR(0x03) AM_READ(watchdog_reset_r) AM_WRITE(crimfght_coin_w) // 051550
+ AM_RANGE(0x3f8c, 0x3f8c) AM_MIRROR(0x03) AM_WRITE(sound_w)
AM_RANGE(0x2000, 0x5fff) AM_READWRITE(k052109_051960_r, k052109_051960_w) /* video RAM + sprite RAM */
- AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank2") /* banked ROM */
- AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */
+ AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank") /* banked ROM */
+ AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("maincpu", 0x18000)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( bank0000_map, AS_PROGRAM, 8, crimfght_state )
+ AM_RANGE(0x0000, 0x03ff) AM_RAM
+ AM_RANGE(0x0400, 0x07ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
+ADDRESS_MAP_END
+
+// full memory map derived from schematics
static ADDRESS_MAP_START( crimfght_sound_map, AS_PROGRAM, 8, crimfght_state )
- AM_RANGE(0x0000, 0x7fff) AM_ROM /* ROM 821l01.h4 */
- AM_RANGE(0x8000, 0x87ff) AM_RAM /* RAM */
- AM_RANGE(0xa000, 0xa001) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write) /* YM2151 */
- AM_RANGE(0xc000, 0xc000) AM_READ(soundlatch_byte_r) /* soundlatch_byte_r */
- AM_RANGE(0xe000, 0xe00d) AM_DEVREADWRITE("k007232", k007232_device, read, write) /* 007232 registers */
+ AM_RANGE(0x0000, 0x7fff) AM_ROM
+ AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x1800) AM_RAM
+ AM_RANGE(0xa000, 0xa001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
+ AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x1fff) AM_READ(soundlatch_byte_r)
+ AM_RANGE(0xe000, 0xe00f) AM_MIRROR(0x1ff0) AM_DEVREADWRITE("k007232", k007232_device, read, write)
ADDRESS_MAP_END
/***************************************************************************
@@ -111,48 +118,64 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( crimfght )
PORT_START("DSW1")
- PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
- PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ) )
- PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ) )
- PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
- PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ) )
- PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ) )
- PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ) )
- PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ) )
- PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ) )
- PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ) )
- PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
- PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ) )
- PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ) )
- PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ) )
- PORT_DIPSETTING( 0x00, "1 Coin/99 Credits" )
- PORT_DIPUNUSED_DIPLOC( 0xf0, 0xf0, "SW1:5,6,7,8" ) /* Manual says these are unused */
+ PORT_DIPNAME(0x0f, 0x0f, DEF_STR( Coin_A )) PORT_DIPLOCATION("SW1:1,2,3,4")
+ PORT_DIPSETTING( 0x02, DEF_STR( 4C_1C ))
+ PORT_DIPSETTING( 0x05, DEF_STR( 3C_1C ))
+ PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ))
+ PORT_DIPSETTING( 0x04, DEF_STR( 3C_2C ))
+ PORT_DIPSETTING( 0x01, DEF_STR( 4C_3C ))
+ PORT_DIPSETTING( 0x0f, DEF_STR( 1C_1C ))
+ PORT_DIPSETTING( 0x03, DEF_STR( 3C_4C ))
+ PORT_DIPSETTING( 0x07, DEF_STR( 2C_3C ))
+ PORT_DIPSETTING( 0x0e, DEF_STR( 1C_2C ))
+ PORT_DIPSETTING( 0x06, DEF_STR( 2C_5C ))
+ PORT_DIPSETTING( 0x0d, DEF_STR( 1C_3C ))
+ PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ))
+ PORT_DIPSETTING( 0x0b, DEF_STR( 1C_5C ))
+ PORT_DIPSETTING( 0x0a, DEF_STR( 1C_6C ))
+ PORT_DIPSETTING( 0x09, DEF_STR( 1C_7C ))
+ PORT_DIPSETTING( 0x00, "Void")
+ PORT_DIPNAME(0xf0, 0x00, "Coin B (unused)") PORT_DIPLOCATION("SW1:5,6,7,8")
+ PORT_DIPSETTING( 0x20, DEF_STR( 4C_1C ))
+ PORT_DIPSETTING( 0x50, DEF_STR( 3C_1C ))
+ PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ))
+ PORT_DIPSETTING( 0x40, DEF_STR( 3C_2C ))
+ PORT_DIPSETTING( 0x10, DEF_STR( 4C_3C ))
+ PORT_DIPSETTING( 0xf0, DEF_STR( 1C_1C ))
+ PORT_DIPSETTING( 0x30, DEF_STR( 3C_4C ))
+ PORT_DIPSETTING( 0x70, DEF_STR( 2C_3C ))
+ PORT_DIPSETTING( 0xe0, DEF_STR( 1C_2C ))
+ PORT_DIPSETTING( 0x60, DEF_STR( 2C_5C ))
+ PORT_DIPSETTING( 0xd0, DEF_STR( 1C_3C ))
+ PORT_DIPSETTING( 0xc0, DEF_STR( 1C_4C ))
+ PORT_DIPSETTING( 0xb0, DEF_STR( 1C_5C ))
+ PORT_DIPSETTING( 0xa0, DEF_STR( 1C_6C ))
+ PORT_DIPSETTING( 0x90, DEF_STR( 1C_7C ))
+ PORT_DIPSETTING( 0x00, "Void")
PORT_START("DSW2")
- PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW2:1" ) /* Manual says these are unused */
- PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW2:2" ) /* Manual says these are unused */
- PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" ) /* Manual says these are unused */
- PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW2:4" ) /* Manual says these are unused */
- PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW2:5" ) /* Manual says these are unused */
- PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
- PORT_DIPSETTING( 0x60, DEF_STR( Easy ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Normal ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Difficult ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPUNUSED_DIPLOC(0x01, 0x01, "SW2:1")
+ PORT_DIPUNUSED_DIPLOC(0x02, 0x02, "SW2:2")
+ PORT_DIPUNUSED_DIPLOC(0x04, 0x04, "SW2:3")
+ PORT_DIPUNUSED_DIPLOC(0x08, 0x08, "SW2:4")
+ PORT_DIPUNUSED_DIPLOC(0x10, 0x10, "SW2:5")
+ PORT_DIPNAME(0x60, 0x40, DEF_STR( Difficulty )) PORT_DIPLOCATION("SW2:6,7")
+ PORT_DIPSETTING( 0x60, DEF_STR( Easy ))
+ PORT_DIPSETTING( 0x40, DEF_STR( Normal ))
+ PORT_DIPSETTING( 0x20, DEF_STR( Difficult ))
+ PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ))
+ PORT_DIPNAME(0x80, 0x00, DEF_STR( Demo_Sounds )) PORT_DIPLOCATION("SW2:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ))
+ PORT_DIPSETTING( 0x00, DEF_STR( On ))
PORT_START("DSW3")
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW3:1")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) /* Manual says these are unused */
- PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_HIGH, "SW3:3" )
- PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) /* Manual says these are unused */
- PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_DIPNAME(0x01, 0x01, DEF_STR( Flip_Screen )) PORT_DIPLOCATION("SW3:1")
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ))
+ PORT_DIPSETTING( 0x00, DEF_STR( On ))
+ PORT_DIPUNUSED_DIPLOC(0x02, IP_ACTIVE_LOW, "SW3:2")
+ PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW3:3")
+ PORT_DIPUNUSED_DIPLOC(0x08, IP_ACTIVE_LOW, "SW3:4")
+ PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, crimfght_state, system_r, 0)
PORT_START("P1")
KONAMI8_B12_UNK(1)
@@ -167,14 +190,14 @@ static INPUT_PORTS_START( crimfght )
KONAMI8_B12_UNK(4)
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
+ PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN1)
+ PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_COIN2)
+ PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN3)
+ PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN4)
+ PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_SERVICE1)
+ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_SERVICE2)
+ PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_SERVICE3)
+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_SERVICE4)
INPUT_PORTS_END
static INPUT_PORTS_START( crimfghtj )
@@ -226,28 +249,35 @@ WRITE8_MEMBER(crimfght_state::volume_callback)
void crimfght_state::machine_start()
{
- UINT8 *ROM = memregion("maincpu")->base();
-
- membank("bank2")->configure_entries(0, 12, &ROM[0x10000], 0x2000);
- membank("bank2")->set_entry(0);
+ m_rombank->configure_entries(0, 16, memregion("maincpu")->base(), 0x2000);
+ m_rombank->set_entry(0);
}
WRITE8_MEMBER( crimfght_state::banking_callback )
{
+ m_rombank->set_entry(data & 0x0f);
+
/* bit 5 = select work RAM or palette */
- if (data & 0x20)
- {
- m_maincpu->space(AS_PROGRAM).install_read_bank(0x0000, 0x03ff, "bank3");
- m_maincpu->space(AS_PROGRAM).install_write_handler(0x0000, 0x03ff, write8_delegate(FUNC(palette_device::write), m_palette.target()));
- membank("bank3")->set_base(&m_paletteram[0]);
- }
- else
- m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */
+ m_woco = BIT(data, 5);
+ m_bank0000->set_bank(m_woco);
/* bit 6 = enable char ROM reading through the video RAM */
- m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
+ m_rmrd = BIT(data, 6);
+ m_k052109->set_rmrd_line(m_rmrd ? ASSERT_LINE : CLEAR_LINE);
+
+ m_init = BIT(data, 7);
+}
- membank("bank2")->set_entry(data & 0x0f);
+CUSTOM_INPUT_MEMBER( crimfght_state::system_r )
+{
+ UINT8 data = 0;
+
+ data |= 1 << 4; // VCC
+ data |= m_woco << 5;
+ data |= m_rmrd << 6;
+ data |= m_init << 7;
+
+ return data >> 4;
}
static MACHINE_CONFIG_START( crimfght, crimfght_state )
@@ -255,18 +285,24 @@ static MACHINE_CONFIG_START( crimfght, crimfght_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", KONAMI, XTAL_24MHz/8) /* 052001 (verified on pcb) */
MCFG_CPU_PROGRAM_MAP(crimfght_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", crimfght_state, crimfght_interrupt)
MCFG_KONAMICPU_LINE_CB(WRITE8(crimfght_state, banking_callback))
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(crimfght_sound_map)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE(DEVICE_SELF, crimfght_state, audiocpu_irq_ack)
+
+ MCFG_DEVICE_ADD("bank0000", ADDRESS_MAP_BANK, 0)
+ MCFG_DEVICE_PROGRAM_MAP(bank0000_map)
+ MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_BIG)
+ MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
+ MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(11)
+ MCFG_ADDRESS_MAP_BANK_STRIDE(0x400)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(59.17) /* verified on pcb */
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(12*8-2, (64-12)*8-3, 2*8, 30*8-1 )
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 96, 416, 256, 16, 240) // measured 59.17
+// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
+// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_UPDATE_DRIVER(crimfght_state, screen_update_crimfght)
MCFG_SCREEN_PALETTE("palette")
@@ -280,13 +316,15 @@ static MACHINE_CONFIG_START( crimfght, crimfght_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(crimfght_state, sprite_callback)
+ MCFG_K051960_IRQ_HANDLER(INPUTLINE("maincpu", KONAMI_IRQ_LINE))
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
- MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(crimfght_state,crimfght_snd_bankswitch_w))
+ MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(crimfght_state, ym2151_ct_w))
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
@@ -305,9 +343,8 @@ MACHINE_CONFIG_END
***************************************************************************/
ROM_START( crimfght )
- ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */
- ROM_LOAD( "821l02.f24", 0x10000, 0x18000, CRC(588e7da6) SHA1(285febb3bcca31f82b34af3695a59eafae01cd30) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x20000, "maincpu", 0 ) /* code + banked roms */
+ ROM_LOAD( "821l02.f24", 0x00000, 0x20000, CRC(588e7da6) SHA1(285febb3bcca31f82b34af3695a59eafae01cd30) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */
ROM_LOAD( "821l01.h4", 0x0000, 0x8000, CRC(0faca89e) SHA1(21c9c6d736b398a29e8709e1187c5bf3cacdc99d) )
@@ -328,9 +365,8 @@ ROM_START( crimfght )
ROM_END
ROM_START( crimfghtj )
- ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */
- ROM_LOAD( "821p02.f24", 0x10000, 0x18000, CRC(f33fa2e1) SHA1(00fc9e8250fa51386f3af2fca0f137bec9e1c220) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x20000, "maincpu", 0 ) /* code + banked roms */
+ ROM_LOAD( "821p02.f24", 0x00000, 0x20000, CRC(f33fa2e1) SHA1(00fc9e8250fa51386f3af2fca0f137bec9e1c220) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */
ROM_LOAD( "821l01.h4", 0x0000, 0x8000, CRC(0faca89e) SHA1(21c9c6d736b398a29e8709e1187c5bf3cacdc99d) )
@@ -351,9 +387,8 @@ ROM_START( crimfghtj )
ROM_END
ROM_START( crimfght2 )
-ROM_REGION( 0x28000, "maincpu", 0 ) /* code + banked roms */
- ROM_LOAD( "821r02.f24", 0x10000, 0x18000, CRC(4ecdd923) SHA1(78e5260c4bb9b18d7818fb6300d7e1d3a577fb63) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x20000, "maincpu", 0 ) /* code + banked roms */
+ ROM_LOAD( "821r02.f24", 0x00000, 0x20000, CRC(4ecdd923) SHA1(78e5260c4bb9b18d7818fb6300d7e1d3a577fb63) )
ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the sound CPU */
ROM_LOAD( "821l01.h4", 0x0000, 0x8000, CRC(0faca89e) SHA1(21c9c6d736b398a29e8709e1187c5bf3cacdc99d) )
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index a7e75c9ac7b..f0cf098b7bc 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -11,44 +11,46 @@ CPU: Z80 or 68000
Sound: (AY-3-8910) + YM2413 + MSM6295
Other: Real Time Clock (Oki MSM6242B or 72421B)
---------------------------------------------------------------------------------------------------------------------
-Year + Game Board CPU Sound Custom Other
---------------------------------------------------------------------------------------------------------------------
-92 Monkey Mole Panic 2xZ80 AY8910 YM2413 M6295 NL-001 1108(x2) 1427(x2) 8251
-93 Animalandia Jr. 2xZ80 AY8910 YM2413 M6295 NL-001 NL-003(x2) NL-004(x2) 8251
-93 Quiz Channel Question N7311208L1-2 Z80 YM2413 M6295 NL-002 1108F0405 1427F0071
-93 First Funky Fighter N7403208L-2 2xZ80 YM2149 YM2413 M6295 NL-001 NL-002 NL-005
-94 Mj Mysterious World D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071 4L02?
-94 Mj Mysterious Universe D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071
-94 Mj Mysterious Orient D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071
-94 Quiz 365 68000 AY8910 YM2413 M6295
-94 Rong Rong (J) N8010178L1 Z80 YM2413 M6295 NL-002 1108F0405 1427F0071 4L02F2637
-94 Hf Hana Ginga D8102048L1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071 4L02?
-94 Super Hana Paradise N8010178L1+N73RSUB Z80 YM2413 M6295 NL-002 1108F0406 1427F0071 4L02F2637
-95 Mj Dai Chuuka Ken D11107218L1 Z80 AY8910 YM2413 M6295 70C160F009
-95 Mj Super Dai Chuuka Ken D11510198L1 Z80 AY8910 YM2413 M6295
-95 Hf Hana Gokou N83061581L1 Z80 AY8910 YM2413 M6295 NL-002 1108? 1427? 4L02?
-95 Hf Hana Gokou Bangaihen N10805078L1 Z80 AY8910 YM2413 M6295 NL-002 1108? 1427? 4L02?
-95 Nettoh Quiz Champion 68000 AY8910 YM2413 M6295
-95 Ultra Champion (K) N11309208L1+N114SUB 68000 AY8910 YM2413 M6295 NL-005
-95 Don Den Lover (J) D1120901L8 68000 YMZ284 YM2413 M6295 NL-005
-96 Don Den Lover (HK) D11309208L1 68000 YMZ284 YM2413 M6295 NL-005
-96 Panel&Variety Akamaru 68000 YMZ284 YM2413 M6295 NL-005
-96 Mj Fantasic Love NS5000101+? Z80 YMZ284 YM2413 M6295 NL-005
-96 Hana Kanzashi Z80 YM2413 M6295 70C160F011?
-96 Mj Seiryu Densetsu NM5020403 Z80 YMZ284 YM2413 M6295 70C160F011?
-96 Mj Janshin Plus NM7001004 Z80 YMZ284 YM2413 M6295 TZ-2053P
-96 Mj Dai Touyouken NM7001004 Z80 YMZ284 YM2413 M6295 TZ-2053P
-96 Return Of Sel Jan II NM504-2 Z80 YM2149 YM2413 M6295 TZ-2053P?
-97 Hana Kagerou KC80 YM2413 M6295 70C160F011
-97 Kkot Bi Nyo 9090123-2 KC80 YM2413 M6295 70C160F011 A1010
-97 Kkot Bi Nyo Special 9090123-3 KC80 YM2413 M6295 ?
-98 Mj Chuukanejyo D11107218L1 Z80 AY8910 YM2413 M6295 70C160F009
-98 Mj Reach Ippatsu KC80 YM2413 M6295 70C160F011
-99 Mj Jong-Tei NM532-9902 Z80 YM2413 M6295 4L10FXXXX?
-00 Mj Gorgeous Night TSM003-0002 Z80 YM2413 M6295 4L10FXXXX?
-02 Mj Daimyojin TSM015-0111 Z80 YM2413 M6295 70C160F011
-04 Mj Momotarou TSM015-0111? Z80 YM2413 M6295 70C160F011?
+----------------------------------------------------------------------------------------------------------------------
+Year + Game Board CPU Sound Custom Other
+----------------------------------------------------------------------------------------------------------------------
+92 Hf Hana Tengoku D6502208L1+D6107068L1 Z80 YM2149 YM2413
+92 Monkey Mole Panic 2xZ80 AY8910 YM2413 M6295 NL-001 1108(x2) 1427(x2) 8251
+92 Mj Mysterious Orient D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071
+93 Mj Mysterious Orient 2 D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071
+93 Quiz Channel Question N7311208L1-2 Z80 YM2413 M6295 NL-002 1108F0405 1427F0071
+93 First Funky Fighter N7403208L-2 2xZ80 YM2149 YM2413 M6295 NL-001 NL-002 NL-005
+93 Animalandia Jr. 2xZ80 AY8910 YM2413 M6295 NL-001 NL-003(x2) NL-004(x2) 8251
+94 Mj Mysterious World D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071 4L02?
+94 Mj Mysterious Universe D7107058L1-1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071
+94 Quiz 365 68000 AY8910 YM2413 M6295
+94 Rong Rong (J) N8010178L1 Z80 YM2413 M6295 NL-002 1108F0405 1427F0071 4L02F2637
+94 Hf Hana Ginga D8102048L1 Z80 YM2149 YM2413 M6295 NL-002 1108F0405 1427F0071 4L02?
+94 Super Hana Paradise N8010178L1+N73RSUB Z80 YM2413 M6295 NL-002 1108F0406 1427F0071 4L02F2637
+95 Mj Dai Chuuka Ken D11107218L1 Z80 AY8910 YM2413 M6295 70C160F009
+95 Mj Super Dai Chuuka Ken D11510198L1 Z80 AY8910 YM2413 M6295
+95 Hf Hana Gokou N83061581L1 Z80 AY8910 YM2413 M6295 NL-002 1108? 1427? 4L02?
+95 Hf Hana Gokou Bangaihen N10805078L1 Z80 AY8910 YM2413 M6295 NL-002 1108? 1427? 4L02?
+95 Nettoh Quiz Champion 68000 AY8910 YM2413 M6295
+95 Ultra Champion (K) N11309208L1+N114SUB 68000 AY8910 YM2413 M6295 NL-005
+95 Don Den Lover (J) D1120901L8 68000 YMZ284 YM2413 M6295 NL-005
+96 Don Den Lover (HK) D11309208L1 68000 YMZ284 YM2413 M6295 NL-005
+96 Panel&Variety Akamaru 68000 YMZ284 YM2413 M6295 NL-005
+96 Mj Fantasic Love NS5000101+? Z80 YMZ284 YM2413 M6295 NL-005
+96 Hana Kanzashi Z80 YM2413 M6295 70C160F011?
+96 Mj Seiryu Densetsu NM5020403 Z80 YMZ284 YM2413 M6295 70C160F011?
+96 Mj Janshin Plus NM7001004 Z80 YMZ284 YM2413 M6295 TZ-2053P
+96 Mj Dai Touyouken NM7001004 Z80 YMZ284 YM2413 M6295 TZ-2053P
+96 Return Of Sel Jan II NM504-2 Z80 YM2149 YM2413 M6295 TZ-2053P?
+97 Hana Kagerou KC80 YM2413 M6295 70C160F011
+97 Kkot Bi Nyo 9090123-2 KC80 YM2413 M6295 70C160F011 A1010
+97 Kkot Bi Nyo Special 9090123-3 KC80 YM2413 M6295 ?
+98 Mj Chuukanejyo D11107218L1 Z80 AY8910 YM2413 M6295 70C160F009
+98 Mj Reach Ippatsu KC80 YM2413 M6295 70C160F011
+99 Mj Jong-Tei NM532-9902 Z80 YM2413 M6295 4L10FXXXX?
+00 Mj Gorgeous Night TSM003-0002 Z80 YM2413 M6295 4L10FXXXX?
+02 Mj Daimyojin TSM015-0111 Z80 YM2413 M6295 70C160F011
+04 Mj Momotarou TSM015-0111? Z80 YM2413 M6295 70C160F011?
--------------------------------------------------------------------------------------------------------------------
TODO:
@@ -4845,7 +4847,7 @@ INPUT_PORTS_EXTERN( HANAFUDA_KEYS_BET );
static INPUT_PORTS_START( htengoku )
PORT_START("COINS")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE4 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // analyzer
@@ -4916,7 +4918,7 @@ static INPUT_PORTS_START( htengoku )
PORT_DIPNAME( 0x04, 0x04, "Credits Per Note" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPSETTING( 0x04, "10" )
- PORT_DIPNAME( 0x08, 0x08, "Max Bet" )
+ PORT_DIPNAME( 0x08, 0x08, "Max Rate" )
PORT_DIPSETTING( 0x08, "5" )
PORT_DIPSETTING( 0x00, "10" )
PORT_DIPNAME( 0x30, 0x30, "Min Rate To Play" )
@@ -5455,7 +5457,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( hanakanz )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) // Test
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -5677,7 +5679,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( hkagerou )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) // Test
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -6119,7 +6121,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mjreach1 )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_SERVICE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -6231,7 +6233,7 @@ static INPUT_PORTS_START( mjreach1 )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -6352,7 +6354,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( jongtei )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_SERVICE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -6464,7 +6466,7 @@ static INPUT_PORTS_START( jongtei )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -6478,9 +6480,9 @@ static INPUT_PORTS_START( jongtei )
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
PORT_DIPSETTING( 0x0c, "1" )
-// PORT_DIPSETTING( 0x08, "2" ) // ? these don't let you start a game
-// PORT_DIPSETTING( 0x04, "3" )
-// PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x04, "3" )
+ PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x30, 0x30, "Payout" )
PORT_DIPSETTING( 0x30, "300" )
PORT_DIPSETTING( 0x20, "500" )
@@ -6641,7 +6643,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mjchuuka )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_SERVICE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -6753,7 +6755,7 @@ static INPUT_PORTS_START( mjchuuka )
PORT_DIPSETTING( 0x30, "1 2 4 8 12 16 24 32" )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -6767,9 +6769,9 @@ static INPUT_PORTS_START( mjchuuka )
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
PORT_DIPSETTING( 0x0c, "1" )
-// PORT_DIPSETTING( 0x08, "2" ) // ? these don't let you start a game
-// PORT_DIPSETTING( 0x04, "3" )
-// PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x04, "3" )
+ PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, "10" )
PORT_DIPSETTING( 0x00, "255" )
@@ -6874,7 +6876,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mjschuka )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_SERVICE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -6986,7 +6988,7 @@ static INPUT_PORTS_START( mjschuka )
PORT_DIPSETTING( 0x30, "1 2 4 8 12 16 24 32" )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -7208,7 +7210,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mjmyster )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -7280,7 +7282,7 @@ static INPUT_PORTS_START( mjmyster )
PORT_DIPSETTING( 0x30, "1 2 4 8 12 16 24 32" )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -7294,9 +7296,9 @@ static INPUT_PORTS_START( mjmyster )
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
PORT_DIPSETTING( 0x0c, "1" )
-// PORT_DIPSETTING( 0x08, "2" ) // ? these don't let you start a game
-// PORT_DIPSETTING( 0x04, "3" )
-// PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x04, "3" )
+ PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x70, 0x70, "YAKUMAN Bonus" )
PORT_DIPSETTING( 0x70, "Cut" )
PORT_DIPSETTING( 0x60, "1 T" )
@@ -7388,7 +7390,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( hginga )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
// PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) // Test
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -7608,7 +7610,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( hgokou )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -7822,7 +7824,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( mjmyornt )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -7894,7 +7896,7 @@ static INPUT_PORTS_START( mjmyornt )
PORT_DIPSETTING( 0x30, "1 2 4 8 12 16 24 32" )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -7902,15 +7904,21 @@ static INPUT_PORTS_START( mjmyornt )
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) )
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+
+ PORT_DIPSETTING( 0x01, DEF_STR( 2C_2C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+
PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
PORT_DIPSETTING( 0x0c, "1" )
-// PORT_DIPSETTING( 0x08, "2" ) // ? these don't let you start a game
-// PORT_DIPSETTING( 0x04, "3" )
-// PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x04, "3" )
+ PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x70, 0x70, "YAKUMAN Bonus" )
PORT_DIPSETTING( 0x70, "Cut" )
PORT_DIPSETTING( 0x60, "1 T" )
@@ -7925,11 +7933,11 @@ static INPUT_PORTS_START( mjmyornt )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW3")
- PORT_DIPNAME( 0x03, 0x03, "YAKUMAN Times" )
-// PORT_DIPSETTING( 0x00, "1" )
- PORT_DIPSETTING( 0x03, "1" )
- PORT_DIPSETTING( 0x02, "2" )
- PORT_DIPSETTING( 0x01, "3?" )
+ PORT_DIPNAME( 0x03, 0x03, "Bonus Game" )
+ PORT_DIPSETTING( 0x00, "Slot? (duplicate)" )
+ PORT_DIPSETTING( 0x03, "Slot?" )
+ PORT_DIPSETTING( 0x02, "Slot + Girls?" )
+ PORT_DIPSETTING( 0x01, "Girl Choice" ) // 4 choices in gal mode check (instead of 3)
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@@ -7967,7 +7975,7 @@ static INPUT_PORTS_START( mjmyornt )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
+ PORT_DIPNAME( 0x40, 0x40, "Set Clock" )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
@@ -7975,195 +7983,15 @@ static INPUT_PORTS_START( mjmyornt )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW5")
- PORT_DIPNAME( 0x03, 0x03, "Computer Strength?" )
- PORT_DIPSETTING( 0x03, "Weak" )
- PORT_DIPSETTING( 0x02, DEF_STR( Normal ))
- PORT_DIPSETTING( 0x01, "Strong" )
- PORT_DIPSETTING( 0x00, "Very Strong" )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, "DonDen Key" )
- PORT_DIPSETTING( 0x08, "Start" )
- PORT_DIPSETTING( 0x00, "Flip Flop" )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, "Credits Per Note" )
- PORT_DIPSETTING( 0x40, "5" )
- PORT_DIPSETTING( 0x00, "10" )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Flip_Screen ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x80, DEF_STR( On ) )
-INPUT_PORTS_END
-
-#ifdef UNUSED_DEFINITION
-static INPUT_PORTS_START( mjmyuniv )
- PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN)
- PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) // data clear
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // note
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN)
-
- PORT_START("KEY0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) // A
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) // E
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) // I
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) // M
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) // Kan
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) // Start 1
-
- PORT_START("KEY1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) // B
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) // F
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) // J
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) // N
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) // Reach
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) // BET
-
- PORT_START("KEY2")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) // C
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) // G
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) // K
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) // Chi
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) // Ron
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // nothing
-
- PORT_START("KEY3")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) // D
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) // H
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) // L
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) // Pon
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // nothing
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // nothing
-
- PORT_START("KEY4")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) // "l"
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // "t"
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // "w"
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) // Flip Flop
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // "b"
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // "s"
-
- PORT_START("DSW1")
- PORT_DIPNAME( 0x0f, 0x07, "Pay Out Rate (%)" )
- PORT_DIPSETTING( 0x00, "50" )
- PORT_DIPSETTING( 0x01, "53" )
- PORT_DIPSETTING( 0x02, "56" )
- PORT_DIPSETTING( 0x03, "59" )
- PORT_DIPSETTING( 0x04, "62" )
- PORT_DIPSETTING( 0x05, "65" )
- PORT_DIPSETTING( 0x06, "68" )
- PORT_DIPSETTING( 0x07, "71" )
- PORT_DIPSETTING( 0x08, "75" )
- PORT_DIPSETTING( 0x09, "78" )
- PORT_DIPSETTING( 0x0a, "81" )
- PORT_DIPSETTING( 0x0b, "84" )
- PORT_DIPSETTING( 0x0c, "87" )
- PORT_DIPSETTING( 0x0d, "90" )
- PORT_DIPSETTING( 0x0e, "93" )
- PORT_DIPSETTING( 0x0f, "96" )
- PORT_DIPNAME( 0x30, 0x30, "Odds Rate" )
- PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
- PORT_DIPSETTING( 0x30, "1 2 4 8 12 16 24 32" )
- PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
- PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
- PORT_DIPSETTING( 0xc0, "1" )
- PORT_DIPSETTING( 0x80, "5" )
- PORT_DIPSETTING( 0x40, "10" )
- PORT_DIPSETTING( 0x00, "20" )
-
- PORT_START("DSW2")
- PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
- PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
- PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
- PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) )
- PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
- PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
- PORT_DIPSETTING( 0x0c, "1" )
-// PORT_DIPSETTING( 0x08, "2" ) // ? these don't let you start a game
-// PORT_DIPSETTING( 0x04, "3" )
-// PORT_DIPSETTING( 0x00, "5" )
- PORT_DIPNAME( 0x70, 0x70, "YAKUMAN Bonus" )
- PORT_DIPSETTING( 0x70, "Cut" )
- PORT_DIPSETTING( 0x60, "1 T" )
- PORT_DIPSETTING( 0x50, "300" )
- PORT_DIPSETTING( 0x40, "500" )
- PORT_DIPSETTING( 0x30, "700" )
- PORT_DIPSETTING( 0x20, "1000" )
- PORT_DIPSETTING( 0x10, "1000?" )
- PORT_DIPSETTING( 0x00, "1000?" )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
- PORT_START("DSW3")
- PORT_DIPNAME( 0x03, 0x03, "YAKUMAN Times" )
-// PORT_DIPSETTING( 0x00, "1" )
- PORT_DIPSETTING( 0x03, "1" )
- PORT_DIPSETTING( 0x02, "2" )
- PORT_DIPSETTING( 0x01, "3?" )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x18, 0x18, "Payout" )
- PORT_DIPSETTING( 0x18, "300" )
- PORT_DIPSETTING( 0x10, "500" )
- PORT_DIPSETTING( 0x08, "700" )
- PORT_DIPSETTING( 0x00, "1000" )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
- PORT_START("DSW4")
- PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )
+ PORT_DIPNAME( 0x01, 0x01, "Alternate Coinage" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x00, "In Game Music" )
+ PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
-
- PORT_START("DSW5")
- PORT_DIPNAME( 0x03, 0x03, "Computer Strength?" )
- PORT_DIPSETTING( 0x03, "Weak" )
- PORT_DIPSETTING( 0x02, DEF_STR( Normal ))
- PORT_DIPSETTING( 0x01, "Strong" )
- PORT_DIPSETTING( 0x00, "Very Strong" )
- PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, "DonDen Key" )
PORT_DIPSETTING( 0x08, "Start" )
PORT_DIPSETTING( 0x00, "Flip Flop" )
@@ -8180,7 +8008,22 @@ static INPUT_PORTS_START( mjmyuniv )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
INPUT_PORTS_END
-#endif
+
+static INPUT_PORTS_START( mjmyorn2 )
+ PORT_INCLUDE(mjmyornt)
+
+ PORT_MODIFY("DSW2")
+ PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x01, DEF_STR( 1C_5C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+ PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_CONDITION("DSW5",0x01,EQUALS,0x01)
+
+ PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00) // different alternate coinage
+ PORT_DIPSETTING( 0x01, DEF_STR( 2C_2C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+ PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) PORT_CONDITION("DSW5",0x01,EQUALS,0x00)
+INPUT_PORTS_END
static INPUT_PORTS_START( akamaru )
PORT_START("P1")
@@ -8583,7 +8426,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( sryudens )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -8695,7 +8538,7 @@ static INPUT_PORTS_START( sryudens )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -8709,9 +8552,9 @@ static INPUT_PORTS_START( sryudens )
PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" )
PORT_DIPNAME( 0x0c, 0x0c, "Min Rate To Play" )
PORT_DIPSETTING( 0x0c, "1" )
-// PORT_DIPSETTING( 0x08, "2" ) // ? these don't let you start a game
-// PORT_DIPSETTING( 0x04, "3" )
-// PORT_DIPSETTING( 0x00, "5" )
+ PORT_DIPSETTING( 0x08, "2" )
+ PORT_DIPSETTING( 0x04, "3" )
+ PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x30, 0x30, "Payout" )
PORT_DIPSETTING( 0x30, "300" )
PORT_DIPSETTING( 0x20, "500" )
@@ -8816,7 +8659,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( seljan2 )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -8928,7 +8771,7 @@ static INPUT_PORTS_START( seljan2 )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0x40, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0x40, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -9049,7 +8892,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( janshinp )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -9161,7 +9004,7 @@ static INPUT_PORTS_START( janshinp )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0x40, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0x40, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -9281,7 +9124,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( dtoyoken )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE(0x04, IP_ACTIVE_LOW)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -9393,7 +9236,7 @@ static INPUT_PORTS_START( dtoyoken )
PORT_DIPSETTING( 0x00, "1 2 3 5 8 15 30 50" )
PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
- PORT_DIPNAME( 0xc0, 0x40, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0x40, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -9514,7 +9357,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( daimyojn )
PORT_START("SYSTEM")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE3 ) // medal out
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CODE(KEYCODE_4) // pay
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) PORT_TOGGLE
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 ) // analyzer
@@ -9627,7 +9470,7 @@ static INPUT_PORTS_START( daimyojn )
// PORT_DIPSETTING( 0x10, "1 2 3 5 10 25 50 100" )
// PORT_DIPSETTING( 0x20, "2 3 6 8 12 15 30 50" )
// PORT_DIPSETTING( 0x30, "2 3 6 8 12 15 30 50" )
- PORT_DIPNAME( 0xc0, 0xc0, "Max Bet" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Max Rate" )
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "5" )
PORT_DIPSETTING( 0x40, "10" )
@@ -10556,6 +10399,9 @@ static MACHINE_CONFIG_DERIVED( mjmyornt, quizchq )
MCFG_CPU_IO_MAP(mjmyster_portmap)
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddenlovr_state, mjmyster_irq, "screen", 0, 1)
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_VISIBLE_AREA(0, 336-1, 4, 256-16+4-1)
+
MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,mjmyster)
MCFG_DEVICE_MODIFY("rtc")
@@ -12287,7 +12133,7 @@ ROM_END
/***************************************************************************
Mahjong The Mysterious Orient
-Dynax, 1994
+Dynax, 1992
PCB Layout
----------
@@ -12345,6 +12191,32 @@ ROM_START( mjmyornt )
ROM_LOAD( "7101.1e", 0x00000, 0x20000, CRC(09b7a9b2) SHA1(64d9ccbb726bb6c5b362afc92bca2e3db87fd454) )
ROM_END
+/***************************************************************************
+
+Mahjong The Mysterious Orient Part 2
+Dynax, 1993
+
+Same PCB as Mysterious Orient / Mysterious Universe (D7107058L1-1).
+ROM labels are blank, so their file names are just the location.
+
+***************************************************************************/
+
+ROM_START( mjmyorn2 )
+ ROM_REGION( 0x90000 + 0x1000*8, "maincpu", 0 ) /* Z80 Code + space for banked RAM */
+ ROM_LOAD( "3d", 0x00000, 0x40000, CRC(7ef07c1e) SHA1(3fabd429c71224ddfaa4552e54f1d763e7e40c18) )
+ ROM_RELOAD( 0x10000, 0x40000 )
+
+ ROM_REGION( 0x1c0000, "blitter", 0 ) /* blitter data */
+ ROM_LOAD( "12b", 0x000000, 0x80000, CRC(1debae36) SHA1(670fa1203b9f127f9ce3150a4a0cae730cbc426f) )
+ ROM_LOAD( "11b", 0x080000, 0x80000, CRC(fe9953f7) SHA1(db7bef218f830f7a0e7d68ee6ff363f9b5c2966c) )
+ ROM_LOAD( "10b", 0x100000, 0x80000, CRC(6d0fd29a) SHA1(9b31668acf1790d9aecd1f8e8c0cb52a7a625d2d) )
+ ROM_LOAD( "9b", 0x180000, 0x40000, CRC(36228e6a) SHA1(f6153d6fc1c53d1ffa54820b2803967c50a148dd) )
+
+ ROM_REGION( 0x40000, "oki", 0 ) /* Samples */
+ ROM_LOAD( "1e", 0x00000, 0x20000, CRC(09b7a9b2) SHA1(64d9ccbb726bb6c5b362afc92bca2e3db87fd454) )
+ ROM_RELOAD( 0x20000, 0x20000 )
+ROM_END
+
/***************************************************************************
@@ -13152,18 +13024,19 @@ ROM_END
GAME( 1992, htengoku, 0, htengoku, htengoku, driver_device, 0, ROT180, "Dynax", "Hanafuda Hana Tengoku (Japan)", 0)
GAME( 1992, mmpanic, 0, mmpanic, mmpanic, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "Monkey Mole Panic (USA)", MACHINE_NO_COCKTAIL )
-GAME( 1993, funkyfig, 0, funkyfig, funkyfig, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "The First Funky Fighter (set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) // scrolling, priority?
-GAME( 1993, funkyfiga, funkyfig, funkyfig, funkyfig, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "The First Funky Fighter (set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1993, mjmyorn2, 0, mjmyornt, mjmyorn2, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious Orient Part 2 - Exotic Dream", MACHINE_NO_COCKTAIL )
+GAME( 1992, mjmyornt, mjmyorn2, mjmyornt, mjmyornt, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious Orient", MACHINE_NO_COCKTAIL )
+GAME( 1993, funkyfig, 0, funkyfig, funkyfig, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "The First Funky Fighter (North America, set 1)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) // scrolling, priority?
+GAME( 1993, funkyfiga, funkyfig, funkyfig, funkyfig, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "The First Funky Fighter (North America, set 2)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, quizchq, 0, quizchq, quizchq, driver_device, 0, ROT0, "Nakanihon", "Quiz Channel Question (Ver 1.00) (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
GAME( 1993, quizchql, quizchq, quizchq, quizchq, driver_device, 0, ROT0, "Nakanihon (Laxan license)", "Quiz Channel Question (Ver 1.23) (Taiwan?)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
GAME( 1993, animaljr, 0, mmpanic, animaljr, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "Exciting Animal Land Jr. (USA)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND )
GAME( 1993, animaljrs, animaljr, mmpanic, animaljr, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "Animalandia Jr. (Spanish)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND )
GAME( 1993, animaljrj, animaljr, mmpanic, animaljr, driver_device, 0, ROT0, "Nakanihon / East Technology (Taito license)", "Waiwai Animal Land Jr. (Japan)", MACHINE_NO_COCKTAIL )
-GAME( 1994, hginga, 0, hginga, hginga, driver_device, 0, ROT0, "Dynax", "Hanafuda Hana Ginga", MACHINE_NO_COCKTAIL )
GAME( 1994, mjmyster, 0, mjmyster, mjmyster, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious World (set 1)", MACHINE_NO_COCKTAIL )
GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious World (set 2)", MACHINE_NO_COCKTAIL )
-GAME( 1994, mjmyornt, 0, mjmyornt, mjmyornt, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious Orient", MACHINE_NO_COCKTAIL )
-GAME( 1994, mjmyuniv, 0, mjmyuniv, mjmyster, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious Universe", MACHINE_NO_COCKTAIL )
+GAME( 1994, hginga, 0, hginga, hginga, driver_device, 0, ROT0, "Dynax", "Hanafuda Hana Ginga", MACHINE_NO_COCKTAIL )
+GAME( 1994, mjmyuniv, 0, mjmyuniv, mjmyster, driver_device, 0, ROT0, "Dynax", "Mahjong The Mysterious Universe (Japan, D85)", MACHINE_NO_COCKTAIL )
GAME( 1994, quiz365, 0, quiz365, quiz365, driver_device, 0, ROT0, "Nakanihon", "Quiz 365 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION )
GAME( 1994, quiz365t, quiz365, quiz365, quiz365, driver_device, 0, ROT0, "Nakanihon / Taito", "Quiz 365 (Hong Kong & Taiwan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION )
GAME( 1994, rongrong, 0, rongrong, rongrong, ddenlovr_state,rongrong, ROT0, "Nakanihon (Activision license)", "Puzzle Game Rong Rong (Europe)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_COLORS )
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index a069152efc8..1413f0c501a 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -223,6 +223,97 @@ Notes:
PROM.9J Fujitsu MB7124 compatible with 82S147 Labelled 'LN-00'
+
+
+Fighter's History
+Data East, 1993
+
+PCB Layout
+----------
+
+DE-0395-1 DEC-22VO
+|-----------------------------------------------------|
+| TA8205AH 6164 MBF-05 2M-8M*|
+| LE02 HuC6280A MBF-04 8M*|
+| YM2151 52* MBF-03 4M-16M*|
+| YM3012 32.220MHz MBF-02 16M*|
+| JP1 MBF-07 93C45 4M-16M*|
+|CN2 MBF-06 16M*|
+| M6295(1) 52* |
+| M6295(2) |
+| |-----| |-----| |
+|J | 75 | 113/153* | 52 | |
+|A | | |-----| | | |
+|M |-----| | 113 | |-----| |
+|M | | 28MHz |
+|A |-----| |
+| PAL* |
+| 99* KT-00 |-----| 6164 MBF-01 |
+| | 74 | 6164 |
+| | | MBF-00 |
+| |-----| |-----| |-----| |
+| | 113 | | 200 | |-----| 6164 |
+| | | | | | 56 | 6164 |
+| |-----| |-----| | | VE-01A |
+|TEST_SW |-----| VE-00 |-----| |
+| | 156 | |
+| CN4 LH52250 LH52250 LE01 | | |
+| CN3* LH52250 LH52250 LE00 |-----| |
+|-----------------------------------------------------|
+
+Very similar to the DE-0396-0 described below with the notable exceptions:
+ The sound area reworked to use the HuC6280A instead of a standard Z80
+ Uses the larger 113 instead of the 153 chips, however both PCBs have
+ solder pads in the same locations for either chip.
+ Uses the 56 instead of the 141
+
+
+DE-0396-0 DEC-22VO
+|-----------------------------------------------------|
+| TA8205AH Z80 MBF-05 2M-8M*|
+| 6164 YM2151 MBF-04 8M*|
+| LJ02 52* MBF-03 4M-16M*|
+| YM3012 32.220MHz MBF-02 16M*|
+| JP1 MBF-07 93C45 4M-16M*|
+|CN2 MBF-06 16M*|
+| M6295(1) 52* |
+| M6295(2) |
+| |-----| |-----| |
+|J | 75 | 113/153* | 52 | |
+|A | | |-----| | | |
+|M |-----| | 153 | |-----| |
+|M | | 28MHz |
+|A |-----| |
+| PAL* |
+| 99* KT-00 |-----| 6164 MBF-01 |
+| | 74 | 6164 |
+| | | MBF-00 |
+| |-----| |-----| |-----| |
+| | 153 | | 200 | |-----| 6164 |
+| | | | | | 141 | 6164 |
+| |-----| |-----| | | VE-01A |
+|TEST_SW |-----| VE-00 |-----| |
+| | 156 | |
+| CN4 LH52250 LH52250 LJ01-3 | | |
+| CN3* LH52250 LH52250 LJ00-3 |-----| |
+|-----------------------------------------------------|
+
+This PCB is very close to the DE-397-0 listed above
+
+ Custom ICs-
+ DE # Package Type Additional #'s (for reference of scratched-off chips on other PCB's)
+ ------------------------------------------------------------------------------------------------------
+ 156 (CPU) 100 Pin PQFP 9321EV 301811 (Doesn't use encryption functions of the 156)
+ 141 160 Pin PQFP 24220F008
+ 74 160 Pin PQFP 24220F009
+ 52 128 Pin PQFP 9313EV 211771 VC5259-0001
+ 153 (x2) 144 Pin PQFP L7A0888 9312
+ 75 100 Pin PQFP L7A0680 9143
+ 200 100 Pin PQFP JAPAN 9315PP002 (chip is darker black)
+
+NOTE: There are several unpopulated locations (denoted by *) for additional rom chips
+ or more custom ICs.
+
***************************************************************************/
#include "emu.h"
@@ -355,8 +446,10 @@ WRITE32_MEMBER(deco32_state::fghthist_eeprom_w)
}
}
+
/**********************************************************************************/
+
READ32_MEMBER(dragngun_state::service_r)
{
// logerror("%08x:Read service\n",space.device().safe_pc());
@@ -372,7 +465,6 @@ READ32_MEMBER(dragngun_state::lockload_gun_mirror_r)
return ioport("IN3")->read() | ioport("LIGHT0_X")->read() | (ioport("LIGHT0_X")->read()<<16) | (ioport("LIGHT0_X")->read()<<24); //((machine().rand()%0xff)<<16);
}
-
READ32_MEMBER(dragngun_state::lightgun_r)
{
/* Ports 0-3 are read, but seem unused */
@@ -409,8 +501,8 @@ WRITE32_MEMBER(dragngun_state::eeprom_w)
logerror("%s:Write control 1 %08x %08x\n",machine().describe_context(),offset,data);
}
-/**********************************************************************************/
+/**********************************************************************************/
WRITE32_MEMBER(deco32_state::tattass_control_w)
@@ -543,14 +635,15 @@ WRITE32_MEMBER(deco32_state::tattass_control_w)
//logerror("%08x: %08x data\n",data,mem_mask);
}
+
/**********************************************************************************/
+
UINT16 deco32_state::port_b_nslasher(int unused)
{
return (m_eeprom->do_read());
}
-
void deco32_state::nslasher_sound_cb( address_space &space, UINT16 data, UINT16 mem_mask )
{
/* bit 1 of nslasher_sound_irq specifies IRQ command writes */
@@ -572,9 +665,6 @@ void deco32_state::tattass_sound_cb( address_space &space, UINT16 data, UINT16 m
m_decobsmt->bsmt_comms_w(space, 0, soundcommand);
}
-
-
-
WRITE32_MEMBER(deco32_state::nslasher_eeprom_w)
{
if (ACCESSING_BITS_0_7)
@@ -588,10 +678,9 @@ WRITE32_MEMBER(deco32_state::nslasher_eeprom_w)
}
-
-
/**********************************************************************************/
+
READ32_MEMBER(deco32_state::spriteram_r)
{
return m_spriteram16[offset] ^ 0xffff0000;
@@ -767,7 +856,6 @@ static ADDRESS_MAP_START( fghthsta_memmap, AS_PROGRAM, 32, deco32_state )
AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w)
AM_RANGE(0x200000, 0x207fff) AM_READWRITE(fghthist_protection_region_0_146_r, fghthist_protection_region_0_146_w) AM_SHARE("prot32ram") // only maps on 16-bits
-
ADDRESS_MAP_END
@@ -1014,7 +1102,6 @@ static ADDRESS_MAP_START( nslasher_map, AS_PROGRAM, 32, deco32_state )
AM_RANGE(0x200000, 0x207fff) AM_READWRITE16(nslasher_protection_region_0_104_r, nslasher_protection_region_0_104_w, 0xffff0000)
AM_RANGE(0x200000, 0x207fff) AM_READ16(nslasher_debug_r, 0x0000ffff) // seems to be debug switches / code activated by this?
-
ADDRESS_MAP_END
/******************************************************************************/
@@ -1949,6 +2036,31 @@ static MACHINE_CONFIG_START( fghthsta, deco32_state ) /* DE-0395-1 PCB */
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.35)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( fghthistz, fghthsta )
+ MCFG_DEVICE_REMOVE("audiocpu")
+
+ MCFG_CPU_ADD("audiocpu", Z80, 32220000/9)
+ MCFG_CPU_PROGRAM_MAP(nslasher_sound)
+ MCFG_CPU_IO_MAP(nslasher_io_sound)
+
+ MCFG_SOUND_MODIFY("ymsnd")
+ //MCFG_YM2151_IRQ_HANDLER(WRITELINE(deco32_state,sound_irq_nslasher))
+ MCFG_YM2151_IRQ_HANDLER(INPUTLINE("audiocpu",0))
+
+ MCFG_YM2151_PORT_WRITE_HANDLER(WRITE8(deco32_state,sound_bankswitch_w))
+ MCFG_SOUND_ROUTE(0, "lspeaker", 0.40)
+ MCFG_SOUND_ROUTE(1, "rspeaker", 0.40)
+ /*
+ MCFG_DEVICE_REMOVE("ioprot")
+ MCFG_DECO146_ADD("ioprot")
+ MCFG_DECO146_SET_PORTA_CALLBACK( deco32_state, port_a_fghthist )
+ MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_fghthist )
+ MCFG_DECO146_SET_PORTC_CALLBACK( deco32_state, port_c_fghthist )
+ MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
+ MCFG_DECO146_SET_USE_MAGIC_ADDRESS_XOR
+ MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, nslasher_sound_cb)
+ */
+MACHINE_CONFIG_END
DECO16IC_BANK_CB_MEMBER(dragngun_state::bank_1_callback)
{
@@ -2324,7 +2436,6 @@ static MACHINE_CONFIG_START( nslasher, deco32_state )
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, nslasher_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -2356,9 +2467,9 @@ static MACHINE_CONFIG_DERIVED( nslasheru, nslasher )
MCFG_DECO146_SET_PORTB_CALLBACK( deco32_state, port_b_nslasher )
MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb)
MCFG_DECO146_SET_INTERFACE_SCRAMBLE_INTERLEAVE
-
MACHINE_CONFIG_END
+
/**********************************************************************************/
ROM_START( captaven )
@@ -2883,8 +2994,8 @@ ROM_END
ROM_START( fghthist ) /* DE-0380-2 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
- ROM_LOAD32_WORD( "kx00-unknown.1f", 0x000000, 0x80000, CRC(fe5eaba1) SHA1(c8a3784af487a1bbd2150abf4b1c8f3ad33da8a4) ) /* Version 43-07, Overseas */
- ROM_LOAD32_WORD( "kx01-unknown.2f", 0x000002, 0x80000, CRC(3fb8d738) SHA1(2fca7a3ea483f01c97fb28a0adfa6d7980d8236c) )
+ ROM_LOAD32_WORD( "kx00-3.1f", 0x000000, 0x80000, CRC(fe5eaba1) SHA1(c8a3784af487a1bbd2150abf4b1c8f3ad33da8a4) ) /* Version 43-07, Overseas */
+ ROM_LOAD32_WORD( "kx01-3.2f", 0x000002, 0x80000, CRC(3fb8d738) SHA1(2fca7a3ea483f01c97fb28a0adfa6d7980d8236c) )
ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
ROM_LOAD( "kx02.18k", 0x00000, 0x10000, CRC(5fd2309c) SHA1(2fb7af54d5cd9bf7dd6fb4f6b82aa52b03294f1f) )
@@ -2949,7 +3060,41 @@ ROM_START( fghthista ) /* DE-0380-2 PCB */
ROM_LOAD( "ve-01.4d", 0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
ROM_END
-ROM_START( fghthistu ) /* DE-0395-1 PCB */
+ROM_START( fghthistu ) /* DE-0396-0 PCB */
+ ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
+ ROM_LOAD32_WORD( "lj00-3.1f", 0x000000, 0x80000, CRC(17543d60) SHA1(ff206e8552587b41d075b3c99f9ad733f1c2b5e0) ) /* Version 42-09, US */
+ ROM_LOAD32_WORD( "lj01-3.2f", 0x000002, 0x80000, CRC(e255d48f) SHA1(30444832cfed7eeb6082010eb219362adbafb826) )
+
+ ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
+ ROM_LOAD( "lj02-.17k", 0x00000, 0x10000, CRC(146a1063) SHA1(d16734c2443bf38add54040b9dd2628ba523638d) )
+
+ ROM_REGION( 0x100000, "gfx1", 0 )
+ ROM_LOAD( "mbf00-8.8a", 0x000000, 0x100000, CRC(d3e9b580) SHA1(fc4676e0ecc6c32441ff66fa1f990cc3158237db) ) /* Encrypted tiles */
+
+ ROM_REGION( 0x100000, "gfx2", 0 )
+ ROM_LOAD( "mbf01-8.9a", 0x000000, 0x100000, CRC(0c6ed2eb) SHA1(8e37ef4b1f0b6d3370a08758bfd602cb5f221282) ) /* Encrypted tiles */
+
+ ROM_REGION( 0x800000, "gfx3", 0 ) /* Sprites */
+ ROM_LOAD16_BYTE( "mbf02-16.16d", 0x000001, 0x200000, CRC(c19c5953) SHA1(e6ed26f932c6c86bbd1fc4c000aa2f510c268009) )
+ ROM_LOAD16_BYTE( "mbf04-16.18d", 0x000000, 0x200000, CRC(f6a23fd7) SHA1(74e5559f17cd591aa25d2ed6c34ac9ed89e2e9ba) )
+ ROM_LOAD16_BYTE( "mbf03-16.17d", 0x400001, 0x200000, CRC(37d25c75) SHA1(8219d31091b4317190618edd8acc49f97cba6a1e) )
+ ROM_LOAD16_BYTE( "mbf05-16.19d", 0x400000, 0x200000, CRC(137be66d) SHA1(3fde345183ce04a7a65b4cedfd050d771df7d026) )
+
+ ROM_REGION(0x80000, "oki1", 0 )
+ ROM_LOAD( "mbf06.15k", 0x000000, 0x80000, CRC(fb513903) SHA1(7727a49ff7977f159ed36d097020edef3b5b36ba) )
+
+ ROM_REGION(0x80000, "oki2", 0 )
+ ROM_LOAD( "mbf07.16k", 0x000000, 0x80000, CRC(51d4adc7) SHA1(22106ed7a05db94adc5a783ce34529e29d24d41a) )
+
+ ROM_REGION(512, "proms", 0 )
+ ROM_LOAD( "kt-00.8j", 0, 512, CRC(7294354b) SHA1(14fe42ad5d26d022c0fe9a46a4a9017af2296f40) ) /* MB7124H type prom */
+
+ ROM_REGION( 0x0400, "plds", 0 )
+ ROM_LOAD( "ve-00.3d", 0x0000, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
+ ROM_LOAD( "ve-01.4d", 0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
+ROM_END
+
+ROM_START( fghthistua ) /* DE-0395-1 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
ROM_LOAD32_WORD( "le00-1.1f", 0x000000, 0x80000, CRC(fccacafb) SHA1(b7236a90a09dbd5870a16aa4e4eac5ab5c098418) ) /* Version 42-06, US */
ROM_LOAD32_WORD( "le01-1.2f", 0x000002, 0x80000, CRC(06a3c326) SHA1(3d8842fb69def93fc544e89fd0e56ada416157dc) )
@@ -2983,7 +3128,7 @@ ROM_START( fghthistu ) /* DE-0395-1 PCB */
ROM_LOAD( "ve-01a.4d", 0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
ROM_END
-ROM_START( fghthistua ) /* DE-0395-1 PCB */
+ROM_START( fghthistub ) /* DE-0395-1 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
ROM_LOAD32_WORD( "le00.1f", 0x000000, 0x80000, CRC(a5c410eb) SHA1(e2b0cb2351782e1155ecc4029010beb7326fd874) ) /* Version 42-05, US */
ROM_LOAD32_WORD( "le01.2f", 0x000002, 0x80000, CRC(7e148aa2) SHA1(b21e16604c4d29611f91d629deb9f041eaf41e9b) )
@@ -3017,7 +3162,7 @@ ROM_START( fghthistua ) /* DE-0395-1 PCB */
ROM_LOAD( "ve-01a.4d", 0x0200, 0x0104, NO_DUMP ) /* PAL16L8 is read protected */
ROM_END
-ROM_START( fghthistub ) /* DE-0380-2 PCB */
+ROM_START( fghthistuc ) /* DE-0380-2 PCB */
ROM_REGION(0x100000, "maincpu", 0 ) /* ARM 32 bit code */
ROM_LOAD32_WORD( "kz00-1.1f", 0x000000, 0x80000, CRC(3a3dd15c) SHA1(689b51adf73402b12191a75061b8e709468c91bc) ) /* Version 42-03, US */
ROM_LOAD32_WORD( "kz01-1.2f", 0x000002, 0x80000, CRC(86796cd6) SHA1(c397c07d7a1d03ba96ccb2fe7a0ad25b8331e945) )
@@ -3741,7 +3886,6 @@ DRIVER_INIT_MEMBER(dragngun_state,dragngunj)
ROM[0x1a1b4/4]=0xe1a00000; // bl $ee000: NOP test switch lock
}
-
DRIVER_INIT_MEMBER(deco32_state,fghthist)
{
deco56_decrypt_gfx(machine(), "gfx1");
@@ -3834,13 +3978,18 @@ GAME( 1991, captavenuu, captaven, captaven, captaven, deco32_state, captaven,
GAME( 1991, captavenua, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (US Rev 1.4)", MACHINE_SUPPORTS_SAVE )
GAME( 1991, captavenj, captaven, captaven, captaven, deco32_state, captaven, ROT0, "Data East Corporation", "Captain America and The Avengers (Japan Rev 0.2)", MACHINE_SUPPORTS_SAVE )
+// DE-0396-0 PCB sets (uses a Z80)
+GAME( 1993, fghthistu, fghthist, fghthistz,fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-09, DE-0396-0 PCB)", MACHINE_SUPPORTS_SAVE )
+// DE-0395-1 PCB sets
+GAME( 1993, fghthistua, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-06, DE-0395-1 PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, fghthistub, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, DE-0395-1 PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, fghthistj, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-07, DE-0395-1 PCB)", MACHINE_SUPPORTS_SAVE )
+// DE-0380-2 PCB sets
GAME( 1993, fghthist, 0, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-07, DE-0380-2 PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, fghthista, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (World ver 43-05, DE-0380-2 PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, fghthistu, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-06, DE-0395-1 PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, fghthistua, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-05, DE-0395-1 PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, fghthistub, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03, DE-0380-2 PCB)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, fghthistj, fghthist, fghthsta, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-07, DE-0395-1 PCB)", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, fghthistuc, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (US ver 42-03, DE-0380-2 PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1993, fghthistja, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-05, DE-0380-2 PCB)", MACHINE_SUPPORTS_SAVE )
+// DE-0380-1 PCB sets
GAME( 1993, fghthistjb, fghthist, fghthist, fghthist, deco32_state, fghthist, ROT0, "Data East Corporation", "Fighter's History (Japan ver 41-04, DE-0380-1 PCB)", MACHINE_SUPPORTS_SAVE )
GAME( 1994, nslasher, 0, nslasher, nslasher, deco32_state, nslasher, ROT0, "Data East Corporation", "Night Slashers (Korea Rev 1.3)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/faceoffh.c b/src/mame/drivers/faceoffh.c
new file mode 100644
index 00000000000..9fca167e1c8
--- /dev/null
+++ b/src/mame/drivers/faceoffh.c
@@ -0,0 +1,375 @@
+// license:BSD-3-Clause
+// copyright-holders:Luca Elia
+/***************************************************************************
+
+Sound board for an unknown game. Most probably a bubble hockey EM game
+titled "Face-Off", an illegal? copy of Chexx Hockey by ICE. See here:
+
+http://valker.us/gameroom/SegaFaceOff.htm
+https://casetext.com/case/innovative-concepts-in-ent-v-entertainment-enter
+http://www.pinrepair.com/arcade/chexx.htm
+
+"Copyright (c) 1983 SoftLogic JAPAN" in the program rom.
+
+The same PCB, with serial 025707, is allegedly for "Vampire" (prototype).
+
+PCB:
+
+Entertainment Enterprises Ltd. 1983 (sticker)
+Serial No. 025402 (sticker)
+MADE IN JAPAN (etched)
+
+CPU: R6502P
+RAM: M58725P (2KB)
+I/O: R6522P (VIA)
+Speech: Digitalker
+Sound: AY-3-8910
+Misc: XTAL 4MHz, DSW4, 42-pin connector
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "sound/ay8910.h"
+#include "sound/digitalk.h"
+#include "machine/6522via.h"
+
+#define MAIN_CLOCK XTAL_4MHz
+
+class faceoffh_state : public driver_device
+{
+public:
+ faceoffh_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_audiocpu(*this, "audiocpu"),
+ m_digitalker(*this, "digitalker"),
+ m_aysnd(*this, "aysnd")
+ {
+ }
+
+ // devices
+ required_device<cpu_device> m_audiocpu;
+ required_device<digitalker_device> m_digitalker;
+ required_device<ay8910_device> m_aysnd;
+
+ // vars
+ UINT8 m_ay_cmd, m_ay_data;
+ UINT8 m_port_a, m_port_b;
+ UINT8 m_coin;
+ UINT8 m_bank;
+ UINT32 m_shift;
+
+ // screen updates
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ // handlers
+ DECLARE_READ8_MEMBER(via_a_in);
+ DECLARE_READ8_MEMBER(via_b_in);
+
+ DECLARE_WRITE8_MEMBER(via_a_out);
+ DECLARE_WRITE8_MEMBER(via_b_out);
+
+ DECLARE_WRITE_LINE_MEMBER(via_ca2_out);
+ DECLARE_WRITE_LINE_MEMBER(via_cb1_out);
+ DECLARE_WRITE_LINE_MEMBER(via_cb2_out);
+ DECLARE_WRITE_LINE_MEMBER(via_irq_out);
+
+ DECLARE_WRITE8_MEMBER(faceoffh_ay_w);
+ DECLARE_READ8_MEMBER(faceoffh_coin_r);
+ DECLARE_WRITE8_MEMBER(faceoffh_coin_w);
+
+ // digitalker
+ void digitalker_set_bank(UINT8 bank);
+
+ // driver_device overrides
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+};
+
+
+// VIA
+
+READ8_MEMBER(faceoffh_state::via_a_in)
+{
+ UINT8 ret = 0;
+ logerror("%s: VIA read A: %02X\n", machine().describe_context(), ret);
+ return ret;
+}
+READ8_MEMBER(faceoffh_state::via_b_in)
+{
+ UINT8 ret = 0;
+ logerror("%s: VIA read B: %02X\n", machine().describe_context(), ret);
+ return ret;
+}
+
+WRITE8_MEMBER(faceoffh_state::via_a_out)
+{
+ m_port_a = data; // multiplexer
+// logerror("%s: VIA write A = %02X\n", machine().describe_context(), data);
+}
+WRITE8_MEMBER(faceoffh_state::via_b_out)
+{
+ m_port_b = data;
+// logerror("%s: VIA write B = %02X\n", machine().describe_context(), data);
+}
+
+WRITE_LINE_MEMBER(faceoffh_state::via_ca2_out)
+{
+// logerror("%s: VIA write CA2 = %02X\n", machine().describe_context(), state);
+}
+WRITE_LINE_MEMBER(faceoffh_state::via_cb1_out)
+{
+// logerror("%s: VIA write CB1 = %02X\n", machine().describe_context(), state);
+}
+WRITE_LINE_MEMBER(faceoffh_state::via_cb2_out)
+{
+ m_shift = ((m_shift << 1) & 0xffffff) | state;
+// logerror("%s: VIA write CB2 = %02X\n", machine().describe_context(), state);
+}
+WRITE_LINE_MEMBER(faceoffh_state::via_irq_out)
+{
+ m_audiocpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
+// logerror("%s: VIA write IRQ = %02X\n", machine().describe_context(), state);
+}
+
+// Video
+
+void faceoffh_state::video_start()
+{
+}
+
+UINT32 faceoffh_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
+{
+ // NMI on coin-in?
+ UINT8 coin = (~ioport("INPUTS")->read()) & 0x03;
+ m_audiocpu->set_input_line(INPUT_LINE_NMI, coin ? ASSERT_LINE : CLEAR_LINE);
+
+ // Play the digitalker samples (it's not hooked up yet)
+ static UINT8 sample = 0, bank = 0;
+
+ if (screen.machine().input().code_pressed_once(KEYCODE_Q))
+ --bank;
+ if (screen.machine().input().code_pressed_once(KEYCODE_W))
+ ++bank;
+ bank %= 3;
+ digitalker_set_bank(bank);
+
+ if (screen.machine().input().code_pressed_once(KEYCODE_A))
+ --sample;
+ if (screen.machine().input().code_pressed_once(KEYCODE_S))
+ ++sample;
+
+ if (screen.machine().input().code_pressed_once(KEYCODE_Z))
+ {
+ m_digitalker->digitalker_0_cms_w(CLEAR_LINE);
+ m_digitalker->digitalker_0_cs_w(CLEAR_LINE);
+
+ address_space &space = m_audiocpu->space(AS_PROGRAM);
+ m_digitalker->digitalker_data_w(space, 0, sample, 0xff);
+
+ m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
+ m_digitalker->digitalker_0_wr_w(CLEAR_LINE);
+ m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
+ }
+
+ popmessage("COIN: %02X VIAB: %02X\nCOUNT: %02X %02X LEDS: %02X\nSAMPLE: %02X (B%X)",
+ m_coin, m_port_b,
+ (m_shift >> 16) & 0xff, (m_shift >> 8) & 0xff, (m_shift >> 0) & 0xff, // 2 x 7-seg, 3 leds
+ sample, bank
+ );
+ return 0;
+}
+
+// Sound
+
+#if 0
+READ8_MEMBER(scramble_state::faceoffh_digitalker_intr_r)
+{
+ return m_digitalker->digitalker_0_intr_r();
+}
+
+WRITE8_MEMBER(scramble_state::faceoffh_digitalker_control_w)
+{
+ m_digitalker->digitalker_0_cs_w (data & 1 ? ASSERT_LINE : CLEAR_LINE);
+ m_digitalker->digitalker_0_cms_w(data & 2 ? ASSERT_LINE : CLEAR_LINE);
+ m_digitalker->digitalker_0_wr_w (data & 4 ? ASSERT_LINE : CLEAR_LINE);
+}
+#endif
+
+WRITE8_MEMBER(faceoffh_state::faceoffh_ay_w)
+{
+ if (offset)
+ {
+ m_ay_data = data;
+ return;
+ }
+
+ if (m_ay_cmd == 0x00 && data == 0x03)
+ {
+ m_aysnd->address_w(space, offset, m_ay_data, mem_mask);
+// logerror("%s: AY addr = %02X\n", machine().describe_context(), m_ay_data);
+ }
+ else if (m_ay_cmd == 0x00 && data == 0x02)
+ {
+ m_aysnd->data_w(space, offset, m_ay_data, mem_mask);
+// logerror("%s: AY data = %02X\n", machine().describe_context(), m_ay_data);
+ }
+ m_ay_cmd = data;
+}
+
+// Memory Map
+
+READ8_MEMBER(faceoffh_state::faceoffh_coin_r)
+{
+ UINT8 ret = ioport("DSW")->read(); // bits 0-3
+ UINT8 inp = ioport("INPUTS")->read(); // bit 7 (multiplexed)
+
+ for (int i = 0; i < 8; ++i)
+ if ( ((~m_port_a) & (1 << i)) && ((~inp) & (1 << i)) )
+ ret &= 0x7f;
+
+ return ret;
+}
+
+WRITE8_MEMBER(faceoffh_state::faceoffh_coin_w)
+{
+ m_coin = data;
+// coin_counter_w(machine(), 0, data & 0x01);
+// coin_counter_w(machine(), 1, data & 0x02);
+ coin_lockout_w(machine(), 0, data & 0x01);
+ coin_lockout_w(machine(), 1, data & 0x02);
+}
+
+//M58725P - 2KB
+static ADDRESS_MAP_START( faceoffh_map, AS_PROGRAM, 8, faceoffh_state )
+ AM_RANGE(0x0000, 0x00ff) AM_RAM
+ AM_RANGE(0x0100, 0x01ff) AM_RAM
+
+ AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE("via6522", via6522_device, read, write)
+
+ AM_RANGE(0x8000, 0x8000) AM_READ(faceoffh_coin_r)
+
+ AM_RANGE(0xa000, 0xa001) AM_WRITE(faceoffh_ay_w)
+
+ AM_RANGE(0xc000, 0xc000) AM_WRITE(faceoffh_coin_w)
+
+ AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("audiocpu", 0)
+ADDRESS_MAP_END
+
+// Inputs
+
+static INPUT_PORTS_START( faceoffh )
+ PORT_START("INPUTS")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(1) // coin 1 (start music)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(1) // coin 2 (start music)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) // ?
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) // (stop music)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) // (stop music)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) // ?
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 )
+
+ PORT_START("DSW")
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1,2")
+ PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) )
+ PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
+ PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
+ PORT_DIPNAME( 0x0c, 0x00, "Game Duration (mins)" ) PORT_DIPLOCATION("SW1:3,4")
+ PORT_DIPSETTING( 0x00, "2" ) // 40
+ PORT_DIPSETTING( 0x04, "3" ) // 60
+ PORT_DIPSETTING( 0x08, "4" ) // 80
+ PORT_DIPSETTING( 0x0c, "5" ) // 100
+ PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) // multiplexed inputs
+INPUT_PORTS_END
+
+// Machine
+
+void faceoffh_state::machine_start()
+{
+}
+
+void faceoffh_state::digitalker_set_bank(UINT8 bank)
+{
+ if (m_bank != bank)
+ {
+ UINT8 *src = memregion("samples")->base();
+ UINT8 *dst = memregion("digitalker")->base();
+
+ memcpy(dst, src + bank * 0x4000, 0x4000);
+
+ m_bank = bank;
+ }
+}
+
+void faceoffh_state::machine_reset()
+{
+ m_bank = -1;
+ digitalker_set_bank(0);
+}
+
+static MACHINE_CONFIG_START( faceoffh, faceoffh_state )
+
+ // basic machine hardware
+ MCFG_CPU_ADD("audiocpu", M6502, MAIN_CLOCK/2)
+ MCFG_CPU_PROGRAM_MAP(faceoffh_map)
+// MCFG_CPU_VBLANK_INT_DRIVER("screen", faceoffh_state, irq0_line_hold)
+// MCFG_CPU_VBLANK_INT_DRIVER("screen", faceoffh_state, nmi_line_pulse)
+
+ // via
+ MCFG_DEVICE_ADD("via6522", VIA6522, MAIN_CLOCK/4)
+
+ MCFG_VIA6522_READPA_HANDLER(READ8(faceoffh_state,via_a_in))
+ MCFG_VIA6522_READPB_HANDLER(READ8(faceoffh_state,via_b_in))
+
+ MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(faceoffh_state, via_a_out))
+ MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(faceoffh_state, via_b_out))
+
+ MCFG_VIA6522_CA2_HANDLER(WRITELINE(faceoffh_state, via_ca2_out))
+ MCFG_VIA6522_CB1_HANDLER(WRITELINE(faceoffh_state, via_cb1_out))
+ MCFG_VIA6522_CB2_HANDLER(WRITELINE(faceoffh_state, via_cb2_out))
+ MCFG_VIA6522_IRQ_HANDLER(WRITELINE(faceoffh_state, via_irq_out)/*DEVWRITELINE("audiocpu", m6502_device, write_irq4)*/)
+
+ // video hardware
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_UPDATE_DRIVER(faceoffh_state, screen_update)
+ MCFG_SCREEN_SIZE(256, 256)
+ MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
+ MCFG_SCREEN_PALETTE("palette")
+
+ MCFG_PALETTE_ADD("palette", 16)
+
+ // sound hardware
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+ MCFG_SOUND_ADD("aysnd", AY8910, MAIN_CLOCK/2)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
+
+ MCFG_DIGITALKER_ADD("digitalker", MAIN_CLOCK)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
+MACHINE_CONFIG_END
+
+// ROMs
+
+ROM_START( faceoffh )
+ ROM_REGION( 0x1000, "audiocpu", 0 )
+ ROM_LOAD( "1.5d", 0x0000, 0x1000, CRC(6ab050be) SHA1(ebecae855e22e9c3c46bdee51f84fd5352bf191a) )
+
+ ROM_REGION( 0x4000, "digitalker", ROMREGION_ERASE00 )
+ // bank switched (from samples region)
+
+ ROM_REGION( 0xc000, "samples", 0 )
+ ROM_LOAD( "9.2a", 0x0000, 0x2000, CRC(059b3725) SHA1(5837bee1ef34ce19a3101b851ca55029776e4b3e) ) // digitalker header
+ ROM_LOAD( "8.2b", 0x2000, 0x2000, CRC(679da4e1) SHA1(01a5b9dd132c1b0de97c153d7de226f5bf357338) )
+
+ ROM_LOAD( "7.2c", 0x4000, 0x2000, CRC(f8461b33) SHA1(717a8842e0ce9ba94dd59504a324bede4844e389) ) // digitalker header
+ ROM_LOAD( "6.2d", 0x6000, 0x2000, CRC(156c91e0) SHA1(6017d4b5609b214a6e66dcd76493a7d1442c04d4) )
+
+ ROM_LOAD( "5.3a", 0x8000, 0x2000, CRC(19904604) SHA1(633c211a9a822cdf597a6f3c221ae9c8d6482e82) ) // digitalker header
+ ROM_LOAD( "4.3b", 0xa000, 0x2000, CRC(c3386d51) SHA1(7882e88db55ba914be81075e4b2d76e246c34d3b) )
+ROM_END
+
+GAME( 1983, faceoffh, 0, faceoffh, faceoffh, driver_device, 0, ROT270, "SoftLogic (Entertainment Enterprises, Ltd. license)", "Face-Off (EM Bubble Hockey)", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index 4c057bd62be..240ff494256 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -261,6 +261,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(sound_irq_callback);
DECLARE_WRITE_LINE_MEMBER(midi_uart_ch0_irq_callback);
DECLARE_WRITE_LINE_MEMBER(midi_uart_ch1_irq_callback);
+ DECLARE_WRITE_LINE_MEMBER(gcu0_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(gcu1_interrupt);
};
@@ -1229,6 +1231,16 @@ INTERRUPT_GEN_MEMBER(firebeat_state::firebeat_interrupt)
device.execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
}
+WRITE_LINE_MEMBER(firebeat_state::gcu0_interrupt)
+{
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, state);
+}
+
+WRITE_LINE_MEMBER(firebeat_state::gcu1_interrupt)
+{
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, state);
+}
+
MACHINE_RESET_MEMBER(firebeat_state,firebeat)
{
m_layer = 0;
@@ -1271,10 +1283,10 @@ static MACHINE_CONFIG_START( firebeat, firebeat_state )
MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
MCFG_DEVICE_ADD("gcu0", K057714, 0)
- MCFG_K057714_CPU_TAG("maincpu")
+ MCFG_K057714_IRQ_CALLBACK(WRITELINE(firebeat_state, gcu0_interrupt))
MCFG_DEVICE_ADD("gcu1", K057714, 0)
- MCFG_K057714_CPU_TAG("maincpu")
+ MCFG_K057714_IRQ_CALLBACK(WRITELINE(firebeat_state, gcu1_interrupt))
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
@@ -1331,10 +1343,10 @@ static MACHINE_CONFIG_START( firebeat2, firebeat_state )
MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette")
MCFG_DEVICE_ADD("gcu0", K057714, 0)
- MCFG_K057714_CPU_TAG("maincpu")
+ MCFG_K057714_IRQ_CALLBACK(WRITELINE(firebeat_state, gcu0_interrupt))
MCFG_DEVICE_ADD("gcu1", K057714, 0)
- MCFG_K057714_CPU_TAG("maincpu")
+ MCFG_K057714_IRQ_CALLBACK(WRITELINE(firebeat_state, gcu1_interrupt))
MCFG_SCREEN_ADD("lscreen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c
index 3e6db9f94be..f11ebe45a23 100644
--- a/src/mame/drivers/gaelco2.c
+++ b/src/mame/drivers/gaelco2.c
@@ -204,12 +204,12 @@ ROM_END
BANG
============================================================================*/
-READ16_MEMBER(gaelco2_state::p1_gun_x){return (ioport("LIGHT0_X")->read() * 320 / 0x100) + 1;}
-READ16_MEMBER(gaelco2_state::p1_gun_y){return (ioport("LIGHT0_Y")->read() * 240 / 0x100) - 4;}
-READ16_MEMBER(gaelco2_state::p2_gun_x){return (ioport("LIGHT1_X")->read() * 320 / 0x100) + 1;}
-READ16_MEMBER(gaelco2_state::p2_gun_y){return (ioport("LIGHT1_Y")->read() * 240 / 0x100) - 4;}
+READ16_MEMBER(bang_state::p1_gun_x){return (m_light0_x->read() * 320 / 0x100) + 1;}
+READ16_MEMBER(bang_state::p1_gun_y){return (m_light0_y->read() * 240 / 0x100) - 4;}
+READ16_MEMBER(bang_state::p2_gun_x){return (m_light1_x->read() * 320 / 0x100) + 1;}
+READ16_MEMBER(bang_state::p2_gun_y){return (m_light1_y->read() * 240 / 0x100) - 4;}
-static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16, gaelco2_state )
+static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16, bang_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_cg1v_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */
AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */
@@ -263,11 +263,11 @@ static INPUT_PORTS_START( bang )
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, -6.0 / 240, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2)
INPUT_PORTS_END
-static MACHINE_CONFIG_START( bang, gaelco2_state )
+static MACHINE_CONFIG_START( bang, bang_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 30000000/2) /* 15 MHz */
MCFG_CPU_PROGRAM_MAP(bang_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gaelco2_state, bang_irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bang_state, bang_irq, "screen", 0, 1)
MCFG_EEPROM_SERIAL_93C66_ADD("eeprom")
@@ -1060,7 +1060,7 @@ ROM_END
WORLD RALLY 2
============================================================================*/
-static ADDRESS_MAP_START( wrally2_map, AS_PROGRAM, 16, gaelco2_state )
+static ADDRESS_MAP_START( wrally2_map, AS_PROGRAM, 16, wrally2_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelco_gae1_device, gaelcosnd_r, gaelcosnd_w) /* Sound Registers */
AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_SHARE("spriteram") /* Video RAM */
@@ -1086,7 +1086,7 @@ static INPUT_PORTS_START( wrally2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Acc.")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Gear") PORT_TOGGLE
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco2_state,wrally2_analog_bit_r, (void *)0) /* ADC_1 serial input */
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, wrally2_state,wrally2_analog_bit_r, (void *)0) /* ADC_1 serial input */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_SERVICE_DIPLOC( 0x0100, IP_ACTIVE_LOW, "SW2:1" )
PORT_DIPNAME( 0x0200, 0x0000, "Coin mechanism" ) PORT_DIPLOCATION("SW2:2")
@@ -1144,7 +1144,7 @@ static INPUT_PORTS_START( wrally2 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Acc.")
PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Gear") PORT_TOGGLE
- PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, gaelco2_state,wrally2_analog_bit_r, (void *)1) /* ADC_2 serial input */
+ PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_SPECIAL) PORT_CUSTOM_MEMBER(DEVICE_SELF, wrally2_state,wrally2_analog_bit_r, (void *)1) /* ADC_2 serial input */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN2 )
@@ -1167,7 +1167,7 @@ static INPUT_PORTS_START( wrally2 )
PORT_BIT( 0xff, 0x8A, IPT_PADDLE_V ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_REVERSE PORT_NAME("P2 Wheel")
INPUT_PORTS_END
-static MACHINE_CONFIG_START( wrally2, gaelco2_state )
+static MACHINE_CONFIG_START( wrally2, wrally2_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 26000000/2) /* 13 MHz */
MCFG_CPU_PROGRAM_MAP(wrally2_map)
@@ -1415,7 +1415,7 @@ GAME( 1995, wrally2, 0, wrally2, wrally2, driver_device, 0, ROT
GAME( 1996, maniacsq, 0, maniacsq, maniacsq, driver_device, 0, ROT0, "Gaelco", "Maniac Square (unprotected)", 0 )
GAME( 1996, snowboar, 0, snowboar, snowboar, driver_device, 0, ROT0, "Gaelco", "Snow Board Championship (Version 2.1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING )
GAME( 1996, snowboara,snowboar, snowboar, snowboar, gaelco2_state, snowboar, ROT0, "Gaelco", "Snow Board Championship (Version 2.0)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING )
-GAME( 1998, bang, 0, bang, bang, gaelco2_state, bang, ROT0, "Gaelco", "Bang!", 0 )
-GAME( 1998, bangj, bang, bang, bang, gaelco2_state, bang, ROT0, "Gaelco", "Gun Gabacho (Japan)", 0 )
+GAME( 1998, bang, 0, bang, bang, bang_state, bang, ROT0, "Gaelco", "Bang!", 0 )
+GAME( 1998, bangj, bang, bang, bang, bang_state, bang, ROT0, "Gaelco", "Gun Gabacho (Japan)", 0 )
GAME( 1999, grtesoro, 0, maniacsq, maniacsq, driver_device, 0, ROT0, "Nova Desitec", "Gran Tesoro? / Play 2000 (v5.01) (Italy)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING )
GAME( 1999, grtesoro4, grtesoro,maniacsq, maniacsq, driver_device, 0, ROT0, "Nova Desitec", "Gran Tesoro? / Play 2000 (v4.0) (Italy)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING )
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index b74fe069cf9..da02df07eb6 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -677,7 +677,7 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback)
/* now put it down to samples, so we know what the channel frequency has to be */
sample_period *= 16 * SOUND_CHANNELS;
- dmadac_set_frequency(&m_dmadac[0], SOUND_CHANNELS, ATTOSECONDS_TO_HZ(sample_period.attoseconds));
+ dmadac_set_frequency(&m_dmadac[0], SOUND_CHANNELS, ATTOSECONDS_TO_HZ(sample_period.attoseconds()));
dmadac_enable(&m_dmadac[0], SOUND_CHANNELS, 1);
/* fire off a timer wich will hit every half-buffer */
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index e949f7befe6..b96605cc273 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -260,6 +260,7 @@ WRITE8_MEMBER(goldstar_state::p1_lamps_w)
x--- ----
all cm/cmaster use the same scheme
+ cmv4, cmv801 and crazybon don't light the Take button when it's available for hold pair
tonypok uses lamps to indicate current button functions rather than active buttons
skill98 is like schery97 but doesn't activate bit 0 for stop
nfb96, roypok96 and nc96 sets are like schery97 but they don't activate bit 2 for select
@@ -1221,7 +1222,7 @@ INPUT_PORTS_END
static INPUT_PORTS_START( cmv4_dsw1 )
PORT_START("DSW1")
- PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1")
+ PORT_DIPNAME( 0x01, 0x00, "Hold Pair" ) PORT_DIPLOCATION("DSW1:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" ) PORT_DIPLOCATION("DSW1:2")
@@ -1456,7 +1457,7 @@ static INPUT_PORTS_START( cmv801 )
PORT_INCLUDE( cmv4_dsw1 )
PORT_MODIFY("DSW1")
- /* DSW1-1 unused */
+ /* Hold Pair OK - use Take button */
/* Hopper Out Switch not checked */
/* Payout Mode not checked */
/* '7' In Double Up Game OK */
@@ -1491,11 +1492,14 @@ static INPUT_PORTS_START( cmv801 )
PORT_INCLUDE( cmv4_dsw4 ) /* Display Of Payout Limit not working; all others OK */
PORT_INCLUDE( cmv4_dsw5 )
+ PORT_MODIFY("DSW5")
/* Display of Doll On Demo only affects payout table screen */
/* Coin In Limit OK */
/* Condition For 3 Kind Of Bonus not checked */
/* Display Of Doll At All Fr. Bonus not checked */
- /* DSW5-7 listed as unused */
+ PORT_DIPNAME( 0x40, 0x40, "Card Shuffle Animation" ) PORT_DIPLOCATION("DSW5:7") /* OK */
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Test Mode For Disp. Of Doll not working */
INPUT_PORTS_END
@@ -1508,7 +1512,7 @@ static INPUT_PORTS_START( cmv4 )
PORT_INCLUDE( cmv4_dsw1 )
PORT_MODIFY("DSW1")
- /* DSW1-1 unused */
+ /* Hold Pair OK - use Take button */
/* Hopper Out Switch not checked */
/* Payout Mode not checked */
/* '7' In Double Up Game OK */
@@ -1564,7 +1568,9 @@ static INPUT_PORTS_START( cmaster )
PORT_INCLUDE( cmv4_dsw1 )
PORT_MODIFY("DSW1")
- /* DSW1-1 unused */
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1")
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Hopper Out Switch not checked */
/* Payout Mode not checked */
/* '7' In Double Up Game OK */
@@ -1620,7 +1626,9 @@ static INPUT_PORTS_START( cmasterb )
PORT_INCLUDE( cmv4_dsw1 )
PORT_MODIFY("DSW1")
- /* DSW1-1 unused */
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1")
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Hopper Out Switch not checked */
/* Payout Mode not checked */
/* '7' In Double Up Game OK */
@@ -1676,7 +1684,9 @@ static INPUT_PORTS_START( cmasterc )
PORT_INCLUDE( cmv4_dsw1 )
PORT_MODIFY("DSW1")
- /* DSW1-1 unused */
+ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW1:1")
+ PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* Hopper Out Switch not checked */
/* Payout Mode not checked */
/* '7' In Double Up Game OK */
@@ -6006,7 +6016,7 @@ static INPUT_PORTS_START( crazybon )
PORT_INCLUDE( cmv4_service )
PORT_START("DSW1")
- PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1")
+ PORT_DIPNAME( 0x01, 0x00, "Hold Pair" ) PORT_DIPLOCATION("DSW1:1") /* OK - use Take button */
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "Hopper Out Switch" ) PORT_DIPLOCATION("DSW1:2") /* not checked */
@@ -6096,9 +6106,9 @@ static INPUT_PORTS_START( crazybon )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5")
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x10, "Fast Take With" ) PORT_DIPLOCATION("DSW4:5") /* OK */
+ PORT_DIPSETTING( 0x10, "Take" )
+ PORT_DIPSETTING( 0x00, "Start" )
PORT_DIPNAME( 0x20, 0x20, "Bonus Min Bet" ) PORT_DIPLOCATION("DSW4:6") /* OK */
PORT_DIPSETTING( 0x20, "16" )
PORT_DIPSETTING( 0x00, "32" )
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index c4b87e6c794..94b4e5f2ed5 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -307,6 +307,7 @@ static MACHINE_CONFIG_START( gradius3, gradius3_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(gradius3_state, sprite_callback)
MCFG_K051960_PLANEORDER(K051960_PLANEORDER_GRADIUS3)
@@ -412,50 +413,50 @@ ROM_START( gradius3j )
ROM_END
ROM_START( gradius3js )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "945_s13.f15", 0x00000, 0x20000, CRC(70c240a2) SHA1(82dc391572e1f61b0182cb031654d71adcdd5f6e) )
- ROM_LOAD16_BYTE( "945_s12.e15", 0x00001, 0x20000, CRC(bbc300d4) SHA1(e1ca98bc591575285d7bd2d4fefdf35fed10dcb6) )
-
- ROM_REGION( 0x100000, "sub", 0 )
- ROM_LOAD16_BYTE( "945_m09.r17", 0x000000, 0x20000, CRC(b4a6df25) SHA1(85533cf140d28f6f81c0b49b8061bda0924a613a) )
- ROM_LOAD16_BYTE( "945_m08.n17", 0x000001, 0x20000, CRC(74e981d2) SHA1(e7b47a2da01ff73293d2100c48fdf00b33125af5) )
- ROM_LOAD16_BYTE( "945_l06b.r11", 0x040000, 0x20000, CRC(83772304) SHA1(a90c75a3de670b6ec5e0fc201876d463b4a76766) )
- ROM_LOAD16_BYTE( "945_l06a.n11", 0x040001, 0x20000, CRC(e1fd75b6) SHA1(6160d80a2f1bf550e85d6253cf521a96f5a644cc) )
- ROM_LOAD16_BYTE( "945_l07c.r15", 0x080000, 0x20000, CRC(c1e399b6) SHA1(e95bd478dd3beea0175bf9ee4cededb111c4ace1) )
- ROM_LOAD16_BYTE( "945_l07a.n15", 0x080001, 0x20000, CRC(96222d04) SHA1(b55700f683a556b0e73dbac9c7b4ce485420d21c) )
- ROM_LOAD16_BYTE( "945_l07d.r13", 0x0c0000, 0x20000, CRC(4c16d4bd) SHA1(01dcf169b78a1e495214b10181401d1920b0c924) )
- ROM_LOAD16_BYTE( "945_l07b.n13", 0x0c0001, 0x20000, CRC(5e209d01) SHA1(0efa1bbfdc7e2ba1e0bb96245e2bfe961258b446) )
-
- ROM_REGION( 0x10000, "audiocpu", 0 )
- ROM_LOAD( "945_m05.d9", 0x00000, 0x10000, CRC(c8c45365) SHA1(b9a7b736b52bca42c7b8c8ed64c8df73e0116158) )
-
- ROM_REGION( 0x200000, "k051960", 0 ) /* graphics (addressable by the main CPU) */
+ ROM_REGION( 0x40000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "945_s13.f15", 0x00000, 0x20000, CRC(70c240a2) SHA1(82dc391572e1f61b0182cb031654d71adcdd5f6e) )
+ ROM_LOAD16_BYTE( "945_s12.e15", 0x00001, 0x20000, CRC(bbc300d4) SHA1(e1ca98bc591575285d7bd2d4fefdf35fed10dcb6) )
+
+ ROM_REGION( 0x100000, "sub", 0 )
+ ROM_LOAD16_BYTE( "945_m09.r17", 0x000000, 0x20000, CRC(b4a6df25) SHA1(85533cf140d28f6f81c0b49b8061bda0924a613a) )
+ ROM_LOAD16_BYTE( "945_m08.n17", 0x000001, 0x20000, CRC(74e981d2) SHA1(e7b47a2da01ff73293d2100c48fdf00b33125af5) )
+ ROM_LOAD16_BYTE( "945_l06b.r11", 0x040000, 0x20000, CRC(83772304) SHA1(a90c75a3de670b6ec5e0fc201876d463b4a76766) )
+ ROM_LOAD16_BYTE( "945_l06a.n11", 0x040001, 0x20000, CRC(e1fd75b6) SHA1(6160d80a2f1bf550e85d6253cf521a96f5a644cc) )
+ ROM_LOAD16_BYTE( "945_l07c.r15", 0x080000, 0x20000, CRC(c1e399b6) SHA1(e95bd478dd3beea0175bf9ee4cededb111c4ace1) )
+ ROM_LOAD16_BYTE( "945_l07a.n15", 0x080001, 0x20000, CRC(96222d04) SHA1(b55700f683a556b0e73dbac9c7b4ce485420d21c) )
+ ROM_LOAD16_BYTE( "945_l07d.r13", 0x0c0000, 0x20000, CRC(4c16d4bd) SHA1(01dcf169b78a1e495214b10181401d1920b0c924) )
+ ROM_LOAD16_BYTE( "945_l07b.n13", 0x0c0001, 0x20000, CRC(5e209d01) SHA1(0efa1bbfdc7e2ba1e0bb96245e2bfe961258b446) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "945_m05.d9", 0x00000, 0x10000, CRC(c8c45365) SHA1(b9a7b736b52bca42c7b8c8ed64c8df73e0116158) )
+
+ ROM_REGION( 0x200000, "k051960", 0 ) /* graphics (addressable by the main CPU) */
ROM_LOAD32_BYTE( "945_A02A.K2", 0x000000, 0x20000, CRC(fbb81511) SHA1(e7988d52e323e46117f5080c469daf9b119f28a0) )
- ROM_LOAD32_BYTE( "945_A02C.M2", 0x000001, 0x20000, CRC(031b55e8) SHA1(64ed8dee60bf012df7c1ed496af1c75263c052a6) )
- ROM_LOAD32_BYTE( "945_A01A.E2", 0x000002, 0x20000, CRC(bace5abb) SHA1(b32df63294c0730f463335b1b760494389c60062) )
- ROM_LOAD32_BYTE( "945_A01C.H2", 0x000003, 0x20000, CRC(d91b29a6) SHA1(0c3027a08996f4c2b86dd88695241b21c8dffd64) )
- ROM_LOAD32_BYTE( "945_A02B.K4", 0x080000, 0x20000, CRC(c0fed4ab) SHA1(f01975b13759cae7c8dfd24f9b3f4ac960d32957) )
- ROM_LOAD32_BYTE( "945_A02D.M4", 0x080001, 0x20000, CRC(d462817c) SHA1(00137e38454e7c3548a1a9553c5ee644916b3959) )
- ROM_LOAD32_BYTE( "945_A01B.E4", 0x080002, 0x20000, CRC(b426090e) SHA1(06a671a648e3255146fe0c325d5451d4f75f08aa) )
- ROM_LOAD32_BYTE( "945_A01D.H4", 0x080003, 0x20000, CRC(3990c09a) SHA1(1f6a089c1d03fb95d4d96fecc0379bde26ee2b9d) )
-
- ROM_LOAD32_BYTE( "945_l04a.k6", 0x100000, 0x20000, CRC(884e21ee) SHA1(ce86dd3a06775e5b1aa09db010dcb674e67828e7) )
- ROM_LOAD32_BYTE( "945_l04c.m6", 0x100001, 0x20000, CRC(45bcd921) SHA1(e51a8a71362a6fb55124aa1dce74519c0a3c6e3f) )
- ROM_LOAD32_BYTE( "945_l03a.e6", 0x100002, 0x20000, CRC(a67ef087) SHA1(fd63474f3bbde5dfc53ed4c1db25d6411a8b54d2) )
- ROM_LOAD32_BYTE( "945_l03c.h6", 0x100003, 0x20000, CRC(a56be17a) SHA1(1d387736144c30fcb5de54235331ab1ff70c356e) )
- ROM_LOAD32_BYTE( "945_l04b.k8", 0x180000, 0x20000, CRC(843bc67d) SHA1(cdf8421083f24ab27867ed5d08d8949da192b2b9) )
- ROM_LOAD32_BYTE( "945_l04d.m8", 0x180001, 0x20000, CRC(0a98d08e) SHA1(1e0ca51a2d45c01fa3f11950ddd387f41ddae691) )
- ROM_LOAD32_BYTE( "945_l03b.e8", 0x180002, 0x20000, CRC(933e68b9) SHA1(f3a39446ca77d17fdbd938bd5f718ae9d5570879) )
- ROM_LOAD32_BYTE( "945_l03d.h8", 0x180003, 0x20000, CRC(f375e87b) SHA1(6427b966795c907c8e516244872fe52217da62c4) )
-
- ROM_REGION( 0x0100, "proms", 0 )
- ROM_LOAD( "945l14.j28", 0x0000, 0x0100, CRC(c778c189) SHA1(847eaf379ba075c25911c6f83dd63ff390534f60) ) /* priority encoder (not used) */
-
- ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 samples */
+ ROM_LOAD32_BYTE( "945_A02C.M2", 0x000001, 0x20000, CRC(031b55e8) SHA1(64ed8dee60bf012df7c1ed496af1c75263c052a6) )
+ ROM_LOAD32_BYTE( "945_A01A.E2", 0x000002, 0x20000, CRC(bace5abb) SHA1(b32df63294c0730f463335b1b760494389c60062) )
+ ROM_LOAD32_BYTE( "945_A01C.H2", 0x000003, 0x20000, CRC(d91b29a6) SHA1(0c3027a08996f4c2b86dd88695241b21c8dffd64) )
+ ROM_LOAD32_BYTE( "945_A02B.K4", 0x080000, 0x20000, CRC(c0fed4ab) SHA1(f01975b13759cae7c8dfd24f9b3f4ac960d32957) )
+ ROM_LOAD32_BYTE( "945_A02D.M4", 0x080001, 0x20000, CRC(d462817c) SHA1(00137e38454e7c3548a1a9553c5ee644916b3959) )
+ ROM_LOAD32_BYTE( "945_A01B.E4", 0x080002, 0x20000, CRC(b426090e) SHA1(06a671a648e3255146fe0c325d5451d4f75f08aa) )
+ ROM_LOAD32_BYTE( "945_A01D.H4", 0x080003, 0x20000, CRC(3990c09a) SHA1(1f6a089c1d03fb95d4d96fecc0379bde26ee2b9d) )
+
+ ROM_LOAD32_BYTE( "945_l04a.k6", 0x100000, 0x20000, CRC(884e21ee) SHA1(ce86dd3a06775e5b1aa09db010dcb674e67828e7) )
+ ROM_LOAD32_BYTE( "945_l04c.m6", 0x100001, 0x20000, CRC(45bcd921) SHA1(e51a8a71362a6fb55124aa1dce74519c0a3c6e3f) )
+ ROM_LOAD32_BYTE( "945_l03a.e6", 0x100002, 0x20000, CRC(a67ef087) SHA1(fd63474f3bbde5dfc53ed4c1db25d6411a8b54d2) )
+ ROM_LOAD32_BYTE( "945_l03c.h6", 0x100003, 0x20000, CRC(a56be17a) SHA1(1d387736144c30fcb5de54235331ab1ff70c356e) )
+ ROM_LOAD32_BYTE( "945_l04b.k8", 0x180000, 0x20000, CRC(843bc67d) SHA1(cdf8421083f24ab27867ed5d08d8949da192b2b9) )
+ ROM_LOAD32_BYTE( "945_l04d.m8", 0x180001, 0x20000, CRC(0a98d08e) SHA1(1e0ca51a2d45c01fa3f11950ddd387f41ddae691) )
+ ROM_LOAD32_BYTE( "945_l03b.e8", 0x180002, 0x20000, CRC(933e68b9) SHA1(f3a39446ca77d17fdbd938bd5f718ae9d5570879) )
+ ROM_LOAD32_BYTE( "945_l03d.h8", 0x180003, 0x20000, CRC(f375e87b) SHA1(6427b966795c907c8e516244872fe52217da62c4) )
+
+ ROM_REGION( 0x0100, "proms", 0 )
+ ROM_LOAD( "945l14.j28", 0x0000, 0x0100, CRC(c778c189) SHA1(847eaf379ba075c25911c6f83dd63ff390534f60) ) /* priority encoder (not used) */
+
+ ROM_REGION( 0x80000, "k007232", 0 ) /* 007232 samples */
ROM_LOAD( "945_A10A.C14", 0x00000, 0x20000, CRC(ec717414) SHA1(8c63d5fe01d0833529fca91bc80cdbd8a04174c0) )
ROM_LOAD( "945_A10B.C16", 0x20000, 0x20000, CRC(709e30e4) SHA1(27fcea720cd2498f1870c9290d30dcb3dd81d5e5) )
- ROM_LOAD( "945_l11a.c18", 0x40000, 0x20000, CRC(6043f4eb) SHA1(1c2e9ace1cfdde504b7b6158e3c3f54dc5ae33d4) )
- ROM_LOAD( "945_l11b.c20", 0x60000, 0x20000, CRC(89ea3baf) SHA1(8edcbaa7969185cfac48c02559826d1b8b081f3f) )
+ ROM_LOAD( "945_l11a.c18", 0x40000, 0x20000, CRC(6043f4eb) SHA1(1c2e9ace1cfdde504b7b6158e3c3f54dc5ae33d4) )
+ ROM_LOAD( "945_l11b.c20", 0x60000, 0x20000, CRC(89ea3baf) SHA1(8edcbaa7969185cfac48c02559826d1b8b081f3f) )
ROM_END
ROM_START( gradius3a )
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index c172cca7118..95a60fb7134 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -355,6 +355,8 @@ harddriv_state::harddriv_state(const machine_config &mconfig, const char *tag, d
m_ds3dac2(*this, "ds3dac2"),
m_harddriv_sound(*this, "harddriv_sound"),
m_jsa(*this, "jsa"),
+ m_screen(*this, "screen"),
+ m_duartn68681(*this, "duartn68681"),
m_hd34010_host_access(0),
m_dsk_pio_access(0),
m_msp_ram(*this, "msp_ram"),
@@ -384,6 +386,11 @@ harddriv_state::harddriv_state(const machine_config &mconfig, const char *tag, d
m_gsp_control_hi(*this, "gsp_control_hi"),
m_gsp_paletteram_lo(*this, "gsp_palram_lo"),
m_gsp_paletteram_hi(*this, "gsp_palram_hi"),
+ m_in0(*this, "IN0"),
+ m_sw1(*this, "SW1"),
+ m_a80000(*this, "a80000"),
+ m_8badc(*this, "8BADC"),
+ m_12badc(*this, "12BADC"),
m_irq_state(0),
m_gsp_irq_state(0),
m_msp_irq_state(0),
@@ -499,9 +506,18 @@ class harddriv_new_state : public driver_device
public:
harddriv_new_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
+ , m_mainpcb(*this, "mainpcb")
+ , m_leftpcb(*this, "leftpcb")
+ , m_rightpcb(*this, "rightpcb")
{ }
TIMER_DEVICE_CALLBACK_MEMBER(hack_timer);
+ DECLARE_WRITE_LINE_MEMBER(tx_a);
+
+ required_device<harddriv_state> m_mainpcb;
+ optional_device<harddriv_state> m_leftpcb;
+ optional_device<harddriv_state> m_rightpcb;
+
};
@@ -777,40 +793,40 @@ static INPUT_PORTS_START( harddriv )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 ) /* aux coin */
PORT_BIT( 0xfff8, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 - gas pedal */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 - gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Gas Pedal")
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 - clutch pedal */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 - clutch pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_NAME("Clutch Pedal")
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 - seat */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 - seat */
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 - shifter lever Y */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 - shifter lever Y */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_NAME("Shifter Lever Y")
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 - shifter lever X*/
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 - shifter lever X*/
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G) PORT_NAME("Shifter Lever X")
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 - wheel */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 - wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Wheel")
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 - line volts */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 - line volts */
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 - shift force */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 - shift force */
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("mainpcb:12BADC0") /* b80000 - 12 bit ADC 0 - steering wheel */
+ PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 - steering wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
- PORT_START("mainpcb:12BADC1") /* b80000 - 12 bit ADC 1 - force brake */
+ PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 - force brake */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_REVERSE PORT_NAME("Force Brake")
- PORT_START("mainpcb:12BADC2") /* b80000 - 12 bit ADC 2 */
+ PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC3") /* b80000 - 12 bit ADC 3 */
+ PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -861,40 +877,40 @@ static INPUT_PORTS_START( racedriv )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN3 ) /* aux coin */
PORT_BIT( 0xfff8, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 - gas pedal */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 - gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Gas Pedal")
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 - clutch pedal */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 - clutch pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_NAME("Clutch Pedal")
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 - seat */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 - seat */
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 - shifter lever Y */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 - shifter lever Y */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_R) PORT_CODE_INC(KEYCODE_F) PORT_NAME("Shifter Lever Y")
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 - shifter lever X*/
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 - shifter lever X*/
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(128) PORT_CODE_DEC(KEYCODE_D) PORT_CODE_INC(KEYCODE_G) PORT_NAME("Shifter Lever X")
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 - wheel */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 - wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Wheel")
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 - line volts */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 - line volts */
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC0") /* b80000 - 12 bit ADC 0 - steering wheel */
+ PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 - steering wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
- PORT_START("mainpcb:12BADC1") /* b80000 - 12 bit ADC 1 - force brake */
+ PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 - force brake */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_REVERSE PORT_NAME("Force Brake")
- PORT_START("mainpcb:12BADC2") /* b80000 - 12 bit ADC 2 */
+ PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC3") /* b80000 - 12 bit ADC 3 */
+ PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -991,39 +1007,39 @@ static INPUT_PORTS_START( racedrivc )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) /* center edge on steering wheel */
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 - gas pedal */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 - gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Gas Pedal")
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 - clutch pedal */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 - clutch pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL3 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(100) PORT_NAME("Clutch Pedal")
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 */
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 - force brake */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 - force brake */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_REVERSE PORT_NAME("Force Brake")
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC0") /* 400000 - steering wheel */
+ PORT_START("mainpcb:12BADC.0") /* 400000 - steering wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
/* dummy ADC ports to end up with the same number as the full version */
- PORT_START("mainpcb:12BADC1")
+ PORT_START("mainpcb:12BADC.1")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC2")
+ PORT_START("mainpcb:12BADC.2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC3")
+ PORT_START("mainpcb:12BADC.3")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1073,40 +1089,40 @@ static INPUT_PORTS_START( stunrun )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xfff8, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10)
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 */
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC0") /* b80000 - 12 bit ADC 0 */
+ PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC1") /* b80000 - 12 bit ADC 1 */
+ PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC2") /* b80000 - 12 bit ADC 2 */
+ PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC3") /* b80000 - 12 bit ADC 3 */
+ PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
/* stunrun has its own coins */
@@ -1163,40 +1179,40 @@ static INPUT_PORTS_START( steeltal )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Real Helicopter Flight")
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) /* volume control */
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 */
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC0") /* b80000 - 12 bit ADC 0 */
+ PORT_START("mainpcb:12BADC.0") /* b80000 - 12 bit ADC 0 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) /* left/right */
- PORT_START("mainpcb:12BADC1") /* b80000 - 12 bit ADC 1 */
+ PORT_START("mainpcb:12BADC.1") /* b80000 - 12 bit ADC 1 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) /* up/down */
- PORT_START("mainpcb:12BADC2") /* b80000 - 12 bit ADC 2 */
+ PORT_START("mainpcb:12BADC.2") /* b80000 - 12 bit ADC 2 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Z ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_NAME("Collective") PORT_REVERSE /* collective */
- PORT_START("mainpcb:12BADC3") /* b80000 - 12 bit ADC 3 */
+ PORT_START("mainpcb:12BADC.3") /* b80000 - 12 bit ADC 3 */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_NAME("Rudder") PORT_PLAYER(2) /* rudder */
/* steeltal has its own coins */
@@ -1260,39 +1276,39 @@ static INPUT_PORTS_START( strtdriv )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) /* center edge on steering wheel */
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 - gas pedal */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 - gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Gas Pedal")
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 - voice mic */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 - voice mic */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 - volume */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 - volume */
PORT_BIT( 0xff, 0X80, IPT_UNUSED )
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 - elevator */
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 - elevator */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_NAME("Elevator") PORT_REVERSE /* up/down */
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 - canopy */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 - canopy */
PORT_BIT( 0xff, 0X80, IPT_UNUSED )
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 - brake */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 - brake */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_NAME("Brake") PORT_REVERSE
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 - seat adjust */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 - seat adjust */
PORT_BIT( 0xff, 0X80, IPT_UNUSED )
- PORT_START("mainpcb:12BADC0") /* 400000 - steering wheel */
+ PORT_START("mainpcb:12BADC.0") /* 400000 - steering wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_NAME("Steering Wheel")
/* dummy ADC ports to end up with the same number as the full version */
- PORT_START("mainpcb:12BADC1") /* FAKE */
+ PORT_START("mainpcb:12BADC.1") /* FAKE */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC2") /* FAKE */
+ PORT_START("mainpcb:12BADC.2") /* FAKE */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC3") /* FAKE */
+ PORT_START("mainpcb:12BADC.3") /* FAKE */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1350,39 +1366,39 @@ static INPUT_PORTS_START( hdrivair )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SPECIAL ) /* center edge on steering wheel */
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC0") /* b00000 - 8 bit ADC 0 - gas pedal */
+ PORT_START("mainpcb:8BADC.0") /* b00000 - 8 bit ADC 0 - gas pedal */
PORT_BIT( 0xff, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) PORT_NAME("Gas Pedal")
- PORT_START("mainpcb:8BADC1") /* b00000 - 8 bit ADC 1 */
+ PORT_START("mainpcb:8BADC.1") /* b00000 - 8 bit ADC 1 */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC2") /* b00000 - 8 bit ADC 2 - voice mic */
+ PORT_START("mainpcb:8BADC.2") /* b00000 - 8 bit ADC 2 - voice mic */
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:8BADC3") /* b00000 - 8 bit ADC 3 - volume */
+ PORT_START("mainpcb:8BADC.3") /* b00000 - 8 bit ADC 3 - volume */
PORT_BIT( 0xff, 0X80, IPT_UNUSED )
- PORT_START("mainpcb:8BADC4") /* b00000 - 8 bit ADC 4 - elevator */
+ PORT_START("mainpcb:8BADC.4") /* b00000 - 8 bit ADC 4 - elevator */
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_REVERSE PORT_NAME("Elevator") /* up/down */
- PORT_START("mainpcb:8BADC5") /* b00000 - 8 bit ADC 5 - canopy */
+ PORT_START("mainpcb:8BADC.5") /* b00000 - 8 bit ADC 5 - canopy */
PORT_BIT( 0xff, 0X80, IPT_UNUSED )
- PORT_START("mainpcb:8BADC6") /* b00000 - 8 bit ADC 6 - brake */
+ PORT_START("mainpcb:8BADC.6") /* b00000 - 8 bit ADC 6 - brake */
PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(25) PORT_KEYDELTA(40) PORT_REVERSE PORT_NAME("Brake")
- PORT_START("mainpcb:8BADC7") /* b00000 - 8 bit ADC 7 - seat adjust */
+ PORT_START("mainpcb:8BADC.7") /* b00000 - 8 bit ADC 7 - seat adjust */
PORT_BIT( 0xff, 0X80, IPT_UNUSED )
- PORT_START("mainpcb:12BADC0") /* 400000 - steering wheel */
+ PORT_START("mainpcb:12BADC.0") /* 400000 - steering wheel */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10,0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5) PORT_REVERSE PORT_NAME("Steering Wheel")
/* dummy ADC ports to end up with the same number as the full version */
- PORT_START("mainpcb:12BADC1")
+ PORT_START("mainpcb:12BADC.1")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC2")
+ PORT_START("mainpcb:12BADC.2")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_START("mainpcb:12BADC3")
+ PORT_START("mainpcb:12BADC.3")
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
@@ -1986,13 +2002,11 @@ static MACHINE_CONFIG_START( steeltalp_machine, harddriv_new_state )
MCFG_DEVICE_ADD("mainpcb", STEELTALP_BOARD_DEVICE, 0)
MACHINE_CONFIG_END
-WRITE_LINE_MEMBER(racedriv_board_device_state::tx_a)
+WRITE_LINE_MEMBER(harddriv_new_state::tx_a)
{
// passive connection, one way, to both screens
- mc68681_device* left = machine().device<mc68681_device>(":leftpcb:duartn68681");
- mc68681_device* right = machine().device<mc68681_device>(":rightpcb:duartn68681");
- left->rx_a_w(state);
- right->rx_a_w(state);
+ m_leftpcb->m_duartn68681->rx_a_w(state);
+ m_rightpcb->m_duartn68681->rx_a_w(state);
}
static MACHINE_CONFIG_START( racedriv_panorama_machine, harddriv_new_state )
@@ -2002,7 +2016,7 @@ static MACHINE_CONFIG_START( racedriv_panorama_machine, harddriv_new_state )
// MCFG_QUANTUM_TIME(attotime::from_hz(100000))
MCFG_DEVICE_MODIFY("mainpcb:duartn68681")
- MCFG_MC68681_A_TX_CALLBACK(WRITELINE(racedriv_board_device_state,tx_a ))
+ MCFG_MC68681_A_TX_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, harddriv_new_state,tx_a))
MCFG_TIMER_DRIVER_ADD_PERIODIC("hack_timer", harddriv_new_state, hack_timer, attotime::from_hz(60))
// MCFG_QUANTUM_TIME(attotime::from_hz(60000))
@@ -2012,13 +2026,9 @@ MACHINE_CONFIG_END
// by forcing them to stay in sync using this ugly method everything works much better.
TIMER_DEVICE_CALLBACK_MEMBER(harddriv_new_state::hack_timer)
{
- screen_device* middle = machine().device<screen_device>(":mainpcb:screen");
- screen_device* left = machine().device<screen_device>(":leftpcb:screen");
- screen_device* right = machine().device<screen_device>(":rightpcb:screen");
-
- left->reset_origin(0, 0);
- middle->reset_origin(0, 0);
- right->reset_origin(0, 0);
+ m_leftpcb->m_screen->reset_origin(0, 0);
+ m_mainpcb->m_screen->reset_origin(0, 0);
+ m_rightpcb->m_screen->reset_origin(0, 0);
}
/*************************************
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 29c3248d2e0..c0c8cc70c10 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -813,7 +813,7 @@ WRITE32_MEMBER(hng64_state::tcram_w)
m_screen_dis = 0;
visarea.set(min_x, min_x + max_x - 1, min_y, min_y + max_y - 1);
- m_screen->configure(HTOTAL, VTOTAL, visarea, m_screen->frame_period().attoseconds );
+ m_screen->configure(HTOTAL, VTOTAL, visarea, m_screen->frame_period().attoseconds() );
}
}
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index 9a3fb5ef665..fbaaee1b032 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -67,6 +67,7 @@ public:
DECLARE_DRIVER_INIT(klxyj);
DECLARE_DRIVER_INIT(fearless);
DECLARE_DRIVER_INIT(slqz3);
+ DECLARE_DRIVER_INIT(fruitpar);
TILE_GET_INFO_MEMBER(get_tx_tilemap_tile_info);
TILE_GET_INFO_MEMBER(get_bg_tilemap_tile_info);
virtual void video_start();
@@ -454,7 +455,7 @@ IGS PCB-0239-11-EE
| |
| |
| 62256 IGS027A |
-| |
+| 55857G |
| U29 |
| 8255 |
| |
@@ -471,7 +472,7 @@ IGS PCB-0239-11-EE
ROM_START( slqz3 )
ROM_REGION( 0x04000, "maincpu", 0 )
- /* Internal rom of IGS027A ARM based MCU */
+ /* Internal rom of IGS027A type G ARM based MCU */
ROM_LOAD( "slqz3_igs027a", 0x00000, 0x4000, NO_DUMP )
ROM_REGION( 0x200000, "user1", 0 ) // external ARM data / prg
@@ -488,6 +489,56 @@ ROM_END
+/***************************************************************************
+
+Fruit Paradise
+IGS
+
+PCB Layout
+----------
+
+IGS PCB-0331-02-FG
+|--------------------------------------------|
+|PC817 7805 W4102.U28|
+|ULN2004 ULN2004 TDA1020 VOL M6295 |
+|ULN2004 PAL 62257 3.6VBATT|
+|ULN2004 82C55 22MHz |
+|ULN2004 |
+|8 V214.U23 |
+|L |--------| |
+|I PC817(x20) |IGS027A | |
+|N |--------| |55857G | |
+|E M4101.U13 | | |--------| |
+|R | IGS031 | |
+| | | |
+| TEXT.U12 |--------| |
+|DSW1 |
+|DSW2 ULN2004 61256 |
+|DSW3 PC817(x13) PC817 PC817 |
+| |--| JAMMA |--| |
+|-------| |---------------------------| |--|
+
+***************************************************************************/
+
+ROM_START( fruitpar )
+ ROM_REGION( 0x04000, "maincpu", 0 )
+ /* Internal rom of IGS027A type G ARM based MCU */
+ ROM_LOAD( "fruitpar_igs027a", 0x00000, 0x4000, NO_DUMP )
+
+ ROM_REGION( 0x80000, "user1", 0 ) // external ARM data / prg
+ ROM_LOAD( "fruit_paradise_v214.u23", 0x00000, 0x80000, CRC(e37bc4e0) SHA1(f5580e6007dc60f32efd3b3e7e64c5ee446ede8a) )
+
+ ROM_REGION( 0x480000, "gfx1", 0 )
+ ROM_LOAD( "igs_m4101.u13", 0x000000, 0x400000, CRC(84899398) SHA1(badac65af6e03c490798f4368eb2b15db8c590d0) ) // FIXED BITS (xxxxxxx0xxxxxxxx)
+ ROM_LOAD( "paradise_text.u12", 0x400000, 0x080000, CRC(bdaa4407) SHA1(845eead0902c81290c2b5d7543ac9dfda375fdd1) )
+
+ ROM_REGION( 0x80000, "oki", 0 )
+ ROM_LOAD( "igs_w4102.u28", 0x00000, 0x80000, CRC(558cab25) SHA1(0280b37a14589329f0385c048e5742b9e89bd587) )
+ROM_END
+
+
+
+
ROM_START( sdwx )
ROM_REGION( 0x04000, "maincpu", 0 )
/* Internal rom of IGS027A ARM based MCU */
@@ -1006,6 +1057,13 @@ DRIVER_INIT_MEMBER(igs_m027_state,slqz3)
pgm_create_dummy_internal_arm_region();
}
+DRIVER_INIT_MEMBER(igs_m027_state,fruitpar)
+{
+ fruitpar_decrypt(machine());
+ //sdwx_gfx_decrypt(machine());
+ pgm_create_dummy_internal_arm_region();
+}
+
/***************************************************************************
Game Drivers
@@ -1013,6 +1071,7 @@ DRIVER_INIT_MEMBER(igs_m027_state,slqz3)
***************************************************************************/
GAME( 1999, slqz3, 0, igs_majhong, sdwx, igs_m027_state, slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", MACHINE_IS_SKELETON )
+GAME( 200?, fruitpar, 0, igs_majhong, sdwx, igs_m027_state, fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_IS_SKELETON )
GAME( 2002, sdwx, 0, igs_majhong, sdwx, igs_m027_state, sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_IS_SKELETON ) // aka Christmas 5 Line?
GAME( 200?, sddz, 0, igs_majhong, sdwx, igs_m027_state, sddz, ROT0, "IGS", "Super Dou Di Zhu", MACHINE_IS_SKELETON )
GAME( 2000, zhongguo, 0, igs_majhong, sdwx, igs_m027_state, zhongguo, ROT0, "IGS", "Zhong Guo Chu Da D", MACHINE_IS_SKELETON )
diff --git a/src/mame/drivers/joystand.c b/src/mame/drivers/joystand.c
new file mode 100644
index 00000000000..338d3282592
--- /dev/null
+++ b/src/mame/drivers/joystand.c
@@ -0,0 +1,687 @@
+// license:BSD-3-Clause
+// copyright-holders:Luca Elia
+/***************************************************************************
+
+Joy Stand Private
+Yuvo 1999 (31st October, 1999)
+
+driver by Luca Elia
+
+This is a sticker machine with camera, printer and light pen.
+
+PCB Layout
+----------
+
+Main board
+
+JSP-NM515
+|---------------------------------------------------------|
+|TA8201A POWER-IN TD62083 TD62083 CONTROL |
+| JRC3404 D71055 D71055 T531A|
+|SP JRC3404 CN10 |
+|VR2 JRC3404 JSP001 JSP-FRM JSP003B TC551001|
+|VR1 M6295 JSP-MAP |
+|CAM-IN JRC2235 JSP002 C46M1 TMP68301 JSP004B TC551001|
+|PRN-IN JRC2233 YM2413 |
+|VR3 JRC3404 JSP-XCT |
+|VR4 16MHz 32.767kHz|
+|VR5 SONY_A1585Q M548262 M548262 M6242B|
+| 3.579545MHz M548262 M548262 3V_BATT|
+| JRC2240 D6951 M548262 M548262 |
+|RGB-OUT D6951 M548262 M548262 JACK|
+| D6951 XC3042A |
+| SONY_CXA1645M KM68257 KM68257 JRC2903 |
+|SV-OUT D6901 LIGHTPEN|
+| JRC2244 D6901 XC3030A XC3030A XC3030A |
+| JRC2244 D6901 CN11 PRN_CONT|
+|---------------------------------------------------------|
+Notes:
+ Main CPU is Toshiba TMP68301 @ 16MHz
+ No custom chips, using only Xilinx XC30xx FPGA
+ Sound Oki M6295 @ 1MHz [16/16], YM2413 @ 3.579545MHz
+ PALs type PALCE16V8H
+ EPROMs are 27C040/27C020
+ CN10/11 - Connector for sub-board
+ Many other connectors for camera, printer, lightpen etc.
+
+
+Sub board
+
+JSP-NS515
+MODEL-NP001
+9.10.31
+|-------------------------------|
+| J2 |
+| |
+| JSP-SUB |
+| |
+| |-| |-| |
+|JSP005 JSP007A | | | | |
+| | | | | |
+| | | | | |
+| | | | | |
+|JSP006 JSP008A | | | | |
+| | | | | |
+| |-| |-| |
+| J1 |
+|-------------------------------|
+
+
+Cart board
+
+NS514-F040DD
+|---------------------|
+| U1 U2 U3 U4 U5 U6 |
+| |
+| U7 U8 U9 U10 U11 U12|
+| |
+-| |-|
+ |------------------|
+ Notes:
+ U* - TMS29F040 (TSOP32, x12)
+
+
+Notes:
+
+- To unlock some hidden items in test mode, go in the option menu and move:
+ left, right, left, left
+
+***************************************************************************/
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+#include "machine/tmp68301.h"
+#include "machine/msm6242.h"
+#include "machine/eepromser.h"
+#include "machine/intelfsh.h"
+#include "sound/2413intf.h"
+#include "sound/okim6295.h"
+
+class joystand_state : public driver_device
+{
+public:
+ joystand_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_tmp68301(*this, "tmp68301"),
+ m_palette(*this, "palette"),
+ m_bg15_palette(*this, "bg15_palette"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_eeprom(*this, "eeprom"),
+ m_cart_u1(*this, "cart.u1"),
+ m_cart_u2(*this, "cart.u2"),
+ m_cart_u3(*this, "cart.u3"),
+ m_cart_u4(*this, "cart.u4"),
+ m_cart_u5(*this, "cart.u5"),
+ m_cart_u6(*this, "cart.u6"),
+ m_cart_u7(*this, "cart.u7"),
+ m_cart_u8(*this, "cart.u8"),
+ m_cart_u9(*this, "cart.u9"),
+ m_cart_u10(*this, "cart.u10"),
+ m_cart_u11(*this, "cart.u11"),
+ m_cart_u12(*this, "cart.u12"),
+ m_oki(*this, "oki"),
+ m_bg1_ram(*this, "bg1_ram"),
+ m_bg2_ram(*this, "bg2_ram"),
+ m_bg15_0_ram(*this, "bg15_0_ram"),
+ m_bg15_1_ram(*this, "bg15_1_ram"),
+ m_scroll(*this, "scroll"),
+ m_enable(*this, "enable"),
+ m_outputs(*this, "outputs")
+ { }
+
+ // devices
+ required_device<cpu_device> m_maincpu;
+ required_device<tmp68301_device> m_tmp68301;
+ required_device<palette_device> m_palette;
+ required_device<palette_device> m_bg15_palette;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<eeprom_serial_93cxx_device> m_eeprom;
+ required_device<intelfsh8_device> m_cart_u1;
+ required_device<intelfsh8_device> m_cart_u2;
+ required_device<intelfsh8_device> m_cart_u3;
+ required_device<intelfsh8_device> m_cart_u4;
+ required_device<intelfsh8_device> m_cart_u5;
+ required_device<intelfsh8_device> m_cart_u6;
+ required_device<intelfsh8_device> m_cart_u7;
+ required_device<intelfsh8_device> m_cart_u8;
+ required_device<intelfsh8_device> m_cart_u9;
+ required_device<intelfsh8_device> m_cart_u10;
+ required_device<intelfsh8_device> m_cart_u11;
+ required_device<intelfsh8_device> m_cart_u12;
+ intelfsh8_device *m_cart_flash[12];
+ required_device<okim6295_device> m_oki;
+
+ // memory pointers
+ required_shared_ptr<UINT16> m_bg1_ram;
+ required_shared_ptr<UINT16> m_bg2_ram;
+ required_shared_ptr<UINT16> m_bg15_0_ram;
+ required_shared_ptr<UINT16> m_bg15_1_ram;
+ required_shared_ptr<UINT16> m_scroll;
+ required_shared_ptr<UINT16> m_enable;
+ required_shared_ptr<UINT16> m_outputs;
+
+ // tilemaps
+ tilemap_t *m_bg1_tmap;
+ tilemap_t *m_bg2_tmap;
+ DECLARE_WRITE16_MEMBER(bg1_w);
+ DECLARE_WRITE16_MEMBER(bg2_w);
+ TILE_GET_INFO_MEMBER(get_bg1_tile_info);
+ TILE_GET_INFO_MEMBER(get_bg2_tile_info);
+
+ // r5g5b5 layers
+ bitmap_rgb32 m_bg15_bitmap[2];
+ DECLARE_WRITE16_MEMBER(bg15_0_w);
+ DECLARE_WRITE16_MEMBER(bg15_1_w);
+ static const rgb_t BG15_TRANSPARENT;
+ void draw_bg15_tile(address_space &space, int x, int y, UINT16 code);
+ void draw_bg15_tilemap();
+ bool bg15_tiles_dirty;
+
+ // eeprom
+ DECLARE_READ16_MEMBER(eeprom_r);
+ DECLARE_WRITE16_MEMBER(eeprom_w);
+
+ // cart
+ DECLARE_READ16_MEMBER(cart_r);
+ DECLARE_WRITE16_MEMBER(cart_w);
+
+ // misc
+ DECLARE_READ16_MEMBER(fpga_r);
+ DECLARE_WRITE16_MEMBER(oki_bank_w);
+ DECLARE_READ16_MEMBER(e00000_r);
+ DECLARE_READ16_MEMBER(e00020_r);
+ DECLARE_WRITE16_MEMBER(outputs_w);
+
+ // screen updates
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ virtual void video_start();
+
+ // machine
+ virtual void machine_start();
+ virtual void machine_reset();
+ INTERRUPT_GEN_MEMBER(joystand_interrupt);
+};
+
+const rgb_t joystand_state::BG15_TRANSPARENT = 0x99999999;
+
+/***************************************************************************
+
+ Tilemaps
+
+***************************************************************************/
+
+TILE_GET_INFO_MEMBER(joystand_state::get_bg1_tile_info)
+{
+ UINT32 code = (m_bg1_ram[tile_index * 2 + 0] << 16) | m_bg1_ram[tile_index * 2 + 1];
+ SET_TILE_INFO_MEMBER(0, code & 0x00ffffff, code >> 24, 0);
+}
+
+TILE_GET_INFO_MEMBER(joystand_state::get_bg2_tile_info)
+{
+ UINT32 code = (m_bg2_ram[tile_index * 2 + 0] << 16) | m_bg2_ram[tile_index * 2 + 1];
+ SET_TILE_INFO_MEMBER(0, code & 0x00ffffff, code >> 24, 0);
+}
+
+WRITE16_MEMBER(joystand_state::bg1_w)
+{
+ COMBINE_DATA(&m_bg1_ram[offset]);
+ m_bg1_tmap->mark_tile_dirty(offset/2);
+}
+
+WRITE16_MEMBER(joystand_state::bg2_w)
+{
+ COMBINE_DATA(&m_bg2_ram[offset]);
+ m_bg2_tmap->mark_tile_dirty(offset/2);
+}
+
+/***************************************************************************
+
+ r5g5b5 Layers
+
+***************************************************************************/
+
+// pixel-based
+WRITE16_MEMBER(joystand_state::bg15_0_w)
+{
+ UINT16 val = COMBINE_DATA(&m_bg15_0_ram[offset]);
+ m_bg15_bitmap[0].pix32(offset >> 9, offset & 0x1ff) = (val & 0x8000) ? BG15_TRANSPARENT : m_bg15_palette->pen_color(val & 0x7fff);
+}
+
+// tile-based
+void joystand_state::draw_bg15_tile(address_space &space, int x, int y, UINT16 code)
+{
+ x *= 16;
+ y *= 16;
+ int srcaddr = 0x800000 + (code % (0x800 * 6)) * 16 * 16 * 2;
+
+ for (int ty = 0; ty < 16; ++ty)
+ {
+ for (int tx = 0; tx < 16; ++tx)
+ {
+ UINT16 val = space.read_word(srcaddr + ty * 16 * 2 + tx * 2);
+ m_bg15_bitmap[1].pix32(y + ty , x + tx) = (val & 0x8000) ? BG15_TRANSPARENT : m_bg15_palette->pen_color(val & 0x7fff);
+ }
+ }
+}
+
+void joystand_state::draw_bg15_tilemap()
+{
+ if (!bg15_tiles_dirty)
+ return;
+
+ bg15_tiles_dirty = false;
+
+ address_space &space = m_maincpu->space(AS_PROGRAM);
+ UINT16 *src = m_bg15_1_ram + 2/2;
+ for (int y = 0; y < 0x10; ++y)
+ {
+ for (int x = 0; x < 0x20; ++x)
+ {
+ draw_bg15_tile(space, x, y, *src);
+ src += 8/2;
+ }
+ src += 0x100/2;
+ }
+}
+
+WRITE16_MEMBER(joystand_state::bg15_1_w)
+{
+ UINT16 code = COMBINE_DATA(&m_bg15_1_ram[offset]);
+ if ((offset & 0x83) == 0x01)
+ draw_bg15_tile(space, (offset/4) & 0x1f, offset/0x100, code);
+}
+
+/***************************************************************************
+
+ Screen Update
+
+***************************************************************************/
+
+void joystand_state::video_start()
+{
+ m_bg1_tmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(joystand_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 0x40, 0x20);
+ m_bg2_tmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(joystand_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 0x40, 0x40);
+
+ m_bg1_tmap->set_transparent_pen(0xf);
+ m_bg2_tmap->set_transparent_pen(0xf);
+
+ for (int i = 0; i < 2; ++i)
+ {
+ m_bg15_bitmap[i].allocate(0x200, 0x200);
+ m_bg15_bitmap[i].fill(BG15_TRANSPARENT);
+ }
+
+ bg15_tiles_dirty = true;
+}
+
+UINT32 joystand_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
+{
+ int layers_ctrl = -1;
+
+#ifdef MAME_DEBUG
+ if (machine().input().code_pressed(KEYCODE_Z))
+ {
+ int msk = 0;
+ if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1;
+ if (machine().input().code_pressed(KEYCODE_W)) msk |= 2;
+ if (machine().input().code_pressed(KEYCODE_A)) msk |= 4;
+ if (machine().input().code_pressed(KEYCODE_S)) msk |= 8;
+ if (msk != 0) layers_ctrl &= msk;
+ }
+#endif
+
+ m_bg1_tmap->set_scrollx(0, 0);
+ m_bg1_tmap->set_scrolly(0, 0);
+
+ m_bg2_tmap->set_scrollx(0, m_scroll[0] - 0xa);
+ m_bg2_tmap->set_scrolly(0, m_scroll[1]);
+
+ draw_bg15_tilemap();
+
+ bitmap.fill(m_palette->black_pen(), cliprect);
+ if (layers_ctrl & 4) copybitmap_trans(bitmap, m_bg15_bitmap[0], 0, 0, 1, 0, cliprect, BG15_TRANSPARENT);
+ if (layers_ctrl & 8) copybitmap_trans(bitmap, m_bg15_bitmap[1], 0, 0, 0, 0, cliprect, BG15_TRANSPARENT);
+ if (layers_ctrl & 1) m_bg1_tmap->draw(screen, bitmap, cliprect, 0, 0);
+ if (layers_ctrl & 2) m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);
+
+ popmessage("S0: %04X S1: %04X EN: %04X OUT: %04X", m_scroll[0], m_scroll[1], m_enable[0], m_outputs[0]);
+ return 0;
+}
+
+/***************************************************************************
+
+ Memory Maps
+
+***************************************************************************/
+
+READ16_MEMBER(joystand_state::fpga_r)
+{
+ return 0xffff;
+}
+
+WRITE16_MEMBER(joystand_state::oki_bank_w)
+{
+ if (ACCESSING_BITS_0_7)
+ m_oki->set_bank_base(((data >> 6) & 3) * 0x40000);
+}
+
+READ16_MEMBER(joystand_state::eeprom_r)
+{
+ // mask 0x0020 ? (active low)
+ // mask 0x0040 ? ""
+ return (m_eeprom->do_read() & 1) << 3;
+}
+WRITE16_MEMBER(joystand_state::eeprom_w)
+{
+ if (ACCESSING_BITS_8_15)
+ {
+ // latch the data bit
+ m_eeprom->di_write ( (data & 0x0004) ? ASSERT_LINE : CLEAR_LINE );
+
+ // reset line asserted: reset.
+ m_eeprom->cs_write ( (data & 0x0001) ? ASSERT_LINE : CLEAR_LINE );
+
+ // clock line asserted: write latch or select next bit to read
+ m_eeprom->clk_write( (data & 0x0002) ? ASSERT_LINE : CLEAR_LINE );
+
+ // mask 0x1000 ?
+ }
+}
+
+WRITE16_MEMBER(joystand_state::outputs_w)
+{
+ COMBINE_DATA(&m_outputs[0]);
+ if (ACCESSING_BITS_8_15)
+ {
+ coin_counter_w(machine(), 0, BIT(data, 0)); // coin counter 1
+ coin_counter_w(machine(), 1, BIT(data, 1)); // coin counter 2
+
+ output_set_value("blocker", BIT(data, 2));
+ output_set_value("error_lamp", BIT(data, 3)); // counter error
+ output_set_value("photo_lamp", BIT(data, 4)); // during photo
+ }
+ if (ACCESSING_BITS_8_15)
+ {
+ output_set_value("ok_button_led", BIT(data, 8));
+ output_set_value("cancel_button_led", BIT(data, 9));
+ }
+}
+
+// carts
+
+// copy slot
+READ16_MEMBER(joystand_state::e00000_r)
+{
+ return ioport("COPY")->read();
+}
+// master slot
+READ16_MEMBER(joystand_state::e00020_r)
+{
+ return ioport("MASTER")->read();
+}
+
+READ16_MEMBER(joystand_state::cart_r)
+{
+ int which = offset / 0x80000;
+ int addr = offset & 0x7ffff;
+ return (m_cart_flash[which * 2 + 0]->read(addr) << 8) | m_cart_flash[which * 2 + 1]->read(addr);
+}
+
+WRITE16_MEMBER(joystand_state::cart_w)
+{
+ int which = offset / 0x80000;
+ int addr = offset & 0x7ffff;
+
+ if (ACCESSING_BITS_0_7)
+ m_cart_flash[which * 2 + 1]->write(addr, data & 0xff);
+ if (ACCESSING_BITS_8_15)
+ m_cart_flash[which * 2 + 0]->write(addr, data >> 8);
+
+ bg15_tiles_dirty = true;
+}
+
+static ADDRESS_MAP_START( joystand_map, AS_PROGRAM, 16, joystand_state )
+ AM_RANGE(0x000000, 0x07ffff) AM_ROM
+ AM_RANGE(0x100000, 0x13ffff) AM_RAM
+ AM_RANGE(0x200000, 0x200003) AM_DEVWRITE8("ym2413", ym2413_device, write, 0x00ff)
+ AM_RANGE(0x200008, 0x200009) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
+ AM_RANGE(0x200010, 0x200011) AM_READ_PORT("IN0") // r/w
+ AM_RANGE(0x200012, 0x200013) AM_RAM_WRITE(outputs_w) AM_SHARE("outputs") // r/w
+ AM_RANGE(0x200014, 0x200015) AM_READWRITE(fpga_r, oki_bank_w) // r/w
+// AM_RANGE(0x200016, 0x200017) // write $9190 at boot
+
+ AM_RANGE(0x400000, 0x47ffff) AM_RAM_WRITE(bg15_0_w) AM_SHARE("bg15_0_ram") // r5g5b5 200x200 pixel-based
+ AM_RANGE(0x480000, 0x4fffff) AM_RAM // more rgb layers? (writes at offset 0)
+ AM_RANGE(0x500000, 0x57ffff) AM_RAM // ""
+ AM_RANGE(0x580000, 0x5fffff) AM_RAM // ""
+
+ AM_RANGE(0x600000, 0x603fff) AM_RAM_WRITE(bg2_w) AM_SHARE("bg2_ram")
+ AM_RANGE(0x604000, 0x605fff) AM_RAM_WRITE(bg1_w) AM_SHARE("bg1_ram")
+ AM_RANGE(0x606000, 0x607fff) AM_RAM_WRITE(bg15_1_w) AM_SHARE("bg15_1_ram") // r5g5b5 200x200 tile-based
+ AM_RANGE(0x608000, 0x609fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
+ AM_RANGE(0x60c000, 0x60c003) AM_RAM AM_SHARE("scroll") // write
+ AM_RANGE(0x60c00c, 0x60c00d) AM_RAM AM_SHARE("enable") // write
+
+ AM_RANGE(0x800000, 0xdfffff) AM_READWRITE(cart_r, cart_w) // r/w (cart flash)
+// AM_RANGE(0xe00080, 0xe00081) // write (bit 0 = cart? bit 1 = ? bit 3 = ?)
+ AM_RANGE(0xe00000, 0xe00001) AM_READ(e00000_r) // copy slot
+ AM_RANGE(0xe00020, 0xe00021) AM_READ(e00020_r) // master slot
+
+ AM_RANGE(0xe80040, 0xe8005f) AM_DEVREADWRITE8("rtc", msm6242_device, read, write,0x00ff)
+
+ AM_RANGE(0xfffc00, 0xffffff) AM_DEVREADWRITE("tmp68301", tmp68301_device, regs_r, regs_w) // TMP68301 Registers
+ADDRESS_MAP_END
+
+
+static INPUT_PORTS_START( joystand )
+ // Cart status:
+ // mask 0x1000 -> cart flash addressing (0 = sequential, 1 = interleaved even/odd)
+ // mask 0x6000 == 0 -> cart present?
+ // mask 0x8000 -> cart ready?
+
+ PORT_START("MASTER")
+ PORT_CONFNAME( 0x1000, 0x1000, "Master Flash Addressing" )
+ PORT_CONFSETTING( 0x1000, "Interleaved" )
+ PORT_CONFSETTING( 0x0000, "Sequential" )
+ PORT_CONFNAME( 0x2000, 0x0000, "Master Slot Sense 1" )
+ PORT_CONFSETTING( 0x2000, "Empty" )
+ PORT_CONFSETTING( 0x0000, "Cart" )
+ PORT_CONFNAME( 0x4000, 0x0000, "Master Slot Sense 2" )
+ PORT_CONFSETTING( 0x4000, "Empty" )
+ PORT_CONFSETTING( 0x0000, "Cart" )
+ PORT_BIT( 0x8fff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("COPY")
+ PORT_CONFNAME( 0x1000, 0x1000, "Copy Flash Addressing" )
+ PORT_CONFSETTING( 0x1000, "Interleaved" )
+ PORT_CONFSETTING( 0x0000, "Sequential" )
+ PORT_CONFNAME( 0x2000, 0x2000, "Copy Slot Sense 1" )
+ PORT_CONFSETTING( 0x2000, "Empty" )
+ PORT_CONFSETTING( 0x0000, "Cart" )
+ PORT_CONFNAME( 0x4000, 0x4000, "Copy Slot Sense 2" )
+ PORT_CONFSETTING( 0x4000, "Empty" )
+ PORT_CONFSETTING( 0x0000, "Cart" )
+ PORT_BIT( 0x8fff, IP_ACTIVE_LOW, IPT_UNKNOWN )
+
+ PORT_START("IN0")
+ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // up
+ PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // down
+ PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // left
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // right
+ PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) // ok
+ PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) // cancel
+ PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) // coin
+ PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service
+ PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) // test
+ PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
+INPUT_PORTS_END
+
+
+static const gfx_layout layout_8x8x4 =
+{
+ 8,8,
+ RGN_FRAC(1,1),
+ 4,
+ { STEP4(0, 1) },
+ { STEP8(0, 4) },
+ { STEP8(0, 4*8) },
+ 8*8*4
+};
+
+static const gfx_layout layout_16x16x8 =
+{
+ 16,16,
+ RGN_FRAC(1,1),
+ 8,
+ { STEP8(0, 1) },
+ { STEP16(0, 8) },
+ { STEP16(0, 8*16) },
+ 16*16*8
+};
+
+static GFXDECODE_START( joystand )
+ GFXDECODE_ENTRY( "tiles", 0, layout_8x8x4, 0, 0x100 )
+ GFXDECODE_ENTRY( "cart.u5", 0, layout_16x16x8, 0, 0x10 )
+ GFXDECODE_ENTRY( "cart.u6", 0, layout_16x16x8, 0, 0x10 )
+ GFXDECODE_ENTRY( "cart.u3", 0, layout_16x16x8, 0, 0x10 )
+ GFXDECODE_ENTRY( "cart.u4", 0, layout_16x16x8, 0, 0x10 )
+ GFXDECODE_ENTRY( "cart.u1", 0, layout_16x16x8, 0, 0x10 )
+ GFXDECODE_ENTRY( "cart.u2", 0, layout_16x16x8, 0, 0x10 )
+GFXDECODE_END
+
+
+void joystand_state::machine_start()
+{
+ m_cart_flash[0] = m_cart_u11; m_cart_flash[1] = m_cart_u5;
+ m_cart_flash[2] = m_cart_u12; m_cart_flash[3] = m_cart_u6;
+ m_cart_flash[4] = m_cart_u9; m_cart_flash[5] = m_cart_u3;
+ m_cart_flash[6] = m_cart_u10; m_cart_flash[7] = m_cart_u4;
+ m_cart_flash[8] = m_cart_u7; m_cart_flash[9] = m_cart_u1;
+ m_cart_flash[10] = m_cart_u8; m_cart_flash[11] = m_cart_u2;
+}
+
+void joystand_state::machine_reset()
+{
+}
+
+INTERRUPT_GEN_MEMBER(joystand_state::joystand_interrupt)
+{
+ // VBlank is connected to INT1 (external interrupts pin 1)
+ m_tmp68301->external_interrupt_1();
+}
+
+static MACHINE_CONFIG_START( joystand, joystand_state )
+
+ // basic machine hardware
+ MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) // !! TMP68301 !!
+ MCFG_CPU_PROGRAM_MAP(joystand_map)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", joystand_state, joystand_interrupt)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("tmp68301",tmp68301_device,irq_callback)
+
+ MCFG_DEVICE_ADD("tmp68301", TMP68301, 0)
+ MCFG_TMP68301_IN_PARALLEL_CB(READ16(joystand_state, eeprom_r))
+ MCFG_TMP68301_OUT_PARALLEL_CB(WRITE16(joystand_state, eeprom_w))
+
+ // video hardware
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_UPDATE_DRIVER(joystand_state, screen_update)
+ MCFG_SCREEN_SIZE(0x200, 0x100)
+ MCFG_SCREEN_VISIBLE_AREA(0x40, 0x40+0x178-1, 0x10, 0x100-1)
+
+ MCFG_PALETTE_ADD("palette", 0x1000)
+ MCFG_PALETTE_FORMAT(xRRRRRGGGGGBBBBB)
+ MCFG_GFXDECODE_ADD("gfxdecode", "palette", joystand)
+
+ MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("bg15_palette")
+
+ // sound hardware
+ MCFG_SPEAKER_STANDARD_MONO("mono")
+
+ MCFG_SOUND_ADD("ym2413", YM2413, XTAL_3_579545MHz)
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
+
+ MCFG_OKIM6295_ADD("oki", XTAL_16MHz / 16, OKIM6295_PIN7_HIGH) // pin 7 not verified
+ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
+
+ // cart
+ MCFG_TMS_29F040_ADD("cart.u1")
+ MCFG_TMS_29F040_ADD("cart.u2")
+ MCFG_TMS_29F040_ADD("cart.u3")
+ MCFG_TMS_29F040_ADD("cart.u4")
+ MCFG_TMS_29F040_ADD("cart.u5")
+ MCFG_TMS_29F040_ADD("cart.u6")
+ MCFG_TMS_29F040_ADD("cart.u7")
+ MCFG_TMS_29F040_ADD("cart.u8")
+ MCFG_TMS_29F040_ADD("cart.u9")
+ MCFG_TMS_29F040_ADD("cart.u10")
+ MCFG_TMS_29F040_ADD("cart.u11")
+ MCFG_TMS_29F040_ADD("cart.u12")
+
+ // devices
+ MCFG_EEPROM_SERIAL_93C46_ADD("eeprom")
+ MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz)
+MACHINE_CONFIG_END
+
+
+/***************************************************************************
+
+ Machine driver(s)
+
+***************************************************************************/
+
+ROM_START( joystand )
+ ROM_REGION( 0x80000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "yuvo_jsp003b.ic3", 0x00000, 0x40000, CRC(0c85bc77) SHA1(ad8ec80b02e82cf43e3f0732cc6e5468c6d21297) )
+ ROM_LOAD16_BYTE( "yuvo_jsp004b.ic63", 0x00001, 0x40000, CRC(333396e5) SHA1(fc605890676efed476b67abcd1fcb8d509324be2) )
+
+ ROM_REGION( 0x180000, "tiles", 0 )
+ ROM_LOAD16_BYTE( "yuvo_jsp005.2j", 0x000000, 0x80000, CRC(98caff66) SHA1(e201bb0119bc6560b7def40d42d2ef5b788ca3d4) )
+ ROM_LOAD16_BYTE( "yuvo_jsp006.4j", 0x000001, 0x80000, CRC(6c9f8048) SHA1(3fd6effa83b0e429b97d55041697f1b5ee6eafe2) )
+ ROM_LOAD16_BYTE( "yuvo_jsp007a.2g", 0x100000, 0x40000, CRC(ccfd5b72) SHA1(29bf14c888731d63f5d6705d0efb840f1de0fc91) ) // 1xxxxxxxxxxxxxxxxx = 0xFF
+ ROM_LOAD16_BYTE( "yuvo_jsp008a.4g", 0x100001, 0x40000, CRC(fdaf369c) SHA1(488741b9f2c5ccd27ee1aa5120834ec8b161d6b1) ) // 1xxxxxxxxxxxxxxxxx = 0xFF
+
+ ROM_REGION( 0x80000, "cart.u1", 0 )
+ ROM_LOAD( "jsp.u1", 0x00000, 0x80000, CRC(5478b779) SHA1(5d76645de2833cefb20374480572f06ef496ce30) )
+ ROM_REGION( 0x80000, "cart.u2", 0 )
+ ROM_LOAD( "jsp.u2", 0x00000, 0x80000, CRC(adba9522) SHA1(574e925b35ef3f732989f712caf3f92e16106c22) )
+ ROM_REGION( 0x80000, "cart.u3", 0 )
+ ROM_LOAD( "jsp.u3", 0x00000, 0x80000, CRC(6e293f82) SHA1(e29099c5337c5e7b4776da01a3bd45141b4900b9) )
+ ROM_REGION( 0x80000, "cart.u4", 0 )
+ ROM_LOAD( "jsp.u4", 0x00000, 0x80000, CRC(4caab540) SHA1(5cd88dc93c57d3ae9a6b3773222d8f6001b74634) )
+ ROM_REGION( 0x80000, "cart.u5", 0 )
+ ROM_LOAD( "jsp.u5", 0x00000, 0x80000, CRC(2cfee501) SHA1(2f07179accca0181d20bb0af797194a8ddad4f7a) )
+ ROM_REGION( 0x80000, "cart.u6", 0 )
+ ROM_LOAD( "jsp.u6", 0x00000, 0x80000, CRC(6069d711) SHA1(e969dcc4b5da6951b4140a78fa7cda350167ca66) )
+ ROM_REGION( 0x80000, "cart.u7", 0 )
+ ROM_LOAD( "jsp.u7", 0x00000, 0x80000, CRC(9f58df4d) SHA1(e4933087204624c021420bf632a6ddfd7b26179c) )
+ ROM_REGION( 0x80000, "cart.u8", 0 )
+ ROM_LOAD( "jsp.u8", 0x00000, 0x80000, CRC(829ddce6) SHA1(614ac45d55abe487aaa0e5ca7354926caaa03346) )
+ ROM_REGION( 0x80000, "cart.u9", 0 )
+ ROM_LOAD( "jsp.u9", 0x00000, 0x80000, CRC(e5ee5d8d) SHA1(ea6ea2fe4fc8b9eaf556453b430c85434ddf1570) )
+ ROM_REGION( 0x80000, "cart.u10", 0 )
+ ROM_LOAD( "jsp.u10", 0x00000, 0x80000, CRC(97234b84) SHA1(06a5dc290e925f5d6a8bade89d970964f32c9945) )
+ ROM_REGION( 0x80000, "cart.u11", 0 )
+ ROM_LOAD( "jsp.u11", 0x00000, 0x80000, CRC(8b138563) SHA1(8a2092d80d02ac685014540837b9aa38dfe0eb47) )
+ ROM_REGION( 0x80000, "cart.u12", 0 )
+ ROM_LOAD( "jsp.u12", 0x00000, 0x80000, CRC(10001cab) SHA1(5de49061f9ab81a4dc7e3405132ecec35a63248d) )
+
+ ROM_REGION( 0x100000, "oki", 0 )
+ ROM_LOAD( "yuvo_jsp001.ic14", 0x00000, 0x80000, CRC(bf2b4557) SHA1(932b96f4b3553e9d52509d678c7c2d4dcfc32cd7) )
+ ROM_LOAD( "yuvo_jsp002.ic13", 0x80000, 0x80000, CRC(0eb6db96) SHA1(e5f88f5357709def987f807d1a2d21514b5aa107) ) // 1ST AND 2ND HALF IDENTICAL
+
+ ROM_REGION( 0x117, "pld", 0 )
+ ROM_LOAD( "jsp-frm.ic100", 0x000, 0x117, NO_DUMP )
+ ROM_LOAD( "jsp-map.ic4", 0x000, 0x117, NO_DUMP )
+ ROM_LOAD( "jsp-sub.1f", 0x000, 0x117, NO_DUMP )
+ ROM_LOAD( "jsp-xct.ic5", 0x000, 0x117, NO_DUMP )
+ROM_END
+
+GAME( 1997, joystand, 0, joystand, joystand, driver_device, 0, ROT0, "Yuvo", "Joy Stand Private", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index cb1b3116baf..7f755144298 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -2058,7 +2058,7 @@ ROM_START( tbyahhoo )
/* main program */
ROM_REGION( 0x800000, "maincpu", 0 )
GX_BIOS
- ROM_LOAD32_WORD_SWAP( "426jaa02.31b", 0x200002, 512*1024, CRC(0416ad78) SHA1(a94c37a95e431c8f8cc3db66713faed406ab27c4) )
+ ROM_LOAD32_WORD_SWAP( "424jaa02.31b", 0x200002, 512*1024, CRC(0416ad78) SHA1(a94c37a95e431c8f8cc3db66713faed406ab27c4) )
ROM_LOAD32_WORD_SWAP( "424jaa04.27b", 0x200000, 512*1024, CRC(bcbe0e40) SHA1(715f72a172a0662e6e65a57baa1f5a18d6210389) )
/* sound program */
@@ -2274,8 +2274,8 @@ ROM_START( rushhero )
/* main program */
ROM_REGION( 0x800000, "maincpu", 0 )
GX_BIOS
- ROM_LOAD32_WORD_SWAP( "605b03.29m", 0x200000, 512*1024, CRC(c5b8d31d) SHA1(6c5b359e1fcf511c50d6a876946631fc38a6dade) )
- ROM_LOAD32_WORD_SWAP( "605b02.31m", 0x200002, 512*1024, CRC(94c3d835) SHA1(f48d34987fa6575a2c41d3ca3359e9e2cbc817e0) )
+ ROM_LOAD32_WORD_SWAP( "605uab03.29m", 0x200000, 512*1024, CRC(c5b8d31d) SHA1(6c5b359e1fcf511c50d6a876946631fc38a6dade) )
+ ROM_LOAD32_WORD_SWAP( "605uab02.31m", 0x200002, 512*1024, CRC(94c3d835) SHA1(f48d34987fa6575a2c41d3ca3359e9e2cbc817e0) )
/* data roms */
ROM_LOAD32_WORD_SWAP( "605a05.29r", 0x400000, 1024*1024, CRC(9bca4297) SHA1(c20be1ffcee8bd56f69d4fcc19d0035b3f74b8f2))
@@ -2627,8 +2627,8 @@ ROM_START( soccerss )
/* main program */
ROM_REGION( 0x800000, "maincpu", 0 )
GX_BIOS
- ROM_LOAD32_WORD_SWAP( "427ea_c02.28m", 0x200000, 512*1024, CRC(1817b218) SHA1(d69c70f0d8f1cbf385046c755a9533c01fe1eb4a) )
- ROM_LOAD32_WORD_SWAP( "427ea_c03.30m", 0x200002, 512*1024, CRC(8a17f509) SHA1(c3944b766499f2b6f217357159a02e54e44060c2) )
+ ROM_LOAD32_WORD_SWAP( "427eac02.28m", 0x200000, 512*1024, CRC(1817b218) SHA1(d69c70f0d8f1cbf385046c755a9533c01fe1eb4a) )
+ ROM_LOAD32_WORD_SWAP( "427eac03.30m", 0x200002, 512*1024, CRC(8a17f509) SHA1(c3944b766499f2b6f217357159a02e54e44060c2) )
/* data roms */
ROM_LOAD32_WORD_SWAP( "427a04.28r", 0x400000, 0x080000, CRC(c7d3e1a2) SHA1(5e1e4f4c97def36902ad853248014a7af62e0c5e) )
@@ -2686,8 +2686,8 @@ ROM_START( soccerssj )
/* main program */
ROM_REGION( 0x800000, "maincpu", 0 )
GX_BIOS
- ROM_LOAD32_WORD_SWAP( "427c02.28m", 0x200000, 512*1024, CRC(399fe89d) SHA1(e42cf87cff8cd421afd121621ba1f67c43f728ef) )
- ROM_LOAD32_WORD_SWAP( "427c03.30m", 0x200002, 512*1024, CRC(f9c6ab08) SHA1(371b05a3990436a16b77b3d58aa235202abe78db) )
+ ROM_LOAD32_WORD_SWAP( "427jac02.28m", 0x200000, 512*1024, CRC(399fe89d) SHA1(e42cf87cff8cd421afd121621ba1f67c43f728ef) )
+ ROM_LOAD32_WORD_SWAP( "427jac03.30m", 0x200002, 512*1024, CRC(f9c6ab08) SHA1(371b05a3990436a16b77b3d58aa235202abe78db) )
/* data roms */
ROM_LOAD32_WORD_SWAP( "427a04.28r", 0x400000, 0x080000, CRC(c7d3e1a2) SHA1(5e1e4f4c97def36902ad853248014a7af62e0c5e) )
diff --git a/src/mame/drivers/konendev.c b/src/mame/drivers/konendev.c
index f0af960ddc7..5b7099748b3 100644
--- a/src/mame/drivers/konendev.c
+++ b/src/mame/drivers/konendev.c
@@ -38,6 +38,8 @@
#include "cpu/powerpc/ppc.h"
#include "sound/ymz280b.h"
#include "video/k057714.h"
+#include "machine/nvram.h"
+#include "machine/eepromser.h"
class konendev_state : public driver_device
{
@@ -45,19 +47,28 @@ public:
konendev_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
- m_gcu(*this, "gcu")
+ m_gcu(*this, "gcu"),
+ m_eeprom(*this, "eeprom")
{ }
protected:
// devices
required_device<cpu_device> m_maincpu;
required_device<k057714_device> m_gcu;
+ required_device<eeprom_serial_93cxx_device> m_eeprom;
public:
DECLARE_DRIVER_INIT(konendev);
+ DECLARE_DRIVER_INIT(enchlamp);
DECLARE_READ32_MEMBER(mcu2_r);
DECLARE_READ32_MEMBER(ifu2_r);
+ DECLARE_READ32_MEMBER(unk_78800004_r);
+ DECLARE_READ32_MEMBER(unk_78a00000_r);
+ DECLARE_READ32_MEMBER(unk_78e00000_r);
+ DECLARE_WRITE32_MEMBER(eeprom_w);
+
+ DECLARE_WRITE_LINE_MEMBER(gcu_interrupt);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
@@ -71,15 +82,25 @@ READ32_MEMBER(konendev_state::mcu2_r)
{
UINT32 r = 0;
+ if (ACCESSING_BITS_24_31)
+ {
+ r |= 0x11000000; // MCU2 version
+ }
+ if (ACCESSING_BITS_16_23)
+ {
+ r |= (m_eeprom->do_read() ? 0x2 : 0) << 16;
+ }
if (ACCESSING_BITS_8_15)
{
r &= ~0x4000; // MCU2 presence
r &= ~0x2000; // IFU2 presence
- r &= ~0x1000; // FMU2 presence
+ r &= ~0x1000; // FMU2 presence
}
- if (ACCESSING_BITS_24_31)
+ if (ACCESSING_BITS_0_7)
{
- r |= 0x11000000; // MCU2 version
+ r |= 0x40; // logic door
+ r |= 0x04; // battery 1 status
+ r |= 0x10; // battery 2 status
}
return r;
@@ -97,14 +118,46 @@ READ32_MEMBER(konendev_state::ifu2_r)
return r;
}
+READ32_MEMBER(konendev_state::unk_78800004_r)
+{
+ return 0xffffffff;
+}
+
+READ32_MEMBER(konendev_state::unk_78a00000_r)
+{
+ return 0xffffffff;
+}
+
+READ32_MEMBER(konendev_state::unk_78e00000_r)
+{
+ return 0xffffffff;
+}
+
+WRITE32_MEMBER(konendev_state::eeprom_w)
+{
+ if (ACCESSING_BITS_0_7)
+ {
+ m_eeprom->di_write((data & 0x04) ? 1 : 0);
+ m_eeprom->clk_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE);
+ m_eeprom->cs_write((data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
+ }
+}
+
static ADDRESS_MAP_START( konendev_map, AS_PROGRAM, 32, konendev_state )
AM_RANGE(0x00000000, 0x00ffffff) AM_RAM
AM_RANGE(0x78000000, 0x78000003) AM_READ(mcu2_r)
+ AM_RANGE(0x78100000, 0x78100003) AM_WRITE(eeprom_w)
AM_RANGE(0x78800000, 0x78800003) AM_READ(ifu2_r)
+ AM_RANGE(0x78800004, 0x78800007) AM_READ(unk_78800004_r)
+ AM_RANGE(0x78a00000, 0x78a0001f) AM_READ(unk_78a00000_r)
+ AM_RANGE(0x78e00000, 0x78e00003) AM_READ(unk_78e00000_r)
// AM_RANGE(0x78000000, 0x78000003) AM_READNOP
// AM_RANGE(0x78100000, 0x7810001b) AM_RAM
// AM_RANGE(0x78a00014, 0x78a00017) AM_WRITENOP
+ AM_RANGE(0x79000000, 0x79000003) AM_DEVWRITE("gcu", k057714_device, fifo_w)
AM_RANGE(0x79800000, 0x798000ff) AM_DEVREADWRITE("gcu", k057714_device, read, write)
+ AM_RANGE(0x7a000000, 0x7a01ffff) AM_RAM AM_SHARE("nvram0")
+ AM_RANGE(0x7a100000, 0x7a11ffff) AM_RAM AM_SHARE("nvram1")
AM_RANGE(0x7e000000, 0x7f7fffff) AM_ROM AM_REGION("flash", 0)
AM_RANGE(0x7ff00000, 0x7fffffff) AM_ROM AM_REGION("program", 0)
ADDRESS_MAP_END
@@ -114,6 +167,12 @@ static INPUT_PORTS_START( konendev )
INPUT_PORTS_END
+WRITE_LINE_MEMBER(konendev_state::gcu_interrupt)
+{
+ m_maincpu->set_input_line(INPUT_LINE_IRQ0, state);
+}
+
+
static MACHINE_CONFIG_START( konendev, konendev_state )
/* basic machine hardware */
@@ -132,7 +191,12 @@ static MACHINE_CONFIG_START( konendev, konendev_state )
MCFG_SCREEN_PALETTE("palette")
MCFG_DEVICE_ADD("gcu", K057714, 0)
- MCFG_K057714_CPU_TAG("maincpu")
+ MCFG_K057714_IRQ_CALLBACK(WRITELINE(konendev_state, gcu_interrupt))
+
+ MCFG_NVRAM_ADD_0FILL("nvram0")
+ MCFG_NVRAM_ADD_0FILL("nvram1")
+
+ MCFG_EEPROM_SERIAL_93C56_ADD("eeprom")
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
@@ -152,6 +216,9 @@ ROM_START( enchlamp )
ROM_REGION32_BE( 0x1800000, "flash", ROMREGION_ERASE00 )
ROM_LOAD( "enl5r211.fmu.bin", 0x0000, 0x1800000, CRC(592c3c7f) SHA1(119b3c6223d656981c399c399d7edccfdbb50dc7) )
+
+ ROM_REGION32_BE( 0x100, "eeprom", 0 )
+ ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) ) // empty eeprom with Konami header
ROM_END
@@ -279,14 +346,25 @@ ROM_START( konzero )
ROM_LOAD32_WORD_SWAP( "rmclr_l.bin", 0x00002, 0x080000, CRC(2806299c) SHA1(a069f4477b310f99ff1ff48f622dc30862589127) )
ROM_REGION32_BE( 0x1800000, "flash", ROMREGION_ERASE00 )
+
+ ROM_REGION32_BE( 0x100, "eeprom", 0 )
+ ROM_LOAD( "93c56.u98", 0x00, 0x100, CRC(b2521a6a) SHA1(f44711545bee7e9c772a3dc23b79f0ea8059ec50) ) // empty eeprom with Konami header
ROM_END
DRIVER_INIT_MEMBER(konendev_state,konendev)
{
}
+DRIVER_INIT_MEMBER(konendev_state,enchlamp)
+{
+ UINT32 *rom = (UINT32*)memregion("program")->base();
+ rom[0x24/4] = 0x00002743; // patch flash checksum for now
+
+ rom[0] = 0xd43eb930; // new checksum for program rom
+}
+
// has a flash dump?
-GAME( 200?, enchlamp, 0, konendev, konendev, konendev_state, konendev, ROT0, "Konami", "Enchanted Lamp (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
+GAME( 200?, enchlamp, 0, konendev, konendev, konendev_state, enchlamp, ROT0, "Konami", "Enchanted Lamp (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
// missing flash but has other interesting files
GAME( 200?, whiterus, 0, konendev, konendev, konendev_state, konendev, ROT0, "Konami", "White Russia (Konami Endeavour)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c
index 47704031630..f4454127dc8 100644
--- a/src/mame/drivers/lethalj.c
+++ b/src/mame/drivers/lethalj.c
@@ -142,7 +142,6 @@ Pin #11(+) | | R |
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
#include "includes/lethalj.h"
-#include "machine/ticket.h"
#include "sound/okim6295.h"
@@ -162,7 +161,7 @@ Pin #11(+) | | R |
CUSTOM_INPUT_MEMBER(lethalj_state::cclownz_paddle)
{
- int value = ioport("PADDLE")->read();
+ int value = m_paddle->read();
return ((value << 4) & 0xf00) | (value & 0x00f);
}
@@ -177,14 +176,14 @@ CUSTOM_INPUT_MEMBER(lethalj_state::cclownz_paddle)
WRITE16_MEMBER(lethalj_state::ripribit_control_w)
{
coin_counter_w(machine(), 0, data & 1);
- machine().device<ticket_dispenser_device>("ticket")->write(space, 0, ((data >> 1) & 1) << 7);
+ m_ticket->write(space, 0, ((data >> 1) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
}
WRITE16_MEMBER(lethalj_state::cfarm_control_w)
{
- machine().device<ticket_dispenser_device>("ticket")->write(space, 0, ((data >> 0) & 1) << 7);
+ m_ticket->write(space, 0, ((data >> 0) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
output_set_lamp_value(1, (data >> 3) & 1);
output_set_lamp_value(2, (data >> 4) & 1);
@@ -194,7 +193,7 @@ WRITE16_MEMBER(lethalj_state::cfarm_control_w)
WRITE16_MEMBER(lethalj_state::cclownz_control_w)
{
- machine().device<ticket_dispenser_device>("ticket")->write(space, 0, ((data >> 0) & 1) << 7);
+ m_ticket->write(space, 0, ((data >> 0) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
output_set_lamp_value(1, (data >> 4) & 1);
output_set_lamp_value(2, (data >> 5) & 1);
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 5d63550de55..840da8b536b 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -51,7 +51,7 @@ INTERRUPT_GEN_MEMBER(mainevt_state::dv_interrupt)
WRITE8_MEMBER(mainevt_state::mainevt_bankswitch_w)
{
/* bit 0-1 ROM bank select */
- membank("bank1")->set_entry(data & 0x03);
+ m_rombank->set_entry(data & 0x03);
/* TODO: bit 5 = select work RAM or palette? */
//palette_selected = data & 0x20;
@@ -170,7 +170,7 @@ static ADDRESS_MAP_START( mainevt_map, AS_PROGRAM, 8, mainevt_state )
AM_RANGE(0x4000, 0x5dff) AM_RAM
AM_RANGE(0x5e00, 0x5fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
+ AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -194,7 +194,7 @@ static ADDRESS_MAP_START( devstors_map, AS_PROGRAM, 8, mainevt_state )
AM_RANGE(0x4000, 0x5dff) AM_RAM
AM_RANGE(0x5e00, 0x5fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
- AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bank1")
+ AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank")
AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END
@@ -380,9 +380,7 @@ WRITE8_MEMBER(mainevt_state::volume_callback)
void mainevt_state::machine_start()
{
- UINT8 *ROM = memregion("maincpu")->base();
-
- membank("bank1")->configure_entries(0, 4, &ROM[0x10000], 0x2000);
+ m_rombank->configure_entries(0, 4, memregion("maincpu")->base(), 0x2000);
save_item(NAME(m_nmi_enable));
}
@@ -428,14 +426,13 @@ static MACHINE_CONFIG_START( mainevt, mainevt_state )
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_VIDEO_START_OVERRIDE(mainevt_state,mainevt)
-
MCFG_DEVICE_ADD("k052109", K052109, 0)
MCFG_GFX_PALETTE("palette")
MCFG_K052109_CB(mainevt_state, mainevt_tile_callback)
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(mainevt_state, mainevt_sprite_callback)
/* sound hardware */
@@ -475,14 +472,13 @@ static MACHINE_CONFIG_START( devstors, mainevt_state )
MCFG_PALETTE_ENABLE_SHADOWS()
MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR)
- MCFG_VIDEO_START_OVERRIDE(mainevt_state,dv)
-
MCFG_DEVICE_ADD("k052109", K052109, 0)
MCFG_GFX_PALETTE("palette")
MCFG_K052109_CB(mainevt_state, dv_tile_callback)
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(mainevt_state, dv_sprite_callback)
MCFG_K051733_ADD("k051733")
@@ -510,11 +506,10 @@ MACHINE_CONFIG_END
ROM_START( mainevt ) /* 4 players - English title screen - No "Warning" message in the ROM */
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "799y02.k11", 0x10000, 0x08000, CRC(e2e7dbd5) SHA1(80314cd42a9f47f7bb82a2160fb5ef2ddc6dff30) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "799y02.k11", 0x00000, 0x10000, CRC(e2e7dbd5) SHA1(80314cd42a9f47f7bb82a2160fb5ef2ddc6dff30) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "799c01.f7", 0x00000, 0x08000, CRC(447c4c5c) SHA1(86e42132793c59cc6feece143516f7ecd4ed14e8) )
ROM_REGION( 0x20000, "k052109", 0 ) /* tiles */
@@ -538,11 +533,10 @@ ROM_START( mainevt ) /* 4 players - English title screen - No "Warning" messa
ROM_END
ROM_START( mainevto ) /* 4 players - English title screen - No "Warning" message in the ROM */
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "799f02.k11", 0x10000, 0x08000, CRC(c143596b) SHA1(5da7efaf0f7c7a493cc242eae115f278bc9c134b) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "799f02.k11", 0x00000, 0x10000, CRC(c143596b) SHA1(5da7efaf0f7c7a493cc242eae115f278bc9c134b) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "799c01.f7", 0x00000, 0x08000, CRC(447c4c5c) SHA1(86e42132793c59cc6feece143516f7ecd4ed14e8) )
ROM_REGION( 0x20000, "k052109", 0 ) /* tiles */
@@ -566,11 +560,10 @@ ROM_START( mainevto ) /* 4 players - English title screen - No "Warning" messa
ROM_END
ROM_START( mainevt2p ) /* 2 players - English title screen - "Warning" message in the ROM (not displayed) */
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "799x02.k11", 0x10000, 0x08000, CRC(42cfc650) SHA1(2d1918ebc0d93a2356ad995a6854dbde7c3b8daf) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "799x02.k11", 0x00000, 0x10000, CRC(42cfc650) SHA1(2d1918ebc0d93a2356ad995a6854dbde7c3b8daf) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "799c01.f7", 0x00000, 0x08000, CRC(447c4c5c) SHA1(86e42132793c59cc6feece143516f7ecd4ed14e8) )
ROM_REGION( 0x20000, "k052109", 0 ) /* tiles */
@@ -594,11 +587,10 @@ ROM_START( mainevt2p ) /* 2 players - English title screen - "Warning" message
ROM_END
ROM_START( ringohja ) /* 2 players - Japan title screen - "Warning" message in the ROM (displayed) */
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "799n02.k11", 0x10000, 0x08000, CRC(f9305dd0) SHA1(7135053be9d46ac9c09ab63eca1eb71825a71a13) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "799n02.k11", 0x00000, 0x10000, CRC(f9305dd0) SHA1(7135053be9d46ac9c09ab63eca1eb71825a71a13) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "799c01.f7", 0x00000, 0x08000, CRC(447c4c5c) SHA1(86e42132793c59cc6feece143516f7ecd4ed14e8) )
ROM_REGION( 0x20000, "k052109", 0 ) /* tiles */
@@ -623,11 +615,10 @@ ROM_END
ROM_START( devstors )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "890z02.k11", 0x10000, 0x08000, CRC(ebeb306f) SHA1(838fcfe95dfedd61f21f34301d48e337db765ab2) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "890z02.k11", 0x00000, 0x10000, CRC(ebeb306f) SHA1(838fcfe95dfedd61f21f34301d48e337db765ab2) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "890k01.f7", 0x00000, 0x08000, CRC(d44b3eb0) SHA1(26109fc56668b65f1a5aa6d8ec2c08fd70ca7c51) )
ROM_REGION( 0x40000, "k052109", 0 ) /* tiles */
@@ -648,11 +639,10 @@ ROM_START( devstors )
ROM_END
ROM_START( devstors2 )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "890x02.k11", 0x10000, 0x08000, CRC(e58ebb35) SHA1(4253b6a7128534cc0866bc910a271d91ac8b40fd) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "890x02.k11", 0x00000, 0x10000, CRC(e58ebb35) SHA1(4253b6a7128534cc0866bc910a271d91ac8b40fd) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "890k01.f7", 0x00000, 0x08000, CRC(d44b3eb0) SHA1(26109fc56668b65f1a5aa6d8ec2c08fd70ca7c51) )
ROM_REGION( 0x40000, "k052109", 0 ) /* tiles */
@@ -673,11 +663,10 @@ ROM_START( devstors2 )
ROM_END
ROM_START( devstors3 )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "890v02.k11", 0x10000, 0x08000, CRC(52f4ccdd) SHA1(074e526ed170a5f2083c8c0808734291a2ea7403) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "890v02.k11", 0x00000, 0x10000, CRC(52f4ccdd) SHA1(074e526ed170a5f2083c8c0808734291a2ea7403) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "890k01.f7", 0x00000, 0x08000, CRC(d44b3eb0) SHA1(26109fc56668b65f1a5aa6d8ec2c08fd70ca7c51) )
ROM_REGION( 0x40000, "k052109", 0 ) /* tiles */
@@ -698,11 +687,10 @@ ROM_START( devstors3 )
ROM_END
ROM_START( garuka )
- ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD( "890w02.k11", 0x10000, 0x08000, CRC(b2f6f538) SHA1(95dad3258a2e4c5648d0fc22c06fa3e2da3b5ed1) )
- ROM_CONTINUE( 0x08000, 0x08000 )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "890w02.k11", 0x00000, 0x10000, CRC(b2f6f538) SHA1(95dad3258a2e4c5648d0fc22c06fa3e2da3b5ed1) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x8000, "audiocpu", 0 )
ROM_LOAD( "890k01.f7", 0x00000, 0x08000, CRC(d44b3eb0) SHA1(26109fc56668b65f1a5aa6d8ec2c08fd70ca7c51) )
ROM_REGION( 0x40000, "k052109", 0 ) /* tiles */
diff --git a/src/mame/drivers/mediagx.c b/src/mame/drivers/mediagx.c
index 429dc44d622..57cca0c4b97 100644
--- a/src/mame/drivers/mediagx.c
+++ b/src/mame/drivers/mediagx.c
@@ -287,7 +287,7 @@ void mediagx_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &clip
m_frame_height = height;
visarea.set(0, width - 1, 0, height - 1);
- m_screen->configure(width, height * 262 / 240, visarea, m_screen->frame_period().attoseconds);
+ m_screen->configure(width, height * 262 / 240, visarea, m_screen->frame_period().attoseconds());
}
if (m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // 8-bit mode
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index ff2f41a9e36..67cf8e126ab 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -1213,10 +1213,21 @@ Entering the Setup menu "S":
Is the "Stand" & "Hi-Score" keys the same? Without a separate Stand key, you cannot set up the "TWIN" bonus feature
+REPLAYS - You start with 1 star per coin up to a maximum 15 stars. One star is deducted for each losing hand including
+ busting on Double-ups while stars are added for winning hands. Running out of stars forces the player to add
+ at least 1 more coin to continue to play EVEN if the player still has points available to use.
+
*/
ROM_START( americna ) /* Uses a small daughter card CRT-251 & Dallas DS1225Y NV SRAM */
ROM_REGION( 0x80000, "maincpu", 0 )
- ROM_LOAD( "9131-00_u9-2.u9", 0x00000, 0x10000, CRC(8a741fb6) SHA1(2d77c67e5a0bdaf6199c31c4055df214672db3e1) ) /* 9131-00 U9-2 888020 */
+ ROM_LOAD( "9131-01_u9-2.u9", 0x00000, 0x10000, CRC(0410a1bf) SHA1(1218cf4b3d1067777841673620c84406cce418fb) ) /* 9131-01 U9-2 888020 - Has REPLAYS feature */
+ ROM_LOAD( "9131-00_u10-0.u10", 0x10000, 0x10000, CRC(d6f72934) SHA1(4f3d6a5227a3b0fc298533a03cc0a32f8e2f3840) )
+ ROM_LOAD( "9131-00_u11-0.u11", 0x20000, 0x10000, CRC(f2db6f5d) SHA1(3f734a7e8c72c14bf4a3e6f595819311739394d3) )
+ROM_END
+
+ROM_START( americnaa ) /* Uses a small daughter card CRT-251 & Dallas DS1225Y NV SRAM */
+ ROM_REGION( 0x80000, "maincpu", 0 )
+ ROM_LOAD( "9131-00_u9-2.u9", 0x00000, 0x10000, CRC(8a741fb6) SHA1(2d77c67e5a0bdaf6199c31c4055df214672db3e1) ) /* 9131-00 U9-2 888020 - Doesn't have REPLAYS feature */
ROM_LOAD( "9131-00_u10-0.u10", 0x10000, 0x10000, CRC(d6f72934) SHA1(4f3d6a5227a3b0fc298533a03cc0a32f8e2f3840) )
ROM_LOAD( "9131-00_u11-0.u11", 0x20000, 0x10000, CRC(f2db6f5d) SHA1(3f734a7e8c72c14bf4a3e6f595819311739394d3) )
ROM_END
@@ -1227,12 +1238,12 @@ This set seems odd, it doesn't really have a title sequence.
Same keys as Americana & same Stand / Hi-Score issue
-C1988 MII on the labels
+This set also has additional bonuses for certain winning hands, but requires a minimum 10 point bet to qualify for any bonus.
*/
ROM_START( meritjp ) /* Uses a small daughter card CRT-255 & Dallas DS1225Y NV SRAM */
ROM_REGION( 0x80000, "maincpu", 0 )
- ROM_LOAD( "9131-01_u9-00.u9", 0x00000, 0x10000, CRC(dadaac6a) SHA1(798068f3cef6f5d41dd8ee4315e220932f31a3f7) ) /* 9131-01 U9-00 */
+ ROM_LOAD( "9131-01_u9-00.u9", 0x00000, 0x10000, CRC(dadaac6a) SHA1(798068f3cef6f5d41dd8ee4315e220932f31a3f7) ) /* 9131-01 U9-00 - Has REPLAYS feature */
ROM_LOAD( "9131-01_u10-r0.u10", 0x10000, 0x10000, CRC(ebee75e2) SHA1(1ba1c92684d0f5251bb5b57a29b39467b57a1170) )
ROM_LOAD( "9131-01_u11-r0.u11", 0x20000, 0x10000, CRC(f2db6f5d) SHA1(3f734a7e8c72c14bf4a3e6f595819311739394d3) )
ROM_END
@@ -2293,8 +2304,9 @@ DRIVER_INIT_MEMBER(meritm_state,megat3te)
}
/* CRT-250 */
-GAME( 1987, americna, 0, meritm_crt250, americna, driver_device, 0, ROT0, "Merit", "Americana (9131-00)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1988, meritjp, 0, meritm_crt250, americna, driver_device, 0, ROT0, "Merit", "Merit Joker Poker (9131-01)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1987, americna, 0, meritm_crt250, americna, driver_device, 0, ROT0, "Merit", "Americana (9131-01)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1987, americnaa, americna, meritm_crt250, americna, driver_device, 0, ROT0, "Merit", "Americana (9131-00)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1988, meritjp, 0, meritm_crt250, americna, driver_device, 0, ROT0, "Merit", "Merit Joker Poker (9131-01)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1988, dodgecty, 0, meritm_crt250, dodgecty, driver_device, 0, ROT0, "Merit", "Dodge City (9131-02)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1988, pitboss2, 0, meritm_crt250, pitboss2, driver_device, 0, ROT0, "Merit", "Pit Boss II (9221-01C)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1988, spitboss, 0, meritm_crt250, spitboss, driver_device, 0, ROT0, "Merit", "Super Pit Boss (9221-02A)", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/minivadr.c b/src/mame/drivers/minivadr.c
index b8256fc5b8f..780959845f5 100644
--- a/src/mame/drivers/minivadr.c
+++ b/src/mame/drivers/minivadr.c
@@ -10,6 +10,28 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/12/19 -
This is a test board sold together with the cabinet (as required by law in
Japan). It has no sound.
+PCB Layout
+----------
+
+K11X0622A
+MINI VADERS
+|-------------------------|
+|MB3771 24MHz |
+|LS32 74F74 |
+|LS139 |
+|D26_01.IC7 LS244 J|
+|Z80 LS244 A|
+|LS86 LS08 LS373 M|
+|LS157 LS157 LS161 LS161 M|
+|LS157 LS157 LS161 LS161 A|
+|6116 LS157 LS08 |
+|LS74 LS74 LS74 LS157 |
+|-------------------------|
+Notes: (all ICs shown)
+ Z80 - Clock 4MHz [24/6]
+ 6116 - 2Kbx8 SRAM
+ D26_01.IC7 - 27C64 8Kbx8 EPROM
+
***************************************************************************/
#include "emu.h"
diff --git a/src/mame/drivers/monzagp.c b/src/mame/drivers/monzagp.c
index 9534a4346d3..f95264f2423 100644
--- a/src/mame/drivers/monzagp.c
+++ b/src/mame/drivers/monzagp.c
@@ -31,7 +31,9 @@ Lower board (MGP_01):
#include "emu.h"
#include "cpu/mcs48/mcs48.h"
+#include "machine/nvram.h"
+#include "monzagp.lh"
class monzagp_state : public driver_device
{
@@ -41,6 +43,7 @@ public:
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_nvram(*this, "nvram"),
m_gfx1(*this, "gfx1"),
m_tile_attr(*this, "unk1"),
m_proms(*this, "proms"),
@@ -49,26 +52,20 @@ public:
m_dsw(*this, "DSW")
{ }
- UINT8 m_p1;
- UINT8 m_p2;
- UINT8 *m_vram;
- int m_screenw;
- int m_bank;
-
- DECLARE_READ8_MEMBER(rng_r);
DECLARE_READ8_MEMBER(port_r);
DECLARE_WRITE8_MEMBER(port_w);
- DECLARE_WRITE8_MEMBER(port0_w);
DECLARE_WRITE8_MEMBER(port1_w);
DECLARE_WRITE8_MEMBER(port2_w);
DECLARE_READ8_MEMBER(port2_r);
DECLARE_WRITE8_MEMBER(port3_w);
virtual void video_start();
+ TIMER_DEVICE_CALLBACK_MEMBER(time_tick_timer);
DECLARE_PALETTE_INIT(monzagp);
UINT32 screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<nvram_device> m_nvram;
required_memory_region m_gfx1;
required_memory_region m_tile_attr;
required_memory_region m_proms;
@@ -76,50 +73,43 @@ public:
required_ioport m_in1;
required_ioport m_dsw;
+private:
+ UINT8 m_p1;
+ UINT8 m_p2;
UINT8 m_video_ctrl[2][8];
+ bool m_time_tick;
+ bool m_cp_ruote;
+ UINT8 m_mycar_pos;
+ UINT8 *m_vram;
+ UINT8 *m_score_ram;
};
+TIMER_DEVICE_CALLBACK_MEMBER(monzagp_state::time_tick_timer)
+{
+ m_time_tick = !m_time_tick;
+}
+
PALETTE_INIT_MEMBER(monzagp_state, monzagp)
{
}
void monzagp_state::video_start()
{
- m_screenw = 80;
- m_vram = auto_alloc_array(machine(), UINT8, 0x10000);
+ m_vram = auto_alloc_array(machine(), UINT8, 0x800);
+ m_score_ram = auto_alloc_array(machine(), UINT8, 0x100);
+ m_time_tick = 0;
+ m_cp_ruote = 0;
+ m_mycar_pos = 7*16;
+ save_pointer(NAME(m_vram), 0x800);
+ save_pointer(NAME(m_score_ram), 0x100);
+
+ m_nvram->set_base(m_score_ram, 0x100);
}
UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- int x,y;
-
- if(machine().input().code_pressed_once(KEYCODE_Z))
- m_bank--;
-
- if(machine().input().code_pressed_once(KEYCODE_X))
- m_bank++;
-
- if(machine().input().code_pressed_once(KEYCODE_Q))
- {
- m_screenw--;
- printf("%x\n",m_screenw);
- }
-
- if(machine().input().code_pressed_once(KEYCODE_W))
- {
- m_screenw++;
- printf("%x\n",m_screenw);
- }
-
- if(machine().input().code_pressed_once(KEYCODE_A))
- {
- FILE * p=fopen("vram.bin","wb");
- fwrite(&m_vram[0],1,0x10000,p);
- fclose(p);
- }
-
/*
for(int i=0;i<8;i++)
printf("%02x ", m_video_ctrl[0][i]);
@@ -135,17 +125,18 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16
UINT8 *tile_table = m_proms->base() + 0x100;
UINT8 start_tile = m_video_ctrl[0][0] >> 5;
- for(y=0; y<8; y++)
+ for(int y=0; y<8; y++)
{
UINT16 start_x = ((m_video_ctrl[0][3] << 8) | m_video_ctrl[0][2]) ^ 0xffff;
bool inv = y > 3;
- for(x=0;x<64;x++)
+ for(int x=0;x<64;x++)
{
UINT8 tile_attr = m_tile_attr->base()[((start_x >> 5) & 0x07) | (((start_x >> 8) & 0x3f) << 3) | ((start_x >> 6) & 0x200)];
//if (tile_attr & 0x10) printf("dark on\n");
//if (tile_attr & 0x20) printf("light on\n");
+ //if (tile_attr & 0x40) printf("bridge\n");
int tile_idx = tile_table[((tile_attr & 0x0f) << 4) | (inv ? 0x08 : 0) | (start_tile & 0x07)];
int tile = (tile_idx << 3) | (((start_x) >> 2) & 0x07);
@@ -165,10 +156,32 @@ UINT32 monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind16
start_tile--;
}
+ // my car sprite
+ if (m_video_ctrl[1][3] & 0x18)
+ {
+ int start_sprite = (((m_video_ctrl[1][3] & 0x18)) << 3) | (m_video_ctrl[1][3] & 0x06);
+
+ if (m_cp_ruote && (m_video_ctrl[1][3] & 0x0e) == 0)
+ start_sprite |= 0x02;
+
+ for(int y=0; y<2; y++)
+ for(int x=0; x<4*8; x+=4)
+ {
+ int sprite = start_sprite | ((x << 1) & 0x38);
+
+ m_gfxdecode->gfx(1)->transpen(bitmap,cliprect,
+ (sprite ^ 0x06) + y,
+ 0,
+ 0, 0,
+ m_video_ctrl[1][2] + x, m_mycar_pos + (1 - y) * 16,
+ 3);
+ }
+ }
+
// characters
- for(y=0;y<256;y++)
+ for(int y=0;y<26;y++)
{
- for(x=0;x<256;x++)
+ for(int x=0;x<40;x++)
{
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
m_vram[y*40+x],
@@ -186,10 +199,6 @@ static ADDRESS_MAP_START( monzagp_map, AS_PROGRAM, 8, monzagp_state )
AM_RANGE(0x0000, 0x0fff) AM_ROM
ADDRESS_MAP_END
-READ8_MEMBER(monzagp_state::rng_r)
-{
- return machine().rand();
-}
READ8_MEMBER(monzagp_state::port_r)
{
@@ -226,12 +235,20 @@ READ8_MEMBER(monzagp_state::port_r)
}
if (!(m_p1 & 0x40)) // digits
{
+ data = m_score_ram[BITSWAP8(offset, 3,2,1,0,7,6,5,4)];
//printf("ext 6 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
}
if (!(m_p1 & 0x80))
{
//printf("ext 7 r P1:%02x P2:%02x %02x\n", m_p1, m_p2, offset);
data = 0;
+ if(machine().input().code_pressed(KEYCODE_1_PAD)) data |= 0x01;
+ if(machine().input().code_pressed(KEYCODE_2_PAD)) data |= 0x02;
+ if(machine().input().code_pressed(KEYCODE_3_PAD)) data |= 0x04;
+ if(machine().input().code_pressed(KEYCODE_4_PAD)) data |= 0x08;
+
+ if (m_time_tick)
+ data |= 0x10;
}
return data;
@@ -253,6 +270,13 @@ WRITE8_MEMBER(monzagp_state::port_w)
if (!(m_p1 & 0x04)) // GFX
{
//printf("ext 2 w P1:%02x P2:%02x, %02x = %02x\n", m_p1, m_p2, offset, data);
+ int addr = ((m_p2 & 0x7f) << 5) | (offset & 0x1f);
+ if (addr < 0x400)
+ {
+ static int pt[] = { 0x0e, 0x0c, 0x0d, 0x08, 0x09, 0x0a, 0x0b, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x0f };
+ m_gfx1->base()[addr] = (pt[(data >> 4) & 0x0f] << 4) | pt[data & 0x0f];
+ m_gfxdecode->gfx(0)->mark_dirty(addr >> 4);
+ }
}
if (!(m_p1 & 0x08))
{
@@ -269,6 +293,15 @@ WRITE8_MEMBER(monzagp_state::port_w)
if (!(m_p1 & 0x40)) // digits
{
//printf("ext 6 w P1:%02x P2:%02x, %02x = %02x\n", m_p1, m_p2, offset, data);
+ offs_t ram_offset = BITSWAP8(offset, 3,2,1,0,7,6,5,4);
+ m_score_ram[ram_offset] = data & 0x0f;
+
+ if ((ram_offset & 0x07) == 0)
+ {
+ // 74LS47 BCD-to-Seven-Segment Decoder
+ static UINT8 bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0x58, 0x4c, 0x62, 0x49, 0x78, 0x00 };
+ output_set_digit_value(ram_offset >> 3, bcd2hex[data & 0x0f]);
+ }
}
if (!(m_p1 & 0x80))
{
@@ -278,11 +311,6 @@ WRITE8_MEMBER(monzagp_state::port_w)
}
}
-WRITE8_MEMBER(monzagp_state::port0_w)
-{
-// printf("P0 %x = %x\n",space.device().safe_pc(),data);
-}
-
WRITE8_MEMBER(monzagp_state::port1_w)
{
// printf("P1 %x = %x\n",space.device().safe_pc(),data);
@@ -303,10 +331,8 @@ WRITE8_MEMBER(monzagp_state::port2_w)
static ADDRESS_MAP_START( monzagp_io, AS_IO, 8, monzagp_state )
AM_RANGE(0x00, 0xff) AM_READWRITE(port_r, port_w)
- AM_RANGE(MCS48_PORT_P0, MCS48_PORT_P0) AM_WRITE(port0_w)
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(port1_w)
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(port2_r, port2_w)
- AM_RANGE(0x104, 0x104) AM_READ(rng_r)
ADDRESS_MAP_END
static INPUT_PORTS_START( monzagp )
@@ -402,6 +428,10 @@ static MACHINE_CONFIG_START( monzagp, monzagp_state )
MCFG_PALETTE_INIT_OWNER(monzagp_state, monzagp)
MCFG_GFXDECODE_ADD("gfxdecode", "palette", monzagp)
+
+ MCFG_TIMER_DRIVER_ADD_PERIODIC("time_tick_timer", monzagp_state, time_tick_timer, attotime::from_hz(4))
+
+ MCFG_NVRAM_ADD_NO_FILL("nvram")
MACHINE_CONFIG_END
ROM_START( monzagp )
@@ -416,10 +446,10 @@ ROM_START( monzagp )
ROM_LOAD( "11.8d", 0x0800, 0x0400, CRC(47607a83) SHA1(91ce272c4af3e1994db71d2239b68879dd279347) )
ROM_REGION( 0x1000, "gfx2", 0 )
- ROM_LOAD( "7.3f", 0x0000, 0x0400, CRC(08f29f60) SHA1(9ca454e848aa986ff9eccaead3fec5076df2e4d3) )
- ROM_LOAD( "8.1f", 0x0400, 0x0400, CRC(99ce2753) SHA1(f4540700ea909ba1be34ac2c33dafd8ec67a2bb7) )
- ROM_LOAD( "6.4f", 0x0800, 0x0400, CRC(934d2070) SHA1(e742bfcb910e8747780d32ca66efd7e343190fb4) )
- ROM_LOAD( "9.10j", 0x0c00, 0x0400, CRC(474ab63f) SHA1(6ba623d1768ed92b39e8f76c2f2eed7874955f1b) )
+ ROM_LOAD( "9.10j", 0x0000, 0x0400, CRC(474ab63f) SHA1(6ba623d1768ed92b39e8f76c2f2eed7874955f1b) )
+ ROM_LOAD( "6.4f", 0x0400, 0x0400, CRC(934d2070) SHA1(e742bfcb910e8747780d32ca66efd7e343190fb4) )
+ ROM_LOAD( "7.3f", 0x0800, 0x0400, CRC(08f29f60) SHA1(9ca454e848aa986ff9eccaead3fec5076df2e4d3) )
+ ROM_LOAD( "8.1f", 0x0c00, 0x0400, CRC(99ce2753) SHA1(f4540700ea909ba1be34ac2c33dafd8ec67a2bb7) )
ROM_REGION( 0x1000, "gfx3", 0 )
ROM_LOAD( "5.9f", 0x0000, 0x0400, CRC(5abd1ef6) SHA1(1bc79225c1be2821930fdb8e821a70c7ac8683ab) )
@@ -453,10 +483,10 @@ ROM_START( monzagpb )
ROM_LOAD( "m11.8d", 0x0800, 0x0400, CRC(5b4a7ffa) SHA1(50fa073437febe516065cd83fbaf85b596c4f3c8) ) /* differs from above */
ROM_REGION( 0x1000, "gfx2", 0 )
- ROM_LOAD( "m7.3f", 0x0000, 0x0400, CRC(08f29f60) SHA1(9ca454e848aa986ff9eccaead3fec5076df2e4d3) )
- ROM_LOAD( "m8.1f", 0x0400, 0x0400, CRC(99ce2753) SHA1(f4540700ea909ba1be34ac2c33dafd8ec67a2bb7) )
- ROM_LOAD( "m6.4f", 0x0800, 0x0400, CRC(934d2070) SHA1(e742bfcb910e8747780d32ca66efd7e343190fb4) )
- ROM_LOAD( "m9.10j", 0x0c00, 0x0400, CRC(474ab63f) SHA1(6ba623d1768ed92b39e8f76c2f2eed7874955f1b) )
+ ROM_LOAD( "m9.10j", 0x0000, 0x0400, CRC(474ab63f) SHA1(6ba623d1768ed92b39e8f76c2f2eed7874955f1b) )
+ ROM_LOAD( "m6.4f", 0x0400, 0x0400, CRC(934d2070) SHA1(e742bfcb910e8747780d32ca66efd7e343190fb4) )
+ ROM_LOAD( "m7.3f", 0x0800, 0x0400, CRC(08f29f60) SHA1(9ca454e848aa986ff9eccaead3fec5076df2e4d3) )
+ ROM_LOAD( "m8.1f", 0x0c00, 0x0400, CRC(99ce2753) SHA1(f4540700ea909ba1be34ac2c33dafd8ec67a2bb7) )
ROM_REGION( 0x1000, "gfx3", 0 )
ROM_LOAD( "m5.9f", 0x0000, 0x0400, CRC(5abd1ef6) SHA1(1bc79225c1be2821930fdb8e821a70c7ac8683ab) )
@@ -478,5 +508,5 @@ ROM_START( monzagpb )
ROM_END
-GAME( 1981, monzagp, 0, monzagp, monzagp, driver_device, 0, ROT270, "Olympia", "Monza GP", MACHINE_NOT_WORKING|MACHINE_NO_SOUND )
-GAME( 1981, monzagpb, monzagp, monzagp, monzagp, driver_device, 0, ROT270, "bootleg", "Monza GP (bootleg)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND )
+GAMEL( 1981, monzagp, 0, monzagp, monzagp, driver_device, 0, ROT270, "Olympia", "Monza GP", MACHINE_NOT_WORKING|MACHINE_NO_SOUND, layout_monzagp )
+GAMEL( 1981, monzagpb, monzagp, monzagp, monzagp, driver_device, 0, ROT270, "bootleg", "Monza GP (bootleg)", MACHINE_NOT_WORKING|MACHINE_NO_SOUND, layout_monzagp )
diff --git a/src/mame/drivers/namcops2.c b/src/mame/drivers/namcops2.c
index b503ceb2765..e9cb86f7e21 100644
--- a/src/mame/drivers/namcops2.c
+++ b/src/mame/drivers/namcops2.c
@@ -80,6 +80,380 @@ List of Namco System 256 Games
List of System Super 256 Games
* Time Crisis 4 (Namco, 2006)
+
+Namco System 246 readme (earliest type using standard PS2 main board)
+-----------------------
+The info below covers the first version of Namco System 246 hardware used with
+games including Ridge Racer V, Wangan Midnight, Vampire Night and Bloody Roar 3.
+It uses a standard Japanese COH-H30000 Playstation 2 main board (GH-004).
+A later model Playstation 2 main board COH-H31000 (GH-006) has also been tested and works fine.
+The PS2 main board is interfaced to the Namco MOTHER PCB via a small adapter board.
+The boot ROM is inside a MagicGate security cart and plugs into the memory cart slot.
+After the boot ROM loads, some of the game data is loaded from CDROM and stored in the
+RAM32 PCB. However, the CDROM is continually accessed as the game plays.
+The CDROM drive is a TEAC CD-540E.
+
+
+PCB Layouts
+===========
+
+Namco Interface Board (1st version)
+---------------------
+This PCB is used with Ridge Racer V and Wangan Midnight.
+
+System 246 MOTHER PCB
+8908960202 (8908970202)
+|------------------------------------------------------------------------------|
+|J1 ADM485 Ti6734 |------| J12 |
+| 6358N TMP95C061 | C448 | |
+| MAX232 | | |
+|J2 |------| |
+| CY7C199 |
+| K4S281632 |
+| CXA2055P K4S281632 |
+| J11 |
+|J3 66.666MHz |
+| J13 |--------| J10 |
+| EPM3128 |ALTERA | |
+| |EP20K100E |
+|J4 LC35256 |QC208 | |
+| |--------| |
+| |
+| |
+| J6 |
+| |
+|J5 BATTERY PQ30RV31 |
+| J7 J8 J9 |
+|------------------------------------------------------------------------------|
+Notes:
+ J1 - USB connector (not used)
+ J2 - Two RCA jacks for stereo audio output
+ J3/J4 - DSUB15 VGA output connectors
+ J5 - 3-pin connector (joins to V257 STR PCB to J104)
+ J6 - Multi-pin connector (PS2 interface adapter plugged in here)
+ J7 - Playstation 2 video cable connector (input)
+ J8 - 2-pin power connector (+5V input)
+ J9 - 40-pin IDE flat cable connector for CDROM drive
+ J10 - Multi-pin connector (this is the same as the J9 connector on the 2nd version, not used)
+ J11 - Multi-pin connector (RAM32 PCB plugged in here, same as J10 on 2nd version)
+ J12 - Multi-pin connector (this is the same as the J8 connector on the 2nd version, not used)
+ J13 - 6-pin connector for programming EPM3128 CPLD (not populated)
+TMP95C061 - Toshiba TMP95C061 TLCS-900-series 16-bit Microcontroller (internal RAM/ROM = none)
+ C448 - Namco Custom C448
+ EPM3128 - Altera MAX EMP3128ATC100-10 CPLD labelled 'P2AMO1'
+ CXA2055P - Sony CXA2055P Video Amplifier IC
+ Ti6734 - Texas Instruments LMH6734 Single Supply, Ultra High-Speed, Triple Selectable Gain Buffer
+ 6358N - Sanyo 6358N High-Performance Dual Operational Amplifier
+ PQ30RV31 - Sharp PQ30RV31 Voltage Regulator
+ CY7C199 - Cypress CY7C199-15VC 32k x8-bit SRAM
+ LC35256 - Sanyo LC35256DM70 32k x8-bit SRAM
+ EP20K100 - Altera APEX EP20K100EQC208-2X FPGA
+K4S281632 - Samsung K4S281632B-TC1H 8M x16-bit SDRAM
+ ADM485 - Analog Devices ADM485 5V Low Power EIA RS-485 Transceiver
+ MAX232 - Maxim MAX232 dual serial to TTL logic level driver/receiver
+
+
+Namco Interface Board (2nd version)
+---------------------
+This PCB is used with Bloody Roar 3 and Vampire Night.
+
+System 246 MOTHER(A) PCB
+8908961500 (8908971500)
+|------------------------------------------------------------------------------|
+| |------| BATTERY |
+| J2 TMP95C061 | C448 | |
+|J1 | | LC35256 |
+| |------| K4S281632 |
+| 66.666MHz K4S281632 |
+| J11 CY7C199 |
+| EPM3128 |--------| J10 |
+| |ALTERA | |
+| |EP20K100E |
+| |QC208 | J9 |
+| |--------| |
+| Ti6734 |
+| |
+| SP232EET 6358N |
+| |
+|J3 J4 J8 |
+| |
+| CXA2055P |
+| PQ30RV31 |
+| J5 J6 J7 |
+|------------------------------------------------------------------------------|
+Notes:
+ J1 - USB connector (not used for Bloody Roar 3)
+ J2 - I/O board connector
+ J3 - PAC PCB connector
+ J4 - Multi-pin connector (PS2 interface adapter plugged in here)
+ J5 - 2-pin power connector (+5V input)
+ J6 - Playstation 2 video cable connector (input)
+ J7 - 40-pin IDE flat cable connector for CDROM drive
+ J8 - Multi-pin connector labelled 'ROM' (not used)
+ J9 - Multi-pin connector labelled 'RAM2' (not used)
+ J10 - Multi-pin connector labelled 'RAM1' (RAM32 PCB plugged in here)
+ J11 - 6-pin connector for programming EPM3128 CPLD (not populated)
+TMP95C061 - Toshiba TMP95C061 TLCS-900-series 16-bit Microcontroller (internal RAM/ROM = none)
+ C448 - Namco Custom C448
+ EPM3128 - Altera MAX EMP3128ATC100-10 CPLD labelled 'P2AMO1'
+ CXA2055P - Sony CXA2055P Video Amplifier IC
+ Ti6734 - Texas Instruments LMH6734 Single Supply, Ultra High-Speed, Triple Selectable Gain Buffer
+ 6358N - Sanyo 6358N High-Performance Dual Operational Amplifier
+ PQ30RV31 - Sharp PQ30RV31 Voltage Regulator
+ CY7C199 - Cypress CY7C199-15VC 32k x8-bit SRAM
+ LC35256 - Sanyo LC35256DM70 32k x8-bit SRAM
+ EP20K100 - Altera APEX EP20K100EQC208-2X FPGA
+K4S281632 - Samsung K4S281632B-TC1H 8M x16-bit SDRAM
+
+
+Add-on Memory Board (plugs into J10 on MOTHER(A) PCB)
+-------------------
+This PCB is used with Bloody Roar 3, Vampire Night, Ridge Racer V and Wangan Midnight.
+
+System246 RAM32 PCB
+8908960400 (8908970400)
+|--------------|
+|K4S281632 |
+|K4S281632 |
+| J1 |
+|--------------|
+Notes:
+ K4S281632 - Samsung K4S281632B-TC1H 8M x16-bit SDRAM
+ J1 - Multi-pin connector
+
+
+PS2 Adapter Board
+-----------------
+This PCB is used with Bloody Roar 3, Vampire Night, Ridge Racer V and Wangan Midnight.
+
+System246 T004 PCB
+8908960501 (8908970501)
+|----------------|
+| *J1 |
+| J2 |
+|----------------|
+Notes:
+ J1 - Multi-pin connector (*located on other side of PCB, plugs into J4 on MOTHER(A) PCB)
+ J2 - Multi-pin connector (plugs into PS2 main board)
+
+
+I/O Board
+---------
+This PCB is used with Bloody Roar 3. It is bolted into the metal box and the JAMMA
+edge connector sticks out the front at 90 degrees to the front face of the metal box.
+
+System246 JAMMA PCB
+8908961601 (8908971601)
+|--------------------------------------------|
+|TLP281-4 J6 TLP281-4 LA4705 |
+| TLP281-4 |
+| EPM7064 BA3121 |
+| J5 TLP281-4 |
+| TLP281-4 TLP281-4 TLP281-4 |
+| TLP281-4 TLP281-4 VOLUME |
+|J4 J2 J1|
+|--| J3 JAMMA |-------------|
+ |---------------------------|
+Notes:
+ J1 - 4-pin connector for stereo audio output
+ J2 - 10-pin connector for extra buttons
+ J3 - JAMMA connector
+ J4 - 2-pin power connector for 5V
+ J5 - 6-pin connector for programming CPLD (not populated)
+ J6 - Multi-pin connector (located on other side of PCB, plugs into J2 on MOTHER(A) PCB)
+ EPM7064 - Altera MAX EPM7065STC100-10 CPLD labelled 'S246J01'
+ BA3121 - Rohm BA3121 Ground Isolation Amplifier IC
+TLP281-4 - Toshiba TLP281-4 Optocoupler
+ LA4705 - Sanyo LA4705 2-channel BTL Power Amplifier
+
+Connector J2 pinout Connector J1 pinout
+1 - GND 1 - Left +
+2 - NC 2 - Left -
+3 - P1 Button 4 3 - Right +
+4 - P1 Button 5 4 - Right -
+5 - P1 Button 6
+6 - NC
+7 - P2 Button 4
+8 - P2 Button 5
+9 - P2 Button 6
+10- GND
+
+
+Power Input/Video Output/Audio Output Board
+-------------------------------------------
+This PCB is used with Bloody Roar 3 and Vampire Night. It is bolted to the front of the metal box.
+
+System246 PAC PCB
+8908961700 (8908971700)
+ |----------------------------|
+ | G5LE-1 |
+ | |
+ | J6 J7 L1|
+|------------------------| J9 J10 |
+| J3 J4 J5 J8 L2|
+|J1 J2 SW1 |
+|-----------------------------------------------------|
+Notes:
+ J1/J2 - RCA jacks for stereo audio output (mono audio is also output from the JAMMA connector on the I/O board for Bloody Roar 3)
+ J3 - Multi-pin connector (located on other side of PCB, plugs into J3 on MOTHER(A) PCB)
+ J4 - 4-pin connector (not used)
+ J5 - 3-pin connector (not used)
+ J6/J7 - DSUB15 VGA output connectors
+ J8 - 10-pin power output connector for 5V/12V (located on other side of PCB, joins
+ to PS2 main board, MOTHER(A) PCB and CDROM drive)
+ J9 - 6-pin JVS power input connector
+ J10 - 4-pin power connector
+ G5LE-1 - Omron G5LE-1 single-pole 10A power relay (located on other side of PCB)
+ SW1 - 4-position DIP switch (all OFF)
+ L1 - Green LED (lights when 5 volts is present)
+ L2 - Blue LED (lights when 12 volts is present)
+
+
+Gun I/O Board
+---------------
+This PCB is used with Vampire Night.
+It is also used with Time Crisis 3 (on System 246C) and Crisis Zone (on System 23 Evolution2)
+
+V221 MIU PCB
+2512960101 (2512970101)
+additional sticker for Vampire Night says '8662969301 (JV) TMIU PCB'
+|---------------------------------------------|
+|J10 J9 29C020 LC35256 DSW(4) |
+| M0105 PRG.8F LED |
+|2267 6393 LED |
+| T082 T082 |------| |
+| |--------| | C78 | J8 |
+| |ALTERA | | | |
+|J11 |MAX | |------| J7|
+| LM1881 |EPM7128 | 3771 |
+|R305526 |--------| |
+| ZUW1R51212 14.746MHz |
+| ADM485 J6|
+| |
+| J1 J2 J3 J4 J5 |
+|---------------------------------------------|
+Notes:
+ 2267 - JRC2267 Current limiting diode array? (SOIC8)
+ R305526 - Some kind of mini transformer or regulator?
+ LC35256 - Sanyo LC35256 32k x8 SRAM (SOP28)
+ LM1881 - National Semiconductor LM1881 Video Sync Separator (SOIC8)
+ M0105 - Matsushita Panasonic 0105 = ? (SOIC16)
+ T082 - Texas Instruments T082 (=TL082) JFET-Input operational amplifier (SOIC8)
+ 6393 - Sanyo 6393 (LA6393) High Performance Dual Comparator (SOIC8)
+ ADM485 - Analog Devices ADM485 5V Low Power EIA RS-485 Transceiver (SOIC8)
+ 3771 - Fujitsu MB3771 Power Supply Monitor and Master Reset IC (SOIC8)
+ EPM7128 - Altera MAX EPM7128SLC84-15 PLD labelled 'TMIU1 PLD0'
+ 29C020 - location for 29C020 PLCC32 Flash/EP ROM (not populated)
+ZUW1R51212 - Cosel ZUW1R51212 DC to DC Power Supply Module (input 9-18VDC, output +-12VDC or +24VDC)
+ DSW - 4 position dipswitch block, all off
+ J1 - 6-pin power input connector
+ J2 - 12-pin connector (cabinet buttons UP/DOWN/ENTER/TEST/SERVICE/COIN etc)
+ J3 - 4 pin connector (not used)
+ J4 - 9 pin Namco female plug connector for gun (solenoid +24V/trigger/pedal/sensor)
+ J5 - 5 pin connector used for I/O --> S246 communications (connects to J1 on MOTHER(A) PCB)
+ J6 - 7-pin connector (not used)
+ J9 - 6-pin connector (not used)
+ J10 - 2-pin Namco female plug connector (not used)
+ J11 - 6-pin Namco female plug connector (video input from CCD camera)
+ PRG.8F - 27C1001 EPROM with label...
+ - 'TMIU1 PRG0B' (I/O program for Vampire Night)
+ - 'XMIU1 PRG0' (I/O program for Time Crisis 3)
+ - 'CSZ1 PRG0A' (I/O program for Crisis Zone)
+
+Note this board uses a CCD camera for the gun sensor.
+
+
+I/O Board
+---------
+This PCB is used with Ridge Racer V and Wangan Midnight.
+
+FCA PCB
+8662969102 (8662979102)
+|---------------------------------------------------|
+| J101 J106 |
+| 4.9152MHz |
+| DSW(6) |
+| LED2 |-----| |
+| | MCU | |
+| LEDS3-10 | | |
+| PIC16F84 |-----| |
+| JP1 LED1 ADM485 |
+| |
+| J102 J104 |
+|---------------------------------------------------|
+Notes:
+ J101 - 6 pin connector for power input
+ J102 - 60 pin flat cable connector
+ J104 - 5 pin connector
+ J106 - 30 pin flat cable connector
+ JP1 - 3 pin jumper, set to 'NORM'. Alt setting 'WR'
+ 3771 - Fujitsu MB3771 System Reset IC (SOIC8)
+ PIC16F84 - Microchip PIC16F84 PIC with sticker 'FCAP11' (SOIC20)
+ MCU - Fujitsu MB90F574 Microcontroller with sticker 'FCAF11' (QFP120)
+ ADM485 - Analog Devices ADM485 +5V Low Power EIA RS-485 Transceiver (SOIC8)
+
+
+Drive/Feedback Board
+--------------------
+This PCB is used with Ridge Racer V and Wangan Midnight.
+It controls the steering feed-back motor.
+When the driving games boot they test the feed-back motor by monitoring a potentiometer
+connected to the steering wheel mechanism. If the pot is faulty or not connected or if
+the drive/feedback board isn't connected (including the 110VAC input voltage), the
+steering check will fail after a time-out period and the game will not continue further.
+
+V194 STR PCB
+2487960103 (2487970103)
+Additional sticker for Ridge Racer V: 'V257 STR PCB 2553960100'
+Note this same PCB (with a different ROM) is also used with Mario Kart on Triforce hardware.
+|----------------------------------------------------------|
+| SOP44.IC16 TRANSFORMER J105 |
+| DIP42 |
+| LED N341256 FUSE |
+| LED FUSE BF150G8E|
+| N341256 |
+| |
+|RESET_SW 32MHz 7815 K2682|
+| MB3771 |
+|J101 DSW2(4, all off) |
+| MB90242A |
+| LED MB3773 HP3150 |
+| LED K2682|
+| HP3150 |
+| EPM7064 |
+|J104 MAX232 LM393 |
+| LED JP1 O O=O |
+| LED HP3150 K2682|
+| |
+| HP3150 |
+| |
+|J103 |
+| UPC358 LM393 UPC358 K2682|
+| J102 J106 |
+|----------------------------------------------------------|
+Notes:
+ SOP44.IC16 - Fujitsu MB29F400TC 512k x8 flash ROM labelled 'RRV3 STR-0A' (SOP44)
+ EPM7064 - Altera EPM7064 CPLD labelled 'STR-DR1' (PLCC44)
+ N341256 - NKK 32k x8 SRAM (SOP28)
+ K2682 - 2SK2682 N-Channel Silicon MOSFET
+ BF150G8E - Large power transistor(?) connected to the transformer
+ UPC358 - NEC uPC358 Dual operational amplifier (SOIC8)
+ LM393 - National LM393 Low Power Low Offset Voltage Dual Comparator (SOIC8)
+ MAX232 - Maxim MAX232 dual serial to TTL logic level driver/receiver (SOIC16)
+ HP3150 - HP 3150 Optocoupler (DIP8)
+ MB3773 - Fujitsu MB3773 Power Supply Monitor with Watch Dog Timer and Reset (SOIC8)
+ MB3771 - Fujitsu MB3771 System Reset IC (SOIC8)
+ DIP42 - Unpopulated DIP42 socket for 27C4096 EPROM
+ MB90242A - Fujitsu MB90242A 16-Bit CISC ROM-less F2MC-16F Family Microcontroller optimized for mechatronics control applications (TQFP80)
+ 7815 - LM7815 15V voltage regulator
+ J101 - 8 pin connector (purpose unknown)
+ J102 - 3 pin connector input from potentiometer connected to the steering wheel mechanism
+ J103 - Power input connector (5v/GND/12v)
+ J104 - 6 pin connector joined with a cable to J5 on the System 246 MOTHER PCB.
+ This cable provides the feed-back connection to/from the main board.
+ J105 - 110VAC power input
+ J106 - DC variable power output to feed-back motor
+
***************************************************************************/
diff --git a/src/mame/drivers/namcos10.c b/src/mame/drivers/namcos10.c
index 3af6c3c0af2..26c70f1e559 100644
--- a/src/mame/drivers/namcos10.c
+++ b/src/mame/drivers/namcos10.c
@@ -294,10 +294,27 @@ public:
DECLARE_WRITE16_MEMBER(nand_block_w);
DECLARE_READ16_MEMBER(nand_block_r);
+ DECLARE_READ16_MEMBER (control_r);
+ DECLARE_WRITE16_MEMBER(control_w);
+
+ DECLARE_READ16_MEMBER (i2c_clock_r);
+ DECLARE_WRITE16_MEMBER(i2c_clock_w);
+ DECLARE_READ16_MEMBER (i2c_data_r);
+ DECLARE_WRITE16_MEMBER(i2c_data_w);
+
+ DECLARE_READ16_MEMBER (sprot_r);
+ DECLARE_WRITE16_MEMBER(sprot_w);
+
UINT8 *nand_base;
void nand_copy( UINT32 *dst, UINT32 address, int len );
private:
+ enum {
+ I2CP_IDLE,
+ I2CP_RECIEVE_BYTE,
+ I2CP_RECIEVE_ACK_1,
+ I2CP_RECIEVE_ACK_0
+ };
UINT16 key;
UINT8 cnt;
UINT32 bank_base;
@@ -305,8 +322,16 @@ private:
UINT16 block[0x1ff];
ns10_decrypter_device* decrypter;
+ UINT16 i2c_host_clock, i2c_host_data, i2c_dev_clock, i2c_dev_data, i2c_prev_clock, i2c_prev_data;
+ int i2cp_mode;
+ UINT8 i2c_byte;
+ int i2c_bit;
+
+ int sprot_bit, sprot_byte;
UINT16 nand_read( UINT32 address );
UINT16 nand_read2( UINT32 address );
+
+ void i2c_update();
public:
DECLARE_DRIVER_INIT(knpuzzle);
DECLARE_DRIVER_INIT(panikuru);
@@ -326,9 +351,14 @@ public:
static ADDRESS_MAP_START( namcos10_map, AS_PROGRAM, 32, namcos10_state )
- AM_RANGE(0x1f500000, 0x1f5007ff) AM_RAM AM_SHARE("share3") /* ram? stores block numbers */
- AM_RANGE(0x9f500000, 0x9f5007ff) AM_RAM AM_SHARE("share3") /* ram? stores block numbers */
- AM_RANGE(0xbf500000, 0xbf5007ff) AM_RAM AM_SHARE("share3") /* ram? stores block numbers */
+ AM_RANGE(0x1f500000, 0x1f501fff) AM_RAM AM_SHARE("share3") /* ram? stores block numbers */
+ AM_RANGE(0x9f500000, 0x9f501fff) AM_RAM AM_SHARE("share3") /* ram? stores block numbers */
+ AM_RANGE(0xbf500000, 0xbf501fff) AM_RAM AM_SHARE("share3") /* ram? stores block numbers */
+
+ AM_RANGE(0x1fba0000, 0x1fba0003) AM_READWRITE16(sprot_r, sprot_w, 0xffff0000)
+ AM_RANGE(0x1fba0008, 0x1fba000b) AM_READWRITE16(i2c_clock_r, i2c_clock_w, 0x0000ffff)
+ AM_RANGE(0x1fba0008, 0x1fba000b) AM_READWRITE16(i2c_data_r, i2c_data_w, 0xffff0000)
+ AM_RANGE(0x1fba0000, 0x1fba000f) AM_READWRITE16(control_r, control_w, 0xffffffff)
ADDRESS_MAP_END
@@ -390,6 +420,141 @@ READ16_MEMBER(namcos10_state::range_r)
return dd16;
}
+READ16_MEMBER(namcos10_state::control_r)
+{
+ logerror("control_r %d (%x)\n", offset, space.device().safe_pc());
+ if(offset == 2)
+ return 1^0xffff;
+ return 0;
+}
+
+WRITE16_MEMBER(namcos10_state::control_w)
+{
+ logerror("control_w %d, %04x (%x)\n", offset, data, space.device().safe_pc());
+}
+
+WRITE16_MEMBER(namcos10_state::sprot_w)
+{
+ logerror("sprot_w %04x (%x)\n", data, space.device().safe_pc());
+ sprot_bit = 7;
+ sprot_byte = 0;
+}
+
+// startrgn:
+// 8004b6f8: jal 4b730, dies if v0!=0 (answers 1)
+// flash access, unhappy with the results
+
+// 800128d8: jal 37b58 (flash death)
+// 800128e0: jal 1649c
+// 800128e8: jal 2c47c
+
+READ16_MEMBER(namcos10_state::sprot_r)
+{
+ // If line 3 has 0x30/0x31 in it, something happens. That
+ // something currently kills the system though.
+
+ const static UINT8 prot[0x40] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51, 0x50, 0x51,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ };
+ UINT16 res = sprot_byte >= 0x20 ? 0x3 :
+ (((prot[sprot_byte ] >> sprot_bit) & 1) ? 1 : 0) |
+ (((prot[sprot_byte+0x20] >> sprot_bit) & 1) ? 2 : 0);
+
+ sprot_bit--;
+ if(sprot_bit == -1) {
+ sprot_bit = 7;
+ sprot_byte++;
+ }
+ return res;
+}
+
+READ16_MEMBER(namcos10_state::i2c_clock_r)
+{
+ UINT16 res = i2c_dev_clock & i2c_host_clock & 1;
+ // logerror("i2c_clock_r %d (%x)\n", res, space.device().safe_pc());
+ return res;
+}
+
+
+WRITE16_MEMBER(namcos10_state::i2c_clock_w)
+{
+ COMBINE_DATA(&i2c_host_clock);
+ // logerror("i2c_clock_w %d (%x)\n", data, space.device().safe_pc());
+ i2c_update();
+}
+
+READ16_MEMBER(namcos10_state::i2c_data_r)
+{
+ UINT16 res = i2c_dev_data & i2c_host_data & 1;
+ // logerror("i2c_data_r %d (%x)\n", res, space.device().safe_pc());
+ return res;
+}
+
+
+WRITE16_MEMBER(namcos10_state::i2c_data_w)
+{
+ COMBINE_DATA(&i2c_host_data);
+ // logerror("i2c_data_w %d (%x)\n", data, space.device().safe_pc());
+ i2c_update();
+}
+
+void namcos10_state::i2c_update()
+{
+ UINT16 clock = i2c_dev_clock & i2c_host_clock & 1;
+ UINT16 data = i2c_dev_data & i2c_host_data & 1;
+
+ if(i2c_prev_data == data && i2c_prev_clock == clock)
+ return;
+
+ switch(i2cp_mode) {
+ case I2CP_IDLE:
+ if(clock && !data) {
+ logerror("i2c: start bit\n");
+ i2c_byte = 0;
+ i2c_bit = 7;
+ i2cp_mode = I2CP_RECIEVE_BYTE;
+ }
+ break;
+ case I2CP_RECIEVE_BYTE:
+ if(clock && data && !i2c_prev_data) {
+ logerror("i2c stop bit\n");
+ i2cp_mode = I2CP_IDLE;
+ } else if(clock && !i2c_prev_clock) {
+ i2c_byte |= (data << i2c_bit);
+ // logerror("i2c_byte = %02x (%d)\n", i2c_byte, i2c_bit);
+ i2c_bit--;
+ if(i2c_bit < 0) {
+ i2cp_mode = I2CP_RECIEVE_ACK_1;
+ logerror("i2c recieved byte %02x\n", i2c_byte);
+ i2c_dev_data = 0;
+ data = 0;
+ }
+ }
+ break;
+ case I2CP_RECIEVE_ACK_1:
+ if(clock && !i2c_prev_clock) {
+ // logerror("i2c ack on\n");
+ i2cp_mode = I2CP_RECIEVE_ACK_0;
+ }
+ break;
+ case I2CP_RECIEVE_ACK_0:
+ if(!clock && i2c_prev_clock) {
+ // logerror("i2c ack off\n");
+ i2c_dev_data = 1;
+ data = i2c_host_data & 1;
+ i2c_byte = 0;
+ i2c_bit = 7;
+ i2cp_mode = I2CP_RECIEVE_BYTE;
+ }
+ break;
+ }
+ i2c_prev_data = data;
+ i2c_prev_clock = clock;
+}
+
static ADDRESS_MAP_START( namcos10_memm_map, AS_PROGRAM, 32, namcos10_state )
AM_RANGE(0x1f300000, 0x1f300003) AM_WRITE16(key_w, 0x0000ffff)
AM_RANGE(0x1f400000, 0x1f5fffff) AM_READ16(range_r, 0xffffffff)
@@ -462,7 +627,7 @@ READ16_MEMBER( namcos10_state::nand_data_r )
UINT16 data = nand_read2( nand_address * 2 );
// logerror("read %08x = %04x\n", nand_address*2, data);
- //printf("read %08x = %04x\n", nand_address*2, data);
+ // printf("read %08x = %04x\n", nand_address*2, data);
/* printf( "data<-%08x (%08x)\n", data, nand_address ); */
@@ -544,7 +709,9 @@ DRIVER_INIT_MEMBER(namcos10_state,mrdrilr2)
DRIVER_INIT_MEMBER(namcos10_state,gjspace)
{
int regSize = machine().root_device().memregion("user2")->bytes();
- decrypt_bios(machine(), "user2", 0x8400, regSize, 0x0, 0x2, 0xe, 0xd, 0xf, 0x6, 0xc, 0x7, 0x5, 0x1, 0x9, 0x8, 0xa, 0x3, 0x4, 0xb);
+ decrypt_bios(machine(), "user2", 0x0008400, 0x0029400, 0x0, 0x2, 0xe, 0xd, 0xf, 0x6, 0xc, 0x7, 0x5, 0x1, 0x9, 0x8, 0xa, 0x3, 0x4, 0xb);
+ decrypt_bios(machine(), "user2", 0x0210000, 0x104e800, 0x0, 0x2, 0xe, 0xd, 0xf, 0x6, 0xc, 0x7, 0x5, 0x1, 0x9, 0x8, 0xa, 0x3, 0x4, 0xb);
+ decrypt_bios(machine(), "user2", 0x1077c00, regSize, 0x0, 0x2, 0xe, 0xd, 0xf, 0x6, 0xc, 0x7, 0x5, 0x1, 0x9, 0x8, 0xa, 0x3, 0x4, 0xb);
memn_driver_init();
}
@@ -626,6 +793,12 @@ DRIVER_INIT_MEMBER(namcos10_state,konotako)
MACHINE_RESET_MEMBER(namcos10_state,namcos10)
{
+ i2c_dev_clock = i2c_dev_data = 1;
+ i2c_host_clock = i2c_host_data = 1;
+ i2c_prev_clock = i2c_prev_data = 1;
+ i2cp_mode = I2CP_IDLE;
+ i2c_byte = 0x00;
+ i2c_bit = 0;
}
static MACHINE_CONFIG_START( namcos10_memm, namcos10_state )
@@ -633,6 +806,13 @@ static MACHINE_CONFIG_START( namcos10_memm, namcos10_state )
MCFG_CPU_ADD( "maincpu", CXD8606BQ, XTAL_101_4912MHz )
MCFG_CPU_PROGRAM_MAP( namcos10_memm_map )
+ // The bios first configures the rom window as 80000-big, then
+ // switches to 400000. If berr is active, the first configuration
+ // wipes all handlers after 1fc80000, which kills the system
+ // afterwards
+
+ MCFG_PSX_DISABLE_ROM_BERR
+
MCFG_RAM_MODIFY("maincpu:ram")
MCFG_RAM_DEFAULT_SIZE("16M")
@@ -650,6 +830,13 @@ static MACHINE_CONFIG_START( namcos10_memn, namcos10_state )
MCFG_CPU_ADD( "maincpu", CXD8606BQ, XTAL_101_4912MHz )
MCFG_CPU_PROGRAM_MAP( namcos10_memn_map )
+ // The bios first configures the rom window as 80000-big, then
+ // switches to 400000. If berr is active, the first configuration
+ // wipes all handlers after 1fc80000, which kills the system
+ // afterwards
+
+ MCFG_PSX_DISABLE_ROM_BERR
+
MCFG_RAM_MODIFY("maincpu:ram")
MCFG_RAM_DEFAULT_SIZE("16M")
@@ -672,6 +859,11 @@ static MACHINE_CONFIG_DERIVED(ns10_gamshara, namcos10_memn)
MCFG_DEVICE_ADD("decrypter", GAMSHARA_DECRYPTER, 0)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED(ns10_gjspace, namcos10_memn)
+/* decrypter device (CPLD in hardware?) */
+MCFG_DEVICE_ADD("decrypter", GJSPACE_DECRYPTER, 0)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED(ns10_knpuzzle, namcos10_memn)
/* decrypter device (CPLD in hardware?) */
MCFG_DEVICE_ADD("decrypter", KNPUZZLE_DECRYPTER, 0)
@@ -889,7 +1081,7 @@ GAME( 2000, mrdrilr2, 0, namcos10_memm, namcos10, namcos10_state, mrdril
GAME( 2000, mrdrlr2a, mrdrilr2, namcos10_memm, namcos10, namcos10_state, mrdrilr2, ROT0, "Namco", "Mr. Driller 2 (Asia, DR22 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks
GAME( 2000, ptblank3, 0, namcos10_memn, namcos10, namcos10_state, gunbalna, ROT0, "Namco", "Point Blank 3 (Asia, GNN2 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 2000, gunbalina, ptblank3, namcos10_memn, namcos10, namcos10_state, gunbalna, ROT0, "Namco", "Gunbalina (Japan, GNN1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
-GAME( 2001, gjspace, 0, namcos10_memn, namcos10, namcos10_state, gjspace, ROT0, "Namco / Metro", "Gekitoride-Jong Space (10011 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
+GAME( 2001, gjspace, 0, ns10_gjspace , namcos10, namcos10_state, gjspace, ROT0, "Namco / Metro", "Gekitoride-Jong Space (10011 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
GAME( 2001, mrdrilrg, 0, namcos10_memn, namcos10, namcos10_state, mrdrilrg, ROT0, "Namco", "Mr. Driller G (Japan, DRG1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks
GAME( 2001, mrdrilrga, mrdrilrg, namcos10_memn, namcos10, namcos10_state, mrdrilrg, ROT0, "Namco", "Mr. Driller G ALT (Japan, DRG1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // PORT_4WAY joysticks
GAME( 2001, knpuzzle, 0, ns10_knpuzzle, namcos10, namcos10_state, knpuzzle, ROT0, "Namco", "Kotoba no Puzzle Mojipittan (Japan, KPM1 Ver.A)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )
diff --git a/src/mame/drivers/pinball2k.c b/src/mame/drivers/pinball2k.c
index 121fac46712..37666de9a8c 100644
--- a/src/mame/drivers/pinball2k.c
+++ b/src/mame/drivers/pinball2k.c
@@ -199,7 +199,7 @@ void pinball2k_state::draw_framebuffer(bitmap_rgb32 &bitmap, const rectangle &cl
m_frame_height = height;
visarea.set(0, width - 1, 0, height - 1);
- m_screen->configure(width, height * 262 / 240, visarea, m_screen->frame_period().attoseconds);
+ m_screen->configure(width, height * 262 / 240, visarea, m_screen->frame_period().attoseconds());
}
if (m_disp_ctrl_reg[DC_OUTPUT_CFG] & 0x1) // 8-bit mode
diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c
index c664022558c..366bfe84094 100644
--- a/src/mame/drivers/qix.c
+++ b/src/mame/drivers/qix.c
@@ -1454,7 +1454,7 @@ GAME( 1981, qixa, qix, qix, qix, driver_device, 0, ROT
GAME( 1981, qixb, qix, qix, qix, driver_device, 0, ROT270, "Taito America Corporation", "Qix (set 2, larger roms)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, qixo, qix, qix, qix, driver_device, 0, ROT270, "Taito America Corporation", "Qix (set 3, earlier)", MACHINE_SUPPORTS_SAVE ) // oldest set / prototype? has incorrect spelling 'deutch' and doesn't allow language selection to be changed
GAME( 1981, qix2, qix, qix, qix, driver_device, 0, ROT270, "Taito America Corporation", "Qix II (Tournament)", MACHINE_SUPPORTS_SAVE )
-GAME( 1981, sdungeon, 0, mcu, sdungeon, driver_device, 0, ROT270, "Taito America Corporation", "Space Dungeon", MACHINE_SUPPORTS_SAVE )
+GAME( 1981, sdungeon, 0, mcu, sdungeon, driver_device, 0, ROT270, "Taito America Corporation", "Space Dungeon", MACHINE_SUPPORTS_SAVE ) // actually released July 1982
GAMEL(1982, elecyoyo, 0, mcu, elecyoyo, driver_device, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 1)", MACHINE_SUPPORTS_SAVE, layout_elecyoyo )
GAMEL(1982, elecyoyo2,elecyoyo, mcu, elecyoyo, driver_device, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 2)", MACHINE_SUPPORTS_SAVE, layout_elecyoyo )
GAME( 1982, kram, 0, mcu, kram, driver_device, 0, ROT0, "Taito America Corporation", "Kram (set 1)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/rockrage.c b/src/mame/drivers/rockrage.c
index 0ce316b0c58..49d255e190d 100644
--- a/src/mame/drivers/rockrage.c
+++ b/src/mame/drivers/rockrage.c
@@ -234,8 +234,6 @@ void rockrage_state::machine_start()
void rockrage_state::machine_reset()
{
m_vreg = 0;
- m_layer_colorbase[0] = 0x00;
- m_layer_colorbase[1] = 0x10;
}
static MACHINE_CONFIG_START( rockrage, rockrage_state )
diff --git a/src/mame/drivers/rocnrope.c b/src/mame/drivers/rocnrope.c
index a053b3b2f76..4823bc6d7fb 100644
--- a/src/mame/drivers/rocnrope.c
+++ b/src/mame/drivers/rocnrope.c
@@ -344,10 +344,11 @@ ROM_START( ropeman )
ROM_LOAD( "pal10l8.6g", 0x0000, 0x0001, NO_DUMP )
ROM_REGION( 0x01D6, "pals_daughterbd", 0 ) /* N82S153's located on the daughterboard of the cpu/video board */
- ROM_LOAD( "n82s153.pal1.bin", 0x0000, 0x00EB, CRC(baebe804) SHA1(c2e084b4df8a5c6d12cc34106583b532cd7a697b) ) /* Signetics N82S153 */
- ROM_LOAD( "n82s153.pal2.bin", 0x00EB, 0x00EB, CRC(a0e1b7a0) SHA1(7c3ce1a286bef69830a5e67a85965fe71f7ee283) ) /* Signetics N82S153 */
+ ROM_LOAD( "n82s153.pal1.bin", 0x0000, 0x00eb, CRC(baebe804) SHA1(c2e084b4df8a5c6d12cc34106583b532cd7a697b) ) /* Signetics N82S153 */
+ ROM_LOAD( "n82s153.pal2.bin", 0x00eb, 0x00eb, CRC(a0e1b7a0) SHA1(7c3ce1a286bef69830a5e67a85965fe71f7ee283) ) /* Signetics N82S153 */
ROM_END
+
/*************************************
*
* Driver initialization
@@ -356,11 +357,7 @@ ROM_END
DRIVER_INIT_MEMBER(rocnrope_state,rocnrope)
{
- memregion("maincpu")->base()[0x703d] = 0x98^0x88; /* fix one instruction */
-}
-
-DRIVER_INIT_MEMBER(rocnrope_state,rocnropk)
-{
+ memregion("maincpu")->base()[0x703d] = 0x98^0x22; // HACK: fix one instruction
}
@@ -370,6 +367,6 @@ DRIVER_INIT_MEMBER(rocnrope_state,rocnropk)
*
*************************************/
-GAME( 1983, rocnrope, 0, rocnrope, rocnrope, rocnrope_state, rocnrope, ROT270, "Konami", "Roc'n Rope", MACHINE_SUPPORTS_SAVE )
-GAME( 1983, rocnropek,rocnrope, rocnrope, rocnrope, rocnrope_state, rocnropk, ROT270, "Konami / Kosuka", "Roc'n Rope (Kosuka)", MACHINE_SUPPORTS_SAVE )
-GAME( 1983, ropeman, rocnrope, rocnrope, rocnrope, rocnrope_state, rocnrope, ROT270, "bootleg", "Ropeman (bootleg of Roc'n Rope)", MACHINE_SUPPORTS_SAVE )
+GAME( 1983, rocnrope, 0, rocnrope, rocnrope, rocnrope_state, rocnrope, ROT270, "Konami", "Roc'n Rope", MACHINE_SUPPORTS_SAVE )
+GAME( 1983, rocnropek, rocnrope, rocnrope, rocnrope, driver_device, 0, ROT270, "Konami (Kosuka license)", "Roc'n Rope (Kosuka)", MACHINE_SUPPORTS_SAVE )
+GAME( 1983, ropeman, rocnrope, rocnrope, rocnrope, rocnrope_state, rocnrope, ROT270, "bootleg", "Ropeman (bootleg of Roc'n Rope)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/rollext.c b/src/mame/drivers/rollext.c
new file mode 100644
index 00000000000..325c2ac8439
--- /dev/null
+++ b/src/mame/drivers/rollext.c
@@ -0,0 +1,366 @@
+// license:BSD-3-Clause
+// copyright-holders:Ville Linde
+/*
+ Rolling Extreme
+ Gaelco, 1999
+
+ PCB Layout
+ ----------
+
+ REF.991015
+ |--------------------------------------------------|
+ |TL074 TDA1543 LP61256 ROE.45 ROE.58 |
+ | |
+ |TL074 TDA1543 LP61256 ROE.47 ROE.60 |-|
+ | | |DB9
+ | |--------| KM4216C258 KM4216C258 |-|
+ | |ALTERA | |
+ | LP61256 |FLEX | KM4216C258 KM4216C258 |
+ | LP61256 |EPF10K50| |
+ |-| LP61256 |--------| KM4216C258 KM4216C258 |
+ | |2444CS CY2308 |
+ | | |--------| KM4216C258 KM4216C258 |
+ | | L4955 |ALTERA | |
+ | | |FLEX | |------------| |
+ | |LED1 |EPF10K100 |CHIP EXPRESS|KM4216C258 |
+ | |LED2 60MHz |--------| |D3PLUS-4 | |
+ |-| |----------| |T2032-01 |KM4216C258 |
+ | |DSP | |N9G1554 | |
+ | |TMS320C82 | |9939 CA TWN | |
+ | |GGP60 | |------------| |
+ | |1997 TI | 93C66 |
+ | |----------| |-------| |-|
+ | ROE.17 |ALTERA | 90MHz | |DB9
+ |K4S643232-TC80 |MAX |KM718V895T-72 |-|
+ | ROE.18 ROE.38|EPM7160| |
+ |K4S643232-TC80 |-------| |
+ |--------------------------------------------------|
+*/
+
+/*
+
+ MP Interrupts:
+
+ External Interrupt 1: 0x4003ef78
+ External Interrupt 2: -
+ External Interrupt 3: 0x40041d30
+ Memory Fault: 0x40043ae8
+
+ PP0 Interrupts:
+ Task: 0x400010a0 / 0x400001a0
+
+ PP1 Interrupts:
+ Task: 0x4004c6e8
+
+
+ Memory locations:
+
+ [0x00000084] PP0 busy flag?
+ [0x00000090] PP0 fifo write pointer?
+ [0x00000094] PP0 fifo read pointer?
+ [0x00000320] 2000000-TCOUNT in XINT3 handler
+ [0x01010668] copied from (word)0xb0000004 in XINT3 handler
+
+
+ Texture ROM decode:
+
+ {ic45} {ic47} {ic58} {ic60}
+ [2,0][0,0] [2,1][0,1] [3,0][1,0] [3,1][1,1]
+
+*/
+
+#include "emu.h"
+#include "cpu/tms32082/tms32082.h"
+
+class rollext_state : public driver_device
+{
+public:
+ rollext_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_palette_ram(*this, "palette_ram"),
+ m_texture_mask(*this, "texture_mask"),
+ m_disp_ram(*this, "disp_ram")
+ {
+ }
+
+ required_device<cpu_device> m_maincpu;
+ required_shared_ptr<UINT32> m_palette_ram;
+ required_shared_ptr<UINT32> m_texture_mask;
+ required_shared_ptr<UINT32> m_disp_ram;
+
+ DECLARE_READ32_MEMBER(a0000000_r);
+ DECLARE_WRITE32_MEMBER(a0000000_w);
+ DECLARE_READ32_MEMBER(b0000000_r);
+
+ UINT8 *m_texture;
+
+ void draw_line(bitmap_rgb32 &bitmap, const rectangle &visarea, int v1x, int v1y, int v2x, int v2y);
+
+ INTERRUPT_GEN_MEMBER(vblank_interrupt);
+ DECLARE_DRIVER_INIT(rollext);
+ virtual void machine_start();
+ virtual void machine_reset();
+ virtual void video_start();
+ void preprocess_texture_data();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+};
+
+
+
+void rollext_state::preprocess_texture_data()
+{
+ UINT8 *rom = (UINT8*)memregion("texture")->base();
+
+ for (int j=0; j < 16384; j+=2)
+ {
+ for (int i=0; i < 2048; i+=4)
+ {
+ m_texture[((j+0) * 2048) + i + 1] = *rom++;
+ m_texture[((j+1) * 2048) + i + 1] = *rom++;
+ m_texture[((j+0) * 2048) + i + 0] = *rom++;
+ m_texture[((j+1) * 2048) + i + 0] = *rom++;
+ m_texture[((j+0) * 2048) + i + 3] = *rom++;
+ m_texture[((j+1) * 2048) + i + 3] = *rom++;
+ m_texture[((j+0) * 2048) + i + 2] = *rom++;
+ m_texture[((j+1) * 2048) + i + 2] = *rom++;
+ }
+ }
+}
+
+void rollext_state::draw_line(bitmap_rgb32 &bitmap, const rectangle &visarea, int v1x, int v1y, int v2x, int v2y)
+{
+ int dx = (v2x - v1x);
+ int dy = (v2y - v1y);
+
+ int x1 = v1x;
+ int y1 = v1y;
+
+ if (v1x < visarea.min_x || v1x > visarea.max_x ||
+ v1y < visarea.min_y || v1y > visarea.max_y ||
+ v2x < visarea.min_x || v2x > visarea.max_x ||
+ v2y < visarea.min_y || v2y > visarea.max_x)
+ return;
+
+ if (dx > dy)
+ {
+ int x = x1;
+ for (int i=0; i < abs(dx); i++)
+ {
+ int y = y1 + (dy * (float)(x - x1) / (float)(dx));
+
+ if (x >= 0 && x < 512 && y >= 0 && y < 384)
+ {
+ UINT32 *fb = &bitmap.pix32(y);
+ fb[x] = 0xffffffff;
+ }
+
+ x++;
+ }
+ }
+ else
+ {
+ int y = y1;
+ for (int i=0; i < abs(dy); i++)
+ {
+ int x = x1 + (dx * (float)(y - y1) / (float)(dy));
+
+ if (x >= 0 && x < 512 && y >= 0 && y < 384)
+ {
+ UINT32 *fb = &bitmap.pix32(y);
+ fb[x] = 0xffffffff;
+ }
+
+ y++;
+ }
+ }
+}
+
+void rollext_state::video_start()
+{
+ m_texture = auto_alloc_array(machine(), UINT8, 0x2000000);
+
+ preprocess_texture_data();
+}
+
+UINT32 rollext_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+{
+ bitmap.fill(0xff000000, cliprect);
+
+#if 0
+ UINT16 *pal = (UINT16*)&m_palette_ram[0];
+
+ int palnum = 31;
+ // 24,25,31 for basic font
+ // 29 = trees
+
+ int ii=0;
+ for (int j=0; j < 384; j++)
+ {
+ UINT32 *fb = &bitmap.pix32(j);
+ for (int i=0; i < 512; i++)
+ {
+ UINT8 p = m_texture[ii++];
+
+ UINT16 rgb = pal[(palnum * 256) + BYTE_XOR_BE(p)];
+ int r = ((rgb >> 10) & 0x1f) << 3;
+ int g = ((rgb >> 5) & 0x1f) << 3;
+ int b = (rgb & 0x1f) << 3;
+
+ fb[i] = 0xff000000 | (r << 16) | (g << 8) | b;
+ }
+ ii += 1536;
+ }
+#endif
+
+ int num = m_disp_ram[0xffffc/4];
+
+ for (int i=0; i < num; i++)
+ {
+ int ii = i * 0x60;
+
+ int x[4];
+ int y[4];
+
+ for (int j=0; j < 4; j++)
+ {
+ UINT32 ix = m_disp_ram[(ii + (j*0x10) + 0x4) / 4];
+ UINT32 iy = m_disp_ram[(ii + (j*0x10) + 0xc) / 4];
+
+ x[j] = (int)((u2f(ix) / 2.0f) + 256.0f);
+ y[j] = (int)((u2f(iy) / 2.0f) + 192.0f);
+ }
+
+
+ draw_line(bitmap, cliprect, x[0], y[0], x[1], y[1]);
+ draw_line(bitmap, cliprect, x[1], y[1], x[2], y[2]);
+ draw_line(bitmap, cliprect, x[3], y[3], x[2], y[2]);
+ draw_line(bitmap, cliprect, x[0], y[0], x[3], y[3]);
+
+ }
+
+ m_disp_ram[0xffffc/4] = 0;
+
+
+ return 0;
+}
+
+
+READ32_MEMBER(rollext_state::a0000000_r)
+{
+ switch (offset)
+ {
+ case 0: // ??
+ {
+ UINT32 data = 0x20200;
+
+ //data |= ioport("INPUTS1")->read();
+ //data |= 0xfff7fff7;
+
+ return data;
+ }
+
+ case 1:
+ return 0xffffffff;
+ }
+
+ return 0xffffffff;
+}
+
+WRITE32_MEMBER(rollext_state::a0000000_w)
+{
+ // FPGA interface?
+}
+
+READ32_MEMBER(rollext_state::b0000000_r)
+{
+ switch (offset)
+ {
+ case 0: // ??
+ return 0xffff;
+ case 1: // ??
+ return 0;
+ }
+
+ return 0;
+}
+
+
+// Master Processor memory map
+static ADDRESS_MAP_START(memmap, AS_PROGRAM, 32, rollext_state)
+ AM_RANGE(0x40000000, 0x40ffffff) AM_RAM AM_SHARE("main_ram")
+ AM_RANGE(0x60000000, 0x600fffff) AM_RAM AM_SHARE("disp_ram")
+ AM_RANGE(0x80000000, 0x8000ffff) AM_RAM AM_SHARE("palette_ram")
+ AM_RANGE(0x90000000, 0x9007ffff) AM_RAM AM_SHARE("texture_mask")
+ AM_RANGE(0xa0000000, 0xa00000ff) AM_READWRITE(a0000000_r, a0000000_w)
+ AM_RANGE(0xb0000000, 0xb0000007) AM_READ(b0000000_r)
+ AM_RANGE(0xc0000000, 0xc03fffff) AM_ROM AM_REGION("rom1", 0)
+ AM_RANGE(0xff000000, 0xffffffff) AM_RAM AM_REGION("rom0", 0)
+ADDRESS_MAP_END
+
+
+static INPUT_PORTS_START(rollext)
+
+ PORT_START("INPUTS1")
+ PORT_BIT( 0xfff7fff7, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_SERVICE_NO_TOGGLE( 0x00080008, IP_ACTIVE_LOW) /* Test Button */
+
+INPUT_PORTS_END
+
+
+void rollext_state::machine_reset()
+{
+}
+
+void rollext_state::machine_start()
+{
+}
+
+
+static MACHINE_CONFIG_START(rollext, rollext_state)
+ MCFG_CPU_ADD("maincpu", TMS32082_MP, 60000000)
+ MCFG_CPU_PROGRAM_MAP(memmap)
+ MCFG_CPU_VBLANK_INT_DRIVER("screen", rollext_state, vblank_interrupt)
+ MCFG_CPU_PERIODIC_INT_DRIVER(rollext_state, irq3_line_assert, 60)
+
+ MCFG_CPU_ADD("pp0", TMS32082_PP, 60000000)
+ MCFG_CPU_PROGRAM_MAP(memmap);
+
+ MCFG_QUANTUM_TIME(attotime::from_hz(100))
+
+ MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
+ MCFG_SCREEN_SIZE(512, 384)
+ MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383)
+ MCFG_SCREEN_UPDATE_DRIVER(rollext_state, screen_update)
+MACHINE_CONFIG_END
+
+
+INTERRUPT_GEN_MEMBER(rollext_state::vblank_interrupt)
+{
+ m_maincpu->set_input_line(tms32082_mp_device::INPUT_X1, ASSERT_LINE);
+}
+
+DRIVER_INIT_MEMBER(rollext_state, rollext)
+{
+}
+
+
+ROM_START(rollext)
+ ROM_REGION32_BE(0x1000000, "rom0", 0)
+ ROM_LOAD64_DWORD_SWAP("roe.ic17", 0x000000, 0x800000, CRC(a52bf5a1) SHA1(5c35740e14978368ab1c72931a767fcb6f217edf))
+ ROM_LOAD64_DWORD_SWAP("roe.ic18", 0x000004, 0x800000, CRC(1a4e65d6) SHA1(69fc7747d8e64d0b397c676bebaedc9e6122fe89))
+
+ ROM_REGION32_BE(0x400000, "rom1", 0)
+ ROM_LOAD32_DWORD("roe.ic38", 0x000000, 0x400000, CRC(d9bcfb7c) SHA1(eda9870881732d4dc7cdacb65c6d40af3451dc9d))
+
+ ROM_REGION32_BE(0x2000000, "texture", 0) // Texture ROMs
+ ROM_LOAD32_BYTE("roe.ic45", 0x000000, 0x800000, CRC(0f7fe365) SHA1(ed50fd2b76840eac6ce394a0c748109f615b775a))
+ ROM_LOAD32_BYTE("roe.ic47", 0x000001, 0x800000, CRC(44d7ccee) SHA1(2fec682396e4cca704bd1237016acec0e7b4b428))
+ ROM_LOAD32_BYTE("roe.ic58", 0x000002, 0x800000, CRC(67ad4561) SHA1(56f41b4ebd827fec49902f377c5ed054c02d9e6c))
+ ROM_LOAD32_BYTE("roe.ic60", 0x000003, 0x800000, CRC(a64524af) SHA1(31bef17656ab025f90cd222d3d6d0cb62dee29ee))
+ROM_END
+
+
+GAME( 1999, rollext, 0, rollext, rollext, rollext_state, rollext, ROT0, "Gaelco", "ROLLing eX.tre.me", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) \ No newline at end of file
diff --git a/src/mame/drivers/scramble.c b/src/mame/drivers/scramble.c
index 62312347f6a..fd3730d2aff 100644
--- a/src/mame/drivers/scramble.c
+++ b/src/mame/drivers/scramble.c
@@ -2164,6 +2164,32 @@ ROM_START( mimonscr )
ROM_LOAD( "c01s.6e", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
ROM_END
+
+ROM_START( mimonscra )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "1.c2", 0x0000, 0x1000, CRC(cfff26f3) SHA1(6e611e370ce5a93099bdcdb3b34b86c9c6d49180) )
+ ROM_LOAD( "2.e2", 0x1000, 0x1000, CRC(1fca805f) SHA1(eb85d3c08b141d8bd85da38936a5fafcdd2ff709) )
+ ROM_LOAD( "3.f2", 0x2000, 0x1000, CRC(24ce1ce3) SHA1(ae5ba6913cabab2152bf48c0c0d5983ecbe5c700) )
+ ROM_LOAD( "4.h2", 0x3000, 0x1000, CRC(c83fb639) SHA1(38ddd80b25cc0707b9e53396c322fe731ea8bc3e) )
+ ROM_LOAD( "5.j2", 0xc000, 0x1000, CRC(a9f12dfc) SHA1(c279e3ac84194cc83642a2c330fd869eaae8f063) )
+ ROM_LOAD( "6.l2", 0xd000, 0x1000, CRC(e492a40c) SHA1(d01d6f9c18821fd8c7ed11d65d13bd0c9595881f) )
+ ROM_LOAD( "7.m2", 0xe000, 0x1000, CRC(5339928d) SHA1(7c28516fb7d762e2f77d0ed3dc56a57d0213dbf9) )
+ ROM_LOAD( "8.p2", 0xf000, 0x1000, CRC(0b9915b8) SHA1(bb5155eede699d0b612cae458499bd245ab44b4d) )
+
+ ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_LOAD( "2732.c5", 0x0000, 0x1000, CRC(5995f24b) SHA1(e3cad71006346e6ca6579c09e65195718687dca1) )
+ ROM_LOAD( "2732.d5", 0x1000, 0x1000, CRC(35ed0f96) SHA1(5aaacae5c2acf97540b72491f71ea823f5eeae1a) )
+
+ ROM_REGION( 0x4000, "gfx1", 0 )
+ ROM_LOAD( "top.g5", 0x0000, 0x1000, CRC(f73a8412) SHA1(9baf4336cceb9b039372b0a1c733910aeab5ec6d) )
+ ROM_LOAD( "bottom.g5", 0x1000, 0x1000, CRC(3828c9db) SHA1(eaf9e81c803ad2be6c2db3104f07f80788378286) )
+ ROM_LOAD( "top.f5", 0x2000, 0x1000, CRC(9e0e9289) SHA1(79d412dbceb364bc798feda658b15792feb63338) )
+ ROM_LOAD( "bottom.f5", 0x3000, 0x1000, CRC(92085b0c) SHA1(a791703fa9f17e42450c871d902430fc3c6b10ef) )
+
+ ROM_REGION( 0x0020, "proms", 0 )
+ ROM_LOAD( "mb7051.e6", 0x0000, 0x0020, CRC(4e3caeab) SHA1(a25083c3e36d28afdefe4af6e6d4f3155e303625) )
+ROM_END
+
ROM_START( ad2083 )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "ad0.10o", 0x0000, 0x2000, CRC(4d34325a) SHA1(4a0eb1cd94382c44ab2642d734d3da9025872eba) )
@@ -2265,7 +2291,8 @@ GAME( 1984, hncholms, huncholy, hncholms, hncholms, scramble_state, scramble_ppi
GAME( 1983, cavelon, 0, cavelon, cavelon, scramble_state, cavelon, ROT90, "Jetsoft", "Cavelon", MACHINE_SUPPORTS_SAVE )
-GAME( 1982, mimonscr, mimonkey, mimonscr, mimonscr, scramble_state, mimonscr, ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", MACHINE_SUPPORTS_SAVE )
+GAME( 1982, mimonscr, mimonkey, mimonscr, mimonscr, scramble_state, mimonscr, ROT90, "bootleg", "Mighty Monkey (bootleg on Scramble hardware)", MACHINE_SUPPORTS_SAVE )
+GAME( 1982, mimonscra,mimonkey, mimonscr, mimonscr, scramble_state, mimonscr, ROT90, "bootleg (Kaina Games)","Mighty Monkey (Kaina Games, bootleg on Scramble hardware)", MACHINE_SUPPORTS_SAVE )
GAME( 1983, ad2083, 0, ad2083, ad2083, scramble_state, ad2083, ROT90, "Midcoin", "A. D. 2083", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/segas32.c b/src/mame/drivers/segas32.c
index b862a4de722..88e7fce9b3c 100644
--- a/src/mame/drivers/segas32.c
+++ b/src/mame/drivers/segas32.c
@@ -296,6 +296,35 @@ IC Type 27C2048 27C2048 27C4200 27C4200 27C1000 27C160 27C160
Stadium Cross EPR15093 EPR15094 EPR15018 EPR15019 EPR15192 EPR15020 EPR15021 EPR15022 EPR15023 EPR15024 EPR15025 EPR15026 EPR15027 EPR15028 EPR15029 EPR15031 EPR15032 -
+System 32 Multi COMM board
+--------------------------
+
+SEGA 1992 837-8792
+sticker: 837-9016-03
+|--------------------------------------------------------|
+| CN3 CN4 |
+| |
+| 32MHz JP1(1-2) |
+| Z80 MB89374 MB89237A MB8421 |
+| |
+| JP2(1-2) |
+| EPR-15033.IC17 |
+| JP3(2-3) |
+| JP4(1-2) |
+| 8464 GAL16V8 GAL16V8 |
+| (315-5610) (315-5506) |
+| CN1 CN2 |
+| CN8 CN9 |
+|--------------------------------------------------------|
+EPR-15033 - AM27C100 EPROM found on Stadium Cross
+ MB89374 - Fujitsu MB89374 Data Link Controller. Clock input 8MHz [32/4]
+ MB89237A - Fujitsu MB89237A DMA Controller
+ 8464 - Fujitsu MB8464 8k x8 SRAM
+ CN8 - TX connector
+ CN9 - RX connector
+ CN1-4 - Joins to Main Board. Connections on top allow plugging in the ROM PCB
+
+
*********************************************************************************************
diff --git a/src/mame/drivers/simpsons.c b/src/mame/drivers/simpsons.c
index bb510fa74b7..9d0cece5f09 100644
--- a/src/mame/drivers/simpsons.c
+++ b/src/mame/drivers/simpsons.c
@@ -344,11 +344,10 @@ static MACHINE_CONFIG_START( simpsons, simpsons_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
+ MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/3, 528, 112, 400, 256, 16, 240)
+// 6MHz dotclock is more realistic, however needs drawing updates. replace when ready
+// MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396, hbend, hbstart, 256, 16, 240)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
- MCFG_SCREEN_REFRESH_RATE(59.1856)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(64*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(14*8, (64-14)*8-1, 2*8, 30*8-1 )
MCFG_SCREEN_UPDATE_DRIVER(simpsons_state, screen_update_simpsons)
MCFG_SCREEN_PALETTE("palette")
diff --git a/src/mame/drivers/spcforce.c b/src/mame/drivers/spcforce.c
index b313ad7c999..303d4c61a87 100644
--- a/src/mame/drivers/spcforce.c
+++ b/src/mame/drivers/spcforce.c
@@ -119,6 +119,13 @@ static ADDRESS_MAP_START( spcforce_map, AS_PROGRAM, 8, spcforce_state )
AM_RANGE(0xa000, 0xa3ff) AM_RAM AM_SHARE("scrollram")
ADDRESS_MAP_END
+static ADDRESS_MAP_START( meteors_map, AS_PROGRAM, 8, spcforce_state )
+ AM_RANGE(0x700b, 0x700b) AM_WRITENOP
+ AM_RANGE(0x700d, 0x700d) AM_WRITE(irq_mask_w) // ??
+ AM_RANGE(0x700e, 0x700e) AM_WRITE(flip_screen_w) // irq mask isn't here, gets written too early causing the game to not boot, see startup code between sets
+ AM_IMPORT_FROM(spcforce_map)
+ADDRESS_MAP_END
+
static ADDRESS_MAP_START( spcforce_sound_map, AS_PROGRAM, 8, spcforce_state )
AM_RANGE(0x0000, 0x07ff) AM_ROM
ADDRESS_MAP_END
@@ -265,6 +272,7 @@ PALETTE_INIT_MEMBER(spcforce_state, spcforce)
INTERRUPT_GEN_MEMBER(spcforce_state::vblank_irq)
{
+
if(m_irq_mask)
device.execute().set_input_line(3, HOLD_LINE);
}
@@ -310,6 +318,11 @@ static MACHINE_CONFIG_START( spcforce, spcforce_state )
MCFG_SN76496_READY_HANDLER(WRITELINE(spcforce_state, write_sn3_ready))
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( meteors, spcforce )
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_PROGRAM_MAP(meteors_map)
+MACHINE_CONFIG_END
+
/***************************************************************************
@@ -385,7 +398,31 @@ ROM_START( meteor )
ROM_LOAD( "bm2v", 0x2800, 0x0800, CRC(2858cf5c) SHA1(1313b4e4adda074499153e4a42bc2c6b41b0ec7e) )
ROM_END
+ROM_START( meteors )
+ ROM_REGION( 0x10000, "maincpu", 0 )
+ ROM_LOAD( "1hz1_2.1ab", 0x0000, 0x0800, CRC(86de2a63) SHA1(083a0d31f29bd9d68d240b23234645eeea57556d) )
+ ROM_LOAD( "2hz1_2.1cd", 0x0800, 0x0800, CRC(7ef2c421) SHA1(f01327748e5a2144744557cd3cef16c93076466c) )
+ ROM_LOAD( "3hz1_2.2ab", 0x1000, 0x0800, CRC(6d631f33) SHA1(4c69e3761d7db5ed6c8c23cc5e255cacfac6137f) )
+ ROM_LOAD( "4hz1_2.2cd", 0x1800, 0x0800, CRC(48cb5acc) SHA1(791f9ca0225465d7af8a2a61f617112570f529e6))
+ /*0x2000 empty */
+ ROM_LOAD( "6hz1_2.3cd", 0x2800, 0x0800, CRC(39541265) SHA1(e55eb6c826fb553123991577be4daa3c2aa236f6) )
+ ROM_LOAD( "7hz1_2.4ab", 0x3000, 0x0800, CRC(e718e807) SHA1(d8f3f66aea409c296785d66937b067f4b2c76ed4) )
+ ROM_LOAD( "mbv21_2.4cd", 0x3800, 0x0800, CRC(f805c3cd) SHA1(78eb13b99aae895742b34ed56bee9313d3643de1) )
+
+ ROM_REGION( 0x1000, "audiocpu", 0 ) /* sound MCU */
+ ROM_LOAD( "vms.10l", 0x0000, 0x0800, CRC(b14ccd57) SHA1(0349ec5d0ca7f98ffdd96d7bf01cf096fe547f7a))
+
+ ROM_REGION( 0x3000, "gfx1", 0 )
+ ROM_LOAD( "rm1h1_2.6st", 0x0000, 0x0800, CRC(409fef31) SHA1(7260e06fa654d54f3660712a63f8db8c28b872c9) )
+ ROM_LOAD( "rm2h1_2.7st", 0x0800, 0x0800, CRC(b3981251) SHA1(b6743d121a6b3ad8e8beebe1faff2678b89e7d16) )
+ ROM_LOAD( "gm1h1_2.6pr", 0x1000, 0x0800, CRC(0b85c282) SHA1(b264c92d4b2533c18ac7831491133170a2fd400b) )
+ ROM_LOAD( "gm2h1_2.7pr", 0x1800, 0x0800, CRC(0997d945) SHA1(16eba77b14c62b2a0ebea47a28d4d5d21d7a2234) )
+ ROM_LOAD( "bm1h1_2.6nm", 0x2000, 0x0800, CRC(f9501c8e) SHA1(483d3d4c3f9601d7fcbf263bba5bdc5529b13f70) )
+ ROM_LOAD( "bm2h1_2.7nm", 0x2800, 0x0800, CRC(2858cf5c) SHA1(1313b4e4adda074499153e4a42bc2c6b41b0ec7e) )
+ROM_END
+
GAME( 1980, spcforce, 0, spcforce, spcforce, driver_device, 0, ROT270, "Venture Line", "Space Force (set 1)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 19??, spcforc2, spcforce, spcforce, spcforc2, driver_device, 0, ROT270, "bootleg? (Elcon)", "Space Force (set 2)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
GAME( 1981, meteor, spcforce, spcforce, spcforc2, driver_device, 0, ROT270, "Venture Line", "Meteoroids", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
+GAME( 19??, meteors, spcforce, meteors, spcforc2, driver_device, 0, ROT0, "Amusement World", "Meteors", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/splus.c b/src/mame/drivers/splus.c
index e6855f81c6f..7075b8c3372 100644
--- a/src/mame/drivers/splus.c
+++ b/src/mame/drivers/splus.c
@@ -40,6 +40,10 @@ public:
m_program_ram(*this, "program_ram"),
m_reel_ram(*this, "reel_ram"),
m_io_port(*this, "io_port"),
+ m_i10(*this, "I10"),
+ m_i20(*this, "I20"),
+ m_i30(*this, "I30"),
+ m_sensor(*this, "SENSOR"),
m_maincpu(*this, "maincpu"),
m_i2cmem(*this, "i2cmem")
{
@@ -71,6 +75,10 @@ public:
// IO Ports
required_shared_ptr<UINT8> m_io_port;
+ required_ioport m_i10;
+ required_ioport m_i20;
+ required_ioport m_i30;
+ required_ioport m_sensor;
// EEPROM States
int m_sda_dir;
@@ -389,7 +397,7 @@ READ8_MEMBER(splus_state::splus_serial_r)
break;
case 0x01: // Bank 10
// Test for Coin-In
- if ((ioport("SENSOR")->read_safe(0x00) & 0x01) == 0x01 && m_coin_state == 0) {
+ if ((m_sensor->read() & 0x01) == 0x01 && m_coin_state == 0) {
m_coin_state = 1; // Start Coin Cycle
m_last_cycles = m_maincpu->total_cycles();
#if DEBUG_OUTPUT
@@ -432,7 +440,7 @@ READ8_MEMBER(splus_state::splus_serial_r)
}
// Determine Door Optics
- if ((ioport("I10")->read_safe(0x08) & 0x08) == 0x08)
+ if ((m_i10->read() & 0x08) == 0x08)
door_optics = 0x08;
else
door_optics = (((m_bank20 >> 4) & 1) << 3); // Use Door Optics Transmitter
@@ -477,22 +485,22 @@ READ8_MEMBER(splus_state::splus_serial_r)
val = val | door_optics; // Door Optics Receiver
val = val | coin_out; // Hopper Coin OutR
val = val | 0x00; // Hopper Full
- val = val | (ioport("I10")->read_safe(0x40) & 0x40); // Handle/Spin Button
- val = val | (ioport("I10")->read_safe(0x80) & 0x80); // Jackpot Reset Key
+ val = val | (m_i10->read() & 0x40); // Handle/Spin Button
+ val = val | (m_i10->read() & 0x80); // Jackpot Reset Key
break;
case 0x02: // Bank 20
- val = val | (ioport("I20")->read_safe(0x01) & 0x01); // Bet One Credit
- val = val | (ioport("I20")->read_safe(0x02) & 0x02); // Play Max Credits
- val = val | (ioport("I20")->read_safe(0x04) & 0x04); // Cash Out
- val = val | (ioport("I20")->read_safe(0x08) & 0x08); // Change Request
+ val = val | (m_i20->read() & 0x01); // Bet One Credit
+ val = val | (m_i20->read() & 0x02); // Play Max Credits
+ val = val | (m_i20->read() & 0x04); // Cash Out
+ val = val | (m_i20->read() & 0x08); // Change Request
val = val | 0x00; // Reel Mechanism
- val = val | (ioport("I20")->read_safe(0x20) & 0x20); // Self Test Button
+ val = val | (m_i20->read() & 0x20); // Self Test Button
val = val | 0x40; // Card Cage
val = val | 0x80; // Bill Acceptor
break;
case 0x04: // Bank 30
// Reserved
- val = val | (ioport("I30")->read_safe(0x02) & 0x02); // Drop Door
+ val = val | (m_i30->read() & 0x02); // Drop Door
// Jackpot to Credit Key
// Reserved
// Reserved
diff --git a/src/mame/drivers/spy.c b/src/mame/drivers/spy.c
index 0d1254c7aca..a37a42d0bce 100644
--- a/src/mame/drivers/spy.c
+++ b/src/mame/drivers/spy.c
@@ -519,6 +519,7 @@ static MACHINE_CONFIG_START( spy, spy_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(spy_state, sprite_callback)
/* sound hardware */
diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c
index e03a6cf63ce..768ea171221 100644
--- a/src/mame/drivers/taito_b.c
+++ b/src/mame/drivers/taito_b.c
@@ -3213,7 +3213,7 @@ ROM_START( hiticej ) /* 2 Player version */
ROM_LOAD( "pal16r4b-c59-07.61", 0x600, 0x104, CRC(cf64bd95) SHA1(5acada8bd6da40b5342bdd7ec494ee0e615492f0) )
ROM_END
-ROM_START( rambo3 )
+ROM_START( rambo3 ) /* all of the following roms should most likely have the names "B93-xx" rather than "ramb3-xx" */
ROM_REGION( 0x80000, "maincpu", 0 ) /* 512k for 68000 code */
ROM_LOAD16_BYTE( "ramb3-11.bin", 0x00000, 0x20000, CRC(1cc42247) SHA1(e5a226a0016ec329fc23046c426c6303e452ef1d) )
ROM_LOAD16_BYTE( "ramb3-14.bin", 0x00001, 0x20000, CRC(7d917c21) SHA1(2850c46d6bdabfb76c40a7dc78ebc14b69ce95c9) )
diff --git a/src/mame/drivers/thunderx.c b/src/mame/drivers/thunderx.c
index 6dced26d356..0149e610533 100644
--- a/src/mame/drivers/thunderx.c
+++ b/src/mame/drivers/thunderx.c
@@ -663,6 +663,7 @@ static MACHINE_CONFIG_START( scontra, thunderx_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(thunderx_state, sprite_callback)
/* sound hardware */
diff --git a/src/mame/drivers/tmnt.c b/src/mame/drivers/tmnt.c
index 4fd26f6d5ca..0d7c1c1ede7 100644
--- a/src/mame/drivers/tmnt.c
+++ b/src/mame/drivers/tmnt.c
@@ -1992,6 +1992,7 @@ static MACHINE_CONFIG_START( cuebrick, tmnt_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, mia_sprite_callback)
MCFG_K051960_PLANEORDER(K051960_PLANEORDER_MIA)
@@ -2041,6 +2042,7 @@ static MACHINE_CONFIG_START( mia, tmnt_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, mia_sprite_callback)
MCFG_K051960_PLANEORDER(K051960_PLANEORDER_MIA)
@@ -2103,6 +2105,7 @@ static MACHINE_CONFIG_START( tmnt, tmnt_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, tmnt_sprite_callback)
MCFG_K051960_PLANEORDER(K051960_PLANEORDER_MIA)
@@ -2163,6 +2166,7 @@ static MACHINE_CONFIG_START( punkshot, tmnt_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, punkshot_sprite_callback)
MCFG_K053251_ADD("k053251")
@@ -2632,6 +2636,7 @@ static MACHINE_CONFIG_START( thndrx2, tmnt_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(tmnt_state, thndrx2_sprite_callback)
MCFG_K053251_ADD("k053251")
diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c
index 72648573bcf..fd2ef8fdf5e 100644
--- a/src/mame/drivers/toaplan2.c
+++ b/src/mame/drivers/toaplan2.c
@@ -1885,6 +1885,28 @@ static INPUT_PORTS_START( kbash )
// PORT_CONFSETTING( 0x00f0, DEF_STR( Unused ) )
INPUT_PORTS_END
+static INPUT_PORTS_START( kbashk )
+ PORT_INCLUDE( kbash )
+
+ PORT_MODIFY("JMPR")
+ PORT_CONFNAME( 0x00f0, 0x0000, DEF_STR( Region ) ) //PORT_CONFLOCATION("JP:!4,!3,!2,!1")
+ PORT_CONFSETTING( 0x0000, "Japan (Taito license)" ) // Taito license
+ PORT_CONFSETTING( 0x0010, DEF_STR( Unused ) )
+ PORT_CONFSETTING( 0x0020, DEF_STR( Unused ) )
+ PORT_CONFSETTING( 0x0030, DEF_STR( Korea ) )
+ PORT_CONFSETTING( 0x0040, DEF_STR( Hong_Kong ) )
+ PORT_CONFSETTING( 0x0050, DEF_STR( Taiwan ) )
+ PORT_CONFSETTING( 0x0060, DEF_STR( Southeast_Asia ) )
+ PORT_CONFSETTING( 0x0070, DEF_STR( Unused ) )
+ PORT_CONFSETTING( 0x0080, DEF_STR( Japan ) ) // no Taito license
+ PORT_CONFSETTING( 0x0090, DEF_STR( Unused ) )
+ PORT_CONFSETTING( 0x00a0, DEF_STR( Unused ) )
+ PORT_CONFSETTING( 0x00b0, DEF_STR( Korea ) )
+ PORT_CONFSETTING( 0x00c0, DEF_STR( Hong_Kong ))
+ PORT_CONFSETTING( 0x00d0, DEF_STR( Taiwan ))
+ PORT_CONFSETTING( 0x00e0, DEF_STR( Southeast_Asia ))
+ PORT_CONFSETTING( 0x00f0, DEF_STR( Unused ) )
+INPUT_PORTS_END
static INPUT_PORTS_START( kbash2 )
PORT_INCLUDE( kbash )
@@ -4135,7 +4157,25 @@ ROM_START( kbash )
ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) )
ROM_END
+ROM_START( kbashk )
+ ROM_REGION( 0x080000, "maincpu", 0 ) /* Main 68K code */
+ ROM_LOAD16_WORD_SWAP( "tp023_01.u52", 0x000000, 0x080000, CRC(099aefbc) SHA1(8daa0deffe221e1bb5a8744ced18c23ad319ffd3) ) // same label as parent?
+
+ /* Secondary CPU is a Toaplan marked chip, (TS-004-Dash TOA PLAN) */
+ /* It's a NEC V25 (PLCC94) (encrypted) */
+ ROM_REGION( 0x8000, "audiocpu", 0 ) /* Sound CPU code */
+ ROM_LOAD( "tp023_02.bin", 0x0000, 0x8000, CRC(4cd882a1) SHA1(7199a5c384918f775f0815e09c46b2a58141814a) )
+
+ ROM_REGION( 0x800000, "gp9001", 0 )
+ ROM_LOAD( "tp023_3.bin", 0x000000, 0x200000, CRC(32ad508b) SHA1(e473489beaf649d3e5236770eb043327e309850c) )
+ ROM_LOAD( "tp023_5.bin", 0x200000, 0x200000, CRC(b84c90eb) SHA1(17a1531d884d9a9696d1b25d65f9155f02396e0e) )
+ ROM_LOAD( "tp023_4.bin", 0x400000, 0x200000, CRC(e493c077) SHA1(0edcfb70483ad07206695d9283031b85cd198a36) )
+ ROM_LOAD( "tp023_6.bin", 0x600000, 0x200000, CRC(9084b50a) SHA1(03b58278619524d2f09a4b1c152d5e057e792a56) )
+
+ ROM_REGION( 0x40000, "oki", 0 ) /* ADPCM Samples */
+ ROM_LOAD( "tp023_7.bin", 0x00000, 0x40000, CRC(3732318f) SHA1(f0768459f5ad2dee53d408a0a5ae3a314864e667) )
+ROM_END
/*
Knuckle Bash 2
This is a hacked version of Knuckle Bash on bootleg/Korean/Chinese
@@ -5313,7 +5353,8 @@ GAME( 1992, dogyuun, 0, dogyuun, dogyuun, toaplan2_state, dogyuun,
GAME( 1992, dogyuuna, dogyuun, dogyuun, dogyuuna, toaplan2_state, dogyuun, ROT270, "Toaplan", "Dogyuun (older set)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, dogyuunt, dogyuun, dogyuun, dogyuunt, toaplan2_state, dogyuun, ROT270, "Toaplan", "Dogyuun (location test)", MACHINE_SUPPORTS_SAVE )
-GAME( 1993, kbash, 0, kbash, kbash, driver_device, 0, ROT0, "Toaplan", "Knuckle Bash", MACHINE_SUPPORTS_SAVE )
+GAME( 1993, kbash, 0, kbash, kbash, driver_device, 0, ROT0, "Toaplan / Atari", "Knuckle Bash", MACHINE_SUPPORTS_SAVE ) // Atari license shown for some regions.
+GAME( 1993, kbashk, kbash, kbash, kbashk,driver_device, 0, ROT0, "Toaplan / Taito", "Knuckle Bash (Korean PCB)", MACHINE_SUPPORTS_SAVE ) // Japan region has optional Taito license, maybe the original Japan release?
GAME( 1999, kbash2, 0, kbash2, kbash2, driver_device, 0, ROT0, "bootleg", "Knuckle Bash 2 (bootleg)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/ultraman.c b/src/mame/drivers/ultraman.c
index e06606002b4..93c6c67f7c6 100644
--- a/src/mame/drivers/ultraman.c
+++ b/src/mame/drivers/ultraman.c
@@ -200,6 +200,7 @@ static MACHINE_CONFIG_START( ultraman, ultraman_state )
MCFG_DEVICE_ADD("k051960", K051960, 0)
MCFG_GFX_PALETTE("palette")
+ MCFG_K051960_SCREEN_TAG("screen")
MCFG_K051960_CB(ultraman_state, sprite_callback)
MCFG_DEVICE_ADD("k051316_1", K051316, 0)
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index b516b736d30..d017f04712c 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -464,7 +464,9 @@ public:
m_nile_regs(*this, "nile_regs"),
m_rombase(*this, "rombase"),
m_dcs(*this, "dcs"),
- m_ioasic(*this, "ioasic") { }
+ m_ioasic(*this, "ioasic"),
+ m_io_analog(*this, "AN")
+ { }
required_device<mips3_device> m_maincpu;
required_device<m48t37_device> m_timekeeper;
@@ -475,6 +477,7 @@ public:
required_shared_ptr<UINT32> m_rombase;
required_device<dcs_audio_device> m_dcs;
required_device<midway_ioasic_device> m_ioasic;
+ optional_ioport_array<8> m_io_analog;
UINT16 m_nile_irq_state;
UINT16 m_ide_irq_state;
@@ -1172,7 +1175,7 @@ WRITE32_MEMBER( vegas_state::nile_w )
logerror("Unexpected value: timer %d is prescaled\n", which);
if (scale != 0)
m_timer[which]->adjust(TIMER_PERIOD * scale, which);
- if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (m_nile_regs[offset + 1] + 1)).attoseconds));
+ if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (m_nile_regs[offset + 1] + 1)).attoseconds()));
}
/* timer disabled? */
@@ -1442,11 +1445,9 @@ READ32_MEMBER( vegas_state::analog_port_r )
WRITE32_MEMBER( vegas_state::analog_port_w )
{
- static const char *const portnames[] = { "AN0", "AN1", "AN2", "AN3", "AN4", "AN5", "AN6", "AN7" };
-
if (data < 8 || data > 15)
logerror("%08X:Unexpected analog port select = %08X\n", safe_pc(), data);
- m_pending_analog_read = ioport(portnames[data & 7])->read_safe(0);
+ m_pending_analog_read = m_io_analog[data & 7] ? m_io_analog[data & 7]->read() : 0;
}
@@ -1947,28 +1948,28 @@ static INPUT_PORTS_START( warfa )
PORT_DIPSETTING( 0x4000, "Medium Res 512x384" )
PORT_DIPSETTING( 0x0000, "VGA Res 640x480" )
- PORT_START("AN0")
+ PORT_START("AN.0")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START("AN1")
+ PORT_START("AN.1")
PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_PLAYER(1)
- PORT_START("AN2")
+ PORT_START("AN.2")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN3")
+ PORT_START("AN.3")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN4")
+ PORT_START("AN.4")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN5")
+ PORT_START("AN.5")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN6")
+ PORT_START("AN.6")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN7")
+ PORT_START("AN.7")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
INPUT_PORTS_END
@@ -1991,28 +1992,28 @@ static INPUT_PORTS_START( roadburn )
PORT_DIPSETTING( 0x0200, "Medium Res 512x384" )
PORT_DIPSETTING( 0x0000, "VGA Res 640x480" )
- PORT_START("AN0") /* Steer */
+ PORT_START("AN.0") /* Steer */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
- PORT_START("AN1") /* Accel */
+ PORT_START("AN.1") /* Accel */
PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
- PORT_START("AN2") /* Brake */
+ PORT_START("AN.2") /* Brake */
PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
- PORT_START("AN3")
+ PORT_START("AN.3")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN4")
+ PORT_START("AN.4")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN5")
+ PORT_START("AN.5")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN6")
+ PORT_START("AN.6")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN7")
+ PORT_START("AN.7")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
INPUT_PORTS_END
@@ -2087,28 +2088,28 @@ static INPUT_PORTS_START( sf2049 )
PORT_DIPSETTING( 0x0200, "Medium Res 512x384" )
PORT_DIPSETTING( 0x0300, "VGA Res 640x480" )
- PORT_START("AN0") /* Steer */
+ PORT_START("AN.0") /* Steer */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
- PORT_START("AN1") /* Accel */
+ PORT_START("AN.1") /* Accel */
PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
- PORT_START("AN2") /* Brake */
+ PORT_START("AN.2") /* Brake */
PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
- PORT_START("AN3")
+ PORT_START("AN.3")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN4")
+ PORT_START("AN.4")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN5")
+ PORT_START("AN.5")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN6")
+ PORT_START("AN.6")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN7")
+ PORT_START("AN.7")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
INPUT_PORTS_END
@@ -2118,28 +2119,28 @@ static INPUT_PORTS_START( sf2049se )
PORT_MODIFY("DIPS")
- PORT_START("AN0") /* Steer */
+ PORT_START("AN.0") /* Steer */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
- PORT_START("AN1") /* Accel */
+ PORT_START("AN.1") /* Accel */
PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
- PORT_START("AN2") /* Brake */
+ PORT_START("AN.2") /* Brake */
PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
- PORT_START("AN3")
+ PORT_START("AN.3")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN4")
+ PORT_START("AN.4")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN5")
+ PORT_START("AN.5")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN6")
+ PORT_START("AN.6")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN7")
+ PORT_START("AN.7")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
INPUT_PORTS_END
@@ -2149,28 +2150,28 @@ static INPUT_PORTS_START( sf2049te )
PORT_MODIFY("DIPS")
- PORT_START("AN0") /* Steer */
+ PORT_START("AN.0") /* Steer */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
- PORT_START("AN1") /* Accel */
+ PORT_START("AN.1") /* Accel */
PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
- PORT_START("AN2") /* Brake */
+ PORT_START("AN.2") /* Brake */
PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
- PORT_START("AN3")
+ PORT_START("AN.3")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN4")
+ PORT_START("AN.4")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN5")
+ PORT_START("AN.5")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN6")
+ PORT_START("AN.6")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN7")
+ PORT_START("AN.7")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
INPUT_PORTS_END
@@ -2180,28 +2181,28 @@ static INPUT_PORTS_START( cartfury )
PORT_MODIFY("DIPS")
- PORT_START("AN0") /* Steer */
+ PORT_START("AN.0") /* Steer */
PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_MINMAX(0x10, 0xf0) PORT_SENSITIVITY(25) PORT_KEYDELTA(5)
- PORT_START("AN1") /* Accel */
+ PORT_START("AN.1") /* Accel */
PORT_BIT( 0xff, 0x80, IPT_PEDAL ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(20)
- PORT_START("AN2") /* Brake */
+ PORT_START("AN.2") /* Brake */
PORT_BIT( 0xff, 0x80, IPT_PEDAL2 ) PORT_MINMAX(0x00, 0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(100)
- PORT_START("AN3")
+ PORT_START("AN.3")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN4")
+ PORT_START("AN.4")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN5")
+ PORT_START("AN.5")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN6")
+ PORT_START("AN.6")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
- PORT_START("AN7")
+ PORT_START("AN.7")
PORT_BIT( 0xff, 0x80, IPT_SPECIAL )
INPUT_PORTS_END
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index ebe685ad277..f327a895cb2 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -186,7 +186,7 @@ CUSTOM_INPUT_MEMBER(vicdual_state::get_timer_value)
int vicdual_state::is_cabinet_color()
{
- return (ioport(COLOR_BW_PORT_TAG)->read_safe(0) & 1) ? 0 : 1;
+ return ((m_color_bw ? m_color_bw->read() : 0) & 1) ? 0 : 1;
}
@@ -266,8 +266,8 @@ READ8_MEMBER(vicdual_state::depthch_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x08) ret = ioport("IN1")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x08) ret = m_in1->read();
return ret;
}
@@ -347,8 +347,8 @@ READ8_MEMBER(vicdual_state::safari_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x08) ret = ioport("IN1")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x08) ret = m_in1->read();
return ret;
}
@@ -430,8 +430,8 @@ READ8_MEMBER(vicdual_state::frogs_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x08) ret = ioport("IN1")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x08) ret = m_in1->read();
return ret;
}
@@ -541,8 +541,8 @@ READ8_MEMBER(vicdual_state::headon_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x08) ret = ioport("IN1")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x08) ret = m_in1->read();
return ret;
}
@@ -552,9 +552,9 @@ READ8_MEMBER(vicdual_state::sspaceat_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x04) ret = ioport("IN1")->read();
- if (offset & 0x08) ret = ioport("IN2")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x04) ret = m_in1->read();
+ if (offset & 0x08) ret = m_in2->read();
return ret;
}
@@ -800,10 +800,10 @@ READ8_MEMBER(vicdual_state::headon2_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
+ if (offset & 0x01) ret = m_in0->read();
if (offset & 0x02) { /* schematics show this as in input port, but never read from */ }
- if (offset & 0x04) ret = ioport("IN1")->read();
- if (offset & 0x08) ret = ioport("IN2")->read();
+ if (offset & 0x04) ret = m_in1->read();
+ if (offset & 0x08) ret = m_in2->read();
if (offset & 0x12) logerror("********* Read from port %x\n", offset);
return ret;
@@ -1289,14 +1289,12 @@ ADDRESS_MAP_END
/* several of the games' lives DIPs are spread across two input ports */
CUSTOM_INPUT_MEMBER(vicdual_state::fake_lives_r)
{
- static const char *const portnames[] = { "FAKE_LIVES1", "FAKE_LIVES2" };
-
/* use the low byte for the bitmask */
UINT8 bit_mask = ((FPTR)param) & 0xff;
/* and use d8 for the port */
int port = ((FPTR)param) >> 8 & 1;
- return (ioport(portnames[port])->read_safe(0) & bit_mask) ? 0 : 1;
+ return ((m_fake_lives[port] ? m_fake_lives[port]->read() : 0) & bit_mask) ? 0 : 1;
}
@@ -1341,7 +1339,7 @@ static INPUT_PORTS_START( invho2 )
PORT_COIN_DEFAULT
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x03, 0x01, "Head On 2 Lives" ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x01, "3" )
@@ -1353,7 +1351,7 @@ static INPUT_PORTS_START( invho2 )
reads IN3 bit 3 instead of bit 2.
Note that the manual only lists setting it to 3 or 4.
*/
- PORT_START("FAKE_LIVES2")
+ PORT_START("FAKE_LIVES.1")
PORT_DIPNAME( 0x03, 0x03, "Invinco Lives" ) PORT_DIPLOCATION("SW1:3,4")
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "4" )
@@ -1404,14 +1402,14 @@ static INPUT_PORTS_START( carhntds )
PORT_COIN_DEFAULT
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x03, 0x01, "Car Hunt Lives" ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x03, "1" )
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x01, "3" )
PORT_DIPSETTING( 0x00, "4" )
- PORT_START("FAKE_LIVES2")
+ PORT_START("FAKE_LIVES.1")
PORT_DIPNAME( 0x03, 0x03, "Deep Scan Lives" ) PORT_DIPLOCATION("SW1:3,4")
PORT_DIPSETTING( 0x02, "1" )
PORT_DIPSETTING( 0x01, "2" )
@@ -1462,14 +1460,14 @@ static INPUT_PORTS_START( invds )
PORT_COIN_DEFAULT
// SW1 @ C1, 6-pos (where are 5 & 6?)
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x03, 0x03, "Invinco Lives" ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "4" )
PORT_DIPSETTING( 0x01, "5" )
PORT_DIPSETTING( 0x00, "6" )
- PORT_START("FAKE_LIVES2")
+ PORT_START("FAKE_LIVES.1")
PORT_DIPNAME( 0x03, 0x01, "Deep Scan Lives" ) PORT_DIPLOCATION("SW1:3,4")
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x01, "3" )
@@ -1523,7 +1521,7 @@ static INPUT_PORTS_START( sspacaho )
PORT_COIN_DEFAULT
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x03, 0x03, "Space Attack Lives" ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "4" )
@@ -1763,7 +1761,7 @@ static INPUT_PORTS_START( brdrline )
PORT_COIN_DEFAULT
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x07, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2,3")
PORT_DIPSETTING( 0x01, "3" )
PORT_DIPSETTING( 0x02, "4" )
@@ -1838,7 +1836,7 @@ static INPUT_PORTS_START( pulsar )
PORT_COIN_DEFAULT
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x02, "3" )
@@ -1943,7 +1941,7 @@ static INPUT_PORTS_START( alphaho )
PORT_COIN_DEFAULT
- PORT_START("FAKE_LIVES1")
+ PORT_START("FAKE_LIVES.0")
PORT_DIPNAME( 0x03, 0x03, "Alpha Fighter Lives" ) PORT_DIPLOCATION("SW1:1,2")
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "4" )
@@ -2230,8 +2228,8 @@ READ8_MEMBER(vicdual_state::nsub_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x08) ret = ioport("IN1")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x08) ret = m_in1->read();
return ret;
}
@@ -2279,7 +2277,7 @@ INPUT_CHANGED_MEMBER(vicdual_state::nsub_coin_in)
if (newval)
{
int which = (int)(FPTR)param;
- int coinage = ioport("COINAGE")->read();
+ int coinage = m_coinage->read();
switch (which)
{
@@ -2377,7 +2375,7 @@ MACHINE_START_MEMBER(vicdual_state,nsub)
MACHINE_RESET_MEMBER(vicdual_state,nsub)
{
- m_nsub_coin_counter = ioport("COINAGE")->read() & 7;
+ m_nsub_coin_counter = m_coinage->read() & 7;
machine_reset();
}
@@ -2411,9 +2409,9 @@ READ8_MEMBER(vicdual_state::invinco_io_r)
{
UINT8 ret = 0;
- if (offset & 0x01) ret = ioport("IN0")->read();
- if (offset & 0x02) ret = ioport("IN1")->read();
- if (offset & 0x08) ret = ioport("IN2")->read();
+ if (offset & 0x01) ret = m_in0->read();
+ if (offset & 0x02) ret = m_in1->read();
+ if (offset & 0x08) ret = m_in2->read();
return ret;
}
diff --git a/src/mame/drivers/warpwarp.c b/src/mame/drivers/warpwarp.c
index dd05ae98f53..9a4e1ed7675 100644
--- a/src/mame/drivers/warpwarp.c
+++ b/src/mame/drivers/warpwarp.c
@@ -150,18 +150,18 @@ INTERRUPT_GEN_MEMBER(warpwarp_state::vblank_irq)
device.execute().set_input_line(0, ASSERT_LINE);
}
+IOPORT_ARRAY_MEMBER(warpwarp_state::portnames) { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3
/* B&W Games I/O */
READ8_MEMBER(warpwarp_state::geebee_in_r)
{
int res;
- static const char *const portnames[] = { "SW0", "SW1", "DSW2", "PLACEHOLDER" }; // "IN1" & "IN2" are read separately when offset==3
offset &= 3;
- res = ioport(portnames[offset])->read_safe(0);
+ res = m_ports[offset] ? m_ports[offset]->read() : 0;
if (offset == 3)
{
- res = ioport((flip_screen() & 1) ? "IN2" : "IN1")->read(); // read player 2 input in cocktail mode
+ res = (flip_screen() & 1) ? m_in2->read() : m_in1->read(); // read player 2 input in cocktail mode
if (m_handle_joystick)
{
/* map digital two-way joystick to two fixed VOLIN values */
@@ -234,13 +234,13 @@ WRITE8_MEMBER(warpwarp_state::geebee_out7_w)
/* Read Switch Inputs */
READ8_MEMBER(warpwarp_state::warpwarp_sw_r)
{
- return (ioport("IN0")->read() >> (offset & 7)) & 1;
+ return (m_in0->read() >> (offset & 7)) & 1;
}
/* Read Dipswitches */
READ8_MEMBER(warpwarp_state::warpwarp_dsw1_r)
{
- return (ioport("DSW1")->read() >> (offset & 7)) & 1;
+ return (m_dsw1->read() >> (offset & 7)) & 1;
}
/* Read mux Controller Inputs */
@@ -248,7 +248,7 @@ READ8_MEMBER(warpwarp_state::warpwarp_vol_r)
{
int res;
- res = ioport((flip_screen() & 1) ? "VOLIN2" : "VOLIN1")->read();
+ res = (flip_screen() & 1) ? m_volin2->read() : m_volin1->read();
if (m_handle_joystick)
{
if (res & 1) return 0x0f;
diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c
index 5727594dee5..e8ce89b5983 100644
--- a/src/mame/drivers/wgp.c
+++ b/src/mame/drivers/wgp.c
@@ -516,12 +516,12 @@ WRITE16_MEMBER(wgp_state::rotate_port_w)
READ16_MEMBER(wgp_state::wgp_adinput_r)
{
int steer = 0x40;
- int fake = ioport(FAKE_PORT_TAG)->read_safe(0x00);
+ int fake = m_fake ? m_fake->read() : 0;
if (!(fake & 0x10)) /* Analogue steer (the real control method) */
{
/* Reduce span to 0x80 */
- steer = (ioport(STEER_PORT_TAG)->read_safe(0x00) * 0x80) / 0x100;
+ steer = ((m_steer ? m_steer->read() : 0) * 0x80) / 0x100;
}
else /* Digital steer */
{
@@ -566,7 +566,7 @@ READ16_MEMBER(wgp_state::wgp_adinput_r)
}
case 0x05:
- return ioport(UNKNOWN_PORT_TAG)->read_safe(0x00); /* unknown */
+ return m_unknown ? m_unknown->read() : 0; /* unknown */
}
logerror("CPU #0 PC %06x: warning - read unmapped a/d input offset %06x\n",space.device().safe_pc(),offset);
@@ -590,7 +590,7 @@ WRITE16_MEMBER(wgp_state::wgp_adinput_w)
WRITE8_MEMBER(wgp_state::sound_bankswitch_w)
{
- membank("z80bank")->set_entry(data & 3);
+ m_z80bank->set_entry(data & 3);
}
WRITE16_MEMBER(wgp_state::wgp_sound_w)
@@ -909,7 +909,7 @@ void wgp_state::machine_reset()
void wgp_state::machine_start()
{
- membank("z80bank")->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
+ m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000);
save_item(NAME(m_cpua_ctrl));
save_item(NAME(m_port_sel));
diff --git a/src/mame/drivers/xmen.c b/src/mame/drivers/xmen.c
index 000a4fba7e4..f0cac836222 100644
--- a/src/mame/drivers/xmen.c
+++ b/src/mame/drivers/xmen.c
@@ -83,15 +83,9 @@ WRITE16_MEMBER(xmen_state::xmen_18fa00_w)
}
}
-void xmen_state::sound_reset_bank()
-{
- membank("bank4")->set_entry(m_sound_curbank & 0x07);
-}
-
WRITE8_MEMBER(xmen_state::sound_bankswitch_w)
{
- m_sound_curbank = data;
- sound_reset_bank();
+ m_z80bank->set_entry(data & 0x07);
}
@@ -118,7 +112,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, xmen_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
- AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank4")
+ AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("z80bank")
AM_RANGE(0xc000, 0xdfff) AM_RAM
AM_RANGE(0xe000, 0xe22f) AM_DEVREADWRITE("k054539", k054539_device, read, write)
AM_RANGE(0xe800, 0xe801) AM_MIRROR(0x0400) AM_DEVREADWRITE("ymsnd", ym2151_device, read, write)
@@ -282,17 +276,13 @@ INPUT_PORTS_END
void xmen_state::machine_start()
{
- UINT8 *ROM = memregion("audiocpu")->base();
-
- membank("bank4")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
- membank("bank4")->set_entry(0);
+ m_z80bank->configure_entries(0, 8, memregion("audiocpu")->base(), 0x4000);
+ m_z80bank->set_entry(0);
- save_item(NAME(m_sound_curbank));
save_item(NAME(m_sprite_colorbase));
save_item(NAME(m_layer_colorbase));
save_item(NAME(m_layerpri));
save_item(NAME(m_vblank_irq_mask));
- machine().save().register_postload(save_prepost_delegate(FUNC(xmen_state::sound_reset_bank), this));
}
void xmen_state::machine_reset()
@@ -306,7 +296,6 @@ void xmen_state::machine_reset()
}
m_sprite_colorbase = 0;
- m_sound_curbank = 0;
m_vblank_irq_mask = 0;
}
@@ -501,9 +490,8 @@ ROM_START( xmen )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -529,9 +517,8 @@ ROM_START( xmenj )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -557,9 +544,8 @@ ROM_START( xmene )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -585,9 +571,8 @@ ROM_START( xmena )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -613,9 +598,8 @@ ROM_START( xmenaa )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -641,9 +625,8 @@ ROM_START( xmen2pe )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -669,9 +652,8 @@ ROM_START( xmen2pu )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -697,9 +679,8 @@ ROM_START( xmen2pa )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -725,9 +706,8 @@ ROM_START( xmen2pj )
ROM_LOAD16_BYTE( "065-a02.9d", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.9f", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.6f", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.15l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -807,9 +787,8 @@ ROM_START( xmen6p )
ROM_LOAD16_BYTE( "065-a02.17g", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.17j", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.7b", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.1l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
@@ -835,9 +814,8 @@ ROM_START( xmen6pu )
ROM_LOAD16_BYTE( "065-a02.17g", 0x80000, 0x40000, CRC(b31dc44c) SHA1(4bdac05826b4d6d4fe46686ede5190e2f73eefc5) )
ROM_LOAD16_BYTE( "065-a03.17j", 0x80001, 0x40000, CRC(13842fe6) SHA1(b61f094eb94336edb8708d3437ead9b853b2d6e6) )
- ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k+128k for sound cpu */
+ ROM_REGION( 0x20000, "audiocpu", 0 )
ROM_LOAD( "065-a01.7b", 0x00000, 0x20000, CRC(147d3a4d) SHA1(a14409fe991e803b9e7812303e3a9ebd857d8b01) )
- ROM_RELOAD( 0x10000, 0x20000 )
ROM_REGION( 0x200000, "k052109", 0 ) /* tiles */
ROM_LOAD32_WORD( "065-a08.1l", 0x000000, 0x100000, CRC(6b649aca) SHA1(2595f314517738e8614facf578cc951a6c36a180) )
diff --git a/src/mame/etc/template_driver.c b/src/mame/etc/template_driver.c
index 40d40704c9e..168bfc6c837 100644
--- a/src/mame/etc/template_driver.c
+++ b/src/mame/etc/template_driver.c
@@ -190,4 +190,4 @@ ROM_END
// For a generic system:
// SYST(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS)
-GAME( 198?, xxx, 0, xxx, xxx, driver_device, 0, ROT0, "<template_manufacturer>", "<template_machinename>", GAME_IS_SKELETON )
+GAME( 198?, xxx, 0, xxx, xxx, driver_device, 0, ROT0, "<template_manufacturer>", "<template_machinename>", MACHINE_IS_SKELETON )
diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h
index 42cdb55ae98..e8197eea633 100644
--- a/src/mame/includes/ajax.h
+++ b/src/mame/includes/ajax.h
@@ -47,7 +47,6 @@ public:
virtual void machine_start();
virtual void machine_reset();
UINT32 screen_update_ajax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(ajax_interrupt);
DECLARE_WRITE8_MEMBER(volume_callback0);
DECLARE_WRITE8_MEMBER(volume_callback1);
K051316_CB_MEMBER(zoom_callback);
diff --git a/src/mame/includes/aliens.h b/src/mame/includes/aliens.h
index f4b32aa50ea..6e21270c068 100644
--- a/src/mame/includes/aliens.h
+++ b/src/mame/includes/aliens.h
@@ -10,7 +10,6 @@
#include "sound/k007232.h"
#include "video/k052109.h"
#include "video/k051960.h"
-#include "video/konami_helper.h"
class aliens_state : public driver_device
{
@@ -22,11 +21,8 @@ public:
m_bank0000(*this, "bank0000"),
m_k007232(*this, "k007232"),
m_k052109(*this, "k052109"),
- m_k051960(*this, "k051960") { }
-
- /* video-related */
- int m_layer_colorbase[3];
- int m_sprite_colorbase;
+ m_k051960(*this, "k051960"),
+ m_rombank(*this, "rombank") { }
/* devices */
required_device<cpu_device> m_maincpu;
@@ -35,6 +31,8 @@ public:
required_device<k007232_device> m_k007232;
required_device<k052109_device> m_k052109;
required_device<k051960_device> m_k051960;
+ required_memory_bank m_rombank;
+
DECLARE_WRITE8_MEMBER(aliens_coin_counter_w);
DECLARE_WRITE8_MEMBER(aliens_sh_irqtrigger_w);
DECLARE_READ8_MEMBER(k052109_051960_r);
@@ -42,9 +40,7 @@ public:
DECLARE_WRITE8_MEMBER(aliens_snd_bankswitch_w);
virtual void machine_start();
virtual void machine_reset();
- virtual void video_start();
UINT32 screen_update_aliens(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(aliens_interrupt);
DECLARE_WRITE8_MEMBER(volume_callback);
K052109_CB_MEMBER(tile_callback);
K051960_CB_MEMBER(sprite_callback);
diff --git a/src/mame/includes/astrocde.h b/src/mame/includes/astrocde.h
index fe2c249de99..9469edd8b4c 100644
--- a/src/mame/includes/astrocde.h
+++ b/src/mame/includes/astrocde.h
@@ -5,6 +5,7 @@
Bally Astrocade-based hardware
***************************************************************************/
+#include "machine/bankdev.h"
#include "sound/astrocde.h"
#include "sound/samples.h"
#include "sound/votrax.h"
@@ -37,7 +38,24 @@ public:
m_astrocade_sound1(*this, "astrocade1"),
m_videoram(*this, "videoram"),
m_protected_ram(*this, "protected_ram"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_bank4000(*this, "bank4000"),
+ m_bank8000(*this, "bank8000"),
+ m_p1handle(*this, "P1HANDLE"),
+ m_p2handle(*this, "P2HANDLE"),
+ m_p3handle(*this, "P3HANDLE"),
+ m_p4handle(*this, "P4HANDLE"),
+ m_keypad0(*this, "KEYPAD0"),
+ m_keypad1(*this, "KEYPAD1"),
+ m_keypad2(*this, "KEYPAD2"),
+ m_keypad3(*this, "KEYPAD3"),
+ m_p1_knob(*this, "P1_KNOB"),
+ m_p2_knob(*this, "P2_KNOB"),
+ m_p3_knob(*this, "P3_KNOB"),
+ m_p4_knob(*this, "P4_KNOB"),
+ m_trackball(*this, trackball_inputs),
+ m_joystick(*this, joystick_inputs)
+ { }
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_subcpu;
@@ -47,6 +65,24 @@ public:
optional_shared_ptr<UINT8> m_videoram;
optional_shared_ptr<UINT8> m_protected_ram;
required_device<screen_device> m_screen;
+ optional_device<address_map_bank_device> m_bank4000;
+ optional_memory_bank m_bank8000;
+ optional_ioport m_p1handle;
+ optional_ioport m_p2handle;
+ optional_ioport m_p3handle;
+ optional_ioport m_p4handle;
+ optional_ioport m_keypad0;
+ optional_ioport m_keypad1;
+ optional_ioport m_keypad2;
+ optional_ioport m_keypad3;
+ optional_ioport m_p1_knob;
+ optional_ioport m_p2_knob;
+ optional_ioport m_p3_knob;
+ optional_ioport m_p4_knob;
+ DECLARE_IOPORT_ARRAY(trackball_inputs);
+ optional_ioport_array<4> m_trackball;
+ DECLARE_IOPORT_ARRAY(joystick_inputs);
+ optional_ioport_array<2> m_joystick;
UINT8 m_video_config;
UINT8 m_sparkle[4];
@@ -58,7 +94,6 @@ public:
UINT8 m_port_2_last;
UINT8 m_ram_write_enable;
UINT8 m_input_select;
- UINT8 m_profpac_bank;
UINT8 *m_sparklestar;
UINT8 m_interrupt_enabl;
UINT8 m_interrupt_vector;
@@ -112,6 +147,7 @@ public:
DECLARE_READ8_MEMBER(profpac_io_1_r);
DECLARE_READ8_MEMBER(profpac_io_2_r);
DECLARE_WRITE8_MEMBER(profpac_banksw_w);
+ DECLARE_WRITE8_MEMBER(demndrgn_banksw_w);
DECLARE_READ8_MEMBER(demndrgn_io_r);
DECLARE_WRITE8_MEMBER(demndrgn_sound_w);
DECLARE_WRITE8_MEMBER(tenpindx_sound_w);
@@ -147,7 +183,6 @@ public:
UINT32 screen_update_astrocde(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_profpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(scanline_callback);
- void profbank_banksw_restore();
inline int mame_vpos_to_astrocade_vpos(int scanline);
void init_savestate();
void astrocade_trigger_lightpen(UINT8 vfeedback, UINT8 hfeedback);
diff --git a/src/mame/includes/battlnts.h b/src/mame/includes/battlnts.h
index 7caaedbcb47..8b65ea88388 100644
--- a/src/mame/includes/battlnts.h
+++ b/src/mame/includes/battlnts.h
@@ -23,7 +23,6 @@ public:
/* video-related */
int m_spritebank;
- int m_layer_colorbase[2];
/* devices */
required_device<cpu_device> m_maincpu;
diff --git a/src/mame/includes/bladestl.h b/src/mame/includes/bladestl.h
index 6988eb2b797..5eac667b587 100644
--- a/src/mame/includes/bladestl.h
+++ b/src/mame/includes/bladestl.h
@@ -45,7 +45,6 @@ public:
/* video-related */
int m_spritebank;
- int m_layer_colorbase[2];
/* misc */
int m_last_track[4];
diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h
index 45e5cc4ea8d..79b9aca8f9d 100644
--- a/src/mame/includes/chqflag.h
+++ b/src/mame/includes/chqflag.h
@@ -61,7 +61,6 @@ public:
virtual void machine_start();
virtual void machine_reset();
UINT32 screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(chqflag_scanline);
DECLARE_WRITE8_MEMBER(volume_callback0);
DECLARE_WRITE8_MEMBER(volume_callback1);
K051316_CB_MEMBER(zoom_callback_1);
diff --git a/src/mame/includes/crimfght.h b/src/mame/includes/crimfght.h
index 2e3acc50625..70b96323d40 100644
--- a/src/mame/includes/crimfght.h
+++ b/src/mame/includes/crimfght.h
@@ -5,11 +5,10 @@
Crime Fighters
*************************************************************************/
-#include "cpu/m6809/konami.h"
+#include "machine/bankdev.h"
#include "sound/k007232.h"
#include "video/k052109.h"
#include "video/k051960.h"
-#include "video/konami_helper.h"
class crimfght_state : public driver_device
{
@@ -18,37 +17,39 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
+ m_bank0000(*this, "bank0000"),
m_k007232(*this, "k007232"),
m_k052109(*this, "k052109"),
m_k051960(*this, "k051960"),
- m_palette(*this, "palette") { }
-
- /* memory pointers */
- std::vector<UINT8> m_paletteram;
-
- /* video-related */
- int m_layer_colorbase[3];
- int m_sprite_colorbase;
+ m_palette(*this, "palette"),
+ m_rombank(*this, "rombank") { }
/* devices */
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
+ required_device<address_map_bank_device> m_bank0000;
required_device<k007232_device> m_k007232;
required_device<k052109_device> m_k052109;
required_device<k051960_device> m_k051960;
required_device<palette_device> m_palette;
+ required_memory_bank m_rombank;
DECLARE_WRITE8_MEMBER(crimfght_coin_w);
- DECLARE_WRITE8_MEMBER(crimfght_sh_irqtrigger_w);
+ DECLARE_WRITE8_MEMBER(sound_w);
DECLARE_READ8_MEMBER(k052109_051960_r);
DECLARE_WRITE8_MEMBER(k052109_051960_w);
- DECLARE_WRITE8_MEMBER(crimfght_snd_bankswitch_w);
+ IRQ_CALLBACK_MEMBER(audiocpu_irq_ack);
+ DECLARE_WRITE8_MEMBER(ym2151_ct_w);
virtual void machine_start();
- virtual void video_start();
UINT32 screen_update_crimfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- INTERRUPT_GEN_MEMBER(crimfght_interrupt);
DECLARE_WRITE8_MEMBER(volume_callback);
K052109_CB_MEMBER(tile_callback);
K051960_CB_MEMBER(sprite_callback);
DECLARE_WRITE8_MEMBER(banking_callback);
+ DECLARE_CUSTOM_INPUT_MEMBER(system_r);
+
+private:
+ int m_woco;
+ int m_rmrd;
+ int m_init;
};
diff --git a/src/mame/includes/gaelco2.h b/src/mame/includes/gaelco2.h
index 32d71355cc8..ca0e5affccc 100644
--- a/src/mame/includes/gaelco2.h
+++ b/src/mame/includes/gaelco2.h
@@ -27,33 +27,21 @@ public:
required_device<palette_device> m_palette;
required_shared_ptr<UINT16> m_generic_paletteram_16;
- int m_clr_gun_int;
- UINT8 m_analog_ports[2];
UINT16 *m_videoram;
tilemap_t *m_pant[2];
int m_dual_monitor;
- DECLARE_READ16_MEMBER(p1_gun_x);
- DECLARE_READ16_MEMBER(p1_gun_y);
- DECLARE_READ16_MEMBER(p2_gun_x);
- DECLARE_READ16_MEMBER(p2_gun_y);
DECLARE_READ16_MEMBER(dallas_kludge_r);
DECLARE_WRITE16_MEMBER(gaelco2_coin_w);
DECLARE_WRITE16_MEMBER(gaelco2_coin2_w);
- DECLARE_WRITE16_MEMBER(wrally2_coin_w);
DECLARE_WRITE16_MEMBER(touchgo_coin_w);
- DECLARE_WRITE16_MEMBER(bang_clr_gun_int_w);
- DECLARE_WRITE16_MEMBER(wrally2_adc_clk);
- DECLARE_WRITE16_MEMBER(wrally2_adc_cs);
DECLARE_READ16_MEMBER(snowboar_protection_r);
DECLARE_WRITE16_MEMBER(snowboar_protection_w);
DECLARE_WRITE16_MEMBER(gaelco2_vram_w);
DECLARE_WRITE16_MEMBER(gaelco2_palette_w);
- DECLARE_CUSTOM_INPUT_MEMBER(wrally2_analog_bit_r);
DECLARE_DRIVER_INIT(touchgo);
DECLARE_DRIVER_INIT(snowboar);
DECLARE_DRIVER_INIT(alighunt);
- DECLARE_DRIVER_INIT(bang);
TILE_GET_INFO_MEMBER(get_tile_info_gaelco2_screen0);
TILE_GET_INFO_MEMBER(get_tile_info_gaelco2_screen1);
TILE_GET_INFO_MEMBER(get_tile_info_gaelco2_screen0_dual);
@@ -63,7 +51,6 @@ public:
UINT32 screen_update_gaelco2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gaelco2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gaelco2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(bang_irq);
DECLARE_WRITE16_MEMBER(gaelco2_eeprom_cs_w);
DECLARE_WRITE16_MEMBER(gaelco2_eeprom_sk_w);
DECLARE_WRITE16_MEMBER(gaelco2_eeprom_data_w);
@@ -71,3 +58,53 @@ public:
UINT32 dual_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int index);
void gaelco2_ROM16_split_gfx(const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2);
};
+
+
+class bang_state : public gaelco2_state
+{
+public:
+ bang_state(const machine_config &mconfig, device_type type, const char *tag)
+ : gaelco2_state(mconfig, type, tag)
+ , m_light0_x(*this, "LIGHT0_X")
+ , m_light0_y(*this, "LIGHT0_Y")
+ , m_light1_x(*this, "LIGHT1_X")
+ , m_light1_y(*this, "LIGHT1_Y")
+ {}
+
+ required_ioport m_light0_x;
+ required_ioport m_light0_y;
+ required_ioport m_light1_x;
+ required_ioport m_light1_y;
+
+ int m_clr_gun_int;
+
+ DECLARE_READ16_MEMBER(p1_gun_x);
+ DECLARE_READ16_MEMBER(p1_gun_y);
+ DECLARE_READ16_MEMBER(p2_gun_x);
+ DECLARE_READ16_MEMBER(p2_gun_y);
+ DECLARE_WRITE16_MEMBER(bang_clr_gun_int_w);
+ TIMER_DEVICE_CALLBACK_MEMBER(bang_irq);
+ DECLARE_DRIVER_INIT(bang);
+};
+
+
+class wrally2_state : public gaelco2_state
+{
+public:
+ wrally2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : gaelco2_state(mconfig, type, tag)
+ , m_analog0(*this, "ANALOG0")
+ , m_analog1(*this, "ANALOG1")
+ {}
+
+ required_ioport m_analog0;
+ required_ioport m_analog1;
+
+ UINT8 m_analog_ports[2];
+
+ DECLARE_WRITE16_MEMBER(wrally2_coin_w);
+ DECLARE_WRITE16_MEMBER(wrally2_adc_clk);
+ DECLARE_WRITE16_MEMBER(wrally2_adc_cs);
+ DECLARE_CUSTOM_INPUT_MEMBER(wrally2_analog_bit_r);
+};
+
diff --git a/src/mame/includes/gradius3.h b/src/mame/includes/gradius3.h
index a0e8bacc159..0aa94e18fed 100644
--- a/src/mame/includes/gradius3.h
+++ b/src/mame/includes/gradius3.h
@@ -16,6 +16,7 @@ public:
gradius3_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_gfxram(*this, "k052109"),
+ m_gfxrom(*this, "k051960"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
@@ -25,10 +26,7 @@ public:
/* memory pointers */
required_shared_ptr<UINT16> m_gfxram;
-
- /* video-related */
- int m_layer_colorbase[3];
- int m_sprite_colorbase;
+ required_region_ptr<UINT8> m_gfxrom;
/* misc */
int m_priority;
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 5a1925474a4..7602b616330 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -59,6 +59,8 @@ public:
optional_device<dac_device> m_ds3dac2;
optional_device<harddriv_sound_board_device> m_harddriv_sound;
optional_device<atari_jsa_base_device> m_jsa;
+ optional_device<screen_device> m_screen;
+ optional_device<mc68681_device> m_duartn68681;
UINT8 m_hd34010_host_access;
UINT8 m_dsk_pio_access;
@@ -106,6 +108,12 @@ public:
optional_shared_ptr<UINT16> m_gsp_paletteram_lo;
optional_shared_ptr<UINT16> m_gsp_paletteram_hi;
+ required_ioport m_in0;
+ optional_ioport m_sw1;
+ required_ioport m_a80000;
+ optional_ioport_array<8> m_8badc;
+ optional_ioport_array<4> m_12badc;
+
/* machine state */
UINT8 m_irq_state;
UINT8 m_gsp_irq_state;
@@ -525,7 +533,6 @@ class racedriv_board_device_state : public harddriv_state
{
public:
racedriv_board_device_state(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- DECLARE_WRITE_LINE_MEMBER(tx_a);
protected:
virtual machine_config_constructor device_mconfig_additions() const;
diff --git a/src/mame/includes/leland.h b/src/mame/includes/leland.h
index cc0ed2da506..ef8a4d2b585 100644
--- a/src/mame/includes/leland.h
+++ b/src/mame/includes/leland.h
@@ -237,7 +237,6 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
int m_type;
enum {
@@ -247,7 +246,14 @@ protected:
TYPE_WSF
};
- required_device<dac_device> m_dac;
+ required_device<dac_device> m_dac1;
+ required_device<dac_device> m_dac2;
+ required_device<dac_device> m_dac3;
+ required_device<dac_device> m_dac4;
+ optional_device<dac_device> m_dac5;
+ optional_device<dac_device> m_dac6;
+ optional_device<dac_device> m_dac7;
+ optional_device<dac_device> m_dac8;
private:
void command_lo_sync(void *ptr, int param);
@@ -266,9 +272,6 @@ private:
UINT32 m_ext_stop;
UINT8 m_ext_active;
UINT8* m_ext_base;
- INT16 m_dac_sample[8];
- UINT8 m_dac_volume[8];
- emu_timer *m_dac_timer;
required_device<pit8254_device> m_pit0;
optional_device<pit8254_device> m_pit1;
diff --git a/src/mame/includes/lethalj.h b/src/mame/includes/lethalj.h
index ed70bdf3453..390f889ef3c 100644
--- a/src/mame/includes/lethalj.h
+++ b/src/mame/includes/lethalj.h
@@ -6,6 +6,9 @@
**************************************************************************/
+#include "machine/ticket.h"
+
+
class lethalj_state : public driver_device
{
public:
@@ -17,10 +20,24 @@ public:
lethalj_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
m_maincpu(*this, "maincpu"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_ticket(*this, "ticket"),
+ m_paddle(*this, "PADDLE"),
+ m_light0_x(*this, "LIGHT0_X"),
+ m_light0_y(*this, "LIGHT0_Y"),
+ m_light1_x(*this, "LIGHT1_X"),
+ m_light1_y(*this, "LIGHT1_Y")
+ { }
required_device<cpu_device> m_maincpu;
required_device<screen_device> m_screen;
+ required_device<ticket_dispenser_device> m_ticket;
+ optional_ioport m_paddle;
+ optional_ioport m_light0_x;
+ optional_ioport m_light0_y;
+ optional_ioport m_light1_x;
+ optional_ioport m_light1_y;
+
UINT16 m_blitter_data[8];
UINT16 *m_screenram;
UINT8 m_vispage;
diff --git a/src/mame/includes/mainevt.h b/src/mame/includes/mainevt.h
index 245247fc9c1..f68af5e78b8 100644
--- a/src/mame/includes/mainevt.h
+++ b/src/mame/includes/mainevt.h
@@ -22,11 +22,8 @@ public:
m_upd7759(*this, "upd"),
m_k007232(*this, "k007232"),
m_k052109(*this, "k052109"),
- m_k051960(*this, "k051960") { }
-
- /* video-related */
- int m_layer_colorbase[3];
- int m_sprite_colorbase;
+ m_k051960(*this, "k051960"),
+ m_rombank(*this, "rombank") { }
/* misc */
int m_nmi_enable;
@@ -39,6 +36,9 @@ public:
required_device<k007232_device> m_k007232;
required_device<k052109_device> m_k052109;
required_device<k051960_device> m_k051960;
+
+ required_memory_bank m_rombank;
+
DECLARE_WRITE8_MEMBER(dv_nmienable_w);
DECLARE_WRITE8_MEMBER(mainevt_bankswitch_w);
DECLARE_WRITE8_MEMBER(mainevt_coin_w);
@@ -52,8 +52,6 @@ public:
DECLARE_WRITE8_MEMBER(dv_sh_bankswitch_w);
virtual void machine_start();
virtual void machine_reset();
- DECLARE_VIDEO_START(mainevt);
- DECLARE_VIDEO_START(dv);
UINT32 screen_update_mainevt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_dv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(mainevt_interrupt);
diff --git a/src/mame/includes/micro3d.h b/src/mame/includes/micro3d.h
index 7b8151d702f..ed0f05ee67e 100644
--- a/src/mame/includes/micro3d.h
+++ b/src/mame/includes/micro3d.h
@@ -39,6 +39,7 @@ enum dac_registers {
PAN
};
+class micro3d_sound_device;
class micro3d_state : public driver_device
{
@@ -58,6 +59,14 @@ public:
m_vgb(*this, "vgb"),
m_palette(*this, "palette"),
m_duart68681(*this, "duart68681"),
+ m_noise_1(*this, "noise_1"),
+ m_noise_2(*this, "noise_2"),
+ m_vertex(*this, "vertex"),
+ m_sound_sw(*this, "SOUND_SW"),
+ m_volume(*this, "VOLUME"),
+ m_joystick_x(*this, "JOYSTICK_X"),
+ m_joystick_y(*this, "JOYSTICK_Y"),
+ m_throttle(*this, "THROTTLE"),
m_shared_ram(*this, "shared_ram"),
m_mac_sram(*this, "mac_sram"),
m_sprite_vram(*this, "sprite_vram") { }
@@ -69,6 +78,15 @@ public:
required_device<tms34010_device> m_vgb;
required_device<palette_device> m_palette;
required_device<mc68681_device> m_duart68681;
+ required_device<micro3d_sound_device> m_noise_1;
+ required_device<micro3d_sound_device> m_noise_2;
+ required_memory_region m_vertex;
+
+ required_ioport m_sound_sw;
+ required_ioport m_volume;
+ optional_ioport m_joystick_x;
+ optional_ioport m_joystick_y;
+ optional_ioport m_throttle;
required_shared_ptr<UINT16> m_shared_ram;
UINT8 m_m68681_tx0;
diff --git a/src/mame/includes/rockrage.h b/src/mame/includes/rockrage.h
index 3d16d50d50d..c2ed6095460 100644
--- a/src/mame/includes/rockrage.h
+++ b/src/mame/includes/rockrage.h
@@ -37,7 +37,6 @@ public:
required_memory_bank m_rombank;
/* video-related */
- int m_layer_colorbase[2];
int m_vreg;
DECLARE_WRITE8_MEMBER(rockrage_bankswitch_w);
diff --git a/src/mame/includes/rocnrope.h b/src/mame/includes/rocnrope.h
index 9345b69eeef..545862727c3 100644
--- a/src/mame/includes/rocnrope.h
+++ b/src/mame/includes/rocnrope.h
@@ -5,38 +5,40 @@ class rocnrope_state : public driver_device
public:
rocnrope_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_gfxdecode(*this, "gfxdecode"),
+ m_palette(*this, "palette"),
m_spriteram2(*this, "spriteram2"),
m_spriteram(*this, "spriteram"),
m_colorram(*this, "colorram"),
- m_videoram(*this, "videoram"),
- m_maincpu(*this, "maincpu"),
- m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_videoram(*this, "videoram")
+ { }
- /* memory pointers */
+ // devices
+ required_device<cpu_device> m_maincpu;
+ required_device<gfxdecode_device> m_gfxdecode;
+ required_device<palette_device> m_palette;
+
+ // memory pointers
required_shared_ptr<UINT8> m_spriteram2;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_colorram;
required_shared_ptr<UINT8> m_videoram;
- /* video-related */
- tilemap_t *m_bg_tilemap;
-
- UINT8 m_irq_mask;
+ tilemap_t *m_bg_tilemap;
+ UINT8 m_irq_mask;
+
DECLARE_WRITE8_MEMBER(rocnrope_interrupt_vector_w);
DECLARE_WRITE8_MEMBER(irq_mask_w);
DECLARE_WRITE8_MEMBER(rocnrope_videoram_w);
DECLARE_WRITE8_MEMBER(rocnrope_colorram_w);
DECLARE_WRITE8_MEMBER(rocnrope_flipscreen_w);
DECLARE_DRIVER_INIT(rocnrope);
- DECLARE_DRIVER_INIT(rocnropk);
+
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void video_start();
DECLARE_PALETTE_INIT(rocnrope);
UINT32 screen_update_rocnrope(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_irq);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
- required_device<cpu_device> m_maincpu;
- required_device<gfxdecode_device> m_gfxdecode;
- required_device<palette_device> m_palette;
};
diff --git a/src/mame/includes/rollerg.h b/src/mame/includes/rollerg.h
index eb982a3c5a5..88ddca6cc45 100644
--- a/src/mame/includes/rollerg.h
+++ b/src/mame/includes/rollerg.h
@@ -27,10 +27,6 @@ public:
m_k053252(*this, "k053252")
{ }
- /* video-related */
- int m_sprite_colorbase;
- int m_zoom_colorbase;
-
/* misc */
int m_readzoomroms;
@@ -48,7 +44,6 @@ public:
DECLARE_WRITE_LINE_MEMBER(rollerg_irq_ack_w);
virtual void machine_start();
virtual void machine_reset();
- virtual void video_start();
UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
K05324X_CB_MEMBER(sprite_callback);
K051316_CB_MEMBER(zoom_callback);
diff --git a/src/mame/includes/ultraman.h b/src/mame/includes/ultraman.h
index 0e1e9772d60..854f30d606e 100644
--- a/src/mame/includes/ultraman.h
+++ b/src/mame/includes/ultraman.h
@@ -22,9 +22,6 @@ public:
m_k051316_3(*this, "k051316_3"),
m_k051960(*this, "k051960") { }
- /* video-related */
- int m_sprite_colorbase;
- int m_zoom_colorbase[3];
int m_bank0;
int m_bank1;
int m_bank2;
@@ -41,7 +38,6 @@ public:
DECLARE_WRITE16_MEMBER(ultraman_gfxctrl_w);
virtual void machine_start();
virtual void machine_reset();
- virtual void video_start();
UINT32 screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
K051316_CB_MEMBER(zoom_callback_1);
K051316_CB_MEMBER(zoom_callback_2);
diff --git a/src/mame/includes/vicdual.h b/src/mame/includes/vicdual.h
index 4c2fe9801a2..140e27b9486 100644
--- a/src/mame/includes/vicdual.h
+++ b/src/mame/includes/vicdual.h
@@ -24,8 +24,15 @@ public:
m_coinstate_timer(*this, "coinstate"),
m_nsub_coinage_timer(*this, "nsub_coin"),
m_screen(*this, "screen"),
+ m_proms(*this, "proms"),
m_videoram(*this, "videoram"),
- m_characterram(*this, "characterram")
+ m_characterram(*this, "characterram"),
+ m_in0(*this, "IN0"),
+ m_in1(*this, "IN1"),
+ m_in2(*this, "IN2"),
+ m_coinage(*this, "COINAGE"),
+ m_color_bw(*this, "COLOR_BW"),
+ m_fake_lives(*this, "FAKE_LIVES")
{ }
required_device<cpu_device> m_maincpu;
@@ -36,10 +43,18 @@ public:
required_device<timer_device> m_coinstate_timer;
optional_device<timer_device> m_nsub_coinage_timer;
required_device<screen_device> m_screen;
+ optional_memory_region m_proms;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_characterram;
+ required_ioport m_in0;
+ required_ioport m_in1;
+ optional_ioport m_in2;
+ optional_ioport m_coinage;
+ optional_ioport m_color_bw;
+ optional_ioport_array<2> m_fake_lives;
+
UINT8 m_coin_status;
UINT8 m_palette_bank;
UINT8 m_samurai_protection_data;
diff --git a/src/mame/includes/warpwarp.h b/src/mame/includes/warpwarp.h
index d50cf1cef5f..dd485ab1f7d 100644
--- a/src/mame/includes/warpwarp.h
+++ b/src/mame/includes/warpwarp.h
@@ -12,8 +12,15 @@ public:
m_warpwarp_sound(*this, "warpwarp_custom"),
m_geebee_sound(*this, "geebee_custom"),
m_geebee_videoram(*this, "geebee_videoram"),
- m_videoram(*this, "videoram")
- { }
+ m_videoram(*this, "videoram"),
+ m_in0(*this, "IN0"),
+ m_in1(*this, "IN1"),
+ m_in2(*this, "IN2"),
+ m_dsw1(*this, "DSW1"),
+ m_volin1(*this, "VOLIN1"),
+ m_volin2(*this, "VOLIN2"),
+ m_ports(*this, portnames)
+ { }
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
@@ -21,6 +28,14 @@ public:
optional_device<geebee_sound_device> m_geebee_sound;
optional_shared_ptr<UINT8> m_geebee_videoram;
optional_shared_ptr<UINT8> m_videoram;
+ optional_ioport m_in0;
+ optional_ioport m_in1;
+ optional_ioport m_in2;
+ optional_ioport m_dsw1;
+ optional_ioport m_volin1;
+ optional_ioport m_volin2;
+ DECLARE_IOPORT_ARRAY(portnames);
+ optional_ioport_array<4> m_ports;
int m_geebee_bgw;
int m_ball_on;
diff --git a/src/mame/includes/wgp.h b/src/mame/includes/wgp.h
index 6f2416a4326..c306b52ba2d 100644
--- a/src/mame/includes/wgp.h
+++ b/src/mame/includes/wgp.h
@@ -34,7 +34,12 @@ public:
m_tc0140syt(*this, "tc0140syt"),
m_tc0220ioc(*this, "tc0220ioc"),
m_gfxdecode(*this, "gfxdecode"),
- m_palette(*this, "palette") { }
+ m_palette(*this, "palette"),
+ m_z80bank(*this, "z80bank"),
+ m_steer(*this, "STEER"),
+ m_unknown(*this, "UNKNOWN"),
+ m_fake(*this, "FAKE")
+ { }
/* memory pointers */
required_shared_ptr<UINT16> m_spritemap;
@@ -66,6 +71,10 @@ public:
required_device<tc0220ioc_device> m_tc0220ioc;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_memory_bank m_z80bank;
+ optional_ioport m_steer;
+ optional_ioport m_unknown;
+ optional_ioport m_fake;
DECLARE_WRITE16_MEMBER(cpua_ctrl_w);
DECLARE_READ16_MEMBER(lan_status_r);
diff --git a/src/mame/includes/xmen.h b/src/mame/includes/xmen.h
index f0ad2b713df..2f87182fbea 100644
--- a/src/mame/includes/xmen.h
+++ b/src/mame/includes/xmen.h
@@ -21,7 +21,8 @@ public:
m_k052109(*this, "k052109"),
m_k053246(*this, "k053246"),
m_k053251(*this, "k053251"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_z80bank(*this, "z80bank") { }
/* video-related */
int m_layer_colorbase[3];
@@ -38,7 +39,6 @@ public:
UINT16 * m_k053247_ram;
/* misc */
- UINT8 m_sound_curbank;
UINT8 m_vblank_irq_mask;
/* devices */
@@ -49,6 +49,8 @@ public:
required_device<k053247_device> m_k053246;
required_device<k053251_device> m_k053251;
required_device<screen_device> m_screen;
+
+ required_memory_bank m_z80bank;
DECLARE_WRITE16_MEMBER(eeprom_w);
DECLARE_READ16_MEMBER(sound_status_r);
DECLARE_WRITE16_MEMBER(sound_cmd_w);
@@ -64,7 +66,6 @@ public:
UINT32 screen_update_xmen6p_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_xmen6p(screen_device &screen, bool state);
TIMER_DEVICE_CALLBACK_MEMBER(xmen_scanline);
- void sound_reset_bank();
K052109_CB_MEMBER(tile_callback);
K053246_CB_MEMBER(sprite_callback);
};
diff --git a/src/mame/layout/monzagp.lay b/src/mame/layout/monzagp.lay
new file mode 100644
index 00000000000..12d9614ce47
--- /dev/null
+++ b/src/mame/layout/monzagp.lay
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+ <element name="digit" defstate="0">
+ <led7seg>
+ <color red="1.0" green="0.0" blue="0.0" />
+ </led7seg>
+ </element>
+
+ <view name="Default Layout">
+ <screen index="0">
+ <bounds x="0" y="160" width="300" height="400" />
+ </screen>
+
+ <!-- best scores 1 -->
+ <bezel name="digit27" element="digit">
+ <bounds x="10" y="10" width="15" height="22" />
+ </bezel>
+ <bezel name="digit11" element="digit">
+ <bounds x="30" y="10" width="15" height="22" />
+ </bezel>
+ <bezel name="digit19" element="digit">
+ <bounds x="50" y="10" width="15" height="22" />
+ </bezel>
+ <bezel name="digit3" element="digit">
+ <bounds x="70" y="10" width="15" height="22" />
+ </bezel>
+
+ <!-- best scores 2 -->
+ <bezel name="digit24" element="digit">
+ <bounds x="10" y="40" width="15" height="22" />
+ </bezel>
+ <bezel name="digit8" element="digit">
+ <bounds x="30" y="40" width="15" height="22" />
+ </bezel>
+ <bezel name="digit16" element="digit">
+ <bounds x="50" y="40" width="15" height="22" />
+ </bezel>
+ <bezel name="digit0" element="digit">
+ <bounds x="70" y="40" width="15" height="22" />
+ </bezel>
+
+ <!-- best scores 3 -->
+ <bezel name="digit28" element="digit">
+ <bounds x="10" y="70" width="15" height="22" />
+ </bezel>
+ <bezel name="digit12" element="digit">
+ <bounds x="30" y="70" width="15" height="22" />
+ </bezel>
+ <bezel name="digit20" element="digit">
+ <bounds x="50" y="70" width="15" height="22" />
+ </bezel>
+ <bezel name="digit4" element="digit">
+ <bounds x="70" y="70" width="15" height="22" />
+ </bezel>
+
+ <!-- best scores 4 -->
+ <bezel name="digit26" element="digit">
+ <bounds x="10" y="100" width="15" height="22" />
+ </bezel>
+ <bezel name="digit10" element="digit">
+ <bounds x="30" y="100" width="15" height="22" />
+ </bezel>
+ <bezel name="digit18" element="digit">
+ <bounds x="50" y="100" width="15" height="22" />
+ </bezel>
+ <bezel name="digit2" element="digit">
+ <bounds x="70" y="100" width="15" height="22" />
+ </bezel>
+
+ <!-- best scores 5 -->
+ <bezel name="digit30" element="digit">
+ <bounds x="10" y="130" width="15" height="22" />
+ </bezel>
+ <bezel name="digit14" element="digit">
+ <bounds x="30" y="130" width="15" height="22" />
+ </bezel>
+ <bezel name="digit22" element="digit">
+ <bounds x="50" y="130" width="15" height="22" />
+ </bezel>
+ <bezel name="digit6" element="digit">
+ <bounds x="70" y="130" width="15" height="22" />
+ </bezel>
+
+ <!-- time racing -->
+ <bezel name="digit21" element="digit">
+ <bounds x="140" y="130" width="15" height="22" />
+ </bezel>
+ <bezel name="digit5" element="digit">
+ <bounds x="160" y="130" width="15" height="22" />
+ </bezel>
+
+ <!-- your score -->
+ <bezel name="digit25" element="digit">
+ <bounds x="220" y="10" width="15" height="22" />
+ </bezel>
+ <bezel name="digit9" element="digit">
+ <bounds x="240" y="10" width="15" height="22" />
+ </bezel>
+ <bezel name="digit17" element="digit">
+ <bounds x="260" y="10" width="15" height="22" />
+ </bezel>
+ <bezel name="digit1" element="digit">
+ <bounds x="280" y="10" width="15" height="22" />
+ </bezel>
+ </view>
+</mamelayout>
diff --git a/src/mame/machine/ajax.c b/src/mame/machine/ajax.c
index f684fd5ca28..15d4ca3415b 100644
--- a/src/mame/machine/ajax.c
+++ b/src/mame/machine/ajax.c
@@ -214,9 +214,3 @@ void ajax_state::machine_reset()
m_priority = 0;
m_firq_enable = 0;
}
-
-INTERRUPT_GEN_MEMBER(ajax_state::ajax_interrupt)
-{
- if (m_k051960->k051960_is_irq_enabled())
- device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
-}
diff --git a/src/mame/machine/gaelco2.c b/src/mame/machine/gaelco2.c
index 306c3e1ed07..19dfd833223 100644
--- a/src/mame/machine/gaelco2.c
+++ b/src/mame/machine/gaelco2.c
@@ -155,7 +155,7 @@ WRITE16_MEMBER(gaelco2_state::gaelco2_coin2_w)
coin_counter_w(machine(), offset & 0x01, data & 0x01);
}
-WRITE16_MEMBER(gaelco2_state::wrally2_coin_w)
+WRITE16_MEMBER(wrally2_state::wrally2_coin_w)
{
/* coin counters */
coin_counter_w(machine(), (offset >> 3) & 0x01, data & 0x01);
@@ -178,17 +178,17 @@ WRITE16_MEMBER(gaelco2_state::touchgo_coin_w)
***************************************************************************/
-DRIVER_INIT_MEMBER(gaelco2_state,bang)
+DRIVER_INIT_MEMBER(bang_state,bang)
{
m_clr_gun_int = 0;
}
-WRITE16_MEMBER(gaelco2_state::bang_clr_gun_int_w)
+WRITE16_MEMBER(bang_state::bang_clr_gun_int_w)
{
m_clr_gun_int = 1;
}
-TIMER_DEVICE_CALLBACK_MEMBER(gaelco2_state::bang_irq)
+TIMER_DEVICE_CALLBACK_MEMBER(bang_state::bang_irq)
{
int scanline = param;
@@ -218,14 +218,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(gaelco2_state::bang_irq)
***************************************************************************/
-CUSTOM_INPUT_MEMBER(gaelco2_state::wrally2_analog_bit_r)
+CUSTOM_INPUT_MEMBER(wrally2_state::wrally2_analog_bit_r)
{
int which = (FPTR)param;
return (m_analog_ports[which] >> 7) & 0x01;
}
-WRITE16_MEMBER(gaelco2_state::wrally2_adc_clk)
+WRITE16_MEMBER(wrally2_state::wrally2_adc_clk)
{
/* a zero/one combo is written here to clock the next analog port bit */
if (ACCESSING_BITS_0_7)
@@ -241,15 +241,15 @@ WRITE16_MEMBER(gaelco2_state::wrally2_adc_clk)
}
-WRITE16_MEMBER(gaelco2_state::wrally2_adc_cs)
+WRITE16_MEMBER(wrally2_state::wrally2_adc_cs)
{
/* a zero is written here to read the analog ports, and a one is written when finished */
if (ACCESSING_BITS_0_7)
{
if (!(data & 0xff))
{
- m_analog_ports[0] = ioport("ANALOG0")->read_safe(0);
- m_analog_ports[1] = ioport("ANALOG1")->read_safe(0);
+ m_analog_ports[0] = m_analog0->read();
+ m_analog_ports[1] = m_analog1->read();
}
}
else
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index 24a6ff0da7c..e802f2bfe09 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -200,7 +200,7 @@ WRITE16_MEMBER( harddriv_state::hd68k_msp_io_w )
READ16_MEMBER( harddriv_state::hd68k_a80000_r )
{
- return ioport("a80000")->read_safe(0xffff);
+ return m_a80000->read();
}
READ16_MEMBER( harddriv_state::hd68k_port0_r )
@@ -222,7 +222,7 @@ READ16_MEMBER( harddriv_state::hd68k_port0_r )
*/
screen_device &scr = m_gsp->screen();
- int temp = (ioport("SW1")->read_safe(0xff) << 8) | ioport("IN0")->read_safe(0xff);
+ int temp = ((m_sw1 ? m_sw1->read() : 0xff) << 8) | m_in0->read();
if (get_hblank(scr)) temp ^= 0x0002;
temp ^= 0x0018; /* both EOCs always high for now */
return temp;
@@ -231,7 +231,7 @@ READ16_MEMBER( harddriv_state::hd68k_port0_r )
READ16_MEMBER( harddriv_state::hdc68k_port1_r )
{
- UINT16 result = ioport("a80000")->read_safe(0xffff);
+ UINT16 result = m_a80000->read();
UINT16 diff = result ^ m_hdc68k_last_port1;
/* if a new shifter position is selected, use it */
@@ -259,7 +259,7 @@ READ16_MEMBER( harddriv_state::hdc68k_port1_r )
READ16_MEMBER( harddriv_state::hda68k_port1_r )
{
- UINT16 result = ioport("a80000")->read_safe(0xffff);
+ UINT16 result = m_a80000->read();
/* merge in the wheel edge latch bit */
if (m_hdc68k_wheel_edge)
@@ -272,7 +272,7 @@ READ16_MEMBER( harddriv_state::hda68k_port1_r )
READ16_MEMBER( harddriv_state::hdc68k_wheel_r )
{
/* grab the new wheel value and upconvert to 12 bits */
- UINT16 new_wheel = ioport("12BADC0")->read_safe(0xffff) << 4;
+ UINT16 new_wheel = (m_12badc[0] ? m_12badc[0]->read() : 0xffff) << 4;
/* hack to display the wheel position */
if (space.machine().input().code_pressed(KEYCODE_LSHIFT))
@@ -317,23 +317,20 @@ READ16_MEMBER( harddriv_state::hd68k_sound_reset_r )
WRITE16_MEMBER( harddriv_state::hd68k_adc_control_w )
{
- static const char *const adc8names[] = { "8BADC0", "8BADC1", "8BADC2", "8BADC3", "8BADC4", "8BADC5", "8BADC6", "8BADC7" };
- static const char *const adc12names[] = { "12BADC0", "12BADC1", "12BADC2", "12BADC3" };
-
COMBINE_DATA(&m_adc_control);
/* handle a write to the 8-bit ADC address select */
if (m_adc_control & 0x08)
{
m_adc8_select = m_adc_control & 0x07;
- m_adc8_data = ioport(adc8names[m_adc8_select])->read_safe(0xffff);
+ m_adc8_data = m_8badc[m_adc8_select] ? m_8badc[m_adc8_select]->read() : 0xffff;
}
/* handle a write to the 12-bit ADC address select */
if (m_adc_control & 0x40)
{
m_adc12_select = (m_adc_control >> 4) & 0x03;
- m_adc12_data = ioport(adc12names[m_adc12_select])->read_safe(0xffff) << 4;
+ m_adc12_data = (m_12badc[m_adc12_select] ? m_12badc[m_adc12_select]->read() : 0xffff) << 4;
}
/* bit 7 selects which byte of the 12 bit data to read */
diff --git a/src/mame/machine/jvs13551.c b/src/mame/machine/jvs13551.c
index 40b669e235e..fa0350e60a0 100644
--- a/src/mame/machine/jvs13551.c
+++ b/src/mame/machine/jvs13551.c
@@ -79,6 +79,10 @@ UINT8 sega_837_13551::comm_method_version()
void sega_837_13551::device_start()
{
jvs_device::device_start();
+ for (int i = 0; i < ARRAY_LENGTH(port_tag); i++)
+ {
+ port[i] = ioport(port_tag[i]);
+ }
save_item(NAME(coin_counter));
}
@@ -140,9 +144,9 @@ bool sega_837_13551::switches(UINT8 *&buf, UINT8 count_players, UINT8 bytes_per_
if(count_players > 2 || bytes_per_switch > 2)
return false;
- *buf++ = ioport(port_tag[0])->read_safe(0);
+ *buf++ = port[0] ? port[0]->read() : 0;
for(int i=0; i<count_players; i++) {
- UINT32 val = ioport(port_tag[1+i])->read_safe(0);
+ UINT32 val = port[1+i] ? port[1+i]->read() : 0;
for(int j=0; j<bytes_per_switch; j++)
*buf++ = val >> ((1-j) << 3);
}
@@ -155,7 +159,7 @@ bool sega_837_13551::analogs(UINT8 *&buf, UINT8 count)
if(count > 8)
return false;
for(int i=0; i<count; i++) {
- UINT16 val = ioport(port_tag[3+i])->read_safe(0x8000);
+ UINT16 val = port[3+i] ? port[3+i]->read() : 0x8000;
*buf++ = val >> 8;
*buf++ = val;
}
@@ -170,7 +174,10 @@ bool sega_837_13551::swoutputs(UINT8 count, const UINT8 *vals)
return false;
jvs_outputs = vals[0] & 0xfc;
logerror("837-13551: output %02x\n", jvs_outputs);
- ioport(port_tag[11])->write_safe(jvs_outputs, 0xfc);
+ if (port[11])
+ {
+ port[11]->write(jvs_outputs, 0xfc);
+ }
return true;
}
@@ -178,7 +185,7 @@ bool sega_837_13551::swoutputs(UINT8 id, UINT8 val)
{
if(id > 6)
return false;
- handle_output(port_tag[11], id, val);
+ handle_output(port[11], id, val);
logerror("837-13551: output %d, %d\n", id, val);
return true;
}
diff --git a/src/mame/machine/jvs13551.h b/src/mame/machine/jvs13551.h
index 98f095e3c1c..6385178b318 100644
--- a/src/mame/machine/jvs13551.h
+++ b/src/mame/machine/jvs13551.h
@@ -56,6 +56,7 @@ protected:
private:
const char *port_tag[12];
+ ioport_port *port[12];
UINT16 coin_counter[2];
};
diff --git a/src/mame/machine/micro3d.c b/src/mame/machine/micro3d.c
index 9d9eb6c7f99..4c207dfe28f 100644
--- a/src/mame/machine/micro3d.c
+++ b/src/mame/machine/micro3d.c
@@ -299,7 +299,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
case 0x08:
{
int i;
- const UINT16 *rom = (UINT16*)memregion("vertex")->base();
+ const UINT16 *rom = (UINT16*)m_vertex->base();
for (i = 0; i <= cnt; ++i)
{
@@ -338,7 +338,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
case 0x0c:
{
int i;
- const UINT16 *rom = (UINT16*)memregion("vertex")->base();
+ const UINT16 *rom = (UINT16*)m_vertex->base();
for (i = 0; i <= cnt; ++i)
{
@@ -371,7 +371,7 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
case 0x0f:
{
int i;
- const UINT16 *rom = (UINT16*)memregion("vertex")->base();
+ const UINT16 *rom = (UINT16*)m_vertex->base();
for (i = 0; i <= cnt; ++i, vtx_addr += 4)
{
@@ -467,16 +467,16 @@ WRITE32_MEMBER(micro3d_state::micro3d_mac2_w)
READ16_MEMBER(micro3d_state::micro3d_encoder_h_r)
{
- UINT16 x_encoder = ioport("JOYSTICK_X")->read_safe(0);
- UINT16 y_encoder = ioport("JOYSTICK_Y")->read_safe(0);
+ UINT16 x_encoder = m_joystick_x ? m_joystick_x->read() : 0;
+ UINT16 y_encoder = m_joystick_y ? m_joystick_y->read() : 0;
return (y_encoder & 0xf00) | ((x_encoder & 0xf00) >> 8);
}
READ16_MEMBER(micro3d_state::micro3d_encoder_l_r)
{
- UINT16 x_encoder = ioport("JOYSTICK_X")->read_safe(0);
- UINT16 y_encoder = ioport("JOYSTICK_Y")->read_safe(0);
+ UINT16 x_encoder = m_joystick_x ? m_joystick_x->read() : 0;
+ UINT16 y_encoder = m_joystick_y ? m_joystick_y->read() : 0;
return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff);
}
@@ -485,9 +485,9 @@ TIMER_CALLBACK_MEMBER(micro3d_state::adc_done_callback)
{
switch (param)
{
- case 0: m_adc_val = ioport("THROTTLE")->read_safe(0);
+ case 0: m_adc_val = m_throttle ? m_throttle->read() : 0;
break;
- case 1: m_adc_val = (UINT8)((255.0/100.0) * ioport("VOLUME")->read() + 0.5);
+ case 1: m_adc_val = (UINT8)((255.0/100.0) * m_volume->read() + 0.5);
break;
case 2: break;
case 3: break;
diff --git a/src/mame/machine/mie.c b/src/mame/machine/mie.c
index b82c3fe8f8f..108192fd021 100644
--- a/src/mame/machine/mie.c
+++ b/src/mame/machine/mie.c
@@ -108,6 +108,11 @@ void mie_device::device_start()
timer = timer_alloc(0);
jvs = machine().device<mie_jvs_device>(jvs_name);
+ for (int i = 0; i < ARRAY_LENGTH(gpio_name); i++)
+ {
+ gpio_port[i] = gpio_name[i] ? ioport(gpio_name[i]) : NULL;
+ }
+
save_item(NAME(gpiodir));
save_item(NAME(gpio_val));
save_item(NAME(irq_enable));
@@ -215,7 +220,7 @@ READ8_MEMBER(mie_device::read_78xx)
READ8_MEMBER(mie_device::gpio_r)
{
if(gpiodir & (1 << offset))
- return gpio_name[offset] ? ioport(gpio_name[offset])->read() : 0xff;
+ return gpio_port[offset] ? gpio_port[offset]->read() : 0xff;
else
return gpio_val[offset];
}
@@ -223,8 +228,8 @@ READ8_MEMBER(mie_device::gpio_r)
WRITE8_MEMBER(mie_device::gpio_w)
{
gpio_val[offset] = data;
- if(!(gpiodir & (1 << offset)) && gpio_name[offset])
- ioport(gpio_name[offset])->write(data, 0xff);
+ if(!(gpiodir & (1 << offset)) && gpio_port[offset])
+ gpio_port[offset]->write(data, 0xff);
}
READ8_MEMBER(mie_device::gpiodir_r)
diff --git a/src/mame/machine/mie.h b/src/mame/machine/mie.h
index a011d463592..d76f17ee4f9 100644
--- a/src/mame/machine/mie.h
+++ b/src/mame/machine/mie.h
@@ -103,6 +103,7 @@ private:
z80_device *cpu;
emu_timer *timer;
mie_jvs_device *jvs;
+ ioport_port *gpio_port[8];
UINT32 tbuf[TBUF_SIZE];
UINT32 control, lreg, jvs_rpos;
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index 3d93b68d9c6..a93065780f5 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -1003,7 +1003,7 @@ void n64_periphs::vi_recalculate_resolution()
int height = ((vi_yscale & 0x00000fff) * (y_end - y_start)) / 0x400;
rectangle visarea = m_screen->visible_area();
- attoseconds_t period = m_screen->frame_period().attoseconds;
+ attoseconds_t period = m_screen->frame_period().attoseconds();
if (width == 0 || height == 0)
{
diff --git a/src/mame/machine/ns10crypt.c b/src/mame/machine/ns10crypt.c
index 91779b7260f..0650dfceddd 100644
--- a/src/mame/machine/ns10crypt.c
+++ b/src/mame/machine/ns10crypt.c
@@ -16,56 +16,65 @@ to what is described here needs further investigation.
In type-2 PCBs, the encrypted data is always contained in the first ROM of the
game (8E), and it's always stored spanning an integer number of NAND blocks
(the K9F2808U0B is organized in blocks of 16 KiB, each containing 32 pages of
-0x200 bytes). The first part of the encrypted data is stored at about the end
-of the ROM, and apparently all the blocks in that area are processed in
-reverse order (first the one nearest the end, then the second nearest, etc);
-the second part goes inmediately after it from a logic perspective, but it's
-physically located at the area starting at 0x28000 in the ROM. Games, after
+0x200 bytes). Usually the first part of the encrypted data is stored at about the end
+of the ROM, with all the blocks in that area processed in reverse order (first the
+one nearest the end, then the second nearest, etc); the second part goes immediately
+after it from a logic perspective, but it's, usually, physically located at the area
+starting at 0x28000 in the ROM. However, in at least a couple of games, there are
+out-of-order blocks (details below). Games, after
some bootup code has been executed, will copy the encrypted content from
the NANDs to RAM, moment at which the decryption is triggered. Physical locations
of the encrypted programs in the first NAND, together with the RAM region where
-they are loaded, are summarized in the following table:
-
-game head region tail region RAM address
--------- ---------------- -------------- -----------
-chocovdr [fdc000,1000000) [28000,1dc000) 80010000
-gamshara [fdc000,1000000) [28000,144000) 80010000
-knpuzzle [fc8000,fcc000) [28000,40c000) 80030000
-konotako [fdc000,1000000) [28000,b4000) 80010000
-nflclsfb [fdc000,1000000) [28000,204000) 80010000
-startrgn [fdc000,1000000) [28000,b4000) 80010000
-
-knpuzzle constitutes an interesting case, as it seem to be playing some tricks
-in order to obfuscate the location of the main program; first, both regions
-are padded by encrypted blank regions (at [fc4000,fc8000) & [40c000,458000)),
-maybe in an attempt to hinder the recognition of the extremes of the
-encrypted data; second, some kind of protection trap seem to simulate a loading
-of the encrypted region as if it were using the same head region and RAM address
-than most sets ([fdc000,1000000) & 80010000), while those aren't the correct
-values for it.
+they are loaded, are summarized in the following table ( ' indicating processing
+in reverse order of the constituting blocks) :
+
+game data regions RAM address
+-------- ---------------------------------- -----------
+chocovdr [fdc000,1000000)' + [28000,1dc000) 80010000
+gamshara [fdc000,1000000)' + [28000,144000) 80010000
+gjspace [fd4000,ff8000)' + [28000,80000) 80010000
+ + [fd0000,fd4000) + [80000,200000)
+knpuzzle [fc8000,fcc000)' + [28000,40c000) 80030000
+ + [fc4000,fc8000) + [40c000,458000)
+konotako [fdc000,1000000)' + [28000,b4000) 80010000
+mrdrilrg [fd4000,fd8000)' + [28000,3dc000) 80030000
+nflclsfb [fdc000,1000000)' + [28000,204000) 80010000
+panikuru [fdc000,fe0000)' + [28000,ac000) 80030000
+startrgn [fdc000,1000000)' + [28000,b4000) 80010000
+
+Both knpuzzle & gjspace present a NAND block which is out of order with respect
+to the normal layout; besides, that block is physically located immediately before
+the end-of-ROM region, in what maybe is an attempt to hinder the
+recognition/reconstruction of the encrypted data.
Most games do a single decryption run, so the process is only initialized once;
-however, at least one game (gamshara) does write to the triggering register
-more than once, effectively resetting the internal state of the decrypter
-several times. (gamshara do it every 5 NAND blocks; the lowest nibble written to
-the register seem to control the initial value of the state; see details in the
-implementation).
+however, at least three of them (gamshara, mrdrilrg & panikuru) do reinitialize the
+internal state of the decrypted several times. As of 2015-08-19, only gamshara shows signs
+of doing it by writing to the triggering register; how the others two are triggering the
+reinitializations is still unclear. gamshara does a reinitialization every 5 NAND blocks
+(16 times in total); mrdrilrg does the second one after 0x38000 bytes and then subsequent
+ones every 32 blocks (8 times in total); panikuru does one every 2 blocks up to a total
+of 16 times.
The calculation of the XOR masks seem to operate this way: most bits are
calculated by using linear equations over GF(2) taking as input data the bits from
previously processed words; however, one nonlinear calculation is performed
-per word processed, and that calculation can affect several bits from the
-mask (but, apparently, the same nonlinear terms affect all of them),
-though in most cases only one bit is involved. Till now, most of the linear
-relations seem to depend only on the previous 3 words, but there are some
-bits from those showing nonlinear behaviour which seem to use farther words;
-this is still being investigated, and the implementation is probable to
-change to reflect new findings.
+per word processed, and that calculation typically affect just one bit (the only
+known exception is mrdrilrg, where the same nonlinear terms are
+affecting two of them). Till now, all the formulae seem to depend only on the
+previous 3 words, and the first mask after a (re-)initialization is always zero, so
+chances are the mask bits are calculated one word in advance, having access to the
+current encrypted and decrypted words plus two further words in each sequence, maybe stored
+in 32 bits registers. All the nonlinear terms reverse-engineered till now are of the form
+A x B, where A and B are linear formulae; thus, as everything else in the schema involves
+only linear relations, those nonlinear terms are probably caused by an Y-combinator taking
+the resuls of two such linear relations as input, and deciding between both branches based
+on another linear formula.
The bits affected by the nonlinear calculations are given below:
chocovdr -> #10
gamshara -> #2
-gjspace -> a subset of {#3, #4, #5, #10, #11}, maybe all of them
+gjspace -> none
gunbalina -> #11
knpuzzle -> #1
konotako -> #15
@@ -84,14 +93,14 @@ equivalent datasets, nothing else.
TO-DO:
-* Research the nonlinear calculations in most of the games.
-* Determine how many previous words the hardware is really using, and change
-the implementation accordingly.
+* If further dumps support the theory of the calculations just depending on 3 previous words,
+change the implementation accordingly to reflect that.
+* Research how type-1 encryption is related to this.
Observing the linear equations, there is a keen difference between bits using
just a bunch of previous bits, and others using much more bits from more words;
-simplyfing the latter ones could be handy, and probably closer to what the
-hardware is doing. Two possible simplyfications could be:
+simplifying the latter ones could be handy, and probably closer to what the
+hardware is doing. Two possible simplifications could be:
A) The linear relations are creating lots of identities involving the bits
from the sequence; they could be exploited to simplify the equations (but
only when the implementation be stable, to avoid duplicating work).
@@ -106,6 +115,7 @@ really exist.
const device_type CHOCOVDR_DECRYPTER = &device_creator<chocovdr_decrypter_device>;
const device_type GAMSHARA_DECRYPTER = &device_creator<gamshara_decrypter_device>;
+const device_type GJSPACE_DECRYPTER = &device_creator<gjspace_decrypter_device>;
const device_type KNPUZZLE_DECRYPTER = &device_creator<knpuzzle_decrypter_device>;
const device_type KONOTAKO_DECRYPTER = &device_creator<konotako_decrypter_device>;
const device_type NFLCLSFB_DECRYPTER = &device_creator<nflclsfb_decrypter_device>;
@@ -201,6 +211,18 @@ int gf2_reducer::gf2_reduce(UINT64 num)const
// game-specific logic
+// static UINT16 mrdrilrg_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer& reducer)
+// {
+ // UINT64 previous_masks = previous_cipherwords ^ previous_plainwords;
+ // return (reducer.gf2_reduce(0x00000a00a305c826ull & previous_masks) & reducer.gf2_reduce(0x0000011800020000ull & previous_masks)) * 0x0011;
+// }
+
+// static UINT16 panikuru_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer& reducer)
+// {
+ // return ((reducer.gf2_reduce(0x0000000088300281ull & previous_cipherwords) ^ reducer.gf2_reduce(0x0000000004600281ull & previous_plainwords))
+ // & (reducer.gf2_reduce(0x0000a13140090000ull & previous_cipherwords) ^ reducer.gf2_reduce(0x0000806240090000ull & previous_plainwords))) << 2;
+// }
+
static UINT16 chocovdr_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer& reducer)
{
UINT64 previous_masks = previous_cipherwords ^ previous_plainwords;
@@ -245,6 +267,27 @@ static const ns10_decrypter_device::ns10_crypto_logic gamshara_crypto_logic = {
gamshara_nonlinear_calc
};
+static UINT16 gjspace_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer&)
+{
+ return 0;
+}
+
+static const ns10_decrypter_device::ns10_crypto_logic gjspace_crypto_logic = {
+ {
+ 0x0000000000000240ull, 0x0000d617eb0f1ab1ull, 0x00000000451111c0ull, 0x00000000013b1f44ull,
+ 0x0000aab0b356abceull, 0x00007ca76b89602aull, 0x0000000000001800ull, 0x00000000031d1303ull,
+ 0x0000000000000801ull, 0x0000000030111160ull, 0x0000000001ab3978ull, 0x00000000c131b160ull,
+ 0x0000000000001110ull, 0x0000000000008002ull, 0x00000000e1113540ull, 0x0000d617fdce8bfcull,
+ }, {
+ 0x0000000000008240ull, 0x000000002f301ab1ull, 0x00000000050011c0ull, 0x00000000412817c4ull,
+ 0x00000004c338abc6ull, 0x000000046108602aull, 0x0000000000005800ull, 0x00000000c3081347ull,
+ 0x0000000000000801ull, 0x0000000061001160ull, 0x0000000061183978ull, 0x00000000e520b142ull,
+ 0x0000000000001101ull, 0x000000000000a002ull, 0x0000000029001740ull, 0x00000000a4309bfcull,
+ },
+ 0x2e7f,
+ gjspace_nonlinear_calc
+};
+
static UINT16 knpuzzle_nonlinear_calc(UINT64 previous_cipherwords, UINT64 previous_plainwords, const gf2_reducer& reducer)
{
UINT64 previous_masks = previous_cipherwords ^ previous_plainwords;
@@ -346,6 +389,11 @@ gamshara_decrypter_device::gamshara_decrypter_device(const machine_config &mconf
{
}
+gjspace_decrypter_device::gjspace_decrypter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : ns10_decrypter_device(GJSPACE_DECRYPTER, gjspace_crypto_logic, mconfig, tag, owner, clock)
+{
+}
+
knpuzzle_decrypter_device::knpuzzle_decrypter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ns10_decrypter_device(KNPUZZLE_DECRYPTER, knpuzzle_crypto_logic, mconfig, tag, owner, clock)
{
diff --git a/src/mame/machine/ns10crypt.h b/src/mame/machine/ns10crypt.h
index 4aa7ad47266..52a4d3da065 100644
--- a/src/mame/machine/ns10crypt.h
+++ b/src/mame/machine/ns10crypt.h
@@ -66,6 +66,12 @@ public:
gamshara_decrypter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};
+class gjspace_decrypter_device : public ns10_decrypter_device
+{
+public:
+ gjspace_decrypter_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+};
+
class knpuzzle_decrypter_device : public ns10_decrypter_device
{
public:
@@ -93,6 +99,7 @@ public:
extern const device_type CHOCOVDR_DECRYPTER;
extern const device_type GAMSHARA_DECRYPTER;
+extern const device_type GJSPACE_DECRYPTER;
extern const device_type KNPUZZLE_DECRYPTER;
extern const device_type KONOTAKO_DECRYPTER;
extern const device_type NFLCLSFB_DECRYPTER;
diff --git a/src/mame/machine/pgmcrypt.c b/src/mame/machine/pgmcrypt.c
index 956edaaa66f..3d7ad018f9f 100644
--- a/src/mame/machine/pgmcrypt.c
+++ b/src/mame/machine/pgmcrypt.c
@@ -1525,3 +1525,8 @@ void slqz3_decrypt(running_machine &machine)
src[i] = x;
}
}
+
+void fruitpar_decrypt(running_machine &machine)
+{
+// TODO
+}
diff --git a/src/mame/machine/pgmcrypt.h b/src/mame/machine/pgmcrypt.h
index 2eb78e99d20..a2351b5309c 100644
--- a/src/mame/machine/pgmcrypt.h
+++ b/src/mame/machine/pgmcrypt.h
@@ -35,3 +35,4 @@ void lhzb4_decrypt(running_machine &machine);
void fearless_decrypt(running_machine &machine);
void pgm_decrypt_pgm3in1(running_machine &machine);
void slqz3_decrypt(running_machine &machine);
+void fruitpar_decrypt(running_machine &machine);
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 90914f1ac4e..80ed9e1909b 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -1064,7 +1064,7 @@ void snes_state::snes_init_ram()
SNES_CPU_REG(WRIO) = 0xff;
// init frame counter so first line is 0
- if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds) >= 59)
+ if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds()) >= 59)
m_ppu->m_beam.current_vert = SNES_VTOTAL_NTSC;
else
m_ppu->m_beam.current_vert = SNES_VTOTAL_PAL;
@@ -1137,7 +1137,7 @@ void snes_state::machine_reset()
}
/* Set STAT78 to NTSC or PAL */
- if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds) >= 59.0)
+ if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds()) >= 59.0)
m_ppu->m_stat78 = SNES_NTSC;
else /* if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds) == 50.0f) */
m_ppu->m_stat78 = SNES_PAL;
diff --git a/src/mame/mess.lst b/src/mame/mess.lst
index 3b5d1bb0b22..0b132250583 100644
--- a/src/mame/mess.lst
+++ b/src/mame/mess.lst
@@ -610,6 +610,7 @@ cbm4032b
pet8032
cbm8032
cbm8032_de
+cbm8032_fr
cbm8032_se
superpet
mmf9000
@@ -750,6 +751,7 @@ ssam88s
// Non-PC msdos
pcd // Siemens PC-D
+pcx // Siemens PC-X
slicer // 1983 Slicer Computers
olypeopl // Olympia People PC
@@ -2233,6 +2235,7 @@ mbdtower // Milton Bradley
// hh_tms1k tispeak.c
snspell
+snspellp
snspella
snspellb
snspelluk
@@ -2725,4 +2728,5 @@ bitgrpha
bitgrphb
tvgame
aussieby
+hp_ipc
diff --git a/src/mame/video/aliens.c b/src/mame/video/aliens.c
index e169a422406..39489d27faa 100644
--- a/src/mame/video/aliens.c
+++ b/src/mame/video/aliens.c
@@ -12,7 +12,7 @@
K052109_CB_MEMBER(aliens_state::tile_callback)
{
*code |= ((*color & 0x3f) << 8) | (bank << 14);
- *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+ *color = layer * 4 + ((*color & 0xc0) >> 6);
}
@@ -24,43 +24,29 @@ K052109_CB_MEMBER(aliens_state::tile_callback)
K051960_CB_MEMBER(aliens_state::sprite_callback)
{
+ enum { sprite_colorbase = 256 / 16 };
+
/* The PROM allows for mixed priorities, where sprites would have */
/* priority over text but not on one or both of the other two planes. */
switch (*color & 0x70)
{
case 0x10: *priority = 0x00; break; /* over ABF */
- case 0x00: *priority = 0xf0 ; break; /* over AB, not F */
- case 0x40: *priority = 0xf0|0xcc ; break; /* over A, not BF */
+ case 0x00: *priority = GFX_PMASK_4 ; break; /* over AB, not F */
+ case 0x40: *priority = GFX_PMASK_4|GFX_PMASK_2 ; break; /* over A, not BF */
case 0x20:
- case 0x60: *priority = 0xf0|0xcc|0xaa; break; /* over -, not ABF */
- case 0x50: *priority = 0xcc ; break; /* over AF, not B */
+ case 0x60: *priority = GFX_PMASK_4|GFX_PMASK_2|GFX_PMASK_1; break; /* over -, not ABF */
+ case 0x50: *priority = GFX_PMASK_2 ; break; /* over AF, not B */
case 0x30:
- case 0x70: *priority = 0xcc|0xaa; break; /* over F, not AB */
+ case 0x70: *priority = GFX_PMASK_2|GFX_PMASK_1; break; /* over F, not AB */
}
*code |= (*color & 0x80) << 6;
- *color = m_sprite_colorbase + (*color & 0x0f);
+ *color = sprite_colorbase + (*color & 0x0f);
*shadow = 0; /* shadows are not used by this game */
}
/***************************************************************************
- Start the video hardware emulation.
-
-***************************************************************************/
-
-void aliens_state::video_start()
-{
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 4;
- m_layer_colorbase[2] = 8;
- m_sprite_colorbase = 16;
-}
-
-
-
-/***************************************************************************
-
Display refresh
***************************************************************************/
@@ -70,7 +56,8 @@ UINT32 aliens_state::screen_update_aliens(screen_device &screen, bitmap_ind16 &b
m_k052109->tilemap_update();
screen.priority().fill(0, cliprect);
- bitmap.fill(m_layer_colorbase[1] * 16, cliprect);
+ /* The background color is always from layer 1 */
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 0);
m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 1);
m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
diff --git a/src/mame/video/antic.c b/src/mame/video/antic.c
index 0e7381c29e9..2979a86f92a 100644
--- a/src/mame/video/antic.c
+++ b/src/mame/video/antic.c
@@ -29,6 +29,9 @@ antic_device::antic_device(const machine_config &mconfig, const char *tag, devic
device_t(mconfig, ATARI_ANTIC, "Atari ANTIC", tag, owner, clock, "antic", __FILE__),
device_video_interface(mconfig, *this),
m_gtia_tag(NULL),
+ m_maincpu(*this, ":maincpu"),
+ m_djoy_b(*this, ":djoy_b"),
+ m_artifacts(*this, ":artifacts"),
m_tv_artifacts(0),
m_render1(0),
m_render2(0),
@@ -1388,7 +1391,7 @@ void antic_device::render(address_space &space, int param1, int param2, int para
************************************************************************/
UINT32 antic_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- UINT32 new_tv_artifacts = screen.ioport("artifacts")->read_safe(0);
+ UINT32 new_tv_artifacts = m_artifacts ? m_artifacts->read() : 0;
copybitmap(bitmap, *m_bitmap, 0, 0, 0, 0, cliprect);
if (m_tv_artifacts != new_tv_artifacts)
@@ -2081,7 +2084,7 @@ void antic_device::generic_interrupt(int button_count)
if( m_scanline == VBL_START )
{
/* specify buttons relevant to this Atari variant */
- m_gtia->button_interrupt(button_count, machine().root_device().ioport("djoy_b")->read_safe(0));
+ m_gtia->button_interrupt(button_count, m_djoy_b ? m_djoy_b->read() : 0);
/* do nothing new for the rest of the frame */
m_modelines = m_screen->height() - VBL_START;
@@ -2095,7 +2098,7 @@ void antic_device::generic_interrupt(int button_count)
LOG((" cause VBL NMI\n"));
/* set the VBL NMI status bit */
m_r.nmist |= VBL_NMI;
- machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
diff --git a/src/mame/video/antic.h b/src/mame/video/antic.h
index bb08a37361b..fba381887d6 100644
--- a/src/mame/video/antic.h
+++ b/src/mame/video/antic.h
@@ -389,6 +389,9 @@ private:
const char *m_gtia_tag;
gtia_device *m_gtia;
+ required_device<cpu_device> m_maincpu;
+ optional_ioport m_djoy_b;
+ optional_ioport m_artifacts;
UINT32 m_tv_artifacts;
int m_render1, m_render2, m_render3;
diff --git a/src/mame/video/astrocde.c b/src/mame/video/astrocde.c
index 962de8e7e2c..2df2fb11706 100644
--- a/src/mame/video/astrocde.c
+++ b/src/mame/video/astrocde.c
@@ -24,7 +24,6 @@ void astrocde_state::machine_start()
save_item(NAME(m_port_2_last));
save_item(NAME(m_ram_write_enable));
save_item(NAME(m_input_select));
- save_item(NAME(m_profpac_bank));
m_port_1_last = m_port_2_last = 0xff;
}
@@ -491,51 +490,51 @@ READ8_MEMBER(astrocde_state::astrocade_data_chip_register_r)
break;
case 0x10: /* player 1 handle */
- result = ioport("P1HANDLE")->read_safe(0xff);
+ result = m_p1handle? m_p1handle->read() : 0xff;
break;
case 0x11: /* player 2 handle */
- result = ioport("P2HANDLE")->read_safe(0xff);
+ result = m_p2handle? m_p2handle->read() : 0xff;
break;
case 0x12: /* player 3 handle */
- result = ioport("P3HANDLE")->read_safe(0xff);
+ result = m_p3handle? m_p3handle->read() : 0xff;
break;
case 0x13: /* player 4 handle */
- result = ioport("P4HANDLE")->read_safe(0xff);
+ result = m_p4handle? m_p4handle->read() : 0xff;
break;
case 0x14: /* keypad column 0 */
- result = ioport("KEYPAD0")->read_safe(0xff);
+ result = m_keypad0 ? m_keypad0->read() : 0xff;
break;
case 0x15: /* keypad column 1 */
- result = ioport("KEYPAD1")->read_safe(0xff);
+ result = m_keypad1 ? m_keypad1->read() : 0xff;
break;
case 0x16: /* keypad column 2 */
- result = ioport("KEYPAD2")->read_safe(0xff);
+ result = m_keypad2 ? m_keypad2->read() : 0xff;
break;
case 0x17: /* keypad column 3 */
- result = ioport("KEYPAD3")->read_safe(0xff);
+ result = m_keypad3 ? m_keypad3->read() : 0xff;
break;
case 0x1c: /* player 1 knob */
- result = ioport("P1_KNOB")->read_safe(0xff);
+ result = m_p1_knob ? m_p1_knob->read() : 0xff;
break;
case 0x1d: /* player 2 knob */
- result = ioport("P2_KNOB")->read_safe(0xff);
+ result = m_p2_knob ? m_p2_knob->read() : 0xff;
break;
case 0x1e: /* player 3 knob */
- result = ioport("P3_KNOB")->read_safe(0xff);
+ result = m_p3_knob ? m_p3_knob->read() : 0xff;
break;
case 0x1f: /* player 4 knob */
- result = ioport("P4_KNOB")->read_safe(0xff);
+ result = m_p4_knob ? m_p4_knob->read() : 0xff;
break;
}
@@ -605,7 +604,7 @@ WRITE8_MEMBER(astrocde_state::astrocade_data_chip_register_w)
case 0x17: /* noise volume register */
case 0x18: /* sound block transfer */
if (m_video_config & AC_SOUND_PRESENT)
- machine().device<astrocade_device>("astrocade1")->astrocade_sound_w(space, offset, data);
+ m_astrocade_sound1->astrocade_sound_w(space, offset, data);
break;
case 0x19: /* expand register */
diff --git a/src/mame/video/atarimo.c b/src/mame/video/atarimo.c
index aeb0e3d6912..df1df174e9e 100644
--- a/src/mame/video/atarimo.c
+++ b/src/mame/video/atarimo.c
@@ -259,12 +259,12 @@ void atari_motion_objects_device::apply_stain(bitmap_ind16 &bitmap, UINT16 *pf,
{
const UINT16 START_MARKER = ((4 << PRIORITY_SHIFT) | 2);
const UINT16 END_MARKER = ((4 << PRIORITY_SHIFT) | 4);
- int offnext = 0;
+ bool offnext = false;
for ( ; x < bitmap.width(); x++)
{
pf[x] |= 0x400;
- if (offnext != 0 && (mo[x] & START_MARKER) != START_MARKER)
+ if (mo[x] == 0xffff || (offnext && (mo[x] & START_MARKER) != START_MARKER))
break;
offnext = ((mo[x] & END_MARKER) == END_MARKER);
}
@@ -541,7 +541,7 @@ void atari_motion_objects_device::render_object(bitmap_ind16 &bitmap, const rect
continue;
// draw the sprite
- gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
+ gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
mark_dirty(sx, sx + m_tilewidth - 1, sy, sy + m_tileheight - 1);
}
}
@@ -570,7 +570,7 @@ void atari_motion_objects_device::render_object(bitmap_ind16 &bitmap, const rect
continue;
// draw the sprite
- gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
+ gfx->transpen_raw(bitmap,cliprect, code, color, hflip, vflip, sx, sy, m_transpen);
mark_dirty(sx, sx + m_tilewidth - 1, sy, sy + m_tileheight - 1);
}
}
@@ -595,8 +595,8 @@ void atari_motion_objects_device::render_object(bitmap_ind16 &bitmap, const rect
atari_motion_objects_device::sprite_parameter::sprite_parameter()
: m_word(0),
- m_shift(0),
- m_mask(0)
+ m_shift(0),
+ m_mask(0)
{
}
diff --git a/src/mame/video/battlnts.c b/src/mame/video/battlnts.c
index f50f77339d2..d88f16a9251 100644
--- a/src/mame/video/battlnts.c
+++ b/src/mame/video/battlnts.c
@@ -12,7 +12,7 @@
K007342_CALLBACK_MEMBER(battlnts_state::battlnts_tile_callback)
{
*code |= ((*color & 0x0f) << 9) | ((*color & 0x40) << 2);
- *color = m_layer_colorbase[layer];
+ *color = 0;
}
/***************************************************************************
diff --git a/src/mame/video/bladestl.c b/src/mame/video/bladestl.c
index 7e62058945a..58db646223a 100644
--- a/src/mame/video/bladestl.c
+++ b/src/mame/video/bladestl.c
@@ -32,7 +32,7 @@ PALETTE_INIT_MEMBER(bladestl_state, bladestl)
K007342_CALLBACK_MEMBER(bladestl_state::bladestl_tile_callback)
{
*code |= ((*color & 0x0f) << 8) | ((*color & 0x40) << 6);
- *color = m_layer_colorbase[layer];
+ *color = layer;
}
/***************************************************************************
diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c
index 73e51719582..06f78dfd55e 100644
--- a/src/mame/video/cps1.c
+++ b/src/mame/video/cps1.c
@@ -477,6 +477,7 @@ The games seem to use them to mark platforms, kill zones and no-go areas.
#define CPS_B_21_QS4 0x2e,0x0c01, -1, -1, -1, -1, 0x1c,0x1e,0x08, 0x16,{0x00,0x02,0x28,0x2a},0x2c, {0x04,0x08,0x10,0x00,0x00}
#define CPS_B_21_QS5 0x1e,0x0c02, -1, -1, -1, -1, 0x0c, -1, -1, 0x2a,{0x2c,0x2e,0x30,0x32},0x1c, {0x04,0x08,0x10,0x00,0x00}
#define HACK_B_1 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0x14,{0x12,0x10,0x0e,0x0c},0x0a, {0x0e,0x0e,0x0e,0x30,0x30}
+#define HACK_B_2 -1, -1, 0x0e,0x0c,0x0a,0x08, 0x06,0x04,0x02, 0x28,{0x26,0x24,0x22,0x20},0x22, {0x20,0x04,0x08,0x12,0x12}
/*
CPS_B_21_DEF is CPS-B-21 at default settings (no battery)
@@ -1477,8 +1478,8 @@ static const struct CPS1config cps1_config_table[]=
{"3wondersr1", CPS_B_21_BT1, mapper_RT24B },
{"3wondersu", CPS_B_21_BT1, mapper_RT24B },
{"wonder3", CPS_B_21_BT1, mapper_RT22B }, // equivalent to RT24B
- {"3wondersb", CPS_B_21_BT1, mapper_RT24B },
- {"3wondersh", CPS_B_02 , mapper_RT24B }, /* Not 100% sure of the CPS B-ID */
+ {"3wondersb", CPS_B_21_BT1, mapper_RT24B, 0x36, 0, 0, 0x88 }, // same as 3wonders except some registers are hard wired rather than written to
+ {"3wondersh", HACK_B_2, mapper_RT24B }, // one port is changed from 3wonders, and no protection
{"kod", CPS_B_21_BT2, mapper_KD29B, 0x36, 0, 0x34 },
{"kodr1", CPS_B_21_BT2, mapper_KD29B, 0x36, 0, 0x34 },
{"kodu", CPS_B_21_BT2, mapper_KD29B, 0x36, 0, 0x34 },
@@ -1767,7 +1768,7 @@ READ16_MEMBER(cps_state::cps1_cps_b_r)
{
if (offset == 0x10/2)
{
- // UNKNOWN--only mmatrix appears to read this, and I'm not sure if the result is actuallyused
+ // UNKNOWN--only mmatrix appears to read this, and I'm not sure if the result is actually used
return m_cps_b_regs[0x10 / 2];
}
if (offset == 0x12/2)
@@ -1950,6 +1951,18 @@ void cps_state::cps1_get_video_base()
scroll2xoff = -0x0b;
scroll3xoff = -0x0c;
}
+ else
+ if (m_game_config->bootleg_kludge == 0x88) // 3wondersb
+ {
+ scroll1xoff = 0x4;
+ scroll2xoff = 0x6;
+ scroll3xoff = 0xa;
+ m_cps_b_regs[0x30/2] = 0x3f;
+ m_cps_a_regs[CPS1_VIDEOCONTROL] = 0x3e;
+ m_cps_a_regs[CPS1_SCROLL2_BASE] = 0x90c0;
+ m_cps_a_regs[CPS1_SCROLL3_BASE] = 0x9100;
+ m_cps_a_regs[CPS1_PALETTE_BASE] = 0x9140;
+ }
m_obj = cps1_base(CPS1_OBJ_BASE, m_obj_size);
m_other = cps1_base(CPS1_OTHER_BASE, m_other_size);
@@ -2958,6 +2971,9 @@ UINT32 cps_state::screen_update_cps1(screen_device &screen, bitmap_ind16 &bitmap
if (m_cps_version == 1)
{
+ if BIT(m_game_config->bootleg_kludge, 7)
+ cps1_build_palette(cps1_base(CPS1_PALETTE_BASE, m_palette_align));
+
cps1_render_layer(screen, bitmap, cliprect, l0, 0);
if (l1 == 0)
diff --git a/src/mame/video/crimfght.c b/src/mame/video/crimfght.c
index 46806d7e076..8b37bb03313 100644
--- a/src/mame/video/crimfght.c
+++ b/src/mame/video/crimfght.c
@@ -13,7 +13,7 @@ K052109_CB_MEMBER(crimfght_state::tile_callback)
{
*flags = (*color & 0x20) ? TILE_FLIPX : 0;
*code |= ((*color & 0x1f) << 8) | (bank << 13);
- *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+ *color = layer * 4 + ((*color & 0xc0) >> 6);
}
/***************************************************************************
@@ -24,50 +24,29 @@ K052109_CB_MEMBER(crimfght_state::tile_callback)
K051960_CB_MEMBER(crimfght_state::sprite_callback)
{
- /* Weird priority scheme. Why use three bits when two would suffice? */
+ enum { sprite_colorbase = 256 / 16 };
+
/* The PROM allows for mixed priorities, where sprites would have */
/* priority over text but not on one or both of the other two planes. */
- /* Luckily, this isn't used by the game. */
switch (*color & 0x70)
{
- case 0x10: *priority = 0; break;
- case 0x00: *priority = 1; break;
- case 0x40: *priority = 2; break;
- case 0x20: *priority = 3; break;
- /* 0x60 == 0x20 */
- /* 0x50 priority over F and A, but not over B */
- /* 0x30 priority over F, but not over A and B */
- /* 0x70 == 0x30 */
+ case 0x10: *priority = 0x00; break; /* over ABF */
+ case 0x00: *priority = GFX_PMASK_4 ; break; /* over AB, not F */
+ case 0x40: *priority = GFX_PMASK_4|GFX_PMASK_2 ; break; /* over A, not BF */
+ case 0x20:
+ case 0x60: *priority = GFX_PMASK_4|GFX_PMASK_2|GFX_PMASK_1; break; /* over -, not ABF */
+ case 0x50: *priority = GFX_PMASK_2 ; break; /* over AF, not B */
+ case 0x30:
+ case 0x70: *priority = GFX_PMASK_2|GFX_PMASK_1; break; /* over F, not AB */
}
/* bit 7 is on in the "Game Over" sprites, meaning unknown */
/* in Aliens it is the top bit of the code, but that's not needed here */
- *color = m_sprite_colorbase + (*color & 0x0f);
+ *color = sprite_colorbase + (*color & 0x0f);
}
/***************************************************************************
- Start the video hardware emulation.
-
-***************************************************************************/
-
-void crimfght_state::video_start()
-{
- m_paletteram.resize(0x400);
- m_palette->basemem().set(m_paletteram, ENDIANNESS_BIG, 2);
-
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 4;
- m_layer_colorbase[2] = 8;
- m_sprite_colorbase = 16;
-
- save_item(NAME(m_paletteram));
-}
-
-
-
-/***************************************************************************
-
Display refresh
***************************************************************************/
@@ -76,11 +55,14 @@ UINT32 crimfght_state::screen_update_crimfght(screen_device &screen, bitmap_ind1
{
m_k052109->tilemap_update();
+ screen.priority().fill(0, cliprect);
+ /* The background color is always from layer 1 */
m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 0);
- m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 2, 2);
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0);
- m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1);
- m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
- m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0);
+
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 1);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2);
+ m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 4);
+
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
return 0;
}
diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c
index 545e1a353f3..f923c2dba15 100644
--- a/src/mame/video/deco16ic.c
+++ b/src/mame/video/deco16ic.c
@@ -36,19 +36,22 @@
Pocket Gal DX MAZ 102 52,71 56 104 153
Boogie Wings MBD 102 52,52,71,71 141, 141 104 113,99,200
1 Double Wings MBE 102 52 141 104
- Fighter's History MBF 101 52,153 56,74 [Scratched] 200, 153, 170
- Heavy Smash MBG 156 52 141 153*3
- Night Slashers MBH 156 52,52,52,153,153,153 74, 141 104 99,200
- Locked N Loaded MBM 101 ? 74,74 146 113,186,187
+3 Fighter's History DE-0380-0 MBF 156 52 56, 74 [Scratched] 153,153,200,170
+3 Fighter's History DE-0395-1 MBF 156 52 56, 74 75 113,113,200
+3 Fighter's History DE-0396-0 MBF 156 52 74, 141 75 153,153,200
+ Heavy Smash MBG 156 52 141 153,153,153
+ Night Slashers MBH 156 52(*3) 74, 141 104 153(*3),99,200
+ Locked N Loaded MBM 101 ? 74, 74 146 113,186,187
Joe & Mac Return MBN 156 52 141 223,223
2 Charlie Ninja MBR 156 52 141 223,223
World Cup Volleyball 95 MBX 156 52 141 ?
- Backfire! MBZ 156 52,52,153,153 141,141 ? 223
+ Backfire! MBZ 156 52,52 141, 141 ? 153,153,223
2* Ganbare Gonta MCB 156 52 141 223,223
Chain Reaction/Magical Drop MCC 156 52 141 223,223
Dunk Dream 95 MCE 156 [MLC] [MLC]
2 Osman/Cannon Dancer MCF 156 52 141 223,223
Avengers In Galactic Storm MCG SH2 [MLC] [MLC]
+ Skull Fang MCH 156 [MLC] [MLC]
Stadium Hero 96 MCM 156 [MLC] [MLC] 146
Sotsugyo Shousho 59 52 74 146?
@@ -57,11 +60,14 @@
Note 1: Mitchell game on DECO PCB board number DEC-22V0 (S-NK-3220)
Note 2: Mitchell games on DECO PCB board number MT5601-0
+Note 3: Fighter's History was released on 3 different PCBs, DE-0396-0, DE-0395-1 & DE-0380-2
+ Fighter's History seems to use the 156 Encrypted ARM cpu with the encryption disabled
Note *: Ganbare! Gonta!! 2 / Lady Killer Part 2 - Party Time
Custom chip 59 = 68000 cpu
Custom chip 101 = Arm6 cpu
Custom chip 113 = Alpha blending
+ Custom chip 153 = Alpha blending (same functions as 113, smaller PQFP package)
Custom chip 99 = 'Ace' chip (Special alpha blending?)
Custom chip 156 = Encrypted ARM cpu
Custom chip 102 = Encrypted 68000 cpu
diff --git a/src/mame/video/gradius3.c b/src/mame/video/gradius3.c
index 36f3e334bc5..2002afb39bc 100644
--- a/src/mame/video/gradius3.c
+++ b/src/mame/video/gradius3.c
@@ -4,9 +4,6 @@
#include "includes/gradius3.h"
-#define TOTAL_CHARS 0x1000
-#define TOTAL_SPRITES 0x4000
-
/***************************************************************************
Callbacks for the K052109
@@ -15,9 +12,11 @@
K052109_CB_MEMBER(gradius3_state::tile_callback)
{
+ static const int layer_colorbase[] = { 0 / 16, 512 / 16, 768 / 16 };
+
/* (color & 0x02) is flip y handled internally by the 052109 */
*code |= ((*color & 0x01) << 8) | ((*color & 0x1c) << 7);
- *color = m_layer_colorbase[layer] + ((*color & 0xe0) >> 5);
+ *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
/***************************************************************************
@@ -28,14 +27,19 @@ K052109_CB_MEMBER(gradius3_state::tile_callback)
K051960_CB_MEMBER(gradius3_state::sprite_callback)
{
- #define L0 0xaa
- #define L1 0xcc
- #define L2 0xf0
+ enum { sprite_colorbase = 256 / 16 };
+
+ #define L0 GFX_PMASK_1
+ #define L1 GFX_PMASK_2
+ #define L2 GFX_PMASK_4
static const int primask[2][4] =
{
{ L0|L2, L0, L0|L2, L0|L1|L2 },
{ L1|L2, L2, 0, L0|L1|L2 }
};
+ #undef L0
+ #undef L1
+ #undef L2
int pri = ((*color & 0x60) >> 5);
@@ -45,7 +49,7 @@ K051960_CB_MEMBER(gradius3_state::sprite_callback)
*priority = primask[1][pri];
*code |= (*color & 0x01) << 13;
- *color = m_sprite_colorbase + ((*color & 0x1e) >> 1);
+ *color = sprite_colorbase + ((*color & 0x1e) >> 1);
}
/***************************************************************************
@@ -61,11 +65,6 @@ void gradius3_state::gradius3_postload()
void gradius3_state::video_start()
{
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 32;
- m_layer_colorbase[2] = 48;
- m_sprite_colorbase = 16;
-
machine().save().register_postload(save_prepost_delegate(FUNC(gradius3_state::gradius3_postload), this));
}
@@ -77,9 +76,7 @@ void gradius3_state::video_start()
READ16_MEMBER(gradius3_state::gradius3_gfxrom_r)
{
- UINT8 *gfxdata = memregion("k051960")->base();
-
- return (gfxdata[2 * offset + 1] << 8) | gfxdata[2 * offset];
+ return (m_gfxrom[2 * offset + 1] << 8) | m_gfxrom[2 * offset];
}
WRITE16_MEMBER(gradius3_state::gradius3_gfxram_w)
diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c
index 59027e594af..2d9e0b08378 100644
--- a/src/mame/video/gtia.c
+++ b/src/mame/video/gtia.c
@@ -283,7 +283,7 @@ void gtia_device::device_reset()
int gtia_device::is_ntsc()
{
- return ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds) > 55;
+ return ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds()) > 55;
}
void gtia_device::button_interrupt(int button_count, UINT8 button_port)
diff --git a/src/mame/video/k051960.c b/src/mame/video/k051960.c
index 1b2270db7fc..96c1acb2faf 100644
--- a/src/mame/video/k051960.c
+++ b/src/mame/video/k051960.c
@@ -24,11 +24,12 @@ The 051960 can also genenrate IRQ, FIRQ and NMI signals.
memory map:
000-007 is for the 051937, but also seen by the 051960
400-7ff is 051960 only
-000 R bit 0 = unknown, looks like a status flag or something
+000 R bit 0 = vblank?
aliens waits for it to be 0 before starting to copy sprite data
thndrx2 needs it to pulse for the startup checks to succeed
-000 W bit 0 = irq enable/acknowledge?
- bit 2 = nmi enable?
+000 W bit 0 = irq acknowledge
+ bit 1 = firq acknowledge?
+ bit 2 = nmi enable/acknowledge
bit 3 = flip screen (applies to sprites only, not tilemaps)
bit 4 = unknown, used by Devastators, TMNT, Aliens, Chequered Flag, maybe others
aliens sets it just after checking bit 0, and before copying
@@ -128,12 +129,18 @@ k051960_device::k051960_device(const machine_config &mconfig, const char *tag, d
: device_t(mconfig, K051960, "K051960 Sprite Generator", tag, owner, clock, "k051960", __FILE__),
device_gfx_interface(mconfig, *this, gfxinfo),
m_ram(NULL),
+ m_sprite_rom(NULL),
+ m_sprite_size(0),
+ m_screen_tag(NULL),
+ m_screen(NULL),
+ m_scanline_timer(NULL),
+ m_irq_handler(*this),
+ m_firq_handler(*this),
+ m_nmi_handler(*this),
m_romoffset(0),
m_spriteflip(0),
m_readroms(0),
- m_irq_enabled(0),
- m_nmi_enabled(0),
- m_k051937_counter(0)
+ m_nmi_enabled(0)
{
}
@@ -161,11 +168,30 @@ void k051960_device::set_plane_order(device_t &device, int order)
}
//-------------------------------------------------
+// set_screen_tag - set screen we are attached to
+//-------------------------------------------------
+
+void k051960_device::set_screen_tag(device_t &device, device_t *owner, const char *tag)
+{
+ k051960_device &dev = dynamic_cast<k051960_device &>(device);
+ dev.m_screen_tag = tag;
+}
+
+//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void k051960_device::device_start()
{
+ // make sure our screen is started
+ m_screen = m_owner->subdevice<screen_device>(m_screen_tag);
+ if (!m_screen->started())
+ throw device_missing_dependencies();
+
+ // allocate scanline timer and start at first scanline
+ m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(k051960_device::scanline_callback), this));
+ m_scanline_timer->adjust(m_screen->time_until_pos(0));
+
m_sprite_rom = region()->base();
m_sprite_size = region()->bytes();
@@ -180,15 +206,18 @@ void k051960_device::device_start()
// bind callbacks
m_k051960_cb.bind_relative_to(*owner());
+ // resolve callbacks
+ m_irq_handler.resolve_safe();
+ m_firq_handler.resolve_safe();
+ m_nmi_handler.resolve_safe();
+
+ // register for save states
save_item(NAME(m_romoffset));
save_item(NAME(m_spriteflip));
save_item(NAME(m_readroms));
+ save_item(NAME(m_nmi_enabled));
save_item(NAME(m_spriterombank));
save_pointer(NAME(m_ram), 0x400);
- save_item(NAME(m_irq_enabled));
- save_item(NAME(m_nmi_enabled));
-
- save_item(NAME(m_k051937_counter));
}
//-------------------------------------------------
@@ -197,12 +226,9 @@ void k051960_device::device_start()
void k051960_device::device_reset()
{
- m_k051937_counter = 0;
-
m_romoffset = 0;
m_spriteflip = 0;
m_readroms = 0;
- m_irq_enabled = 0;
m_nmi_enabled = 0;
m_spriterombank[0] = 0;
@@ -215,6 +241,23 @@ void k051960_device::device_reset()
DEVICE HANDLERS
*****************************************************************************/
+TIMER_CALLBACK_MEMBER( k051960_device::scanline_callback )
+{
+ // range 0..255
+ UINT8 y = m_screen->vpos();
+
+ // 32v
+ if ((y % 32 == 0) && m_nmi_enabled)
+ m_nmi_handler(ASSERT_LINE);
+
+ // vblank
+ if (y == 240)
+ m_irq_handler(ASSERT_LINE);
+
+ // wait for next line
+ m_scanline_timer->adjust(m_screen->time_until_pos(y + 1));
+}
+
int k051960_device::k051960_fetchromdata( int byte )
{
int code, color, pri, shadow, off1, addr;
@@ -259,8 +302,7 @@ READ8_MEMBER( k051960_device::k051937_r )
if (m_readroms && offset >= 4 && offset < 8)
return k051960_fetchromdata(offset & 3);
else if (offset == 0)
- /* some games need bit 0 to pulse */
- return (m_k051937_counter++) & 1;
+ return m_screen->vblank() ? 1 : 0; // vblank?
//logerror("%04x: read unknown 051937 address %x\n", space.device().safe_pc(), offset);
return 0;
@@ -272,13 +314,13 @@ WRITE8_MEMBER( k051960_device::k051937_w )
{
//if (data & 0xc2) popmessage("051937 reg 00 = %02x",data);
- /* bit 0 is IRQ enable */
- m_irq_enabled = data & 0x01;
-
- /* bit 1: probably FIRQ enable */
+ if (BIT(data, 0)) m_irq_handler(CLEAR_LINE); // bit 0, irq ack
+ if (BIT(data, 1)) m_firq_handler(CLEAR_LINE); // bit 1, firq ack?
- /* bit 2 is NMI enable */
- m_nmi_enabled = data & 0x04;
+ // bit 2, nmi enable/ack
+ m_nmi_enabled = BIT(data, 2);
+ if (m_nmi_enabled)
+ m_nmi_handler(CLEAR_LINE);
/* bit 3 = flip screen */
m_spriteflip = data & 0x08;
@@ -291,8 +333,9 @@ WRITE8_MEMBER( k051960_device::k051937_w )
}
else if (offset == 1)
{
-// popmessage("%04x: write %02x to 051937 address %x", space.device().safe_pc(), data, offset);
-//logerror("%04x: write %02x to unknown 051937 address %x\n", space.device().safe_pc(), data, offset);
+ // unknown, Devastators writes 02 here in game
+ if (0)
+ logerror("%s: %02x to 051937 address %x\n", machine().describe_context(), data, offset);
}
else if (offset >= 2 && offset < 5)
{
@@ -305,16 +348,6 @@ WRITE8_MEMBER( k051960_device::k051937_w )
}
}
-int k051960_device::k051960_is_irq_enabled( )
-{
- return m_irq_enabled;
-}
-
-int k051960_device::k051960_is_nmi_enabled( )
-{
- return m_nmi_enabled;
-}
-
/*
* Sprite Format
diff --git a/src/mame/video/k051960.h b/src/mame/video/k051960.h
index 353974ed734..43c9a171856 100644
--- a/src/mame/video/k051960.h
+++ b/src/mame/video/k051960.h
@@ -21,6 +21,15 @@ typedef device_delegate<void (int *code, int *color, int *priority, int *shadow)
#define MCFG_K051960_PLANEORDER(_order) \
k051960_device::set_plane_order(*device, _order);
+#define MCFG_K051960_SCREEN_TAG(_tag) \
+ k051960_device::set_screen_tag(*device, owner, _tag);
+
+#define MCFG_K051960_IRQ_HANDLER(_devcb) \
+ devcb = &k051960_device::set_irq_handler(*device, DEVCB_##_devcb);
+
+#define MCFG_K051960_NMI_HANDLER(_devcb) \
+ devcb = &k051960_device::set_nmi_handler(*device, DEVCB_##_devcb);
+
class k051960_device : public device_t,
public device_gfx_interface
@@ -36,9 +45,16 @@ public:
k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k051960_device() {}
+ template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object)
+ { return downcast<k051960_device &>(device).m_irq_handler.set_callback(object); }
+
+ template<class _Object> static devcb_base &set_nmi_handler(device_t &device, _Object object)
+ { return downcast<k051960_device &>(device).m_nmi_handler.set_callback(object); }
+
// static configuration
static void set_k051960_callback(device_t &device, k051960_cb_delegate callback) { downcast<k051960_device &>(device).m_k051960_cb = callback; }
static void set_plane_order(device_t &device, int order);
+ static void set_screen_tag(device_t &device, device_t *owner, const char *tag);
/*
The callback is passed:
@@ -61,13 +77,14 @@ public:
DECLARE_WRITE8_MEMBER( k051937_w );
void k051960_sprites_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int min_priority, int max_priority);
- int k051960_is_irq_enabled();
- int k051960_is_nmi_enabled();
+
+ TIMER_CALLBACK_MEMBER(scanline_callback);
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
+
private:
// internal state
UINT8 *m_ram;
@@ -75,14 +92,20 @@ private:
UINT8 *m_sprite_rom;
UINT32 m_sprite_size;
+ const char *m_screen_tag;
+ screen_device *m_screen;
+ emu_timer *m_scanline_timer;
+
k051960_cb_delegate m_k051960_cb;
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_firq_handler;
+ devcb_write_line m_nmi_handler;
+
UINT8 m_spriterombank[3];
int m_romoffset;
int m_spriteflip, m_readroms;
- int m_irq_enabled, m_nmi_enabled;
-
- int m_k051937_counter;
+ int m_nmi_enabled;
int k051960_fetchromdata( int byte );
};
diff --git a/src/mame/video/k052109.c b/src/mame/video/k052109.c
index 52ef33ecb65..ccffe5f2e89 100644
--- a/src/mame/video/k052109.c
+++ b/src/mame/video/k052109.c
@@ -179,7 +179,11 @@ k052109_device::k052109_device(const machine_config &mconfig, const char *tag, d
m_romsubbank(0),
m_scrollctrl(0),
m_char_rom(NULL),
- m_char_size(0)
+ m_char_size(0),
+ m_screen_tag(NULL),
+ m_irq_handler(*this),
+ m_firq_handler(*this),
+ m_nmi_handler(*this)
{
}
@@ -201,11 +205,21 @@ void k052109_device::set_ram(device_t &device, bool ram)
void k052109_device::device_start()
{
- memory_region *ROM = region();
- if (ROM != NULL)
+ if (m_screen_tag != NULL)
{
- m_char_rom = ROM->base();
- m_char_size = ROM->bytes();
+ // make sure our screen is started
+ screen_device *screen = m_owner->subdevice<screen_device>(m_screen_tag);
+ if (!screen->started())
+ throw device_missing_dependencies();
+
+ // and register a callback for vblank state
+ screen->register_vblank_callback(vblank_state_delegate(FUNC(k052109_device::vblank_callback), this));
+ }
+
+ if (region() != NULL)
+ {
+ m_char_rom = region()->base();
+ m_char_size = region()->bytes();
}
decode_gfx();
@@ -234,6 +248,11 @@ void k052109_device::device_start()
// bind callbacks
m_k052109_cb.bind_relative_to(*owner());
+ // resolve callbacks
+ m_irq_handler.resolve_safe();
+ m_firq_handler.resolve_safe();
+ m_nmi_handler.resolve_safe();
+
save_pointer(NAME(m_ram), 0x6000);
save_item(NAME(m_rmrd_line));
save_item(NAME(m_romsubbank));
@@ -265,10 +284,27 @@ void k052109_device::device_reset()
}
}
+//-------------------------------------------------
+// set_screen_tag - set screen we are attached to
+//-------------------------------------------------
+
+void k052109_device::set_screen_tag(device_t &device, device_t *owner, const char *tag)
+{
+ k052109_device &dev = dynamic_cast<k052109_device &>(device);
+ dev.m_screen_tag = tag;
+}
+
+
/*****************************************************************************
DEVICE HANDLERS
*****************************************************************************/
+void k052109_device::vblank_callback(screen_device &screen, bool state)
+{
+ if (state)
+ m_irq_handler(ASSERT_LINE);
+}
+
READ8_MEMBER( k052109_device::read )
{
if (m_rmrd_line == CLEAR_LINE)
@@ -351,6 +387,8 @@ WRITE8_MEMBER( k052109_device::write )
/* bit 2 = irq enable */
/* the custom chip can also generate NMI and FIRQ, for use with a 6809 */
m_irq_enabled = data & 0x04;
+ if (m_irq_enabled)
+ m_irq_handler(CLEAR_LINE);
}
else if (offset == 0x1d80)
{
diff --git a/src/mame/video/k052109.h b/src/mame/video/k052109.h
index 13f63b61359..5c62bdf1638 100644
--- a/src/mame/video/k052109.h
+++ b/src/mame/video/k052109.h
@@ -13,8 +13,14 @@ typedef device_delegate<void (int layer, int bank, int *code, int *color, int *f
#define MCFG_K052109_CHARRAM(_ram) \
k052109_device::set_ram(*device, _ram);
-class k052109_device : public device_t,
- public device_gfx_interface
+#define MCFG_K052109_SCREEN_TAG(_tag) \
+ k052109_device::set_screen_tag(*device, owner, _tag);
+
+#define MCFG_K052109_IRQ_HANDLER(_devcb) \
+ devcb = &k052109_device::set_irq_handler(*device, DEVCB_##_devcb);
+
+
+class k052109_device : public device_t, public device_gfx_interface
{
static const gfx_layout charlayout;
static const gfx_layout charlayout_ram;
@@ -25,8 +31,12 @@ public:
k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~k052109_device() {}
+ template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object)
+ { return downcast<k052109_device &>(device).m_irq_handler.set_callback(object); }
+
static void set_k052109_callback(device_t &device, k052109_cb_delegate callback) { downcast<k052109_device &>(device).m_k052109_cb = callback; }
static void set_ram(device_t &device, bool ram);
+ static void set_screen_tag(device_t &device, device_t *owner, const char *tag);
/*
The callback is passed:
@@ -57,10 +67,13 @@ public:
void tilemap_mark_dirty(int tmap_num);
void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, UINT32 flags, UINT8 priority);
+ void vblank_callback(screen_device &screen, bool state);
+
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
+
private:
// internal state
UINT8 *m_ram;
@@ -86,8 +99,14 @@ private:
UINT8 *m_char_rom;
UINT32 m_char_size;
+ const char *m_screen_tag;
+
k052109_cb_delegate m_k052109_cb;
+ devcb_write_line m_irq_handler;
+ devcb_write_line m_firq_handler;
+ devcb_write_line m_nmi_handler;
+
TILE_GET_INFO_MEMBER(get_tile_info0);
TILE_GET_INFO_MEMBER(get_tile_info1);
TILE_GET_INFO_MEMBER(get_tile_info2);
diff --git a/src/mame/video/k057714.c b/src/mame/video/k057714.c
index 5f7b6b7b595..14cb52a83ba 100644
--- a/src/mame/video/k057714.c
+++ b/src/mame/video/k057714.c
@@ -14,13 +14,14 @@
const device_type K057714 = &device_creator<k057714_device>;
k057714_device::k057714_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, K057714, "K057714 GCU", tag, owner, clock, "k057714", __FILE__)
+ : device_t(mconfig, K057714, "K057714 GCU", tag, owner, clock, "k057714", __FILE__),
+ m_irq(*this)
{
}
void k057714_device::device_start()
{
- m_cpu = machine().device(m_cputag);
+ m_irq.resolve_safe();
m_vram = auto_alloc_array(machine(), UINT32, 0x2000000/4);
memset(m_vram, 0, 0x2000000);
@@ -97,7 +98,12 @@ WRITE32_MEMBER(k057714_device::write)
/* IRQ clear/enable; ppd writes bit off then on in response to interrupt */
/* it enables bits 0x41, but 0x01 seems to be the one it cares about */
if (ACCESSING_BITS_16_31 && (data & 0x00010000) == 0)
- m_cpu->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
+ {
+ if (!m_irq.isnull())
+ {
+ m_irq(CLEAR_LINE);
+ }
+ }
if (ACCESSING_BITS_0_15)
#if PRINT_GCU
printf("%s_w: %02X, %08X, %08X\n", basetag(), reg, data, mem_mask);
@@ -110,6 +116,14 @@ WRITE32_MEMBER(k057714_device::write)
case 0x18: // ?
break;
+ case 0x1c: // set to 1 on "media bus" access
+ if ((data >> 16) == 1)
+ {
+ m_ext_fifo_count = 0;
+ m_ext_fifo_line = 0;
+ }
+ break;
+
case 0x20: // Framebuffer 0 Origin(?)
break;
@@ -178,6 +192,17 @@ WRITE32_MEMBER(k057714_device::write)
#endif
break;
+ case 0x54:
+ if (ACCESSING_BITS_16_31)
+ m_ext_fifo_num_lines = data >> 16;
+ if (ACCESSING_BITS_0_15)
+ m_ext_fifo_width = data & 0xffff;
+ break;
+
+ case 0x58:
+ m_ext_fifo_addr = (data & 0xffffff);
+ break;
+
case 0x5c: // VRAM Read Address
m_vram_read_addr = (data & 0xffffff) / 2;
break;
@@ -244,11 +269,41 @@ WRITE32_MEMBER(k057714_device::write)
break;
default:
- //printf("%s_w: %02X, %08X, %08X\n", basetag(), reg, data, mem_mask);
+ //printf("%s_w: %02X, %08X, %08X at %08X\n", basetag(), reg, data, mem_mask, space.device().safe_pc());
break;
}
}
+WRITE32_MEMBER(k057714_device::fifo_w)
+{
+ if (ACCESSING_BITS_16_31)
+ {
+ if (m_ext_fifo_count != 0) // first access is a dummy write
+ {
+ int count = m_ext_fifo_count - 1;
+ UINT32 addr = (((m_ext_fifo_addr >> 10) + m_ext_fifo_line) * 1024) + count;
+
+ if ((count & 1) == 0)
+ {
+ m_vram[addr >> 1] &= 0x0000ffff;
+ m_vram[addr >> 1] |= (data & 0xffff0000);
+ }
+ else
+ {
+ m_vram[addr >> 1] &= 0xffff0000;
+ m_vram[addr >> 1] |= (data >> 16);
+ }
+ }
+ m_ext_fifo_count++;
+
+ if (m_ext_fifo_count > m_ext_fifo_width+1)
+ {
+ m_ext_fifo_line++;
+ m_ext_fifo_count = 0;
+ }
+ }
+}
+
int k057714_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
UINT16 *vram16 = (UINT16*)m_vram;
@@ -265,7 +320,7 @@ int k057714_device::draw(screen_device &screen, bitmap_ind16 &bitmap, const rect
{
visarea.max_x = width-1;
visarea.max_y = height-1;
- screen.configure(width, height, visarea, screen.frame_period().attoseconds);
+ screen.configure(width, height, visarea, screen.frame_period().attoseconds());
}
}
diff --git a/src/mame/video/k057714.h b/src/mame/video/k057714.h
index 85671ffd5d8..88b03791e57 100644
--- a/src/mame/video/k057714.h
+++ b/src/mame/video/k057714.h
@@ -9,12 +9,13 @@ class k057714_device : public device_t
{
public:
k057714_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- static void static_set_cpu_tag(device_t &device, const char *tag) { downcast<k057714_device &>(device).m_cputag = tag; }
+ template<class _Object> static devcb_base &static_set_irq_callback(device_t &device, _Object object) { return downcast<k057714_device &>(device).m_irq.set_callback(object); }
int draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ32_MEMBER(read);
DECLARE_WRITE32_MEMBER(write);
+ DECLARE_WRITE32_MEMBER(fifo_w);
struct framebuffer
{
@@ -46,18 +47,23 @@ private:
UINT32 m_command_fifo0_ptr;
UINT32 m_command_fifo1[4];
UINT32 m_command_fifo1_ptr;
-
- const char* m_cputag;
- device_t* m_cpu;
+ UINT32 m_ext_fifo_addr;
+ UINT32 m_ext_fifo_count;
+ UINT32 m_ext_fifo_line;
+ UINT32 m_ext_fifo_num_lines;
+ UINT32 m_ext_fifo_width;
framebuffer m_frame[4];
UINT32 m_fb_origin_x;
UINT32 m_fb_origin_y;
+
+ devcb_write_line m_irq;
};
extern const device_type K057714;
-#define MCFG_K057714_CPU_TAG(_tag) \
- k057714_device::static_set_cpu_tag(*device, _tag);
+#define MCFG_K057714_IRQ_CALLBACK(_devcb) \
+ devcb = &k057714_device::static_set_irq_callback(*device, DEVCB_##_devcb);
+
#endif
diff --git a/src/mame/video/lethalj.c b/src/mame/video/lethalj.c
index d34a017623b..3fdc4027ede 100644
--- a/src/mame/video/lethalj.c
+++ b/src/mame/video/lethalj.c
@@ -24,13 +24,20 @@
inline void lethalj_state::get_crosshair_xy(int player, int *x, int *y)
{
- static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
const rectangle &visarea = m_screen->visible_area();
int width = visarea.width();
int height = visarea.height();
- *x = ((ioport(gunnames[player * 2])->read_safe(0x00) & 0xff) * width) / 255;
- *y = ((ioport(gunnames[1 + player * 2])->read_safe(0x00) & 0xff) * height) / 255;
+ if (player)
+ {
+ *x = (((m_light1_x ? m_light1_x->read() : 0) & 0xff) * width) / 255;
+ *y = (((m_light1_y ? m_light1_y->read() : 0) & 0xff) * height) / 255;
+ }
+ else
+ {
+ *x = (((m_light0_x ? m_light0_x->read() : 0) & 0xff) * width) / 255;
+ *y = (((m_light0_y ? m_light0_y->read() : 0) & 0xff) * height) / 255;
+ }
}
diff --git a/src/mame/video/mainevt.c b/src/mame/video/mainevt.c
index b8fc5bb2287..8f177009ca2 100644
--- a/src/mame/video/mainevt.c
+++ b/src/mame/video/mainevt.c
@@ -19,19 +19,23 @@
K052109_CB_MEMBER(mainevt_state::mainevt_tile_callback)
{
+ static const int layer_colorbase[] = { 0 / 16, 128 / 16, 64 / 16 };
+
*flags = (*color & 0x02) ? TILE_FLIPX : 0;
/* priority relative to HALF priority sprites */
*priority = (layer == 2) ? (*color & 0x20) >> 5 : 0;
*code |= ((*color & 0x01) << 8) | ((*color & 0x1c) << 7);
- *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+ *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6);
}
K052109_CB_MEMBER(mainevt_state::dv_tile_callback)
{
+ static const int layer_colorbase[] = { 0 / 16, 0 / 16, 64 / 16 };
+
/* (color & 0x02) is flip y handled internally by the 052109 */
*code |= ((*color & 0x01) << 8) | ((*color & 0x3c) << 7);
- *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6);
+ *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6);
}
@@ -43,6 +47,8 @@ K052109_CB_MEMBER(mainevt_state::dv_tile_callback)
K051960_CB_MEMBER(mainevt_state::mainevt_sprite_callback)
{
+ enum { sprite_colorbase = 192 / 16 };
+
/* bit 5 = priority over layer B (has precedence) */
/* bit 6 = HALF priority over layer B (used for crowd when you get out of the ring) */
if (*color & 0x20)
@@ -53,33 +59,17 @@ K051960_CB_MEMBER(mainevt_state::mainevt_sprite_callback)
*priority = 0xff00 | 0xf0f0 | 0xcccc;
/* bit 7 is shadow, not used */
- *color = m_sprite_colorbase + (*color & 0x03);
+ *color = sprite_colorbase + (*color & 0x03);
}
K051960_CB_MEMBER(mainevt_state::dv_sprite_callback)
{
- /* TODO: the priority/shadow handling (bits 5-7) seems to be quite complex (see PROM) */
- *color = m_sprite_colorbase + (*color & 0x07);
-}
-
+ enum { sprite_colorbase = 128 / 16 };
-/*****************************************************************************/
-
-VIDEO_START_MEMBER(mainevt_state,mainevt)
-{
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 8;
- m_layer_colorbase[2] = 4;
- m_sprite_colorbase = 12;
+ /* TODO: the priority/shadow handling (bits 5-7) seems to be quite complex (see PROM) */
+ *color = sprite_colorbase + (*color & 0x07);
}
-VIDEO_START_MEMBER(mainevt_state,dv)
-{
- m_layer_colorbase[0] = 0;
- m_layer_colorbase[1] = 0;
- m_layer_colorbase[2] = 4;
- m_sprite_colorbase = 8;
-}
/*****************************************************************************/
diff --git a/src/mame/video/mcd212.c b/src/mame/video/mcd212.c
index 7ae7051916e..d67930c08f1 100644
--- a/src/mame/video/mcd212.c
+++ b/src/mame/video/mcd212.c
@@ -518,7 +518,7 @@ void mcd212_device::update_visible_area()
{
const rectangle &visarea = m_screen->visible_area();
rectangle visarea1;
- attoseconds_t period = m_screen->frame_period().attoseconds;
+ attoseconds_t period = m_screen->frame_period().attoseconds();
int width = 0;
if((m_channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (m_channel[0].csrw & MCD212_CSR1W_ST))
diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c
index 8afd287ec7a..31fa346751b 100644
--- a/src/mame/video/midzeus.c
+++ b/src/mame/video/midzeus.c
@@ -27,10 +27,14 @@
#define WAVERAM1_WIDTH 512
#define WAVERAM1_HEIGHT 512
-#define BLEND_OPAQUE 0x00000000
+#define BLEND_OPAQUE1 0x00000000
#define BLEND_OPAQUE2 0x4b23cb00
-#define BLEND_ADD 0x40b68800
-#define BLEND_SUB 0x4093c800
+#define BLEND_OPAQUE3 0x4b23dd00
+#define BLEND_OPAQUE4 0x00004800
+#define BLEND_OPAQUE5 0xdd23dd00
+#define BLEND_ADD1 0x40b68800
+#define BLEND_ADD2 0xc9b78800
+#define BLEND_MUL1 0x4093c800
/*************************************
@@ -41,18 +45,21 @@
struct mz_poly_extra_data
{
- const void * palbase;
- const void * texbase;
- UINT16 solidcolor;
- UINT16 voffset;
- INT16 zoffset;
- UINT16 transcolor;
- UINT16 texwidth;
- UINT16 color;
- UINT32 alpha;
+ const void * palbase;
+ const void * texbase;
+ UINT16 solidcolor;
+ UINT16 voffset;
+ INT16 zoffset;
+ UINT16 transcolor;
+ UINT16 texwidth;
+ UINT16 color;
+ UINT32 alpha;
+ UINT32 ctrl_word;
bool blend_enable;
+ bool depth_test_enable;
+ bool depth_write_enable;
UINT32 blend;
- UINT8 (*get_texel)(const void *, int, int, int);
+ UINT8 (*get_texel)(const void *, int, int, int);
};
@@ -73,6 +80,7 @@ static INT32 zeus_point[3];
static INT16 zeus_light[3];
static void *zeus_renderbase;
static UINT32 zeus_palbase;
+static UINT32 zeus_unkbase;
static int zeus_enable_logging;
static UINT32 zeus_objdata;
static rectangle zeus_cliprect;
@@ -94,9 +102,7 @@ INLINE UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width);
INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width);
INLINE UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width);
-static void render_poly_texture(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
-static void render_poly_shade(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
-static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
+static void render_poly(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
static void render_poly_solid_fixedz(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid);
@@ -172,19 +178,20 @@ INLINE void *waveram0_ptr_from_texture_addr(UINT32 addr, int width)
*
*************************************/
-INLINE void waveram_plot(int y, int x, UINT16 color)
+INLINE void waveram_plot_depth(int y, int x, UINT16 color, UINT16 depth)
{
if (zeus_cliprect.contains(x, y))
+ {
WAVERAM_WRITEPIX(zeus_renderbase, y, x, color);
+ WAVERAM_WRITEDEPTH(zeus_renderbase, y, x, depth);
+ }
}
-INLINE void waveram_plot_depth(int y, int x, UINT16 color, UINT16 depth)
+#ifdef UNUSED_FUNCTION
+INLINE void waveram_plot(int y, int x, UINT16 color)
{
if (zeus_cliprect.contains(x, y))
- {
WAVERAM_WRITEPIX(zeus_renderbase, y, x, color);
- WAVERAM_WRITEDEPTH(zeus_renderbase, y, x, depth);
- }
}
INLINE void waveram_plot_check_depth(int y, int x, UINT16 color, UINT16 depth)
@@ -200,7 +207,6 @@ INLINE void waveram_plot_check_depth(int y, int x, UINT16 color, UINT16 depth)
}
}
-#ifdef UNUSED_FUNCTION
INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT16 color, UINT16 depth)
{
if (zeus_cliprect.contains(x, y))
@@ -219,31 +225,30 @@ INLINE void waveram_plot_check_depth_nowrite(int y, int x, UINT16 color, UINT16
*
*************************************/
-INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width)
+// 4x2 block size
+INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width)
{
- UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3);
- return WAVERAM_READ8(base, byteoffs);
+ UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3);
+ return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f;
}
-
-INLINE UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width)
+INLINE UINT8 get_texel_8bit(const void *base, int y, int x, int width)
{
- UINT32 byteoffs = (y / 4) * (width * 4) + ((x / 2) << 3) + ((y & 3) << 1) + (x & 1);
+ UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 4) << 3) + ((y & 1) << 2) + (x & 3);
return WAVERAM_READ8(base, byteoffs);
}
-
-INLINE UINT8 get_texel_4bit(const void *base, int y, int x, int width)
+// 2x2 block size
+INLINE UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width)
{
- UINT32 byteoffs = (y / 2) * (width * 2) + ((x / 8) << 3) + ((y & 1) << 2) + ((x / 2) & 3);
+ UINT32 byteoffs = (y / 4) * (width * 4) + ((x / 4) << 3) + ((y & 3) << 1) + ((x / 2) & 1);
return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f;
}
-
-INLINE UINT8 get_texel_alt_4bit(const void *base, int y, int x, int width)
+INLINE UINT8 get_texel_alt_8bit(const void *base, int y, int x, int width)
{
- UINT32 byteoffs = (y / 4) * (width * 4) + ((x / 4) << 3) + ((y & 3) << 1) + ((x / 2) & 1);
- return (WAVERAM_READ8(base, byteoffs) >> (4 * (x & 1))) & 0x0f;
+ UINT32 byteoffs = (y / 4) * (width * 4) + ((x / 2) << 3) + ((y & 3) << 1) + (x & 1);
+ return WAVERAM_READ8(base, byteoffs);
}
/*************************************
@@ -490,6 +495,12 @@ void midzeus_state::zeus_pointer_w(UINT32 which, UINT32 data, int logit)
zeus_palbase = data;
break;
+ case 0x02c0f0:
+ if (logit)
+ logerror(" -- setptr(unkbase)\n");
+ zeus_unkbase = data;
+ break;
+
// case 0x004040: -- set via FIFO command in mk4 (len=02)
@@ -907,13 +918,12 @@ int midzeus_state::zeus_fifo_process(const UINT32 *data, int numwords)
if (log_fifo)
{
log_fifo_command(data, numwords, "");
- logerror(" -- additional xyz = %d,%d,%d\n", (INT16)data[0], (INT16)(data[1] >> 16), (INT16)data[1]);
-
- /* guessing this might be a light source? */
- zeus_light[0] = (INT16)data[0];
- zeus_light[1] = (INT16)(data[1] >> 16);
- zeus_light[2] = (INT16)data[1];
+ logerror(" -- light xyz = %d,%d,%d\n", (INT16)data[1], (INT16)(data[1] >> 16), (INT16)data[0]);
}
+
+ zeus_light[0] = (INT16)(data[1] & 0xffff);
+ zeus_light[1] = (INT16)(data[1] >> 16);
+ zeus_light[2] = (INT16)(data[0] & 0xffff);
break;
/* 0x25: display control? */
/* 0x28: same for mk4b */
@@ -1092,58 +1102,22 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
mz_poly_extra_data *extra;
poly_vertex clipvert[8];
poly_vertex vert[4];
- float uscale, vscale;
+ UINT32 ushift, vshift;
float maxy, maxx;
- int val2, texbase, texwshift;
- int numverts;
- int i;
- INT16 normal[3];
- INT32 rotnormal[3];
-
- INT32 ctrl_word = databuffer[long_fmt ? 1 : 9];
-
- /* look for interesting data patterns */
- if (
- (ctrl_word & 0xffffffff) != 0x200c0000 && /* mk4 sometimes */
- (ctrl_word & 0xfffe0000) != 0x21000000 && /* most of mk4 */
- (ctrl_word & 0xffffffff) != 0x008c0000 && /* invasn */
- (ctrl_word & 0xfffeffff) != 0x028c0000 && /* invasn */
- (ctrl_word & 0xfffe0000) != 0x21800000 && /* invasn */
- (ctrl_word & 0xfffe0000) != 0x23800000 && /* invasn */
- 1)
- printf("zeus_draw_quad: ctrl_word = %08X\n", ctrl_word);
-
-
- /* do a simple backface cull; not sure if the hardware does it, but I see no other
- reason for a polygon normal here */
+ UINT32 texbase, texwshift;
+ UINT32 numverts;
- /* extract the polygon normal */
- normal[0] = (INT8)(databuffer[0] >> 0);
- normal[1] = (INT8)(databuffer[0] >> 8);
- normal[2] = (INT8)(databuffer[0] >> 16);
-
- /* rotate the normal into camera view; we only need the Z coordinate */
- rotnormal[2] = normal[0] * zeus_matrix[2][0] + normal[1] * zeus_matrix[2][1] + normal[2] * zeus_matrix[2][2];
-
- /* if we're pointing away from the camera, toss */
- if (rotnormal[2] > 0)
- {
- if (logit)
- logerror("quad (culled %08X)\n", rotnormal[2]);
-// if (machine().input().code_pressed(KEYCODE_COMMA))
-// return;
- }
+ UINT32 ctrl_word = databuffer[long_fmt ? 1 : 9];
texbase = ((texdata >> 10) & 0x3f0000) | (texdata & 0xffff);
- val2 = (texdata >> 16) & 0x3ff;
- texwshift = (val2 >> 6) & 7;
+ texwshift = (texdata >> 22) & 7;
- uscale = (8 >> ((m_zeusbase[0x04] >> 4) & 3)) * 0.125f * 256.0f;
- vscale = (8 >> ((m_zeusbase[0x04] >> 6) & 3)) * 0.125f * 256.0f;
+ ushift = 8 - ((m_zeusbase[0x04] >> 4) & 3);
+ vshift = 8 - ((m_zeusbase[0x04] >> 6) & 3);
int xy_offset = long_fmt ? 2 : 1;
- for (i = 0; i < 4; i++)
+ for (UINT32 i = 0; i < 4; i++)
{
UINT32 ixy = databuffer[xy_offset + i*2];
UINT32 iuvz = databuffer[xy_offset + 1 + i*2];
@@ -1152,41 +1126,64 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
INT32 zo = (INT16)iuvz;
UINT8 u = iuvz >> 16;
UINT8 v = iuvz >> 24;
- INT32 dotnormal = 0;
INT64 x, y, z;
+
x = (INT64)(xo * zeus_matrix[0][0]) + (INT64)(yo * zeus_matrix[0][1]) + (INT64)(zo * zeus_matrix[0][2]) + zeus_point[0];
y = (INT64)(xo * zeus_matrix[1][0]) + (INT64)(yo * zeus_matrix[1][1]) + (INT64)(zo * zeus_matrix[1][2]) + zeus_point[1];
z = (INT64)(xo * zeus_matrix[2][0]) + (INT64)(yo * zeus_matrix[2][1]) + (INT64)(zo * zeus_matrix[2][2]) + zeus_point[2];
- if (long_fmt)
+ // Rounding hack
+ x = (x + 0x00004000) & ~0x00007fffULL;
+ y = (y + 0x00004000) & ~0x00007fffULL;
+ z = (z + 0x00004000) & ~0x00007fffULL;
+
+ // back face cull using polygon normal and first vertex
+ if (i == 0)
{
- UINT32 inormal = databuffer[10 + i];
- INT32 xn = (INT32)(inormal << 2) >> 20;
- INT32 yn = (INT32)(inormal << 12) >> 20;
- INT32 zn = (INT32)(inormal << 22) >> 20;
+ INT16 normal[3];
+ INT32 rotnormal[3];
+
+ normal[0] = (INT8)(databuffer[0] >> 0);
+ normal[1] = (INT8)(databuffer[0] >> 8);
+ normal[2] = (INT8)(databuffer[0] >> 16);
+
+ rotnormal[0] = normal[0] * zeus_matrix[0][0] + normal[1] * zeus_matrix[0][1] + normal[2] * zeus_matrix[0][2];
+ rotnormal[1] = normal[0] * zeus_matrix[1][0] + normal[1] * zeus_matrix[1][1] + normal[2] * zeus_matrix[1][2];
+ rotnormal[2] = normal[0] * zeus_matrix[2][0] + normal[1] * zeus_matrix[2][1] + normal[2] * zeus_matrix[2][2];
- rotnormal[0] = ((INT64)(xn * zeus_matrix[0][0]) + (INT64)(yn * zeus_matrix[0][1]) + (INT64)(zn * zeus_matrix[0][2])) >> 14;
- rotnormal[1] = ((INT64)(xn * zeus_matrix[1][0]) + (INT64)(yn * zeus_matrix[1][1]) + (INT64)(zn * zeus_matrix[1][2])) >> 14;
- rotnormal[2] = ((INT64)(xn * zeus_matrix[2][0]) + (INT64)(yn * zeus_matrix[2][1]) + (INT64)(zn * zeus_matrix[2][2])) >> 14;
+ INT64 dot = rotnormal[0] * x + rotnormal[1] * y + rotnormal[2] * z;
- dotnormal = rotnormal[0] * ((x >> 16) + zeus_light[0]) + rotnormal[1] * ((y >> 16) + zeus_light[1]) + rotnormal[2] * ((z >> 16) + zeus_light[2]);
+ if (dot >= 0)
+ return;
+ }
+
+ if (long_fmt)
+ {
+#if 0
+ // TODO: Lighting
+ UINT32 inormal = databuffer[10 + i];
+ INT32 xn = (INT32)(((inormal >> 0) & 0x3ff) << 22) >> 22;
+ INT32 yn = (INT32)(((inormal >> 10) & 0x3ff) << 22) >> 22;
+ INT32 zn = (INT32)(((inormal >> 20) & 0x3ff) << 22) >> 22;
+#endif
}
vert[i].x = x;
vert[i].y = y;
vert[i].p[0] = z;
- vert[i].p[1] = u * uscale;
- vert[i].p[2] = v * vscale;
- vert[i].p[3] = dotnormal;
+ vert[i].p[1] = u << ushift;
+ vert[i].p[2] = v << vshift;
+ vert[i].p[3] = 0xffff;
if (logit)
{
- logerror("\t\t(%f,%f,%f) (%02X,%02X) (%03X,%03X,%03X) dot=%08X\n",
+ logerror("\t\t(%f,%f,%f) UV:(%02X,%02X) UV_SCALE:(%02X,%02X) (%03X,%03X,%03X) dot=%08X\n",
(double) vert[i].x * (1.0 / 65536.0), (double) vert[i].y * (1.0 / 65536.0), (double) vert[i].p[0] * (1.0 / 65536.0),
+ (iuvz >> 16) & 0xff, (iuvz >> 24) & 0xff,
(int)(vert[i].p[1] / 256.0f), (int)(vert[i].p[2] / 256.0f),
(databuffer[10 + i] >> 20) & 0x3ff, (databuffer[10 + i] >> 10) & 0x3ff, (databuffer[10 + i] >> 0) & 0x3ff,
- dotnormal);
+ 0);
}
}
@@ -1195,7 +1192,7 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
return;
maxx = maxy = -1000.0f;
- for (i = 0; i < numverts; i++)
+ for (UINT32 i = 0; i < numverts; i++)
{
float ooz = 512.0f / clipvert[i].p[0];
@@ -1206,10 +1203,11 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
maxx = MAX(maxx, clipvert[i].x);
maxy = MAX(maxy, clipvert[i].y);
+
if (logit)
- logerror("\t\t\tTranslated=(%f,%f)\n", (double) clipvert[i].x, (double) clipvert[i].y);
+ logerror("\t\t\tTranslated=(%f,%f,%f)\n", (double) clipvert[i].x, (double) clipvert[i].y, (double) clipvert[i].p[0]);
}
- for (i = 0; i < numverts; i++)
+ for (UINT32 i = 0; i < numverts; i++)
{
if (clipvert[i].x == maxx)
clipvert[i].x += 0.0005f;
@@ -1219,30 +1217,21 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
extra = (mz_poly_extra_data *)poly_get_extra_data(poly);
- if ((ctrl_word & 0x000c0000) == 0x000c0000)
- {
- callback = render_poly_solid;
- }
- else if (val2 == 0x182)
- {
- callback = render_poly_shade;
- }
- else if (ctrl_word & 0x01000000)
+ if (ctrl_word & 0x01000000)
{
- int tex_type = val2 & 3;
-
- callback = render_poly_texture;
+ UINT32 tex_type = (texdata >> 16) & 3;
extra->texwidth = 512 >> texwshift;
extra->voffset = ctrl_word & 0xffff;
+
extra->texbase = waveram0_ptr_from_texture_addr(texbase, extra->texwidth);
if (tex_type == 1)
{
- extra->get_texel = (val2 & 0x20) ? get_texel_8bit : get_texel_4bit;
+ extra->get_texel = texdata & 0x00200000 ? get_texel_8bit : get_texel_4bit;
}
else if (tex_type == 2)
{
- extra->get_texel = (val2 & 0x20) ? get_texel_alt_8bit : get_texel_alt_4bit;
+ extra->get_texel = texdata & 0x00200000 ? get_texel_alt_8bit : get_texel_alt_4bit;
}
else
{
@@ -1250,16 +1239,16 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
return;
}
}
- else
- {
- printf("Unknown draw mode: %.8x\n", ctrl_word);
- return;
- }
+
+ callback = render_poly;
+
+ extra->ctrl_word = ctrl_word;
extra->solidcolor = m_zeusbase[0x00] & 0x7fff;
extra->zoffset = m_zeusbase[0x7e] >> 16;
extra->alpha = m_zeusbase[0x4e];
extra->blend = m_zeusbase[0x5c];
- extra->blend_enable = m_zeusbase[0x5c] == BLEND_ADD || m_zeusbase[0x5c] == BLEND_SUB;
+ extra->depth_test_enable = !(m_zeusbase[0x04] & 0x800);
+ extra->depth_write_enable = m_zeusbase[0x04] & 0x200;
extra->transcolor = ((ctrl_word >> 16) & 1) ? 0 : 0x100;
extra->palbase = waveram0_ptr_from_block_addr(zeus_palbase);
@@ -1274,149 +1263,216 @@ void midzeus_state::zeus_draw_quad(int long_fmt, const UINT32 *databuffer, UINT3
*
*************************************/
-static void render_poly_texture(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
+static void render_poly(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
INT32 curz = extent->param[0].start;
INT32 curu = extent->param[1].start;
INT32 curv = extent->param[2].start;
- //INT32 curi = extent->param[3].start;
+ INT32 curi = extent->param[3].start;
INT32 dzdx = extent->param[0].dpdx;
INT32 dudx = extent->param[1].dpdx;
INT32 dvdx = extent->param[2].dpdx;
- //INT32 didx = extent->param[3].dpdx;
+ INT32 didx = extent->param[3].dpdx;
const void *texbase = extra->texbase;
const void *palbase = extra->palbase;
UINT16 transcolor = extra->transcolor;
- int texwidth = extra->texwidth;
- int x;
+ UINT32 texwidth = extra->texwidth;
- for (x = extent->startx; x < extent->stopx; x++)
+ for (UINT32 x = extent->startx; x < extent->stopx; x++)
{
UINT16 *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, scanline, x);
INT32 depth = (curz >> 16) + extra->zoffset;
- if (depth > 0x7fff) depth = 0x7fff;
- if (depth >= 0 && depth <= *depthptr)
+
+ if (depth > 0x7fff)
+ depth = 0x7fff;
+
+ UINT32 i8 = curi >> 8;
+
+ bool depth_pass;
+
+ if (extra->depth_test_enable)
+ depth_pass = depth >= 0 && depth <= *depthptr;
+ else
+ depth_pass = true;
+
+ if (depth_pass)
{
- int u0 = (curu >> 8);
- int v0 = (curv >> 8) + extra->voffset;
- int u1 = (u0 + 1);
- int v1 = (v0 + 1);
- UINT8 texel0 = extra->get_texel(texbase, v0, u0, texwidth);
- UINT8 texel1 = extra->get_texel(texbase, v0, u1, texwidth);
- UINT8 texel2 = extra->get_texel(texbase, v1, u0, texwidth);
- UINT8 texel3 = extra->get_texel(texbase, v1, u1, texwidth);
- if (texel0 != transcolor)
+ rgb_t src=0;
+
+ bool src_valid = true;
+
+ if ((extra->ctrl_word & 0x000c0000) == 0x000c0000)
{
- rgb_t color0 = WAVERAM_READ16(palbase, texel0);
- rgb_t color1 = WAVERAM_READ16(palbase, texel1);
- rgb_t color2 = WAVERAM_READ16(palbase, texel2);
- rgb_t color3 = WAVERAM_READ16(palbase, texel3);
- color0 = ((color0 & 0x7fe0) << 6) | (color0 & 0x1f);
- color1 = ((color1 & 0x7fe0) << 6) | (color1 & 0x1f);
- color2 = ((color2 & 0x7fe0) << 6) | (color2 & 0x1f);
- color3 = ((color3 & 0x7fe0) << 6) | (color3 & 0x1f);
- rgb_t filtered = rgbaint_t::bilinear_filter(color0, color1, color2, color3, curu, curv);
-
- if (extra->blend_enable)
- {
- UINT16 dst = WAVERAM_READPIX(zeus_renderbase, scanline, x);
- INT32 dst_r = (dst >> 10) & 0x1f;
- INT32 dst_g = (dst >> 5) & 0x1f;
- INT32 dst_b = dst & 0x1f;
+ src.set_r(pal5bit(extra->solidcolor >> 10));
+ src.set_g(pal5bit(extra->solidcolor >> 5));
+ src.set_b(pal5bit(extra->solidcolor));
+ }
+ else
+ {
+ UINT32 u0 = curu >> 8;
+ UINT32 v0 = extra->voffset + (curv >> 8);
+ UINT32 u1 = u0 + 1;
+ UINT32 v1 = v0 + 1;
- INT32 src_r = filtered.r();
- INT32 src_g = filtered.g() >> 3;
- INT32 src_b = filtered.b();
+ UINT8 texels[4];
- if (extra->blend == BLEND_ADD)
- {
- dst_r += src_r;
- dst_g += src_g;
- dst_b += src_b;
- dst_r = ((dst_r > 0x1f) ? 0x1f : dst_r);
- dst_g = ((dst_g > 0x1f) ? 0x1f : dst_g);
- dst_b = ((dst_b > 0x1f) ? 0x1f : dst_b);
- }
- else if (extra->blend == BLEND_SUB)
+ texels[0] = extra->get_texel(texbase, v0, u0, texwidth);
+ texels[1] = extra->get_texel(texbase, v0, u1, texwidth);
+ texels[2] = extra->get_texel(texbase, v1, u0, texwidth);
+ texels[3] = extra->get_texel(texbase, v1, u1, texwidth);
+
+ if (texels[0] != transcolor)
+ {
+ rgb_t color[4];
+
+ for (UINT32 i = 0; i < 4; ++i)
{
- dst_r -= src_r;
- dst_g -= src_g;
- dst_b -= src_b;
- dst_r = ((dst_r < 0) ? 0 : dst_r);
- dst_g = ((dst_g < 0) ? 0 : dst_g);
- dst_b = ((dst_b < 0) ? 0 : dst_b);
+ UINT16 pix = WAVERAM_READ16(palbase, texels[i]);
+
+ color[i].set_r(pal5bit(pix >> 10));
+ color[i].set_g(pal5bit(pix >> 5));
+ color[i].set_b(pal5bit(pix));
}
- WAVERAM_WRITEPIX(zeus_renderbase, scanline, x, (dst_r << 10) | (dst_g << 5) | dst_b);
+
+ src = rgbaint_t::bilinear_filter(color[0], color[1], color[2], color[3], curu & 0xff, curv & 0xff);
}
else
{
- WAVERAM_WRITEPIX(zeus_renderbase, scanline, x, ((filtered >> 6) & 0x7fe0) | (filtered & 0x1f));
+ src_valid = false;
}
- *depthptr = depth;
}
- }
- curz += dzdx;
- curu += dudx;
- curv += dvdx;
- //curi += didx;
- }
-}
+ if (src_valid)
+ {
+ UINT32 srcr = src.r();
+ UINT32 srcg = src.g();
+ UINT32 srcb = src.b();
-static void render_poly_shade(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
-{
- const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
- int x;
+ UINT32 dstr = 0;
+ UINT32 dstg = 0;
+ UINT32 dstb = 0;
- for (x = extent->startx; x < extent->stopx; x++)
- {
- if (x >= 0 && x < 400)
- {
- if (extra->alpha <= 0x80)
- {
- UINT16 *ptr = WAVERAM_PTRPIX(zeus_renderbase, scanline, x);
- UINT16 pix = *ptr;
+ UINT32 outr = 0;
+ UINT32 outg = 0;
+ UINT32 outb = 0;
- *ptr = ((((pix & 0x7c00) * extra->alpha) >> 7) & 0x7c00) |
- ((((pix & 0x03e0) * extra->alpha) >> 7) & 0x03e0) |
- ((((pix & 0x001f) * extra->alpha) >> 7) & 0x001f);
- }
- else
- {
- waveram_plot(scanline, x, 0);
- }
- }
- }
-}
+ UINT32 srca = extra->alpha & 0xff;
+ UINT32 dsta = (extra->alpha >> 8) & 0xff;
+ // Destination enable?
+ if (extra->blend & 0x00800000)
+ {
+ UINT16 dst = WAVERAM_READPIX(zeus_renderbase, scanline, x);
-static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
-{
- const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
- UINT16 color = extra->solidcolor;
- INT32 curz = (INT32)(extent->param[0].start);
- INT32 curv = extent->param[2].start;
- INT32 dzdx = (INT32)(extent->param[0].dpdx);
- INT32 dvdx = extent->param[2].dpdx;
- int x;
+ dstr = (dst >> 10) & 0x1f;
+ dstg = (dst >> 5) & 0x1f;
+ dstb = dst & 0x1f;
- for (x = extent->startx; x < extent->stopx; x++)
- {
- INT32 depth = (curz >> 16) + extra->zoffset;
- if (depth > 0x7fff) depth = 0x7fff;
- if (depth >= 0)
- {
-// UINT32 finalcolor = (((color & 0x7c00) * curv) & 0x7c000000) | (((color & 0x03e0) * curv) & 0x03e00000) | (((color & 0x001f) * curv) & 0x001f0000);
-// waveram_plot_check_depth(scanline, x, finalcolor >> 16, depth);
- waveram_plot_check_depth(scanline, x, color, depth);
+ dstr = (dstr << 3) | (dstr >> 2);
+ dstg = (dstg << 3) | (dstg >> 2);
+ dstb = (dstb << 3) | (dstb >> 2);
+ }
+
+ switch (extra->blend)
+ {
+ case BLEND_OPAQUE1:
+ {
+ outr = srcr;
+ outg = srcg;
+ outb = srcb;
+ break;
+ }
+
+ case BLEND_OPAQUE2:
+ {
+ outr = (srcr * i8) >> 8;
+ outg = (srcg * i8) >> 8;
+ outb = (srcb * i8) >> 8;
+ break;
+ }
+
+ case BLEND_OPAQUE3:
+ {
+ outr = (srcr * i8) >> 8;
+ outg = (srcg * i8) >> 8;
+ outb = (srcb * i8) >> 8;
+ break;
+ }
+
+ case BLEND_OPAQUE4:
+ {
+ outr = srcr;
+ outg = srcg;
+ outb = srcb;
+ break;
+ }
+
+ case BLEND_OPAQUE5:
+ {
+ // TODO: Fog factor?
+ outr = (srcr * srca) >> 8;
+ outg = (srcg * srca) >> 8;
+ outb = (srcb * srca) >> 8;
+ break;
+ }
+
+ case BLEND_ADD1:
+ {
+ outr = ((srcr * srca) >> 8) + dstr;
+ outg = ((srcg * srca) >> 8) + dstg;
+ outb = ((srcb * srca) >> 8) + dstb;
+ break;
+ }
+
+ case BLEND_ADD2:
+ {
+ outr = ((srcr * srca) >> 8) + ((dstr * (dsta << 1)) >> 8);
+ outg = ((srcg * srca) >> 8) + ((dstg * (dsta << 1)) >> 8);
+ outb = ((srcb * srca) >> 8) + ((dstb * (dsta << 1)) >> 8);
+ break;
+ }
+
+ case BLEND_MUL1:
+ {
+ outr = (((srcr * (srca << 1)) >> 8) * dstr) >> 8;
+ outg = (((srcg * (srca << 1)) >> 8) * dstg) >> 8;
+ outb = (((srcb * (srca << 1)) >> 8) * dstb) >> 8;
+ break;
+ }
+ default:
+ {
+ outr = srcr;
+ outg = srcg;
+ outb = srcb;
+ break;
+ }
+ }
+
+ outr = outr > 0xff ? 0xff : outr;
+ outg = outg > 0xff ? 0xff : outg;
+ outb = outb > 0xff ? 0xff : outb;
+
+ outr >>= 3;
+ outg >>= 3;
+ outb >>= 3;
+
+ WAVERAM_WRITEPIX(zeus_renderbase, scanline, x, (outr << 10) | (outg << 5) | outb);
+
+ if (extra->depth_write_enable)
+ *depthptr = depth;
+ }
}
+
curz += dzdx;
+ curu += dudx;
curv += dvdx;
+ curi += didx;
}
}
+
static void render_poly_solid_fixedz(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
const mz_poly_extra_data *extra = (const mz_poly_extra_data *)extradata;
diff --git a/src/mame/video/powervr2.c b/src/mame/video/powervr2.c
index 95638a3681d..328f5fdc3c7 100644
--- a/src/mame/video/powervr2.c
+++ b/src/mame/video/powervr2.c
@@ -3467,7 +3467,7 @@ UINT32 powervr2_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
pvr_drawframebuffer(bitmap, cliprect);
// update this here so we only do string lookup once per frame
- debug_dip_status = ioport(":MAMEDEBUG")->read();
+ debug_dip_status = m_mamedebug->read();
return 0;
}
@@ -3603,7 +3603,8 @@ void powervr2_device::pvr_dma_execute(address_space &space)
powervr2_device::powervr2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, POWERVR2, "PowerVR 2", tag, owner, clock, "powervr2", __FILE__),
device_video_interface(mconfig, *this),
- irq_cb(*this)
+ irq_cb(*this),
+ m_mamedebug(*this, ":MAMEDEBUG")
{
}
diff --git a/src/mame/video/powervr2.h b/src/mame/video/powervr2.h
index deea328c858..65d68f7864e 100644
--- a/src/mame/video/powervr2.h
+++ b/src/mame/video/powervr2.h
@@ -285,6 +285,7 @@ protected:
private:
devcb_write8 irq_cb;
+ required_ioport m_mamedebug;
// Core registers
UINT32 softreset;
diff --git a/src/mame/video/rdptpipe.c b/src/mame/video/rdptpipe.c
index d574cd13133..cbe208e9162 100644
--- a/src/mame/video/rdptpipe.c
+++ b/src/mame/video/rdptpipe.c
@@ -233,31 +233,13 @@ void n64_texture_pipe_t::cycle_linear(color_t* TEX, color_t* prev, INT32 SSS, IN
rgbaint_t st(0, SSS, 0, SST);
rgbaint_t maxst = shift_cycle(st, tile);
- rgbaint_t stfrac(st);
- stfrac.and_imm(0x1f);
- clamp_cycle(st, stfrac, maxst, tilenum, tile, userdata);
+ clamp_cycle_light(st, maxst, tilenum, tile, userdata);
mask(st, tile);
const UINT32 tbase = tile.tmem + ((tile.line * st.get_b32()) & 0x1ff);
- bool upper = ((stfrac.get_r32() + stfrac.get_b32()) >= 0x20);
-
- rgbaint_t invstf;
- if (upper)
- {
- invstf.set(stfrac);
- invstf.subr_imm(0x20);
- invstf.shl_imm(3);
- }
- else
- {
- invstf.set(0, 0, 0, 0);
- }
-
- stfrac.shl_imm(3);
-
rgbaint_t t0;
((this)->*(m_texel_fetch[index]))(t0, st.get_r32(), st.get_b32(), tbase, tile.palette, userdata);
if (object.m_other_modes.convert_one && cycle)
@@ -302,10 +284,9 @@ void n64_texture_pipe_t::cycle_linear_lerp(color_t* TEX, color_t* prev, INT32 SS
bool upper = ((stfrac.get_r32() + stfrac.get_b32()) >= 0x20);
- rgbaint_t invstf;
+ rgbaint_t invstf(stfrac);
if (upper)
{
- invstf.set(stfrac);
invstf.subr_imm(0x20);
invstf.shl_imm(3);
}
diff --git a/src/mame/video/rockrage.c b/src/mame/video/rockrage.c
index 394cb79da6b..8e32ecfa0b4 100644
--- a/src/mame/video/rockrage.c
+++ b/src/mame/video/rockrage.c
@@ -30,7 +30,7 @@ K007342_CALLBACK_MEMBER(rockrage_state::rockrage_tile_callback)
*code |= ((*color & 0x40) << 2) | ((bank & 0x01) << 9);
else
*code |= ((*color & 0x40) << 2) | ((bank & 0x03) << 10) | ((m_vreg & 0x04) << 7) | ((m_vreg & 0x08) << 9);
- *color = m_layer_colorbase[layer] + (*color & 0x0f);
+ *color = layer * 16 + (*color & 0x0f);
}
/***************************************************************************
diff --git a/src/mame/video/rollerg.c b/src/mame/video/rollerg.c
index 473ff87b3f3..016cf298c96 100644
--- a/src/mame/video/rollerg.c
+++ b/src/mame/video/rollerg.c
@@ -11,6 +11,7 @@
K05324X_CB_MEMBER(rollerg_state::sprite_callback)
{
+ enum { sprite_colorbase = 256 / 16 };
#if 0
if (machine().input().code_pressed(KEYCODE_Q) && (*color & 0x80)) *color = rand();
if (machine().input().code_pressed(KEYCODE_W) && (*color & 0x40)) *color = rand();
@@ -18,7 +19,7 @@ K05324X_CB_MEMBER(rollerg_state::sprite_callback)
if (machine().input().code_pressed(KEYCODE_R) && (*color & 0x10)) *color = rand();
#endif
*priority = (*color & 0x10) ? 0 : 0x02;
- *color = m_sprite_colorbase + (*color & 0x0f);
+ *color = sprite_colorbase + (*color & 0x0f);
}
@@ -32,20 +33,7 @@ K051316_CB_MEMBER(rollerg_state::zoom_callback)
{
*flags = TILE_FLIPYX((*color & 0xc0) >> 6);
*code |= ((*color & 0x0f) << 8);
- *color = m_zoom_colorbase + ((*color & 0x30) >> 4);
-}
-
-
-/***************************************************************************
-
- Start the video hardware emulation.
-
-***************************************************************************/
-
-void rollerg_state::video_start()
-{
- m_sprite_colorbase = 16;
- m_zoom_colorbase = 0;
+ *color = ((*color & 0x30) >> 4);
}
diff --git a/src/mame/video/spy.c b/src/mame/video/spy.c
index f657b716aa9..c12a886c079 100644
--- a/src/mame/video/spy.c
+++ b/src/mame/video/spy.c
@@ -10,10 +10,10 @@
***************************************************************************/
-static const int layer_colorbase[] = { 768 / 16, 0 / 16, 256 / 16 };
-
K052109_CB_MEMBER(spy_state::tile_callback)
{
+ static const int layer_colorbase[] = { 768 / 16, 0 / 16, 256 / 16 };
+
*flags = (*color & 0x20) ? TILE_FLIPX : 0;
*code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13);
*color = layer_colorbase[layer] + ((*color & 0xc0) >> 6);
@@ -53,7 +53,7 @@ UINT32 spy_state::screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap,
screen.priority().fill(0, cliprect);
if (!m_video_enable)
- bitmap.fill(16 * layer_colorbase[0], cliprect);
+ bitmap.fill(768, cliprect); // ?
else
{
m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1);
diff --git a/src/mame/video/ultraman.c b/src/mame/video/ultraman.c
index 9e003fe8fe1..ed969c5e21a 100644
--- a/src/mame/video/ultraman.c
+++ b/src/mame/video/ultraman.c
@@ -11,8 +11,10 @@
K051960_CB_MEMBER(ultraman_state::sprite_callback)
{
- *priority = (*color & 0x80) >> 7;
- *color = m_sprite_colorbase + ((*color & 0x7e) >> 1);
+ enum { sprite_colorbase = 3072 / 16 };
+
+ *priority = (*color & 0x80) ? 0 : GFX_PMASK_1;
+ *color = sprite_colorbase + ((*color & 0x7e) >> 1);
*shadow = 0;
}
@@ -25,36 +27,25 @@ K051960_CB_MEMBER(ultraman_state::sprite_callback)
K051316_CB_MEMBER(ultraman_state::zoom_callback_1)
{
+ enum { zoom_colorbase_1 = 0 / 16 };
+
*code |= ((*color & 0x07) << 8) | (m_bank0 << 11);
- *color = m_zoom_colorbase[0] + ((*color & 0xf8) >> 3);
+ *color = zoom_colorbase_1 + ((*color & 0xf8) >> 3);
}
K051316_CB_MEMBER(ultraman_state::zoom_callback_2)
{
+ enum { zoom_colorbase_2 = 1024 / 16 };
+
*code |= ((*color & 0x07) << 8) | (m_bank1 << 11);
- *color = m_zoom_colorbase[1] + ((*color & 0xf8) >> 3);
+ *color = zoom_colorbase_2 + ((*color & 0xf8) >> 3);
}
K051316_CB_MEMBER(ultraman_state::zoom_callback_3)
{
+ enum { zoom_colorbase_3 = 2048 / 16 };
*code |= ((*color & 0x07) << 8) | (m_bank2 << 11);
- *color = m_zoom_colorbase[2] + ((*color & 0xf8) >> 3);
-}
-
-
-
-/***************************************************************************
-
- Start the video hardware emulation.
-
-***************************************************************************/
-
-void ultraman_state::video_start()
-{
- m_sprite_colorbase = 192;
- m_zoom_colorbase[0] = 0;
- m_zoom_colorbase[1] = 64;
- m_zoom_colorbase[2] = 128;
+ *color = zoom_colorbase_3 + ((*color & 0xf8) >> 3);
}
@@ -117,10 +108,11 @@ WRITE16_MEMBER(ultraman_state::ultraman_gfxctrl_w)
UINT32 ultraman_state::screen_update_ultraman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
+ screen.priority().fill(0, cliprect);
+
m_k051316_3->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
m_k051316_2->zoom_draw(screen, bitmap, cliprect, 0, 0);
- m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0);
- m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0);
- m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1);
+ m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 1);
+ m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
return 0;
}
diff --git a/src/mame/video/vicdual.c b/src/mame/video/vicdual.c
index 6b79523fdee..f1e0dee5a70 100644
--- a/src/mame/video/vicdual.c
+++ b/src/mame/video/vicdual.c
@@ -82,7 +82,7 @@ UINT32 vicdual_state::screen_update_bw(screen_device &screen, bitmap_rgb32 &bitm
UINT32 vicdual_state::screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
- UINT8 *color_prom = (UINT8 *)memregion("proms")->base();
+ UINT8 *color_prom = (UINT8 *)m_proms->base();
UINT8 x = 0;
UINT8 y = cliprect.min_y;
UINT8 video_data = 0;
diff --git a/src/mess/drivers/4004clk.c b/src/mess/drivers/4004clk.c
index 631690d582d..0d750822b7c 100644
--- a/src/mess/drivers/4004clk.c
+++ b/src/mess/drivers/4004clk.c
@@ -21,7 +21,7 @@ public:
m_maincpu(*this, "maincpu"),
m_dac(*this, "dac"),
m_input(*this, "INPUT")
- { }
+ { }
required_device<i4004_cpu_device> m_maincpu;
required_device<dac_device> m_dac;
@@ -155,7 +155,6 @@ static MACHINE_CONFIG_START( 4004clk, nixieclock_state )
MCFG_CPU_DATA_MAP(4004clk_mem)
MCFG_CPU_IO_MAP(4004clk_io)
-
/* video hardware */
MCFG_DEFAULT_LAYOUT(layout_4004clk)
@@ -190,5 +189,5 @@ ROM_END
/* Driver */
-/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
-SYST( 2008, 4004clk, 0, 0, 4004clk, 4004clk, driver_device, 0, "John L. Weinrich", "4004 Nixie Clock", MACHINE_SUPPORTS_SAVE)
+/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
+SYST( 2008, 4004clk, 0, 0, 4004clk, 4004clk, driver_device, 0, "John L. Weinrich", "4004 Nixie Clock", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mess/drivers/altos5.c b/src/mess/drivers/altos5.c
index 337504621ba..24136a110d7 100644
--- a/src/mess/drivers/altos5.c
+++ b/src/mess/drivers/altos5.c
@@ -434,7 +434,9 @@ static MACHINE_CONFIG_START( altos5, altos5_state )
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(altos5_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("z80dma", z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", altos5_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", altos5_floppies, "525qd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_SOFTWARE_LIST_ADD("flop_list", "altos5")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/ampro.c b/src/mess/drivers/ampro.c
index c0400a20ef0..3cd31d47e29 100644
--- a/src/mess/drivers/ampro.c
+++ b/src/mess/drivers/ampro.c
@@ -181,6 +181,7 @@ static MACHINE_CONFIG_START( ampro, ampro_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc_tick", ampro_state, ctc_tick, attotime::from_hz(XTAL_16MHz / 8))
MCFG_WD1772_ADD("fdc", XTAL_16MHz / 2)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ampro_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_SOFTWARE_LIST_ADD("flop_list", "ampro")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/amust.c b/src/mess/drivers/amust.c
index 91d125f46f8..a49a0db462b 100644
--- a/src/mess/drivers/amust.c
+++ b/src/mess/drivers/amust.c
@@ -192,7 +192,8 @@ static ADDRESS_MAP_START(amust_io, AS_IO, 8, amust_state)
ADDRESS_MAP_END
static SLOT_INTERFACE_START( amust_floppies )
- SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
+ SLOT_INTERFACE( "drive0", FLOPPY_525_QD )
+ SLOT_INTERFACE( "drive1", FLOPPY_525_QD )
SLOT_INTERFACE_END
/* Input ports */
@@ -409,8 +410,10 @@ static MACHINE_CONFIG_START( amust, amust_state )
MCFG_DEVICE_ADD("keybd", GENERIC_KEYBOARD, 0)
MCFG_GENERIC_KEYBOARD_CB(WRITE8(amust_state, kbd_put))
MCFG_UPD765A_ADD("fdc", false, true)
- MCFG_FLOPPY_DRIVE_ADD("fdc:0", amust_floppies, "525dd", floppy_image_device::default_floppy_formats)
- MCFG_FLOPPY_DRIVE_ADD("fdc:1", amust_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:0", amust_floppies, "drive0", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
+ MCFG_FLOPPY_DRIVE_ADD("fdc:1", amust_floppies, "drive1", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
//MCFG_DEVICE_ADD("uart1", I8251, 0)
//MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
diff --git a/src/mess/drivers/apf.c b/src/mess/drivers/apf.c
index c46b7dd3701..8509777d21b 100644
--- a/src/mess/drivers/apf.c
+++ b/src/mess/drivers/apf.c
@@ -562,7 +562,9 @@ static MACHINE_CONFIG_DERIVED( apfimag, apfm1000 )
MCFG_FD1771_ADD("fdc", 1000000) // guess
MCFG_FLOPPY_DRIVE_ADD("fdc:0", apf_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", apf_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_SOFTWARE_LIST_ADD("cass_list", "apfimag_cass")
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index 602a5f3f3f0..4c03b3fb63c 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -368,7 +368,7 @@ PALETTE_INIT_MEMBER(napple2_state, apple2)
UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// always update the flash timer here so it's smooth regardless of mode switches
- m_video->m_flash = ((machine().time() * 4).seconds & 1) ? true : false;
+ m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
if (m_video->m_graphics)
{
@@ -377,7 +377,14 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
if (m_video->m_mix)
{
m_video->hgr_update(screen, bitmap, cliprect, 0, 159);
- m_video->text_update_orig(screen, bitmap, cliprect, 160, 191);
+ if (!strcmp(machine().system().name, "ivelultr"))
+ {
+ m_video->text_update_ultr(screen, bitmap, cliprect, 160, 191);
+ }
+ else
+ {
+ m_video->text_update_orig(screen, bitmap, cliprect, 160, 191);
+ }
}
else
{
@@ -389,7 +396,14 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
if (m_video->m_mix)
{
m_video->lores_update(screen, bitmap, cliprect, 0, 159);
- m_video->text_update_orig(screen, bitmap, cliprect, 160, 191);
+ if (!strcmp(machine().system().name, "ivelultr"))
+ {
+ m_video->text_update_ultr(screen, bitmap, cliprect, 160, 191);
+ }
+ else
+ {
+ m_video->text_update_orig(screen, bitmap, cliprect, 160, 191);
+ }
}
else
{
@@ -399,7 +413,14 @@ UINT32 napple2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
}
else
{
- m_video->text_update_orig(screen, bitmap, cliprect, 0, 191);
+ if (!strcmp(machine().system().name, "ivelultr"))
+ {
+ m_video->text_update_ultr(screen, bitmap, cliprect, 0, 191);
+ }
+ else
+ {
+ m_video->text_update_orig(screen, bitmap, cliprect, 0, 191);
+ }
}
return 0;
diff --git a/src/mess/drivers/apple2e.c b/src/mess/drivers/apple2e.c
index 2db5b7d9939..617c96c3b23 100644
--- a/src/mess/drivers/apple2e.c
+++ b/src/mess/drivers/apple2e.c
@@ -610,8 +610,11 @@ void apple2e_state::machine_start()
if (m_a2eauxslot)
{
m_auxslotdevice = m_a2eauxslot->get_a2eauxslot_card();
- m_aux_ptr = m_auxslotdevice->get_vram_ptr();
- m_aux_bank_ptr = m_auxslotdevice->get_auxbank_ptr();
+ if (m_auxslotdevice)
+ {
+ m_aux_ptr = m_auxslotdevice->get_vram_ptr();
+ m_aux_bank_ptr = m_auxslotdevice->get_auxbank_ptr();
+ }
}
else // IIc has 128K right on the motherboard
{
@@ -822,7 +825,7 @@ UINT32 apple2e_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
}
// always update the flash timer here so it's smooth regardless of mode switches
- m_video->m_flash = ((machine().time() * 4).seconds & 1) ? true : false;
+ m_video->m_flash = ((machine().time() * 4).seconds() & 1) ? true : false;
if (m_video->m_graphics)
{
diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c
index 752a9b8af2c..2b5097470ee 100644
--- a/src/mess/drivers/applix.c
+++ b/src/mess/drivers/applix.c
@@ -886,7 +886,9 @@ static MACHINE_CONFIG_START( applix, applix_state )
MCFG_WD1772_ADD("fdc", XTAL_16MHz / 2) //connected to Z80H clock pin
MCFG_FLOPPY_DRIVE_ADD("fdc:0", applix_floppies, "35dd", applix_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", applix_floppies, "35dd", applix_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_TIMER_DRIVER_ADD_PERIODIC("applix_c", applix_state, cass_timer, attotime::from_hz(100000))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/aussiebyte.c b/src/mess/drivers/aussiebyte.c
index 97414c4ae41..4980be8204d 100644
--- a/src/mess/drivers/aussiebyte.c
+++ b/src/mess/drivers/aussiebyte.c
@@ -513,14 +513,16 @@ static MACHINE_CONFIG_START( aussiebyte, aussiebyte_state )
MCFG_Z80DART_OUT_DTRA_CB(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
MCFG_Z80DART_OUT_RTSA_CB(DEVWRITELINE("rs232", rs232_port_device, write_rts))
- MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal")
+ MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "keyboard")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("sio2", z80sio0_device, rxa_w))
MCFG_WD2797_ADD("fdc", XTAL_16MHz / 16)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(aussiebyte_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(aussiebyte_state, fdc_drq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", aussiebyte_floppies, "drive0", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", aussiebyte_floppies, "drive1", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
/* devices */
MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_16MHz / 8)
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index 9ae7e3372ab..abe3f7bde8b 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -963,11 +963,11 @@ READ8_MEMBER( c128_state::cia1_pa_r )
bit description
- PA0 COL0, JOY B0
- PA1 COL1, JOY B1
- PA2 COL2, JOY B2
- PA3 COL3, JOY B3
- PA4 COL4, BTNB
+ PA0 COL0, JOYB0
+ PA1 COL1, JOYB1
+ PA2 COL2, JOYB2
+ PA3 COL3, JOYB3
+ PA4 COL4, FBTNB
PA5 COL5
PA6 COL6
PA7 COL7
@@ -1005,20 +1005,40 @@ READ8_MEMBER( c128_state::cia1_pa_r )
return data;
}
+WRITE8_MEMBER( c128_state::cia1_pa_w )
+{
+ /*
+
+ bit description
+
+ PA0 COL0, JOYB0
+ PA1 COL1, JOYB1
+ PA2 COL2, JOYB2
+ PA3 COL3, JOYB3
+ PA4 COL4, FBTNB
+ PA5 COL5
+ PA6 COL6
+ PA7 COL7
+
+ */
+
+ m_joy2->joy_w(data & 0x1f);
+}
+
READ8_MEMBER( c128_state::cia1_pb_r )
{
/*
bit description
- PB0 JOY A0
- PB1 JOY A1
- PB2 JOY A2
- PB3 JOY A3
- PB4 BTNA/_LP
- PB5
- PB6
- PB7
+ PB0 ROW0, JOYA0
+ PB1 ROW1, JOYA1
+ PB2 ROW2, JOYA2
+ PB3 ROW3, JOYA3
+ PB4 ROW4, FBTNA, _LP
+ PB5 ROW5
+ PB6 ROW6
+ PB7 ROW7
*/
@@ -1055,17 +1075,19 @@ WRITE8_MEMBER( c128_state::cia1_pb_w )
bit description
- PB0 ROW0
- PB1 ROW1
- PB2 ROW2
- PB3 ROW3
- PB4 ROW4
+ PB0 ROW0, JOYA0
+ PB1 ROW1, JOYA1
+ PB2 ROW2, JOYA2
+ PB3 ROW3, JOYA3
+ PB4 ROW4, FBTNA, _LP
PB5 ROW5
PB6 ROW6
PB7 ROW7
*/
+ m_joy1->joy_w(data & 0x1f);
+
m_vic->lp_w(BIT(data, 4));
}
@@ -1487,6 +1509,7 @@ static MACHINE_CONFIG_START( ntsc, c128_state )
MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c128_state, cia1_cnt_w))
MCFG_MOS6526_SP_CALLBACK(WRITELINE(c128_state, cia1_sp_w))
MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c128_state, cia1_pa_r))
+ MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c128_state, cia1_pa_w))
MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c128_state, cia1_pb_r))
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c128_state, cia1_pb_w))
MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_14_31818MHz*2/3.5/8)
@@ -1659,6 +1682,7 @@ static MACHINE_CONFIG_START( pal, c128_state )
MCFG_MOS6526_CNT_CALLBACK(WRITELINE(c128_state, cia1_cnt_w))
MCFG_MOS6526_SP_CALLBACK(WRITELINE(c128_state, cia1_sp_w))
MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c128_state, cia1_pa_r))
+ MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c128_state, cia1_pa_w))
MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c128_state, cia1_pb_r))
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c128_state, cia1_pb_w))
MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_17_734472MHz*2/4.5/8)
diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c
index b65ae1a072a..56aaf5966da 100644
--- a/src/mess/drivers/c64.c
+++ b/src/mess/drivers/c64.c
@@ -625,20 +625,40 @@ READ8_MEMBER( c64_state::cia1_pa_r )
return data;
}
+WRITE8_MEMBER( c64_state::cia1_pa_w )
+{
+ /*
+
+ bit description
+
+ PA0 COL0, JOY B0
+ PA1 COL1, JOY B1
+ PA2 COL2, JOY B2
+ PA3 COL3, JOY B3
+ PA4 COL4, BTNB
+ PA5 COL5
+ PA6 COL6
+ PA7 COL7
+
+ */
+
+ m_joy2->joy_w(data & 0x1f);
+}
+
READ8_MEMBER( c64_state::cia1_pb_r )
{
/*
bit description
- PB0 JOY A0
- PB1 JOY A1
- PB2 JOY A2
- PB3 JOY A3
- PB4 BTNA/_LP
- PB5
- PB6
- PB7
+ PB0 ROW0, JOY A0
+ PB1 ROW1, JOY A1
+ PB2 ROW2, JOY A2
+ PB3 ROW3, JOY A3
+ PB4 ROW4, BTNA, _LP
+ PB5 ROW5
+ PB6 ROW6
+ PB7 ROW7
*/
@@ -671,17 +691,19 @@ WRITE8_MEMBER( c64_state::cia1_pb_w )
bit description
- PB0 ROW0
- PB1 ROW1
- PB2 ROW2
- PB3 ROW3
- PB4 ROW4
+ PB0 ROW0, JOY A0
+ PB1 ROW1, JOY A1
+ PB2 ROW2, JOY A2
+ PB3 ROW3, JOY A3
+ PB4 ROW4, BTNA, _LP
PB5 ROW5
PB6 ROW6
PB7 ROW7
*/
+ m_joy1->joy_w(data & 0x1f);
+
m_vic->lp_w(BIT(data, 4));
}
@@ -1289,6 +1311,7 @@ static MACHINE_CONFIG_START( pal, c64_state )
MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4))
MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5))
MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64_state, cia1_pa_r))
+ MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pa_w))
MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64_state, cia1_pb_r))
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pb_w))
MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_17_734472MHz/18)
@@ -1423,6 +1446,7 @@ static MACHINE_CONFIG_START( pal_gs, c64gs_state )
MCFG_MOS6526_CNT_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_4))
MCFG_MOS6526_SP_CALLBACK(DEVWRITELINE(PET_USER_PORT_TAG, pet_user_port_device, write_5))
MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c64gs_state, cia1_pa_r))
+ MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pa_w))
MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c64gs_state, cia1_pb_r))
MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c64_state, cia1_pb_w))
MCFG_DEVICE_ADD(MOS6526_2_TAG, MOS6526, XTAL_17_734472MHz/18)
diff --git a/src/mess/drivers/ccs2810.c b/src/mess/drivers/ccs2810.c
index 12e189e0d04..5a38e72d9d6 100644
--- a/src/mess/drivers/ccs2810.c
+++ b/src/mess/drivers/ccs2810.c
@@ -356,6 +356,7 @@ static MACHINE_CONFIG_START( ccs2422, ccs_state )
/* Devices */
MCFG_MB8877_ADD("fdc", XTAL_16MHz / 8) // UB1793 or MB8877
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ccs_floppies, "8sssd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/excali64.c b/src/mess/drivers/excali64.c
index b68d0e1f67e..3e4664ca913 100644
--- a/src/mess/drivers/excali64.c
+++ b/src/mess/drivers/excali64.c
@@ -595,7 +595,9 @@ static MACHINE_CONFIG_START( excali64, excali64_state )
MCFG_WD2793_ADD("fdc", XTAL_16MHz / 16)
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", excali64_floppies, "drive0", excali64_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", excali64_floppies, "drive1", excali64_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_16MHz/4)
MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(excali64_state, busreq_w))
diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c
index 60ffed0d525..08fc5a6e04f 100644
--- a/src/mess/drivers/gba.c
+++ b/src/mess/drivers/gba.c
@@ -34,7 +34,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, c
}
}
-#define GBA_ATTOTIME_NORMALIZE(a) do { while ((a).attoseconds >= ATTOSECONDS_PER_SECOND) { (a).seconds++; (a).attoseconds -= ATTOSECONDS_PER_SECOND; } } while (0)
+#define GBA_ATTOTIME_NORMALIZE(a) a.normalize()
static const UINT32 timer_clks[4] = { 16777216, 16777216/64, 16777216/256, 16777216/1024 };
diff --git a/src/mess/drivers/geneve.c b/src/mess/drivers/geneve.c
index 8ec248d5fae..af87a338470 100644
--- a/src/mess/drivers/geneve.c
+++ b/src/mess/drivers/geneve.c
@@ -215,9 +215,9 @@
#include "bus/ti99_peb/peribox.h"
-
-#define VERBOSE 1
-#define LOG logerror
+#define TRACE_READY 0
+#define TRACE_LINES 0
+#define TRACE_CRU 0
#define SRAM_SIZE 384*1024 // maximum SRAM expansion on-board
#define DRAM_SIZE 512*1024
@@ -318,9 +318,11 @@ static INPUT_PORTS_START(geneve)
PORT_CONFSETTING( GENMOD, "GenMod" )
PORT_START( "BOOTROM" )
- PORT_CONFNAME( 0x01, GENEVE_098, "Boot ROM" ) PORT_CONDITION( "MODE", 0x01, EQUALS, 0x00 )
+ PORT_CONFNAME( 0x03, GENEVE_098, "Boot ROM" ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, settings_changed, 3)
PORT_CONFSETTING( GENEVE_098, "Version 0.98" )
PORT_CONFSETTING( GENEVE_100, "Version 1.00" )
+ PORT_CONFSETTING( GENEVE_PFM512, "PFM 512" )
+ PORT_CONFSETTING( GENEVE_PFM512A, "PFM 512A" )
PORT_START( "SRAM" )
PORT_CONFNAME( 0x03, 0x01, "Onboard SRAM" ) PORT_CONDITION( "MODE", 0x01, EQUALS, 0x00 )
@@ -329,10 +331,10 @@ static INPUT_PORTS_START(geneve)
PORT_CONFSETTING( 0x02, "384 KiB" )
PORT_START( "GENMODDIPS" )
- PORT_DIPNAME( GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CONDITION( "MODE", 0x01, EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, gm_changed, 1)
+ PORT_DIPNAME( GM_TURBO, 0x00, "Genmod Turbo mode") PORT_CONDITION( "MODE", 0x01, EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, settings_changed, 1)
PORT_CONFSETTING( 0x00, DEF_STR( Off ))
PORT_CONFSETTING( GM_TURBO, DEF_STR( On ))
- PORT_DIPNAME( GM_TIM, GM_TIM, "Genmod TI mode") PORT_CONDITION( "MODE", 0x01, EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, gm_changed, 2)
+ PORT_DIPNAME( GM_TIM, GM_TIM, "Genmod TI mode") PORT_CONDITION( "MODE", 0x01, EQUALS, GENMOD ) PORT_CHANGED_MEMBER(GMAPPER_TAG, geneve_mapper_device, settings_changed, 2)
PORT_CONFSETTING( 0x00, DEF_STR( Off ))
PORT_CONFSETTING( GM_TIM, DEF_STR( On ))
@@ -354,7 +356,7 @@ WRITE8_MEMBER ( geneve_state::cruwrite )
if ((addroff & 0xffc0) == CRU_SSTEP_BASE)
{
int bit = (addroff & 0x003e)>>1;
- if (VERBOSE>0) LOG("geneve: Single step not implemented; bit %d set to %d\n", bit, data);
+ logerror("geneve: Single step not implemented; bit %d set to %d\n", bit, data);
return;
}
@@ -365,47 +367,47 @@ WRITE8_MEMBER ( geneve_state::cruwrite )
{
case 5:
// No one really cares...
- if (VERBOSE>8) LOG("geneve: Set PAL flag = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Set PAL flag = %02x\n", data);
// m_palvideo = (data!=0);
break;
case 7:
// m_capslock = (data!=0);
- if (VERBOSE>8) LOG("geneve: Set capslock flag = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Set capslock flag = %02x\n", data);
break;
case 8:
- if (VERBOSE>8) LOG("geneve: Set keyboard clock flag = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Set keyboard clock flag = %02x\n", data);
m_keyboard->clock_control((data!=0)? ASSERT_LINE : CLEAR_LINE);
break;
case 9:
- if (VERBOSE>8) LOG("geneve: Set keyboard scan flag = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Set keyboard scan flag = %02x\n", data);
m_keyboard->send_scancodes((data!=0)? ASSERT_LINE : CLEAR_LINE);
break;
case 10:
- if (VERBOSE>8) LOG("geneve: Geneve mode = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Geneve mode = %02x\n", data);
m_mapper->set_geneve_mode(data!=0);
break;
case 11:
- if (VERBOSE>8) LOG("geneve: Direct mode = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Direct mode = %02x\n", data);
m_mapper->set_direct_mode(data!=0);
break;
case 12:
- if (VERBOSE>8) LOG("geneve: Cartridge size 8K = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Cartridge size 8K = %02x\n", data);
m_mapper->set_cartridge_size((data!=0)? 0x2000 : 0x4000);
break;
case 13:
- if (VERBOSE>8) LOG("geneve: Cartridge writable 6000 = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Cartridge writable 6000 = %02x\n", data);
m_mapper->set_cartridge_writable(0x6000, (data!=0));
break;
case 14:
- if (VERBOSE>8) LOG("geneve: Cartridge writable 7000 = %02x\n", data);
+ if (TRACE_CRU) logerror("geneve: Cartridge writable 7000 = %02x\n", data);
m_mapper->set_cartridge_writable(0x7000, (data!=0));
break;
case 15:
- if (VERBOSE>8) LOG("geneve: Extra wait states = %02x\n", data==0);
+ if (TRACE_CRU) logerror("geneve: Extra wait states = %02x\n", data==0);
m_mapper->set_extra_waitstates(data==0); // let's use the inverse semantics
break;
default:
- if (VERBOSE>0) LOG("geneve: set CRU address %04x=%02x ignored\n", addroff, data);
+ logerror("geneve: set CRU address %04x=%02x ignored\n", addroff, data);
break;
}
}
@@ -425,7 +427,7 @@ READ8_MEMBER( geneve_state::cruread )
if ((addroff & 0xffc0) == CRU_SSTEP_BASE)
{
int bit = (addroff & 0x003e)>>1;
- if (VERBOSE>0) LOG("geneve: Single step not implemented; attempting to read bit %d\n", bit);
+ logerror("geneve: Single step not implemented; attempting to read bit %d\n", bit);
return value;
}
@@ -477,7 +479,7 @@ READ8_MEMBER( geneve_state::read_by_9901 )
if (m_intb==CLEAR_LINE) answer |= 0x10;
if (m_video_wait==ASSERT_LINE) answer |= 0x20;
// TODO: PAL pin 5
- if (VERBOSE>8) LOG("geneve: INT15-8 = %02x\n", answer);
+ if (TRACE_LINES) logerror("geneve: INT15-8 = %02x\n", answer);
break;
case TMS9901_P0_P7:
@@ -505,7 +507,7 @@ READ8_MEMBER( geneve_state::read_by_9901 )
*/
WRITE_LINE_MEMBER( geneve_state::peripheral_bus_reset )
{
- if (VERBOSE>0) LOG("geneve: peripheral bus reset request; not implemented yet.\n");
+ logerror("geneve: Peripheral bus reset request; not implemented yet.\n");
}
/*
@@ -513,7 +515,7 @@ WRITE_LINE_MEMBER( geneve_state::peripheral_bus_reset )
*/
WRITE_LINE_MEMBER( geneve_state::VDP_reset )
{
- if (VERBOSE>0) LOG("geneve: Video reset request; not implemented yet.\n");
+ logerror("geneve: Video reset request; not implemented yet.\n");
}
/*
@@ -529,7 +531,7 @@ WRITE_LINE_MEMBER( geneve_state::joystick_select )
*/
WRITE_LINE_MEMBER( geneve_state::extbus_wait_states )
{
- if (VERBOSE>0) LOG("geneve: external bus wait states set to %d, not implemented yet.\n", state);
+ logerror("geneve: External bus wait states set to %d, not implemented yet.\n", state);
}
/*
@@ -538,7 +540,7 @@ WRITE_LINE_MEMBER( geneve_state::extbus_wait_states )
*/
WRITE_LINE_MEMBER( geneve_state::video_wait_states )
{
- if (VERBOSE>1) LOG("geneve: video wait states set to %d\n", state);
+ if (TRACE_LINES) logerror("geneve: Video wait states set to %d\n", state);
m_mapper->set_video_waitstates(state==ASSERT_LINE);
m_video_wait = (state!=0)? ASSERT_LINE : CLEAR_LINE;
}
@@ -555,39 +557,6 @@ WRITE8_MEMBER( geneve_state::tms9901_interrupt )
m_cpu->set_input_line(INT_9995_INT1, data);
}
-/*
-// tms9901 setup
-const tms9901_interface tms9901_wiring_geneve =
-{
- TMS9901_INT1 | TMS9901_INT2 | TMS9901_INT8 | TMS9901_INTB | TMS9901_INTC,
-
- // read handler
- DEVCB_DRIVER_MEMBER(geneve_state, read_by_9901),
-
- { // write handlers
- DEVCB_DRIVER_LINE_MEMBER(geneve_state, peripheral_bus_reset),
- DEVCB_DRIVER_LINE_MEMBER(geneve_state, VDP_reset),
- DEVCB_DRIVER_LINE_MEMBER(geneve_state, joystick_select),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_DEVICE_LINE_MEMBER(GKEYBOARD_TAG, geneve_keyboard_device, reset_line),
- DEVCB_DRIVER_LINE_MEMBER(geneve_state, extbus_wait_states),
- DEVCB_NULL,
- DEVCB_DRIVER_LINE_MEMBER(geneve_state, video_wait_states),
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL
- },
-
- // interrupt handler
- DEVCB_DRIVER_MEMBER(geneve_state, tms9901_interrupt)
-};
-*/
-
/*******************************************************************
Signal lines
*******************************************************************/
@@ -613,14 +582,14 @@ WRITE_LINE_MEMBER( geneve_state::intb )
WRITE_LINE_MEMBER( geneve_state::ext_ready )
{
- if (VERBOSE>6) LOG("geneve: READY level (ext) = %02x\n", state);
+ if (TRACE_READY) logerror("geneve: READY level (ext) = %02x\n", state);
m_ready_line = state;
m_cpu->set_ready((m_ready_line == ASSERT_LINE && m_ready_line1 == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE);
}
WRITE_LINE_MEMBER( geneve_state::mapper_ready )
{
- if (VERBOSE>6) LOG("geneve: READY level (mapper) = %02x\n", state);
+ if (TRACE_READY) logerror("geneve: READY level (mapper) = %02x\n", state);
m_ready_line1 = state;
m_cpu->set_ready((m_ready_line == ASSERT_LINE && m_ready_line1 == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE);
}
@@ -667,8 +636,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(geneve_state::geneve_hblank_interrupt)
WRITE8_MEMBER( geneve_state::external_operation )
{
static const char* extop[8] = { "inv1", "inv2", "IDLE", "RSET", "inv3", "CKON", "CKOF", "LREX" };
- if (VERBOSE>1)
- if (offset != IDLE_OP) LOG("geneve: External operation %s not implemented on Geneve board\n", extop[offset]);
+ if (offset != IDLE_OP) logerror("geneve: External operation %s not implemented on Geneve board\n", extop[offset]);
}
/*
@@ -739,9 +707,12 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state )
MCFG_TMS9901_P0_HANDLER( WRITELINE( geneve_state, peripheral_bus_reset) )
MCFG_TMS9901_P1_HANDLER( WRITELINE( geneve_state, VDP_reset) )
MCFG_TMS9901_P2_HANDLER( WRITELINE( geneve_state, joystick_select) )
+ MCFG_TMS9901_P4_HANDLER( DEVWRITELINE( GMAPPER_TAG, geneve_mapper_device, pfm_select_lsb) ) // new for PFM
+ MCFG_TMS9901_P5_HANDLER( DEVWRITELINE( GMAPPER_TAG, geneve_mapper_device, pfm_output_enable) ) // new for PFM
MCFG_TMS9901_P6_HANDLER( DEVWRITELINE( GKEYBOARD_TAG, geneve_keyboard_device, reset_line) )
MCFG_TMS9901_P7_HANDLER( WRITELINE( geneve_state, extbus_wait_states) )
MCFG_TMS9901_P9_HANDLER( WRITELINE( geneve_state, video_wait_states) )
+ MCFG_TMS9901_P13_HANDLER( DEVWRITELINE( GMAPPER_TAG, geneve_mapper_device, pfm_select_msb) ) // new for PFM
MCFG_TMS9901_INTLEVEL_HANDLER( WRITE8( geneve_state, tms9901_interrupt) )
// Mapper
@@ -769,6 +740,10 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state )
MCFG_GENEVE_MOUSE_ADD( GMOUSE_TAG )
MCFG_GENEVE_JOYPORT_ADD( JOYPORT_TAG )
+ // PFM expansion
+ MCFG_AT29C040_ADD( PFM512_TAG )
+ MCFG_AT29C040A_ADD( PFM512A_TAG )
+
MACHINE_CONFIG_END
/*
diff --git a/src/mess/drivers/hh_cop400.c b/src/mess/drivers/hh_cop400.c
index c8d7852ebf2..3400b2d9ab5 100644
--- a/src/mess/drivers/hh_cop400.c
+++ b/src/mess/drivers/hh_cop400.c
@@ -284,7 +284,7 @@ MACHINE_CONFIG_END
The first version was on TMS1100 (see hh_tms1k.c), this is the reprogrammed
second release with a gray case instead of black.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
diff --git a/src/mess/drivers/hh_hmcs40.c b/src/mess/drivers/hh_hmcs40.c
index 21b1b182d2b..182324e86ec 100644
--- a/src/mess/drivers/hh_hmcs40.c
+++ b/src/mess/drivers/hh_hmcs40.c
@@ -334,7 +334,7 @@ INPUT_CHANGED_MEMBER(hh_hmcs40_state::single_interrupt_line)
* Hitachi HD38750A08 MCU
* green VFD display Emix-106, with bezel overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -446,7 +446,7 @@ MACHINE_CONFIG_END
* Hitachi HD38750A07 MCU
* cyan VFD display Emix-103, with blue or green color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -582,7 +582,7 @@ MACHINE_CONFIG_END
* Hitachi HD38800A77 MCU
* cyan/red/green VFD display Futaba DM-43ZK 2E
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -712,7 +712,7 @@ MACHINE_CONFIG_END
- USA/Canada: Hungry Monster, published by Tandy
- other: Gobble Man/Ogre Monster, published by Tandy
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -823,7 +823,7 @@ MACHINE_CONFIG_END
- Japan: ?
- USA: Star Hawk, published by Mattel
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -951,7 +951,7 @@ MACHINE_CONFIG_END
* cyan/red/blue VFD display NEC FIP11BM24T no. 4-8, half of it reflected
with a one-way mirror to give the illusion of a 3D display
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1071,7 +1071,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A49 MCU
* cyan/red/yellow VFD display Futaba DM-53Z 3E, with color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1190,7 +1190,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A63 MCU
* cyan/red/blue VFD display Futaba DM-68ZK 3D DM-63
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1318,7 +1318,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A65 MCU
* cyan/red/green VFD display NEC FIP6AM25T no. 21-21
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1442,7 +1442,7 @@ MACHINE_CONFIG_END
* Hitachi HD38800B43 MCU
* cyan/red/blue VFD display Futaba DM-71
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1540,7 +1540,7 @@ MACHINE_CONFIG_END
* Hitachi HD38800B52 MCU
* cyan/red/blue VFD display NEC FIP8BM25T no. 21-8 2
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1630,7 +1630,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A85 MCU
* cyan/red/green VFD display NEC FIP5CM33T no. 4 21
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1876,7 +1876,7 @@ MACHINE_CONFIG_END
It looks like Coleco took Gakken's Heiankyo Alien and turned it into a more
action-oriented game.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1987,7 +1987,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A45 MCU
* cyan/red VFD display Futaba DM-47ZK 2K, with color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2121,7 +2121,7 @@ MACHINE_CONFIG_END
- P2 Left: Head-to-Head Galaxian (2-player mode, short)
- P2 Right: Head-to-Head Galaxian (2-player mode, long)
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2254,7 +2254,7 @@ MACHINE_CONFIG_END
BTANB note: 1st version doesn't show the whole maze on power-on
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2370,7 +2370,7 @@ MACHINE_CONFIG_END
BTANB note: in demo-mode, she hardly ever walks to the upper two rows
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2479,7 +2479,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A13 MCU
* cyan/red/green VFD display Futaba DM-20
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2603,7 +2603,7 @@ MACHINE_CONFIG_END
2 VFD revisions are known, the difference is Pac-Man's color: cyan or red.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
#if 0
@@ -2661,7 +2661,7 @@ INPUT_PORTS_END
* COP411L sub MCU, labeled COP411L-KED/N
* cyan/red/green VFD display NEC FIP15BM32T
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2854,7 +2854,7 @@ MACHINE_CONFIG_END
* COP411L sub MCU, labeled ~/B8236 COP411L-KEC/N
* cyan/red/green VFD display NEC FIP15AM32T (EL628-003) no. 2-421, with partial color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2964,7 +2964,7 @@ MACHINE_CONFIG_END
- Japan: Heiankyo Alien
- USA: Earth Invaders, published by CGL
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3080,7 +3080,7 @@ MACHINE_CONFIG_END
- Japan: Crazy Kong
- USA: Super Kong, published by CGL
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3203,7 +3203,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A69 MCU
* cyan/red/green VFD display Futaba DM-69Z 3F, with color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3328,7 +3328,7 @@ MACHINE_CONFIG_END
turn the game on while holding the 1-key and use the visitor's side keypad
to play offsense.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3486,7 +3486,7 @@ MACHINE_CONFIG_END
* Hitachi QFP HD38820A70 MCU
* cyan/red/green/darkgreen VFD display Itron CP5137
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3574,7 +3574,7 @@ MACHINE_CONFIG_END
* Hitachi HD38800B23 MCU
* cyan/red/blue VFD display Futaba DM-65ZK 3A
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3695,7 +3695,7 @@ MACHINE_CONFIG_END
* Hitachi HD38800A88 MCU
* cyan/red/green VFD display NEC FIP10AM24T no. 2-8 1
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -3820,7 +3820,7 @@ MACHINE_CONFIG_END
- UK: Cosmic Invader, published by Grandstand
- UK: Galactic Invaders, published by Prinztronic
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
diff --git a/src/mess/drivers/hh_melps4.c b/src/mess/drivers/hh_melps4.c
index f5d5dda8be6..92e4bd09228 100644
--- a/src/mess/drivers/hh_melps4.c
+++ b/src/mess/drivers/hh_melps4.c
@@ -224,7 +224,7 @@ INPUT_CHANGED_MEMBER(hh_melps4_state::reset_button)
* Mitsubishi M58846-701P MCU
* cyan/red/green VFD display Itron CP5090GLR R1B, with partial color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -339,7 +339,7 @@ MACHINE_CONFIG_END
* Mitsubishi M58846-702P MCU
* cyan/red/green VFD display Itron CP5143GLR SGA, with light-yellow color overlay
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
diff --git a/src/mess/drivers/hh_tms1k.c b/src/mess/drivers/hh_tms1k.c
index adbc2595c0e..00b68d3bfdb 100644
--- a/src/mess/drivers/hh_tms1k.c
+++ b/src/mess/drivers/hh_tms1k.c
@@ -146,6 +146,8 @@ void hh_tms1k_state::machine_start()
m_inp_mux = 0;
m_power_led = false;
m_power_on = false;
+ m_grid = 0;
+ m_plate = 0;
// register for savestates
save_item(NAME(m_display_maxy));
@@ -162,6 +164,8 @@ void hh_tms1k_state::machine_start()
save_item(NAME(m_r));
save_item(NAME(m_inp_mux));
save_item(NAME(m_power_on));
+ save_item(NAME(m_grid));
+ save_item(NAME(m_plate));
}
void hh_tms1k_state::machine_reset()
@@ -1526,7 +1530,7 @@ MACHINE_CONFIG_END
TMS1100, the second more widespread release runs on a COP400. There are
also differences with the overlay mask.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1895,7 +1899,7 @@ MACHINE_CONFIG_END
8 = lamp42 18 = lamp73 28 = lamp84 38 = lamp82
9 = lamp43 19 = - 29 = lamp94 39 = lamp83
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
diff --git a/src/mess/drivers/hh_ucom4.c b/src/mess/drivers/hh_ucom4.c
index f0df7f66792..b6314b0feda 100644
--- a/src/mess/drivers/hh_ucom4.c
+++ b/src/mess/drivers/hh_ucom4.c
@@ -237,7 +237,7 @@ UINT8 hh_ucom4_state::read_inputs(int columns)
- Japan: "Missile Guerilla Warfare Maneuvers", published by Tomy
- World: UFO Master-Blaster Station
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -349,7 +349,7 @@ MACHINE_CONFIG_END
Then choose a formation(A,B,C) and either pass the ball, and/or start
running. For more information, refer to the official manual.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -489,7 +489,7 @@ MACHINE_CONFIG_END
player 1 presses one of the directional keys. In 2-player mode, player 2
controls the goalkeeper, defensive players are still controlled by the CPU.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -611,7 +611,7 @@ MACHINE_CONFIG_END
* NEC uCOM-44 MCU, labeled EMIX D552C 049
* cyan VFD display Emix-108
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -720,7 +720,7 @@ MACHINE_CONFIG_END
This is basically a revamp of their earlier Boxing game (ET-06), case and
buttons are exactly the same.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -873,7 +873,7 @@ MACHINE_CONFIG_END
- Japan: FL Crazy Climbing
- USA: Crazy Climber
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1094,7 +1094,7 @@ MACHINE_CONFIG_END
- USA: Invader From Space
- UK: Invader From Space, published by Grandstand
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1308,7 +1308,7 @@ MACHINE_CONFIG_END
- Japan: Astro Wars
- UK: Astro Wars, published by Grandstand
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1410,7 +1410,7 @@ MACHINE_CONFIG_END
- USA: Astro Command, published by Tandy
- UK: Scramble, published by Grandstand
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1519,7 +1519,7 @@ MACHINE_CONFIG_END
- USA: Dracula, red case
- Other: Dracula, yellow case, published by Hales
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1720,7 +1720,7 @@ MACHINE_CONFIG_END
- USA: Cosmic Combat
- Japan: Space Attack
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1819,7 +1819,7 @@ MACHINE_CONFIG_END
Press the Serve button to start, then hit the ball by pressing one of the
positional buttons when the ball flies over it.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -1981,7 +1981,7 @@ MACHINE_CONFIG_END
The game will start automatically after turning it on. This Pac Man refuses
to eat dots with his butt, you can only eat them going right-to-left.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2085,7 +2085,7 @@ MACHINE_CONFIG_END
- UK: Astro Blaster, published by Hales (Epoch Astro Command was named Scramble)
- Germany: Rambler
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2186,7 +2186,7 @@ MACHINE_CONFIG_END
- USA: Caveman, published by Tandy
- UK: Cave Man - Jr. Caveman vs Dinosaur, published by Grandstand
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
@@ -2285,7 +2285,7 @@ MACHINE_CONFIG_END
To start the game, simply press [UP]. Hold a joystick direction to move around.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
***************************************************************************/
diff --git a/src/mess/drivers/hp64k.c b/src/mess/drivers/hp64k.c
index 3c33333804e..1467aac1c91 100644
--- a/src/mess/drivers/hp64k.c
+++ b/src/mess/drivers/hp64k.c
@@ -60,7 +60,7 @@
// simple rectangular envelope.
//
//*U20 HP "PHI" Custom HP-IB interface microcontroller
-//*U28 i8251 RS232 UART
+// U28 i8251 RS232 UART
//
// **********
// Display card (64100-66530)
@@ -148,8 +148,6 @@
//
// ICs that are not emulated yet are marked with "*"
//
-// TODO:
-// - RS232 I/F
#include "emu.h"
#include "cpu/hphybrid/hphybrid.h"
@@ -158,6 +156,9 @@
#include "machine/74123.h"
#include "machine/rescap.h"
#include "sound/beep.h"
+#include "machine/clock.h"
+#include "machine/i8251.h"
+#include "bus/rs232/rs232.h"
#define BIT_MASK(n) (1U << (n))
@@ -165,6 +166,8 @@
#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n))
#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
+#define BAUD_RATE_GEN_CLOCK 5068800
+
class hp64k_state : public driver_device
{
public:
@@ -212,9 +215,22 @@ public:
void hp64k_floppy_wpt_cb(floppy_image_device *floppy , int state);
DECLARE_READ16_MEMBER(hp64k_usart_r);
-
+ DECLARE_WRITE16_MEMBER(hp64k_usart_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_rxrdy_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_txrdy_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_txd_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_dtr_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_rts_w);
+ DECLARE_WRITE16_MEMBER(hp64k_loopback_w);
+ void hp64k_update_loopback(void);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_rxd_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_dcd_w);
+ DECLARE_WRITE_LINE_MEMBER(hp64k_rs232_cts_w);
+
DECLARE_WRITE16_MEMBER(hp64k_beep_w);
TIMER_DEVICE_CALLBACK_MEMBER(hp64k_beeper_off);
+
+ DECLARE_WRITE_LINE_MEMBER(hp64k_baud_clk_w);
private:
required_device<hp_5061_3011_cpu_device> m_cpu;
required_device<i8275_device> m_crtc;
@@ -232,6 +248,10 @@ private:
required_ioport m_rs232_sw;
required_device<beep_device> m_beeper;
required_device<timer_device> m_beep_timer;
+ required_device<clock_device> m_baud_rate;
+ required_ioport m_s5_sw;
+ required_device<i8251_device> m_uart;
+ required_device<rs232_port_device> m_rs232;
// Character generator
const UINT8 *m_chargen;
@@ -281,6 +301,15 @@ private:
floppy_state_t m_floppy_if_state;
floppy_image_device *m_current_floppy;
+
+ // RS232 I/F
+ bool m_16x_clk;
+ bool m_baud_clk;
+ UINT8 m_16x_div;
+ bool m_loopback;
+ bool m_txd_state;
+ bool m_dtr_state;
+ bool m_rts_state;
};
static ADDRESS_MAP_START(cpu_mem_map , AS_PROGRAM , 16 , hp64k_state)
@@ -300,12 +329,15 @@ static ADDRESS_MAP_START(cpu_io_map , AS_IO , 16 , hp64k_state)
// PA = 4, IC = [0..3]
// Floppy I/F
AM_RANGE(HP_MAKE_IOADDR(4 , 0) , HP_MAKE_IOADDR(4 , 3)) AM_READWRITE(hp64k_flp_r , hp64k_flp_w)
+ // PA = 5, IC = [0..3]
+ // Write to USART
+ AM_RANGE(HP_MAKE_IOADDR(5 , 0) , HP_MAKE_IOADDR(5 , 3)) AM_WRITE(hp64k_usart_w)
// PA = 6, IC = [0..3]
// Read from USART
AM_RANGE(HP_MAKE_IOADDR(6 , 0) , HP_MAKE_IOADDR(6 , 3)) AM_READ(hp64k_usart_r)
// PA = 7, IC = 2
- // Rear-panel switches
- AM_RANGE(HP_MAKE_IOADDR(7 , 2) , HP_MAKE_IOADDR(7 , 2)) AM_READ(hp64k_rear_sw_r)
+ // Rear-panel switches and loopback relay control
+ AM_RANGE(HP_MAKE_IOADDR(7 , 2) , HP_MAKE_IOADDR(7 , 2)) AM_READWRITE(hp64k_rear_sw_r , hp64k_loopback_w)
// PA = 9, IC = [0..3]
// Beeper control & interrupt status read
AM_RANGE(HP_MAKE_IOADDR(9 , 0) , HP_MAKE_IOADDR(9 , 3)) AM_WRITE(hp64k_beep_w)
@@ -334,7 +366,11 @@ hp64k_state::hp64k_state(const machine_config &mconfig, device_type type, const
m_rear_panel_sw(*this , "rear_sw"),
m_rs232_sw(*this , "rs232_sw"),
m_beeper(*this , "beeper"),
- m_beep_timer(*this , "beep_timer")
+ m_beep_timer(*this , "beep_timer"),
+ m_baud_rate(*this , "baud_rate"),
+ m_s5_sw(*this , "s5_sw"),
+ m_uart(*this , "uart"),
+ m_rs232(*this , "rs232")
{
}
@@ -349,6 +385,26 @@ void hp64k_state::video_start()
m_chargen = memregion("chargen")->base();
}
+// Divisors of K1135 baud rate generator
+static unsigned baud_rate_divisors[] = {
+ 6336,
+ 4224,
+ 2880,
+ 2355,
+ 2112,
+ 1056,
+ 528,
+ 264,
+ 176,
+ 158,
+ 132,
+ 88,
+ 66,
+ 44,
+ 33,
+ 16
+};
+
void hp64k_state::machine_reset()
{
m_crtc_drq = false;
@@ -372,6 +428,13 @@ void hp64k_state::machine_reset()
m_floppy0_wpt = false;
m_floppy1_wpt = false;
m_beeper->set_state(0);
+ m_baud_rate->set_unscaled_clock(BAUD_RATE_GEN_CLOCK / baud_rate_divisors[ (m_s5_sw->read() >> 1) & 0xf ]);
+ m_16x_clk = (m_rs232_sw->read() & 0x02) != 0;
+ m_loopback = false;
+ m_txd_state = true;
+ m_dtr_state = true;
+ m_rts_state = true;
+
}
UINT8 hp64k_state::hp64k_crtc_filter(UINT8 data)
@@ -895,9 +958,125 @@ void hp64k_state::hp64k_floppy_wpt_cb(floppy_image_device *floppy , int state)
READ16_MEMBER(hp64k_state::hp64k_usart_r)
{
- // todo
+ UINT16 tmp;
+
+ if ((offset & 1) == 0) {
+ tmp = m_uart->status_r(space , 0);
+ } else {
+ tmp = m_uart->data_r(space , 0);
+ }
+
// bit 8 == bit 7 rear panel switches (modem/terminal) ???
- return m_rs232_sw->read() << 8;
+
+ tmp |= (m_rs232_sw->read() << 8);
+
+ if (BIT(m_rear_panel_sw->read() , 7)) {
+ BIT_SET(tmp , 8);
+ }
+
+ return tmp;
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_usart_w)
+{
+ if ((offset & 1) == 0) {
+ m_uart->control_w(space , 0 , (UINT8)(data & 0xff));
+ } else {
+ m_uart->data_w(space , 0 , (UINT8)(data & 0xff));
+ }
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_rxrdy_w)
+{
+ if (state) {
+ BIT_SET(m_irl_pending , 6);
+ } else {
+ BIT_CLR(m_irl_pending , 6);
+ }
+
+ hp64k_update_irl();
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_txrdy_w)
+{
+ if (state) {
+ BIT_SET(m_irl_pending , 5);
+ } else {
+ BIT_CLR(m_irl_pending , 5);
+ }
+
+ hp64k_update_irl();
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_txd_w)
+{
+ m_txd_state = state;
+ if (m_loopback) {
+ m_uart->write_rxd(state);
+ }
+ m_rs232->write_txd(state);
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_dtr_w)
+{
+ m_dtr_state = state;
+ if (m_loopback) {
+ m_uart->write_dsr(state);
+ }
+ m_rs232->write_dtr(state);
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_rts_w)
+{
+ if (BIT(m_s5_sw->read() , 0)) {
+ // Full duplex, RTS/ = 0
+ state = 0;
+ }
+ m_rts_state = state;
+ if (m_loopback) {
+ m_uart->write_cts(state);
+ }
+ m_rs232->write_rts(state);
+}
+
+WRITE16_MEMBER(hp64k_state::hp64k_loopback_w)
+{
+ m_loopback = BIT(data , 11);
+ hp64k_update_loopback();
+}
+
+void hp64k_state::hp64k_update_loopback(void)
+{
+ if (m_loopback) {
+ m_uart->write_rxd(m_txd_state);
+ m_uart->write_dsr(m_dtr_state);
+ m_uart->write_cts(m_rts_state);
+ } else {
+ m_uart->write_rxd(m_rs232->rxd_r());
+ m_uart->write_dsr(m_rs232->dcd_r());
+ m_uart->write_cts(m_rs232->cts_r());
+ }
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_rs232_rxd_w)
+{
+ if (!m_loopback) {
+ m_uart->write_rxd(state);
+ }
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_rs232_dcd_w)
+{
+ if (!m_loopback) {
+ m_uart->write_dsr(state);
+ }
+}
+
+WRITE_LINE_MEMBER(hp64k_state::hp64k_rs232_cts_w)
+{
+ if (!m_loopback) {
+ m_uart->write_cts(state);
+ }
}
WRITE16_MEMBER(hp64k_state::hp64k_beep_w)
@@ -914,6 +1093,19 @@ TIMER_DEVICE_CALLBACK_MEMBER(hp64k_state::hp64k_beeper_off)
m_beeper->set_state(0);
}
+WRITE_LINE_MEMBER(hp64k_state::hp64k_baud_clk_w)
+{
+ if (!m_16x_clk) {
+ if (state && !m_baud_clk) {
+ m_16x_div++;
+ }
+ m_baud_clk = !!state;
+ state = BIT(m_16x_div , 3);
+ }
+ m_uart->write_txc(state);
+ m_uart->write_rxc(state);
+}
+
static INPUT_PORTS_START(hp64k)
// Keyboard is arranged in a 8 x 16 matrix. Of the 128 possible positions, only 77 are used.
// For key arrangement on the matrix, see [1] pg 334
@@ -1129,6 +1321,30 @@ static INPUT_PORTS_START(hp64k)
PORT_DIPSETTING(0x00 , "1x")
PORT_DIPSETTING(0x02 , "16x")
+ PORT_START("s5_sw")
+ PORT_DIPNAME(0x01 , 0x00 , "Duplex")
+ PORT_DIPLOCATION("S5 IO:!1")
+ PORT_DIPSETTING(0x00 , "Half duplex")
+ PORT_DIPSETTING(0x01 , "Full duplex")
+ PORT_DIPNAME(0x1e , 0x00 , "Baud rate")
+ PORT_DIPLOCATION("S5 IO:!5,!4,!3,!2")
+ PORT_DIPSETTING(0x00 , "50")
+ PORT_DIPSETTING(0x02 , "75")
+ PORT_DIPSETTING(0x04 , "110")
+ PORT_DIPSETTING(0x06 , "134.5")
+ PORT_DIPSETTING(0x08 , "150")
+ PORT_DIPSETTING(0x0a , "300")
+ PORT_DIPSETTING(0x0c , "600")
+ PORT_DIPSETTING(0x0e , "1200")
+ PORT_DIPSETTING(0x10 , "1800")
+ PORT_DIPSETTING(0x12 , "2000")
+ PORT_DIPSETTING(0x14 , "2400")
+ PORT_DIPSETTING(0x16 , "3600")
+ PORT_DIPSETTING(0x18 , "4800")
+ PORT_DIPSETTING(0x1a , "7200")
+ PORT_DIPSETTING(0x1c , "9600")
+ PORT_DIPSETTING(0x1e , "19200")
+
INPUT_PORTS_END
static SLOT_INTERFACE_START(hp64k_floppies)
@@ -1150,6 +1366,7 @@ static MACHINE_CONFIG_START(hp64k , hp64k_state)
// Clock = 25 MHz / 9 * (112/114)
MCFG_DEVICE_ADD("crtc" , I8275 , 2729045)
+ MCFG_VIDEO_SET_SCREEN("screen")
MCFG_I8275_CHARACTER_WIDTH(9)
MCFG_I8275_DRAW_CHARACTER_CALLBACK_OWNER(hp64k_state , crtc_display_pixels)
MCFG_I8275_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_crtc_drq_w))
@@ -1158,9 +1375,10 @@ static MACHINE_CONFIG_START(hp64k , hp64k_state)
MCFG_SCREEN_ADD("screen" , RASTER)
MCFG_SCREEN_UPDATE_DEVICE("crtc" , i8275_device , screen_update)
MCFG_SCREEN_REFRESH_RATE(60)
+ MCFG_SCREEN_SIZE(720 , 390)
MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette")
- MCFG_FD1791_ADD("fdc" , XTAL_4MHz / 4)
+ MCFG_FD1791_ADD("fdc" , XTAL_4MHz / 4)
MCFG_WD_FDC_FORCE_READY
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_flp_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(hp64k_state , hp64k_flp_drq_w))
@@ -1191,6 +1409,22 @@ static MACHINE_CONFIG_START(hp64k , hp64k_state)
MCFG_SOUND_ROUTE(ALL_OUTPUTS , "mono" , 1.00)
MCFG_TIMER_DRIVER_ADD("beep_timer" , hp64k_state , hp64k_beeper_off);
+
+ MCFG_DEVICE_ADD("baud_rate" , CLOCK , 0)
+ MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(hp64k_state , hp64k_baud_clk_w));
+
+ MCFG_DEVICE_ADD("uart" , I8251 , 0)
+ MCFG_I8251_RXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_rxrdy_w));
+ MCFG_I8251_TXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_txrdy_w));
+ MCFG_I8251_TXD_HANDLER(WRITELINE(hp64k_state , hp64k_txd_w));
+ MCFG_I8251_DTR_HANDLER(WRITELINE(hp64k_state , hp64k_dtr_w));
+ MCFG_I8251_RTS_HANDLER(WRITELINE(hp64k_state , hp64k_rts_w));
+
+ MCFG_RS232_PORT_ADD("rs232" , default_rs232_devices , NULL)
+ MCFG_RS232_RXD_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_rxd_w))
+ MCFG_RS232_DCD_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_dcd_w))
+ MCFG_RS232_CTS_HANDLER(WRITELINE(hp64k_state , hp64k_rs232_cts_w))
+
MACHINE_CONFIG_END
ROM_START(hp64k)
diff --git a/src/mess/drivers/hp_ipc.c b/src/mess/drivers/hp_ipc.c
new file mode 100644
index 00000000000..a248efc299b
--- /dev/null
+++ b/src/mess/drivers/hp_ipc.c
@@ -0,0 +1,359 @@
+// license:BSD-3-Clause
+// copyright-holders:
+/******************************************************************************
+
+
+Integral Personal Computer (HP9807A)
+Hewlett-Packard, 1985
+
+This is a portable mains-powered UNIX workstation computer system produced by Hewlett-Packard and launched in 1985
+Basic hardware specs are....
+- 68000 CPU at 7.96MHz
+- 9" amber electro-luminescent display with a resolution of 255*512 pixels or up to 85 characters x 31 lines (default=80*24) with
+ dedicated 32Kb display memory
+- Internal 3.5" floppy disk drive with the following specification....
+ Encoding: Double Density HP MFM Format
+ Rotational speed: 600 RPM
+ Transfer speed: 62.5kB/second
+ Capacity: 709Kb (709632 bytes)
+ Bytes per sector: 512
+ Sectors per track: 9
+ Total tracks per surface: 80, Available: 77, Spare: 2, Wear: 1
+ Surfaces: 2
+ Interleave: 1
+- HP ThinkJet ink-jet printer integrated into the top of the case. This is a modified HP2225B Thinkjet printer
+- 90-key detachable keyboard
+- ROM: up to 512Kb standard and an additional 512Kb of option ROM
+- RAM: 512Kb, arranged as 256Kbx16. RAM is expandable externally to 7Mb
+- Real Time Clock
+- Speaker
+- External I/O bus with two I/O ports for interfaces and memory modules. Expandable to maximum 10 ports with two 5-port Bus Expander Modules
+- HP-IB (IEEE-488) bus
+- Runs the HP-UX Operating System III or System V (in ROM)
+
+
+PCB Layouts
+===========
+
+CPU/Memory Board (LOGIC A PCA)
+----------------
+
+HP Part# 00095-60953
+ |---------------------------------------------------------------------------------|
+ | 15.92MHz J1 J2 |
+ |LS74 |
+ | |---| |
+ | |T | |
+ | |M | |
+ | |S | |
+ | |4 | |-------------------------| |
+|--------------------| |5 | | 68000 | |
+| |0 | | | |
+| MB81256 MB81256 |0 | |-------------------------| |
+| |A | |
+| MB81256 MB81256 |---| |
+| |----------------J3-----------------| |
+| MB81256 MB81256 | | |
+| | | |
+| MB81256 MB81256 | | |
+| | | |
+| MB81256 MB81256 | | |
+| | | |
+| MB81256 MB81256 | | |
+| |----------------J4-----------------| |
+| MB81256 MB81256 |
+| U58 U60 |
+| MB81256 MB81256 555 |
+| |
+| |
+| |
+| J5 J6 J7 |
+|------------------------------------------------------------------------------------------------------|
+Notes:
+ 68000 - 68000 CPU at U7. Clock input 7.96MHz [15.92/2] (DIP64)
+ LS74 - 74LS74 at U2 provides system clock dividers /4 /2
+ MB81256 - Fujitsu MB81256 256Kx1 DRAM. Total RAM 512Kx8/256Kx16. HP part# 1818-3308. U20-U35 (DIP16)
+ TMS4500 - Texas Instruments TMS4500A DRAM Controller at U4. Clock input 3.98MHz [15.92/4] (DIP40)
+ U58 - HP-HIL Keyboard Interface 'Cerberus'. Clock input on pin 24 is unknown (DIP24)
+ U60 - Unknown IC used as an interrupt encoder. Possibly a logic chip? (DIP20)
+ 555 - 555 Timer
+ J1/J2 - Connectors joining to LOGIC B PCA (logic A to logic B bus)
+ J3/J4 - Connectors for ROM board
+ J5 - Power input connector from power supply PCB
+ J6 - 64-pin external I/O bus. This is connected to the I/O backplane PCB mounted at the rear of the case using a ribbon cable
+ J7 - 10 pin connector. Labelled on schematics as LOOP0 In/Out and LOOP1 In/Out. Connected to 'Cerberus' IC. Possibly for more input devices?
+
+
+Interface & Control Board (LOGIC B PCA)
+-------------------------
+
+HP Part# 00095-60952
+00095-60107 BD REV A
+00095-60149 ASSY LOGIC B
+|---------------------------------------------------------------------------------|
+|SPEAKER NS58167A J11 J10 |
+| LM358 32.768kHz |
+| |
+| 16Kx4 16Kx4 16Kx4 16Kx4 |
+| ROM |
+| |
+| BT1 HP-IL(2) GPU |
+| |--------------------|
+| 1Kb |
+| COP452 |
+| |
+| |
+| WD2797 |
+| LM393 HP-IL(1) |
+| |
+| LS193 |
+| |
+| |
+| |
+| LS74 24MHz LS161 |
+| J2|
+| |
+| TMS9914 |
+| |
+| |
+| 75162 75160 |
+| |
+| J14 J6 J5 J4 J3 J7 J1 J8 J9 J12 |
+|------------------------------------------------------------------------------------------------------|
+Notes:
+ GPU - GPU (Graphics Processor) at U1. Clock input 3MHz [24/8]. VSync on pin 45, HSync on pin 46 (DIP48)
+ 16Kx4 - 16Kx4 DRAM, organised as 32Kx8bit/16Kx16bit at U3, U4, U5 & U6. Chip type unknown, likely Fujitsu MB81416 (DIP18)
+ WD2797 - Western Digital WD2797 Floppy Disk Controller at U18. Clock input 2MHz [24/2/3/2] (DIP40)
+ HP-IL(1) - HP-IL 1LJ7-0015 'Saturn' Thinkjet Printer Controller IC at U28. Clock input 3MHz on pin 9 [24/8] (DIP48)
+ HP-IL(2) - HP-IL Interface IC at U31. Clock input 2MHz on pin 22 [24/2/3/2] (DIP28)
+ 1Kb - 1Kb RAM at U27 for printer buffer (DIP28, type unknown, very old, with only DATA0,1,2,3, C/D and DIN,DOUT)
+ ROM - 16Kb (2Kx8?) Some kind of very early DIP28 PROM/ROM? Same pinout as 1Kb RAM above. Holds the character font table for the printer
+ Four versions of this ROM exist, one each for Japan/Arabic/Hebrew and one for all other regions
+ NS58167A - National Semiconductor NS58167A Clock Controller RTC at U44. Clock input 32.768kHz (DIP24)
+ LM358 - National Semiconductor LM358 Operational Amplifier at U40 (DIP8)
+ LM393 - Texas Instruments LM393 Dual Comparator at U34 (DIP8)
+ BT1 - 3v lithium battery
+ COP452 - National Semiconductor COP452 Speaker Controller at U39. Clock input 2MHz [24/2/3/2]. This IC provides programmable square wave output from 100Hz to 5000Hz (DIP14)
+ TMS9914 - Texas Instruments TMS9914 General Purpose Interface Bus Adapter at U41. Clock input 4MHz [24/2/3] (DIP40)
+ 75160 - National Semiconductor DS75160A IEEE-488 General Purpose Interface Bus Transceiver at U42 (DIP20)
+ 75162 - National Semiconductor DS75162A IEEE-488 General Purpose Interface Bus Transceiver at U43 (DIP22)
+ LS193 - 74LS193 at U9 provides the main system clock dividers /8 /4 /2 (24MHz -> 12MHz, 6MHz, 3MHz). This is also the source of the 6MHz video clock on connector J1
+ LS161 - 74LS161 at U46. Takes 12MHz clock input on pin 2 and outputs 4MHz on pin 13 (i.e. /3). This is the clock source for the TMS9914
+ LS74 - LS74 at U16. Takes output of 4MHz from LS161 at U46 and outputs 2MHz on pin 5 (i.e. /2). This is the source of the 2MHz clocks
+ J1 - Connector joining to video display assembly
+ J2 - Connector joining to floppy drive
+ J3 - Connector joining to printer front switch panel assembly (ADV/CONT/FF/ATTN)
+ J4 - Connector joining to printer out of paper switch connected to ATTN
+ J5 - Connector joining to printer carriage motor
+ J6 - Connector joining to printer mechanism assembly including paper motor
+ J7 - Connector joining to printer printhead
+ J8 - Connector joining to HO?E switch (? ~ M, text unreadable on schems)
+ J9 - Connector for ?
+ J10/J11 - Connectors joining to LOGIC A PCA (logic A to logic B bus)
+ J12 - Power input connector from power supply PCB
+ J14 - Fan connector
+
+
+ROM board (Operating System ROM PCA. Assembly# HP82991A or HP82995A)
+---------
+
+|----------------J3-----------------|
+| |
+| |
+| |
+|J1 U1 U2 U3 U4 J2|
+| |
+| |
+| |
+|----------------J4-----------------|
+Notes:
+ J1/J2 - 20 pin connector joining to 'Option ROM PCA'
+ J3/J4 - 20 pin connector joining to 'LOGIC A PCA'
+ U1-U4 - 28 pin EPROM/MASKROM 0L/1L/0H/1H (note 1Mbit: 128Kx8 28 pin)
+
+
+ROM board (Option ROM PCA)
+---------
+Note this PCB plugs in upside-down on top of the Operating System ROM PCB
+
+|----------------J4-----------------|
+| |
+| |
+| |
+|J1 U1 U2 U3 U4 J2|
+| |
+| |
+| |
+|----------------J3-----------------|
+Notes:
+ J1/J2 - 20 pin connector joining to 'Operating System ROM PCA'
+ J3/J4 - 20 pin connector joining to 'LOGIC A PCA'
+ U1-U4 - 28 pin EPROM/MASKROM 0L/1L/0H/1H (note 1Mbit: 128Kx8 28 pin)
+
+
+Physical Memory Map
+===================
+000000-07FFFF - Internal ROM (Operating System PCA 512Kb)
+080000-0FFFFF - Internal ROM (Option ROM PCA 512Kb)
+100000-4FFFFF - External ROM modules (up to 4Mb)
+500000-5FFFFF - Reserved 1Mb
+600000-6FFFFF - Internal I/O 1Mb
+
+ Address Port Use
+ -------------------------
+ 600000-60FFFF 0 MMU
+ 610000-61FFFF 1 Disk Drive
+ 620000-62FFFF 2 Display
+ 630000-63FFFF 3 HP-IB
+ 640000-64FFFF 4 RTC
+ 650000-65FFFF 5 Printer
+ 660000-66FFFF 6 Keyboard
+ 670000-67FFFF 7 Speaker
+ 680000-68FFFF 8 Reserved
+ 690000-69FFFF 9 Reserved
+ 6A0000-6AFFFF 10 Reserved
+ 6B0000-6BFFFF 11 Reserved
+ 6C0000-6CFFFF 12 Reserved
+ 6D0000-6DFFFF 13 Reserved
+ 6E0000-6EFFFF 14 Reserved
+ 6F0000-6FFFFF 15 Reserved
+
+700000-7FFFFF - External I/O 1Mb
+
+ Address Port Use
+ -------------------------
+ 700000-70FFFF 16 Mainframe Port A
+ 710000-71FFFF 17 Mainframe Port B
+ 720000-72FFFF 18 Bus Expander Port A1
+ 730000-73FFFF 19 Bus Expander Port A2
+ 740000-74FFFF 20 Bus Expander Port A3
+ 750000-75FFFF 21 Bus Expander Port A4
+ 760000-76FFFF 22 Bus Expander Port A5
+ 770000-77FFFF 23 Reserved
+ 780000-78FFFF 24 Reserved
+ 790000-79FFFF 25 Reserved
+ 7A0000-7AFFFF 26 Bus Expander Port B1
+ 7B0000-7BFFFF 27 Bus Expander Port B2
+ 7C0000-7CFFFF 28 Bus Expander Port B3
+ 7D0000-7DFFFF 29 Bus Expander Port B4
+ 7E0000-7EFFFF 30 Bus Expander Port B5
+ 7F0000-7FFFFF 31 Reserved
+
+800000-EFFFFF - External RAM modules (up to 7Mb)
+F00000-F7FFFF - Internal RAM 512Kb
+F80000-FFFFFF - Reserved 512Kb
+
+Access to 800000-FFFFFF can be remapped by the MMU registers.
+
+
+Interrupts
+----------
+High Priority 7 - Soft reset from keyboard (NMI)
+ /\ 6 - RTC or NBIR3 (external I/O)
+ || 5 - Disc Drive or NBIR2 (external I/O)
+ || 4 - GPU or NBIR1 (external I/O)
+ || 3 - HP-IB, printer or NBIR0 (external I/O)
+ \/ 2 - HP-HIL devices (keyboard/mouse)
+Low Priority 1 - RTC
+
+Note external interrupt lines NBIR0 to NBIR3 can be asserted by an interface connected to the external I/O port
+
+
+******************************************************************************/
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+
+
+class hp_ipc_state : public driver_device
+{
+public:
+ hp_ipc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ { }
+
+ DECLARE_WRITE16_MEMBER(mmu_w);
+ DECLARE_READ16_MEMBER(ram_r);
+ DECLARE_WRITE16_MEMBER(ram_w);
+
+private:
+ required_device<m68000_device> m_maincpu;
+
+ UINT32 m_mmu[4];
+ UINT16 m_internal_ram[0x40000];
+
+ inline UINT32 get_ram_address(offs_t offset) { return (m_mmu[(m_maincpu->get_fc() >> 1) & 3] + offset) & 0x3FFFFF; }
+};
+
+
+static ADDRESS_MAP_START(hp_ipc_mem, AS_PROGRAM, 16, hp_ipc_state)
+ AM_RANGE(0x000000, 0x07FFFF) AM_ROM
+ AM_RANGE(0x600000, 0x60FFFF) AM_WRITE(mmu_w)
+ AM_RANGE(0x800000, 0xFFFFFF) AM_READWRITE(ram_r, ram_w)
+ADDRESS_MAP_END
+
+
+static INPUT_PORTS_START(hp_ipc)
+INPUT_PORTS_END
+
+
+WRITE16_MEMBER(hp_ipc_state::mmu_w)
+{
+ logerror("mmu_w: offset = %08x, data = %04x, register = %d, data_to_add = %08x\n", offset, data, offset & 3, (data & 0xFFF) << 10);
+ m_mmu[offset & 3] = (data & 0xFFF) << 10;
+}
+
+
+READ16_MEMBER(hp_ipc_state::ram_r)
+{
+ UINT32 ram_address = get_ram_address(offset);
+
+ //logerror("RAM read, offset = %08x, ram address = %08X\n", offset, ram_address);
+
+ if (ram_address < 0x380000)
+ {
+ // External RAM modules
+ }
+ else if (ram_address < 0x3c0000)
+ {
+ // Internal RAM
+ return m_internal_ram[offset & 0x3ffff];
+ }
+ return 0xffff;
+}
+
+
+WRITE16_MEMBER(hp_ipc_state::ram_w)
+{
+ UINT32 ram_address = get_ram_address(offset);
+
+ //logerror("RAM write, offset = %08x, ram address = %08X, data = %04x\n", offset, ram_address, data);
+
+ if (ram_address < 0x380000)
+ {
+ // External RAM modules
+ }
+ else if (ram_address < 0x3c0000)
+ {
+ // Internal RAM
+ m_internal_ram[offset & 0x3ffff] = data;
+ }
+}
+
+
+static MACHINE_CONFIG_START(hp_ipc, hp_ipc_state)
+ /* basic machine hardware */
+ MCFG_CPU_ADD("maincpu", M68000, 15920000 / 2)
+ MCFG_CPU_PROGRAM_MAP(hp_ipc_mem)
+MACHINE_CONFIG_END
+
+
+ROM_START(hp_ipc)
+ ROM_REGION(0x100000, "maincpu" , 0)
+ ROM_LOAD("hp ipc os 82991A.bin", 0x00000, 0x80000, BAD_DUMP CRC(df45a37b) SHA1(476af9923bca0d2d0f40aeb81be5145ca76fddf5)) // Should be spread across 4 x 128K ROMs
+ROM_END
+
+
+COMP(1985, hp_ipc, 0, 0, hp_ipc, hp_ipc, driver_device, 0, "HP", "Integral Personal Computer", MACHINE_IS_SKELETON)
+
diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c
index 27e3b7bfe58..7213db9ebe6 100644
--- a/src/mess/drivers/kaypro.c
+++ b/src/mess/drivers/kaypro.c
@@ -246,7 +246,9 @@ static MACHINE_CONFIG_START( kayproii, kaypro_state )
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(kaypro_state, fdc_drq_w))
MCFG_WD_FDC_FORCE_READY
MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "drive0", kaypro_state::kayproii_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", kaypro_floppies, "drive1", kaypro_state::kayproii_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_SOFTWARE_LIST_ADD("flop_list","kayproii")
MACHINE_CONFIG_END
@@ -309,7 +311,9 @@ static MACHINE_CONFIG_START( kaypro2x, kaypro_state )
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(kaypro_state, fdc_drq_w))
MCFG_WD_FDC_FORCE_READY
MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "drive0", kaypro_state::kaypro2x_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", kaypro_floppies, "drive1", kaypro_state::kaypro2x_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( kaypro10, kaypro2x )
diff --git a/src/mess/drivers/laser3k.c b/src/mess/drivers/laser3k.c
index b157da73fd5..a7a3fa3bfa3 100644
--- a/src/mess/drivers/laser3k.c
+++ b/src/mess/drivers/laser3k.c
@@ -529,7 +529,7 @@ void laser3k_state::text_update(screen_device &screen, bitmap_ind16 &bitmap, con
start_address = (m_disp_page == 0) ? 0x400 : 0x800;
}
- m_flash = ((machine().time() * 4).seconds & 1) ? 1 : 0;
+ m_flash = ((machine().time() * 4).seconds() & 1) ? 1 : 0;
beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
diff --git a/src/mess/drivers/mbee.c b/src/mess/drivers/mbee.c
index 176def6e7a8..35cfd694d67 100644
--- a/src/mess/drivers/mbee.c
+++ b/src/mess/drivers/mbee.c
@@ -767,7 +767,9 @@ static MACHINE_CONFIG_DERIVED( mbee56, mbeeic )
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
MCFG_WD_FDC_ENMF_CALLBACK(GND)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive5a", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive5b", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbee128, mbee56 )
@@ -789,7 +791,9 @@ static MACHINE_CONFIG_DERIVED( mbee128p, mbeeppc )
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w))
MCFG_WD_FDC_ENMF_CALLBACK(GND)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive5a", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive5b", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbee256, mbee128p )
@@ -801,7 +805,9 @@ static MACHINE_CONFIG_DERIVED( mbee256, mbee128p )
MCFG_DEVICE_REMOVE("fdc:0")
MCFG_DEVICE_REMOVE("fdc:1")
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive3a", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive3b", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc )
diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c
index 2a7c33013ad..be3978d2ddf 100644
--- a/src/mess/drivers/mycom.c
+++ b/src/mess/drivers/mycom.c
@@ -552,7 +552,9 @@ static MACHINE_CONFIG_START( mycom, mycom_state )
MCFG_CASSETTE_ADD( "cassette" )
MCFG_FD1771_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", mycom_floppies, "525sd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", mycom_floppies, "525sd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", mycom_state, mycom_kbd, attotime::from_hz(20))
MACHINE_CONFIG_END
diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c
index 837a6f833db..9e30a8c2ac5 100644
--- a/src/mess/drivers/mz2500.c
+++ b/src/mess/drivers/mz2500.c
@@ -729,7 +729,7 @@ void mz2500_state::mz2500_reconfigure_screen()
//popmessage("%d %d %d %d %02x",vs,ve,hs,he,m_cg_reg[0x0e]);
- machine().first_screen()->configure(720, 480, visarea, machine().first_screen()->frame_period().attoseconds);
+ machine().first_screen()->configure(720, 480, visarea, machine().first_screen()->frame_period().attoseconds());
/* calculate CG window parameters here */
m_cg_vs = (m_cg_reg[0x08]) | ((m_cg_reg[0x09]<<8) & 1);
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index 8c85fb6998f..aadd261c5b0 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -1343,7 +1343,7 @@ WRITE8_MEMBER(pc6001_state::pc6001m2_vram_bank_w)
visarea.set(0, (320) - 1, 0, (y_height) - 1);
- machine().first_screen()->configure(320, 240, visarea, machine().first_screen()->frame_period().attoseconds);
+ machine().first_screen()->configure(320, 240, visarea, machine().first_screen()->frame_period().attoseconds());
}
}
diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c
index a17e509b3ee..8d53ff2ae7a 100644
--- a/src/mess/drivers/pcd.c
+++ b/src/mess/drivers/pcd.c
@@ -17,10 +17,12 @@
#include "machine/wd_fdc.h"
#include "machine/mc146818.h"
#include "machine/pcd_kbd.h"
+#include "machine/terminal.h"
#include "sound/speaker.h"
#include "video/scn2674.h"
#include "formats/pc_dsk.h"
#include "bus/scsi/omti5100.h"
+#include "bus/rs232/rs232.h"
//**************************************************************************
// TYPE DEFINITIONS
@@ -43,6 +45,7 @@ public:
m_scsi(*this, "scsi"),
m_scsi_data_out(*this, "scsi_data_out"),
m_scsi_data_in(*this, "scsi_data_in"),
+ m_terminal(*this, "terminal"),
m_ram(*this, "ram"),
m_vram(*this, "vram"),
m_charram(8*1024)
@@ -74,6 +77,9 @@ public:
DECLARE_WRITE16_MEMBER( mmu_w );
DECLARE_READ16_MEMBER( mem_r );
DECLARE_WRITE16_MEMBER( mem_w );
+ DECLARE_READ8_MEMBER( exp_r );
+ DECLARE_WRITE8_MEMBER( exp_w );
+ DECLARE_WRITE8_MEMBER( term_key_w );
SCN2674_DRAW_CHARACTER_MEMBER(display_pixels);
DECLARE_FLOPPY_FORMATS( floppy_formats );
DECLARE_WRITE_LINE_MEMBER(write_scsi_bsy);
@@ -101,10 +107,11 @@ private:
required_device<SCSI_PORT_DEVICE> m_scsi;
required_device<output_latch_device> m_scsi_data_out;
required_device<input_buffer_device> m_scsi_data_in;
+ optional_device<generic_terminal_device> m_terminal;
required_device<ram_device> m_ram;
required_shared_ptr<UINT16> m_vram;
dynamic_buffer m_charram;
- UINT8 m_stat, m_led, m_vram_sw;
+ UINT8 m_stat, m_led, m_vram_sw, m_term_key;
int m_msg, m_bsy, m_io, m_cd, m_req, m_rst;
emu_timer *m_req_hack;
UINT16 m_dskctl;
@@ -159,6 +166,7 @@ void pcd_state::machine_reset()
m_mmu.ctl = 0;
m_mmu.sc = false;
m_mmu.type = ioport("mmu")->read();
+ m_term_key = 0;
}
READ8_MEMBER( pcd_state::irq_callback )
@@ -486,6 +494,50 @@ READ16_MEMBER(pcd_state::mem_r)
}
return ram[offset];
}
+
+// The PC-X treats the graphics board as a serial port. Maybe the 8031 (instead of 8047) can
+// write directly to the video ram and there's a char ROM instead of RAM?
+READ8_MEMBER(pcd_state::exp_r)
+{
+ if(m_dskctl & 0x40)
+ {
+ if(!offset)
+ {
+ UINT8 data = m_term_key;
+ m_term_key = 0;
+ return data;
+ }
+ else
+ {
+ m_pic2->ir0_w(CLEAR_LINE);
+ return (m_term_key ? 1 : 0);
+ }
+ }
+ else if(offset & 1)
+ return m_crtc->read(space, offset/2);
+ return 0xff;
+}
+
+WRITE8_MEMBER(pcd_state::exp_w)
+{
+ if(m_dskctl & 0x40)
+ {
+ if(!offset)
+ {
+ m_pic2->ir0_w(ASSERT_LINE);
+ m_terminal->write(space, 0, data);
+ }
+ }
+ else if(!(offset & 1))
+ return m_crtc->write(space, offset/2, data);
+}
+
+WRITE8_MEMBER(pcd_state::term_key_w)
+{
+ m_pic2->ir0_w(ASSERT_LINE);
+ m_term_key = data;
+}
+
//**************************************************************************
// ADDRESS MAPS
//**************************************************************************
@@ -522,6 +574,11 @@ static ADDRESS_MAP_START( pcd_io, AS_IO, 16, pcd_state )
AM_RANGE(0xfb00, 0xffff) AM_READWRITE8(nmi_io_r, nmi_io_w, 0xffff)
ADDRESS_MAP_END
+static ADDRESS_MAP_START( pcx_io, AS_IO, 16, pcd_state )
+ ADDRESS_MAP_UNMAP_HIGH
+ AM_RANGE(0xf980, 0xf98f) AM_READWRITE8(exp_r, exp_w, 0xffff)
+ AM_IMPORT_FROM(pcd_io)
+ADDRESS_MAP_END
//**************************************************************************
// MACHINE DRIVERS
@@ -579,6 +636,7 @@ static MACHINE_CONFIG_START( pcd, pcd_state )
MCFG_DEVICE_ADD("usart1", MC2661, XTAL_4_9152MHz)
MCFG_MC2661_RXRDY_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir3_w))
MCFG_MC2661_TXRDY_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir3_w))
+ MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("rs232_1", rs232_port_device, write_txd))
MCFG_DEVICE_ADD("usart2", MC2661, XTAL_4_9152MHz)
MCFG_MC2661_RXRDY_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir2_w))
//MCFG_MC2661_TXRDY_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir2_w)) // this gets stuck high causing the keyboard to not work
@@ -586,6 +644,12 @@ static MACHINE_CONFIG_START( pcd, pcd_state )
MCFG_DEVICE_ADD("usart3", MC2661, XTAL_4_9152MHz)
MCFG_MC2661_RXRDY_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir4_w))
MCFG_MC2661_TXRDY_HANDLER(DEVWRITELINE("pic1", pic8259_device, ir4_w))
+ MCFG_MC2661_TXD_HANDLER(DEVWRITELINE("rs232_2", rs232_port_device, write_txd))
+
+ MCFG_RS232_PORT_ADD("rs232_1", default_rs232_devices, NULL)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("usart1", mc2661_device, rx_w))
+ MCFG_RS232_PORT_ADD("rs232_2", default_rs232_devices, NULL)
+ MCFG_RS232_RXD_HANDLER(DEVWRITELINE("usart3", mc2661_device, rx_w))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -606,6 +670,7 @@ static MACHINE_CONFIG_START( pcd, pcd_state )
MCFG_SCN2674_TEXT_CHARACTER_WIDTH(8)
MCFG_SCN2674_GFX_CHARACTER_WIDTH(16)
MCFG_SCN2674_DRAW_CHARACTER_CALLBACK_OWNER(pcd_state, display_pixels)
+ MCFG_VIDEO_SET_SCREEN("screen")
// rtc
MCFG_MC146818_ADD("rtc", XTAL_32_768kHz)
@@ -627,6 +692,16 @@ static MACHINE_CONFIG_START( pcd, pcd_state )
MCFG_SCSIDEV_ADD("scsi:1", "harddisk", OMTI5100, SCSI_ID_0)
MACHINE_CONFIG_END
+MACHINE_CONFIG_DERIVED(pcx, pcd)
+ MCFG_CPU_MODIFY("maincpu")
+ MCFG_CPU_IO_MAP(pcx_io)
+
+ // FIXME: temporary workaround
+ MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0)
+ MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(pcd_state, term_key_w))
+
+ MCFG_DEVICE_REMOVE("graphics")
+MACHINE_CONFIG_END
//**************************************************************************
// ROM DEFINITIONS
@@ -646,9 +721,19 @@ ROM_START( pcd )
ROM_LOAD("s36361-d321-v1.bin", 0x000, 0x400, CRC(69baeb2a) SHA1(98b9cd0f38c51b4988a3aed0efcf004bedd115ff))
ROM_END
+ROM_START( pcx )
+ ROM_REGION(0x4000, "bios", 0)
+ ROM_SYSTEM_BIOS(0, "v2", "V2 GS") // from mainboard SYBAC S26361-D359 V2 GS
+ ROMX_LOAD("s26361-d359.d42", 0x0001, 0x2000, CRC(e20244dd) SHA1(0ebc5ddb93baacd9106f1917380de58aac64fe73), ROM_SKIP(1) | ROM_BIOS(1))
+ ROMX_LOAD("s26361-d359.d43", 0x0000, 0x2000, CRC(e03db2ec) SHA1(fcae8b0c9e7543706817b0a53872826633361fda), ROM_SKIP(1) | ROM_BIOS(1))
+ ROM_SYSTEM_BIOS(1, "v3", "V3 GS4") // from mainboard SYBAC S26361-D359 V3 GS4
+ ROMX_LOAD("361d0359.d42", 0x0001, 0x2000, CRC(5b4461e4) SHA1(db6756aeabb2e6d3921dc7571a5bed3497b964bf), ROM_SKIP(1) | ROM_BIOS(2))
+ ROMX_LOAD("361d0359.d43", 0x0000, 0x2000, CRC(71c3189d) SHA1(e8dd6c632bfc833074d3a833ea7f59bb5460f313), ROM_SKIP(1) | ROM_BIOS(2))
+ROM_END
//**************************************************************************
// GAME DRIVERS
//**************************************************************************
COMP( 1984, pcd, 0, 0, pcd, pcd, driver_device, 0, "Siemens", "PC-D", MACHINE_NOT_WORKING )
+COMP( 1984, pcx, pcd, 0, pcx, pcd, driver_device, 0, "Siemens", "PC-X", MACHINE_NOT_WORKING )
diff --git a/src/mess/drivers/pdp1.c b/src/mess/drivers/pdp1.c
index cddee893f94..f3827cf61b1 100644
--- a/src/mess/drivers/pdp1.c
+++ b/src/mess/drivers/pdp1.c
@@ -1597,7 +1597,7 @@ static void iot_dra(device_t *device, int op2, int nac, int mb, int *io, int ac)
{
pdp1_state *state = device->machine().driver_data<pdp1_state>();
(*io) = (state->m_parallel_drum.rotation_timer->elapsed() *
- (ATTOSECONDS_PER_SECOND / (PARALLEL_DRUM_WORD_TIME.as_attoseconds()))).seconds & 0007777;
+ (ATTOSECONDS_PER_SECOND / (PARALLEL_DRUM_WORD_TIME.as_attoseconds()))).seconds() & 0007777;
/* set parity error and timing error... */
}
diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c
index ad595fed1dc..f8bb9a06933 100644
--- a/src/mess/drivers/pet.c
+++ b/src/mess/drivers/pet.c
@@ -833,6 +833,15 @@ INPUT_PORTS_END
//-------------------------------------------------
+// INPUT_PORTS( petb_fr )
+//-------------------------------------------------
+
+INPUT_PORTS_START( petb_fr )
+ PORT_INCLUDE( petb )
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
// INPUT_PORTS( petb_se )
//-------------------------------------------------
@@ -2296,6 +2305,23 @@ ROM_END
//-------------------------------------------------
+// ROM( cbm8032_fr )
+//-------------------------------------------------
+
+ROM_START( cbm8032_fr )
+ ROM_REGION( 0x7000, M6502_TAG, 0 )
+ ROM_LOAD( "901465-23.ud10", 0x2000, 0x1000, CRC(ae3deac0) SHA1(975ee25e28ff302879424587e5fb4ba19f403adc) ) // BASIC 4
+ ROM_LOAD( "901465-20.ud9", 0x3000, 0x1000, CRC(0fc17b9c) SHA1(242f98298931d21eaacb55fe635e44b7fc192b0a) ) // BASIC 4
+ ROM_LOAD( "901465-21.ud8", 0x4000, 0x1000, CRC(36d91855) SHA1(1bb236c72c726e8fb029c68f9bfa5ee803faf0a8) ) // BASIC 4
+ ROM_LOAD( "8032_editor_80c_fr_a1ab.ud7", 0x5000, 0x1000, CRC(4d3d9918) SHA1(eedac298a201a28ad86a5939b569a46f9f12c16f) )
+ ROM_LOAD( "901465-22.ud6", 0x6000, 0x1000, CRC(cc5298a1) SHA1(96a0fa56e0c937da92971d9c99d504e44e898806) ) // Kernal
+
+ ROM_REGION( 0x1000, "charom", 0 )
+ ROM_LOAD( "8032_chargen_80c_fr_b9c1.ua3", 0x0000, 0x1000, CRC(d7424620) SHA1(e74c0eabb921d4a34032b57a7ee61ce61ec8a10c) )
+ROM_END
+
+
+//-------------------------------------------------
// ROM( cbm8032_se )
//-------------------------------------------------
@@ -2580,6 +2606,7 @@ COMP( 1980, cbm4032b, pet4032b, 0, cbm4032b, petb, driver_devic
COMP( 1980, pet8032, 0, 0, pet8032, petb, driver_device, 0, "Commodore Business Machines", "PET 8032", MACHINE_SUPPORTS_SAVE )
COMP( 1981, cbm8032, pet8032, 0, pet8032, petb, driver_device, 0, "Commodore Business Machines", "CBM 8032", MACHINE_SUPPORTS_SAVE )
COMP( 1981, cbm8032_de, pet8032, 0, pet8032, petb_de, driver_device, 0, "Commodore Business Machines", "CBM 8032 (Germany)", MACHINE_SUPPORTS_SAVE )
+COMP( 1981, cbm8032_fr, pet8032, 0, pet8032, petb_fr, driver_device, 0, "Commodore Business Machines", "CBM 8032 (France)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
COMP( 1981, cbm8032_se, pet8032, 0, pet8032, petb_se, driver_device, 0, "Commodore Business Machines", "CBM 8032 (Sweden/Finland)", MACHINE_SUPPORTS_SAVE )
COMP( 1981, superpet, pet8032, 0, superpet, petb, driver_device, 0, "Commodore Business Machines", "SuperPET SP-9000", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
COMP( 1981, mmf9000, pet8032, 0, superpet, petb, driver_device, 0, "Commodore Business Machines", "MicroMainFrame 9000", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mess/drivers/riscpc.c b/src/mess/drivers/riscpc.c
index 9bfcf221020..4bddb03c55f 100644
--- a/src/mess/drivers/riscpc.c
+++ b/src/mess/drivers/riscpc.c
@@ -186,7 +186,7 @@ void riscpc_state::vidc20_dynamic_screen_change()
visarea.min_y = (m_vidc20_vert_reg[VBSR] & 0x1fff);
visarea.max_y = (m_vidc20_vert_reg[VBER] & 0x1fff)-1;
- machine().first_screen()->configure(hblank_period, vblank_period, visarea, machine().first_screen()->frame_period().attoseconds );
+ machine().first_screen()->configure(hblank_period, vblank_period, visarea, machine().first_screen()->frame_period().attoseconds() );
logerror("VIDC20: successfully changed the screen to:\n Display Size = %d x %d\n Border Size %d x %d\n Cycle Period %d x %d\n",
(m_vidc20_horz_reg[HDER]-m_vidc20_horz_reg[HDSR]),(m_vidc20_vert_reg[VDER]-m_vidc20_vert_reg[VDSR]),
(m_vidc20_horz_reg[HBER]-m_vidc20_horz_reg[HBSR]),(m_vidc20_vert_reg[VBER]-m_vidc20_vert_reg[VBSR]),
diff --git a/src/mess/drivers/socrates.c b/src/mess/drivers/socrates.c
index fe354a2b955..ddf88ddc002 100644
--- a/src/mess/drivers/socrates.c
+++ b/src/mess/drivers/socrates.c
@@ -867,7 +867,7 @@ WRITE8_MEMBER( iqunlim_state::video_regs_w )
{
rectangle visarea = m_screen->visible_area();
visarea.set(0, (data & 0x02 ? 496 : 256) - 1, 0, 224 - 1);
- m_screen->configure(data & 0x02 ? 496 : 256 , 224, visarea, m_screen->frame_period().attoseconds);
+ m_screen->configure(data & 0x02 ? 496 : 256 , 224, visarea, m_screen->frame_period().attoseconds());
}
m_video_regs[offset] = data;
diff --git a/src/mess/drivers/super80.c b/src/mess/drivers/super80.c
index bfc217aafbf..2c6b069e4bf 100644
--- a/src/mess/drivers/super80.c
+++ b/src/mess/drivers/super80.c
@@ -840,7 +840,9 @@ static MACHINE_CONFIG_DERIVED( super80r, super80v )
MCFG_WD2793_ADD("fdc", XTAL_2MHz)
MCFG_WD_FDC_DRQ_CALLBACK(DEVWRITELINE("dma", z80dma_device, rdy_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", super80_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", super80_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
/**************************** ROMS *****************************************************************/
diff --git a/src/mess/drivers/supercon.c b/src/mess/drivers/supercon.c
index ae33dd1243a..7c286f6b4c2 100644
--- a/src/mess/drivers/supercon.c
+++ b/src/mess/drivers/supercon.c
@@ -22,7 +22,6 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "sound/beep.h"
-#include "supercon.lh"
class supercon_state : public driver_device
@@ -785,14 +784,11 @@ INPUT_PORTS_END
/* Machine driver */
static MACHINE_CONFIG_START( supercon, supercon_state )
+
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",M6502,MAIN_CLOCK)
MCFG_CPU_PROGRAM_MAP(supercon_mem)
-
- /* video hardware */
- MCFG_DEFAULT_LAYOUT(layout_supercon)
-
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("beeper", BEEP, 0)
@@ -812,4 +808,4 @@ ROM_END
/* Driver */
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
-CONS( 1983, supercon, 0, 0, supercon, supercon, supercon_state, supercon, "Novag", "SuperConstellation", MACHINE_SUPPORTS_SAVE)
+CONS( 1983, supercon, 0, 0, supercon, supercon, supercon_state, supercon, "Novag", "SuperConstellation", MACHINE_SUPPORTS_SAVE | MACHINE_REQUIRES_ARTWORK )
diff --git a/src/mess/drivers/supracan.c b/src/mess/drivers/supracan.c
index 8fb7668b5f9..baf2a4668f1 100644
--- a/src/mess/drivers/supracan.c
+++ b/src/mess/drivers/supracan.c
@@ -1643,7 +1643,7 @@ WRITE16_MEMBER( supracan_state::video_w )
rectangle visarea = machine().first_screen()->visible_area();
visarea.set(0, ((m_video_flags & 0x100) ? 320 : 256) - 1, 8, 232 - 1);
- machine().first_screen()->configure(348, 256, visarea, machine().first_screen()->frame_period().attoseconds);
+ machine().first_screen()->configure(348, 256, visarea, machine().first_screen()->frame_period().attoseconds());
}
break;
case 0x0a/2:
diff --git a/src/mess/drivers/tavernie.c b/src/mess/drivers/tavernie.c
index 9de8f4e5f4f..c1ea74dc14d 100644
--- a/src/mess/drivers/tavernie.c
+++ b/src/mess/drivers/tavernie.c
@@ -373,6 +373,7 @@ static MACHINE_CONFIG_DERIVED( ivg09, cpu09 )
MCFG_FD1795_ADD("fdc", XTAL_8MHz / 8)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ifd09_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/tispeak.c b/src/mess/drivers/tispeak.c
index 4550eb1cbca..211d535f9ac 100644
--- a/src/mess/drivers/tispeak.c
+++ b/src/mess/drivers/tispeak.c
@@ -9,7 +9,9 @@
These devices, mostly edu-toys, are based around an MCU(TMS0270/TMS1100),
TMS51xx speech, and VSM ROM(s). Newer devices, such as Speak & Music,
are based around the TMP50C40 and belong in another driver, probably.
-
+
+ note: except for tntell, MAME external artwork is not required. But it
+ is objectively a large improvement.
----------------------------------------------------------------------------
@@ -48,7 +50,7 @@ above expectations. TI continued to manufacture many products for this line.
with no module inserted
Speak & Spell (US), 1980
- - MCU: TMC0271* (same as 1979 version)
+ - MCU: same as 1979 version
- TMS51xx: TMC0281D
- VSM: 16KB CD2350(rev.A)
- notes: only 1 VSM, meaning much smaller internal vocabulary
@@ -74,6 +76,7 @@ above expectations. TI continued to manufacture many products for this line.
- MCU: TMC0271* (assume same as US 1979 version)
- TMS51xx: CD2801
- VSM: 16KB CD62175
+ - VFD: same as Speak & Math(!)
- notes: this one has a dedicated voice actor
Speak & Spell (France) "La Dictee Magique", 1980
@@ -89,12 +92,14 @@ above expectations. TI continued to manufacture many products for this line.
Speak & Spell (Italy) "Grillo Parlante", 1982
- MCU & TMS51xx: same as French 1980 version
- VSM: 16KB CD62190
+ - VFD: same as Speak & Math
+ - notes: it appears that TI ran out of original snspell VFDs in the early 80s?
Speak & Spell Compact (US), 1981
- MCU: CD8011**
- TMS51xx: TMC0281D
- VSM: 16KB CD2354, CD2354(rev.A)
- - notes: no display, MCU is TMS1100 instead of TMS0270
+ - notes: no display, MCU is TMS1100 instead of TMS0270, overall similar to Touch & Tell
Speak & Spell Compact (UK) "Speak & Write", 1981
- MCU & TMS51xx: same as US 1981 version
@@ -140,6 +145,7 @@ Speak & Math:
- TMS51xx: CD2801
- VSM(1/2): 16KB CD2392
- VSM(2/2): 16KB CD2393
+ - VFD: Futaba 9SY -02Z 7E
- notes: As with the Speak & Spell, the voice actor was a radio announcer.
However, the phrase "is greater than or less than" had to be added in a
hurry by one of the TI employees in a hurry, the day before a demo.
@@ -166,6 +172,7 @@ Speak & Read:
- TMS51xx: CD2801
- VSM(1/2): 16KB CD2394(rev.A)
- VSM(2/2): 16KB CD2395(rev.A)
+ - VFD: same as Language Tutor, rightmost digit unused
Speak & Read modules:
@@ -297,6 +304,7 @@ A later device, called Language Teacher, was released without speech hardware.
Language Tutor (US), 1978
- MCU: TMC0275*
- TMS51xx: CD2801
+ - VFD: NEC FIP10xxx?
- notes: external module is required (see below)
Language Tutor modules:
@@ -331,7 +339,6 @@ Language Tutor modules:
TODO:
- why doesn't lantutor work?
- - tntell/vocaid: able to get overlay code from external artwork file
- emulate other known devices
@@ -345,6 +352,7 @@ Language Tutor modules:
// internal artwork
#include "lantutor.lh"
+#include "snmath.lh"
#include "snspell.lh"
#include "tntell.lh" // keyboard overlay
@@ -479,7 +487,7 @@ DRIVER_INIT_MEMBER(tispeak_state, lantutor)
void tispeak_state::prepare_display()
{
- display_matrix_seg(16, 16, m_o, (m_r & 0x8000) ? (m_r & 0x21ff) : 0, 0x3fff);
+ display_matrix_seg(16, 16, m_plate, (m_r & 0x8000) ? m_grid : 0, 0x3fff);
}
WRITE16_MEMBER(tispeak_state::snspell_write_r)
@@ -492,14 +500,16 @@ WRITE16_MEMBER(tispeak_state::snspell_write_r)
// R15: filament on
// other bits: MCU internal use
m_r = m_inp_mux = data;
+ m_grid = data & 0x1ff;
prepare_display();
}
WRITE16_MEMBER(tispeak_state::snspell_write_o)
{
// reorder opla to led14seg, plus DP as d14 and AP as d15:
+ // note: lantutor and snread VFD has an accent triangle instead of DP, and no AP
// E,D,C,G,B,A,I,M,L,K,N,J,[AP],H,F,[DP] (sidenote: TI KLMN = MAME MLNK)
- m_o = BITSWAP16(data,12,15,10,7,8,9,11,6,13,3,14,0,1,2,4,5);
+ m_plate = BITSWAP16(data,12,15,10,7,8,9,11,6,13,3,14,0,1,2,4,5);
prepare_display();
}
@@ -524,9 +534,9 @@ void tispeak_state::snspell_power_off()
WRITE16_MEMBER(tispeak_state::snmath_write_o)
{
- // reorder opla to led14seg, plus DP as d14 and AP as d15:
- // [DP],D,C,H,F,B,I,M,L,K,N,J,[AP],E,G,A (sidenote: TI KLMN = MAME MLNK)
- m_o = BITSWAP16(data,12,0,10,7,8,9,11,6,3,14,4,13,1,2,5,15);
+ // reorder opla to led14seg, plus DP as d14 and CT as d15:
+ // [DP],D,C,H,F,B,I,M,L,K,N,J,[CT],E,G,A (sidenote: TI KLMN = MAME MLNK)
+ m_plate = BITSWAP16(data,12,0,10,7,8,9,11,6,3,14,4,13,1,2,5,15);
prepare_display();
}
@@ -537,6 +547,7 @@ WRITE16_MEMBER(tispeak_state::lantutor_write_r)
{
// same as default, except R13 is used for an extra digit
m_r = m_inp_mux = data;
+ m_grid = data & 0x21ff;
prepare_display();
}
@@ -585,7 +596,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(tispeak_state::tntell_get_overlay)
// which one is active(if any). If it matches with the internal ROM or
// external module, the game continues.
// 00 for none, 1F for diagnostics, see comment section above for a list
- m_overlay = m_inp_matrix[10]->read();
+
+ // try to get overlay code from artwork file(in decimal), otherwise pick the
+ // one that was selected in machine configuration
+ m_overlay = output_get_value("overlay_code") & 0x1f;
+ if (m_overlay == 0)
+ m_overlay = m_inp_matrix[10]->read();
for (int i = 0; i < 5; i++)
output_set_indexed_value("ol", i+1, m_overlay >> i & 1);
@@ -838,7 +854,7 @@ static INPUT_PORTS_START( tntell )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_STOP) PORT_CODE(KEYCODE_PGUP) PORT_NAME("Grid 6-6 (On)") PORT_CHANGED_MEMBER(DEVICE_SELF, tispeak_state, snspell_power_button, (void *)true)
PORT_START("IN.10")
- PORT_CONFNAME( 0x1f, 0x01, "Overlay Code" )
+ PORT_CONFNAME( 0x1f, 0x04, "Overlay Code" ) // only if not provided by external artwork
PORT_CONFSETTING( 0x00, "00 (None)" )
PORT_CONFSETTING( 0x01, "01" )
PORT_CONFSETTING( 0x02, "02" )
@@ -905,7 +921,7 @@ static MACHINE_CONFIG_START( snmath, tispeak_state )
MCFG_TMS0270_WRITE_PDC_CB(DEVWRITELINE("tms5100", tms5110_device, pdc_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1))
- MCFG_DEFAULT_LAYOUT(layout_snspell) // max 9 digits
+ MCFG_DEFAULT_LAYOUT(layout_snmath)
/* no video! */
@@ -924,6 +940,8 @@ static MACHINE_CONFIG_DERIVED( sns_cd2801, snmath )
MCFG_CPU_MODIFY("maincpu")
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snspell_write_o))
+ MCFG_DEFAULT_LAYOUT(layout_snspell)
+
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snspell")
MCFG_GENERIC_EXTENSIONS("vsm")
@@ -946,6 +964,12 @@ static MACHINE_CONFIG_DERIVED( sns_tmc0281d, sns_cd2801 )
MCFG_FRAGMENT_ADD(tms5110_route)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( sns_cd2801_m, sns_cd2801 )
+
+ /* basic machine hardware */
+ MCFG_DEFAULT_LAYOUT(layout_snmath)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( snread, snmath )
@@ -953,6 +977,8 @@ static MACHINE_CONFIG_DERIVED( snread, snmath )
MCFG_CPU_MODIFY("maincpu")
MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tispeak_state, snspell_write_o))
+ MCFG_DEFAULT_LAYOUT(layout_lantutor)
+
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "snread")
MCFG_GENERIC_EXTENSIONS("vsm")
@@ -1021,6 +1047,8 @@ MACHINE_CONFIG_END
***************************************************************************/
+#define rom_snspellp rom_snspell // until we have a correct dump
+
ROM_START( snspell )
ROM_REGION( 0x1000, "maincpu", 0 )
ROM_LOAD( "us4189779_tmc0271", 0x0000, 0x1000, CRC(d3f5a37d) SHA1(f75ab617a6067d4d3a954a9f86126d2089554df8) ) // typed in from patent US4189779, verified by 2 sources
@@ -1285,14 +1313,15 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */
-COMP( 1978, snspell, 0, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1978 version/patent)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
-COMP( 1979, snspella, snspell, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1979 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
+COMP( 1978, snspell, 0, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1978 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // incomplete dump, uses patent MCU ROM
+COMP( 1978, snspellp, snspell, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, patent)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
+COMP( 1979, snspella, snspell, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1979 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
COMP( 1980, snspellb, snspell, 0, sns_tmc0281d,snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (US, 1980 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
COMP( 1978, snspelluk, snspell, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1978 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
-COMP( 1981, snspelluka, snspell, 0, sns_cd2801, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1981 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
+COMP( 1981, snspelluka, snspell, 0, sns_cd2801_m,snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (UK, 1981 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
COMP( 1979, snspelljp, snspell, 0, sns_tmc0281, snspell, tispeak_state, snspell, "Texas Instruments", "Speak & Spell (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
COMP( 1980, snspellfr, snspell, 0, sns_cd2801, snspell, tispeak_state, snspell, "Texas Instruments", "La Dictee Magique (France)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // doesn't work due to missing CD2702 MCU dump, German/Italian version has CD2702 too
-COMP( 1982, snspellit, snspell, 0, sns_cd2801, snspell, tispeak_state, snspell, "Texas Instruments", "Grillo Parlante (Italy)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
+COMP( 1982, snspellit, snspell, 0, sns_cd2801_m,snspell, tispeak_state, snspell, "Texas Instruments", "Grillo Parlante (Italy)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // "
COMP( 1986, snmath, 0, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1986 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND )
COMP( 1980, snmathp, snmath, 0, snmath, snmath, driver_device, 0, "Texas Instruments", "Speak & Math (US, 1980 version/patent)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
@@ -1302,8 +1331,8 @@ COMP( 1980, snread, 0, 0, snread, snread, tispeak_state, snspe
COMP( 1979, lantutor, 0, 0, lantutor, lantutor, tispeak_state, lantutor, "Texas Instruments", "Language Tutor (patent)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING )
COMP( 1981, tntell, 0, 0, tntell, tntell, tispeak_state, tntell, "Texas Instruments", "Touch & Tell (US, 1981 version)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK ) // assume there is an older version too, with CD8010 MCU
+COMP( 1980, tntellp, tntell, 0, tntell, tntell, tispeak_state, tntell, "Texas Instruments", "Touch & Tell (patent)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING )
COMP( 1981, tntelluk, tntell, 0, tntell, tntell, tispeak_state, tntell, "Texas Instruments", "Touch & Tell (UK)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK )
COMP( 1981, tntellfr, tntell, 0, tntell, tntell, tispeak_state, tntell, "Texas Instruments", "Le Livre Magique (France)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK )
-COMP( 1980, tntellp, tntell, 0, tntell, tntell, tispeak_state, tntell, "Texas Instruments", "Touch & Tell (patent)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK | MACHINE_NOT_WORKING )
COMP( 1982, vocaid, 0, 0, vocaid, tntell, driver_device, 0, "Texas Instruments", "Vocaid", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND | MACHINE_REQUIRES_ARTWORK )
diff --git a/src/mess/drivers/trs80.c b/src/mess/drivers/trs80.c
index 629b13e1467..8a9c0c3af24 100644
--- a/src/mess/drivers/trs80.c
+++ b/src/mess/drivers/trs80.c
@@ -604,7 +604,9 @@ static MACHINE_CONFIG_DERIVED( model1, trs80 ) // model I, level II
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(trs80_state,trs80_fdc_intrq_w))
MCFG_FLOPPY_DRIVE_ADD("fdc:0", trs80_floppies, "sssd", trs80_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", trs80_floppies, "sssd", trs80_state::floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:2", trs80_floppies, "", trs80_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:3", trs80_floppies, "", trs80_state::floppy_formats)
diff --git a/src/mess/drivers/ts802.c b/src/mess/drivers/ts802.c
index 33f3e44f4db..19680c956cb 100644
--- a/src/mess/drivers/ts802.c
+++ b/src/mess/drivers/ts802.c
@@ -213,6 +213,7 @@ static MACHINE_CONFIG_START( ts802, ts802_state )
MCFG_FD1793_ADD("fdc", XTAL_4MHz / 2) // unknown clock
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ts802_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/v6809.c b/src/mess/drivers/v6809.c
index 111fdd699bb..1b408d95335 100644
--- a/src/mess/drivers/v6809.c
+++ b/src/mess/drivers/v6809.c
@@ -360,6 +360,7 @@ static MACHINE_CONFIG_START( v6809, v6809_state )
MCFG_MB8876_ADD("fdc", XTAL_16MHz / 16)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", v6809_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MACHINE_CONFIG_END
/* ROM definition */
diff --git a/src/mess/drivers/wildfire.c b/src/mess/drivers/wildfire.c
index bb1df824cf5..992fcbc544c 100644
--- a/src/mess/drivers/wildfire.c
+++ b/src/mess/drivers/wildfire.c
@@ -9,7 +9,7 @@
to create the illusion of a moving ball, and even the flippers are leds.
A drawing of a pinball table is added as overlay.
- NOTE!: MAME external artwork is recommended
+ NOTE!: MAME external artwork is required
TODO:
diff --git a/src/mess/drivers/zorba.c b/src/mess/drivers/zorba.c
index 15784fc5876..2b0a9aed58d 100644
--- a/src/mess/drivers/zorba.c
+++ b/src/mess/drivers/zorba.c
@@ -403,9 +403,10 @@ static MACHINE_CONFIG_START( zorba, zorba_state )
MCFG_FD1793_ADD("fdc", XTAL_24MHz / 24)
MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(zorba_state, fdc_intrq_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(zorba_state, fdc_drq_w))
- //MCFG_WD_FDC_FORCE_READY
MCFG_FLOPPY_DRIVE_ADD("fdc:0", zorba_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", zorba_floppies, "525dd", floppy_image_device::default_floppy_formats)
+ MCFG_FLOPPY_DRIVE_SOUND(true)
/* Keyboard */
MCFG_DEVICE_ADD("keyboard", GENERIC_KEYBOARD, 0)
diff --git a/src/mess/includes/c128.h b/src/mess/includes/c128.h
index 0a1ca6c9cb8..c32b2afd726 100644
--- a/src/mess/includes/c128.h
+++ b/src/mess/includes/c128.h
@@ -171,6 +171,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( cia1_cnt_w );
DECLARE_WRITE_LINE_MEMBER( cia1_sp_w );
DECLARE_READ8_MEMBER( cia1_pa_r );
+ DECLARE_WRITE8_MEMBER( cia1_pa_w );
DECLARE_READ8_MEMBER( cia1_pb_r );
DECLARE_WRITE8_MEMBER( cia1_pb_w );
diff --git a/src/mess/includes/c64.h b/src/mess/includes/c64.h
index a9adca1291f..787fe5a6f60 100644
--- a/src/mess/includes/c64.h
+++ b/src/mess/includes/c64.h
@@ -34,42 +34,42 @@
class c64_state : public driver_device
{
public:
- c64_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, M6510_TAG),
- m_pla(*this, PLA_TAG),
- m_vic(*this, MOS6569_TAG),
- m_sid(*this, MOS6581_TAG),
- m_cia1(*this, MOS6526_1_TAG),
- m_cia2(*this, MOS6526_2_TAG),
- m_iec(*this, CBM_IEC_TAG),
- m_joy1(*this, CONTROL1_TAG),
- m_joy2(*this, CONTROL2_TAG),
- m_exp(*this, C64_EXPANSION_SLOT_TAG),
- m_user(*this, PET_USER_PORT_TAG),
- m_ram(*this, RAM_TAG),
- m_cassette(*this, PET_DATASSETTE_PORT_TAG),
- m_color_ram(*this, "color_ram"),
- m_row0(*this, "ROW0"),
- m_row1(*this, "ROW1"),
- m_row2(*this, "ROW2"),
- m_row3(*this, "ROW3"),
- m_row4(*this, "ROW4"),
- m_row5(*this, "ROW5"),
- m_row6(*this, "ROW6"),
- m_row7(*this, "ROW7"),
- m_lock(*this, "LOCK"),
- m_loram(1),
- m_hiram(1),
- m_charen(1),
- m_va14(1),
- m_va15(1),
- m_restore(1),
- m_cia1_irq(CLEAR_LINE),
- m_cia2_irq(CLEAR_LINE),
- m_vic_irq(CLEAR_LINE),
- m_exp_irq(CLEAR_LINE),
- m_exp_nmi(CLEAR_LINE)
+ c64_state(const machine_config &mconfig, device_type type, const char *tag) :
+ driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6510_TAG),
+ m_pla(*this, PLA_TAG),
+ m_vic(*this, MOS6569_TAG),
+ m_sid(*this, MOS6581_TAG),
+ m_cia1(*this, MOS6526_1_TAG),
+ m_cia2(*this, MOS6526_2_TAG),
+ m_iec(*this, CBM_IEC_TAG),
+ m_joy1(*this, CONTROL1_TAG),
+ m_joy2(*this, CONTROL2_TAG),
+ m_exp(*this, C64_EXPANSION_SLOT_TAG),
+ m_user(*this, PET_USER_PORT_TAG),
+ m_ram(*this, RAM_TAG),
+ m_cassette(*this, PET_DATASSETTE_PORT_TAG),
+ m_color_ram(*this, "color_ram"),
+ m_row0(*this, "ROW0"),
+ m_row1(*this, "ROW1"),
+ m_row2(*this, "ROW2"),
+ m_row3(*this, "ROW3"),
+ m_row4(*this, "ROW4"),
+ m_row5(*this, "ROW5"),
+ m_row6(*this, "ROW6"),
+ m_row7(*this, "ROW7"),
+ m_lock(*this, "LOCK"),
+ m_loram(1),
+ m_hiram(1),
+ m_charen(1),
+ m_va14(1),
+ m_va15(1),
+ m_restore(1),
+ m_cia1_irq(CLEAR_LINE),
+ m_cia2_irq(CLEAR_LINE),
+ m_vic_irq(CLEAR_LINE),
+ m_exp_irq(CLEAR_LINE),
+ m_exp_nmi(CLEAR_LINE)
{ }
// ROM
@@ -121,6 +121,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( cia1_irq_w );
DECLARE_READ8_MEMBER( cia1_pa_r );
+ DECLARE_WRITE8_MEMBER( cia1_pa_w );
DECLARE_READ8_MEMBER( cia1_pb_r );
DECLARE_WRITE8_MEMBER( cia1_pb_w );
diff --git a/src/mess/includes/coco.h b/src/mess/includes/coco.h
index a43af0d40f0..363fcff5d2a 100644
--- a/src/mess/includes/coco.h
+++ b/src/mess/includes/coco.h
@@ -153,8 +153,8 @@ protected:
void recalculate_firq(void);
// changed handlers
- virtual void pia1_pa_changed(void);
- virtual void pia1_pb_changed(void);
+ virtual void pia1_pa_changed(UINT8 data);
+ virtual void pia1_pb_changed(UINT8 data);
// miscellaneous
virtual void update_keyboard_input(UINT8 value, UINT8 z);
@@ -208,7 +208,6 @@ private:
bool is_joystick_hires(int joystick_index);
soundmux_status_t soundmux_status(void);
- UINT8 sound_value(void);
void update_sound(void);
bool joyin(void);
void poll_joystick(bool *joyin, UINT8 *buttons);
@@ -244,6 +243,10 @@ private:
// DAC output
UINT8 m_dac_output;
+ // remember the last audio sample level from the analog sources (DAC, cart, cassette) so that we don't
+ // introduce step changes when the audio output is enabled/disabled via PIA1 CB2
+ UINT8 m_analog_audio_level;
+
// hires interface
emu_timer *m_hiresjoy_transition_timer[2];
bool m_hiresjoy_ca;
diff --git a/src/mess/includes/coco12.h b/src/mess/includes/coco12.h
index c264ad092e5..030adc35b25 100644
--- a/src/mess/includes/coco12.h
+++ b/src/mess/includes/coco12.h
@@ -56,7 +56,7 @@ protected:
virtual void update_cart_base(UINT8 *cart_base);
/* PIA1 */
- virtual void pia1_pb_changed(void);
+ virtual void pia1_pb_changed(UINT8 data);
private:
diff --git a/src/mess/includes/dragon.h b/src/mess/includes/dragon.h
index 6db0d5f86a2..7006d37e68d 100644
--- a/src/mess/includes/dragon.h
+++ b/src/mess/includes/dragon.h
@@ -45,7 +45,7 @@ public:
required_device<printer_image_device> m_printer;
protected:
- virtual void pia1_pa_changed(void);
+ virtual void pia1_pa_changed(UINT8 data);
};
@@ -65,7 +65,7 @@ protected:
virtual DECLARE_READ8_MEMBER( ff00_read );
virtual DECLARE_WRITE8_MEMBER( ff00_write );
- virtual void pia1_pb_changed(void);
+ virtual void pia1_pb_changed(UINT8 data);
void page_rom(bool romswitch);
};
diff --git a/src/mess/includes/hh_tms1k.h b/src/mess/includes/hh_tms1k.h
index 2d4149fcee4..edcea970b64 100644
--- a/src/mess/includes/hh_tms1k.h
+++ b/src/mess/includes/hh_tms1k.h
@@ -49,6 +49,9 @@ public:
int m_display_maxy; // display matrix number of rows
int m_display_maxx; // display matrix number of columns (max 31 for now)
+ UINT32 m_grid; // VFD current row data
+ UINT32 m_plate; // VFD current column data
+
UINT32 m_display_state[0x20]; // display matrix rows data (last bit is used for always-on)
UINT16 m_display_segmask[0x20]; // if not 0, display matrix row is a digit, mask indicates connected segments
UINT32 m_display_cache[0x20]; // (internal use)
diff --git a/src/mess/layout/4004clk.lay b/src/mess/layout/4004clk.lay
index c8c84d3ac84..e3ec9522743 100644
--- a/src/mess/layout/4004clk.lay
+++ b/src/mess/layout/4004clk.lay
@@ -1,18 +1,47 @@
<?xml version="1.0"?>
<mamelayout version="2">
- <element name="background">
- <rect>
- <bounds left="0" top="0" right="1" bottom="1" />
- <color red="0.0" green="0.0" blue="0.0" />
- </rect>
+
+<!-- define elements -->
+
+ <element name="digit" defstate="10">
+ <rect><color red="0.1" green="0.06" blue="0.02" /></rect>
+ <text state="0" string="0"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="1" string="1"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="2" string="2"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="3" string="3"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="4" string="4"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="5" string="5"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="6" string="6"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="7" string="7"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="8" string="8"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="9" string="9"><color red="1.0" green="0.6" blue="0.2" /></text>
+ <text state="10" string=" "><color red="1.0" green="0.6" blue="0.2" /></text>
</element>
- <element name="warning"><text string="Mandatory Artwork '4004clk.zip' is missing from 'Artwork' folder."><color red="1.0" green="0.5" blue="0.5" /></text></element>
- <view name="artwork_missing">
- <bezel element="background">
- <bounds left="0" top="0" right="580" bottom="150" />
- </bezel>
- <bezel name="warning_txt" element="warning">
- <bounds left="50" right="530" top="50" bottom="65" />
- </bezel>
+
+ <element name="dot" defstate="0">
+ <disk state="0"><color red="0.1" green="0.06" blue="0.02" /></disk>
+ <disk state="1"><color red="1.0" green="0.6" blue="0.2" /></disk>
+ </element>
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-1" right="67.9" top="-1" bottom="16" />
+
+ <!-- 3*2 neon digits, separated by colons -->
+
+ <bezel name="nixie0" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel>
+ <bezel name="nixie1" element="digit"><bounds x="10.3" y="0" width="10" height="15" /></bezel>
+ <bezel name="nixie2" element="digit"><bounds x="23.3" y="0" width="10" height="15" /></bezel>
+ <bezel name="nixie3" element="digit"><bounds x="33.6" y="0" width="10" height="15" /></bezel>
+ <bezel name="nixie4" element="digit"><bounds x="46.6" y="0" width="10" height="15" /></bezel>
+ <bezel name="nixie5" element="digit"><bounds x="56.9" y="0" width="10" height="15" /></bezel>
+
+ <bezel name="neon1" element="dot"><bounds x="21.05" y="4.35" width="1.5" height="1.5" /></bezel>
+ <bezel name="neon0" element="dot"><bounds x="21.05" y="9.15" width="1.5" height="1.5" /></bezel>
+ <bezel name="neon2" element="dot"><bounds x="44.35" y="4.35" width="1.5" height="1.5" /></bezel>
+ <bezel name="neon3" element="dot"><bounds x="44.35" y="9.15" width="1.5" height="1.5" /></bezel>
+
</view>
</mamelayout>
diff --git a/src/mess/layout/aim65.lay b/src/mess/layout/aim65.lay
index 1ab154fe1b5..b250dc48b35 100644
--- a/src/mess/layout/aim65.lay
+++ b/src/mess/layout/aim65.lay
@@ -1,98 +1,133 @@
-<!-- aim65.lay -->
+<?xml version="1.0"?>
+<mamelayout version="2">
<!-- 2007-07-30: Initial version. [Dirk Best] -->
+<!-- 2015-08-14: Eric Roberts version. [Best of the Best 2] -->
-<mamelayout version="2">
+
+<!-- define elements -->
<element name="digit" defstate="0">
<led16seg>
<!-- Note: Peak wavelength of the DL1416 chips = 660 nm -->
- <color red="1.0" green="0.0" blue="0.0" />
+ <color red="1.0" green="0.15" blue="0.2" />
</led16seg>
</element>
- <element name="background">
- <rect>
- <bounds left="0" top="0" right="1" bottom="1" />
- <color red="0.0" green="0.0" blue="0.0" />
- </rect>
- </element>
+ <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element>
+ <element name="static_white"><rect><color red="0.85" green="0.84" blue="0.84" /></rect></element>
- <view name="Default Layout">
- <!-- Black background -->
- <bezel element="background">
- <bounds left="55" top="60" right="758" bottom="130" />
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="50" top="20" right="770" bottom="141" />
+ <bezel element="static_black">
+ <bounds left="50" top="20" right="770" bottom="141" />
</bezel>
+ <!-- bezel -->
+
+ <bezel element="static_white"><bounds left="50" top="20" right="770" bottom="141" /></bezel>
+ <bezel element="static_black"><bounds left="53" top="23" right="767" bottom="138" /></bezel>
+
+ <bezel element="static_white"><bounds x="63" y="129" width="2" height="10" /></bezel>
+ <bezel element="static_white"><bounds x="97" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="131" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="165" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="202" y="135" width="2" height="4" /></bezel>
+
+ <bezel element="static_white"><bounds x="236" y="129" width="2" height="10" /></bezel>
+ <bezel element="static_white"><bounds x="270" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="304" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="341" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="375" y="135" width="2" height="4" /></bezel>
+
+ <bezel element="static_white"><bounds x="409" y="129" width="2" height="10" /></bezel>
+ <bezel element="static_white"><bounds x="443" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="480" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="514" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="548" y="135" width="2" height="4" /></bezel>
+
+ <bezel element="static_white"><bounds x="582" y="129" width="2" height="10" /></bezel>
+ <bezel element="static_white"><bounds x="619" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="653" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="687" y="135" width="2" height="4" /></bezel>
+ <bezel element="static_white"><bounds x="721" y="135" width="2" height="4" /></bezel>
+
+ <bezel element="static_white"><bounds x="755" y="129" width="2" height="10" /></bezel>
+
+
+ <!-- digits -->
+
<!-- DL1416A DS1 -->
<bezel name="digit0" element="digit">
- <bounds left="65" top="70" right="90" bottom="120" />
+ <bounds left="65" top="80" right="90" bottom="120" />
</bezel>
<bezel name="digit1" element="digit">
- <bounds left="99" top="70" right="124" bottom="120" />
+ <bounds left="99" top="80" right="124" bottom="120" />
</bezel>
<bezel name="digit2" element="digit">
- <bounds left="133" top="70" right="158" bottom="120" />
+ <bounds left="133" top="80" right="158" bottom="120" />
</bezel>
<bezel name="digit3" element="digit">
- <bounds left="167" top="70" right="192" bottom="120" />
+ <bounds left="167" top="80" right="192" bottom="120" />
</bezel>
<!-- DL1416A DS2 -->
<bezel name="digit4" element="digit">
- <bounds left="204" top="70" right="229" bottom="120" />
+ <bounds left="204" top="80" right="229" bottom="120" />
</bezel>
<bezel name="digit5" element="digit">
- <bounds left="238" top="70" right="263" bottom="120" />
+ <bounds left="238" top="80" right="263" bottom="120" />
</bezel>
<bezel name="digit6" element="digit">
- <bounds left="272" top="70" right="297" bottom="120" />
+ <bounds left="272" top="80" right="297" bottom="120" />
</bezel>
<bezel name="digit7" element="digit">
- <bounds left="306" top="70" right="331" bottom="120" />
+ <bounds left="306" top="80" right="331" bottom="120" />
</bezel>
<!-- DL1416A DS3 -->
<bezel name="digit8" element="digit">
- <bounds left="343" top="70" right="368" bottom="120" />
+ <bounds left="343" top="80" right="368" bottom="120" />
</bezel>
<bezel name="digit9" element="digit">
- <bounds left="377" top="70" right="402" bottom="120" />
+ <bounds left="377" top="80" right="402" bottom="120" />
</bezel>
<bezel name="digit10" element="digit">
- <bounds left="411" top="70" right="436" bottom="120" />
+ <bounds left="411" top="80" right="436" bottom="120" />
</bezel>
<bezel name="digit11" element="digit">
- <bounds left="445" top="70" right="470" bottom="120" />
+ <bounds left="445" top="80" right="470" bottom="120" />
</bezel>
<!-- DL1416A DS4 -->
<bezel name="digit12" element="digit">
- <bounds left="482" top="70" right="507" bottom="120" />
+ <bounds left="482" top="80" right="507" bottom="120" />
</bezel>
<bezel name="digit13" element="digit">
- <bounds left="516" top="70" right="541" bottom="120" />
+ <bounds left="516" top="80" right="541" bottom="120" />
</bezel>
<bezel name="digit14" element="digit">
- <bounds left="550" top="70" right="575" bottom="120" />
+ <bounds left="550" top="80" right="575" bottom="120" />
</bezel>
<bezel name="digit15" element="digit">
- <bounds left="584" top="70" right="609" bottom="120" />
+ <bounds left="584" top="80" right="609" bottom="120" />
</bezel>
<!-- DL1416A DS5 -->
<bezel name="digit16" element="digit">
- <bounds left="621" top="70" right="646" bottom="120" />
+ <bounds left="621" top="80" right="646" bottom="120" />
</bezel>
<bezel name="digit17" element="digit">
- <bounds left="655" top="70" right="680" bottom="120" />
+ <bounds left="655" top="80" right="680" bottom="120" />
</bezel>
<bezel name="digit18" element="digit">
- <bounds left="689" top="70" right="714" bottom="120" />
+ <bounds left="689" top="80" right="714" bottom="120" />
</bezel>
<bezel name="digit19" element="digit">
- <bounds left="723" top="70" right="748" bottom="120" />
+ <bounds left="723" top="80" right="748" bottom="120" />
</bezel>
</view>
diff --git a/src/mess/layout/lantutor.lay b/src/mess/layout/lantutor.lay
index 2bb1fb677ab..bfdf2189350 100644
--- a/src/mess/layout/lantutor.lay
+++ b/src/mess/layout/lantutor.lay
@@ -20,6 +20,8 @@
<view name="Internal Layout">
<bounds left="0" right="111" top="0" bottom="19" />
+ <!-- 10 digits (snread doesn't use the last digit) -->
+
<bezel name="digit0" element="digit"><bounds x="0" y="4" width="10" height="15" /></bezel>
<bezel name="digit1" element="digit"><bounds x="11" y="4" width="10" height="15" /></bezel>
<bezel name="digit2" element="digit"><bounds x="22" y="4" width="10" height="15" /></bezel>
diff --git a/src/mess/layout/snmath.lay b/src/mess/layout/snmath.lay
new file mode 100644
index 00000000000..ca1eb371aea
--- /dev/null
+++ b/src/mess/layout/snmath.lay
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<mamelayout version="2">
+
+<!-- define elements -->
+
+ <element name="digit" defstate="0">
+ <led14seg><color red="0.2" green="1.0" blue="0.85" /></led14seg>
+ </element>
+
+<!-- add our own for DP(display point) and the CT(comma tail) segments -->
+<!-- MAME led16segsc won't do, since Speak & Math has them on the left side -->
+
+ <element name="lamp_dp" defstate="0">
+ <disk state="0"><color red="0.0235" green="0.1255" blue="0.1059" /></disk>
+ <disk state="1"><color red="0.2" green="1.0" blue="0.85" /></disk>
+ </element>
+ <element name="lamp_ct" defstate="0">
+ <rect state="0"><color red="0.0235" green="0.1255" blue="0.1059" /></rect>
+ <rect state="1"><color red="0.2" green="1.0" blue="0.85" /></rect>
+ </element>
+
+
+
+<!-- build screen -->
+
+ <view name="Internal Layout">
+ <bounds left="-1.5" right="99" top="0" bottom="15" />
+
+ <!-- 9 digits -->
+
+ <bezel name="digit0" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp14" element="lamp_dp"><bounds x="-1.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp15" element="lamp_ct"><bounds x="-0.8" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit1" element="digit"><bounds x="11" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp114" element="lamp_dp"><bounds x="9.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp115" element="lamp_ct"><bounds x="10.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit2" element="digit"><bounds x="22" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp214" element="lamp_dp"><bounds x="20.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp215" element="lamp_ct"><bounds x="21.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit3" element="digit"><bounds x="33" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp314" element="lamp_dp"><bounds x="31.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp315" element="lamp_ct"><bounds x="32.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit4" element="digit"><bounds x="44" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp414" element="lamp_dp"><bounds x="42.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp415" element="lamp_ct"><bounds x="43.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit5" element="digit"><bounds x="55" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp514" element="lamp_dp"><bounds x="53.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp515" element="lamp_ct"><bounds x="54.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit6" element="digit"><bounds x="66" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp614" element="lamp_dp"><bounds x="64.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp615" element="lamp_ct"><bounds x="65.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit7" element="digit"><bounds x="77" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp714" element="lamp_dp"><bounds x="75.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp715" element="lamp_ct"><bounds x="76.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ <bezel name="digit8" element="digit"><bounds x="88" y="0" width="10" height="15" /></bezel>
+ <bezel name="lamp814" element="lamp_dp"><bounds x="86.5" y="11" width="1.5" height="1.5" /></bezel>
+ <bezel name="lamp815" element="lamp_ct"><bounds x="87.2" y="13.5" width="0.75" height="1.5" /></bezel>
+
+ </view>
+</mamelayout>
diff --git a/src/mess/layout/snspell.lay b/src/mess/layout/snspell.lay
index 67e78617995..e84c2e9fdfb 100644
--- a/src/mess/layout/snspell.lay
+++ b/src/mess/layout/snspell.lay
@@ -25,9 +25,9 @@
<!-- build screen -->
<view name="Internal Layout">
- <bounds left="0" right="100" top="0" bottom="15" />
+ <bounds left="0" right="89" top="0" bottom="15" />
- <!-- 9 digits (snspell has 8, snmath has 9) -->
+ <!-- 8 digits -->
<bezel name="digit0" element="digit"><bounds x="0" y="0" width="10" height="15" /></bezel>
<bezel name="lamp14" element="lamp_dp"><bounds x="9" y="13.5" width="1.5" height="1.5" /></bezel>
@@ -61,9 +61,5 @@
<bezel name="lamp714" element="lamp_dp"><bounds x="86" y="13.5" width="1.5" height="1.5" /></bezel>
<bezel name="lamp715" element="lamp_ap"><bounds x="87.5" y="0" width="0.5" height="3.5" /></bezel>
- <bezel name="digit8" element="digit"><bounds x="88" y="0" width="10" height="15" /></bezel>
- <bezel name="lamp814" element="lamp_dp"><bounds x="97" y="13.5" width="1.5" height="1.5" /></bezel>
- <bezel name="lamp815" element="lamp_ap"><bounds x="98.5" y="0" width="0.5" height="3.5" /></bezel>
-
</view>
</mamelayout>
diff --git a/src/mess/layout/supercon.lay b/src/mess/layout/supercon.lay
deleted file mode 100644
index 5b5f73955fc..00000000000
--- a/src/mess/layout/supercon.lay
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-<mamelayout version="2">
- <element name="background">
- <rect>
- <bounds left="0" top="0" right="1" bottom="1" />
- <color red="0.0" green="0.0" blue="0.0" />
- </rect>
- </element>
- <element name="warning"><text string="Mandatory Artwork 'supercon.zip' is missing from 'Artwork' folder."><color red="1.0" green="0.5" blue="0.5" /></text></element>
- <view name="artwork_missing">
- <bezel element="background">
- <bounds left="0" top="0" right="580" bottom="150" />
- </bezel>
- <bezel name="warning_txt" element="warning">
- <bounds left="50" right="530" top="50" bottom="65" />
- </bezel>
- </view>
-</mamelayout>
diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c
index 537375b17cc..4f7f64f0f7c 100644
--- a/src/mess/machine/apple2gs.c
+++ b/src/mess/machine/apple2gs.c
@@ -143,7 +143,7 @@ void apple2gs_state::process_clock()
seconds_t current_interval;
/* update clock_curtime */
- current_interval = machine().time().seconds;
+ current_interval = machine().time().seconds();
m_clock_curtime += current_interval - m_clock_curtime_interval;
m_clock_curtime_interval = current_interval;
diff --git a/src/mess/machine/coco.c b/src/mess/machine/coco.c
index 7994f5b9caa..d28fa1b3412 100644
--- a/src/mess/machine/coco.c
+++ b/src/mess/machine/coco.c
@@ -183,6 +183,7 @@ void coco_state::device_reset()
/* reset state */
m_dac_output = 0;
+ m_analog_audio_level = 0;
m_hiresjoy_ca = false;
m_dclg_previous_bit = false;
m_dclg_output_h = 0;
@@ -364,7 +365,7 @@ WRITE8_MEMBER( coco_state::pia0_pb_w )
WRITE_LINE_MEMBER( coco_state::pia0_ca2_w )
{
- update_sound();
+ update_sound(); // analog mux SEL1 is tied to PIA0 CA2
poll_keyboard();
}
@@ -376,7 +377,7 @@ WRITE_LINE_MEMBER( coco_state::pia0_ca2_w )
WRITE_LINE_MEMBER( coco_state::pia0_cb2_w )
{
- update_sound();
+ update_sound(); // analog mux SEL2 is tied to PIA0 CB2
poll_keyboard();
}
@@ -456,6 +457,8 @@ WRITE8_MEMBER( coco_state::ff20_write )
READ8_MEMBER( coco_state::pia1_pa_r )
{
+ // Port A: we need to specify the values of all the lines, regardless of whether
+ // they are in input or output mode in the DDR
return (m_cassette->input() >= 0 ? 0x01 : 0x00)
| (dac_output() << 2);
}
@@ -470,6 +473,8 @@ READ8_MEMBER( coco_state::pia1_pa_r )
READ8_MEMBER( coco_state::pia1_pb_r )
{
+ // Port B: lines in output mode are handled automatically by the PIA object.
+ // We only need to specify the input lines here
UINT32 ram_size = m_ram->size();
// For the CoCo 1, the logic has been changed to only select 64K rams
@@ -479,7 +484,7 @@ READ8_MEMBER( coco_state::pia1_pb_r )
// to access 32K of ram, and also allows the cocoe driver to access
// the full 64K, as this uses Color Basic 1.2, which can configure 64K rams
bool memory_sense = (ram_size >= 0x4000 && ram_size <= 0x7FFF)
- || (ram_size >= 0x8000 && (m_pia_0->b_output() & 0x80));
+ || (ram_size >= 0x8000 && (m_pia_0->b_output() & 0x40));
// serial in (PB0)
bool serial_in = (m_rs232 != NULL) && (m_rs232->rxd_r() ? true : false);
@@ -497,7 +502,7 @@ READ8_MEMBER( coco_state::pia1_pb_r )
WRITE8_MEMBER( coco_state::pia1_pa_w )
{
- pia1_pa_changed();
+ pia1_pa_changed(data);
}
@@ -508,7 +513,7 @@ WRITE8_MEMBER( coco_state::pia1_pa_w )
WRITE8_MEMBER( coco_state::pia1_pb_w )
{
- pia1_pb_changed();
+ pia1_pb_changed(data);
}
@@ -532,11 +537,7 @@ WRITE_LINE_MEMBER( coco_state::pia1_ca2_w )
WRITE_LINE_MEMBER( coco_state::pia1_cb2_w )
{
- poll_keyboard();
-
- // Theoretically, I should be calling update_sound() here; however this seems to create
- // a buzzing in some CoCo software (e.g. - Popcorn). This is likely because this line
- // drives the MC14529B MUX, and when disabled the output probably goes hi-Z.
+ update_sound(); // SOUND_ENABLE is connected to PIA1 CB2
}
@@ -689,10 +690,25 @@ void coco_state::update_sound(void)
UINT8 cassette_sound = (bCassSoundEnable ? 0x40 : 0);
UINT8 cart_sound = (bCartSoundEnable ? 0x40 : 0);
- /* determine the value to send to the DAC */
+ /* determine the value to send to the DAC (this is used by the Joystick read as well as audio out) */
m_dac_output = (m_pia_1->a_output() & 0xFC) >> 2;
UINT8 dac_sound = (status == SOUNDMUX_ENABLE ? m_dac_output << 1 : 0);
- m_dac->write_unsigned8(single_bit_sound + dac_sound + cassette_sound + cart_sound);
+
+ /* The CoCo uses a single DAC for both audio output and joystick axis position measurement.
+ * To avoid introducing artifacts while reading the axis positions, some software will disable
+ * the audio output while using the DAC to read the joystick. On a real CoCo, there is a low-pass
+ * filter (C57 on the CoCo 3) which will hold the audio level for very short periods of time,
+ * preventing the introduction of artifacts while the joystick value is being read. We are not going
+ * to simulate the exponential decay of a capacitor here. Instead, we will store and hold the last
+ * used analog audio output value while the audio is disabled, to avoid introducing artifacts in
+ * software such as Tandy's Popcorn and Sock Master's Donkey Kong.
+ */
+ if ((status & SOUNDMUX_ENABLE) != 0)
+ {
+ m_analog_audio_level = dac_sound + cassette_sound + cart_sound;
+ }
+
+ m_dac->write_unsigned8(single_bit_sound + m_analog_audio_level);
/* determine the cassette sound status */
cassette_state cas_sound = bCassSoundEnable ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED;
@@ -981,12 +997,12 @@ void coco_state::update_prinout(bool prinout)
// pia1_pa_changed - called when PIA1 PA changes
//-------------------------------------------------
-void coco_state::pia1_pa_changed(void)
+void coco_state::pia1_pa_changed(UINT8 data)
{
- update_sound();
+ update_sound(); // DAC is connected to PIA1 PA2-PA7
poll_keyboard();
update_cassout(dac_output());
- update_prinout(m_pia_1->a_output() & 0x02 ? true : false);
+ update_prinout(data & 0x02 ? true : false);
}
@@ -995,9 +1011,9 @@ void coco_state::pia1_pa_changed(void)
// pia1_pb_changed - called when PIA1 PB changes
//-------------------------------------------------
-void coco_state::pia1_pb_changed(void)
+void coco_state::pia1_pb_changed(UINT8 data)
{
- update_sound();
+ update_sound(); // singe_bit_sound is connected to PIA1 PB1
}
diff --git a/src/mess/machine/coco12.c b/src/mess/machine/coco12.c
index c9a0a9a2afb..e2f3fbdb521 100644
--- a/src/mess/machine/coco12.c
+++ b/src/mess/machine/coco12.c
@@ -94,12 +94,11 @@ READ8_MEMBER( coco12_state::sam_read )
// pia1_pb_changed
//-------------------------------------------------
-void coco12_state::pia1_pb_changed(void)
+void coco12_state::pia1_pb_changed(UINT8 data)
{
/* call inherited function */
- coco_state::pia1_pb_changed();
+ coco_state::pia1_pb_changed(data);
- UINT8 data = m_pia_1->b_output();
m_vdg->css_w(data & 0x08);
m_vdg->intext_w(data & 0x10);
m_vdg->gm0_w(data & 0x10);
diff --git a/src/mess/machine/dragon.c b/src/mess/machine/dragon.c
index ded7ff221e5..12c902d5c93 100644
--- a/src/mess/machine/dragon.c
+++ b/src/mess/machine/dragon.c
@@ -48,13 +48,13 @@ easier to manage.
// pia1_pa_changed - called when PIA1 PA changes
//-------------------------------------------------
-void dragon_state::pia1_pa_changed(void)
+void dragon_state::pia1_pa_changed(UINT8 data)
{
/* call inherited function */
- coco12_state::pia1_pa_changed();
+ coco12_state::pia1_pa_changed(data);
/* if strobe bit is high send data from pia0 port b to dragon parallel printer */
- if (m_pia_1->a_output() & 0x02)
+ if (data & 0x02)
{
UINT8 output = m_pia_1->b_output();
m_printer->output(output);
@@ -113,9 +113,9 @@ WRITE8_MEMBER( dragon64_state::ff00_write )
// pia1_pb_changed
//-------------------------------------------------
-void dragon64_state::pia1_pb_changed(void)
+void dragon64_state::pia1_pb_changed(UINT8 data)
{
- dragon_state::pia1_pb_changed();
+ dragon_state::pia1_pb_changed(data);
UINT8 ddr = ~m_pia_1->port_b_z_mask();
@@ -125,7 +125,7 @@ void dragon64_state::pia1_pb_changed(void)
/* always be high (enabling 32k basic rom) */
if (ddr & 0x04)
{
- page_rom(m_pia_1->b_output() & 0x04 ? true : false);
+ page_rom(data & 0x04 ? true : false);
logerror("pia1_pb_changed\n");
}
}
diff --git a/src/mess/machine/mega32x.c b/src/mess/machine/mega32x.c
index be3c572b53d..8c60160097d 100644
--- a/src/mess/machine/mega32x.c
+++ b/src/mess/machine/mega32x.c
@@ -958,9 +958,9 @@ UINT16 sega_32x_device::get_hposition(void)
time_elapsed_since_megadriv_scanline_timer = machine().device<timer_device>(":md_scan_timer")->time_elapsed();
- if (time_elapsed_since_megadriv_scanline_timer.attoseconds<(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines))
+ if (time_elapsed_since_megadriv_scanline_timer.attoseconds() < (ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines))
{
- value4 = (UINT16)(MAX_HPOSITION*((double)(time_elapsed_since_megadriv_scanline_timer.attoseconds) / (double)(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines)));
+ value4 = (UINT16)(MAX_HPOSITION*((double)(time_elapsed_since_megadriv_scanline_timer.attoseconds()) / (double)(ATTOSECONDS_PER_SECOND/m_framerate /m_total_scanlines)));
}
else /* in some cases (probably due to rounding errors) we get some stupid results (the odd huge value where the time elapsed is much higher than the scanline time??!).. hopefully by clamping the result to the maximum we limit errors */
{
diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c
index f52a33ccf73..4556778597b 100644
--- a/src/mess/machine/orion.c
+++ b/src/mess/machine/orion.c
@@ -69,7 +69,7 @@ WRITE8_MEMBER(orion_state::orion128_romdisk_w)
void orion_state::orion_set_video_mode(int width)
{
rectangle visarea(0, width-1, 0, 255);
- machine().first_screen()->configure(width, 256, visarea, machine().first_screen()->frame_period().attoseconds);
+ machine().first_screen()->configure(width, 256, visarea, machine().first_screen()->frame_period().attoseconds());
}
WRITE8_MEMBER(orion_state::orion128_video_mode_w)
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index a2d7d770db4..ba944cef8fd 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -44,7 +44,7 @@ WRITE8_MEMBER( vector06_state::vector06_8255_porta_w )
void vector06_state::vector06_set_video_mode(int width)
{
rectangle visarea(0, width+64-1, 0, 256+64-1);
- machine().first_screen()->configure(width+64, 256+64, visarea, machine().first_screen()->frame_period().attoseconds);
+ machine().first_screen()->configure(width+64, 256+64, visarea, machine().first_screen()->frame_period().attoseconds());
}
WRITE8_MEMBER( vector06_state::vector06_8255_portb_w )
diff --git a/src/mess/video/apple2.c b/src/mess/video/apple2.c
index 6f5b31793d3..195fed4ce8f 100644
--- a/src/mess/video/apple2.c
+++ b/src/mess/video/apple2.c
@@ -543,7 +543,7 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram,
|| !strcmp(machine().system().name, "apple2p")
|| !strcmp(machine().system().name, "prav82")
|| !strcmp(machine().system().name, "prav8m")
- || !strcmp(machine().system().name, "ace100")
+ || !strcmp(machine().system().name, "ivelultr")
|| !strcmp(machine().system().name, "apple2jp"))
{
int len = memregion("gfx1")->bytes();
@@ -615,7 +615,7 @@ UINT32 apple2_state::screen_update_apple2(screen_device &screen, bitmap_ind16 &b
UINT32 new_a2;
/* calculate the m_flash value */
- m_flash = ((machine().time() * 4).seconds & 1) ? 1 : 0;
+ m_flash = ((machine().time() * 4).seconds() & 1) ? 1 : 0;
/* read out relevant softswitch variables; to see what has changed */
new_a2 = effective_a2();
@@ -845,6 +845,40 @@ void a2_video_device::plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, i
}
}
+void a2_video_device::plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code,
+ const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg)
+{
+ int x, y, i;
+ const UINT8 *chardata;
+ UINT16 color;
+
+ if ((code >= 0x40) && (code <= 0x7f))
+ {
+ if (m_flash)
+ {
+ i = fg;
+ fg = bg;
+ bg = i;
+ }
+ }
+
+ /* look up the character data */
+ chardata = &textgfx_data[(code * 8)];
+
+ for (y = 0; y < 8; y++)
+ {
+ for (x = 1; x < 8; x++)
+ {
+ color = (chardata[y] & (1 << x)) ? fg : bg;
+
+ for (i = 0; i < xscale; i++)
+ {
+ bitmap.pix16(ypos + y, xpos + ((x-1) * xscale) + i) = color;
+ }
+ }
+ }
+}
+
void a2_video_device::lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
{
int row, col, y, x;
@@ -1160,6 +1194,37 @@ void a2_video_device::text_update_orig(screen_device &screen, bitmap_ind16 &bitm
}
}
+void a2_video_device::text_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
+{
+ int row, col;
+ UINT32 start_address = m_page2 ? 0x800 : 0x400;
+ UINT32 address;
+ int fg = 0;
+ int bg = 0;
+
+ beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
+ endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
+
+ switch (m_sysconfig & 0x03)
+ {
+ case 0: fg = WHITE; break;
+ case 1: fg = WHITE; break;
+ case 2: fg = GREEN; break;
+ case 3: fg = ORANGE; break;
+ }
+
+ for (row = beginrow; row <= endrow; row += 8)
+ {
+ for (col = 0; col < 40; col++)
+ {
+ /* calculate address */
+ address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
+ plot_text_character_ultr(bitmap, col * 14, row, 2, m_ram_ptr[address],
+ m_char_ptr, m_char_size, fg, bg);
+ }
+ }
+}
+
void a2_video_device::hgr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow)
{
const UINT8 *vram;
diff --git a/src/mess/video/apple2.h b/src/mess/video/apple2.h
index f0df6717578..6f5f76e4cbf 100644
--- a/src/mess/video/apple2.h
+++ b/src/mess/video/apple2.h
@@ -37,6 +37,7 @@ public:
int m_sysconfig;
void text_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
+ void text_update_ultr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
void text_update_orig(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
void lores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
void dlores_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int beginrow, int endrow);
@@ -50,6 +51,7 @@ protected:
private:
void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg);
+ void plot_text_character_ultr(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg);
void plot_text_character_orig(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen, int fg, int bg);
};
diff --git a/src/mess/video/thomson.c b/src/mess/video/thomson.c
index 7c6a9ea7a97..a258bb529da 100644
--- a/src/mess/video/thomson.c
+++ b/src/mess/video/thomson.c
@@ -70,7 +70,7 @@ unsigned thomson_state::thom_video_elapsed()
{
unsigned u;
attotime elapsed = m_thom_video_timer->elapsed();
- u = (elapsed * 1000000 ).seconds;
+ u = (elapsed * 1000000 ).seconds();
if ( u >= 19968 )
u = 19968;
return u;
diff --git a/src/osd/modules/render/d3d/d3dhlsl.c b/src/osd/modules/render/d3d/d3dhlsl.c
index 1f244bf2184..ec52cd4abc4 100644
--- a/src/osd/modules/render/d3d/d3dhlsl.c
+++ b/src/osd/modules/render/d3d/d3dhlsl.c
@@ -523,7 +523,7 @@ void shaders::begin_avi_recording(const char *name)
// build up information about this new movie
avi_movie_info info;
info.video_format = 0;
- info.video_timescale = 1000 * ((machine->first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine->first_screen()->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
+ info.video_timescale = 1000 * ((machine->first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine->first_screen()->frame_period().m_attoseconds) : screen_device::DEFAULT_FRAME_RATE);
info.video_sampletime = 1000;
info.video_numsamples = 0;
info.video_width = snap_width;