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 Aug 31, 2024
2 parents fba8c3a + a1f3f25 commit ad56ee3
Show file tree
Hide file tree
Showing 48 changed files with 1,641 additions and 1,118 deletions.
12 changes: 12 additions & 0 deletions hash/megadriv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36461,6 +36461,18 @@ Jumps to invalid address, needs own slot type with mountable carts
</part>
</software>

<software name="pvar" supported="no">
<description>Pro Version Action Replay (Europe)</description>
<year>1992</year>
<publisher>Datel</publisher>
<part name="cart" interface="megadriv_cart">
<dataarea name="rom" width="16" endianness="big" size="131072">
<rom name="27c256.low" size="32768" crc="cca1bd54" sha1="39a934fca8343cf84ecff4f2010cb08e55ad2b06" offset="0x0000" loadflag="load16_byte"/>
<rom name="27c256.high" size="32768" crc="41c5499f" sha1="9f39ddfc9299f2d796e0f00472d258a854ce1b18" offset="0x0001" loadflag="load16_byte"/>
</dataarea>
</part>
</software>

<software name="par2" supported="no">
<description>Pro Action Replay 2 (Europe)</description>
<year>1994</year>
Expand Down
48 changes: 48 additions & 0 deletions hash/msx1_cart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19246,6 +19246,18 @@ legacy FM implementations cannot find it.
</part>
</software>

<software name="4mastmel">
<description>The 4 Masters of Melody</description>
<year>2019</year>
<publisher>Clube MSX</publisher>
<part name="cart" interface="msx_cart">
<feature name="start_page" value="2"/>
<dataarea name="rom" size="0x4000">
<rom name="the 4 masters of melody - matra.rom" size="0x4000" crc="56dc456b" sha1="74094836d6deeebd70ead949553b8d7918716ab2"/>
</dataarea>
</part>
</software>

<software name="acegun">
<description>Ace Gun</description>
<year>2020</year>
Expand Down Expand Up @@ -19565,6 +19577,18 @@ legacy FM implementations cannot find it.
</part>
</software>

<software name="batlgojo">
<description>The Battle on Gojo Ohashi</description>
<year>2020</year>
<publisher>Matra</publisher>
<part name="cart" interface="msx_cart">
<feature name="start_page" value="0"/>
<dataarea name="rom" size="0x10000">
<rom name="the battle on gojo ohashi - matra.rom" size="0x10000" crc="5d1e5d4e" sha1="1086d8795f344753d55cf358e3c274f14e408751"/>
</dataarea>
</part>
</software>

<software name="battlot">
<description>Battlot</description>
<year>2021</year>
Expand Down Expand Up @@ -21834,6 +21858,18 @@ legacy FM implementations cannot find it.
</part>
</software>

<software name="ghost">
<description>Ghost</description>
<year>2017</year>
<publisher>Matra</publisher>
<part name="cart" interface="msx_cart">
<feature name="start_page" value="0"/>
<dataarea name="rom" size="0x10000">
<rom name="ghost - matra.rom" size="0x10000" crc="48efb417" sha1="d26ea45f0b84f65df21fe54573ef2c37e21bc591"/>
</dataarea>
</part>
</software>

<software name="gniffel">
<description>Gniffel</description>
<year>2004</year>
Expand Down Expand Up @@ -24515,6 +24551,18 @@ legacy FM implementations cannot find it.
</part>
</software>

<software name="prsnrwar">
<description>Prisoner of War</description>
<year>2018</year>
<publisher>Matra</publisher>
<part name="cart" interface="msx_cart">
<feature name="start_page" value="0"/>
<dataarea name="rom" size="0x10000">
<rom name="prisoner of war - matra.rom" size="0x10000" crc="49efb097" sha1="f07f68e873689e1d7083e21b805b8a5b174f50d2"/>
</dataarea>
</part>
</software>

<software name="psged">
<description>PSGed (v0.82b)</description>
<year>2010</year>
Expand Down
13 changes: 13 additions & 0 deletions hash/msx2_cart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3969,6 +3969,19 @@ LZ93A13 (32 pin) - 8KB banks
</part>
</software>

