Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed May 14, 2024
2 parents 32e0e87 + 7501d0c commit 3967dcb
Show file tree
Hide file tree
Showing 65 changed files with 3,359 additions and 1,845 deletions.
2 changes: 1 addition & 1 deletion plugins/layout/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function layout.startplugin()
table = table }
local script, err = load(script, script, "t", env)
if not script then
emu.print_verbose("error loading layout script " .. err)
emu.print_warning("error loading layout script " .. err)
return
end
local hooks = script()
Expand Down
2 changes: 2 additions & 0 deletions scripts/src/cpu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2042,6 +2042,8 @@ if CPUS["M680X0"] then
MAME_DIR .. "src/devices/cpu/m68000/m68008-sip8.cpp",
MAME_DIR .. "src/devices/cpu/m68000/m68008.h",
MAME_DIR .. "src/devices/cpu/m68000/m68008.cpp",
MAME_DIR .. "src/devices/cpu/m68000/m68000musashi.h",
MAME_DIR .. "src/devices/cpu/m68000/m68000musashi.cpp",
MAME_DIR .. "src/devices/cpu/m68000/m68010.h",
MAME_DIR .. "src/devices/cpu/m68000/m68010.cpp",
MAME_DIR .. "src/devices/cpu/m68000/m68020.h",
Expand Down
20 changes: 15 additions & 5 deletions src/devices/bus/ata/atapicdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,19 @@ void atapi_cdrom_device::ExecCommand()
}
t10mmc::ExecCommand();

// truckk requires seek complete flag to be set after calling the SEEK command
// so set the seek complete status flag after a successful request to emulate
// having asked the device itself to seek
if (command[0] == T10SBC_CMD_SEEK_10 && m_status_code == SCSI_STATUS_CODE_GOOD)
m_status |= IDE_STATUS_DSC;
if (m_status_code == SCSI_STATUS_CODE_GOOD)
{
switch (command[0])
{
// Set the DSC (Drive Seek Complete) bit on commands that involve a drive seek.
// truckk is known to rely on this flag being set after T10SBC_CMD_SEEK_10.
case T10SBC_CMD_SEEK_10:
case T10MMC_CMD_PLAY_AUDIO_10:
case T10MMC_CMD_PLAY_AUDIO_12:
case T10MMC_CMD_PLAY_AUDIO_MSF:
case T10MMC_CMD_PLAY_AUDIO_TRACK_INDEX:
m_status |= IDE_STATUS_DSC;
break;
}
}
}
2 changes: 1 addition & 1 deletion src/devices/cpu/h8/h8_intc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ u8 h8h_intc_device::isr_r()
void h8h_intc_device::isr_w(u8 data)
{
m_isr &= data; // edge/level
logerror("isr = %02x / %02x\n", data, m_isr);
// logerror("isr = %02x / %02x\n", data, m_isr);
check_level_irqs(false);
update_irq_state();
}
Expand Down
25 changes: 25 additions & 0 deletions src/devices/cpu/m68000/m68000musashi.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// license:BSD-3-Clause
// copyright-holders:Karl Stenerud

#include "emu.h"
#include "m68000musashi.h"
#include "m68kdasm.h"

DEFINE_DEVICE_TYPE(M68000MUSASHI, m68000msh_device, "m68000msh", "Motorola MC68000 (Musashi)")

std::unique_ptr<util::disasm_interface> m68000msh_device::create_disassembler()
{
return std::make_unique<m68k_disassembler>(m68k_disassembler::TYPE_68010);
}


m68000msh_device::m68000msh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: m68000_musashi_device(mconfig, tag, owner, clock, M68000MUSASHI, 16, 24)
{
}

void m68000msh_device::device_start()
{
m68000_musashi_device::device_start();
init_cpu_m68000();
}
27 changes: 27 additions & 0 deletions src/devices/cpu/m68000/m68000musashi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// license:BSD-3-Clause
// copyright-holders:Karl Stenerud
#ifndef MAME_CPU_M68000_M68000MUSASHI_H
#define MAME_CPU_M68000_M68000MUSASHI_H

