summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp42
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h11
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h3
-rw-r--r--3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp4
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp6
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h4
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp99
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h36
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.h10
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.mm7
-rw-r--r--scripts/src/bus.lua8
-rw-r--r--scripts/src/emu.lua2
-rw-r--r--scripts/src/lib.lua2
-rw-r--r--scripts/src/sound.lua13
-rw-r--r--scripts/target/mame/mess.lua2
-rw-r--r--src/devices/bus/a7800/a78_slot.h2
-rw-r--r--src/devices/bus/a800/a800_slot.h2
-rw-r--r--src/devices/bus/adam/exp.h2
-rw-r--r--src/devices/bus/apf/slot.h2
-rw-r--r--src/devices/bus/arcadia/slot.h3
-rw-r--r--src/devices/bus/astrocde/slot.h3
-rw-r--r--src/devices/bus/c64/exp.h1
-rw-r--r--src/devices/bus/cbm2/exp.h1
-rw-r--r--src/devices/bus/chanf/slot.h3
-rw-r--r--src/devices/bus/coco/cococart.h2
-rw-r--r--src/devices/bus/coleco/exp.h2
-rw-r--r--src/devices/bus/crvision/slot.h3
-rw-r--r--src/devices/bus/gameboy/gb_slot.h3
-rw-r--r--src/devices/bus/gba/gba_slot.h3
-rw-r--r--src/devices/bus/generic/slot.h3
-rw-r--r--src/devices/bus/hp_optroms/hp_optrom.h2
-rw-r--r--src/devices/bus/intv/slot.h3
-rw-r--r--src/devices/bus/iq151/iq151.h2
-rw-r--r--src/devices/bus/isa/sc499.h2
-rw-r--r--src/devices/bus/kc/kc.h2
-rw-r--r--src/devices/bus/m5/slot.h3
-rw-r--r--src/devices/bus/megadrive/md_slot.h2
-rw-r--r--src/devices/bus/msx_slot/cartridge.h1
-rw-r--r--src/devices/bus/neogeo/slot.h2
-rw-r--r--src/devices/bus/nes/aladdin.h1
-rw-r--r--src/devices/bus/nes/datach.h1
-rw-r--r--src/devices/bus/nes/karastudio.h1
-rw-r--r--src/devices/bus/nes/nes_slot.h3
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.h1
-rw-r--r--src/devices/bus/newbrain/fdc.cpp2
-rw-r--r--src/devices/bus/odyssey2/slot.h3
-rw-r--r--src/devices/bus/pce/pce_slot.h3
-rw-r--r--src/devices/bus/plus4/exp.h2
-rw-r--r--src/devices/bus/pofo/ccm.cpp109
-rw-r--r--src/devices/bus/pofo/ccm.h156
-rw-r--r--src/devices/bus/pofo/exp.cpp3
-rw-r--r--src/devices/bus/pofo/hpc104.cpp241
-rw-r--r--src/devices/bus/pofo/hpc104.h86
-rw-r--r--src/devices/bus/pofo/ram.cpp63
-rw-r--r--src/devices/bus/pofo/ram.h56
-rw-r--r--src/devices/bus/pofo/rom.cpp51
-rw-r--r--src/devices/bus/pofo/rom.h48
-rw-r--r--src/devices/bus/ql/rom.h2
-rw-r--r--src/devices/bus/saturn/sat_slot.h3
-rw-r--r--src/devices/bus/scv/slot.h3
-rw-r--r--src/devices/bus/sega8/sega8_slot.h3
-rw-r--r--src/devices/bus/snes/snes_slot.h3
-rw-r--r--src/devices/bus/ti99_peb/bwg.cpp32
-rw-r--r--src/devices/bus/ti99_peb/bwg.h3
-rw-r--r--src/devices/bus/ti99_peb/hfdc.cpp127
-rw-r--r--src/devices/bus/ti99_peb/hfdc.h3
-rw-r--r--src/devices/bus/ti99_peb/tn_ide.cpp31
-rw-r--r--src/devices/bus/ti99_peb/tn_ide.h4
-rw-r--r--src/devices/bus/ti99x/genboard.cpp169
-rw-r--r--src/devices/bus/ti99x/genboard.h5
-rw-r--r--src/devices/bus/ti99x/gromport.h2
-rw-r--r--src/devices/bus/vboy/slot.h3
-rw-r--r--src/devices/bus/vc4000/slot.h3
-rwxr-xr-xsrc/devices/bus/vcs/vcs_slot.h2
-rw-r--r--src/devices/bus/vectrex/slot.h3
-rw-r--r--src/devices/bus/vic10/exp.h2
-rw-r--r--src/devices/bus/vic20/exp.h2
-rw-r--r--src/devices/bus/vidbrain/exp.h2
-rw-r--r--src/devices/bus/wswan/slot.h3
-rw-r--r--src/devices/bus/z88/z88.h3
-rw-r--r--src/devices/cpu/alto2/a2curt.cpp4
-rw-r--r--src/devices/cpu/alto2/a2dht.cpp4
-rw-r--r--src/devices/cpu/alto2/a2dvt.cpp3
-rw-r--r--src/devices/cpu/alto2/a2dwt.cpp2
-rw-r--r--src/devices/cpu/alto2/a2emu.cpp22
-rw-r--r--src/devices/cpu/alto2/a2ether.cpp17
-rw-r--r--src/devices/cpu/alto2/a2ksec.cpp23
-rw-r--r--src/devices/cpu/alto2/a2kwd.cpp22
-rw-r--r--src/devices/cpu/alto2/a2mrt.cpp3
-rw-r--r--src/devices/cpu/alto2/a2part.cpp1
-rw-r--r--src/devices/cpu/alto2/a2ram.cpp35
-rw-r--r--src/devices/cpu/alto2/a2roms.cpp12
-rw-r--r--src/devices/cpu/alto2/alto2cpu.cpp514
-rw-r--r--src/devices/cpu/alto2/alto2cpu.h52
-rw-r--r--src/devices/imagedev/cassette.cpp4
-rw-r--r--src/devices/imagedev/cassette.h1
-rw-r--r--src/devices/imagedev/chd_cd.h1
-rw-r--r--src/devices/imagedev/diablo.h1
-rw-r--r--src/devices/imagedev/flopdrv.h1
-rw-r--r--src/devices/imagedev/floppy.h1
-rw-r--r--src/devices/imagedev/harddriv.h1
-rw-r--r--src/devices/imagedev/mfmhd.cpp66
-rw-r--r--src/devices/imagedev/snapquik.h2
-rw-r--r--src/devices/machine/hdc92x4.cpp334
-rw-r--r--src/devices/machine/hdc92x4.h21
-rw-r--r--src/devices/machine/im6402.cpp3
-rw-r--r--src/devices/machine/nmc9306.cpp2
-rw-r--r--src/devices/machine/smartmed.h1
-rw-r--r--src/devices/sound/pcd3311.cpp56
-rw-r--r--src/devices/sound/pcd3311.h67
-rw-r--r--src/emu/addrmap.cpp15
-rw-r--r--src/emu/diimage.cpp92
-rw-r--r--src/emu/diimage.h12
-rw-r--r--src/emu/drivenum.cpp4
-rw-r--r--src/emu/drivers/xtal.h1
-rw-r--r--src/emu/image.cpp17
-rw-r--r--src/emu/image.h1
-rw-r--r--src/emu/inpttype.h1
-rw-r--r--src/emu/ioport.cpp27
-rw-r--r--src/emu/ioport.h13
-rw-r--r--src/emu/rendersw.hxx193
-rw-r--r--src/emu/romload.cpp4
-rw-r--r--src/emu/softlist.cpp680
-rw-r--r--src/emu/softlist.h232
-rw-r--r--src/emu/softlist_dev.cpp523
-rw-r--r--src/emu/softlist_dev.h195
-rw-r--r--src/frontend/mame/audit.cpp11
-rw-r--r--src/frontend/mame/audit.h2
-rw-r--r--src/frontend/mame/clifront.cpp18
-rw-r--r--src/frontend/mame/info.cpp7
-rw-r--r--src/frontend/mame/luaengine.cpp4
-rw-r--r--src/frontend/mame/mameopts.cpp2
-rw-r--r--src/frontend/mame/ui/imgcntrl.cpp2
-rw-r--r--src/frontend/mame/ui/info.cpp323
-rw-r--r--src/frontend/mame/ui/info.h30
-rw-r--r--src/frontend/mame/ui/inifile.cpp2
-rw-r--r--src/frontend/mame/ui/mainmenu.cpp8
-rw-r--r--src/frontend/mame/ui/miscmenu.cpp2
-rw-r--r--src/frontend/mame/ui/selgame.cpp2
-rw-r--r--src/frontend/mame/ui/selsoft.cpp6
-rw-r--r--src/frontend/mame/ui/swlist.cpp4
-rw-r--r--src/frontend/mame/ui/ui.cpp291
-rw-r--r--src/frontend/mame/ui/ui.h12
-rw-r--r--src/frontend/mame/ui/utils.h2
-rw-r--r--src/lib/netlist/build/makefile71
-rw-r--r--src/lib/netlist/nl_base.cpp27
-rw-r--r--src/lib/netlist/nl_base.h45
-rw-r--r--src/lib/netlist/plib/pdynlib.cpp10
-rw-r--r--src/lib/netlist/plib/pparser.cpp8
-rw-r--r--src/lib/netlist/plib/putil.cpp2
-rw-r--r--src/lib/netlist/prg/nltool.cpp10
-rw-r--r--src/lib/netlist/tools/nl_convert.cpp251
-rw-r--r--src/lib/netlist/tools/nl_convert.h69
-rw-r--r--src/lib/util/cstrpool.cpp114
-rw-r--r--src/lib/util/cstrpool.h65
-rw-r--r--src/mame/arcade.flt2
-rw-r--r--src/mame/audio/hng64.cpp6
-rw-r--r--src/mame/drivers/abc1600.cpp11
-rw-r--r--src/mame/drivers/apple2gs.cpp3
-rw-r--r--src/mame/drivers/aristmk4.cpp2
-rw-r--r--src/mame/drivers/arkanoid.cpp2
-rw-r--r--src/mame/drivers/astrafr.cpp16
-rw-r--r--src/mame/drivers/bfm_sc4.cpp12
-rw-r--r--src/mame/drivers/bfm_sc5.cpp2
-rw-r--r--src/mame/drivers/c65.cpp2
-rw-r--r--src/mame/drivers/calomega.cpp4
-rw-r--r--src/mame/drivers/cb2001.cpp4
-rw-r--r--src/mame/drivers/chihiro.cpp16
-rw-r--r--src/mame/drivers/cobra.cpp2
-rw-r--r--src/mame/drivers/crystal.cpp6
-rw-r--r--src/mame/drivers/cv1k.cpp7
-rw-r--r--src/mame/drivers/dblcrown.cpp2
-rw-r--r--src/mame/drivers/deco32.cpp4
-rw-r--r--src/mame/drivers/deco_mlc.cpp8
-rw-r--r--[-rwxr-xr-x]src/mame/drivers/divebomb.cpp0
-rw-r--r--src/mame/drivers/dkong.cpp25
-rw-r--r--src/mame/drivers/dreambal.cpp2
-rw-r--r--src/mame/drivers/dvk_ksm.cpp35
-rw-r--r--src/mame/drivers/eacc.cpp2
-rw-r--r--src/mame/drivers/feversoc.cpp2
-rw-r--r--src/mame/drivers/galaxy.cpp4
-rw-r--r--src/mame/drivers/gambl186.cpp4
-rw-r--r--src/mame/drivers/gba.cpp428
-rw-r--r--src/mame/drivers/geneve.cpp62
-rw-r--r--src/mame/drivers/glass.cpp2
-rw-r--r--src/mame/drivers/goldnpkr.cpp2
-rw-r--r--src/mame/drivers/hnayayoi.cpp16
-rw-r--r--src/mame/drivers/hyhoo.cpp4
-rw-r--r--src/mame/drivers/jangou.cpp2
-rw-r--r--src/mame/drivers/juicebox.cpp16
-rw-r--r--src/mame/drivers/kurukuru.cpp103
-rw-r--r--src/mame/drivers/lc80.cpp6
-rw-r--r--src/mame/drivers/lisa.cpp2
-rw-r--r--src/mame/drivers/lvcards.cpp2
-rw-r--r--src/mame/drivers/mpu5.cpp16
-rw-r--r--src/mame/drivers/mystwarr.cpp42
-rw-r--r--src/mame/drivers/namcos22.cpp2
-rw-r--r--src/mame/drivers/nbmj8688.cpp68
-rw-r--r--src/mame/drivers/nbmj8891.cpp48
-rw-r--r--src/mame/drivers/nbmj8991.cpp34
-rw-r--r--src/mame/drivers/ngen.cpp78
-rw-r--r--src/mame/drivers/plygonet.cpp4
-rw-r--r--src/mame/drivers/pofo.cpp577
-rw-r--r--src/mame/drivers/s6.cpp2
-rw-r--r--src/mame/drivers/sega_sawatte.cpp2
-rw-r--r--src/mame/drivers/segapico.cpp4
-rw-r--r--src/mame/drivers/segasp.cpp10
-rw-r--r--src/mame/drivers/sengokmj.cpp2
-rw-r--r--src/mame/drivers/slc1.cpp2
-rw-r--r--src/mame/drivers/supracan.cpp8
-rw-r--r--[-rwxr-xr-x]src/mame/drivers/tek440x.cpp0
-rw-r--r--src/mame/drivers/toaplan2.cpp195
-rw-r--r--src/mame/drivers/toobin.cpp32
-rw-r--r--src/mame/drivers/triforce.cpp126
-rw-r--r--src/mame/drivers/uapce.cpp2
-rw-r--r--src/mame/drivers/vegas.cpp16
-rw-r--r--src/mame/drivers/vroulet.cpp2
-rw-r--r--src/mame/drivers/wangpc.cpp4
-rw-r--r--src/mame/includes/lisa.h4
-rw-r--r--src/mame/includes/toaplan2.h8
-rw-r--r--src/mame/machine/abc1600mac.cpp49
-rw-r--r--src/mame/machine/apollo.cpp2
-rw-r--r--src/mame/machine/at.cpp1
-rw-r--r--src/mame/machine/bebox.cpp32
-rw-r--r--src/mame/machine/dc.cpp2
-rw-r--r--src/mame/machine/lisa.cpp60
-rw-r--r--src/mame/machine/m1comm.cpp2
-rw-r--r--src/mame/machine/m3comm.cpp4
-rw-r--r--src/mame/machine/microdrv.h1
-rw-r--r--src/mame/machine/ms7004.cpp28
-rw-r--r--src/mame/machine/ms7004.h7
-rw-r--r--src/mame/machine/n64.cpp8
-rw-r--r--src/mame/machine/psion_pack.h2
-rw-r--r--src/mame/machine/segas32.cpp2
-rw-r--r--src/mame/machine/stvprot.cpp4
-rw-r--r--src/mame/machine/wangpckb.cpp165
-rw-r--r--src/mame/machine/wangpckb.h22
-rw-r--r--src/mame/mame.lst11
-rw-r--r--src/mame/video/abc1600.cpp48
-rw-r--r--src/mame/video/abc1600.h4
-rw-r--r--src/mame/video/jaguar.cpp2
-rw-r--r--src/mame/video/kaneko_tmap.cpp4
-rw-r--r--src/osd/modules/input/input_sdlcommon.cpp8
-rw-r--r--src/osd/modules/sound/xaudio2_sound.cpp7
245 files changed, 5559 insertions, 3269 deletions
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
index e3c3b915d2c..623ac90a4c9 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.cpp
@@ -209,15 +209,15 @@
- 2015/05/27 (1.40) - removed the third 'repeat_if_held' parameter from Button() - sorry! it was rarely used and inconsistent. Use PushButtonRepeat(true) / PopButtonRepeat() to enable repeat on desired buttons.
- 2015/05/11 (1.40) - changed BeginPopup() API, takes a string identifier instead of a bool. ImGui needs to manage the open/closed state of popups. Call OpenPopup() to actually set the "open" state of a popup. BeginPopup() returns true if the popup is opened.
- 2015/05/03 (1.40) - removed style.AutoFitPadding, using style.WindowPadding makes more sense (the default values were already the same).
- - 2015/04/13 (1.38) - renamed IsClipped() to IsRectClipped(). Kept inline redirection function (will obsolete).
+ - 2015/04/13 (1.38) - renamed IsClipped() to IsRectClipped(). Kept inline redirection function until 1.50.
- 2015/04/09 (1.38) - renamed ImDrawList::AddArc() to ImDrawList::AddArcFast() for compatibility with future API
- 2015/04/03 (1.38) - removed ImGuiCol_CheckHovered, ImGuiCol_CheckActive, replaced with the more general ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgActive.
- 2014/04/03 (1.38) - removed support for passing -FLT_MAX..+FLT_MAX as the range for a SliderFloat(). Use DragFloat() or Inputfloat() instead.
- - 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function (will obsolete).
+ - 2015/03/17 (1.36) - renamed GetItemBoxMin()/GetItemBoxMax()/IsMouseHoveringBox() to GetItemRectMin()/GetItemRectMax()/IsMouseHoveringRect(). Kept inline redirection function until 1.50.
- 2015/03/15 (1.36) - renamed style.TreeNodeSpacing to style.IndentSpacing, ImGuiStyleVar_TreeNodeSpacing to ImGuiStyleVar_IndentSpacing
- - 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function (will obsolete).
+ - 2015/03/13 (1.36) - renamed GetWindowIsFocused() to IsWindowFocused(). Kept inline redirection function until 1.50.
- 2015/03/08 (1.35) - renamed style.ScrollBarWidth to style.ScrollbarWidth (casing)
- - 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function (will obsolete).
+ - 2015/02/27 (1.34) - renamed OpenNextNode(bool) to SetNextTreeNodeOpened(bool, ImGuiSetCond). Kept inline redirection function until 1.50.
- 2015/02/27 (1.34) - renamed ImGuiSetCondition_*** to ImGuiSetCond_***, and _FirstUseThisSession becomes _Once.
- 2015/02/11 (1.32) - changed text input callback ImGuiTextEditCallback return type from void-->int. reserved for future use, return 0 for now.
- 2015/02/10 (1.32) - renamed GetItemWidth() to CalcItemWidth() to clarify its evolving behavior
@@ -1202,6 +1202,20 @@ ImU32 ImGui::ColorConvertFloat4ToU32(const ImVec4& in)
return out;
}
+ImU32 ImGui::GetColorU32(ImGuiCol idx, float alpha_mul)
+{
+ ImVec4 c = GImGui->Style.Colors[idx];
+ c.w *= GImGui->Style.Alpha * alpha_mul;
+ return ImGui::ColorConvertFloat4ToU32(c);
+}
+
+ImU32 ImGui::GetColorU32(const ImVec4& col)
+{
+ ImVec4 c = col;
+ c.w *= GImGui->Style.Alpha;
+ return ImGui::ColorConvertFloat4ToU32(c);
+}
+
// Convert rgb floats ([0-1],[0-1],[0-1]) to hsv floats ([0-1],[0-1],[0-1]), from Foley & van Dam p592
// Optimized http://lolengine.net/blog/2013/01/13/fast-rgb-to-hsv
void ImGui::ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v)
@@ -1841,7 +1855,7 @@ void ImGui::ItemSize(const ImVec2& size, float text_offset_y)
window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPosPrevLine.x);
window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
- //window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, 0xFF0000FF, 4); // Debug
+ //window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // Debug
window->DC.PrevLineHeight = line_height;
window->DC.PrevLineTextBaseOffset = text_base_offset;
@@ -2693,10 +2707,10 @@ void ImGui::Render()
const ImVec2 size = cursor_data.Size;
const ImTextureID tex_id = g.IO.Fonts->TexID;
g.OverlayDrawList.PushTextureID(tex_id);
- g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(1,0), pos+ImVec2(1,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
- g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(2,0), pos+ImVec2(2,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0x30000000); // Shadow
- g.OverlayDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], 0xFF000000); // Black border
- g.OverlayDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[0], cursor_data.TexUvMax[0], 0xFFFFFFFF); // White fill
+ g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(1,0), pos+ImVec2(1,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], IM_COL32(0,0,0,48)); // Shadow
+ g.OverlayDrawList.AddImage(tex_id, pos+ImVec2(2,0), pos+ImVec2(2,0) + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], IM_COL32(0,0,0,48)); // Shadow
+ g.OverlayDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[1], cursor_data.TexUvMax[1], IM_COL32(0,0,0,255)); // Black border
+ g.OverlayDrawList.AddImage(tex_id, pos, pos + size, cursor_data.TexUvMin[0], cursor_data.TexUvMax[0], IM_COL32(255,255,255,255)); // White fill
g.OverlayDrawList.PopTextureID();
}
if (!g.OverlayDrawList.VtxBuffer.empty())
@@ -6172,7 +6186,7 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
const char* text_begin = g.TempBuffer;
const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
- const ImVec2 label_size = CalcTextSize(text_begin, text_end, true);
+ const ImVec2 label_size = CalcTextSize(text_begin, text_end, false);
const float text_base_offset_y = ImMax(0.0f, window->DC.CurrentLineTextBaseOffset); // Latch before ItemSize changes it
const float line_height = ImMax(ImMin(window->DC.CurrentLineHeight, g.FontSize + g.Style.FramePadding.y*2), g.FontSize);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x*2) : 0.0f), ImMax(line_height, label_size.y))); // Empty text doesn't add padding
@@ -6182,7 +6196,7 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
// Render
RenderBullet(bb.Min + ImVec2(style.FramePadding.x + g.FontSize*0.5f, line_height*0.5f));
- RenderText(bb.Min+ImVec2(g.FontSize + style.FramePadding.x*2, text_base_offset_y), text_begin, text_end);
+ RenderText(bb.Min+ImVec2(g.FontSize + style.FramePadding.x*2, text_base_offset_y), text_begin, text_end, false);
}
void ImGui::BulletText(const char* fmt, ...)
@@ -9108,6 +9122,12 @@ bool ImGui::IsRectVisible(const ImVec2& size)
return window->ClipRect.Overlaps(ImRect(window->DC.CursorPos, window->DC.CursorPos + size));
}
+bool ImGui::IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max)
+{
+ ImGuiWindow* window = GetCurrentWindowRead();
+ return window->ClipRect.Overlaps(ImRect(rect_min, rect_max));
+}
+
// Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
void ImGui::BeginGroup()
{
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
index 6a1ed055964..24cb7715449 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui.h
@@ -409,7 +409,8 @@ namespace ImGui
IMGUI_API bool IsRootWindowFocused(); // is current root window focused (root = top-most parent of a child, otherwise self)
IMGUI_API bool IsRootWindowOrAnyChildFocused(); // is current root window or any of its child (including current window) focused
IMGUI_API bool IsRootWindowOrAnyChildHovered(); // is current root window or any of its child (including current window) hovered and hoverable (not blocked by a popup)
- IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle of given size starting from cursor pos is visible (not clipped). to perform coarse clipping on user's side (as an optimization)
+ IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped.
+ IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
IMGUI_API float GetTime();
IMGUI_API int GetFrameCount();
@@ -467,15 +468,9 @@ namespace ImGui
static inline bool CollapsingHeader(const char* label, const char* str_id, bool framed = true, bool default_open = false) { (void)str_id; (void)framed; ImGuiTreeNodeFlags default_open_flags = 1<<5; return CollapsingHeader(label, (default_open ? default_open_flags : 0)); } // OBSOLETE 1.49+
static inline ImFont* GetWindowFont() { return GetFont(); } // OBSOLETE 1.48+
static inline float GetWindowFontSize() { return GetFontSize(); } // OBSOLETE 1.48+
- static inline void OpenNextNode(bool open) { ImGui::SetNextTreeNodeOpen(open, 0); } // OBSOLETE 1.34+
- static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); } // OBSOLETE 1.36+
+ static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETE 1.42+
static inline bool GetWindowCollapsed() { return ImGui::IsWindowCollapsed(); } // OBSOLETE 1.39+
- static inline ImVec2 GetItemBoxMin() { return GetItemRectMin(); } // OBSOLETE 1.36+
- static inline ImVec2 GetItemBoxMax() { return GetItemRectMax(); } // OBSOLETE 1.36+
- static inline bool IsClipped(const ImVec2& size) { return !IsRectVisible(size); } // OBSOLETE 1.38+
static inline bool IsRectClipped(const ImVec2& size) { return !IsRectVisible(size); } // OBSOLETE 1.39+
- static inline bool IsMouseHoveringBox(const ImVec2& rect_min, const ImVec2& rect_max) { return IsMouseHoveringRect(rect_min, rect_max); } // OBSOLETE 1.36+
- static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETE 1.42+
#endif
} // namespace ImGui
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
index 67846e7ab1b..b6582a88a69 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_demo.cpp
@@ -2184,7 +2184,8 @@ struct ExampleAppConsole
}
else if (Stricmp(command_line, "HISTORY") == 0)
{
- for (int i = History.Size >= 10 ? History.Size - 10 : 0; i < History.Size; i++)
+ int first = History.Size - 10;
+ for (int i = first > 0 ? first : 0; i < History.Size; i++)
AddLog("%3d: %s\n", i, History[i]);
}
else
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
index 7b59bb63f66..dc02f719a63 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_internal.h
@@ -703,9 +703,6 @@ namespace ImGui
IMGUI_API void OpenPopupEx(const char* str_id, bool reopen_existing);
- inline IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul) { ImVec4 c = GImGui->Style.Colors[idx]; c.w *= GImGui->Style.Alpha * alpha_mul; return ImGui::ColorConvertFloat4ToU32(c); }
- inline IMGUI_API ImU32 GetColorU32(const ImVec4& col) { ImVec4 c = col; c.w *= GImGui->Style.Alpha; return ImGui::ColorConvertFloat4ToU32(c); }
-
// NB: All position are in absolute pixels coordinates (not window coordinates)
// FIXME: All those functions are a mess and needs to be refactored into something decent. Avoid use outside of imgui.cpp!
// We need: a sort of symbol library, preferably baked into font atlas when possible + decent text rendering helpers.
diff --git a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp
index ac584ce110c..83a7e40d376 100644
--- a/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp
+++ b/3rdparty/bgfx/3rdparty/ocornut-imgui/imgui_wm.cpp
@@ -575,8 +575,8 @@ namespace ImGuiWM
ImColor oSelectedTab(37, 37, 37, 255); // selected
ImColor oBorderColor(72, 72, 72, 255); // border
- ImVec2 oRectMin = ImGui::GetItemBoxMin();
- ImVec2 oRectMax = ImGui::GetItemBoxMax();
+ ImVec2 oRectMin = ImGui::GetItemRectMin();
+ ImVec2 oRectMax = ImGui::GetItemRectMax();
const float fOverlap = 10.f;
const float fSlopWidth = 30.f;
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index b8bf5b97a39..6a80447a34b 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -1488,7 +1488,7 @@ struct Imgui
}
}
- uint8_t tabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, uint8_t _nEnabled, va_list _argList)
+ uint8_t tabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint32_t _nTabs, uint32_t _nEnabled, va_list _argList)
{
const char* titles[16];
bool tabEnabled[16];
@@ -3469,7 +3469,7 @@ void imguiInput(const char* _label, char* _str, uint32_t _len, bool _enabled, Im
s_imgui.input(_label, _str, _len, _enabled, _align, _r);
}
-uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, uint8_t _nEnabled, ...)
+uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint32_t _nTabs, uint32_t _nEnabled, ...)
{
va_list argList;
va_start(argList, _nEnabled);
@@ -3479,7 +3479,7 @@ uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int
return result;
}
-uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, ...)
+uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint32_t _nTabs, ...)
{
va_list argList;
va_start(argList, _nTabs);
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index 273f2a817e7..3b0fc54f875 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -190,8 +190,8 @@ void imguiInput(const char* _label, char* _str, uint32_t _len, bool _enabled = t
/// _nEnabled - Number of specified 'enabled' flags. All other unspecified tabs are considered enabled by default.
/// In the above example, there are 2 enabled flags: 'Tab0' is specified as enabled and 'Tab1' is specified as disabled.
/// Tab2 is unspecified and therefore is treated as enabled.
-uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, uint8_t _nEnabled, ...);
-uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, ...);
+uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint32_t _nTabs, uint32_t _nEnabled, ...);
+uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint32_t _nTabs, ...);
uint32_t imguiChooseUseMacroInstead(uint32_t _selected, ...);
#define imguiChoose(...) imguiChooseUseMacroInstead(__VA_ARGS__, NULL)
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
index 41095d853bb..05973f26284 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
@@ -548,6 +548,7 @@ namespace
static void nvgRenderViewport(void* _userPtr, int width, int height, float devicePixelRatio)
{
struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr;
+ gl->state = 0;
gl->view[0] = (float)width;
gl->view[1] = (float)height;
bgfx::setViewRect(gl->m_viewId, 0, 0, width * devicePixelRatio, height * devicePixelRatio);
@@ -714,33 +715,24 @@ namespace
int allocated = gl->tvb.size/gl->tvb.stride;
- if (allocated < gl->nverts) {
+ if (allocated < gl->nverts)
+ {
gl->nverts = allocated;
BX_WARN(true, "Vertex number truncated due to transient vertex buffer overflow");
}
-
memcpy(gl->tvb.data, gl->verts, gl->nverts * sizeof(struct NVGvertex) );
- gl->state = 0
+ if (0 == gl->state)
+ {
+ gl->state = BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA);
+ }
+
+ gl->state |= 0
| BGFX_STATE_RGB_WRITE
| BGFX_STATE_ALPHA_WRITE
;
-// if (alphaBlend == NVG_PREMULTIPLIED_ALPHA)
-// {
-// gl->state |= BGFX_STATE_BLEND_FUNC_SEPARATE(
-// BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA
-// , BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_INV_SRC_ALPHA
-// );
-// }
-// else
- {
- gl->state |= BGFX_STATE_BLEND_FUNC(
- BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA
- );
- }
-
bgfx::setUniform(gl->u_viewSize, gl->view);
for (uint32_t ii = 0, num = gl->ncalls; ii < num; ++ii)
@@ -1089,7 +1081,26 @@ error:
}
NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId) {
- return nvgCreate(edgeaa, _viewId, NULL);
+ return nvgCreate(edgeaa, _viewId, NULL);
+}
+
+void nvgDelete(struct NVGcontext* ctx)
+{
+ nvgDeleteInternal(ctx);
+}
+
+void nvgState(struct NVGcontext* ctx, uint64_t state)
+{
+ struct NVGparams* params = nvgInternalParams(ctx);
+ struct GLNVGcontext* gl = (struct GLNVGcontext*)params->userPtr;
+ gl->state = state;
+}
+
+uint8_t nvgViewId(struct NVGcontext* ctx)
+{
+ struct NVGparams* params = nvgInternalParams(ctx);
+ struct GLNVGcontext* gl = (struct GLNVGcontext*)params->userPtr;
+ return gl->m_viewId;
}
void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId)
@@ -1099,7 +1110,55 @@ void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId)
gl->m_viewId = uint8_t(_viewId);
}
-void nvgDelete(struct NVGcontext* ctx)
+bgfx::TextureHandle nvglImageHandle(NVGcontext* ctx, int image)
{
- nvgDeleteInternal(ctx);
+ GLNVGcontext* gl = (GLNVGcontext*)nvgInternalParams(ctx)->userPtr;
+ GLNVGtexture* tex = glnvg__findTexture(gl, image);
+ return tex->id;
+}
+
+NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* ctx, int width,
+ int height, int imageFlags) {
+ NVGLUframebuffer* framebuffer = new NVGLUframebuffer;
+ framebuffer->ctx = ctx;
+ framebuffer->image = nvgCreateImageRGBA(ctx, width, height,
+ imageFlags, NULL);
+ bgfx::TextureHandle texture = nvglImageHandle(ctx, framebuffer->image);
+ if (!bgfx::isValid(texture)) {
+ nvgluDeleteFramebuffer(framebuffer);
+ return NULL;
+ }
+ framebuffer->handle = bgfx::createFrameBuffer(1, &texture, false);
+ if (!bgfx::isValid(framebuffer->handle))
+ {
+ nvgluDeleteFramebuffer(framebuffer);
+ return NULL;
+ }
+ static uint8_t s_ViewId = 1; // may have a better way to assign new view id
+ framebuffer->viewId = s_ViewId++;
+ bgfx::setViewFrameBuffer(framebuffer->viewId, framebuffer->handle);
+ bgfx::setViewSeq(framebuffer->viewId, true);
+ return framebuffer;
+}
+
+void nvgluBindFramebuffer(NVGLUframebuffer* framebuffer) {
+ static NVGcontext* s_prevCtx = NULL;
+ static uint8_t s_prevViewId;
+ if (framebuffer != NULL) {
+ s_prevCtx = framebuffer->ctx;
+ s_prevViewId = nvgViewId(framebuffer->ctx);
+ nvgViewId(framebuffer->ctx, framebuffer->viewId);
+ } else if (s_prevCtx != NULL) {
+ nvgViewId(s_prevCtx, s_prevViewId);
+ }
+}
+
+void nvgluDeleteFramebuffer(NVGLUframebuffer* framebuffer) {
+ if (framebuffer == NULL)
+ return;
+ if (framebuffer->image >= 0)
+ nvgDeleteImage(framebuffer->ctx, framebuffer->image);
+ if (bgfx::isValid(framebuffer->handle))
+ bgfx::destroyFrameBuffer(framebuffer->handle);
+ delete framebuffer;
}
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h
index d24ee4fa72f..2268e900f99 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h
@@ -6,13 +6,47 @@
#ifndef NANOVG_BGFX_H_HEADER_GUARD
#define NANOVG_BGFX_H_HEADER_GUARD
+#include "bgfx/bgfx.h"
+
namespace bx { struct AllocatorI; }
struct NVGcontext;
+struct NVGLUframebuffer {
+ NVGcontext* ctx;
+ bgfx::FrameBufferHandle handle;
+ int image;
+ uint8_t viewId;
+};
+typedef struct NVGLUframebuffer NVGLUframebuffer;
+
NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId, bx::AllocatorI* _allocator);
NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId);
-void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId);
void nvgDelete(struct NVGcontext* ctx);
+void nvgState(struct NVGcontext* ctx, uint64_t state);
+uint8_t nvgViewId(struct NVGcontext* ctx);
+void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId);
+
+// Helper functions to create bgfx framebuffer to render to.
+// Example:
+// float scale = 2;
+// NVGLUframebuffer* fb = nvgluCreateFramebuffer(ctx, 100 * scale, 100 * scale, 0);
+// nvgluBindFramebuffer(fb);
+// nvgBeginFrame(ctx, 100, 100, scale);
+// // renders anything offscreen
+// nvgEndFrame(ctx);
+// nvgluBindFramebuffer(NULL);
+//
+// // Pastes the framebuffer rendering.
+// nvgBeginFrame(ctx, 1024, 768, scale);
+// NVGpaint paint = nvgImagePattern(ctx, 0, 0, 100, 100, 0, fb->image, 1);
+// nvgBeginPath(ctx);
+// nvgRect(ctx, 0, 0, 100, 100);
+// nvgFillPaint(ctx, paint);
+// nvgFill(ctx);
+// nvgEndFrame(ctx);
+NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* ctx, int width, int height, int imageFlags);
+void nvgluBindFramebuffer(NVGLUframebuffer* framebuffer);
+void nvgluDeleteFramebuffer(NVGLUframebuffer* framebuffer);
#endif // NANOVG_BGFX_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/renderer_mtl.h b/3rdparty/bgfx/src/renderer_mtl.h
index 42145e0c036..13f1bf6b7af 100644
--- a/3rdparty/bgfx/src/renderer_mtl.h
+++ b/3rdparty/bgfx/src/renderer_mtl.h
@@ -87,6 +87,16 @@ namespace bgfx { namespace mtl
destinationSlice:_destinationSlice destinationLevel:_destinationLevel destinationOrigin:_destinationOrigin];
}
+ void synchronizeTexture(id<MTLTexture> _texture, NSUInteger _slice, NSUInteger _level)
+ {
+ [m_obj synchronizeTexture:_texture slice:_slice level:_level];
+ }
+
+ void synchronizeResource(id<MTLResource> _resource)
+ {
+ [m_obj synchronizeResource:_resource];
+ }
+
void endEncoding()
{
[m_obj endEncoding];
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm
index b2dcdd36900..ce2bf3b8b51 100644
--- a/3rdparty/bgfx/src/renderer_mtl.mm
+++ b/3rdparty/bgfx/src/renderer_mtl.mm
@@ -3023,16 +3023,23 @@ namespace bgfx { namespace mtl
uint32_t width = bx::uint32_min(srcWidth, dstWidth);
uint32_t height = bx::uint32_min(srcHeight, dstHeight);
uint32_t depth = bx::uint32_min(srcDepth, dstDepth);
+ bool readBack = !!(dst.m_flags & BGFX_TEXTURE_READ_BACK);
if ( MTLTextureType3D == src.m_ptr.textureType())
{
m_blitCommandEncoder.copyFromTexture(src.m_ptr, 0, 0, MTLOriginMake(blit.m_srcX, blit.m_srcY, blit.m_srcZ), MTLSizeMake(width, height, bx::uint32_imax(depth, 1)),
dst.m_ptr, 0, 0, MTLOriginMake(blit.m_dstX, blit.m_dstY, blit.m_dstZ));
+ if (m_macOS11Runtime &&readBack) {
+ m_blitCommandEncoder.synchronizeResource(dst.m_ptr);
+ }
}
else
{
m_blitCommandEncoder.copyFromTexture(src.m_ptr, blit.m_srcZ, blit.m_srcMip, MTLOriginMake(blit.m_srcX, blit.m_srcY, 0), MTLSizeMake(width, height, 1),
dst.m_ptr, blit.m_dstZ, blit.m_dstMip, MTLOriginMake(blit.m_dstX, blit.m_dstY, 0));
+ if (m_macOS11Runtime && readBack) {
+ m_blitCommandEncoder.synchronizeTexture(dst.m_ptr, 0, blit.m_dstMip);
+ }
}
}
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 083cd2d46d1..d15d71fee78 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -1174,6 +1174,14 @@ if (BUSES["POFO"]~=null) then
MAME_DIR .. "src/devices/bus/pofo/hpc101.h",
MAME_DIR .. "src/devices/bus/pofo/hpc102.cpp",
MAME_DIR .. "src/devices/bus/pofo/hpc102.h",
+ MAME_DIR .. "src/devices/bus/pofo/hpc104.cpp",
+ MAME_DIR .. "src/devices/bus/pofo/hpc104.h",
+ MAME_DIR .. "src/devices/bus/pofo/ccm.cpp",
+ MAME_DIR .. "src/devices/bus/pofo/ccm.h",
+ MAME_DIR .. "src/devices/bus/pofo/ram.cpp",
+ MAME_DIR .. "src/devices/bus/pofo/ram.h",
+ MAME_DIR .. "src/devices/bus/pofo/rom.cpp",
+ MAME_DIR .. "src/devices/bus/pofo/rom.h",
}
end
diff --git a/scripts/src/emu.lua b/scripts/src/emu.lua
index 2302811a058..78b61d03d54 100644
--- a/scripts/src/emu.lua
+++ b/scripts/src/emu.lua
@@ -158,6 +158,8 @@ files {
MAME_DIR .. "src/emu/screen.h",
MAME_DIR .. "src/emu/softlist.cpp",
MAME_DIR .. "src/emu/softlist.h",
+ MAME_DIR .. "src/emu/softlist_dev.cpp",
+ MAME_DIR .. "src/emu/softlist_dev.h",
MAME_DIR .. "src/emu/sound.cpp",
MAME_DIR .. "src/emu/sound.h",
MAME_DIR .. "src/emu/speaker.cpp",
diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua
index 7353c87c1d9..1549084c918 100644
--- a/scripts/src/lib.lua
+++ b/scripts/src/lib.lua
@@ -48,8 +48,6 @@ project "utils"
MAME_DIR .. "src/lib/util/corestr.h",
MAME_DIR .. "src/lib/util/coreutil.cpp",
MAME_DIR .. "src/lib/util/coreutil.h",
- MAME_DIR .. "src/lib/util/cstrpool.cpp",
- MAME_DIR .. "src/lib/util/cstrpool.h",
MAME_DIR .. "src/lib/util/delegate.cpp",
MAME_DIR .. "src/lib/util/delegate.h",
MAME_DIR .. "src/lib/util/flac.cpp",
diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua
index bf1e87ebc7e..30d049c72e1 100644
--- a/scripts/src/sound.lua
+++ b/scripts/src/sound.lua
@@ -1352,6 +1352,7 @@ if (SOUNDS["UPD1771"]~=null) then
MAME_DIR .. "src/devices/sound/upd1771.h",
}
end
+
---------------------------------------------------
-- GB_SOUND
--@src/devices/sound/gb.h,SOUNDS["GB_SOUND"] = true
@@ -1363,3 +1364,15 @@ if (SOUNDS["GB_SOUND"]~=null) then
MAME_DIR .. "src/devices/sound/gb.h",
}
end
+
+---------------------------------------------------
+-- PCD3311
+--@src/devices/sound/gb.h,SOUNDS["PCD3311"] = true
+---------------------------------------------------
+
+if (SOUNDS["PCD3311"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/sound/pcd3311.cpp",
+ MAME_DIR .. "src/devices/sound/pcd3311.h",
+ }
+end
diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua
index e78baadfdc6..3554b86e213 100644
--- a/scripts/target/mame/mess.lua
+++ b/scripts/target/mame/mess.lua
@@ -260,6 +260,8 @@ SOUNDS["ESQPUMP"] = true
SOUNDS["VRC6"] = true
SOUNDS["UPD1771"] = true
SOUNDS["GB_SOUND"] = true
+SOUNDS["PCD3311"] = true
+
--------------------------------------------------
-- specify available video cores
--------------------------------------------------
diff --git a/src/devices/bus/a7800/a78_slot.h b/src/devices/bus/a7800/a78_slot.h
index d6a635b1a82..0f4fd9d2e92 100644
--- a/src/devices/bus/a7800/a78_slot.h
+++ b/src/devices/bus/a7800/a78_slot.h
@@ -3,6 +3,8 @@
#ifndef __A78_SLOT_H
#define __A78_SLOT_H
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/bus/a800/a800_slot.h b/src/devices/bus/a800/a800_slot.h
index 0d1bf674bd5..d1cf620bdc4 100644
--- a/src/devices/bus/a800/a800_slot.h
+++ b/src/devices/bus/a800/a800_slot.h
@@ -3,6 +3,8 @@
#ifndef __A800_SLOT_H
#define __A800_SLOT_H
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/bus/adam/exp.h b/src/devices/bus/adam/exp.h
index c7bd5abc12a..f1b004d67a8 100644
--- a/src/devices/bus/adam/exp.h
+++ b/src/devices/bus/adam/exp.h
@@ -12,7 +12,7 @@
#define __ADAM_EXPANSION_SLOT__
#include "emu.h"
-
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/devices/bus/apf/slot.h b/src/devices/bus/apf/slot.h
index 076759e18b3..c2dba02fc08 100644
--- a/src/devices/bus/apf/slot.h
+++ b/src/devices/bus/apf/slot.h
@@ -3,6 +3,8 @@
#ifndef __APF_SLOT_H
#define __APF_SLOT_H
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/arcadia/slot.h b/src/devices/bus/arcadia/slot.h
index abc95db625f..2f7f2dbc67a 100644
--- a/src/devices/bus/arcadia/slot.h
+++ b/src/devices/bus/arcadia/slot.h
@@ -3,6 +3,9 @@
#ifndef __ARCADIA_SLOT_H
#define __ARCADIA_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/astrocde/slot.h b/src/devices/bus/astrocde/slot.h
index 6866f787655..edd94af5ca1 100644
--- a/src/devices/bus/astrocde/slot.h
+++ b/src/devices/bus/astrocde/slot.h
@@ -3,6 +3,9 @@
#ifndef __ASTROCADE_SLOT_H
#define __ASTROCADE_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/c64/exp.h b/src/devices/bus/c64/exp.h
index 3522942e823..4e4555173fa 100644
--- a/src/devices/bus/c64/exp.h
+++ b/src/devices/bus/c64/exp.h
@@ -37,6 +37,7 @@
#define __C64_EXPANSION_SLOT__
#include "emu.h"
+#include "softlist_dev.h"
#include "formats/cbm_crt.h"
diff --git a/src/devices/bus/cbm2/exp.h b/src/devices/bus/cbm2/exp.h
index 2a9fa80d051..ad66454a746 100644
--- a/src/devices/bus/cbm2/exp.h
+++ b/src/devices/bus/cbm2/exp.h
@@ -30,6 +30,7 @@
#define __CBM2_EXPANSION_SLOT__
#include "emu.h"
+#include "softlist_dev.h"
diff --git a/src/devices/bus/chanf/slot.h b/src/devices/bus/chanf/slot.h
index 68599ffad1c..f1d3f0d2c88 100644
--- a/src/devices/bus/chanf/slot.h
+++ b/src/devices/bus/chanf/slot.h
@@ -3,6 +3,9 @@
#ifndef __CHANF_SLOT_H
#define __CHANF_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/coco/cococart.h b/src/devices/bus/coco/cococart.h
index 7ba1e301d50..9415b5956c8 100644
--- a/src/devices/bus/coco/cococart.h
+++ b/src/devices/bus/coco/cococart.h
@@ -11,6 +11,8 @@
#ifndef __COCOCART_H__
#define __COCOCART_H__
+#include "softlist_dev.h"
+
/***************************************************************************
CONSTANTS
diff --git a/src/devices/bus/coleco/exp.h b/src/devices/bus/coleco/exp.h
index 25f503b378e..19fa5b5e69c 100644
--- a/src/devices/bus/coleco/exp.h
+++ b/src/devices/bus/coleco/exp.h
@@ -31,7 +31,7 @@
#define __COLECOVISION_CARTRIDGE_SLOT__
#include "emu.h"
-
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/devices/bus/crvision/slot.h b/src/devices/bus/crvision/slot.h
index 47fed8c1583..7643ca7fb1b 100644
--- a/src/devices/bus/crvision/slot.h
+++ b/src/devices/bus/crvision/slot.h
@@ -3,6 +3,9 @@
#ifndef __CRVISION_SLOT_H
#define __CRVISION_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/gameboy/gb_slot.h b/src/devices/bus/gameboy/gb_slot.h
index 67db3cda7f0..75a8b4e7cde 100644
--- a/src/devices/bus/gameboy/gb_slot.h
+++ b/src/devices/bus/gameboy/gb_slot.h
@@ -3,6 +3,9 @@
#ifndef __GB_SLOT_H
#define __GB_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/gba/gba_slot.h b/src/devices/bus/gba/gba_slot.h
index 5cbc103e8dc..f9918744d97 100644
--- a/src/devices/bus/gba/gba_slot.h
+++ b/src/devices/bus/gba/gba_slot.h
@@ -3,6 +3,9 @@
#ifndef __GBA_SLOT_H
#define __GBA_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/generic/slot.h b/src/devices/bus/generic/slot.h
index 6ba2e1a1fd5..a3e07f68ef4 100644
--- a/src/devices/bus/generic/slot.h
+++ b/src/devices/bus/generic/slot.h
@@ -3,6 +3,9 @@
#ifndef __GENERIC_SLOT_H
#define __GENERIC_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/hp_optroms/hp_optrom.h b/src/devices/bus/hp_optroms/hp_optrom.h
index d82f8962f4f..6ca5440cce5 100644
--- a/src/devices/bus/hp_optroms/hp_optrom.h
+++ b/src/devices/bus/hp_optroms/hp_optrom.h
@@ -14,6 +14,8 @@
#define _HP_OPTROM_H_
#include "emu.h"
+#include "softlist_dev.h"
+
class hp_optrom_cart_device : public device_t,
public device_slot_card_interface
diff --git a/src/devices/bus/intv/slot.h b/src/devices/bus/intv/slot.h
index ced41e71fd0..11d88aed25c 100644
--- a/src/devices/bus/intv/slot.h
+++ b/src/devices/bus/intv/slot.h
@@ -3,6 +3,9 @@
#ifndef __INTV_SLOT_H
#define __INTV_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/iq151/iq151.h b/src/devices/bus/iq151/iq151.h
index 1c75ff6c9a0..684aa00b8fd 100644
--- a/src/devices/bus/iq151/iq151.h
+++ b/src/devices/bus/iq151/iq151.h
@@ -45,6 +45,8 @@
#ifndef __IQ151CART_H__
#define __IQ151CART_H__
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/isa/sc499.h b/src/devices/bus/isa/sc499.h
index 7bbdaedfb8b..ad536a66df0 100644
--- a/src/devices/bus/isa/sc499.h
+++ b/src/devices/bus/isa/sc499.h
@@ -15,6 +15,8 @@
#include "emu.h"
#include "bus/isa/isa.h"
+#include "softlist_dev.h"
+
//**************************************************************************
// TYPE DEFINITIONS
diff --git a/src/devices/bus/kc/kc.h b/src/devices/bus/kc/kc.h
index 7f9ed65f7d0..6f5e30f4943 100644
--- a/src/devices/bus/kc/kc.h
+++ b/src/devices/bus/kc/kc.h
@@ -11,6 +11,8 @@
#ifndef __KCEXP_H__
#define __KCEXP_H__
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/m5/slot.h b/src/devices/bus/m5/slot.h
index cd12d43f3a8..27345e34a99 100644
--- a/src/devices/bus/m5/slot.h
+++ b/src/devices/bus/m5/slot.h
@@ -3,6 +3,9 @@
#ifndef __M5_SLOT_H
#define __M5_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/megadrive/md_slot.h b/src/devices/bus/megadrive/md_slot.h
index 4a86749d991..008ae917fb5 100644
--- a/src/devices/bus/megadrive/md_slot.h
+++ b/src/devices/bus/megadrive/md_slot.h
@@ -3,6 +3,8 @@
#ifndef __MD_SLOT_H
#define __MD_SLOT_H
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/msx_slot/cartridge.h b/src/devices/bus/msx_slot/cartridge.h
index b9e1ca5e4f7..63530699b2b 100644
--- a/src/devices/bus/msx_slot/cartridge.h
+++ b/src/devices/bus/msx_slot/cartridge.h
@@ -5,6 +5,7 @@
#include "slot.h"
#include "bus/msx_cart/cartridge.h"
+#include "softlist_dev.h"
extern const device_type MSX_SLOT_CARTRIDGE;
diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h
index 158ff77e706..83de22b0a4b 100644
--- a/src/devices/bus/neogeo/slot.h
+++ b/src/devices/bus/neogeo/slot.h
@@ -4,6 +4,8 @@
#define __NEOGEO_SLOT_H
#include "emu.h"
+#include "softlist_dev.h"
+
/* PCB */
enum
diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h
index 13c11d9ae3f..589fc3d87ec 100644
--- a/src/devices/bus/nes/aladdin.h
+++ b/src/devices/bus/nes/aladdin.h
@@ -4,6 +4,7 @@
#define __NES_ALADDIN_H
#include "nxrom.h"
+#include "softlist_dev.h"
//----------------------------------
diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h
index 1b1fa57fde5..47c625badc7 100644
--- a/src/devices/bus/nes/datach.h
+++ b/src/devices/bus/nes/datach.h
@@ -4,6 +4,7 @@
#define __NES_DATACH_H
#include "bandai.h"
+#include "softlist_dev.h"
#include "machine/i2cmem.h"
#include "machine/bcreader.h"
diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h
index d0924db0ffb..f5d15ce6e46 100644
--- a/src/devices/bus/nes/karastudio.h
+++ b/src/devices/bus/nes/karastudio.h
@@ -4,6 +4,7 @@
#define __NES_KARASTUDIO_H
#include "nxrom.h"
+#include "softlist_dev.h"
//-----------------------------------------
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index d9b64cfa30a..27790c208e0 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -3,6 +3,9 @@
#ifndef __NES_SLOT_H__
#define __NES_SLOT_H__
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h
index b50ad5cf940..2428632824a 100644
--- a/src/devices/bus/nes/sunsoft_dcs.h
+++ b/src/devices/bus/nes/sunsoft_dcs.h
@@ -4,6 +4,7 @@
#define __NES_SUNSOFT_DCS_H
#include "sunsoft.h"
+#include "softlist_dev.h"
//-----------------------------------------------
diff --git a/src/devices/bus/newbrain/fdc.cpp b/src/devices/bus/newbrain/fdc.cpp
index 92499b19028..d4fadb9df70 100644
--- a/src/devices/bus/newbrain/fdc.cpp
+++ b/src/devices/bus/newbrain/fdc.cpp
@@ -80,7 +80,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( newbrain_fdc_io, AS_IO, 8, newbrain_fdc_t )
ADDRESS_MAP_UNMAP_HIGH
- ADDRESS_MAP_GLOBAL_MASK(0xd1)
+ ADDRESS_MAP_GLOBAL_MASK(0x71)
AM_RANGE(0x00, 0x01) AM_MIRROR(0x10) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0x20, 0x20) AM_MIRROR(0x11) AM_WRITE(fdc_auxiliary_w)
AM_RANGE(0x40, 0x40) AM_MIRROR(0x11) AM_READ(fdc_control_r)
diff --git a/src/devices/bus/odyssey2/slot.h b/src/devices/bus/odyssey2/slot.h
index 88dde833dca..50f04e74b7e 100644
--- a/src/devices/bus/odyssey2/slot.h
+++ b/src/devices/bus/odyssey2/slot.h
@@ -3,6 +3,9 @@
#ifndef __O2_SLOT_H
#define __O2_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/pce/pce_slot.h b/src/devices/bus/pce/pce_slot.h
index c6cb11096e1..579945229bf 100644
--- a/src/devices/bus/pce/pce_slot.h
+++ b/src/devices/bus/pce/pce_slot.h
@@ -3,6 +3,9 @@
#ifndef __PCE_SLOT_H
#define __PCE_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/plus4/exp.h b/src/devices/bus/plus4/exp.h
index c63d2b618f1..2d18efaa207 100644
--- a/src/devices/bus/plus4/exp.h
+++ b/src/devices/bus/plus4/exp.h
@@ -40,7 +40,7 @@
#define __PLUS4_EXPANSION_SLOT__
#include "emu.h"
-
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/devices/bus/pofo/ccm.cpp b/src/devices/bus/pofo/ccm.cpp
new file mode 100644
index 00000000000..a28f29c7637
--- /dev/null
+++ b/src/devices/bus/pofo/ccm.cpp
@@ -0,0 +1,109 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio Memory Card Port emulation
+
+**********************************************************************/
+
+#include "ccm.h"
+
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type PORTFOLIO_MEMORY_CARD_SLOT = &device_creator<portfolio_memory_card_slot_t>;
+
+
+
+//**************************************************************************
+// CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_portfolio_memory_card_slot_interface - constructor
+//-------------------------------------------------
+
+device_portfolio_memory_card_slot_interface::device_portfolio_memory_card_slot_interface(const machine_config &mconfig, device_t &device) :
+ device_slot_card_interface(mconfig, device),
+ m_rom(*this, "rom"),
+ m_nvram(*this, "nvram")
+{
+ m_slot = dynamic_cast<portfolio_memory_card_slot_t *>(device.owner());
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// portfolio_memory_card_slot_t - constructor
+//-------------------------------------------------
+
+portfolio_memory_card_slot_t::portfolio_memory_card_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, PORTFOLIO_MEMORY_CARD_SLOT, "Atari Portfolio memory card port", tag, owner, clock, "portfolio_ccm_slot", __FILE__),
+ device_slot_interface(mconfig, *this),
+ device_image_interface(mconfig, *this),
+ m_card(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void portfolio_memory_card_slot_t::device_start()
+{
+ m_card = dynamic_cast<device_portfolio_memory_card_slot_interface *>(get_card_device());
+}
+
+
+//-------------------------------------------------
+// call_load -
+//-------------------------------------------------
+
+image_init_result portfolio_memory_card_slot_t::call_load()
+{
+ if (m_card)
+ {
+ if (software_entry() == nullptr)
+ {
+ fread(m_card->m_rom, length());
+ }
+ else
+ {
+ load_software_region("rom", m_card->m_rom);
+ }
+ }
+
+ return image_init_result::PASS;
+}
+
+
+//-------------------------------------------------
+// get_default_card_software -
+//-------------------------------------------------
+
+std::string portfolio_memory_card_slot_t::get_default_card_software()
+{
+ return software_get_default_slot("rom");
+}
+
+
+//-------------------------------------------------
+// SLOT_INTERFACE( portfolio_memory_cards )
+//-------------------------------------------------
+
+// slot devices
+#include "ram.h"
+#include "rom.h"
+
+SLOT_INTERFACE_START( portfolio_memory_cards )
+ SLOT_INTERFACE("ram", PORTFOLIO_RAM_CARD)
+ SLOT_INTERFACE("rom", PORTFOLIO_ROM_CARD)
+SLOT_INTERFACE_END
diff --git a/src/devices/bus/pofo/ccm.h b/src/devices/bus/pofo/ccm.h
new file mode 100644
index 00000000000..4f8f87c873f
--- /dev/null
+++ b/src/devices/bus/pofo/ccm.h
@@ -0,0 +1,156 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio Memory Card port emulation
+
+**********************************************************************
+
+ Pin COMMON RAM OPTROM Mask ROM
+ 32k 64k 128k
+ 1 A16
+ 2 A15
+ 3 VBB VPP NC VPP NC
+ 4 A12
+ 5 A7
+ 6 A6
+ 7 A5
+ 8 A4
+ 9 A3
+ 10 A2
+ 11 A1
+ 12 A0
+ 13 D0
+ 14 D1
+ 15 D2
+ 16 GND
+ 17 D3
+ 18 D4
+ 19 D5
+ 20 D6
+ 21 D7
+ 22 CE
+ 23 A10
+ 24 OE OE OE/VPP OE OE
+ 25 A11
+ 26 A9
+ 27 A8
+ 28 A13
+ 29 A14
+ 30 WE NC NC PGM NC
+ 31 VCC
+ 32 CDET
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __PORTFOLIO_MEMORY_CARD_SLOT__
+#define __PORTFOLIO_MEMORY_CARD_SLOT__
+
+#include "emu.h"
+#include "softlist_dev.h"
+
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+#define PORTFOLIO_MEMORY_CARD_SLOT_A_TAG "ccma"
+#define PORTFOLIO_MEMORY_CARD_SLOT_B_TAG "ccmb"
+
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_PORTFOLIO_MEMORY_CARD_SLOT_ADD(_tag, _slot_intf, _def_slot) \
+ MCFG_DEVICE_ADD(_tag, PORTFOLIO_MEMORY_CARD_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> device_portfolio_memory_card_slot_interface
+
+class portfolio_memory_card_slot_t;
+
+class device_portfolio_memory_card_slot_interface : public device_slot_card_interface
+{
+ friend class portfolio_memory_card_slot_t;
+
+public:
+ // construction/destruction
+ device_portfolio_memory_card_slot_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_portfolio_memory_card_slot_interface() { }
+
+ virtual bool cdet() { return 1; }
+
+ virtual UINT8 nrdi_r(address_space &space, offs_t offset) { return 0xff; };
+ virtual void nwri_w(address_space &space, offs_t offset, UINT8 data) { };
+
+protected:
+ optional_shared_ptr<UINT8> m_rom;
+ optional_shared_ptr<UINT8> m_nvram;
+
+ portfolio_memory_card_slot_t *m_slot;
+};
+
+
+// ======================> portfolio_memory_card_slot_t
+
+class portfolio_memory_card_slot_t : public device_t,
+ public device_slot_interface,
+ public device_image_interface
+{
+public:
+ // construction/destruction
+ portfolio_memory_card_slot_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ virtual ~portfolio_memory_card_slot_t() { }
+
+ // computer interface
+ bool cdet_r() { return (m_card != nullptr) ? m_card->cdet() : 1; }
+
+ DECLARE_READ8_MEMBER( nrdi_r ) { return (m_card != nullptr) ? m_card->nrdi_r(space, offset) : 0xff; }
+ DECLARE_WRITE8_MEMBER( nwri_w ) { if (m_card != nullptr) m_card->nwri_w(space, offset, data); }
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() override { update_names(); }
+ virtual void device_start() override;
+
+ // image-level overrides
+ virtual image_init_result call_load() override;
+ virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
+
+ virtual iodevice_t image_type() const override { return IO_CARTSLOT; }
+
+ virtual bool is_readable() const override { return 1; }
+ virtual bool is_writeable() const override { return 1; }
+ virtual bool is_creatable() const override { return 1; }
+ virtual bool must_be_loaded() const override { return 0; }
+ virtual bool is_reset_on_load() const override { return 1; }
+ virtual const char *image_interface() const override { return "pofo_card"; }
+ virtual const char *file_extensions() const override { return "rom,bin"; }
+
+ // slot interface overrides
+ virtual std::string get_default_card_software() override;
+
+ device_portfolio_memory_card_slot_interface *m_card;
+};
+
+
+// device type definition
+extern const device_type PORTFOLIO_MEMORY_CARD_SLOT;
+
+
+SLOT_INTERFACE_EXTERN( portfolio_memory_cards );
+
+
+
+#endif
diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp
index 98b411990bf..ce7adb0d1fb 100644
--- a/src/devices/bus/pofo/exp.cpp
+++ b/src/devices/bus/pofo/exp.cpp
@@ -96,8 +96,11 @@ void portfolio_expansion_slot_t::device_reset()
// slot devices
#include "hpc101.h"
#include "hpc102.h"
+#include "hpc104.h"
SLOT_INTERFACE_START( portfolio_expansion_cards )
SLOT_INTERFACE("lpt", HPC101)
SLOT_INTERFACE("uart", HPC102)
+ SLOT_INTERFACE("ram", HPC104)
+ SLOT_INTERFACE("ram2", HPC104_2)
SLOT_INTERFACE_END
diff --git a/src/devices/bus/pofo/hpc104.cpp b/src/devices/bus/pofo/hpc104.cpp
new file mode 100644
index 00000000000..5483fc72c2b
--- /dev/null
+++ b/src/devices/bus/pofo/hpc104.cpp
@@ -0,0 +1,241 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio HPC-104 Memory Expander Plus emulation
+
+**********************************************************************/
+
+#include "hpc104.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define LOG 0
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type HPC104 = &device_creator<hpc104_t>;
+const device_type HPC104_2 = &device_creator<hpc104_2_t>;
+
+
+//-------------------------------------------------
+// MACHINE_CONFIG_FRAGMENT( hpc104 )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( hpc104 )
+ MCFG_PORTFOLIO_MEMORY_CARD_SLOT_ADD(PORTFOLIO_MEMORY_CARD_SLOT_B_TAG, portfolio_memory_cards, nullptr)
+
+ MCFG_PORTFOLIO_EXPANSION_SLOT_ADD(PORTFOLIO_EXPANSION_SLOT_TAG, XTAL_4_9152MHz, portfolio_expansion_cards, nullptr)
+ MCFG_PORTFOLIO_EXPANSION_SLOT_IINT_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, iint_w))
+ MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, eint_w))
+ MCFG_PORTFOLIO_EXPANSION_SLOT_NMIO_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, nmio_w))
+ MCFG_PORTFOLIO_EXPANSION_SLOT_WAKE_CALLBACK(DEVWRITELINE(DEVICE_SELF_OWNER, portfolio_expansion_slot_t, wake_w))
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor hpc104_t::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( hpc104 );
+}
+
+
+//-------------------------------------------------
+// INPUT_PORTS( hpc104 )
+//-------------------------------------------------
+
+static INPUT_PORTS_START( hpc104 )
+ PORT_START("SW1")
+ PORT_DIPNAME( 0x01, 0x00, "Unit Number" )
+ PORT_DIPSETTING( 0x00, "1 (0x1F000)" )
+ PORT_DIPSETTING( 0x01, "2 (0x5F000)" )
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor hpc104_t::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( hpc104 );
+}
+
+
+//-------------------------------------------------
+// INPUT_PORTS( hpc104_2 )
+//-------------------------------------------------
+
+static INPUT_PORTS_START( hpc104_2 )
+ PORT_START("SW1")
+ PORT_DIPNAME( 0x01, 0x01, "Unit Number" )
+ PORT_DIPSETTING( 0x00, "1 (0x1F000)" )
+ PORT_DIPSETTING( 0x01, "2 (0x5F000)" )
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor hpc104_2_t::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( hpc104_2 );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// hpc104_t - constructor
+//-------------------------------------------------
+
+hpc104_t::hpc104_t(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_portfolio_expansion_slot_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_B_TAG),
+ m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
+ m_nvram(*this, "nvram"),
+ m_io_sw1(*this, "SW1")
+{
+}
+
+hpc104_t::hpc104_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, HPC104, "Atari Portfolio HPC-104", tag, owner, clock, "hpc104", __FILE__),
+ device_portfolio_expansion_slot_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this),
+ m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_B_TAG),
+ m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
+ m_nvram(*this, "nvram"),
+ m_io_sw1(*this, "SW1")
+{
+}
+
+
+//-------------------------------------------------
+// hpc104_2_t - constructor
+//-------------------------------------------------
+
+hpc104_2_t::hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ hpc104_t(mconfig, HPC104_2, "Atari Portfolio HPC-104 (Unit 2)", tag, owner, clock, "hpc104_2", __FILE__) { }
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void hpc104_t::device_start()
+{
+ // allocate memory
+ m_nvram.allocate(0x40000);
+}
+
+
+//-------------------------------------------------
+// device_reset - device-specific reset
+//-------------------------------------------------
+
+void hpc104_t::device_reset()
+{
+ m_sw1 = BIT(m_io_sw1->read(), 0);
+}
+
+
+//-------------------------------------------------
+// nrdi_r - read
+//-------------------------------------------------
+
+UINT8 hpc104_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1)
+{
+ data = m_exp->nrdi_r(space, offset, data, iom, bcom, m_ncc1_out || ncc1);
+
+ if (!iom)
+ {
+ if (!(!m_ncc1_out || ncc1))
+ {
+ if (LOG) logerror("%s %s CCM0 read %05x\n", machine().time().as_string(), machine().describe_context(), offset & 0x1ffff);
+
+ data = m_ccm->nrdi_r(space, offset & 0x1ffff);
+ }
+
+ if (m_sw1)
+ {
+ if (offset >= 0x5f000 && offset < 0x9f000)
+ {
+ data = m_nvram[offset - 0x5f000];
+ }
+ }
+ else
+ {
+ if (offset >= 0x1f000 && offset < 0x5f000)
+ {
+ data = m_nvram[offset - 0x1f000] = data;
+ }
+ }
+ }
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// nwri_w - write
+//-------------------------------------------------
+
+void hpc104_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1)
+{
+ m_exp->nwri_w(space, offset, data, iom, bcom, m_ncc1_out || ncc1);
+
+ if (!iom)
+ {
+ if (!(!m_ncc1_out || ncc1))
+ {
+ if (LOG) logerror("%s %s CCM1 write %05x:%02x\n", machine().time().as_string(), machine().describe_context(), offset & 0x1ffff, data);
+
+ m_ccm->nwri_w(space, offset & 0x1ffff, data);
+ }
+
+ if (m_sw1)
+ {
+ if (offset >= 0x5f000 && offset < 0x9f000)
+ {
+ m_nvram[offset - 0x5f000] = data;
+ }
+ }
+ else
+ {
+ if (offset >= 0x1f000 && offset < 0x5f000)
+ {
+ m_nvram[offset - 0x1f000] = data;
+ }
+ }
+ }
+ else
+ {
+ if (!bcom)
+ {
+ if ((offset & 0x0f) == 0x0c)
+ {
+ m_ncc1_out = BIT(data, 0);
+
+ if (LOG) logerror("NCC1 out %u\n", machine().time().as_string(), machine().describe_context(), m_ncc1_out);
+ }
+ }
+ }
+}
diff --git a/src/devices/bus/pofo/hpc104.h b/src/devices/bus/pofo/hpc104.h
new file mode 100644
index 00000000000..9d930c21347
--- /dev/null
+++ b/src/devices/bus/pofo/hpc104.h
@@ -0,0 +1,86 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio HPC-104 Memory Expander Plus emulation
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __HPC104__
+#define __HPC104__
+
+#include "emu.h"
+#include "exp.h"
+#include "bus/pofo/ccm.h"
+#include "machine/nvram.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> hpc104_t
+
+class hpc104_t : public device_t,
+ public device_portfolio_expansion_slot_interface,
+ public device_nvram_interface
+{
+public:
+ // construction/destruction
+ hpc104_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ hpc104_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const override;
+ virtual ioport_constructor device_input_ports() const override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ // device_nvram_interface overrides
+ virtual void nvram_default() override { }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+
+ // device_portfolio_expansion_slot_interface overrides
+ virtual bool nmd1() override { return m_ccm->cdet_r(); }
+
+ virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override;
+ virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override;
+
+private:
+ required_device<portfolio_memory_card_slot_t> m_ccm;
+ required_device<portfolio_expansion_slot_t> m_exp;
+ optional_shared_ptr<UINT8> m_nvram;
+ required_ioport m_io_sw1;
+
+ bool m_sw1;
+ bool m_ncc1_out;
+};
+
+
+// ======================> hpc104_2_t
+
+class hpc104_2_t : public hpc104_t
+{
+public:
+ // construction/destruction
+ hpc104_2_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual ioport_constructor device_input_ports() const override;
+};
+
+
+// device type definition
+extern const device_type HPC104;
+extern const device_type HPC104_2;
+
+
+
+#endif
diff --git a/src/devices/bus/pofo/ram.cpp b/src/devices/bus/pofo/ram.cpp
new file mode 100644
index 00000000000..e1fdce1b7ad
--- /dev/null
+++ b/src/devices/bus/pofo/ram.cpp
@@ -0,0 +1,63 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio 128KB RAM card emulation
+
+**********************************************************************/
+
+#include "ram.h"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type PORTFOLIO_RAM_CARD = &device_creator<portfolio_ram_card_t>;
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// portfolio_ram_card_t - constructor
+//-------------------------------------------------
+
+portfolio_ram_card_t::portfolio_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, PORTFOLIO_RAM_CARD, "Atari Portfolio RAM card", tag, owner, clock, "portfolio_ram_card", __FILE__),
+ device_portfolio_memory_card_slot_interface(mconfig, *this),
+ device_nvram_interface(mconfig, *this)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void portfolio_ram_card_t::device_start()
+{
+ m_nvram.allocate(0x20000);
+}
+
+
+//-------------------------------------------------
+// nrdi_r - read
+//-------------------------------------------------
+
+UINT8 portfolio_ram_card_t::nrdi_r(address_space &space, offs_t offset)
+{
+ return m_nvram[offset];
+}
+
+
+//-------------------------------------------------
+// nwri_w - write
+//-------------------------------------------------
+
+void portfolio_ram_card_t::nwri_w(address_space &space, offs_t offset, UINT8 data)
+{
+ m_nvram[offset] = data;
+}
diff --git a/src/devices/bus/pofo/ram.h b/src/devices/bus/pofo/ram.h
new file mode 100644
index 00000000000..77af70f33be
--- /dev/null
+++ b/src/devices/bus/pofo/ram.h
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio 128KB RAM card emulation
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __PORTFOLIO_RAM_CARD__
+#define __PORTFOLIO_RAM_CARD__
+
+#include "emu.h"
+#include "ccm.h"
+#include "machine/nvram.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> portfolio_ram_card_t
+
+class portfolio_ram_card_t : public device_t,
+ public device_portfolio_memory_card_slot_interface,
+ public device_nvram_interface
+{
+public:
+ // construction/destruction
+ portfolio_ram_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_nvram_interface overrides
+ virtual void nvram_default() override { }
+ virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
+ virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
+
+ // device_portfolio_memory_card_slot_interface overrides
+ virtual bool cdet() override { return 0; }
+
+ virtual UINT8 nrdi_r(address_space &space, offs_t offset) override;
+ virtual void nwri_w(address_space &space, offs_t offset, UINT8 data) override;
+};
+
+
+// device type definition
+extern const device_type PORTFOLIO_RAM_CARD;
+
+
+
+#endif
diff --git a/src/devices/bus/pofo/rom.cpp b/src/devices/bus/pofo/rom.cpp
new file mode 100644
index 00000000000..fbc4c5961b5
--- /dev/null
+++ b/src/devices/bus/pofo/rom.cpp
@@ -0,0 +1,51 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio ROM card emulation
+
+**********************************************************************/
+
+#include "rom.h"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type PORTFOLIO_ROM_CARD = &device_creator<portfolio_rom_card_t>;
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// portfolio_rom_card_t - constructor
+//-------------------------------------------------
+
+portfolio_rom_card_t::portfolio_rom_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, PORTFOLIO_ROM_CARD, "Atari Portfolio ROM card", tag, owner, clock, "portfolio_rom_card", __FILE__),
+ device_portfolio_memory_card_slot_interface(mconfig, *this)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void portfolio_rom_card_t::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// nrdi_r - read
+//-------------------------------------------------
+
+UINT8 portfolio_rom_card_t::nrdi_r(address_space &space, offs_t offset)
+{
+ return m_rom[offset];
+}
diff --git a/src/devices/bus/pofo/rom.h b/src/devices/bus/pofo/rom.h
new file mode 100644
index 00000000000..48503fef58b
--- /dev/null
+++ b/src/devices/bus/pofo/rom.h
@@ -0,0 +1,48 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ Atari Portfolio ROM card emulation
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __PORTFOLIO_ROM_CARD__
+#define __PORTFOLIO_ROM_CARD__
+
+#include "emu.h"
+#include "ccm.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> portfolio_rom_card_t
+
+class portfolio_rom_card_t : public device_t,
+ public device_portfolio_memory_card_slot_interface
+{
+public:
+ // construction/destruction
+ portfolio_rom_card_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // device_portfolio_memory_card_slot_interface overrides
+ virtual bool cdet() override { return 0; }
+
+ virtual UINT8 nrdi_r(address_space &space, offs_t offset) override;
+};
+
+
+// device type definition
+extern const device_type PORTFOLIO_ROM_CARD;
+
+
+
+#endif
diff --git a/src/devices/bus/ql/rom.h b/src/devices/bus/ql/rom.h
index 606ffe4e67b..5649804df66 100644
--- a/src/devices/bus/ql/rom.h
+++ b/src/devices/bus/ql/rom.h
@@ -31,7 +31,7 @@
#define __QL_ROM_CARTRIDGE_SLOT__
#include "emu.h"
-
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/devices/bus/saturn/sat_slot.h b/src/devices/bus/saturn/sat_slot.h
index af16ecbdeaa..f87ce9bf0d3 100644
--- a/src/devices/bus/saturn/sat_slot.h
+++ b/src/devices/bus/saturn/sat_slot.h
@@ -3,6 +3,9 @@
#ifndef __SAT_SLOT_H
#define __SAT_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/scv/slot.h b/src/devices/bus/scv/slot.h
index 1d921f8d607..cbf87dd7d06 100644
--- a/src/devices/bus/scv/slot.h
+++ b/src/devices/bus/scv/slot.h
@@ -3,6 +3,9 @@
#ifndef __SCV_SLOT_H
#define __SCV_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/sega8/sega8_slot.h b/src/devices/bus/sega8/sega8_slot.h
index d27e993f0f7..5a0ce0af010 100644
--- a/src/devices/bus/sega8/sega8_slot.h
+++ b/src/devices/bus/sega8/sega8_slot.h
@@ -3,6 +3,9 @@
#ifndef __SEGA8_SLOT_H
#define __SEGA8_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/snes/snes_slot.h b/src/devices/bus/snes/snes_slot.h
index 7ebfefaa7f2..f6d4208eb1c 100644
--- a/src/devices/bus/snes/snes_slot.h
+++ b/src/devices/bus/snes/snes_slot.h
@@ -3,6 +3,9 @@
#ifndef __SNS_SLOT_H
#define __SNS_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/ti99_peb/bwg.cpp b/src/devices/bus/ti99_peb/bwg.cpp
index c5c9796a084..5587c931b6e 100644
--- a/src/devices/bus/ti99_peb/bwg.cpp
+++ b/src/devices/bus/ti99_peb/bwg.cpp
@@ -85,10 +85,15 @@
*/
snug_bwg_device::snug_bwg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : ti_expansion_card_device(mconfig, TI99_BWG, "SNUG BwG Floppy Controller", tag, owner, clock, "ti99_bwg", __FILE__), m_DRQ(), m_IRQ(), m_dip1(0), m_dip2(0), m_dip34(0), m_ram_page(0), m_rom_page(0), m_WAITena(false), m_inDsrArea(false), m_WDsel(false), m_WDsel0(false), m_RTCsel(false), m_lastK(false), m_dataregLB(false), m_rtc_enabled(false), m_MOTOR_ON(), m_lastval(0), m_address(0), m_DSEL(0), m_SIDSEL(), m_motor_on_timer(nullptr), m_dsrrom(nullptr), m_buffer_ram(nullptr), m_current_floppy(nullptr),
- m_wd1773(*this, FDC_TAG),
- m_clock(*this, CLOCK_TAG), m_debug_dataout(false)
- { }
+ : ti_expansion_card_device(mconfig, TI99_BWG, "SNUG BwG Floppy Controller", tag, owner, clock, "ti99_bwg", __FILE__),
+ m_DRQ(), m_IRQ(), m_dip1(0), m_dip2(0), m_dip34(0), m_ram_page(0),
+ m_rom_page(0), m_WAITena(false), m_inDsrArea(false), m_WDsel(false),
+ m_WDsel0(false), m_RTCsel(false), m_lastK(false), m_dataregLB(false),
+ m_rtc_enabled(false), m_MOTOR_ON(), m_lastval(0), m_address(0),
+ m_DSEL(0), m_SIDSEL(), m_motor_on_timer(nullptr), m_dsrrom(nullptr),
+ m_buffer_ram(*this, BUFFER), m_current_floppy(nullptr),
+ m_wd1773(*this, FDC_TAG),
+ m_clock(*this, CLOCK_TAG), m_debug_dataout(false) { }
/*
Operate the wait state logic.
@@ -189,7 +194,7 @@ void snug_bwg_device::debug_read(offs_t offset, UINT8* value)
if ((offset & 0x1c00)==0x1c00)
{
if ((offset & 0x1fe0)!=0x1fe0)
- *value = m_buffer_ram[(m_ram_page<<10) | (offset & 0x03ff)];
+ *value = m_buffer_ram->pointer()[(m_ram_page<<10) | (offset & 0x03ff)];
}
else
*value = m_dsrrom[(m_rom_page<<13) | (offset & 0x1fff)];
@@ -201,7 +206,7 @@ void snug_bwg_device::debug_write(offs_t offset, UINT8 data)
if (((offset & m_select_mask)==m_select_value) && m_selected)
{
if (((offset & 0x1c00)==0x1c00) && ((offset & 0x1fe0)!=0x1fe0))
- m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
+ m_buffer_ram->pointer()[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
}
}
@@ -233,7 +238,7 @@ READ8Z_MEMBER(snug_bwg_device::readz)
}
else
{
- *value = m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)];
+ *value = m_buffer_ram->pointer()[(m_ram_page<<10) | (m_address & 0x03ff)];
if (TRACE_RW) logerror("bwg: read ram: %04x (page %d)-> %02x\n", m_address & 0xffff, m_ram_page, *value);
}
}
@@ -254,7 +259,7 @@ READ8Z_MEMBER(snug_bwg_device::readz)
}
else
{
- *value = m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)];
+ *value = m_buffer_ram->pointer()[(m_ram_page<<10) | (m_address & 0x03ff)];
if (TRACE_RW) logerror("bwg: read ram: %04x (page %d)-> %02x\n", m_address & 0xffff, m_ram_page, *value);
}
}
@@ -302,7 +307,7 @@ WRITE8_MEMBER(snug_bwg_device::write)
else
{
if (TRACE_RW) logerror("bwg: write ram: %04x (page %d) <- %02x\n", m_address & 0xffff, m_ram_page, data);
- m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
+ m_buffer_ram->pointer()[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
}
}
else
@@ -318,7 +323,7 @@ WRITE8_MEMBER(snug_bwg_device::write)
else
{
if (TRACE_RW) logerror("bwg: write ram: %04x (page %d) <- %02x\n", m_address & 0xffff, m_ram_page, data);
- m_buffer_ram[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
+ m_buffer_ram->pointer()[(m_ram_page<<10) | (m_address & 0x03ff)] = data;
}
}
}
@@ -558,7 +563,6 @@ void snug_bwg_device::device_start(void)
{
logerror("bwg: BWG start\n");
m_dsrrom = memregion(DSRROM)->base();
- m_buffer_ram = memregion(BUFFER)->base();
m_motor_on_timer = timer_alloc(MOTOR_TIMER);
m_cru_base = 0x1100;
}
@@ -678,13 +682,15 @@ MACHINE_CONFIG_FRAGMENT( bwg_fdc )
MCFG_FLOPPY_DRIVE_SOUND(true)
MCFG_FLOPPY_DRIVE_ADD("3", bwg_floppies, nullptr, snug_bwg_device::floppy_formats)
MCFG_FLOPPY_DRIVE_SOUND(true)
+
+ MCFG_RAM_ADD(BUFFER)
+ MCFG_RAM_DEFAULT_SIZE("2K")
+ MCFG_RAM_DEFAULT_VALUE(0)
MACHINE_CONFIG_END
ROM_START( bwg_fdc )
ROM_REGION(0x8000, DSRROM, 0)
ROM_LOAD("bwg_dsr.u15", 0x0000, 0x8000, CRC(06f1ec89) SHA1(6ad77033ed268f986d9a5439e65f7d391c4b7651)) /* BwG disk DSR ROM */
- ROM_REGION(0x0800, BUFFER, 0) /* BwG RAM buffer */
- ROM_FILL(0x0000, 0x0400, 0x00)
ROM_END
machine_config_constructor snug_bwg_device::device_mconfig_additions() const
diff --git a/src/devices/bus/ti99_peb/bwg.h b/src/devices/bus/ti99_peb/bwg.h
index 262256b26c1..6178a20d457 100644
--- a/src/devices/bus/ti99_peb/bwg.h
+++ b/src/devices/bus/ti99_peb/bwg.h
@@ -17,6 +17,7 @@
#include "imagedev/flopdrv.h"
#include "machine/mm58274c.h"
#include "machine/wd_fdc.h"
+#include "machine/ram.h"
extern const device_type TI99_BWG;
@@ -119,7 +120,7 @@ private:
UINT8* m_dsrrom;
// Buffer RAM
- UINT8* m_buffer_ram;
+ required_device<ram_device> m_buffer_ram;
// Link to the attached floppy drives
floppy_image_device* m_floppy[4];
diff --git a/src/devices/bus/ti99_peb/hfdc.cpp b/src/devices/bus/ti99_peb/hfdc.cpp
index 0a84e0ec54f..0252cfda5f9 100644
--- a/src/devices/bus/ti99_peb/hfdc.cpp
+++ b/src/devices/bus/ti99_peb/hfdc.cpp
@@ -90,9 +90,14 @@
myarc_hfdc_device::myarc_hfdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ti_expansion_card_device(mconfig, TI99_HFDC, "Myarc Hard and Floppy Disk Controller", tag, owner, clock, "ti99_hfdc", __FILE__), m_motor_on_timer(nullptr),
m_hdc9234(*this, FDC_TAG),
- m_clock(*this, CLOCK_TAG), m_current_floppy(nullptr), m_current_harddisk(nullptr), m_see_switches(false), m_irq(), m_dip(), m_motor_running(false),
- m_inDsrArea(false), m_HDCsel(false), m_RTCsel(false), m_tapesel(false), m_RAMsel(false), m_ROMsel(false), m_address(0),
- m_wait_for_hd1(false), m_dsrrom(nullptr), m_rom_page(0), m_buffer_ram(nullptr), m_status_latch(0), m_dma_address(0), m_output1_latch(0), m_output2_latch(0), m_lastval(0), m_MOTOR_ON(), m_readyflags(0)
+ m_clock(*this, CLOCK_TAG), m_current_floppy(nullptr),
+ m_current_harddisk(nullptr), m_see_switches(false),
+ m_irq(), m_dip(), m_motor_running(false),
+ m_inDsrArea(false), m_HDCsel(false), m_RTCsel(false),
+ m_tapesel(false), m_RAMsel(false), m_ROMsel(false), m_address(0),
+ m_wait_for_hd1(false), m_dsrrom(nullptr), m_rom_page(0),
+ m_buffer_ram(*this, BUFFER), m_status_latch(0), m_dma_address(0),
+ m_output1_latch(0), m_output2_latch(0), m_lastval(0), m_MOTOR_ON(), m_readyflags(0)
{
}
@@ -151,7 +156,7 @@ void myarc_hfdc_device::debug_read(offs_t offset, UINT8* value)
if ((offset & 0x1000)==RAM_ADDR)
{
int bank = (offset & 0x0c00) >> 10;
- *value = m_buffer_ram[(m_ram_page[bank]<<10) | (offset & 0x03ff)];
+ *value = m_buffer_ram->pointer()[(m_ram_page[bank]<<10) | (offset & 0x03ff)];
}
else
{
@@ -170,7 +175,7 @@ void myarc_hfdc_device::debug_write(offs_t offset, UINT8 data)
if ((offset & 0x1000)==RAM_ADDR)
{
int bank = (offset & 0x0c00) >> 10;
- m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)] = data;
+ m_buffer_ram->pointer()[(m_ram_page[bank]<<10) | (m_address & 0x03ff)] = data;
}
}
}
@@ -202,21 +207,21 @@ READ8Z_MEMBER(myarc_hfdc_device::readz)
{
if (m_tapesel)
{
- logerror("%s: Tape support not available on this HFDC version (access to address %04x)\n", tag(), m_address & 0xffff);
+ logerror("Tape support not available on this HFDC version (access to address %04x)\n", m_address & 0xffff);
return;
}
if (m_HDCsel)
{
*value = m_hdc9234->read(space, (m_address>>2)&1, 0xff);
- if (TRACE_COMP) logerror("%s: %04x[HDC] -> %02x\n", tag(), m_address & 0xffff, *value);
+ if (TRACE_COMP) logerror("%04x[HDC] -> %02x\n", m_address & 0xffff, *value);
return;
}
if (m_RTCsel)
{
*value = m_clock->read(space, (m_address & 0x001e) >> 1);
- if (TRACE_COMP) logerror("%s: %04x[CLK] -> %02x\n", tag(), m_address & 0xffff, *value);
+ if (TRACE_COMP) logerror("%04x[CLK] -> %02x\n", m_address & 0xffff, *value);
return;
}
@@ -229,13 +234,13 @@ READ8Z_MEMBER(myarc_hfdc_device::readz)
int bank = (m_address & 0x0c00) >> 10;
// If a DMA is in progress, do not respond
- if (m_dip == CLEAR_LINE) *value = m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)];
+ if (m_dip == CLEAR_LINE) *value = m_buffer_ram->pointer()[(m_ram_page[bank]<<10) | (m_address & 0x03ff)];
if (TRACE_RAM)
{
if (WORD_ALIGNED(m_address))
{
- int valword = (((*value) << 8) | m_buffer_ram[(m_ram_page[bank]<<10) | ((m_address+1) & 0x03ff)])&0xffff;
- logerror("%s: %04x[%02x] -> %04x\n", tag(), m_address & 0xffff, m_ram_page[bank], valword);
+ int valword = (((*value) << 8) | m_buffer_ram->pointer()[(m_ram_page[bank]<<10) | ((m_address+1) & 0x03ff)])&0xffff;
+ logerror("%04x[%02x] -> %04x\n", m_address & 0xffff, m_ram_page[bank], valword);
}
}
return;
@@ -249,7 +254,7 @@ READ8Z_MEMBER(myarc_hfdc_device::readz)
if (WORD_ALIGNED(m_address))
{
int valword = (((*value) << 8) | m_dsrrom[(m_rom_page << 12) | ((m_address + 1) & 0x0fff)])&0xffff;
- logerror("%s: %04x[%02x] -> %04x\n", tag(), m_address & 0xffff, m_rom_page, valword);
+ logerror("%04x[%02x] -> %04x\n", m_address & 0xffff, m_rom_page, valword);
}
}
return;
@@ -281,20 +286,20 @@ WRITE8_MEMBER( myarc_hfdc_device::write )
{
if (m_tapesel)
{
- logerror("%s: Tape support not available on this HFDC version (write access to address %04x: %02x)\n", tag(), m_address & 0xffff, data);
+ logerror("Tape support not available on this HFDC version (write access to address %04x: %02x)\n", m_address & 0xffff, data);
return;
}
if (m_HDCsel)
{
- if (TRACE_COMP) logerror("%s: %04x[HDC] <- %02x\n", tag(), m_address & 0xffff, data);
+ if (TRACE_COMP) logerror("%04x[HDC] <- %02x\n", m_address & 0xffff, data);
m_hdc9234->write(space, (m_address>>2)&1, data, 0xff);
return;
}
if (m_RTCsel)
{
- if (TRACE_COMP) logerror("%s: %04x[CLK] <- %02x\n", tag(), m_address & 0xffff, data);
+ if (TRACE_COMP) logerror("%04x[CLK] <- %02x\n", m_address & 0xffff, data);
m_clock->write(space, (m_address & 0x001e) >> 1, data);
return;
}
@@ -306,16 +311,16 @@ WRITE8_MEMBER( myarc_hfdc_device::write )
// 0101 10xx xxxx xxxx bank 2
// 0101 11xx xxxx xxxx bank 3
int bank = (m_address & 0x0c00) >> 10;
- if (TRACE_RAM) logerror("%s: %04x[%02x] <- %02x\n", tag(), m_address & 0xffff, m_ram_page[bank], data);
+ if (TRACE_RAM) logerror("%04x[%02x] <- %02x\n", m_address & 0xffff, m_ram_page[bank], data);
// When a DMA is in progress, do not change anything
- if (m_dip == CLEAR_LINE) m_buffer_ram[(m_ram_page[bank]<<10) | (m_address & 0x03ff)] = data;
+ if (m_dip == CLEAR_LINE) m_buffer_ram->pointer()[(m_ram_page[bank]<<10) | (m_address & 0x03ff)] = data;
return;
}
// The rest is ROM
if (m_ROMsel)
{
- if (TRACE_ROM) logerror("%s: Ignoring write ROM %04x[%02x]: %02x\n", tag(), m_address & 0xffff, m_rom_page, data);
+ if (TRACE_ROM) logerror("Ignoring write ROM %04x[%02x]: %02x\n", m_address & 0xffff, m_rom_page, data);
}
}
}
@@ -388,7 +393,7 @@ READ8Z_MEMBER(myarc_hfdc_device::crureadz)
*value = 0;
}
- if (TRACE_CRU) logerror("%s: CRU %04x -> %02x\n", tag(), offset & 0xffff, *value);
+ if (TRACE_CRU) logerror("CRU %04x -> %02x\n", offset & 0xffff, *value);
}
}
@@ -420,7 +425,7 @@ WRITE8_MEMBER(myarc_hfdc_device::cruwrite)
{
if ((offset & 0xff00)==m_cru_base)
{
- if (TRACE_CRU) logerror("%s: CRU %04x <- %d\n", tag(), offset & 0xffff, data);
+ if (TRACE_CRU) logerror("CRU %04x <- %d\n", offset & 0xffff, data);
int bit = (offset >> 1) & 0x1f;
@@ -435,9 +440,9 @@ WRITE8_MEMBER(myarc_hfdc_device::cruwrite)
if (TRACE_CRU)
{
- if (bit==0x0d) logerror("%s: RAM page @5400 = %d\n", tag(), m_ram_page[1]);
- if (bit==0x12) logerror("%s: RAM page @5800 = %d\n", tag(), m_ram_page[2]);
- if (bit==0x17) logerror("%s: RAM page @5C00 = %d\n", tag(), m_ram_page[3]);
+ if (bit==0x0d) logerror("RAM page @5400 = %d\n", m_ram_page[1]);
+ if (bit==0x12) logerror("RAM page @5800 = %d\n", m_ram_page[2]);
+ if (bit==0x17) logerror("RAM page @5C00 = %d\n", m_ram_page[3]);
}
return;
}
@@ -448,12 +453,12 @@ WRITE8_MEMBER(myarc_hfdc_device::cruwrite)
{
bool turnOn = (data!=0);
// Avoid too many meaningless log outputs
- if (TRACE_CRU) if (m_selected != turnOn) logerror("%s: card %s\n", tag(), turnOn? "selected" : "unselected");
+ if (TRACE_CRU) if (m_selected != turnOn) logerror("card %s\n", turnOn? "selected" : "unselected");
m_selected = turnOn;
break;
}
case 1:
- if (TRACE_CRU) if (data==0) logerror("%s: trigger HDC reset\n", tag());
+ if (TRACE_CRU) if (data==0) logerror("trigger HDC reset\n");
m_hdc9234->reset((data == 0)? ASSERT_LINE : CLEAR_LINE);
break;
@@ -477,17 +482,17 @@ WRITE8_MEMBER(myarc_hfdc_device::cruwrite)
case 3:
m_hdc9234->set_clock_divider(1, data);
m_rom_page = (data != 0)? (m_rom_page | 2) : (m_rom_page & 0xfd);
- if (TRACE_CRU) logerror("%s: ROM page = %d\n", tag(), m_rom_page);
+ if (TRACE_CRU) logerror("ROM page = %d\n", m_rom_page);
break;
case 4:
m_see_switches = (data != 0);
m_rom_page = (data != 0)? (m_rom_page | 1) : (m_rom_page & 0xfe);
- if (TRACE_CRU) logerror("%s: ROM page = %d, see_switches = %d\n", tag(), m_rom_page, m_see_switches);
+ if (TRACE_CRU) logerror("ROM page = %d, see_switches = %d\n", m_rom_page, m_see_switches);
break;
default:
- logerror("%s: Attempt to set undefined CRU bit %d\n", tag(), bit);
+ logerror("Attempt to set undefined CRU bit %d\n", bit);
}
}
}
@@ -505,7 +510,7 @@ void myarc_hfdc_device::device_timer(emu_timer &timer, device_timer_id id, int p
*/
void myarc_hfdc_device::floppy_index_callback(floppy_image_device *floppy, int state)
{
- if (TRACE_LINES) if (state==1) logerror("%s: Floppy index pulse\n", tag());
+ if (TRACE_LINES) if (state==1) logerror("Floppy index pulse\n");
// m_status_latch = (state==ASSERT_LINE)? (m_status_latch | HDC_DS_INDEX) : (m_status_latch & ~HDC_DS_INDEX);
set_bits(m_status_latch, HDC_DS_INDEX, (state==ASSERT_LINE));
signal_drive_status();
@@ -516,7 +521,7 @@ void myarc_hfdc_device::floppy_index_callback(floppy_image_device *floppy, int s
*/
void myarc_hfdc_device::harddisk_index_callback(mfm_harddisk_device *harddisk, int state)
{
- if (TRACE_LINES) if (state==1) logerror("%s: HD index pulse\n", tag());
+ if (TRACE_LINES) if (state==1) logerror("HD index pulse\n");
set_bits(m_status_latch, HDC_DS_INDEX, (state==ASSERT_LINE));
signal_drive_status();
}
@@ -526,7 +531,7 @@ void myarc_hfdc_device::harddisk_index_callback(mfm_harddisk_device *harddisk, i
*/
void myarc_hfdc_device::harddisk_ready_callback(mfm_harddisk_device *harddisk, int state)
{
- if (TRACE_LINES) logerror("%s: HD READY = %d\n", tag(), state);
+ if (TRACE_LINES) logerror("HD READY = %d\n", state);
set_bits(m_status_latch, HDC_DS_READY, (state==ASSERT_LINE));
signal_drive_status();
}
@@ -536,7 +541,7 @@ void myarc_hfdc_device::harddisk_ready_callback(mfm_harddisk_device *harddisk, i
*/
void myarc_hfdc_device::harddisk_skcom_callback(mfm_harddisk_device *harddisk, int state)
{
- if (TRACE_LINES) logerror("%s: HD seek complete = %d\n", tag(), state);
+ if (TRACE_LINES) logerror("HD seek complete = %d\n", state);
set_bits(m_status_latch, HDC_DS_SKCOM, (state==ASSERT_LINE));
signal_drive_status();
}
@@ -627,14 +632,14 @@ WRITE8_MEMBER( myarc_hfdc_device::auxbus_out )
switch (offset)
{
case HDC_INPUT_STATUS:
- logerror("%s: Invalid operation: S0=S1=0, but tried to write (expected: read drive status)\n", tag());
+ logerror("Invalid operation: S0=S1=0, but tried to write (expected: read drive status)\n");
break;
case HDC_OUTPUT_DMA_ADDR:
// Value is dma address byte. Shift previous contents to the left.
// The value is latched inside the Gate Array.
m_dma_address = ((m_dma_address << 8) + (data&0xff))&0xffffff;
- if (TRACE_DMA) logerror("%s: Setting DMA address; current value = %06x\n", tag(), m_dma_address);
+ if (TRACE_DMA) logerror("Setting DMA address; current value = %06x\n", m_dma_address);
break;
case HDC_OUTPUT_1:
@@ -713,7 +718,7 @@ void myarc_hfdc_device::connect_floppy_unit(int index)
// Clear all latched flags from other drives
m_status_latch = 0;
disconnect_floppy_drives();
- if (TRACE_LINES) logerror("%s: Select floppy drive DSK%d\n", tag(), index+1);
+ if (TRACE_LINES) logerror("Select floppy drive DSK%d\n", index+1);
// Connect new drive
m_current_floppy = m_floppy_unit[index];
@@ -721,11 +726,11 @@ void myarc_hfdc_device::connect_floppy_unit(int index)
// We don't use the READY line of floppy drives.
// READY is asserted when DSKx = 1
// The controller fetches the state with the auxbus access
- if (TRACE_LINES) logerror("%s: Connect index callback DSK%d\n", tag(), index+1);
+ if (TRACE_LINES) logerror("Connect index callback DSK%d\n", index+1);
if (m_current_floppy != nullptr)
m_current_floppy->setup_index_pulse_cb(floppy_image_device::index_pulse_cb(FUNC(myarc_hfdc_device::floppy_index_callback), this));
else
- logerror("%s: Connection to DSK%d failed because no drive is connected\n", tag(), index+1);
+ logerror("Connection to DSK%d failed because no drive is connected\n", index+1);
m_hdc9234->connect_floppy_drive(m_floppy_unit[index]);
}
@@ -740,12 +745,12 @@ void myarc_hfdc_device::connect_harddisk_unit(int index)
// Clear all latched flags form other drives
m_status_latch = 0;
disconnect_hard_drives();
- if (TRACE_LINES) logerror("%s: Select hard disk WDS%d\n", tag(), index+1);
+ if (TRACE_LINES) logerror("Select hard disk WDS%d\n", index+1);
// Connect new drive
m_current_harddisk = m_harddisk_unit[index];
- if (TRACE_LINES) logerror("%s: Connect index callback WDS%d\n", tag(), index+1);
+ if (TRACE_LINES) logerror("Connect index callback WDS%d\n", index+1);
if (m_current_harddisk != nullptr)
{
m_current_harddisk->setup_index_pulse_cb(mfm_harddisk_device::index_pulse_cb(FUNC(myarc_hfdc_device::harddisk_index_callback), this));
@@ -753,7 +758,7 @@ void myarc_hfdc_device::connect_harddisk_unit(int index)
m_current_harddisk->setup_seek_complete_cb(mfm_harddisk_device::seek_complete_cb(FUNC(myarc_hfdc_device::harddisk_skcom_callback), this));
}
else
- logerror("%s: Connection to WDS%d failed because no drive is connected\n", tag(), index+1);
+ logerror("Connection to WDS%d failed because no drive is connected\n", index+1);
m_hdc9234->connect_hard_drive(m_current_harddisk);
}
@@ -763,7 +768,7 @@ void myarc_hfdc_device::connect_harddisk_unit(int index)
void myarc_hfdc_device::disconnect_floppy_drives()
{
- if (TRACE_LINES) logerror("%s: Unselect floppy drives\n", tag());
+ if (TRACE_LINES) logerror("Unselect floppy drives\n");
// Disconnect current floppy
if (m_current_floppy != nullptr)
{
@@ -774,7 +779,7 @@ void myarc_hfdc_device::disconnect_floppy_drives()
void myarc_hfdc_device::disconnect_hard_drives()
{
- if (TRACE_LINES) logerror("%s: Unselect hard drives\n", tag());
+ if (TRACE_LINES) logerror("Unselect hard drives\n");
if (m_current_harddisk != nullptr)
{
m_current_harddisk->setup_index_pulse_cb(mfm_harddisk_device::index_pulse_cb());
@@ -791,13 +796,13 @@ void myarc_hfdc_device::set_floppy_motors_running(bool run)
if (run)
{
if (TRACE_MOTOR)
- if (m_MOTOR_ON==CLEAR_LINE) logerror("%s: Motor START\n", tag());
+ if (m_MOTOR_ON==CLEAR_LINE) logerror("Motor START\n");
m_MOTOR_ON = ASSERT_LINE;
}
else
{
if (TRACE_MOTOR)
- if (m_MOTOR_ON==ASSERT_LINE) logerror("%s: Motor STOP\n", tag());
+ if (m_MOTOR_ON==ASSERT_LINE) logerror("Motor STOP\n");
m_MOTOR_ON = CLEAR_LINE;
}
@@ -812,7 +817,7 @@ void myarc_hfdc_device::set_floppy_motors_running(bool run)
WRITE_LINE_MEMBER( myarc_hfdc_device::intrq_w )
{
m_irq = (line_state)state;
- if (TRACE_INT) logerror("%s: INT pin from controller = %d, propagating to INTA*\n", tag(), state);
+ if (TRACE_INT) logerror("INT pin from controller = %d, propagating to INTA*\n", state);
// Set INTA*
// Signal from SMC is active high, INTA* is active low; board inverts signal
@@ -826,7 +831,7 @@ WRITE_LINE_MEMBER( myarc_hfdc_device::intrq_w )
*/
WRITE_LINE_MEMBER( myarc_hfdc_device::dmarq_w )
{
- if (TRACE_DMA) logerror("%s: DMARQ pin from controller = %d\n", tag(), state);
+ if (TRACE_DMA) logerror("DMARQ pin from controller = %d\n", state);
if (state == ASSERT_LINE)
{
m_hdc9234->dmaack(ASSERT_LINE);
@@ -846,9 +851,9 @@ WRITE_LINE_MEMBER( myarc_hfdc_device::dip_w )
*/
READ8_MEMBER( myarc_hfdc_device::read_buffer )
{
- if (TRACE_DMA) logerror("%s: Read access to onboard SRAM at %04x\n", tag(), m_dma_address);
- if (m_dma_address > 0x8000) logerror("%s: Read access beyond RAM size: %06x\n", tag(), m_dma_address);
- UINT8 value = m_buffer_ram[m_dma_address & 0x7fff];
+ if (TRACE_DMA) logerror("Read access to onboard SRAM at %04x\n", m_dma_address);
+ if (m_dma_address > 0x8000) logerror("Read access beyond RAM size: %06x\n", m_dma_address);
+ UINT8 value = m_buffer_ram->pointer()[m_dma_address & 0x7fff];
m_dma_address = (m_dma_address+1) & 0x7fff;
return value;
}
@@ -858,17 +863,15 @@ READ8_MEMBER( myarc_hfdc_device::read_buffer )
*/
WRITE8_MEMBER( myarc_hfdc_device::write_buffer )
{
- if (TRACE_DMA) logerror("%s: Write access to onboard SRAM at %04x: %02x\n", tag(), m_dma_address, data);
- if (m_dma_address > 0x8000) logerror("%s: Write access beyond RAM size: %06x\n", tag(), m_dma_address);
- m_buffer_ram[m_dma_address & 0x7fff] = data;
+ if (TRACE_DMA) logerror("Write access to onboard SRAM at %04x: %02x\n", m_dma_address, data);
+ if (m_dma_address > 0x8000) logerror("Write access beyond RAM size: %06x\n", m_dma_address);
+ m_buffer_ram->pointer()[m_dma_address & 0x7fff] = data;
m_dma_address = (m_dma_address+1) & 0x7fff;
}
void myarc_hfdc_device::device_start()
{
- if (TRACE_EMU) logerror("%s: start\n", tag());
m_dsrrom = memregion(DSRROM)->base();
- m_buffer_ram = memregion(BUFFER)->base();
m_motor_on_timer = timer_alloc(MOTOR_TIMER);
// The HFDC does not use READY; it has on-board RAM for DMA
m_current_floppy = nullptr;
@@ -877,8 +880,6 @@ void myarc_hfdc_device::device_start()
void myarc_hfdc_device::device_reset()
{
- if (TRACE_EMU) logerror("%s: reset\n", tag());
-
// The GenMOD mod; our implementation automagically adapts all cards
if (m_genmod)
{
@@ -914,17 +915,17 @@ void myarc_hfdc_device::device_reset()
for (int i=0; i < 4; i++)
{
if (m_floppy_unit[i] != nullptr)
- logerror("%s: FD connector %d with %s\n", tag(), i+1, m_floppy_unit[i]->name());
+ logerror("FD connector %d with %s\n", i+1, m_floppy_unit[i]->name());
else
- logerror("%s: FD connector %d has no floppy attached\n", tag(), i+1);
+ logerror("FD connector %d has no floppy attached\n", i+1);
}
for (int i=0; i < 3; i++)
{
if (m_harddisk_unit[i] != nullptr)
- logerror("%s: HD connector %d with %s\n", tag(), i+1, m_harddisk_unit[i]->name());
+ logerror("HD connector %d with %s\n", i+1, m_harddisk_unit[i]->name());
else
- logerror("%s: HD connector %d has no drive attached\n", tag(), i+1);
+ logerror("HD connector %d has no drive attached\n", i+1);
}
// Disconnect all units
@@ -1053,13 +1054,15 @@ MACHINE_CONFIG_FRAGMENT( ti99_hfdc )
MCFG_DEVICE_ADD(CLOCK_TAG, MM58274C, 0)
MCFG_MM58274C_MODE24(1) // 24 hour
MCFG_MM58274C_DAY1(0) // sunday
+
+ MCFG_RAM_ADD(BUFFER)
+ MCFG_RAM_DEFAULT_SIZE("32K")
+ MCFG_RAM_DEFAULT_VALUE(0)
MACHINE_CONFIG_END
ROM_START( ti99_hfdc )
ROM_REGION(0x4000, DSRROM, 0)
ROM_LOAD("hfdc_dsr.u34", 0x0000, 0x4000, CRC(66fbe0ed) SHA1(11df2ecef51de6f543e4eaf8b2529d3e65d0bd59)) /* HFDC disk DSR ROM */
- ROM_REGION(0x8000, BUFFER, 0) /* HFDC RAM buffer 32 KiB */
- ROM_FILL(0x0000, 0x8000, 0x00)
ROM_END
diff --git a/src/devices/bus/ti99_peb/hfdc.h b/src/devices/bus/ti99_peb/hfdc.h
index 3fa6817ae39..939671f0142 100644
--- a/src/devices/bus/ti99_peb/hfdc.h
+++ b/src/devices/bus/ti99_peb/hfdc.h
@@ -21,6 +21,7 @@
#include "machine/mm58274c.h"
#include "machine/hdc92x4.h"
+#include "machine/ram.h"
extern const device_type TI99_HFDC;
@@ -149,7 +150,7 @@ private:
int m_rom_page;
// HFDC on-board SRAM (8K or 32K)
- UINT8* m_buffer_ram;
+ required_device<ram_device> m_buffer_ram;
// RAM page registers
int m_ram_page[4];
diff --git a/src/devices/bus/ti99_peb/tn_ide.cpp b/src/devices/bus/ti99_peb/tn_ide.cpp
index a1698f11b02..39686998a96 100644
--- a/src/devices/bus/ti99_peb/tn_ide.cpp
+++ b/src/devices/bus/ti99_peb/tn_ide.cpp
@@ -34,7 +34,7 @@
#define CRU_BASE 0x1000
-#define BUFFER_TAG "ram"
+#define RAMREGION "ram"
/* previously 0xff */
#define PAGE_MASK 0x3f
@@ -52,8 +52,9 @@ enum
nouspikel_ide_interface_device::nouspikel_ide_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: ti_expansion_card_device(mconfig, TI99_IDE, "Nouspikel IDE interface card", tag, owner, clock, "ti99_ide", __FILE__), m_ata_irq(false),
m_cru_register(0), m_rtc(nullptr),
- m_ata(*this, "ata"), m_clk_irq(false), m_sram_enable(false), m_sram_enable_dip(false), m_cur_page(0), m_tms9995_mode(false),
- m_input_latch(0), m_output_latch(0), m_ram(nullptr)
+ m_ata(*this, "ata"), m_clk_irq(false), m_sram_enable(false),
+ m_sram_enable_dip(false), m_cur_page(0), m_tms9995_mode(false),
+ m_input_latch(0), m_output_latch(0), m_ram(*this, RAMREGION)
{
}
@@ -180,9 +181,9 @@ READ8Z_MEMBER(nouspikel_ide_interface_device::readz)
else
{ /* sram */
if ((m_cru_register & cru_reg_page_0) || (addr >= 0x1000))
- reply = m_ram[addr+0x2000 * m_cur_page];
+ reply = m_ram->pointer()[addr+0x2000 * m_cur_page];
else
- reply = m_ram[addr];
+ reply = m_ram->pointer()[addr];
}
*value = reply;
}
@@ -267,9 +268,9 @@ WRITE8_MEMBER(nouspikel_ide_interface_device::write)
if (! (m_cru_register & cru_reg_wp))
{
if ((m_cru_register & cru_reg_page_0) || (addr >= 0x1000))
- m_ram[addr+0x2000 * m_cur_page] = data;
+ m_ram->pointer()[addr+0x2000 * m_cur_page] = data;
else
- m_ram[addr] = data;
+ m_ram->pointer()[addr] = data;
}
}
}
@@ -304,8 +305,6 @@ WRITE_LINE_MEMBER(nouspikel_ide_interface_device::clock_interrupt_callback)
void nouspikel_ide_interface_device::device_start()
{
m_rtc = subdevice<rtc65271_device>("ide_rtc");
-
- m_ram = memregion(BUFFER_TAG)->base();
m_sram_enable_dip = false; // TODO: what is this?
}
@@ -338,12 +337,11 @@ MACHINE_CONFIG_FRAGMENT( tn_ide )
MCFG_RTC65271_INTERRUPT_CB(WRITELINE(nouspikel_ide_interface_device, clock_interrupt_callback))
MCFG_ATA_INTERFACE_ADD( "ata", ata_devices, "hdd", nullptr, false)
MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(nouspikel_ide_interface_device, ide_interrupt_callback))
-MACHINE_CONFIG_END
-ROM_START( tn_ide )
- ROM_REGION(0x80000, BUFFER_TAG, 0) /* RAM buffer 512 KiB */
- ROM_FILL(0x0000, 0x80000, 0x00)
-ROM_END
+ MCFG_RAM_ADD(RAMREGION)
+ MCFG_RAM_DEFAULT_SIZE("512K")
+ MCFG_RAM_DEFAULT_VALUE(0)
+MACHINE_CONFIG_END
INPUT_PORTS_START( tn_ide )
PORT_START( "CRUIDE" )
@@ -371,11 +369,6 @@ machine_config_constructor nouspikel_ide_interface_device::device_mconfig_additi
return MACHINE_CONFIG_NAME( tn_ide );
}
-const tiny_rom_entry *nouspikel_ide_interface_device::device_rom_region() const
-{
- return ROM_NAME( tn_ide );
-}
-
ioport_constructor nouspikel_ide_interface_device::device_input_ports() const
{
return INPUT_PORTS_NAME(tn_ide);
diff --git a/src/devices/bus/ti99_peb/tn_ide.h b/src/devices/bus/ti99_peb/tn_ide.h
index e4c213763b6..e4bb41e2642 100644
--- a/src/devices/bus/ti99_peb/tn_ide.h
+++ b/src/devices/bus/ti99_peb/tn_ide.h
@@ -17,6 +17,7 @@
#include "emu.h"
#include "machine/ataintf.h"
#include "machine/rtc65271.h"
+#include "machine/ram.h"
extern const device_type TI99_IDE;
@@ -40,7 +41,6 @@ public:
protected:
virtual void device_start(void) override;
virtual void device_reset(void) override;
- virtual const tiny_rom_entry *device_rom_region() const override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual ioport_constructor device_input_ports() const override;
@@ -58,7 +58,7 @@ private:
UINT16 m_input_latch;
UINT16 m_output_latch;
- UINT8 *m_ram;
+ required_device<ram_device> m_ram;
};
#endif
diff --git a/src/devices/bus/ti99x/genboard.cpp b/src/devices/bus/ti99x/genboard.cpp
index 7eb48b6197a..572638701ce 100644
--- a/src/devices/bus/ti99x/genboard.cpp
+++ b/src/devices/bus/ti99x/genboard.cpp
@@ -206,12 +206,22 @@
#define TRACE_VIDEOWS 0
#define TRACE_PFM 0
+#define SRAM_PAR_TAG ":sram"
+#define DRAM_PAR_TAG ":dram"
+
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__), m_gromwaddr_LSB(false), m_gromraddr_LSB(false), m_grom_address(0), m_video_waitstates(false), m_extra_waitstates(false), m_ready_asserted(false), m_read_mode(false), m_debug_no_ws(false), m_geneve_mode(false), m_direct_mode(false), m_cartridge_size(0), m_cartridge_secondpage(false), m_cartridge6_writable(false), m_cartridge7_writable(false), m_turbo(false), m_genmod(false), m_timode(false), m_pfm_mode(0), m_pfm_bank(0), m_pfm_output_enable(false), m_sram_mask(0), m_sram_val(0),
+: device_t(mconfig, GENEVE_MAPPER, "Geneve Gate Array", tag, owner, clock, "geneve_mapper", __FILE__), m_gromwaddr_LSB(false),
+ m_gromraddr_LSB(false), m_grom_address(0), m_video_waitstates(false),
+ m_extra_waitstates(false), m_ready_asserted(false), m_read_mode(false),
+ m_debug_no_ws(false), m_geneve_mode(false), m_direct_mode(false),
+ m_cartridge_size(0), m_cartridge_secondpage(false),
+ m_cartridge6_writable(false), m_cartridge7_writable(false),
+ m_turbo(false), m_genmod(false), m_timode(false), m_pfm_mode(0),
+ m_pfm_bank(0), m_pfm_output_enable(false), m_sram_mask(0), m_sram_val(0),
m_ready(*this), m_waitcount(0), m_ext_waitcount(0),
m_clock(nullptr), m_cpu(nullptr), m_pfm512(nullptr),
m_pfm512a(nullptr), m_sound(nullptr), m_keyboard(nullptr),
- m_video(nullptr), m_peribox(nullptr), m_sram(nullptr), m_dram(nullptr)
+ m_video(nullptr), m_peribox(nullptr), m_sram(*this, SRAM_PAR_TAG), m_dram(*this, DRAM_PAR_TAG)
{
m_eprom = nullptr;
}
@@ -225,12 +235,12 @@ INPUT_CHANGED_MEMBER( geneve_mapper_device::settings_changed )
{
case 1:
// Turbo switch. May be changed at any time.
- if (TRACE_SETTING) logerror("%s: Setting turbo flag to %d\n", tag(), value);
+ if (TRACE_SETTING) logerror("Setting turbo flag to %d\n", value);
m_turbo = (value!=0);
break;
case 2:
// TIMode switch. Causes reset when changed.
- if (TRACE_SETTING) logerror("%s: Setting timode flag to %d\n", tag(), value);
+ if (TRACE_SETTING) logerror("Setting timode flag to %d\n", value);
m_timode = (value!=0);
machine().schedule_hard_reset();
break;
@@ -239,7 +249,7 @@ INPUT_CHANGED_MEMBER( geneve_mapper_device::settings_changed )
set_boot_rom(value);
break;
default:
- logerror("%s: Unknown setting %d ignored\n", tag(), number);
+ logerror("Unknown setting %d ignored\n", number);
}
}
@@ -277,7 +287,7 @@ READ8_MEMBER( geneve_mapper_device::read_grom )
// GROM data handling
// GROMs are stored in pages 38..3f
int page = 0x38;
- reply = m_dram[(page<<13) + m_grom_address];
+ reply = m_dram->pointer()[(page<<13) + m_grom_address];
m_grom_address = (m_grom_address + 1) & 0xffff;
m_gromraddr_LSB = m_gromwaddr_LSB = false;
}
@@ -310,7 +320,7 @@ WRITE8_MEMBER( geneve_mapper_device::write_grom )
{ // write GPL data
// The Geneve GROM simulator allows for GROM writing (verified with a real system)
int page = 0x38;
- m_dram[(page<<13) + m_grom_address] = data;
+ m_dram->pointer()[(page<<13) + m_grom_address] = data;
m_grom_address = (m_grom_address + 1) & 0xffff;
m_gromraddr_LSB = m_gromwaddr_LSB = false;
@@ -330,7 +340,7 @@ void geneve_mapper_device::set_wait(int min)
m_waitcount = min + 1;
if (m_waitcount > 1)
{
- if (TRACE_LINES) logerror("%s: Pulling down READY line for %d cycles\n", tag(), min);
+ if (TRACE_LINES) logerror("Pulling down READY line for %d cycles\n", min);
m_ready(CLEAR_LINE);
m_ready_asserted = false;
}
@@ -347,62 +357,62 @@ void geneve_mapper_device::set_boot_rom(int selection)
switch (selection)
{
case GENEVE_098:
- logerror("%s: Using 0.98 boot eprom\n", tag());
+ logerror("Using 0.98 boot eprom\n");
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());
+ logerror("Using 1.00 boot eprom\n");
m_eprom = machine().root_device().memregion("maincpu")->base();
m_pfm_mode = 0;
break;
case GENEVE_PFM512:
- logerror("%s: Using PFM512 (AT29C040)\n", tag());
+ logerror("Using PFM512 (AT29C040)\n");
m_pfm_mode = 1;
break;
case GENEVE_PFM512A:
- logerror("%s: Using PFM512A (AT29C040A)\n", tag());
+ logerror("Using PFM512A (AT29C040A)\n");
m_pfm_mode = 2;
break;
default:
- logerror("%s: Unknown boot ROM selection\n", tag());
+ logerror("Unknown boot ROM selection\n");
}
}
void geneve_mapper_device::set_geneve_mode(bool geneve)
{
- if (TRACE_SETTING) logerror("%s: Setting Geneve mode = %d\n", tag(), geneve);
+ if (TRACE_SETTING) logerror("Setting Geneve mode = %d\n", 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);
+ if (TRACE_SETTING) logerror("Setting direct mode = %d\n", 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);
+ if (TRACE_SETTING) logerror("Setting cartridge size to %d\n", 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 (TRACE_SETTING) logerror("Cartridge %04x space writable = %d\n", 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_VIDEOWS) logerror("%s: Setting video waitstates = %d\n", tag(), wait);
+ if (TRACE_VIDEOWS) logerror("Setting video waitstates = %d\n", 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);
+ if (TRACE_SETTING) logerror("Setting extra waitstates = %d\n", wait);
m_extra_waitstates = wait;
}
@@ -473,7 +483,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
if (!space.debugger_access())
{
value = m_video->read(space, dec->offset>>1);
- if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("Read video %04x -> %02x\n", 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);
@@ -483,13 +493,13 @@ READ8_MEMBER( geneve_mapper_device::readm )
case MLGMAPPER:
// mapper
value = m_map[dec->offset];
- if (TRACE_READ) logerror("%s: read mapper %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("read mapper %04x -> %02x\n", dec->offset, value);
break;
case MLGKEY:
// key
if (!space.debugger_access()) value = m_keyboard->get_recent_key();
- if (TRACE_READ) logerror("%s: Read keyboard -> %02x\n", tag(), value);
+ if (TRACE_READ) logerror("Read keyboard -> %02x\n", value);
break;
case MLGCLOCK:
@@ -497,19 +507,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 (TRACE_READ) logerror("%s: Read clock %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("Read clock %04x -> %02x\n", dec->offset, value);
break;
case MLTMAPPER:
// mapper
value = m_map[dec->offset];
- if (TRACE_READ) logerror("%s: Read mapper %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("Read mapper %04x -> %02x\n", dec->offset, value);
break;
case MLTKEY:
// key
if (!space.debugger_access()) value = m_keyboard->get_recent_key();
- if (TRACE_READ) logerror("%s: Read keyboard -> %02x\n", tag(), value);
+ if (TRACE_READ) logerror("Read keyboard -> %02x\n", value);
break;
case MLTCLOCK:
@@ -523,7 +533,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// value floating around.
value = m_clock->read(space, dec->offset);
value |= (dec->offset==0x000f)? 0x20 : 0x10;
- if (TRACE_READ) logerror("%s: Read clock %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("Read clock %04x -> %02x\n", dec->offset, value);
break;
case MLTVIDEO:
@@ -533,7 +543,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
if (!space.debugger_access())
{
value = m_video->read(space, dec->offset>>1);
- if (TRACE_READ) logerror("%s: Read video %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("Read video %04x -> %02x\n", dec->offset, value);
// See above
if (m_video_waitstates) set_ext_wait(15);
}
@@ -546,7 +556,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// We need to add the address prefix bits
m_peribox->readz(space, dec->offset, &value, 0xff);
m_peribox->memen_in(CLEAR_LINE);
- if (TRACE_READ) logerror("%s: Read speech -> %02x\n", tag(), value);
+ if (TRACE_READ) logerror("Read speech -> %02x\n", value);
break;
case MLTGROM:
@@ -554,7 +564,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
// ++++ ++-- ---- ---+
// 1001 1000 0000 00x0
if (!space.debugger_access()) value = read_grom(space, dec->offset, 0xff);
- if (TRACE_READ) logerror("%s: Read GROM %04x -> %02x\n", tag(), dec->offset, value);
+ if (TRACE_READ) logerror("Read GROM %04x -> %02x\n", dec->offset, value);
break;
case MLGSOUND:
@@ -565,14 +575,14 @@ READ8_MEMBER( geneve_mapper_device::readm )
case MPGDRAM:
// DRAM.
- value = m_dram[dec->physaddr];
+ value = m_dram->pointer()[dec->physaddr];
// LOG("dram read physaddr = %06x logaddr = %04x value = %02x\n", dec->physaddr, dec->offset, value);
- if (TRACE_READ) logerror("%s: Read DRAM %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
+ if (TRACE_READ) logerror("Read DRAM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
break;
case MPGEXP:
// On-board memory expansion for standard Geneve (never used)
- if (TRACE_READ) logerror("%s: Read unmapped area %06x\n", tag(), dec->physaddr);
+ if (TRACE_READ) logerror("Read unmapped area %06x\n", dec->physaddr);
value = 0;
break;
@@ -582,7 +592,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
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);
+ if (TRACE_READ) logerror("Read EPROM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
}
else value = read_from_pfm(space, dec->physaddr, 0xff);
@@ -591,12 +601,12 @@ READ8_MEMBER( geneve_mapper_device::readm )
case MPGSRAM:
if ((dec->physaddr & m_sram_mask)==m_sram_val)
{
- value = m_sram[dec->physaddr & ~m_sram_mask];
+ value = m_sram->pointer()[dec->physaddr & ~m_sram_mask];
}
else value = 0;
// Return in any case
// LOG("sram read physaddr = %06x logaddr = %04x value = %02x\n", dec->physaddr, dec->offset, value);
- if (TRACE_READ) logerror("%s: Read SRAM %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
+ if (TRACE_READ) logerror("Read SRAM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
break;
case MPGBOX:
@@ -606,12 +616,12 @@ READ8_MEMBER( geneve_mapper_device::readm )
m_peribox->readz(space, dec->physaddr, &value, 0xff);
m_peribox->memen_in(CLEAR_LINE);
- if (TRACE_READ) logerror("%s: Read P-Box %04x (%06x) -> %02x\n", tag(), dec->offset, dec->physaddr, value);
+ if (TRACE_READ) logerror("Read P-Box %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
break;
case MPGMDRAM:
// DRAM. One wait state.
- value = m_dram[dec->physaddr];
+ value = m_dram->pointer()[dec->physaddr];
break;
case MPGMEPROM:
@@ -620,7 +630,7 @@ READ8_MEMBER( geneve_mapper_device::readm )
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);
+ if (TRACE_READ) logerror("Read EPROM %04x (%06x) -> %02x\n", dec->offset, dec->physaddr, value);
}
else value = read_from_pfm(space, dec->physaddr, 0xff);
break;
@@ -663,7 +673,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
if (!space.debugger_access())
{
m_video->write(space, dec->offset>>1, data);
- if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write video %04x <- %02x\n", offset, data);
// See above
if (m_video_waitstates) set_ext_wait(15);
}
@@ -672,33 +682,33 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
case MLGMAPPER:
// mapper
m_map[dec->offset] = data;
- if (TRACE_WRITE) logerror("%s: Write mapper %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write mapper %04x <- %02x\n", offset, data);
break;
case MLGCLOCK:
// clock
// ++++ ++++ ++++ ----
m_clock->write(space, dec->offset, data);
- if (TRACE_WRITE) logerror("%s: Write clock %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write clock %04x <- %02x\n", offset, data);
break;
case MLGSOUND:
// sound
// ++++ ++++ ++++ ---+
m_sound->write(space, 0, data, 0xff);
- if (TRACE_WRITE) logerror("%s: Write sound <- %02x\n", tag(), data);
+ if (TRACE_WRITE) logerror("Write sound <- %02x\n", data);
break;
case MLTMAPPER:
// mapper
m_map[dec->offset] = data;
- if (TRACE_WRITE) logerror("%s: Write mapper %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write mapper %04x <- %02x\n", offset, data);
break;
case MLTCLOCK:
// clock
m_clock->write(space, dec->offset, data);
- if (TRACE_WRITE) logerror("%s: Write clock %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write clock %04x <- %02x\n", offset, data);
break;
case MLTVIDEO:
@@ -709,7 +719,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
if (!space.debugger_access())
{
m_video->write(space, dec->offset>>1, data);
- if (TRACE_WRITE) logerror("%s: Write video %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write video %04x <- %02x\n", offset, data);
// See above
if (m_video_waitstates) set_ext_wait(15);
}
@@ -722,7 +732,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// We need to add the address prefix bits
m_peribox->write(space, dec->offset, data, 0xff);
m_peribox->memen_in(CLEAR_LINE);
- if (TRACE_WRITE) logerror("%s: Write speech <- %02x\n", tag(), data);
+ if (TRACE_WRITE) logerror("Write speech <- %02x\n", data);
break;
case MLTGROM:
@@ -730,7 +740,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// ++++ ++-- ---- ---+
// 1001 1100 0000 00c0
write_grom(space, dec->offset, data, 0xff);
- if (TRACE_WRITE) logerror("%s: Write GROM %04x <- %02x\n", tag(), offset, data);
+ if (TRACE_WRITE) logerror("Write GROM %04x <- %02x\n", offset, data);
break;
case MLTSOUND:
@@ -738,7 +748,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// ++++ ++-- ---- ---+
// 1000 0100 0000 0000
m_sound->write(space, 0, data, 0xff);
- if (TRACE_WRITE) logerror("%s: Write sound <- %02x\n", tag(), data);
+ if (TRACE_WRITE) logerror("Write sound <- %02x\n", data);
break;
case MLTKEY:
@@ -747,13 +757,13 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
case MPGDRAM:
// DRAM write. One wait state. (only for normal Geneve)
- m_dram[dec->physaddr] = data;
- if (TRACE_WRITE) logerror("%s: Write DRAM %04x (%06x) <- %02x\n", tag(), offset, dec->physaddr, data);
+ m_dram->pointer()[dec->physaddr] = data;
+ if (TRACE_WRITE) logerror("Write DRAM %04x (%06x) <- %02x\n", offset, dec->physaddr, data);
break;
case MPGEXP:
// On-board memory expansion for standard Geneve (never used)
- if (TRACE_WRITE) logerror("%s: Write unmapped area %06x\n", tag(), dec->physaddr);
+ if (TRACE_WRITE) logerror("Write unmapped area %06x\n", dec->physaddr);
break;
case MPGEPROM:
@@ -762,27 +772,27 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// 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);
+ logerror("Write EPROM %04x (%06x) <- %02x, ignored\n", offset, dec->physaddr, data);
break;
case MPGSRAM:
if ((dec->physaddr & m_sram_mask)==m_sram_val)
{
- m_sram[dec->physaddr & ~m_sram_mask] = data;
+ m_sram->pointer()[dec->physaddr & ~m_sram_mask] = data;
}
- if (TRACE_WRITE) logerror("%s: Write SRAM %04x (%06x) <- %02x\n", tag(), offset, dec->physaddr, data);
+ if (TRACE_WRITE) logerror("Write SRAM %04x (%06x) <- %02x\n", offset, dec->physaddr, data);
break;
case MPGBOX:
dec->physaddr = (dec->physaddr & 0x0007ffff); // 19 bit address
- if (TRACE_WRITE) logerror("%s: Write P-Box %04x (%06x) <- %02x\n", tag(), offset, dec->physaddr, data);
+ if (TRACE_WRITE) logerror("Write P-Box %04x (%06x) <- %02x\n", offset, dec->physaddr, data);
m_peribox->write(space, dec->physaddr, data, 0xff);
m_peribox->memen_in(CLEAR_LINE);
break;
case MPGMDRAM:
// DRAM. One wait state.
- m_dram[dec->physaddr] = data;
+ m_dram->pointer()[dec->physaddr] = data;
break;
case MPGMEPROM:
@@ -791,7 +801,7 @@ WRITE8_MEMBER( geneve_mapper_device::writem )
// 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);
+ logerror("Write EPROM %04x (%06x) <- %02x, ignored\n", offset, dec->physaddr, data);
break;
case MPGMBOX:
@@ -1119,7 +1129,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 (TRACE_WRITE) logerror("%s: Set cartridge page %02x\n", tag(), m_cartridge_secondpage);
+ if (TRACE_WRITE) logerror("Set cartridge page %02x\n", m_cartridge_secondpage);
set_wait(1);
return;
}
@@ -1129,7 +1139,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))
{
- logerror("%s: Writing to protected cartridge space %04x ignored\n", tag(), dec->offset);
+ logerror("Writing to protected cartridge space %04x ignored\n", dec->offset);
return;
}
else
@@ -1229,11 +1239,11 @@ READ8_MEMBER( geneve_mapper_device::read_from_pfm )
value = m_pfm512a->read(space, address, mem_mask);
break;
default:
- logerror("%s: Illegal mode for reading PFM: %d\n", tag(), m_pfm_mode);
+ logerror("Illegal mode for reading PFM: %d\n", m_pfm_mode);
return 0;
}
- if (TRACE_PFM) logerror("%s: Reading from PFM at address %05x -> %02x\n", tag(), address, value);
+ if (TRACE_PFM) logerror("Reading from PFM at address %05x -> %02x\n", address, value);
return value;
}
@@ -1242,7 +1252,7 @@ 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);
+ if (TRACE_PFM) logerror("Writing to PFM at address %05x <- %02x\n", address, data);
switch (m_pfm_mode)
{
@@ -1253,7 +1263,7 @@ WRITE8_MEMBER( geneve_mapper_device::write_to_pfm )
m_pfm512a->write(space, address, data, mem_mask);
break;
default:
- logerror("%s: Illegal mode for writing to PFM: %d\n", tag(), m_pfm_mode);
+ logerror("Illegal mode for writing to PFM: %d\n", m_pfm_mode);
}
}
@@ -1265,7 +1275,7 @@ WRITE8_MEMBER( geneve_mapper_device::write_to_pfm )
*/
SETOFFSET_MEMBER( geneve_mapper_device::setoffset )
{
- if (TRACE_DETAIL) logerror("%s: setoffset = %04x\n", tag(), offset);
+ if (TRACE_DETAIL) logerror("setoffset = %04x\n", offset);
m_debug_no_ws = false;
decode(space, offset, m_read_mode, &m_decoded);
}
@@ -1294,13 +1304,13 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
m_waitcount--;
if (m_waitcount == 0)
{
- if (TRACE_CLOCK) logerror("%s: clock, READY asserted\n", tag());
+ if (TRACE_CLOCK) logerror("clock, READY asserted\n");
m_ready(ASSERT_LINE);
m_ready_asserted = true;
}
else
{
- if (TRACE_CLOCK) logerror("%s: clock\n", tag());
+ if (TRACE_CLOCK) logerror("clock\n");
}
}
else
@@ -1310,13 +1320,13 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
m_ext_waitcount--;
if (m_ext_waitcount == 0)
{
- if (TRACE_CLOCK) logerror("%s: clock, READY asserted after video\n", tag());
+ if (TRACE_CLOCK) logerror("clock, READY asserted after video\n");
m_ready(ASSERT_LINE);
m_ready_asserted = true;
}
else
{
- if (TRACE_CLOCK) logerror("%s: vclock, ew=%d\n", tag(), m_ext_waitcount);
+ if (TRACE_CLOCK) logerror("vclock, ew=%d\n", m_ext_waitcount);
}
}
}
@@ -1328,7 +1338,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 (TRACE_CLOCK) logerror("%s: clock, READY cleared for video\n", tag());
+ if (TRACE_CLOCK) logerror("clock, READY cleared for video\n");
m_ready(CLEAR_LINE);
m_ready_asserted = false;
}
@@ -1341,7 +1351,7 @@ WRITE_LINE_MEMBER( geneve_mapper_device::clock_in )
WRITE_LINE_MEMBER( geneve_mapper_device::dbin_in )
{
m_read_mode = (state==ASSERT_LINE);
- if (TRACE_DETAIL) logerror("%s: dbin = %02x\n", tag(), m_read_mode? 1:0);
+ if (TRACE_DETAIL) logerror("dbin = %02x\n", m_read_mode? 1:0);
}
/*
@@ -1351,21 +1361,21 @@ 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);
+ if (TRACE_PFM) logerror("Setting bank (l) = %d\n", 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);
+ if (TRACE_PFM) logerror("Setting bank (u) = %d\n", 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");
+ if (TRACE_PFM) logerror("PFM output %s\n", m_pfm_output_enable? "enable" : "disable");
}
//====================================================================
@@ -1386,9 +1396,6 @@ void geneve_mapper_device::device_start()
m_pfm512a = machine().device<at29c040a_device>(PFM512A_TAG);
m_ready.resolve();
-
- m_sram = machine().root_device().memregion(SRAM_TAG)->base();
- m_dram = machine().root_device().memregion(DRAM_TAG)->base();
m_cpu = static_cast<tms9995_device*>(machine().device("maincpu"));
m_geneve_mode = false;
@@ -1425,7 +1432,7 @@ void geneve_mapper_device::device_reset()
// Check for GenMod. We assume that GenMod can be combined with PFM.
if (machine().root_device().ioport("MODE")->read()!=0)
{
- logerror("%s: Using GenMod modification\n", tag());
+ logerror("Using GenMod modification\n");
m_eprom = machine().root_device().memregion("maincpu")->base() + 0x8000;
if (m_eprom[0] != 0xf0)
{
@@ -1508,7 +1515,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 (TRACE_KEYBOARD) logerror("%s: Posting keycode %02x\n", tag(), keycode);
+ if (TRACE_KEYBOARD) logerror("Posting keycode %02x\n", keycode);
}
void geneve_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
@@ -1523,7 +1530,7 @@ void geneve_keyboard_device::poll()
int i, j;
int keycode;
int pressed;
- if (TRACE_KEYBOARD) logerror("%s: Poll keyboard\n", tag());
+ if (TRACE_KEYBOARD) logerror("Poll keyboard\n");
if (m_key_reset) return;
/* Poll keyboard */
@@ -1729,7 +1736,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 (TRACE_KEYBOARD) logerror("%s: Signalling key available\n", tag());
+ if (TRACE_KEYBOARD) logerror("Signalling key available\n");
m_interrupt(ASSERT_LINE);
m_key_in_buffer = true;
}
@@ -1739,7 +1746,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 (TRACE_KEYBOARD) logerror("%s: Keyboard clock_control state=%d\n", tag(), m_keyboard_clock);
+ if (TRACE_KEYBOARD) logerror("Keyboard clock_control state=%d\n", m_keyboard_clock);
if (rising_edge)
signal_when_key_available();
}
diff --git a/src/devices/bus/ti99x/genboard.h b/src/devices/bus/ti99x/genboard.h
index 4f9c5da7f27..932989cf8d7 100644
--- a/src/devices/bus/ti99x/genboard.h
+++ b/src/devices/bus/ti99x/genboard.h
@@ -21,6 +21,7 @@
#include "machine/at29x.h"
#include "bus/ti99_peb/peribox.h"
#include "sound/sn76496.h"
+#include "machine/ram.h"
extern const device_type GENEVE_MOUSE;
extern const device_type GENEVE_KEYBOARD;
@@ -212,8 +213,8 @@ private:
v9938_device* m_video;
peribox_device* m_peribox;
UINT8* m_eprom;
- UINT8* m_sram;
- UINT8* m_dram;
+ required_device<ram_device> m_sram;
+ required_device<ram_device> m_dram;
};
#define MCFG_GENEVE_READY_HANDLER( _intcallb ) \
diff --git a/src/devices/bus/ti99x/gromport.h b/src/devices/bus/ti99x/gromport.h
index 5ab93e0f673..d21497d9d55 100644
--- a/src/devices/bus/ti99x/gromport.h
+++ b/src/devices/bus/ti99x/gromport.h
@@ -12,6 +12,8 @@
#include "emu.h"
#include "ti99defs.h"
#include "machine/tmc0430.h"
+#include "softlist_dev.h"
+
extern const device_type GROMPORT;
diff --git a/src/devices/bus/vboy/slot.h b/src/devices/bus/vboy/slot.h
index cf031e75f85..71adadd6a2a 100644
--- a/src/devices/bus/vboy/slot.h
+++ b/src/devices/bus/vboy/slot.h
@@ -3,6 +3,9 @@
#ifndef __VBOY_SLOT_H
#define __VBOY_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/vc4000/slot.h b/src/devices/bus/vc4000/slot.h
index 069593208bc..ed3425d0ddc 100644
--- a/src/devices/bus/vc4000/slot.h
+++ b/src/devices/bus/vc4000/slot.h
@@ -3,6 +3,9 @@
#ifndef __VC4000_SLOT_H
#define __VC4000_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/vcs/vcs_slot.h b/src/devices/bus/vcs/vcs_slot.h
index 142c30f9622..b8532dc216d 100755
--- a/src/devices/bus/vcs/vcs_slot.h
+++ b/src/devices/bus/vcs/vcs_slot.h
@@ -3,6 +3,8 @@
#ifndef __VCS_SLOT_H
#define __VCS_SLOT_H
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/bus/vectrex/slot.h b/src/devices/bus/vectrex/slot.h
index 5c0183327ae..261574556cd 100644
--- a/src/devices/bus/vectrex/slot.h
+++ b/src/devices/bus/vectrex/slot.h
@@ -3,6 +3,9 @@
#ifndef __VECTREX_SLOT_H
#define __VECTREX_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/vic10/exp.h b/src/devices/bus/vic10/exp.h
index 4221991e124..a3ff118c891 100644
--- a/src/devices/bus/vic10/exp.h
+++ b/src/devices/bus/vic10/exp.h
@@ -37,10 +37,10 @@
#define __VIC10_EXPANSION_SLOT__
#include "emu.h"
+#include "softlist_dev.h"
#include "formats/cbm_crt.h"
-
//**************************************************************************
// CONSTANTS
//**************************************************************************
diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h
index 1bd6092e400..9f161fb5c28 100644
--- a/src/devices/bus/vic20/exp.h
+++ b/src/devices/bus/vic20/exp.h
@@ -37,7 +37,7 @@
#define __VIC20_EXPANSION_SLOT__
#include "emu.h"
-
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/devices/bus/vidbrain/exp.h b/src/devices/bus/vidbrain/exp.h
index f662dd7cfa7..c9cd6677b55 100644
--- a/src/devices/bus/vidbrain/exp.h
+++ b/src/devices/bus/vidbrain/exp.h
@@ -40,7 +40,7 @@
#define __VIDEOBRAIN_EXPANSION_SLOT__
#include "emu.h"
-
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/devices/bus/wswan/slot.h b/src/devices/bus/wswan/slot.h
index 72036eab9ca..bd9d74fbe85 100644
--- a/src/devices/bus/wswan/slot.h
+++ b/src/devices/bus/wswan/slot.h
@@ -3,6 +3,9 @@
#ifndef __WS_SLOT_H
#define __WS_SLOT_H
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/bus/z88/z88.h b/src/devices/bus/z88/z88.h
index 60dfa2f924c..73d64575976 100644
--- a/src/devices/bus/z88/z88.h
+++ b/src/devices/bus/z88/z88.h
@@ -54,6 +54,9 @@
#ifndef __Z88CART_H__
#define __Z88CART_H__
+#include "softlist_dev.h"
+
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
diff --git a/src/devices/cpu/alto2/a2curt.cpp b/src/devices/cpu/alto2/a2curt.cpp
index 3d23ba2ef44..1980408f2b5 100644
--- a/src/devices/cpu/alto2/a2curt.cpp
+++ b/src/devices/cpu/alto2/a2curt.cpp
@@ -67,10 +67,6 @@ void alto2_cpu_device::activate_curt()
/** @brief initialize the cursor task F1 and F2 functions */
void alto2_cpu_device::init_curt(int task)
{
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_curt_block, nullptr);
- set_f2(task, f2_curt_load_xpreg, nullptr, &alto2_cpu_device::f2_late_load_xpreg);
- set_f2(task, f2_curt_load_csr, nullptr, &alto2_cpu_device::f2_late_load_csr);
- m_active_callback[task] = &alto2_cpu_device::activate_curt;
}
void alto2_cpu_device::exit_curt()
diff --git a/src/devices/cpu/alto2/a2dht.cpp b/src/devices/cpu/alto2/a2dht.cpp
index cf32394a83c..27f2103344c 100644
--- a/src/devices/cpu/alto2/a2dht.cpp
+++ b/src/devices/cpu/alto2/a2dht.cpp
@@ -95,10 +95,6 @@ void alto2_cpu_device::activate_dht()
*/
void alto2_cpu_device::init_dht(int task)
{
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_dht_block, nullptr);
- set_f2(task, f2_dht_evenfield, nullptr, &alto2_cpu_device::f2_late_evenfield);
- set_f2(task, f2_dht_setmode, nullptr, &alto2_cpu_device::f2_late_dht_setmode);
- m_active_callback[task] = &alto2_cpu_device::activate_dht;
}
void alto2_cpu_device::exit_dht()
diff --git a/src/devices/cpu/alto2/a2dvt.cpp b/src/devices/cpu/alto2/a2dvt.cpp
index 2badc246b57..a3800a211a8 100644
--- a/src/devices/cpu/alto2/a2dvt.cpp
+++ b/src/devices/cpu/alto2/a2dvt.cpp
@@ -53,9 +53,6 @@ void alto2_cpu_device::activate_dvt()
*/
void alto2_cpu_device::init_dvt(int task)
{
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_dvt_block, nullptr);
- set_f2(task, f2_dvt_evenfield, nullptr, &alto2_cpu_device::f2_late_evenfield);
- m_active_callback[task] = &alto2_cpu_device::activate_dvt;
}
void alto2_cpu_device::exit_dvt()
diff --git a/src/devices/cpu/alto2/a2dwt.cpp b/src/devices/cpu/alto2/a2dwt.cpp
index 6791c8cc6ff..40bbe456a0e 100644
--- a/src/devices/cpu/alto2/a2dwt.cpp
+++ b/src/devices/cpu/alto2/a2dwt.cpp
@@ -75,8 +75,6 @@ void alto2_cpu_device::f2_late_dwt_load_ddr()
void alto2_cpu_device::init_dwt(int task)
{
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_dwt_block, nullptr);
- set_f2(task, f2_dwt_load_ddr, nullptr, &alto2_cpu_device::f2_late_dwt_load_ddr);
}
void alto2_cpu_device::exit_dwt()
diff --git a/src/devices/cpu/alto2/a2emu.cpp b/src/devices/cpu/alto2/a2emu.cpp
index e01ebe2c342..8cb0296e512 100644
--- a/src/devices/cpu/alto2/a2emu.cpp
+++ b/src/devices/cpu/alto2/a2emu.cpp
@@ -656,28 +656,6 @@ void alto2_cpu_device::init_emu(int task)
save_item(NAME(m_emu.cy));
init_ram(task);
-
- set_bs(task, bs_emu_read_sreg, &alto2_cpu_device::bs_early_read_sreg, nullptr);
- set_bs(task, bs_emu_load_sreg, &alto2_cpu_device::bs_early_load_sreg, &alto2_cpu_device::bs_late_load_sreg);
- set_bs(task, bs_disp, &alto2_cpu_device::bs_early_emu_disp, nullptr);
-
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_emu_block, nullptr); // catch the emulator task trying to block (wrong branch)
- set_f1(task, f1_emu_swmode, nullptr, &alto2_cpu_device::f1_late_swmode);
- set_f1(task, f1_emu_wrtram, nullptr, &alto2_cpu_device::f1_late_wrtram);
- set_f1(task, f1_emu_rdram, nullptr, &alto2_cpu_device::f1_late_rdram);
- set_f1(task, f1_emu_load_rmr, nullptr, &alto2_cpu_device::f1_late_emu_load_rmr);
- set_f1(task, f1_task_14, nullptr, nullptr); // F1 014 is undefined (?)
- set_f1(task, f1_emu_load_esrb, nullptr, &alto2_cpu_device::f1_late_emu_load_esrb);
- set_f1(task, f1_emu_rsnf, &alto2_cpu_device::f1_early_rsnf, nullptr);
- set_f1(task, f1_emu_startf, &alto2_cpu_device::f1_early_startf, nullptr);
-
- set_f2(task, f2_emu_busodd, nullptr, &alto2_cpu_device::f2_late_busodd);
- set_f2(task, f2_emu_magic, nullptr, &alto2_cpu_device::f2_late_magic);
- set_f2(task, f2_emu_load_dns, &alto2_cpu_device::f2_early_load_dns, &alto2_cpu_device::f2_late_load_dns);
- set_f2(task, f2_emu_acdest, &alto2_cpu_device::f2_early_acdest, nullptr);
- set_f2(task, f2_emu_load_ir, nullptr, &alto2_cpu_device::f2_late_load_ir);
- set_f2(task, f2_emu_idisp, nullptr, &alto2_cpu_device::f2_late_idisp);
- set_f2(task, f2_emu_acsource, &alto2_cpu_device::f2_early_acsource, &alto2_cpu_device::f2_late_acsource);
}
void alto2_cpu_device::exit_emu()
diff --git a/src/devices/cpu/alto2/a2ether.cpp b/src/devices/cpu/alto2/a2ether.cpp
index 39959ce4360..3a360f8854e 100644
--- a/src/devices/cpu/alto2/a2ether.cpp
+++ b/src/devices/cpu/alto2/a2ether.cpp
@@ -1321,23 +1321,6 @@ void alto2_cpu_device::init_ether(int task)
m_ether_a42 = prom_load(machine(), &pl_enet_a42, memregion("ether_a42")->base());
m_ether_a49 = prom_load(machine(), &pl_enet_a49, memregion("ether_a49")->base());
- set_bs(task, bs_ether_eidfct, &alto2_cpu_device::bs_early_eidfct, nullptr);
-
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_eth_block, nullptr);
- set_f1(task, f1_ether_eilfct, &alto2_cpu_device::f1_early_eilfct, nullptr);
- set_f1(task, f1_ether_epfct, &alto2_cpu_device::f1_early_epfct, nullptr);
- set_f1(task, f1_ether_ewfct, nullptr, &alto2_cpu_device::f1_late_ewfct);
-
- set_f2(task, f2_ether_eodfct, nullptr, &alto2_cpu_device::f2_late_eodfct);
- set_f2(task, f2_ether_eosfct, nullptr, &alto2_cpu_device::f2_late_eosfct);
- set_f2(task, f2_ether_erbfct, nullptr, &alto2_cpu_device::f2_late_erbfct);
- set_f2(task, f2_ether_eefct, nullptr, &alto2_cpu_device::f2_late_eefct);
- set_f2(task, f2_ether_ebfct, nullptr, &alto2_cpu_device::f2_late_ebfct);
- set_f2(task, f2_ether_ecbfct, nullptr, &alto2_cpu_device::f2_late_ecbfct);
- set_f2(task, f2_ether_eisfct, nullptr, &alto2_cpu_device::f2_late_eisfct);
-
- m_active_callback[task] = &alto2_cpu_device::activate_eth;
-
m_eth.rx_packet = std::make_unique<UINT16[]>(sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE);
m_eth.tx_packet = std::make_unique<UINT16[]>(sizeof(UINT16)*ALTO2_ETHER_PACKET_SIZE);
diff --git a/src/devices/cpu/alto2/a2ksec.cpp b/src/devices/cpu/alto2/a2ksec.cpp
index 9e288aeead9..6ba05395877 100644
--- a/src/devices/cpu/alto2/a2ksec.cpp
+++ b/src/devices/cpu/alto2/a2ksec.cpp
@@ -17,29 +17,6 @@ void alto2_cpu_device::f1_early_ksec_block()
//! disk sector task slot initialization
void alto2_cpu_device::init_ksec(int task)
{
- set_bs(task, bs_ksec_read_kstat, &alto2_cpu_device::bs_early_read_kstat, nullptr);
- set_bs(task, bs_ksec_read_kdata, &alto2_cpu_device::bs_early_read_kdata, nullptr);
-
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_ksec_block, nullptr);
-
- set_f1(task, f1_task_10, nullptr, nullptr);
- set_f1(task, f1_ksec_strobe, nullptr, &alto2_cpu_device::f1_late_strobe);
- set_f1(task, f1_ksec_load_kstat, nullptr, &alto2_cpu_device::f1_late_load_kstat);
- set_f1(task, f1_ksec_increcno, nullptr, &alto2_cpu_device::f1_late_increcno);
- set_f1(task, f1_ksec_clrstat, nullptr, &alto2_cpu_device::f1_late_clrstat);
- set_f1(task, f1_ksec_load_kcom, nullptr, &alto2_cpu_device::f1_late_load_kcom);
- set_f1(task, f1_ksec_load_kadr, nullptr, &alto2_cpu_device::f1_late_load_kadr);
- set_f1(task, f1_ksec_load_kdata, nullptr, &alto2_cpu_device::f1_late_load_kdata);
-
- set_f2(task, f2_ksec_init, nullptr, &alto2_cpu_device::f2_late_init);
- set_f2(task, f2_ksec_rwc, nullptr, &alto2_cpu_device::f2_late_rwc);
- set_f2(task, f2_ksec_recno, nullptr, &alto2_cpu_device::f2_late_recno);
- set_f2(task, f2_ksec_xfrdat, nullptr, &alto2_cpu_device::f2_late_xfrdat);
- set_f2(task, f2_ksec_swrnrdy, nullptr, &alto2_cpu_device::f2_late_swrnrdy);
- set_f2(task, f2_ksec_nfer, nullptr, &alto2_cpu_device::f2_late_nfer);
- set_f2(task, f2_ksec_strobon, nullptr, &alto2_cpu_device::f2_late_strobon);
- set_f2(task, f2_task_17, nullptr, nullptr);
-
m_task_wakeup |= 1 << task;
}
diff --git a/src/devices/cpu/alto2/a2kwd.cpp b/src/devices/cpu/alto2/a2kwd.cpp
index f93343e908b..e312debecf9 100644
--- a/src/devices/cpu/alto2/a2kwd.cpp
+++ b/src/devices/cpu/alto2/a2kwd.cpp
@@ -17,28 +17,6 @@ void alto2_cpu_device::f1_early_kwd_block()
//! disk word task slot initialization
void alto2_cpu_device::init_kwd(int task)
{
- set_bs(task, bs_kwd_read_kstat, &alto2_cpu_device::bs_early_read_kstat, nullptr);
- set_bs(task, bs_kwd_read_kdata, &alto2_cpu_device::bs_early_read_kdata, nullptr);
-
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_kwd_block, nullptr);
-
- set_f1(task, f1_task_10, nullptr, nullptr);
- set_f1(task, f1_kwd_strobe, nullptr, &alto2_cpu_device::f1_late_strobe);
- set_f1(task, f1_kwd_load_kstat, nullptr, &alto2_cpu_device::f1_late_load_kstat);
- set_f1(task, f1_kwd_increcno, nullptr, &alto2_cpu_device::f1_late_increcno);
- set_f1(task, f1_kwd_clrstat, nullptr, &alto2_cpu_device::f1_late_clrstat);
- set_f1(task, f1_kwd_load_kcom, nullptr, &alto2_cpu_device::f1_late_load_kcom);
- set_f1(task, f1_kwd_load_kadr, nullptr, &alto2_cpu_device::f1_late_load_kadr);
- set_f1(task, f1_kwd_load_kdata, nullptr, &alto2_cpu_device::f1_late_load_kdata);
-
- set_f2(task, f2_kwd_init, nullptr, &alto2_cpu_device::f2_late_init);
- set_f2(task, f2_kwd_rwc, nullptr, &alto2_cpu_device::f2_late_rwc);
- set_f2(task, f2_kwd_recno, nullptr, &alto2_cpu_device::f2_late_recno);
- set_f2(task, f2_kwd_xfrdat, nullptr, &alto2_cpu_device::f2_late_xfrdat);
- set_f2(task, f2_kwd_swrnrdy, nullptr, &alto2_cpu_device::f2_late_swrnrdy);
- set_f2(task, f2_kwd_nfer, nullptr, &alto2_cpu_device::f2_late_nfer);
- set_f2(task, f2_kwd_strobon, nullptr, &alto2_cpu_device::f2_late_strobon);
- set_f2(task, f2_task_17, nullptr, nullptr);
}
void alto2_cpu_device::exit_kwd()
diff --git a/src/devices/cpu/alto2/a2mrt.cpp b/src/devices/cpu/alto2/a2mrt.cpp
index 93fedbdbf6a..c072a23129c 100644
--- a/src/devices/cpu/alto2/a2mrt.cpp
+++ b/src/devices/cpu/alto2/a2mrt.cpp
@@ -29,9 +29,6 @@ void alto2_cpu_device::activate_mrt()
//! memory refresh task slots initialization
void alto2_cpu_device::init_mrt(int task)
{
- set_f1(task, f1_block, &alto2_cpu_device::f1_early_mrt_block, nullptr);
- /* auto block */
- m_active_callback[task] = &alto2_cpu_device::activate_mrt;
}
void alto2_cpu_device::exit_mrt()
diff --git a/src/devices/cpu/alto2/a2part.cpp b/src/devices/cpu/alto2/a2part.cpp
index ecf9da51ea5..7e28c2d1da7 100644
--- a/src/devices/cpu/alto2/a2part.cpp
+++ b/src/devices/cpu/alto2/a2part.cpp
@@ -16,7 +16,6 @@ void alto2_cpu_device::activate_part()
//! parity task slots initialization
void alto2_cpu_device::init_part(int task)
{
- m_active_callback[task] = &alto2_cpu_device::activate_part;
}
void alto2_cpu_device::exit_part()
diff --git a/src/devices/cpu/alto2/a2ram.cpp b/src/devices/cpu/alto2/a2ram.cpp
index 9d2f5b37c2d..f482b82f94f 100644
--- a/src/devices/cpu/alto2/a2ram.cpp
+++ b/src/devices/cpu/alto2/a2ram.cpp
@@ -117,21 +117,14 @@ void alto2_cpu_device::wrtram()
{
UINT32 bank = GET_CRAM_BANKSEL(m_cram_addr);
UINT32 wordaddr = GET_CRAM_WORDADDR(m_cram_addr);
- UINT32 value = ((m_m << 16) | m_alu) ^ ALTO2_UCODE_INVERTED;
+ UINT32 value = ((m_myl << 16) | m_alu) ^ ALTO2_UCODE_INVERTED;
UINT32 addr = bank * ALTO2_UCODE_PAGE_SIZE + wordaddr; // write RAM 0,1,2
- LOG((this,LOG_CPU,0," wrtram: RAM%d [%04o] upper:%06o lower:%06o", bank, wordaddr, m_m, m_alu));
+ LOG((this,LOG_CPU,0," wrtram: RAM%d [%04o] upper:%06o lower:%06o", bank, wordaddr, m_myl, m_alu));
#if DEBUG_WRTRAM
- char buff[128];
- UINT8 oprom[4];
- oprom[0] = m_m / 256;
- oprom[1] = m_m % 256;
- oprom[2] = m_m / 256;
- oprom[3] = m_m % 256;
- disasm_disassemble(buff, addr, oprom, oprom, 0);
- printf("WR CRAM_BANKSEL=%d RAM%d [%04o] upper:%06o lower:%06o *** %s\n",
- GET_CRAM_BANKSEL(m_cram_addr), bank, wordaddr, m_m, m_alu, buff);
+ printf("WR CRAM_BANKSEL=%d RAM%d [%04o] upper:%06o lower:%06o\n",
+ GET_CRAM_BANKSEL(m_cram_addr), bank, wordaddr, m_myl, m_alu);
#endif
m_wrtram_flag = false;
@@ -158,7 +151,7 @@ void alto2_cpu_device::bs_early_read_sreg()
r = m_s[bank][rsel()];
LOG((this,LOG_RAM,2," <-S%02o; bus &= S[%o][%02o] (%#o)\n", rsel(), bank, rsel(), r));
} else {
- r = m_m;
+ r = m_myl;
LOG((this,LOG_RAM,2," <-S%02o; bus &= M (%#o)\n", rsel(), r));
}
m_bus &= r;
@@ -180,8 +173,8 @@ void alto2_cpu_device::bs_early_load_sreg()
void alto2_cpu_device::bs_late_load_sreg()
{
UINT8 bank = m_s_reg_bank[m_task];
- m_s[bank][rsel()] = m_m;
- LOG((this,LOG_RAM,2," S%02o<- S[%o][%02o] := %#o\n", rsel(), bank, rsel(), m_m));
+ m_s[bank][rsel()] = m_myl;
+ LOG((this,LOG_RAM,2," S%02o<- S[%o][%02o] := %#o\n", rsel(), bank, rsel(), m_myl));
}
/**
@@ -410,18 +403,6 @@ void alto2_cpu_device::f1_late_load_srb()
void alto2_cpu_device::init_ram(int task)
{
m_ram_related[task] = true;
-
- set_bs(task, bs_ram_read_slocation, &alto2_cpu_device::bs_early_read_sreg, nullptr);
- set_bs(task, bs_ram_load_slocation, &alto2_cpu_device::bs_early_load_sreg, &alto2_cpu_device::bs_late_load_sreg);
-
- set_f1(task, f1_ram_swmode, nullptr, &alto2_cpu_device::f1_late_swmode);
- set_f1(task, f1_ram_wrtram, nullptr, &alto2_cpu_device::f1_late_wrtram);
- set_f1(task, f1_ram_rdram, nullptr, &alto2_cpu_device::f1_late_rdram);
-#if (ALTO2_UCODE_RAM_PAGES == 3)
- set_f1(task, f1_ram_load_rmr, 0, &alto2_cpu_device::f1_late_load_rmr);
-#else // ALTO2_UCODE_RAM_PAGES != 3
- set_f1(task, f1_ram_load_srb, nullptr, &alto2_cpu_device::f1_late_load_srb);
-#endif
}
void alto2_cpu_device::exit_ram()
@@ -433,6 +414,6 @@ void alto2_cpu_device::reset_ram()
{
m_rdram_flag = false;
m_wrtram_flag = false;
- m_m = 0;
+ m_myl = 0;
memset(m_s, 0, sizeof(m_s));
}
diff --git a/src/devices/cpu/alto2/a2roms.cpp b/src/devices/cpu/alto2/a2roms.cpp
index ee46d12c0e5..995d1841da2 100644
--- a/src/devices/cpu/alto2/a2roms.cpp
+++ b/src/devices/cpu/alto2/a2roms.cpp
@@ -19,12 +19,12 @@
*/
static UINT32 ones_u32(UINT32 val)
{
- val -= ((val >> 1) & 0x55555555);
- val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
- val = (((val >> 4) + val) & 0x0f0f0f0f);
- val += (val >> 8);
- val += (val >> 16);
- return (val & 0x0000003f);
+ val -= ((val >> 1) & 0x55555555);
+ val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
+ val = (((val >> 4) + val) & 0x0f0f0f0f);
+ val += (val >> 8);
+ val += (val >> 16);
+ return val & 0x3f;
}
/**
diff --git a/src/devices/cpu/alto2/alto2cpu.cpp b/src/devices/cpu/alto2/alto2cpu.cpp
index 1b9c4e42f40..ff9b98f66ab 100644
--- a/src/devices/cpu/alto2/alto2cpu.cpp
+++ b/src/devices/cpu/alto2/alto2cpu.cpp
@@ -144,7 +144,7 @@ alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* ta
m_l(0),
m_shifter(0),
m_laluc0(0),
- m_m(0),
+ m_myl(0),
m_cram_addr(0),
m_task_wakeup(0),
m_reset_mode(0xffff),
@@ -188,12 +188,8 @@ alto2_cpu_device::alto2_cpu_device(const machine_config& mconfig, const char* ta
memset(m_task_next2, 0x00, sizeof(m_task_next2));
memset(m_r, 0x00, sizeof(m_r));
memset(m_s, 0x00, sizeof(m_s));
- memset(m_active_callback, 0x00, sizeof(m_active_callback));
memset(m_s_reg_bank, 0x00, sizeof(m_s_reg_bank));
memset(m_bank_reg, 0x00, sizeof(m_bank_reg));
- memset(m_bs, 0x00, sizeof(m_bs));
- memset(m_f1, 0x00, sizeof(m_f1));
- memset(m_f2, 0x00, sizeof(m_f2));
memset(m_ram_related, 0x00, sizeof(m_ram_related));
memset(m_drive, 0x00, sizeof(m_drive));
memset(m_sysclka0, 0x00, sizeof(m_sysclka0));
@@ -863,7 +859,7 @@ void alto2_cpu_device::device_start()
save_item(NAME(m_l));
save_item(NAME(m_shifter));
save_item(NAME(m_laluc0));
- save_item(NAME(m_m));
+ save_item(NAME(m_myl));
save_item(NAME(m_cram_addr));
save_item(NAME(m_task_wakeup));
save_item(NAME(m_reset_mode));
@@ -897,7 +893,7 @@ void alto2_cpu_device::device_start()
state_add( A2_L, "L", m_l).formatstr("%06O");
state_add( A2_SHIFTER, "SHIFTER", m_shifter).formatstr("%06O");
state_add( A2_LALUC0, "LALUC0", m_laluc0).mask(1);
- state_add( A2_M, "M", m_m).formatstr("%06O");
+ state_add( A2_M, "M", m_myl).formatstr("%06O");
state_add_divider(-1);
state_add( A2_AC3, "AC(3)", m_r[000]).formatstr("%06O");
state_add( A2_AC2, "AC(2)", m_r[001]).formatstr("%06O");
@@ -1281,42 +1277,42 @@ void alto2_cpu_device::watch_write(UINT32 addr, UINT32 data)
#endif
/** @brief fatal exit on unitialized dynamic phase BUS source */
-void alto2_cpu_device::fn_bs_bad_0()
+void alto2_cpu_device::bs_early_bad()
{
fatal(9,"fatal: bad early bus source pointer for task %s, mpc:%05o bs:%s\n",
task_name(m_task), m_mpc, bs_name(bs()));
}
/** @brief fatal exit on unitialized latching phase BUS source */
-void alto2_cpu_device::fn_bs_bad_1()
+void alto2_cpu_device::bs_late_bad()
{
fatal(9,"fatal: bad late bus source pointer for task %s, mpc:%05o bs: %s\n",
task_name(m_task), m_mpc, bs_name(bs()));
}
/** @brief fatal exit on unitialized dynamic phase F1 function */
-void alto2_cpu_device::fn_f1_bad_0()
+void alto2_cpu_device::f1_early_bad()
{
fatal(9,"fatal: bad early f1 function pointer for task %s, mpc:%05o f1: %s\n",
task_name(m_task), m_mpc, f1_name(f1()));
}
/** @brief fatal exit on unitialized latching phase F1 function */
-void alto2_cpu_device::fn_f1_bad_1()
+void alto2_cpu_device::f1_late_bad()
{
fatal(9,"fatal: bad late f1 function pointer for task %s, mpc:%05o f1: %s\n",
task_name(m_task), m_mpc, f1_name(f1()));
}
/** @brief fatal exit on unitialized dynamic phase F2 function */
-void alto2_cpu_device::fn_f2_bad_0()
+void alto2_cpu_device::f2_early_bad()
{
fatal(9,"fatal: bad early f2 function pointer for task %s, mpc:%05o f2: %s\n",
task_name(m_task), m_mpc, f2_name(f2()));
}
/** @brief fatal exit on unitialized latching phase F2 function */
-void alto2_cpu_device::fn_f2_bad_1()
+void alto2_cpu_device::f2_late_bad()
{
fatal(9,"fatal: bad late f2 function pointer for task %s, mpc:%05o f2: %s\n",
task_name(m_task), m_mpc, f2_name(f2()));
@@ -2335,14 +2331,170 @@ void alto2_cpu_device::execute_run()
* because the emulator task F2 acsource or acdest may
* change the m_rsel
*/
- ((*this).*m_f2[0][m_task][f2()])();
+ switch (f2()) {
+ case f2_task_12: // f2 12 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_early_load_dns();
+ break;
+ }
+ break;
+ case f2_task_13: // f2 13 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_early_acdest();
+ break;
+ }
+ break;
+ case f2_task_16: // f2 16 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_early_acsource();
+ break;
+ }
+ break;
+ }
// early BS function can be done now
- if (do_bs)
- ((*this).*m_bs[0][m_task][bs()])();
+ if (do_bs) {
+ switch (bs()) {
+ case bs_read_r: // BUS source is R register
+ bs_early_read_r();
+ break;
+ case bs_load_r: // load R register from BUS
+ bs_early_load_r();
+ break;
+ case bs_task_3: // BUS source is task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ bs_early_read_sreg();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ bs_early_read_kstat();
+ break;
+ case task_ether: // ethernet task
+ bs_early_eidfct();
+ break;
+ case task_mrt: // memory refresh task
+ case task_dwt: // display word task
+ case task_curt: // cursor task
+ case task_dht: // display horizontal task
+ case task_dvt: // display vertical task
+ case task_part: // parity task
+ break;
+ default:
+ bs_early_bad();
+ }
+ break;
+ case bs_task_4: // BUS source is task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ bs_early_load_sreg();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ bs_early_read_kdata();
+ break;
+ case task_ether: // ethernet task
+ case task_mrt: // memory refresh task
+ case task_dwt: // display word task
+ case task_curt: // cursor task
+ case task_dht: // display horizontal task
+ case task_dvt: // display vertical task
+ case task_part: // parity task
+ break;
+ default:
+ bs_early_bad();
+ }
+ break;
+ case bs_read_md: // BUS source is memory data
+ bs_early_read_md();
+ break;
+ case bs_mouse: // BUS source is mouse data
+ bs_early_mouse();
+ break;
+ case bs_disp: // BUS source displacement (emulator task)
+ switch (m_task) {
+ case task_emu: // emulator task
+ bs_early_emu_disp();
+ break;
+ default:
+ bs_early_disp();
+ }
+ break;
+ }
+ }
// early F1 function
- ((*this).*m_f1[0][m_task][f1()])();
+ switch (f1()) {
+ case f1_task: // f1 02 task switch
+ f1_early_task();
+ break;
+ case f1_block: // f1 03 task block
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_early_emu_block();
+ break;
+ case task_ksec: // disk sector task
+ f1_early_ksec_block();
+ break;
+ case task_ether: // ethernet task
+ f1_early_eth_block();
+ break;
+ case task_mrt: // memory refresh task
+ f1_early_mrt_block();
+ break;
+ case task_dwt: // display word task
+ f1_early_dwt_block();
+ break;
+ case task_curt: // cursor task
+ f1_early_curt_block();
+ break;
+ case task_dht: // display horizontal task
+ f1_early_dht_block();
+ break;
+ case task_dvt: // display vertical task
+ f1_early_dvt_block();
+ break;
+ case task_part: // parity task
+ f1_early_block();
+ break;
+ case task_kwd: // disk word task
+ f1_early_kwd_block();
+ break;
+ }
+ break;
+
+ case f1_task_13: // f1 13 task specific
+ switch (m_task) {
+ case task_ether: // ethernet task
+ f1_early_eilfct();
+ break;
+ }
+ break;
+ case f1_task_14: // f1 14 task specific
+ switch (m_task) {
+ case task_ether: // ethernet task
+ f1_early_epfct();
+ break;
+ }
+ break;
+ case f1_task_16: // f1 16 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_early_rsnf();
+ break;
+ }
+ break;
+ case f1_task_17: // f1 17 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_early_startf();
+ break;
+ }
+ break;
+ }
/**
* The ALU a10 PROM address lines are
@@ -2367,14 +2519,255 @@ void alto2_cpu_device::execute_run()
m_shifter = m_l;
// late F1 function call now
- ((*this).*m_f1[1][m_task][f1()])();
+ switch (f1()) {
+ case f1_load_mar: // f1 01 load memory address register
+ f1_late_load_mar();
+ break;
+ case f1_l_lsh_1: // f1 04 left shift L once
+ f1_late_l_lsh_1();
+ break;
+ case f1_l_rsh_1: // f1 05 right shift L once
+ f1_late_l_rsh_1();
+ break;
+ case f1_l_lcy_8: // f1 06 cycle L 8 times
+ f1_late_l_lcy_8();
+ break;
+
+ case f1_task_10: // f1 10 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_late_swmode();
+ break;
+ }
+ break;
+ case f1_task_11: // f1 11 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_late_wrtram();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_strobe();
+ break;
+ }
+ break;
+ case f1_task_12: // f1 12 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_late_rdram();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_load_kstat();
+ break;
+ }
+ break;
+ case f1_task_13: // f1 13 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+#if (ALTO2_UCODE_RAM_PAGES == 3)
+ f1_late_load_rmr();
+#else
+ f1_late_load_srb();
+#endif
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_increcno();
+ break;
+ }
+ break;
+ case f1_task_14: // f1 14 task specific
+ switch (m_task) {
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_clrstat();
+ break;
+ }
+ break;
+ case f1_task_15: // f1 15 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f1_late_emu_load_esrb();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_load_kcom();
+ break;
+ case task_ether: // ethernet task
+ f1_late_ewfct();
+ break;
+ }
+ break;
+ case f1_task_16: // f1 16 task specific
+ switch (m_task) {
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_load_kadr();
+ break;
+ }
+ break;
+ case f1_task_17: // f1 17 task specific
+ switch (m_task) {
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f1_late_load_kdata();
+ break;
+ }
+ break;
+ }
// late F2 function call now
- ((*this).*m_f2[1][m_task][f2()])();
+ switch (f2()) {
+ case f2_bus_eq_zero: // f2 01 branch on bus equals 0
+ f2_late_bus_eq_zero();
+ break;
+ case f2_shifter_lt_zero: // f2 02 branch on shifter less than 0
+ f2_late_shifter_lt_zero();
+ break;
+ case f2_shifter_eq_zero: // f2 03 branch on shifter equals 0
+ f2_late_shifter_eq_zero();
+ break;
+ case f2_bus: // f2 04 branch on BUS[6-15]
+ f2_late_bus();
+ break;
+ case f2_alucy: // f2 05 branch on (latched) ALU carry
+ f2_late_alucy();
+ break;
+ case f2_load_md: // f2 06 load memory data
+ f2_late_load_md();
+ break;
+
+ case f2_task_10: // f2 10 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_late_busodd();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_init();
+ break;
+ case task_ether: // ethernet task
+ f2_late_eodfct();
+ break;
+ case task_dwt: // display word task
+ f2_late_dwt_load_ddr();
+ break;
+ case task_curt: // cursor task
+ f2_late_load_xpreg();
+ break;
+ case task_dht: // display horizontal task
+ f2_late_evenfield();
+ break;
+ case task_dvt: // display vertical task
+ f2_late_evenfield();
+ break;
+ }
+ break;
+ case f2_task_11: // f2 11 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_late_magic();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_rwc();
+ break;
+ case task_ether: // ethernet task
+ f2_late_eosfct();
+ break;
+ case task_curt: // cursor task
+ f2_late_load_csr();
+ break;
+ case task_dht: // display horizontal task
+ f2_late_dht_setmode();
+ break;
+ }
+ break;
+ case f2_task_12: // f2 12 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_late_load_dns();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_recno();
+ break;
+ case task_ether: // ethernet task
+ f2_late_erbfct();
+ break;
+ }
+ break;
+ case f2_task_13: // f2 13 task specific
+ switch (m_task) {
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_xfrdat();
+ break;
+ case task_ether: // ethernet task
+ f2_late_eefct();
+ break;
+ }
+ break;
+ case f2_task_14: // f2 14 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_late_load_ir();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_swrnrdy();
+ break;
+ case task_ether: // ethernet task
+ f2_late_ebfct();
+ break;
+ }
+ break;
+ case f2_task_15: // f2 15 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_late_idisp();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_nfer();
+ break;
+ case task_ether: // ethernet task
+ f2_late_ecbfct();
+ break;
+ }
+ break;
+ case f2_task_16: // f2 16 task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ f2_late_acsource();
+ break;
+ case task_ksec: // disk sector task
+ case task_kwd: // disk word task
+ f2_late_strobon();
+ break;
+ case task_ether: // ethernet task
+ f2_late_eisfct();
+ break;
+ }
+ break;
+ }
// late BS function call now, if no constant was put on the bus
- if (do_bs)
- ((*this).*m_bs[1][m_task][bs()])();
+ if (do_bs) {
+ switch (bs()) {
+ case bs_load_r: // load R register from BUS
+ bs_late_load_r();
+ break;
+ case bs_task_4: // BUS source is task specific
+ switch (m_task) {
+ case task_emu: // emulator task
+ bs_late_load_sreg();
+ break;
+ }
+ break;
+ }
+ }
// update T register, if LOADT is set
if (loadt()) {
@@ -2400,7 +2793,7 @@ void alto2_cpu_device::execute_run()
}
// update M (MYL) register, if a RAM related task is active
if (m_ram_related[m_task]) {
- m_m = m_alu; // load M from ALU, if 'GOODTASK'
+ m_myl = m_alu; // load M from ALU, if 'GOODTASK'
m_s[m_s_reg_bank[m_task]][0] = m_alu; // also writes to S[bank][0], which can't be read
LOG((this,LOG_CPU,2, " M<- ALU (%#o)\n", m_alu));
}
@@ -2422,7 +2815,34 @@ void alto2_cpu_device::execute_run()
m_next2 = m_task_next2[m_task]; // get address modifier after task switch (needed?)
// let the task know it becomes active now and (most probably) reset the wakeup
- ((*this).*m_active_callback[m_task])();
+ switch (m_task) {
+ case task_emu: // emulator task
+ break;
+ case task_ksec: // disk sector task
+ break;
+ case task_ether: // ethernet task
+ activate_eth();
+ break;
+ case task_mrt: // memory refresh task
+ activate_mrt();
+ break;
+ case task_dwt: // display word task
+ break;
+ case task_curt: // cursor task
+ activate_curt();
+ break;
+ case task_dht: // display horizontal task
+ activate_dht();
+ break;
+ case task_dvt: // display vertical task
+ activate_dvt();
+ break;
+ case task_part: // parity task
+ activate_part();
+ break;
+ case task_kwd: // disk word task
+ break;
+ }
}
}
@@ -2449,7 +2869,7 @@ void alto2_cpu_device::execute_run()
if (m_unload_time < 0)
unload_word();
}
-
+
if (m_bitclk_time >= 0) {
/**
* Subtract the microcycle time from the bitclk time accu.
@@ -2479,52 +2899,8 @@ void alto2_cpu_device::hard_reset()
for (int task = 0; task < ALTO2_TASKS; task++) {
// every task starts at mpc = task number, in either ROM0 or RAM0
m_task_mpc[task] = (m_ctl2k_u38[task] >> 4) ^ 017;
- m_active_callback[task] = &alto2_cpu_device::noop;
if (0 == (m_reset_mode & (1 << task)))
m_task_mpc[task] |= ALTO2_UCODE_RAM_BASE;
-
- set_bs(task, bs_read_r, &alto2_cpu_device::bs_early_read_r, nullptr);
- set_bs(task, bs_load_r, &alto2_cpu_device::bs_early_load_r, &alto2_cpu_device::bs_late_load_r);
- set_bs(task, bs_no_source, nullptr, nullptr);
- set_bs(task, bs_task_3, &alto2_cpu_device::fn_bs_bad_0, &alto2_cpu_device::fn_bs_bad_1); // task specific
- set_bs(task, bs_task_4, &alto2_cpu_device::fn_bs_bad_0, &alto2_cpu_device::fn_bs_bad_1); // task specific
- set_bs(task, bs_read_md, &alto2_cpu_device::bs_early_read_md, nullptr);
- set_bs(task, bs_mouse, &alto2_cpu_device::bs_early_mouse, nullptr);
- set_bs(task, bs_disp, &alto2_cpu_device::bs_early_disp, nullptr);
-
- set_f1(task, f1_nop, nullptr, nullptr);
- set_f1(task, f1_load_mar, nullptr, &alto2_cpu_device::f1_late_load_mar);
- set_f1(task, f1_task, &alto2_cpu_device::f1_early_task, nullptr);
- set_f1(task, f1_block, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // not all tasks have the f1_block
- set_f1(task, f1_l_lsh_1, nullptr, &alto2_cpu_device::f1_late_l_lsh_1);
- set_f1(task, f1_l_rsh_1, nullptr, &alto2_cpu_device::f1_late_l_rsh_1);
- set_f1(task, f1_l_lcy_8, nullptr, &alto2_cpu_device::f1_late_l_lcy_8);
- set_f1(task, f1_const, nullptr, nullptr);
- set_f1(task, f1_task_10, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_11, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_12, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_13, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_14, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_15, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_16, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
- set_f1(task, f1_task_17, &alto2_cpu_device::fn_f1_bad_0, &alto2_cpu_device::fn_f1_bad_1); // f1_task_10 to f1_task_17 are task specific
-
- set_f2(task, f2_nop, nullptr, nullptr);
- set_f2(task, f2_bus_eq_zero, nullptr, &alto2_cpu_device::f2_late_bus_eq_zero);
- set_f2(task, f2_shifter_lt_zero,nullptr, &alto2_cpu_device::f2_late_shifter_lt_zero);
- set_f2(task, f2_shifter_eq_zero,nullptr, &alto2_cpu_device::f2_late_shifter_eq_zero);
- set_f2(task, f2_bus, nullptr, &alto2_cpu_device::f2_late_bus);
- set_f2(task, f2_alucy, nullptr, &alto2_cpu_device::f2_late_alucy);
- set_f2(task, f2_load_md, nullptr, &alto2_cpu_device::f2_late_load_md);
- set_f2(task, f2_const, nullptr, nullptr);
- set_f2(task, f2_task_10, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_11, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_12, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_13, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_14, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_15, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_16, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
- set_f2(task, f2_task_17, &alto2_cpu_device::fn_f2_bad_0, &alto2_cpu_device::fn_f2_bad_1); // f2_task_10 to f2_task_17 are task specific
}
init_memory();
@@ -2546,6 +2922,8 @@ void alto2_cpu_device::hard_reset()
init_kwd();
m_dsp_time = 0; // reset the display state timing
+ m_unload_time = 0; // reset the word unload timing accu
+ m_bitclk_time = 0; // reset the bitclk timing accu
m_task = task_emu; // start with task 0 (emulator)
m_task_wakeup |= 1 << task_emu; // set wakeup flag
}
diff --git a/src/devices/cpu/alto2/alto2cpu.h b/src/devices/cpu/alto2/alto2cpu.h
index 63d1e634aae..823500a56cd 100644
--- a/src/devices/cpu/alto2/alto2cpu.h
+++ b/src/devices/cpu/alto2/alto2cpu.h
@@ -42,14 +42,17 @@ enum {
};
#ifndef ALTO2_DEBUG
-#define ALTO2_DEBUG 1 //!< define to 1 to enable logerror() output
+//! Define to 1 to enable logerror() output.
+#define ALTO2_DEBUG 1
#endif
#ifndef ALTO2_CRAM_CONFIG
-#define ALTO2_CRAM_CONFIG 2 //!< use default CROM/CRAM configuration 2
+//! Use default CROM/CRAM configuration 2.
+#define ALTO2_CRAM_CONFIG 2
#endif
-#define USE_PRIO_F9318 0 //!< define to 1 to use the F9318 priority encoder code (broken)
+//!< Define to 1 to use the F9318 priority encoder code (broken).
+#define USE_PRIO_F9318 0
#define ALTO2_TASKS 16 //!< 16 task slots
#define ALTO2_REGS 32 //!< 32 16-bit words in the R register file
@@ -61,7 +64,7 @@ enum {
#define ALTO2_CONST_SIZE 256 //!< number words in the constant ROM
-//! inverted bits in the micro instruction 32 bit word
+//! Inverted bits in the micro instruction 32 bit word.
#define ALTO2_UCODE_INVERTED ((1 << 10) | (1 << 15) | (1 << 19))
/********************************************************************************
@@ -278,8 +281,6 @@ private:
speaker_sound_device* m_speaker;
- typedef void (alto2_cpu_device::*a2func)();
-
//! task numbers
enum {
task_emu, //!< emulator task
@@ -575,10 +576,9 @@ private:
UINT16 m_l; //!< L register
UINT16 m_shifter; //!< shifter output
UINT16 m_laluc0; //!< the latched ALU carry output
- UINT16 m_m; //!< M register of RAM related tasks (MYL latch in the schematics)
+ UINT16 m_myl; //!< M register of RAM related tasks (MYL latch in the schematics)
UINT16 m_cram_addr; //!< constant RAM address
UINT16 m_task_wakeup; //!< task wakeup: bit 1<<n set if task n requesting service
- a2func m_active_callback[ALTO2_TASKS]; //!< task activation callbacks
UINT16 m_reset_mode; //!< reset mode register: bit 1<<n set if task n starts in ROM
bool m_rdram_flag; //!< set by rdram, action happens on next cycle
@@ -861,27 +861,6 @@ private:
//! no operating function to put in the m_bs, m_f1 and m_f2 slots
void noop() {}
- //! per task bus source function pointers, early (0) and late (1)
- a2func m_bs[2][ALTO2_TASKS][ALTO2_BUSSRC];
- void set_bs(UINT8 task, UINT8 fn, a2func f0, a2func f1) {
- m_bs[0][task][fn] = f0 ? f0 : &alto2_cpu_device::noop;
- m_bs[1][task][fn] = f1 ? f1 : &alto2_cpu_device::noop;
- }
-
- //! per task f1 function pointers, early (0) and late (1)
- a2func m_f1[2][ALTO2_TASKS][ALTO2_F1MAX];
- void set_f1(UINT8 task, UINT8 fn, a2func f0, a2func f1) {
- m_f1[0][task][fn] = f0 ? f0 : &alto2_cpu_device::noop;
- m_f1[1][task][fn] = f1 ? f1 : &alto2_cpu_device::noop;
- }
-
- //! per task f2 function pointers, early (0) and late (1)
- a2func m_f2[2][ALTO2_TASKS][ALTO2_F2MAX];
- void set_f2(UINT8 task, UINT8 fn, a2func f0, a2func f1) {
- m_f2[0][task][fn] = f0 ? f0 : &alto2_cpu_device::noop;
- m_f2[1][task][fn] = f1 ? f1 : &alto2_cpu_device::noop;
- }
-
bool m_ram_related[ALTO2_TASKS]; //!< set when task is RAM related
UINT64 m_cycle; //!< number of cycles executed in the current slice
@@ -892,14 +871,14 @@ private:
void hard_reset(); //!< reset the various registers
void soft_reset(); //!< soft reset
- void fn_bs_bad_0(); //! bs dummy early function
- void fn_bs_bad_1(); //! bs dummy late function
+ void bs_early_bad(); //! bs dummy early function
+ void bs_late_bad(); //! bs dummy late function
- void fn_f1_bad_0(); //! f1 dummy early function
- void fn_f1_bad_1(); //! f1 dummy late function
+ void f1_early_bad(); //! f1 dummy early function
+ void f1_late_bad(); //! f1 dummy late function
- void fn_f2_bad_0(); //! f2 dummy early function
- void fn_f2_bad_1(); //! f2 dummy late function
+ void f2_early_bad(); //! f2 dummy early function
+ void f2_late_bad(); //! f2 dummy late function
DECLARE_READ16_MEMBER( noop_r ); //!< read open bus (0177777)
DECLARE_WRITE16_MEMBER( noop_w ); //!< write open bus
@@ -913,18 +892,21 @@ private:
void bs_early_read_md(); //!< bus source: drive BUS from read memory data
void bs_early_mouse(); //!< bus source: drive bus by mouse
void bs_early_disp(); //!< bus source: drive bus by displacement (which?)
+
void f1_early_block(); //!< F1 func: block active task
void f1_late_load_mar(); //!< F1 func: load memory address register
void f1_early_task(); //!< F1 func: task switch
void f1_late_l_lsh_1(); //!< F1 func: SHIFTER = left shift L once
void f1_late_l_rsh_1(); //!< F1 func: SHIFTER = right shift L once
void f1_late_l_lcy_8(); //!< F1 func: SHIFTER = byte swap L
+
void f2_late_bus_eq_zero(); //!< F2 func: branch on bus equals zero
void f2_late_shifter_lt_zero(); //!< F2 func: branch on shifter less than zero
void f2_late_shifter_eq_zero(); //!< F2 func: branch on shifter equals zero
void f2_late_bus(); //!< F2 func: branch on bus bits BUS[6-15]
void f2_late_alucy(); //!< F2 func: branch on latched ALU carry
void f2_late_load_md(); //!< F2 func: load memory data
+
UINT32 alu_74181(UINT32 a, UINT32 b, UINT8 smc);
void rdram(); //!< read the microcode ROM/RAM halfword
diff --git a/src/devices/imagedev/cassette.cpp b/src/devices/imagedev/cassette.cpp
index 57b7068d49a..adf59ca95eb 100644
--- a/src/devices/imagedev/cassette.cpp
+++ b/src/devices/imagedev/cassette.cpp
@@ -285,10 +285,6 @@ image_init_result cassette_image_device::internal_load(bool is_create)
cassette_flags = is_writable ? (CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT) : CASSETTE_FLAG_READONLY;
std::string fname;
err = cassette_open_choices((void *)image, &image_ioprocs, filetype().c_str(), m_formats, cassette_flags, &m_cassette);
-
- /* this is kind of a hack */
- if (err && is_writable)
- make_readonly();
}
while(err && is_writable);
diff --git a/src/devices/imagedev/cassette.h b/src/devices/imagedev/cassette.h
index 1e6198ddeed..036fc77c534 100644
--- a/src/devices/imagedev/cassette.h
+++ b/src/devices/imagedev/cassette.h
@@ -12,6 +12,7 @@
#define CASSETTE_H
#include "formats/cassimg.h"
+#include "softlist_dev.h"
enum cassette_state
diff --git a/src/devices/imagedev/chd_cd.h b/src/devices/imagedev/chd_cd.h
index 02d39071604..9e2ec9f9a29 100644
--- a/src/devices/imagedev/chd_cd.h
+++ b/src/devices/imagedev/chd_cd.h
@@ -12,6 +12,7 @@
#define CHD_CD_H
#include "cdrom.h"
+#include "softlist_dev.h"
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/imagedev/diablo.h b/src/devices/imagedev/diablo.h
index 806a825a1fe..8ab2ac1addc 100644
--- a/src/devices/imagedev/diablo.h
+++ b/src/devices/imagedev/diablo.h
@@ -8,6 +8,7 @@
#define _IMAGEDEV_DIABLO_H_
#include "harddisk.h"
+#include "softlist_dev.h"
#define DIABLO_TAG(_id) "diablo"#_id
diff --git a/src/devices/imagedev/flopdrv.h b/src/devices/imagedev/flopdrv.h
index 9d571c9f390..34e54100364 100644
--- a/src/devices/imagedev/flopdrv.h
+++ b/src/devices/imagedev/flopdrv.h
@@ -7,6 +7,7 @@
#define __FLOPDRV_H__
#include "formats/flopimg.h"
+#include "softlist_dev.h"
#define FLOPPY_TYPE_REGULAR 0
#define FLOPPY_TYPE_APPLE 1
diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h
index ec5e4b983e2..5e93da56c69 100644
--- a/src/devices/imagedev/floppy.h
+++ b/src/devices/imagedev/floppy.h
@@ -20,6 +20,7 @@
#include "formats/cqm_dsk.h"
#include "formats/dsk_dsk.h"
#include "sound/samples.h"
+#include "softlist_dev.h"
#define MCFG_FLOPPY_DRIVE_ADD(_tag, _slot_intf, _def_slot, _formats) \
MCFG_DEVICE_ADD(_tag, FLOPPY_CONNECTOR, 0) \
diff --git a/src/devices/imagedev/harddriv.h b/src/devices/imagedev/harddriv.h
index 583a5f53e9f..d2ce6aeaef9 100644
--- a/src/devices/imagedev/harddriv.h
+++ b/src/devices/imagedev/harddriv.h
@@ -12,6 +12,7 @@
#define HARDDRIV_H
#include "harddisk.h"
+#include "softlist_dev.h"
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp
index d7e5306f57f..9c3f27d50d6 100644
--- a/src/devices/imagedev/mfmhd.cpp
+++ b/src/devices/imagedev/mfmhd.cpp
@@ -406,7 +406,7 @@ image_init_result mfm_harddisk_device::call_load()
if (chdfile==nullptr)
{
- logerror("%s: chdfile is null\n", tag());
+ logerror("chdfile is null\n");
return image_init_result::FAIL;
}
@@ -414,24 +414,24 @@ image_init_result mfm_harddisk_device::call_load()
chd_error state = chdfile->read_metadata(HARD_DISK_METADATA_TAG, 0, metadata);
if (state != CHDERR_NONE)
{
- logerror("%s: Failed to read CHD metadata\n", tag());
+ logerror("Failed to read CHD metadata\n");
return image_init_result::FAIL;
}
- if (TRACE_CONFIG) logerror("%s: CHD metadata: %s\n", tag(), metadata.c_str());
+ if (TRACE_CONFIG) logerror("CHD metadata: %s\n", metadata.c_str());
// Parse the metadata
mfmhd_layout_params param;
param.encoding = m_encoding;
- if (TRACE_CONFIG) logerror("%s: Set encoding to %d\n", tag(), m_encoding);
+ if (TRACE_CONFIG) logerror("Set encoding to %d\n", m_encoding);
if (sscanf(metadata.c_str(), HARD_DISK_METADATA_FORMAT, &param.cylinders, &param.heads, &param.sectors_per_track, &param.sector_size) != 4)
{
- logerror("%s: Invalid CHD metadata\n", tag());
+ logerror("Invalid CHD metadata\n");
return image_init_result::FAIL;
}
- if (TRACE_CONFIG) logerror("%s: CHD image has geometry cyl=%d, head=%d, sect=%d, size=%d\n", tag(), param.cylinders, param.heads, param.sectors_per_track, param.sector_size);
+ if (TRACE_CONFIG) logerror("CHD image has geometry cyl=%d, head=%d, sect=%d, size=%d\n", param.cylinders, param.heads, param.sectors_per_track, param.sector_size);
if (m_max_cylinders != 0 && (param.cylinders != m_max_cylinders || param.heads != m_max_heads))
{
@@ -448,7 +448,7 @@ image_init_result mfm_harddisk_device::call_load()
state = chdfile->read_metadata(MFM_HARD_DISK_METADATA_TAG, 0, metadata);
if (state != CHDERR_NONE)
{
- logerror("%s: Failed to read CHD sector arrangement/recording specs, applying defaults\n", tag());
+ logerror("Failed to read CHD sector arrangement/recording specs, applying defaults\n");
}
else
{
@@ -457,17 +457,17 @@ image_init_result mfm_harddisk_device::call_load()
if (!param.sane_rec())
{
- if (TRACE_CONFIG) logerror("%s: Sector arrangement/recording specs have invalid values, applying defaults\n", tag());
+ if (TRACE_CONFIG) logerror("Sector arrangement/recording specs have invalid values, applying defaults\n");
param.reset_rec();
}
else
- if (TRACE_CONFIG) logerror("%s: MFM HD rec specs: interleave=%d, cylskew=%d, headskew=%d, wpcom=%d, rwc=%d\n",
+ if (TRACE_CONFIG) logerror("MFM HD rec specs: interleave=%d, cylskew=%d, headskew=%d, wpcom=%d, rwc=%d\n",
tag(), param.interleave, param.cylskew, param.headskew, param.write_precomp_cylinder, param.reduced_wcurr_cylinder);
state = chdfile->read_metadata(MFM_HARD_DISK_METADATA_TAG, 1, metadata);
if (state != CHDERR_NONE)
{
- logerror("%s: Failed to read CHD track gap specs, applying defaults\n", tag());
+ logerror("Failed to read CHD track gap specs, applying defaults\n");
}
else
{
@@ -476,11 +476,11 @@ image_init_result mfm_harddisk_device::call_load()
if (!param.sane_gap())
{
- if (TRACE_CONFIG) logerror("%s: MFM HD gap specs have invalid values, applying defaults\n", tag());
+ if (TRACE_CONFIG) logerror("MFM HD gap specs have invalid values, applying defaults\n");
param.reset_gap();
}
else
- if (TRACE_CONFIG) logerror("%s: MFM HD gap specs: gap1=%d, gap2=%d, gap3=%d, sync=%d, headerlen=%d, ecctype=%d\n",
+ if (TRACE_CONFIG) logerror("MFM HD gap specs: gap1=%d, gap2=%d, gap3=%d, sync=%d, headerlen=%d, ecctype=%d\n",
tag(), param.gap1, param.gap2, param.gap3, param.sync, param.headerlen, param.ecctype);
m_format->set_layout_params(param);
@@ -501,7 +501,7 @@ image_init_result mfm_harddisk_device::call_load()
float realmax = (m_maxseek_time==0)? (m_actual_cylinders * 0.2) : (m_maxseek_time * 0.8);
float settle_us = ((m_actual_cylinders-1.0) * realnext - realmax) / (m_actual_cylinders-2.0) * 1000;
float step_us = realnext * 1000 - settle_us;
- if (TRACE_CONFIG) logerror("%s: Calculated settle time: %0.2f ms, step: %d us\n", tag(), settle_us/1000, (int)step_us);
+ if (TRACE_CONFIG) logerror("Calculated settle time: %0.2f ms, step: %d us\n", settle_us/1000, (int)step_us);
m_settle_time = attotime::from_usec((int)settle_us);
m_step_time = attotime::from_usec((int)step_us);
@@ -510,7 +510,7 @@ image_init_result mfm_harddisk_device::call_load()
}
else
{
- logerror("%s: Could not load CHD\n", tag());
+ logerror("Could not load CHD\n");
}
return loaded;
}
@@ -529,25 +529,25 @@ void mfm_harddisk_device::call_unload()
if (m_format->save_param(MFMHD_IL) && !params->equals_rec(oldparams))
{
- logerror("%s: MFM HD sector arrangement and recording specs have changed; updating CHD metadata\n", tag());
+ logerror("MFM HD sector arrangement and recording specs have changed; updating CHD metadata\n");
chd_file* chdfile = get_chd_file();
chd_error err = chdfile->write_metadata(MFM_HARD_DISK_METADATA_TAG, 0, string_format(MFMHD_REC_METADATA_FORMAT, params->interleave, params->cylskew, params->headskew, params->write_precomp_cylinder, params->reduced_wcurr_cylinder), 0);
if (err != CHDERR_NONE)
{
- logerror("%s: Failed to save MFM HD sector arrangement/recording specs to CHD\n", tag());
+ logerror("Failed to save MFM HD sector arrangement/recording specs to CHD\n");
}
}
if (m_format->save_param(MFMHD_GAP1) && !params->equals_gap(oldparams))
{
- logerror("%s: MFM HD track gap specs have changed; updating CHD metadata\n", tag());
+ logerror("MFM HD track gap specs have changed; updating CHD metadata\n");
chd_file* chdfile = get_chd_file();
chd_error err = chdfile->write_metadata(MFM_HARD_DISK_METADATA_TAG, 1, string_format(MFMHD_GAP_METADATA_FORMAT, params->gap1, params->gap2, params->gap3, params->sync, params->headerlen, params->ecctype), 0);
if (err != CHDERR_NONE)
{
- logerror("%s: Failed to save MFM HD track gap specs to CHD\n", tag());
+ logerror("Failed to save MFM HD track gap specs to CHD\n");
}
}
}
@@ -586,7 +586,7 @@ attotime mfm_harddisk_device::track_end_time()
if (!m_revolution_start_time.is_never())
{
endtime = m_revolution_start_time + nexttime;
- if (TRACE_TIMING) logerror("%s: Track start time = %s, end time = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(endtime).c_str());
+ if (TRACE_TIMING) logerror("Track start time = %s, end time = %s\n", tts(m_revolution_start_time).c_str(), tts(endtime).c_str());
}
return endtime;
}
@@ -628,7 +628,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int
// Start the settle timer
m_step_phase = STEP_SETTLE;
m_seek_timer->adjust(m_settle_time);
- if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Arrived at target cylinder %d, settling ...\n", tag(), m_current_cylinder);
+ if (TRACE_STEPS && TRACE_DETAIL) logerror("Arrived at target cylinder %d, settling ...\n", m_current_cylinder);
}
else
{
@@ -646,12 +646,12 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int
{
m_ready = true;
m_recalibrated = true;
- if (TRACE_STATE) logerror("%s: Spinup complete, drive recalibrated and positioned at cylinder %d; drive is READY\n", tag(), m_current_cylinder);
+ if (TRACE_STATE) logerror("Spinup complete, drive recalibrated and positioned at cylinder %d; drive is READY\n", m_current_cylinder);
if (!m_ready_cb.isnull()) m_ready_cb(this, ASSERT_LINE);
}
else
{
- if (TRACE_SIGNALS) logerror("%s: Settling done at cylinder %d, seek complete\n", tag(), m_current_cylinder);
+ if (TRACE_SIGNALS) logerror("Settling done at cylinder %d, seek complete\n", m_current_cylinder);
}
m_seek_complete = true;
if (!m_seek_complete_cb.isnull()) m_seek_complete_cb(this, ASSERT_LINE);
@@ -664,7 +664,7 @@ void mfm_harddisk_device::device_timer(emu_timer &timer, device_timer_id id, int
void mfm_harddisk_device::recalibrate()
{
- if (TRACE_STEPS) logerror("%s: Recalibrate to track 0\n", tag());
+ if (TRACE_STEPS) logerror("Recalibrate to track 0\n");
direction_in_w(CLEAR_LINE);
while (-m_track_delta < m_phys_cylinders)
{
@@ -677,13 +677,13 @@ void mfm_harddisk_device::head_move()
{
int steps = m_track_delta;
if (steps < 0) steps = -steps;
- if (TRACE_STEPS) logerror("%s: Moving head by %d step(s) %s\n", tag(), steps, (m_track_delta<0)? "outward" : "inward");
+ if (TRACE_STEPS) logerror("Moving head by %d step(s) %s\n", steps, (m_track_delta<0)? "outward" : "inward");
// We simulate the head movement by pausing for n*step_time with n being the cylinder delta
m_step_phase = STEP_MOVING;
m_seek_timer->adjust(m_step_time * steps);
- if (TRACE_TIMING) logerror("%s: Head movement takes %s time\n", tag(), tts(m_step_time * steps).c_str());
+ if (TRACE_TIMING) logerror("Head movement takes %s time\n", tts(m_step_time * steps).c_str());
// We pretend that we already arrived
// TODO: Check auto truncation?
m_current_cylinder += m_track_delta;
@@ -695,7 +695,7 @@ void mfm_harddisk_device::head_move()
void mfm_harddisk_device::direction_in_w(line_state line)
{
m_seek_inward = (line == ASSERT_LINE);
- if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Setting seek direction %s\n", tag(), m_seek_inward? "inward" : "outward");
+ if (TRACE_STEPS && TRACE_DETAIL) logerror("Setting seek direction %s\n", m_seek_inward? "inward" : "outward");
}
/*
@@ -746,10 +746,10 @@ void mfm_harddisk_device::step_w(line_state line)
// Counter will be adjusted according to the direction (+-1)
m_track_delta += (m_seek_inward)? +1 : -1;
- if (TRACE_STEPS && TRACE_DETAIL) logerror("%s: Got seek pulse; track delta %d\n", tag(), m_track_delta);
+ if (TRACE_STEPS && TRACE_DETAIL) logerror("Got seek pulse; track delta %d\n", m_track_delta);
if (m_track_delta < -m_phys_cylinders || m_track_delta > m_phys_cylinders)
{
- if (TRACE_STEPS) logerror("%s: Excessive step pulses - doing auto-truncation\n", tag());
+ if (TRACE_STEPS) logerror("Excessive step pulses - doing auto-truncation\n");
m_autotruncation = true;
}
m_seek_timer->adjust(attotime::from_usec(250)); // Start step collect timer
@@ -782,7 +782,7 @@ bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &lim
// Reached the end
if (bytepos >= m_trackimage_size)
{
- if (TRACE_TIMING) logerror("%s: Reached end: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
+ if (TRACE_TIMING) logerror("Reached end: rev_start = %s, live = %s\n", tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
m_revolution_start_time += m_rev_time;
cell = (from_when - m_revolution_start_time).as_ticks(freq);
bytepos = cell / 16;
@@ -790,7 +790,7 @@ bool mfm_harddisk_device::find_position(attotime &from_when, const attotime &lim
if (bytepos < 0)
{
- if (TRACE_TIMING) logerror("%s: Negative cell number: rev_start = %s, live = %s\n", tag(), tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
+ if (TRACE_TIMING) logerror("Negative cell number: rev_start = %s, live = %s\n", tts(m_revolution_start_time).c_str(), tts(from_when).c_str());
bytepos = 0;
}
bit = cell % 16;
@@ -827,12 +827,12 @@ bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, UINT1
{
// We will deliver a single bit
cdata = ((track[bytepos] << bitpos) & 0x8000) >> 15;
- if (TRACE_BITS) logerror("%s: Reading (c=%d,h=%d,bit=%d) at cell %d [%s] = %d\n", tag(), m_current_cylinder, m_current_head, bitpos, ((bytepos<<4) + bitpos), tts(fw).c_str(), cdata);
+ if (TRACE_BITS) logerror("Reading (c=%d,h=%d,bit=%d) at cell %d [%s] = %d\n", m_current_cylinder, m_current_head, bitpos, ((bytepos<<4) + bitpos), tts(fw).c_str(), cdata);
}
else
{
// We will deliver a whole byte
- if (TRACE_READ) logerror("%s: Reading (c=%d,h=%d) at position %d\n", tag(), m_current_cylinder, m_current_head, bytepos);
+ if (TRACE_READ) logerror("Reading (c=%d,h=%d) at position %d\n", m_current_cylinder, m_current_head, bytepos);
cdata = track[bytepos];
}
return false;
@@ -885,7 +885,7 @@ bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, UINT
if (wpcom && (params->write_precomp_cylinder == -1 || m_current_cylinder < params->write_precomp_cylinder))
params->write_precomp_cylinder = m_current_cylinder;
- if (TRACE_WRITE) if ((bitpos&0x0f)==0) logerror("%s: Wrote data=%04x (c=%d,h=%d) at position %04x, wpcom=%d, rwc=%d\n", tag(), track[bytepos], m_current_cylinder, m_current_head, bytepos, wpcom, reduced_wc);
+ if (TRACE_WRITE) if ((bitpos&0x0f)==0) logerror("Wrote data=%04x (c=%d,h=%d) at position %04x, wpcom=%d, rwc=%d\n", track[bytepos], m_current_cylinder, m_current_head, bytepos, wpcom, reduced_wc);
return false;
}
diff --git a/src/devices/imagedev/snapquik.h b/src/devices/imagedev/snapquik.h
index e14b1d6da6a..1c1a9a3b3df 100644
--- a/src/devices/imagedev/snapquik.h
+++ b/src/devices/imagedev/snapquik.h
@@ -11,6 +11,8 @@
#ifndef __SNAPQUIK_H__
#define __SNAPQUIK_H__
+#include "softlist_dev.h"
+
typedef delegate<image_init_result (device_image_interface &,const char *, int)> snapquick_load_delegate;
// ======================> snapshot_image_device
diff --git a/src/devices/machine/hdc92x4.cpp b/src/devices/machine/hdc92x4.cpp
index 9579f33bf7c..4701f8c7711 100644
--- a/src/devices/machine/hdc92x4.cpp
+++ b/src/devices/machine/hdc92x4.cpp
@@ -16,6 +16,56 @@
Michael Zapf, August 2015
+ ==================================
+ Specifics of both controller types
+
+ ** 9224 **
+ - Defines a special "ST506" type for hard disks with a fixed 512 byte sector length
+ - No specific IDENT; uses HEAD field for cylinder MSBs (both ST and user-defined types);
+ - Different buffered step rate for SEEK and RESTORE
+ - POLL_DRIVES
+ - must be preceded by DESELECT
+ - DRIVE_SELECT
+ - 00 = ST506
+ - READ_SECTORS_LOGICAL
+ - Bit 1 = Bad sector bypass/terminate
+ - Multi-sector read requires ECC correction disable
+ - WRITE_SECTOR_*
+ - Bit 6 = Bad sector bypass/terminate
+ - FORMAT_TRACK
+ - 3-byte header for ST506, 4-byte otherwise
+ - No IDENT byte in the format parameters; the IDENT field (after the IDAM) is locked to FE
+
+ ** 9234 **
+ - Defines a special "PC-AT" type for hard disks with a selectable sector length (128, 256, 512, 1024)
+ - IDENT field in the sector header encodes cylinder MSBs (HD and MFM floppy)
+ - Defines R6 as CURRENT IDENT byte register
+ - Uses HEAD field for cylinder MSBs (only user-defined type)
+ - Faster step rates, no different rates for SEEK/RESTORE
+ - PC-AT mode:
+ - R/W reg A contains specs for sector length and zone
+ - HEAD register contains sector size code provided by system (W4)
+ or read from disk (R4)
+ - POLL_DRIVES
+ - must be preceded by SEEK or DESELECT
+ - DRIVE_SELECT
+ - 00 = PC-AT
+ - READ_SECTORS_PHYSICAL
+ - PC-AT: Requires W10 to be set appropriately
+ - READ_SECTORS_LOGICAL
+ - Bit 1 = Implied seek enabled/disabled
+ - PC-AT: Requires W10 to be set appropriately
+ - WRITE_SECTOR_*
+ - Bit 6 = Implied seek enable/disable
+ - PC-AT: Requires W10 to be set appropriately
+ - WRITE LONG mode for extended ECC code
+ - MODE register (8) allows for setting WRITE LONG mode
+ - FORMAT_TRACK
+ - 4-byte header for PC-AT, 5-byte otherwise
+ - IDENT byte must be set for MFM floppy and MFM/PC-AT HD
+ - No Bad Sector Flag for PC-AT
+ - HEAD field contains sector size for PC-AT
+
***************************************************************************/
#include "emu.h"
@@ -67,7 +117,6 @@
ECC
Write long (see MODE register; only useful with ECC)
Tape operations
- AT mode (HD)
FM-encoded HD
=== Implemented but untested ===
@@ -75,6 +124,7 @@
Poll drives
Seek/Read ID
Read track
+ AT mode (HD)
=== TODO ===
Create a common state machine for HD and floppy
@@ -232,7 +282,8 @@ enum
TYPE_AT = 0x00,
TYPE_HD = 0x01,
TYPE_FLOPPY8 = 0x02,
- TYPE_FLOPPY5 = 0x03
+ TYPE_FLOPPY5 = 0x03,
+ TYPE_ST = 0x04
};
/*
@@ -241,8 +292,7 @@ enum
enum
{
GEN_TIMER = 1,
- COM_TIMER /*,
- LIVE_TIMER */
+ COM_TIMER
};
/*
@@ -257,14 +307,6 @@ enum {
};
/*
- Step rates in microseconds for MFM. This is set in the mode register,
- bits 0-2. FM mode doubles all values.
-*/
-static const int step_hd[] = { 22, 50, 100, 200, 400, 800, 1600, 3200 };
-static const int step_flop8[] = { 218, 500, 1000, 2000, 4000, 8000, 16000, 32000 };
-static const int step_flop5[] = { 436, 1000, 2000, 4000, 8000, 16000, 32000, 64000 };
-
-/*
Head load timer increments in usec. Delay value is calculated from this value
multiplied by the factor in the DATA/DELAY register. For FM mode all
values are doubled. The values depend on the drive type.
@@ -272,11 +314,6 @@ static const int step_flop5[] = { 436, 1000, 2000, 4000, 8000, 16000, 32000, 6
static const int head_load_timer_increment[] = { 200, 200, 2000, 4000 };
/*
- ID fields association to registers
-*/
-static const int id_field[] = { CURRENT_CYLINDER, CURRENT_HEAD, CURRENT_SECTOR, CURRENT_SIZE, CURRENT_CRC1, CURRENT_CRC2 };
-
-/*
Pulse widths for stepping in usec
*/
enum
@@ -518,19 +555,32 @@ bool hdc92x4_device::reading_track()
*/
/*
- In SMC mode, the cylinder number is stored in bit positions 4,5,6 of the
- head register and in the 8 bits of the cylinder register.
- This is true for the desired cyl/head, current cyl/head, and the header
- fields on the track.
+ The desired head is specified by the last 4 bits of the desired head
+ register in all modes.
*/
int hdc92x4_device::desired_head()
{
return m_register_w[DESIRED_HEAD] & 0x0f;
}
+/*
+ PC-AT mode: Cylinder number is specified by the least significant two
+ bits of the R/W register A (DATA) and the 8 bits of the desired cylinder
+ register.
+
+ SMC mode: Cylinder number is stored in bit positions 4,5,6 of the
+ head register and in the 8 bits of the desired cylinder register.
+*/
int hdc92x4_device::desired_cylinder()
{
- return (m_register_w[DESIRED_CYLINDER] & 0xff) | ((m_register_w[DESIRED_HEAD] & 0x70) << 4);
+ if (m_selected_drive_type == TYPE_AT)
+ {
+ return (m_register_w[DESIRED_CYLINDER] & 0xff) | ((m_register_w[DATA] & 0x03) << 8);
+ }
+ else
+ {
+ return (m_register_w[DESIRED_CYLINDER] & 0xff) | ((m_register_w[DESIRED_HEAD] & 0x70) << 4);
+ }
}
int hdc92x4_device::desired_sector()
@@ -538,14 +588,34 @@ int hdc92x4_device::desired_sector()
return m_register_w[DESIRED_SECTOR] & 0xff;
}
+/*
+ The current head is specified by the last 4 bits of the current head
+ register in all modes.
+*/
int hdc92x4_device::current_head()
{
return m_register_r[CURRENT_HEAD] & 0x0f;
}
+/*
+ PC-AT mode: The current cylinder number is specified by the IDENT field
+ as read from the sector header and the 8 bits of the desired cylinder
+ register.
+ IDENT: FE->0, FF->1, FC->2, FD->3
+
+ SMC mode: The current cylinder number is stored in bit positions 4,5,6 of
+ the head register and in the 8 bits of the desired cylinder register.
+*/
int hdc92x4_device::current_cylinder()
{
- return (m_register_r[CURRENT_CYLINDER] & 0xff) | ((m_register_r[CURRENT_HEAD] & 0x70) << 4);
+ if (m_selected_drive_type == TYPE_AT)
+ {
+ return (m_register_r[CURRENT_CYLINDER] & 0xff) | (((m_register_r[CURRENT_IDENT] + 2) & 0x03) << 8);
+ }
+ else
+ {
+ return (m_register_r[CURRENT_CYLINDER] & 0xff) | ((m_register_r[CURRENT_HEAD] & 0x70) << 4);
+ }
}
int hdc92x4_device::current_sector()
@@ -563,12 +633,77 @@ bool hdc92x4_device::using_floppy()
return (m_selected_drive_type == TYPE_FLOPPY5 || m_selected_drive_type == TYPE_FLOPPY8);
}
+int hdc92x4_device::header_length()
+{
+ return (m_selected_drive_type == TYPE_AT)? 4 : 5;
+}
+
+/*
+ Returns the index of the register where the sector header field shall be stored
+*/
+int hdc92x4_device::register_number(int slot)
+{
+ // The id_field is an array of indexes into the chip registers.
+ // Thus we get the values properly assigned to the registers.
+ // The PC-AT mode does not use a size field.
+ const int id_field[] = { CURRENT_CYLINDER, CURRENT_HEAD, CURRENT_SECTOR, CURRENT_SIZE, CURRENT_CRC1, CURRENT_CRC2 };
+ int index = slot;
+
+ // Skip size for PC-AT
+ if (m_selected_drive_type == TYPE_AT && slot > 2) index++;
+ if (index > 5)
+ {
+ logerror("BUG: Invalid index for header field: %d", index);
+ index = 5;
+ }
+ return id_field[index];
+}
+
+/*
+ Delivers the step time (in microseconds) minus the pulse width (9224).
+ The first two values in the list apply for index==0 (buffered step),
+ but the first one is used for the RESTORE command, the second one is used
+ for SEEK. [2]
+*/
+int hdc9224_device::step_time()
+{
+ int time;
+ // Step rates in microseconds for MFM. This is set in the mode register,
+ // bits 0-2. FM mode doubles all values.
+ const int step_hd[] = { 22, 18, 200, 400, 800, 1600, 3200, 6400, 12800 };
+ const int step_flop8[] = { 218, 176, 2000, 4000, 8000, 16000, 32000, 64000, 128000 };
+ const int step_flop5[] = { 436, 352, 4000, 8000, 16000, 32000, 64000, 128000, 256000 };
+
+ int index = m_register_w[MODE] & MO_STEPRATE;
+ // First value is used only for RESTORE (02, 03)
+ if ((index > 0) || ((current_command() & 0xfe)!=0x02)) index++;
+
+ // Get seek time.
+ if (m_selected_drive_type == TYPE_FLOPPY8)
+ time = step_flop8[index] - pulse_flop8;
+
+ else if (m_selected_drive_type == TYPE_FLOPPY5)
+ time = step_flop5[index] - pulse_flop5;
+ else
+ time = step_hd[index] - pulse_hd;
+
+ if (fm_mode()) time = time * 2;
+ return time;
+}
+
/*
- Delivers the step time (in microseconds) minus the pulse width
+ Delivers the step time (in microseconds) minus the pulse width (9234).
+ The 9234 does not use different values for buffered steps.
*/
-int hdc92x4_device::step_time()
+int hdc9234_device::step_time()
{
int time;
+ // Step rates in microseconds for MFM. This is set in the mode register,
+ // bits 0-2. FM mode doubles all values.
+ const int step_hd[] = { 22, 50, 100, 200, 400, 800, 1600, 3200 };
+ const int step_flop8[] = { 218, 500, 1000, 2000, 4000, 8000, 16000, 32000 };
+ const int step_flop5[] = { 436, 1000, 2000, 4000, 8000, 16000, 32000, 64000 };
+
int index = m_register_w[MODE] & MO_STEPRATE;
// Get seek time.
if (m_selected_drive_type == TYPE_FLOPPY8)
@@ -603,11 +738,24 @@ int hdc92x4_device::pulse_width()
}
/*
- Delivers the sector size
+ Delivers the sector size. The register has been either loaded from the
+ sector header (floppy / generic HD) or from register A (PC-AT mode). For
+ the 9224, 512 bytes is returned when TYPE_ST was selected.
*/
-int hdc92x4_device::calc_sector_size()
+int hdc92x4_device::sector_size()
{
- return 128 << (m_register_r[CURRENT_SIZE] & 3);
+ // TYPE_AT:
+ // CURRENT_HEAD
+ // x S S x x x x x, where SS =0 (256), =1 (512), =2(1024), =3 (128)
+ if (m_selected_drive_type==TYPE_AT)
+ return 128 << (((m_register_r[CURRENT_HEAD] >> 5) + 1) & 0x03);
+ else
+ {
+ if (m_selected_drive_type==TYPE_ST)
+ return 512;
+ else
+ return 128 << (m_register_r[CURRENT_SIZE] & 7);
+ }
}
// ===========================================================================
@@ -1006,7 +1154,7 @@ void hdc92x4_device::data_transfer(int& cont)
(m_register_w[DMA15_8] & 0xff) << 8 |
(m_register_w[DMA7_0] & 0xff);
- dma_address = (dma_address + calc_sector_size()) & 0xffffff;
+ dma_address = (dma_address + sector_size()) & 0xffffff;
m_register_w[DMA23_16] = m_register_r[DMA23_16] = (dma_address & 0xff0000) >> 16;
m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00) >> 8;
@@ -1049,7 +1197,7 @@ void hdc92x4_device::data_transfer(int& cont)
(m_register_w[DMA15_8] & 0xff) << 8 |
(m_register_w[DMA7_0] & 0xff);
- dma_address = (dma_address + calc_sector_size()) & 0xffffff;
+ dma_address = (dma_address + sector_size()) & 0xffffff;
m_register_w[DMA23_16] = m_register_r[DMA23_16] = (dma_address & 0xff0000) >> 16;
m_register_w[DMA15_8] = m_register_r[DMA15_8] = (dma_address & 0x00ff00) >> 8;
@@ -1087,6 +1235,56 @@ void hdc92x4_device::data_transfer(int& cont)
}
}
+/*
+ Presets the CRC register, depending on the flag in the Interrupt/Command
+ Termination Register.
+ If this flag is set to 0, the CRC calculation is preset with 0, which
+ means that only media with the same setting will be readable (all others
+ will yield CRC errors).
+ This method simply provides preset values for some particular situations.
+ When value=0, the CRC is preset to 0 or FFFF. Other defined values are:
+ a1 = data value of MFM IDAM
+ a1a1a1 = all three a1s
+ fe = data value of FM IDAM
+ f56a = cell pattern of f8 (DAM, FM)
+ f56b = cell pattern of f9 (DAM, FM)
+ f56e = cell pattern of fa (DAM, FM)
+ f56f = cell pattern of fb (DAM, FM)
+*/
+void hdc92x4_device::preset_crc(live_info& live, int value)
+{
+ if ((m_register_w[INT_COMM_TERM] & 0x80)!=0)
+ {
+ // Preset -1
+ switch (value)
+ {
+ case 0xa1: live.crc = 0x443b; break;
+ case 0xfe: live.crc = 0xef21; break;
+ case 0xf56a: live.crc = 0x8fe7; break; // F8
+ case 0xf56b: live.crc = 0x9fc6; break; // F9
+ case 0xf56e: live.crc = 0xafa5; break; // FA
+ case 0xf56f: live.crc = 0xbf84; break; // FB
+ case 0xa1a1a1: live.crc = 0xcdb4; break; // A1A1A1
+ default: live.crc = 0xffff; break;
+ }
+ }
+ else
+ {
+ // Preset 0
+ switch (value)
+ {
+ case 0xa1: live.crc = 0xc1a9; break;
+ case 0xfe: live.crc = 0x736d; break;
+ case 0xf56a: live.crc = 0x6e17; break; // F8
+ case 0xf56b: live.crc = 0x7e36; break; // F9
+ case 0xf56e: live.crc = 0x4e55; break; // FA
+ case 0xf56f: live.crc = 0x5e74; break; // FB
+ case 0xa1a1a1: live.crc = 0x0128; break; // A1A1A1
+ default: live.crc = 0x0000; break;
+ }
+ }
+};
+
// ===========================================================================
// Commands
// ===========================================================================
@@ -1954,7 +2152,7 @@ void hdc92x4_device::live_start(int state)
m_live_state.next_state = -1;
m_live_state.shift_reg = 0;
- m_live_state.crc = 0xffff;
+ preset_crc(m_live_state, 0);
m_live_state.bit_counter = 0;
m_live_state.byte_counter = 0;
m_live_state.data_separator_phase = false;
@@ -2063,7 +2261,7 @@ void hdc92x4_device::live_run_until(attotime limit)
if (m_live_state.shift_reg == 0x4489)
{
if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
- m_live_state.crc = 0x443b;
+ preset_crc(m_live_state, 0xa1);
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
// Next task: find the next two A1 marks
@@ -2076,7 +2274,7 @@ void hdc92x4_device::live_run_until(attotime limit)
if (m_live_state.shift_reg == 0xf57e)
{
if (TRACE_LIVE) logerror("%s: SEARCH_IDAM: IDAM found\n", tag());
- m_live_state.crc = 0xef21;
+ preset_crc(m_live_state, 0xfe);
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
m_live_state.state = READ_ID_FIELDS_INTO_REGS;
@@ -2174,11 +2372,9 @@ void hdc92x4_device::live_run_until(attotime limit)
if (TRACE_LIVE) logerror("%s: slot %d = %02x, crc=%04x\n", tag(), slot, m_live_state.data_reg, m_live_state.crc);
- // The id_field is an array of indexes into the chip registers.
- // Thus we get the values properly assigned to the registers.
- m_register_r[id_field[slot]] = m_live_state.data_reg;
+ m_register_r[register_number(slot)] = m_live_state.data_reg;
- if(slot > 4)
+ if (slot > 4) // this includes both CRC bytes. There are no different lengths for the floppy headers (excluding the ident byte)
{
// We successfully read the ID fields; let's wait for the machine time to catch up.
if (reading_track())
@@ -2222,7 +2418,7 @@ void hdc92x4_device::live_run_until(attotime limit)
if (m_live_state.bit_counter >= 28*16 && m_live_state.shift_reg == 0x4489)
{
if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
- m_live_state.crc = 0x443b;
+ preset_crc(m_live_state, 0xa1);
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
m_live_state.state = READ_TWO_MORE_A1_DAM;
@@ -2240,11 +2436,7 @@ void hdc92x4_device::live_run_until(attotime limit)
if (m_live_state.bit_counter >= 11*16 && (m_live_state.shift_reg == 0xf56a || m_live_state.shift_reg == 0xf56b ||
m_live_state.shift_reg == 0xf56e || m_live_state.shift_reg == 0xf56f)) {
if (TRACE_LIVE) logerror("%s: SEARCH_DAM: found DAM = %04x\n", tag(), m_live_state.shift_reg);
- m_live_state.crc =
- m_live_state.shift_reg == 0xf56a ? 0x8fe7 :
- m_live_state.shift_reg == 0xf56b ? 0x9fc6 :
- m_live_state.shift_reg == 0xf56e ? 0xafa5 :
- 0xbf84;
+ preset_crc(m_live_state, m_live_state.shift_reg);
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
m_live_state.state = READ_SECTOR_DATA;
@@ -2342,16 +2534,16 @@ void hdc92x4_device::live_run_until(attotime limit)
if (TRACE_LIVE) logerror("%s: [%s live] Found data value %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), m_live_state.data_reg, m_live_state.crc);
int slot = (m_live_state.bit_counter >> 4)-1;
- if (slot < calc_sector_size())
+ if (slot < sector_size())
{
// Sector data
wait_for_realtime(READ_SECTOR_DATA_CONT);
return;
}
- else if (slot < calc_sector_size()+2)
+ else if (slot < sector_size()+2)
{
// CRC
- if (slot == calc_sector_size()+1)
+ if (slot == sector_size()+1)
{
if (reading_track())
{
@@ -2395,7 +2587,7 @@ void hdc92x4_device::live_run_until(attotime limit)
m_out_dma(0, m_register_r[DATA], 0xff);
// And again, for floppies, clear line after writing each byte, for hard disk, only after the last byte
- if (using_floppy() || (m_live_state.bit_counter >> 4)==calc_sector_size()-1)
+ if (using_floppy() || (m_live_state.bit_counter >> 4)==sector_size()-1)
{
m_out_dip(CLEAR_LINE);
m_out_dmarq(CLEAR_LINE);
@@ -2441,7 +2633,7 @@ void hdc92x4_device::live_run_until(attotime limit)
if (fm_mode())
{
// Init the CRC for the DAM and sector
- m_live_state.crc = 0xffff;
+ preset_crc(m_live_state, 0);
// 1111 0101 0110 1010 = F8 deleted
// 1111 0101 0110 1111 = FB normal
@@ -2450,10 +2642,10 @@ void hdc92x4_device::live_run_until(attotime limit)
else
{
// Init the CRC for the ident byte and sector
- m_live_state.crc = 0xcdb4; // value for 3*A1
+ preset_crc(m_live_state, 0xa1a1a1);
write_on_track(encode(m_deleted? 0xf8 : 0xfb), 1, WRITE_SECDATA);
}
- m_live_state.byte_counter = calc_sector_size();
+ m_live_state.byte_counter = sector_size();
// Set the over/underrun flag and hope that it will be cleared before we start writing
// (only for sector writing)
@@ -2476,7 +2668,7 @@ void hdc92x4_device::live_run_until(attotime limit)
else
{
// For floppies, set this for each byte; for hard disk, set it only at the beginning
- if (using_floppy() || m_live_state.byte_counter == calc_sector_size())
+ if (using_floppy() || m_live_state.byte_counter == sector_size())
m_out_dip(ASSERT_LINE);
m_register_r[DATA] = m_register_w[DATA] = m_in_dma(0, 0xff);
@@ -2624,7 +2816,7 @@ void hdc92x4_device::live_run_until(attotime limit)
write_on_track(0x4489, 3, WRITE_HEADER);
m_live_state.byte_counter = 5;
}
- m_live_state.crc = 0xffff;
+ preset_crc(m_live_state, 0);
break;
case WRITE_HEADER:
@@ -2721,8 +2913,8 @@ void hdc92x4_device::live_run_until(attotime limit)
m_out_dip(ASSERT_LINE);
// Write the header via DMA
- for (auto & elem : id_field)
- m_out_dma(0, m_register_r[elem], 0xff);
+ for (int i=0; i < header_length(); i++)
+ m_out_dma(0, m_register_r[register_number(i)], 0xff);
m_out_dip(CLEAR_LINE);
m_out_dmarq(CLEAR_LINE);
@@ -2877,7 +3069,7 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
if (found_mark(SEARCH_IDAM))
{
if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(), tts(m_live_state.time).c_str());
- m_live_state.crc = 0x443b;
+ preset_crc(m_live_state, 0xa1);
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
@@ -2934,7 +3126,7 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
if (m_live_state.bit_counter & 15) break;
if (TRACE_LIVE) logerror("%s: slot %d = %02x, crc=%04x\n", tag(), slot, m_live_state.data_reg, m_live_state.crc);
- m_register_r[id_field[slot++]] = m_live_state.data_reg;
+ m_register_r[register_number(slot++)] = m_live_state.data_reg;
if(slot > 5)
{
@@ -2972,7 +3164,7 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
if (found_mark(SEARCH_DAM))
{
if (TRACE_LIVE) logerror("%s: [%s live] Found an A1 mark\n", tag(),tts(m_live_state.time).c_str());
- m_live_state.crc = 0x443b;
+ preset_crc(m_live_state, 0xa1);
m_live_state.data_separator_phase = false;
m_live_state.bit_counter = 0;
m_live_state.state = READ_DATADEL_FLAG;
@@ -3030,9 +3222,9 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
if (m_live_state.bit_counter & 15) break;
slot = (m_live_state.bit_counter >> 4)-1;
- if (TRACE_LIVE) logerror("%s: [%s live] Found data value [%d/%d] = %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), slot, calc_sector_size(), m_live_state.data_reg, m_live_state.crc);
+ if (TRACE_LIVE) logerror("%s: [%s live] Found data value [%d/%d] = %02X, CRC=%04x\n", tag(),tts(m_live_state.time).c_str(), slot, sector_size(), m_live_state.data_reg, m_live_state.crc);
- if (slot < calc_sector_size())
+ if (slot < sector_size())
{
// For the first byte, allow for the DMA acknowledge to be set.
if (slot == 0)
@@ -3042,10 +3234,10 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
}
else m_live_state.state = READ_SECTOR_DATA_CONT;
}
- else if (slot < calc_sector_size()+2)
+ else if (slot < sector_size()+2)
{
// CRC
- if (slot == calc_sector_size()+1)
+ if (slot == sector_size()+1)
{
m_out_dip(CLEAR_LINE);
m_out_dmarq(CLEAR_LINE);
@@ -3176,11 +3368,11 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write data mark\n", tag());
// Init the CRC for the ident byte and sector
- m_live_state.crc = 0x443b; // value for 1*A1
+ preset_crc(m_live_state, 0xa1); // only one A1
write_on_track(encode_hd(m_deleted? 0xf8 : 0xfb), 1, WRITE_SECDATA);
- m_live_state.byte_counter = calc_sector_size();
+ m_live_state.byte_counter = sector_size();
// Set the over/underrun flag and hope that it will be cleared before we start writing
// (only for sector writing)
@@ -3204,8 +3396,8 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
{
if (TRACE_WRITE && TRACE_DETAIL) logerror("%s: Write sector byte, %d to go\n", tag(), m_live_state.byte_counter);
- // For floppies, set this for each byte; for hard disk, set it only at the beginning
- if (m_live_state.byte_counter == calc_sector_size())
+ // This is hard disk, so set DIP only at the beginning
+ if (m_live_state.byte_counter == sector_size())
m_out_dip(ASSERT_LINE);
m_register_r[DATA] = m_register_w[DATA] = m_in_dma(0, 0xff);
@@ -3296,8 +3488,8 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
m_out_dip(ASSERT_LINE);
// Write the header via DMA
- for (auto & elem : id_field)
- m_out_dma(0, m_register_r[elem], 0xff);
+ for (int i=0; i < header_length(); i++)
+ m_out_dma(0, m_register_r[register_number(i)], 0xff);
// Continue with reading the sector data
m_live_state.state = SEARCH_DAM;
@@ -3341,7 +3533,7 @@ void hdc92x4_device::live_run_hd_until(attotime limit)
if (TRACE_HEADER) logerror("%s: Writing IDAM and header: ", tag());
write_on_track(encode_a1_hd(), 1, WRITE_HEADER);
m_live_state.byte_counter = 5; // TODO: Check this for AT mode
- m_live_state.crc = 0xffff;
+ preset_crc(m_live_state, 0);
break;
case WRITE_HEADER:
@@ -3997,6 +4189,12 @@ void hdc92x4_device::process_command()
// write are identical, so in that case we copy the contents
if (m_register_pointer < DESIRED_HEAD) m_register_r[m_register_pointer] = m_regvalue;
+ // Note for the PC-AT mode: The DATA register contains two bits (5,4)
+ // that are defined as "Actual sector size" ([1] p. 7). The
+ // specification does not say anything about the meaning of these
+ // bits. The desired sector size is already specified by bits 6 and 5
+ // of the DESIRED_HEAD register, so we ignore these bits for now.
+
// Autoincrement until DATA is reached.
if (m_register_pointer < DATA) m_register_pointer++;
}
diff --git a/src/devices/machine/hdc92x4.h b/src/devices/machine/hdc92x4.h
index fccf23666d7..fc862101919 100644
--- a/src/devices/machine/hdc92x4.h
+++ b/src/devices/machine/hdc92x4.h
@@ -232,6 +232,9 @@ protected:
live_info m_live_state, m_checkpoint_state;
int m_last_live_state;
+ // Presets CRC.
+ void preset_crc(live_info& live, int value);
+
// Starts the live run
void live_start(int state);
@@ -433,13 +436,19 @@ protected:
UINT8 current_command();
// Step time (minus pulse width)
- int step_time();
+ virtual int step_time() =0;
// Step pulse width
int pulse_width();
- // Sector size as read from the track
- int calc_sector_size();
+ // Sector size as read from the track or given by register A (PC-AT mode)
+ int sector_size();
+
+ // Returns the sector header length
+ int header_length();
+
+ // Returns the index of the register for the header field
+ int register_number(int slot);
// Is the currently selected drive a floppy drive?
bool using_floppy();
@@ -476,12 +485,18 @@ class hdc9224_device : public hdc92x4_device
{
public:
hdc9224_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ int step_time() override;
};
class hdc9234_device : public hdc92x4_device
{
public:
hdc9234_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+protected:
+ int step_time() override;
};
#endif
diff --git a/src/devices/machine/im6402.cpp b/src/devices/machine/im6402.cpp
index f713a048517..4d3a7696b46 100644
--- a/src/devices/machine/im6402.cpp
+++ b/src/devices/machine/im6402.cpp
@@ -340,6 +340,9 @@ WRITE_LINE_MEMBER( im6402_device::crl_w )
else parity = PARITY_ODD;
set_data_frame(1, data_bit_count, parity, stop_bits);
+
+ receive_register_reset();
+ transmit_register_reset();
}
}
diff --git a/src/devices/machine/nmc9306.cpp b/src/devices/machine/nmc9306.cpp
index 0b23eda21d7..85580a6a621 100644
--- a/src/devices/machine/nmc9306.cpp
+++ b/src/devices/machine/nmc9306.cpp
@@ -15,7 +15,7 @@
// MACROS / CONSTANTS
//**************************************************************************
-#define LOG 1
+#define LOG 0
#define RAM_SIZE 32
diff --git a/src/devices/machine/smartmed.h b/src/devices/machine/smartmed.h
index 0b69fd05886..f1da965c4e9 100644
--- a/src/devices/machine/smartmed.h
+++ b/src/devices/machine/smartmed.h
@@ -8,6 +8,7 @@
#define __SMARTMEDIA_H__
#include "formats/imageutl.h"
+#include "softlist_dev.h"
//#define SMARTMEDIA_IMAGE_SAVE
diff --git a/src/devices/sound/pcd3311.cpp b/src/devices/sound/pcd3311.cpp
new file mode 100644
index 00000000000..840cdb7ee2f
--- /dev/null
+++ b/src/devices/sound/pcd3311.cpp
@@ -0,0 +1,56 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ PCD3311 DTMF/modem/musical tone generator emulation
+
+**********************************************************************/
+
+#include "pcd3311.h"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type PCD3311 = &device_creator<pcd3311_t>;
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// pcd3311_t - constructor
+//-------------------------------------------------
+
+pcd3311_t::pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, PCD3311, "PCD3311", tag, owner, clock, "pcd3311", __FILE__),
+ device_sound_interface(mconfig, *this)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void pcd3311_t::device_start()
+{
+ save_item(NAME(m_a0));
+ save_item(NAME(m_mode));
+ save_item(NAME(m_strobe));
+ save_item(NAME(m_data));
+}
+
+
+//-------------------------------------------------
+// sound_stream_update - handle update requests for
+// our sound stream
+//-------------------------------------------------
+
+void pcd3311_t::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
+{
+}
diff --git a/src/devices/sound/pcd3311.h b/src/devices/sound/pcd3311.h
new file mode 100644
index 00000000000..2c50a0a987a
--- /dev/null
+++ b/src/devices/sound/pcd3311.h
@@ -0,0 +1,67 @@
+// license:BSD-3-Clause
+// copyright-holders:Curt Coder
+/**********************************************************************
+
+ PCD3311 DTMF/modem/musical tone generator emulation
+
+**********************************************************************
+ _____ _____
+ OSCI 1 |* \_/ | 16 Vdd
+ OSCO 2 | | 15 Vss
+ MODE 3 | | 14 D4
+ D5 4 | PCD3311T | 13 N/C
+ N/C 5 | | 12 D3
+ STROBE 6 | | 11 D2
+ TONE 7 | | 10 D1/SDA
+ A0 8 |_____________| 9 D0/SCL
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __PCD3311__
+#define __PCD3311__
+
+#include "emu.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> pcd3311_t
+
+class pcd3311_t : public device_t,
+ public device_sound_interface
+{
+public:
+ // construction/destruction
+ pcd3311_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ DECLARE_WRITE8_MEMBER( write ) { m_data = data; }
+ DECLARE_WRITE_LINE_MEMBER( strobe_w ) { m_strobe = state; }
+ DECLARE_WRITE_LINE_MEMBER( mode_w ) { m_mode = state; }
+ DECLARE_WRITE_LINE_MEMBER( a0_w ) { m_a0 = state; }
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
+ // internal callbacks
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+
+private:
+ int m_a0;
+ int m_mode;
+ int m_strobe;
+ UINT8 m_data;
+};
+
+
+// device type definition
+extern const device_type PCD3311;
+
+
+
+#endif
diff --git a/src/emu/addrmap.cpp b/src/emu/addrmap.cpp
index 2b3f45b1795..a8fe7281d1d 100644
--- a/src/emu/addrmap.cpp
+++ b/src/emu/addrmap.cpp
@@ -32,8 +32,8 @@ address_map_entry::address_map_entry(device_t &device, address_map &map, offs_t
: m_next(nullptr),
m_map(map),
m_devbase(device),
- m_addrstart((map.m_globalmask == 0) ? start : start & map.m_globalmask),
- m_addrend((map.m_globalmask == 0) ? end : end & map.m_globalmask),
+ m_addrstart(start),
+ m_addrend(end),
m_addrmirror(0),
m_addrmask(0),
m_addrselect(0),
@@ -47,6 +47,17 @@ address_map_entry::address_map_entry(device_t &device, address_map &map, offs_t
m_bytemirror(0),
m_bytemask(0)
{
+ if (map.m_globalmask != 0 && (start & ~map.m_globalmask) != 0)
+ {
+ osd_printf_warning("AS_%d map entry start %08X lies outside global address mask %08X\n", map.m_spacenum, start, map.m_globalmask);
+ m_addrstart &= map.m_globalmask;
+ }
+
+ if (map.m_globalmask != 0 && (end & ~map.m_globalmask) != 0)
+ {
+ osd_printf_warning("AS_%d map entry end %08X lies outside global address mask %08X\n", map.m_spacenum, end, map.m_globalmask);
+ m_addrend &= map.m_globalmask;
+ }
}
diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp
index 087fefc20e3..97c9559e9a9 100644
--- a/src/emu/diimage.cpp
+++ b/src/emu/diimage.cpp
@@ -15,6 +15,7 @@
#include "ui/uimain.h"
#include "zippath.h"
#include "softlist.h"
+#include "softlist_dev.h"
#include "formats/ioprocs.h"
#include <regex>
@@ -509,7 +510,7 @@ void device_image_interface::image_checkhash()
// only calculate CRC if it hasn't been calculated, and the open_mode is read only
UINT32 crcval;
- if (!m_hash.crc(crcval) && m_readonly && !m_created)
+ if (!m_hash.crc(crcval) && is_readonly() && !m_created)
{
// do not cause a linear read of 600 megs please
// TODO: use SHA1 in the CHD header as the hash
@@ -840,9 +841,9 @@ bool device_image_interface::load_software(software_list_device &swlist, const c
UINT32 supported = swinfo->supported();
if (supported == SOFTWARE_SUPPORTED_PARTIAL)
- osd_printf_error("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist.list_name());
+ osd_printf_error("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist.list_name().c_str());
if (supported == SOFTWARE_SUPPORTED_NO)
- osd_printf_error("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist.list_name());
+ osd_printf_error("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist.list_name().c_str());
// attempt reading up the chain through the parents and create a locationtag std::string in the format
// " swlist % clonename % parentname "
@@ -1036,7 +1037,8 @@ image_init_result device_image_interface::load_software(const std::string &softl
m_is_loading = true;
// Check if there's a software list defined for this device and use that if we're not creating an image
- bool softload = load_software_part(softlist_name.c_str(), m_software_part_ptr);
+ std::string list_name;
+ bool softload = load_software_part(softlist_name, m_software_part_ptr, &list_name);
if (!softload)
{
m_is_loading = false;
@@ -1045,8 +1047,8 @@ image_init_result device_image_interface::load_software(const std::string &softl
// set up softlist stuff
m_software_info_ptr = &m_software_part_ptr->info();
- m_software_list_name.assign(m_software_info_ptr->list().list_name());
- m_full_software_name.assign(m_software_part_ptr->info().shortname());
+ m_software_list_name = std::move(list_name);
+ m_full_software_name = m_software_part_ptr->info().shortname();
// specify image name with softlist-derived names
m_image_name = m_full_software_name;
@@ -1058,8 +1060,6 @@ image_init_result device_image_interface::load_software(const std::string &softl
const char *read_only = get_feature("read_only");
if (read_only && !strcmp(read_only, "true"))
{
- make_readonly();
-
// Copy some image information when we have been loaded through a software list
if (m_software_info_ptr)
{
@@ -1270,7 +1270,7 @@ void device_image_interface::update_names(const device_type device_type, const c
// case.
//-------------------------------------------------
-void device_image_interface::software_name_split(const char *swlist_swname, std::string &swlist_name, std::string &swname, std::string &swpart)
+void device_image_interface::software_name_split(const std::string &swlist_swname, std::string &swlist_name, std::string &swname, std::string &swpart)
{
// reset all output parameters
swlist_name.clear();
@@ -1278,30 +1278,34 @@ void device_image_interface::software_name_split(const char *swlist_swname, std:
swpart.clear();
// if no colon, this is the swname by itself
- const char *split1 = strchr(swlist_swname, ':');
- if (split1 == nullptr)
+ auto split1 = swlist_swname.find_first_of(':');
+ if (split1 == std::string::npos)
{
- swname.assign(swlist_swname);
+ swname = swlist_swname;
return;
}
// if one colon, it is the swname and swpart alone
- const char *split2 = strchr(split1 + 1, ':');
- if (split2 == nullptr)
+ auto split2 = swlist_swname.find_first_of(':', split1 + 1);
+ if (split2 == std::string::npos)
{
- swname.assign(swlist_swname, split1 - swlist_swname);
- swpart.assign(split1 + 1);
+ swname = swlist_swname.substr(0, split1);
+ swpart = swlist_swname.substr(split1 + 1);
return;
}
// if two colons present, split into 3 parts
- swlist_name.assign(swlist_swname, split1 - swlist_swname);
- swname.assign(split1 + 1, split2 - (split1 + 1));
- swpart.assign(split2 + 1);
+ swlist_name = swlist_swname.substr(0, split1);
+ swname = swlist_swname.substr(split1 + 1, split2 - (split1 + 1));
+ swpart = swlist_swname.substr(split2 + 1);
}
-const software_part *device_image_interface::find_software_item(const char *path, bool restrict_to_interface) const
+//-------------------------------------------------
+// find_software_item
+//-------------------------------------------------
+
+const software_part *device_image_interface::find_software_item(const std::string &path, bool restrict_to_interface, software_list_device **dev) const
{
// split full software name into software list name and short software name
std::string swlist_name, swinfo_name, swpart_name;
@@ -1317,12 +1321,16 @@ const software_part *device_image_interface::find_software_item(const char *path
{
if (swlist_name.compare(swlistdev.list_name())==0 || !(swlist_name.length() > 0))
{
- const software_info *info = swlistdev.find(swinfo_name.c_str());
+ const software_info *info = swlistdev.find(swinfo_name);
if (info != nullptr)
{
- const software_part *part = info->find_part(swpart_name.c_str(), interface);
+ const software_part *part = info->find_part(swpart_name, interface);
if (part != nullptr)
+ {
+ if (dev != nullptr)
+ *dev = &swlistdev;
return part;
+ }
}
}
@@ -1332,22 +1340,38 @@ const software_part *device_image_interface::find_software_item(const char *path
// gameboy:sml) which is not handled properly by software_name_split
// since the function cannot distinguish between this and the case
// path = swinfo_name:swpart_name
- const software_info *info = swlistdev.find(swpart_name.c_str());
+ const software_info *info = swlistdev.find(swpart_name);
if (info != nullptr)
{
- const software_part *part = info->find_part(nullptr, interface);
+ const software_part *part = info->find_part("", interface);
if (part != nullptr)
+ {
+ if (dev != nullptr)
+ *dev = &swlistdev;
return part;
+ }
}
}
}
// if explicitly specified and not found, just error here
+ if (dev != nullptr)
+ *dev = nullptr;
return nullptr;
}
//-------------------------------------------------
+// get_software_list_loader
+//-------------------------------------------------
+
+const software_list_loader &device_image_interface::get_software_list_loader() const
+{
+ return false_software_list_loader::instance();
+}
+
+
+//-------------------------------------------------
// load_software_part
//
// Load a software part for a device. The part to
@@ -1360,10 +1384,11 @@ const software_part *device_image_interface::find_software_item(const char *path
// sw_info and sw_part are also set.
//-------------------------------------------------
-bool device_image_interface::load_software_part(const char *path, const software_part *&swpart)
+bool device_image_interface::load_software_part(const std::string &path, const software_part *&swpart, std::string *list_name)
{
// if no match has been found, we suggest similar shortnames
- swpart = find_software_item(path, true);
+ software_list_device *swlist;
+ swpart = find_software_item(path, true, &swlist);
if (swpart == nullptr)
{
software_list_device::display_matches(device().machine().config(), image_interface(), path);
@@ -1375,11 +1400,10 @@ bool device_image_interface::load_software_part(const char *path, const software
set_init_phase();
// Load the software part
- software_list_device &swlist = swpart->info().list();
const char *swname = swpart->info().shortname().c_str();
- const rom_entry *start_entry = swpart->romdata();
+ const rom_entry *start_entry = swpart->romdata().data();
const software_list_loader &loader = get_software_list_loader();
- bool result = loader.load_software(*this, swlist, swname, start_entry);
+ bool result = loader.load_software(*this, *swlist, swname, start_entry);
#ifdef UNUSED_VARIABLE
// Tell the world which part we actually loaded
@@ -1387,17 +1411,17 @@ bool device_image_interface::load_software_part(const char *path, const software
#endif
// check compatibility
- switch (swpart->is_compatible(swlist))
+ switch (swlist->is_compatible(*swpart))
{
case SOFTWARE_IS_COMPATIBLE:
break;
case SOFTWARE_IS_INCOMPATIBLE:
- swlist.popmessage("WARNING! the set %s might not work on this system due to incompatible filter(s) '%s'\n", swpart->info().shortname(), swlist.filter());
+ swlist->popmessage("WARNING! the set %s might not work on this system due to incompatible filter(s) '%s'\n", swpart->info().shortname(), swlist->filter());
break;
case SOFTWARE_NOT_COMPATIBLE:
- swlist.popmessage("WARNING! the set %s might not work on this system due to missing filter(s) '%s'\n", swpart->info().shortname(), swlist.filter());
+ swlist->popmessage("WARNING! the set %s might not work on this system due to missing filter(s) '%s'\n", swpart->info().shortname(), swlist->filter());
break;
}
@@ -1408,7 +1432,7 @@ bool device_image_interface::load_software_part(const char *path, const software
const software_part *req_swpart = find_software_item(requirement, false);
if (req_swpart != nullptr)
{
- device_image_interface *req_image = req_swpart->find_mountable_image(device().mconfig());
+ device_image_interface *req_image = software_list_device::find_mountable_image(device().mconfig(), *req_swpart);
if (req_image != nullptr)
{
req_image->set_init_phase();
@@ -1416,6 +1440,8 @@ bool device_image_interface::load_software_part(const char *path, const software
}
}
}
+ if (list_name != nullptr)
+ *list_name = swlist->list_name();
return result;
}
diff --git a/src/emu/diimage.h b/src/emu/diimage.h
index fa30dc71cad..d2ea51c47e7 100644
--- a/src/emu/diimage.h
+++ b/src/emu/diimage.h
@@ -21,8 +21,6 @@
#include <string>
#include <vector>
-#include "softlist.h"
-
//**************************************************************************
// TYPE DEFINITIONS
@@ -31,6 +29,7 @@
extern struct io_procs image_ioprocs;
class software_list;
+class software_list_loader;
enum iodevice_t
{
@@ -181,7 +180,6 @@ public:
util::core_file &image_core_file() const { return *m_file; }
UINT64 length() { check_for_file(); return m_file->size(); }
bool is_readonly() const { return m_readonly; }
- void make_readonly() { m_readonly = true; }
UINT32 fread(void *buffer, UINT32 length) { check_for_file(); return m_file->read(buffer, length); }
UINT32 fread(optional_shared_ptr<UINT8> &ptr, UINT32 length) { ptr.allocate(length); return fread(ptr.target(), length); }
UINT32 fread(optional_shared_ptr<UINT8> &ptr, UINT32 length, offs_t offset) { ptr.allocate(length); return fread(ptr + offset, length - offset); }
@@ -240,7 +238,7 @@ public:
bool load_software(software_list_device &swlist, const char *swname, const rom_entry *entry);
int reopen_for_write(const std::string &path);
- static void software_name_split(const char *swlist_swname, std::string &swlist_name, std::string &swname, std::string &swpart);
+ static void software_name_split(const std::string &swlist_swname, std::string &swlist_name, std::string &swname, std::string &swpart);
static void static_set_user_loadable(device_t &device, bool user_loadable) {
device_image_interface *img;
if (!device.interface(img))
@@ -252,7 +250,7 @@ public:
bool user_loadable() const { return m_user_loadable; }
protected:
- virtual const software_list_loader &get_software_list_loader() const { return false_software_list_loader::instance(); }
+ virtual const software_list_loader &get_software_list_loader() const;
image_init_result load_internal(const std::string &path, bool is_create, int create_format, util::option_resolution *create_args, bool just_load);
void determine_open_plan(int is_create, UINT32 *open_plan);
@@ -273,8 +271,8 @@ protected:
void image_checkhash();
void update_names(const device_type device_type = nullptr, const char *inst = nullptr, const char *brief = nullptr);
- const software_part *find_software_item(const char *path, bool restrict_to_interface) const;
- bool load_software_part(const char *path, const software_part *&swpart);
+ const software_part *find_software_item(const std::string &path, bool restrict_to_interface, software_list_device **device = nullptr) const;
+ bool load_software_part(const std::string &path, const software_part *&swpart, std::string *list_name = nullptr);
std::string software_get_default_slot(const char *default_card_slot) const;
void add_format(std::unique_ptr<image_device_format> &&format);
diff --git a/src/emu/drivenum.cpp b/src/emu/drivenum.cpp
index 1d2f6d79f06..450790eb55a 100644
--- a/src/emu/drivenum.cpp
+++ b/src/emu/drivenum.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles
/***************************************************************************
- drivenum.c
+ drivenum.cpp
Driver enumeration helpers.
@@ -10,7 +10,7 @@
#include "emu.h"
#include "drivenum.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include <ctype.h>
diff --git a/src/emu/drivers/xtal.h b/src/emu/drivers/xtal.h
index 5cb8b901db8..c74c9ec24b8 100644
--- a/src/emu/drivers/xtal.h
+++ b/src/emu/drivers/xtal.h
@@ -60,6 +60,7 @@ enum
XTAL_3_12MHz = 3120000, /* SP0250 clock on Gottlieb games */
XTAL_3_5MHz = 3500000, /* Reported by Commodore 65 document, true xtal unchecked on PCB */
XTAL_3_52128MHz = 3521280, /* RCA COSMAC VIP */
+ XTAL_3_57864MHz = 3578640, /* Atari Portfolio PCD3311T */
XTAL_3_579545MHz = 3579545, /* NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */
XTAL_3_6864MHz = 3686400, /* CPS3 */
XTAL_4MHz = 4000000,
diff --git a/src/emu/image.cpp b/src/emu/image.cpp
index a08acad47cf..5fbc5844b9d 100644
--- a/src/emu/image.cpp
+++ b/src/emu/image.cpp
@@ -209,23 +209,6 @@ void image_manager::options_extract()
/*-------------------------------------------------
- image_mandatory_scan - search for devices which
- need an image to be loaded
- -------------------------------------------------*/
-
-std::string &image_manager::mandatory_scan(std::string &mandatory)
-{
- mandatory.clear();
- // make sure that any required image has a mounted file
- for (device_image_interface &image : image_interface_iterator(machine().root_device()))
- {
- if (image.filename() == nullptr && image.must_be_loaded())
- mandatory.append("\"").append(image.instance_name()).append("\", ");
- }
- return mandatory;
-}
-
-/*-------------------------------------------------
postdevice_init - initialize devices for a specific
running_machine
-------------------------------------------------*/
diff --git a/src/emu/image.h b/src/emu/image.h
index 32b8035d14d..4a9e55e4c80 100644
--- a/src/emu/image.h
+++ b/src/emu/image.h
@@ -23,7 +23,6 @@ public:
void unload_all();
void postdevice_init();
- std::string &mandatory_scan(std::string &mandatory);
// getters
running_machine &machine() const { return m_machine; }
diff --git a/src/emu/inpttype.h b/src/emu/inpttype.h
index 605abe0b024..d8258c02605 100644
--- a/src/emu/inpttype.h
+++ b/src/emu/inpttype.h
@@ -555,6 +555,7 @@ inline void construct_core_types_other(simple_list<input_type_entry> &typelist)
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, SERVICE, "Service", input_seq(KEYCODE_F2) )
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, TILT, "Tilt", input_seq(KEYCODE_T) )
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, INTERLOCK, "Door Interlock", input_seq() )
+ INPUT_PORT_DIGITAL_TYPE( 0, OTHER, MEMORY_RESET, "Memory Reset", input_seq(KEYCODE_F1) )
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, VOLUME_DOWN, "Volume Down", input_seq(KEYCODE_MINUS) )
INPUT_PORT_DIGITAL_TYPE( 0, OTHER, VOLUME_UP, "Volume Up", input_seq(KEYCODE_EQUALS) )
}
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index 4bec462ceed..44e758b5752 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -2450,10 +2450,6 @@ ioport_manager::ioport_manager(running_machine &machine)
m_timecode_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS),
m_timecode_count(0),
m_timecode_last_time(attotime::zero),
- m_has_configs(false),
- m_has_analog(false),
- m_has_dips(false),
- m_has_bioses(false),
m_autofire_toggle(false),
m_autofire_delay(3) // 1 seems too fast for a bunch of games
{
@@ -2534,29 +2530,6 @@ time_t ioport_manager::initialize()
// register callbacks for when we load configurations
machine().configuration().config_register("input", config_saveload_delegate(FUNC(ioport_manager::load_config), this), config_saveload_delegate(FUNC(ioport_manager::save_config), this));
- // calculate "has..." values
- {
- m_has_configs = false;
- m_has_analog = false;
- m_has_dips = false;
- m_has_bioses = false;
-
- // scan the input port array to see what options we need to enable
- for (auto &port : m_portlist)
- for (ioport_field &field : port.second->fields())
- {
- if (field.type() == IPT_DIPSWITCH)
- m_has_dips = true;
- if (field.type() == IPT_CONFIG)
- m_has_configs = true;
- if (field.is_analog())
- m_has_analog = true;
- }
- for (device_t &device : device_iterator(machine().root_device()))
- for (const rom_entry &rom : device.rom_region_vector())
- if (ROMENTRY_ISSYSTEM_BIOS(&rom)) { m_has_bioses= true; break; }
- }
-
// open playback and record files if specified
time_t basetime = playback_init();
record_init();
diff --git a/src/emu/ioport.h b/src/emu/ioport.h
index 5aba15c94dc..419b603b239 100644
--- a/src/emu/ioport.h
+++ b/src/emu/ioport.h
@@ -143,6 +143,7 @@ enum ioport_type
IPT_SERVICE,
IPT_TILT,
IPT_INTERLOCK,
+ IPT_MEMORY_RESET,
IPT_VOLUME_UP,
IPT_VOLUME_DOWN,
IPT_START, // use the numbered start button(s) for coin-ops
@@ -1473,12 +1474,6 @@ public:
bool safe_to_read() const { return m_safe_to_read; }
natural_keyboard &natkeyboard() { return m_natkeyboard; }
- // has... getters
- bool has_configs() const { return m_has_configs; }
- bool has_analog() const { return m_has_analog; }
- bool has_dips() const { return m_has_dips; }
- bool has_bioses() const { return m_has_bioses; }
-
// type helpers
const simple_list<input_type_entry> &types() const { return m_typelist; }
bool type_pressed(ioport_type type, int player = 0);
@@ -1569,12 +1564,6 @@ private:
int m_timecode_count;
attotime m_timecode_last_time;
- // has...
- bool m_has_configs;
- bool m_has_analog;
- bool m_has_dips;
- bool m_has_bioses;
-
// autofire
bool m_autofire_toggle; // autofire toggle
int m_autofire_delay; // autofire delay
diff --git a/src/emu/rendersw.hxx b/src/emu/rendersw.hxx
index a7dcbac0191..bcd827aa446 100644
--- a/src/emu/rendersw.hxx
+++ b/src/emu/rendersw.hxx
@@ -902,7 +902,6 @@ private:
static void draw_quad_yuy16_none(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
{
- const rgb_t *palbase = prim.texture.palette;
INT32 dudx = setup.dudx;
INT32 dvdx = setup.dvdx;
INT32 endx = setup.endx;
@@ -917,30 +916,13 @@ private:
INT32 curu = setup.startu + (y - setup.starty) * setup.dudy;
INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
- // no lookup case
- if (palbase == nullptr)
- {
- // loop over cols
- for (INT32 x = setup.startx; x < endx; x++)
- {
- UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
- *dest++ = source32_to_dest(pix);
- curu += dudx;
- curv += dvdx;
- }
- }
-
- // lookup case
- else
+ // loop over cols
+ for (INT32 x = setup.startx; x < endx; x++)
{
- // loop over cols
- for (INT32 x = setup.startx; x < endx; x++)
- {
- UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
- *dest++ = source32_to_dest(pix);
- curu += dudx;
- curv += dvdx;
- }
+ UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
+ *dest++ = source32_to_dest(pix);
+ curu += dudx;
+ curv += dvdx;
}
}
}
@@ -964,38 +946,17 @@ private:
INT32 curu = setup.startu + (y - setup.starty) * setup.dudy;
INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
- // no lookup case
- if (palbase == nullptr)
- {
- // loop over cols
- for (INT32 x = setup.startx; x < endx; x++)
- {
- UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
- UINT32 r = (source32_r(pix) * sr) >> 8;
- UINT32 g = (source32_g(pix) * sg) >> 8;
- UINT32 b = (source32_b(pix) * sb) >> 8;
-
- *dest++ = dest_assemble_rgb(r, g, b);
- curu += dudx;
- curv += dvdx;
- }
- }
-
- // lookup case
- else
+ // loop over cols
+ for (INT32 x = setup.startx; x < endx; x++)
{
- // loop over cols
- for (INT32 x = setup.startx; x < endx; x++)
- {
- UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
- UINT32 r = (source32_r(pix) * sr) >> 8;
- UINT32 g = (source32_g(pix) * sg) >> 8;
- UINT32 b = (source32_b(pix) * sb) >> 8;
+ UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
+ UINT32 r = (source32_r(pix) * sr) >> 8;
+ UINT32 g = (source32_g(pix) * sg) >> 8;
+ UINT32 b = (source32_b(pix) * sb) >> 8;
- *dest++ = dest_assemble_rgb(r, g, b);
- curu += dudx;
- curv += dvdx;
- }
+ *dest++ = dest_assemble_rgb(r, g, b);
+ curu += dudx;
+ curv += dvdx;
}
}
}
@@ -1021,40 +982,103 @@ private:
INT32 curu = setup.startu + (y - setup.starty) * setup.dudy;
INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
- // no lookup case
- if (palbase == nullptr)
+ // loop over cols
+ for (INT32 x = setup.startx; x < endx; x++)
{
- // loop over cols
- for (INT32 x = setup.startx; x < endx; x++)
- {
- UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
- UINT32 dpix = _NoDestRead ? 0 : *dest;
- UINT32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
- UINT32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
- UINT32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
+ UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
+ UINT32 dpix = _NoDestRead ? 0 : *dest;
+ UINT32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
+ UINT32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
+ UINT32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
- *dest++ = dest_assemble_rgb(r, g, b);
- curu += dudx;
- curv += dvdx;
- }
+ *dest++ = dest_assemble_rgb(r, g, b);
+ curu += dudx;
+ curv += dvdx;
}
+ }
+ }
+ }
- // lookup case
- else
+
+ //-------------------------------------------------
+ // draw_quad_yuy16_add - perform
+ // rasterization by using RGB add after YUY
+ // conversion
+ //-------------------------------------------------
+
+ static void draw_quad_yuy16_add(const render_primitive &prim, _PixelType *dstdata, UINT32 pitch, quad_setup_data &setup)
+ {
+ INT32 dudx = setup.dudx;
+ INT32 dvdx = setup.dvdx;
+ INT32 endx = setup.endx;
+
+ // simply can't do this without reading from the dest
+ if (_NoDestRead)
+ return;
+
+ // fast case: no coloring, no alpha
+ if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a))
+ {
+ // loop over rows
+ for (INT32 y = setup.starty; y < setup.endy; y++)
+ {
+ _PixelType *dest = dstdata + y * pitch + setup.startx;
+ INT32 curu = setup.startu + (y - setup.starty) * setup.dudy;
+ INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
+
+ // loop over cols
+ for (INT32 x = setup.startx; x < endx; x++)
{
- // loop over cols
- for (INT32 x = setup.startx; x < endx; x++)
- {
- UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
- UINT32 dpix = _NoDestRead ? 0 : *dest;
- UINT32 r = (source32_r(pix) * sr + dest_r(dpix) * invsa) >> 8;
- UINT32 g = (source32_g(pix) * sg + dest_g(dpix) * invsa) >> 8;
- UINT32 b = (source32_b(pix) * sb + dest_b(dpix) * invsa) >> 8;
+ UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
+ UINT32 dpix = _NoDestRead ? 0 : *dest;
+ UINT32 r = source32_r(pix) + dest_r(dpix);
+ UINT32 g = source32_g(pix) + dest_g(dpix);
+ UINT32 b = source32_b(pix) + dest_b(dpix);
+ r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR);
+ g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG);
+ b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB);
+ *dest++ = dest_assemble_rgb(r, g, b);
+ curu += dudx;
+ curv += dvdx;
+ }
+ }
+ }
- *dest++ = dest_assemble_rgb(r, g, b);
- curu += dudx;
- curv += dvdx;
- }
+ // alpha and/or coloring case
+ else
+ {
+ UINT32 sr = UINT32(256.0f * prim.color.r);
+ UINT32 sg = UINT32(256.0f * prim.color.g);
+ UINT32 sb = UINT32(256.0f * prim.color.b);
+ UINT32 sa = UINT32(256.0f * prim.color.a);
+
+ // clamp R,G,B and inverse A to 0-256 range
+ if (sr > 0x100) { if (INT32(sr) < 0) sr = 0; else sr = 0x100; }
+ if (sg > 0x100) { if (INT32(sg) < 0) sg = 0; else sg = 0x100; }
+ if (sb > 0x100) { if (INT32(sb) < 0) sb = 0; else sb = 0x100; }
+ if (sa > 0x100) { if (INT32(sa) < 0) sa = 0; else sa = 0x100; }
+
+ // loop over rows
+ for (INT32 y = setup.starty; y < setup.endy; y++)
+ {
+ _PixelType *dest = dstdata + y * pitch + setup.startx;
+ INT32 curu = setup.startu + (y - setup.starty) * setup.dudy;
+ INT32 curv = setup.startv + (y - setup.starty) * setup.dvdy;
+
+ // loop over cols
+ for (INT32 x = setup.startx; x < endx; x++)
+ {
+ UINT32 pix = ycc_to_rgb(get_texel_yuy16(prim.texture, curu, curv));
+ UINT32 dpix = _NoDestRead ? 0 : *dest;
+ UINT32 r = ((source32_r(pix) * sr * sa) >> 16) + dest_r(dpix);
+ UINT32 g = ((source32_g(pix) * sg * sa) >> 16) + dest_g(dpix);
+ UINT32 b = ((source32_b(pix) * sb * sa) >> 16) + dest_b(dpix);
+ r = (r | -(r >> (8 - _SrcShiftR))) & (0xff >> _SrcShiftR);
+ g = (g | -(g >> (8 - _SrcShiftG))) & (0xff >> _SrcShiftG);
+ b = (b | -(b >> (8 - _SrcShiftB))) & (0xff >> _SrcShiftB);
+ *dest++ = dest_assemble_rgb(r, g, b);
+ curu += dudx;
+ curv += dvdx;
}
}
}
@@ -1865,9 +1889,14 @@ private:
break;
case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16) | PRIMFLAG_BLENDMODE(BLENDMODE_NONE):
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA):
draw_quad_yuy16_none(prim, dstdata, pitch, setup);
break;
+ case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD):
+ draw_quad_yuy16_add(prim, dstdata, pitch, setup);
+ break;
+
case PRIMFLAG_TEXFORMAT(TEXFORMAT_RGB32) | PRIMFLAG_BLENDMODE(BLENDMODE_NONE):
case PRIMFLAG_TEXFORMAT(TEXFORMAT_RGB32) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA):
case PRIMFLAG_TEXFORMAT(TEXFORMAT_ARGB32) | PRIMFLAG_BLENDMODE(BLENDMODE_NONE):
diff --git a/src/emu/romload.cpp b/src/emu/romload.cpp
index 2bb4d984602..7a983118e8a 100644
--- a/src/emu/romload.cpp
+++ b/src/emu/romload.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Nicola Salmoria,Paul Priest,Aaron Giles
/*********************************************************************
- romload.c
+ romload.cpp
ROM loading functions.
*********************************************************************/
@@ -10,7 +10,7 @@
#include "emu.h"
#include "emuopts.h"
#include "drivenum.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include "ui/uimain.h"
diff --git a/src/emu/softlist.cpp b/src/emu/softlist.cpp
index 2d6793db3af..d7a8b8d86d8 100644
--- a/src/emu/softlist.cpp
+++ b/src/emu/softlist.cpp
@@ -2,137 +2,16 @@
// copyright-holders:Wilbert Pol
/***************************************************************************
- softlist.c
+ softlist.cpp
Software list construction helpers.
***************************************************************************/
-#include "emu.h"
-#include "emuopts.h"
#include "softlist.h"
-#include "validity.h"
+#include "hash.h"
#include "expat.h"
-#include <ctype.h>
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-typedef std::unordered_map<std::string,const software_info *> softlist_map;
-
-
-// ======================> softlist_parser
-
-class softlist_parser
-{
-public:
- // construction (== execution)
- softlist_parser(software_list_device &list, std::ostringstream &errors);
-
-private:
- enum parse_position
- {
- POS_ROOT,
- POS_MAIN,
- POS_SOFT,
- POS_PART,
- POS_DATA
- };
-
- // internal parsing helpers
- const char *filename() const { return m_list.filename(); }
- const char *infoname() const { return (m_current_info != nullptr) ? m_current_info->shortname().c_str() : "???"; }
- int line() const { return XML_GetCurrentLineNumber(m_parser); }
- int column() const { return XML_GetCurrentColumnNumber(m_parser); }
- const char *parser_error() const { return XML_ErrorString(XML_GetErrorCode(m_parser)); }
-
- // internal error helpers
- template <typename Format, typename... Params> void parse_error(Format &&fmt, Params &&... args);
- void unknown_tag(const char *tagname) { parse_error("Unknown tag: %s", tagname); }
- void unknown_attribute(const char *attrname) { parse_error("Unknown attribute: %s", attrname); }
-
- // internal helpers
- template <typename T> std::vector<std::string> parse_attributes(const char **attributes, const T &attrlist);
- bool parse_name_and_value(const char **attributes, std::string &name, std::string &value);
- void add_rom_entry(std::string &&name, std::string &&hashdata, UINT32 offset, UINT32 length, UINT32 flags);
-
- // expat callbacks
- static void start_handler(void *data, const char *tagname, const char **attributes);
- static void data_handler(void *data, const XML_Char *s, int len);
- static void end_handler(void *data, const char *name);
-
- // internal parsing
- void parse_root_start(const char *tagname, const char **attributes);
- void parse_main_start(const char *tagname, const char **attributes);
- void parse_soft_start(const char *tagname, const char **attributes);
- void parse_part_start(const char *tagname, const char **attributes);
- void parse_data_start(const char *tagname, const char **attributes);
- void parse_soft_end(const char *name);
-
- // internal parsing state
- software_list_device & m_list;
- std::ostringstream & m_errors;
- XML_Parser m_parser;
- bool m_done;
- bool m_data_accum_expected;
- std::string m_data_accum;
- software_info * m_current_info;
- software_part * m_current_part;
- parse_position m_pos;
-};
-
-
-
-//**************************************************************************
-// GLOBAL VARIABLES
-//**************************************************************************
-
-// device type definition
-const device_type SOFTWARE_LIST = &device_creator<software_list_device>;
-false_software_list_loader false_software_list_loader::s_instance;
-rom_software_list_loader rom_software_list_loader::s_instance;
-image_software_list_loader image_software_list_loader::s_instance;
-
-
-
-//**************************************************************************
-// SOFTWARE LIST LOADER
-//**************************************************************************
-
-//-------------------------------------------------
-// false_software_list_loader::load_software
-//-------------------------------------------------
-
-bool false_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const
-{
- return false;
-}
-
-
-//-------------------------------------------------
-// rom_software_list_loader::load_software
-//-------------------------------------------------
-
-bool rom_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const
-{
- swlist.machine().rom_load().load_software_part_region(device, swlist, swname, start_entry);
- return true;
-}
-
-
-//-------------------------------------------------
-// image_software_list_loader::load_software
-//-------------------------------------------------
-
-bool image_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const
-{
- return device.load_software(swlist, swname, start_entry);
-}
-
-
//**************************************************************************
// FEATURE LIST ITEM
//**************************************************************************
@@ -195,56 +74,6 @@ const char *software_part::feature(const std::string &feature_name) const
//-------------------------------------------------
-// is_compatible - determine if we are compatible
-// with the given software_list_device
-//-------------------------------------------------
-
-software_compatibility software_part::is_compatible(const software_list_device &swlistdev) const
-{
- // get the softlist filter; if null, assume compatible
- const char *filter = swlistdev.filter();
- if (filter == nullptr)
- return SOFTWARE_IS_COMPATIBLE;
-
- // copy the comma-delimited string and ensure it ends with a final comma
- std::string filt = std::string(filter).append(",");
-
- // get the incompatibility filter and test against it first if it exists
- const char *incompatibility = feature("incompatibility");
- if (incompatibility != nullptr)
- {
- // copy the comma-delimited string and ensure it ends with a final comma
- std::string incomp = std::string(incompatibility).append(",");
-
- // iterate over filter items and see if they exist in the list; if so, it's incompatible
- for (int start = 0, end = filt.find_first_of(',',start); end != -1; start = end + 1, end = filt.find_first_of(',', start))
- {
- std::string token(filt, start, end - start + 1);
- if (incomp.find(token) != -1)
- return SOFTWARE_IS_INCOMPATIBLE;
- }
- }
-
- // get the compatibility feature; if null, assume compatible
- const char *compatibility = feature("compatibility");
- if (compatibility == nullptr)
- return SOFTWARE_IS_COMPATIBLE;
-
- // copy the comma-delimited string and ensure it ends with a final comma
- std::string comp = std::string(compatibility).append(",");
-
- // iterate over filter items and see if they exist in the compatibility list; if so, it's compatible
- for (int start = 0, end = filt.find_first_of(',',start); end != -1; start = end + 1, end = filt.find_first_of(',', start))
- {
- std::string token(filt, start, end - start + 1);
- if (comp.find(token) != -1)
- return SOFTWARE_IS_COMPATIBLE;
- }
- return SOFTWARE_NOT_COMPATIBLE;
-}
-
-
-//-------------------------------------------------
// matches_interface - determine if we match
// an interface in the provided list
//-------------------------------------------------
@@ -264,35 +93,6 @@ bool software_part::matches_interface(const char *interface_list) const
}
-//-------------------------------------------------
-// find_mountable_image - find an image interface
-// that can automatically mount this software part
-//-------------------------------------------------
-
-device_image_interface *software_part::find_mountable_image(const machine_config &mconfig) const
-{
- // if automount="no", don't bother
- const char *mount = feature("automount");
- if (mount != nullptr && strcmp(mount, "no") == 0)
- return nullptr;
-
- for (device_image_interface &image : image_interface_iterator(mconfig.root_device()))
- {
- const char *interface = image.image_interface();
- if (interface != nullptr && matches_interface(interface))
- {
- // mount only if not already mounted
- const char *option = mconfig.options().value(image.brief_instance_name());
- if (*option == '\0' && !image.filename())
-
- return &image;
- }
- }
- return nullptr;
-}
-
-
-
//**************************************************************************
// SOFTWARE INFO
//**************************************************************************
@@ -301,21 +101,16 @@ device_image_interface *software_part::find_mountable_image(const machine_config
// software_info - constructor
//-------------------------------------------------
-software_info::software_info(software_list_device &list, std::string &&name, std::string &&parent, const char *supported)
- : m_next(nullptr),
- m_list(list),
- m_supported(SOFTWARE_SUPPORTED_YES),
+software_info::software_info(std::string &&name, std::string &&parent, const std::string &supported)
+ : m_supported(SOFTWARE_SUPPORTED_YES),
m_shortname(std::move(name)),
m_parentname(std::move(parent))
{
// handle the supported flag if provided
- if (supported != nullptr)
- {
- if (strcmp(supported, "partial") == 0)
- m_supported = SOFTWARE_SUPPORTED_PARTIAL;
- else if (strcmp(supported, "no") == 0)
- m_supported = SOFTWARE_SUPPORTED_NO;
- }
+ if (supported == "partial")
+ m_supported = SOFTWARE_SUPPORTED_PARTIAL;
+ else if (supported == "no")
+ m_supported = SOFTWARE_SUPPORTED_NO;
}
@@ -324,22 +119,20 @@ software_info::software_info(software_list_device &list, std::string &&name, std
// optional interface match
//-------------------------------------------------
-const software_part *software_info::find_part(const char *partname, const char *interface) const
+const software_part *software_info::find_part(const std::string &partname, const char *interface) const
{
// if neither partname nor interface supplied, then we just return the first entry
- if (partname != nullptr && strlen(partname)==0) partname = nullptr;
-
- if (partname == nullptr && interface == nullptr)
+ if (partname.empty() && interface == nullptr)
return &m_partdata.front();
// look for the part by name and match against the interface if provided
for (const software_part &part : m_partdata)
- if (partname != nullptr && (partname == part.name()))
+ if (!partname.empty() && (partname == part.name()))
{
if (interface == nullptr || part.matches_interface(interface))
return &part;
}
- else if (partname == nullptr && part.matches_interface(interface))
+ else if (partname.empty() && part.matches_interface(interface))
return &part;
return nullptr;
}
@@ -365,383 +158,6 @@ bool software_info::has_multiple_parts(const char *interface) const
}
-
-//**************************************************************************
-// SOFTWARE LIST DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// software_list_device - constructor
-//-------------------------------------------------
-
-software_list_device::software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, SOFTWARE_LIST, "Software list", tag, owner, clock, "software_list", __FILE__),
- m_list_type(SOFTWARE_LIST_ORIGINAL_SYSTEM),
- m_filter(nullptr),
- m_parsed(false),
- m_file(mconfig.options().hash_path(), OPEN_FLAG_READ),
- m_description("")
-{
-}
-
-
-//-------------------------------------------------
-// static_set_type - configuration helper
-// to set the list type
-//-------------------------------------------------
-
-void software_list_device::static_set_type(device_t &device, const char *list, softlist_type list_type)
-{
- software_list_device &swlistdev = downcast<software_list_device &>(device);
- swlistdev.m_list_name.assign(list);
- swlistdev.m_list_type = list_type;
-}
-
-
-//-------------------------------------------------
-// static_set_custom_handler - configuration
-// helper to set a custom callback
-//-------------------------------------------------
-
-void software_list_device::static_set_filter(device_t &device, const char *filter)
-{
- downcast<software_list_device &>(device).m_filter = filter;
-}
-
-
-//-------------------------------------------------
-// device_start - device-specific startup
-//-------------------------------------------------
-
-void software_list_device::device_start()
-{
-}
-
-
-//-------------------------------------------------
-// find_approx_matches - search ourselves for
-// a list of possible matches of the given name
-// and optional interface
-//-------------------------------------------------
-
-void software_list_device::find_approx_matches(const char *name, int matches, const software_info **list, const char *interface)
-{
- // if no name, return
- if (name == nullptr || name[0] == 0)
- return;
-
- // initialize everyone's states
- std::vector<int> penalty(matches);
- for (int matchnum = 0; matchnum < matches; matchnum++)
- {
- penalty[matchnum] = 9999;
- list[matchnum] = nullptr;
- }
-
- // iterate over our info (will cause a parse if needed)
- for (const software_info &swinfo : get_info())
- {
- const software_part &part = swinfo.parts().front();
- if ((interface == nullptr || part.matches_interface(interface)) && part.is_compatible(*this) == SOFTWARE_IS_COMPATIBLE)
- {
- // pick the best match between driver name and description
- int longpenalty = driver_list::penalty_compare(name, swinfo.longname().c_str());
- int shortpenalty = driver_list::penalty_compare(name, swinfo.shortname().c_str());
- int curpenalty = std::min(longpenalty, shortpenalty);
-
- // insert into the sorted table of matches
- for (int matchnum = matches - 1; matchnum >= 0; matchnum--)
- {
- // stop if we're worse than the current entry
- if (curpenalty >= penalty[matchnum])
- break;
-
- // as long as this isn't the last entry, bump this one down
- if (matchnum < matches - 1)
- {
- penalty[matchnum + 1] = penalty[matchnum];
- list[matchnum + 1] = list[matchnum];
- }
- list[matchnum] = &swinfo;
- penalty[matchnum] = curpenalty;
- }
- }
- }
-}
-
-
-//-------------------------------------------------
-// release - reset to a pre-parsed state
-//-------------------------------------------------
-
-void software_list_device::release()
-{
- osd_printf_verbose("Resetting %s\n", m_file.filename());
- m_parsed = false;
- m_description.clear();
- m_errors.clear();
- m_infolist.clear();
-}
-
-
-//-------------------------------------------------
-// find_by_name - find a software list by name
-// across all software list devices
-//-------------------------------------------------
-
-software_list_device *software_list_device::find_by_name(const machine_config &config, const char *name)
-{
- // iterate over each device in the system and find a match
- for (software_list_device &swlistdev : software_list_device_iterator(config.root_device()))
- if (strcmp(swlistdev.list_name(), name) == 0)
- return &swlistdev;
- return nullptr;
-}
-
-
-//-------------------------------------------------
-// software_display_matches - display a list of
-// possible matches in the system to the given
-// name, across all software list devices
-//-------------------------------------------------
-
-void software_list_device::display_matches(const machine_config &config, const char *interface, const char *name)
-{
- // check if there is at least one software list
- software_list_device_iterator deviter(config.root_device());
- if (deviter.first() != nullptr)
- osd_printf_error("\n\"%s\" approximately matches the following\n"
- "supported software items (best match first):\n\n", name);
-
- // iterate through lists
- for (software_list_device &swlistdev : deviter)
- {
- // get the top 16 approximate matches for the selected device interface (i.e. only carts for cartslot, etc.)
- const software_info *matches[16] = { nullptr };
- swlistdev.find_approx_matches(name, ARRAY_LENGTH(matches), matches, interface);
-
- // if we found some, print them
- if (matches[0] != nullptr)
- {
- // different output depending on original system or compatible
- if (swlistdev.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM)
- osd_printf_error("* Software list \"%s\" (%s) matches: \n", swlistdev.list_name(), swlistdev.description());
- else
- osd_printf_error("* Compatible software list \"%s\" (%s) matches: \n", swlistdev.list_name(), swlistdev.description());
-
- // print them out
- for (auto &match : matches)
- {
- if (match != nullptr)
- osd_printf_error("%-18s%s\n", match->shortname().c_str(), match->longname().c_str());
- }
-
- osd_printf_error("\n");
- }
- }
-}
-
-
-//-------------------------------------------------
-// find - find an item by name in the software
-// list, using wildcards and optionally starting
-// from an intermediate point
-//-------------------------------------------------
-
-const software_info *software_list_device::find(const char *look_for)
-{
- // nullptr search returns nothing
- if (look_for == nullptr)
- return nullptr;
-
- bool iswild = strchr(look_for, '*') != nullptr || strchr(look_for, '?');
-
- // find a match (will cause a parse if needed when calling get_info)
- const auto &info_list = get_info();
- auto iter = std::find_if(
- info_list.begin(),
- info_list.end(),
- [&](const software_info &info)
- {
- const char *shortname = info.shortname().c_str();
- return (iswild && core_strwildcmp(look_for, shortname) == 0)
- || core_stricmp(look_for, shortname) == 0;
- });
-
- return iter != info_list.end()
- ? &*iter
- : nullptr;
-}
-
-
-//-------------------------------------------------
-// parse - parse our softlist file
-//-------------------------------------------------
-
-void software_list_device::parse()
-{
- // skip if done
- if (m_parsed)
- return;
-
- // reset the errors
- m_errors.clear();
-
- // attempt to open the file
- osd_file::error filerr = m_file.open(m_list_name.c_str(), ".xml");
- if (filerr == osd_file::error::NONE)
- {
- // parse if no error
- std::ostringstream errs;
- softlist_parser parser(*this, errs);
- m_file.close();
- m_errors = errs.str();
- }
- else
- m_errors = string_format("Error opening file: %s\n", filename());
-
- // indicate that we've been parsed
- m_parsed = true;
-}
-
-
-//-------------------------------------------------
-// device_validity_check - validate the device
-// configuration
-//-------------------------------------------------
-
-void software_list_device::device_validity_check(validity_checker &valid) const
-{
- // add to the global map whenever we check a list so we don't re-check
- // it in the future
- if (valid.already_checked(std::string("softlist/").append(m_list_name).c_str()))
- return;
-
- // do device validation only in case of validate command
- if (!valid.validate_all())
- return;
-
- // actually do the validate
- const_cast<software_list_device *>(this)->internal_validity_check(valid);
-}
-
-
-//-------------------------------------------------
-// internal_validity_check - internal helper to
-// check the list
-//-------------------------------------------------
-
-void software_list_device::internal_validity_check(validity_checker &valid)
-{
- enum { NAME_LEN_PARENT = 8, NAME_LEN_CLONE = 16 };
-
- softlist_map names;
- softlist_map descriptions;
- for (const software_info &swinfo : get_info())
- {
- // first parse and output core errors if any
- if (m_errors.length() > 0)
- {
- osd_printf_error("%s: Errors parsing software list:\n%s", filename(), errors_string());
- break;
- }
-
- // Now check if the xml data is valid:
-
- // Did we lost any description?
- if (swinfo.longname().empty())
- {
- osd_printf_error("%s: %s has no description\n", filename(), swinfo.shortname().c_str());
- break;
- }
-
- // Did we lost any year?
- if (swinfo.year().empty())
- {
- osd_printf_error("%s: %s has no year\n", filename(), swinfo.shortname().c_str());
- break;
- }
-
- // Did we lost any publisher?
- if (swinfo.publisher().empty())
- {
- osd_printf_error("%s: %s has no publisher\n", filename(), swinfo.shortname().c_str());
- break;
- }
-
- // Did we lost the software parts?
- if (swinfo.parts().empty())
- {
- osd_printf_error("%s: %s has no part\n", filename(), swinfo.shortname().c_str());
- break;
- }
-
- // Second, since the xml is fine, run additional checks:
-
- // check for duplicate names
- if (!names.insert(std::make_pair(swinfo.shortname(), &swinfo)).second)
- {
- const software_info *match = names.find(swinfo.shortname())->second;
- osd_printf_error("%s: %s is a duplicate name (%s)\n", filename(), swinfo.shortname().c_str(), match->shortname().c_str());
- }
-
- // check for duplicate descriptions
- std::string longname = std::string(swinfo.longname());
- if (!descriptions.insert(std::make_pair(strmakelower(longname), &swinfo)).second)
- osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo.longname().c_str(), swinfo.shortname().c_str());
-
- bool is_clone = false;
- if (!swinfo.parentname().empty())
- {
- is_clone = true;
- if (swinfo.parentname() == swinfo.shortname())
- {
- osd_printf_error("%s: %s is set as a clone of itself\n", filename(), swinfo.shortname().c_str());
- break;
- }
-
- // make sure the parent exists
- const software_info *swinfo2 = find(swinfo.parentname().c_str());
-
- if (swinfo2 == nullptr)
- osd_printf_error("%s: parent '%s' software for '%s' not found\n", filename(), swinfo.parentname().c_str(), swinfo.shortname().c_str());
- else if (!swinfo2->parentname().empty())
- osd_printf_error("%s: %s is a clone of a clone\n", filename(), swinfo.shortname().c_str());
- }
-
- // make sure the driver name is 8 chars or less
- if ((is_clone && swinfo.shortname().length() > NAME_LEN_CLONE) || (!is_clone && swinfo.shortname().length() > NAME_LEN_PARENT))
- osd_printf_error("%s: %s %s driver name must be %d characters or less\n", filename(), swinfo.shortname().c_str(),
- is_clone ? "clone" : "parent", is_clone ? NAME_LEN_CLONE : NAME_LEN_PARENT);
-
- // make sure the year is only digits, '?' or '+'
- for (const char *s = swinfo.year().c_str(); *s != 0; s++)
- if (!isdigit((UINT8)*s) && *s != '?' && *s != '+')
- {
- osd_printf_error("%s: %s has an invalid year '%s'\n", filename(), swinfo.shortname().c_str(), swinfo.year().c_str());
- break;
- }
-
- softlist_map part_names;
- for (const software_part &part : swinfo.parts())
- {
- if (part.interface().empty())
- osd_printf_error("%s: %s has a part (%s) without interface\n", filename(), swinfo.shortname().c_str(), part.name().c_str());
-
- if (part.romdata() == nullptr)
- osd_printf_error("%s: %s has a part (%s) with no data\n", filename(), swinfo.shortname().c_str(), part.name().c_str());
-
- if (!part_names.insert(std::make_pair(part.name(), &swinfo)).second)
- osd_printf_error("%s: %s has a part (%s) whose name is duplicate\n", filename(), swinfo.shortname().c_str(), part.name().c_str());
- }
- }
-
- // release all the memory
- release();
-}
-
-
-
//**************************************************************************
// SOFTWARE LIST PARSER
//**************************************************************************
@@ -750,17 +166,18 @@ void software_list_device::internal_validity_check(validity_checker &valid)
// softlist_parser - constructor
//-------------------------------------------------
-softlist_parser::softlist_parser(software_list_device &list, std::ostringstream &errors)
- : m_list(list),
+softlist_parser::softlist_parser(util::core_file &file, const std::string &filename, std::string &description, std::list<software_info> &infolist, std::ostringstream &errors)
+ : m_file(file),
+ m_filename(filename),
+ m_infolist(infolist),
m_errors(errors),
m_done(false),
+ m_description(description),
m_data_accum_expected(false),
m_current_info(nullptr),
m_current_part(nullptr),
m_pos(POS_ROOT)
{
- osd_printf_verbose("Parsing %s\n", m_list.m_file.filename());
-
// create the parser
m_parser = XML_ParserCreate_MM(nullptr, nullptr, nullptr);
if (m_parser == nullptr)
@@ -772,12 +189,12 @@ softlist_parser::softlist_parser(software_list_device &list, std::ostringstream
XML_SetCharacterDataHandler(m_parser, &softlist_parser::data_handler);
// parse the file contents
- m_list.m_file.seek(0, SEEK_SET);
+ m_file.seek(0, SEEK_SET);
char buffer[1024];
while (!m_done)
{
- UINT32 length = m_list.m_file.read(buffer, sizeof(buffer));
- m_done = m_list.m_file.eof();
+ UINT32 length = m_file.read(buffer, sizeof(buffer));
+ m_done = m_file.eof();
if (XML_Parse(m_parser, buffer, length, m_done) == XML_STATUS_ERROR)
{
parse_error("%s", parser_error());
@@ -787,9 +204,39 @@ softlist_parser::softlist_parser(software_list_device &list, std::ostringstream
// free the parser
XML_ParserFree(m_parser);
- osd_printf_verbose("Parsing complete\n");
}
+
+//-------------------------------------------------
+// line
+//-------------------------------------------------
+
+int softlist_parser::line() const
+{
+ return XML_GetCurrentLineNumber(m_parser);
+}
+
+
+//-------------------------------------------------
+// column
+//-------------------------------------------------
+
+int softlist_parser::column() const
+{
+ return XML_GetCurrentColumnNumber(m_parser);
+}
+
+
+//-------------------------------------------------
+// parser_error
+//-------------------------------------------------
+
+const char *softlist_parser::parser_error() const
+{
+ return XML_ErrorString(XML_GetErrorCode(m_parser));
+}
+
+
//-------------------------------------------------
// parse_error - append a parsing error with
// filename, line and column information
@@ -799,7 +246,7 @@ template <typename Format, typename... Params>
inline void softlist_parser::parse_error(Format &&fmt, Params &&... args)
{
// always start with filename(line.column):
- util::stream_format(m_errors, "%s(%d.%d): ", filename(), line(), column());
+ util::stream_format(m_errors, "%s(%d.%d): ", m_filename, line(), column());
// append the remainder of the string
util::stream_format(m_errors, std::forward<Format>(fmt), std::forward<Params>(args)...);
@@ -894,17 +341,13 @@ void softlist_parser::add_rom_entry(std::string &&name, std::string &&hashdata,
// make sure we don't add duplicate regions
if (!name.empty() && (flags & ROMENTRY_TYPEMASK) == ROMENTRYTYPE_REGION)
+ {
for (auto &elem : m_current_part->m_romdata)
- if (!elem.name().empty() && elem.name() == name)
+ if (elem.name() == name)
parse_error("Duplicated dataarea %s in software %s", name, infoname());
+ }
- // create the new entry and append it
- m_current_part->m_romdata.emplace_back(
- std::move(name),
- std::move(hashdata),
- offset,
- length,
- flags);
+ m_current_part->m_romdata.emplace_back(std::move(name), std::move(hashdata), offset, length, flags);
}
@@ -986,7 +429,7 @@ void softlist_parser::end_handler(void *data, const char *name)
// data_handler - expat data handler
//-------------------------------------------------
-void softlist_parser::data_handler(void *data, const XML_Char *s, int len)
+void softlist_parser::data_handler(void *data, const char *s, int len)
{
softlist_parser *state = reinterpret_cast<softlist_parser *>(data);
@@ -1018,7 +461,7 @@ void softlist_parser::parse_root_start(const char *tagname, const char **attribu
const auto attrvalues = parse_attributes(attributes, attrnames);
if (!attrvalues[1].empty())
- m_list.m_description = attrvalues[1];
+ m_description = attrvalues[1];
}
else
unknown_tag(tagname);
@@ -1040,8 +483,8 @@ void softlist_parser::parse_main_start(const char *tagname, const char **attribu
if (!attrvalues[0].empty())
{
- m_list.m_infolist.emplace_back(m_list, std::move(attrvalues[0]), std::move(attrvalues[1]), attrvalues[2].c_str());
- m_current_info = &m_list.m_infolist.back();
+ m_infolist.emplace_back(std::move(attrvalues[0]), std::move(attrvalues[1]), attrvalues[2].c_str());
+ m_current_info = &m_infolist.back();
}
else
parse_error("No name defined for item");
@@ -1354,7 +797,7 @@ void softlist_parser::parse_soft_end(const char *tagname)
return;
// was any dataarea/rom information encountered? if so, add a terminator
- if (m_current_part->romdata() != nullptr)
+ if (!m_current_part->m_romdata.empty())
add_rom_entry("", "", 0, 0, ROMENTRYTYPE_END);
// get the info; if present, copy shared data (we assume name/value strings live
@@ -1364,3 +807,4 @@ void softlist_parser::parse_soft_end(const char *tagname)
m_current_part->m_featurelist.emplace_back(item.name(), item.value());
}
}
+
diff --git a/src/emu/softlist.h b/src/emu/softlist.h
index 9b6cfd829bf..6f3b69deaa7 100644
--- a/src/emu/softlist.h
+++ b/src/emu/softlist.h
@@ -4,15 +4,16 @@
softlist.h
- Software and software list information.
+ Software list file format.
*********************************************************************/
#ifndef __SOFTLIST_H_
#define __SOFTLIST_H_
-#include "cstrpool.h"
-
+#include <list>
+#include "romentry.h"
+#include "corefile.h"
//**************************************************************************
@@ -23,108 +24,13 @@
#define SOFTWARE_SUPPORTED_PARTIAL 1
#define SOFTWARE_SUPPORTED_NO 2
-enum softlist_type
-{
- SOFTWARE_LIST_ORIGINAL_SYSTEM,
- SOFTWARE_LIST_COMPATIBLE_SYSTEM
-};
-
-enum software_compatibility
-{
- SOFTWARE_IS_COMPATIBLE,
- SOFTWARE_IS_INCOMPATIBLE,
- SOFTWARE_NOT_COMPATIBLE
-};
-
-
-//**************************************************************************
-// MACROS
-//**************************************************************************
-
-#define MCFG_SOFTWARE_LIST_CONFIG(_list,_list_type) \
- software_list_device::static_set_type(*device, _list, _list_type);
-
-#define MCFG_SOFTWARE_LIST_ADD( _tag, _list ) \
- MCFG_DEVICE_ADD( _tag, SOFTWARE_LIST, 0 ) \
- MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
-
-#define MCFG_SOFTWARE_LIST_COMPATIBLE_ADD( _tag, _list ) \
- MCFG_DEVICE_ADD( _tag, SOFTWARE_LIST, 0 ) \
- MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
-
-#define MCFG_SOFTWARE_LIST_MODIFY( _tag, _list ) \
- MCFG_DEVICE_MODIFY( _tag ) \
- MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
-
-#define MCFG_SOFTWARE_LIST_COMPATIBLE_MODIFY( _tag, _list ) \
- MCFG_DEVICE_MODIFY( _tag ) \
- MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
-
-#define MCFG_SOFTWARE_LIST_FILTER( _tag, _filter ) \
- MCFG_DEVICE_MODIFY( _tag ) \
- software_list_device::static_set_filter(*device, _filter);
-
-#define MCFG_SOFTWARE_LIST_REMOVE( _tag ) \
- MCFG_DEVICE_REMOVE( _tag )
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-class rom_entry;
+struct XML_ParserStruct;
class software_info;
-class device_image_interface;
-class software_list_device;
-
-// ======================> software_list_loader
-
-class software_list_loader
-{
-public:
- virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const = 0;
-};
-
-
-// ======================> false_software_list_loader
-
-class false_software_list_loader : public software_list_loader
-{
-public:
- virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override;
- static const software_list_loader &instance() { return s_instance; }
-
-private:
- static false_software_list_loader s_instance;
-};
-
-
-// ======================> rom_software_list_loader
-
-class rom_software_list_loader : public software_list_loader
-{
-public:
- virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override;
- static const software_list_loader &instance() { return s_instance; }
-
-private:
- static rom_software_list_loader s_instance;
-};
-
-
-// ======================> image_software_list_loader
-
-class image_software_list_loader : public software_list_loader
-{
-public:
- virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override;
- static const software_list_loader &instance() { return s_instance; }
-
-private:
- static image_software_list_loader s_instance;
-};
-
// ======================> feature_list_item
@@ -174,13 +80,11 @@ public:
const std::string &name() const { return m_name; }
const std::string &interface() const { return m_interface; }
const std::list<feature_list_item> &featurelist() const { return m_featurelist; }
- const rom_entry *romdata(unsigned int index = 0) const { return (index < m_romdata.size()) ? &m_romdata[index] : nullptr; }
+ const std::vector<rom_entry> &romdata() const { return m_romdata; }
// helpers
- software_compatibility is_compatible(const software_list_device &swlist) const;
bool matches_interface(const char *interface) const;
const char *feature(const std::string &feature_name) const;
- device_image_interface *find_mountable_image(const machine_config &mconfig) const;
private:
// internal state
@@ -202,15 +106,13 @@ class software_info
public:
// construction/destruction
- software_info(software_list_device &list, std::string &&name, std::string &&parent, const char *supported);
+ software_info(std::string &&name, std::string &&parent, const std::string &supported);
software_info(software_info const &) = delete;
software_info(software_info &&) = delete;
software_info& operator=(software_info const &) = delete;
software_info& operator=(software_info &&) = delete;
// getters
- software_info *next() const { return m_next; }
- software_list_device &list() const { return m_list; }
const std::string &shortname() const { return m_shortname; }
const std::string &longname() const { return m_longname; }
const std::string &parentname() const { return m_parentname; }
@@ -222,13 +124,11 @@ public:
const std::list<software_part> &parts() const { return m_partdata; }
// additional operations
- const software_part *find_part(const char *partname, const char *interface = nullptr) const;
+ const software_part *find_part(const std::string &partname, const char *interface = nullptr) const;
bool has_multiple_parts(const char *interface) const;
private:
// internal state
- software_info * m_next;
- software_list_device & m_list;
UINT32 m_supported;
std::string m_shortname;
std::string m_longname;
@@ -242,74 +142,68 @@ private:
};
-// ======================> software_list_device
+// ======================> softlist_parser
-// device representing a software list
-class software_list_device : public device_t
+class softlist_parser
{
- friend class softlist_parser;
-
public:
- // construction/destruction
- software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ // construction (== execution)
+ softlist_parser(util::core_file &file, const std::string &filename, std::string &description, std::list<software_info> &infolist, std::ostringstream &errors);
- // inline configuration helpers
- static void static_set_type(device_t &device, const char *list, softlist_type list_type);
- static void static_set_filter(device_t &device, const char *filter);
+private:
+ enum parse_position
+ {
+ POS_ROOT,
+ POS_MAIN,
+ POS_SOFT,
+ POS_PART,
+ POS_DATA
+ };
+
+ // internal parsing helpers
+ const char *infoname() const { return (m_current_info != nullptr) ? m_current_info->shortname().c_str() : "???"; }
+ int line() const;
+ int column() const;
+ const char *parser_error() const;
+
+ // internal error helpers
+ template <typename Format, typename... Params> void parse_error(Format &&fmt, Params &&... args);
+ void unknown_tag(const char *tagname) { parse_error("Unknown tag: %s", tagname); }
+ void unknown_attribute(const char *attrname) { parse_error("Unknown attribute: %s", attrname); }
- // getters
- const char *list_name() const { return m_list_name.c_str(); }
- softlist_type list_type() const { return m_list_type; }
- const char *filter() const { return m_filter; }
- const char *filename() { return m_file.filename(); }
-
- // getters that may trigger a parse
- const char *description() { if (!m_parsed) parse(); return m_description.c_str(); }
- bool valid() { if (!m_parsed) parse(); return !m_infolist.empty(); }
- const char *errors_string() { if (!m_parsed) parse(); return m_errors.c_str(); }
- const std::list<software_info> &get_info() { if (!m_parsed) parse(); return m_infolist; }
-
- // operations
- const software_info *find(const char *look_for);
- void find_approx_matches(const char *name, int matches, const software_info **list, const char *interface);
- void release();
-
- // string pool helpers
- const char *add_string(const char *string) { return m_stringpool.add(string); }
-
- // static helpers
- static software_list_device *find_by_name(const machine_config &mconfig, const char *name);
- static void display_matches(const machine_config &config, const char *interface, const char *name);
-
-protected:
// internal helpers
- void parse();
- void internal_validity_check(validity_checker &valid) ATTR_COLD;
-
- // device-level overrides
- virtual void device_start() override;
- virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD;
-
- // configuration state
- std::string m_list_name;
- softlist_type m_list_type;
- const char * m_filter;
-
- // internal state
- bool m_parsed;
- emu_file m_file;
- std::string m_description;
- std::string m_errors;
- std::list<software_info> m_infolist;
- const_string_pool m_stringpool;
+ template <typename T> std::vector<std::string> parse_attributes(const char **attributes, const T &attrlist);
+ bool parse_name_and_value(const char **attributes, std::string &name, std::string &value);
+ void add_rom_entry(std::string &&name, std::string &&hashdata, UINT32 offset, UINT32 length, UINT32 flags);
+
+ // expat callbacks
+ static void start_handler(void *data, const char *tagname, const char **attributes);
+ static void data_handler(void *data, const char *s, int len);
+ static void end_handler(void *data, const char *name);
+
+ // internal parsing
+ void parse_root_start(const char *tagname, const char **attributes);
+ void parse_main_start(const char *tagname, const char **attributes);
+ void parse_soft_start(const char *tagname, const char **attributes);
+ void parse_part_start(const char *tagname, const char **attributes);
+ void parse_data_start(const char *tagname, const char **attributes);
+ void parse_soft_end(const char *name);
+
+ // internal parsing state
+ util::core_file & m_file;
+ std::string m_filename;
+ std::list<software_info> & m_infolist;
+ std::ostringstream & m_errors;
+ struct XML_ParserStruct * m_parser;
+ bool m_done;
+ std::string & m_description;
+ bool m_data_accum_expected;
+ std::string m_data_accum;
+ software_info * m_current_info;
+ software_part * m_current_part;
+ parse_position m_pos;
};
-// device type definition
-extern const device_type SOFTWARE_LIST;
-
-// device type iterator
-typedef device_type_iterator<&device_creator<software_list_device>, software_list_device> software_list_device_iterator;
-
+#endif // __SOFTLIST_H_
-#endif
diff --git a/src/emu/softlist_dev.cpp b/src/emu/softlist_dev.cpp
new file mode 100644
index 00000000000..ce6d96a24d2
--- /dev/null
+++ b/src/emu/softlist_dev.cpp
@@ -0,0 +1,523 @@
+// license:BSD-3-Clause
+// copyright-holders:Wilbert Pol
+/***************************************************************************
+
+ softlist_dev.cpp
+
+ Software list construction helpers.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "diimage.h"
+#include "softlist_dev.h"
+#include "validity.h"
+
+#include <ctype.h>
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+typedef std::unordered_map<std::string, const software_info *> softlist_map;
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// device type definition
+const device_type SOFTWARE_LIST = &device_creator<software_list_device>;
+false_software_list_loader false_software_list_loader::s_instance;
+rom_software_list_loader rom_software_list_loader::s_instance;
+image_software_list_loader image_software_list_loader::s_instance;
+
+
+//**************************************************************************
+// SOFTWARE LIST LOADER
+//**************************************************************************
+
+//-------------------------------------------------
+// false_software_list_loader::load_software
+//-------------------------------------------------
+
+bool false_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const
+{
+ return false;
+}
+
+
+//-------------------------------------------------
+// rom_software_list_loader::load_software
+//-------------------------------------------------
+
+bool rom_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const
+{
+ swlist.machine().rom_load().load_software_part_region(device, swlist, swname, start_entry);
+ return true;
+}
+
+
+//-------------------------------------------------
+// image_software_list_loader::load_software
+//-------------------------------------------------
+
+bool image_software_list_loader::load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const
+{
+ return device.load_software(swlist, swname, start_entry);
+}
+
+
+//**************************************************************************
+// SOFTWARE LIST DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// software_list_device - constructor
+//-------------------------------------------------
+
+software_list_device::software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, SOFTWARE_LIST, "Software list", tag, owner, clock, "software_list", __FILE__),
+ m_list_type(SOFTWARE_LIST_ORIGINAL_SYSTEM),
+ m_filter(nullptr),
+ m_parsed(false),
+ m_file(mconfig.options().hash_path(), OPEN_FLAG_READ),
+ m_description("")
+{
+}
+
+
+//-------------------------------------------------
+// static_set_type - configuration helper
+// to set the list type
+//-------------------------------------------------
+
+void software_list_device::static_set_type(device_t &device, const char *list, softlist_type list_type)
+{
+ software_list_device &swlistdev = downcast<software_list_device &>(device);
+ swlistdev.m_list_name.assign(list);
+ swlistdev.m_list_type = list_type;
+}
+
+
+//-------------------------------------------------
+// static_set_custom_handler - configuration
+// helper to set a custom callback
+//-------------------------------------------------
+
+void software_list_device::static_set_filter(device_t &device, const char *filter)
+{
+ downcast<software_list_device &>(device).m_filter = filter;
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void software_list_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// find_approx_matches - search ourselves for
+// a list of possible matches of the given name
+// and optional interface
+//-------------------------------------------------
+
+void software_list_device::find_approx_matches(const std::string &name, int matches, const software_info **list, const char *interface)
+{
+ // if no name, return
+ if (name.empty())
+ return;
+
+ // initialize everyone's states
+ std::vector<int> penalty(matches);
+ for (int matchnum = 0; matchnum < matches; matchnum++)
+ {
+ penalty[matchnum] = 9999;
+ list[matchnum] = nullptr;
+ }
+
+ // iterate over our info (will cause a parse if needed)
+ for (const software_info &swinfo : get_info())
+ {
+ const software_part &part = swinfo.parts().front();
+ if ((interface == nullptr || part.matches_interface(interface)) && is_compatible(part) == SOFTWARE_IS_COMPATIBLE)
+ {
+ // pick the best match between driver name and description
+ int longpenalty = driver_list::penalty_compare(name.c_str(), swinfo.longname().c_str());
+ int shortpenalty = driver_list::penalty_compare(name.c_str(), swinfo.shortname().c_str());
+ int curpenalty = std::min(longpenalty, shortpenalty);
+
+ // insert into the sorted table of matches
+ for (int matchnum = matches - 1; matchnum >= 0; matchnum--)
+ {
+ // stop if we're worse than the current entry
+ if (curpenalty >= penalty[matchnum])
+ break;
+
+ // as long as this isn't the last entry, bump this one down
+ if (matchnum < matches - 1)
+ {
+ penalty[matchnum + 1] = penalty[matchnum];
+ list[matchnum + 1] = list[matchnum];
+ }
+ list[matchnum] = &swinfo;
+ penalty[matchnum] = curpenalty;
+ }
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// release - reset to a pre-parsed state
+//-------------------------------------------------
+
+void software_list_device::release()
+{
+ osd_printf_verbose("Resetting %s\n", m_file.filename());
+ m_parsed = false;
+ m_description.clear();
+ m_errors.clear();
+ m_infolist.clear();
+}
+
+
+//-------------------------------------------------
+// find_by_name - find a software list by name
+// across all software list devices
+//-------------------------------------------------
+
+software_list_device *software_list_device::find_by_name(const machine_config &config, const std::string &name)
+{
+ // iterate over each device in the system and find a match
+ for (software_list_device &swlistdev : software_list_device_iterator(config.root_device()))
+ if (swlistdev.list_name() == name)
+ return &swlistdev;
+ return nullptr;
+}
+
+
+//-------------------------------------------------
+// software_display_matches - display a list of
+// possible matches in the system to the given
+// name, across all software list devices
+//-------------------------------------------------
+
+void software_list_device::display_matches(const machine_config &config, const char *interface, const std::string &name)
+{
+ // check if there is at least one software list
+ software_list_device_iterator deviter(config.root_device());
+ if (deviter.first() != nullptr)
+ osd_printf_error("\n\"%s\" approximately matches the following\n"
+ "supported software items (best match first):\n\n", name.c_str());
+
+ // iterate through lists
+ for (software_list_device &swlistdev : deviter)
+ {
+ // get the top 16 approximate matches for the selected device interface (i.e. only carts for cartslot, etc.)
+ const software_info *matches[16] = { nullptr };
+ swlistdev.find_approx_matches(name, ARRAY_LENGTH(matches), matches, interface);
+
+ // if we found some, print them
+ if (matches[0] != nullptr)
+ {
+ // different output depending on original system or compatible
+ if (swlistdev.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM)
+ osd_printf_error("* Software list \"%s\" (%s) matches: \n", swlistdev.list_name().c_str(), swlistdev.description().c_str());
+ else
+ osd_printf_error("* Compatible software list \"%s\" (%s) matches: \n", swlistdev.list_name().c_str(), swlistdev.description().c_str());
+
+ // print them out
+ for (auto &match : matches)
+ {
+ if (match != nullptr)
+ osd_printf_error("%-18s%s\n", match->shortname().c_str(), match->longname().c_str());
+ }
+
+ osd_printf_error("\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// find - find an item by name in the software
+// list, using wildcards and optionally starting
+// from an intermediate point
+//-------------------------------------------------
+
+const software_info *software_list_device::find(const std::string &look_for)
+{
+ // empty search returns nothing
+ if (look_for.empty())
+ return nullptr;
+
+ const bool iswild = look_for.find_first_of("*?") != std::string::npos;
+
+ // find a match (will cause a parse if needed when calling get_info)
+ const auto &info_list = get_info();
+ auto iter = std::find_if(
+ info_list.begin(),
+ info_list.end(),
+ [&](const software_info &info)
+ {
+ const char *shortname = info.shortname().c_str();
+ return (iswild && core_strwildcmp(look_for.c_str(), shortname) == 0)
+ || core_stricmp(look_for.c_str(), shortname) == 0;
+ });
+
+ return iter != info_list.end()
+ ? &*iter
+ : nullptr;
+}
+
+
+//-------------------------------------------------
+// parse - parse our softlist file
+//-------------------------------------------------
+
+void software_list_device::parse()
+{
+ // skip if done
+ if (m_parsed)
+ return;
+
+ // reset the errors
+ m_errors.clear();
+
+ // attempt to open the file
+ osd_file::error filerr = m_file.open(m_list_name.c_str(), ".xml");
+ if (filerr == osd_file::error::NONE)
+ {
+ // parse if no error
+ std::ostringstream errs;
+ softlist_parser parser(m_file, m_file.filename(), m_description, m_infolist, errs);
+ m_file.close();
+ m_errors = errs.str();
+ }
+ else
+ m_errors = string_format("Error opening file: %s\n", filename());
+
+ // indicate that we've been parsed
+ m_parsed = true;
+}
+
+
+//-------------------------------------------------
+// is_compatible - determine if we are compatible
+// with the given software_list_device
+//-------------------------------------------------
+
+software_compatibility software_list_device::is_compatible(const software_part &swpart) const
+{
+ // get the softlist filter; if null, assume compatible
+ if (m_filter == nullptr)
+ return SOFTWARE_IS_COMPATIBLE;
+
+ // copy the comma-delimited string and ensure it ends with a final comma
+ std::string filt = std::string(m_filter).append(",");
+
+ // get the incompatibility filter and test against it first if it exists
+ const char *incompatibility = swpart.feature("incompatibility");
+ if (incompatibility != nullptr)
+ {
+ // copy the comma-delimited string and ensure it ends with a final comma
+ std::string incomp = std::string(incompatibility).append(",");
+
+ // iterate over filter items and see if they exist in the list; if so, it's incompatible
+ for (int start = 0, end = filt.find_first_of(',', start); end != -1; start = end + 1, end = filt.find_first_of(',', start))
+ {
+ std::string token(filt, start, end - start + 1);
+ if (incomp.find(token) != -1)
+ return SOFTWARE_IS_INCOMPATIBLE;
+ }
+ }
+
+ // get the compatibility feature; if null, assume compatible
+ const char *compatibility = swpart.feature("compatibility");
+ if (compatibility == nullptr)
+ return SOFTWARE_IS_COMPATIBLE;
+
+ // copy the comma-delimited string and ensure it ends with a final comma
+ std::string comp = std::string(compatibility).append(",");
+
+ // iterate over filter items and see if they exist in the compatibility list; if so, it's compatible
+ for (int start = 0, end = filt.find_first_of(',', start); end != -1; start = end + 1, end = filt.find_first_of(',', start))
+ {
+ std::string token(filt, start, end - start + 1);
+ if (comp.find(token) != -1)
+ return SOFTWARE_IS_COMPATIBLE;
+ }
+ return SOFTWARE_NOT_COMPATIBLE;
+}
+
+
+//-------------------------------------------------
+// find_mountable_image - find an image interface
+// that can automatically mount this software part
+//-------------------------------------------------
+
+device_image_interface *software_list_device::find_mountable_image(const machine_config &mconfig, const software_part &part)
+{
+ // if automount="no", don't bother
+ const char *mount = part.feature("automount");
+ if (mount != nullptr && strcmp(mount, "no") == 0)
+ return nullptr;
+
+ for (device_image_interface &image : image_interface_iterator(mconfig.root_device()))
+ {
+ const char *interface = image.image_interface();
+ if (interface != nullptr && part.matches_interface(interface))
+ {
+ // mount only if not already mounted
+ const char *option = mconfig.options().value(image.brief_instance_name());
+ if (*option == '\0' && !image.filename())
+ return &image;
+ }
+ }
+ return nullptr;
+}
+
+
+//-------------------------------------------------
+// device_validity_check - validate the device
+// configuration
+//-------------------------------------------------
+
+void software_list_device::device_validity_check(validity_checker &valid) const
+{
+ // add to the global map whenever we check a list so we don't re-check
+ // it in the future
+ if (valid.already_checked(std::string("softlist/").append(m_list_name).c_str()))
+ return;
+
+ // do device validation only in case of validate command
+ if (!valid.validate_all())
+ return;
+
+ // actually do the validate
+ const_cast<software_list_device *>(this)->internal_validity_check(valid);
+}
+
+
+//-------------------------------------------------
+// internal_validity_check - internal helper to
+// check the list
+//-------------------------------------------------
+
+void software_list_device::internal_validity_check(validity_checker &valid)
+{
+ enum { NAME_LEN_PARENT = 8, NAME_LEN_CLONE = 16 };
+
+ softlist_map names;
+ softlist_map descriptions;
+ for (const software_info &swinfo : get_info())
+ {
+ // first parse and output core errors if any
+ if (m_errors.length() > 0)
+ {
+ osd_printf_error("%s: Errors parsing software list:\n%s", filename(), errors_string());
+ break;
+ }
+
+ // Now check if the xml data is valid:
+
+ // Did we lost any description?
+ if (swinfo.longname().empty())
+ {
+ osd_printf_error("%s: %s has no description\n", filename(), swinfo.shortname().c_str());
+ break;
+ }
+
+ // Did we lost any year?
+ if (swinfo.year().empty())
+ {
+ osd_printf_error("%s: %s has no year\n", filename(), swinfo.shortname().c_str());
+ break;
+ }
+
+ // Did we lost any publisher?
+ if (swinfo.publisher().empty())
+ {
+ osd_printf_error("%s: %s has no publisher\n", filename(), swinfo.shortname().c_str());
+ break;
+ }
+
+ // Did we lost the software parts?
+ if (swinfo.parts().empty())
+ {
+ osd_printf_error("%s: %s has no part\n", filename(), swinfo.shortname().c_str());
+ break;
+ }
+
+ // Second, since the xml is fine, run additional checks:
+
+ // check for duplicate names
+ if (!names.insert(std::make_pair(swinfo.shortname(), &swinfo)).second)
+ {
+ const software_info *match = names.find(swinfo.shortname())->second;
+ osd_printf_error("%s: %s is a duplicate name (%s)\n", filename(), swinfo.shortname().c_str(), match->shortname().c_str());
+ }
+
+ // check for duplicate descriptions
+ std::string longname = std::string(swinfo.longname());
+ if (!descriptions.insert(std::make_pair(strmakelower(longname), &swinfo)).second)
+ osd_printf_error("%s: %s is a duplicate description (%s)\n", filename(), swinfo.longname().c_str(), swinfo.shortname().c_str());
+
+ bool is_clone = false;
+ if (!swinfo.parentname().empty())
+ {
+ is_clone = true;
+ if (swinfo.parentname() == swinfo.shortname())
+ {
+ osd_printf_error("%s: %s is set as a clone of itself\n", filename(), swinfo.shortname().c_str());
+ break;
+ }
+
+ // make sure the parent exists
+ const software_info *swinfo2 = find(swinfo.parentname().c_str());
+
+ if (swinfo2 == nullptr)
+ osd_printf_error("%s: parent '%s' software for '%s' not found\n", filename(), swinfo.parentname().c_str(), swinfo.shortname().c_str());
+ else if (!swinfo2->parentname().empty())
+ osd_printf_error("%s: %s is a clone of a clone\n", filename(), swinfo.shortname().c_str());
+ }
+
+ // make sure the driver name is 8 chars or less
+ if ((is_clone && swinfo.shortname().length() > NAME_LEN_CLONE) || (!is_clone && swinfo.shortname().length() > NAME_LEN_PARENT))
+ osd_printf_error("%s: %s %s driver name must be %d characters or less\n", filename(), swinfo.shortname().c_str(),
+ is_clone ? "clone" : "parent", is_clone ? NAME_LEN_CLONE : NAME_LEN_PARENT);
+
+ // make sure the year is only digits, '?' or '+'
+ for (const char *s = swinfo.year().c_str(); *s != 0; s++)
+ if (!isdigit((UINT8)*s) && *s != '?' && *s != '+')
+ {
+ osd_printf_error("%s: %s has an invalid year '%s'\n", filename(), swinfo.shortname().c_str(), swinfo.year().c_str());
+ break;
+ }
+
+ softlist_map part_names;
+ for (const software_part &part : swinfo.parts())
+ {
+ if (part.interface().empty())
+ osd_printf_error("%s: %s has a part (%s) without interface\n", filename(), swinfo.shortname().c_str(), part.name().c_str());
+
+ if (part.romdata().empty())
+ osd_printf_error("%s: %s has a part (%s) with no data\n", filename(), swinfo.shortname().c_str(), part.name().c_str());
+
+ if (!part_names.insert(std::make_pair(part.name(), &swinfo)).second)
+ osd_printf_error("%s: %s has a part (%s) whose name is duplicate\n", filename(), swinfo.shortname().c_str(), part.name().c_str());
+ }
+ }
+
+ // release all the memory
+ release();
+}
+
+
diff --git a/src/emu/softlist_dev.h b/src/emu/softlist_dev.h
new file mode 100644
index 00000000000..c144c93bc4a
--- /dev/null
+++ b/src/emu/softlist_dev.h
@@ -0,0 +1,195 @@
+// license:BSD-3-Clause
+// copyright-holders:Wilbert Pol
+/*********************************************************************
+
+ softlist_dev.h
+
+ Software and software list information.
+
+*********************************************************************/
+
+#ifndef __SOFTLIST_DEV_H_
+#define __SOFTLIST_DEV_H_
+
+#include "softlist.h"
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+#define SOFTWARE_SUPPORTED_YES 0
+#define SOFTWARE_SUPPORTED_PARTIAL 1
+#define SOFTWARE_SUPPORTED_NO 2
+
+enum softlist_type
+{
+ SOFTWARE_LIST_ORIGINAL_SYSTEM,
+ SOFTWARE_LIST_COMPATIBLE_SYSTEM
+};
+
+enum software_compatibility
+{
+ SOFTWARE_IS_COMPATIBLE,
+ SOFTWARE_IS_INCOMPATIBLE,
+ SOFTWARE_NOT_COMPATIBLE
+};
+
+
+//**************************************************************************
+// MACROS
+//**************************************************************************
+
+#define MCFG_SOFTWARE_LIST_CONFIG(_list,_list_type) \
+ software_list_device::static_set_type(*device, _list, _list_type);
+
+#define MCFG_SOFTWARE_LIST_ADD( _tag, _list ) \
+ MCFG_DEVICE_ADD( _tag, SOFTWARE_LIST, 0 ) \
+ MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
+
+#define MCFG_SOFTWARE_LIST_COMPATIBLE_ADD( _tag, _list ) \
+ MCFG_DEVICE_ADD( _tag, SOFTWARE_LIST, 0 ) \
+ MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
+
+#define MCFG_SOFTWARE_LIST_MODIFY( _tag, _list ) \
+ MCFG_DEVICE_MODIFY( _tag ) \
+ MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_ORIGINAL_SYSTEM)
+
+#define MCFG_SOFTWARE_LIST_COMPATIBLE_MODIFY( _tag, _list ) \
+ MCFG_DEVICE_MODIFY( _tag ) \
+ MCFG_SOFTWARE_LIST_CONFIG(_list, SOFTWARE_LIST_COMPATIBLE_SYSTEM)
+
+#define MCFG_SOFTWARE_LIST_FILTER( _tag, _filter ) \
+ MCFG_DEVICE_MODIFY( _tag ) \
+ software_list_device::static_set_filter(*device, _filter);
+
+#define MCFG_SOFTWARE_LIST_REMOVE( _tag ) \
+ MCFG_DEVICE_REMOVE( _tag )
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class device_image_interface;
+class software_list_device;
+
+
+// ======================> software_list_loader
+
+class software_list_loader
+{
+public:
+ virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const = 0;
+};
+
+
+// ======================> false_software_list_loader
+
+class false_software_list_loader : public software_list_loader
+{
+public:
+ virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override;
+ static const software_list_loader &instance() { return s_instance; }
+
+private:
+ static false_software_list_loader s_instance;
+};
+
+
+// ======================> rom_software_list_loader
+
+class rom_software_list_loader : public software_list_loader
+{
+public:
+ virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override;
+ static const software_list_loader &instance() { return s_instance; }
+
+private:
+ static rom_software_list_loader s_instance;
+};
+
+
+// ======================> image_software_list_loader
+
+class image_software_list_loader : public software_list_loader
+{
+public:
+ virtual bool load_software(device_image_interface &device, software_list_device &swlist, const char *swname, const rom_entry *start_entry) const override;
+ static const software_list_loader &instance() { return s_instance; }
+
+private:
+ static image_software_list_loader s_instance;
+};
+
+
+// ======================> software_list_device
+
+// device representing a software list
+class software_list_device : public device_t
+{
+ friend class softlist_parser;
+
+public:
+ // construction/destruction
+ software_list_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // inline configuration helpers
+ static void static_set_type(device_t &device, const char *list, softlist_type list_type);
+ static void static_set_filter(device_t &device, const char *filter);
+
+ // getters
+ const std::string &list_name() const { return m_list_name; }
+ softlist_type list_type() const { return m_list_type; }
+ const char *filter() const { return m_filter; }
+ const char *filename() { return m_file.filename(); }
+
+ // getters that may trigger a parse
+ const std::string &description() { if (!m_parsed) parse(); return m_description; }
+ bool valid() { if (!m_parsed) parse(); return !m_infolist.empty(); }
+ const char *errors_string() { if (!m_parsed) parse(); return m_errors.c_str(); }
+ const std::list<software_info> &get_info() { if (!m_parsed) parse(); return m_infolist; }
+
+ // operations
+ const software_info *find(const std::string &look_for);
+ void find_approx_matches(const std::string &name, int matches, const software_info **list, const char *interface);
+ void release();
+ software_compatibility is_compatible(const software_part &part) const;
+
+ // static helpers
+ static software_list_device *find_by_name(const machine_config &mconfig, const std::string &name);
+ static void display_matches(const machine_config &config, const char *interface, const std::string &name);
+ static device_image_interface *find_mountable_image(const machine_config &mconfig, const software_part &part);
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_validity_check(validity_checker &valid) const override ATTR_COLD;
+
+private:
+ // internal helpers
+ void parse();
+ void internal_validity_check(validity_checker &valid) ATTR_COLD;
+
+ // configuration state
+ std::string m_list_name;
+ softlist_type m_list_type;
+ const char * m_filter;
+
+ // internal state
+ bool m_parsed;
+ emu_file m_file;
+ std::string m_description;
+ std::string m_errors;
+ std::list<software_info> m_infolist;
+};
+
+
+// device type definition
+extern const device_type SOFTWARE_LIST;
+
+// device type iterator
+typedef device_type_iterator<&device_creator<software_list_device>, software_list_device> software_list_device_iterator;
+
+
+#endif // __SOFTLIST_DEV_H_
diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp
index 9dfc99940f2..6adb5539747 100644
--- a/src/frontend/mame/audit.cpp
+++ b/src/frontend/mame/audit.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles
/***************************************************************************
- audit.c
+ audit.cpp
ROM set auditing functions.
@@ -14,7 +14,8 @@
#include "chd.h"
#include "drivenum.h"
#include "sound/samples.h"
-#include "softlist.h"
+#include "softlist_dev.h"
+
//**************************************************************************
// CORE FUNCTIONS
@@ -149,7 +150,7 @@ media_auditor::summary media_auditor::audit_device(device_t &device, const char
//-------------------------------------------------
// audit_software
//-------------------------------------------------
-media_auditor::summary media_auditor::audit_software(const char *list_name, const software_info *swinfo, const char *validation)
+media_auditor::summary media_auditor::audit_software(const std::string &list_name, const software_info *swinfo, const char *validation)
{
// start fresh
m_record_list.clear();
@@ -171,7 +172,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, cons
// now iterate over software parts
for (const software_part &part : swinfo->parts())
- audit_regions(part.romdata(), locationtag.c_str(), found, required);
+ audit_regions(part.romdata().data(), locationtag.c_str(), found, required);
if ((found == 0) && (required > 0))
{
@@ -180,7 +181,7 @@ media_auditor::summary media_auditor::audit_software(const char *list_name, cons
}
// return a summary
- return summarize(list_name);
+ return summarize(list_name.c_str());
}
diff --git a/src/frontend/mame/audit.h b/src/frontend/mame/audit.h
index 1999fb229fa..9e0e131e2ca 100644
--- a/src/frontend/mame/audit.h
+++ b/src/frontend/mame/audit.h
@@ -158,7 +158,7 @@ public:
// audit operations
summary audit_media(const char *validation = AUDIT_VALIDATE_FULL);
summary audit_device(device_t &device, const char *validation = AUDIT_VALIDATE_FULL);
- summary audit_software(const char *list_name, const software_info *swinfo, const char *validation = AUDIT_VALIDATE_FULL);
+ summary audit_software(const std::string &list_name, const software_info *swinfo, const char *validation = AUDIT_VALIDATE_FULL);
summary audit_samples();
summary summarize(const char *name, std::ostream *output = nullptr) const;
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 2ce5a6a5581..a274326fac2 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -25,7 +25,7 @@
#include "drivenum.h"
#include "osdepend.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include "ui/moptions.h"
#include "language.h"
@@ -374,7 +374,7 @@ int media_identifier::find_by_hash(const util::hash_collection &hashes, int leng
{
for (const software_info &swinfo : swlistdev.get_info())
for (const software_part &part : swinfo.parts())
- for (const rom_entry *region = part.romdata(); region != nullptr; region = rom_next_region(region))
+ for (const rom_entry *region = part.romdata().data(); region != nullptr; region = rom_next_region(region))
for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom))
{
util::hash_collection romhashes(ROM_GETHASHDATA(rom));
@@ -385,7 +385,7 @@ int media_identifier::find_by_hash(const util::hash_collection &hashes, int leng
// output information about the match
if (found)
osd_printf_info(" ");
- osd_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlistdev.list_name(), swinfo.shortname().c_str(), swinfo.longname().c_str());
+ osd_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlistdev.list_name().c_str(), swinfo.shortname().c_str(), swinfo.longname().c_str());
found++;
}
}
@@ -527,9 +527,9 @@ int cli_frontend::execute(int argc, char **argv)
for (const software_part &swpart : swinfo->parts())
{
// only load compatible software this way
- if (swpart.is_compatible(swlistdev) == SOFTWARE_IS_COMPATIBLE)
+ if (swlistdev.is_compatible(swpart) == SOFTWARE_IS_COMPATIBLE)
{
- device_image_interface *image = swpart.find_mountable_image(config);
+ device_image_interface *image = software_list_device::find_mountable_image(config, swpart);
if (image != nullptr)
{
std::string val = string_format("%s:%s:%s", swlistdev.list_name(), m_options.software_name(), swpart.name());
@@ -1387,7 +1387,7 @@ void cli_frontend::verifysamples(const char *gamename)
void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlistdev)
{
- fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name(), xml_normalize_string(swlistdev.description()));
+ fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name().c_str(), xml_normalize_string(swlistdev.description().c_str()));
for (const software_info &swinfo : swlistdev.get_info())
{
fprintf(out, "\t\t<software name=\"%s\"", swinfo.shortname().c_str());
@@ -1417,7 +1417,7 @@ void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlis
fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name().c_str(), xml_normalize_string(flist.value().c_str()));
/* TODO: display rom region information */
- for (const rom_entry *region = part.romdata(); region; region = rom_next_region(region))
+ for (const rom_entry *region = part.romdata().data(); region; region = rom_next_region(region))
{
int is_disk = ROMREGION_ISDISKDATA(region);
@@ -1626,7 +1626,7 @@ void cli_frontend::getsoftlist(const char *gamename)
while (drivlist.next())
{
for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config().root_device()))
- if (core_strwildcmp(gamename, swlistdev.list_name()) == 0 && list_map.insert(swlistdev.list_name()).second)
+ if (core_strwildcmp(gamename, swlistdev.list_name().c_str()) == 0 && list_map.insert(swlistdev.list_name()).second)
if (!swlistdev.get_info().empty())
{
if (isfirst) { fprintf( out, SOFTLIST_XML_BEGIN); isfirst = false; }
@@ -1660,7 +1660,7 @@ void cli_frontend::verifysoftlist(const char *gamename)
{
for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config().root_device()))
{
- if (core_strwildcmp(gamename, swlistdev.list_name()) == 0 && list_map.insert(swlistdev.list_name()).second)
+ if (core_strwildcmp(gamename, swlistdev.list_name().c_str()) == 0 && list_map.insert(swlistdev.list_name()).second)
{
if (!swlistdev.get_info().empty())
{
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp
index 6431517163b..1d1468643c6 100644
--- a/src/frontend/mame/info.cpp
+++ b/src/frontend/mame/info.cpp
@@ -16,7 +16,7 @@
#include "xmlfile.h"
#include "config.h"
#include "drivenum.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include <ctype.h>
@@ -579,8 +579,7 @@ void info_xml_creator::output_rom(device_t &device)
if (!is_disk && is_bios)
{
// scan backwards through the ROM entries
- auto entries = rom_build_entries(m_drivlist.driver().rom);
- for (const rom_entry *brom = entries.data(); !ROMENTRY_ISEND(brom); brom++)
+ for (const rom_entry *brom = rom - 1; brom != device.rom_region(); brom--)
if (ROMENTRY_ISSYSTEM_BIOS(brom))
{
strcpy(bios_name, ROM_GETNAME(brom));
@@ -1564,7 +1563,7 @@ void info_xml_creator::output_software_list()
{
for (const software_list_device &swlist : software_list_device_iterator(m_drivlist.config().root_device()))
{
- fprintf(m_output, "\t\t<softwarelist name=\"%s\" ", swlist.list_name());
+ fprintf(m_output, "\t\t<softwarelist name=\"%s\" ", swlist.list_name().c_str());
fprintf(m_output, "status=\"%s\" ", (swlist.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM) ? "original" : "compatible");
if (swlist.filter())
fprintf(m_output, "filter=\"%s\" ", swlist.filter());
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
index 83a077cec86..0ccda19620e 100644
--- a/src/frontend/mame/luaengine.cpp
+++ b/src/frontend/mame/luaengine.cpp
@@ -2395,10 +2395,6 @@ void lua_engine::initialize()
.addFunction ("select_next_state", &cheat_entry::select_next_state)
.endClass()
.beginClass <ioport_manager> ("ioport")
- .addFunction ("has_configs", &ioport_manager::has_configs)
- .addFunction ("has_analog", &ioport_manager::has_analog)
- .addFunction ("has_dips", &ioport_manager::has_dips)
- .addFunction ("has_bioses", &ioport_manager::has_bioses)
.addFunction ("has_keyboard", &ioport_manager::has_keyboard)
.addFunction ("count_players", &ioport_manager::count_players)
.addProperty <luabridge::LuaRef, void> ("ports", &lua_engine::l_ioport_get_ports)
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp
index c64b8fd7ebc..9b1150a9590 100644
--- a/src/frontend/mame/mameopts.cpp
+++ b/src/frontend/mame/mameopts.cpp
@@ -11,7 +11,7 @@
#include "emu.h"
#include "mameopts.h"
#include "drivenum.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include <ctype.h>
diff --git a/src/frontend/mame/ui/imgcntrl.cpp b/src/frontend/mame/ui/imgcntrl.cpp
index 0fabfc57d5d..59e20eb1cee 100644
--- a/src/frontend/mame/ui/imgcntrl.cpp
+++ b/src/frontend/mame/ui/imgcntrl.cpp
@@ -20,7 +20,7 @@
#include "audit.h"
#include "drivenum.h"
#include "emuopts.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include "zippath.h"
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 9461f566d71..1048ac426ce 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -13,9 +13,328 @@
#include "ui/info.h"
#include "ui/ui.h"
+#include "drivenum.h"
#include "softlist.h"
namespace ui {
+
+
+//-------------------------------------------------
+// machine_info - constructor
+//-------------------------------------------------
+
+machine_info::machine_info(running_machine &machine)
+ : m_machine(machine)
+{
+ // calculate "has..." values
+ m_has_configs = false;
+ m_has_analog = false;
+ m_has_dips = false;
+ m_has_bioses = false;
+
+ // scan the input port array to see what options we need to enable
+ for (auto &port : machine.ioport().ports())
+ for (ioport_field &field : port.second->fields())
+ {
+ if (field.type() == IPT_DIPSWITCH)
+ m_has_dips = true;
+ if (field.type() == IPT_CONFIG)
+ m_has_configs = true;
+ if (field.is_analog())
+ m_has_analog = true;
+ }
+
+ for (device_t &device : device_iterator(machine.root_device()))
+ for (const rom_entry &rom : device.rom_region_vector())
+ if (ROMENTRY_ISSYSTEM_BIOS(&rom)) { m_has_bioses = true; break; }
+}
+
+
+/***************************************************************************
+ TEXT GENERATORS
+***************************************************************************/
+
+//-------------------------------------------------
+// warnings_string - print the warning flags
+// text to the given buffer
+//-------------------------------------------------
+
+std::string machine_info::warnings_string()
+{
+ constexpr UINT32 warning_flags = ( MACHINE_NOT_WORKING |
+ MACHINE_UNEMULATED_PROTECTION |
+ MACHINE_MECHANICAL |
+ MACHINE_WRONG_COLORS |
+ MACHINE_IMPERFECT_COLORS |
+ MACHINE_REQUIRES_ARTWORK |
+ MACHINE_NO_SOUND |
+ MACHINE_IMPERFECT_SOUND |
+ MACHINE_IMPERFECT_GRAPHICS |
+ MACHINE_IMPERFECT_KEYBOARD |
+ MACHINE_NO_COCKTAIL |
+ MACHINE_IS_INCOMPLETE |
+ MACHINE_NO_SOUND_HW );
+
+ // if no warnings, nothing to return
+ if (m_machine.rom_load().warnings() == 0 && m_machine.rom_load().knownbad() == 0 && !(m_machine.system().flags & warning_flags) && m_machine.rom_load().software_load_warnings_message().length() == 0)
+ return std::string();
+
+ std::ostringstream buf;
+
+ // add a warning if any ROMs were loaded with warnings
+ if (m_machine.rom_load().warnings() > 0)
+ {
+ buf << _("One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n");
+ if (m_machine.system().flags & warning_flags)
+ buf << "\n";
+ }
+
+ if (m_machine.rom_load().software_load_warnings_message().length()>0) {
+ buf << m_machine.rom_load().software_load_warnings_message();
+ if (m_machine.system().flags & warning_flags)
+ buf << "\n";
+ }
+ // if we have at least one warning flag, print the general header
+ if ((m_machine.system().flags & warning_flags) || m_machine.rom_load().knownbad() > 0)
+ {
+ buf << _("There are known problems with this machine\n\n");
+
+ // add a warning if any ROMs are flagged BAD_DUMP/NO_DUMP
+ if (m_machine.rom_load().knownbad() > 0) {
+ buf << _("One or more ROMs/CHDs for this machine have not been correctly dumped.\n");
+ }
+ // add one line per warning flag
+ if (m_machine.system().flags & MACHINE_IMPERFECT_KEYBOARD)
+ buf << _("The keyboard emulation may not be 100% accurate.\n");
+ if (m_machine.system().flags & MACHINE_IMPERFECT_COLORS)
+ buf << _("The colors aren't 100% accurate.\n");
+ if (m_machine.system().flags & MACHINE_WRONG_COLORS)
+ buf << _("The colors are completely wrong.\n");
+ if (m_machine.system().flags & MACHINE_IMPERFECT_GRAPHICS)
+ buf << _("The video emulation isn't 100% accurate.\n");
+ if (m_machine.system().flags & MACHINE_IMPERFECT_SOUND)
+ buf << _("The sound emulation isn't 100% accurate.\n");
+ if (m_machine.system().flags & MACHINE_NO_SOUND) {
+ buf << _("The machine lacks sound.\n");
+ }
+ if (m_machine.system().flags & MACHINE_NO_COCKTAIL)
+ buf << _("Screen flipping in cocktail mode is not supported.\n");
+
+ // check if external artwork is present before displaying this warning?
+ if (m_machine.system().flags & MACHINE_REQUIRES_ARTWORK) {
+ buf << _("The machine requires external artwork files\n");
+ }
+
+ if (m_machine.system().flags & MACHINE_IS_INCOMPLETE )
+ {
+ buf << _("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n");
+ }
+
+ if (m_machine.system().flags & MACHINE_NO_SOUND_HW )
+ {
+ buf << _("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n");
+ }
+
+ // if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger
+ if (m_machine.system().flags & (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL))
+ {
+ // add the strings for these warnings
+ if (m_machine.system().flags & MACHINE_UNEMULATED_PROTECTION) {
+ buf << _("The machine has protection which isn't fully emulated.\n");
+ }
+ if (m_machine.system().flags & MACHINE_NOT_WORKING) {
+ buf << _("\nTHIS MACHINE DOESN'T WORK. The emulation for this machine is not yet complete. "
+ "There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
+ }
+ if (m_machine.system().flags & MACHINE_MECHANICAL) {
+ buf << _("\nCertain elements of this machine cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
+ "It is not possible to fully play this machine.\n");
+ }
+
+ // find the parent of this driver
+ driver_enumerator drivlist(m_machine.options());
+ int maindrv = drivlist.find(m_machine.system());
+ int clone_of = drivlist.non_bios_clone(maindrv);
+ if (clone_of != -1)
+ maindrv = clone_of;
+
+ // scan the driver list for any working clones and add them
+ bool foundworking = false;
+ while (drivlist.next())
+ if (drivlist.current() == maindrv || drivlist.clone() == maindrv)
+ if ((drivlist.driver().flags & (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL)) == 0)
+ {
+ // this one works, add a header and display the name of the clone
+ if (!foundworking) {
+ buf << _("\n\nThere are working clones of this machine: ");
+ }
+ else
+ buf << ", ";
+ buf << drivlist.driver().name;
+ foundworking = true;
+ }
+
+ if (foundworking)
+ buf << "\n";
+ }
+ }
+
+ // add the 'press OK' string
+ buf << _("\n\nPress any key to continue");
+ return buf.str();
+}
+
+
+//-------------------------------------------------
+// game_info_string - return the game info text
+//-------------------------------------------------
+
+std::string machine_info::game_info_string()
+{
+ std::ostringstream buf;
+
+ // print description, manufacturer, and CPU:
+ util::stream_format(buf, _("%1$s\n%2$s %3$s\nDriver: %4$s\n\nCPU:\n"),
+ m_machine.system().description,
+ m_machine.system().year,
+ m_machine.system().manufacturer,
+ core_filename_extract_base(m_machine.system().source_file));
+
+ // loop over all CPUs
+ execute_interface_iterator execiter(m_machine.root_device());
+ std::unordered_set<std::string> exectags;
+ for (device_execute_interface &exec : execiter)
+ {
+ if (!exectags.insert(exec.device().tag()).second)
+ continue;
+ // get cpu specific clock that takes internal multiplier/dividers into account
+ int clock = exec.device().clock();
+
+ // count how many identical CPUs we have
+ int count = 1;
+ const char *name = exec.device().name();
+ for (device_execute_interface &scan : execiter)
+ {
+ if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && exec.device().clock() == scan.device().clock())
+ if (exectags.insert(scan.device().tag()).second)
+ count++;
+ }
+
+ // if more than one, prepend a #x in front of the CPU name
+ // display clock in kHz or MHz
+ util::stream_format(buf,
+ (count > 1) ? "%1$d" UTF8_MULTIPLY "%2$s %3$d.%4$0*5$d%6$s\n" : "%2$s %3$d.%4$0*5$d%6$s\n",
+ count,
+ name,
+ (clock >= 1000000) ? (clock / 1000000) : (clock / 1000),
+ (clock >= 1000000) ? (clock % 1000000) : (clock % 1000),
+ (clock >= 1000000) ? 6 : 3,
+ (clock >= 1000000) ? _("MHz") : _("kHz"));
+ }
+
+ // loop over all sound chips
+ sound_interface_iterator snditer(m_machine.root_device());
+ std::unordered_set<std::string> soundtags;
+ bool found_sound = false;
+ for (device_sound_interface &sound : snditer)
+ {
+ if (!soundtags.insert(sound.device().tag()).second)
+ continue;
+
+ // append the Sound: string
+ if (!found_sound)
+ buf << _("\nSound:\n");
+ found_sound = true;
+
+ // count how many identical sound chips we have
+ int count = 1;
+ for (device_sound_interface &scan : snditer)
+ {
+ if (sound.device().type() == scan.device().type() && sound.device().clock() == scan.device().clock())
+ if (soundtags.insert(scan.device().tag()).second)
+ count++;
+ }
+
+ // if more than one, prepend a #x in front of the CPU name
+ // display clock in kHz or MHz
+ int clock = sound.device().clock();
+ util::stream_format(buf,
+ (count > 1)
+ ? ((clock != 0) ? "%1$d" UTF8_MULTIPLY "%2$s %3$d.%4$0*5$d%6$s\n" : "%1$d" UTF8_MULTIPLY "%2$s\n")
+ : ((clock != 0) ? "%2$s %3$d.%4$0*5$d%6$s\n" : "%2$s\n"),
+ count,
+ sound.device().name(),
+ (clock >= 1000000) ? (clock / 1000000) : (clock / 1000),
+ (clock >= 1000000) ? (clock % 1000000) : (clock % 1000),
+ (clock >= 1000000) ? 6 : 3,
+ (clock >= 1000000) ? _("MHz") : _("kHz"));
+ }
+
+ // display screen information
+ buf << _("\nVideo:\n");
+ screen_device_iterator scriter(m_machine.root_device());
+ int scrcount = scriter.count();
+ if (scrcount == 0)
+ buf << _("None\n");
+ else
+ {
+ for (screen_device &screen : scriter)
+ {
+ std::string detail;
+ if (screen.screen_type() == SCREEN_TYPE_VECTOR)
+ detail = _("Vector");
+ else
+ {
+ const rectangle &visarea = screen.visible_area();
+ detail = string_format("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz",
+ visarea.width(), visarea.height(),
+ (m_machine.system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
+ ATTOSECONDS_TO_HZ(screen.frame_period().attoseconds()));
+ }
+
+ util::stream_format(buf,
+ (scrcount > 1) ? _("%1$s: %2$s\n") : _("%2$s\n"),
+ get_screen_desc(screen), detail);
+ }
+ }
+
+ return buf.str();
+}
+
+
+//-------------------------------------------------
+// mandatory_images - search for devices which
+// need an image to be loaded
+//-------------------------------------------------
+
+std::string machine_info::mandatory_images()
+{
+ std::ostringstream buf;
+
+ // make sure that any required image has a mounted file
+ for (device_image_interface &image : image_interface_iterator(m_machine.root_device()))
+ {
+ if (image.filename() == nullptr && image.must_be_loaded())
+ buf << "\"" << image.instance_name() << "\", ";
+ }
+ return buf.str();
+}
+
+
+//-------------------------------------------------
+// get_screen_desc - returns the description for
+// a given screen
+//-------------------------------------------------
+
+std::string machine_info::get_screen_desc(screen_device &screen)
+{
+ if (screen_device_iterator(m_machine.root_device()).count() > 1)
+ return string_format(_("Screen '%1$s'"), screen.tag());
+ else
+ return _("Screen");
+}
+
+
/*-------------------------------------------------
menu_game_info - handle the game information
menu
@@ -31,8 +350,8 @@ menu_game_info::~menu_game_info()
void menu_game_info::populate()
{
- std::string tempstring;
- item_append(ui().game_info_astring(tempstring), "", FLAG_MULTILINE, nullptr);
+ std::string tempstring = ui().machine_info().game_info_string();
+ item_append(std::move(tempstring), "", FLAG_MULTILINE, nullptr);
}
void menu_game_info::handle()
diff --git a/src/frontend/mame/ui/info.h b/src/frontend/mame/ui/info.h
index 2fbd9de3683..8a1d339dc73 100644
--- a/src/frontend/mame/ui/info.h
+++ b/src/frontend/mame/ui/info.h
@@ -16,6 +16,36 @@
#include "ui/menu.h"
namespace ui {
+
+class machine_info
+{
+public:
+ // construction
+ machine_info(running_machine &machine);
+
+ // has... getters
+ bool has_configs() const { return m_has_configs; }
+ bool has_analog() const { return m_has_analog; }
+ bool has_dips() const { return m_has_dips; }
+ bool has_bioses() const { return m_has_bioses; }
+
+ // text generators
+ std::string warnings_string();
+ std::string game_info_string();
+ std::string mandatory_images();
+ std::string get_screen_desc(screen_device &screen);
+
+private:
+ // reference to machine
+ running_machine & m_machine;
+
+ // has...
+ bool m_has_configs;
+ bool m_has_analog;
+ bool m_has_dips;
+ bool m_has_bioses;
+};
+
class menu_game_info : public menu
{
public:
diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp
index c9b99153522..e1bf2604733 100644
--- a/src/frontend/mame/ui/inifile.cpp
+++ b/src/frontend/mame/ui/inifile.cpp
@@ -11,7 +11,7 @@
#include "emu.h"
#include "ui/moptions.h"
#include "ui/inifile.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include "drivenum.h"
//-------------------------------------------------
diff --git a/src/frontend/mame/ui/mainmenu.cpp b/src/frontend/mame/ui/mainmenu.cpp
index 3bf5e5cb7b6..92d7db18d4c 100644
--- a/src/frontend/mame/ui/mainmenu.cpp
+++ b/src/frontend/mame/ui/mainmenu.cpp
@@ -56,11 +56,11 @@ void menu_main::populate()
item_append(_("Input (this Machine)"), "", 0, (void *)INPUT_SPECIFIC);
/* add optional input-related menus */
- if (machine().ioport().has_analog())
+ if (ui().machine_info().has_analog())
item_append(_("Analog Controls"), "", 0, (void *)ANALOG);
- if (machine().ioport().has_dips())
+ if (ui().machine_info().has_dips())
item_append(_("Dip Switches"), "", 0, (void *)SETTINGS_DIP_SWITCHES);
- if (machine().ioport().has_configs())
+ if (ui().machine_info().has_configs())
{
item_append(_("Machine Configuration"), "", 0, (void *)SETTINGS_DRIVER_CONFIG);
}
@@ -92,7 +92,7 @@ void menu_main::populate()
if (pty_interface_iterator(machine().root_device()).first() != nullptr)
item_append(_("Pseudo terminals"), "", 0, (void *)PTY_INFO);
- if (machine().ioport().has_bioses())
+ if (ui().machine_info().has_bioses())
item_append(_("Bios Selection"), "", 0, (void *)BIOS_SELECTION);
/* add slot info menu */
diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp
index 0191b5d7fea..3da9d91ee4e 100644
--- a/src/frontend/mame/ui/miscmenu.cpp
+++ b/src/frontend/mame/ui/miscmenu.cpp
@@ -78,7 +78,7 @@ void menu_bios_selection::populate()
/* cycle through all devices for this system */
for (device_t &device : device_iterator(machine().root_device()))
{
- if (device.rom_region())
+ if (device.rom_region() != nullptr && !ROMENTRY_ISEND(device.rom_region()))
{
const char *val = "default";
for (const rom_entry *rom = device.rom_region(); !ROMENTRY_ISEND(rom); rom++)
diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp
index bbfb0937f18..7357d3f66c2 100644
--- a/src/frontend/mame/ui/selgame.cpp
+++ b/src/frontend/mame/ui/selgame.cpp
@@ -31,7 +31,7 @@
#include "mame.h"
#include "rendfont.h"
#include "rendutil.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include "uiinput.h"
extern const char UI_VERSION_TAG[];
diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp
index baf1e17ba24..858a29e36fe 100644
--- a/src/frontend/mame/ui/selsoft.cpp
+++ b/src/frontend/mame/ui/selsoft.cpp
@@ -24,7 +24,7 @@
#include "mame.h"
#include "rendfont.h"
#include "rendutil.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#include "uiinput.h"
@@ -530,7 +530,7 @@ void menu_select_software::build_software_list()
for (const software_info &swinfo : swlist.get_info())
{
const software_part &part = swinfo.parts().front();
- if (part.is_compatible(swlist) == SOFTWARE_IS_COMPATIBLE)
+ if (swlist.is_compatible(part) == SOFTWARE_IS_COMPATIBLE)
{
const char *instance_name = nullptr;
const char *type_name = nullptr;
@@ -562,7 +562,7 @@ void menu_select_software::build_software_list()
tmpmatches.supported = swinfo.supported();
tmpmatches.part = part.name();
tmpmatches.driver = m_driver;
- tmpmatches.listname = strensure(swlist.list_name());
+ tmpmatches.listname = swlist.list_name();
tmpmatches.interface = part.interface();
tmpmatches.startempty = 0;
tmpmatches.parentlongname.clear();
diff --git a/src/frontend/mame/ui/swlist.cpp b/src/frontend/mame/ui/swlist.cpp
index babe5690f75..6126f433e39 100644
--- a/src/frontend/mame/ui/swlist.cpp
+++ b/src/frontend/mame/ui/swlist.cpp
@@ -14,7 +14,7 @@
#include "ui/swlist.h"
#include "ui/utils.h"
-#include "softlist.h"
+#include "softlist_dev.h"
namespace ui {
@@ -186,7 +186,7 @@ void menu_software_list::append_software_entry(const software_info &swinfo)
// check if at least one of the parts has the correct interface and add a menu entry only in this case
for (const software_part &swpart : swinfo.parts())
{
- if (swpart.matches_interface(m_interface) && swpart.is_compatible(*m_swlist) == SOFTWARE_IS_COMPATIBLE)
+ if (swpart.matches_interface(m_interface) && m_swlist->is_compatible(swpart) == SOFTWARE_IS_COMPATIBLE)
{
entry_updated = true;
entry.short_name.assign(swinfo.shortname());
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 7394f03be2f..5c7f4a54a39 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -21,13 +21,13 @@
#include "rendfont.h"
#include "uiinput.h"
#include "ui/ui.h"
+#include "ui/info.h"
#include "ui/menu.h"
#include "ui/mainmenu.h"
#include "ui/filemngr.h"
#include "ui/sliders.h"
#include "ui/viewgfx.h"
#include "imagedev/cassette.h"
-#include "image.h"
/***************************************************************************
@@ -186,6 +186,10 @@ mame_ui_manager::mame_ui_manager(running_machine &machine)
{
}
+mame_ui_manager::~mame_ui_manager()
+{
+}
+
void mame_ui_manager::init()
{
load_ui_options();
@@ -240,6 +244,8 @@ void mame_ui_manager::exit()
void mame_ui_manager::initialize(running_machine &machine)
{
+ m_machine_info = std::make_unique<ui::machine_info>(machine);
+
// initialize the on-screen display system
slider_list = slider_init(machine);
if (slider_list.size() > 0)
@@ -295,12 +301,15 @@ void mame_ui_manager::display_startup_screens(bool first_time)
{
// default to standard colors
messagebox_backcolor = UI_BACKGROUND_COLOR;
+ messagebox_text.clear();
// pick the next state
switch (state)
{
case 0:
- if (show_warnings && warnings_string(messagebox_text).length() > 0)
+ if (show_warnings)
+ messagebox_text = machine_info().warnings_string();
+ if (!messagebox_text.empty())
{
set_handler(ui_callback_type::MODAL, std::bind(&mame_ui_manager::handler_messagebox_anykey, this, _1));
if (machine().system().flags & (MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_COLORS | MACHINE_REQUIRES_ARTWORK | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_KEYBOARD | MACHINE_NO_SOUND))
@@ -311,12 +320,16 @@ void mame_ui_manager::display_startup_screens(bool first_time)
break;
case 1:
- if (show_gameinfo && game_info_astring(messagebox_text).length() > 0)
+ if (show_gameinfo)
+ messagebox_text = machine_info().game_info_string();
+ if (!messagebox_text.empty())
set_handler(ui_callback_type::MODAL, std::bind(&mame_ui_manager::handler_messagebox_anykey, this, _1));
break;
case 2:
- if (show_mandatory_fileman && machine().image().mandatory_scan(messagebox_text).length() > 0)
+ if (show_mandatory_fileman)
+ messagebox_text = machine_info().mandatory_images();
+ if (!messagebox_text.empty())
{
std::string warning;
warning.assign(_("This driver requires images to be loaded in the following device(s): ")).append(messagebox_text.substr(0, messagebox_text.length() - 2));
@@ -745,259 +758,6 @@ bool mame_ui_manager::is_menu_active(void)
}
-/***************************************************************************
- TEXT GENERATORS
-***************************************************************************/
-
-//-------------------------------------------------
-// warnings_string - print the warning flags
-// text to the given buffer
-//-------------------------------------------------
-
-std::string &mame_ui_manager::warnings_string(std::string &str)
-{
-#define WARNING_FLAGS ( MACHINE_NOT_WORKING | \
- MACHINE_UNEMULATED_PROTECTION | \
- MACHINE_MECHANICAL | \
- MACHINE_WRONG_COLORS | \
- MACHINE_IMPERFECT_COLORS | \
- MACHINE_REQUIRES_ARTWORK | \
- MACHINE_NO_SOUND | \
- MACHINE_IMPERFECT_SOUND | \
- MACHINE_IMPERFECT_GRAPHICS | \
- MACHINE_IMPERFECT_KEYBOARD | \
- MACHINE_NO_COCKTAIL| \
- MACHINE_IS_INCOMPLETE| \
- MACHINE_NO_SOUND_HW )
-
- str.clear();
-
- // if no warnings, nothing to return
- if (machine().rom_load().warnings() == 0 && machine().rom_load().knownbad() == 0 && !(machine().system().flags & WARNING_FLAGS) && machine().rom_load().software_load_warnings_message().length() == 0)
- return str;
-
- // add a warning if any ROMs were loaded with warnings
- if (machine().rom_load().warnings() > 0)
- {
- str.append(_("One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n"));
- if (machine().system().flags & WARNING_FLAGS)
- str.append("\n");
- }
-
- if (machine().rom_load().software_load_warnings_message().length()>0) {
- str.append(machine().rom_load().software_load_warnings_message());
- if (machine().system().flags & WARNING_FLAGS)
- str.append("\n");
- }
- // if we have at least one warning flag, print the general header
- if ((machine().system().flags & WARNING_FLAGS) || machine().rom_load().knownbad() > 0)
- {
- str.append(_("There are known problems with this machine\n\n"));
-
- // add a warning if any ROMs are flagged BAD_DUMP/NO_DUMP
- if (machine().rom_load().knownbad() > 0) {
- str.append(_("One or more ROMs/CHDs for this machine have not been correctly dumped.\n"));
- }
- // add one line per warning flag
- if (machine().system().flags & MACHINE_IMPERFECT_KEYBOARD)
- str.append(_("The keyboard emulation may not be 100% accurate.\n"));
- if (machine().system().flags & MACHINE_IMPERFECT_COLORS)
- str.append(_("The colors aren't 100% accurate.\n"));
- if (machine().system().flags & MACHINE_WRONG_COLORS)
- str.append(_("The colors are completely wrong.\n"));
- if (machine().system().flags & MACHINE_IMPERFECT_GRAPHICS)
- str.append(_("The video emulation isn't 100% accurate.\n"));
- if (machine().system().flags & MACHINE_IMPERFECT_SOUND)
- str.append(_("The sound emulation isn't 100% accurate.\n"));
- if (machine().system().flags & MACHINE_NO_SOUND) {
- str.append(_("The machine lacks sound.\n"));
- }
- if (machine().system().flags & MACHINE_NO_COCKTAIL)
- str.append(_("Screen flipping in cocktail mode is not supported.\n"));
-
- // check if external artwork is present before displaying this warning?
- if (machine().system().flags & MACHINE_REQUIRES_ARTWORK) {
- str.append(_("The machine requires external artwork files\n"));
- }
-
- if (machine().system().flags & MACHINE_IS_INCOMPLETE )
- {
- str.append(_("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n"));
- }
-
- if (machine().system().flags & MACHINE_NO_SOUND_HW )
- {
- str.append(_("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n"));
- }
-
- // if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger
- if (machine().system().flags & (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL))
- {
- // add the strings for these warnings
- if (machine().system().flags & MACHINE_UNEMULATED_PROTECTION) {
- str.append(_("The machine has protection which isn't fully emulated.\n"));
- }
- if (machine().system().flags & MACHINE_NOT_WORKING) {
- str.append(_("\nTHIS MACHINE DOESN'T WORK. The emulation for this machine is not yet complete. "
- "There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n"));
- }
- if (machine().system().flags & MACHINE_MECHANICAL) {
- str.append(_("\nCertain elements of this machine cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
- "It is not possible to fully play this machine.\n"));
- }
-
- // find the parent of this driver
- driver_enumerator drivlist(machine().options());
- int maindrv = drivlist.find(machine().system());
- int clone_of = drivlist.non_bios_clone(maindrv);
- if (clone_of != -1)
- maindrv = clone_of;
-
- // scan the driver list for any working clones and add them
- bool foundworking = false;
- while (drivlist.next())
- if (drivlist.current() == maindrv || drivlist.clone() == maindrv)
- if ((drivlist.driver().flags & (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL)) == 0)
- {
- // this one works, add a header and display the name of the clone
- if (!foundworking) {
- str.append(_("\n\nThere are working clones of this machine: "));
- }
- else
- str.append(", ");
- str.append(drivlist.driver().name);
- foundworking = true;
- }
-
- if (foundworking)
- str.append("\n");
- }
- }
-
- // add the 'press OK' string
- str.append(_("\n\nPress any key to continue"));
- return str;
-}
-
-
-//-------------------------------------------------
-// game_info_std::string - populate an allocated
-// string with the game info text
-//-------------------------------------------------
-
-std::string &mame_ui_manager::game_info_astring(std::string &str)
-{
- std::ostringstream buf;
-
- // print description, manufacturer, and CPU:
- util::stream_format(buf, _("%1$s\n%2$s %3$s\nDriver: %4$s\n\nCPU:\n"),
- machine().system().description,
- machine().system().year,
- machine().system().manufacturer,
- core_filename_extract_base(machine().system().source_file));
-
- // loop over all CPUs
- execute_interface_iterator execiter(machine().root_device());
- std::unordered_set<std::string> exectags;
- for (device_execute_interface &exec : execiter)
- {
- if (!exectags.insert(exec.device().tag()).second)
- continue;
- // get cpu specific clock that takes internal multiplier/dividers into account
- int clock = exec.device().clock();
-
- // count how many identical CPUs we have
- int count = 1;
- const char *name = exec.device().name();
- for (device_execute_interface &scan : execiter)
- {
- if (exec.device().type() == scan.device().type() && strcmp(name, scan.device().name()) == 0 && exec.device().clock() == scan.device().clock())
- if (exectags.insert(scan.device().tag()).second)
- count++;
- }
-
- // if more than one, prepend a #x in front of the CPU name
- // display clock in kHz or MHz
- util::stream_format(buf,
- (count > 1) ? "%1$d" UTF8_MULTIPLY "%2$s %3$d.%4$0*5$d%6$s\n" : "%2$s %3$d.%4$0*5$d%6$s\n",
- count,
- name,
- (clock >= 1000000) ? (clock / 1000000) : (clock / 1000),
- (clock >= 1000000) ? (clock % 1000000) : (clock % 1000),
- (clock >= 1000000) ? 6 : 3,
- (clock >= 1000000) ? _("MHz") : _("kHz"));
- }
-
- // loop over all sound chips
- sound_interface_iterator snditer(machine().root_device());
- std::unordered_set<std::string> soundtags;
- bool found_sound = false;
- for (device_sound_interface &sound : snditer)
- {
- if (!soundtags.insert(sound.device().tag()).second)
- continue;
-
- // append the Sound: string
- if (!found_sound)
- buf << _("\nSound:\n");
- found_sound = true;
-
- // count how many identical sound chips we have
- int count = 1;
- for (device_sound_interface &scan : snditer)
- {
- if (sound.device().type() == scan.device().type() && sound.device().clock() == scan.device().clock())
- if (soundtags.insert(scan.device().tag()).second)
- count++;
- }
-
- // if more than one, prepend a #x in front of the CPU name
- // display clock in kHz or MHz
- int clock = sound.device().clock();
- util::stream_format(buf,
- (count > 1)
- ? ((clock != 0) ? "%1$d" UTF8_MULTIPLY "%2$s %3$d.%4$0*5$d%6$s\n" : "%1$d" UTF8_MULTIPLY "%2$s\n")
- : ((clock != 0) ? "%2$s %3$d.%4$0*5$d%6$s\n" : "%2$s\n"),
- count,
- sound.device().name(),
- (clock >= 1000000) ? (clock / 1000000) : (clock / 1000),
- (clock >= 1000000) ? (clock % 1000000) : (clock % 1000),
- (clock >= 1000000) ? 6 : 3,
- (clock >= 1000000) ? _("MHz") : _("kHz"));
- }
-
- // display screen information
- buf << _("\nVideo:\n");
- screen_device_iterator scriter(machine().root_device());
- int scrcount = scriter.count();
- if (scrcount == 0)
- buf << _("None\n");
- else
- {
- for (screen_device &screen : scriter)
- {
- std::string detail;
- if (screen.screen_type() == SCREEN_TYPE_VECTOR)
- detail = _("Vector");
- else
- {
- const rectangle &visarea = screen.visible_area();
- detail = string_format("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz",
- visarea.width(), visarea.height(),
- (machine().system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
- ATTOSECONDS_TO_HZ(screen.frame_period().attoseconds()));
- }
-
- util::stream_format(buf,
- (scrcount > 1) ? _("%1$s: %2$s\n") : _("%2$s\n"),
- slider_get_screen_desc(screen), detail);
- }
- }
-
- return str = buf.str();
-}
-
-
/***************************************************************************
UI HANDLERS
@@ -1043,7 +803,7 @@ UINT32 mame_ui_manager::handler_messagebox_anykey(render_container &container)
}
-//-------------------------------------------------3
+//-------------------------------------------------
// process_natural_keyboard - processes any
// natural keyboard input
//-------------------------------------------------
@@ -1758,7 +1518,7 @@ std::vector<ui::menu_item> mame_ui_manager::slider_init(running_machine &machine
int defxoffset = floor(screen.xoffset() * 1000.0f + 0.5f);
int defyoffset = floor(screen.yoffset() * 1000.0f + 0.5f);
void *param = (void *)&screen;
- std::string screen_desc = slider_get_screen_desc(screen);
+ std::string screen_desc = machine_info().get_screen_desc(screen);
// add refresh rate tweaker
if (machine.options().cheat())
@@ -2318,19 +2078,6 @@ INT32 mame_ui_manager::slider_beam_intensity_weight(running_machine &machine, vo
//-------------------------------------------------
-// slider_get_screen_desc - returns the
-// description for a given screen
-//-------------------------------------------------
-
-std::string mame_ui_manager::slider_get_screen_desc(screen_device &screen)
-{
- if (screen_device_iterator(screen.machine().root_device()).count() > 1)
- return string_format(_("Screen '%1$s'"), screen.tag());
- else
- return _("Screen");
-}
-
-//-------------------------------------------------
// slider_crossscale - crosshair scale slider
// callback
//-------------------------------------------------
diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h
index 0c45dd08405..3baa5db61c2 100644
--- a/src/frontend/mame/ui/ui.h
+++ b/src/frontend/mame/ui/ui.h
@@ -26,7 +26,7 @@
namespace ui {
class menu_item;
-
+class machine_info;
} // namespace ui
/***************************************************************************
@@ -152,6 +152,7 @@ public:
// construction/destruction
mame_ui_manager(running_machine &machine);
+ ~mame_ui_manager();
void init();
@@ -159,6 +160,7 @@ public:
running_machine &machine() const { return m_machine; }
bool single_step() const { return m_single_step; }
ui_options &options() { return m_ui_options; }
+ ui::machine_info &machine_info() const { assert(m_machine_info != nullptr); return *m_machine_info; }
// setters
void set_single_step(bool single_step) { m_single_step = single_step; }
@@ -213,9 +215,6 @@ public:
void start_save_state();
void start_load_state();
- // print the game info string into a buffer
- std::string &game_info_astring(std::string &str);
-
// slider controls
std::vector<ui::menu_item>& get_slider_list(void);
@@ -249,6 +248,8 @@ private:
bool m_load_save_hold;
ui_options m_ui_options;
+ std::unique_ptr<ui::machine_info> m_machine_info;
+
// static variables
static std::string messagebox_text;
static std::string messagebox_poptext;
@@ -257,9 +258,6 @@ private:
static std::vector<ui::menu_item> slider_list;
static slider_state *slider_current;
- // text generators
- std::string &warnings_string(std::string &buffer);
-
// UI handlers
UINT32 handler_messagebox(render_container &container);
UINT32 handler_messagebox_anykey(render_container &container);
diff --git a/src/frontend/mame/ui/utils.h b/src/frontend/mame/ui/utils.h
index a5c6626f675..0c63d3961fe 100644
--- a/src/frontend/mame/ui/utils.h
+++ b/src/frontend/mame/ui/utils.h
@@ -274,7 +274,7 @@ bool input_character(std::string &buffer, unicode_char unichar, F &&filter)
result = true;
}
}
- else if ((unichar >= ' ') && (!filter || filter(unichar)))
+ else if ((unichar >= ' ') && filter(unichar))
{
// append this character
buffer += utf8_from_uchar(unichar);
diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile
index 8f11a68b6bd..36bce299de5 100644
--- a/src/lib/netlist/build/makefile
+++ b/src/lib/netlist/build/makefile
@@ -16,16 +16,12 @@ SRC = ..
# LTO = -flto=4 -fuse-linker-plugin -flto-partition=balanced -Wodr
-#-Werror
-#CFLAGS = $(LTO) -g -O3 -std=c++98 -Doverride="" -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 = $(CEXTRAFLAGS) $(LTO) -g -O3 -std=c++11 -march=native -I.. -Wall -Wpedantic -Wsign-compare -Wextra -Wno-unused-parameter
-LDFLAGS = $(LTO) -g -O3 -std=c++11
+CFLAGS = $(LTO) -g -O3 -std=c++11 -march=native -I.. -Wall -Wpedantic -Wsign-compare -Wextra -Wno-unused-parameter $(CEXTRAFLAGS)
+LDFLAGS = $(LTO) -g -O3 -std=c++11 $(LDEXTRAFLAGS)
LIBS = -lpthread -ldl
-CC = g++-5
-LD = @g++-5
+CC = g++
+LD = @g++
MD = @mkdir
RM = @rm
DOXYGEN = @doxygen
@@ -107,19 +103,20 @@ NLOBJS := \
ALL_OBJS = $(OBJS) $(NLOBJ)/prg/nltool.o $(NLOBJ)/prg/nlwav.o
SOURCES = $(patsubst $(OBJ)%, $(SRC)%, $(ALL_OBJS:.o=.cpp))
+MAKEFILE_TARGETS_WITHOUT_INCLUDE := clean doc clang mingw
#-------------------------------------------------
# all
#-------------------------------------------------
-all: maketree $(TARGETS)
+all: maketree depend $(TARGETS)
#-------------------------------------------------
# clean
#-------------------------------------------------
clean:
- $(RM) -rf $(OBJS) $(TARGETS) .depend
+ $(RM) -rf $(OBJS) $(TARGETS) $(OBJ)/prg/nltool.o $(OBJ)/prg/nlwav.o .depend
#-------------------------------------------------
# nltool
@@ -127,11 +124,11 @@ clean:
nltool: $(OBJ)/prg/nltool.o $(OBJS)
@echo Linking $@...
- @$(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
+ $(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
nlwav: $(OBJ)/prg/nlwav.o $(OBJS)
@echo Linking $@...
- @$(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
+ $(LD) -o $@ $(LDFLAGS) $^ $(LIBS)
#-------------------------------------------------
# directories
@@ -143,36 +140,50 @@ $(sort $(OBJDIRS)):
maketree: $(sort $(OBJDIRS))
#-------------------------------------------------
-# depends
-#-------------------------------------------------
-
-depend: .depend
-
-.depend: $(SOURCES)
- @echo creating .depend
- @rm -f ./.depend
- @for i in $(SOURCES); do \
- $(CC) $(CFLAGS) -MM $$i -MT `echo $$i | sed -e 's/$(SRC)/$(OBJ)/' -e 's/.cpp/.o/' ` >>./.depend; \
- done
-
--include .depend
-
-#-------------------------------------------------
# Special targets
#-------------------------------------------------
-.PHONY: clang doc
+.PHONY: clang mingw doc
+
clang:
$(MAKE) CC=clang++ LD=clang++ CEXTRAFLAGS="-Weverything -Werror -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wconversion -Wno-c++98-compat -Wno-float-equal -Wno-cast-align -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-exit-time-destructors -Wno-format-nonliteral -Wno-weak-template-vtables"
#
-# FIX: -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-exit-time-destructors
+# FIXME: -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-exit-time-destructors
#
+mingw:
+ $(MAKE) LDEXTRAFLAGS="-Wl,--subsystem,console" LIBS= MD=@mkdir.exe SHELL=sh.exe
+
+#
+# FIXME: Unicode
+# CEXTRAFLAGS = -DUNICODE -D_UNICODE -municode
+# LDEXTRAFLAGS = -municode
+#
+
+
doc:
$(DOXYGEN) doxygen.conf
#-------------------------------------------------
+# depends
+#-------------------------------------------------
+
+.depend: $(SOURCES)
+ @echo creating .depend
+ @rm -f ./.depend
+ @for i in $(SOURCES); do \
+ $(CC) $(CFLAGS) -MM $$i -MT `echo $$i | sed -e 's/$(SRC)/$(OBJ)/' -e 's/.cpp/.o/' ` >>./.depend; \
+ done
+
+depend: .depend
+
+# Include only if the goal needs it
+ifeq ($(filter $(MAKECMDGOALS),$(MAKEFILE_TARGETS_WITHOUT_INCLUDE)),)
+-include .depend
+endif
+
+#-------------------------------------------------
# generic rules
#-------------------------------------------------
@@ -192,5 +203,3 @@ $(OBJ)/%.a:
@echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $^
-
-
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp
index 0145d918766..d8a01612e25 100644
--- a/src/lib/netlist/nl_base.cpp
+++ b/src/lib/netlist/nl_base.cpp
@@ -641,7 +641,7 @@ detail::net_t::~net_t()
netlist().state().remove_save_items(this);
}
-void detail::net_t::inc_active(core_terminal_t &term)
+void detail::net_t::inc_active(core_terminal_t &term) NL_NOEXCEPT
{
m_active++;
m_list_active.push_front(&term);
@@ -665,7 +665,7 @@ void detail::net_t::inc_active(core_terminal_t &term)
}
}
-void detail::net_t::dec_active(core_terminal_t &term)
+void detail::net_t::dec_active(core_terminal_t &term) NL_NOEXCEPT
{
--m_active;
nl_assert(m_active >= 0);
@@ -689,7 +689,7 @@ void detail::net_t::rebuild_list()
m_active = cnt;
}
-void detail::net_t::update_devs()
+void detail::net_t::update_devs() NL_NOEXCEPT
{
nl_assert(this->isRailNet());
@@ -780,11 +780,12 @@ analog_net_t::analog_net_t(netlist_t &nl, const pstring &aname, detail::core_ter
// core_terminal_t
// ----------------------------------------------------------------------------------------
-detail::core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, const type_t atype)
-: device_object_t(dev, dev.name() + "." + aname, atype)
+detail::core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname,
+ const type_t type, const state_e state)
+: device_object_t(dev, dev.name() + "." + aname, type)
, plib::linkedlist_t<core_terminal_t>::element_t()
, m_net(nullptr)
-, m_state(*this, "m_state", STATE_NONEX)
+, m_state(*this, "m_state", state)
{
}
@@ -812,7 +813,7 @@ void detail::core_terminal_t::set_net(net_t *anet)
// ----------------------------------------------------------------------------------------
terminal_t::terminal_t(core_device_t &dev, const pstring &aname)
-: analog_t(dev, aname, TERMINAL)
+: analog_t(dev, aname, TERMINAL, STATE_BIDIR)
, m_otherterm(nullptr)
, m_Idr1(*this, "m_Idr1", nullptr)
, m_go1(*this, "m_go1", nullptr)
@@ -849,10 +850,9 @@ void terminal_t::schedule_after(const netlist_time &after)
// ----------------------------------------------------------------------------------------
logic_output_t::logic_output_t(core_device_t &dev, const pstring &aname)
- : logic_t(dev, aname, OUTPUT)
+ : logic_t(dev, aname, OUTPUT, STATE_OUT)
, m_my_net(dev.netlist(), name() + ".net", this)
{
- set_state(STATE_OUT);
this->set_net(&m_my_net);
set_logic_family(dev.logic_family());
netlist().setup().register_term(*this);
@@ -868,9 +868,8 @@ void logic_output_t::initial(const netlist_sig_t val)
// ----------------------------------------------------------------------------------------
analog_input_t::analog_input_t(core_device_t &dev, const pstring &aname)
-: analog_t(dev, aname, INPUT)
+: analog_t(dev, aname, INPUT, STATE_INP_ACTIVE)
{
- set_state(STATE_INP_ACTIVE);
netlist().setup().register_term(*this);
}
@@ -879,11 +878,10 @@ analog_input_t::analog_input_t(core_device_t &dev, const pstring &aname)
// ----------------------------------------------------------------------------------------
analog_output_t::analog_output_t(core_device_t &dev, const pstring &aname)
- : analog_t(dev, aname, OUTPUT)
+ : analog_t(dev, aname, OUTPUT, STATE_OUT)
, m_my_net(dev.netlist(), name() + ".net", this)
{
this->set_net(&m_my_net);
- set_state(STATE_OUT);
net().m_cur_Analog = NL_FCONST(0.0);
netlist().setup().register_term(*this);
@@ -899,9 +897,8 @@ void analog_output_t::initial(const nl_double val)
// -----------------------------------------------------------------------------
logic_input_t::logic_input_t(core_device_t &dev, const pstring &aname)
- : logic_t(dev, aname, INPUT)
+ : logic_t(dev, aname, INPUT, STATE_INP_ACTIVE)
{
- set_state(STATE_INP_ACTIVE);
set_logic_family(dev.logic_family());
netlist().setup().register_term(*this);
}
diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h
index e9ac9a64129..f76b7b8e673 100644
--- a/src/lib/netlist/nl_base.h
+++ b/src/lib/netlist/nl_base.h
@@ -143,7 +143,7 @@ class NETLIB_NAME(name) : public device_t
#define nl_assert(x) do { if (1) if (!(x)) throw nl_exception(plib::pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); } while (0)
#define NL_NOEXCEPT
#else
-#define nl_assert(x) do { if (0) if (!(x)) throw nl_exception(plib::pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); } while (0)
+#define nl_assert(x) do { if (0) if (!(x)) { /*throw nl_exception(plib::pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); */} } while (0)
#define NL_NOEXCEPT noexcept
#endif
#define nl_assert_always(x, msg) do { if (!(x)) throw nl_exception(plib::pfmt("Fatal error: {1}\nCaused by assert: {2}:{3}: {4}")(msg)(__FILE__)(__LINE__)(#x)); } while (0)
@@ -214,8 +214,8 @@ namespace netlist
*/
using model_map_t = std::unordered_map<pstring, pstring>;
- /*! Logic families descriptors are used create proxy devices.
- * The logic family describe the analog capabilities of logic devices,
+ /*! Logic families descriptors are used to create proxy devices.
+ * The logic family describes the analog capabilities of logic devices,
* inputs and outputs.
*/
class logic_family_desc_t
@@ -448,6 +448,11 @@ namespace netlist
// core_terminal_t
// -----------------------------------------------------------------------------
+ /*! Base class for all terminals.
+ *
+ * All terminals are derived from this class.
+ *
+ */
class detail::core_terminal_t : public device_object_t, public plib::linkedlist_t<core_terminal_t>::element_t
{
P_PREVENT_COPYING(core_terminal_t)
@@ -455,18 +460,17 @@ namespace netlist
using list_t = std::vector<core_terminal_t *>;
- /* needed here ... */
-
enum state_e {
STATE_INP_PASSIVE = 0,
STATE_INP_ACTIVE = 1,
STATE_INP_HL = 2,
STATE_INP_LH = 4,
STATE_OUT = 128,
- STATE_NONEX = 256
+ STATE_BIDIR = 256
};
- core_terminal_t(core_device_t &dev, const pstring &aname, const type_t atype);
+ core_terminal_t(core_device_t &dev, const pstring &aname,
+ const type_t type, const state_e state);
virtual ~core_terminal_t() { }
void set_net(net_t *anet);
@@ -481,11 +485,7 @@ namespace netlist
bool is_state(const state_e astate) const { return (m_state == astate); }
state_e state() const { return m_state; }
- void set_state(const state_e astate)
- {
- nl_assert(astate != STATE_NONEX);
- m_state = astate;
- }
+ void set_state(const state_e astate) { m_state = astate; }
void reset();
@@ -502,8 +502,9 @@ namespace netlist
{
public:
- analog_t(core_device_t &dev, const pstring &aname, const type_t atype)
- : core_terminal_t(dev, aname, atype)
+ analog_t(core_device_t &dev, const pstring &aname, const type_t type,
+ const state_e state)
+ : core_terminal_t(dev, aname, type, state)
{
}
@@ -580,9 +581,11 @@ namespace netlist
class logic_t : public detail::core_terminal_t, public logic_family_t
{
public:
- logic_t(core_device_t &dev, const pstring &aname, const type_t atype)
- : core_terminal_t(dev, aname, atype), logic_family_t(),
- m_proxy(nullptr)
+ logic_t(core_device_t &dev, const pstring &aname, const type_t type,
+ const state_e state)
+ : core_terminal_t(dev, aname, type, state)
+ , logic_family_t()
+ , m_proxy(nullptr)
{
}
@@ -610,7 +613,7 @@ namespace netlist
netlist_sig_t Q() const noexcept;
- netlist_sig_t operator()() const
+ netlist_sig_t operator()() const NL_NOEXCEPT
{
nl_assert(state() != STATE_INP_PASSIVE);
return Q();
@@ -680,7 +683,7 @@ namespace netlist
void reschedule_in_queue(const netlist_time delay) noexcept;
bool is_queued() const { return m_in_queue == 1; }
- void update_devs();
+ void update_devs() NL_NOEXCEPT;
const netlist_time time() const { return m_time; }
void set_time(const netlist_time ntime) { m_time = ntime; }
@@ -690,8 +693,8 @@ namespace netlist
std::size_t num_cons() const noexcept { return m_core_terms.size(); }
- void inc_active(core_terminal_t &term);
- void dec_active(core_terminal_t &term);
+ void inc_active(core_terminal_t &term) NL_NOEXCEPT;
+ void dec_active(core_terminal_t &term) NL_NOEXCEPT;
void rebuild_list(); /* rebuild m_list after a load */
void move_connections(net_t &dest_net);
diff --git a/src/lib/netlist/plib/pdynlib.cpp b/src/lib/netlist/plib/pdynlib.cpp
index 2088ab47c1b..0ed2ca3a620 100644
--- a/src/lib/netlist/plib/pdynlib.cpp
+++ b/src/lib/netlist/plib/pdynlib.cpp
@@ -7,7 +7,7 @@
#include "pdynlib.h"
-#ifdef WIN32
+#ifdef _WIN32
#include "windows.h"
#include "palloc.h"
@@ -61,7 +61,7 @@ namespace plib {
dynlib::dynlib(const pstring libname)
: m_isLoaded(false), m_lib(nullptr)
{
-#ifdef WIN32
+#ifdef _WIN32
//fprintf(stderr, "win: loading <%s>\n", libname.cstr());
TCHAR *buffer = tstring_from_utf8(libname.cstr());
if (libname != "")
@@ -90,7 +90,7 @@ dynlib::dynlib(const pstring path, const pstring libname)
: m_isLoaded(false), m_lib(nullptr)
{
// printf("win: loading <%s>\n", libname.cstr());
-#ifdef WIN32
+#ifdef _WIN32
TCHAR *buffer = tstring_from_utf8(libname.cstr());
if (libname != "")
m_lib = LoadLibrary(buffer);
@@ -122,7 +122,7 @@ dynlib::~dynlib()
{
if (m_lib != nullptr)
{
-#ifdef WIN32
+#ifdef _WIN32
#else
dlclose(m_lib);
//printf("Closed %s\n", dlerror());
@@ -137,7 +137,7 @@ bool dynlib::isLoaded() const
void *dynlib::getsym_p(const pstring name)
{
-#ifdef WIN32
+#ifdef _WIN32
return (void *) GetProcAddress((HMODULE) m_lib, name.cstr());
#else
return dlsym(m_lib, name.cstr());
diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp
index 4f41c73d6f8..0a19685316d 100644
--- a/src/lib/netlist/plib/pparser.cpp
+++ b/src/lib/netlist/plib/pparser.cpp
@@ -106,7 +106,7 @@ pstring ptokenizer::get_identifier_or_number()
token_t tok = get_token();
if (!(tok.is_type(IDENTIFIER) || tok.is_type(NUMBER)))
{
- error(pfmt("Expected an identifier, got <{1}>")(tok.str()) );
+ error(pfmt("Expected an identifier or number, got <{1}>")(tok.str()) );
}
return tok.str();
}
@@ -203,7 +203,8 @@ ptokenizer::token_t ptokenizer::get_token_internal()
{
/* read identifier till non identifier char */
pstring tokstr = "";
- while (m_identifier_chars.find(c) != m_identifier_chars.end()) {
+ while (m_identifier_chars.find(c) != m_identifier_chars.end())
+ {
tokstr += c;
c = getc();
}
@@ -229,7 +230,8 @@ ptokenizer::token_t ptokenizer::get_token_internal()
{
/* read identifier till first identifier char or ws */
pstring tokstr = "";
- while ((m_identifier_chars.find(c)) == m_identifier_chars.end() && (m_whitespace.find(c) == m_whitespace.end())) {
+ while ((m_identifier_chars.find(c) == m_identifier_chars.end()) && (m_whitespace.find(c) == m_whitespace.end()))
+ {
tokstr += c;
/* expensive, check for single char tokens */
if (tokstr.len() == 1)
diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp
index f3f9b4c15ea..ad340017bc4 100644
--- a/src/lib/netlist/plib/putil.cpp
+++ b/src/lib/netlist/plib/putil.cpp
@@ -22,7 +22,7 @@ namespace plib
if (ret == "")
ret = elem;
else
- #ifdef WIN32
+ #ifdef _WIN32
ret = ret + '\\' + elem;
#else
ret = ret + '/' + elem;
diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp
index 92057688954..b095a081f81 100644
--- a/src/lib/netlist/prg/nltool.cpp
+++ b/src/lib/netlist/prg/nltool.cpp
@@ -41,7 +41,7 @@ public:
opt_logs(*this, "l", "log" , "define terminal to log. This option may be specified repeatedly."),
opt_inp(*this, "i", "input", "", "input file to process (default is none)"),
opt_grp4(*this, "Options for convert command", "These options are only used by the convert command."),
- opt_type(*this, "y", "type", "spice", "spice:eagle", "type of file to be converted: spice,eagle"),
+ opt_type(*this, "y", "type", "spice", "spice:eagle:rinf", "type of file to be converted: spice,eagle,rinf"),
opt_ex1(*this, "nltool -c run -t 3.5 -f nl_examples/cdelay.c -n cap_delay",
"Run netlist \"cap_delay\" from file nl_examples/cdelay.c for 3.5 seconds"),
@@ -465,12 +465,18 @@ int main(int argc, char *argv[])
c.convert(contents);
result = c.result();
}
- else
+ else if (opts.opt_type().equals("eagle"))
{
nl_convert_eagle_t c;
c.convert(contents);
result = c.result();
}
+ else if (opts.opt_type().equals("rinf"))
+ {
+ nl_convert_rinf_t c;
+ c.convert(contents);
+ result = c.result();
+ }
/* present result */
pout_strm.write(result.cstr());
}
diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp
index b0ca5fe3c0d..978be90caaf 100644
--- a/src/lib/netlist/tools/nl_convert.cpp
+++ b/src/lib/netlist/tools/nl_convert.cpp
@@ -8,9 +8,51 @@
#include <algorithm>
#include <cstdio>
#include <cmath>
+#include <unordered_map>
#include "nl_convert.h"
#include "plib/palloc.h"
+#include "plib/putil.h"
+/* FIXME: temporarily defined here - should be in a file */
+/* FIXME: family logic in netlist is convoluted, create
+ * define a model param on core device
+ */
+/* Format: external name,netlist device,model */
+static const char *s_lib_map =
+"SN74LS00D, TTL_7400_DIP, 74LSXX\n"
+"SN74LS04D, TTL_7404_DIP, 74LSXX\n"
+"SN74ALS08D, TTL_7408_DIP, 74ALSXX\n"
+"SN74ALS10AD, TTL_7410_DIP, 74ALSXX\n"
+"SN74LS30N, TTL_7430_DIP, 74LSXX\n"
+"SN74ALS74AD, TTL_7474_DIP, 74ALSXX\n"
+"SN74LS74AD, TTL_7474_DIP, 74LSXX\n"
+"SN74LS86AD, TTL_7486_DIP, 74LSXX\n"
+"SN74F153D, TTL_74153_DIP, 74FXX\n"
+"SN74LS161AD, TTL_74161_DIP, 74LSXX\n"
+"SN74LS164D, TTL_74164_DIP, 74LSXX\n"
+"DM74LS366AN, TTL_74366_DIP, 74LSXX\n"
+;
+
+struct lib_map_entry
+{
+ pstring dev;
+ pstring model;
+};
+
+using lib_map_t = std::unordered_map<pstring, lib_map_entry>;
+
+static lib_map_t read_lib_map(const pstring lm)
+{
+ plib::pistringstream istrm(lm);
+ lib_map_t m;
+ pstring line;
+ while (istrm.readline(line))
+ {
+ plib::pstring_vector_t split(line, ",");
+ m[split[0].trim()] = { split[1].trim(), split[2].trim() };
+ }
+ return m;
+}
/*-------------------------------------------------
convert - convert a spice netlist
@@ -173,8 +215,9 @@ nl_convert_base_t::unit_t nl_convert_base_t::m_units[] = {
{"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 },
+ {"??", "CAP_U({1})", 1.0e-6 }, /* FIXME */
{"N", "CAP_N({1})", 1.0e-9 },
+ {"pF", "CAP_P({1})", 1.0e-12},
{"P", "CAP_P({1})", 1.0e-12},
{"F", "{1}e-15", 1.0e-15},
@@ -448,3 +491,209 @@ void nl_convert_eagle_t::convert(const pstring &contents)
}
}
+
+/* token_id_t m_tok_HFA;
+ token_id_t m_tok_APP;
+ token_id_t m_tok_TIM;
+ token_id_t m_tok_TYP;
+ token_id_t m_tok_ADDC;
+ token_id_t m_tok_ATTC;
+ token_id_t m_tok_NET;
+ token_id_t m_tok_TER;
+ *
+ */
+void nl_convert_rinf_t::convert(const pstring &contents)
+{
+ plib::pistringstream istrm(contents);
+ tokenizer tok(*this, istrm);
+ auto lm = read_lib_map(s_lib_map);
+
+ out("NETLIST_START(dummy)\n");
+ add_term("GND", "GND");
+ add_term("VCC", "VCC");
+ tokenizer::token_t token = tok.get_token();
+ while (true)
+ {
+ if (token.is_type(tokenizer::ENDOFFILE) || token.is(tok.m_tok_END))
+ {
+ dump_nl();
+ // FIXME: Parameter
+ out("NETLIST_END()\n");
+ return;
+ }
+ else if (token.is(tok.m_tok_HEA))
+ {
+ /* seems to be start token - ignore */
+ token = tok.get_token();
+ }
+ else if (token.is(tok.m_tok_APP))
+ {
+ /* version string */
+ pstring app = tok.get_string();
+ out("// APP: {}\n", app);
+ token = tok.get_token();
+ }
+ else if (token.is(tok.m_tok_TIM))
+ {
+ /* time */
+ out("// TIM:");
+ for (int i=0; i<6; i++)
+ {
+ long x = tok.get_number_long();
+ out(" {}", x);
+ }
+ out("\n");
+ token = tok.get_token();
+ }
+ else if (token.is(tok.m_tok_TYP))
+ {
+ pstring id(tok.get_identifier());
+ out("// TYP: {}\n", id);
+ token = tok.get_token();
+ }
+ else if (token.is(tok.m_tok_ADDC))
+ {
+ std::unordered_map<pstring, pstring> attr;
+ pstring id = tok.get_identifier();
+ pstring s1 = tok.get_string();
+ pstring s2 = tok.get_string();
+
+ token = tok.get_token();
+ while (token.is(tok.m_tok_ATTC))
+ {
+ pstring tid = tok.get_identifier();
+ if (tid != id)
+ {
+ out("Error: found {} expected {} in {}\n", tid, id, token.str());
+ return;
+ }
+ pstring at = tok.get_string();
+ pstring val = tok.get_string();
+ attr[at] = val;
+ token = tok.get_token();
+ }
+ pstring sim = attr["Simulation"];
+ pstring val = attr["Value"];
+ pstring com = attr["Comment"];
+ if (val == "")
+ val = com;
+
+ if (sim == "CAP")
+ {
+ add_device("CAP", id, get_sp_val(val));
+ }
+ else if (sim == "RESISTOR")
+ {
+ add_device("RES", id, get_sp_val(val));
+ }
+ else
+ {
+ pstring lib = attr["Library Reference"];
+ auto f = lm.find(lib);
+ if (f != lm.end())
+ add_device(f->second.dev, id);
+ else
+ add_device(lib, id);
+ }
+ }
+ else if (token.is(tok.m_tok_NET))
+ {
+ pstring dev = tok.get_identifier();
+ pstring pin = tok.get_identifier_or_number();
+ pstring net = tok.get_string();
+ add_term(net, dev + "." + pin);
+ token = tok.get_token();
+ if (token.is(tok.m_tok_TER))
+ {
+ token = tok.get_token();
+ while (token.is_type(plib::ptokenizer::IDENTIFIER))
+ {
+ pin = tok.get_identifier_or_number();
+ add_term(net, token.str() + "." + pin);
+ token = tok.get_token();
+ }
+ }
+ }
+#if 0
+ token = tok.get_token();
+ /* skip to semicolon */
+ do
+ {
+ token = tok.get_token();
+ } while (!token.is(tok.m_tok_SEMICOLON));
+ token = tok.get_token();
+ pstring sval = "";
+ if (token.is(tok.m_tok_VALUE))
+ {
+ pstring vname = tok.get_string();
+ sval = tok.get_string();
+ tok.require_token(tok.m_tok_SEMICOLON);
+ token = tok.get_token();
+ }
+ switch (name.code_at(0))
+ {
+ case 'Q':
+ {
+ add_device("QBJT", name, sval);
+ }
+ break;
+ case 'R':
+ {
+ double val = get_sp_val(sval);
+ add_device("RES", name, val);
+ }
+ break;
+ case 'C':
+ {
+ double val = get_sp_val(sval);
+ add_device("CAP", name, val);
+ }
+ break;
+ case 'P':
+ if (sval.ucase() == "HIGH")
+ add_device("TTL_INPUT", name, 1);
+ else if (sval.ucase() == "LOW")
+ add_device("TTL_INPUT", name, 0);
+ else
+ add_device("ANALOG_INPUT", name, sval.as_double());
+ add_pin_alias(name, "1", "Q");
+ break;
+ case 'D':
+ /* Pin 1 = Anode, Pin 2 = Cathode */
+ add_device("DIODE", name, sval);
+ add_pin_alias(name, "1", "A");
+ add_pin_alias(name, "2", "K");
+ break;
+ case 'U':
+ case 'X':
+ {
+ pstring tname = "TTL_" + sval + "_DIP";
+ add_device(tname, name);
+ break;
+ }
+ default:
+ tok.error("// IGNORED " + name);
+ }
+
+ }
+ else if (token.is(tok.m_tok_SIGNAL))
+ {
+ pstring netname = tok.get_string();
+ token = tok.get_token();
+ while (!token.is(tok.m_tok_SEMICOLON))
+ {
+ /* fixme: should check for string */
+ pstring devname = token.str();
+ pstring pin = tok.get_string();
+ add_term(netname, devname + "." + pin);
+ token = tok.get_token(); }
+ }
+#endif
+ else
+ {
+ out("Unexpected {}\n", token.str());
+ return;
+ }
+ }
+
+}
diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h
index 209057a06d5..fa496a092d7 100644
--- a/src/lib/netlist/tools/nl_convert.h
+++ b/src/lib/netlist/tools/nl_convert.h
@@ -221,4 +221,73 @@ private:
};
+class nl_convert_rinf_t : public nl_convert_base_t
+{
+public:
+
+ nl_convert_rinf_t() : nl_convert_base_t() {}
+ ~nl_convert_rinf_t()
+ {
+ }
+
+ class tokenizer : public plib::ptokenizer
+ {
+ public:
+ tokenizer(nl_convert_rinf_t &convert, plib::pistream &strm)
+ : plib::ptokenizer(strm), m_convert(convert)
+ {
+ set_identifier_chars(".abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_-");
+ set_number_chars("0123456789", "0123456789eE-."); //FIXME: processing of numbers
+ char ws[5];
+ ws[0] = ' ';
+ ws[1] = 9;
+ ws[2] = 10;
+ ws[3] = 13;
+ ws[4] = 0;
+ set_whitespace(ws);
+ /* FIXME: gnetlist doesn't print comments */
+ set_comment("","","//"); // FIXME:needs to be confirmed
+ set_string_char('"');
+ m_tok_HEA = register_token(".HEA");
+ m_tok_APP = register_token(".APP");
+ m_tok_TIM = register_token(".TIM");
+ m_tok_TYP = register_token(".TYP");
+ m_tok_ADDC = register_token(".ADD_COM");
+ m_tok_ATTC = register_token(".ATT_COM");
+ m_tok_NET = register_token(".ADD_TER");
+ m_tok_TER = register_token(".TER");
+ m_tok_END = register_token(".END");
+ }
+
+ token_id_t m_tok_HEA;
+ token_id_t m_tok_APP;
+ token_id_t m_tok_TIM;
+ token_id_t m_tok_TYP;
+ token_id_t m_tok_ADDC;
+ token_id_t m_tok_ATTC;
+ token_id_t m_tok_NET;
+ token_id_t m_tok_TER;
+ token_id_t m_tok_END;
+
+ protected:
+
+ void verror(const pstring &msg, int line_num, const pstring &line) override
+ {
+ m_convert.out("{} (line {}): {}\n", msg.cstr(), line_num, line.cstr());
+ }
+
+
+ private:
+ nl_convert_rinf_t &m_convert;
+ };
+
+ void convert(const pstring &contents) override;
+
+protected:
+
+
+private:
+
+};
+
#endif /* NL_CONVERT_H_ */
diff --git a/src/lib/util/cstrpool.cpp b/src/lib/util/cstrpool.cpp
deleted file mode 100644
index 5a9e571366b..00000000000
--- a/src/lib/util/cstrpool.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
-/***************************************************************************
-
- cstrpool.c
-
- Constant string pool helper class.
-
-***************************************************************************/
-
-#include <assert.h>
-
-#include "cstrpool.h"
-
-
-//**************************************************************************
-// CONST STRING POOL
-//**************************************************************************
-
-//-------------------------------------------------
-// const_string_pool - constructor
-//-------------------------------------------------
-
-const_string_pool::const_string_pool()
-{
-}
-
-
-//-------------------------------------------------
-// add - add a string to the string pool
-//-------------------------------------------------
-
-const char *const_string_pool::add(const char *string)
-{
- // if nullptr or a small number (for some hash strings), just return as-is
- if (FPTR(string) < 0x100)
- return string;
-
- // scan to find space
- for (pool_chunk *chunk = m_chunklist.first(); chunk != nullptr; chunk = chunk->next())
- {
- const char *result = chunk->add(string);
- if (result != nullptr)
- return result;
- }
-
- // no space anywhere, create a new pool and prepend it (so it gets used first)
- const char *result = m_chunklist.prepend(*global_alloc(pool_chunk)).add(string);
- assert(result != nullptr);
- return result;
-}
-
-
-//-------------------------------------------------
-// contains - determine if the given string
-// pointer lives in the pool
-//-------------------------------------------------
-
-bool const_string_pool::contains(const char *string)
-{
- // if nullptr or a small number (for some hash strings), then yes, effectively
- if (FPTR(string) < 0x100)
- return true;
-
- // scan to find it
- for (pool_chunk *chunk = m_chunklist.first(); chunk != nullptr; chunk = chunk->next())
- if (chunk->contains(string))
- return true;
-
- return false;
-}
-
-/**
- * @fn const_string_pool::pool_chunk::pool_chunk()
- *
- * @brief -------------------------------------------------
- * pool_chunk - constructor
- * -------------------------------------------------.
- */
-
-const_string_pool::pool_chunk::pool_chunk()
- : m_next(nullptr),
- m_used(0)
-{
-}
-
-/**
- * @fn const char *const_string_pool::pool_chunk::add(const char *string)
- *
- * @brief -------------------------------------------------
- * add - add a string to this pool
- * -------------------------------------------------.
- *
- * @param string The string to add.
- *
- * @return null if it fails, else a char*.
- */
-
-const char *const_string_pool::pool_chunk::add(const char *string)
-{
- // get the length of the string (no string can be longer than a full pool)
- int bytes = strlen(string) + 1;
- assert(bytes < POOL_SIZE);
-
- // if too big, return nullptr
- if (m_used + bytes > POOL_SIZE)
- return nullptr;
-
- // allocate, copy, and return the memory
- char *dest = &m_buffer[m_used];
- m_used += bytes;
- memcpy(dest, string, bytes);
- return dest;
-}
diff --git a/src/lib/util/cstrpool.h b/src/lib/util/cstrpool.h
deleted file mode 100644
index ff6b4c4c0ee..00000000000
--- a/src/lib/util/cstrpool.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Aaron Giles
-/*********************************************************************
-
- cstrpool.h
-
- Constant string pool helper class.
-
-*********************************************************************/
-
-#pragma once
-
-#ifndef __CSTRPOOL_H_
-#define __CSTRPOOL_H_
-
-#include "coretmpl.h"
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> const_string_pool
-
-// a pool to hold constant strings efficiently
-class const_string_pool
-{
-public:
- // construction
- const_string_pool();
-
- // operations
- void reset() { m_chunklist.reset(); }
- const char *add(const char *string);
- bool contains(const char *string);
-
-private:
- // shared string pool
- class pool_chunk
- {
- static const int POOL_SIZE = 4096;
- friend class simple_list<pool_chunk>;
-
- public:
- // construction
- pool_chunk();
-
- // getters
- pool_chunk *next() const { return m_next; }
-
- // operations
- const char *add(const char *string);
- bool contains(const char *string) const { return (string >= m_buffer && string < &m_buffer[POOL_SIZE]); }
-
- private:
- // internal state
- pool_chunk * m_next;
- UINT32 m_used;
- char m_buffer[POOL_SIZE];
- };
- simple_list<pool_chunk> m_chunklist;
-};
-
-
-#endif
diff --git a/src/mame/arcade.flt b/src/mame/arcade.flt
index d663b173402..ab90e054301 100644
--- a/src/mame/arcade.flt
+++ b/src/mame/arcade.flt
@@ -27,6 +27,7 @@ aeroboto.cpp
aerofgt.cpp
age_candy.cpp
airbustr.cpp
+airraid.cpp
ajax.cpp
albazc.cpp
albazg.cpp
@@ -251,7 +252,6 @@ crimfght.cpp
crospang.cpp
crshrace.cpp
crystal.cpp
-cshooter.cpp
csplayh5.cpp
cswat.cpp
cubeqst.cpp
diff --git a/src/mame/audio/hng64.cpp b/src/mame/audio/hng64.cpp
index be6857113cb..d6395327b29 100644
--- a/src/mame/audio/hng64.cpp
+++ b/src/mame/audio/hng64.cpp
@@ -110,7 +110,7 @@ READ32_MEMBER(hng64_state::hng64_soundram_r)
WRITE32_MEMBER( hng64_state::hng64_soundcpu_enable_w )
{
- if (mem_mask&0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
int cmd = data >> 16;
// I guess it's only one of the bits, the commands are inverse of each other
@@ -132,9 +132,9 @@ WRITE32_MEMBER( hng64_state::hng64_soundcpu_enable_w )
}
}
- if (mem_mask&0x0000ffff)
+ if (ACCESSING_BITS_0_15)
{
- logerror("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
+ logerror("unknown hng64_soundcpu_enable_w %08x %08x\n", data, mem_mask);
}
}
diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp
index f7db95b7640..8a8077d58d4 100644
--- a/src/mame/drivers/abc1600.cpp
+++ b/src/mame/drivers/abc1600.cpp
@@ -34,6 +34,11 @@
TODO:
+ - abcenix boot stuck in a loop @ 37cfa
+ - segment/page RAM addresses are not correctly decoded, "sas/format/format" can't find the SASI interface because of this
+ forcetask0 1 t0 0 t1 0 t2 0 t3 0
+ sega19 0 task 0
+ sega 000 segd 00 pga 008 pgd 4058 virtual 02c730 (should be 004730)
- short/long reset (RSTBUT)
- CIO
- optimize timers!
@@ -482,7 +487,9 @@ static ADDRESS_MAP_START( mac_mem, AS_PROGRAM, 8, abc1600_state )
AM_RANGE(0x1ff500, 0x1ff500) AM_MIRROR(0xff) AM_DEVREADWRITE(Z8410AB1_2_TAG, z80dma_device, read, write)
AM_RANGE(0x1ff600, 0x1ff607) AM_MIRROR(0xf8) AM_READWRITE(scc_r, scc_w)
AM_RANGE(0x1ff700, 0x1ff707) AM_MIRROR(0xf8) AM_READWRITE(cio_r, cio_w)
- AM_RANGE(0x1ff800, 0x1ffaff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, io_map)
+ AM_RANGE(0x1ff800, 0x1ff8ff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, iowr0_map)
+ AM_RANGE(0x1ff900, 0x1ff9ff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, iowr1_map)
+ AM_RANGE(0x1ffa00, 0x1ffaff) AM_DEVICE(ABC1600_MOVER_TAG, abc1600_mover_device, iowr2_map)
AM_RANGE(0x1ffb00, 0x1ffb00) AM_MIRROR(0x7e) AM_WRITE(fw0_w)
AM_RANGE(0x1ffb01, 0x1ffb01) AM_MIRROR(0x7e) AM_WRITE(fw1_w)
AM_RANGE(0x1ffd00, 0x1ffd07) AM_MIRROR(0xf8) AM_DEVWRITE(ABC1600_MAC_TAG, abc1600_mac_device, dmamap_w)
@@ -892,7 +899,9 @@ static MACHINE_CONFIG_START( abc1600, abc1600_state )
MCFG_Z8536_PC_OUT_CALLBACK(WRITE8(abc1600_state, cio_pc_w))
MCFG_NMC9306_ADD(NMC9306_TAG)
+
MCFG_E0516_ADD(E050_C16PC_TAG, XTAL_32_768kHz)
+
MCFG_FD1797_ADD(SAB1797_02P_TAG, XTAL_64MHz/64)
MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z8536B1_TAG, z8536_device, pb7_w))
MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(abc1600_state, fdc_drq_w))
diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp
index ca65f5fdfd1..11c62e0b299 100644
--- a/src/mame/drivers/apple2gs.cpp
+++ b/src/mame/drivers/apple2gs.cpp
@@ -451,7 +451,8 @@ ROM_START(apple2gs)
// 341-0728 is the MASK rom version while 341-0737 is the EPROM version - SAME data.
ROM_LOAD("341-0728", 0x00000, 0x20000, CRC(8d410067) SHA1(c0f4704233ead14cb8e1e8a68fbd7063c56afd27) ) /* 341-0728: IIgs ROM03 FC-FD */
// 341-0748 is the MASK rom version while 341-0749 is the EPROM version - SAME data.
- ROM_LOAD("341-0748", 0x20000, 0x20000, CRC(18190283) SHA1(c70576869deec92ca82c78438b1d5c686eac7480) ) /* 341-0748: IIgs ROM03 FE-FF */
+ ROM_LOAD("341-0748", 0x30000, 0x10000, CRC(18190283) SHA1(c70576869deec92ca82c78438b1d5c686eac7480) ) /* 341-0748: IIgs ROM03 FE-FF */
+ ROM_CONTINUE ( 0x20000, 0x10000) /* high address line is inverted on PCB? */
ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
diff --git a/src/mame/drivers/aristmk4.cpp b/src/mame/drivers/aristmk4.cpp
index b752c6b8f9d..203680b20cd 100644
--- a/src/mame/drivers/aristmk4.cpp
+++ b/src/mame/drivers/aristmk4.cpp
@@ -1198,7 +1198,7 @@ static INPUT_PORTS_START(aristmk4)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_NAME("2-2 UNUSED")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_NAME("2-3 UNUSED")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_NAME("AUX1") PORT_CODE(KEYCODE_X) // PB5
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_NAME("Memory Reset") PORT_CODE(KEYCODE_C) // PB4
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_CODE(KEYCODE_C) // PB4
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_NAME("Hopper Test") PORT_CODE(KEYCODE_V) // PB3
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_NAME("Print Data") PORT_CODE(KEYCODE_B) // PB2
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_NAME("Clock Init") PORT_CODE(KEYCODE_N) // PB1
diff --git a/src/mame/drivers/arkanoid.cpp b/src/mame/drivers/arkanoid.cpp
index 6daff2641bf..7e025e7c311 100644
--- a/src/mame/drivers/arkanoid.cpp
+++ b/src/mame/drivers/arkanoid.cpp
@@ -878,7 +878,7 @@ READ8_MEMBER(arkanoid_state::hexaa_sub_90_r)
}
static ADDRESS_MAP_START( hexaa_sub_iomap, AS_IO, 8, arkanoid_state )
- ADDRESS_MAP_GLOBAL_MASK(0x0f)
+ ADDRESS_MAP_GLOBAL_MASK(0x9f)
AM_RANGE(0x00, 0x0f) AM_RAM // ?? could be communication with the other chip (protection?)
AM_RANGE(0x80, 0x80) AM_WRITE(hexaa_sub_80_w)
AM_RANGE(0x90, 0x90) AM_READ(hexaa_sub_90_r)
diff --git a/src/mame/drivers/astrafr.cpp b/src/mame/drivers/astrafr.cpp
index 303b0448626..37d0f4c4997 100644
--- a/src/mame/drivers/astrafr.cpp
+++ b/src/mame/drivers/astrafr.cpp
@@ -170,10 +170,10 @@ WRITE32_MEMBER(astrafr_state::astrafr_mem_w)
case 3:
address &= 0xfffff;
- if (mem_mask&0xff000000) astra_fgpa_w(space, address+0, data >> 24);
- if (mem_mask&0x00ff0000) astra_fgpa_w(space, address+1, data >> 16);
- if (mem_mask&0x0000ff00) astra_fgpa_w(space, address+2, data >> 8);
- if (mem_mask&0x000000ff) astra_fgpa_w(space, address+3, data >> 0);
+ if (ACCESSING_BITS_24_31) astra_fgpa_w(space, address+0, data >> 24);
+ if (ACCESSING_BITS_16_23) astra_fgpa_w(space, address+1, data >> 16);
+ if (ACCESSING_BITS_8_15) astra_fgpa_w(space, address+2, data >> 8);
+ if (ACCESSING_BITS_0_7) astra_fgpa_w(space, address+3, data >> 0);
break;
case 2:
@@ -225,10 +225,10 @@ WRITE32_MEMBER(astrafr_state::astrafr_slave_mem_w)
case 3:
address &= 0xfffff;
- if (mem_mask&0xff000000) astra_fgpa_slave_w(space, address+0, data >> 24);
- if (mem_mask&0x00ff0000) astra_fgpa_slave_w(space, address+1, data >> 16);
- if (mem_mask&0x0000ff00) astra_fgpa_slave_w(space, address+2, data >> 8);
- if (mem_mask&0x000000ff) astra_fgpa_slave_w(space, address+3, data >> 0);
+ if (ACCESSING_BITS_24_31) astra_fgpa_slave_w(space, address+0, data >> 24);
+ if (ACCESSING_BITS_16_23) astra_fgpa_slave_w(space, address+1, data >> 16);
+ if (ACCESSING_BITS_8_15) astra_fgpa_slave_w(space, address+2, data >> 8);
+ if (ACCESSING_BITS_0_7) astra_fgpa_slave_w(space, address+3, data >> 0);
break;
case 2:
diff --git a/src/mame/drivers/bfm_sc4.cpp b/src/mame/drivers/bfm_sc4.cpp
index 0ae8c347bc2..bfd99c93683 100644
--- a/src/mame/drivers/bfm_sc4.cpp
+++ b/src/mame/drivers/bfm_sc4.cpp
@@ -205,12 +205,12 @@ READ16_MEMBER(sc4_state::sc4_mem_r)
if (addr < 0x0080)
{
UINT16 retvalue = 0x0000;
- if (mem_mask&0xff00)
+ if (ACCESSING_BITS_8_15)
{
logerror("mem_mask&0xff00 unhandled\n");
}
- if (mem_mask&0x00ff)
+ if (ACCESSING_BITS_0_7)
{
retvalue = read_input_matrix((addr & 0x00f0)>>4);
}
@@ -381,12 +381,12 @@ WRITE16_MEMBER(sc4_state::sc4_mem_w)
if (addr < 0x0200)
{
- if (mem_mask&0xff00)
+ if (ACCESSING_BITS_8_15)
{
logerror("lamp write mem_mask&0xff00 unhandled\n");
}
- if (mem_mask&0x00ff)
+ if (ACCESSING_BITS_0_7)
{ // lamps
mux_output_w(space, (addr & 0x01f0)>>4, data);
}
@@ -394,12 +394,12 @@ WRITE16_MEMBER(sc4_state::sc4_mem_w)
}
else if ((addr >= 0x1000) && (addr < 0x1200))
{
- if (mem_mask&0xff00)
+ if (ACCESSING_BITS_8_15)
{
logerror("lamp write mem_mask&0xff00 unhandled\n");
}
- if (mem_mask&0x00ff)
+ if (ACCESSING_BITS_0_7)
{ // lamps
mux_output2_w(space, (addr & 0x01f0)>>4, data);
}
diff --git a/src/mame/drivers/bfm_sc5.cpp b/src/mame/drivers/bfm_sc5.cpp
index a899ee2260e..bd9b4d2f2a4 100644
--- a/src/mame/drivers/bfm_sc5.cpp
+++ b/src/mame/drivers/bfm_sc5.cpp
@@ -28,7 +28,7 @@ WRITE16_MEMBER( bfm_sc5_state::sc5_duart_w )
// clearly a duart of some kind, write patterns are the same as SC4 games
// printf("%s: duart_w %1x %04x %04x\n", machine().describe_context(), offset, data, mem_mask);
- if (mem_mask &0xff00)
+ if (ACCESSING_BITS_8_15)
{
m_duart->write(space,offset,(data>>8)&0x00ff);
}
diff --git a/src/mame/drivers/c65.cpp b/src/mame/drivers/c65.cpp
index fb9f882ead7..1f007bd15f0 100644
--- a/src/mame/drivers/c65.cpp
+++ b/src/mame/drivers/c65.cpp
@@ -21,7 +21,7 @@ Note:
#include "emu.h"
#include "cpu/m6502/m4510.h"
#include "machine/mos6526.h"
-#include "softlist.h"
+#include "softlist_dev.h"
#define MAIN_CLOCK XTAL_3_5MHz
diff --git a/src/mame/drivers/calomega.cpp b/src/mame/drivers/calomega.cpp
index 9226a748b92..a247dc12de0 100644
--- a/src/mame/drivers/calomega.cpp
+++ b/src/mame/drivers/calomega.cpp
@@ -843,7 +843,7 @@ static ADDRESS_MAP_START( s903mod_map, AS_PROGRAM, 8, calomega_state )
AM_RANGE(0x08c8, 0x08cb) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(calomega_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(calomega_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x1800, 0xffff) AM_ROM
+ AM_RANGE(0x1800, 0x3fff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( sys905_map, AS_PROGRAM, 8, calomega_state )
@@ -856,7 +856,7 @@ static ADDRESS_MAP_START( sys905_map, AS_PROGRAM, 8, calomega_state )
AM_RANGE(0x10c8, 0x10cb) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(calomega_videoram_w) AM_SHARE("videoram")
AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(calomega_colorram_w) AM_SHARE("colorram")
- AM_RANGE(0x2800, 0xffff) AM_ROM
+ AM_RANGE(0x2800, 0x7fff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( sys906_map, AS_PROGRAM, 8, calomega_state )
diff --git a/src/mame/drivers/cb2001.cpp b/src/mame/drivers/cb2001.cpp
index 10fc8bb527a..c969490595e 100644
--- a/src/mame/drivers/cb2001.cpp
+++ b/src/mame/drivers/cb2001.cpp
@@ -447,7 +447,7 @@ UINT32 cb2001_state::screen_update_cb2001(screen_device &screen, bitmap_rgb32 &b
is being executed incorrectly */
WRITE16_MEMBER(cb2001_state::cb2001_vidctrl_w)
{
- if (mem_mask&0xff00) // video control?
+ if (ACCESSING_BITS_8_15) // video control?
{
printf("cb2001_vidctrl_w %04x %04x\n", data, mem_mask);
m_videobank = (data & 0x0800)>>11;
@@ -458,7 +458,7 @@ WRITE16_MEMBER(cb2001_state::cb2001_vidctrl_w)
WRITE16_MEMBER(cb2001_state::cb2001_vidctrl2_w)
{
- if (mem_mask&0xff00) // video control?
+ if (ACCESSING_BITS_8_15) // video control?
{
printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // i think this switches to 'reels' mode
m_videomode = (data>>8) & 0x03; // which bit??
diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp
index d2f15f54fcf..3632cd95872 100644
--- a/src/mame/drivers/chihiro.cpp
+++ b/src/mame/drivers/chihiro.cpp
@@ -13,6 +13,7 @@ Games on this system include....
|*| 20030224 | Crazy Taxi High Roller (Rev B) | Sega / Hitmaker | GDROM | GDX-0002B | 317-0353-COM |
| | 2003 | Virtua Cop 3 | Sega | GDROM | GDX-0003 | 317-0354-COM |
|*| 20030226 | Virtua Cop 3 (Rev A) | Sega | GDROM | GDX-0003A | 317-0354-COM |
+|*| 20030521 | Virtua Cop 3 (Rev B) | Sega | GDROM | GDX-0003B | 317-0354-COM |
| | 2003 | OutRun 2 | Sega | GDROM | GDX-0004 | 317-0372-COM |
|*| 200312 | OutRun 2 (Rev A) | Sega | GDROM | GDX-0004A | 317-0372-COM |
| | 2003 | OutRun 2 prototype (Rev P) | Sega | GDROM | GDX-0004P | |
@@ -1724,7 +1725,7 @@ PIC
255-5508-354
317-0354-COM
*/
-ROM_START( vcop3 )
+ROM_START( vcop3a )
CHIHIRO_BIOS
DISK_REGION( "gdrom" )
@@ -1734,6 +1735,16 @@ ROM_START( vcop3 )
ROM_LOAD("317-0354-com.data", 0x00, 0x50, CRC(df7e3217) SHA1(9f0f4bf6b15f3b6eeea81eaa27b3d25bd94110da) )
ROM_END
+ROM_START( vcop3 )
+ CHIHIRO_BIOS
+
+ DISK_REGION( "gdrom" )
+ DISK_IMAGE_READONLY( "gdx-0003b", 0, SHA1(4268aadb83c880d4f3dab1d43ddd0a3a2f8befa2) )
+
+ ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
+ ROM_LOAD("317-0354-com.data", 0x00, 0x50, CRC(df7e3217) SHA1(9f0f4bf6b15f3b6eeea81eaa27b3d25bd94110da) )
+ROM_END
+
ROM_START( outr2 )
CHIHIRO_BIOS
@@ -2045,7 +2056,8 @@ ROM_END
// 0002A GAME( 2003, crtaxhra, crtaxihr, chihirogd, chihiro, driver_device, 0, ROT0, "Sega / Hitmaker", "Crazy Taxi High Roller (Rev A) (GDX-0002A)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING )
/* 0002B */ GAME( 2003, crtaxihr, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega / Hitmaker", "Crazy Taxi High Roller (Rev B) (GDX-0002B)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING )
// 0003 GAME( 2003, vcop3o, vcop3, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Virtua Cop 3 (GDX-0003)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING )
-/* 0003A */ GAME( 2003, vcop3, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Virtua Cop 3 (Rev A) (GDX-0003A)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING )
+/* 0003A */ GAME( 2003, vcop3a, vcop3, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Virtua Cop 3 (Rev A) (GDX-0003A)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING )
+/* 0003B */ GAME( 2003, vcop3, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Virtua Cop 3 (Rev B) (GDX-0003B)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING )
// 0004 GAME( 2003, outr2o, outr2, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 (GDX-0004)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE )
/* 0004A */ GAME( 2003, outr2, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "OutRun 2 (Rev A) (GDX-0004A)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE )
// 0005 GAME( 2004, sgolcnpt, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Sega Golf Club Network Pro Tour (GDX-0005)", MACHINE_NO_SOUND|MACHINE_NOT_WORKING|MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp
index 4c3a98e1f87..8b440c98659 100644
--- a/src/mame/drivers/cobra.cpp
+++ b/src/mame/drivers/cobra.cpp
@@ -1730,7 +1730,7 @@ READ32_MEMBER(cobra_state::sub_unk1_r)
WRITE32_MEMBER(cobra_state::sub_unk1_w)
{
/*
- if (!(mem_mask & 0xff000000))
+ if (!ACCESSING_BITS_24_31)
{
printf("%02X", data >> 24);
ucount++;
diff --git a/src/mame/drivers/crystal.cpp b/src/mame/drivers/crystal.cpp
index ebe604fbe48..ec80ebaa415 100644
--- a/src/mame/drivers/crystal.cpp
+++ b/src/mame/drivers/crystal.cpp
@@ -318,7 +318,7 @@ READ32_MEMBER(crystal_state::FlipCount_r)
WRITE32_MEMBER(crystal_state::FlipCount_w)
{
- if (mem_mask & 0x00ff0000)
+ if (ACCESSING_BITS_16_23)
{
int fc = (data >> 16) & 0xff;
if (fc == 1)
@@ -351,14 +351,14 @@ WRITE32_MEMBER(crystal_state::IntAck_w)
{
UINT32 IntPend = space.read_dword(0x01800c0c);
- if (mem_mask & 0xff)
+ if (ACCESSING_BITS_0_7)
{
IntPend &= ~(1 << (data & 0x1f));
space.write_dword(0x01800c0c, IntPend);
if (!IntPend)
m_maincpu->set_input_line(SE3208_INT, CLEAR_LINE);
}
- if (mem_mask & 0xff00)
+ if (ACCESSING_BITS_8_15)
m_IntHigh = (data >> 8) & 7;
}
diff --git a/src/mame/drivers/cv1k.cpp b/src/mame/drivers/cv1k.cpp
index 45c751c4725..53edb8c68b7 100644
--- a/src/mame/drivers/cv1k.cpp
+++ b/src/mame/drivers/cv1k.cpp
@@ -734,7 +734,7 @@ ROM_START( pinkswts )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
- ROM_LOAD( "pinkswts_u2", 0x000000, 0x8400000, CRC(92d3243a) SHA1(e9d20c62f642fb2f62ef83ed5caeee6b3f67fef9) ) /* (2006/04/06 MASTER VER....) */
+ ROM_LOAD( "pinkswts_u2", 0x000000, 0x8400000, CRC(a2fa5363) SHA1(5be327534840871592df523ac82ee1927bd79d67) ) /* (2006/04/06 MASTER VER....) */
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4b82d250) SHA1(ee98dbc3f791efb6d58f3945bcb2044667ae7978) )
@@ -760,7 +760,8 @@ ROM_START( pinkswtsb )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
- ROM_LOAD( "pnkswtsb_u2", 0x000000, 0x8400000, CRC(a5666ed9) SHA1(682e06c84990225bc6bb0c9f38b5f46c4e36b430) ) /* (2006/04/06 MASTER VER.) */
+// ROM_LOAD( "pnkswtsb_u2", 0x000000, 0x8400000, BAD_DUMP CRC(a5666ed9) SHA1(682e06c84990225bc6bb0c9f38b5f46c4e36b430) ) /* (2006/04/06 MASTER VER.) */
+ ROM_LOAD( "pnkswtsx_u2", 0x000000, 0x8400000, CRC(91e4deb2) SHA1(893cb10d6f805df7cb4a1bb709a3ea6de147b7e9) ) // (2006/xx/xx MASTER VER.) and (2006/04/06 MASTER VER.)
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4b82d250) SHA1(ee98dbc3f791efb6d58f3945bcb2044667ae7978) )
@@ -773,7 +774,7 @@ ROM_START( pinkswtsx )
ROM_RELOAD(0x200000,0x200000)
ROM_REGION( 0x8400000, "game", ROMREGION_ERASEFF)
- ROM_LOAD( "pnkswtsx_u2", 0x000000, 0x8400000, CRC(91e4deb2) SHA1(893cb10d6f805df7cb4a1bb709a3ea6de147b7e9) ) // (2006/xx/xx MASTER VER.)
+ ROM_LOAD( "pnkswtsx_u2", 0x000000, 0x8400000, CRC(91e4deb2) SHA1(893cb10d6f805df7cb4a1bb709a3ea6de147b7e9) ) // (2006/xx/xx MASTER VER.) and (2006/04/06 MASTER VER.)
ROM_REGION( 0x800000, "ymz770", ROMREGION_ERASEFF)
ROM_LOAD16_WORD_SWAP( "u23", 0x000000, 0x400000, CRC(4b82d250) SHA1(ee98dbc3f791efb6d58f3945bcb2044667ae7978) )
diff --git a/src/mame/drivers/dblcrown.cpp b/src/mame/drivers/dblcrown.cpp
index d766e0c425d..a251a42dcaa 100644
--- a/src/mame/drivers/dblcrown.cpp
+++ b/src/mame/drivers/dblcrown.cpp
@@ -387,7 +387,7 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( dblcrown )
PORT_START("IN0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Memory Reset")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Credit Reset")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_NAME("Note")
diff --git a/src/mame/drivers/deco32.cpp b/src/mame/drivers/deco32.cpp
index afb6c0a5033..131606916d5 100644
--- a/src/mame/drivers/deco32.cpp
+++ b/src/mame/drivers/deco32.cpp
@@ -808,7 +808,7 @@ READ32_MEMBER( deco32_state::fghthist_protection_region_0_146_r )
{
UINT32 retdata = 0x0000ffff;
- if (mem_mask & 0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
mem_mask >>=16;
@@ -826,7 +826,7 @@ READ32_MEMBER( deco32_state::fghthist_protection_region_0_146_r )
WRITE32_MEMBER( deco32_state::fghthist_protection_region_0_146_w )
{
- if (mem_mask & 0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
data >>=16;
mem_mask >>=16;
diff --git a/src/mame/drivers/deco_mlc.cpp b/src/mame/drivers/deco_mlc.cpp
index 61a6ab054b2..0365d844625 100644
--- a/src/mame/drivers/deco_mlc.cpp
+++ b/src/mame/drivers/deco_mlc.cpp
@@ -241,12 +241,12 @@ READ32_MEMBER( deco_mlc_state::mlc_spriteram_r )
{
UINT32 retdata = 0;
- if (mem_mask & 0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
retdata |= 0xffff0000;
}
- if (mem_mask & 0x0000ffff)
+ if (ACCESSING_BITS_0_15)
{
retdata |= m_mlc_spriteram[offset];
}
@@ -257,11 +257,11 @@ READ32_MEMBER( deco_mlc_state::mlc_spriteram_r )
WRITE32_MEMBER( deco_mlc_state::mlc_spriteram_w )
{
- if (mem_mask & 0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
}
- if (mem_mask & 0x0000ffff)
+ if (ACCESSING_BITS_0_15)
{
data &=0x0000ffff;
COMBINE_DATA(&m_mlc_spriteram[offset]);
diff --git a/src/mame/drivers/divebomb.cpp b/src/mame/drivers/divebomb.cpp
index e87e3c6d08d..e87e3c6d08d 100755..100644
--- a/src/mame/drivers/divebomb.cpp
+++ b/src/mame/drivers/divebomb.cpp
diff --git a/src/mame/drivers/dkong.cpp b/src/mame/drivers/dkong.cpp
index 546ef915830..93537dd6e80 100644
--- a/src/mame/drivers/dkong.cpp
+++ b/src/mame/drivers/dkong.cpp
@@ -355,6 +355,28 @@ Donkey Kong Notes
Not only did the eprom fix the ladder bug, but it also changed
the copyright screen to read "(C)1981 Nintendo of America".
+
+ --------------------------------------------------------------
+
+ Nintendo Service Department Bulletin # TKG-06 10-04-82
+ GAME: Donkey Kong
+ SUBJECT: Speed-up Kit #2
+
+ In an attempt to increase revenue of Donkey Kong we are making
+ available and updated speed-up kit, part number TKG-23-70.
+
+ The speed-up kit consists of two (2) EPROM's that are mounted
+ on the CPU P.C. Board. The replacement locations vary depend-
+ ing on the P.C. Board style.
+
+ P.C Board Style Eprom Location
+ --------------- --------------
+ TKG2 and TKG3 5F, 5K
+ TKG4 5A, 5E
+
+ These kits are available through all Nintendo distributors. If
+ your distributor is out, they can get immediate shipment from
+ our factory.
D2K Jumpman returns Notes
@@ -378,6 +400,9 @@ Donkey Kong Notes
Hopefully confirmation and information will come along later which confirms
this is a legitimate Nintendo Kit.
+
+ This is probably "Speed-up Kit #2" mentioned above, but this still needs to be
+ confirmed.
***************************************************************************/
diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp
index 55d360aaf68..60e9653a1d5 100644
--- a/src/mame/drivers/dreambal.cpp
+++ b/src/mame/drivers/dreambal.cpp
@@ -64,7 +64,7 @@ public:
logerror("dreambal_eeprom_w unhandled data %04x %04x\n",data&0x0fff8, mem_mask);
}
- if (mem_mask&0x00ff)
+ if (ACCESSING_BITS_0_7)
{
m_eeprom->clk_write(data &0x2 ? ASSERT_LINE : CLEAR_LINE);
m_eeprom->di_write(data &0x1);
diff --git a/src/mame/drivers/dvk_ksm.cpp b/src/mame/drivers/dvk_ksm.cpp
index 60cfee34578..855be480138 100644
--- a/src/mame/drivers/dvk_ksm.cpp
+++ b/src/mame/drivers/dvk_ksm.cpp
@@ -11,7 +11,13 @@
Hardware revisions (XXX verify everything):
- 7.102.076 -- has DIP switches, SRAM at 0x2000, model name "KSM"
- - 7.102.228 -- no DIP switches, SRAM at 0x2100, model name "KSM-01"
+ - 7.102.228 -- no DIP switches, ?? SRAM at 0x2100, model name "KSM-01"
+
+ Two sets of dumps exist:
+ - one puts SRAM at 0x2000, which is where technical manual puts it,
+ but chargen has 1 missing pixel in 'G' character.
+ - another puts SRAM at 0x2100, but has no missing pixel.
+ Merge them for now into one (SRAM at 0x2000 and no missing pixel).
Emulates a VT52 without copier (ESC Z response is ESC / M), with
Hold Screen mode and Graphics character set (but it is unique and
@@ -49,7 +55,7 @@ ksm|DVK KSM,
To do:
- verify if pixel stretching is done by hw
- verify details of hw revisions (memory map, DIP presence...)
- - baud rate selection (missing feature in bitbanger)
+ - baud rate selection
****************************************************************************/
@@ -222,8 +228,7 @@ WRITE8_MEMBER(ksm_state::ksm_ppi_portc_w)
WRITE_LINE_MEMBER(ksm_state::write_keyboard_clock)
{
-// KSM never sends data to keyboard
-// m_i8251kbd->write_txc(state);
+ m_i8251kbd->write_txc(state);
m_i8251kbd->write_rxc(state);
}
@@ -335,8 +340,7 @@ static MACHINE_CONFIG_START( ksm, ksm_state )
MCFG_CPU_IO_MAP(ksm_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic8259", pic8259_device, inta_cb)
- MCFG_TIMER_DRIVER_ADD_PERIODIC("scantimer", ksm_state, scanline_callback, attotime::from_hz(50*28*11))
- MCFG_TIMER_START_DELAY(attotime::from_hz(XTAL_15_4MHz/KSM_HORZ_START))
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ksm_state, scanline_callback, "screen", 0, 1)
MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green)
MCFG_SCREEN_UPDATE_DRIVER(ksm_state, screen_update)
@@ -383,30 +387,12 @@ static MACHINE_CONFIG_START( ksm, ksm_state )
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(ksm_state, write_keyboard_clock))
MACHINE_CONFIG_END
-
-/*
- Assumes that SRAM is at 0x2000, which is where technical manual puts it.
- Chargen has 1 missing pixel in 'G' character.
-*/
ROM_START( dvk_ksm )
ROM_REGION(0x1000, "maincpu", ROMREGION_ERASE00)
ROM_LOAD( "ksm_04_rom0_d32.bin", 0x0000, 0x0800, CRC(6ad62715) SHA1(20f8f95119bc7fc6e0f16c67864e339a86edb44d))
ROM_LOAD( "ksm_05_rom1_d33.bin", 0x0800, 0x0800, CRC(5b29bcd2) SHA1(1f4f82c2f88f1e8615ec02076559dc606497e654))
ROM_REGION(0x0800, "chargen", ROMREGION_ERASE00)
- ROM_LOAD("ksm_03_cg_d31.bin", 0x0000, 0x0800, CRC(98853aa7) SHA1(09b8e1b5b10a00c0b0ae7e36ad1328113d31230a))
-ROM_END
-
-/*
- Assumes that SRAM is at 0x2100, otherwise identical.
- Chargen has no missing pixels in 'G' character.
-*/
-ROM_START( dvk_ksm01 )
- ROM_REGION(0x1000, "maincpu", ROMREGION_ERASE00)
- ROM_LOAD( "ksm_04_rom0_d32.bin", 0x0000, 0x0800, CRC(5276dc9a) SHA1(dd41dfb4cb3f1cf22d96d95f1ff6a27fe4eb9a38))
- ROM_LOAD( "ksm_05_rom1_d33.bin", 0x0800, 0x0800, CRC(5b29bcd2) SHA1(1f4f82c2f88f1e8615ec02076559dc606497e654))
-
- ROM_REGION(0x0800, "chargen", ROMREGION_ERASE00)
ROM_LOAD("ksm_03_cg_d31.bin", 0x0000, 0x0800, CRC(6a8477e2) SHA1(c7871a96f135db05c3c8d718fbdf1728e22e72b7))
ROM_END
@@ -414,4 +400,3 @@ ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
COMP( 1986, dvk_ksm, 0, 0, ksm, ksm, driver_device, 0, "USSR", "DVK KSM", 0)
-COMP( 198?, dvk_ksm01,dvk_ksm,0, ksm, ksm, driver_device, 0, "USSR", "DVK KSM-01", 0)
diff --git a/src/mame/drivers/eacc.cpp b/src/mame/drivers/eacc.cpp
index cc91872dddf..3aef6f02258 100644
--- a/src/mame/drivers/eacc.cpp
+++ b/src/mame/drivers/eacc.cpp
@@ -96,7 +96,7 @@ static ADDRESS_MAP_START(eacc_mem, AS_PROGRAM, 8, eacc_state)
ADDRESS_MAP_GLOBAL_MASK(0xc7ff) // A11,A12,A13 not connected
AM_RANGE(0x0000, 0x001f) AM_RAM AM_SHARE("nvram") // inside cpu, battery-backed
AM_RANGE(0x0020, 0x007f) AM_RAM // inside cpu
- AM_RANGE(0x6000, 0x67ff) AM_ROM AM_MIRROR(0x8000)
+ AM_RANGE(0x4000, 0x47ff) AM_ROM AM_MIRROR(0x8000)
AM_RANGE(0x8000, 0x8003) AM_MIRROR(0x7fc) AM_DEVREADWRITE("pia", pia6821_device, read, write)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/feversoc.cpp b/src/mame/drivers/feversoc.cpp
index 9b4f1132140..e326faf7869 100644
--- a/src/mame/drivers/feversoc.cpp
+++ b/src/mame/drivers/feversoc.cpp
@@ -255,7 +255,7 @@ static INPUT_PORTS_START( feversoc )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Unknown (BTN5)") PORT_CODE(KEYCODE_J)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_NAME("Key Out (BTN6)")
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_NAME("Coin Out (BTN7)")
- PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Reset")
+ PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_MEMORY_RESET )
PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
diff --git a/src/mame/drivers/galaxy.cpp b/src/mame/drivers/galaxy.cpp
index 8a6a884ea8d..79f3b47ee61 100644
--- a/src/mame/drivers/galaxy.cpp
+++ b/src/mame/drivers/galaxy.cpp
@@ -37,8 +37,8 @@ Galaksija driver by Krzysztof Strzecha and Miodrag Milanovic
static ADDRESS_MAP_START (galaxyp_io, AS_IO, 8, galaxy_state )
ADDRESS_MAP_GLOBAL_MASK(0x01)
ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0xbe, 0xbe) AM_DEVWRITE("ay8910", ay8910_device, address_w)
- AM_RANGE(0xbf, 0xbf) AM_DEVWRITE("ay8910", ay8910_device, data_w)
+ AM_RANGE(0x00, 0x00) AM_DEVWRITE("ay8910", ay8910_device, address_w)
+ AM_RANGE(0x01, 0x01) AM_DEVWRITE("ay8910", ay8910_device, data_w)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/gambl186.cpp b/src/mame/drivers/gambl186.cpp
index 89e009743c5..37360a09512 100644
--- a/src/mame/drivers/gambl186.cpp
+++ b/src/mame/drivers/gambl186.cpp
@@ -347,8 +347,8 @@ WRITE16_MEMBER(gambl186_state::upd_w)
// m_upd7759->reset_w(0);
// m_upd7759->reset_w(1);
-// if (mem_mask&0x00ff) m_upd7759->port_w(space, 0, data & 0xff);
-// if (mem_mask&0xff00) m_upd7759->port_w(space, 0, (data >> 8) & 0xff);
+// if (ACCESSING_BITS_0_7) m_upd7759->port_w(space, 0, data & 0xff);
+// if (ACCESSING_BITS_8_15) m_upd7759->port_w(space, 0, (data >> 8) & 0xff);
data = (data >> 8);
popmessage("sample index: %02x", data);
diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp
index b58253c03b2..d1f46afc67d 100644
--- a/src/mame/drivers/gba.cpp
+++ b/src/mame/drivers/gba.cpp
@@ -475,12 +475,12 @@ READ32_MEMBER(gba_state::gba_io_r)
switch( offset )
{
case 0x0000/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: DISPCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_DISPCNT );
retval |= m_DISPCNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: Green Swap (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_GRNSWAP );
retval |= m_GRNSWAP << 16;
@@ -490,229 +490,229 @@ READ32_MEMBER(gba_state::gba_io_r)
retval = (m_DISPSTAT & 0xffff) | (machine().first_screen()->vpos()<<16);
break;
case 0x0008/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG0CNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_BG0CNT );
retval |= m_BG0CNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG1CNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_BG1CNT );
retval |= m_BG1CNT << 16;
}
break;
case 0x000c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2CNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_BG2CNT );
retval |= m_BG2CNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3CNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_BG3CNT );
retval |= m_BG3CNT << 16;
}
break;
case 0x0010/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG0HOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG0VOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0014/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG1HOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG1VOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0018/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2HOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2VOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x001c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3HOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3VOFS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0020/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2PA (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2PB (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0024/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2PC (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2PD (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0028/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2X_LSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2X_MSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x002c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2Y_LSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG2Y_MSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0030/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3PA (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3PB (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0034/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3PC (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3PD (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0038/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3X_LSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3X_MSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x003c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3Y_LSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BG3Y_MSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0040/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: WIN0H (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: WIN1H (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0044/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: WIN0V (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: WIN1V (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0048/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: WININ (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_WININ );
retval |= m_WININ;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: WINOUT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_WINOUT );
retval |= m_WINOUT << 16;
}
break;
case 0x004c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: MOSAIC (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0050/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BLDCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_BLDCNT );
retval |= m_BLDCNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: BLDALPHA (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_BLDALPHA );
retval |= m_BLDALPHA << 16;
}
break;
case 0x0054/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: BLDY (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0058/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x005c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), 0 );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
@@ -743,7 +743,7 @@ READ32_MEMBER(gba_state::gba_io_r)
break;
case 0x0080/4:
retval = m_gbsound->sound_r(space, 0x14) | m_gbsound->sound_r(space, 0x15)<<8;
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: SOUNDCNT_H (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_SOUNDCNT_H );
retval |= m_SOUNDCNT_H << 16;
@@ -753,12 +753,12 @@ READ32_MEMBER(gba_state::gba_io_r)
retval = m_gbsound->sound_r(space, 0x16);
break;
case 0x0088/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: SOUNDBIAS (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_SOUNDBIAS );
retval |= m_SOUNDBIAS;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
@@ -850,115 +850,115 @@ READ32_MEMBER(gba_state::gba_io_r)
}
break;
case 0x0120/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: SIOMULTI0 (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_SIOMULTI0 );
retval |= m_SIOMULTI0;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: SIOMULTI1 (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_SIOMULTI1 );
retval |= m_SIOMULTI1 << 16;
}
break;
case 0x0124/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: SIOMULTI2 (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_SIOMULTI2 );
retval |= m_SIOMULTI2;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: SIOMULTI3 (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_SIOMULTI3 );
retval |= m_SIOMULTI3 << 16;
}
break;
case 0x0128/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: SIOCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_SIOCNT );
retval |= m_SIOCNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: SIODATA8 (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_SIODATA8 );
retval |= m_SIODATA8 << 16;
}
break;
case 0x0130/4:
- if( (mem_mask) & 0x0000ffff ) // KEYINPUT
+ if( ACCESSING_BITS_0_15 ) // KEYINPUT
{
retval = m_io_inputs->read();
}
- else if( (mem_mask) & 0xffff0000 )
+ else if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: KEYCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_KEYCNT );
retval |= m_KEYCNT << 16;
}
break;
case 0x0134/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: RCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_RCNT );
retval |= m_RCNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: IR (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0140/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: JOYCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_JOYCNT );
retval |= m_JOYCNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0150/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: JOY_RECV_LSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_JOY_RECV & 0x0000ffff );
retval |= m_JOY_RECV & 0x0000ffff;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: JOY_RECV_MSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, ( m_JOY_RECV & 0xffff0000 ) >> 16 );
retval |= m_JOY_RECV & 0xffff0000;
}
break;
case 0x0154/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: JOY_TRANS_LSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_JOY_TRANS & 0x0000ffff );
retval |= m_JOY_TRANS & 0x0000ffff;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: JOY_TRANS_MSW (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, ( m_JOY_TRANS & 0xffff0000 ) >> 16 );
retval |= m_JOY_TRANS & 0xffff0000;
}
break;
case 0x0158/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: JOYSTAT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_JOYSTAT );
retval |= m_JOYSTAT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0200/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
// printf("Read: IE (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_IE );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: IF (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, m_IF );
}
@@ -966,23 +966,23 @@ READ32_MEMBER(gba_state::gba_io_r)
retval = m_IE | (m_IF<<16);
break;
case 0x0204/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: WAITCNT (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_WAITCNT );
retval |= m_WAITCNT;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
break;
case 0x0208/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Read: IME (%08x) = %04x\n", 0x04000000 + ( offset << 2 ), m_IME );
retval |= m_IME;
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Read: UNKNOWN (%08x) = %04x\n", 0x04000000 + ( offset << 2 ) + 2, 0 );
}
@@ -1002,10 +1002,10 @@ WRITE32_MEMBER(gba_state::gba_io_w)
switch( offset )
{
case 0x0000/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: DISPCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_DISPCNT = ( m_DISPCNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_DISPCNT);
if(m_DISPCNT & (DISPCNT_WIN0_EN | DISPCNT_WIN1_EN))
{
m_windowOn = 1;
@@ -1015,7 +1015,7 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_windowOn = 0;
}
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: Green Swap (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_GRNSWAP = ( m_GRNSWAP & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
@@ -1025,107 +1025,107 @@ WRITE32_MEMBER(gba_state::gba_io_w)
COMBINE_DATA(&m_DISPSTAT);
break;
case 0x0008/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG0CNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG0CNT = ( m_BG0CNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG0CNT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG1CNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG1CNT = ( m_BG1CNT & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x000c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2CNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG2CNT = ( m_BG2CNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG2CNT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3CNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG3CNT = ( m_BG3CNT & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0010/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG0HOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG0HOFS = ( m_BG0HOFS & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG0HOFS);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG0VOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG0VOFS = ( m_BG0VOFS & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0014/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG1HOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG1HOFS = ( m_BG1HOFS & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG1HOFS);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG1VOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG1VOFS = ( m_BG1VOFS & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0018/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2HOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG2HOFS = ( m_BG2HOFS & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG2HOFS);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2VOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG2VOFS = ( m_BG2VOFS & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x001c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3HOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG3HOFS = ( m_BG3HOFS & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG3HOFS);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3VOFS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG3VOFS = ( m_BG3VOFS & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0020/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2PA (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG2PA = ( m_BG2PA & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG2PA);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2PB (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG2PB = ( m_BG2PB & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0024/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2PC (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG2PC = ( m_BG2PC & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG2PC);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2PD (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG2PD = ( m_BG2PD & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0028/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2X_LSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2X_MSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
@@ -1133,11 +1133,11 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_gfxBG2Changed |= 1;
break;
case 0x002c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2Y_LSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG2Y_MSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
@@ -1145,35 +1145,35 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_gfxBG2Changed |= 2;
break;
case 0x0030/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3PA (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG3PA = ( m_BG3PA & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG3PA);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3PB (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG3PB = ( m_BG3PB & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0034/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3PC (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BG3PC = ( m_BG3PC & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BG3PC);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3PD (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BG3PD = ( m_BG3PD & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0038/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3X_LSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3X_MSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
@@ -1181,11 +1181,11 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_gfxBG3Changed |= 1;
break;
case 0x003c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3Y_LSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BG3Y_MSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
@@ -1193,57 +1193,57 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_gfxBG3Changed |= 2;
break;
case 0x0040/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: WIN0H (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_WIN0H = ( m_WIN0H & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_WIN0H);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: WIN1H (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_WIN1H = ( m_WIN1H & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0044/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: WIN0V (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_WIN0V = ( m_WIN0V & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_WIN0V);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: WIN1V (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_WIN1V = ( m_WIN1V & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0048/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: WININ (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_WININ = ( m_WININ & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_WININ);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: WINOUT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_WINOUT = ( m_WINOUT & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x004c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: MOSAIC (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_MOSAIC = ( m_MOSAIC & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_MOSAIC);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
break;
case 0x0050/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BLDCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BLDCNT = ( m_BLDCNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BLDCNT);
if(m_BLDCNT & BLDCNT_SFX)
{
m_fxOn = 1;
@@ -1253,142 +1253,142 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_fxOn = 0;
}
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: BLDALPHA (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
m_BLDALPHA = ( m_BLDALPHA & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0054/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: BLDY (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_BLDY = ( m_BLDY & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_BLDY);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
break;
case 0x0058/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
break;
case 0x005c/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
break;
case 0x0060/4:
- if( (mem_mask) & 0x000000ff ) // SOUNDCNTL
+ if( ACCESSING_BITS_0_7 ) // SOUNDCNTL
{
m_gbsound->sound_w(space, 0, data);
}
- if( (mem_mask) & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
m_gbsound->sound_w(space, 1, data>>16); // SOUND1CNT_H
}
- if( (mem_mask) & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
m_gbsound->sound_w(space, 2, data>>24);
}
break;
case 0x0064/4:
- if( (mem_mask) & 0x000000ff ) // SOUNDCNTL
+ if( ACCESSING_BITS_0_7 ) // SOUNDCNTL
{
m_gbsound->sound_w(space, 3, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 4, data>>8); // SOUND1CNT_H
}
break;
case 0x0068/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 6, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 7, data>>8);
}
break;
case 0x006c/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 8, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 9, data>>8);
}
break;
case 0x0070/4: //SND3CNTL and H
- if( (mem_mask) & 0x000000ff ) // SOUNDCNTL
+ if( ACCESSING_BITS_0_7 ) // SOUNDCNTL
{
m_gbsound->sound_w(space, 0xa, data);
}
- if( (mem_mask) & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
m_gbsound->sound_w(space, 0xb, data>>16); // SOUND1CNT_H
}
- if( (mem_mask) & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
m_gbsound->sound_w(space, 0xc, data>>24);
}
break;
case 0x0074/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 0xd, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 0xe, data>>8);
}
break;
case 0x0078/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 0x10, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 0x11, data>>8);
}
break;
case 0x007c/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 0x12, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 0x13, data>>8);
}
break;
case 0x0080/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 0x14, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->sound_w(space, 0x15, data>>8);
}
- if ((mem_mask) & 0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
data >>= 16;
m_SOUNDCNT_H = data;
@@ -1413,7 +1413,7 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
break;
case 0x0084/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->sound_w(space, 0x16, data);
if ((data & 0x80) && !(m_SOUNDCNT_X & 0x80))
@@ -1429,84 +1429,84 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
break;
case 0x0088/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: SOUNDBIAS (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x0000ffff, ~mem_mask );
- m_SOUNDBIAS = ( m_SOUNDBIAS & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_SOUNDBIAS);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
break;
case 0x0090/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->wave_w(space, 0, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->wave_w(space, 1, data>>8);
}
- if( (mem_mask) & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
m_gbsound->wave_w(space, 2, data>>16);
}
- if( (mem_mask) & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
m_gbsound->wave_w(space, 3, data>>24);
}
break;
case 0x0094/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->wave_w(space, 4, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->wave_w(space, 5, data>>8);
}
- if( (mem_mask) & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
m_gbsound->wave_w(space, 6, data>>16);
}
- if( (mem_mask) & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
m_gbsound->wave_w(space, 7, data>>24);
}
break;
case 0x0098/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->wave_w(space, 8, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->wave_w(space, 9, data>>8);
}
- if( (mem_mask) & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
m_gbsound->wave_w(space, 0xa, data>>16);
}
- if( (mem_mask) & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
m_gbsound->wave_w(space, 0xb, data>>24);
}
break;
case 0x009c/4:
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
m_gbsound->wave_w(space, 0xc, data);
}
- if( (mem_mask) & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
m_gbsound->wave_w(space, 0xd, data>>8);
}
- if( (mem_mask) & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
m_gbsound->wave_w(space, 0xe, data>>16);
}
- if( (mem_mask) & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
m_gbsound->wave_w(space, 0xf, data>>24);
}
@@ -1642,31 +1642,31 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
break;
case 0x0120/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: SIOMULTI0 (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_SIOMULTI0 = ( m_SIOMULTI0 & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_SIOMULTI0);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: SIOMULTI1 (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
m_SIOMULTI1 = ( m_SIOMULTI1 & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0124/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: SIOMULTI2 (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_SIOMULTI2 = ( m_SIOMULTI2 & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_SIOMULTI2);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: SIOMULTI3 (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
m_SIOMULTI3 = ( m_SIOMULTI3 & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0128/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: SIOCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
// normal mode ?
@@ -1683,16 +1683,16 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
}
}
- m_SIOCNT = ( m_SIOCNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_SIOCNT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: SIODATA8 (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
m_SIODATA8 = ( m_SIODATA8 & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0130/4:
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
// printf("KEYCNT = %04x\n", data>>16);
verboselog(*this, 2, "GBA IO Register Write: KEYCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
@@ -1700,68 +1700,68 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
break;
case 0x0134/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: RCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_RCNT = ( m_RCNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_RCNT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: IR (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
m_IR = ( m_IR & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0140/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: JOYCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_JOYCNT = ( m_JOYCNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_JOYCNT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
}
break;
case 0x0150/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: JOY_RECV_LSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_JOY_RECV = ( m_JOY_RECV & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_JOY_RECV);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: JOY_RECV_MSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
m_JOY_RECV = ( m_JOY_RECV & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0154/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: JOY_TRANS_LSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_JOY_TRANS = ( m_JOY_TRANS & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_JOY_TRANS);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: JOY_TRANS_MSW (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
m_JOY_TRANS = ( m_JOY_TRANS & ( ~mem_mask >> 16 ) ) | ( ( data & mem_mask ) >> 16 );
}
break;
case 0x0158/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: JOYSTAT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_JOYSTAT = ( m_JOYSTAT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_JOYSTAT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
}
break;
case 0x0200/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
// printf("IE (%08x) = %04x raw %x (%08x) (scan %d PC %x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, data, ~mem_mask, machine.first_screen()->vpos(), space.device().safe_pc());
- m_IE = ( m_IE & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_IE);
#if 0
if (m_IE & m_IF)
{
@@ -1769,7 +1769,7 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
#endif
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: IF (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ) + 2, ( data & mem_mask ) >> 16, ~mem_mask );
m_IF &= ~( ( data & mem_mask ) >> 16 );
@@ -1782,35 +1782,35 @@ WRITE32_MEMBER(gba_state::gba_io_w)
}
break;
case 0x0204/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 2, "GBA IO Register Write: WAITCNT (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_WAITCNT = ( m_WAITCNT & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_WAITCNT);
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
}
break;
case 0x0208/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
verboselog(*this, 3, "GBA IO Register Write: IME (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, ~mem_mask );
- m_IME = ( m_IME & ~mem_mask ) | ( data & mem_mask );
+ COMBINE_DATA(&m_IME);
if (m_IF)
{
m_irq_timer->adjust(attotime::zero);
}
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 3, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & mem_mask ) >> 16, ~mem_mask );
}
break;
case 0x0300/4:
- if( (mem_mask) & 0x0000ffff )
+ if( ACCESSING_BITS_0_15 )
{
- if( (mem_mask) & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
verboselog(*this, 2, "GBA IO Register Write: POSTFLG (%08x) = %02x (%08x)\n", 0x04000000 + ( offset << 2 ), data & 0x000000ff, ~mem_mask );
m_POSTFLG = data & 0x000000ff;
@@ -1823,7 +1823,7 @@ WRITE32_MEMBER(gba_state::gba_io_w)
m_maincpu->spin_until_interrupt();
}
}
- if( (mem_mask) & 0xffff0000 )
+ if( ACCESSING_BITS_16_31 )
{
verboselog(*this, 2, "GBA IO Register Write: UNKNOWN (%08x) = %04x (%08x)\n", 0x04000000 + ( offset << 2 ), ( data & 0xffff0000 ) >> 16, ~mem_mask );
}
diff --git a/src/mame/drivers/geneve.cpp b/src/mame/drivers/geneve.cpp
index bcf8acee880..866805420d9 100644
--- a/src/mame/drivers/geneve.cpp
+++ b/src/mame/drivers/geneve.cpp
@@ -218,8 +218,8 @@
#define TRACE_LINES 0
#define TRACE_CRU 0
-#define SRAM_SIZE 384*1024 // maximum SRAM expansion on-board
-#define DRAM_SIZE 512*1024
+#define SRAM_GEN_TAG "sram"
+#define DRAM_GEN_TAG "dram"
class geneve_state : public driver_device
{
@@ -355,7 +355,7 @@ WRITE8_MEMBER ( geneve_state::cruwrite )
if ((addroff & 0xffc0) == CRU_SSTEP_BASE)
{
int bit = (addroff & 0x003e)>>1;
- logerror("geneve: Single step not implemented; bit %d set to %d\n", bit, data);
+ logerror("Single step not implemented; bit %d set to %d\n", bit, data);
return;
}
@@ -366,47 +366,47 @@ WRITE8_MEMBER ( geneve_state::cruwrite )
{
case 5:
// No one really cares...
- if (TRACE_CRU) logerror("geneve: Set PAL flag = %02x\n", data);
+ if (TRACE_CRU) logerror("Set PAL flag = %02x\n", data);
// m_palvideo = (data!=0);
break;
case 7:
// m_capslock = (data!=0);
- if (TRACE_CRU) logerror("geneve: Set capslock flag = %02x\n", data);
+ if (TRACE_CRU) logerror("Set capslock flag = %02x\n", data);
break;
case 8:
- if (TRACE_CRU) logerror("geneve: Set keyboard clock flag = %02x\n", data);
+ if (TRACE_CRU) logerror("Set keyboard clock flag = %02x\n", data);
m_keyboard->clock_control((data!=0)? ASSERT_LINE : CLEAR_LINE);
break;
case 9:
- if (TRACE_CRU) logerror("geneve: Set keyboard scan flag = %02x\n", data);
+ if (TRACE_CRU) logerror("Set keyboard scan flag = %02x\n", data);
m_keyboard->send_scancodes((data!=0)? ASSERT_LINE : CLEAR_LINE);
break;
case 10:
- if (TRACE_CRU) logerror("geneve: Geneve mode = %02x\n", data);
+ if (TRACE_CRU) logerror("Geneve mode = %02x\n", data);
m_mapper->set_geneve_mode(data!=0);
break;
case 11:
- if (TRACE_CRU) logerror("geneve: Direct mode = %02x\n", data);
+ if (TRACE_CRU) logerror("Direct mode = %02x\n", data);
m_mapper->set_direct_mode(data!=0);
break;
case 12:
- if (TRACE_CRU) logerror("geneve: Cartridge size 8K = %02x\n", data);
+ if (TRACE_CRU) logerror("Cartridge size 8K = %02x\n", data);
m_mapper->set_cartridge_size((data!=0)? 0x2000 : 0x4000);
break;
case 13:
- if (TRACE_CRU) logerror("geneve: Cartridge writable 6000 = %02x\n", data);
+ if (TRACE_CRU) logerror("Cartridge writable 6000 = %02x\n", data);
m_mapper->set_cartridge_writable(0x6000, (data!=0));
break;
case 14:
- if (TRACE_CRU) logerror("geneve: Cartridge writable 7000 = %02x\n", data);
+ if (TRACE_CRU) logerror("Cartridge writable 7000 = %02x\n", data);
m_mapper->set_cartridge_writable(0x7000, (data!=0));
break;
case 15:
- if (TRACE_CRU) logerror("geneve: Extra wait states = %02x\n", data==0);
+ if (TRACE_CRU) logerror("Extra wait states = %02x\n", data==0);
m_mapper->set_extra_waitstates(data==0); // let's use the inverse semantics
break;
default:
- logerror("geneve: set CRU address %04x=%02x ignored\n", addroff, data);
+ logerror("set CRU address %04x=%02x ignored\n", addroff, data);
break;
}
}
@@ -426,7 +426,7 @@ READ8_MEMBER( geneve_state::cruread )
if ((addroff & 0xffc0) == CRU_SSTEP_BASE)
{
int bit = (addroff & 0x003e)>>1;
- logerror("geneve: Single step not implemented; attempting to read bit %d\n", bit);
+ logerror("Single step not implemented; attempting to read bit %d\n", bit);
return value;
}
@@ -478,7 +478,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 (TRACE_LINES) logerror("geneve: INT15-8 = %02x\n", answer);
+ if (TRACE_LINES) logerror("INT15-8 = %02x\n", answer);
break;
case TMS9901_P0_P7:
@@ -506,7 +506,7 @@ READ8_MEMBER( geneve_state::read_by_9901 )
*/
WRITE_LINE_MEMBER( geneve_state::peripheral_bus_reset )
{
- logerror("geneve: Peripheral bus reset request; not implemented yet.\n");
+ logerror("Peripheral bus reset request; not implemented yet.\n");
}
/*
@@ -514,7 +514,7 @@ WRITE_LINE_MEMBER( geneve_state::peripheral_bus_reset )
*/
WRITE_LINE_MEMBER( geneve_state::VDP_reset )
{
- logerror("geneve: Video reset request; not implemented yet.\n");
+ logerror("Video reset request; not implemented yet.\n");
}
/*
@@ -530,7 +530,7 @@ WRITE_LINE_MEMBER( geneve_state::joystick_select )
*/
WRITE_LINE_MEMBER( geneve_state::extbus_wait_states )
{
- logerror("geneve: External bus wait states set to %d, not implemented yet.\n", state);
+ logerror("External bus wait states set to %d, not implemented yet.\n", state);
}
/*
@@ -539,7 +539,7 @@ WRITE_LINE_MEMBER( geneve_state::extbus_wait_states )
*/
WRITE_LINE_MEMBER( geneve_state::video_wait_states )
{
- if (TRACE_LINES) logerror("geneve: Video wait states set to %d\n", state);
+ if (TRACE_LINES) logerror("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;
}
@@ -581,14 +581,14 @@ WRITE_LINE_MEMBER( geneve_state::intb )
WRITE_LINE_MEMBER( geneve_state::ext_ready )
{
- if (TRACE_READY) logerror("geneve: READY level (ext) = %02x\n", state);
+ if (TRACE_READY) logerror("READY level (ext) = %02x\n", state);
m_ready_line = state;
m_cpu->ready_line((m_ready_line == ASSERT_LINE && m_ready_line1 == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE);
}
WRITE_LINE_MEMBER( geneve_state::mapper_ready )
{
- if (TRACE_READY) logerror("geneve: READY level (mapper) = %02x\n", state);
+ if (TRACE_READY) logerror("READY level (mapper) = %02x\n", state);
m_ready_line1 = state;
m_cpu->ready_line((m_ready_line == ASSERT_LINE && m_ready_line1 == ASSERT_LINE)? ASSERT_LINE : CLEAR_LINE);
}
@@ -633,7 +633,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 (offset != IDLE_OP) logerror("geneve: External operation %s not implemented on Geneve board\n", extop[offset]);
+ if (offset != IDLE_OP) logerror("External operation %s not implemented on Geneve board\n", extop[offset]);
}
/*
@@ -740,6 +740,16 @@ static MACHINE_CONFIG_START( geneve_60hz, geneve_state )
MCFG_AT29C040_ADD( PFM512_TAG )
MCFG_AT29C040A_ADD( PFM512A_TAG )
+ // DRAM 512K
+ MCFG_RAM_ADD(DRAM_GEN_TAG)
+ MCFG_RAM_DEFAULT_SIZE("512K")
+ MCFG_RAM_DEFAULT_VALUE(0)
+
+ // SRAM 384K (max; stock Geneve: 32K)
+ MCFG_RAM_ADD(SRAM_GEN_TAG)
+ MCFG_RAM_DEFAULT_SIZE("384K")
+ MCFG_RAM_DEFAULT_VALUE(0)
+
MACHINE_CONFIG_END
/*
@@ -752,12 +762,6 @@ ROM_START(geneve)
ROM_LOAD("genbt100.bin", 0x0000, 0x4000, CRC(8001e386) SHA1(b44618b54dabac3882543e18555d482b299e0109)) /* CPU ROMs v1.0 */
ROM_LOAD_OPTIONAL("genbt098.bin", 0x4000, 0x4000, CRC(b2e20df9) SHA1(2d5d09177afe97d63ceb3ad59b498b1c9e2153f7)) /* CPU ROMs v0.98 */
ROM_LOAD_OPTIONAL("gnmbt100.bin", 0x8000, 0x4000, CRC(19b89479) SHA1(6ef297eda78dc705946f6494e9d7e95e5216ec47)) /* CPU ROMs GenMod */
-
- ROM_REGION(SRAM_SIZE, SRAM_TAG, 0)
- ROM_FILL(0x0000, SRAM_SIZE, 0x00)
-
- ROM_REGION(DRAM_SIZE, DRAM_TAG, 0)
- ROM_FILL(0x0000, DRAM_SIZE, 0x00)
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
diff --git a/src/mame/drivers/glass.cpp b/src/mame/drivers/glass.cpp
index 5711341018f..285970b54e7 100644
--- a/src/mame/drivers/glass.cpp
+++ b/src/mame/drivers/glass.cpp
@@ -388,7 +388,7 @@ WRITE16_MEMBER( glass_state::mainram_w )
{
// printf("%06x write %06x - %04x %04x\n", pc, (offset*2 + 0xfec000), data, mem_mask);
// several checks write here then expect it to appear mirrored, might be some kind of command + command ack
- if (mem_mask & 0xff00) // sometimes mask 0xff00, but not in cases which poll for change
+ if (ACCESSING_BITS_8_15) // sometimes mask 0xff00, but not in cases which poll for change
{
mem_mask = 0x00ff;
data >>=8;
diff --git a/src/mame/drivers/goldnpkr.cpp b/src/mame/drivers/goldnpkr.cpp
index 591d3e8a589..c70d153a41d 100644
--- a/src/mame/drivers/goldnpkr.cpp
+++ b/src/mame/drivers/goldnpkr.cpp
@@ -1690,7 +1690,7 @@ static ADDRESS_MAP_START( wildcrdb_map, AS_PROGRAM, 8, goldnpkr_state )
AM_RANGE(0x2100, 0x2100) AM_DEVWRITE("crtc", mc6845_device, address_w)
AM_RANGE(0x2101, 0x2101) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
AM_RANGE(0x2800, 0x2fff) AM_RAM
- AM_RANGE(0x3000, 0xffff) AM_ROM
+ AM_RANGE(0x3000, 0x7fff) AM_ROM
ADDRESS_MAP_END
static ADDRESS_MAP_START( wildcrdb_mcu_map, AS_PROGRAM, 8, goldnpkr_state )
diff --git a/src/mame/drivers/hnayayoi.cpp b/src/mame/drivers/hnayayoi.cpp
index 3afc8c0def9..39c2081a0bf 100644
--- a/src/mame/drivers/hnayayoi.cpp
+++ b/src/mame/drivers/hnayayoi.cpp
@@ -21,7 +21,7 @@ Year + Game Board
---------------------------------------
Notes:
-- In service mode, press "analyzer" (0) and "test" (F1) to see a gfx test
+- In service mode, press "analyzer" (0) and "test" (F2) to see a gfx test
- hnfubuki doesn't have a service mode dip, press "analyzer" instead
@@ -269,7 +269,9 @@ static INPUT_PORTS_START( hnayayoi )
PORT_START("DSW3") /* DSW3 */
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) // blitter busy flag
- PORT_SERVICE( 0x02, IP_ACTIVE_LOW )
+ PORT_DIPNAME( 0x02, 0x02, DEF_STR( Service_Mode ) )
+ 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 ) )
@@ -292,7 +294,7 @@ static INPUT_PORTS_START( hnayayoi )
PORT_START("COIN") /* COIN */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1) // there is also a dip switch
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) // there is also a dip switch
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Analizer")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "Non Use" in service mode
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) /* "Note" ("Paper Money") = 10 Credits */
@@ -382,9 +384,9 @@ static INPUT_PORTS_START( hnfubuki )
PORT_START("COIN") /* COIN */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test ))
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Analizer")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Memory Reset")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) /* "Note" ("Paper Money") = 10 Credits */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
@@ -446,9 +448,9 @@ static INPUT_PORTS_START( untoucha )
PORT_START("COIN") /* COIN */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F1)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test ))
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Analizer")
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Memory Reset")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MEMORY_RESET )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) /* "Note" ("Paper Money") = 5 or 8 Credits */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 )
diff --git a/src/mame/drivers/hyhoo.cpp b/src/mame/drivers/hyhoo.cpp
index 9def22372b7..64fcee9eda1 100644
--- a/src/mame/drivers/hyhoo.cpp
+++ b/src/mame/drivers/hyhoo.cpp
@@ -109,7 +109,7 @@ static INPUT_PORTS_START( hyhoo )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, hyhoo_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // NOT USED
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // SERVICE
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Memory Reset") // MEMORY RESET
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // NOT USED
@@ -184,7 +184,7 @@ static INPUT_PORTS_START( hyhoo2 )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, hyhoo_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // NOT USED
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // SERVICE
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Memory Reset") // MEMORY RESET
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // NOT USED
diff --git a/src/mame/drivers/jangou.cpp b/src/mame/drivers/jangou.cpp
index 64c34ac3cf2..250db8e3d38 100644
--- a/src/mame/drivers/jangou.cpp
+++ b/src/mame/drivers/jangou.cpp
@@ -763,7 +763,7 @@ static INPUT_PORTS_START( roylcrdn )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* Spare 2 */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME("Note In") /* Note In */
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE PORT_CODE(KEYCODE_9) PORT_NAME("Memory Reset") /* Memory Reset */
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE PORT_CODE(KEYCODE_9) /* Memory Reset */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE PORT_CODE(KEYCODE_0) PORT_NAME("Analyzer") /* Analyzer */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_TOGGLE PORT_CODE(KEYCODE_F2) PORT_NAME("Test Mode") /* Test Mode */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") /* Coin In */
diff --git a/src/mame/drivers/juicebox.cpp b/src/mame/drivers/juicebox.cpp
index f0e58b3138c..a024b893759 100644
--- a/src/mame/drivers/juicebox.cpp
+++ b/src/mame/drivers/juicebox.cpp
@@ -223,10 +223,10 @@ WRITE32_MEMBER(juicebox_state::s3c44b0_gpio_port_w)
READ32_MEMBER(juicebox_state::juicebox_nand_r)
{
UINT32 data = 0;
- if (mem_mask & 0x000000FF) data = data | (smc_read() << 0);
- if (mem_mask & 0x0000FF00) data = data | (smc_read() << 8);
- if (mem_mask & 0x00FF0000) data = data | (smc_read() << 16);
- if (mem_mask & 0xFF000000) data = data | (smc_read() << 24);
+ if (ACCESSING_BITS_0_7) data = data | (smc_read() << 0);
+ if (ACCESSING_BITS_8_15) data = data | (smc_read() << 8);
+ if (ACCESSING_BITS_16_23) data = data | (smc_read() << 16);
+ if (ACCESSING_BITS_24_31) data = data | (smc_read() << 24);
verboselog( 5, "juicebox_nand_r %08X %08X %08X\n", offset, mem_mask, data);
return data;
}
@@ -234,10 +234,10 @@ READ32_MEMBER(juicebox_state::juicebox_nand_r)
WRITE32_MEMBER(juicebox_state::juicebox_nand_w)
{
verboselog( 5, "juicebox_nand_w %08X %08X %08X\n", offset, mem_mask, data);
- if (mem_mask & 0x000000FF) smc_write((data >> 0) & 0xFF);
- if (mem_mask & 0x0000FF00) smc_write((data >> 8) & 0xFF);
- if (mem_mask & 0x00FF0000) smc_write((data >> 16) & 0xFF);
- if (mem_mask & 0xFF000000) smc_write((data >> 24) & 0xFF);
+ if (ACCESSING_BITS_0_7) smc_write((data >> 0) & 0xFF);
+ if (ACCESSING_BITS_8_15) smc_write((data >> 8) & 0xFF);
+ if (ACCESSING_BITS_16_23) smc_write((data >> 16) & 0xFF);
+ if (ACCESSING_BITS_24_31) smc_write((data >> 24) & 0xFF);
}
// I2S
diff --git a/src/mame/drivers/kurukuru.cpp b/src/mame/drivers/kurukuru.cpp
index 2e003469c0c..bc9b968bf7e 100644
--- a/src/mame/drivers/kurukuru.cpp
+++ b/src/mame/drivers/kurukuru.cpp
@@ -124,12 +124,17 @@
3) Pyon Pyon Jump (a contents where the same characters try to cross the river jumping on pads).
4) Sui Sui Pyon Pyon (a swimming competition where the same characters swim with different styles, even walking).
- Coin 1 (key 5) could be set either as Coin 1 or as Payout button, through
- a DIP switch.
+ The 100 Yen coin input (key 7) can be set as "Exchange" through a DIP switch, in
+ which case its value is not accepted as credits but immediately paid out in
+ "medals."
If you get a 'medal jam' error, and the game is not responding anymore, press
- RESET (key 9), and the game will reset to default values (even all counters
- will be cleared).
+ RESET (key F1), and the game will reset to default values (even all counters
+ will be cleared; the program does this by zeroing the magic byte preceding the
+ game ID string copied with it into NVRAM and then jumping to the boot routine).
+
+ The tables for the I/O routines have room for 7 coin inputs (address + mask) and
+ 3 output latches, but only 3 coin inputs and 1 output latch are defined and used.
************************************************************************************
@@ -145,9 +150,9 @@
How to play...
Insert tokens (medals).
- You can bet to any (or all) of the following 5 characters: Bote, Oume, Pyoko,
- Kunio, and Pyon Pyon. Press start, and the reels start to roll. You'll win if
- you can get 3 of the chosen character(s) in a row, column or diagonal.
+ You can bet to any (or all) of the following 5 characters: Botechin, Oume,
+ Pyokorin, Kunio, and Pyon-Pyon. Press start, and the reels start to roll. You'll
+ win if you can get 3 of the chosen character(s) in a row, column or diagonal.
The black tadpoles behave just like jokers... If you have 2 chosen characters
in a row and the remaining one is a black tadpole, it will transform into another
@@ -254,6 +259,9 @@
#include "machine/nvram.h"
#include "machine/gen_latch.h"
+#define UNICODE_10YEN "\xC2\xA5" "10"
+#define UNICODE_100YEN "\xC2\xA5" "100"
+
class kurukuru_state : public driver_device
{
public:
@@ -361,7 +369,7 @@ WRITE8_MEMBER(kurukuru_state::kurukuru_out_latch_w)
machine().bookkeeping().coin_counter_w(0, data & 0x01); /* Coin Counter 1 */
machine().bookkeeping().coin_counter_w(1, data & 0x20); /* Coin Counter 2 */
machine().bookkeeping().coin_lockout_global_w(data & 0x40); /* Coin Lock */
- m_hopper->write(space, 0, (data & 0x40)); /* Hopper Motor */
+ m_hopper->write(space, 0, (data & 0x40) ? 0x80 : 0); /* Hopper Motor */
if (data & 0x9e)
logerror("kurukuru_out_latch_w %02X @ %04X\n", data, space.device().safe_pc());
@@ -540,13 +548,13 @@ static INPUT_PORTS_START( kurukuru )
/* bits d0-d3 are JAMMA top side pins 20,21,22,23, bits d4-d7 are JAMMA bottom side pins 20,21,22,23
so that's player 1 left/right/button1/button2 then player 2 left/right/button1/button2
*/
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("1st (Bote/Botechin)") // edge connector pin 20 top
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("1st (Botechin)") // edge connector pin 20 top
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("2nd (Oume)") // edge connector pin 21 top
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyoko/Pyokorin)") // edge connector pin 22 top
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyokorin)") // edge connector pin 22 top
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("4th (Kunio)") // edge connector pin 23 top
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("5th (Pyon-Pyon)") // edge connector pin 20 bottom
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("Unknown A0h - bit5") // edge connector pin 21 bottom
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("Unknown A0h - bit6") // edge connector pin 22 bottom
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) // edge connector pin 21 bottom
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // edge connector pin 22 bottom
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) // edge connector pin 23 bottom
PORT_START("IN1")
@@ -554,16 +562,16 @@ static INPUT_PORTS_START( kurukuru )
so that's test, tilt/slam, coin 1, coin 2, p1 start, p2 start, p1 button 3, p2 button 3
*/
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // edge connector pin 15 top
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") // edge connector pin 15 bottom
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Reset Button") // edge connector pin 16 top
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) // edge connector pin 16 bottom
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown B0h - bit4") // edge connector pin 17 top (active)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE (2) // edge connector pin 17 bottom
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Medal In") // edge connector pin 15 bottom
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // edge connector pin 16 top
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME(UNICODE_10YEN " In") // edge connector pin 16 bottom
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // edge connector pin 17 top (active)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME(UNICODE_100YEN " In") PORT_IMPULSE(2) // edge connector pin 17 bottom
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback, edge connector pin 24 top
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // edge connector pin 24 bottom
PORT_START("DSW1") // found in the PCB: 11111111
- PORT_DIPNAME( 0x07, 0x00, "Coinage A (100 Y)" ) PORT_DIPLOCATION("DSW1:1,2,3")
+ PORT_DIPNAME( 0x07, 0x00, "Coinage A (" UNICODE_100YEN ")" ) PORT_DIPLOCATION("DSW1:1,2,3")
PORT_DIPSETTING( 0x02, "1 Coin / 3 Medal" )
PORT_DIPSETTING( 0x06, "1 Coin / 4 Medal" )
PORT_DIPSETTING( 0x01, "1 Coin / 5 Medal" )
@@ -572,17 +580,17 @@ static INPUT_PORTS_START( kurukuru )
PORT_DIPSETTING( 0x07, "1 Coin / 11 Medal" )
PORT_DIPSETTING( 0x04, "1 Coin / 20 Medal" )
PORT_DIPSETTING( 0x00, "1 Coin / 50 Medal" )
- PORT_DIPNAME( 0x18, 0x00, "Coinage B (10 Y)" ) PORT_DIPLOCATION("DSW1:4,5")
+ PORT_DIPNAME( 0x18, 0x00, "Coinage B (" UNICODE_10YEN ")" ) PORT_DIPLOCATION("DSW1:4,5")
PORT_DIPSETTING( 0x00, "3 Coin / 1 Medal" )
PORT_DIPSETTING( 0x10, "2 Coin / 1 Medal" )
PORT_DIPSETTING( 0x18, "1 Coin / 1 Medal" )
PORT_DIPSETTING( 0x08, "1 Coin / 2 Medal" )
PORT_DIPNAME( 0x20, 0x00, "Coinage Config" ) PORT_DIPLOCATION("DSW1:6")
- PORT_DIPSETTING( 0x00, "Coin 1 = Normal; Medal In = 2 Credits by Medal" )
- PORT_DIPSETTING( 0x20, "Coin 1 = Payout; Medal In = 1 Credit by Medal" )
+ PORT_DIPSETTING( 0x00, UNICODE_100YEN " = Credits; Medal In = 2 Credits by Medal" )
+ PORT_DIPSETTING( 0x20, UNICODE_100YEN " = Exchange; Medal In = 1 Credit by Medal" )
PORT_DIPNAME( 0x40, 0x00, "Payout Mode" ) PORT_DIPLOCATION("DSW1:7")
- PORT_DIPSETTING( 0x40, "Manual" )
- PORT_DIPSETTING( 0x00, "Automatic" )
+ PORT_DIPSETTING( 0x40, "Automatic" )
+ PORT_DIPSETTING( 0x00, "Manual" )
PORT_DIPNAME( 0x80, 0x00, "Repeat Last Bet") PORT_DIPLOCATION("DSW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
@@ -625,8 +633,8 @@ static INPUT_PORTS_START( ppj )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("3rd (Pyon-Pyon)") // edge connector pin 22 top
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("4th (Pyokorin)") // edge connector pin 23 top
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("5th (Botechin)") // edge connector pin 20 bottom
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("Unknown 70h - bit5") // edge connector pin 21 bottom (active)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("Unknown 70h - bit6") // edge connector pin 22 bottom (active)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) // edge connector pin 21 bottom (active)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // edge connector pin 22 bottom (active)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) // edge connector pin 23 bottom
PORT_START("IN1")
@@ -634,16 +642,16 @@ static INPUT_PORTS_START( ppj )
so that's test, tilt/slam, coin 1, coin 2, p1 start, p2 start, p1 button 3, p2 button 3
*/
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // edge connector pin 15 top
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME("Medal In") // edge connector pin 15 bottom
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Reset Button") // edge connector pin 16 top
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) // edge connector pin 16 bottom
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Unknown 60h - bit4") // edge connector pin 17 top (active)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE (2) // edge connector pin 17 bottom
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Medal In") // edge connector pin 15 bottom
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // edge connector pin 16 top
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_NAME(UNICODE_10YEN " In") // edge connector pin 16 bottom
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // edge connector pin 17 top (active)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_NAME(UNICODE_100YEN " In") PORT_IMPULSE(2) // edge connector pin 17 bottom
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r) // hopper feedback, edge connector pin 24 top
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // edge connector pin 24 bottom
PORT_START("DSW1") // found in the PCB: 00000000 (arranged for sale since they are uncommon settings)
- PORT_DIPNAME( 0x07, 0x03, "Coinage A (100 Y)" ) PORT_DIPLOCATION("DSW1:1,2,3")
+ PORT_DIPNAME( 0x07, 0x03, "Coinage A (" UNICODE_100YEN ")" ) PORT_DIPLOCATION("DSW1:1,2,3")
PORT_DIPSETTING( 0x00, "1 Coin / 1 Medal" )
PORT_DIPSETTING( 0x04, "1 Coin / 2 Medal" )
PORT_DIPSETTING( 0x02, "1 Coin / 3 Medal" )
@@ -652,21 +660,22 @@ static INPUT_PORTS_START( ppj )
PORT_DIPSETTING( 0x05, "1 Coin / 6 Medal" )
PORT_DIPSETTING( 0x03, "1 Coin / 10 Medal" )
PORT_DIPSETTING( 0x07, "1 Coin / 11 Medal" )
- PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4")
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ // Coinage B is always 1 Coin / 1 Medal
+ PORT_DIPNAME( 0x08, 0x00, "Coinage Config" ) PORT_DIPLOCATION("DSW1:4")
+ PORT_DIPSETTING( 0x00, UNICODE_100YEN " = Credits" )
+ PORT_DIPSETTING( 0x08, UNICODE_100YEN " = Exchange" )
+ PORT_DIPNAME( 0x10, 0x00, "Payout Mode" ) PORT_DIPLOCATION("DSW1:5")
+ PORT_DIPSETTING( 0x10, "Automatic" )
+ PORT_DIPSETTING( 0x00, "Manual" )
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6")
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x00, "Unknown (related to coin1/payout)") PORT_DIPLOCATION("DSW1:5")
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7")
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x00, "Coinage Config" ) PORT_DIPLOCATION("DSW1:6")
- PORT_DIPSETTING( 0x00, "Coin 1 = Normal" )
- PORT_DIPSETTING( 0x20, "Coin 1 = Payout" )
- PORT_DIPNAME( 0x40, 0x00, "Payout Mode" ) PORT_DIPLOCATION("DSW1:7")
- PORT_DIPSETTING( 0x40, "Manual" )
- PORT_DIPSETTING( 0x00, "Automatic" )
- PORT_DIPNAME( 0x80, 0x00, "Repeat Last Bet") PORT_DIPLOCATION("DSW1:8")
- PORT_DIPSETTING( 0x80, DEF_STR( No ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
PORT_START("DSW2") // found in the PCB: 00000000 (arranged for sale since they are uncommon settings)
PORT_DIPNAME( 0x07, 0x01, "Percentage" ) PORT_DIPLOCATION("DSW2:1,2,3")
@@ -732,7 +741,7 @@ static MACHINE_CONFIG_START( kurukuru, kurukuru_state )
MCFG_V99X8_INTERRUPT_CALLBACK(INPUTLINE("maincpu", 0))
MCFG_V99X8_SCREEN_ADD_NTSC("screen", "v9938", MAIN_CLOCK)
- MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
+ MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -770,7 +779,7 @@ static MACHINE_CONFIG_START( ppj, kurukuru_state )
MCFG_V99X8_INTERRUPT_CALLBACK(INPUTLINE("maincpu", 0))
MCFG_V99X8_SCREEN_ADD_NTSC("screen", "v9938", MAIN_CLOCK)
- MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_LOW, TICKET_STATUS_ACTIVE_LOW )
+ MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH )
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -800,6 +809,7 @@ MACHINE_CONFIG_END
ROM_START( kurukuru )
ROM_REGION( 0x08000, "maincpu", 0 )
ROM_LOAD( "kp_17l.ic17", 0x00000, 0x08000, CRC(9b552ebc) SHA1(07d0e62b7fdad381963a345376b72ad31eb7b96d) ) // program code
+ // Game ID string: "carp carp carp hiroshima ---"
ROM_REGION( 0x40000, "user1", 0 ) // maincpu banked roms
ROM_FILL( 0x00000, 0x10000, 0xff ) // ic23: unpopulated
@@ -824,6 +834,7 @@ ROM_END
ROM_START( ppj )
ROM_REGION( 0x08000, "maincpu", 0 )
ROM_LOAD( "ppj17.ic17", 0x00000, 0x08000, CRC(5d9c9ceb) SHA1(0f52c8a0aaaf978afeb07e56493399133b4ce781) ) // program code
+ // Game ID string: "PYON PYON JUMP V1.40"
ROM_REGION( 0x40000, "user1", 0 ) // maincpu banked roms
ROM_FILL( 0x00000, 0x10000, 0xff ) // ic23: unpopulated
diff --git a/src/mame/drivers/lc80.cpp b/src/mame/drivers/lc80.cpp
index b29f5836f35..9deed1fc2fe 100644
--- a/src/mame/drivers/lc80.cpp
+++ b/src/mame/drivers/lc80.cpp
@@ -64,9 +64,9 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( lc80_io, AS_IO, 8, lc80_state )
ADDRESS_MAP_GLOBAL_MASK(0x1f)
- AM_RANGE(0xf4, 0xf7) AM_DEVREADWRITE(Z80PIO1_TAG, z80pio_device, read, write)
- AM_RANGE(0xf8, 0xfb) AM_DEVREADWRITE(Z80PIO2_TAG, z80pio_device, read, write)
- AM_RANGE(0xec, 0xef) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
+ AM_RANGE(0x14, 0x17) AM_DEVREADWRITE(Z80PIO1_TAG, z80pio_device, read, write)
+ AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80PIO2_TAG, z80pio_device, read, write)
+ AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
ADDRESS_MAP_END
/* Input Ports */
diff --git a/src/mame/drivers/lisa.cpp b/src/mame/drivers/lisa.cpp
index 34e9b8bbe1f..1e5dad25b03 100644
--- a/src/mame/drivers/lisa.cpp
+++ b/src/mame/drivers/lisa.cpp
@@ -31,7 +31,6 @@ static ADDRESS_MAP_START(lisa_fdc_map, AS_PROGRAM, 8, lisa_state )
AM_RANGE(0x0400, 0x07ff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w) /* disk controller (IWM and TTL logic) */
AM_RANGE(0x0800, 0x0fff) AM_NOP
AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("fdccpu", 0x1000) AM_SHARE("fdc_rom") /* ROM */
- AM_RANGE(0x2000, 0xffff) AM_READWRITE(lisa_fdc_r, lisa_fdc_w) /* handler for wrap-around */
ADDRESS_MAP_END
static ADDRESS_MAP_START(lisa210_fdc_map, AS_PROGRAM, 8, lisa_state )
@@ -41,7 +40,6 @@ static ADDRESS_MAP_START(lisa210_fdc_map, AS_PROGRAM, 8, lisa_state )
AM_RANGE(0x0800, 0x0bff) AM_READWRITE(lisa_fdc_io_r, lisa_fdc_io_w) /* disk controller (IWM and TTL logic) */
AM_RANGE(0x0c00, 0x0fff) AM_NOP /* nothing, or IO port wrap-around ??? */
AM_RANGE(0x1000, 0x1fff) AM_ROM AM_REGION("fdccpu", 0x1000) AM_SHARE("fdc_rom") /* ROM */
- AM_RANGE(0x2000, 0xffff) AM_READWRITE(lisa_fdc_r, lisa_fdc_w) /* handler for wrap-around */
ADDRESS_MAP_END
diff --git a/src/mame/drivers/lvcards.cpp b/src/mame/drivers/lvcards.cpp
index 48225a4cc78..2d855815cdd 100644
--- a/src/mame/drivers/lvcards.cpp
+++ b/src/mame/drivers/lvcards.cpp
@@ -272,7 +272,7 @@ static INPUT_PORTS_START( lvpoker )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Analyzer") PORT_TOGGLE
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_MINUS) PORT_NAME("Memory Reset")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_CODE(KEYCODE_MINUS)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Clear Stats")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_EQUALS) PORT_NAME("Hopper Reset")
diff --git a/src/mame/drivers/mpu5.cpp b/src/mame/drivers/mpu5.cpp
index 068b54fe23d..c2a5dce88cc 100644
--- a/src/mame/drivers/mpu5.cpp
+++ b/src/mame/drivers/mpu5.cpp
@@ -121,10 +121,10 @@ READ8_MEMBER(mpu5_state::asic_r8)
READ32_MEMBER(mpu5_state::asic_r32)
{
UINT32 retdata = 0;
- if (mem_mask&0xff000000) retdata |= asic_r8(space,(offset*4)+0) <<24;
- if (mem_mask&0x00ff0000) retdata |= asic_r8(space,(offset*4)+1) <<16;
- if (mem_mask&0x0000ff00) retdata |= asic_r8(space,(offset*4)+2) <<8;
- if (mem_mask&0x000000ff) retdata |= asic_r8(space,(offset*4)+3) <<0;
+ if (ACCESSING_BITS_24_31) retdata |= asic_r8(space,(offset*4)+0) <<24;
+ if (ACCESSING_BITS_16_23) retdata |= asic_r8(space,(offset*4)+1) <<16;
+ if (ACCESSING_BITS_8_15) retdata |= asic_r8(space,(offset*4)+2) <<8;
+ if (ACCESSING_BITS_0_7) retdata |= asic_r8(space,(offset*4)+3) <<0;
return retdata;
}
@@ -255,10 +255,10 @@ WRITE8_MEMBER(mpu5_state::asic_w8)
WRITE32_MEMBER(mpu5_state::asic_w32)
{
- if (mem_mask&0xff000000) asic_w8(space,(offset*4)+0, (data>>24)&0xff);
- if (mem_mask&0x00ff0000) asic_w8(space,(offset*4)+1, (data>>16)&0xff);
- if (mem_mask&0x0000ff00) asic_w8(space,(offset*4)+2, (data>>8) &0xff);
- if (mem_mask&0x000000ff) asic_w8(space,(offset*4)+3, (data>>0) &0xff);
+ if (ACCESSING_BITS_24_31) asic_w8(space,(offset*4)+0, (data>>24)&0xff);
+ if (ACCESSING_BITS_16_23) asic_w8(space,(offset*4)+1, (data>>16)&0xff);
+ if (ACCESSING_BITS_8_15) asic_w8(space,(offset*4)+2, (data>>8) &0xff);
+ if (ACCESSING_BITS_0_7) asic_w8(space,(offset*4)+3, (data>>0) &0xff);
}
diff --git a/src/mame/drivers/mystwarr.cpp b/src/mame/drivers/mystwarr.cpp
index a552f78e3b4..3d2ec6f3c07 100644
--- a/src/mame/drivers/mystwarr.cpp
+++ b/src/mame/drivers/mystwarr.cpp
@@ -1684,7 +1684,7 @@ ROM_START( metamrph )
ROM_LOAD( "metamrph.nv", 0x0000, 0x080, CRC(2c51229a) SHA1(7f056792cc44ec3d4aacc33c825ab796a913488e) )
ROM_END
-ROM_START( metamrpha ) /* alternate set - possibly a bugfix version. Only 2 adjusted bytes causing a swap in commands */
+ROM_START( metamrphe ) /* alternate set - possibly a bugfix version. Only 2 adjusted bytes causing a swap in commands */
/* main program */
ROM_REGION( 0x200000, "maincpu", 0 )
ROM_LOAD16_BYTE( "3.15h", 0x000001, 0x40000, CRC(8b9f1ba3) SHA1(cccbaf117800a030c8218a91740dc98182a27901) )
@@ -1721,6 +1721,43 @@ ROM_START( metamrpha ) /* alternate set - possibly a bugfix version. Only 2 adju
ROM_LOAD( "metamrph.nv", 0x0000, 0x080, CRC(2c51229a) SHA1(7f056792cc44ec3d4aacc33c825ab796a913488e) )
ROM_END
+ROM_START( metamrpha )
+ /* main program */
+ ROM_REGION( 0x200000, "maincpu", 0 )
+ ROM_LOAD16_BYTE( "224aaa01.15h", 0x000001, 0x40000, CRC(12515518) SHA1(7c47ce7ee9817b5f3f516dda021028a0b0a2941f) )
+ ROM_LOAD16_BYTE( "224aaa02.15f", 0x000000, 0x40000, CRC(04ed41df) SHA1(a966aa887f286b528d122aceee957ca2d9fdedb6) )
+ ROM_LOAD16_BYTE( "224a03", 0x100001, 0x80000, CRC(a5bedb01) SHA1(5e7a0b93af654ba6a87be8d449c7080a0f0e2a43) )
+ ROM_LOAD16_BYTE( "224a04", 0x100000, 0x80000, CRC(ada53ba4) SHA1(f77bf854dff1f8f718579fe6d3730066708396e2) )
+
+ /* sound program */
+ ROM_REGION( 0x40000, "soundcpu", 0 )
+ ROM_LOAD("224a05", 0x000000, 0x40000, CRC(4b4c985c) SHA1(c83cce05355023be9cd55b4aa595c61f8236269c) )
+
+ /* tiles */
+ ROM_REGION( 0x500000, "gfx1", ROMREGION_ERASE00 )
+ ROM_LOADTILE_WORD( "224a09", 0x000000, 1*1024*1024, CRC(1931afce) SHA1(78838c0fd2a9c80f130db1fcf6c88b14f7363639) )
+ ROM_LOADTILE_WORD( "224a08", 0x000002, 1*1024*1024, CRC(dc94d53a) SHA1(91e16371a335f078a81c06a1045759653080aba0) )
+
+ /* sprites */
+ ROM_REGION( 0x800000, "gfx2", ROMREGION_ERASE00 )
+ ROM_LOAD64_WORD( "224a10", 0x000000, 2*1024*1024, CRC(161287f0) SHA1(a13b197a98fa1cebb11fb87b54e277c72852c4ee) )
+ ROM_LOAD64_WORD( "224a11", 0x000002, 2*1024*1024, CRC(df5960e1) SHA1(ee7794dd119f5f2c52e7ba589d78067a89ff3cab) )
+ ROM_LOAD64_WORD( "224a12", 0x000004, 2*1024*1024, CRC(ca72a4b3) SHA1(a09deb6d7cb8be4edaeb78e0e676ea2d6055e9e0) )
+ ROM_LOAD64_WORD( "224a13", 0x000006, 2*1024*1024, CRC(86b58feb) SHA1(5a43746e2cd3c7aca21496c092aef83e64b3ab2c) )
+
+ /* K053250 linescroll/zoom thingy */
+ ROM_REGION( 0x40000, "k053250_1", 0 )
+ ROM_LOAD( "224a14", 0x000000, 0x40000, CRC(3c79b404) SHA1(7c6bb4cbf050f314ea0cd3e8bc6e1947d0573084) )
+
+ /* sound data */
+ ROM_REGION( 0x400000, "shared", 0 )
+ ROM_LOAD( "224a06", 0x000000, 2*1024*1024, CRC(972f6abe) SHA1(30907495fc49fe3424c092b074c1dc137aa14306) )
+ ROM_LOAD( "224a07", 0x200000, 1*1024*1024, CRC(61b2f97a) SHA1(34bf835d6361c7809d40fa20fd238c9e2a84b101) )
+
+ ROM_REGION( 0x80, "eeprom", 0 ) // default eeprom to prevent game booting upside down with error
+ ROM_LOAD( "metamrpha.nv", 0x0000, 0x080, CRC(6d34a4f2) SHA1(6ec2645ee4375d4924c3cfed2285224af6d19f4c) )
+ROM_END
+
ROM_START( metamrphu )
/* main program */
ROM_REGION( 0x200000, "maincpu", 0 )
@@ -2271,9 +2308,10 @@ GAME( 1993, viostorma, viostorm, viostorm, viostorm, driver_device, 0, ROT0, "
GAME( 1993, viostormab, viostorm, viostorm, viostorm, driver_device, 0, ROT0, "Konami", "Violent Storm (ver AAB)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, metamrph, 0, metamrph, metamrph, driver_device, 0, ROT0, "Konami", "Metamorphic Force (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
-GAME( 1993, metamrpha, metamrph, metamrph, metamrph, driver_device, 0, ROT0, "Konami", "Metamorphic Force (ver EAA - alternate)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1993, metamrphe, metamrph, metamrph, metamrph, driver_device, 0, ROT0, "Konami", "Metamorphic Force (ver EAA - alternate)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, metamrphu, metamrph, metamrph, metamrph, driver_device, 0, ROT0, "Konami", "Metamorphic Force (ver UAA)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, metamrphj, metamrph, metamrph, metamrph, driver_device, 0, ROT0, "Konami", "Metamorphic Force (ver JAA)", MACHINE_IMPERFECT_GRAPHICS )
+GAME( 1993, metamrpha, metamrph, metamrph, metamrph, driver_device, 0, ROT0, "Konami", "Metamorphic Force (ver AAA)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, mtlchamp, 0, martchmp, martchmp, driver_device, 0, ROT0, "Konami", "Martial Champion (ver EAB)", MACHINE_IMPERFECT_GRAPHICS )
GAME( 1993, mtlchamp1, mtlchamp, martchmp, martchmp, driver_device, 0, ROT0, "Konami", "Martial Champion (ver EAA)", MACHINE_IMPERFECT_GRAPHICS )
diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp
index fd360c13f00..33e43c44051 100644
--- a/src/mame/drivers/namcos22.cpp
+++ b/src/mame/drivers/namcos22.cpp
@@ -1582,7 +1582,7 @@ READ32_MEMBER(namcos22_state::namcos22_dspram_r)
WRITE32_MEMBER(namcos22_state::namcos22_dspram_w)
{
- if (mem_mask & 0x00ff0000)
+ if (ACCESSING_BITS_16_23)
{
// only d0-23 are connected
mem_mask |= 0xff000000;
diff --git a/src/mame/drivers/nbmj8688.cpp b/src/mame/drivers/nbmj8688.cpp
index 314a62da37f..1f8e25d9fc7 100644
--- a/src/mame/drivers/nbmj8688.cpp
+++ b/src/mame/drivers/nbmj8688.cpp
@@ -435,7 +435,7 @@ static INPUT_PORTS_START( mjsikaku )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -540,7 +540,7 @@ static INPUT_PORTS_START( mmsikaku )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -606,7 +606,7 @@ static INPUT_PORTS_START( otonano )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -672,7 +672,7 @@ static INPUT_PORTS_START( mjcamera )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -736,7 +736,7 @@ static INPUT_PORTS_START( kaguya )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
// PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -803,7 +803,7 @@ static INPUT_PORTS_START( kaguya2 )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
// PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -867,7 +867,7 @@ static INPUT_PORTS_START( kanatuen )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -931,7 +931,7 @@ static INPUT_PORTS_START( kyuhito )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -996,7 +996,7 @@ static INPUT_PORTS_START( idhimitu )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1061,7 +1061,7 @@ static INPUT_PORTS_START( secolove )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1126,7 +1126,7 @@ static INPUT_PORTS_START( barline )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1236,7 +1236,7 @@ static INPUT_PORTS_START( citylove )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1298,7 +1298,7 @@ static INPUT_PORTS_START( mcitylov )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN2
@@ -1364,7 +1364,7 @@ static INPUT_PORTS_START( seiha )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1428,7 +1428,7 @@ static INPUT_PORTS_START( seiham )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1494,7 +1494,7 @@ static INPUT_PORTS_START( iemoto )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1558,7 +1558,7 @@ static INPUT_PORTS_START( iemotom )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1623,7 +1623,7 @@ static INPUT_PORTS_START( ryuuha )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1688,7 +1688,7 @@ static INPUT_PORTS_START( bijokkoy )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1764,7 +1764,7 @@ static INPUT_PORTS_START( bijokkog )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1840,7 +1840,7 @@ static INPUT_PORTS_START( housemnq )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1915,7 +1915,7 @@ static INPUT_PORTS_START( housemn2 )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1993,7 +1993,7 @@ static INPUT_PORTS_START( orangec )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN2
@@ -2058,7 +2058,7 @@ static INPUT_PORTS_START( orangeci )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN2
@@ -2123,7 +2123,7 @@ static INPUT_PORTS_START( vipclub )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN2
@@ -2186,7 +2186,7 @@ static INPUT_PORTS_START( livegal )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -2235,7 +2235,7 @@ static INPUT_PORTS_START( ojousan )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -2299,7 +2299,7 @@ static INPUT_PORTS_START( ojousanm )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -2365,7 +2365,7 @@ static INPUT_PORTS_START( korinai )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -2429,7 +2429,7 @@ static INPUT_PORTS_START( korinaim )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -2493,7 +2493,7 @@ static INPUT_PORTS_START( crystalg )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -2555,7 +2555,7 @@ static INPUT_PORTS_START( crystal2 )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -2617,7 +2617,7 @@ static INPUT_PORTS_START( apparel )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -2687,7 +2687,7 @@ static INPUT_PORTS_START( nightlov )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8688_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_TOGGLE // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
diff --git a/src/mame/drivers/nbmj8891.cpp b/src/mame/drivers/nbmj8891.cpp
index 25c4fdbb1bd..3e9b2b41351 100644
--- a/src/mame/drivers/nbmj8891.cpp
+++ b/src/mame/drivers/nbmj8891.cpp
@@ -616,7 +616,7 @@ static INPUT_PORTS_START( hanamomo )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -689,7 +689,7 @@ static INPUT_PORTS_START( mjcamerb )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -755,7 +755,7 @@ static INPUT_PORTS_START( mmcamera )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -798,7 +798,7 @@ static INPUT_PORTS_START( msjiken )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -883,7 +883,7 @@ static INPUT_PORTS_START( gionbana )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -949,7 +949,7 @@ static INPUT_PORTS_START( mgion )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1015,7 +1015,7 @@ static INPUT_PORTS_START( omotesnd )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1080,7 +1080,7 @@ static INPUT_PORTS_START( abunai )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1146,7 +1146,7 @@ static INPUT_PORTS_START( mgmen89 )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1188,7 +1188,7 @@ static INPUT_PORTS_START( mjfocus )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1252,7 +1252,7 @@ static INPUT_PORTS_START( mjfocusm )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1319,7 +1319,7 @@ static INPUT_PORTS_START( scandal )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1383,7 +1383,7 @@ static INPUT_PORTS_START( scandalm )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) // COIN2
@@ -1449,7 +1449,7 @@ static INPUT_PORTS_START( mjnanpas )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1515,7 +1515,7 @@ static INPUT_PORTS_START( mjnanpaa )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1584,7 +1584,7 @@ static INPUT_PORTS_START( bananadr )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1649,7 +1649,7 @@ static INPUT_PORTS_START( club90s )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1728,7 +1728,7 @@ static INPUT_PORTS_START( lovehous )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -1768,7 +1768,7 @@ static INPUT_PORTS_START( mladyhtr )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1833,7 +1833,7 @@ static INPUT_PORTS_START( chinmoku )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Credit Clear") PORT_CODE(KEYCODE_4) // CREDIT CLEAR
@@ -1911,7 +1911,7 @@ static INPUT_PORTS_START( maiko )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) //
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) //
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //
@@ -1987,7 +1987,7 @@ static INPUT_PORTS_START( mmaiko )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
@@ -2063,7 +2063,7 @@ static INPUT_PORTS_START( hanaoji )
PORT_START("PORT0-2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) //
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_outcoin_flag_r, nullptr) // OUT COIN
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) //
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) //
@@ -2229,7 +2229,7 @@ static INPUT_PORTS_START( taiwanmb )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8891_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // COIN OUT
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
diff --git a/src/mame/drivers/nbmj8991.cpp b/src/mame/drivers/nbmj8991.cpp
index 50900d54b80..e84c59224d2 100644
--- a/src/mame/drivers/nbmj8991.cpp
+++ b/src/mame/drivers/nbmj8991.cpp
@@ -288,7 +288,7 @@ static INPUT_PORTS_START( pstadium )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -330,7 +330,7 @@ static INPUT_PORTS_START( triplew1 )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -395,7 +395,7 @@ static INPUT_PORTS_START( ntopstar )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -460,7 +460,7 @@ static INPUT_PORTS_START( mjlstory )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -525,7 +525,7 @@ static INPUT_PORTS_START( vanilla )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -592,7 +592,7 @@ static INPUT_PORTS_START( finalbny )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -657,7 +657,7 @@ static INPUT_PORTS_START( qmhayaku )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -701,7 +701,7 @@ static INPUT_PORTS_START( galkoku )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -770,7 +770,7 @@ static INPUT_PORTS_START( hyouban )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -839,7 +839,7 @@ static INPUT_PORTS_START( galkaika )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -908,7 +908,7 @@ static INPUT_PORTS_START( tokyogal )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -977,7 +977,7 @@ static INPUT_PORTS_START( tokimbsj )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1046,7 +1046,7 @@ static INPUT_PORTS_START( mcontest )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1115,7 +1115,7 @@ static INPUT_PORTS_START( uchuuai )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1184,7 +1184,7 @@ static INPUT_PORTS_START( mjgottub )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1248,7 +1248,7 @@ static INPUT_PORTS_START( av2mj1bb )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
@@ -1315,7 +1315,7 @@ static INPUT_PORTS_START( av2mj2rg )
PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, nbmj8991_state, nb1413m3_busyflag_r, nullptr) // DRAW BUSY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) //
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) // MEMORY RESET
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER
PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) // TEST
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1
diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp
index 63778115301..0d2dbac5add 100644
--- a/src/mame/drivers/ngen.cpp
+++ b/src/mame/drivers/ngen.cpp
@@ -283,32 +283,32 @@ WRITE16_MEMBER(ngen_state::peripheral_w)
case 0x0d:
case 0x0e:
case 0x0f:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_dmac->write(space,offset,data & 0xff);
break;
case 0x80: // DMA page offset?
case 0x81:
case 0x82:
case 0x83:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_dma_offset[offset-0x80] = data & 0xff;
break;
case 0xc0: // X-Bus modules reset
m_xbus_current = 0;
break;
case 0x10c:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_pic->write(space,0,data & 0xff);
break;
case 0x10d:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_pic->write(space,1,data & 0xff);
break;
case 0x110:
case 0x111:
case 0x112:
case 0x113:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_pit->write(space,offset-0x110,data & 0xff);
break;
case 0x141:
@@ -316,19 +316,19 @@ WRITE16_MEMBER(ngen_state::peripheral_w)
COMBINE_DATA(&m_periph141);
break;
case 0x144:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_crtc->address_w(space,0,data & 0xff);
break;
case 0x145:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_crtc->register_w(space,0,data & 0xff);
break;
case 0x146:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_viduart->data_w(space,0,data & 0xff);
break;
case 0x147:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_viduart->control_w(space,0,data & 0xff);
break;
case 0x1a0: // serial?
@@ -360,7 +360,7 @@ READ16_MEMBER(ngen_state::peripheral_r)
case 0x0d:
case 0x0e:
case 0x0f:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_dmac->read(space,offset);
logerror("DMA read offset %04x mask %04x returning %04x\n",offset,mem_mask,ret);
break;
@@ -368,42 +368,42 @@ READ16_MEMBER(ngen_state::peripheral_r)
case 0x81:
case 0x82:
case 0x83:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_dma_offset[offset-0x80] & 0xff;
break;
case 0x10c:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_pic->read(space,0);
break;
case 0x10d:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_pic->read(space,1);
break;
case 0x110:
case 0x111:
case 0x112:
case 0x113:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_pit->read(space,offset-0x110);
break;
case 0x141:
ret = m_periph141;
break;
case 0x144:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_crtc->status_r(space,0);
break;
case 0x145:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_crtc->register_r(space,0);
break;
case 0x146:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_viduart->data_r(space,0);
break;
case 0x147: // keyboard UART
// expects bit 0 to be set (UART transmit ready)
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_viduart->status_r(space,0);
break;
case 0x1a0: // I/O control register?
@@ -478,11 +478,11 @@ WRITE16_MEMBER(ngen_state::hfd_w)
case 0x00:
case 0x01:
case 0x02:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_fdc->write(space,offset,data & 0xff);
break;
case 0x03:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
{
m_fdc->write(space,offset,data & 0xff);
m_fdc_timer->write_clk0(1);
@@ -490,22 +490,22 @@ WRITE16_MEMBER(ngen_state::hfd_w)
}
break;
case 0x04:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
fdc_control_w(space,0,data & 0xff);
break;
case 0x05:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
hdc_control_w(space,0,data & 0xff);
break;
case 0x07:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
disk_addr_ext(space,0,data & 0xff);
break;
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_fdc_timer->write(space,offset-0x08,data & 0xff);
break;
case 0x10:
@@ -516,7 +516,7 @@ WRITE16_MEMBER(ngen_state::hfd_w)
case 0x15:
case 0x16:
case 0x17:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_hdc->write(space,offset-0x10,data & 0xff);
logerror("WD1010 register %i write %02x mask %04x\n",offset-0x10,data & 0xff,mem_mask);
break;
@@ -524,7 +524,7 @@ WRITE16_MEMBER(ngen_state::hfd_w)
case 0x19:
case 0x1a:
case 0x1b:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_hdc_timer->write(space,offset-0x18,data & 0xff);
break;
}
@@ -539,11 +539,11 @@ READ16_MEMBER(ngen_state::hfd_r)
case 0x00:
case 0x01:
case 0x02:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_fdc->read(space,offset);
break;
case 0x03:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
{
ret = m_fdc->read(space,offset);
m_fdc_timer->write_clk0(1);
@@ -554,7 +554,7 @@ READ16_MEMBER(ngen_state::hfd_r)
case 0x09:
case 0x0a:
case 0x0b:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_fdc_timer->read(space,offset-0x08);
break;
case 0x10:
@@ -565,7 +565,7 @@ READ16_MEMBER(ngen_state::hfd_r)
case 0x15:
case 0x16:
case 0x17:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_hdc->read(space,offset-0x10);
logerror("WD1010 register %i read, mask %04x\n",offset-0x10,mem_mask);
break;
@@ -573,7 +573,7 @@ READ16_MEMBER(ngen_state::hfd_r)
case 0x19:
case 0x1a:
case 0x1b:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_hdc_timer->read(space,offset-0x18);
break;
}
@@ -769,12 +769,12 @@ READ16_MEMBER( ngen_state::b38_keyboard_r )
switch(offset)
{
case 0:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_viduart->data_r(space,0);
break;
case 1: // keyboard UART
// expects bit 0 to be set (UART transmit ready)
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_viduart->status_r(space,0);
break;
}
@@ -786,11 +786,11 @@ WRITE16_MEMBER( ngen_state::b38_keyboard_w )
switch(offset)
{
case 0:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_viduart->data_w(space,0,data & 0xff);
break;
case 1:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_viduart->control_w(space,0,data & 0xff);
break;
}
@@ -802,11 +802,11 @@ READ16_MEMBER( ngen_state::b38_crtc_r )
switch(offset)
{
case 0:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_crtc->register_r(space,0);
break;
case 1:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
ret = m_viduart->data_r(space,0);
break;
}
@@ -818,11 +818,11 @@ WRITE16_MEMBER( ngen_state::b38_crtc_w )
switch(offset)
{
case 0:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_crtc->address_w(space,0,data & 0xff);
break;
case 1:
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
m_crtc->register_w(space,0,data & 0xff);
break;
}
diff --git a/src/mame/drivers/plygonet.cpp b/src/mame/drivers/plygonet.cpp
index 4feea095396..2082fbb9811 100644
--- a/src/mame/drivers/plygonet.cpp
+++ b/src/mame/drivers/plygonet.cpp
@@ -236,13 +236,13 @@ WRITE32_MEMBER(polygonet_state::shared_ram_write)
}
/* write to the current dsp56k word */
- if (mem_mask & 0xffff0000)
+ if (ACCESSING_BITS_16_31)
{
m_dsp56k_shared_ram_16[(offset<<1)] = (m_shared_ram[offset] & 0xffff0000) >> 16 ;
}
/* write to the next dsp56k word */
- if (mem_mask & 0x0000ffff)
+ if (ACCESSING_BITS_0_15)
{
m_dsp56k_shared_ram_16[(offset<<1)+1] = (m_shared_ram[offset] & 0x0000ffff) ;
}
diff --git a/src/mame/drivers/pofo.cpp b/src/mame/drivers/pofo.cpp
index 8e3500e10e1..57cd2d30ad9 100644
--- a/src/mame/drivers/pofo.cpp
+++ b/src/mame/drivers/pofo.cpp
@@ -9,18 +9,26 @@
http://www.best-electronics-ca.com/portfoli.htm
http://www.atari-portfolio.co.uk/pfnews/pf9.txt
+ Command line for dual RAM expansion with A: File Manager ROM card and B: RAM card
+ ./mess64 pofo -exp ram -exp:ram:exp ram2 -cart1 fileman -exp:ram:ccmb ram
+
*/
/*
TODO:
- - create chargen ROM from tech manual
- - memory error interrupt vector
+ - cursor is missing
+ - where do CDET and NMD1 connect to ??
- i/o port 8051
- screen contrast
- system tick frequency selection (1 or 128 Hz)
- - speaker
+ - soft power off
+ - LCD board
+ - HD61830A00
+ - 5816 2Kx8 RAM
+ - 27C256 32Kx8 EPROM
+ - PCD3311T DTMF generator @ 3.578640MHz
*/
@@ -28,21 +36,35 @@
#include "rendlay.h"
#include "softlist.h"
#include "cpu/i86/i86.h"
-#include "bus/generic/slot.h"
-#include "bus/generic/carts.h"
+#include "bus/pofo/ccm.h"
#include "bus/pofo/exp.h"
#include "machine/nvram.h"
#include "machine/ram.h"
-#include "sound/speaker.h"
+#include "sound/pcd3311.h"
#include "video/hd61830.h"
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
#define LOG 0
#define M80C88A_TAG "u1"
#define HD61830_TAG "hd61830"
+#define PCD3311T_TAG "pcd3311t"
#define TIMER_TICK_TAG "tick"
#define SCREEN_TAG "screen"
+static const UINT8 INTERRUPT_VECTOR[] = { 0x08, 0x09, 0x00 };
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
class portfolio_state : public driver_device
{
public:
@@ -50,10 +72,12 @@ public:
driver_device(mconfig, type, tag),
m_maincpu(*this, M80C88A_TAG),
m_lcdc(*this, HD61830_TAG),
- m_speaker(*this, "speaker"),
- m_card(*this, "cardslot"),
+ m_dtmf(*this, PCD3311T_TAG),
+ m_ccm(*this, PORTFOLIO_MEMORY_CARD_SLOT_A_TAG),
m_exp(*this, PORTFOLIO_EXPANSION_SLOT_TAG),
m_timer_tick(*this, TIMER_TICK_TAG),
+ m_nvram(*this, "nvram"),
+ m_ram(*this, "ram"),
m_rom(*this, M80C88A_TAG),
m_char_rom(*this, HD61830_TAG),
m_y0(*this, "Y0"),
@@ -65,16 +89,17 @@ public:
m_y6(*this, "Y6"),
m_y7(*this, "Y7"),
m_battery(*this, "BATTERY"),
- m_contrast(*this, "contrast"),
- m_ram(*this, RAM_TAG)
+ m_keylatch(0xff)
{ }
required_device<cpu_device> m_maincpu;
required_device<hd61830_device> m_lcdc;
- required_device<speaker_sound_device> m_speaker;
- required_device<generic_slot_device> m_card;
+ required_device<pcd3311_t> m_dtmf;
+ required_device<portfolio_memory_card_slot_t> m_ccm;
required_device<portfolio_expansion_slot_t> m_exp;
required_device<timer_device> m_timer_tick;
+ required_device<nvram_device> m_nvram;
+ required_device<ram_device> m_ram;
required_region_ptr<UINT8> m_rom;
required_region_ptr<UINT8> m_char_rom;
required_ioport m_y0;
@@ -110,7 +135,11 @@ public:
ROM_EXT
};
- DECLARE_READ8_MEMBER( rom_b_r );
+ DECLARE_READ8_MEMBER( mem_r );
+ DECLARE_WRITE8_MEMBER( mem_w );
+
+ DECLARE_READ8_MEMBER( io_r );
+ DECLARE_WRITE8_MEMBER( io_w );
DECLARE_READ8_MEMBER( irq_status_r );
DECLARE_READ8_MEMBER( keyboard_r );
@@ -118,51 +147,32 @@ public:
DECLARE_READ8_MEMBER( counter_r );
DECLARE_WRITE8_MEMBER( irq_mask_w );
- DECLARE_WRITE8_MEMBER( speaker_w );
+ DECLARE_WRITE8_MEMBER( dtmf_w );
DECLARE_WRITE8_MEMBER( power_w );
- DECLARE_WRITE8_MEMBER( unknown_w );
+ DECLARE_WRITE8_MEMBER( select_w );
DECLARE_WRITE8_MEMBER( counter_w );
+ DECLARE_WRITE8_MEMBER( contrast_w );
DECLARE_WRITE_LINE_MEMBER( iint_w );
DECLARE_WRITE_LINE_MEMBER( eint_w );
- /* interrupt state */
- UINT8 m_ip; /* interrupt pending */
- UINT8 m_ie; /* interrupt enable */
-
- /* counter state */
+ UINT8 m_ip;
+ UINT8 m_ie;
UINT16 m_counter;
-
- /* keyboard state */
UINT8 m_keylatch;
-
int m_rom_b;
- /* video state */
- required_shared_ptr<UINT8> m_contrast;
-
- /* peripheral state */
DECLARE_PALETTE_INIT(portfolio);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
DECLARE_READ8_MEMBER(hd61830_rd_r);
IRQ_CALLBACK_MEMBER(portfolio_int_ack);
- DECLARE_DEVICE_IMAGE_LOAD_MEMBER( portfolio_card );
- required_device<ram_device> m_ram;
};
//**************************************************************************
-// MACROS / CONSTANTS
-//**************************************************************************
-
-static const UINT8 INTERRUPT_VECTOR[] = { 0x08, 0x09, 0x00 };
-
-
-
-//**************************************************************************
// INTERRUPTS
//**************************************************************************
@@ -187,13 +197,34 @@ void portfolio_state::trigger_interrupt(int level)
// set interrupt pending bit
m_ip |= 1 << level;
- //logerror("%s IP set %01x : %u\n", machine().time().as_string(), m_ip, level);
-
check_interrupt();
}
//-------------------------------------------------
+// iint_w - internal interrupt
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( portfolio_state::iint_w )
+{
+ // TODO
+}
+
+
+//-------------------------------------------------
+// eint_w - external interrupt
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( portfolio_state::eint_w )
+{
+ if (state)
+ {
+ trigger_interrupt(INT_EXTERNAL);
+ }
+}
+
+
+//-------------------------------------------------
// irq_status_r - interrupt status read
//-------------------------------------------------
@@ -211,7 +242,7 @@ WRITE8_MEMBER( portfolio_state::irq_mask_w )
{
m_ie = data;
- if (LOG) logerror("IE %02x\n", data);
+ if (LOG) logerror("%s %s IE %01x\n", machine().time().as_string(), machine().describe_context(), data);
check_interrupt();
}
@@ -232,6 +263,8 @@ IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
// clear interrupt pending bit
m_ip &= ~(1 << i);
+ if (LOG) logerror("%s %s IP %01x\n", machine().time().as_string(), machine().describe_context(), m_ip);
+
if (i == 3)
vector = m_exp->eack_r();
else
@@ -241,8 +274,6 @@ IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
}
}
- //logerror("IP ack %01x\n", m_ip);
-
check_interrupt();
return vector;
@@ -326,33 +357,36 @@ READ8_MEMBER( portfolio_state::keyboard_r )
//**************************************************************************
-// INTERNAL SPEAKER
+// SOUND
//**************************************************************************
//-------------------------------------------------
-// speaker_w - internal speaker output
+// dtmf_w -
//-------------------------------------------------
-WRITE8_MEMBER( portfolio_state::speaker_w )
+WRITE8_MEMBER( portfolio_state::dtmf_w )
{
/*
bit description
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7 speaker level
+ 0 PCD3311T D0
+ 1 PCD3311T D1
+ 2 PCD3311T D2
+ 3 PCD3311T D3
+ 4 PCD3311T D4
+ 5 PCD3311T D5
+ 6 PCD3311T STROBE
+ 7 PCD3311T VDD,MODE,A0
*/
- m_speaker->level_w(!BIT(data, 7));
+ if (LOG) logerror("%s %s DTMF %02x\n", machine().time().as_string(), machine().describe_context(), data);
- if (LOG) logerror("SPEAKER %02x\n", data);
+ m_dtmf->mode_w(!BIT(data, 7));
+ m_dtmf->a0_w(!BIT(data, 7));
+ m_dtmf->write(space, 0, data & 0x3f);
+ m_dtmf->strobe_w(BIT(data, 6));
}
@@ -382,7 +416,12 @@ WRITE8_MEMBER( portfolio_state::power_w )
*/
- if (LOG) logerror("POWER %02x\n", data);
+ if (LOG) logerror("%s %s POWER %02x\n", machine().time().as_string(), machine().describe_context(), data);
+
+ if (BIT(data, 1))
+ {
+ // TODO power off
+ }
}
@@ -396,36 +435,51 @@ READ8_MEMBER( portfolio_state::battery_r )
bit signal description
- 0
- 1
- 2
- 3
- 4
+ 0 ? 1=boots from B:
+ 1 ? 1=boots from external ROM
+ 2 ? 1=boots from B:
+ 3 ? 1=boots from ???
+ 4 ?
5 PDET 1=peripheral connected
6 BATD? 0=battery low
- 7 1=cold boot
+ 7 ? 1=cold boot
*/
UINT8 data = 0;
- /* peripheral detect */
+ // peripheral detect
data |= m_exp->pdet_r() << 5;
- /* battery status */
- data |= BIT(m_battery->read(), 0) << 6;
+ // battery status
+ data |= (m_battery->read() & 0x03) << 6;
return data;
}
//-------------------------------------------------
-// unknown_w - ?
+// select_w -
//-------------------------------------------------
-WRITE8_MEMBER( portfolio_state::unknown_w )
+WRITE8_MEMBER( portfolio_state::select_w )
{
- if (LOG) logerror("UNKNOWN %02x\n", data);
+ /*
+
+ bit description
+
+ 0 ?
+ 1 ?
+ 2 ?
+ 3 ?
+ 4
+ 5
+ 6 ?
+ 7 ?
+
+ */
+
+ if (LOG) logerror("%s %s SELECT %02x\n", machine().time().as_string(), machine().describe_context(), data);
switch (data & 0x0f)
{
@@ -463,32 +517,21 @@ TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick)
//-------------------------------------------------
-// rom_b_r -
+// counter_r - counter register read
//-------------------------------------------------
-READ8_MEMBER( portfolio_state::rom_b_r )
+READ8_MEMBER( portfolio_state::counter_r )
{
UINT8 data = 0;
- switch (m_rom_b)
+ switch (offset)
{
- case ROM_APP:
- data = m_rom[offset];
- break;
-
- case CCM_A:
- if (m_card->exists())
- {
- data = m_card->read_rom(space, offset);
- }
- break;
-
- case CCM_B:
- // TODO this is wired thru the expansion slot
+ case 0:
+ data = m_counter & 0xff;
break;
- case ROM_EXT:
- // TODO ???
+ case 1:
+ data = m_counter >> 8;
break;
}
@@ -497,44 +540,238 @@ READ8_MEMBER( portfolio_state::rom_b_r )
//-------------------------------------------------
-// counter_r - counter register read
+// counter_w - counter register write
//-------------------------------------------------
-READ8_MEMBER( portfolio_state::counter_r )
+WRITE8_MEMBER( portfolio_state::counter_w )
{
- UINT8 data = 0;
-
switch (offset)
{
case 0:
- data = m_counter & 0xff;
+ m_counter = (m_counter & 0xff00) | data;
break;
case 1:
- data = m_counter >> 8;
+ m_counter = (data << 8) | (m_counter & 0xff);
break;
}
+}
+
+
+
+//**************************************************************************
+// MEMORY MAPPING
+//**************************************************************************
+
+//-------------------------------------------------
+// mem_r -
+//-------------------------------------------------
+
+READ8_MEMBER( portfolio_state::mem_r )
+{
+ UINT8 data = 0;
+
+ int iom = 0;
+ int bcom = 1;
+ int ncc1 = 1;
+
+ if (offset < 0x1f000)
+ {
+ data = m_ram->read(offset);
+ }
+ else if (offset >= 0xb0000 && offset < 0xc0000)
+ {
+ data = m_ram->read(0x1f000 + (offset & 0xfff));
+ }
+ else if (offset >= 0xc0000 && offset < 0xe0000)
+ {
+ switch (m_rom_b)
+ {
+ case ROM_APP:
+ data = m_rom[offset & 0x3ffff];
+ break;
+
+ case CCM_A:
+ if (LOG) logerror("%s %s CCM0 read %05x\n", machine().time().as_string(), machine().describe_context(), offset & 0x1ffff);
+
+ data = m_ccm->nrdi_r(space, offset & 0x1ffff);
+ break;
+
+ case CCM_B:
+ ncc1 = 0;
+ break;
+
+ case ROM_EXT:
+ // TODO
+ break;
+ }
+ }
+ else if (offset >= 0xe0000)
+ {
+ data = m_rom[offset & 0x3ffff];
+ }
+
+ data = m_exp->nrdi_r(space, offset, data, iom, bcom, ncc1);
return data;
}
//-------------------------------------------------
-// counter_w - counter register write
+// mem_w -
//-------------------------------------------------
-WRITE8_MEMBER( portfolio_state::counter_w )
+WRITE8_MEMBER( portfolio_state::mem_w )
{
- switch (offset)
+ int iom = 0;
+ int bcom = 1;
+ int ncc1 = 1;
+
+ if (offset < 0x1f000)
{
- case 0:
- m_counter = (m_counter & 0xff00) | data;
- break;
+ m_ram->write(offset, data);
+ }
+ else if (offset >= 0xb0000 && offset < 0xc0000)
+ {
+ m_ram->write(0x1f000 + (offset & 0xfff), data);
+ }
+ else if (offset >= 0xc0000 && offset < 0xe0000)
+ {
+ switch (m_rom_b)
+ {
+ case CCM_A:
+ if (LOG) logerror("%s %s CCM0 write %05x:%02x\n", machine().time().as_string(), machine().describe_context(), offset & 0x1ffff, data);
- case 1:
- m_counter = (data << 8) | (m_counter & 0xff);
- break;
+ m_ccm->nwri_w(space, offset & 0x1ffff, data);
+ break;
+
+ case CCM_B:
+ ncc1 = 0;
+ break;
+ }
+ }
+
+ m_exp->nwri_w(space, offset, data, iom, bcom, ncc1);
+}
+
+
+//-------------------------------------------------
+// io_r -
+//-------------------------------------------------
+
+READ8_MEMBER( portfolio_state::io_r )
+{
+ UINT8 data = 0;
+
+ int iom = 1;
+ int bcom = 1;
+ int ncc1 = 0;
+
+ if ((offset & 0xff00) == 0x8000)
+ {
+ switch ((offset >> 4) & 0x0f)
+ {
+ case 0:
+ data = keyboard_r(space, 0);
+ break;
+
+ case 1:
+ if (offset & 0x01)
+ {
+ data = m_lcdc->status_r(space, 0);
+ }
+ else
+ {
+ data = m_lcdc->data_r(space, 0);
+ }
+ break;
+
+ case 4:
+ data = counter_r(space, offset & 0x01);
+ break;
+
+ case 5:
+ if (offset & 0x01)
+ {
+ data = battery_r(space, 0);
+ }
+ else
+ {
+ data = irq_status_r(space, 0);
+ }
+ break;
+
+ case 7:
+ bcom = 0;
+ break;
+ }
}
+
+ data = m_exp->nrdi_r(space, offset, data, iom, bcom, ncc1);
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// io_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( portfolio_state::io_w )
+{
+ int iom = 1;
+ int bcom = 1;
+ int ncc1 = 0;
+
+ if ((offset & 0xff00) == 0x8000)
+ {
+ switch ((offset >> 4) & 0x0f)
+ {
+ case 1:
+ if (offset & 0x01)
+ {
+ m_lcdc->control_w(space, 0, data);
+ }
+ else
+ {
+ m_lcdc->data_w(space, 0, data);
+ }
+ break;
+
+ case 2:
+ dtmf_w(space, 0, data);
+ break;
+
+ case 3:
+ power_w(space, 0, data);
+ break;
+
+ case 4:
+ counter_w(space, offset & 0x01, data);
+ break;
+
+ case 5:
+ if (offset & 0x01)
+ {
+ select_w(space, 0, data);
+ }
+ else
+ {
+ irq_mask_w(space, 0, data);
+ }
+ break;
+
+ case 6:
+ contrast_w(space, 0, data);
+ break;
+
+ case 7:
+ bcom = 0;
+ break;
+ }
+ }
+
+ m_exp->nwri_w(space, offset, data, iom, bcom, ncc1);
}
@@ -548,11 +785,7 @@ WRITE8_MEMBER( portfolio_state::counter_w )
//-------------------------------------------------
static ADDRESS_MAP_START( portfolio_mem, AS_PROGRAM, 8, portfolio_state )
- AM_RANGE(0x00000, 0x1efff) AM_RAM AM_SHARE("nvram1")
- AM_RANGE(0x1f000, 0x9efff) AM_RAM // expansion
- AM_RANGE(0xb0000, 0xb0fff) AM_MIRROR(0xf000) AM_RAM AM_SHARE("nvram2") // video RAM
- AM_RANGE(0xc0000, 0xdffff) AM_READ(rom_b_r)
- AM_RANGE(0xe0000, 0xfffff) AM_ROM AM_REGION(M80C88A_TAG, 0x20000)
+ AM_RANGE(0x00000, 0xfffff) AM_READWRITE(mem_r, mem_w)
ADDRESS_MAP_END
@@ -561,15 +794,17 @@ ADDRESS_MAP_END
//-------------------------------------------------
static ADDRESS_MAP_START( portfolio_io, AS_IO, 8, portfolio_state )
- AM_RANGE(0x8000, 0x8000) AM_READ(keyboard_r)
- AM_RANGE(0x8010, 0x8010) AM_DEVREADWRITE(HD61830_TAG, hd61830_device, data_r, data_w)
- AM_RANGE(0x8011, 0x8011) AM_DEVREADWRITE(HD61830_TAG, hd61830_device, status_r, control_w)
- AM_RANGE(0x8020, 0x8020) AM_WRITE(speaker_w)
- AM_RANGE(0x8030, 0x8030) AM_WRITE(power_w)
- AM_RANGE(0x8040, 0x8041) AM_READWRITE(counter_r, counter_w)
- AM_RANGE(0x8050, 0x8050) AM_READWRITE(irq_status_r, irq_mask_w)
- AM_RANGE(0x8051, 0x8051) AM_READWRITE(battery_r, unknown_w)
- AM_RANGE(0x8060, 0x8060) AM_RAM AM_SHARE("contrast")
+ AM_RANGE(0x0000, 0xffff) AM_READWRITE(io_r, io_w)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( portfolio_lcdc )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( portfolio_lcdc, AS_0, 8, portfolio_state )
+ ADDRESS_MAP_GLOBAL_MASK(0x7ff)
+ AM_RANGE(0x0000, 0x07ff) AM_RAM
ADDRESS_MAP_END
@@ -667,6 +902,9 @@ static INPUT_PORTS_START( portfolio )
PORT_CONFNAME( 0x01, 0x01, "Battery Status" )
PORT_CONFSETTING( 0x01, DEF_STR( Normal ) )
PORT_CONFSETTING( 0x00, "Low Battery" )
+ PORT_CONFNAME( 0x02, 0x00, "Boot" )
+ PORT_CONFSETTING( 0x02, "Cold" )
+ PORT_CONFSETTING( 0x00, "Warm" )
INPUT_PORTS_END
@@ -675,10 +913,24 @@ INPUT_PORTS_END
// VIDEO
//**************************************************************************
+//-------------------------------------------------
+// contrast_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( portfolio_state::contrast_w )
+{
+ if (LOG) logerror("%s %s CONTRAST %02x\n", machine().time().as_string(), machine().describe_context(), data);
+}
+
+
+//-------------------------------------------------
+// PALETTE_INIT( portfolio )
+//-------------------------------------------------
+
PALETTE_INIT_MEMBER(portfolio_state, portfolio)
{
- palette.set_pen_color(0, rgb_t(138, 146, 148));
- palette.set_pen_color(1, rgb_t(92, 83, 88));
+ palette.set_pen_color(0, rgb_t(142, 193, 172));
+ palette.set_pen_color(1, rgb_t(67, 71, 151));
}
@@ -688,6 +940,7 @@ PALETTE_INIT_MEMBER(portfolio_state, portfolio)
READ8_MEMBER( portfolio_state::hd61830_rd_r )
{
+ // TODO with real ROM: offs_t address = ((offset & 0xff) << 4) | ((offset >> 12) & 0x0f);
UINT16 address = ((offset & 0xff) << 3) | ((offset >> 12) & 0x07);
UINT8 data = m_char_rom[address];
@@ -722,40 +975,6 @@ GFXDECODE_END
//**************************************************************************
-// DEVICE CONFIGURATION
-//**************************************************************************
-
-WRITE_LINE_MEMBER( portfolio_state::iint_w )
-{
-}
-
-WRITE_LINE_MEMBER( portfolio_state::eint_w )
-{
- if (state)
- trigger_interrupt(INT_EXTERNAL);
-}
-
-//**************************************************************************
-// IMAGE LOADING
-//**************************************************************************
-
-//-------------------------------------------------
-// DEVICE_IMAGE_LOAD( portfolio_card )
-//-------------------------------------------------
-
-DEVICE_IMAGE_LOAD_MEMBER( portfolio_state, portfolio_card )
-{
- UINT32 size = m_card->common_get_size("rom");
-
- m_card->rom_alloc(size, GENERIC_ROM8_WIDTH, ENDIANNESS_BIG);
- m_card->common_load_rom(m_card->get_rom_base(), size, "rom");
-
- return image_init_result::PASS;
-}
-
-
-
-//**************************************************************************
// MACHINE INITIALIZATION
//**************************************************************************
@@ -765,29 +984,14 @@ DEVICE_IMAGE_LOAD_MEMBER( portfolio_state, portfolio_card )
void portfolio_state::machine_start()
{
- address_space &program = m_maincpu->space(AS_PROGRAM);
-
- /* memory expansions */
- switch (m_ram->size())
- {
- case 128 * 1024:
- program.unmap_readwrite(0x1f000, 0x9efff);
- break;
-
- case 384 * 1024:
- program.unmap_readwrite(0x5f000, 0x9efff);
- break;
- }
+ m_nvram->set_base(m_ram->pointer(), m_ram->size());
- /* set initial values */
- m_keylatch = 0xff;
-
- /* register for state saving */
+ // state saving
save_item(NAME(m_ip));
save_item(NAME(m_ie));
save_item(NAME(m_counter));
save_item(NAME(m_keylatch));
- save_pointer(NAME(m_contrast.target()), m_contrast.bytes());
+ save_item(NAME(m_rom_b));
}
@@ -797,6 +1001,9 @@ void portfolio_state::machine_start()
void portfolio_state::machine_reset()
{
+ m_lcdc->reset();
+
+ m_exp->reset();
}
@@ -810,13 +1017,13 @@ void portfolio_state::machine_reset()
//-------------------------------------------------
static MACHINE_CONFIG_START( portfolio, portfolio_state )
- /* basic machine hardware */
+ // basic machine hardware
MCFG_CPU_ADD(M80C88A_TAG, I8088, XTAL_4_9152MHz)
MCFG_CPU_PROGRAM_MAP(portfolio_mem)
MCFG_CPU_IO_MAP(portfolio_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(portfolio_state,portfolio_int_ack)
- /* video hardware */
+ // video hardware
MCFG_SCREEN_ADD(SCREEN_TAG, LCD)
MCFG_SCREEN_REFRESH_RATE(72)
MCFG_SCREEN_UPDATE_DEVICE(HD61830_TAG, hd61830_device, screen_update)
@@ -832,15 +1039,18 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", portfolio)
MCFG_DEVICE_ADD(HD61830_TAG, HD61830, XTAL_4_9152MHz/2/2)
+ MCFG_DEVICE_ADDRESS_MAP(AS_0, portfolio_lcdc)
MCFG_HD61830_RD_CALLBACK(READ8(portfolio_state, hd61830_rd_r))
MCFG_VIDEO_SET_SCREEN(SCREEN_TAG)
- /* sound hardware */
+ // sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
- MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
+ MCFG_SOUND_ADD(PCD3311T_TAG, PCD3311, XTAL_3_57864MHz)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
// devices
+ MCFG_PORTFOLIO_MEMORY_CARD_SLOT_ADD(PORTFOLIO_MEMORY_CARD_SLOT_A_TAG, portfolio_memory_cards, nullptr)
+
MCFG_PORTFOLIO_EXPANSION_SLOT_ADD(PORTFOLIO_EXPANSION_SLOT_TAG, XTAL_4_9152MHz, portfolio_expansion_cards, nullptr)
MCFG_PORTFOLIO_EXPANSION_SLOT_IINT_CALLBACK(WRITELINE(portfolio_state, iint_w))
MCFG_PORTFOLIO_EXPANSION_SLOT_EINT_CALLBACK(WRITELINE(portfolio_state, eint_w))
@@ -850,24 +1060,17 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("counter", portfolio_state, counter_tick, attotime::from_hz(XTAL_32_768kHz/16384))
MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_TICK_TAG, portfolio_state, system_tick, attotime::from_hz(XTAL_32_768kHz/32768))
- /* fake keyboard */
+ // fake keyboard
MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", portfolio_state, keyboard_tick, attotime::from_usec(2500))
- /* cartridge */
- MCFG_GENERIC_CARTSLOT_ADD("cardslot", generic_plain_slot, "pofo_card")
- MCFG_GENERIC_EXTENSIONS("rom,bin")
- MCFG_GENERIC_LOAD(portfolio_state, portfolio_card)
-
- /* software lists */
+ // software list
MCFG_SOFTWARE_LIST_ADD("cart_list", "pofo")
- /* internal ram */
+ // internal ram
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("128K")
- MCFG_RAM_EXTRA_OPTIONS("384K,640K")
- MCFG_NVRAM_ADD_RANDOM_FILL("nvram1")
- MCFG_NVRAM_ADD_RANDOM_FILL("nvram2")
+ MCFG_NVRAM_ADD_RANDOM_FILL("nvram")
MACHINE_CONFIG_END
@@ -886,7 +1089,7 @@ ROM_START( pofo )
ROMX_LOAD( "rom b.u4", 0x00000, 0x20000, BAD_DUMP CRC(c9852766) SHA1(c74430281bc717bd36fd9b5baec1cc0f4489fe82), ROM_BIOS(1) ) // dumped with debug.com
ROMX_LOAD( "rom a.u3", 0x20000, 0x20000, BAD_DUMP CRC(b8fb730d) SHA1(1b9d82b824cab830256d34912a643a7d048cd401), ROM_BIOS(1) ) // dumped with debug.com
- ROM_REGION( 0x800, HD61830_TAG, 0 )
+ ROM_REGION( 0x8000, HD61830_TAG, 0 )
ROM_LOAD( "hd61830 external character generator", 0x000, 0x800, BAD_DUMP CRC(747a1db3) SHA1(a4b29678fdb43791a8ce4c1ec778f3231bb422c5) ) // typed in from manual
ROM_END
@@ -896,5 +1099,5 @@ ROM_END
// SYSTEM DRIVERS
//**************************************************************************
-/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
-COMP( 1989, pofo, 0, 0, portfolio, portfolio, driver_device, 0, "Atari", "Portfolio", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
+// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS
+COMP( 1989, pofo, 0, 0, portfolio, portfolio, driver_device, 0, "Atari", "Portfolio", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/s6.cpp b/src/mame/drivers/s6.cpp
index cc28d6f3c58..86ababe599e 100644
--- a/src/mame/drivers/s6.cpp
+++ b/src/mame/drivers/s6.cpp
@@ -120,7 +120,7 @@ static ADDRESS_MAP_START( s6_main_map, AS_PROGRAM, 8, s6_state )
AM_RANGE(0x2200, 0x2203) AM_DEVREADWRITE("pia22", pia6821_device, read, write) // solenoids
AM_RANGE(0x2400, 0x2403) AM_DEVREADWRITE("pia24", pia6821_device, read, write) // lamps
AM_RANGE(0x2800, 0x2803) AM_DEVREADWRITE("pia28", pia6821_device, read, write) // display
- AM_RANGE(0xb000, 0x3003) AM_DEVREADWRITE("pia30", pia6821_device, read, write) // inputs
+ AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("pia30", pia6821_device, read, write) // inputs
AM_RANGE(0x6000, 0x7fff) AM_ROM AM_REGION("roms", 0)
ADDRESS_MAP_END
diff --git a/src/mame/drivers/sega_sawatte.cpp b/src/mame/drivers/sega_sawatte.cpp
index 9ef349c81e4..04dd9fa432e 100644
--- a/src/mame/drivers/sega_sawatte.cpp
+++ b/src/mame/drivers/sega_sawatte.cpp
@@ -25,7 +25,7 @@ http://mamedev.emulab.it/haze/reference/sawatte/cartridge_example.jpg
*/
#include "emu.h"
-#include "softlist.h"
+#include "softlist_dev.h"
class sawatte_state : public driver_device
diff --git a/src/mame/drivers/segapico.cpp b/src/mame/drivers/segapico.cpp
index 1df769c0363..fa953d8a9cf 100644
--- a/src/mame/drivers/segapico.cpp
+++ b/src/mame/drivers/segapico.cpp
@@ -330,8 +330,8 @@ WRITE16_MEMBER(pico_base_state::pico_68k_io_write )
m_sega_315_5641_pcm->reset_w(1);
m_sega_315_5641_pcm->start_w(1);
- if (mem_mask&0x00ff) m_sega_315_5641_pcm->port_w(space,0,data&0xff);
- if (mem_mask&0xff00) m_sega_315_5641_pcm->port_w(space,0,(data>>8)&0xff);*/
+ if (ACCESSING_BITS_0_7) m_sega_315_5641_pcm->port_w(space,0,data&0xff);
+ if (ACCESSING_BITS_8_15) m_sega_315_5641_pcm->port_w(space,0,(data>>8)&0xff);*/
break;
}
diff --git a/src/mame/drivers/segasp.cpp b/src/mame/drivers/segasp.cpp
index ed1d4a91a2f..6f51857d51b 100644
--- a/src/mame/drivers/segasp.cpp
+++ b/src/mame/drivers/segasp.cpp
@@ -79,14 +79,14 @@ G 171-8278G 315-6416 2x 512Mbit RMI
READ64_MEMBER(segasp_state::sp_bank_r)
{
- if (mem_mask & U64(0xffffffff00000000))
+ if (ACCESSING_BITS_32_63)
return -1;
return m_sp_bank;
}
WRITE64_MEMBER(segasp_state::sp_bank_w)
{
- if (mem_mask & U64(0xffffffff00000000))
+ if (ACCESSING_BITS_32_63)
return;
UINT16 bank = data & 0xffff;
if (bank != m_sp_bank)
@@ -116,14 +116,14 @@ WRITE64_MEMBER(segasp_state::sn_93c46a_w)
READ64_MEMBER(segasp_state::sp_eeprom_r)
{
- if (mem_mask & U64(0xffffffff00000000))
+ if (ACCESSING_BITS_32_63)
return -1;
return m_sp_eeprom->do_read() << 4;
}
WRITE64_MEMBER(segasp_state::sp_eeprom_w)
{
- if (mem_mask & U64(0xffffffff00000000))
+ if (ACCESSING_BITS_32_63)
return;
m_sp_eeprom->di_write(data & 1);
m_sp_eeprom->cs_write((data & 2) ? ASSERT_LINE : CLEAR_LINE);
@@ -144,7 +144,7 @@ READ64_MEMBER(segasp_state::sp_io_r)
int reg = offset * 2;
int shift = 0;
- if (mem_mask & U64(0xffffffff00000000))
+ if (ACCESSING_BITS_32_63)
{
reg++;
shift = 32;
diff --git a/src/mame/drivers/sengokmj.cpp b/src/mame/drivers/sengokmj.cpp
index 007b5fe7786..8f3666fa763 100644
--- a/src/mame/drivers/sengokmj.cpp
+++ b/src/mame/drivers/sengokmj.cpp
@@ -505,7 +505,7 @@ static INPUT_PORTS_START( sengokmj )
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_DOOR ) // Only used in service mode?
PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE4 ) PORT_NAME("Opt. 1st") // Only used in service mode?
- PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Reset")
+ PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MEMORY_RESET )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Cash") // Only used in service mode?
// 0x40 Hopper
diff --git a/src/mame/drivers/slc1.cpp b/src/mame/drivers/slc1.cpp
index f367e3b1705..a2eec395f04 100644
--- a/src/mame/drivers/slc1.cpp
+++ b/src/mame/drivers/slc1.cpp
@@ -182,7 +182,7 @@ static ADDRESS_MAP_START( slc1_map, AS_PROGRAM, 8, slc1_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0x4fff)
AM_RANGE(0x0000, 0x0fff) AM_ROM
- AM_RANGE(0x5000, 0x53ff) AM_RAM AM_MIRROR(0xc00)
+ AM_RANGE(0x4000, 0x43ff) AM_RAM AM_MIRROR(0xc00)
ADDRESS_MAP_END
static ADDRESS_MAP_START( slc1_io, AS_IO, 8, slc1_state )
diff --git a/src/mame/drivers/supracan.cpp b/src/mame/drivers/supracan.cpp
index 3e4c00d964f..1679a167351 100644
--- a/src/mame/drivers/supracan.cpp
+++ b/src/mame/drivers/supracan.cpp
@@ -1368,13 +1368,13 @@ WRITE16_MEMBER( supracan_state::_68k_soundram_w )
if(offset*2 < 0x500 && offset*2 >= 0x300)
{
- if(mem_mask & 0xff00)
+ if(ACCESSING_BITS_8_15)
{
m_hack_68k_to_6502_access = true;
_6502_soundmem_w(mem, offset*2, data >> 8);
m_hack_68k_to_6502_access = false;
}
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
{
m_hack_68k_to_6502_access = true;
_6502_soundmem_w(mem, offset*2 + 1, data & 0xff);
@@ -1392,13 +1392,13 @@ READ16_MEMBER( supracan_state::_68k_soundram_r )
if(offset*2 >= 0x300 && offset*2 < 0x500)
{
val = 0;
- if(mem_mask & 0xff00)
+ if(ACCESSING_BITS_8_15)
{
m_hack_68k_to_6502_access = true;
val |= _6502_soundmem_r(mem, offset*2) << 8;
m_hack_68k_to_6502_access = false;
}
- if(mem_mask & 0x00ff)
+ if(ACCESSING_BITS_0_7)
{
m_hack_68k_to_6502_access = true;
val |= _6502_soundmem_r(mem, offset*2 + 1);
diff --git a/src/mame/drivers/tek440x.cpp b/src/mame/drivers/tek440x.cpp
index 8072e4f2cf9..8072e4f2cf9 100755..100644
--- a/src/mame/drivers/tek440x.cpp
+++ b/src/mame/drivers/tek440x.cpp
diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp
index 084b7236212..d8d04c146d3 100644
--- a/src/mame/drivers/toaplan2.cpp
+++ b/src/mame/drivers/toaplan2.cpp
@@ -347,7 +347,15 @@ To Do / Unknowns:
- Need to sort out the video status register.
- Find out how exactly how sound CPU communication really works in bgaregga/batrider/bbakraid
current emulation seems to work (plays all sounds), but there are still some unknown reads/writes
- - Write a RTC core for uPD4992, needed by Othello Derby and Power Kick
+
+Notes on Power Kick coin inputs:
+- The 10 yen input is "Key In" according to the bookkeeping screen, but is
+ an otherwise normal coin input with a counter and a lockout (sharing the
+ latter with the "medal" coin).
+- The 100 yen input never adds any credits except in "Coin Function Check,"
+ instead dispensing its value into the hopper immediately.
+
+To reset the NVRAM in Othello Derby, hold P1 Button 1 down while booting.
*****************************************************************************/
@@ -356,12 +364,16 @@ To Do / Unknowns:
#include "cpu/nec/v25.h"
#include "cpu/z80/z80.h"
#include "cpu/z180/z180.h"
+#include "machine/nvram.h"
#include "sound/ym2151.h"
#include "sound/3812intf.h"
#include "sound/ymz280b.h"
#include "includes/toaplan2.h"
#include "includes/toaplipt.h"
+#define UNICODE_YEN "\xC2\xA5"
+#define PWRKICK_HOPPER_PULSE 50 // time between hopper pulses in milliseconds (probably wrong)
+
/***************************************************************************
Initialisation handlers
@@ -556,9 +568,17 @@ WRITE8_MEMBER(toaplan2_state::toaplan2_coin_w)
WRITE8_MEMBER(toaplan2_state::pwrkick_coin_w)
{
- machine().bookkeeping().coin_counter_w(0, (data & 2) >> 1 );
- machine().bookkeeping().coin_counter_w(1, (data & 8) >> 3 );
- m_pwrkick_hopper = (data & 0x80) >> 7;
+ machine().bookkeeping().coin_counter_w(0, (data & 2) >> 1 ); // medal
+ machine().bookkeeping().coin_counter_w(1, (data & 8) >> 3 ); // 10 yen
+ machine().bookkeeping().coin_counter_w(2, (data & 1) ); // 100 yen
+ m_hopper->write(space, 0, data & 0x80);
+}
+
+WRITE8_MEMBER(toaplan2_state::pwrkick_coin_lockout_w)
+{
+ machine().bookkeeping().coin_lockout_w(0, (data & 4) ? 0 : 1);
+ machine().bookkeeping().coin_lockout_w(1, (data & 4) ? 0 : 1);
+ machine().bookkeeping().coin_lockout_w(2, (data & 2) ? 0 : 1);
}
@@ -1182,7 +1202,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pwrkick_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
- AM_RANGE(0x100000, 0x10ffff) AM_RAM
+ AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE("nvram") // Only 10022C-10037B is actually saved as NVRAM
+ AM_RANGE(0x104000, 0x10ffff) AM_RAM
AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8("rtc", upd4992_device, read, write, 0x00ff )
AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE("gp9001", gp9001vdp_device, gp9001_vdp_r, gp9001_vdp_w)
@@ -1197,13 +1218,14 @@ static ADDRESS_MAP_START( pwrkick_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x700018, 0x700019) AM_READ_PORT("DSWC")
AM_RANGE(0x70001c, 0x70001d) AM_READ_PORT("SYS")
AM_RANGE(0x700030, 0x700031) AM_WRITE(oki_bankswitch_w)
- AM_RANGE(0x700034, 0x700035) AM_WRITE8(pwrkick_coin_w,0x00ff)
- AM_RANGE(0x700038, 0x700039) AM_WRITENOP // lamps?
+ AM_RANGE(0x700034, 0x700035) AM_WRITE8(pwrkick_coin_w, 0x00ff)
+ AM_RANGE(0x700038, 0x700039) AM_WRITE8(pwrkick_coin_lockout_w, 0x00ff)
ADDRESS_MAP_END
static ADDRESS_MAP_START( othldrby_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x000000, 0x07ffff) AM_ROM
- AM_RANGE(0x100000, 0x10ffff) AM_RAM
+ AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE("nvram") // Only 10331E-103401 is actually saved as NVRAM
+ AM_RANGE(0x104000, 0x10ffff) AM_RAM
AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE8("rtc", upd4992_device, read, write, 0x00ff )
AM_RANGE(0x300000, 0x30000d) AM_DEVREADWRITE("gp9001", gp9001vdp_device, gp9001_vdp_r, gp9001_vdp_w)
@@ -2304,139 +2326,90 @@ static INPUT_PORTS_START( batsugun )
INPUT_PORTS_END
-CUSTOM_INPUT_MEMBER(toaplan2_state::pwrkick_hopper_status_r)
-{
- /* TODO: hopper mechanism */
- return machine().rand() & 1;
- //return m_pwrkick_hopper & (machine().rand() & 1);
-}
-
static INPUT_PORTS_START( pwrkick )
PORT_START("DSWA")
- PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )
+ PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:!1,!2")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x01, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x02, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x03, DEF_STR( Very_Hard ) )
- PORT_DIPNAME( 0x1c, 0x00, "Payout" )
- PORT_DIPSETTING( 0x00, "1" )
- PORT_DIPSETTING( 0x04, "2" )
- PORT_DIPSETTING( 0x08, "3" )
- PORT_DIPSETTING( 0x0c, "4" )
- PORT_DIPSETTING( 0x10, "5" )
- PORT_DIPSETTING( 0x14, "6" )
- PORT_DIPSETTING( 0x18, "7" )
- PORT_DIPSETTING( 0x1c, "8" )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )
+ PORT_DIPNAME( 0x5c, 0x00, "Payout" ) PORT_DIPLOCATION("SW1:!3,!4,!5,!7")
+ PORT_DIPSETTING( 0x00, "110" ) // Service mode displays values as 1-8, ignoring SW1:7
+ PORT_DIPSETTING( 0x04, "105" )
+ PORT_DIPSETTING( 0x08, "100" )
+ PORT_DIPSETTING( 0x0c, "95" )
+ PORT_DIPSETTING( 0x10, "90" )
+ PORT_DIPSETTING( 0x14, "85" )
+ PORT_DIPSETTING( 0x18, "80" )
+ PORT_DIPSETTING( 0x1c, "75" )
+ PORT_DIPSETTING( 0x40, "70" )
+ PORT_DIPSETTING( 0x44, "65" )
+ PORT_DIPSETTING( 0x48, "60" )
+ PORT_DIPSETTING( 0x4c, "55" )
+ PORT_DIPSETTING( 0x50, "50" )
+ PORT_DIPSETTING( 0x54, "45" )
+ PORT_DIPSETTING( 0x58, "40" )
+ PORT_DIPSETTING( 0x5c, "35" )
+ PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:!6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x00, "Diagnostic" )
+ PORT_DIPNAME( 0x80, 0x00, "Diagnostic" ) PORT_DIPLOCATION("SW1:!8")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("DSWB")
- PORT_DIPNAME( 0x03, 0x00, "Play Credit" )
- PORT_DIPSETTING( 0x00, "10 \xC2\xA5" )
- PORT_DIPSETTING( 0x01, "20 \xC2\xA5" )
- PORT_DIPSETTING( 0x02, "30 \xC2\xA5" )
- PORT_DIPSETTING( 0x03, "40 \xC2\xA5" )
- PORT_DIPNAME( 0x0c, 0x00, "Coin Exchange" )
+ PORT_DIPNAME( 0x03, 0x00, "Play Credit" ) PORT_DIPLOCATION("SW2:!1,!2")
+ PORT_DIPSETTING( 0x00, UNICODE_YEN "10" )
+ PORT_DIPSETTING( 0x01, UNICODE_YEN "20" )
+ PORT_DIPSETTING( 0x02, UNICODE_YEN "30" )
+ PORT_DIPSETTING( 0x03, UNICODE_YEN "40" )
+ PORT_DIPNAME( 0x0c, 0x00, "Coin Exchange" ) PORT_DIPLOCATION("SW2:!3,!4")
PORT_DIPSETTING( 0x00, "12" )
PORT_DIPSETTING( 0x04, "10" )
PORT_DIPSETTING( 0x08, "6" )
PORT_DIPSETTING( 0x0c, "5" )
- PORT_DIPNAME( 0x30, 0x00, "Game Mode" )
+ PORT_DIPNAME( 0x30, 0x00, "Game Mode" ) PORT_DIPLOCATION("SW2:!5,!6")
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x10, "Shot" )
PORT_DIPSETTING( 0x20, "Auto" )
PORT_DIPSETTING( 0x30, "S-Manual" )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+ PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW2:!7" )
+ PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW2:!8" )
PORT_START("DSWC")
- PORT_DIPNAME( 0x01, 0x00, "DSWC" )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x01, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x02, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x04, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x08, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x10, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x20, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+ PORT_DIPUNUSED_DIPLOC( 0x01, 0x00, "SW3:!1" )
+ PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW3:!2" )
+ PORT_DIPUNUSED_DIPLOC( 0x04, 0x00, "SW3:!3" )
+ PORT_DIPUNUSED_DIPLOC( 0x08, 0x00, "SW3:!4" )
+ PORT_DIPUNUSED_DIPLOC( 0x10, 0x00, "SW3:!5" )
+ PORT_DIPUNUSED_DIPLOC( 0x20, 0x00, "SW3:!6" )
+ PORT_DIPUNUSED_DIPLOC( 0x40, 0x00, "SW3:!7" )
+ PORT_DIPUNUSED_DIPLOC( 0x80, 0x00, "SW3:!8" )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Left Button")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Center Button")
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Right Button")
- PORT_DIPNAME( 0x10, 0x00, "IN1" )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x10, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x20, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+ PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN2")
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYIN ) // 10 Yen
- PORT_SERVICE( 0x02, IP_ACTIVE_HIGH )
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME("Coin 2 (" UNICODE_YEN "10)")
+ PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_HIGH )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Down Button")
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, toaplan2_state, pwrkick_hopper_status_r, nullptr)
- PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE3 ) PORT_NAME("Memory Reset")
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x20, DEF_STR( On ) )
- PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x40, DEF_STR( On ) )
- PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x80, DEF_STR( On ) )
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("hopper", ticket_dispenser_device, line_r)
+ PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MEMORY_RESET )
+ PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("SYS")
- PORT_DIPNAME( 0x01, 0x00, "SYS" )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x01, DEF_STR( On ) )
- PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x02, DEF_STR( On ) )
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN2 ) // 100 Yen
- PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Bookkeeping")
- PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x10, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
- PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x20, DEF_STR( On ) )
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SERVICE4 ) PORT_NAME("Attendant Key")
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
+ PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME("Coin Exchange (" UNICODE_YEN "100)")
+ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK )
+ PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_UNUSED )
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_GAMBLE_SERVICE ) PORT_NAME("Attendant Key")
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("Coin 1 (Medal)")
+
+ // The specific "Payout" button shown on the test screen and diagnostic menu does not exist.
INPUT_PORTS_END
static INPUT_PORTS_START( othldrby )
@@ -3658,6 +3631,10 @@ static MACHINE_CONFIG_START( pwrkick, toaplan2_state )
MCFG_MACHINE_START_OVERRIDE(toaplan2_state,toaplan2)
MCFG_UPD4992_ADD("rtc")
+ MCFG_NVRAM_ADD_0FILL("nvram")
+
+ MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(PWRKICK_HOPPER_PULSE), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
@@ -3690,6 +3667,8 @@ static MACHINE_CONFIG_START( othldrby, toaplan2_state )
MCFG_MACHINE_START_OVERRIDE(toaplan2_state,toaplan2)
MCFG_UPD4992_ADD("rtc")
+ MCFG_NVRAM_ADD_0FILL("nvram")
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
diff --git a/src/mame/drivers/toobin.cpp b/src/mame/drivers/toobin.cpp
index f07cf0c4110..d35126e0033 100644
--- a/src/mame/drivers/toobin.cpp
+++ b/src/mame/drivers/toobin.cpp
@@ -86,22 +86,22 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, toobin_state )
AM_RANGE(0xc08000, 0xc097ff) AM_MIRROR(0x046000) AM_RAM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xc09800, 0xc09fff) AM_MIRROR(0x046000) AM_RAM AM_SHARE("mob")
AM_RANGE(0xc10000, 0xc107ff) AM_MIRROR(0x047800) AM_RAM_WRITE(paletteram_w) AM_SHARE("paletteram")
- AM_RANGE(0xba6000, 0xba6001) AM_MIRROR(0x4500fe) AM_READNOP /* who knows? read at controls time */
- AM_RANGE(0xba8000, 0xba8001) AM_MIRROR(0x4500fe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0xba8100, 0xba8101) AM_MIRROR(0x4500fe) AM_DEVWRITE8("jsa", atari_jsa_i_device, main_command_w, 0x00ff)
- AM_RANGE(0xba8300, 0xba8301) AM_MIRROR(0x45003e) AM_WRITE(intensity_w)
- AM_RANGE(0xba8340, 0xba8341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan")
- AM_RANGE(0xba8380, 0xba8381) AM_MIRROR(0x45003e) AM_RAM_WRITE(slip_w) AM_SHARE("mob:slip")
- AM_RANGE(0xba83c0, 0xba83c1) AM_MIRROR(0x45003e) AM_WRITE(scanline_int_ack_w)
- AM_RANGE(0xba8400, 0xba8401) AM_MIRROR(0x4500fe) AM_DEVWRITE("jsa", atari_jsa_i_device, sound_reset_w)
- AM_RANGE(0xba8500, 0xba8501) AM_MIRROR(0x4500fe) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
- AM_RANGE(0xba8600, 0xba8601) AM_MIRROR(0x4500fe) AM_WRITE(xscroll_w) AM_SHARE("xscroll")
- AM_RANGE(0xba8700, 0xba8701) AM_MIRROR(0x4500fe) AM_WRITE(yscroll_w) AM_SHARE("yscroll")
- AM_RANGE(0xba8800, 0xba8801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
- AM_RANGE(0xba9000, 0xba9001) AM_MIRROR(0x4507fe) AM_READ_PORT("FF9000")
- AM_RANGE(0xba9800, 0xba9801) AM_MIRROR(0x4507fe) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
- AM_RANGE(0xbaa000, 0xbaafff) AM_MIRROR(0x451000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
- AM_RANGE(0xbac000, 0xbaffff) AM_MIRROR(0x450000) AM_RAM
+ AM_RANGE(0x826000, 0x826001) AM_MIRROR(0x4500fe) AM_READNOP /* who knows? read at controls time */
+ AM_RANGE(0x828000, 0x828001) AM_MIRROR(0x4500fe) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
+ AM_RANGE(0x828100, 0x828101) AM_MIRROR(0x4500fe) AM_DEVWRITE8("jsa", atari_jsa_i_device, main_command_w, 0x00ff)
+ AM_RANGE(0x828300, 0x828301) AM_MIRROR(0x45003e) AM_WRITE(intensity_w)
+ AM_RANGE(0x828340, 0x828341) AM_MIRROR(0x45003e) AM_WRITE(interrupt_scan_w) AM_SHARE("interrupt_scan")
+ AM_RANGE(0x828380, 0x828381) AM_MIRROR(0x45003e) AM_RAM_WRITE(slip_w) AM_SHARE("mob:slip")
+ AM_RANGE(0x8283c0, 0x8283c1) AM_MIRROR(0x45003e) AM_WRITE(scanline_int_ack_w)
+ AM_RANGE(0x828400, 0x828401) AM_MIRROR(0x4500fe) AM_DEVWRITE("jsa", atari_jsa_i_device, sound_reset_w)
+ AM_RANGE(0x828500, 0x828501) AM_MIRROR(0x4500fe) AM_DEVWRITE("eeprom", atari_eeprom_device, unlock_write)
+ AM_RANGE(0x828600, 0x828601) AM_MIRROR(0x4500fe) AM_WRITE(xscroll_w) AM_SHARE("xscroll")
+ AM_RANGE(0x828700, 0x828701) AM_MIRROR(0x4500fe) AM_WRITE(yscroll_w) AM_SHARE("yscroll")
+ AM_RANGE(0x828800, 0x828801) AM_MIRROR(0x4507fe) AM_READ_PORT("FF8800")
+ AM_RANGE(0x829000, 0x829001) AM_MIRROR(0x4507fe) AM_READ_PORT("FF9000")
+ AM_RANGE(0x829800, 0x829801) AM_MIRROR(0x4507fe) AM_DEVREAD8("jsa", atari_jsa_i_device, main_response_r, 0x00ff)
+ AM_RANGE(0x82a000, 0x82afff) AM_MIRROR(0x451000) AM_DEVREADWRITE8("eeprom", atari_eeprom_device, read, write, 0x00ff)
+ AM_RANGE(0x82c000, 0x82ffff) AM_MIRROR(0x450000) AM_RAM
ADDRESS_MAP_END
diff --git a/src/mame/drivers/triforce.cpp b/src/mame/drivers/triforce.cpp
index 07fb15011b8..3cf4d22941f 100644
--- a/src/mame/drivers/triforce.cpp
+++ b/src/mame/drivers/triforce.cpp
@@ -30,35 +30,35 @@ Games on this system include....
|*| 2003 | F-Zero AX (Rev C) | Sega / Amusement Vision / Nintendo | GDROM | GDT-0004C | 317-0362-COM | 253-5508-0362 |
|*| 2003 | F-Zero AX (Rev D) | Sega / Amusement Vision / Nintendo | GDROM | GDT-0004D | 317-0362-COM | 253-5508-0362 |
|*| 2003 | F-Zero AX (Rev E) | Sega / Amusement Vision / Nintendo | GDROM | GDT-0004E | 317-0362-COM | 253-5508-0362 |
-| | 2003 | The Key Of Avalon: The Wizard Master (server) | Sega / Hitmaker | GDROM | GDT-0005 | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0005A | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (server) (Rev B) | Sega / Hitmaker | GDROM | GDT-0005B | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev C) | Sega / Hitmaker | GDROM | GDT-0005C | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (server) (Rev D) | Sega / Hitmaker | GDROM | GDT-0005D | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev E) | Sega / Hitmaker | GDROM | GDT-0005E | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev F) | Sega / Hitmaker | GDROM | GDT-0005F | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev G) | Sega / Hitmaker | GDROM | GDT-0005G | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (client) | Sega / Hitmaker | GDROM | GDT-0006 | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0006A | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0006B | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev C) | Sega / Hitmaker | GDROM | GDT-0006C | | |
-| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev D) | Sega / Hitmaker | GDROM | GDT-0006D | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (client) (Rev E) | Sega / Hitmaker | GDROM | GDT-0006E | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (client) (Rev F) | Sega / Hitmaker | GDROM | GDT-0006F | | |
-|*| 2003 | The Key Of Avalon: The Wizard Master (client) (Rev G) | Sega / Hitmaker | GDROM | GDT-0006G | | |
+| | 2003 | The Key Of Avalon: The Wizard Master (server) | Sega / Hitmaker | GDROM | GDT-0005 | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0005A | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (server) (Rev B) | Sega / Hitmaker | GDROM | GDT-0005B | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev C) | Sega / Hitmaker | GDROM | GDT-0005C | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (server) (Rev D) | Sega / Hitmaker | GDROM | GDT-0005D | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev E) | Sega / Hitmaker | GDROM | GDT-0005E | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev F) | Sega / Hitmaker | GDROM | GDT-0005F | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (server) (Rev G) | Sega / Hitmaker | GDROM | GDT-0005G | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (client) | Sega / Hitmaker | GDROM | GDT-0006 | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0006A | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0006B | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev C) | Sega / Hitmaker | GDROM | GDT-0006C | 317-0355-JPN | 253-5508-0355J|
+| | 2003 | The Key Of Avalon: The Wizard Master (client) (Rev D) | Sega / Hitmaker | GDROM | GDT-0006D | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (client) (Rev E) | Sega / Hitmaker | GDROM | GDT-0006E | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (client) (Rev F) | Sega / Hitmaker | GDROM | GDT-0006F | 317-0355-JPN | 253-5508-0355J|
+|*| 2003 | The Key Of Avalon: The Wizard Master (client) (Rev G) | Sega / Hitmaker | GDROM | GDT-0006G | 317-0355-JPN | 253-5508-0355J|
| | 2003 | Gekitou Pro Yakyuu Mizushima Shinji All Stars | Sega / Wow Entertainment | GDROM | GDT-0008 | 317-0371-JPN | |
| | 2003 | Gekitou Pro Yakyuu Mizushima Shinji All Stars (Rev A) | Sega / Wow Entertainment | GDROM | GDT-0008A | 317-0371-JPN | |
|*| 2003 | Gekitou Pro Yakyuu Mizushima Shinji All Stars (Rev B) | Sega / Wow Entertainment | GDROM | GDT-0008B | 317-0371-JPN | |
|*| 2003 | Gekitou Pro Yakyuu Mizushima Shinji All Stars (Rev C) | Sega / Wow Entertainment | GDROM | GDT-0008C | 317-0371-JPN | |
-| | 2003 | The Key Of Avalon 1.10 | Sega / Hitmaker | GDROM | | | |
-| | 2004 | The Key Of Avalon 1.??: ??? (server) | Sega / Hitmaker | GDROM | GDT-0009 | | |
-|*| 2004 | The Key Of Avalon 1.20: Summon The New Monster (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0009A | | |
-| | 2004 | The Key Of Avalon 1.??: ??? (server) (Rev B) | Sega / Hitmaker | GDROM | GDT-0009B | | |
-|*| 2004 | The Key Of Avalon 1.30: Chaotic Sabbat (server) (Rev C) | Sega / Hitmaker | GDROM | GDT-0009C | | |
-| | 2004 | The Key Of Avalon 1.??: ??? (client) | Sega / Hitmaker | GDROM | GDT-0010 | | |
-|*| 2004 | The Key Of Avalon 1.20: Summon The New Monster (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0010A | | |
-| | 2004 | The Key Of Avalon 1.??: ??? (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0010B | | |
-|*| 2004 | The Key Of Avalon 1.30: Chaotic Sabbat (client) (Rev C) | Sega / Hitmaker | GDROM | GDT-0010C | | |
+| | 2003 | The Key Of Avalon 1.10 | Sega / Hitmaker | GDROM | | 317-0355-JPN | 253-5508-0355J|
+| | 2004 | The Key Of Avalon 1.??: ??? (server) | Sega / Hitmaker | GDROM | GDT-0009 | 317-0355-JPN | 253-5508-0355J|
+|*| 2004 | The Key Of Avalon 1.20: Summon The New Monster (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0009A | 317-0355-JPN | 253-5508-0355J|
+| | 2004 | The Key Of Avalon 1.??: ??? (server) (Rev B) | Sega / Hitmaker | GDROM | GDT-0009B | 317-0355-JPN | 253-5508-0355J|
+|*| 2004 | The Key Of Avalon 1.30: Chaotic Sabbat (server) (Rev C) | Sega / Hitmaker | GDROM | GDT-0009C | 317-0355-JPN | 253-5508-0355J|
+| | 2004 | The Key Of Avalon 1.??: ??? (client) | Sega / Hitmaker | GDROM | GDT-0010 | 317-0355-JPN | 253-5508-0355J|
+|*| 2004 | The Key Of Avalon 1.20: Summon The New Monster (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0010A | 317-0355-JPN | 253-5508-0355J|
+| | 2004 | The Key Of Avalon 1.??: ??? (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0010B | 317-0355-JPN | 253-5508-0355J|
+|*| 2004 | The Key Of Avalon 1.30: Chaotic Sabbat (client) (Rev C) | Sega / Hitmaker | GDROM | GDT-0010C | 317-0355-JPN | 253-5508-0355J|
|*| 2004 | Firmware Update | Sega | GDROM | GDT-0011 | 317-0371-JPN | |
| | 2004 | Virtua Striker 2002 (Export) | Sega | GDROM | GDT-0012 | | |
| | 2004 | Virtua Striker 4 (Japan) | Sega | GDROM | GDT-0013 | 317-0391-JPN | |
@@ -75,13 +75,13 @@ Games on this system include....
|*| 2004 | The Key Of Avalon 2: Eutaxy Commandment (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0017B | | |
| | 2004 | F-Zero AX - Monster Ride Cycraft Edition | Sega / Amusement Vision / Nintendo | GDROM | | | |
| | 2005 | Donkey Kong Jungle Fever | Namco / Nintendo | Cart | | | |
-|*| 2005 | Mario Kart Arcade GP (Japan, MKA1 Ver.A1) | Namco / Nintendo | Cart | 837-14343-4T1 | 317-5109-COM | 253-5509-5109 |
-| | 2005 | The Key Of Avalon 2.5: War of the Key (client) | Sega / Hitmaker | GDROM | GDT-0018 | | |
-| | 2005 | The Key Of Avalon 2.5: War of the Key (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0018A | | |
-| | 2005 | The Key Of Avalon 2.5: War of the Key (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0018B | | |
-| | 2005 | The Key Of Avalon 2.5: War of the Key (server) | Sega / Hitmaker | GDROM | GDT-0019 | | |
-| | 2005 | The Key Of Avalon 2.5: War of the Key (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0019A | | |
-| | 2005 | The Key Of Avalon 2.5: War of the Key (server) (Rev B) | Sega / Hitmaker | GDROM | GDT-0019B | | |
+|*| 2005 | Mario Kart Arcade GP (Japan, MKA1 Ver.A1) | Namco / Nintendo | Cart | 837-14343-4T1 |!317-5109-COM | 253-5509-5109 |
+| | 2005 | The Key Of Avalon 2.5: War of the Key (server) | Sega / Hitmaker | GDROM | GDT-0018 | | |
+| | 2005 | The Key Of Avalon 2.5: War of the Key (server) (Rev A) | Sega / Hitmaker | GDROM | GDT-0018A | | |
+|*| 2005 | The Key Of Avalon 2.5: War of the Key (server) (Rev B) | Sega / Hitmaker | GDROM | GDT-0018B | | |
+| | 2005 | The Key Of Avalon 2.5: War of the Key (client) | Sega / Hitmaker | GDROM | GDT-0019 | | |
+| | 2005 | The Key Of Avalon 2.5: War of the Key (client) (Rev A) | Sega / Hitmaker | GDROM | GDT-0019A | | |
+|*| 2005 | The Key Of Avalon 2.5: War of the Key (client) (Rev B) | Sega / Hitmaker | GDROM | GDT-0019B | | |
| | 2006 | Virtua Striker 4 Ver.2006 (Japan) | Sega | GDROM | GDT-0020 | | |
| | 2006 | Virtua Striker 4 Ver.2006 (Japan) (Rev A) | Sega | GDROM | GDT-0020A | | |
| | 2006 | Virtua Striker 4 Ver.2006 (Japan) (Rev B) | Sega | GDROM | GDT-0020B | | |
@@ -91,11 +91,11 @@ Games on this system include....
| | 2006 | Triforce Firmware Update for Compact Flash Box | Sega | GDROM | GDT-0022 | 317-0567-COM | |
|*| 2006 | Triforce Firmware Update for Compact Flash Box (Rev A) | Sega | GDROM | GDT-0022A | 317-0567-COM | |
| | 2006 | Donkey Kong : Banana Kingdom | Namco / Nintendo | Cart? | | | |
-|*| 2007 | Mario Kart Arcade GP 2 (Japan, MK21 Ver.A) | Namco / Nintendo | Cart | 837-14343-R4S0 | 317-5128-??? | 253-5509-5128 |
-|*| 2007 | Mario Kart Arcade GP 2 (Japan, MK21 Ver.A, alt dump) | Namco / Nintendo | Cart | 837-14343-R4S0 | 317-5128-??? | 253-5509-5128 |
+|*| 2007 | Mario Kart Arcade GP 2 (Japan, MK21 Ver.A) | Namco / Nintendo | Cart | 837-14343-R4S0 |!317-5128-??? | 253-5509-5128 |
+|*| 2007 | Mario Kart Arcade GP 2 (Japan, MK21 Ver.A, alt dump) | Namco / Nintendo | Cart | 837-14343-R4S0 |!317-5128-??? | 253-5509-5128 |
+-+------+-----------------------------------------------------------------+-------------------------------------+-------|----------------+--------------+---------------|
* denotes these games are archived.
-
+! security PIC is not dumped
PCB Layouts
===========
@@ -685,7 +685,7 @@ ROM_START( avalonsc )
DISK_IMAGE_READONLY( "gdt-0005c", 0, SHA1(37b848ed131e8357ba57474f7c2aa6ab51b01781) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalonse )
@@ -695,7 +695,7 @@ ROM_START( avalonse )
DISK_IMAGE_READONLY( "gdt-0005e", 0, SHA1(a888a045c323f374b53295404262a3bb80a533c0) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalonsf )
@@ -705,7 +705,7 @@ ROM_START( avalonsf )
DISK_IMAGE_READONLY( "gdt-0005f", 0, SHA1(3752e406a5542a912f8b1ef48096ed30e7d28279) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalons )
@@ -715,7 +715,7 @@ ROM_START( avalons )
DISK_IMAGE_READONLY( "gdt-0005g", 0, SHA1(f2dca7ecd6c07ff098ac91e353ffc3fd843054e3) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalonce )
@@ -725,7 +725,7 @@ ROM_START( avalonce )
DISK_IMAGE_READONLY( "gdt-0006e", 0, SHA1(59aeb7d767d390b3ee7f079d3d1a31df3e92773b) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avaloncf )
@@ -735,7 +735,7 @@ ROM_START( avaloncf )
DISK_IMAGE_READONLY( "gdt-0006f", 0, SHA1(35c98e41095273326ac0c6fe633c3f6e8b328f63) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalonc )
@@ -745,7 +745,7 @@ ROM_START( avalonc )
DISK_IMAGE_READONLY( "gdt-0006g", 0, SHA1(96e1db3f395152a62d0b344c350f38306ab1e0ae) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( gekpuryb )
@@ -775,7 +775,7 @@ ROM_START( avalns12 )
DISK_IMAGE_READONLY( "gdt-0009a", 0, SHA1(abeb242cb7f55d003eb7ca6d42dccdb5d8080bf1) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalns13 )
@@ -785,7 +785,7 @@ ROM_START( avalns13 )
DISK_IMAGE_READONLY( "gdt-0009c", 0, SHA1(b960815d85e255521fc26bd4a9e4b7e5c4469487) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( avalnc12 )
@@ -795,7 +795,7 @@ ROM_START( avalnc12 )
DISK_IMAGE_READONLY( "gdt-0010a", 0, SHA1(a82f803a2097890c29e44ef30d97ad1fcf550435) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
/*
@@ -822,7 +822,7 @@ ROM_START( avalnc13 )
DISK_IMAGE_READONLY( "gdt-0010c", 0, SHA1(c7a3fdb467ccd03b5b9b9e8e290faabcbbc77546) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("avalon.data", 0x00, 0x50, CRC(6c51e5d6) SHA1(84afef983f1f855fe8722f55baa8ea5121da9369) )
+ ROM_LOAD("317-0355-jpn.data", 0x00, 0x50, CRC(9b9db9d8) SHA1(60aab36fcfd7a2850b2947effea70e44a06d1f78) )
ROM_END
ROM_START( tfupdate )
@@ -913,7 +913,27 @@ ROM_START( avalon20 )
DISK_IMAGE_READONLY( "gdt-0017b", 0, BAD_DUMP SHA1(e2dd32c322ffcaf38b82275d2721b71bb3dfc1f2) )
ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
- ROM_LOAD("gdt-0017b.data", 0x00, 0x50, CRC(32cb46d4) SHA1(a58b9e03d57b317133d9b6c29e42852af8e77559) )
+ ROM_LOAD("avalon2x.data", 0x00, 0x50, CRC(c5071ada) SHA1(70018180b917beec1b2c272f9125fa43fd1a7b00) )
+ROM_END
+
+ROM_START( avalns25 )
+ TRIFORCE_BIOS
+
+ DISK_REGION( "gdrom" )
+ DISK_IMAGE_READONLY( "gdt-0018b", 0, SHA1(4cd10813e66b72021ca344886638025f979d40c0) )
+
+ ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
+ ROM_LOAD("avalon2x.data", 0x00, 0x50, CRC(c5071ada) SHA1(70018180b917beec1b2c272f9125fa43fd1a7b00) )
+ROM_END
+
+ROM_START( avalnc25 )
+ TRIFORCE_BIOS
+
+ DISK_REGION( "gdrom" )
+ DISK_IMAGE_READONLY( "gdt-0019b", 0, SHA1(7f978ec998a86ed9c36a495bfa72073c6d2bbe31) )
+
+ ROM_REGION( 0x50, "pic", ROMREGION_ERASE)
+ ROM_LOAD("avalon2x.data", 0x00, 0x50, CRC(c5071ada) SHA1(70018180b917beec1b2c272f9125fa43fd1a7b00) )
ROM_END
ROM_START( vs42006 )
@@ -1079,12 +1099,12 @@ ROM_END
// 0017 GAME( 2004, avalc20o, avalon20, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.0 - Eutaxy and Commandment (client) (GDT-0017)", MACHINE_IS_SKELETON )
// 0017A GAME( 2004, avalc20a, avalon20, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.0 - Eutaxy and Commandment (client) (Rev A) (GDT-0017A)", MACHINE_IS_SKELETON )
/* 0017B */ GAME( 2004, avalon20, triforce, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.0 - Eutaxy and Commandment (client) (Rev B) (GDT-0017B)", MACHINE_IS_SKELETON )
-// 0018 GAME( 2005, aval25co, aval25c, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (client) (GDT-0018)", MACHINE_IS_SKELETON )
-// 0018A GAME( 2005, aval25ca, aval25c, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (client) (Rev A) (GDT-0018A)", MACHINE_IS_SKELETON )
-// 0018B GAME( 2005, aval25c, triforce, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (client) (Rev B) (GDT-0018B)", MACHINE_IS_SKELETON )
-// 0019 GAME( 2005, aval25so, aval25s, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (server) (GDT-0019)", MACHINE_IS_SKELETON )
-// 0019A GAME( 2005, aval25sa, aval25s, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (server) (Rev A) (GDT-0019A)", MACHINE_IS_SKELETON )
-// 0019B GAME( 2005, aval25s, triforce, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (server) (Rev B) (GDT-0019B)", MACHINE_IS_SKELETON )
+// 0018 GAME( 2005, aval25co, aval25c, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (server) (GDT-0018)", MACHINE_IS_SKELETON )
+// 0018A GAME( 2005, aval25ca, aval25c, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (server) (Rev A) (GDT-0018A)", MACHINE_IS_SKELETON )
+/* 0018B */ GAME( 2005, avalns25, triforce, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (server) (Rev B) (GDT-0018B)", MACHINE_IS_SKELETON )
+// 0019 GAME( 2005, aval25so, aval25s, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (client) (GDT-0019)", MACHINE_IS_SKELETON )
+// 0019A GAME( 2005, aval25sa, aval25s, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (client) (Rev A) (GDT-0019A)", MACHINE_IS_SKELETON )
+/* 0019B */ GAME( 2005, avalnc25, triforce, triforcegd, triforce, driver_device, 0, ROT0, "Sega / Hitmaker", "The Key Of Avalon 2.5 - War of the Key (client) (Rev B) (GDT-0019B)", MACHINE_IS_SKELETON )
// 0020 GAME( 2006, vs42k6o, vs42006, triforcegd, triforce, driver_device, 0, ROT0, "Sega", "Virtua Striker 4 Ver.2006 (Japan) (GDT-0020)", MACHINE_IS_SKELETON )
// 0020A GAME( 2006, vs42k6a, vs42006, triforcegd, triforce, driver_device, 0, ROT0, "Sega", "Virtua Striker 4 Ver.2006 (Japan) (Rev A) (GDT-0020A)", MACHINE_IS_SKELETON )
// 0020B GAME( 2006, vs42k6b, vs42006, triforcegd, triforce, driver_device, 0, ROT0, "Sega", "Virtua Striker 4 Ver.2006 (Japan) (Rev B) (GDT-0020B)", MACHINE_IS_SKELETON )
diff --git a/src/mame/drivers/uapce.cpp b/src/mame/drivers/uapce.cpp
index 1868e615c02..14358a66aa1 100644
--- a/src/mame/drivers/uapce.cpp
+++ b/src/mame/drivers/uapce.cpp
@@ -276,7 +276,7 @@ static INPUT_PORTS_START( uapce )
PORT_DIPSETTING( 0x30, "12 minute Timed Play" )
PORT_DIPSETTING( 0x38, "20 minute Timed Play" )
PORT_DIPNAME( 0x40, 0x40, "Buy-In Feature" )
- PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp
index 269dafacfd3..6dde2254705 100644
--- a/src/mame/drivers/vegas.cpp
+++ b/src/mame/drivers/vegas.cpp
@@ -666,13 +666,13 @@ WRITE32_MEMBER( vegas_state::timekeeper_w )
{
if (m_cmos_unlocked)
{
- if ((mem_mask & 0x000000ff) != 0)
+ if (ACCESSING_BITS_0_7)
m_timekeeper->write(space, offset * 4 + 0, data >> 0, 0xff);
- if ((mem_mask & 0x0000ff00) != 0)
+ if (ACCESSING_BITS_8_15)
m_timekeeper->write(space, offset * 4 + 1, data >> 8, 0xff);
- if ((mem_mask & 0x00ff0000) != 0)
+ if (ACCESSING_BITS_16_23)
m_timekeeper->write(space, offset * 4 + 2, data >> 16, 0xff);
- if ((mem_mask & 0xff000000) != 0)
+ if (ACCESSING_BITS_24_31)
m_timekeeper->write(space, offset * 4 + 3, data >> 24, 0xff);
if (offset*4 >= 0x7ff0)
if (LOG_TIMEKEEPER) logerror("timekeeper_w(%04X & %08X) = %08X\n", offset*4, mem_mask, data);
@@ -686,13 +686,13 @@ WRITE32_MEMBER( vegas_state::timekeeper_w )
READ32_MEMBER( vegas_state::timekeeper_r )
{
UINT32 result = 0xffffffff;
- if ((mem_mask & 0x000000ff) != 0)
+ if (ACCESSING_BITS_0_7)
result = (result & ~0x000000ff) | (m_timekeeper->read(space, offset * 4 + 0, 0xff) << 0);
- if ((mem_mask & 0x0000ff00) != 0)
+ if (ACCESSING_BITS_8_15)
result = (result & ~0x0000ff00) | (m_timekeeper->read(space, offset * 4 + 1, 0xff) << 8);
- if ((mem_mask & 0x00ff0000) != 0)
+ if (ACCESSING_BITS_16_23)
result = (result & ~0x00ff0000) | (m_timekeeper->read(space, offset * 4 + 2, 0xff) << 16);
- if ((mem_mask & 0xff000000) != 0)
+ if (ACCESSING_BITS_24_31)
result = (result & ~0xff000000) | (m_timekeeper->read(space, offset * 4 + 3, 0xff) << 24);
if (offset*4 >= 0x7ff0)
if (LOG_TIMEKEEPER) logerror("timekeeper_r(%04X & %08X) = %08X\n", offset*4, mem_mask, result);
diff --git a/src/mame/drivers/vroulet.cpp b/src/mame/drivers/vroulet.cpp
index dcbf7a37c29..1d7f9da46c8 100644
--- a/src/mame/drivers/vroulet.cpp
+++ b/src/mame/drivers/vroulet.cpp
@@ -167,7 +167,7 @@ static INPUT_PORTS_START( vroulet )
PORT_START("IN0")
PORT_SERVICE( 0x01, IP_ACTIVE_LOW )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_TILT )
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F1) PORT_NAME("Memory Reset")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MEMORY_RESET )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Reset Machine")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
diff --git a/src/mame/drivers/wangpc.cpp b/src/mame/drivers/wangpc.cpp
index 59b7adf40f1..2b43d59b194 100644
--- a/src/mame/drivers/wangpc.cpp
+++ b/src/mame/drivers/wangpc.cpp
@@ -1109,8 +1109,8 @@ static MACHINE_CONFIG_START( wangpc, wangpc_state )
MCFG_PIT8253_CLK2(500000)
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(wangpc_state, pit2_w))
- MCFG_IM6402_ADD(IM6402_TAG, 0, 62500*16) // HACK for wangpckb in IM6402 derives clocks from data line
- MCFG_IM6402_TRO_CALLBACK(DEVWRITELINE(WANGPC_KEYBOARD_TAG, wangpc_keyboard_device, write_rxd))
+ MCFG_IM6402_ADD(IM6402_TAG, 62500*16, 62500*16)
+ MCFG_IM6402_TRO_CALLBACK(DEVWRITELINE(WANGPC_KEYBOARD_TAG, wangpc_keyboard_t, write_rxd))
MCFG_IM6402_DR_CALLBACK(WRITELINE(wangpc_state, uart_dr_w))
MCFG_IM6402_TBRE_CALLBACK(WRITELINE(wangpc_state, uart_tbre_w))
diff --git a/src/mame/includes/lisa.h b/src/mame/includes/lisa.h
index f359191d605..b3a32f84a21 100644
--- a/src/mame/includes/lisa.h
+++ b/src/mame/includes/lisa.h
@@ -192,10 +192,6 @@ public:
int m_videoROM_address;
DECLARE_READ8_MEMBER(lisa_fdc_io_r);
DECLARE_WRITE8_MEMBER(lisa_fdc_io_w);
- DECLARE_READ8_MEMBER(lisa_fdc_r);
- DECLARE_READ8_MEMBER(lisa210_fdc_r);
- DECLARE_WRITE8_MEMBER(lisa_fdc_w);
- DECLARE_WRITE8_MEMBER(lisa210_fdc_w);
DECLARE_READ16_MEMBER(lisa_r);
DECLARE_WRITE16_MEMBER(lisa_w);
DECLARE_READ16_MEMBER(lisa_IO_r);
diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h
index 1a7eb44e195..a4fbde58e80 100644
--- a/src/mame/includes/toaplan2.h
+++ b/src/mame/includes/toaplan2.h
@@ -12,6 +12,7 @@
#include "machine/eepromser.h"
#include "machine/gen_latch.h"
#include "machine/nmk112.h"
+#include "machine/ticket.h"
#include "machine/upd4992.h"
#include "video/gp9001.h"
#include "sound/okim6295.h"
@@ -47,7 +48,8 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
- m_soundlatch2(*this, "soundlatch2") { }
+ m_soundlatch2(*this, "soundlatch2"),
+ m_hopper(*this, "hopper") { }
optional_shared_ptr<UINT8> m_shared_ram; // 8 bit RAM shared between 68K and sound CPU
optional_shared_ptr<UINT16> m_shared_ram16; // Really 8 bit RAM connected to Z180
@@ -72,6 +74,7 @@ public:
required_device<palette_device> m_palette;
optional_device<generic_latch_8_device> m_soundlatch; // batrider and bgaregga and batsugun
optional_device<generic_latch_8_device> m_soundlatch2;
+ optional_device<ticket_dispenser_device> m_hopper;
UINT16 m_mcu_data;
INT8 m_old_p1_paddle_h; /* For Ghox */
@@ -158,9 +161,8 @@ public:
void create_tx_tilemap(int dx = 0, int dx_flipped = 0);
void toaplan2_vblank_irq(int irq_line);
- UINT8 m_pwrkick_hopper;
- DECLARE_CUSTOM_INPUT_MEMBER(pwrkick_hopper_status_r);
DECLARE_WRITE8_MEMBER(pwrkick_coin_w);
+ DECLARE_WRITE8_MEMBER(pwrkick_coin_lockout_w);
DECLARE_WRITE_LINE_MEMBER(toaplan2_reset);
protected:
diff --git a/src/mame/machine/abc1600mac.cpp b/src/mame/machine/abc1600mac.cpp
index 10e64e179c5..7b1dafec391 100644
--- a/src/mame/machine/abc1600mac.cpp
+++ b/src/mame/machine/abc1600mac.cpp
@@ -6,16 +6,6 @@
**********************************************************************/
-/*
-
- TODO:
-
- - segment/page RAM addresses are not correctly decoded, "sas/format/format" can't find the SASI interface because of this
- forcetask0 1 t0 0 t1 0 t2 0 t3 0
- sega19 0 task 0
- sega 000 segd 00 pga 008 pgd 4058 virtual 02c730 (should be 004730)
-*/
-
#include "abc1600mac.h"
@@ -25,6 +15,8 @@
//**************************************************************************
#define LOG 0
+#define LOG_MAC 0
+#define LOG_DMA 0
#define A0 BIT(offset, 0)
@@ -116,15 +108,15 @@ const tiny_rom_entry *abc1600_mac_device::device_rom_region() const
// abc1600_mac_device - constructor
//-------------------------------------------------
-abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, ABC1600_MAC, "ABC 1600 MAC", tag, owner, clock, "abc1600mac", __FILE__),
- device_memory_interface(mconfig, *this),
- m_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)),
- m_rom(*this, "boot"),
- m_segment_ram(*this, "segment_ram"),
- m_page_ram(*this, "page_ram"),
- m_watchdog(*this, "watchdog"),
- m_task(0)
+abc1600_mac_device::abc1600_mac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, ABC1600_MAC, "ABC 1600 MAC", tag, owner, clock, "abc1600mac", __FILE__),
+ device_memory_interface(mconfig, *this),
+ m_space_config("program", ENDIANNESS_LITTLE, 8, 22, 0, *ADDRESS_MAP_NAME(program_map)),
+ m_rom(*this, "boot"),
+ m_segment_ram(*this, "segment_ram"),
+ m_page_ram(*this, "page_ram"),
+ m_watchdog(*this, "watchdog"),
+ m_task(0)
{
}
@@ -145,6 +137,7 @@ void abc1600_mac_device::device_start()
// HACK fill segment RAM or abcenix won't boot
memset(m_segment_ram, 0xcd, 0x400);
+ memset(m_page_ram, 0xcd, 0x400);
// state saving
save_item(NAME(m_ifc2));
@@ -241,6 +234,8 @@ offs_t abc1600_mac_device::translate_address(offs_t offset, int *nonx, int *wp)
*nonx = PAGE_NONX;
*wp = PAGE_WP;
+ if (LOG_MAC) logerror("%s MAC %05x:%06x (SEGA %03x SEGD %02x PGA %03x PGD %04x NONX %u WP %u)\n", machine().describe_context(), offset, virtual_offset, sega, segd, pga, m_page_ram[pga], *nonx, *wp);
+
return virtual_offset;
}
@@ -441,7 +436,7 @@ WRITE8_MEMBER( abc1600_mac_device::task_w )
m_task = data ^ 0xff;
- if (LOG) logerror("%s: %06x Task %u BOOTE %u MAGIC %u\n", machine().describe_context(), offset, get_current_task(offset), BOOTE, MAGIC);
+ if (LOG) logerror("%s TASK %05x:%02x (TASK %u BOOTE %u MAGIC %u)\n", machine().describe_context(), offset, data, get_current_task(offset), BOOTE, MAGIC);
}
@@ -498,7 +493,7 @@ WRITE8_MEMBER( abc1600_mac_device::segment_w )
m_segment_ram[sega] = data & 0x7f;
- if (LOG) logerror("%s: %06x Task %u Segment %03x : %02x\n", machine().describe_context(), offset, get_current_task(offset), sega, data);
+ if (LOG) logerror("%s SEGMENT %05x:%02x (SEGA %03x SEGD %02x)\n", machine().describe_context(), offset, data, sega, m_segment_ram[sega]);
}
@@ -603,7 +598,7 @@ WRITE8_MEMBER( abc1600_mac_device::page_w )
m_page_ram[pga] = ((data & 0xc3) << 8) | (m_page_ram[pga] & 0xff);
}
- if (LOG) logerror("%s: %06x Task %u Segment %03x Page %03x : %02x -> %04x\n", machine().describe_context(), offset, get_current_task(offset), sega, pga, data, m_page_ram[pga]);
+ if (LOG) logerror("%s PAGE %05x:%02x (SEGA %03x SEGD %02x PGA %03x PGD %04x)\n", machine().describe_context(), offset, data, sega, segd, pga, m_page_ram[pga]);
}
@@ -631,6 +626,8 @@ UINT8 abc1600_mac_device::dma_mreq_r(int index, UINT16 offset)
{
offs_t virtual_offset = get_dma_address(index, offset);
+ if (LOG_DMA)logerror("%s DMA R %04x:%06x\n", machine().describe_context(), offset, virtual_offset);
+
return space().read_byte(virtual_offset);
}
@@ -643,6 +640,8 @@ void abc1600_mac_device::dma_mreq_w(int index, UINT16 offset, UINT8 data)
{
offs_t virtual_offset = get_dma_address(index, offset);
+ if (LOG_DMA)logerror("%s DMA W %04x:%06x\n", machine().describe_context(), offset, virtual_offset);
+
space().write_byte(virtual_offset, data);
}
@@ -655,6 +654,8 @@ UINT8 abc1600_mac_device::dma_iorq_r(int index, UINT16 offset)
{
offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset);
+ if (LOG_DMA)logerror("%s DMA R %04x:%06x\n", machine().describe_context(), offset, virtual_offset);
+
return space().read_byte(virtual_offset);
}
@@ -667,6 +668,8 @@ void abc1600_mac_device::dma_iorq_w(int index, UINT16 offset, UINT8 data)
{
offs_t virtual_offset = 0x1fe000 | get_dma_address(index, offset);
+ if (LOG_DMA)logerror("%s DMA W %04x:%06x\n", machine().describe_context(), offset, virtual_offset);
+
space().write_byte(virtual_offset, data);
}
@@ -692,7 +695,7 @@ WRITE8_MEMBER( abc1600_mac_device::dmamap_w )
*/
- if (LOG) logerror("DMAMAP %u %02x\n", offset & 7, data);
+ if (LOG_DMA) logerror("%s DMAMAP %u:%02x\n", machine().describe_context(), offset & 7, data);
m_dmamap[offset & 7] = data;
}
diff --git a/src/mame/machine/apollo.cpp b/src/mame/machine/apollo.cpp
index abd6f7c7622..8adf11a98c5 100644
--- a/src/mame/machine/apollo.cpp
+++ b/src/mame/machine/apollo.cpp
@@ -276,7 +276,7 @@ WRITE16_MEMBER(apollo_state::apollo_csr_control_register_w)
}
}
- cpu_control_register = (cpu_control_register & ~mem_mask) | (data & mem_mask);
+ COMBINE_DATA(&cpu_control_register);
output().set_value("internal_led_1", (cpu_control_register >> 15) & 1);
output().set_value("internal_led_2", (cpu_control_register >> 14) & 1);
diff --git a/src/mame/machine/at.cpp b/src/mame/machine/at.cpp
index 8096b50e289..14508efb797 100644
--- a/src/mame/machine/at.cpp
+++ b/src/mame/machine/at.cpp
@@ -12,6 +12,7 @@
#include "machine/at_keybc.h"
#include "bus/pc_kbd/pc_kbdc.h"
#include "sound/dac.h"
+#include "softlist_dev.h"
#define LOG_PORT80 0
diff --git a/src/mame/machine/bebox.cpp b/src/mame/machine/bebox.cpp
index d5f99d9d0a7..c13fa303c8b 100644
--- a/src/mame/machine/bebox.cpp
+++ b/src/mame/machine/bebox.cpp
@@ -622,28 +622,28 @@ READ64_MEMBER(bebox_state::scsi53c810_r )
{
int reg = offset*8;
UINT64 r = 0;
- if (!(mem_mask & U64(0xff00000000000000))) {
+ if (!ACCESSING_BITS_56_63) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+0) << 56;
}
- if (!(mem_mask & U64(0x00ff000000000000))) {
+ if (!ACCESSING_BITS_48_55) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+1) << 48;
}
- if (!(mem_mask & U64(0x0000ff0000000000))) {
+ if (!ACCESSING_BITS_40_47) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+2) << 40;
}
- if (!(mem_mask & U64(0x000000ff00000000))) {
+ if (!ACCESSING_BITS_32_39) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+3) << 32;
}
- if (!(mem_mask & U64(0x00000000ff000000))) {
+ if (!ACCESSING_BITS_24_31) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+4) << 24;
}
- if (!(mem_mask & U64(0x0000000000ff0000))) {
+ if (!ACCESSING_BITS_16_23) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+5) << 16;
}
- if (!(mem_mask & U64(0x000000000000ff00))) {
+ if (!ACCESSING_BITS_8_15) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+6) << 8;
}
- if (!(mem_mask & U64(0x00000000000000ff))) {
+ if (!ACCESSING_BITS_0_7) {
r |= (UINT64)m_lsi53c810->lsi53c810_reg_r(reg+7) << 0;
}
@@ -654,28 +654,28 @@ READ64_MEMBER(bebox_state::scsi53c810_r )
WRITE64_MEMBER(bebox_state::scsi53c810_w )
{
int reg = offset*8;
- if (!(mem_mask & U64(0xff00000000000000))) {
+ if (!ACCESSING_BITS_56_63) {
m_lsi53c810->lsi53c810_reg_w(reg+0, data >> 56);
}
- if (!(mem_mask & U64(0x00ff000000000000))) {
+ if (!ACCESSING_BITS_48_55) {
m_lsi53c810->lsi53c810_reg_w(reg+1, data >> 48);
}
- if (!(mem_mask & U64(0x0000ff0000000000))) {
+ if (!ACCESSING_BITS_40_47) {
m_lsi53c810->lsi53c810_reg_w(reg+2, data >> 40);
}
- if (!(mem_mask & U64(0x000000ff00000000))) {
+ if (!ACCESSING_BITS_32_39) {
m_lsi53c810->lsi53c810_reg_w(reg+3, data >> 32);
}
- if (!(mem_mask & U64(0x00000000ff000000))) {
+ if (!ACCESSING_BITS_24_31) {
m_lsi53c810->lsi53c810_reg_w(reg+4, data >> 24);
}
- if (!(mem_mask & U64(0x0000000000ff0000))) {
+ if (!ACCESSING_BITS_16_23) {
m_lsi53c810->lsi53c810_reg_w(reg+5, data >> 16);
}
- if (!(mem_mask & U64(0x000000000000ff00))) {
+ if (!ACCESSING_BITS_8_15) {
m_lsi53c810->lsi53c810_reg_w(reg+6, data >> 8);
}
- if (!(mem_mask & U64(0x00000000000000ff))) {
+ if (!ACCESSING_BITS_0_7) {
m_lsi53c810->lsi53c810_reg_w(reg+7, data >> 0);
}
}
diff --git a/src/mame/machine/dc.cpp b/src/mame/machine/dc.cpp
index 913567116b7..e74d9757967 100644
--- a/src/mame/machine/dc.cpp
+++ b/src/mame/machine/dc.cpp
@@ -271,7 +271,7 @@ int dc_state::decode_reg3216_64(UINT32 offset, UINT64 mem_mask, UINT64 *shift)
//machine().debug_break();
}
- if (mem_mask & U64(0x0000ffff00000000))
+ if (ACCESSING_BITS_32_47)
{
reg++;
*shift = 32;
diff --git a/src/mame/machine/lisa.cpp b/src/mame/machine/lisa.cpp
index 2e0cf3de51f..94b05e25270 100644
--- a/src/mame/machine/lisa.cpp
+++ b/src/mame/machine/lisa.cpp
@@ -1221,66 +1221,6 @@ WRITE8_MEMBER(lisa_state::lisa_fdc_io_w)
}
}
-READ8_MEMBER(lisa_state::lisa_fdc_r)
-{
- if (! (offset & 0x1000))
- {
- if (! (offset & 0x0800))
- if (! (offset & 0x0400))
- return m_fdc_ram[offset & 0x03ff];
- else
- return lisa_fdc_io_r(space, offset & 0x03ff);
- else
- return 0; /* ??? */
- }
- else
- return m_fdc_rom[offset & 0x0fff];
-}
-
-READ8_MEMBER(lisa_state::lisa210_fdc_r)
-{
- if (! (offset & 0x1000))
- {
- if (! (offset & 0x0400))
- if (! (offset & 0x0800))
- return m_fdc_ram[offset & 0x03ff];
- else
- return lisa_fdc_io_r(space, offset & 0x03ff);
- else
- return 0; /* ??? */
- }
- else
- return m_fdc_rom[offset & 0x0fff];
-}
-
-WRITE8_MEMBER(lisa_state::lisa_fdc_w)
-{
- if (! (offset & 0x1000))
- {
- if (! (offset & 0x0800))
- {
- if (! (offset & 0x0400))
- m_fdc_ram[offset & 0x03ff] = data;
- else
- lisa_fdc_io_w(space, offset & 0x03ff, data);
- }
- }
-}
-
-WRITE8_MEMBER(lisa_state::lisa210_fdc_w)
-{
- if (! (offset & 0x1000))
- {
- if (! (offset & 0x0400))
- {
- if (! (offset & 0x0800))
- m_fdc_ram[offset & 0x03ff] = data;
- else
- lisa_fdc_io_w(space, offset & 0x03ff, data);
- }
- }
-}
-
READ16_MEMBER(lisa_state::lisa_r)
{
int answer=0;
diff --git a/src/mame/machine/m1comm.cpp b/src/mame/machine/m1comm.cpp
index 38b17b14501..a395c5885cb 100644
--- a/src/mame/machine/m1comm.cpp
+++ b/src/mame/machine/m1comm.cpp
@@ -77,7 +77,7 @@ static ADDRESS_MAP_START( m1comm_io, AS_IO, 8, m1comm_device )
AM_RANGE(0x20, 0x2F) AM_READWRITE(dma_reg_r, dma_reg_w)
AM_RANGE(0x40, 0x40) AM_READWRITE(syn_r, syn_w)
AM_RANGE(0x60, 0x60) AM_READWRITE(zfg_r, zfg_w)
- AM_RANGE(0xFFFF, 0xFFFF) AM_RAM
+ AM_RANGE(0xFF, 0xFF) AM_RAM
ADDRESS_MAP_END
MACHINE_CONFIG_FRAGMENT( m1comm )
diff --git a/src/mame/machine/m3comm.cpp b/src/mame/machine/m3comm.cpp
index 4671375eea9..bcacd9e2b04 100644
--- a/src/mame/machine/m3comm.cpp
+++ b/src/mame/machine/m3comm.cpp
@@ -318,10 +318,10 @@ WRITE16_MEMBER(m3comm_device::ioregs_w)
send_size = (send_size >> 8) | (data << 8);
break;
case 0x88 / 2:
- m_status0 = (m_status0 & ~mem_mask) | (data & mem_mask);
+ COMBINE_DATA(&m_status0);
break;
case 0x8A / 2:
- m_status1 = (m_status1 & ~mem_mask) | (data & mem_mask);
+ COMBINE_DATA(&m_status1);
break;
case 0xC0 / 2:
m_commcpu->set_input_line(INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
diff --git a/src/mame/machine/microdrv.h b/src/mame/machine/microdrv.h
index 5e1547b9dc5..e7d98d8e838 100644
--- a/src/mame/machine/microdrv.h
+++ b/src/mame/machine/microdrv.h
@@ -13,6 +13,7 @@
#ifndef __MICRODRV__
#define __MICRODRV__
+#include "softlist_dev.h"
//**************************************************************************
diff --git a/src/mame/machine/ms7004.cpp b/src/mame/machine/ms7004.cpp
index fb8ca4068cb..1e5cca40e0a 100644
--- a/src/mame/machine/ms7004.cpp
+++ b/src/mame/machine/ms7004.cpp
@@ -316,8 +316,8 @@ INPUT_PORTS_START( ms7004 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num 0") PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
PORT_START("KBD0") // vertical row 15
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F17") //PORT_CODE(KEYCODE_F17) PORT_CHAR(UCHAR_MAMEKEY(F17))
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F18") //PORT_CODE(KEYCODE_F18) PORT_CHAR(UCHAR_MAMEKEY(F18))
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F17") PORT_CODE(KEYCODE_F17) PORT_CHAR(UCHAR_MAMEKEY(F17))
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F18") PORT_CODE(KEYCODE_F18) PORT_CHAR(UCHAR_MAMEKEY(F18))
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PF2") PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD))
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PF3") PORT_CODE(KEYCODE_ASTERISK)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num 8") PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
@@ -326,8 +326,8 @@ INPUT_PORTS_START( ms7004 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num 3") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
PORT_START("KBD4") // vertical row 16
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F19") //PORT_CODE(KEYCODE_F19) PORT_CHAR(UCHAR_MAMEKEY(F19))
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F20") //PORT_CODE(KEYCODE_F20) PORT_CHAR(UCHAR_MAMEKEY(F20))
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F19") PORT_CODE(KEYCODE_F19) PORT_CHAR(UCHAR_MAMEKEY(F19))
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F20") PORT_CODE(KEYCODE_F20) PORT_CHAR(UCHAR_MAMEKEY(F20))
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PF4") PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num 9") PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num ,") PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
@@ -375,7 +375,8 @@ ms7004_device::ms7004_device(const machine_config &mconfig, const char *tag, dev
m_kbd13(*this, "KBD13"),
m_kbd14(*this, "KBD14"),
m_kbd15(*this, "KBD15"),
- m_tx_handler(*this)
+ m_tx_handler(*this),
+ m_rts_handler(*this)
{
}
@@ -386,6 +387,7 @@ ms7004_device::ms7004_device(const machine_config &mconfig, const char *tag, dev
void ms7004_device::device_start()
{
m_tx_handler.resolve_safe();
+ m_rts_handler.resolve_safe();
}
@@ -395,9 +397,15 @@ void ms7004_device::device_start()
void ms7004_device::device_reset()
{
+ m_rts_handler(0);
}
+WRITE_LINE_MEMBER( ms7004_device::write_rxd )
+{
+ DBG_LOG(1,0,("write_rxd %d\n", state));
+}
+
//-------------------------------------------------
// p1_w -
//-------------------------------------------------
@@ -441,7 +449,7 @@ WRITE8_MEMBER( ms7004_device::p2_w )
6 LED "Caps"
7 LED "Hold"
*/
- DBG_LOG(2,0,( "%s: p2_w %02x = col %d\n", tag(), data, data&15));
+ DBG_LOG(2,0,( "p2_w %02x = col %d\n", data, data&15));
m_p2 = data;
m_i8243->i8243_p2_w(space, offset, data);
@@ -456,8 +464,8 @@ WRITE8_MEMBER( ms7004_device::i8243_port_w )
{
int sense = 0;
- DBG_LOG(2,0,( "%s: 8243 port %d data %02xH\n",
- tag(), offset + 4, data));
+ DBG_LOG(2,0,( "8243 port %d data %02xH\n",
+ offset + 4, data));
if (data) {
switch(offset << 4 | data) {
@@ -480,8 +488,8 @@ WRITE8_MEMBER( ms7004_device::i8243_port_w )
}
m_keylatch = BIT(sense, (m_p1 & 7));
if (m_keylatch)
- DBG_LOG(1,0,( "%s: row %d col %02x t1 %d\n",
- tag(), (m_p1 & 7), (offset << 4 | data), m_keylatch));
+ DBG_LOG(1,0,( "row %d col %02x t1 %d\n",
+ (m_p1 & 7), (offset << 4 | data), m_keylatch));
}
}
diff --git a/src/mame/machine/ms7004.h b/src/mame/machine/ms7004.h
index cbf36f3f311..ef9e9608d25 100644
--- a/src/mame/machine/ms7004.h
+++ b/src/mame/machine/ms7004.h
@@ -22,6 +22,9 @@
#define MCFG_MS7004_TX_HANDLER(_cb) \
devcb = &ms7004_device::set_tx_handler(*device, DEVCB_##_cb);
+#define MCFG_MS7004_RTS_HANDLER(_cb) \
+ devcb = &ms7004_device::set_rts_handler(*device, DEVCB_##_cb);
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -36,12 +39,15 @@ public:
ms7004_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _Object> static devcb_base &set_tx_handler(device_t &device, _Object wr) { return downcast<ms7004_device &>(device).m_tx_handler.set_callback(wr); }
+ template<class _Object> static devcb_base &set_rts_handler(device_t &device, _Object wr) { return downcast<ms7004_device &>(device).m_rts_handler.set_callback(wr); }
DECLARE_WRITE8_MEMBER( p1_w );
DECLARE_WRITE8_MEMBER( p2_w );
DECLARE_READ8_MEMBER( t1_r );
DECLARE_WRITE8_MEMBER( i8243_port_w );
+ DECLARE_WRITE_LINE_MEMBER( write_rxd );
+
protected:
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const override;
@@ -77,6 +83,7 @@ private:
UINT8 m_p2;
devcb_write_line m_tx_handler;
+ devcb_write_line m_rts_handler;
};
// device type definition
diff --git a/src/mame/machine/n64.cpp b/src/mame/machine/n64.cpp
index df66c953d9b..3feebf44431 100644
--- a/src/mame/machine/n64.cpp
+++ b/src/mame/machine/n64.cpp
@@ -2682,19 +2682,19 @@ READ32_MEMBER( n64_periphs::pif_ram_r )
WRITE32_MEMBER( n64_periphs::pif_ram_w )
{
- if( mem_mask & 0xff000000 )
+ if( ACCESSING_BITS_24_31 )
{
pif_ram[offset*4+0] = ( data >> 24 ) & 0x000000ff;
}
- if( mem_mask & 0x00ff0000 )
+ if( ACCESSING_BITS_16_23 )
{
pif_ram[offset*4+1] = ( data >> 16 ) & 0x000000ff;
}
- if( mem_mask & 0x0000ff00 )
+ if( ACCESSING_BITS_8_15 )
{
pif_ram[offset*4+2] = ( data >> 8 ) & 0x000000ff;
}
- if( mem_mask & 0x000000ff )
+ if( ACCESSING_BITS_0_7 )
{
pif_ram[offset*4+3] = ( data >> 0 ) & 0x000000ff;
}
diff --git a/src/mame/machine/psion_pack.h b/src/mame/machine/psion_pack.h
index 1c0cd8189d8..f0358844e93 100644
--- a/src/mame/machine/psion_pack.h
+++ b/src/mame/machine/psion_pack.h
@@ -9,6 +9,8 @@
#ifndef __PSION_PACK_H__
#define __PSION_PACK_H__
+#include "softlist_dev.h"
+
/***************************************************************************
TYPE DEFINITIONS
diff --git a/src/mame/machine/segas32.cpp b/src/mame/machine/segas32.cpp
index da3efbbafb6..f2124c8c996 100644
--- a/src/mame/machine/segas32.cpp
+++ b/src/mame/machine/segas32.cpp
@@ -104,7 +104,7 @@ WRITE16_MEMBER(segas32_state::sonic_level_load_protection)
{
UINT16 level;
//Perform write
- m_system32_workram[CLEARED_LEVELS / 2] = (data & mem_mask) | (m_system32_workram[CLEARED_LEVELS / 2] & ~mem_mask);
+ COMBINE_DATA(&m_system32_workram[CLEARED_LEVELS / 2]);
//Refresh current level
if (m_system32_workram[CLEARED_LEVELS / 2] == 0)
diff --git a/src/mame/machine/stvprot.cpp b/src/mame/machine/stvprot.cpp
index d71f6219a04..26d48e8dfd8 100644
--- a/src/mame/machine/stvprot.cpp
+++ b/src/mame/machine/stvprot.cpp
@@ -70,8 +70,8 @@ WRITE32_MEMBER ( stv_state::common_prot_w )
}
else if(offset == 2)
{
- if (mem_mask&0xffff0000) m_cryptdevice->set_addr_low(data >> 16);
- if (mem_mask&0x0000ffff) m_cryptdevice->set_addr_high(data&0xffff);
+ if (ACCESSING_BITS_16_31) m_cryptdevice->set_addr_low(data >> 16);
+ if (ACCESSING_BITS_0_15) m_cryptdevice->set_addr_high(data&0xffff);
}
else if(offset == 3)
diff --git a/src/mame/machine/wangpckb.cpp b/src/mame/machine/wangpckb.cpp
index 76f59922cff..bd636b2eadd 100644
--- a/src/mame/machine/wangpckb.cpp
+++ b/src/mame/machine/wangpckb.cpp
@@ -68,7 +68,7 @@ Notes:
// DEVICE DEFINITIONS
//**************************************************************************
-const device_type WANGPC_KEYBOARD = &device_creator<wangpc_keyboard_device>;
+const device_type WANGPC_KEYBOARD = &device_creator<wangpc_keyboard_t>;
@@ -86,7 +86,7 @@ ROM_END
// rom_region - device-specific ROM region
//-------------------------------------------------
-const tiny_rom_entry *wangpc_keyboard_device::device_rom_region() const
+const tiny_rom_entry *wangpc_keyboard_t::device_rom_region() const
{
return ROM_NAME( wangpc_keyboard );
}
@@ -96,7 +96,7 @@ const tiny_rom_entry *wangpc_keyboard_device::device_rom_region() const
// ADDRESS_MAP( wangpc_keyboard_io )
//-------------------------------------------------
-static ADDRESS_MAP_START( wangpc_keyboard_io, AS_IO, 8, wangpc_keyboard_device )
+static ADDRESS_MAP_START( wangpc_keyboard_io, AS_IO, 8, wangpc_keyboard_t )
//AM_RANGE(0x0000, 0xfeff) AM_READNOP
AM_RANGE(0x47, 0x58) AM_MIRROR(0xff00) AM_READNOP
AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_DEVWRITE(SN76496_TAG, sn76496_device, write)
@@ -113,8 +113,8 @@ ADDRESS_MAP_END
static MACHINE_CONFIG_FRAGMENT( wangpc_keyboard )
MCFG_CPU_ADD(I8051_TAG, I8051, XTAL_4MHz)
MCFG_CPU_IO_MAP(wangpc_keyboard_io)
- MCFG_MCS51_SERIAL_TX_CB(WRITE8(wangpc_keyboard_device, mcs51_tx_callback))
- MCFG_MCS51_SERIAL_RX_CB(READ8(wangpc_keyboard_device, mcs51_rx_callback))
+ MCFG_MCS51_SERIAL_TX_CB(WRITE8(wangpc_keyboard_t, mcs51_tx_callback))
+ MCFG_MCS51_SERIAL_RX_CB(READ8(wangpc_keyboard_t, mcs51_rx_callback))
// sound hardware
MCFG_SPEAKER_STANDARD_MONO("mono")
@@ -128,7 +128,7 @@ MACHINE_CONFIG_END
// machine configurations
//-------------------------------------------------
-machine_config_constructor wangpc_keyboard_device::device_mconfig_additions() const
+machine_config_constructor wangpc_keyboard_t::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( wangpc_keyboard );
}
@@ -357,7 +357,7 @@ INPUT_PORTS_END
// input_ports - device-specific input ports
//-------------------------------------------------
-ioport_constructor wangpc_keyboard_device::device_input_ports() const
+ioport_constructor wangpc_keyboard_t::device_input_ports() const
{
return INPUT_PORTS_NAME( wangpc_keyboard );
}
@@ -369,30 +369,30 @@ ioport_constructor wangpc_keyboard_device::device_input_ports() const
//**************************************************************************
//-------------------------------------------------
-// wangpc_keyboard_device - constructor
-//-------------------------------------------------
-
-wangpc_keyboard_device::wangpc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, WANGPC_KEYBOARD, "Wang PC Keyboard", tag, owner, clock, "wangpckb", __FILE__),
- device_serial_interface(mconfig, *this),
- m_maincpu(*this, I8051_TAG),
- m_y0(*this, "Y0"),
- m_y1(*this, "Y1"),
- m_y2(*this, "Y2"),
- m_y3(*this, "Y3"),
- m_y4(*this, "Y4"),
- m_y5(*this, "Y5"),
- m_y6(*this, "Y6"),
- m_y7(*this, "Y7"),
- m_y8(*this, "Y8"),
- m_y9(*this, "Y9"),
- m_ya(*this, "YA"),
- m_yb(*this, "YB"),
- m_yc(*this, "YC"),
- m_yd(*this, "YD"),
- m_ye(*this, "YE"),
- m_yf(*this, "YF"),
- m_txd_handler(*this)
+// wangpc_keyboard_t - constructor
+//-------------------------------------------------
+
+wangpc_keyboard_t::wangpc_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, WANGPC_KEYBOARD, "Wang PC Keyboard", tag, owner, clock, "wangpckb", __FILE__),
+ device_serial_interface(mconfig, *this),
+ m_maincpu(*this, I8051_TAG),
+ m_y0(*this, "Y0"),
+ m_y1(*this, "Y1"),
+ m_y2(*this, "Y2"),
+ m_y3(*this, "Y3"),
+ m_y4(*this, "Y4"),
+ m_y5(*this, "Y5"),
+ m_y6(*this, "Y6"),
+ m_y7(*this, "Y7"),
+ m_y8(*this, "Y8"),
+ m_y9(*this, "Y9"),
+ m_ya(*this, "YA"),
+ m_yb(*this, "YB"),
+ m_yc(*this, "YC"),
+ m_yd(*this, "YD"),
+ m_ye(*this, "YE"),
+ m_yf(*this, "YF"),
+ m_txd_handler(*this)
{
}
@@ -401,11 +401,14 @@ wangpc_keyboard_device::wangpc_keyboard_device(const machine_config &mconfig, co
// device_start - device-specific startup
//-------------------------------------------------
-void wangpc_keyboard_device::device_start()
+void wangpc_keyboard_t::device_start()
{
m_txd_handler.resolve_safe();
set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2);
+
+ set_rcv_rate(62500);
+ //set_tra_rate(62500);
}
@@ -413,30 +416,84 @@ void wangpc_keyboard_device::device_start()
// device_reset - device-specific reset
//-------------------------------------------------
-void wangpc_keyboard_device::device_reset()
+void wangpc_keyboard_t::device_reset()
{
- transmit_register_reset();
receive_register_reset();
+ transmit_register_reset();
m_txd_handler(1);
}
//-------------------------------------------------
-// write_rxd -
+// device_timer - handler timer events
//-------------------------------------------------
-WRITE_LINE_MEMBER(wangpc_keyboard_device::write_rxd)
+void wangpc_keyboard_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
- receive_register_update_bit(state);
+ device_serial_interface::device_timer(timer, id, param, ptr);
+}
- if (is_receive_register_full())
- {
- m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
- receive_register_extract();
- if (LOG) logerror("Wang PC keyboard receive data %02x\n", get_received_char());
- }
+//-------------------------------------------------
+// tra_callback -
+//-------------------------------------------------
+
+void wangpc_keyboard_t::tra_callback()
+{
+ int bit = transmit_register_get_data_bit();
+
+ if (LOG) logerror("KB '%s' Transmit Bit %u\n", tag(), bit);
+
+ m_txd_handler(transmit_register_get_data_bit());
+}
+
+
+//-------------------------------------------------
+// tra_complete -
+//-------------------------------------------------
+
+void wangpc_keyboard_t::tra_complete()
+{
+}
+
+
+//-------------------------------------------------
+// rcv_callback -
+//-------------------------------------------------
+
+void wangpc_keyboard_t::rcv_callback()
+{
+ if (LOG) logerror("KB '%s' Receive Bit %u\n", tag(), m_rxd);
+
+ receive_register_update_bit(m_rxd);
+}
+
+
+//-------------------------------------------------
+// rcv_complete -
+//-------------------------------------------------
+
+void wangpc_keyboard_t::rcv_complete()
+{
+ receive_register_extract();
+
+ if (LOG) logerror("KB '%s' Receive Data %02x\n", tag(), get_received_char());
+
+ m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE);
+ m_maincpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE);
+}
+
+
+//-------------------------------------------------
+// write_rxd -
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER(wangpc_keyboard_t::write_rxd)
+{
+ m_rxd = state;
+
+ device_serial_interface::rx_w(state);
}
@@ -444,8 +501,10 @@ WRITE_LINE_MEMBER(wangpc_keyboard_device::write_rxd)
// mcs51_rx_callback -
//-------------------------------------------------
-READ8_MEMBER(wangpc_keyboard_device::mcs51_rx_callback)
+READ8_MEMBER(wangpc_keyboard_t::mcs51_rx_callback)
{
+ if (LOG) logerror("KB '%s' CPU Receive Data %02x\n", tag(), get_received_char());
+
return get_received_char();
}
@@ -454,9 +513,9 @@ READ8_MEMBER(wangpc_keyboard_device::mcs51_rx_callback)
// mcs51_tx_callback -
//-------------------------------------------------
-WRITE8_MEMBER(wangpc_keyboard_device::mcs51_tx_callback)
+WRITE8_MEMBER(wangpc_keyboard_t::mcs51_tx_callback)
{
- if (LOG) logerror("Wang PC keyboard transmit data %02x\n", data);
+ if (LOG) logerror("KB '%s' CPU Transmit Data %02x\n", tag(), data);
transmit_register_setup(data);
@@ -472,7 +531,7 @@ WRITE8_MEMBER(wangpc_keyboard_device::mcs51_tx_callback)
// kb_p1_r -
//-------------------------------------------------
-READ8_MEMBER( wangpc_keyboard_device::kb_p1_r )
+READ8_MEMBER( wangpc_keyboard_t::kb_p1_r )
{
UINT8 data = 0xff;
@@ -504,7 +563,7 @@ READ8_MEMBER( wangpc_keyboard_device::kb_p1_r )
// kb_p1_w -
//-------------------------------------------------
-WRITE8_MEMBER( wangpc_keyboard_device::kb_p1_w )
+WRITE8_MEMBER( wangpc_keyboard_t::kb_p1_w )
{
/*
@@ -526,7 +585,7 @@ WRITE8_MEMBER( wangpc_keyboard_device::kb_p1_w )
machine().output().set_led_value(i, !BIT(data, i));
}
- if (LOG) logerror("P1 %02x\n", data);
+ //if (LOG) logerror("P1 %02x\n", data);
}
@@ -534,7 +593,7 @@ WRITE8_MEMBER( wangpc_keyboard_device::kb_p1_w )
// kb_p2_w -
//-------------------------------------------------
-WRITE8_MEMBER( wangpc_keyboard_device::kb_p2_w )
+WRITE8_MEMBER( wangpc_keyboard_t::kb_p2_w )
{
/*
@@ -553,7 +612,7 @@ WRITE8_MEMBER( wangpc_keyboard_device::kb_p2_w )
m_y = data & 0x0f;
- if (LOG) logerror("P2 %02x\n", data);
+ //if (LOG) logerror("P2 %02x\n", data);
}
@@ -561,7 +620,7 @@ WRITE8_MEMBER( wangpc_keyboard_device::kb_p2_w )
// kb_p3_w -
//-------------------------------------------------
-WRITE8_MEMBER( wangpc_keyboard_device::kb_p3_w )
+WRITE8_MEMBER( wangpc_keyboard_t::kb_p3_w )
{
/*
@@ -578,5 +637,5 @@ WRITE8_MEMBER( wangpc_keyboard_device::kb_p3_w )
*/
- if (LOG) logerror("P3 %02x\n", data);
+ //if (LOG) logerror("P3 %02x\n", data);
}
diff --git a/src/mame/machine/wangpckb.h b/src/mame/machine/wangpckb.h
index 3344c6217ea..0ae9065abe5 100644
--- a/src/mame/machine/wangpckb.h
+++ b/src/mame/machine/wangpckb.h
@@ -34,23 +34,23 @@
MCFG_DEVICE_ADD(WANGPC_KEYBOARD_TAG, WANGPC_KEYBOARD, 0)
#define MCFG_WANGPCKB_TXD_HANDLER(_devcb) \
- devcb = &wangpc_keyboard_device::set_txd_handler(*device, DEVCB_##_devcb);
+ devcb = &wangpc_keyboard_t::set_txd_handler(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
-// ======================> wangpc_keyboard_device
+// ======================> wangpc_keyboard_t
-class wangpc_keyboard_device : public device_t,
- public device_serial_interface
+class wangpc_keyboard_t : public device_t,
+ public device_serial_interface
{
public:
// construction/destruction
- wangpc_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ wangpc_keyboard_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- template<class _Object> static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast<wangpc_keyboard_device &>(device).m_txd_handler.set_callback(object); }
+ template<class _Object> static devcb_base &set_txd_handler(device_t &device, _Object object) { return downcast<wangpc_keyboard_t &>(device).m_txd_handler.set_callback(object); }
// optional information overrides
virtual const tiny_rom_entry *device_rom_region() const override;
@@ -65,15 +65,20 @@ public:
DECLARE_WRITE8_MEMBER( kb_p2_w );
DECLARE_WRITE8_MEMBER( kb_p3_w );
- DECLARE_READ8_MEMBER(mcs51_rx_callback);
- DECLARE_WRITE8_MEMBER(mcs51_tx_callback);
+ DECLARE_READ8_MEMBER( mcs51_rx_callback );
+ DECLARE_WRITE8_MEMBER( mcs51_tx_callback );
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
// device_serial_interface overrides
+ virtual void tra_callback() override;
+ virtual void tra_complete() override;
+ virtual void rcv_callback() override;
+ virtual void rcv_complete() override;
private:
required_device<i8051_device> m_maincpu;
@@ -96,6 +101,7 @@ private:
devcb_write_line m_txd_handler;
UINT8 m_y;
+ int m_rxd;
};
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 834b8023cfb..07582df5d80 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -9363,7 +9363,8 @@ ollie // 2004.03 Ollie King
outr2 // 2003.12 Outrun 2 (Rev A)
outr2st // 2004.12 Outrun 2 Special Tours (Rev A)
scg06nt // 2005.12 Sega Golf Club 2006: Next Tours (Rev A)
-vcop3 // 2003.02.26 Virtua Cop 3 (Rev A)
+vcop3a // 2003.02.26 Virtua Cop 3 (Rev A)
+vcop3 // 2003.05.21 Virtua Cop 3 (Rev B)
wangmid // 2004.07 Wangan Midnight Maximum Tune (export) (Rev B)
wangmid2 // 2005.10 Wangan Midnight Maximum Tune 2 (Export) (Rev A)
wangmid2j // 2005.04 Wangan Midnight Maximum Tune 2 (Japan)
@@ -11178,7 +11179,6 @@ dvk_kcgd //
@source:dvk_ksm.cpp
dvk_ksm //
-dvk_ksm01 //
@source:dwarfd.cpp
dwarfd // (c) 198? Electro-Sports
@@ -27471,7 +27471,8 @@ gaiapols // GX123 (c) 1993 (Europe)
gaiapolsj // GX123 (c) 1993 (Japan)
gaiapolsu // GX123 (c) 1993 (US)
metamrph // GX224 (c) 1993 (Europe)
-metamrpha // GX224 (c) 1993 (Europe) - Alternate
+metamrpha // GX224 (c) 1993 (Asia)
+metamrphe // GX224 (c) 1993 (Europe) - Alternate
metamrphj // GX224 (c) 1993 (Japan)
metamrphu // GX224 (c) 1993 (US)
mmaulers // GX170 (c) 1993 (Europe)
@@ -35577,7 +35578,7 @@ avalnc12 // 2004.03 The Key Of Avalon 1.20 - Summon The N
avalnc13 // 2004.06.08 The Key Of Avalon 1.30 - Chaotic Sabbat (client) (Rev C)
avalns12 // 2004.03 The Key Of Avalon 1.20 - Summon The New Monsters (server) (Rev A)
avalns13 // 2004.06.08 The Key Of Avalon 1.30 - Chaotic Sabbat (server) (Rev C)
-avalon20 // 2004.11.02 The Key Of Avalon 2 - Eutaxy Commandment (client) (Rev B)
+avalon20 // 2004.11.02 The Key Of Avalon 2.0 - Eutaxy Commandment (client) (Rev B)
avalonc // 2003.11 The Key Of Avalon: The Wizard Master (client) (Rev G)
avalonce // 2003.08 The Key Of Avalon: The Wizard Master (client) (Rev E)
avaloncf // 2003.09 The Key Of Avalon: The Wizard Master (client) (Rev F)
@@ -35585,6 +35586,8 @@ avalons // 2003.11 The Key Of Avalon: The Wizard Master
avalonsc // 2003.07 The Key Of Avalon: The Wizard Master (server) (Rev C)
avalonse // 2003.08 The Key Of Avalon: The Wizard Master (server) (Rev E)
avalonsf // 2003.09 The Key Of Avalon: The Wizard Master (server) (Rev F)
+avalns25 // 2005.08 The Key Of Avalon 2.5 - War of the Key (server) (Rev B)
+avalnc25 // 2005.08 The Key Of Avalon 2.5 - War of the Key (client) (Rev B)
fzeroax // 2003.12 F-Zero AX (Rev E)
fzeroaxc // 2003.06.11 F-Zero AX (Rev C)
gekpurya // 2003.10 Gekitou Pro Yakyuu Mizushima Shinji All Stars vs. Pro Yakyuu (Rev C)
diff --git a/src/mame/video/abc1600.cpp b/src/mame/video/abc1600.cpp
index e7d6e8356f3..8450c153fd7 100644
--- a/src/mame/video/abc1600.cpp
+++ b/src/mame/video/abc1600.cpp
@@ -55,27 +55,33 @@ DEVICE_ADDRESS_MAP_START( crtc_map, 8, abc1600_mover_device )
AM_RANGE(0x01, 0x01) AM_MIRROR(0xfe) AM_DEVREADWRITE(SY6845E_TAG, mc6845_device, register_r, register_w)
ADDRESS_MAP_END
-DEVICE_ADDRESS_MAP_START( io_map, 8, abc1600_mover_device )
- AM_RANGE(0x000, 0x000) AM_MIRROR(0xff) AM_READ(iord0_r)
- AM_RANGE(0x000, 0x000) AM_MIRROR(0xf8) AM_WRITE(ldsx_hb_w)
- AM_RANGE(0x001, 0x001) AM_MIRROR(0xf8) AM_WRITE(ldsx_lb_w)
- AM_RANGE(0x002, 0x002) AM_MIRROR(0xf8) AM_WRITE(ldsy_hb_w)
- AM_RANGE(0x003, 0x003) AM_MIRROR(0xf8) AM_WRITE(ldsy_lb_w)
- AM_RANGE(0x004, 0x004) AM_MIRROR(0xf8) AM_WRITE(ldtx_hb_w)
- AM_RANGE(0x005, 0x005) AM_MIRROR(0xf8) AM_WRITE(ldtx_lb_w)
- AM_RANGE(0x006, 0x006) AM_MIRROR(0xf8) AM_WRITE(ldty_hb_w)
- AM_RANGE(0x007, 0x007) AM_MIRROR(0xf8) AM_WRITE(ldty_lb_w)
- AM_RANGE(0x100, 0x100) AM_MIRROR(0xf8) AM_WRITE(ldfx_hb_w)
- AM_RANGE(0x101, 0x101) AM_MIRROR(0xf8) AM_WRITE(ldfx_lb_w)
- AM_RANGE(0x102, 0x102) AM_MIRROR(0xf8) AM_WRITE(ldfy_hb_w)
- AM_RANGE(0x103, 0x103) AM_MIRROR(0xf8) AM_WRITE(ldfy_lb_w)
- AM_RANGE(0x105, 0x105) AM_MIRROR(0xf8) AM_WRITE(wrml_w)
- AM_RANGE(0x107, 0x107) AM_MIRROR(0xf8) AM_WRITE(wrdl_w)
- AM_RANGE(0x200, 0x200) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_hb_w)
- AM_RANGE(0x201, 0x201) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_lb_w)
- AM_RANGE(0x202, 0x202) AM_MIRROR(0xf8) AM_WRITE(enable_clocks_w)
- AM_RANGE(0x203, 0x203) AM_MIRROR(0xf8) AM_WRITE(flag_strobe_w)
- AM_RANGE(0x204, 0x204) AM_MIRROR(0xf8) AM_WRITE(endisp_w)
+DEVICE_ADDRESS_MAP_START( iowr0_map, 8, abc1600_mover_device )
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0xff) AM_READ(iord0_r)
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0xf8) AM_WRITE(ldsx_hb_w)
+ AM_RANGE(0x01, 0x01) AM_MIRROR(0xf8) AM_WRITE(ldsx_lb_w)
+ AM_RANGE(0x02, 0x02) AM_MIRROR(0xf8) AM_WRITE(ldsy_hb_w)
+ AM_RANGE(0x03, 0x03) AM_MIRROR(0xf8) AM_WRITE(ldsy_lb_w)
+ AM_RANGE(0x04, 0x04) AM_MIRROR(0xf8) AM_WRITE(ldtx_hb_w)
+ AM_RANGE(0x05, 0x05) AM_MIRROR(0xf8) AM_WRITE(ldtx_lb_w)
+ AM_RANGE(0x06, 0x06) AM_MIRROR(0xf8) AM_WRITE(ldty_hb_w)
+ AM_RANGE(0x07, 0x07) AM_MIRROR(0xf8) AM_WRITE(ldty_lb_w)
+ADDRESS_MAP_END
+
+DEVICE_ADDRESS_MAP_START( iowr1_map, 8, abc1600_mover_device )
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0xf8) AM_WRITE(ldfx_hb_w)
+ AM_RANGE(0x01, 0x01) AM_MIRROR(0xf8) AM_WRITE(ldfx_lb_w)
+ AM_RANGE(0x02, 0x02) AM_MIRROR(0xf8) AM_WRITE(ldfy_hb_w)
+ AM_RANGE(0x03, 0x03) AM_MIRROR(0xf8) AM_WRITE(ldfy_lb_w)
+ AM_RANGE(0x05, 0x05) AM_MIRROR(0xf8) AM_WRITE(wrml_w)
+ AM_RANGE(0x07, 0x07) AM_MIRROR(0xf8) AM_WRITE(wrdl_w)
+ADDRESS_MAP_END
+
+DEVICE_ADDRESS_MAP_START( iowr2_map, 8, abc1600_mover_device )
+ AM_RANGE(0x00, 0x00) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_hb_w)
+ AM_RANGE(0x01, 0x01) AM_MIRROR(0xf8) AM_WRITE(wrmask_strobe_lb_w)
+ AM_RANGE(0x02, 0x02) AM_MIRROR(0xf8) AM_WRITE(enable_clocks_w)
+ AM_RANGE(0x03, 0x03) AM_MIRROR(0xf8) AM_WRITE(flag_strobe_w)
+ AM_RANGE(0x04, 0x04) AM_MIRROR(0xf8) AM_WRITE(endisp_w)
ADDRESS_MAP_END
diff --git a/src/mame/video/abc1600.h b/src/mame/video/abc1600.h
index 253f2733f5b..497ec12c890 100644
--- a/src/mame/video/abc1600.h
+++ b/src/mame/video/abc1600.h
@@ -47,7 +47,9 @@ public:
virtual DECLARE_ADDRESS_MAP(vram_map, 8);
virtual DECLARE_ADDRESS_MAP(crtc_map, 8);
- virtual DECLARE_ADDRESS_MAP(io_map, 8);
+ virtual DECLARE_ADDRESS_MAP(iowr0_map, 8);
+ virtual DECLARE_ADDRESS_MAP(iowr1_map, 8);
+ virtual DECLARE_ADDRESS_MAP(iowr2_map, 8);
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/video/jaguar.cpp b/src/mame/video/jaguar.cpp
index 15a016389bb..29c5ce1b50c 100644
--- a/src/mame/video/jaguar.cpp
+++ b/src/mame/video/jaguar.cpp
@@ -543,7 +543,7 @@ READ32_MEMBER( jaguar_state::blitter_r )
WRITE32_MEMBER( jaguar_state::blitter_w )
{
COMBINE_DATA(&m_blitter_regs[offset]);
- if ((offset == B_CMD) && (mem_mask & 0x0000ffff))
+ if ((offset == B_CMD) && ACCESSING_BITS_0_15)
{
m_blitter_status = 0;
int inner_count = m_blitter_regs[B_COUNT] & 0xffff;
diff --git a/src/mame/video/kaneko_tmap.cpp b/src/mame/video/kaneko_tmap.cpp
index 634753975c0..6a7e0fd5000 100644
--- a/src/mame/video/kaneko_tmap.cpp
+++ b/src/mame/video/kaneko_tmap.cpp
@@ -315,7 +315,7 @@ WRITE16_MEMBER( kaneko_view2_tilemap_device::kaneko_tmap_regs_w )
/* some weird logic needed for Gals Panic on the EXPRO02 board */
WRITE16_MEMBER(kaneko_view2_tilemap_device::galsnew_vram_0_tilebank_w)
{
- if (mem_mask & 0x00ff)
+ if (ACCESSING_BITS_0_7)
{
int val = (data & 0x00ff)<<8;
@@ -329,7 +329,7 @@ WRITE16_MEMBER(kaneko_view2_tilemap_device::galsnew_vram_0_tilebank_w)
WRITE16_MEMBER(kaneko_view2_tilemap_device::galsnew_vram_1_tilebank_w)
{
- if (mem_mask & 0x00ff)
+ if (ACCESSING_BITS_0_7)
{
int val = (data & 0x00ff)<<8;
diff --git a/src/osd/modules/input/input_sdlcommon.cpp b/src/osd/modules/input/input_sdlcommon.cpp
index 479e5975666..4abcbd0251c 100644
--- a/src/osd/modules/input/input_sdlcommon.cpp
+++ b/src/osd/modules/input/input_sdlcommon.cpp
@@ -255,6 +255,14 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
break;
+#if defined(__APPLE__) && defined(__MACH__)
+ // 78-key Apple MacBook & Bluetooth keyboards have no right control key
+ case IPT_MAHJONG_SCORE:
+ if (entry.player() == 0)
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_SLASH);
+ break;
+#endif
+
// leave everything else alone
default:
break;
diff --git a/src/osd/modules/sound/xaudio2_sound.cpp b/src/osd/modules/sound/xaudio2_sound.cpp
index dc14acff64d..1da4794501b 100644
--- a/src/osd/modules/sound/xaudio2_sound.cpp
+++ b/src/osd/modules/sound/xaudio2_sound.cpp
@@ -45,6 +45,7 @@
#define INITIAL_BUFFER_COUNT 4
#define SUBMIT_FREQUENCY_TARGET_MS 20
+#define RESAMPLE_TOLERANCE 1.20f
//============================================================
// Macros
@@ -494,7 +495,7 @@ void sound_xaudio2::create_buffers(const WAVEFORMATEX &format)
// buffer size is equal to the bytes we need to hold in memory per X tenths of a second where X is audio_latency
float audio_latency_in_seconds = m_audio_latency / 10.0f;
UINT32 format_bytes_per_second = format.nSamplesPerSec * format.nBlockAlign;
- UINT32 total_buffer_size = format_bytes_per_second * audio_latency_in_seconds;
+ UINT32 total_buffer_size = format_bytes_per_second * audio_latency_in_seconds * RESAMPLE_TOLERANCE;
// We want to be able to submit buffers every X milliseconds
// I want to divide these up into "packets" so figure out how many buffers we need
@@ -595,10 +596,6 @@ void sound_xaudio2::submit_needed()
XAUDIO2_VOICE_STATE state;
m_sourceVoice->GetState(&state, XAUDIO2_VOICE_NOSAMPLESPLAYED);
- // If we have a buffer on the queue, no reason to submit
- if (state.BuffersQueued >= 1)
- return;
-
std::lock_guard<std::mutex> lock(m_buffer_lock);
// Roll the buffer