<software name="arkanoah">
<description>Ark-A-Noah</description>
<year>2014</year>
<publisher>Matra</publisher>
<info name="serial" value="VGC3303"/>
<part name="cart" interface="msx_cart">
<feature name="start_page" value="0"/>
<dataarea name="rom" size="0x10000">
<rom name="ark-a-noah - matra.rom" size="0x10000" crc="e6abc354" sha1="f5dcc5d5ea152f081fa8239457a992991c08a711"/>
</dataarea>
</part>
</software>

<software name="barbduel">
<description>Barbarian the Duel</description>
<year>2019</year>
Expand Down
10 changes: 10 additions & 0 deletions scripts/src/cpu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2972,6 +2972,14 @@ end
--------------------------------------------------
-- Zilog Z80
--@src/devices/cpu/z80/z80.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/tmpz84c011.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/tmpz84c015.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/ez80.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/lz8420m.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/mc8123.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/nsc800.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/r800.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/z84c015.h,CPUS["Z80"] = true
--@src/devices/cpu/z80/z80n.h,CPUS["Z80N"] = true
--@src/devices/cpu/z80/kc82.h,CPUS["KC80"] = true
--@src/devices/cpu/z80/kl5c80a12.h,CPUS["KC80"] = true
Expand All @@ -2993,6 +3001,8 @@ if CPUS["Z80"] or CPUS["KC80"] or CPUS["Z80N"] then
MAME_DIR .. "src/devices/cpu/z80/lz8420m.h",
MAME_DIR .. "src/devices/cpu/z80/mc8123.cpp",
MAME_DIR .. "src/devices/cpu/z80/mc8123.h",
MAME_DIR .. "src/devices/cpu/z80/nsc800.cpp",
MAME_DIR .. "src/devices/cpu/z80/nsc800.h",
MAME_DIR .. "src/devices/cpu/z80/r800.cpp",
MAME_DIR .. "src/devices/cpu/z80/r800.h",
MAME_DIR .. "src/devices/cpu/z80/z84c015.cpp",
Expand Down
2 changes: 1 addition & 1 deletion src/devices/bus/odyssey2/chess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Hardware notes:
#include "emu.h"
#include "chess.h"

#include "cpu/z80/z80.h"
#include "cpu/z80/nsc800.h"
#include "machine/gen_latch.h"

namespace {
Expand Down
4 changes: 2 additions & 2 deletions src/devices/cpu/z80/kc82.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void kc82_device::data_write(u16 addr, u8 value)

u8 kc82_device::opcode_read()
{
u32 pc = m_pc.w.l + m_mmu_base[m_pc.b.h >> 2];
u32 pc = m_pc.w + m_mmu_base[m_pc.b.h >> 2];
// no refresh
return m_opcodes.read_byte(pc);
}
Expand All @@ -240,6 +240,6 @@ u8 kc82_device::opcode_read()

u8 kc82_device::arg_read()
{
u32 pc = m_pc.w.l + m_mmu_base[m_pc.b.h >> 2];
u32 pc = m_pc.w + m_mmu_base[m_pc.b.h >> 2];
return m_args.read_byte(pc);
}
78 changes: 78 additions & 0 deletions src/devices/cpu/z80/nsc800.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// license:BSD-3-Clause
// copyright-holders:Juergen Buchmueller
/*
National Semiconductor NSC800
*/

#include "emu.h"
#include "nsc800.h"

#include "z80.inc"

#define LOG_INT (1U << 1) // z80.lst

//#define VERBOSE (LOG_INT)
#include "logmacro.h"

#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__)


// device type definition
DEFINE_DEVICE_TYPE(NSC800, nsc800_device, "nsc800", "National Semiconductor NSC800")

nsc800_device::nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: z80_device(mconfig, NSC800, tag, owner, clock)
{
}


//-------------------------------------------------
// initialization
//-------------------------------------------------

void nsc800_device::device_start()
{
z80_device::device_start();

save_item(NAME(m_nsc800_irq_state));
}

void nsc800_device::device_reset()
{
z80_device::device_reset();
memset(m_nsc800_irq_state, 0, sizeof(m_nsc800_irq_state));
}


//-------------------------------------------------
// execute
//-------------------------------------------------

void nsc800_device::do_op()
{
#include "cpu/z80/ncs800.hxx"
}

void nsc800_device::execute_set_input(int inputnum, int state)
{
switch (inputnum)
{
case NSC800_RSTA:
m_nsc800_irq_state[0] = state;
break;

case NSC800_RSTB:
m_nsc800_irq_state[1] = state;
break;

case NSC800_RSTC:
m_nsc800_irq_state[2] = state;
break;

default:
z80_device::execute_set_input(inputnum, state);
break;
}
}
39 changes: 39 additions & 0 deletions src/devices/cpu/z80/nsc800.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// license:BSD-3-Clause
// copyright-holders:Juergen Buchmueller
#ifndef MAME_CPU_Z80_NSC800_H
#define MAME_CPU_Z80_NSC800_H

#pragma once

#include "z80.h"

enum
{
NSC800_RSTA = Z80_INPUT_LINE_MAX,
NSC800_RSTB,
NSC800_RSTC
};


class nsc800_device : public z80_device
{
public:
nsc800_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

protected:
// device_t implementation
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;

// device_execute_interface implementation
virtual u32 execute_input_lines() const noexcept override { return 7; }
virtual void execute_set_input(int inputnum, int state) override;

virtual void do_op() override;
u8 m_nsc800_irq_state[3]; // state of NSC800 restart interrupts A, B, C
};

DECLARE_DEVICE_TYPE(NSC800, nsc800_device)


#endif // MAME_CPU_Z80_NSC800_H
86 changes: 4 additions & 82 deletions src/devices/cpu/z80/r800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
#include "r800.h"
#include "r800dasm.h"

#define LOG_UNDOC (1U << 1)
#define LOG_INT (1U << 2)
#define LOG_TIME (1U << 3)
#include "z80.inc"

//#define VERBOSE ( LOG_UNDOC /*| LOG_INT*/ )
#define LOG_INT (1U << 1) // z80.lst

//#define VERBOSE (LOG_INT)
#include "logmacro.h"

#define LOGUNDOC(...) LOGMASKED(LOG_UNDOC, __VA_ARGS__)
#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__)

//**************************************************************************
Expand Down Expand Up @@ -64,83 +63,6 @@ void r800_device::device_validity_check(validity_checker &valid) const
}



