mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
(MESS) msx.c: Implemented msx2+ system flags register. The fsa1fx driver no longer keeps rebooting into firmware. (nw)
This commit is contained in:
parent
b0a73e4963
commit
9a1354dbd1
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -8707,6 +8707,8 @@ src/mess/machine/msx_s1985.c svneol=native#text/plain
|
||||
src/mess/machine/msx_s1985.h svneol=native#text/plain
|
||||
src/mess/machine/msx_switched.c svneol=native#text/plain
|
||||
src/mess/machine/msx_switched.h svneol=native#text/plain
|
||||
src/mess/machine/msx_systemflags.c svneol=native#text/plain
|
||||
src/mess/machine/msx_systemflags.h svneol=native#text/plain
|
||||
src/mess/machine/mtx.c svneol=native#text/plain
|
||||
src/mess/machine/mz700.c svneol=native#text/plain
|
||||
src/mess/machine/mz80.c svneol=native#text/plain
|
||||
|
@ -41,13 +41,12 @@
|
||||
bit can be read, so the code goes into an infinite loop.
|
||||
** - hbf12: Does not boot; see hbf1.
|
||||
** - tpc310: Floppy support broken
|
||||
** 7fbb <- c7 => seek 199???
|
||||
** - hx23f: The builtin word processor displays white squares instead of text
|
||||
** - cx7m: sfg not emulated
|
||||
** - expert3i: IDE not emulated
|
||||
** - expert3t: Turbo not emulated
|
||||
** - expertac: Does not boot
|
||||
** - fsa1fx: Floppy not emulated
|
||||
** - fsa1fx: Keeps rebooting into firmware
|
||||
** - fsa1wsx: Firmware not emulated
|
||||
** - fsa1wx: Firmware not emulated
|
||||
** - fsa1wx: Floppy not emulated
|
||||
@ -398,6 +397,7 @@ Spectravideo SVI-707 - MB8877A - 1 5.25" SSDD drive (320KB) - There seem to be 2
|
||||
#include "formats/dsk_dsk.h"
|
||||
#include "machine/msx_matsushita.h"
|
||||
#include "machine/msx_s1985.h"
|
||||
#include "machine/msx_systemflags.h"
|
||||
|
||||
|
||||
static ADDRESS_MAP_START ( msx_memory_map, AS_PROGRAM, 8, msx_state )
|
||||
@ -5345,6 +5345,8 @@ static MACHINE_CONFIG_DERIVED( fsa1fx, msx2p )
|
||||
MCFG_MSX_MATSUSHITA_ADD( "matsushita" )
|
||||
MCFG_MSX_MATSUSHITA_TURBO_CB(WRITELINE(msx_state, turbo_w))
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
MCFG_FRAGMENT_ADD( msx_1_35_dd_drive )
|
||||
MCFG_FRAGMENT_ADD( msx2_floplist )
|
||||
@ -5391,6 +5393,8 @@ static MACHINE_CONFIG_DERIVED( fsa1wsx, msx2p )
|
||||
MCFG_MSX_MATSUSHITA_ADD( "matsushita" )
|
||||
MCFG_MSX_MATSUSHITA_TURBO_CB(WRITELINE(msx_state, turbo_w))
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
@ -5439,6 +5443,8 @@ static MACHINE_CONFIG_DERIVED( fsa1wx, msx2p )
|
||||
MCFG_MSX_MATSUSHITA_ADD( "matsushita" )
|
||||
MCFG_MSX_MATSUSHITA_TURBO_CB(WRITELINE(msx_state, turbo_w))
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
@ -5485,6 +5491,8 @@ static MACHINE_CONFIG_DERIVED( fsa1wxa, msx2p )
|
||||
MCFG_MSX_MATSUSHITA_ADD( "matsushita" )
|
||||
MCFG_MSX_MATSUSHITA_TURBO_CB(WRITELINE(msx_state, turbo_w))
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
@ -5521,6 +5529,8 @@ static MACHINE_CONFIG_DERIVED( phc35j, msx2p )
|
||||
MCFG_MSX_LAYOUT_ROM("ext", 3, 1, 0, 1, "maincpu", 0x8000)
|
||||
MCFG_MSX_LAYOUT_ROM("kdr", 3, 1, 1, 2, "maincpu", 0x20000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx2_cartlist )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -5558,6 +5568,8 @@ static MACHINE_CONFIG_DERIVED( phc70fd, msx2p )
|
||||
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x28000)
|
||||
MCFG_MSX_LAYOUT_ROM("bas", 3, 3, 2, 1, "maincpu", 0x2c000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
@ -5600,6 +5612,8 @@ static MACHINE_CONFIG_DERIVED( phc70fd2, msx2p )
|
||||
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x28000)
|
||||
MCFG_MSX_LAYOUT_ROM("bas", 3, 3, 2, 1, "maincpu", 0x2c000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0xff)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
@ -5645,6 +5659,8 @@ static MACHINE_CONFIG_DERIVED( hbf1xdj, msx2p )
|
||||
MCFG_MSX_LAYOUT_DISK1("disk", 3, 2, 1, 1, "maincpu", 0xc000)
|
||||
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x28000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
|
||||
|
||||
MCFG_MSX_S1985_ADD("s1985")
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
@ -5692,6 +5708,8 @@ static MACHINE_CONFIG_DERIVED( hbf1xv, msx2p )
|
||||
MCFG_MSX_LAYOUT_DISK1("disk", 3, 2, 1, 1, "maincpu", 0xc000)
|
||||
MCFG_MSX_LAYOUT_MUSIC("mus", 3, 3, 1, 1, "maincpu", 0x28000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
|
||||
|
||||
MCFG_MSX_S1985_ADD("s1985")
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
@ -5726,6 +5744,8 @@ static MACHINE_CONFIG_DERIVED( hbf9sp, msx2p )
|
||||
MCFG_MSX_LAYOUT_ROM("firm2", 3, 1, 1, 2, "maincpu", 0x24000)
|
||||
MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 2, 0x10000) /* 64KB?? Mapper RAM */
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx2_cartlist )
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
@ -5761,6 +5781,8 @@ static MACHINE_CONFIG_DERIVED( fsa1gt, msx2 )
|
||||
MCFG_MSX_LAYOUT_DISK4("dos", 3, 2, 1, 3, "maincpu", 0x20000)
|
||||
MCFG_MSX_LAYOUT_ROM("firm", 3, 3, 0, 4, "maincpu", 0x80000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
@ -5801,6 +5823,8 @@ static MACHINE_CONFIG_DERIVED( fsa1st, msx2 )
|
||||
MCFG_MSX_LAYOUT_DISK4("dos", 3, 2, 1, 3, "maincpu", 0x20000)
|
||||
MCFG_MSX_LAYOUT_ROM("firm", 3, 3, 0, 4, "maincpu", 0x80000)
|
||||
|
||||
MCFG_MSX_SYSTEMFLAGS_ADD("sysflags", 0x00)
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_ym2413 )
|
||||
|
||||
MCFG_FRAGMENT_ADD( msx_tc8566af )
|
||||
|
39
src/mess/machine/msx_systemflags.c
Normal file
39
src/mess/machine/msx_systemflags.c
Normal file
@ -0,0 +1,39 @@
|
||||
#include "emu.h"
|
||||
#include "msx_systemflags.h"
|
||||
|
||||
|
||||
const device_type MSX_SYSTEMFLAGS = &device_creator<msx_systemflags_device>;
|
||||
|
||||
|
||||
msx_systemflags_device::msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, MSX_SYSTEMFLAGS, "MSX System Flags", tag, owner, clock, "msx_systemflags", __FILE__)
|
||||
, m_initial_value(0xff)
|
||||
, m_system_flags(0xff)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void msx_systemflags_device::device_start()
|
||||
{
|
||||
m_system_flags = m_initial_value;
|
||||
|
||||
save_item(NAME(m_system_flags));
|
||||
|
||||
// Install IO read/write handlers
|
||||
address_space &space = machine().device<cpu_device>("maincpu")->space(AS_IO);
|
||||
space.install_write_handler(0xf4, 0xf4, write8_delegate(FUNC(msx_systemflags_device::write), this));
|
||||
space.install_read_handler(0xf4, 0xf4, read8_delegate(FUNC(msx_systemflags_device::read), this));
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(msx_systemflags_device::read)
|
||||
{
|
||||
return m_system_flags;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(msx_systemflags_device::write)
|
||||
{
|
||||
m_system_flags = data;
|
||||
}
|
||||
|
38
src/mess/machine/msx_systemflags.h
Normal file
38
src/mess/machine/msx_systemflags.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef __MSX_SYSTEMFLAGS_H
|
||||
#define __MSX_SYSTEMFLAGS_H
|
||||
|
||||
/*
|
||||
Some MSX2+ and TurboR machines have a 'system flags' I/O port ($F4).
|
||||
The value in this register is cleared on power up, but it keeps it's
|
||||
value during a reset of the system.
|
||||
*/
|
||||
|
||||
extern const device_type MSX_SYSTEMFLAGS;
|
||||
|
||||
|
||||
#define MCFG_MSX_SYSTEMFLAGS_ADD(_tag, _initial_value) \
|
||||
MCFG_DEVICE_ADD(_tag, MSX_SYSTEMFLAGS, 0) \
|
||||
msx_systemflags_device::set_initial_value(*device, _initial_value);
|
||||
|
||||
|
||||
class msx_systemflags_device : public device_t
|
||||
{
|
||||
public:
|
||||
msx_systemflags_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// static configuration helpers
|
||||
static void set_initial_value(device_t &device, UINT8 initial_value) { dynamic_cast<msx_systemflags_device &>(device).m_initial_value = initial_value; }
|
||||
|
||||
DECLARE_READ8_MEMBER(read);
|
||||
DECLARE_WRITE8_MEMBER(write);
|
||||
|
||||
protected:
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
UINT8 m_initial_value;
|
||||
UINT8 m_system_flags;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1005,6 +1005,7 @@ $(MESSOBJ)/ascii.a: \
|
||||
$(MESS_MACHINE)/msx_switched.o \
|
||||
$(MESS_MACHINE)/msx_matsushita.o \
|
||||
$(MESS_MACHINE)/msx_s1985.o \
|
||||
$(MESS_MACHINE)/msx_systemflags.o \
|
||||
|
||||
$(MESSOBJ)/at.a: \
|
||||
$(MESS_MACHINE)/at.o \
|
||||
|
Loading…
Reference in New Issue
Block a user