summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/imagedev/bitbngr.cpp55
-rw-r--r--src/devices/imagedev/bitbngr.h7
-rw-r--r--src/frontend/mame/cheat.cpp2
-rw-r--r--src/frontend/mame/luaengine_debug.cpp137
-rw-r--r--src/frontend/mame/luaengine_input.cpp31
-rw-r--r--src/mame/drivers/agat.cpp6
-rw-r--r--src/mame/drivers/asst128.cpp5
-rw-r--r--src/mame/drivers/ec184x.cpp3
-rw-r--r--src/mame/drivers/hp_ipc.cpp7
-rw-r--r--src/mame/drivers/iskr103x.cpp7
-rw-r--r--src/mame/drivers/mc1502.cpp93
-rw-r--r--src/mame/drivers/ms0515.cpp8
-rw-r--r--src/mame/drivers/sitcom.cpp46
-rw-r--r--src/mame/drivers/tosh1000.cpp4
-rw-r--r--src/mame/includes/mc1502.h101
-rw-r--r--src/mame/layout/sitcom.lay10
-rw-r--r--src/mame/layout/sitcomtmr.lay89
17 files changed, 397 insertions, 214 deletions
diff --git a/src/devices/imagedev/bitbngr.cpp b/src/devices/imagedev/bitbngr.cpp
index 2a18395ad75..86c92c88ceb 100644
--- a/src/devices/imagedev/bitbngr.cpp
+++ b/src/devices/imagedev/bitbngr.cpp
@@ -9,6 +9,10 @@
#include "emu.h"
#include "bitbngr.h"
+#include "softlist_dev.h"
+
+#include <cstring>
+
/***************************************************************************
@@ -24,6 +28,8 @@ DEFINE_DEVICE_TYPE(BITBANGER, bitbanger_device, "bitbanger", "Bitbanger")
bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, BITBANGER, tag, owner, clock),
device_image_interface(mconfig, *this),
+ m_next(nullptr),
+ m_end(nullptr),
m_interface(nullptr),
m_is_readonly(false)
{
@@ -37,10 +43,8 @@ bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *ta
void bitbanger_device::output(uint8_t data)
{
- if (exists())
- {
+ if (!loaded_through_softlist() && exists())
fwrite(&data, 1);
- }
}
@@ -50,11 +54,21 @@ void bitbanger_device::output(uint8_t data)
uint32_t bitbanger_device::input(void *buffer, uint32_t length)
{
- if (exists())
+ if (loaded_through_softlist())
+ {
+ size_t const result = std::min<size_t>(length, m_end - m_next);
+ memcpy(buffer, m_next, result);
+ m_next += result;
+ return uint32_t(result);
+ }
+ else if (exists())
{
return fread(buffer, length);
}
- return 0;
+ else
+ {
+ return 0;
+ }
}
@@ -63,8 +77,19 @@ uint32_t bitbanger_device::input(void *buffer, uint32_t length)
device_start
-------------------------------------------------*/
-void bitbanger_device::device_start(void)
+void bitbanger_device::device_start()
+{
+}
+
+
+
+/*-------------------------------------------------
+ get_software_list_loader
+-------------------------------------------------*/
+
+const software_list_loader &bitbanger_device::get_software_list_loader() const
{
+ return rom_software_list_loader::instance();
}
@@ -73,15 +98,24 @@ void bitbanger_device::device_start(void)
call_load
-------------------------------------------------*/
-image_init_result bitbanger_device::call_load(void)
+image_init_result bitbanger_device::call_load()
{
- /* we don't need to do anything special */
+ if (loaded_through_softlist())
+ {
+ auto const length = get_software_region_length("input");
+ m_next = get_software_region("input");
+ m_end = m_next + length;
+ }
+ else
+ {
+ m_next = m_end = nullptr;
+ }
return image_init_result::PASS;
}
image_init_result bitbanger_device::call_create(int format_type, util::option_resolution *format_options)
{
- /* we don't need to do anything special */
+ // we don't need to do anything special
return image_init_result::PASS;
}
@@ -89,6 +123,7 @@ image_init_result bitbanger_device::call_create(int format_type, util::option_re
call_unload
-------------------------------------------------*/
-void bitbanger_device::call_unload(void)
+void bitbanger_device::call_unload()
{
+ m_next = m_end = nullptr;
}
diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h
index 19cbea3bc09..7ffcfd45a2b 100644
--- a/src/devices/imagedev/bitbngr.h
+++ b/src/devices/imagedev/bitbngr.h
@@ -39,10 +39,15 @@ public:
uint32_t input(void *buffer, uint32_t length);
protected:
- // device-level overrides
+ // device_t implementation
virtual void device_start() override;
+ // device_image_interface implementation
+ virtual software_list_loader const &get_software_list_loader() const override;
+
private:
+ uint8_t const *m_next;
+ uint8_t const *m_end;
char const *m_interface;
bool m_is_readonly;
};
diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp
index 1e6d7aaffbd..c16316e8d02 100644
--- a/src/frontend/mame/cheat.cpp
+++ b/src/frontend/mame/cheat.cpp
@@ -1400,7 +1400,7 @@ void cheat_manager::load_cheats(std::string const &filename)
emu_file cheatfile(std::move(searchstr), OPEN_FLAG_READ);
try
{
- // loop over all instrances of the files found in our search paths
+ // loop over all instances of the files found in our search paths
for (std::error_condition filerr = cheatfile.open(filename + ".xml"); !filerr; filerr = cheatfile.open_next())
{
osd_printf_verbose("Loading cheats file from %s\n", cheatfile.fullpath());
diff --git a/src/frontend/mame/luaengine_debug.cpp b/src/frontend/mame/luaengine_debug.cpp
index 8349cbd88fc..699c303f44f 100644
--- a/src/frontend/mame/luaengine_debug.cpp
+++ b/src/frontend/mame/luaengine_debug.cpp
@@ -14,6 +14,7 @@
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "debug/debugvw.h"
+#include "debug/express.h"
#include "debug/points.h"
#include "debug/textbuf.h"
#include "debugger.h"
@@ -94,6 +95,140 @@ void lua_engine::initialize_debug(sol::table &emu)
{ "wr", read_or_write::READWRITE }
};
+ static const enum_parser<expression_space, 15> s_expression_space_parser =
+ {
+ { "p", EXPSPACE_PROGRAM_LOGICAL }, { "lp", EXPSPACE_PROGRAM_LOGICAL }, { "pp", EXPSPACE_PROGRAM_PHYSICAL },
+ { "d", EXPSPACE_DATA_LOGICAL }, { "ld", EXPSPACE_DATA_LOGICAL }, { "pd", EXPSPACE_DATA_PHYSICAL },
+ { "i", EXPSPACE_IO_LOGICAL }, { "li", EXPSPACE_IO_LOGICAL }, { "pi", EXPSPACE_IO_PHYSICAL },
+ { "3", EXPSPACE_OPCODE_LOGICAL }, { "l3", EXPSPACE_OPCODE_LOGICAL }, { "p3", EXPSPACE_OPCODE_PHYSICAL },
+ { "r", EXPSPACE_PRGDIRECT },
+ { "o", EXPSPACE_OPDIRECT },
+ { "m", EXPSPACE_REGION }
+ };
+
+ auto const do_add_symbol = [this] (symbol_table &st, char const *name, sol::protected_function getter, std::optional<sol::protected_function> setter, std::optional<char const *> format)
+ {
+ symbol_table::setter_func setfun;
+ if (setter)
+ setfun = [this, cbfunc = std::move(*setter)] (u64 value) { invoke(cbfunc, value); };
+ st.add(
+ name,
+ [this, cbfunc = std::move(getter)] () -> u64
+ {
+ auto result = invoke(cbfunc).get<sol::optional<u64> >();
+ if (result)
+ {
+ return *result;
+ }
+ else
+ {
+ osd_printf_error("[LUA EROR] invalid return from symbol value getter callback\n");
+ return 0;
+ }
+ },
+ std::move(setfun),
+ (format && *format) ? *format : "");
+ };
+
+ auto symbol_table_type = emu.new_usertype<symbol_table>(
+ "symbol_table",
+ sol::call_constructor, sol::factories(
+ [] (running_machine &machine, symbol_table *parent, device_t *device) { return std::make_unique<symbol_table>(machine, parent, device); },
+ [] (running_machine &machine, symbol_table *parent) { return std::make_unique<symbol_table>(machine, parent); },
+ [] (running_machine &machine, device_t &device) { return std::make_unique<symbol_table>(machine, nullptr, &device); },
+ [] (running_machine &machine) { return std::make_unique<symbol_table>(machine); }));
+ symbol_table_type["set_memory_modified_func"] =
+ [this] (symbol_table &st, sol::object cb)
+ {
+ if (cb == sol::lua_nil)
+ st.set_memory_modified_func(nullptr);
+ else if (cb.is<sol::protected_function>())
+ st.set_memory_modified_func([this, cbfunc = cb.as<sol::protected_function>()] () { invoke(cbfunc); });
+ else
+ osd_printf_error("[LUA ERROR] must call set_memory_modified_func with function or nil\n");
+ };
+ symbol_table_type["add"] = sol::overload(
+ [] (symbol_table &st, char const *name) { st.add(name, symbol_table::READ_WRITE); },
+ static_cast<void (symbol_table::*)(char const *, u64)>(&symbol_table::add),
+ do_add_symbol,
+ [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter, sol::lua_nil_t, char const *format)
+ {
+ do_add_symbol(st, name, getter, std::nullopt, format);
+ },
+ [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter, std::optional<sol::protected_function> setter)
+ {
+ do_add_symbol(st, name, getter, setter, nullptr);
+ },
+ [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter, char const *format)
+ {
+ do_add_symbol(st, name, getter, std::nullopt, format);
+ },
+ [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter)
+ {
+ do_add_symbol(st, name, getter, std::nullopt, nullptr);
+ },
+ [this] (symbol_table &st, char const *name, int minparams, int maxparams, sol::protected_function execute)
+ {
+ st.add(
+ name,
+ minparams,
+ maxparams,
+ [this, cbref = sol::reference(execute)] (int numparams, u64 const *paramlist) -> u64
+ {
+ sol::stack_reference traceback(m_lua_state, -sol::stack::push(m_lua_state, sol::default_traceback_error_handler));
+ cbref.push();
+ sol::stack_aligned_stack_handler_function func(m_lua_state, -1, traceback);
+ for (int i = 0; numparams > i; ++i)
+ lua_pushinteger(m_lua_state, paramlist[i]);
+ auto result = func(sol::stack_count(numparams)).get<sol::optional<u64> >();
+ traceback.pop();
+ return result ? *result : 0;
+ });
+ });
+ symbol_table_type["find"] = &symbol_table::find;
+ symbol_table_type["find_deep"] = &symbol_table::find_deep;
+ symbol_table_type["value"] = &symbol_table::value;
+ symbol_table_type["set_value"] = &symbol_table::set_value;
+ symbol_table_type["memory_value"] =
+ [] (symbol_table &st, char const *name, char const *space, u32 offset, int size, bool disable_se)
+ {
+ expression_space const es = s_expression_space_parser(space);
+ return st.memory_value(name, es, offset, size, disable_se);
+ };
+ symbol_table_type["set_memory_value"] =
+ [] (symbol_table &st, char const *name, char const *space, u32 offset, int size, u64 value, bool disable_se)
+ {
+ expression_space const es = s_expression_space_parser(space);
+ st.set_memory_value(name, es, offset, size, value, disable_se);
+ };
+ //symbol_table_type["read_memory"] = &symbol_table::read_memory; crashes if you try to use it, need to work out why
+ //symbol_table_type["write_memory"] = &symbol_table::write_memory; crashes if you try to use it, need to work out why
+ symbol_table_type["entries"] = sol::property([] (symbol_table const &st) { return standard_tag_object_ptr_map<symbol_entry>(st.entries()); });
+ symbol_table_type["parent"] = sol::property(&symbol_table::parent);
+
+
+ auto parsed_expression_type = emu.new_usertype<parsed_expression>(
+ "parsed_expression",
+ sol::call_constructor, sol::factories(
+ [] (symbol_table &symtable) { return std::make_unique<parsed_expression>(symtable); },
+ [] (symbol_table &symtable, char const *expression, int default_base) { return std::make_unique<parsed_expression>(symtable, expression, default_base); },
+ [] (symbol_table &symtable, char const *expression) { return std::make_unique<parsed_expression>(symtable, expression); },
+ [] (parsed_expression const &src) { return std::make_unique<parsed_expression>(src); }));
+ parsed_expression_type["set_default_base"] = &parsed_expression::set_default_base;
+ parsed_expression_type["parse"] = [] (parsed_expression &e, char const *string) { e.parse(string); };
+ parsed_expression_type["execute"] = &parsed_expression::execute;
+ parsed_expression_type["is_empty"] = sol::property(&parsed_expression::is_empty);
+ parsed_expression_type["original_string"] = sol::property(&parsed_expression::original_string);
+ parsed_expression_type["symbols"] = sol::property(&parsed_expression::symbols, &parsed_expression::set_symbols);
+
+
+ auto symbol_entry_type = sol().registry().new_usertype<symbol_entry>("symbol_entry", sol::no_constructor);
+ symbol_entry_type["name"] = sol::property(&symbol_entry::name);
+ symbol_entry_type["format"] = sol::property(&symbol_entry::format);
+ symbol_entry_type["is_function"] = sol::property(&symbol_entry::is_function);
+ symbol_entry_type["is_lval"] = sol::property(&symbol_entry::is_lval);
+ symbol_entry_type["value"] = sol::property(&symbol_entry::value, &symbol_entry::set_value);
+
auto debugger_type = sol().registry().new_usertype<debugger_manager>("debugger", sol::no_constructor);
debugger_type["command"] = [] (debugger_manager &debug, std::string const &cmd) { debug.console().execute_command(cmd, false); };
@@ -177,7 +312,7 @@ void lua_engine::initialize_debug(sol::table &emu)
device_debug_type["wpset"] =
[] (device_debug &dev, addr_space &sp, std::string const &type, offs_t addr, offs_t len, char const *cond, char const *act)
{
- read_or_write wptype = s_read_or_write_parser(type);
+ read_or_write const wptype = s_read_or_write_parser(type);
int result(dev.watchpoint_set(sp.space, wptype, addr, len, cond, act));
dev.device().machine().debug_view().update_all(DVT_WATCH_POINTS);
return result;
diff --git a/src/frontend/mame/luaengine_input.cpp b/src/frontend/mame/luaengine_input.cpp
index f32858ccce3..1812bdc17b3 100644
--- a/src/frontend/mame/luaengine_input.cpp
+++ b/src/frontend/mame/luaengine_input.cpp
@@ -144,29 +144,40 @@ void lua_engine::initialize_input(sol::table &emu)
ioport_manager_type["count_players"] = &ioport_manager::count_players;
ioport_manager_type["type_pressed"] = sol::overload(
&ioport_manager::type_pressed,
- [] (ioport_manager &im, ioport_type type) { return im.type_pressed(type, 0); });
+ [] (ioport_manager &im, ioport_type type) { return im.type_pressed(type, 0); },
+ [] (ioport_manager &im, input_type_entry const &type) { return im.type_pressed(type.type(), type.player()); });
ioport_manager_type["type_name"] = sol::overload(
&ioport_manager::type_name,
[] (ioport_manager &im, ioport_type type) { return im.type_name(type, 0); });
ioport_manager_type["type_group"] = sol::overload(
&ioport_manager::type_group,
[] (ioport_manager &im, ioport_type type) { return im.type_group(type, 0); });
- ioport_manager_type["type_seq"] =
+ ioport_manager_type["type_seq"] = sol::overload(
[] (ioport_manager &im, ioport_type type, std::optional<int> player, std::optional<char const *> seq_type_string)
{
if (!player)
player = 0;
input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD;
return im.type_seq(type, *player, seq_type);
- };
- ioport_manager_type["set_type_seq"] =
+ },
+ [] (ioport_manager &im, input_type_entry const &type, std::optional<char const *> seq_type_string)
+ {
+ input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD;
+ return im.type_seq(type.type(), type.player(), seq_type);
+ });
+ ioport_manager_type["set_type_seq"] = sol::overload(
[] (ioport_manager &im, ioport_type type, std::optional<int> player, std::optional<char const *> seq_type_string, input_seq const &seq)
{
if (!player)
player = 0;
input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD;
im.set_type_seq(type, *player, seq_type, seq);
- };
+ },
+ [] (ioport_manager &im, input_type_entry const &type, std::optional<char const *> seq_type_string, input_seq const &seq)
+ {
+ input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD;
+ im.set_type_seq(type.type(), type.player(), seq_type, seq);
+ });
ioport_manager_type["token_to_input_type"] =
[] (ioport_manager &im, std::string const &string)
{
@@ -177,6 +188,7 @@ void lua_engine::initialize_input(sol::table &emu)
ioport_manager_type["input_type_to_token"] = sol::overload(
&ioport_manager::input_type_to_token,
[] (ioport_manager &im, ioport_type type) { return im.input_type_to_token(type, 0); });
+ ioport_manager_type["types"] = sol::property(&ioport_manager::types);
ioport_manager_type["ports"] = sol::property([] (ioport_manager &im) { return tag_object_ptr_map<ioport_list>(im.ports()); });
@@ -359,6 +371,15 @@ void lua_engine::initialize_input(sol::table &emu)
ioport_field_live_type["name"] = &ioport_field_live::name;
+ auto input_type_entry_type = sol().registry().new_usertype<input_type_entry>("input_type_entry", sol::no_constructor);
+ input_type_entry_type["type"] = sol::property(&input_type_entry::type);
+ input_type_entry_type["group"] = sol::property(&input_type_entry::group);
+ input_type_entry_type["player"] = sol::property(&input_type_entry::player);
+ input_type_entry_type["token"] = sol::property(&input_type_entry::token);
+ input_type_entry_type["name"] = sol::property(&input_type_entry::name);
+ input_type_entry_type["is_analog"] = sol::property([] (input_type_entry const &type) { return ioport_manager::type_is_analog(type.type()); });
+
+
auto input_type = sol().registry().new_usertype<input_manager>("input", sol::no_constructor);
input_type["code_value"] = &input_manager::code_value;
input_type["code_pressed"] = &input_manager::code_pressed;
diff --git a/src/mame/drivers/agat.cpp b/src/mame/drivers/agat.cpp
index b8cd4cf9b9a..0f12a33b3d3 100644
--- a/src/mame/drivers/agat.cpp
+++ b/src/mame/drivers/agat.cpp
@@ -69,6 +69,9 @@
************************************************************************/
#include "emu.h"
+#include "machine/agatkeyb.h"
+#include "video/agat7.h"
+#include "video/agat9.h"
#include "bus/a2bus/a2diskii.h"
#include "bus/a2bus/agat7langcard.h"
@@ -80,12 +83,9 @@
#include "cpu/m6502/m6502.h"
#include "cpu/m6502/r65c02.h"
#include "imagedev/cassette.h"
-#include "machine/agatkeyb.h"
#include "machine/bankdev.h"
#include "machine/timer.h"
#include "sound/spkrdev.h"
-#include "video/agat7.h"
-#include "video/agat9.h"
#include "screen.h"
#include "softlist.h"
diff --git a/src/mame/drivers/asst128.cpp b/src/mame/drivers/asst128.cpp
index b9ce03eab78..0f5f9e7a466 100644
--- a/src/mame/drivers/asst128.cpp
+++ b/src/mame/drivers/asst128.cpp
@@ -2,16 +2,17 @@
// copyright-holders:Sergey Svishchev
#include "emu.h"
+#include "machine/genpc.h"
#include "bus/pc_joy/pc_joy.h"
#include "bus/pc_kbd/keyboards.h"
#include "bus/pc_kbd/pc_kbdc.h"
#include "cpu/i86/i86.h"
-#include "formats/asst128_dsk.h"
#include "imagedev/floppy.h"
-#include "machine/genpc.h"
#include "machine/pc_fdc.h"
+#include "formats/asst128_dsk.h"
+
DECLARE_DEVICE_TYPE(ASST128_MOTHERBOARD, asst128_mb_device)
diff --git a/src/mame/drivers/ec184x.cpp b/src/mame/drivers/ec184x.cpp
index b197d9a7b9e..04cc0ee5ac7 100644
--- a/src/mame/drivers/ec184x.cpp
+++ b/src/mame/drivers/ec184x.cpp
@@ -14,13 +14,14 @@
#include "emu.h"
+#include "machine/genpc.h"
#include "bus/isa/xsu_cards.h"
#include "bus/pc_kbd/keyboards.h"
#include "bus/pc_kbd/pc_kbdc.h"
#include "cpu/i86/i86.h"
-#include "machine/genpc.h"
#include "machine/ram.h"
+
#include "softlist_dev.h"
diff --git a/src/mame/drivers/hp_ipc.cpp b/src/mame/drivers/hp_ipc.cpp
index fa396eef9b9..f3e1b64809a 100644
--- a/src/mame/drivers/hp_ipc.cpp
+++ b/src/mame/drivers/hp_ipc.cpp
@@ -356,17 +356,16 @@ Software to look for
******************************************************************************/
#include "emu.h"
+#include "machine/hp_ipc_optrom.h"
#include "bus/hp_hil/hil_devices.h"
#include "bus/hp_hil/hp_hil.h"
#include "bus/hp_ipc_io/hp_ipc_io.h"
#include "bus/ieee488/ieee488.h"
#include "cpu/m68000/m68000.h"
-#include "formats/hp_ipc_dsk.h"
#include "imagedev/floppy.h"
#include "machine/bankdev.h"
#include "machine/cop452.h"
-#include "machine/hp_ipc_optrom.h"
#include "machine/input_merger.h"
#include "machine/mm58167.h"
#include "machine/ram.h"
@@ -374,11 +373,13 @@ Software to look for
#include "machine/wd_fdc.h"
#include "softlist_dev.h"
#include "sound/dac.h"
-#include "speaker.h"
#include "video/hp1ll3.h"
+#include "formats/hp_ipc_dsk.h"
+
#include "emupal.h"
#include "screen.h"
+#include "speaker.h"
namespace {
diff --git a/src/mame/drivers/iskr103x.cpp b/src/mame/drivers/iskr103x.cpp
index 5f3af8bfa59..694ac815ce2 100644
--- a/src/mame/drivers/iskr103x.cpp
+++ b/src/mame/drivers/iskr103x.cpp
@@ -16,18 +16,20 @@
#include "emu.h"
+#include "machine/genpc.h"
#include "bus/isa/xsu_cards.h"
#include "bus/pc_kbd/keyboards.h"
#include "bus/pc_kbd/pc_kbdc.h"
#include "cpu/i86/i86.h"
-#include "machine/genpc.h"
#include "machine/pc_lpt.h"
#include "machine/ram.h"
#include "softlist.h"
+namespace {
+
class iskr103x_state : public driver_device
{
public:
@@ -123,6 +125,9 @@ ROM_START( iskr1031 )
ROMX_LOAD( "150-07.bin", 0xc001, 0x2000, CRC(0dc4b65a) SHA1(c96f066251a7343eac8113ea9dcb2cb12d0334d5), ROM_SKIP(1) | ROM_BIOS(1))
ROM_END
+} // anonymous namespace
+
+
/***************************************************************************
Game driver(s)
diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp
index 99822915543..a8461a599f2 100644
--- a/src/mame/drivers/mc1502.cpp
+++ b/src/mame/drivers/mc1502.cpp
@@ -15,11 +15,21 @@
***************************************************************************/
#include "emu.h"
+#include "machine/kb_7007_3.h"
+#include "bus/centronics/ctronics.h"
+#include "bus/isa/isa.h"
+#include "bus/isa/mc1502_fdc.h"
+#include "bus/isa/xsu_cards.h"
#include "bus/rs232/rs232.h"
#include "cpu/i86/i86.h"
-#include "includes/mc1502.h"
-#include "machine/kb_7007_3.h"
+#include "imagedev/cassette.h"
+#include "machine/i8251.h"
+#include "machine/i8255.h"
+#include "machine/pic8259.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "sound/spkrdev.h"
#include "softlist_dev.h"
#include "speaker.h"
@@ -38,6 +48,82 @@
#define LOGPPI(...) LOGMASKED(LOG_PPI, __VA_ARGS__)
+namespace {
+
+class mc1502_state : public driver_device
+{
+public:
+ mc1502_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
+ , m_upd8251(*this, "upd8251")
+ , m_pic8259(*this, "pic8259")
+ , m_pit8253(*this, "pit8253")
+ , m_ppi8255n1(*this, "ppi8255n1")
+ , m_ppi8255n2(*this, "ppi8255n2")
+ , m_isabus(*this, "isa")
+ , m_speaker(*this, "speaker")
+ , m_cassette(*this, "cassette")
+ , m_centronics(*this, "centronics")
+ , m_ram(*this, RAM_TAG)
+ , m_kbdio(*this, "Y%u", 1)
+ { }
+
+ void mc1502(machine_config &config);
+
+ void init_mc1502();
+
+ void fdc_config(device_t *device);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+private:
+ required_device<cpu_device> m_maincpu;
+ required_device<i8251_device> m_upd8251;
+ required_device<pic8259_device> m_pic8259;
+ required_device<pit8253_device> m_pit8253;
+ required_device<i8255_device> m_ppi8255n1;
+ required_device<i8255_device> m_ppi8255n2;
+ required_device<isa8_device> m_isabus;
+ required_device<speaker_sound_device> m_speaker;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+ required_ioport_array<12> m_kbdio;
+
+ TIMER_CALLBACK_MEMBER(keyb_signal_callback);
+
+ struct {
+ uint8_t pulsing;
+ uint16_t mask; /* input lines */
+ emu_timer *keyb_signal_timer;
+ } m_kbd;
+
+ uint8_t m_ppi_portb;
+ uint8_t m_ppi_portc;
+ uint8_t m_spkrdata;
+
+ DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out1_changed);
+ DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out2_changed);
+ DECLARE_WRITE_LINE_MEMBER(mc1502_speaker_set_spkrdata);
+ DECLARE_WRITE_LINE_MEMBER(mc1502_i8251_syndet);
+
+ void mc1502_ppi_portb_w(uint8_t data);
+ void mc1502_ppi_portc_w(uint8_t data);
+ uint8_t mc1502_ppi_portc_r();
+ uint8_t mc1502_kppi_porta_r();
+ void mc1502_kppi_portb_w(uint8_t data);
+ void mc1502_kppi_portc_w(uint8_t data);
+
+ void mc1502_io(address_map &map);
+ void mc1502_map(address_map &map);
+
+ int m_pit_out2;
+};
+
+
/*
* onboard devices:
*/
@@ -387,6 +473,9 @@ ROM_START( pk88 )
ROM_LOAD( "pk88-1.064", 0xe000, 0x2000, CRC(6fa7e7ef) SHA1(d68bc273baa46ba733ac6ad4df7569dd70cf60dd))
ROM_END
+} // anonymous namespace
+
+
/***************************************************************************
Game driver(s)
diff --git a/src/mame/drivers/ms0515.cpp b/src/mame/drivers/ms0515.cpp
index 3b8a4f4b36b..63fc8d2ba9e 100644
--- a/src/mame/drivers/ms0515.cpp
+++ b/src/mame/drivers/ms0515.cpp
@@ -29,7 +29,6 @@
#include "bus/rs232/rs232.h"
#include "cpu/t11/t11.h"
-#include "formats/ms0515_dsk.h"
#include "imagedev/floppy.h"
#include "machine/clock.h"
#include "machine/i8251.h"
@@ -40,6 +39,8 @@
#include "machine/wd_fdc.h"
#include "sound/spkrdev.h"
+#include "formats/ms0515_dsk.h"
+
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@@ -59,6 +60,8 @@
#define LOGSYSREG(format, ...) LOGMASKED(LOG_SYSREG, "%11.6f at %s: " format, machine().time().as_double(), machine().describe_context(), __VA_ARGS__)
+namespace {
+
class ms0515_state : public driver_device
{
public:
@@ -617,6 +620,9 @@ ROM_START( ms0515 )
ROMX_LOAD( "0515h.rf4", 0xc001, 0x2000, CRC(e3ff6da9) SHA1(3febccf40abc2e3ca7db3f6f3884be117722dd8b), ROM_SKIP(1) | ROM_BIOS(1))
ROM_END
+} // anonymous namespace
+
+
/* Driver */
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
diff --git a/src/mame/drivers/sitcom.cpp b/src/mame/drivers/sitcom.cpp
index 2fb6e85e692..389d4fcb5a8 100644
--- a/src/mame/drivers/sitcom.cpp
+++ b/src/mame/drivers/sitcom.cpp
@@ -33,13 +33,10 @@
#include "emu.h"
#include "bus/rs232/rs232.h"
-
#include "cpu/i8085/i8085.h"
-
+#include "imagedev/bitbngr.h"
#include "machine/clock.h"
-#include "machine/bankdev.h"
#include "machine/i8255.h"
-
#include "video/dl1416.h"
#include "softlist_dev.h"
@@ -59,9 +56,9 @@ public:
: driver_device(mconfig, type, tag)
, m_buttons(*this, "BUTTONS")
, m_maincpu(*this, "maincpu")
- , m_bank(*this, "bank")
, m_digits(*this, "digit%u", 0U)
, m_leds(*this, "p%c%u", unsigned('a'), 0U)
+ , m_bootstrap(*this, "bootstrap")
, m_rxd(true)
{
}
@@ -71,6 +68,9 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(update_buttons);
protected:
+ void sitcom_mem(address_map &map);
+ void sitcom_io(address_map &map);
+
template <unsigned D> void update_ds(offs_t offset, uint16_t data) { m_digits[(D << 2) | offset] = data; }
DECLARE_WRITE_LINE_MEMBER(update_rxd) { m_rxd = bool(state); }
DECLARE_READ_LINE_MEMBER(sid_line) { return m_rxd ? 1 : 0; }
@@ -78,18 +78,19 @@ protected:
virtual void update_ppi_pa(uint8_t data);
virtual void update_ppi_pb(uint8_t data);
- void sitcom_bank(address_map &map);
- void sitcom_io(address_map &map);
- void sitcom_mem(address_map &map);
-
virtual void machine_start() override;
virtual void machine_reset() override;
+ static void sitcom_null_modem(device_t *device)
+ {
+ device->subdevice<bitbanger_device>("stream")->set_interface("rs232");
+ }
+
required_ioport m_buttons;
required_device<i8085a_cpu_device> m_maincpu;
- required_device<address_map_bank_device> m_bank;
output_finder<15> m_digits;
output_finder<2, 8> m_leds;
+ memory_view m_bootstrap;
bool m_rxd;
};
@@ -109,6 +110,7 @@ public:
, m_ppi(*this, "ppi")
, m_ds2(*this, "ds2")
, m_test_led(*this, "test_led")
+ , m_dac(*this, "dac")
, m_shutter_timer(nullptr)
, m_shutter(false)
, m_dac_cs(true)
@@ -137,6 +139,7 @@ protected:
required_device<i8255_device> m_ppi;
required_device<dl1414_device> m_ds2;
output_finder<> m_test_led;
+ output_finder<> m_dac;
emu_timer *m_shutter_timer;
bool m_shutter;
@@ -144,18 +147,12 @@ protected:
};
-void sitcom_state::sitcom_bank(address_map &map)
-{
- map.unmap_value_high();
- map(0x0000, 0x07ff).rom().region("bootstrap", 0);
- map(0x8000, 0xffff).ram().share("ram");
-}
-
void sitcom_state::sitcom_mem(address_map &map)
{
map.unmap_value_high();
- map(0x0000, 0x7fff).m(m_bank, FUNC(address_map_bank_device::amap8));
- map(0x8000, 0xffff).ram().share("ram");
+ map(0x0000, 0x7fff).mirror(0x8000).ram();
+ map(0x0000, 0x7fff).view(m_bootstrap);
+ m_bootstrap[0](0x0000, 0x7fff).unmapw().rom().region("bootstrap", 0);
}
void sitcom_state::sitcom_io(address_map &map)
@@ -222,7 +219,7 @@ void sitcom_state::machine_start()
void sitcom_state::machine_reset()
{
- m_bank->set_bank(0);
+ m_bootstrap.select(0);
}
void sitcom_state::update_ppi_pa(uint8_t data)
@@ -245,9 +242,9 @@ INPUT_CHANGED_MEMBER( sitcom_state::update_buttons )
m_maincpu->set_input_line(INPUT_LINE_RESET, (boot || reset) ? ASSERT_LINE : CLEAR_LINE);
if (boot)
- m_bank->set_bank(0);
+ m_bootstrap.select(0);
else if (reset)
- m_bank->set_bank(1);
+ m_bootstrap.disable();
}
@@ -319,6 +316,7 @@ void sitcom_timer_state::machine_start()
sitcom_state::machine_start();
m_test_led.resolve();
+ m_dac.resolve();
m_shutter_timer = timer_alloc(TIMER_SHUTTER);
@@ -339,6 +337,7 @@ void sitcom_timer_state::machine_reset()
void sitcom_timer_state::update_dac(uint8_t value)
{
// supposed to be a DAC and an analog meter, but that's hard to do with internal layouts
+ m_dac = value;
constexpr u8 s_7seg[10] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f };
m_digits[12] = s_7seg[value % 10];
value /= 10;
@@ -357,8 +356,6 @@ void sitcom_state::sitcom(machine_config &config)
m_maincpu->in_sid_func().set(FUNC(sitcom_state::sid_line));
m_maincpu->out_sod_func().set_output("sod_led");
- ADDRESS_MAP_BANK(config, "bank").set_map(&sitcom_state::sitcom_bank).set_options(ENDIANNESS_LITTLE, 8, 16, 0x8000);
-
CLOCK(config, "100hz", 100).signal_handler().set_inputline("maincpu", I8085_RST75_LINE);
i8255_device &ppi(I8255(config, "ppi"));
@@ -373,6 +370,7 @@ void sitcom_state::sitcom(machine_config &config)
// host interface
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "null_modem"));
rs232.rxd_handler().set(FUNC(sitcom_state::update_rxd));
+ rs232.set_option_machine_config("null_modem", sitcom_null_modem);
SOFTWARE_LIST(config, "bitb_list").set_original("sitcom");
config.set_default_layout(layout_sitcom);
diff --git a/src/mame/drivers/tosh1000.cpp b/src/mame/drivers/tosh1000.cpp
index 118fd70851c..90edf5c7684 100644
--- a/src/mame/drivers/tosh1000.cpp
+++ b/src/mame/drivers/tosh1000.cpp
@@ -38,16 +38,16 @@
#include "emu.h"
+#include "machine/genpc.h"
+#include "machine/tosh1000_bram.h"
#include "bus/isa/isa_cards.h"
#include "bus/pc_kbd/keyboards.h"
#include "bus/pc_kbd/pc_kbdc.h"
#include "cpu/i86/i86.h"
#include "machine/bankdev.h"
-#include "machine/genpc.h"
#include "machine/ram.h"
#include "machine/rp5c01.h"
-#include "machine/tosh1000_bram.h"
#include "softlist.h"
diff --git a/src/mame/includes/mc1502.h b/src/mame/includes/mc1502.h
deleted file mode 100644
index 14c263ea967..00000000000
--- a/src/mame/includes/mc1502.h
+++ /dev/null
@@ -1,101 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Sergey Svishchev
-/*****************************************************************************
- *
- * includes/mc1502.h
- *
- ****************************************************************************/
-
-#ifndef MAME_INCLUDES_MC1502_H
-#define MAME_INCLUDES_MC1502_H
-
-#pragma once
-
-#include "imagedev/cassette.h"
-#include "machine/i8251.h"
-#include "machine/i8255.h"
-#include "machine/pic8259.h"
-#include "machine/pit8253.h"
-#include "machine/ram.h"
-#include "sound/spkrdev.h"
-
-#include "bus/centronics/ctronics.h"
-#include "bus/isa/isa.h"
-#include "bus/isa/xsu_cards.h"
-#include "bus/isa/mc1502_fdc.h"
-
-
-class mc1502_state : public driver_device
-{
-public:
- mc1502_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag)
- , m_maincpu(*this, "maincpu")
- , m_upd8251(*this, "upd8251")
- , m_pic8259(*this, "pic8259")
- , m_pit8253(*this, "pit8253")
- , m_ppi8255n1(*this, "ppi8255n1")
- , m_ppi8255n2(*this, "ppi8255n2")
- , m_isabus(*this, "isa")
- , m_speaker(*this, "speaker")
- , m_cassette(*this, "cassette")
- , m_centronics(*this, "centronics")
- , m_ram(*this, RAM_TAG)
- , m_kbdio(*this, "Y%u", 1)
- { }
-
- void mc1502(machine_config &config);
-
- void init_mc1502();
-
- void fdc_config(device_t *device);
-
-protected:
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
-private:
- required_device<cpu_device> m_maincpu;
- required_device<i8251_device> m_upd8251;
- required_device<pic8259_device> m_pic8259;
- required_device<pit8253_device> m_pit8253;
- required_device<i8255_device> m_ppi8255n1;
- required_device<i8255_device> m_ppi8255n2;
- required_device<isa8_device> m_isabus;
- required_device<speaker_sound_device> m_speaker;
- required_device<cassette_image_device> m_cassette;
- required_device<centronics_device> m_centronics;
- required_device<ram_device> m_ram;
- required_ioport_array<12> m_kbdio;
-
- TIMER_CALLBACK_MEMBER(keyb_signal_callback);
-
- struct {
- uint8_t pulsing;
- uint16_t mask; /* input lines */
- emu_timer *keyb_signal_timer;
- } m_kbd;
-
- uint8_t m_ppi_portb;
- uint8_t m_ppi_portc;
- uint8_t m_spkrdata;
-
- DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out1_changed);
- DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out2_changed);
- DECLARE_WRITE_LINE_MEMBER(mc1502_speaker_set_spkrdata);
- DECLARE_WRITE_LINE_MEMBER(mc1502_i8251_syndet);
-
- void mc1502_ppi_portb_w(uint8_t data);
- void mc1502_ppi_portc_w(uint8_t data);
- uint8_t mc1502_ppi_portc_r();
- uint8_t mc1502_kppi_porta_r();
- void mc1502_kppi_portb_w(uint8_t data);
- void mc1502_kppi_portc_w(uint8_t data);
-
- void mc1502_io(address_map &map);
- void mc1502_map(address_map &map);
-
- int m_pit_out2;
-};
-
-#endif // MAME_INCLUDES_MC1502_H
diff --git a/src/mame/layout/sitcom.lay b/src/mame/layout/sitcom.lay
index 110b5b69199..25cac25a8e6 100644
--- a/src/mame/layout/sitcom.lay
+++ b/src/mame/layout/sitcom.lay
@@ -41,10 +41,10 @@ Basic display of LEDs for the SITCOM85
<view name="Default Layout">
<!-- Black background -->
<element ref="background">
- <bounds left="34" top="60" right="341" bottom="160" />
+ <bounds left="34" top="60" right="341" bottom="140" />
</element>
<element name="sod_led" ref="a_led">
- <bounds left="46" top="90" right="56" bottom="100" />
+ <bounds x="46" y="80" width="10" height="10" />
</element>
<!-- DL1414 left/right -->
@@ -55,7 +55,7 @@ Basic display of LEDs for the SITCOM85
<param name="digitno" start="~moduleno~" increment="-1" />
<param name="digitx" start="~modulex~" increment="34" />
<element name="digit~digitno~" ref="a_digit">
- <bounds x="~digitx~" y="70" width="25" height="50" />
+ <bounds x="~digitx~" y="70" width="25" height="30" />
</element>
</repeat>
</repeat>
@@ -65,10 +65,10 @@ Basic display of LEDs for the SITCOM85
<param name="bx" start="65" increment="15" />
<param name="ax" start="185" increment="15" />
<element name="pb~ledno~" ref="b_led">
- <bounds x="~bx~" y="140" width="10" height="10" />
+ <bounds x="~bx~" y="120" width="10" height="10" />
</element>
<element name="pa~ledno~" ref="b_led">
- <bounds x="~ax~" y="140" width="10" height="10" />
+ <bounds x="~ax~" y="120" width="10" height="10" />
</element>
</repeat>
</view>
diff --git a/src/mame/layout/sitcomtmr.lay b/src/mame/layout/sitcomtmr.lay
index f3ba1b94d67..4353c9b8304 100644
--- a/src/mame/layout/sitcomtmr.lay
+++ b/src/mame/layout/sitcomtmr.lay
@@ -37,78 +37,65 @@ Basic display of LEDs for the SITCOM85
</led7seg>
</element>
- <element name="background">
- <rect>
- <bounds left="0" top="0" right="1" bottom="1" />
- <color red="0.0" green="0.0" blue="0.0" />
- </rect>
+ <element name="rect">
+ <rect />
</element>
<view name="Default Layout">
<!-- Black background -->
- <element ref="background">
- <bounds left="34" top="60" right="341" bottom="200" />
+ <element ref="rect">
+ <bounds left="34" top="60" right="341" bottom="170" />
+ <color red="0.0" green="0.0" blue="0.0" />
</element>
<element name="sod_led" ref="a_led">
- <bounds left="46" top="90" right="56" bottom="100" />
+ <bounds x="46" y="80" width="10" height="10" />
</element>
<element name="test_led" ref="b_led">
- <bounds left="46" top="160" right="56" bottom="170" />
+ <bounds x="46" y="130" width="10" height="10" />
</element>
- <!-- DL1414 left -->
- <element name="digit3" ref="a_digit">
- <bounds left="65" top="70" right="90" bottom="120" />
- </element>
- <element name="digit2" ref="a_digit">
- <bounds left="99" top="70" right="124" bottom="120" />
- </element>
- <element name="digit1" ref="a_digit">
- <bounds left="133" top="70" right="158" bottom="120" />
- </element>
- <element name="digit0" ref="a_digit">
- <bounds left="167" top="70" right="192" bottom="120" />
- </element>
-
- <!-- DL1414 right -->
- <element name="digit7" ref="a_digit">
- <bounds left="204" top="70" right="229" bottom="120" />
- </element>
- <element name="digit6" ref="a_digit">
- <bounds left="238" top="70" right="263" bottom="120" />
- </element>
- <element name="digit5" ref="a_digit">
- <bounds left="272" top="70" right="297" bottom="120" />
- </element>
- <element name="digit4" ref="a_digit">
- <bounds left="306" top="70" right="331" bottom="120" />
- </element>
+ <!-- DL1414 left/right -->
+ <repeat count="2">
+ <param name="moduleno" start="3" increment="4" />
+ <param name="modulex" start="65" increment="139" />
+ <repeat count="4">
+ <param name="digitno" start="~moduleno~" increment="-1" />
+ <param name="digitx" start="~modulex~" increment="34" />
+ <element name="digit~digitno~" ref="a_digit">
+ <bounds x="~digitx~" y="70" width="25" height="30" />
+ </element>
+ </repeat>
+ </repeat>
<!-- DL1414 remote -->
- <element name="digit11" ref="a_digit">
- <bounds left="65" top="140" right="90" bottom="190" />
- </element>
- <element name="digit10" ref="a_digit">
- <bounds left="99" top="140" right="124" bottom="190" />
- </element>
- <element name="digit9" ref="a_digit">
- <bounds left="133" top="140" right="158" bottom="190" />
- </element>
- <element name="digit8" ref="a_digit">
- <bounds left="167" top="140" right="192" bottom="190" />
- </element>
+ <repeat count="4">
+ <param name="digitno" start="11" increment="-1" />
+ <param name="digitx" start="65" increment="34" />
+ <element name="digit~digitno~" ref="a_digit">
+ <bounds x="~digitx~" y="120" width="25" height="30" />
+ </element>
+ </repeat>
<!-- meter -->
<element name="digit14" ref="b_digit">
- <bounds left="238" top="140" right="263" bottom="190" />
+ <bounds x="248" y="120" width="20" height="30" />
</element>
<element name="digit13" ref="b_digit">
- <bounds left="272" top="140" right="297" bottom="190" />
+ <bounds x="277" y="120" width="20" height="30" />
</element>
<element name="digit12" ref="b_digit">
- <bounds left="306" top="140" right="331" bottom="190" />
+ <bounds x="306" y="120" width="20" height="30" />
+ </element>
+ <element ref="rect">
+ <bounds x="248" y="156" width="78" height="4" />
+ <color red="0.12549" green="0.0" blue="0.0" />
+ </element>
+ <element name="dac" ref="rect">
+ <bounds state="0" x="248" y="156" width="1" height="4" />
+ <bounds state="255" x="248" y="156" width="78" height="4" />
+ <color red="1.0" green="0.0" blue="0.0" />
</element>
</view>