#define HAS_LDAIR_QUIRK 0

/****************************************************************************
* The Z80 registers. halt is set to 1 when the CPU is halted, the refresh
* register is calculated as follows: refresh = (r & 127) | (r2 & 128)
****************************************************************************/
#define CF 0x01
#define NF 0x02
#define PF 0x04
#define VF PF
#define XF 0x08
#define HF 0x10
#define YF 0x20
#define ZF 0x40
#define SF 0x80

#define INT_IRQ 0x01
#define NMI_IRQ 0x02

#define PRVPC m_prvpc.d // previous program counter

#define PCD m_pc.d
#define PC m_pc.w.l

#define SPD m_sp.d
#define SP m_sp.w.l

#define AFD m_af.d
#define AF m_af.w.l
#define A m_af.b.h
#define F m_af.b.l
#define Q m_q
#define QT m_qtemp
#define I m_i
#define R m_r
#define R2 m_r2

#define BCD m_bc.d
#define BC m_bc.w.l
#define B m_bc.b.h
#define C m_bc.b.l

#define DED m_de.d
#define DE m_de.w.l
#define D m_de.b.h
#define E m_de.b.l

#define HLD m_hl.d
#define HL m_hl.w.l
#define H m_hl.b.h
#define L m_hl.b.l

#define IXD m_ix.d
#define IX m_ix.w.l
#define HX m_ix.b.h
#define LX m_ix.b.l

#define IYD m_iy.d
#define IY m_iy.w.l
#define HY m_iy.b.h
#define LY m_iy.b.l

#define WZ m_wz.w.l
#define WZ_H m_wz.b.h
#define WZ_L m_wz.b.l

#define TADR m_shared_addr.w // Typically represents values from A0..15 pins. 16bit input in steps.
#define TADR_H m_shared_addr.b.h
#define TADR_L m_shared_addr.b.l
#define TDAT m_shared_data.w // 16bit input(if use as second parameter) or output in steps.
#define TDAT2 m_shared_data2.w
#define TDAT_H m_shared_data.b.h
#define TDAT_L m_shared_data.b.l
#define TDAT8 m_shared_data.b.l // Typically represents values from D0..8 pins. 8bit input or output in steps.


/***************************************************************
* adjust cycle count by n T-states
***************************************************************/
Expand Down
Loading

0 comments on commit ad56ee3

Please sign in to comment.