#pragma once

#include "m68kmusashi.h"

class m68000msh_device : public m68000_musashi_device
{
public:
// construction/destruction
m68000msh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;

virtual u32 execute_min_cycles() const noexcept override { return 4; }
virtual u32 execute_max_cycles() const noexcept override { return 158; }

// device-level overrides
virtual void device_start() override;
};

DECLARE_DEVICE_TYPE(M68000MUSASHI, m68000msh_device)

#endif
17 changes: 9 additions & 8 deletions src/devices/cpu/sh/sh_mtu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,14 @@ u8 sh_mtu_channel_device::tier_r()
void sh_mtu_channel_device::tier_w(u8 data)
{
m_tier = data;
logerror("irq %c%c%c%c%c%c\n",
m_tier & IRQ_A ? 'a' : '.',
m_tier & IRQ_B ? 'b' : '.',
m_tier & IRQ_C ? 'c' : '.',
m_tier & IRQ_D ? 'd' : '.',
m_tier & IRQ_V ? 'v' : '.',
m_tier & IRQ_U ? 'u' : '.');
if(0)
logerror("irq %c%c%c%c%c%c\n",
m_tier & IRQ_A ? 'a' : '.',
m_tier & IRQ_B ? 'b' : '.',
m_tier & IRQ_C ? 'c' : '.',
m_tier & IRQ_D ? 'd' : '.',
m_tier & IRQ_V ? 'v' : '.',
m_tier & IRQ_U ? 'u' : '.');
recalc_event();
}

Expand All @@ -343,7 +344,7 @@ u16 sh_mtu_channel_device::tcnt_r()
{
if(!machine().side_effects_disabled())
update_counter();
// Nedd to implement phase counting for the rotary controller on the psr540
// Need to implement phase counting for the rotary controller on the psr540
if(m_tmdr & 0xf)
return 0;
return m_tcnt;
Expand Down
6 changes: 3 additions & 3 deletions src/devices/cpu/upd7725/upd7725.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ void necdsp_device::exec_op(uint32_t opcode) {
case 12: regs.idb = bitswap<16>(regs.si, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); break; //LSB = first bit in from serial, 'reversed' SI register order
case 13: regs.idb = regs.k; break;
case 14: regs.idb = regs.l; break;
case 15: regs.idb = dataRAM[regs.dp]; break;
case 15: regs.idb = dataRAM[regs.dp & 0x07ff]; break;
}

if(alu) {
Expand Down Expand Up @@ -573,10 +573,10 @@ void necdsp_device::exec_ld(uint32_t opcode) {
case 9: regs.so = id; break; //MSB first output, output tapped at bit 15 shifting left
case 10: regs.k = id; break;
case 11: regs.k = id; regs.l = m_data.read_word(regs.rp); break;
case 12: regs.l = id; regs.k = dataRAM[regs.dp | 0x40]; break;
case 12: regs.l = id; regs.k = dataRAM[(regs.dp & 0x7ff) | 0x40]; break;
case 13: regs.l = id; break;
case 14: regs.trb = id; break;
case 15: dataRAM[regs.dp] = id; break;
case 15: dataRAM[regs.dp & 0x7ff] = id; break;
}
}

Expand Down
28 changes: 14 additions & 14 deletions src/devices/cpu/upd7725/upd7725.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,26 @@ class necdsp_device : public cpu_device
// construction/destruction
necdsp_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t abits, uint32_t dbits);

// device-level overrides
// device_t implementation
virtual void device_start() override;
virtual void device_reset() override;

// device_execute_interface overrides
// device_execute_interface implementation
virtual uint32_t execute_min_cycles() const noexcept override;
virtual uint32_t execute_max_cycles() const noexcept override;
virtual uint32_t execute_input_lines() const noexcept override;
virtual void execute_run() override;
virtual void execute_set_input(int inputnum, int state) override;

// device_memory_interface overrides
// device_memory_interface implementation
virtual space_config_vector memory_space_config() const override;

