summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2021-09-25 16:00:29 +0200
committer GitHub <noreply@github.com>2021-09-25 16:00:29 +0200
commitec33fac7c77e3f9654d83c15f7c03f1cef79ad34 (patch)
treee19da19abfe0ceddcc3550f3464b420f4fc72aa0 /src/mame/includes
parente2331a7eed73fd6fec837378ac7a47db9388ed18 (diff)
Add floppy support to NEC PC-8001 (#8532)
New clones marked as NOT_WORKING -------------------------------- PC-8001mkIISR [anonymous] * Generate a new pc8001_flop.xml list, based off Neo Kobe dumps; * Move several items from pc8801_flop.xml to the new pc8001_flop.xml; * Generate new lists for pc8001mk2_flop.xml and pc8001mk2sr_flop.xml; * Hook aforementioned lists where they belongs ( i.e. N-Basic list is now shared between pc8801.cpp and pc8001.cpp, N80 list belongs to pc8001mk2 and pc8001mk2sr, N80SR list belongs to pc8001mk2sr alone) * upd3301.cpp: fix scrolling glitch when unthrottled * pc8001.cpp: fix machine configs inheritance * pc8001.cpp: constexpr the XTALs * pc8001.cpp: allow to enter into N80 BASIC mode for mk2 machines * Ported pc80s31k to device interface, and hooked it up to pc8001 * Fix validation errors * Misc documentation updates * uPD3301.cpp: implement bulk of attribute fields * upd3301: fix olyboss compile and crashing, add rvv signal * upd3301.cpp: fix last value of attribute row (7narabe), fix graphic mode when in width 40 (15puzzle) * upd3301.cpp: consider an attribute end of 0 equal to max size, fixes starfire * upd3301.cpp: rvv is definitely a global reverse rather than acting on palette for PC8001, document flgworld attribute weirdness (double somersault) * pc8001_flop.xml: QA selected SW * pc80s31k.cpp: split into PC80S31 (2d) and PC80S31K (2d/2dd/2hd) devices, rearrange disk bioses * pc8801.cpp: inherit pc80s31k device and kill off FDC legacy code * pc80s31k.cpp: documentation updates * pc8001_flop: move Magic Copy and a alt versions of ay1 and 4d house in here * pc98.xml: move daivacal from PC88 since it really belongs here * pc8801_flop.xml: major QA testing on suspicious floppy activities * pc8801.cpp: remove logging of High [TV]RAM * pc8801_flop.xml: fix rogue extra comment closing * pc80s31k.cpp: mailbox the PPI ports, fix barbatus booting; pc80s31k.cpp: allow filemst to boot, and add note about its unemulated extended HW; * upd3301.cpp: convert AT1/AT0/SC to an aggregate variable * upd3301.cpp: convert attribute fetch to be a client delegate * pc8001.cpp: move some shared functions to pc8001_base_state * pc8001.cpp: add DMA functions * pc8001.cpp: add extension setter for 24KHz mode (which will be used by PC-8801 once implementation is merged) * pc8801_flop.xml: fix description duplicate * Bulk replace pc8*_flop.xml capitalized Alt into lowercase * pc80s31k.cpp: add space.unmap() for terminal_count_r, reorder headers, make constructor trampoline protected * Standardize Daiva titles across XMLs * pc8801_cass.xml: revert of software name t[ape] postfixes * pc8801_flop.xml: more identification of N/V1 BASIC SWs
Diffstat (limited to 'src/mame/includes')
-rw-r--r--src/mame/includes/pc8001.h147
-rw-r--r--src/mame/includes/pc8801.h37
2 files changed, 123 insertions, 61 deletions
diff --git a/src/mame/includes/pc8001.h b/src/mame/includes/pc8001.h
index 12002ed8dcd..6a68ab80321 100644
--- a/src/mame/includes/pc8001.h
+++ b/src/mame/includes/pc8001.h
@@ -1,11 +1,11 @@
// license:BSD-3-Clause
-// copyright-holders:Curt Coder
+// copyright-holders:Curt Coder, Angelo Salese
+
#pragma once
#ifndef MAME_INCLUDES_PC8001_H
#define MAME_INCLUDES_PC8001_H
-
#include "cpu/z80/z80.h"
#include "imagedev/cassette.h"
#include "machine/buffer.h"
@@ -15,86 +15,151 @@
#include "machine/i8251.h"
#include "machine/ram.h"
#include "machine/upd1990a.h"
+#include "machine/pc80s31k.h"
#include "sound/beep.h"
#include "video/upd3301.h"
+#include "emupal.h"
+#include "screen.h"
#define Z80_TAG "z80"
+#define N80SR_ROM_TAG "n80sr_rom"
#define I8251_TAG "i8251"
-#define I8255A_TAG "i8255"
#define I8257_TAG "i8257"
#define UPD1990A_TAG "upd1990a"
#define UPD3301_TAG "upd3301"
+#define CGROM_TAG "cgrom"
#define CENTRONICS_TAG "centronics"
-#define SCREEN_TAG "screen"
-class pc8001_state : public driver_device
+class pc8001_base_state : public driver_device
{
public:
- pc8001_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, Z80_TAG),
- m_rtc(*this, UPD1990A_TAG),
- m_dma(*this, I8257_TAG),
- m_crtc(*this, UPD3301_TAG),
- m_cassette(*this, "cassette"),
- m_centronics(*this, CENTRONICS_TAG),
- m_cent_data_out(*this, "cent_data_out"),
- m_beep(*this, "beeper"),
- m_ram(*this, RAM_TAG),
- m_rom(*this, Z80_TAG),
- m_char_rom(*this, UPD3301_TAG)
- { }
+ pc8001_base_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, Z80_TAG)
+ , m_crtc(*this, UPD3301_TAG)
+ , m_crtc_palette(*this, "crtc_palette")
+ , m_dma(*this, I8257_TAG)
+ , m_cassette(*this, "cassette")
+ , m_cgrom(*this, CGROM_TAG)
+ {}
+protected:
required_device<cpu_device> m_maincpu;
- required_device<upd1990a_device> m_rtc;
- required_device<i8257_device> m_dma;
required_device<upd3301_device> m_crtc;
+ required_device<palette_device> m_crtc_palette;
+ required_device<i8257_device> m_dma;
required_device<cassette_image_device> m_cassette;
- required_device<centronics_device> m_centronics;
- required_device<output_latch_device> m_cent_data_out;
- required_device<beep_device> m_beep;
- required_device<ram_device> m_ram;
- required_memory_region m_rom;
- required_memory_region m_char_rom;
+ required_memory_region m_cgrom;
+ void port30_w(u8 data);
virtual void machine_start() override;
+ void set_screen_frequency(bool is_24KHz) { m_screen_is_24KHz = is_24KHz; };
- void port10_w(uint8_t data);
- void port30_w(uint8_t data);
- uint8_t port40_r();
- void port40_w(uint8_t data);
+ DECLARE_WRITE_LINE_MEMBER( crtc_reverse_w );
+ UPD3301_DRAW_CHARACTER_MEMBER( draw_text );
+ UPD3301_FETCH_ATTRIBUTE( attr_fetch );
DECLARE_WRITE_LINE_MEMBER( hrq_w );
uint8_t dma_mem_r(offs_t offset);
+private:
+ bool m_screen_reverse;
+ bool m_screen_is_24KHz;
+
/* video state */
int m_width80;
int m_color;
+};
+
+class pc8001_state : public pc8001_base_state
+{
+public:
+ pc8001_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pc8001_base_state(mconfig, type, tag)
+ , m_pc80s31(*this, "pc80s31")
+ , m_rtc(*this, UPD1990A_TAG)
+ , m_screen(*this, "screen")
+ , m_centronics(*this, CENTRONICS_TAG)
+ , m_cent_data_out(*this, "cent_data_out")
+ , m_beep(*this, "beeper")
+ , m_ram(*this, RAM_TAG)
+ , m_rom(*this, Z80_TAG)
+ { }
+
+ void pc8001(machine_config &config);
+
+protected:
+ void pc8001_io(address_map &map);
+ void pc8001_map(address_map &map);
+
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ required_device<pc80s31_device> m_pc80s31;
+ required_device<upd1990a_device> m_rtc;
+ required_device<screen_device> m_screen;
+ required_device<centronics_device> m_centronics;
+ required_device<output_latch_device> m_cent_data_out;
+ required_device<beep_device> m_beep;
+ required_device<ram_device> m_ram;
+ required_memory_region m_rom;
+
+private:
+ void port10_w(uint8_t data);
+ uint8_t port40_r();
+ void port40_w(uint8_t data);
int m_centronics_busy;
int m_centronics_ack;
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
DECLARE_WRITE_LINE_MEMBER(write_centronics_ack);
- UPD3301_DRAW_CHARACTER_MEMBER( pc8001_display_pixels );
- void pc8001(machine_config &config);
- void pc8001_io(address_map &map);
- void pc8001_mem(address_map &map);
};
class pc8001mk2_state : public pc8001_state
{
public:
pc8001mk2_state(const machine_config &mconfig, device_type type, const char *tag)
- : pc8001_state(mconfig, type, tag),
- m_kanji_rom(*this, "kanji")
+ : pc8001_state(mconfig, type, tag)
+ , m_kanji_rom(*this, "kanji")
+ , m_dsw(*this, "DSW%d", 1U)
{ }
- required_memory_region m_kanji_rom;
-
- void port31_w(uint8_t data);
void pc8001mk2(machine_config &config);
+
+protected:
void pc8001mk2_io(address_map &map);
- void pc8001mk2_mem(address_map &map);
+ void pc8001mk2_map(address_map &map);
+
+ required_memory_region m_kanji_rom;
+ required_ioport_array<2> m_dsw;
+private:
+ void port31_w(uint8_t data);
+};
+
+class pc8001mk2sr_state : public pc8001mk2_state
+{
+public:
+ pc8001mk2sr_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pc8001mk2_state(mconfig, type, tag)
+ , m_n80sr_rom(*this, N80SR_ROM_TAG)
+ { }
+
+ void pc8001mk2sr(machine_config &config);
+
+private:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+ void pc8001mk2sr_io(address_map &map);
+
+ required_memory_region m_n80sr_rom;
+
+ void port33_w(u8 data);
+ u8 port71_r();
+ void port71_w(u8 data);
+
+ u8 m_n80sr_bank;
};
#endif
diff --git a/src/mame/includes/pc8801.h b/src/mame/includes/pc8801.h
index 5365f1d6094..5b76aeb2945 100644
--- a/src/mame/includes/pc8801.h
+++ b/src/mame/includes/pc8801.h
@@ -5,12 +5,12 @@
PC-8801 (c) 1981 NEC
********************************************************************************************/
+
#ifndef MAME_INCLUDES_PC8801_H
#define MAME_INCLUDES_PC8801_H
#pragma once
-
#include "cpu/z80/z80.h"
#include "bus/centronics/ctronics.h"
#include "imagedev/cassette.h"
@@ -20,7 +20,7 @@
#include "machine/i8255.h"
#include "machine/timer.h"
#include "machine/upd1990a.h"
-#include "machine/upd765.h"
+#include "machine/pc80s31k.h"
#include "sound/beep.h"
#include "sound/ymopn.h"
#include "emupal.h"
@@ -41,9 +41,7 @@ public:
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_screen(*this, "screen")
- , m_fdccpu(*this, "fdccpu")
- , m_fdc(*this, "upd765")
- , m_fdd(*this, "upd765:%u", 0U)
+ , m_pc80s31(*this, "pc80s31")
, m_pic(*this, I8214_TAG)
, m_rtc(*this, UPD1990A_TAG)
, m_cassette(*this, "cassette")
@@ -53,16 +51,28 @@ public:
, m_palette(*this, "palette")
{ }
- void pc8801mc(machine_config &config);
- void pc8801fh(machine_config &config);
void pc8801(machine_config &config);
+ void pc8801mk2mr(machine_config &config);
+ void pc8801fh(machine_config &config);
void pc8801ma(machine_config &config);
+ void pc8801mc(machine_config &config);
protected:
virtual void video_start() override;
virtual void machine_start() override;
virtual void machine_reset() override;
+ required_device<cpu_device> m_maincpu;
+ required_device<screen_device> m_screen;
+ required_device<pc80s31_device> m_pc80s31;
+ optional_device<i8214_device> m_pic;
+ required_device<upd1990a_device> m_rtc;
+ required_device<cassette_image_device> m_cassette;
+ required_device<beep_device> m_beeper;
+ required_device<ym2608_device> m_opna;
+ required_device<ym2203_device> m_opn;
+ required_device<palette_device> m_palette;
+
private:
struct crtc_t
{
@@ -78,19 +88,6 @@ private:
attotime time;
};
- required_device<cpu_device> m_maincpu;
- required_device<screen_device> m_screen;
- required_device<cpu_device> m_fdccpu;
- required_device<upd765a_device> m_fdc;
- required_device_array<floppy_connector, 2> m_fdd;
- optional_device<i8214_device> m_pic;
- required_device<upd1990a_device> m_rtc;
- required_device<cassette_image_device> m_cassette;
- required_device<beep_device> m_beeper;
- required_device<ym2608_device> m_opna;
- required_device<ym2203_device> m_opn;
- required_device<palette_device> m_palette;
-
std::unique_ptr<uint8_t[]> m_work_ram;
std::unique_ptr<uint8_t[]> m_hi_work_ram;
std::unique_ptr<uint8_t[]> m_ext_work_ram;