Skip to content

Commit

Permalink
Cleaned up various stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuavas committed Jan 30, 2025
1 parent fbb446e commit dac3a10
Show file tree
Hide file tree
Showing 14 changed files with 684 additions and 672 deletions.
2 changes: 1 addition & 1 deletion src/devices/bus/heathzenith/h89/z_89_11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,6 @@ ioport_constructor z_89_11_device::device_input_ports() const
return INPUT_PORTS_NAME(z_89_11_device);
}

}
} // anonymous namespace

DEFINE_DEVICE_TYPE_PRIVATE(H89BUS_Z_89_11, device_h89bus_right_card_interface, z_89_11_device, "z_89_11", "Heath/Zenith Z-89-11 Multi-Function I/O Card");
46 changes: 24 additions & 22 deletions src/devices/bus/hp_dio/hp98628_9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
#include "machine/z80sio.h"

// Debugging
#undef VERBOSE
#define VERBOSE 0
//#define VERBOSE 1
#include "logmacro.h"

namespace {
Expand Down Expand Up @@ -154,7 +153,7 @@ class base_98628_9_device :
bool m_rt_in;
uint8_t m_modem_ctrl;
uint8_t m_modem_status;
uint8_t m_low_ram[ LOW_RAM_SIZE ];
uint8_t m_low_ram[LOW_RAM_SIZE];
};

base_98628_9_device::base_98628_9_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
Expand Down Expand Up @@ -385,14 +384,16 @@ void base_98628_9_device::cpu_io_mem_map(address_map &map)

void base_98628_9_device::install_68k_map(offs_t base_addr)
{
dio().install_memory(0x0000 + base_addr,
0x0007 + base_addr,
read16sm_delegate(*this, [this](offs_t addr) { return reg_r(addr); }, ""),
write16sm_delegate(*this, [this](offs_t addr, uint16_t data) { reg_w(addr, uint8_t(data)); }, ""));
dio().install_memory(0x4000 + base_addr,
0x7fff + base_addr,
read16sm_delegate(*this, FUNC(base_98628_9_device::low_ram_r_68k)),
write16sm_delegate(*this, FUNC(base_98628_9_device::low_ram_w_68k)));
dio().install_memory(
0x0000 + base_addr,
0x0007 + base_addr,
read16sm_delegate(*this, NAME([this] (offs_t addr) { return reg_r(addr); })),
write16sm_delegate(*this, NAME([this] (offs_t addr, uint16_t data) { reg_w(addr, uint8_t(data)); })));
dio().install_memory(
0x4000 + base_addr,
0x7fff + base_addr,
read16sm_delegate(*this, FUNC(base_98628_9_device::low_ram_r_68k)),
write16sm_delegate(*this, FUNC(base_98628_9_device::low_ram_w_68k)));
}

uint8_t base_98628_9_device::reg_r(offs_t addr)
Expand Down Expand Up @@ -503,7 +504,7 @@ uint8_t base_98628_9_device::low_ram_r_z80(offs_t addr)
m_sio->ctsb_w(m_ctsb);
LOG("CTSB 0\n");
}
return m_low_ram[ addr & (LOW_RAM_SIZE - 1) ];
return m_low_ram[addr & (LOW_RAM_SIZE - 1)];
}

uint16_t base_98628_9_device::low_ram_r_68k(offs_t addr)
Expand All @@ -514,7 +515,7 @@ uint16_t base_98628_9_device::low_ram_r_68k(offs_t addr)
update_irq();
LOG("IRQ 0\n");
}
return m_low_ram[ addr & (LOW_RAM_SIZE - 1) ];
return m_low_ram[addr & (LOW_RAM_SIZE - 1)];
}

void base_98628_9_device::low_ram_w_z80(offs_t addr, uint8_t data)
Expand All @@ -525,7 +526,7 @@ void base_98628_9_device::low_ram_w_z80(offs_t addr, uint8_t data)
LOG("IRQ 1\n");
update_irq();
}
m_low_ram[ addr & (LOW_RAM_SIZE - 1) ] = data;
m_low_ram[addr & (LOW_RAM_SIZE - 1)] = data;
}