// device_state_interface overrides
virtual void state_import(const device_state_entry &entry) override;
virtual void state_export(const device_state_entry &entry) override;
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;

// device_disasm_interface overrides
// device_disasm_interface implementation
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;

// inline data
Expand All @@ -75,12 +75,12 @@ class necdsp_device : public cpu_device
{
bool s1, s0, c, z, ov1, ov0;

inline operator unsigned() const
operator unsigned() const
{
return (s1 << 5) + (s0 << 4) + (c << 3) + (z << 2) + (ov1 << 1) + (ov0 << 0);
return (s1 << 5) | (s0 << 4) | (c << 3) | (z << 2) | (ov1 << 1) | (ov0 << 0);
}

inline unsigned operator=(unsigned d)
unsigned operator=(unsigned d)
{
s1 = d & 0x20; s0 = d & 0x10; c = d & 0x08; z = d & 0x04; ov1 = d & 0x02; ov0 = d & 0x01;
return d;
Expand All @@ -91,14 +91,14 @@ class necdsp_device : public cpu_device
{
bool rqm, usf1, usf0, drs, dma, drc, soc, sic, ei, p1, p0;

inline operator unsigned() const
operator unsigned() const
{
return (rqm << 15) + (usf1 << 14) + (usf0 << 13) + (drs << 12)
+ (dma << 11) + (drc << 10) + (soc << 9) + (sic << 8)
+ (ei << 7) + (p1 << 1) + (p0 << 0);
return (rqm << 15) | (usf1 << 14) | (usf0 << 13) | (drs << 12)
| (dma << 11) | (drc << 10) | (soc << 9) | (sic << 8)
| (ei << 7) | (p1 << 1) | (p0 << 0);
}

inline unsigned operator=(unsigned d)
unsigned operator=(unsigned d)
{
rqm = d & 0x8000; usf1 = d & 0x4000; usf0 = d & 0x2000; drs = d & 0x1000;
dma = d & 0x0800; drc = d & 0x0400; soc = d & 0x0200; sic = d & 0x0100;
Expand Down Expand Up @@ -175,8 +175,8 @@ class upd96050_device : public necdsp_device
// construction/destruction
upd96050_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

uint16_t dataram_r(uint16_t addr) { return dataRAM[addr]; }
void dataram_w(uint16_t addr, uint16_t data) { dataRAM[addr] = data; }
uint16_t dataram_r(uint16_t addr) { return dataRAM[addr & 0x07ff]; }
void dataram_w(uint16_t addr, uint16_t data) { dataRAM[addr & 0x07ff] = data; }
};

// device type definition
Expand Down
14 changes: 14 additions & 0 deletions src/devices/imagedev/cdromimg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,27 @@ int cdrom_image_device::get_last_track() const
return 0;
}

int cdrom_image_device::get_last_session() const
{
if (m_cdrom_handle)
return m_cdrom_handle->get_last_session();
return 0;
}

uint32_t cdrom_image_device::get_track(uint32_t frame) const
{
if (m_cdrom_handle)
return m_cdrom_handle->get_track(frame);
return 0;
}

uint32_t cdrom_image_device::get_track_index(uint32_t frame) const
{
if (m_cdrom_handle)
return m_cdrom_handle->get_track_index(frame);
return 0;
}

uint32_t cdrom_image_device::get_track_start(uint32_t track) const
{
if (m_cdrom_handle)
Expand Down
2 changes: 2 additions & 0 deletions src/devices/imagedev/cdromimg.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class cdrom_image_device : public device_t,
virtual const char *image_brief_type_name() const noexcept override { return "cdrm"; }

int get_last_track() const;
int get_last_session() const;
uint32_t get_track(uint32_t frame) const;
uint32_t get_track_index(uint32_t frame) const;
uint32_t get_track_start(uint32_t track) const;
bool read_data(uint32_t lbasector, void *buffer, uint32_t datatype, bool phys=false);
bool read_subcode(uint32_t lbasector, void *buffer, bool phys=false);
Expand Down
Loading

0 comments on commit 3967dcb

Please sign in to comment.