void base_98628_9_device::low_ram_w_68k(offs_t addr, uint16_t data)
Expand All @@ -536,7 +537,7 @@ void base_98628_9_device::low_ram_w_68k(offs_t addr, uint16_t data)
LOG("CTSB 1\n");
m_sio->ctsb_w(m_ctsb);
}
m_low_ram[ addr & (LOW_RAM_SIZE - 1) ] = uint8_t(data);
m_low_ram[addr & (LOW_RAM_SIZE - 1)] = uint8_t(data);
}

uint8_t base_98628_9_device::sio_r(offs_t addr)
Expand Down Expand Up @@ -873,7 +874,7 @@ class dio16_98629_device :
bool m_tx;
bool m_last_tt;
uint8_t m_sr;
uint8_t m_high_ram[ HIGH_RAM_SIZE ];
uint8_t m_high_ram[HIGH_RAM_SIZE];
};

void dio16_98629_device::device_start()
Expand Down Expand Up @@ -995,20 +996,21 @@ void dio16_98629_device::cpu_program_mem_map(address_map &map)
void dio16_98629_device::install_68k_map(offs_t base_addr)
{
base_98628_9_device::install_68k_map(base_addr);
dio().install_memory(0x8000 + base_addr,
0xbfff + base_addr,
read16sm_delegate(*this, [this](offs_t addr) { return high_ram_r_z80(addr); }, ""),
write16sm_delegate(*this, [this](offs_t addr, uint16_t data) { high_ram_w_z80(addr, uint8_t(data)); }, ""));
dio().install_memory(
0x8000 + base_addr,
0xbfff + base_addr,
read16sm_delegate(*this, NAME([this] (offs_t addr) { return high_ram_r_z80(addr); })),
write16sm_delegate(*this, NAME([this] (offs_t addr, uint16_t data) { high_ram_w_z80(addr, uint8_t(data)); })));
}

uint8_t dio16_98629_device::high_ram_r_z80(offs_t addr)
{
return m_high_ram[ addr & (HIGH_RAM_SIZE - 1) ];
return m_high_ram[addr & (HIGH_RAM_SIZE - 1)];
}

void dio16_98629_device::high_ram_w_z80(offs_t addr, uint8_t data)
{
m_high_ram[ addr & (HIGH_RAM_SIZE - 1) ] = data;
m_high_ram[addr & (HIGH_RAM_SIZE - 1)] = data;
}

void dio16_98629_device::tx_out(int state)
Expand Down
19 changes: 13 additions & 6 deletions src/devices/cpu/mpk1839/kl1839vm1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// copyright-holders:Andrei I. Holub

#include "emu.h"

#include "kl1839vm1.h"
#include "kl1839vm1dasm.h"

#include "cpu/vax/vaxdasm.h"

#include <algorithm>
#include <regex>


Expand Down Expand Up @@ -132,7 +134,7 @@ u32 kl1839vm1_device::shr(u32 val, bool va, u8 fo, bool a_c, bool l_r)
void kl1839vm1_device::kop(u8 kop, u8 fd, u32 x, u32 y, u8 rz, u8 ps, bool va = false, u8 fo = 0)
{
u64 res = 0;
switch(fd)
switch (fd)
{
case 0b11:
x = s8(x);
Expand All @@ -148,7 +150,7 @@ void kl1839vm1_device::kop(u8 kop, u8 fd, u32 x, u32 y, u8 rz, u8 ps, bool va =
}

RSP &= ~(VF | CF);
switch(kop)
switch (kop)
{
case 0b0000: res = y; break;
// 0b0001:
Expand Down Expand Up @@ -191,7 +193,7 @@ void kl1839vm1_device::kop(u8 kop, u8 fd, u32 x, u32 y, u8 rz, u8 ps, bool va =
default: break;
}

switch(fd)
switch (fd)
{
case 0b11:
res &= 0x000000ff;
Expand All @@ -207,7 +209,8 @@ void kl1839vm1_device::kop(u8 kop, u8 fd, u32 x, u32 y, u8 rz, u8 ps, bool va =
break;
}
R(rz) |= res;
if (rz == 0x1f) mreg_w();
if (rz == 0x1f)
mreg_w();
}

bool kl1839vm1_device::mreg_r()
Expand Down Expand Up @@ -874,10 +877,14 @@ void kl1839vm1_device::vax_decode_pc()
}

if (!m_op_size)
{
LOGVAX("(%x): undecoded OP=%02x .. EXIT\n", PC, op);
}
else
{
PC += m_op_size; // move to a next op
;//LOGVAX("(%x): Decoded: OP=%02x args:%d \n", PC, op, m_pcm_queue.size());
/*LOGVAX("(%x): Decoded: OP=%02x args:%d \n", PC, op, m_pcm_queue.size())*/;
}
}

u32 kl1839vm1_device::vax_pcm_pull(bool is_bo)
Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/vax/vaxdasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ bool vax_disassembler::is_read_mode(vax_disassembler::mode m)
}
}

const vax_disassembler::mode* vax_disassembler::get_operands(u8 op)
const vax_disassembler::mode *vax_disassembler::get_operands(u8 op)
{
return s_nonprefix_ops[op].operand;
}
2 changes: 1 addition & 1 deletion src/devices/cpu/vax/vaxdasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class vax_disassembler : public util::disasm_interface
vax_disassembler();

static bool is_read_mode(mode m);
static const mode* get_operands(u8 op);
static const mode *get_operands(u8 op);

protected:
// disassembler overrides
Expand Down
4 changes: 3 additions & 1 deletion src/devices/machine/z80sio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2551,9 +2551,11 @@ void z80sio_channel::txc_w(int state)
// Generate a new bit
bool new_bit = false;
if ((m_wr4 & (WR4_SYNC_MODE_MASK | WR4_STOP_BITS_MASK)) == (WR4_SYNC_MODE_SDLC | WR4_STOP_BITS_SYNC) &&
(m_tx_flags & (TX_FLAG_DATA_TX | TX_FLAG_CRC_TX)) && (m_tx_hist & 0x1f) == 0x1f)
(m_tx_flags & (TX_FLAG_DATA_TX | TX_FLAG_CRC_TX)) && (m_tx_hist & 0x1f) == 0x1f)
{
// SDLC, sending data/CRC & 5 ones in a row: do zero insertion
new_bit = false;
}
else
{
bool get_out = false;
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/mame/luaengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2106,13 +2106,15 @@ void lua_engine::initialize()
ui_type["options"] = sol::property([] (mame_ui_manager &m) { return static_cast<core_options *>(&m.options()); });
ui_type["line_height"] = sol::property([] (mame_ui_manager &m) { return m.get_line_height(); });
ui_type["menu_active"] = sol::property(&mame_ui_manager::is_menu_active);
ui_type["show_menu"] = &mame_ui_manager::show_menu;
ui_type["ui_active"] = sol::property(&mame_ui_manager::ui_active, &mame_ui_manager::set_ui_active);
ui_type["single_step"] = sol::property(&mame_ui_manager::single_step, &mame_ui_manager::set_single_step);
ui_type["show_fps"] = sol::property(&mame_ui_manager::show_fps, &mame_ui_manager::set_show_fps);
ui_type["show_profiler"] = sol::property(&mame_ui_manager::show_profiler, &mame_ui_manager::set_show_profiler);
ui_type["image_display_enabled"] = sol::property(&mame_ui_manager::image_display_enabled, &mame_ui_manager::set_image_display_enabled);

// undocumented/unsupported
ui_type["show_menu"] = &mame_ui_manager::show_menu; // FIXME: this is dangerous - it doesn't give a proper chance for the current UI handler to clean up


/* rom_entry library
*
Expand Down
Loading

1 comment on commit dac3a10

@cuavas
Copy link
Member Author

@cuavas cuavas commented on dac3a10 Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently I fixed the indentation on enough lines in the D70 layout that git doesn’t recognise it as a rename/edit. I’m still not really happy with it. The embedded SVG uses weird coordinates so you can’t easily visualise it by reading the paths, and the sizes and viewboxes don’t match up. The script obviously suffers from the same issues as the original it was copy/pasted from meaning it won’t work with multi-touch and doesn’t handle all the events it should.

Please sign in to comment.