summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/includes
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2012-08-21 10:41:19 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2012-08-21 10:41:19 +0000
commit7285b359d259b2ae0fdf85096571c386ec8c991a (patch)
treea027aff57f1a255f9ec6cfd3b68cabe4b6683998 /src/mess/includes
parent67c425e90757876a6716b7867df30c0149912e74 (diff)
Merge of MESS sources (no whatsnew)
Diffstat (limited to 'src/mess/includes')
-rw-r--r--src/mess/includes/a7800.h89
-rw-r--r--src/mess/includes/abc1600.h264
-rw-r--r--src/mess/includes/abc80.h155
-rw-r--r--src/mess/includes/abc80x.h335
-rw-r--r--src/mess/includes/ac1.h39
-rw-r--r--src/mess/includes/ace.h62
-rw-r--r--src/mess/includes/adam.h131
-rw-r--r--src/mess/includes/advision.h73
-rw-r--r--src/mess/includes/aim65.h73
-rw-r--r--src/mess/includes/aim65_40.h25
-rw-r--r--src/mess/includes/amstr_pc.h35
-rw-r--r--src/mess/includes/amstrad.h214
-rw-r--r--src/mess/includes/apollo.h325
-rw-r--r--src/mess/includes/apple1.h75
-rw-r--r--src/mess/includes/apple2.h287
-rw-r--r--src/mess/includes/apple2gs.h156
-rw-r--r--src/mess/includes/apple3.h82
-rw-r--r--src/mess/includes/apricotf.h83
-rw-r--r--src/mess/includes/apricotp.h110
-rw-r--r--src/mess/includes/aquarius.h46
-rw-r--r--src/mess/includes/arcadia.h90
-rw-r--r--src/mess/includes/at.h195
-rw-r--r--src/mess/includes/atarist.h394
-rw-r--r--src/mess/includes/atom.h104
-rw-r--r--src/mess/includes/avigo.h115
-rw-r--r--src/mess/includes/b2m.h68
-rw-r--r--src/mess/includes/bbc.h332
-rw-r--r--src/mess/includes/bebox.h83
-rw-r--r--src/mess/includes/beta.h54
-rw-r--r--src/mess/includes/bk.h51
-rw-r--r--src/mess/includes/bullet.h137
-rw-r--r--src/mess/includes/busicom.h38
-rw-r--r--src/mess/includes/bw12.h94
-rw-r--r--src/mess/includes/bw2.h98
-rw-r--r--src/mess/includes/c128.h109
-rw-r--r--src/mess/includes/c16.h83
-rw-r--r--src/mess/includes/c64.h183
-rw-r--r--src/mess/includes/c64_legacy.h128
-rw-r--r--src/mess/includes/c65.h88
-rw-r--r--src/mess/includes/c80.h49
-rw-r--r--src/mess/includes/cbm.h34
-rw-r--r--src/mess/includes/cbmb.h108
-rw-r--r--src/mess/includes/cgc7900.h96
-rw-r--r--src/mess/includes/cgenie.h134
-rw-r--r--src/mess/includes/channelf.h68
-rw-r--r--src/mess/includes/coco.h262
-rw-r--r--src/mess/includes/coco12.h62
-rw-r--r--src/mess/includes/coco3.h63
-rw-r--r--src/mess/includes/coleco.h48
-rw-r--r--src/mess/includes/compis.h202
-rw-r--r--src/mess/includes/comquest.h34
-rw-r--r--src/mess/includes/comx35.h110
-rw-r--r--src/mess/includes/concept.h70
-rw-r--r--src/mess/includes/corvushd.h182
-rw-r--r--src/mess/includes/cosmicos.h126
-rw-r--r--src/mess/includes/crvision.h97
-rw-r--r--src/mess/includes/cxhumax.h264
-rw-r--r--src/mess/includes/cybiko.h100
-rw-r--r--src/mess/includes/dai.h105
-rw-r--r--src/mess/includes/dgn_beta.h177
-rw-r--r--src/mess/includes/dgnalpha.h82
-rw-r--r--src/mess/includes/dm7000.h80
-rw-r--r--src/mess/includes/dragon.h62
-rw-r--r--src/mess/includes/einstein.h143
-rw-r--r--src/mess/includes/electron.h90
-rw-r--r--src/mess/includes/elf.h64
-rw-r--r--src/mess/includes/enterp.h41
-rw-r--r--src/mess/includes/eti660.h66
-rw-r--r--src/mess/includes/europc.h152
-rw-r--r--src/mess/includes/exp85.h39
-rw-r--r--src/mess/includes/fidelz80.h69
-rw-r--r--src/mess/includes/fm7.h255
-rw-r--r--src/mess/includes/fmtowns.h295
-rw-r--r--src/mess/includes/galaxy.h51
-rw-r--r--src/mess/includes/galeb.h30
-rw-r--r--src/mess/includes/gamecom.h261
-rw-r--r--src/mess/includes/gamepock.h41
-rw-r--r--src/mess/includes/gb.h288
-rw-r--r--src/mess/includes/gba.h246
-rw-r--r--src/mess/includes/genpc.h142
-rw-r--r--src/mess/includes/gmaster.h42
-rw-r--r--src/mess/includes/gp32.h167
-rw-r--r--src/mess/includes/hec2hrp.h180
-rw-r--r--src/mess/includes/hp48.h195
-rw-r--r--src/mess/includes/huebler.h49
-rw-r--r--src/mess/includes/intv.h156
-rw-r--r--src/mess/includes/irisha.h64
-rw-r--r--src/mess/includes/jtc.h88
-rw-r--r--src/mess/includes/jupiter.h57
-rw-r--r--src/mess/includes/kaypro.h109
-rw-r--r--src/mess/includes/kc.h191
-rw-r--r--src/mess/includes/kramermc.h37
-rw-r--r--src/mess/includes/kyocera.h208
-rw-r--r--src/mess/includes/lc80.h58
-rw-r--r--src/mess/includes/lisa.h185
-rw-r--r--src/mess/includes/llc.h73
-rw-r--r--src/mess/includes/lviv.h47
-rw-r--r--src/mess/includes/lynx.h271
-rw-r--r--src/mess/includes/m5.h75
-rw-r--r--src/mess/includes/mac.h483
-rw-r--r--src/mess/includes/macpci.h164
-rw-r--r--src/mess/includes/mbc55x.h228
-rw-r--r--src/mess/includes/mbee.h167
-rw-r--r--src/mess/includes/mc1000.h84
-rw-r--r--src/mess/includes/mc68328.h175
-rw-r--r--src/mess/includes/mc80.h85
-rw-r--r--src/mess/includes/micronic.h65
-rw-r--r--src/mess/includes/microtan.h75
-rw-r--r--src/mess/includes/mikro80.h48
-rw-r--r--src/mess/includes/mikromik.h123
-rw-r--r--src/mess/includes/mpf1.h60
-rw-r--r--src/mess/includes/mpz80.h103
-rw-r--r--src/mess/includes/msbc1.h20
-rw-r--r--src/mess/includes/msx.h149
-rw-r--r--src/mess/includes/msx_slot.h258
-rw-r--r--src/mess/includes/mtx.h82
-rw-r--r--src/mess/includes/mz700.h106
-rw-r--r--src/mess/includes/mz80.h75
-rw-r--r--src/mess/includes/nascom1.h75
-rw-r--r--src/mess/includes/nc.h103
-rw-r--r--src/mess/includes/nes.h287
-rw-r--r--src/mess/includes/newbrain.h226
-rw-r--r--src/mess/includes/next.h187
-rw-r--r--src/mess/includes/ob68k1a.h46
-rw-r--r--src/mess/includes/odyssey2.h147
-rw-r--r--src/mess/includes/ondra.h36
-rw-r--r--src/mess/includes/orao.h41
-rw-r--r--src/mess/includes/oric.h128
-rw-r--r--src/mess/includes/orion.h82
-rw-r--r--src/mess/includes/osborne1.h113
-rw-r--r--src/mess/includes/osi.h122
-rw-r--r--src/mess/includes/p2000t.h56
-rw-r--r--src/mess/includes/partner.h38
-rw-r--r--src/mess/includes/pc.h135
-rw-r--r--src/mess/includes/pc1251.h53
-rw-r--r--src/mess/includes/pc1350.h52
-rw-r--r--src/mess/includes/pc1401.h52
-rw-r--r--src/mess/includes/pc1403.h60
-rw-r--r--src/mess/includes/pc1512.h259
-rw-r--r--src/mess/includes/pc4.h67
-rw-r--r--src/mess/includes/pc8001.h82
-rw-r--r--src/mess/includes/pc8401a.h100
-rw-r--r--src/mess/includes/pce.h156
-rw-r--r--src/mess/includes/pcw.h109
-rw-r--r--src/mess/includes/pcw16.h108
-rw-r--r--src/mess/includes/pdp1.h273
-rw-r--r--src/mess/includes/pecom.h52
-rw-r--r--src/mess/includes/pes.h45
-rw-r--r--src/mess/includes/pet.h87
-rw-r--r--src/mess/includes/phc25.h54
-rw-r--r--src/mess/includes/pk8020.h61
-rw-r--r--src/mess/includes/plus4.h113
-rw-r--r--src/mess/includes/pmd85.h60
-rw-r--r--src/mess/includes/pocketc.h23
-rw-r--r--src/mess/includes/pokemini.h77
-rw-r--r--src/mess/includes/poly88.h53
-rw-r--r--src/mess/includes/poly880.h51
-rw-r--r--src/mess/includes/portfoli.h89
-rw-r--r--src/mess/includes/pp01.h46
-rw-r--r--src/mess/includes/primo.h51
-rw-r--r--src/mess/includes/prof180x.h39
-rw-r--r--src/mess/includes/prof80.h92
-rw-r--r--src/mess/includes/ps2.h17
-rw-r--r--src/mess/includes/psion.h92
-rw-r--r--src/mess/includes/px8.h82
-rw-r--r--src/mess/includes/ql.h138
-rw-r--r--src/mess/includes/radio86.h82
-rw-r--r--src/mess/includes/rm380z.h129
-rw-r--r--src/mess/includes/rmnimbus.h449
-rw-r--r--src/mess/includes/sage2.h88
-rw-r--r--src/mess/includes/samcoupe.h104
-rw-r--r--src/mess/includes/sapi1.h57
-rw-r--r--src/mess/includes/sg1000.h122
-rw-r--r--src/mess/includes/sms.h215
-rw-r--r--src/mess/includes/sorcerer.h99
-rw-r--r--src/mess/includes/special.h122
-rw-r--r--src/mess/includes/spectrum.h171
-rw-r--r--src/mess/includes/ssystem3.h64
-rw-r--r--src/mess/includes/studio2.h92
-rw-r--r--src/mess/includes/super6.h82
-rw-r--r--src/mess/includes/super80.h101
-rw-r--r--src/mess/includes/svi318.h99
-rw-r--r--src/mess/includes/svision.h71
-rw-r--r--src/mess/includes/sym1.h62
-rw-r--r--src/mess/includes/tandy1t.h28
-rw-r--r--src/mess/includes/tandy2k.h141
-rw-r--r--src/mess/includes/tdv2324.h86
-rw-r--r--src/mess/includes/tek405x.h146
-rw-r--r--src/mess/includes/thomson.h394
-rw-r--r--src/mess/includes/ti85.h121
-rw-r--r--src/mess/includes/ti89.h66
-rw-r--r--src/mess/includes/tiki100.h84
-rw-r--r--src/mess/includes/tmc1800.h177
-rw-r--r--src/mess/includes/tmc2000e.h71
-rw-r--r--src/mess/includes/tmc600.h75
-rw-r--r--src/mess/includes/trs80.h145
-rw-r--r--src/mess/includes/trs80m2.h137
-rw-r--r--src/mess/includes/tsispch.h49
-rw-r--r--src/mess/includes/tvc.h137
-rw-r--r--src/mess/includes/tx0.h277
-rw-r--r--src/mess/includes/ut88.h65
-rw-r--r--src/mess/includes/v1050.h167
-rw-r--r--src/mess/includes/vc4000.h113
-rw-r--r--src/mess/includes/vcs80.h41
-rw-r--r--src/mess/includes/vector06.h82
-rw-r--r--src/mess/includes/vic10.h84
-rw-r--r--src/mess/includes/vic20.h96
-rw-r--r--src/mess/includes/victor9k.h130
-rw-r--r--src/mess/includes/vidbrain.h87
-rw-r--r--src/mess/includes/vip.h113
-rw-r--r--src/mess/includes/vixen.h109
-rw-r--r--src/mess/includes/vtech2.h72
-rw-r--r--src/mess/includes/wangpc.h200
-rw-r--r--src/mess/includes/wswan.h178
-rw-r--r--src/mess/includes/x07.h262
-rw-r--r--src/mess/includes/x1.h221
-rw-r--r--src/mess/includes/x68k.h298
-rw-r--r--src/mess/includes/xerox820.h106
-rw-r--r--src/mess/includes/xor100.h71
-rw-r--r--src/mess/includes/z80ne.h122
-rw-r--r--src/mess/includes/z88.h96
-rw-r--r--src/mess/includes/zx.h75
222 files changed, 26439 insertions, 0 deletions
diff --git a/src/mess/includes/a7800.h b/src/mess/includes/a7800.h
new file mode 100644
index 00000000000..903a5f47463
--- /dev/null
+++ b/src/mess/includes/a7800.h
@@ -0,0 +1,89 @@
+/*****************************************************************************
+ *
+ * includes/a7800.h
+ *
+ ****************************************************************************/
+
+#ifndef A7800_H_
+#define A7800_H_
+
+#include "machine/6532riot.h"
+
+class a7800_state : public driver_device
+{
+public:
+ a7800_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this,"maincpu")
+ { }
+
+ int m_lines;
+ int m_ispal;
+ unsigned char *m_cart_bkup;
+ unsigned char *m_bios_bkup;
+ int m_ctrl_lock;
+ int m_ctrl_reg;
+ int m_maria_flag;
+ unsigned char *m_cartridge_rom;
+ UINT16 m_cart_type;
+ UINT32 m_cart_size;
+ unsigned char m_stick_type;
+ UINT8 *m_ROM;
+ int m_maria_palette[8][4];
+ int m_maria_write_mode;
+ int m_maria_scanline;
+ unsigned int m_maria_dll;
+ unsigned int m_maria_dl;
+ int m_maria_holey;
+ int m_maria_offset;
+ int m_maria_vblank;
+ int m_maria_dli;
+ int m_maria_dmaon;
+ int m_maria_dodma;
+ int m_maria_wsync;
+ int m_maria_backcolor;
+ int m_maria_color_kill;
+ int m_maria_cwidth;
+ int m_maria_bcntl;
+ int m_maria_kangaroo;
+ int m_maria_rm;
+ unsigned int m_maria_charbase;
+ bitmap_ind16 m_bitmap;
+ int m_p1_one_button;
+ int m_p2_one_button;
+
+ required_device<cpu_device> m_maincpu;
+ DECLARE_WRITE8_MEMBER(a7800_RAM0_w);
+ DECLARE_WRITE8_MEMBER(a7800_cart_w);
+ DECLARE_READ8_MEMBER(a7800_TIA_r);
+ DECLARE_WRITE8_MEMBER(a7800_TIA_w);
+ DECLARE_READ8_MEMBER(a7800_MARIA_r);
+ DECLARE_WRITE8_MEMBER(a7800_MARIA_w);
+ DECLARE_DRIVER_INIT(a7800_pal);
+ DECLARE_DRIVER_INIT(a7800_ntsc);
+};
+
+
+/*----------- defined in video/a7800.c -----------*/
+
+VIDEO_START( a7800 );
+SCREEN_UPDATE_IND16( a7800 );
+TIMER_DEVICE_CALLBACK( a7800_interrupt );
+
+
+/*----------- defined in machine/a7800.c -----------*/
+
+extern const riot6532_interface a7800_r6532_interface;
+
+
+MACHINE_RESET( a7800 );
+
+void a7800_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions);
+
+DEVICE_START( a7800_cart );
+DEVICE_IMAGE_LOAD( a7800_cart );
+
+
+
+
+#endif /* A7800_H_ */
diff --git a/src/mess/includes/abc1600.h b/src/mess/includes/abc1600.h
new file mode 100644
index 00000000000..948515487fe
--- /dev/null
+++ b/src/mess/includes/abc1600.h
@@ -0,0 +1,264 @@
+#pragma once
+
+#ifndef __ABC1600__
+#define __ABC1600__
+
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/harddriv.h"
+#include "machine/ram.h"
+#include "machine/8530scc.h"
+#include "machine/abc99.h"
+#include "machine/abc1600_bus.h"
+#include "machine/e0516.h"
+#include "machine/lux4105.h"
+#include "machine/nmc9306.h"
+#include "machine/scsihd.h"
+#include "machine/s1410.h"
+#include "machine/wd17xx.h"
+#include "machine/z80dart.h"
+#include "machine/z80dma.h"
+#include "machine/z8536.h"
+#include "video/mc6845.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define MC68008P8_TAG "3f"
+#define Z8410AB1_0_TAG "5g"
+#define Z8410AB1_1_TAG "7g"
+#define Z8410AB1_2_TAG "9g"
+#define Z8470AB1_TAG "17b"
+#define Z8530B1_TAG "2a"
+#define Z8536B1_TAG "15b"
+#define SAB1797_02P_TAG "5a"
+#define FDC9229BT_TAG "7a"
+#define E050_C16PC_TAG "13b"
+#define NMC9306_TAG "14c"
+#define SY6845E_TAG "sy6845e"
+#define SCREEN_TAG "screen"
+#define BUS0I_TAG "bus0i"
+#define BUS0X_TAG "bus0x"
+#define BUS1_TAG "bus1"
+#define BUS2_TAG "bus2"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> abc1600_state
+class abc1600_state : public driver_device
+{
+public:
+ abc1600_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, MC68008P8_TAG),
+ m_dma0(*this, Z8410AB1_0_TAG),
+ m_dma1(*this, Z8410AB1_1_TAG),
+ m_dma2(*this, Z8410AB1_2_TAG),
+ m_dart(*this, Z8470AB1_TAG),
+ m_scc(*this, Z8530B1_TAG),
+ m_cio(*this, Z8536B1_TAG),
+ m_fdc(*this, SAB1797_02P_TAG),
+ m_rtc(*this, E050_C16PC_TAG),
+ m_nvram(*this, NMC9306_TAG),
+ m_crtc(*this, SY6845E_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy(*this, FLOPPY_0),
+ m_bus0i(*this, BUS0I_TAG),
+ m_bus0x(*this, BUS0X_TAG),
+ m_bus1(*this, BUS1_TAG),
+ m_bus2(*this, BUS2_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80dma_device> m_dma0;
+ required_device<z80dma_device> m_dma1;
+ required_device<z80dma_device> m_dma2;
+ required_device<z80dart_device> m_dart;
+ required_device<scc8530_t> m_scc;
+ required_device<z8536_device> m_cio;
+ required_device<device_t> m_fdc;
+ required_device<e0516_device> m_rtc;
+ required_device<nmc9306_device> m_nvram;
+ required_device<mc6845_device> m_crtc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy;
+ required_device<abc1600bus_slot_device> m_bus0i;
+ required_device<abc1600bus_slot_device> m_bus0x;
+ required_device<abc1600bus_slot_device> m_bus1;
+ required_device<abc1600bus_slot_device> m_bus2;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( mac_r );
+ DECLARE_WRITE8_MEMBER( mac_w );
+ DECLARE_READ8_MEMBER( cause_r );
+ DECLARE_WRITE8_MEMBER( task_w );
+ DECLARE_READ8_MEMBER( segment_r );
+ DECLARE_WRITE8_MEMBER( segment_w );
+ DECLARE_READ8_MEMBER( page_r );
+ DECLARE_WRITE8_MEMBER( page_w );
+ DECLARE_WRITE8_MEMBER( fw0_w );
+ DECLARE_WRITE8_MEMBER( fw1_w );
+ DECLARE_WRITE8_MEMBER( spec_contr_reg_w );
+
+ DECLARE_WRITE8_MEMBER( dmamap_w );
+ DECLARE_WRITE_LINE_MEMBER( dbrq_w );
+ DECLARE_WRITE_LINE_MEMBER( drq_w );
+ DECLARE_READ8_MEMBER( dma0_mreq_r );
+ DECLARE_WRITE8_MEMBER( dma0_mreq_w );
+ DECLARE_READ8_MEMBER( dma0_iorq_r );
+ DECLARE_WRITE8_MEMBER( dma0_iorq_w );
+ DECLARE_READ8_MEMBER( dma1_mreq_r );
+ DECLARE_WRITE8_MEMBER( dma1_mreq_w );
+ DECLARE_READ8_MEMBER( dma1_iorq_r );
+ DECLARE_WRITE8_MEMBER( dma1_iorq_w );
+ DECLARE_READ8_MEMBER( dma2_mreq_r );
+ DECLARE_WRITE8_MEMBER( dma2_mreq_w );
+ DECLARE_READ8_MEMBER( dma2_iorq_r );
+ DECLARE_WRITE8_MEMBER( dma2_iorq_w );
+
+ DECLARE_READ8_MEMBER( video_ram_r );
+ DECLARE_WRITE8_MEMBER( video_ram_w );
+ DECLARE_READ8_MEMBER( iord0_r );
+ DECLARE_WRITE8_MEMBER( iowr0_w );
+ DECLARE_WRITE8_MEMBER( iowr1_w );
+ DECLARE_WRITE8_MEMBER( iowr2_w );
+
+ DECLARE_READ8_MEMBER( cio_pa_r );
+ DECLARE_READ8_MEMBER( cio_pb_r );
+ DECLARE_WRITE8_MEMBER( cio_pb_w );
+ DECLARE_READ8_MEMBER( cio_pc_r );
+ DECLARE_WRITE8_MEMBER( cio_pc_w );
+
+ DECLARE_WRITE_LINE_MEMBER( nmi_w );
+
+ int get_current_task(offs_t offset);
+ offs_t get_segment_address(offs_t offset);
+ offs_t get_page_address(offs_t offset, UINT8 segd);
+ offs_t translate_address(offs_t offset, int *nonx, int *wp);
+ UINT8 read_ram(offs_t offset);
+ void write_ram(offs_t offset, UINT8 data);
+ UINT8 read_io(offs_t offset);
+ void write_io(offs_t offset, UINT8 data);
+ UINT8 read_internal_io(offs_t offset);
+ void write_internal_io(offs_t offset, UINT8 data);
+ UINT8 read_external_io(offs_t offset);
+ void write_external_io(offs_t offset, UINT8 data);
+ UINT8 read_user_memory(offs_t offset);
+ void write_user_memory(offs_t offset, UINT8 data);
+ int get_fc();
+ UINT8 read_supervisor_memory(offs_t offset);
+ void write_supervisor_memory(offs_t offset, UINT8 data);
+
+ inline void update_drdy0();
+ inline void update_drdy1();
+ inline void update_drdy2();
+ inline offs_t get_dma_address(int index, UINT16 offset);
+ inline UINT8 dma_mreq_r(int index, UINT16 offset);
+ inline void dma_mreq_w(int index, UINT16 offset, UINT8 data);
+ inline UINT8 dma_iorq_r(int index, UINT16 offset);
+ inline void dma_iorq_w(int index, UINT16 offset, UINT8 data);
+
+ inline UINT16 get_drmsk();
+ inline void get_shinf();
+ inline UINT16 get_wrmsk();
+ inline UINT16 barrel_shift(UINT16 gmdr);
+ inline UINT16 word_mixer(UINT16 rot);
+ inline void clock_mfa_x();
+ inline void clock_mfa_y();
+ inline void clock_mta_x();
+ inline void clock_mta_y();
+ inline void load_mfa_x();
+ inline void load_mta_x();
+ inline void compare_mta_x();
+ inline void compare_mta_y();
+ inline void load_xy_reg();
+ void mover();
+
+ inline UINT16 read_videoram(UINT32 offset);
+ inline void write_videoram(UINT32 offset, UINT16 data, UINT16 mask);
+ inline UINT16 get_crtca(UINT16 ma, UINT8 ra, UINT8 column);
+ void crtc_update_row(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
+
+ void scc_irq(bool status);
+
+ // memory access controller
+ int m_ifc2;
+ UINT8 m_task;
+ UINT8 m_segment_ram[0x400];
+ UINT16 m_page_ram[0x400];
+
+ // DMA
+ UINT8 m_dmamap[8];
+ int m_dmadis;
+ int m_sysscc;
+ int m_sysfs;
+ UINT8 m_cause;
+ int m_partst; // parity test
+
+ // peripherals
+ int m_cs7; // card select address bit 7
+ int m_bus0; // BUS 0 selected
+ UINT8 m_csb; // card select
+ int m_atce; // V.24 channel A external clock enable
+ int m_btce; // V.24 channel B external clock enable
+
+ // video
+ const UINT8 *m_wrmsk_rom; // write mask ROM
+ const UINT8 *m_shinf_rom; // shifter info ROM
+ const UINT8 *m_drmsk_rom; // data read mask ROM
+ UINT16 *m_video_ram; // video RAM
+ int m_endisp; // enable display
+ int m_clocks_disabled; // clocks disabled
+ UINT16 m_gmdi; // video RAM data latch
+ UINT16 m_wrm; // write mask latch
+ UINT8 m_ms[16]; // mover sequence control
+ UINT8 m_ds[16]; // display sequence control
+ UINT8 m_flag; // flags
+ UINT16 m_xsize; // X size
+ UINT16 m_ysize; // Y size
+ int m_udx; // up/down X
+ int m_udy; // up/down Y
+ UINT16 m_xfrom; // X from
+ UINT16 m_xto; // X to
+ UINT16 m_yto; // Y to
+ UINT16 m_ty; // to Y
+ UINT32 m_mfa; // mover from address
+ UINT32 m_mta; // mover to address
+ UINT8 m_sh; //
+ UINT16 m_mdor; //
+ int m_hold_1w_cyk; //
+ int m_wrms0; //
+ int m_wrms1; //
+ int m_rmc; // row match count
+ int m_cmc; // column match count
+ int m_amm; // active mover mask
+};
+
+
+
+//**************************************************************************
+// MACHINE CONFIGURATION
+//**************************************************************************
+
+/*----------- defined in video/abc1600.c -----------*/
+
+MACHINE_CONFIG_EXTERN( abc1600_video );
+
+
+
+#endif
diff --git a/src/mess/includes/abc80.h b/src/mess/includes/abc80.h
new file mode 100644
index 00000000000..ed3a2894679
--- /dev/null
+++ b/src/mess/includes/abc80.h
@@ -0,0 +1,155 @@
+/*****************************************************************************
+ *
+ * includes/abc80.h
+ *
+ ****************************************************************************/
+
+#ifndef __ABC80__
+#define __ABC80__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/printer.h"
+#include "imagedev/cassette.h"
+#include "machine/abcbus.h"
+#include "machine/abc80kb.h"
+#include "machine/abc830.h"
+#include "machine/ram.h"
+#include "machine/serial.h"
+#include "machine/z80pio.h"
+#include "sound/sn76477.h"
+
+#define ABC80_HTOTAL 384
+#define ABC80_HBEND 35
+#define ABC80_HBSTART 384
+#define ABC80_VTOTAL 312
+#define ABC80_VBEND 15
+#define ABC80_VBSTART 312
+
+#define ABC80_K5_HSYNC 0x01
+#define ABC80_K5_DH 0x02
+#define ABC80_K5_LINE_END 0x04
+#define ABC80_K5_ROW_START 0x08
+
+#define ABC80_K2_VSYNC 0x01
+#define ABC80_K2_DV 0x02
+#define ABC80_K2_FRAME_END 0x04
+#define ABC80_K2_FRAME_RESET 0x08
+
+#define ABC80_J3_BLANK 0x01
+#define ABC80_J3_TEXT 0x02
+#define ABC80_J3_GRAPHICS 0x04
+#define ABC80_J3_VERSAL 0x08
+
+#define ABC80_E7_VIDEO_RAM 0x01
+#define ABC80_E7_INT_RAM 0x02
+#define ABC80_E7_31K_EXT_RAM 0x04
+#define ABC80_E7_16K_INT_RAM 0x08
+
+#define ABC80_CHAR_CURSOR 0x80
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "ab67"
+#define Z80PIO_TAG "cd67"
+#define SN76477_TAG "g8"
+#define RS232_TAG "ser"
+#define TIMER_CASSETTE_TAG "cass"
+
+class abc80_state : public driver_device
+{
+public:
+ abc80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_pio(*this, Z80PIO_TAG),
+ m_psg(*this, SN76477_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_bus(*this, ABCBUS_TAG),
+ m_kb(*this, ABC80_KEYBOARD_TAG),
+ m_ram(*this, RAM_TAG),
+ m_rs232(*this, RS232_TAG),
+ m_tape_in(1),
+ m_tape_in_latch(1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_pio;
+ required_device<device_t> m_psg;
+ required_device<cassette_image_device> m_cassette;
+ required_device<abcbus_slot_device> m_bus;
+ required_device<abc80_keyboard_device> m_kb;
+ required_device<ram_device> m_ram;
+ required_device<rs232_port_device> m_rs232;
+
+ enum
+ {
+ TIMER_ID_PIO,
+ TIMER_ID_CASSETTE,
+ TIMER_ID_BLINK,
+ TIMER_ID_VSYNC_ON,
+ TIMER_ID_VSYNC_OFF,
+ TIMER_ID_FAKE_KEYBOARD_SCAN,
+ TIMER_ID_FAKE_KEYBOARD_CLEAR
+ };
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ virtual void machine_start();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void update_screen(bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void scan_keyboard();
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ DECLARE_WRITE_LINE_MEMBER( vco_voltage_w );
+
+ DECLARE_READ8_MEMBER( pio_pa_r );
+ DECLARE_READ8_MEMBER( pio_pb_r );
+ DECLARE_WRITE8_MEMBER( pio_pb_w );
+
+ DECLARE_WRITE_LINE_MEMBER( keydown_w );
+
+ // keyboard state
+ int m_key_data;
+ int m_key_strobe;
+ int m_pio_astb;
+
+ // video state
+ UINT8 *m_video_ram;
+ UINT8 m_latch;
+ int m_blink;
+
+ // cassette state
+ int m_tape_in;
+ int m_tape_in_latch;
+
+ // memory regions
+ const UINT8 *m_mmu_rom; // memory mapping ROM
+ const UINT8 *m_char_rom; // character generator ROM
+ const UINT8 *m_hsync_prom; // horizontal sync PROM
+ const UINT8 *m_vsync_prom; // horizontal sync PROM
+ const UINT8 *m_line_prom; // line address PROM
+ const UINT8 *m_attr_prom; // character attribute PROM
+
+ // timers
+ emu_timer *m_pio_timer;
+ emu_timer *m_cassette_timer;
+ emu_timer *m_blink_timer;
+ emu_timer *m_vsync_on_timer;
+ emu_timer *m_vsync_off_timer;
+ emu_timer *m_kb_timer;
+};
+
+//----------- defined in video/abc80.c -----------
+
+MACHINE_CONFIG_EXTERN( abc80_video );
+
+#endif
diff --git a/src/mess/includes/abc80x.h b/src/mess/includes/abc80x.h
new file mode 100644
index 00000000000..1acd98d75d4
--- /dev/null
+++ b/src/mess/includes/abc80x.h
@@ -0,0 +1,335 @@
+#pragma once
+
+#ifndef __ABC800__
+#define __ABC800__
+
+
+#define MODERN_DRIVER_INIT
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "cpu/mcs48/mcs48.h"
+#include "imagedev/cassette.h"
+#include "machine/abc77.h"
+#include "machine/abc800kb.h"
+#include "machine/abc830.h"
+#include "machine/abcbus.h"
+#include "machine/e0516.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dart.h"
+#include "machine/ram.h"
+#include "sound/discrete.h"
+#include "video/mc6845.h"
+#include "video/saa5050.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define ABC800_X01 XTAL_12MHz
+#define ABC806_X02 XTAL_32_768kHz
+
+#define ABC802_AT0 0x01
+#define ABC802_AT1 0x02
+#define ABC802_ATD 0x40
+#define ABC802_ATE 0x80
+#define ABC802_INV 0x80
+
+#define ABC800C_CHAR_RAM_SIZE 0x400
+#define ABC800M_CHAR_RAM_SIZE 0x800
+#define ABC800_VIDEO_RAM_SIZE 0x4000
+#define ABC802_CHAR_RAM_SIZE 0x800
+#define ABC806_CHAR_RAM_SIZE 0x800
+#define ABC806_ATTR_RAM_SIZE 0x800
+#define ABC806_VIDEO_RAM_SIZE 0x20000
+
+#define ABC800_CHAR_WIDTH 6
+#define ABC800_CCLK ABC800_X01/ABC800_CHAR_WIDTH
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define E0516_TAG "j13"
+#define MC6845_TAG "b12"
+#define SAA5052_TAG "5c"
+#define Z80CTC_TAG "z80ctc"
+#define Z80SIO_TAG "z80sio"
+#define Z80DART_TAG "z80dart"
+#define DISCRETE_TAG "discrete"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> abc800_state
+
+class abc800_state : public driver_device
+{
+public:
+ abc800_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_dart(*this, Z80DART_TAG),
+ m_sio(*this, Z80SIO_TAG),
+ m_discrete(*this, "discrete"),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_video_ram(*this, "video_ram"),
+ m_char_ram(*this, "char_ram"),
+ m_ctc_z0(0),
+ m_sio_rxdb(1),
+ m_sio_txcb(0),
+ m_sio_txdb(1),
+ m_sio_rtsb(1),
+ m_dfd_out(0),
+ m_tape_ctr(4)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<z80dart_device> m_dart;
+ required_device<z80dart_device> m_sio;
+ optional_device<device_t> m_discrete;
+ optional_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ enum
+ {
+ TIMER_ID_CTC,
+ TIMER_ID_CASSETTE
+ };
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+
+ void bankswitch();
+ void clock_cassette(int state);
+
+ DECLARE_READ8_MEMBER( pling_r );
+ DECLARE_READ_LINE_MEMBER( keyboard_txd_r );
+ DECLARE_READ8_MEMBER( keyboard_col_r );
+ DECLARE_WRITE8_MEMBER( keyboard_row_w );
+ DECLARE_WRITE8_MEMBER( keyboard_ctrl_w );
+ DECLARE_READ8_MEMBER( keyboard_t1_r );
+ DECLARE_WRITE8_MEMBER( hrs_w );
+ DECLARE_WRITE8_MEMBER( hrc_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z0_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
+ DECLARE_READ_LINE_MEMBER( sio_rxdb_r );
+ DECLARE_WRITE_LINE_MEMBER( sio_txdb_w );
+ DECLARE_WRITE_LINE_MEMBER( sio_dtrb_w );
+ DECLARE_WRITE_LINE_MEMBER( sio_rtsb_w );
+
+ // cpu state
+ int m_fetch_charram; // opcode fetched from character RAM region (0x7800-0x7fff)
+
+ // video state
+ optional_shared_ptr<UINT8> m_video_ram;
+ optional_shared_ptr<UINT8> m_char_ram;
+ const UINT8 *m_char_rom; // character generator ROM
+ const UINT8 *m_fgctl_prom; // foreground control PROM
+ UINT8 m_hrs; // HR picture start scanline
+ UINT8 m_fgctl; // HR foreground control
+
+ // sound state
+ int m_pling; // pling
+
+ // serial state
+ UINT8 m_sb;
+ int m_ctc_z0;
+ int m_sio_rxdb;
+ int m_sio_rxcb;
+ int m_sio_txcb;
+ int m_sio_txdb;
+ int m_sio_rtsb;
+ int m_dfd_out;
+ int m_dfd_in;
+ int m_tape_ctr;
+
+ // timers
+ emu_timer *m_ctc_timer;
+ emu_timer *m_cassette_timer;
+};
+
+class abc800m_state : public abc800_state
+{
+public:
+ abc800m_state(const machine_config &mconfig, device_type type, const char *tag)
+ : abc800_state(mconfig, type, tag),
+ m_crtc(*this, MC6845_TAG)
+ { }
+
+ required_device<mc6845_device> m_crtc;
+
+ DECLARE_DRIVER_INIT(driver_init);
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
+};
+
+class abc800c_state : public abc800_state
+{
+public:
+ abc800c_state(const machine_config &mconfig, device_type type, const char *tag)
+ : abc800_state(mconfig, type, tag),
+ m_trom(*this, SAA5052_TAG)
+ { }
+
+ required_device<device_t> m_trom;
+
+ DECLARE_DRIVER_INIT(driver_init);
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ offs_t translate_trom_offset(offs_t offset);
+ void hr_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( char_ram_r );
+ DECLARE_WRITE8_MEMBER( char_ram_w );
+ DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
+};
+
+// ======================> abc802_state
+
+class abc802_state : public abc800_state
+{
+public:
+ abc802_state(const machine_config &mconfig, device_type type, const char *tag)
+ : abc800_state(mconfig, type, tag),
+ m_crtc(*this, MC6845_TAG),
+ m_abc77(*this, ABC77_TAG)
+ { }
+
+ required_device<mc6845_device> m_crtc;
+ optional_device<device_t> m_abc77;
+
+ DECLARE_DRIVER_INIT(driver_init);
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ void bankswitch();
+
+ DECLARE_READ8_MEMBER( pling_r );
+ DECLARE_WRITE_LINE_MEMBER( lrs_w );
+ DECLARE_WRITE_LINE_MEMBER( mux80_40_w );
+ DECLARE_WRITE_LINE_MEMBER( vs_w );
+ DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
+
+ // cpu state
+ int m_lrs; // low RAM select
+
+ // video state
+ const UINT8 *m_char_rom; // character generator ROM
+
+ int m_flshclk_ctr; // flash clock counter
+ int m_flshclk; // flash clock
+ int m_80_40_mux; // 40/80 column mode
+};
+
+
+// ======================> abc806_state
+
+class abc806_state : public abc800_state
+{
+public:
+ abc806_state(const machine_config &mconfig, device_type type, const char *tag)
+ : abc800_state(mconfig, type, tag),
+ m_crtc(*this, MC6845_TAG),
+ m_rtc(*this, E0516_TAG),
+ m_abc77(*this, ABC77_TAG)
+ { }
+
+ required_device<mc6845_device> m_crtc;
+ required_device<e0516_device> m_rtc;
+ optional_device<device_t> m_abc77;
+
+ DECLARE_DRIVER_INIT(driver_init);
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ void bankswitch();
+ void hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( mai_r );
+ DECLARE_WRITE8_MEMBER( mao_w );
+ DECLARE_WRITE8_MEMBER( hrs_w );
+ DECLARE_WRITE8_MEMBER( hrc_w );
+ DECLARE_READ8_MEMBER( charram_r );
+ DECLARE_WRITE8_MEMBER( charram_w );
+ DECLARE_READ8_MEMBER( ami_r );
+ DECLARE_WRITE8_MEMBER( amo_w );
+ DECLARE_READ8_MEMBER( cli_r );
+ DECLARE_WRITE8_MEMBER( sso_w );
+ DECLARE_READ8_MEMBER( sti_r );
+ DECLARE_WRITE8_MEMBER( sto_w );
+ DECLARE_WRITE_LINE_MEMBER( keydtr_w );
+ DECLARE_WRITE_LINE_MEMBER( hs_w );
+ DECLARE_WRITE_LINE_MEMBER( vs_w );
+ DECLARE_DIRECT_UPDATE_MEMBER( direct_update_handler );
+
+ // memory state
+ int m_keydtr; // keyboard DTR
+ int m_eme; // extended memory enable
+ int m_fetch_charram; // opcode fetched from character RAM region (0x7800-0x7fff)
+ UINT8 m_map[16]; // memory page register
+
+ // video state
+ UINT8 *m_color_ram; // attribute RAM
+ const UINT8 *m_rad_prom; // line address PROM
+ const UINT8 *m_hru2_prom; // HR palette PROM
+ const UINT8 *m_char_rom; // character generator ROM
+
+ int m_txoff; // text display enable
+ int m_40; // 40/80 column mode
+ int m_flshclk_ctr; // flash clock counter
+ int m_flshclk; // flash clock
+ UINT8 m_attr_data; // attribute data latch
+ UINT8 m_hrs; // HR memory mapping
+ UINT8 m_hrc[16]; // HR palette
+ UINT8 m_sync; // line synchronization delay
+ UINT8 m_v50_addr; // vertical sync PROM address
+ int m_hru2_a8; // HRU II PROM address line 8
+ UINT32 m_vsync_shift; // vertical sync shift register
+ int m_vsync; // vertical sync
+ int m_d_vsync; // delayed vertical sync
+};
+
+
+
+//**************************************************************************
+// MACHINE CONFIGURATION
+//**************************************************************************
+
+/*----------- defined in video/abc800.c -----------*/
+
+MACHINE_CONFIG_EXTERN(abc800m_video);
+MACHINE_CONFIG_EXTERN(abc800c_video);
+
+/*----------- defined in video/abc802.c -----------*/
+
+MACHINE_CONFIG_EXTERN(abc802_video);
+
+/*----------- defined in video/abc806.c -----------*/
+
+MACHINE_CONFIG_EXTERN(abc806_video);
+
+#endif
diff --git a/src/mess/includes/ac1.h b/src/mess/includes/ac1.h
new file mode 100644
index 00000000000..6e8b64ae06e
--- /dev/null
+++ b/src/mess/includes/ac1.h
@@ -0,0 +1,39 @@
+/*****************************************************************************
+ *
+ * includes/ac1.h
+ *
+ ****************************************************************************/
+
+#ifndef AC1_H_
+#define AC1_H_
+
+#include "machine/z80pio.h"
+#include "imagedev/cassette.h"
+
+class ac1_state : public driver_device
+{
+public:
+ ac1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ cassette_image_device *m_cassette;
+ DECLARE_DRIVER_INIT(ac1);
+};
+
+
+/*----------- defined in machine/ac1.c -----------*/
+
+MACHINE_RESET( ac1 );
+
+extern const z80pio_interface ac1_z80pio_intf;
+
+/*----------- defined in video/ac1.c -----------*/
+
+extern const gfx_layout ac1_charlayout;
+
+VIDEO_START( ac1 );
+SCREEN_UPDATE_IND16( ac1 );
+SCREEN_UPDATE_IND16( ac1_32 );
+
+
+#endif /* AC1_h_ */
diff --git a/src/mess/includes/ace.h b/src/mess/includes/ace.h
new file mode 100644
index 00000000000..be5a7b430f8
--- /dev/null
+++ b/src/mess/includes/ace.h
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ *
+ * includes/ace.h
+ *
+ ****************************************************************************/
+
+#pragma once
+
+#ifndef ACE_H_
+#define ACE_H_
+
+#define Z80_TAG "z0"
+#define AY8910_TAG "ay8910"
+#define I8255_TAG "i8255"
+#define SP0256AL2_TAG "ic1"
+#define Z80PIO_TAG "z80pio"
+#define CENTRONICS_TAG "centronics"
+#define SCREEN_TAG "screen"
+
+class ace_state : public driver_device
+{
+public:
+ ace_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ppi(*this, I8255_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ram(*this, RAM_TAG),
+ m_video_ram(*this, "video_ram"),
+ m_char_ram(*this, "char_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<i8255_device> m_ppi;
+ required_device<device_t> m_speaker;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( io_r );
+ DECLARE_WRITE8_MEMBER( io_w );
+ DECLARE_READ8_MEMBER( ppi_pa_r );
+ DECLARE_WRITE8_MEMBER( ppi_pa_w );
+ DECLARE_READ8_MEMBER( ppi_pb_r );
+ DECLARE_WRITE8_MEMBER( ppi_pb_w );
+ DECLARE_READ8_MEMBER( ppi_pc_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_READ8_MEMBER( ppi_control_r );
+ DECLARE_WRITE8_MEMBER( ppi_control_w );
+ DECLARE_READ8_MEMBER( pio_pa_r );
+ DECLARE_WRITE8_MEMBER( pio_pa_w );
+
+ required_shared_ptr<UINT8> m_video_ram;
+ required_shared_ptr<UINT8> m_char_ram;
+};
+
+#endif /* ACE_H_ */
diff --git a/src/mess/includes/adam.h b/src/mess/includes/adam.h
new file mode 100644
index 00000000000..50289c9e3cf
--- /dev/null
+++ b/src/mess/includes/adam.h
@@ -0,0 +1,131 @@
+#pragma once
+
+#ifndef ADAM_H_
+#define ADAM_H_
+
+#define Z80_TAG "u1"
+#define SN76489A_TAG "u20"
+#define TMS9928A_TAG "tms9928a"
+#define WD2793_TAG "u11"
+#define M6801_MAIN_TAG "cpu1"
+#define M6801_KB_TAG "cpu2"
+#define M6801_DDP_TAG "cpu3"
+#define M6801_PRN_TAG "cpu4"
+#define M6801_FDC_TAG "cpu5"
+#define M6801_SPI_TAG "cpu6"
+#define SCREEN_TAG "screen"
+
+class adam_state : public driver_device
+{
+public:
+ adam_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_netcpu(*this, M6801_MAIN_TAG),
+ m_fdc(*this, WD2793_TAG),
+ m_ram(*this, RAM_TAG),
+ m_ddp0(*this, CASSETTE_TAG),
+ m_ddp1(*this, CASSETTE2_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_rxd(1),
+ m_reset(0),
+ m_dma(1),
+ m_bwr(1)
+ {
+ for (int i = 0; i < 6; i++)
+ m_txd[i] = 1;
+ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_netcpu;
+ required_device<device_t> m_fdc;
+ required_device<ram_device> m_ram;
+ required_device<cassette_image_device> m_ddp0;
+ required_device<cassette_image_device> m_ddp1;
+ required_device<device_t> m_floppy0;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void bankswitch();
+ void adamnet_txd_w(int device, int state);
+
+ DECLARE_WRITE_LINE_MEMBER( os3_w );
+
+ DECLARE_READ8_MEMBER( adamnet_r );
+ DECLARE_WRITE8_MEMBER( adamnet_w );
+ DECLARE_READ8_MEMBER( mioc_r );
+ DECLARE_WRITE8_MEMBER( mioc_w );
+ DECLARE_WRITE8_MEMBER( paddle_w );
+ DECLARE_WRITE8_MEMBER( joystick_w );
+ DECLARE_READ8_MEMBER( input1_r );
+ DECLARE_READ8_MEMBER( input2_r );
+
+ DECLARE_WRITE8_MEMBER( master6801_p1_w );
+ DECLARE_READ8_MEMBER( master6801_p2_r );
+ DECLARE_WRITE8_MEMBER( master6801_p2_w );
+ DECLARE_READ8_MEMBER( master6801_p3_r );
+ DECLARE_WRITE8_MEMBER( master6801_p3_w );
+ DECLARE_WRITE8_MEMBER( master6801_p4_w );
+
+ DECLARE_READ8_MEMBER( kb6801_p1_r );
+ DECLARE_READ8_MEMBER( kb6801_p2_r );
+ DECLARE_WRITE8_MEMBER( kb6801_p2_w );
+ DECLARE_READ8_MEMBER( kb6801_p3_r );
+ DECLARE_WRITE8_MEMBER( kb6801_p3_w );
+ DECLARE_READ8_MEMBER( kb6801_p4_r );
+ DECLARE_WRITE8_MEMBER( kb6801_p4_w );
+
+ DECLARE_WRITE8_MEMBER( ddp6801_p1_w );
+ DECLARE_READ8_MEMBER( ddp6801_p2_r );
+ DECLARE_WRITE8_MEMBER( ddp6801_p2_w );
+ DECLARE_READ8_MEMBER( ddp6801_p4_r );
+
+ DECLARE_WRITE8_MEMBER( printer6801_p1_w );
+ DECLARE_READ8_MEMBER( printer6801_p2_r );
+ DECLARE_WRITE8_MEMBER( printer6801_p2_w );
+ DECLARE_READ8_MEMBER( printer6801_p3_r );
+ DECLARE_READ8_MEMBER( printer6801_p4_r );
+ DECLARE_WRITE8_MEMBER( printer6801_p4_w );
+
+ DECLARE_READ8_MEMBER( fdc6801_p1_r );
+ DECLARE_WRITE8_MEMBER( fdc6801_p1_w );
+ DECLARE_READ8_MEMBER( fdc6801_p2_r );
+ DECLARE_WRITE8_MEMBER( fdc6801_p2_w );
+ DECLARE_WRITE8_MEMBER( fdc6801_p4_w );
+
+ // memory state
+ UINT8 m_mioc;
+ int m_game;
+
+ // ADAMnet state
+ UINT8 m_adamnet;
+ int m_txd[6];
+ int m_rxd;
+ int m_reset;
+
+ // DMA state
+ UINT16 m_ba;
+ int m_dma;
+ int m_bwr;
+ UINT8 m_data_in;
+ UINT8 m_data_out;
+
+ // keyboard state
+ UINT16 m_key_y;
+
+ // paddle state
+ int m_joy_mode;
+ UINT8 m_joy_status0;
+ UINT8 m_joy_status1;
+
+ // video state
+ int m_vdp_nmi;
+
+ // cassette state
+ int m_wr0;
+ int m_wr1;
+ int m_track;
+};
+
+#endif
diff --git a/src/mess/includes/advision.h b/src/mess/includes/advision.h
new file mode 100644
index 00000000000..4a09e9c2db1
--- /dev/null
+++ b/src/mess/includes/advision.h
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ *
+ * includes/advision.h
+ *
+ ****************************************************************************/
+
+#ifndef __ADVISION__
+#define __ADVISION__
+
+#include "sound/dac.h"
+
+#define SCREEN_TAG "screen"
+#define I8048_TAG "i8048"
+#define COP411_TAG "cop411"
+
+class advision_state : public driver_device
+{
+public:
+ advision_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8048_TAG),
+ m_soundcpu(*this, COP411_TAG),
+ m_dac(*this, "dac")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_soundcpu;
+ required_device<dac_device> m_dac;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void update_dac();
+ void vh_write(int data);
+ void vh_update(int x);
+
+ DECLARE_READ8_MEMBER( ext_ram_r );
+ DECLARE_WRITE8_MEMBER( ext_ram_w );
+ DECLARE_READ8_MEMBER( controller_r );
+ DECLARE_WRITE8_MEMBER( bankswitch_w );
+ DECLARE_WRITE8_MEMBER( av_control_w );
+ DECLARE_READ8_MEMBER( vsync_r );
+ DECLARE_READ8_MEMBER( sound_cmd_r );
+ DECLARE_WRITE8_MEMBER( sound_g_w );
+ DECLARE_WRITE8_MEMBER( sound_d_w );
+
+ /* external RAM state */
+ UINT8 *m_ext_ram;
+ int m_rambank;
+
+ /* video state */
+ int m_frame_count;
+ int m_frame_start;
+ int m_video_enable;
+ int m_video_bank;
+ int m_video_hpos;
+ UINT8 m_led_latch[8];
+ UINT8 *m_display;
+
+ /* sound state */
+ int m_sound_cmd;
+ int m_sound_d;
+ int m_sound_g;
+};
+
+/*----------- defined in video/advision.c -----------*/
+
+PALETTE_INIT( advision );
+
+#endif
diff --git a/src/mess/includes/aim65.h b/src/mess/includes/aim65.h
new file mode 100644
index 00000000000..33fcb306cf1
--- /dev/null
+++ b/src/mess/includes/aim65.h
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ *
+ * includes/aim65.h
+ *
+ * Rockwell AIM-65
+ *
+ ****************************************************************************/
+
+#ifndef AIM65_H_
+#define AIM65_H_
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "video/dl1416.h"
+#include "machine/6522via.h"
+#include "machine/6532riot.h"
+#include "machine/6821pia.h"
+#include "machine/ram.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "sound/wave.h"
+
+
+/** R6502 Clock.
+ *
+ * The R6502 on AIM65 operates at 1 MHz. The frequency reference is a 4 MHz
+ * crystal controlled oscillator. Dual D-type flip-flop Z10 divides the 4 MHz
+ * signal by four to drive the R6502 phase 0 (O0) input with a 1 MHz clock.
+ */
+#define AIM65_CLOCK XTAL_4MHz/4
+
+
+class aim65_state : public driver_device
+{
+public:
+ aim65_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_cass1(*this, CASSETTE_TAG),
+ m_cass2(*this, CASSETTE2_TAG)
+ { }
+
+ DECLARE_WRITE8_MEMBER(aim65_pia_a_w);
+ DECLARE_WRITE8_MEMBER(aim65_pia_b_w);
+ DECLARE_READ8_MEMBER(aim65_riot_b_r);
+ DECLARE_WRITE8_MEMBER(aim65_riot_a_w);
+ DECLARE_WRITE8_MEMBER(aim65_pa_w);
+ DECLARE_WRITE8_MEMBER(aim65_pb_w);
+ DECLARE_WRITE8_MEMBER(aim65_printer_on);
+ DECLARE_READ8_MEMBER(aim65_pb_r);
+ UINT8 m_pia_a;
+ UINT8 m_pia_b;
+ UINT8 m_riot_port_a;
+ UINT8 m_pb_save;
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cass1;
+ required_device<cassette_image_device> m_cass2;
+};
+
+
+/*----------- defined in machine/aim65.c -----------*/
+
+void aim65_update_ds1(device_t *device, int digit, int data);
+void aim65_update_ds2(device_t *device, int digit, int data);
+void aim65_update_ds3(device_t *device, int digit, int data);
+void aim65_update_ds4(device_t *device, int digit, int data);
+void aim65_update_ds5(device_t *device, int digit, int data);
+
+
+MACHINE_START( aim65 );
+
+#endif /* AIM65_H_ */
diff --git a/src/mess/includes/aim65_40.h b/src/mess/includes/aim65_40.h
new file mode 100644
index 00000000000..10b0fd3a2bb
--- /dev/null
+++ b/src/mess/includes/aim65_40.h
@@ -0,0 +1,25 @@
+#pragma once
+
+#ifndef __AIM65_40__
+#define __AIM65_40__
+
+#define M6502_TAG "m6502"
+#define M6522_0_TAG "m6522_0"
+#define M6522_1_TAG "m6522_1"
+#define M6522_2_TAG "m6522_2"
+#define M6551_TAG "m6551"
+
+class aim65_40_state : public driver_device
+{
+public:
+ aim65_40_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ /* devices */
+ device_t *m_via0;
+ device_t *m_via1;
+ device_t *m_via2;
+ device_t *m_speaker;
+};
+
+#endif
diff --git a/src/mess/includes/amstr_pc.h b/src/mess/includes/amstr_pc.h
new file mode 100644
index 00000000000..8a14769596b
--- /dev/null
+++ b/src/mess/includes/amstr_pc.h
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ *
+ * includes/amstr_pc.h
+ *
+ ****************************************************************************/
+
+#ifndef AMSTR_PC_H_
+#define AMSTR_PC_H_
+
+
+#define PC200_MODE (machine.root_device().ioport("DSW0")->read() & 0x30)
+#define PC200_MDA 0x30
+
+
+/*----------- defined in machine/amstr_pc.c -----------*/
+
+READ8_HANDLER( pc1640_port60_r );
+WRITE8_HANDLER( pc1640_port60_w );
+
+READ8_HANDLER( pc1640_mouse_x_r );
+READ8_HANDLER( pc1640_mouse_y_r );
+WRITE8_HANDLER( pc1640_mouse_x_w );
+WRITE8_HANDLER( pc1640_mouse_y_w );
+
+READ8_HANDLER( pc200_port378_r );
+READ8_HANDLER( pc200_port278_r );
+READ8_HANDLER( pc1640_port378_r );
+READ8_HANDLER( pc1640_port3d0_r );
+READ8_HANDLER( pc1640_port4278_r );
+READ8_HANDLER( pc1640_port278_r );
+
+INPUT_PORTS_EXTERN( amstrad_keyboard );
+
+
+#endif /* AMSTR_PC_H_ */
diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h
new file mode 100644
index 00000000000..902b72d1d69
--- /dev/null
+++ b/src/mess/includes/amstrad.h
@@ -0,0 +1,214 @@
+/*****************************************************************************
+ *
+ * includes/amstrad.h
+ *
+ ****************************************************************************/
+
+#ifndef AMSTRAD_H_
+#define AMSTRAD_H_
+
+#include "machine/upd765.h"
+#include "video/mc6845.h"
+#include "machine/i8255.h"
+#include "machine/mc146818.h"
+#include "imagedev/snapquik.h"
+#include "machine/cpcexp.h"
+#include "machine/cpc_ssa1.h"
+#include "machine/cpc_rom.h"
+#include "machine/mface2.h"
+#include "machine/ram.h"
+#include "imagedev/cassette.h"
+#include "machine/ctronics.h"
+
+/****************************
+ * Gate Array data (CPC) -
+ ****************************/
+typedef struct
+{
+ bitmap_ind16 *bitmap; /* The bitmap we work on */
+ UINT8 pen_selected; /* Pen selection */
+ UINT8 mrer; /* Mode and ROM Enable Register */
+ UINT8 upper_bank;
+ UINT8 romdis; // ROMDIS signal from the expansion port
+
+ /* input signals from CRTC */
+ int vsync;
+ int hsync;
+ int de;
+ int ma;
+ int ra;
+
+ /* used for timing */
+ int hsync_after_vsync_counter;
+ int hsync_counter; /* The gate array counts CRTC HSYNC pulses using an internal 6-bit counter. */
+
+ /* used for drawing the screen */
+ attotime last_draw_time;
+ int y;
+ UINT16 *draw_p; /* Position in the bitmap where we are currently drawing */
+ UINT16 colour;
+ UINT16 address;
+ UINT8 *mode_lookup;
+ UINT8 data;
+ UINT8 ticks;
+ UINT8 ticks_increment;
+ UINT16 line_ticks;
+ UINT8 colour_ticks;
+ UINT8 max_colour_ticks;
+} gate_array_t;
+
+/****************************
+ * ASIC data (CPC plus)
+ ****************************/
+typedef struct
+{
+ UINT8 *ram; /* pointer to RAM used for the CPC+ ASIC memory-mapped registers */
+ UINT8 enabled; /* Are CPC plus features enabled/unlocked */
+ UINT8 pri; /* Programmable raster interrupt */
+ UINT8 seqptr; /* Current position in the ASIC unlocking sequence */
+ UINT8 rmr2; /* ROM mapping register 2 */
+ UINT16 split_ma_base; /* Used to handle split screen support */
+ UINT16 split_ma_started; /* Used to handle split screen support */
+ UINT16 vpos; /* Current logical scanline */
+ UINT16 h_start; /* Position where DE became active */
+ UINT16 h_end; /* Position where DE became inactive */
+ UINT8 addr_6845; /* We need these to store a shadow copy of R1 of the mc6845 */
+ UINT8 horiz_disp;
+ UINT8 hscroll;
+ UINT8 de_start; /* flag to check if DE is been enabled this frame yet */
+
+ /* DMA */
+ UINT8 dma_status;
+ UINT8 dma_clear; /* Set if DMA interrupts are to be cleared automatically */
+ UINT8 dma_prescaler[3]; /* DMA channel prescaler */
+ UINT16 dma_repeat[3]; /* Location of the DMA channel's last repeat */
+ UINT16 dma_addr[3]; /* DMA channel address */
+ UINT16 dma_loopcount[3]; /* Count loops taken on this channel */
+ UINT16 dma_pause[3]; /* DMA pause count */
+} asic_t;
+
+
+class amstrad_state : public driver_device
+{
+public:
+ amstrad_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ay(*this, "ay"),
+ m_fdc(*this, "upd765"),
+ m_crtc(*this, "mc6845"),
+ m_screen(*this, "screen"),
+ m_ppi(*this, "ppi8255"),
+ m_centronics(*this, "centronics"),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_exp(*this, "exp"),
+ m_rtc(*this, "rtc")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_ay;
+ optional_device<device_t> m_fdc; // not on a GX4000
+ required_device<mc6845_device> m_crtc;
+ required_device<screen_device> m_screen;
+ required_device<i8255_device> m_ppi;
+ optional_device<centronics_device> m_centronics; // not on a GX4000
+ optional_device<cassette_image_device> m_cassette; // not on a GX4000, (or technically, the 6128+)
+ required_device<ram_device> m_ram;
+ optional_device<cpc_expansion_slot_device> m_exp; // not on a GX4000
+ optional_device<mc146818_device> m_rtc; // Aleste 520EX only
+
+ int m_system_type;
+ UINT8 m_aleste_mode;
+ int m_plus_irq_cause;
+ gate_array_t m_gate_array;
+ asic_t m_asic;
+ int m_GateArray_RamConfiguration;
+ unsigned char *m_AmstradCPC_RamBanks[4];
+ unsigned char *m_Aleste_RamBanks[4];
+ int m_aleste_active_page[4];
+ unsigned char *m_Amstrad_ROM_Table[256];
+ UINT8 m_ppi_port_inputs[3];
+ UINT8 m_ppi_port_outputs[3];
+ int m_aleste_rtc_function;
+ int m_aleste_fdc_int;
+ int m_prev_reg;
+ UINT16 m_GateArray_render_colours[17];
+ UINT8 m_mode0_lookup[256];
+ UINT8 m_mode1_lookup[256];
+ UINT8 m_mode2_lookup[256];
+ int m_prev_data;
+ int m_printer_bit8_selected;
+ unsigned char m_Psg_FunctionSelected;
+ int m_previous_ppi_portc_w;
+ DECLARE_WRITE8_MEMBER(amstrad_plus_asic_4000_w);
+ DECLARE_WRITE8_MEMBER(amstrad_plus_asic_6000_w);
+ DECLARE_READ8_MEMBER(amstrad_plus_asic_4000_r);
+ DECLARE_READ8_MEMBER(amstrad_plus_asic_6000_r);
+ DECLARE_WRITE8_MEMBER(aleste_msx_mapper);
+ DECLARE_READ8_MEMBER(amstrad_cpc_io_r);
+ DECLARE_WRITE8_MEMBER(amstrad_cpc_io_w);
+ DECLARE_READ8_MEMBER(amstrad_psg_porta_read);
+ void amstrad_plus_seqcheck(int data);
+ DECLARE_DRIVER_INIT(aleste);
+};
+
+
+/*----------- defined in machine/amstrad.c -----------*/
+
+
+
+READ8_DEVICE_HANDLER( amstrad_ppi_porta_r );
+READ8_DEVICE_HANDLER( amstrad_ppi_portb_r );
+WRITE8_DEVICE_HANDLER( amstrad_ppi_porta_w );
+WRITE8_DEVICE_HANDLER( amstrad_ppi_portc_w );
+
+
+WRITE_LINE_DEVICE_HANDLER( aleste_interrupt );
+WRITE_LINE_DEVICE_HANDLER( cpc_irq_w );
+WRITE_LINE_DEVICE_HANDLER( cpc_nmi_w );
+WRITE_LINE_DEVICE_HANDLER( cpc_romdis );
+WRITE_LINE_DEVICE_HANDLER( cpc_romen );
+
+MACHINE_START( amstrad );
+MACHINE_RESET( amstrad );
+MACHINE_START( kccomp );
+MACHINE_RESET( kccomp );
+MACHINE_START( plus );
+MACHINE_RESET( plus );
+MACHINE_START( gx4000 );
+MACHINE_RESET( gx4000 );
+MACHINE_START( aleste );
+MACHINE_RESET( aleste );
+
+SNAPSHOT_LOAD( amstrad );
+
+DEVICE_IMAGE_LOAD(amstrad_plus_cartridge);
+
+extern const mc6845_interface amstrad_mc6845_intf;
+extern const mc6845_interface amstrad_plus_mc6845_intf;
+
+VIDEO_START( amstrad );
+SCREEN_UPDATE_IND16( amstrad );
+SCREEN_VBLANK( amstrad );
+
+PALETTE_INIT( amstrad_cpc ); /* For CPC464, CPC664, and CPC6128 */
+PALETTE_INIT( amstrad_cpc_green ); /* For CPC464, CPC664, and CPC6128 */
+PALETTE_INIT( kccomp ); /* For KC Compact */
+PALETTE_INIT( amstrad_plus ); /* For CPC464+ and CPC6128+ */
+PALETTE_INIT( aleste ); /* For aleste */
+
+SLOT_INTERFACE_START(cpc_exp_cards)
+ SLOT_INTERFACE("ssa1", CPC_SSA1)
+ SLOT_INTERFACE("dkspeech", CPC_DKSPEECH)
+ SLOT_INTERFACE("rom", CPC_ROM)
+ SLOT_INTERFACE("multiface2", CPC_MFACE2)
+SLOT_INTERFACE_END
+
+SLOT_INTERFACE_START(cpcplus_exp_cards)
+ SLOT_INTERFACE("ssa1", CPC_SSA1)
+ SLOT_INTERFACE("dkspeech", CPC_DKSPEECH)
+ SLOT_INTERFACE("rom", CPC_ROM)
+SLOT_INTERFACE_END
+
+#endif /* AMSTRAD_H_ */
diff --git a/src/mess/includes/apollo.h b/src/mess/includes/apollo.h
new file mode 100644
index 00000000000..b6ed9de93b7
--- /dev/null
+++ b/src/mess/includes/apollo.h
@@ -0,0 +1,325 @@
+/*
+ * apollo.h - APOLLO DN3500/DN3000 driver includes
+ *
+ * Created on: May 12, 2010
+ * Author: Hans Ostermeyer
+ *
+ * Released for general non-commercial use under the MAME license
+ * Visit http://mamedev.org for licensing and usage restrictions.
+ *
+ */
+
+#pragma once
+
+#ifndef APOLLO_H_
+#define APOLLO_H_
+
+#include "emu.h"
+
+#include "cpu/m68000/m68000.h"
+#include "machine/terminal.h"
+#include "machine/ram.h"
+#include "machine/omti8621.h"
+#include "machine/sc499.h"
+#include "machine/3c505.h"
+#include "machine/68681.h"
+
+#ifndef VERBOSE
+#define VERBOSE 0
+#endif
+
+#define LOG(x) { logerror x; logerror ("\n"); apollo_check_log(); }
+#define LOG1(x) { if (VERBOSE > 0) LOG(x) }
+#define LOG2(x) { if (VERBOSE > 1) LOG(x) }
+#define DLOG(x) { logerror ("%s - %s: ", apollo_cpu_context(device->machine().device(MAINCPU)), device->tag()); LOG(x) }
+#define DLOG1(x) { if (VERBOSE > 0) DLOG(x) }
+#define DLOG2(x) { if (VERBOSE > 1) DLOG(x) }
+#define MLOG(x) { logerror ("%s: ", apollo_cpu_context(machine.device(MAINCPU))); LOG(x) }
+#define MLOG1(x) { if (VERBOSE > 0) MLOG(x) }
+#define MLOG2(x) { if (VERBOSE > 1) MLOG(x) }
+#define SLOG(x) { logerror ("%s: ", apollo_cpu_context(&space.device())); LOG(x) }
+#define SLOG1(x) { if (VERBOSE > 0) SLOG(x) }
+#define SLOG2(x) { if (VERBOSE > 1) SLOG(x) }
+
+#define MAINCPU "maincpu"
+
+// Note: defining APOLLO_FOR_LINUX will provide following unportable extensions:
+// * a real Apollo keyboard may be attached at /dev/ttyS0
+// * SIO1 of the DSP3x00 will be connected with stdout and stdin
+// * the 3c505 emulation will be connected with the real ethernet at ETH0
+//
+// Enabling this is >NOT< supported by MESSdev and this code will be removed.
+// Do *not* report any issues on Mametesters if this is enabled!
+
+#if defined(__linux__)
+//#define APOLLO_FOR_LINUX
+#endif
+
+/*----------- machine/apollo_dbg.c -----------*/
+
+int apollo_debug_instruction_hook(device_t *device, offs_t curpc);
+
+/*----------- drivers/apollo.c -----------*/
+
+// return the current CPU context for log file entries
+const char *apollo_cpu_context(device_t *cpu);
+
+// enable/disable the FPU
+void apollo_set_cpu_has_fpu(device_t *device, int onoff);
+
+// check for excessive logging
+void apollo_check_log();
+
+// return 1 if node is DN3000 or DSP3000, 0 otherwise
+int apollo_is_dn3000(void);
+
+// return 1 if node is DSP3000 or DSP3500, 0 otherwise
+int apollo_is_dsp3x00(void);
+
+// get the ram configuration byte
+UINT8 apollo_get_ram_config_byte(void);
+
+//apollo_get_node_id - get the node id
+UINT32 apollo_get_node_id(void);
+
+ // should be called by the CPU core before executing each instruction
+int apollo_instruction_hook(device_t *device, offs_t curpc);
+
+void apollo_set_cache_status_register(UINT8 mask, UINT8 data);
+
+void apollo_terminal_write(UINT8 data);
+
+/*----------- machine/apollo.c -----------*/
+
+#define APOLLO_CONF_TAG "conf"
+#define APOLLO_FDC_TAG "fdc"
+#define APOLLO_DMA1_TAG "dma8237_1"
+#define APOLLO_DMA2_TAG "dma8237_2"
+#define APOLLO_KBD_TAG "kbd"
+#define APOLLO_PIC1_TAG "pic8259_master"
+#define APOLLO_PIC2_TAG "pic8259_slave"
+#define APOLLO_PTM_TAG "ptm"
+#define APOLLO_RTC_TAG "rtc"
+#define APOLLO_SIO_TAG "sio"
+#define APOLLO_SIO2_TAG "sio2"
+#define APOLLO_ETH_TAG "3c505"
+#define APOLLO_WDC_TAG "omti8621"
+#define APOLLO_CTAPE_TAG "ctape"
+
+class apollo_state : public driver_device
+{
+public:
+ apollo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_ctape(*this, APOLLO_CTAPE_TAG)
+ { }
+
+ required_device<sc499_device> m_ctape;
+
+ device_t *dma8237_1;
+ device_t *dma8237_2;
+ device_t *pic8259_master;
+ device_t *pic8259_slave;
+
+ DECLARE_WRITE16_MEMBER(apollo_csr_status_register_w);
+ DECLARE_READ16_MEMBER(apollo_csr_status_register_r);
+ DECLARE_WRITE16_MEMBER(apollo_csr_control_register_w);
+ DECLARE_READ16_MEMBER(apollo_csr_control_register_r);
+ DECLARE_WRITE8_MEMBER(apollo_dma_1_w);
+ DECLARE_READ8_MEMBER(apollo_dma_1_r);
+ DECLARE_WRITE8_MEMBER(apollo_dma_2_w);
+ DECLARE_READ8_MEMBER(apollo_dma_2_r);
+ DECLARE_WRITE8_MEMBER(apollo_dma_page_register_w);
+ DECLARE_READ8_MEMBER(apollo_dma_page_register_r);
+ DECLARE_WRITE16_MEMBER(apollo_address_translation_map_w);
+ DECLARE_READ16_MEMBER(apollo_address_translation_map_r);
+ DECLARE_READ8_MEMBER(apollo_dma_read_byte);
+ DECLARE_WRITE8_MEMBER(apollo_dma_write_byte);
+ DECLARE_READ8_MEMBER(apollo_dma_read_word);
+ DECLARE_WRITE8_MEMBER(apollo_dma_write_word);
+ DECLARE_WRITE8_MEMBER(apollo_rtc_w);
+ DECLARE_READ8_MEMBER(apollo_rtc_r);
+ DECLARE_WRITE8_MEMBER(apollo_fdc_w);
+ DECLARE_READ8_MEMBER(apollo_fdc_r);
+ DECLARE_WRITE8_MEMBER(cache_control_register_w);
+ DECLARE_READ8_MEMBER(cache_status_register_r);
+ DECLARE_WRITE8_MEMBER(task_alias_register_w);
+ DECLARE_READ8_MEMBER(task_alias_register_r);
+ DECLARE_WRITE16_MEMBER(apollo_node_id_w);
+ DECLARE_READ16_MEMBER(apollo_node_id_r);
+ DECLARE_WRITE16_MEMBER(latch_page_on_parity_error_register_w);
+ DECLARE_READ16_MEMBER(latch_page_on_parity_error_register_r);
+ DECLARE_WRITE8_MEMBER(master_req_register_w);
+ DECLARE_READ8_MEMBER(master_req_register_r);
+ DECLARE_WRITE16_MEMBER(selective_clear_locations_w);
+ DECLARE_READ16_MEMBER(selective_clear_locations_r);
+ DECLARE_READ32_MEMBER(ram_with_parity_r);
+ DECLARE_WRITE32_MEMBER(ram_with_parity_w);
+ DECLARE_READ32_MEMBER(apollo_unmapped_r);
+ DECLARE_WRITE32_MEMBER(apollo_unmapped_w);
+ DECLARE_WRITE32_MEMBER(apollo_rom_w);
+ DECLARE_READ16_MEMBER(apollo_atbus_io_r);
+ DECLARE_WRITE16_MEMBER(apollo_atbus_io_w);
+ DECLARE_READ32_MEMBER(apollo_atbus_memory_r);
+ DECLARE_WRITE32_MEMBER(apollo_atbus_memory_w);
+ DECLARE_WRITE8_MEMBER(dn5500_memory_present_register_w);
+ DECLARE_READ8_MEMBER(dn5500_memory_present_register_r);
+ DECLARE_WRITE8_MEMBER(dn5500_11500_w);
+ DECLARE_READ8_MEMBER(dn5500_11500_r);
+ DECLARE_WRITE8_MEMBER(dn5500_io_protection_map_w);
+ DECLARE_READ8_MEMBER(dn5500_io_protection_map_r);
+ DECLARE_READ32_MEMBER(apollo_f8_r);
+ DECLARE_WRITE32_MEMBER(apollo_f8_w);
+ DECLARE_DRIVER_INIT(dsp3000);
+ DECLARE_DRIVER_INIT(dsp5500);
+ DECLARE_DRIVER_INIT(dn3500);
+ DECLARE_DRIVER_INIT(dn3000);
+ DECLARE_DRIVER_INIT(dsp3500);
+ DECLARE_DRIVER_INIT(dn5500);
+ DECLARE_DRIVER_INIT(apollo);
+};
+
+MACHINE_CONFIG_EXTERN( apollo );
+
+MACHINE_START( apollo );
+MACHINE_RESET( apollo );
+
+/*----------- machine/apollo_config.c -----------*/
+
+// configuration bit definitions
+
+#define APOLLO_CONF_SERVICE_MODE 0x001
+#define APOLLO_CONF_GERMAN_KBD 0x002
+#define APOLLO_CONF_DATE_1990 0x004
+#define APOLLO_CONF_NODE_ID 0x008
+#define APOLLO_CONF_IDLE_SLEEP 0x010
+#define APOLLO_CONF_TRAP_TRACE 0x020
+#define APOLLO_CONF_FPU_TRACE 0x040
+#define APOLLO_CONF_DISK_TRACE 0x080
+#define APOLLO_CONF_NET_TRACE 0x100
+
+// check configuration setting
+int apollo_config(int mask);
+
+INPUT_PORTS_EXTERN(apollo_config);
+
+/*----------- machine/apollo_csr.c -----------*/
+
+#define APOLLO_CSR_SR_SERVICE 0x0001
+#define APOLLO_CSR_SR_ATBUS_IO_TIMEOUT 0x0002
+#define APOLLO_CSR_SR_FP_TRAP 0x0004
+#define APOLLO_CSR_SR_INTERRUPT_PENDING 0x0008 // DN3000 only
+#define APOLLO_CSR_SR_PARITY_BYTE_MASK 0x00f0
+#define APOLLO_CSR_SR_CPU_TIMEOUT 0x0100
+#define APOLLO_CSR_SR_ATBUS_MEM_TIMEOUT 0x2000
+#define APOLLO_CSR_SR_BIT15 0x8000
+#define APOLLO_CSR_SR_CLEAR_ALL 0x3ffe
+
+#define APOLLO_CSR_CR_INTERRUPT_ENABLE 0x0001
+#define APOLLO_CSR_CR_RESET_DEVICES 0x0002
+#define APOLLO_CSR_CR_FPU_TRAP_ENABLE 0x0004
+#define APOLLO_CSR_CR_FORCE_BAD_PARITY 0x0008
+#define APOLLO_CSR_CR_PARITY_BYTE_MASK 0x00f0
+
+UINT16 apollo_csr_get_control_register(void);
+UINT16 apollo_csr_get_status_register(void);
+void apollo_csr_set_status_register(UINT16 mask, UINT16 data);
+
+
+/*----------- machine/apollo_dma.c -----------*/
+
+
+
+
+
+/*----------- machine/apollo_pic.c -----------*/
+
+WRITE8_DEVICE_HANDLER(apollo_pic8259_master_w ) ;
+READ8_DEVICE_HANDLER( apollo_pic8259_master_r );
+
+WRITE8_DEVICE_HANDLER(apollo_pic8259_slave_w );
+READ8_DEVICE_HANDLER( apollo_pic8259_slave_r );
+
+IRQ_CALLBACK(apollo_pic_acknowledge);
+
+/*----------- machine/apollo_ptm.c -----------*/
+
+WRITE8_DEVICE_HANDLER( apollo_ptm_w );
+READ8_DEVICE_HANDLER( apollo_ptm_r );
+
+/*----------- machine/apollo_rtc.c -----------*/
+
+
+/*----------- machine/apollo_sio.c -----------*/
+
+void apollo_sio_rx_data( device_t* device, int ch, UINT8 data );
+
+READ8_DEVICE_HANDLER(apollo_sio_r);
+WRITE8_DEVICE_HANDLER(apollo_sio_w);
+
+/*----------- machine/apollo_sio2.c -----------*/
+
+READ8_DEVICE_HANDLER(apollo_sio2_r);
+WRITE8_DEVICE_HANDLER(apollo_sio2_w);
+
+/*----------- machine/apollo_fdc.c -----------*/
+
+
+/*----------- machine/apollo_eth.c -----------*/
+
+// ethernet transmitter
+
+int apollo_eth_transmit(device_t* device,
+ const UINT8 data_buffer[], const int data_length);
+
+int apollo_eth_setfilter(device_t *device, int node_id);
+// ethernet receiver callback
+
+typedef int (*apollo_eth_receive)(device_t *, const UINT8 *, int);
+
+void apollo_eth_init(device_t *device, apollo_eth_receive rx_data);
+
+/*----------- machine/apollo_net.c -----------*/
+
+// netserver receiver
+
+int apollo_netserver_receive(device_t* device,
+ const UINT8 rx_data_buffer[], const int rx_data_length);
+
+// transmitter callback
+
+typedef int (*apollo_netserver_transmit)(device_t *, const UINT8 *, int);
+
+void apollo_netserver_init(const char *root_path, apollo_netserver_transmit tx_data);
+
+/*----------- video/apollo.c -----------*/
+
+#define APOLLO_SCREEN_TAG "apollo_screen"
+
+DECLARE_LEGACY_DEVICE(APOLLO_MONO19I, apollo_mono19i);
+
+#define MCFG_APOLLO_MONO19I_ADD(_tag) \
+ MCFG_FRAGMENT_ADD(apollo_mono19i) \
+ MCFG_DEVICE_ADD(_tag, APOLLO_MONO19I, 0)
+
+DEVICE_GET_INFO( apollo_mono19i );
+
+MACHINE_CONFIG_EXTERN( apollo_mono19i );
+
+DECLARE_LEGACY_DEVICE(APOLLO_MONO15I, apollo_mono15i);
+
+#define MCFG_APOLLO_MONO15I_ADD( _tag) \
+ MCFG_FRAGMENT_ADD(apollo_mono15i) \
+ MCFG_DEVICE_ADD(_tag, APOLLO_MONO15I, 0)
+
+DEVICE_GET_INFO( apollo_mono15i );
+
+MACHINE_CONFIG_EXTERN( apollo_mono15i );
+
+READ16_DEVICE_HANDLER( apollo_mcr_r ) ;
+WRITE16_DEVICE_HANDLER(apollo_mcr_w );
+
+READ16_DEVICE_HANDLER( apollo_mgm_r );
+WRITE16_DEVICE_HANDLER( apollo_mgm_w );
+
+#endif /* APOLLO_H_ */
diff --git a/src/mess/includes/apple1.h b/src/mess/includes/apple1.h
new file mode 100644
index 00000000000..6f50c5abf46
--- /dev/null
+++ b/src/mess/includes/apple1.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ *
+ * includes/apple1.h
+ *
+ ****************************************************************************/
+
+#ifndef APPLE1_H_
+#define APPLE1_H_
+
+#include "imagedev/snapquik.h"
+#include "machine/6821pia.h"
+
+typedef short termchar_t;
+
+typedef struct
+{
+ tilemap_t *tm;
+ int gfx;
+ int blank_char;
+ int char_bits;
+ int num_cols;
+ int num_rows;
+ int (*getcursorcode)(int original_code);
+ int cur_offset;
+ int cur_hidden;
+ termchar_t mem[1];
+} terminal_t;
+
+
+class apple1_state : public driver_device
+{
+public:
+ apple1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ int m_vh_clrscrn_pressed;
+ int m_kbd_data;
+ UINT32 m_kbd_last_scan[4];
+ int m_reset_flag;
+ int m_cassette_output_flipflop;
+ terminal_t *m_current_terminal;
+ terminal_t *m_terminal;
+ int m_blink_on;
+ DECLARE_READ8_MEMBER(apple1_cassette_r);
+ DECLARE_WRITE8_MEMBER(apple1_cassette_w);
+ DECLARE_DRIVER_INIT(apple1);
+};
+
+
+/*----------- defined in machine/apple1.c -----------*/
+
+extern const pia6821_interface apple1_pia0;
+
+MACHINE_RESET( apple1 );
+SNAPSHOT_LOAD( apple1 );
+
+
+
+/*----------- defined in video/apple1.c -----------*/
+
+VIDEO_START( apple1 );
+SCREEN_UPDATE_IND16( apple1 );
+
+void apple1_vh_dsp_w (running_machine &machine, int data);
+void apple1_vh_dsp_clr (running_machine &machine);
+attotime apple1_vh_dsp_time_to_ready (running_machine &machine);
+
+
+
+/*----------- defined in drivers/apple1.c -----------*/
+
+extern const gfx_layout apple1_charlayout;
+
+
+#endif /* APPLE1_H_ */
diff --git a/src/mess/includes/apple2.h b/src/mess/includes/apple2.h
new file mode 100644
index 00000000000..ce54dcacd2b
--- /dev/null
+++ b/src/mess/includes/apple2.h
@@ -0,0 +1,287 @@
+/***************************************************************************
+
+ includes/apple2.h
+
+ Include file to handle emulation of the Apple II series.
+
+***************************************************************************/
+
+#ifndef APPLE2_H_
+#define APPLE2_H_
+
+#include "machine/a2bus.h"
+#include "machine/a2eauxslot.h"
+#include "machine/applefdc.h"
+#include "machine/ram.h"
+
+#define AUXSLOT_TAG "auxbus"
+
+/***************************************************************************
+ SOFTSWITCH VALUES
+***************************************************************************/
+
+#define VAR_80STORE 0x000001
+#define VAR_RAMRD 0x000002
+#define VAR_RAMWRT 0x000004
+#define VAR_INTCXROM 0x000008
+#define VAR_ALTZP 0x000010
+#define VAR_SLOTC3ROM 0x000020
+#define VAR_80COL 0x000040
+#define VAR_ALTCHARSET 0x000080
+#define VAR_TEXT 0x000100
+#define VAR_MIXED 0x000200
+#define VAR_PAGE2 0x000400
+#define VAR_HIRES 0x000800
+#define VAR_AN0 0x001000
+#define VAR_AN1 0x002000
+#define VAR_AN2 0x004000
+#define VAR_AN3 0x008000
+#define VAR_LCRAM 0x010000
+#define VAR_LCRAM2 0x020000
+#define VAR_LCWRITE 0x040000
+#define VAR_ROMSWITCH 0x080000
+#define VAR_TK2000RAM 0x100000 // ROM/RAM switch for TK2000
+
+#define VAR_DHIRES VAR_AN3
+
+
+/***************************************************************************
+ SPECIAL KEYS
+***************************************************************************/
+
+#define SPECIALKEY_CAPSLOCK 0x01
+#define SPECIALKEY_SHIFT 0x06
+#define SPECIALKEY_CONTROL 0x08
+#define SPECIALKEY_BUTTON0 0x10 /* open apple */
+#define SPECIALKEY_BUTTON1 0x20 /* closed apple */
+#define SPECIALKEY_BUTTON2 0x40
+#define SPECIALKEY_RESET 0x80
+
+
+/***************************************************************************
+ OTHER
+***************************************************************************/
+
+/* -----------------------------------------------------------------------
+ * New Apple II memory manager
+ * ----------------------------------------------------------------------- */
+
+#define APPLE2_MEM_AUX 0x40000000
+#define APPLE2_MEM_SLOT 0x80000000
+#define APPLE2_MEM_ROM 0xC0000000
+#define APPLE2_MEM_FLOATING 0xFFFFFFFF
+#define APPLE2_MEM_MASK 0x00FFFFFF
+
+typedef enum
+{
+ APPLE_II, // Apple II/II+
+ APPLE_IIEPLUS, // Apple IIe/IIc/IIgs/IIc+
+ TK2000, // Microdigital TK2000
+ LASER128, // Laser 128/128EX/128EX2
+ SPACE84 // "Space 84" with flipped text mode
+} machine_type_t;
+
+typedef enum
+{
+ A2MEM_IO = 0, /* this is always handlers; never banked memory */
+ A2MEM_MONO = 1, /* this is a bank where read and write are always in unison */
+ A2MEM_DUAL = 2 /* this is a bank where read and write can go different places */
+} bank_disposition_t;
+
+typedef struct _apple2_meminfo apple2_meminfo;
+struct _apple2_meminfo
+{
+ UINT32 read_mem;
+ read8_delegate *read_handler;
+ UINT32 write_mem;
+ write8_delegate *write_handler;
+};
+
+typedef struct _apple2_memmap_entry apple2_memmap_entry;
+struct _apple2_memmap_entry
+{
+ offs_t begin;
+ offs_t end;
+ void (*get_meminfo)(running_machine &machine, offs_t begin, offs_t end, apple2_meminfo *meminfo);
+ bank_disposition_t bank_disposition;
+};
+
+typedef struct _apple2_memmap_config apple2_memmap_config;
+struct _apple2_memmap_config
+{
+ int first_bank;
+ UINT8 *auxmem;
+ UINT32 auxmem_length;
+ const apple2_memmap_entry *memmap;
+};
+
+class apple2_state : public driver_device
+{
+public:
+ apple2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ram(*this, RAM_TAG),
+ m_a2bus(*this, "a2bus"),
+ m_a2eauxslot(*this, AUXSLOT_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+ required_device<a2bus_device> m_a2bus;
+ optional_device<a2eauxslot_device> m_a2eauxslot;
+
+ UINT32 m_flags, m_flags_mask;
+ INT32 m_a2_cnxx_slot;
+ UINT32 m_a2_mask;
+ UINT32 m_a2_set;
+ int m_a2_speaker_state;
+ double m_joystick_x1_time;
+ double m_joystick_y1_time;
+ double m_joystick_x2_time;
+ double m_joystick_y2_time;
+ apple2_memmap_config m_mem_config;
+ apple2_meminfo *m_current_meminfo;
+ int m_fdc_diskreg;
+ unsigned int *m_ay3600_keys;
+ UINT8 m_keycode;
+ UINT8 m_keycode_unmodified;
+ UINT8 m_keywaiting;
+ UINT8 m_keystilldown;
+ UINT8 m_keymodreg;
+ int m_reset_flag;
+ int m_last_key;
+ int m_last_key_unmodified;
+ unsigned int m_time_until_repeat;
+ const UINT8 *m_a2_videoram;
+ UINT32 m_a2_videomask;
+ UINT32 m_old_a2;
+ int m_fgcolor;
+ int m_bgcolor;
+ int m_flash;
+ int m_alt_charset_value;
+ UINT16 *m_hires_artifact_map;
+ UINT16 *m_dhires_artifact_map;
+ bool m_monochrome_dhr;
+ int m_inh_slot;
+
+ UINT8 *m_rambase;
+
+ machine_type_t m_machinetype;
+
+ READ8_MEMBER(apple2_c0xx_r);
+ WRITE8_MEMBER(apple2_c0xx_w);
+ READ8_MEMBER(apple2_c080_r);
+ WRITE8_MEMBER(apple2_c080_w);
+
+ READ8_MEMBER ( apple2_c00x_r );
+ READ8_MEMBER ( apple2_c01x_r );
+ READ8_MEMBER ( apple2_c02x_r );
+ READ8_MEMBER ( apple2_c03x_r );
+ READ8_MEMBER ( apple2_c05x_r );
+ READ8_MEMBER ( apple2_c06x_r );
+ READ8_MEMBER ( apple2_c07x_r );
+ WRITE8_MEMBER ( apple2_c00x_w );
+ WRITE8_MEMBER ( apple2_c01x_w );
+ WRITE8_MEMBER ( apple2_c02x_w );
+ WRITE8_MEMBER ( apple2_c03x_w );
+ WRITE8_MEMBER ( apple2_c05x_w );
+ WRITE8_MEMBER ( apple2_c07x_w );
+
+ WRITE8_MEMBER ( apple2_mainram0400_w );
+ WRITE8_MEMBER ( apple2_mainram2000_w );
+ WRITE8_MEMBER ( apple2_auxram0400_w );
+ WRITE8_MEMBER ( apple2_auxram2000_w );
+
+ READ8_MEMBER ( apple2_c1xx_r );
+ WRITE8_MEMBER ( apple2_c1xx_w );
+ READ8_MEMBER ( apple2_c3xx_r );
+ WRITE8_MEMBER ( apple2_c3xx_w );
+ READ8_MEMBER ( apple2_c4xx_r );
+ WRITE8_MEMBER ( apple2_c4xx_w );
+
+ READ8_MEMBER ( apple2_c800_r );
+ WRITE8_MEMBER ( apple2_c800_w );
+ READ8_MEMBER ( apple2_ce00_r );
+ WRITE8_MEMBER ( apple2_ce00_w );
+
+ READ8_MEMBER ( apple2_inh_d000_r );
+ WRITE8_MEMBER ( apple2_inh_d000_w );
+ READ8_MEMBER ( apple2_inh_e000_r );
+ WRITE8_MEMBER ( apple2_inh_e000_w );
+
+ READ8_MEMBER(read_floatingbus);
+
+ READ8_MEMBER(apple2_cfff_r);
+ WRITE8_MEMBER(apple2_cfff_w);
+
+ void apple2_refresh_delegates();
+
+ read8_delegate read_delegates_master[4];
+ write8_delegate write_delegates_master[3];
+ write8_delegate write_delegates_0400[2];
+ write8_delegate write_delegates_2000[2];
+ read8_delegate rd_c000;
+ write8_delegate wd_c000;
+ read8_delegate rd_c080;
+ write8_delegate wd_c080;
+ read8_delegate rd_cfff;
+ write8_delegate wd_cfff;
+ read8_delegate rd_c800;
+ write8_delegate wd_c800;
+ read8_delegate rd_ce00;
+ write8_delegate wd_ce00;
+ read8_delegate rd_inh_d000;
+ write8_delegate wd_inh_d000;
+ read8_delegate rd_inh_e000;
+ write8_delegate wd_inh_e000;
+};
+
+
+/*----------- defined in drivers/apple2.c -----------*/
+
+INPUT_PORTS_EXTERN( apple2ep );
+PALETTE_INIT( apple2 );
+
+
+/*----------- defined in machine/apple2.c -----------*/
+
+extern const applefdc_interface apple2_fdc_interface;
+
+void apple2_iwm_setdiskreg(running_machine &machine, UINT8 data);
+UINT8 apple2_iwm_getdiskreg(running_machine &machine);
+
+void apple2_init_common(running_machine &machine);
+MACHINE_START( apple2 );
+MACHINE_START( apple2orig );
+MACHINE_START( tk2000 );
+MACHINE_START( laser128 );
+MACHINE_START( space84 );
+UINT8 apple2_getfloatingbusvalue(running_machine &machine);
+READ8_HANDLER( apple2_c0xx_r );
+WRITE8_HANDLER( apple2_c0xx_w );
+READ8_HANDLER( apple2_c080_r );
+WRITE8_HANDLER( apple2_c080_w );
+
+TIMER_DEVICE_CALLBACK( apple2_interrupt );
+
+INT8 apple2_slotram_r(running_machine &machine, int slotnum, int offset);
+
+void apple2_setvar(running_machine &machine, UINT32 val, UINT32 mask);
+
+int apple2_pressed_specialkey(running_machine &machine, UINT8 key);
+
+void apple2_setup_memory(running_machine &machine, const apple2_memmap_config *config);
+void apple2_update_memory(running_machine &machine);
+
+
+
+/*----------- defined in video/apple2.c -----------*/
+
+void apple2_video_start(running_machine &machine, const UINT8 *vram, size_t vram_size, UINT32 ignored_softswitches, int hires_modulo);
+VIDEO_START( apple2 );
+VIDEO_START( apple2p );
+VIDEO_START( apple2e );
+SCREEN_UPDATE_IND16( apple2 );
+
+#endif /* APPLE2_H_ */
diff --git a/src/mess/includes/apple2gs.h b/src/mess/includes/apple2gs.h
new file mode 100644
index 00000000000..dd7f7a975d6
--- /dev/null
+++ b/src/mess/includes/apple2gs.h
@@ -0,0 +1,156 @@
+/*****************************************************************************
+ *
+ * includes/apple2gs.h
+ *
+ * Apple IIgs
+ *
+ ****************************************************************************/
+
+#ifndef APPLE2GS_H_
+#define APPLE2GS_H_
+
+#include "includes/apple2.h"
+#include "sound/es5503.h"
+#include "machine/nvram.h"
+
+// IIgs clocks as marked on the schematics
+#define APPLE2GS_28M (XTAL_28_63636MHz) // IIGS master clock
+#define APPLE2GS_14M (APPLE2GS_28M/2)
+#define APPLE2GS_7M (APPLE2GS_28M/4)
+
+// screen dimensions
+#define BORDER_LEFT (32)
+#define BORDER_RIGHT (32)
+#define BORDER_TOP (16) // (plus bottom)
+
+
+typedef enum
+{
+ CLOCKMODE_IDLE,
+ CLOCKMODE_TIME,
+ CLOCKMODE_INTERNALREGS,
+ CLOCKMODE_BRAM1,
+ CLOCKMODE_BRAM2
+} apple2gs_clock_mode;
+
+
+typedef enum
+{
+ ADBSTATE_IDLE,
+ ADBSTATE_INCOMMAND,
+ ADBSTATE_INRESPONSE
+} adbstate_t;
+
+#define IRQ_KBD_SRQ 0x01
+#define IRQ_ADB_DATA 0x02
+#define IRQ_ADB_MOUSE 0x04
+#define IRQ_VGC_SCANLINE 0x08
+#define IRQ_VGC_SECOND 0x10
+#define IRQ_INTEN_QSECOND 0x20
+#define IRQ_INTEN_VBL 0x40
+#define IRQ_DOC 0x80
+#define IRQ_SLOT 0x100
+
+void apple2gs_add_irq(running_machine &machine, UINT16 irq_mask);
+void apple2gs_remove_irq(running_machine &machine, UINT16 irq_mask);
+
+class apple2gs_state : public apple2_state
+{
+public:
+ apple2gs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : apple2_state(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_es5503(*this, "es5503"),
+ m_fdc(*this, "fdc")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<es5503_device> m_es5503;
+ required_device<device_t> m_fdc;
+
+ UINT8 *m_slowmem;
+ UINT8 m_newvideo;
+ UINT16 m_bordercolor;
+ UINT8 m_vgcint;
+ UINT8 m_langsel;
+ UINT8 m_sltromsel;
+ UINT8 m_cyareg;
+ UINT8 m_inten;
+ UINT8 m_intflag;
+ UINT8 m_shadow;
+ UINT16 m_pending_irqs;
+ UINT8 m_mouse_x;
+ UINT8 m_mouse_y;
+ INT8 m_mouse_dx;
+ INT8 m_mouse_dy;
+ device_t *m_cur_slot6_image;
+ emu_timer *m_scanline_timer;
+ emu_timer *m_clock_timer;
+ emu_timer *m_qsecond_timer;
+ UINT8 m_clock_data;
+ UINT8 m_clock_control;
+ UINT8 m_clock_read;
+ UINT8 m_clock_reg1;
+ apple2gs_clock_mode m_clock_mode;
+ UINT32 m_clock_curtime;
+ seconds_t m_clock_curtime_interval;
+ UINT8 m_clock_bram[256];
+ adbstate_t m_adb_state;
+ UINT8 m_adb_command;
+ UINT8 m_adb_mode;
+ UINT8 m_adb_kmstatus;
+ UINT8 m_adb_latent_result;
+ INT32 m_adb_command_length;
+ INT32 m_adb_command_pos;
+ UINT8 m_adb_command_bytes[8];
+ UINT8 m_adb_response_bytes[8];
+ UINT8 m_adb_response_length;
+ INT32 m_adb_response_pos;
+ UINT8 m_adb_memory[0x100];
+ int m_adb_address_keyboard;
+ int m_adb_address_mouse;
+ UINT8 m_sndglu_ctrl;
+ int m_sndglu_addr;
+ int m_sndglu_dummy_read;
+ bitmap_ind16 *m_legacy_gfx;
+ bool m_is_rom3;
+ UINT8 m_echo_bank;
+
+ DECLARE_DIRECT_UPDATE_MEMBER(apple2gs_opbase);
+
+ READ8_MEMBER( apple2gs_c0xx_r );
+ WRITE8_MEMBER( apple2gs_c0xx_w );
+ WRITE8_MEMBER( apple2gs_main0400_w );
+ WRITE8_MEMBER( apple2gs_aux0400_w );
+ WRITE8_MEMBER( apple2gs_main2000_w );
+ WRITE8_MEMBER( apple2gs_aux2000_w );
+ WRITE8_MEMBER( apple2gs_main4000_w );
+ WRITE8_MEMBER( apple2gs_aux4000_w );
+
+ UINT8 adb_read_datareg();
+ UINT8 adb_read_kmstatus();
+
+ void apple2gs_refresh_delegates();
+
+ write8_delegate write_delegates_2gs0400[2];
+ write8_delegate write_delegates_2gs2000[2];
+ write8_delegate write_delegates_2gs4000[2];
+};
+
+
+/*----------- defined in machine/apple2gs.c -----------*/
+
+MACHINE_START( apple2gs );
+MACHINE_START( apple2gsr1 );
+MACHINE_RESET( apple2gs );
+
+void apple2gs_doc_irq(device_t *device, int state);
+
+
+/*----------- defined in video/apple2gs.c -----------*/
+
+VIDEO_START( apple2gs );
+SCREEN_UPDATE_IND16( apple2gs );
+
+
+#endif /* APPLE2GS_H_ */
diff --git a/src/mess/includes/apple3.h b/src/mess/includes/apple3.h
new file mode 100644
index 00000000000..e815ba191d8
--- /dev/null
+++ b/src/mess/includes/apple3.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ *
+ * includes/apple3.h
+ *
+ * Apple ///
+ *
+ ****************************************************************************/
+
+#ifndef APPLE3_H_
+#define APPLE3_H_
+
+#include "includes/apple2.h"
+#include "machine/applefdc.h"
+#include "machine/6522via.h"
+
+#define VAR_VM0 0x0001
+#define VAR_VM1 0x0002
+#define VAR_VM2 0x0004
+#define VAR_VM3 0x0008
+#define VAR_EXTA0 0x0010
+#define VAR_EXTA1 0x0020
+#define VAR_EXTPOWER 0x0040
+#define VAR_EXTSIDE 0x0080
+
+
+class apple3_state : public apple2_state
+{
+public:
+ apple3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : apple2_state(mconfig, type, tag) { }
+
+ UINT32 m_flags;
+ UINT8 m_via_0_a;
+ UINT8 m_via_0_b;
+ UINT8 m_via_1_a;
+ UINT8 m_via_1_b;
+ int m_via_1_irq;
+ int m_enable_mask;
+ offs_t m_zpa;
+ int m_profile_lastaddr;
+ UINT8 m_profile_gotstrobe;
+ UINT8 m_profile_readdata;
+ UINT8 m_profile_busycount;
+ UINT8 m_profile_busy;
+ UINT8 m_profile_online;
+ UINT8 m_profile_writedata;
+ UINT8 m_last_n;
+ UINT8 *m_char_mem;
+ UINT32 *m_hgr_map;
+ DECLARE_READ8_MEMBER(apple3_c0xx_r);
+ DECLARE_WRITE8_MEMBER(apple3_c0xx_w);
+ DECLARE_READ8_MEMBER(apple3_00xx_r);
+ DECLARE_WRITE8_MEMBER(apple3_00xx_w);
+ DECLARE_READ8_MEMBER(apple3_indexed_read);
+ DECLARE_WRITE8_MEMBER(apple3_indexed_write);
+ UINT8 apple3_profile_r(offs_t offset);
+ void apple3_profile_w(offs_t offset, UINT8 data);
+ DECLARE_DIRECT_UPDATE_MEMBER(apple3_opbase);
+ DECLARE_DRIVER_INIT(apple3);
+};
+
+
+/*----------- defined in machine/apple3.c -----------*/
+
+extern const applefdc_interface apple3_fdc_interface;
+extern const via6522_interface apple3_via_0_intf;
+extern const via6522_interface apple3_via_1_intf;
+
+MACHINE_RESET( apple3 );
+INTERRUPT_GEN( apple3_interrupt );
+
+
+
+
+/*----------- defined in video/apple3.c -----------*/
+
+VIDEO_START( apple3 );
+SCREEN_UPDATE_IND16( apple3 );
+void apple3_write_charmem(running_machine &machine);
+
+
+#endif /* APPLE3_H_ */
diff --git a/src/mess/includes/apricotf.h b/src/mess/includes/apricotf.h
new file mode 100644
index 00000000000..b9fefdb3a4a
--- /dev/null
+++ b/src/mess/includes/apricotf.h
@@ -0,0 +1,83 @@
+#pragma once
+
+#ifndef __APRICOTF__
+#define __APRICOTF__
+
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/z80/z80daisy.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/apricotkb.h"
+#include "machine/ctronics.h"
+#include "machine/wd17xx.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dart.h"
+#include "rendlay.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define SCREEN_TAG "screen"
+#define I8086_TAG "10d"
+#define Z80CTC_TAG "13d"
+#define Z80SIO2_TAG "15d"
+#define WD2797_TAG "5f"
+#define CENTRONICS_TAG "centronics"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> f1_state
+
+class f1_state : public driver_device
+{
+public:
+ f1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8086_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_sio(*this, Z80SIO2_TAG),
+ m_fdc(*this, WD2797_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ctc_int(CLEAR_LINE),
+ m_sio_int(CLEAR_LINE),
+ m_p_scrollram(*this, "p_scrollram"),
+ m_p_paletteram(*this, "p_paletteram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<z80dart_device> m_sio;
+ required_device<device_t> m_fdc;
+ required_device<device_t> m_floppy0;
+ required_device<centronics_device> m_centronics;
+ int m_ctc_int;
+ int m_sio_int;
+ required_shared_ptr<UINT16> m_p_scrollram;
+ required_shared_ptr<UINT16> m_p_paletteram;
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ16_MEMBER( palette_r );
+ DECLARE_WRITE16_MEMBER( palette_w );
+ DECLARE_WRITE8_MEMBER( system_w );
+ DECLARE_WRITE_LINE_MEMBER( sio_int_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_int_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
+
+ int m_40_80;
+ int m_200_256;
+};
+
+
+
+#endif
diff --git a/src/mess/includes/apricotp.h b/src/mess/includes/apricotp.h
new file mode 100644
index 00000000000..d027df01783
--- /dev/null
+++ b/src/mess/includes/apricotp.h
@@ -0,0 +1,110 @@
+#pragma once
+
+#ifndef __APRICOTP__
+#define __APRICOTP__
+
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/m6800/m6800.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/am9517a.h"
+#include "machine/apricotkb.h"
+#include "machine/ctronics.h"
+#include "machine/pic8259.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "machine/wd17xx.h"
+#include "machine/z80dart.h"
+#include "sound/sn76496.h"
+#include "video/mc6845.h"
+#include "rendlay.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define I8086_TAG "ic7"
+#define I8284_TAG "ic30"
+#define I8237_TAG "ic17"
+#define I8259A_TAG "ic51"
+#define I8253A5_TAG "ic20"
+#define TMS4500_TAG "ic42"
+#define MC6845_TAG "ic69"
+#define HD63B01V1_TAG "ic29"
+#define AD7574_TAG "ic34"
+#define AD1408_TAG "ic37"
+#define Z80SIO0_TAG "ic6"
+#define WD2797_TAG "ic5"
+#define SN76489AN_TAG "ic13"
+#define CENTRONICS_TAG "centronics"
+#define SCREEN_LCD_TAG "screen0"
+#define SCREEN_CRT_TAG "screen1"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> fp_state
+
+class fp_state : public driver_device
+{
+public:
+ fp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8086_TAG),
+ m_soundcpu(*this, HD63B01V1_TAG),
+ m_dmac(*this, I8237_TAG),
+ m_pic(*this, I8259A_TAG),
+ m_pit(*this, I8253A5_TAG),
+ m_sio(*this, Z80SIO0_TAG),
+ m_fdc(*this, WD2797_TAG),
+ m_crtc(*this, MC6845_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_centronics(*this, CENTRONICS_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_soundcpu;
+ required_device<am9517a_device> m_dmac;
+ required_device<device_t> m_pic;
+ required_device<device_t> m_pit;
+ required_device<z80dart_device> m_sio;
+ required_device<device_t> m_fdc;
+ required_device<mc6845_device> m_crtc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<centronics_device> m_centronics;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ16_MEMBER( mem_r );
+ DECLARE_WRITE16_MEMBER( mem_w );
+ DECLARE_READ8_MEMBER( prtr_snd_r );
+ DECLARE_WRITE8_MEMBER( pint_clr_w );
+ DECLARE_WRITE8_MEMBER( ls_w );
+ DECLARE_WRITE8_MEMBER( contrast_w );
+ DECLARE_WRITE8_MEMBER( palette_w );
+ DECLARE_WRITE16_MEMBER( video_w );
+ DECLARE_WRITE_LINE_MEMBER( busy_w );
+
+ UINT16 *m_work_ram;
+
+ // video state
+ UINT16 *m_video_ram;
+ UINT8 m_video;
+};
+
+
+
+#endif
diff --git a/src/mess/includes/aquarius.h b/src/mess/includes/aquarius.h
new file mode 100644
index 00000000000..2c0f1eb6695
--- /dev/null
+++ b/src/mess/includes/aquarius.h
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ *
+ * includes/aquarius.h
+ *
+ ****************************************************************************/
+
+#ifndef __AQUARIUS__
+#define __AQUARIUS__
+
+class aquarius_state : public driver_device
+{
+public:
+ aquarius_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_videoram(*this, "videoram"),
+ m_colorram(*this, "colorram"){ }
+
+ required_shared_ptr<UINT8> m_videoram;
+ UINT8 m_scrambler;
+ required_shared_ptr<UINT8> m_colorram;
+ tilemap_t *m_tilemap;
+ DECLARE_WRITE8_MEMBER(aquarius_videoram_w);
+ DECLARE_WRITE8_MEMBER(aquarius_colorram_w);
+ DECLARE_READ8_MEMBER(cassette_r);
+ DECLARE_WRITE8_MEMBER(cassette_w);
+ DECLARE_READ8_MEMBER(vsync_r);
+ DECLARE_WRITE8_MEMBER(mapper_w);
+ DECLARE_READ8_MEMBER(printer_r);
+ DECLARE_WRITE8_MEMBER(printer_w);
+ DECLARE_READ8_MEMBER(keyboard_r);
+ DECLARE_WRITE8_MEMBER(scrambler_w);
+ DECLARE_READ8_MEMBER(cartridge_r);
+ DECLARE_READ8_MEMBER(floppy_r);
+ DECLARE_WRITE8_MEMBER(floppy_w);
+ DECLARE_DRIVER_INIT(aquarius);
+};
+
+
+/*----------- defined in video/aquarius.c -----------*/
+
+
+PALETTE_INIT( aquarius );
+VIDEO_START( aquarius );
+SCREEN_UPDATE_IND16( aquarius );
+
+#endif /* AQUARIUS_H_ */
diff --git a/src/mess/includes/arcadia.h b/src/mess/includes/arcadia.h
new file mode 100644
index 00000000000..49e76ffa06a
--- /dev/null
+++ b/src/mess/includes/arcadia.h
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ *
+ * includes/arcadia.h
+ *
+ ****************************************************************************/
+
+#ifndef ARCADIA_H_
+#define ARCADIA_H_
+
+#include "emu.h"
+#include "cpu/s2650/s2650.h"
+#include "imagedev/cartslot.h"
+#include "audio/arcadia.h"
+
+
+// space vultures sprites above
+// combat below and invisible
+#define YPOS 0
+//#define YBOTTOM_SIZE 24
+// grand slam sprites left and right
+// space vultures left
+// space attack left
+#define XPOS 32
+
+
+class arcadia_state : public driver_device
+{
+public:
+ arcadia_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ { }
+
+ DECLARE_READ8_MEMBER(arcadia_vsync_r);
+ DECLARE_READ8_MEMBER(arcadia_video_r);
+ DECLARE_WRITE8_MEMBER(arcadia_video_w);
+ int m_line;
+ int m_charline;
+ int m_shift;
+ int m_ad_delay;
+ int m_ad_select;
+ int m_ypos;
+ int m_graphics;
+ int m_doublescan;
+ int m_lines26;
+ int m_multicolor;
+ struct { int x, y; } m_pos[4];
+ UINT8 m_bg[262][16+2*XPOS/8];
+ UINT8 m_rectangle[0x40][8];
+ UINT8 m_chars[0x40][8];
+ int m_breaker;
+ union
+ {
+ UINT8 data[0x400];
+ struct
+ {
+ // 0x1800
+ UINT8 chars1[13][16];
+ UINT8 ram1[2][16];
+ struct { UINT8 y,x; } pos[4];
+ UINT8 ram2[4];
+ UINT8 vpos;
+ UINT8 sound1, sound2;
+ UINT8 char_line;
+ // 0x1900
+ UINT8 pad1a, pad1b, pad1c, pad1d;
+ UINT8 pad2a, pad2b, pad2c, pad2d;
+ UINT8 keys, unmapped3[0x80-9];
+ UINT8 chars[8][8];
+ UINT8 unknown[0x38];
+ UINT8 pal[4];
+ UINT8 collision_bg,
+ collision_sprite;
+ UINT8 ad[2];
+ // 0x1a00
+ UINT8 chars2[13][16];
+ UINT8 ram3[3][16];
+ } d;
+ } m_reg;
+ bitmap_ind16 *m_bitmap;
+ DECLARE_DRIVER_INIT(arcadia);
+};
+
+
+/*----------- defined in video/arcadia.c -----------*/
+
+extern INTERRUPT_GEN( arcadia_video_line );
+extern VIDEO_START( arcadia );
+extern SCREEN_UPDATE_IND16( arcadia );
+
+#endif /* ARCADIA_H_ */
diff --git a/src/mess/includes/at.h b/src/mess/includes/at.h
new file mode 100644
index 00000000000..674caeb5066
--- /dev/null
+++ b/src/mess/includes/at.h
@@ -0,0 +1,195 @@
+/*****************************************************************************
+ *
+ * includes/at.h
+ *
+ * IBM AT Compatibles
+ *
+ ****************************************************************************/
+
+#ifndef AT_H_
+#define AT_H_
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/i86/i286.h"
+#include "cpu/i386/i386.h"
+
+#include "machine/ins8250.h"
+#include "machine/mc146818.h"
+#include "machine/pic8259.h"
+#include "machine/i82371ab.h"
+#include "machine/i82371sb.h"
+#include "machine/i82439tx.h"
+#include "machine/cs4031.h"
+#include "machine/cs8221.h"
+#include "machine/pit8253.h"
+#include "video/pc_cga.h"
+#include "video/isa_cga.h"
+#include "video/isa_ega.h"
+#include "video/isa_svga_cirrus.h"
+#include "video/isa_svga_s3.h"
+#include "video/isa_svga_tseng.h"
+
+#include "machine/idectrl.h"
+#include "machine/isa_aha1542.h"
+#include "machine/at_keybc.h"
+#include "includes/ps2.h"
+
+#include "imagedev/harddriv.h"
+#include "machine/am9517a.h"
+#include "machine/pci.h"
+#include "machine/kb_keytro.h"
+
+#include "sound/dac.h"
+#include "sound/speaker.h"
+#include "machine/ram.h"
+#include "machine/nvram.h"
+#include "machine/isa.h"
+
+#include "machine/isa_adlib.h"
+#include "machine/isa_com.h"
+#include "machine/isa_fdc.h"
+#include "machine/isa_gblaster.h"
+#include "machine/isa_hdc.h"
+#include "machine/isa_sblaster.h"
+#include "machine/isa_gus.h"
+#include "machine/3c503.h"
+#include "machine/ne1000.h"
+#include "machine/ne2000.h"
+#include "video/isa_mda.h"
+#include "machine/isa_mpu401.h"
+#include "machine/isa_ibm_mfc.h"
+
+#include "machine/isa_ide.h"
+#include "machine/isa_ide_cd.h"
+
+#include "machine/pc_lpt.h"
+#include "machine/pc_kbdc.h"
+
+
+class at586_state : public driver_device
+{
+public:
+ at586_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+};
+
+class at_state : public driver_device
+{
+public:
+ at_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pic8259_master(*this, "pic8259_master"),
+ m_pic8259_slave(*this, "pic8259_slave"),
+ m_dma8237_1(*this, "dma8237_1"),
+ m_dma8237_2(*this, "dma8237_2"),
+ m_pit8254(*this, "pit8254"),
+ m_cs8221(*this, "cs8221"),
+ m_cs4031(*this, "cs4031"),
+ m_ide(*this, "ide"),
+ m_keybc(*this, "keybc"),
+ m_isabus(*this, "isabus"),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG),
+ m_mc146818(*this, "rtc"),
+ m_pc_kbdc(*this, "pc_kbdc")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<device_t> m_pic8259_master;
+ optional_device<device_t> m_pic8259_slave;
+ optional_device<am9517a_device> m_dma8237_1;
+ optional_device<am9517a_device> m_dma8237_2;
+ optional_device<device_t> m_pit8254;
+ optional_device<cs8221_device> m_cs8221;
+ optional_device<cs4031_device> m_cs4031;
+ optional_device<device_t> m_ide;
+ optional_device<at_keyboard_controller_device> m_keybc;
+ optional_device<isa16_device> m_isabus;
+ required_device<device_t> m_speaker;
+ optional_device<device_t> m_ram;
+ optional_device<mc146818_device> m_mc146818;
+ optional_device<pc_kbdc_device> m_pc_kbdc;
+ DECLARE_READ8_MEMBER(at_page8_r);
+ DECLARE_WRITE8_MEMBER(at_page8_w);
+ DECLARE_READ8_MEMBER(at_portb_r);
+ DECLARE_WRITE8_MEMBER(at_portb_w);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ DECLARE_WRITE_LINE_MEMBER(at_pit8254_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(at_pit8254_out2_changed);
+ DECLARE_WRITE_LINE_MEMBER(pc_dma_hrq_changed);
+ DECLARE_READ8_MEMBER(pc_dma8237_0_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_1_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_2_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_3_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_5_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_6_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_7_dack_r);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_0_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_1_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_2_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_3_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_5_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_6_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_7_dack_w);
+ DECLARE_WRITE_LINE_MEMBER(at_dma8237_out_eop);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack0_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack1_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack2_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack3_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack4_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack5_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack6_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack7_w);
+ DECLARE_READ32_MEMBER(ide_r);
+ DECLARE_WRITE32_MEMBER(ide_w);
+ DECLARE_READ8_MEMBER(at_dma8237_2_r);
+ DECLARE_WRITE8_MEMBER(at_dma8237_2_w);
+ DECLARE_READ8_MEMBER(at_keybc_r);
+ DECLARE_WRITE8_MEMBER(at_keybc_w);
+ DECLARE_READ16_MEMBER(neat_chipset_r);
+ DECLARE_WRITE16_MEMBER(neat_chipset_w);
+ DECLARE_READ32_MEMBER(ct486_chipset_r);
+ DECLARE_WRITE32_MEMBER(ct486_chipset_w);
+ DECLARE_WRITE_LINE_MEMBER(at_mc146818_irq);
+ DECLARE_WRITE8_MEMBER(write_rtc);
+ int m_poll_delay;
+ UINT8 m_at_spkrdata;
+ UINT8 m_at_speaker_input;
+ int m_dma_channel;
+ UINT8 m_dma_offset[2][4];
+ UINT8 m_at_pages[0x10];
+ UINT16 m_dma_high_byte;
+ UINT8 m_at_speaker;
+ UINT8 m_at_offset1;
+ void at_speaker_set_spkrdata(UINT8 data);
+ void at_speaker_set_input(UINT8 data);
+
+ UINT8 m_channel_check;
+ UINT8 m_nmi_enabled;
+ DECLARE_READ8_MEMBER(pc_dma_read_byte);
+ DECLARE_WRITE8_MEMBER(pc_dma_write_byte);
+ DECLARE_READ8_MEMBER(pc_dma_read_word);
+ DECLARE_WRITE8_MEMBER(pc_dma_write_word);
+
+ DECLARE_DRIVER_INIT(atcga);
+ DECLARE_DRIVER_INIT(atvga);
+};
+
+
+/*----------- defined in machine/at.c -----------*/
+
+extern const struct pic8259_interface at_pic8259_master_config;
+extern const struct pic8259_interface at_pic8259_slave_config;
+extern const struct pit8253_config at_pit8254_config;
+extern const am9517a_interface at_dma8237_1_config;
+extern const am9517a_interface at_dma8237_2_config;
+
+
+
+MACHINE_START( at );
+MACHINE_RESET( at );
+
+
+#endif /* AT_H_ */
diff --git a/src/mess/includes/atarist.h b/src/mess/includes/atarist.h
new file mode 100644
index 00000000000..fbfc8b90e36
--- /dev/null
+++ b/src/mess/includes/atarist.h
@@ -0,0 +1,394 @@
+#pragma once
+
+#ifndef __ATARI_ST__
+#define __ATARI_ST__
+
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+#include "cpu/m6800/m6800.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/floppy.h"
+#include "machine/ram.h"
+#include "machine/6850acia.h"
+#include "machine/8530scc.h"
+#include "machine/ctronics.h"
+#include "machine/mc68901.h"
+#include "machine/rescap.h"
+#include "machine/rp5c15.h"
+#include "machine/wd1772.h"
+#include "sound/ay8910.h"
+#include "sound/lmc1992.h"
+
+#define M68000_TAG "m68000"
+#define HD6301V1_TAG "hd6301"
+#define YM2149_TAG "ym2149"
+#define MC6850_0_TAG "mc6850_0"
+#define MC6850_1_TAG "mc6850_1"
+#define Z8530_TAG "z8530"
+#define COP888_TAG "u703"
+#define RP5C15_TAG "rp5c15"
+#define YM3439_TAG "ym3439"
+#define MC68901_TAG "mc68901"
+#define LMC1992_TAG "lmc1992"
+#define WD1772_TAG "wd1772"
+#define SCREEN_TAG "screen"
+#define CENTRONICS_TAG "centronics"
+#define RS232_TAG "rs232"
+
+// Atari ST
+
+#define Y1 XTAL_2_4576MHz
+
+// STBook
+
+#define U517 XTAL_16MHz
+#define Y200 XTAL_2_4576MHz
+#define Y700 XTAL_10MHz
+
+#define DMA_STATUS_DRQ 0x04
+#define DMA_STATUS_SECTOR_COUNT 0x02
+#define DMA_STATUS_ERROR 0x01
+
+#define DMA_MODE_READ_WRITE 0x100
+#define DMA_MODE_FDC_HDC_ACK 0x080
+#define DMA_MODE_ENABLED 0x040
+#define DMA_MODE_SECTOR_COUNT 0x010
+#define DMA_MODE_FDC_HDC_CS 0x008
+#define DMA_MODE_A1 0x004
+#define DMA_MODE_A0 0x002
+#define DMA_MODE_ADDRESS_MASK 0x006
+
+#define DMA_SECTOR_SIZE 512
+
+enum
+{
+ IKBD_MOUSE_PHASE_STATIC = 0,
+ IKBD_MOUSE_PHASE_POSITIVE,
+ IKBD_MOUSE_PHASE_NEGATIVE
+};
+
+class st_state : public driver_device
+{
+public:
+ st_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M68000_TAG),
+ m_fdc(*this, WD1772_TAG),
+ m_mfp(*this, MC68901_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ //m_rs232(*this, RS232_TAG),
+ m_ram(*this, RAM_TAG),
+ m_acia_ikbd_irq(1),
+ m_acia_midi_irq(1),
+ m_ikbd_mouse_x(0),
+ m_ikbd_mouse_y(0),
+ m_ikbd_mouse_px(IKBD_MOUSE_PHASE_STATIC),
+ m_ikbd_mouse_py(IKBD_MOUSE_PHASE_STATIC),
+ m_ikbd_mouse_pc(0),
+ m_ikbd_joy(1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<wd1772_t> m_fdc;
+ required_device<mc68901_device> m_mfp;
+ required_device<centronics_device> m_centronics;
+ //required_device<device_t> m_rs232;
+ required_device<ram_device> m_ram;
+
+ void machine_start();
+
+ void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ // video
+ DECLARE_READ8_MEMBER( shifter_base_r );
+ DECLARE_READ8_MEMBER( shifter_counter_r );
+ DECLARE_READ8_MEMBER( shifter_sync_r );
+ DECLARE_READ16_MEMBER( shifter_palette_r );
+ DECLARE_READ8_MEMBER( shifter_mode_r );
+
+ DECLARE_WRITE8_MEMBER( shifter_base_w );
+ DECLARE_WRITE8_MEMBER( shifter_sync_w );
+ DECLARE_WRITE16_MEMBER( shifter_palette_w );
+ DECLARE_WRITE8_MEMBER( shifter_mode_w );
+
+ DECLARE_READ16_MEMBER( blitter_halftone_r );
+ DECLARE_READ16_MEMBER( blitter_src_inc_x_r );
+ DECLARE_READ16_MEMBER( blitter_src_inc_y_r );
+ DECLARE_READ16_MEMBER( blitter_src_r );
+ DECLARE_READ16_MEMBER( blitter_end_mask_r );
+ DECLARE_READ16_MEMBER( blitter_dst_inc_x_r );
+ DECLARE_READ16_MEMBER( blitter_dst_inc_y_r );
+ DECLARE_READ16_MEMBER( blitter_dst_r );
+ DECLARE_READ16_MEMBER( blitter_count_x_r );
+ DECLARE_READ16_MEMBER( blitter_count_y_r );
+ DECLARE_READ16_MEMBER( blitter_op_r );
+ DECLARE_READ16_MEMBER( blitter_ctrl_r );
+
+ DECLARE_WRITE16_MEMBER( blitter_halftone_w );
+ DECLARE_WRITE16_MEMBER( blitter_src_inc_x_w );
+ DECLARE_WRITE16_MEMBER( blitter_src_inc_y_w );
+ DECLARE_WRITE16_MEMBER( blitter_src_w );
+ DECLARE_WRITE16_MEMBER( blitter_end_mask_w );
+ DECLARE_WRITE16_MEMBER( blitter_dst_inc_x_w );
+ DECLARE_WRITE16_MEMBER( blitter_dst_inc_y_w );
+ DECLARE_WRITE16_MEMBER( blitter_dst_w );
+ DECLARE_WRITE16_MEMBER( blitter_count_x_w );
+ DECLARE_WRITE16_MEMBER( blitter_count_y_w );
+ DECLARE_WRITE16_MEMBER( blitter_op_w );
+ DECLARE_WRITE16_MEMBER( blitter_ctrl_w );
+
+ void mouse_tick();
+ inline pen_t shift_mode_0();
+ inline pen_t shift_mode_1();
+ inline pen_t shift_mode_2();
+ void shifter_tick();
+ inline void shifter_load();
+ void glue_tick();
+ void set_screen_parameters();
+ void blitter_source();
+ UINT16 blitter_hop();
+ void blitter_op(UINT16 s, UINT32 dstaddr, UINT16 mask);
+ void blitter_tick();
+
+ // driver
+ DECLARE_READ16_MEMBER( fdc_data_r );
+ DECLARE_WRITE16_MEMBER( fdc_data_w );
+ DECLARE_READ16_MEMBER( dma_status_r );
+ DECLARE_WRITE16_MEMBER( dma_mode_w );
+ DECLARE_READ8_MEMBER( dma_counter_r );
+ DECLARE_WRITE8_MEMBER( dma_base_w );
+ DECLARE_READ8_MEMBER( mmu_r );
+ DECLARE_WRITE8_MEMBER( mmu_w );
+ DECLARE_READ16_MEMBER( berr_r );
+ DECLARE_WRITE16_MEMBER( berr_w );
+ DECLARE_READ8_MEMBER( ikbd_port1_r );
+ DECLARE_READ8_MEMBER( ikbd_port2_r );
+ DECLARE_WRITE8_MEMBER( ikbd_port2_w );
+ DECLARE_WRITE8_MEMBER( ikbd_port3_w );
+ DECLARE_READ8_MEMBER( ikbd_port4_r );
+ DECLARE_WRITE8_MEMBER( ikbd_port4_w );
+
+ void fdc_intrq_w(bool state);
+ void fdc_drq_w(bool state);
+
+ DECLARE_WRITE8_MEMBER( psg_pa_w );
+
+ DECLARE_READ_LINE_MEMBER( ikbd_rx_r );
+ DECLARE_WRITE_LINE_MEMBER( ikbd_tx_w );
+ DECLARE_WRITE_LINE_MEMBER( acia_ikbd_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( acia_midi_irq_w );
+
+ DECLARE_READ8_MEMBER( mfp_gpio_r );
+ DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w );
+
+ void toggle_dma_fifo();
+ void flush_dma_fifo();
+ void fill_dma_fifo();
+ void fdc_dma_transfer();
+
+ void configure_memory();
+ void state_save();
+
+ /* memory state */
+ UINT8 m_mmu;
+
+ /* keyboard state */
+ int m_acia_ikbd_irq;
+ int m_acia_midi_irq;
+ UINT16 m_ikbd_keylatch;
+ UINT8 m_ikbd_mouse;
+ UINT8 m_ikbd_mouse_x;
+ UINT8 m_ikbd_mouse_y;
+ UINT8 m_ikbd_mouse_px;
+ UINT8 m_ikbd_mouse_py;
+ UINT8 m_ikbd_mouse_pc;
+ int m_ikbd_rx;
+ int m_ikbd_tx;
+ int m_ikbd_joy;
+ int m_midi_rx;
+ int m_midi_tx;
+
+ /* floppy state */
+ UINT32 m_dma_base;
+ UINT16 m_dma_error;
+ UINT16 m_fdc_mode;
+ UINT8 m_fdc_sectors;
+ UINT16 m_fdc_fifo[2][8];
+ int m_fdc_fifo_sel;
+ int m_fdc_fifo_index;
+ int m_fdc_fifo_msb;
+ int m_fdc_fifo_empty[2];
+ int m_fdc_dmabytes;
+
+ /* shifter state */
+ UINT32 m_shifter_base;
+ UINT32 m_shifter_ofs;
+ UINT8 m_shifter_sync;
+ UINT8 m_shifter_mode;
+ UINT16 m_shifter_palette[16];
+ UINT16 m_shifter_rr[4];
+ UINT16 m_shifter_ir[4];
+ int m_shifter_bitplane;
+ int m_shifter_shift;
+ int m_shifter_h;
+ int m_shifter_v;
+ int m_shifter_de;
+ int m_shifter_x_start;
+ int m_shifter_x_end;
+ int m_shifter_y_start;
+ int m_shifter_y_end;
+ int m_shifter_hblank_start;
+ int m_shifter_vblank_start;
+
+ /* blitter state */
+ int m_blitter_done;
+ UINT16 m_blitter_halftone[16];
+ INT16 m_blitter_src_inc_x;
+ INT16 m_blitter_src_inc_y;
+ INT16 m_blitter_dst_inc_x;
+ INT16 m_blitter_dst_inc_y;
+ UINT32 m_blitter_src;
+ UINT32 m_blitter_dst;
+ UINT16 m_blitter_endmask1;
+ UINT16 m_blitter_endmask2;
+ UINT16 m_blitter_endmask3;
+ UINT16 m_blitter_xcount;
+ UINT16 m_blitter_ycount;
+ UINT16 m_blitter_xcountl;
+ UINT8 m_blitter_hop;
+ UINT8 m_blitter_op;
+ UINT8 m_blitter_ctrl;
+ UINT8 m_blitter_skew;
+ UINT32 m_blitter_srcbuf;
+
+ /* timers */
+ emu_timer *m_mouse_timer;
+ emu_timer *m_glue_timer;
+ emu_timer *m_shifter_timer;
+
+ bitmap_rgb32 m_bitmap;
+
+ floppy_image_device *floppy_devices[2];
+
+ static const floppy_format_type floppy_formats[];
+};
+
+class megast_state : public st_state
+{
+public:
+ megast_state(const machine_config &mconfig, device_type type, const char *tag)
+ : st_state(mconfig, type, tag)
+ { }
+
+ DECLARE_READ16_MEMBER( fpu_r );
+ DECLARE_WRITE16_MEMBER( fpu_w );
+};
+
+class ste_state : public st_state
+{
+public:
+ ste_state(const machine_config &mconfig, device_type type, const char *tag)
+ : st_state(mconfig, type, tag),
+ m_lmc1992(*this, LMC1992_TAG)
+ { }
+
+ optional_device<lmc1992_device> m_lmc1992;
+
+ void machine_start();
+
+ void video_start();
+
+ READ8_MEMBER( shifter_base_low_r );
+ WRITE8_MEMBER( shifter_base_low_w );
+ READ8_MEMBER( shifter_counter_r );
+ WRITE8_MEMBER( shifter_counter_w );
+ WRITE16_MEMBER( shifter_palette_w );
+ READ8_MEMBER( shifter_lineofs_r );
+ WRITE8_MEMBER( shifter_lineofs_w );
+ READ8_MEMBER( shifter_pixelofs_r );
+ WRITE8_MEMBER( shifter_pixelofs_w );
+
+ DECLARE_READ8_MEMBER( sound_dma_control_r );
+ DECLARE_READ8_MEMBER( sound_dma_base_r );
+ DECLARE_READ8_MEMBER( sound_dma_counter_r );
+ DECLARE_READ8_MEMBER( sound_dma_end_r );
+ DECLARE_READ8_MEMBER( sound_mode_r );
+ DECLARE_WRITE8_MEMBER( sound_dma_control_w );
+ DECLARE_WRITE8_MEMBER( sound_dma_base_w );
+ DECLARE_WRITE8_MEMBER( sound_dma_end_w );
+ DECLARE_WRITE8_MEMBER( sound_mode_w );
+ DECLARE_READ16_MEMBER( microwire_data_r );
+ DECLARE_WRITE16_MEMBER( microwire_data_w );
+ DECLARE_READ16_MEMBER( microwire_mask_r );
+ DECLARE_WRITE16_MEMBER( microwire_mask_w );
+
+ DECLARE_READ8_MEMBER( mfp_gpio_r );
+
+ void dmasound_set_state(int level);
+ void dmasound_tick();
+ void microwire_shift();
+ void microwire_tick();
+ void state_save();
+
+ // shifter state
+ UINT8 m_shifter_lineofs;
+ UINT8 m_shifter_pixelofs;
+
+ /* microwire state */
+ UINT16 m_mw_data;
+ UINT16 m_mw_mask;
+ int m_mw_shift;
+
+ /* DMA sound state */
+ UINT32 m_dmasnd_base;
+ UINT32 m_dmasnd_end;
+ UINT32 m_dmasnd_cntr;
+ UINT32 m_dmasnd_baselatch;
+ UINT32 m_dmasnd_endlatch;
+ UINT8 m_dmasnd_ctrl;
+ UINT8 m_dmasnd_mode;
+ UINT8 m_dmasnd_fifo[8];
+ UINT8 m_dmasnd_samples;
+ int m_dmasnd_active;
+
+ // timers
+ emu_timer *m_microwire_timer;
+ emu_timer *m_dmasound_timer;
+};
+
+class megaste_state : public ste_state
+{
+public:
+ megaste_state(const machine_config &mconfig, device_type type, const char *tag)
+ : ste_state(mconfig, type, tag)
+ { }
+
+ void machine_start();
+
+ DECLARE_READ16_MEMBER( cache_r );
+ DECLARE_WRITE16_MEMBER( cache_w );
+
+ UINT16 m_cache;
+};
+
+class stbook_state : public ste_state
+{
+public:
+ stbook_state(const machine_config &mconfig, device_type type, const char *tag)
+ : ste_state(mconfig, type, tag)
+ { }
+
+ void machine_start();
+ void video_start();
+
+ DECLARE_READ16_MEMBER( config_r );
+ DECLARE_WRITE16_MEMBER( lcd_control_w );
+
+ DECLARE_WRITE8_MEMBER( psg_pa_w );
+ DECLARE_READ8_MEMBER( mfp_gpio_r );
+};
+
+#endif
diff --git a/src/mess/includes/atom.h b/src/mess/includes/atom.h
new file mode 100644
index 00000000000..bb97a64e569
--- /dev/null
+++ b/src/mess/includes/atom.h
@@ -0,0 +1,104 @@
+#pragma once
+
+#ifndef __ATOM__
+#define __ATOM__
+
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ram.h"
+#include "imagedev/snapquik.h"
+#include "formats/atom_atm.h"
+#include "formats/atom_tap.h"
+#include "formats/basicdsk.h"
+#include "formats/uef_cas.h"
+#include "machine/ctronics.h"
+#include "machine/6522via.h"
+#include "machine/i8255.h"
+#include "machine/i8271.h"
+#include "sound/speaker.h"
+#include "video/mc6847.h"
+
+#define SY6502_TAG "ic22"
+#define INS8255_TAG "ic25"
+#define MC6847_TAG "ic31"
+#define R6522_TAG "ic1"
+#define I8271_TAG "ic13"
+#define MC6854_TAG "econet_ic1"
+#define SCREEN_TAG "screen"
+#define CENTRONICS_TAG "centronics"
+#define BASERAM_TAG "baseram"
+#define EXTROM_TAG "a000"
+#define DOSROM_TAG "e000"
+
+
+#define X1 XTAL_3_579545MHz // MC6847 Clock
+#define X2 XTAL_4MHz // CPU Clock - a divider reduces it to 1MHz
+
+class atom_state : public driver_device
+{
+public:
+ atom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, SY6502_TAG),
+ m_vdg(*this, MC6847_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_speaker(*this, SPEAKER_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<mc6847_base_device> m_vdg;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_speaker;
+
+ virtual void machine_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void bankswitch();
+
+ DECLARE_READ8_MEMBER( eprom_r );
+ DECLARE_WRITE8_MEMBER( eprom_w );
+ DECLARE_WRITE8_MEMBER( ppi_pa_w );
+ DECLARE_READ8_MEMBER( ppi_pb_r );
+ DECLARE_READ8_MEMBER( ppi_pc_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_READ8_MEMBER( printer_busy );
+ DECLARE_WRITE8_MEMBER( printer_data );
+ DECLARE_READ8_MEMBER( vdg_videoram_r );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+
+ /* eprom state */
+ int m_eprom;
+
+ /* video state */
+ required_shared_ptr<UINT8> m_video_ram;
+
+ /* keyboard state */
+ int m_keylatch;
+
+ /* cassette state */
+ int m_hz2400;
+ int m_pc0;
+ int m_pc1;
+
+ /* devices */
+ int m_previous_i8271_int_state;
+};
+
+class atomeb_state : public atom_state
+{
+public:
+ atomeb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : atom_state(mconfig, type, tag)
+ { }
+
+ virtual void machine_start();
+};
+
+#endif
diff --git a/src/mess/includes/avigo.h b/src/mess/includes/avigo.h
new file mode 100644
index 00000000000..5f5c61277a6
--- /dev/null
+++ b/src/mess/includes/avigo.h
@@ -0,0 +1,115 @@
+/*****************************************************************************
+ *
+ * includes/avigo.h
+ *
+ ****************************************************************************/
+
+#ifndef AVIGO_H_
+#define AVIGO_H_
+
+#include "cpu/z80/z80.h"
+#include "machine/rp5c01.h"
+#include "machine/ins8250.h"
+#include "machine/serial.h"
+#include "machine/null_modem.h"
+#include "machine/intelfsh.h"
+#include "machine/nvram.h"
+#include "sound/speaker.h"
+#include "machine/ram.h"
+#include "imagedev/snapquik.h"
+
+#define AVIGO_NUM_COLOURS 2
+
+#define AVIGO_SCREEN_WIDTH 160
+#define AVIGO_SCREEN_HEIGHT 240
+#define AVIGO_PANEL_HEIGHT 26
+
+
+class avigo_state : public driver_device
+{
+public:
+ avigo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ram(*this, RAM_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_uart(*this, "ns16550"),
+ m_serport(*this, "serport")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_speaker;
+ required_device<ns16550_device> m_uart;
+ required_device<rs232_port_device> m_serport;
+
+ // defined in drivers/avigo.c
+ virtual void machine_start();
+ virtual void machine_reset();
+ void postload();
+ void refresh_memory(UINT8 bank, UINT8 chip_select);
+ void refresh_ints();
+ void nvram_init(nvram_device &nvram, void *base, size_t size);
+
+ DECLARE_WRITE_LINE_MEMBER( tc8521_alarm_int );
+ DECLARE_WRITE_LINE_MEMBER( com_interrupt );
+
+ DECLARE_READ8_MEMBER(flash_0x0000_read_handler);
+ DECLARE_WRITE8_MEMBER(flash_0x0000_write_handler);
+ DECLARE_READ8_MEMBER(flash_0x4000_read_handler);
+ DECLARE_WRITE8_MEMBER(flash_0x4000_write_handler);
+ DECLARE_READ8_MEMBER(flash_0x8000_read_handler);
+ DECLARE_WRITE8_MEMBER(flash_0x8000_write_handler);
+
+ DECLARE_READ8_MEMBER(key_data_read_r);
+ DECLARE_WRITE8_MEMBER(set_key_line_w);
+ DECLARE_WRITE8_MEMBER(port2_w);
+ DECLARE_READ8_MEMBER(irq_r);
+ DECLARE_WRITE8_MEMBER(irq_w);
+ DECLARE_READ8_MEMBER(bank1_r);
+ DECLARE_READ8_MEMBER(bank2_r);
+ DECLARE_WRITE8_MEMBER(bank1_w);
+ DECLARE_WRITE8_MEMBER(bank2_w);
+ DECLARE_READ8_MEMBER(ad_control_status_r);
+ DECLARE_WRITE8_MEMBER(ad_control_status_w);
+ DECLARE_READ8_MEMBER(ad_data_r);
+ DECLARE_WRITE8_MEMBER(speaker_w);
+ DECLARE_READ8_MEMBER(port_04_r);
+
+ DECLARE_INPUT_CHANGED_MEMBER(pen_irq);
+ DECLARE_INPUT_CHANGED_MEMBER(pen_move_irq);
+ DECLARE_INPUT_CHANGED_MEMBER(kb_irq);
+ DECLARE_INPUT_CHANGED_MEMBER(power_down_irq);
+
+ // defined in video/avigo.c
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_READ8_MEMBER(vid_memory_r);
+ DECLARE_WRITE8_MEMBER(vid_memory_w);
+
+ // driver state
+ UINT8 m_key_line;
+ UINT8 m_irq;
+ UINT8 m_port2;
+ UINT8 m_bank2_l;
+ UINT8 m_bank2_h;
+ UINT8 m_bank1_l;
+ UINT8 m_bank1_h;
+ UINT8 m_ad_control_status;
+ intelfsh8_device * m_flashes[3];
+ int m_flash_at_0x4000;
+ int m_flash_at_0x8000;
+ UINT16 m_ad_value;
+ UINT8 * m_video_memory;
+ UINT8 m_screen_column;
+ UINT8 m_warm_start;
+ UINT8 * m_ram_base;
+};
+
+
+/*----------- defined in video/avigo.c -----------*/
+
+extern PALETTE_INIT( avigo );
+
+
+#endif /* AVIGO_H_ */
diff --git a/src/mess/includes/b2m.h b/src/mess/includes/b2m.h
new file mode 100644
index 00000000000..2b31a57b2b1
--- /dev/null
+++ b/src/mess/includes/b2m.h
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ *
+ * includes/b2m.h
+ *
+ ****************************************************************************/
+
+#ifndef B2M_H_
+#define B2M_H_
+
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+
+class b2m_state : public driver_device
+{
+public:
+ b2m_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_b2m_8255_porta;
+ UINT8 m_b2m_video_scroll;
+ UINT8 m_b2m_8255_portc;
+
+ UINT8 m_b2m_video_page;
+ UINT8 m_b2m_drive;
+ UINT8 m_b2m_side;
+
+ UINT8 m_b2m_romdisk_lsb;
+ UINT8 m_b2m_romdisk_msb;
+
+ UINT8 m_b2m_color[4];
+ UINT8 m_b2m_localmachine;
+ UINT8 m_vblank_state;
+
+ /* devices */
+ device_t *m_fdc;
+ device_t *m_pic;
+ device_t *m_speaker;
+ DECLARE_READ8_MEMBER(b2m_keyboard_r);
+ DECLARE_WRITE8_MEMBER(b2m_palette_w);
+ DECLARE_READ8_MEMBER(b2m_palette_r);
+ DECLARE_WRITE8_MEMBER(b2m_localmachine_w);
+ DECLARE_READ8_MEMBER(b2m_localmachine_r);
+ DECLARE_DRIVER_INIT(b2m);
+};
+
+/*----------- defined in machine/b2m.c -----------*/
+
+extern const struct pit8253_config b2m_pit8253_intf;
+extern const struct pic8259_interface b2m_pic8259_config;
+
+extern const i8255_interface b2m_ppi8255_interface_1;
+extern const i8255_interface b2m_ppi8255_interface_2;
+extern const i8255_interface b2m_ppi8255_interface_3;
+
+extern MACHINE_START( b2m );
+extern MACHINE_RESET( b2m );
+extern INTERRUPT_GEN( b2m_vblank_interrupt );
+
+/*----------- defined in video/b2m.c -----------*/
+
+extern VIDEO_START( b2m );
+extern SCREEN_UPDATE_IND16( b2m );
+extern PALETTE_INIT( b2m );
+
+#endif
diff --git a/src/mess/includes/bbc.h b/src/mess/includes/bbc.h
new file mode 100644
index 00000000000..1ed419351c7
--- /dev/null
+++ b/src/mess/includes/bbc.h
@@ -0,0 +1,332 @@
+/*****************************************************************************
+ *
+ * includes/bbc.h
+ *
+ * BBC Model B
+ *
+ * Driver by Gordon Jefferyes <mess_bbc@romvault.com>
+ *
+ ****************************************************************************/
+
+#ifndef BBC_H_
+#define BBC_H_
+
+#include "machine/6522via.h"
+#include "machine/6850acia.h"
+#include "machine/i8271.h"
+#include "machine/wd17xx.h"
+#include "machine/upd7002.h"
+#include "video/mc6845.h"
+
+class bbc_state : public driver_device
+{
+public:
+ bbc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ACCCON_IRR(CLEAR_LINE),
+ m_via_system_irq(CLEAR_LINE),
+ m_via_user_irq(CLEAR_LINE),
+ m_acia_irq(CLEAR_LINE)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+
+ void check_interrupts();
+
+ int m_RAMSize; // BBC Memory Size
+ int m_DFSType; // this stores the DIP switch setting for the DFS type being used
+ int m_SWRAMtype; // this stores the DIP switch setting for the SWRAM type being used
+ int m_Master; // if 0 then we are emulating a BBC B style machine
+ // if 1 then we are emulating a BBC Master style machine
+
+ int m_ACCCON_IRR; // IRQ inputs
+
+ int m_rombank; // This is the latch that holds the sideways ROM bank to read
+
+ int m_userport; // This stores the sideways RAM latch type.
+ // Acorn and others use the bbc_rombank latch to select the write bank to be used.(type 0)
+ // Solidisc use the BBC's userport to select the write bank to be used (type 1)
+
+ int m_pagedRAM; // BBC B+ memory handling
+ int m_vdusel; // BBC B+ memory handling
+
+ /*
+ ACCCON
+
+ b7 IRR 1=Causes an IRQ to the processor
+ b6 TST 1=Selects &FC00-&FEFF read from OS-ROM
+ b5 IFJ 1=Internal 1 MHz bus
+ 0=External 1MHz bus
+ b4 ITU 1=Internal Tube
+ 0=External Tube
+ b3 Y 1=Read/Write HAZEL &C000-&DFFF RAM
+ 0=Read/Write ROM &C000-&DFFF OS-ROM
+ b2 X 1=Read/Write LYNNE
+ 0=Read/WRITE main memory &3000-&8000
+ b1 E 1=Causes shadow if VDU code
+ 0=Main all the time
+ b0 D 1=Display LYNNE as screen
+ 0=Display main RAM screen
+
+ ACCCON is a read/write register
+ */
+
+ int m_ACCCON;
+ int m_ACCCON_TST;
+ int m_ACCCON_IFJ;
+ int m_ACCCON_ITU;
+ int m_ACCCON_Y;
+ int m_ACCCON_X;
+ int m_ACCCON_E;
+ int m_ACCCON_D;
+
+
+ /*
+ The addressable latch
+ This 8 bit addressable latch is operated from port B lines 0-3.
+ PB0-PB2 are set to the required address of the output bit to be set.
+ PB3 is set to the value which should be programmed at that bit.
+ The function of the 8 output bits from this latch are:-
+
+ B0 - Write Enable to the sound generator IC
+ B1 - READ select on the speech processor
+ B2 - WRITE select on the speech processor
+ B3 - Keyboard write enable
+ B4,B5 - these two outputs define the number to be added to the
+ start of screen address in hardware to control hardware scrolling:-
+ Mode Size Start of screen Number to add B5 B4
+ 0,1,2 20K &3000 12K 1 1
+ 3 16K &4000 16K 0 0
+ 4,5 10K &5800 (or &1800) 22K 1 0
+ 6 8K &6000 (or &2000) 24K 0 1
+ B6 - Operates the CAPS lock LED (Pin 17 keyboard connector)
+ B7 - Operates the SHIFT lock LED (Pin 16 keyboard connector)
+ */
+
+ int m_b0_sound;
+ int m_b1_speech_read;
+ int m_b2_speech_write;
+ int m_b3_keyboard;
+ int m_b4_video0;
+ int m_b5_video1;
+ int m_b6_caps_lock_led;
+ int m_b7_shift_lock_led;
+
+ int m_MC146818_WR; // FE30 bit 1 replaces b1_speech_read
+ int m_MC146818_DS; // FE30 bit 2 replaces b2_speech_write
+ int m_MC146818_AS; // 6522 port b bit 7
+ int m_MC146818_CE; // 6522 port b bit 6
+
+ int m_via_system_porta;
+ int m_via_system_irq;
+ int m_via_user_irq;
+ int m_acia_irq;
+
+ int m_column; // this is a counter in the keyboard circuit
+
+
+ /***************************************
+ BBC 2C199 Serial Interface Cassette
+ ****************************************/
+
+ double m_last_dev_val;
+ int m_wav_len;
+ int m_len0;
+ int m_len1;
+ int m_len2;
+ int m_len3;
+ int m_mc6850_clock;
+ emu_timer *m_tape_timer;
+
+
+ /**************************************
+ i8271 disc control
+ ***************************************/
+
+ int m_previous_i8271_int_state; // 8271 interupt status
+
+
+
+ /**************************************
+ WD1770 disc control
+ ***************************************/
+ int m_drive_control;
+ int m_wd177x_irq_state;
+ int m_wd177x_drq_state;
+ int m_previous_wd177x_int_state;
+ int m_1770_IntEnabled;
+
+ /**************************************
+ Opus Challenger Disc control
+ ***************************************/
+ int m_opusbank;
+
+
+
+ /**************************************
+ Video Code
+ ***************************************/
+
+ int m_memorySize;
+
+
+// this is the real location of the start of the BBC's ram in the emulation
+// it can be changed if shadow ram is being used to point at the upper 32K of RAM
+
+// this is the screen memory location of the next pixels to be drawn
+
+// this is a more global variable to store the bitmap variable passed in in the bbc_vh_screenrefresh function
+
+// this is the X and Y screen location in emulation pixels of the next pixels to be drawn
+
+
+ unsigned char *m_BBC_Video_RAM;
+ UINT16 *m_BBC_display;
+ UINT16 *m_BBC_display_left;
+ UINT16 *m_BBC_display_right;
+ bitmap_ind16 *m_BBC_bitmap;
+ int m_y_screen_pos;
+ unsigned char m_pixel_bits[256];
+ int m_BBC_HSync;
+ int m_BBC_VSync;
+ device_t *m_saa505x;
+
+
+
+ int m_Teletext_Latch;
+ int m_VideoULA_CR;
+ int m_VideoULA_CR_counter;
+ int m_videoULA_Reg;
+ int m_videoULA_master_cursor_size;
+ int m_videoULA_width_of_cursor;
+ int m_videoULA_6845_clock_rate;
+ int m_videoULA_characters_per_line;
+ int m_videoULA_teletext_normal_select;
+ int m_videoULA_flash_colour_select;
+
+
+
+ int m_pixels_per_byte;
+ int m_emulation_pixels_per_real_pixel;
+ int m_emulation_pixels_per_byte;
+
+ int m_emulation_cursor_size;
+ int m_cursor_state;
+
+ int m_videoULA_pallet0[16];
+ int m_videoULA_pallet1[16];
+ int *m_videoULA_pallet_lookup;
+
+ void (*m_draw_function)(running_machine &machine);
+ DECLARE_WRITE8_MEMBER(bbc_page_selecta_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorya1_w);
+ DECLARE_WRITE8_MEMBER(bbc_page_selectb_w);
+ DECLARE_WRITE8_MEMBER(bbc_memoryb3_w);
+ DECLARE_WRITE8_MEMBER(bbc_memoryb4_w);
+ DECLARE_WRITE8_MEMBER(bbc_page_selectbp_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybp1_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybp2_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybp4_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybp4_128_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybp6_128_w);
+ DECLARE_READ8_MEMBER(bbcm_ACCCON_read);
+ DECLARE_WRITE8_MEMBER(bbcm_ACCCON_write);
+ DECLARE_WRITE8_MEMBER(page_selectbm_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybm1_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybm2_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybm4_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybm5_w);
+ DECLARE_WRITE8_MEMBER(bbc_memorybm7_w);
+ DECLARE_READ8_MEMBER(bbcm_r);
+ DECLARE_WRITE8_MEMBER(bbcm_w);
+ DECLARE_WRITE8_MEMBER(bbc_SerialULA_w);
+ DECLARE_READ8_MEMBER(bbc_i8271_read);
+ DECLARE_WRITE8_MEMBER(bbc_i8271_write);
+ DECLARE_WRITE8_MEMBER(bbc_wd177x_status_w);
+ DECLARE_READ8_MEMBER(bbc_wd1770_read);
+ DECLARE_WRITE8_MEMBER(bbc_wd1770_write);
+ DECLARE_WRITE8_MEMBER(bbc_opus_status_w);
+ DECLARE_READ8_MEMBER(bbc_opus_read);
+ DECLARE_WRITE8_MEMBER(bbc_opus_write);
+ DECLARE_READ8_MEMBER(bbcm_wd1770_read);
+ DECLARE_WRITE8_MEMBER(bbcm_wd1770_write);
+ DECLARE_READ8_MEMBER(bbcm_wd1770l_read);
+ DECLARE_WRITE8_MEMBER(bbcm_wd1770l_write);
+ DECLARE_READ8_MEMBER(bbc_disc_r);
+ DECLARE_WRITE8_MEMBER(bbc_disc_w);
+ DECLARE_WRITE8_MEMBER(bbc_videoULA_w);
+ DECLARE_WRITE8_MEMBER(bbc_6845_w);
+ DECLARE_READ8_MEMBER(bbc_6845_r);
+ DECLARE_READ8_MEMBER(bbc_fe_r);
+ DECLARE_DIRECT_UPDATE_MEMBER(bbcbp_direct_handler);
+ DECLARE_DIRECT_UPDATE_MEMBER(bbcm_direct_handler);
+ DECLARE_DRIVER_INIT(bbc);
+ DECLARE_DRIVER_INIT(bbcm);
+};
+
+
+/*----------- defined in machine/bbc.c -----------*/
+
+
+extern const mc6845_interface bbc_mc6845_intf;
+
+
+extern const via6522_interface bbcb_system_via;
+extern const via6522_interface bbcb_user_via;
+extern const wd17xx_interface bbc_wd17xx_interface;
+
+MACHINE_START( bbca );
+MACHINE_START( bbcb );
+MACHINE_START( bbcbp );
+MACHINE_START( bbcm );
+
+MACHINE_RESET( bbca );
+MACHINE_RESET( bbcb );
+MACHINE_RESET( bbcbp );
+MACHINE_RESET( bbcm );
+
+INTERRUPT_GEN( bbcb_keyscan );
+INTERRUPT_GEN( bbcm_keyscan );
+
+
+
+
+
+
+
+
+/* disc support */
+
+DEVICE_IMAGE_LOAD ( bbcb_cart );
+
+
+
+
+
+
+
+/* tape support */
+
+
+extern const i8271_interface bbc_i8271_interface;
+extern const uPD7002_interface bbc_uPD7002;
+
+/*----------- defined in video/bbc.c -----------*/
+
+VIDEO_START( bbca );
+VIDEO_START( bbcb );
+VIDEO_START( bbcbp );
+VIDEO_START( bbcm );
+SCREEN_UPDATE_IND16( bbc );
+
+void bbc_draw_RGB_in(device_t *device, int offset, int data);
+void bbc_set_video_memory_lookups(running_machine &machine, int ramsize);
+void bbc_setscreenstart(running_machine &machine, int b4, int b5);
+void bbcbp_setvideoshadow(running_machine &machine, int vdusel);
+
+
+
+
+
+#endif /* BBC_H_ */
diff --git a/src/mess/includes/bebox.h b/src/mess/includes/bebox.h
new file mode 100644
index 00000000000..72c2c9b6d60
--- /dev/null
+++ b/src/mess/includes/bebox.h
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ *
+ * includes/bebox.h
+ *
+ * BeBox
+ *
+ ****************************************************************************/
+
+#ifndef BEBOX_H_
+#define BEBOX_H_
+
+#include "machine/ins8250.h"
+#include "machine/8237dma.h"
+
+typedef struct
+{
+ device_t *pic8259_master;
+ device_t *pic8259_slave;
+ device_t *dma8237_1;
+ device_t *dma8237_2;
+} bebox_devices_t;
+
+
+class bebox_state : public driver_device
+{
+public:
+ bebox_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT32 m_cpu_imask[2];
+ UINT32 m_interrupts;
+ UINT32 m_crossproc_interrupts;
+ bebox_devices_t m_devices;
+ int m_dma_channel;
+ UINT16 m_dma_offset[2][4];
+ UINT8 m_at_pages[0x10];
+ UINT32 m_scsi53c810_data[0x100 / 4];
+ DECLARE_DRIVER_INIT(bebox);
+};
+
+
+/*----------- defined in machine/bebox.c -----------*/
+
+extern const struct pit8253_config bebox_pit8254_config;
+extern const i8237_interface bebox_dma8237_1_config;
+extern const i8237_interface bebox_dma8237_2_config;
+extern const struct pic8259_interface bebox_pic8259_master_config;
+extern const struct pic8259_interface bebox_pic8259_slave_config;
+extern const ins8250_interface bebox_uart_inteface_0;
+extern const ins8250_interface bebox_uart_inteface_1;
+extern const ins8250_interface bebox_uart_inteface_2;
+extern const ins8250_interface bebox_uart_inteface_3;
+
+MACHINE_START( bebox );
+MACHINE_RESET( bebox );
+
+READ64_HANDLER( bebox_cpu0_imask_r );
+READ64_HANDLER( bebox_cpu1_imask_r );
+READ64_HANDLER( bebox_interrupt_sources_r );
+READ64_HANDLER( bebox_crossproc_interrupts_r );
+READ8_HANDLER( bebox_800001F0_r );
+READ64_HANDLER( bebox_800003F0_r );
+READ64_HANDLER( bebox_interrupt_ack_r );
+READ8_HANDLER( bebox_page_r );
+READ8_HANDLER( bebox_80000480_r );
+READ8_HANDLER( bebox_flash_r );
+
+WRITE64_HANDLER( bebox_cpu0_imask_w );
+WRITE64_HANDLER( bebox_cpu1_imask_w );
+WRITE64_HANDLER( bebox_crossproc_interrupts_w );
+WRITE64_HANDLER( bebox_processor_resets_w );
+WRITE8_HANDLER( bebox_800001F0_w );
+WRITE64_HANDLER( bebox_800003F0_w );
+WRITE8_HANDLER( bebox_page_w );
+WRITE8_HANDLER( bebox_80000480_w );
+WRITE8_HANDLER( bebox_flash_w );
+
+void bebox_ide_interrupt(device_t *device, int state);
+
+UINT32 scsi53c810_pci_read(device_t *busdevice, device_t *device, int function, int offset, UINT32 mem_mask);
+void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, int offset, UINT32 data, UINT32 mem_mask);
+
+#endif /* BEBOX_H_ */
diff --git a/src/mess/includes/beta.h b/src/mess/includes/beta.h
new file mode 100644
index 00000000000..25742d2bbfb
--- /dev/null
+++ b/src/mess/includes/beta.h
@@ -0,0 +1,54 @@
+#pragma once
+
+#ifndef __BETA__
+#define __BETA__
+
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "imagedev/cartslot.h"
+#include "machine/6532riot.h"
+#include "sound/speaker.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define M6502_TAG "m6502"
+#define M6532_TAG "m6532"
+#define EPROM_TAG "eprom"
+//#define SPEAKER_TAG "b237"
+
+class beta_state : public driver_device
+{
+public:
+ beta_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6502_TAG),
+ m_speaker(*this, SPEAKER_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_speaker;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( riot_pa_r );
+ DECLARE_WRITE8_MEMBER( riot_pa_w );
+ DECLARE_READ8_MEMBER( riot_pb_r );
+ DECLARE_WRITE8_MEMBER( riot_pb_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+
+ /* EPROM state */
+ int m_eprom_oe;
+ int m_eprom_ce;
+ UINT16 m_eprom_addr;
+ UINT8 m_eprom_data;
+ UINT8 m_old_data;
+
+ /* display state */
+ UINT8 m_ls145_p;
+ UINT8 m_segment;
+
+ emu_timer *m_led_refresh_timer;
+};
+
+#endif
diff --git a/src/mess/includes/bk.h b/src/mess/includes/bk.h
new file mode 100644
index 00000000000..cb7f6c9f0aa
--- /dev/null
+++ b/src/mess/includes/bk.h
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ *
+ * includes/bk.h
+ *
+ ****************************************************************************/
+
+#ifndef BK_H_
+#define BK_H_
+
+
+class bk_state : public driver_device
+{
+public:
+ bk_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_bk0010_video_ram(*this, "video_ram"){ }
+
+ UINT16 m_scrool;
+ required_shared_ptr<UINT16> m_bk0010_video_ram;
+ UINT16 m_kbd_state;
+ UINT16 m_key_code;
+ UINT16 m_key_pressed;
+ UINT16 m_key_irq_vector;
+ UINT16 m_drive;
+ DECLARE_READ16_MEMBER(bk_key_state_r);
+ DECLARE_READ16_MEMBER(bk_key_code_r);
+ DECLARE_READ16_MEMBER(bk_vid_scrool_r);
+ DECLARE_READ16_MEMBER(bk_key_press_r);
+ DECLARE_WRITE16_MEMBER(bk_key_state_w);
+ DECLARE_WRITE16_MEMBER(bk_vid_scrool_w);
+ DECLARE_WRITE16_MEMBER(bk_key_press_w);
+ DECLARE_READ16_MEMBER(bk_floppy_cmd_r);
+ DECLARE_WRITE16_MEMBER(bk_floppy_cmd_w);
+ DECLARE_READ16_MEMBER(bk_floppy_data_r);
+ DECLARE_WRITE16_MEMBER(bk_floppy_data_w);
+};
+
+
+/*----------- defined in machine/bk.c -----------*/
+
+extern MACHINE_START( bk0010 );
+extern MACHINE_RESET( bk0010 );
+
+
+
+/*----------- defined in video/bk.c -----------*/
+
+extern VIDEO_START( bk0010 );
+extern SCREEN_UPDATE_IND16( bk0010 );
+
+#endif /* BK_H_ */
diff --git a/src/mess/includes/bullet.h b/src/mess/includes/bullet.h
new file mode 100644
index 00000000000..ce73c78dd8d
--- /dev/null
+++ b/src/mess/includes/bullet.h
@@ -0,0 +1,137 @@
+#pragma once
+
+#ifndef __BULLET__
+#define __BULLET__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/harddriv.h"
+#include "machine/ctronics.h"
+#include "machine/ram.h"
+#include "machine/scsibus.h"
+#include "machine/terminal.h"
+#include "machine/wd17xx.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dart.h"
+#include "machine/z80dma.h"
+#include "machine/z80pio.h"
+
+#define Z80_TAG "u20"
+#define Z80CTC_TAG "u1"
+#define Z80DMA_TAG "u50"
+#define Z80DART_TAG "u45"
+#define Z80PIO_TAG "z80pio"
+#define MB8877_TAG "u55"
+#define CENTRONICS_TAG "centronics"
+#define SCSIBUS_TAG "scsi"
+
+class bullet_state : public driver_device
+{
+public:
+ bullet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_dart(*this, Z80DART_TAG),
+ m_dmac(*this, Z80DMA_TAG),
+ m_fdc(*this, MB8877_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_terminal(*this, TERMINAL_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_fdrdy(0)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<z80dart_device> m_dart;
+ required_device<z80dma_device> m_dmac;
+ required_device<device_t> m_fdc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<serial_terminal_device> m_terminal;
+ required_device<centronics_device> m_centronics;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( mreq_r );
+ DECLARE_WRITE8_MEMBER( mreq_w );
+ DECLARE_READ8_MEMBER( info_r );
+ DECLARE_READ8_MEMBER( brom_r );
+ DECLARE_WRITE8_MEMBER( brom_w );
+ DECLARE_READ8_MEMBER( win_r );
+ DECLARE_WRITE8_MEMBER( wstrobe_w );
+ DECLARE_WRITE8_MEMBER( exdsk_w );
+ DECLARE_WRITE8_MEMBER( exdma_w );
+ DECLARE_WRITE8_MEMBER( hdcon_w );
+ DECLARE_WRITE8_MEMBER( segst_w );
+ DECLARE_WRITE8_MEMBER( dart_w );
+ DECLARE_READ8_MEMBER( dma_mreq_r );
+ DECLARE_WRITE8_MEMBER( dma_mreq_w );
+ DECLARE_READ8_MEMBER( pio_pb_r );
+ DECLARE_WRITE_LINE_MEMBER( dartardy_w );
+ DECLARE_WRITE_LINE_MEMBER( dartbrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( fdrdy_w );
+
+ void bankswitch();
+ void update_dma_rdy();
+
+ // memory state
+ int m_segst;
+ int m_brom;
+
+ // DMA state
+ UINT8 m_exdma;
+ int m_buf;
+ int m_fdrdy;
+ int m_dartardy;
+ int m_dartbrdy;
+ int m_winrdy;
+ int m_exrdy1;
+ int m_exrdy2;
+};
+
+class bulletf_state : public bullet_state
+{
+public:
+ bulletf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : bullet_state(mconfig, type, tag),
+ m_scsibus(*this, SCSIBUS_TAG)
+ { }
+
+ required_device<device_t> m_scsibus;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( mreq_r );
+ DECLARE_WRITE8_MEMBER( mreq_w );
+ DECLARE_WRITE8_MEMBER( xdma0_w );
+ DECLARE_WRITE8_MEMBER( xfdc_w );
+ DECLARE_WRITE8_MEMBER( mbank_w );
+ DECLARE_READ8_MEMBER( hwsts_r );
+ DECLARE_READ8_MEMBER( scsi_r );
+ DECLARE_WRITE8_MEMBER( scsi_w );
+
+ DECLARE_READ8_MEMBER( dma_mreq_r );
+ DECLARE_WRITE8_MEMBER( dma_mreq_w );
+ DECLARE_READ8_MEMBER( pio_pa_r );
+ DECLARE_WRITE8_MEMBER( pio_pa_w );
+ DECLARE_WRITE_LINE_MEMBER( cstrb_w );
+ DECLARE_WRITE_LINE_MEMBER( req_w );
+
+ void update_dma_rdy();
+
+ int m_rome;
+ UINT8 m_xdma0;
+ UINT8 m_mbank;
+ int m_wack;
+ int m_wrdy;
+};
+
+#endif
diff --git a/src/mess/includes/busicom.h b/src/mess/includes/busicom.h
new file mode 100644
index 00000000000..574186c698c
--- /dev/null
+++ b/src/mess/includes/busicom.h
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ *
+ * includes/busicom.h
+ *
+ ****************************************************************************/
+
+#ifndef BUSICOM_H_
+#define BUSICOM_H_
+
+
+class busicom_state : public driver_device
+{
+public:
+ busicom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_drum_index;
+ UINT16 m_keyboard_shifter;
+ UINT32 m_printer_shifter;
+ UINT8 m_timer;
+ UINT8 m_printer_line[11][17];
+ UINT8 m_printer_line_color[11];
+ DECLARE_READ8_MEMBER(keyboard_r);
+ DECLARE_READ8_MEMBER(printer_r);
+ DECLARE_WRITE8_MEMBER(shifter_w);
+ DECLARE_WRITE8_MEMBER(printer_w);
+ DECLARE_WRITE8_MEMBER(status_w);
+ DECLARE_WRITE8_MEMBER(printer_ctrl_w);
+};
+
+
+/*----------- defined in video/busicom.c -----------*/
+
+extern PALETTE_INIT( busicom );
+extern VIDEO_START( busicom );
+extern SCREEN_UPDATE_IND16( busicom );
+
+#endif /* BUSICOM_H_ */
diff --git a/src/mess/includes/bw12.h b/src/mess/includes/bw12.h
new file mode 100644
index 00000000000..82e6e2968c3
--- /dev/null
+++ b/src/mess/includes/bw12.h
@@ -0,0 +1,94 @@
+#ifndef __BW12__
+#define __BW12__
+
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "ic35"
+#define MC6845_TAG "ic14"
+#define UPD765_TAG "ic45"
+#define Z80SIO_TAG "ic15"
+#define PIT8253_TAG "ic34"
+#define PIA6821_TAG "ic16"
+#define MC1408_TAG "ic4"
+#define AY3600PRO002_TAG "ic74"
+#define CENTRONICS_TAG "centronics"
+#define FLOPPY_TIMER_TAG "motor_off"
+
+#define BW12_VIDEORAM_MASK 0x7ff
+#define BW12_CHARROM_MASK 0xfff
+
+class bw12_state : public driver_device
+{
+public:
+ bw12_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_pia(*this, PIA6821_TAG),
+ m_fdc(*this, UPD765_TAG),
+ m_kbc(*this, AY3600PRO002_TAG),
+ m_crtc(*this, MC6845_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_floppy_timer(*this, FLOPPY_TIMER_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<pia6821_device> m_pia;
+ required_device<device_t> m_fdc;
+ required_device<ay3600_device> m_kbc;
+ required_device<mc6845_device> m_crtc;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<timer_device> m_floppy_timer;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+
+ void bankswitch();
+ void floppy_motor_off();
+ void set_floppy_motor_off_timer();
+ void ls259_w(int address, int data);
+
+ DECLARE_READ8_MEMBER( ls259_r );
+ DECLARE_WRITE8_MEMBER( ls259_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
+ DECLARE_READ8_MEMBER( pia_pa_r );
+ DECLARE_READ_LINE_MEMBER( pia_cb1_r );
+ DECLARE_WRITE_LINE_MEMBER( pia_cb2_w );
+ DECLARE_WRITE_LINE_MEMBER( pit_out2_w );
+ DECLARE_READ_LINE_MEMBER( ay3600_shift_r );
+ DECLARE_READ_LINE_MEMBER( ay3600_control_r );
+ DECLARE_WRITE_LINE_MEMBER( ay3600_data_ready_w );
+
+ /* memory state */
+ int m_bank;
+
+ /* video state */
+ required_shared_ptr<UINT8> m_video_ram;
+ UINT8 *m_char_rom;
+
+ /* PIT state */
+ int m_pit_out2;
+
+ /* keyboard state */
+ int m_key_data[9];
+ int m_key_sin;
+ int m_key_stb;
+ int m_key_shift;
+
+ /* floppy state */
+ int m_fdc_int;
+ int m_motor_on;
+ int m_motor0;
+ int m_motor1;
+};
+
+#endif
diff --git a/src/mess/includes/bw2.h b/src/mess/includes/bw2.h
new file mode 100644
index 00000000000..aaa60cd1556
--- /dev/null
+++ b/src/mess/includes/bw2.h
@@ -0,0 +1,98 @@
+#ifndef __BW2__
+#define __BW2__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+#include "machine/i8255.h"
+#include "machine/ctronics.h"
+#include "machine/i8251.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "machine/wd17xx.h"
+#include "video/msm6255.h"
+#include "rendlay.h"
+
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "ic1"
+#define I8255A_TAG "ic4"
+#define WD2797_TAG "ic5"
+#define PIT8253_TAG "ic6"
+#define I8251_TAG "ic7"
+#define MSM6255_TAG "ic49"
+#define CENTRONICS_TAG "centronics"
+
+#define BW2_VIDEORAM_SIZE 0x4000
+#define BW2_RAMCARD_SIZE 0x80000
+
+enum {
+ BANK_RAM1 = 0,
+ BANK_VRAM,
+ BANK_RAM2, BANK_RAMCARD_ROM = BANK_RAM2,
+ BANK_RAM3,
+ BANK_RAM4,
+ BANK_RAM5, BANK_RAMCARD_RAM = BANK_RAM5,
+ BANK_RAM6,
+ BANK_ROM
+};
+
+class bw2_state : public driver_device
+{
+public:
+ bw2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_uart(*this, I8251_TAG),
+ m_fdc(*this, WD2797_TAG),
+ m_lcdc(*this, MSM6255_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<i8251_device> m_uart;
+ required_device<device_t> m_fdc;
+ required_device<msm6255_device> m_lcdc;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ int get_ramdisk_size();
+ void bankswitch(UINT8 data);
+ void ramcard_bankswitch(UINT8 data);
+
+ DECLARE_WRITE8_MEMBER( ramcard_bank_w );
+ DECLARE_WRITE8_MEMBER( ppi_pa_w );
+ DECLARE_READ8_MEMBER( ppi_pb_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_READ8_MEMBER( ppi_pc_r );
+ DECLARE_WRITE_LINE_MEMBER( pit_out0_w );
+ DECLARE_WRITE_LINE_MEMBER( mtron_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+
+ // keyboard state
+ UINT8 m_kb_row;
+
+ // memory state
+ UINT8 *m_ramcard_ram;
+ UINT8 m_bank;
+
+ // floppy state
+ int m_drive;
+ int m_mtron;
+ int m_mfdbk;
+
+ // video state
+ UINT8 *m_video_ram;
+};
+
+#endif
diff --git a/src/mess/includes/c128.h b/src/mess/includes/c128.h
new file mode 100644
index 00000000000..8f64d42563c
--- /dev/null
+++ b/src/mess/includes/c128.h
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ *
+ * includes/c128.h
+ *
+ * Commodore C128 Home Computer
+ *
+ * peter.trauner@jk.uni-linz.ac.at
+ *
+ * Documentation: iDOC (http://www.softwolves.pp.se/idoc)
+ * Christian Janoff <mepk@c64.org>
+ *
+ ****************************************************************************/
+
+#ifndef __C128_H__
+#define __C128_H__
+
+#include "includes/c64_legacy.h"
+#include "machine/6526cia.h"
+
+class c128_state : public legacy_c64_state
+{
+public:
+ c128_state(const machine_config &mconfig, device_type type, const char *tag)
+ : legacy_c64_state(mconfig, type, tag) { }
+
+ DECLARE_READ8_MEMBER( vic_lightpen_x_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_y_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_button_cb );
+ DECLARE_READ8_MEMBER( vic_dma_read );
+ DECLARE_READ8_MEMBER( vic_dma_read_ultimax );
+ DECLARE_READ8_MEMBER( vic_dma_read_color );
+ DECLARE_WRITE_LINE_MEMBER( vic_interrupt );
+ DECLARE_READ8_MEMBER( vic_rdy_cb );
+
+ UINT8 *m_c128_basic;
+ UINT8 *m_c128_kernal;
+ UINT8 *m_c128_chargen;
+ UINT8 *m_z80;
+ UINT8 *m_editor;
+ UINT8 *m_internal_function;
+ UINT8 *m_external_function;
+ UINT8 *m_vdcram;
+ UINT8 m_mmu[0x0b];
+ int m_mmu_cpu;
+ int m_mmu_page0;
+ int m_mmu_page1;
+ int m_c64mode;
+ int m_write_io;
+ int m_ram_bottom;
+ int m_ram_top;
+ UINT8 *m_ram;
+ UINT8 m_c64_port_data;
+ UINT8 m_keyline[3];
+ int m_cnt1;
+ int m_sp1;
+ int m_data_out;
+ int m_va1617;
+ int m_monitor;
+ int m_nmilevel;
+ DECLARE_DRIVER_INIT(c128pal);
+ DECLARE_DRIVER_INIT(c128dcrp);
+ DECLARE_DRIVER_INIT(c128dcr);
+ DECLARE_DRIVER_INIT(c128dpal);
+ DECLARE_DRIVER_INIT(c128d);
+ DECLARE_DRIVER_INIT(c128);
+ DECLARE_DRIVER_INIT(c128d81);
+};
+
+
+/*----------- defined in machine/c128.c -----------*/
+
+WRITE8_HANDLER(c128_mmu8722_port_w);
+READ8_HANDLER(c128_mmu8722_port_r);
+WRITE8_HANDLER(c128_mmu8722_ff00_w);
+READ8_HANDLER(c128_mmu8722_ff00_r);
+WRITE8_HANDLER(c128_write_0000);
+WRITE8_HANDLER(c128_write_1000);
+WRITE8_HANDLER(c128_write_4000);
+WRITE8_HANDLER(c128_write_8000);
+WRITE8_HANDLER(c128_write_a000);
+WRITE8_HANDLER(c128_write_c000);
+WRITE8_HANDLER(c128_write_d000);
+WRITE8_HANDLER(c128_write_e000);
+WRITE8_HANDLER(c128_write_ff00);
+WRITE8_HANDLER(c128_write_ff05);
+
+
+extern MACHINE_START( c128 );
+extern MACHINE_RESET( c128 );
+extern INTERRUPT_GEN( c128_frame_interrupt );
+
+extern SCREEN_UPDATE_IND16( c128 );
+
+void c128_bankswitch_64(running_machine &machine, int reset);
+
+int c128_dma_read(running_machine &machine, int offset);
+int c128_dma_read_color(running_machine &machine, int offset);
+void c128_vic_interrupt(running_machine &machine, int level);
+
+extern READ8_DEVICE_HANDLER(c128_m6510_port_read);
+extern WRITE8_DEVICE_HANDLER(c128_m6510_port_write);
+
+extern const mos6526_interface c128_ntsc_cia0, c128_pal_cia0;
+extern const mos6526_interface c128_ntsc_cia1, c128_pal_cia1;
+
+WRITE_LINE_DEVICE_HANDLER( c128_iec_srq_w );
+WRITE_LINE_DEVICE_HANDLER( c128_iec_data_w );
+
+#endif /* __C128_H__ */
diff --git a/src/mess/includes/c16.h b/src/mess/includes/c16.h
new file mode 100644
index 00000000000..66979761f74
--- /dev/null
+++ b/src/mess/includes/c16.h
@@ -0,0 +1,83 @@
+/*****************************************************************************
+ *
+ * includes/c16.h
+ *
+ ****************************************************************************/
+
+#ifndef __C16_H__
+#define __C16_H__
+
+#include "machine/cbmiec.h"
+
+class c16_state : public driver_device
+{
+public:
+ c16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_iec(*this, CBM_IEC_TAG)
+ { }
+
+ required_device<cbm_iec_device> m_iec;
+
+ /* memory pointers */
+ UINT8 * m_mem10000;
+ UINT8 * m_mem14000;
+ UINT8 * m_mem18000;
+ UINT8 * m_mem1c000;
+ UINT8 * m_mem20000;
+ UINT8 * m_mem24000;
+ UINT8 * m_mem28000;
+ UINT8 * m_mem2c000;
+
+ /* misc */
+ UINT8 m_keyline[10];
+ UINT8 m_port6529;
+ int m_lowrom, m_highrom;
+ int m_old_level;
+
+ int m_sidcard, m_pal;
+
+ /* devices */
+ legacy_cpu_device *m_maincpu;
+ device_t *m_ted7360;
+ cassette_image_device *m_cassette;
+ ram_device *m_messram;
+ device_t *m_sid;
+ DECLARE_DRIVER_INIT(plus4sid);
+ DECLARE_DRIVER_INIT(c16sid);
+ DECLARE_DRIVER_INIT(c16);
+ DECLARE_DRIVER_INIT(plus4);
+};
+
+
+/*----------- defined in machine/c16.c -----------*/
+
+extern READ8_DEVICE_HANDLER(c16_m7501_port_read);
+extern WRITE8_DEVICE_HANDLER(c16_m7501_port_write);
+
+extern WRITE8_HANDLER(c16_6551_port_w);
+extern READ8_HANDLER(c16_6551_port_r);
+
+extern READ8_HANDLER(c16_fd1x_r);
+extern WRITE8_HANDLER(plus4_6529_port_w);
+extern READ8_HANDLER(plus4_6529_port_r);
+
+extern WRITE8_HANDLER(c16_6529_port_w);
+extern READ8_HANDLER(c16_6529_port_r);
+
+extern WRITE8_HANDLER(c16_select_roms);
+extern WRITE8_HANDLER(c16_switch_to_rom);
+extern WRITE8_HANDLER(c16_switch_to_ram);
+
+/* ted reads (passed to the device interface) */
+extern UINT8 c16_read_keyboard(running_machine &machine, int databus);
+extern void c16_interrupt(running_machine &machine, int level);
+extern int c16_dma_read(running_machine &machine, int offset);
+extern int c16_dma_read_rom(running_machine &machine, int offset);
+
+extern MACHINE_RESET( c16 );
+extern INTERRUPT_GEN( c16_frame_interrupt );
+
+MACHINE_CONFIG_EXTERN( c16_cartslot );
+
+#endif /* __C16_H__ */
diff --git a/src/mess/includes/c64.h b/src/mess/includes/c64.h
new file mode 100644
index 00000000000..b7b776e1145
--- /dev/null
+++ b/src/mess/includes/c64.h
@@ -0,0 +1,183 @@
+#pragma once
+
+#ifndef __C64__
+#define __C64__
+
+
+#include "emu.h"
+#include "formats/cbm_snqk.h"
+#include "includes/cbm.h"
+#include "machine/6526cia.h"
+#include "machine/c64exp.h"
+#include "machine/c64user.h"
+#include "machine/cbmiec.h"
+#include "machine/cbmipt.h"
+#include "machine/pls100.h"
+#include "machine/ram.h"
+#include "machine/vcsctrl.h"
+#include "sound/dac.h"
+#include "sound/sid6581.h"
+#include "video/mos6566.h"
+
+#define M6510_TAG "u7"
+#define MOS6567_TAG "u19"
+#define MOS6569_TAG "u19"
+#define MOS6851_TAG "u18"
+#define MOS6526_1_TAG "u1"
+#define MOS6526_2_TAG "u2"
+#define PLA_TAG "u17"
+#define SCREEN_TAG "screen"
+#define TIMER_C1531_TAG "c1531"
+#define CONTROL1_TAG "joy1"
+#define CONTROL2_TAG "joy2"
+
+class c64_state : public driver_device
+{
+public:
+ c64_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6510_TAG),
+ m_pla(*this, PLA_TAG),
+ m_vic(*this, MOS6569_TAG),
+ m_sid(*this, MOS6851_TAG),
+ m_cia1(*this, MOS6526_1_TAG),
+ m_cia2(*this, MOS6526_2_TAG),
+ m_iec(*this, CBM_IEC_TAG),
+ m_joy1(*this, CONTROL1_TAG),
+ m_joy2(*this, CONTROL2_TAG),
+ m_exp(*this, C64_EXPANSION_SLOT_TAG),
+ m_user(*this, C64_USER_PORT_TAG),
+ m_ram(*this, RAM_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_cassette_timer(*this, TIMER_C1531_TAG),
+ m_loram(1),
+ m_hiram(1),
+ m_charen(1),
+ m_color_ram(*this, "color_ram"),
+ m_va14(1),
+ m_va15(1),
+ m_cia1_irq(CLEAR_LINE),
+ m_cia2_irq(CLEAR_LINE),
+ m_vic_irq(CLEAR_LINE),
+ m_exp_irq(CLEAR_LINE),
+ m_exp_nmi(CLEAR_LINE),
+ m_cass_rd(1),
+ m_iec_srq(1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<pls100_device> m_pla;
+ required_device<mos6566_device> m_vic;
+ required_device<device_t> m_sid;
+ required_device<mos6526_device> m_cia1;
+ required_device<mos6526_device> m_cia2;
+ optional_device<cbm_iec_device> m_iec;
+ required_device<vcs_control_port_device> m_joy1;
+ required_device<vcs_control_port_device> m_joy2;
+ required_device<c64_expansion_slot_device> m_exp;
+ required_device<c64_user_port_device> m_user;
+ required_device<ram_device> m_ram;
+ optional_device<cassette_image_device> m_cassette;
+ optional_device<timer_device> m_cassette_timer;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void check_interrupts();
+ void bankswitch(offs_t offset, offs_t va, int rw, int aec, int ba, int cas, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh);
+ UINT8 read_memory(address_space &space, offs_t offset, int ba, int casram, int basic, int kernal, int charom, int io, int roml, int romh);
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ DECLARE_READ8_MEMBER( vic_videoram_r );
+ DECLARE_WRITE_LINE_MEMBER( vic_irq_w );
+ DECLARE_READ8_MEMBER( vic_lightpen_x_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_y_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_button_cb );
+ DECLARE_READ8_MEMBER( vic_rdy_cb );
+
+ DECLARE_WRITE_LINE_MEMBER( cia1_irq_w );
+ DECLARE_READ8_MEMBER( cia1_pa_r );
+ DECLARE_READ8_MEMBER( cia1_pb_r );
+ DECLARE_WRITE8_MEMBER( cia1_pb_w );
+
+ DECLARE_WRITE_LINE_MEMBER( cia2_irq_w );
+ DECLARE_READ8_MEMBER( cia2_pa_r );
+ DECLARE_WRITE8_MEMBER( cia2_pa_w );
+
+ DECLARE_READ8_MEMBER( cpu_r );
+ DECLARE_WRITE8_MEMBER( cpu_w );
+
+ DECLARE_WRITE_LINE_MEMBER( iec_srq_w );
+
+ DECLARE_READ8_MEMBER( exp_dma_r );
+ DECLARE_WRITE8_MEMBER( exp_dma_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_nmi_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_reset_w );
+
+ // memory state
+ int m_loram;
+ int m_hiram;
+ int m_charen;
+ UINT8 *m_basic;
+ UINT8 *m_kernal;
+ UINT8 *m_charom;
+
+ // video state
+ required_shared_ptr<UINT8> m_color_ram;
+ int m_va14;
+ int m_va15;
+
+ // interrupt state
+ int m_cia1_irq;
+ int m_cia2_irq;
+ int m_vic_irq;
+ int m_exp_irq;
+ int m_exp_nmi;
+ int m_cass_rd;
+ int m_iec_srq;
+ DECLARE_DRIVER_INIT(c64pal);
+};
+
+
+class sx64_state : public c64_state
+{
+public:
+ sx64_state(const machine_config &mconfig, device_type type, const char *tag)
+ : c64_state(mconfig, type, tag)
+ { }
+
+ DECLARE_READ8_MEMBER( cpu_r );
+ DECLARE_WRITE8_MEMBER( cpu_w );
+};
+
+
+class c64c_state : public c64_state
+{
+public:
+ c64c_state(const machine_config &mconfig, device_type type, const char *tag)
+ : c64_state(mconfig, type, tag)
+ { }
+
+ virtual void machine_start();
+};
+
+
+class c64gs_state : public c64c_state
+{
+public:
+ c64gs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : c64c_state(mconfig, type, tag)
+ { }
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( cpu_r );
+ DECLARE_WRITE8_MEMBER( cpu_w );
+};
+
+
+
+#endif
diff --git a/src/mess/includes/c64_legacy.h b/src/mess/includes/c64_legacy.h
new file mode 100644
index 00000000000..5e18d9cad99
--- /dev/null
+++ b/src/mess/includes/c64_legacy.h
@@ -0,0 +1,128 @@
+/*****************************************************************************
+ *
+ * includes/c64.h
+ *
+ * Commodore C64 Home Computer
+ *
+ * peter.trauner@jk.uni-linz.ac.at
+ *
+ * Documentation: www.funet.fi
+ *
+ ****************************************************************************/
+
+#ifndef C64_H_
+#define C64_H_
+
+#include "machine/6526cia.h"
+#include "machine/cbmiec.h"
+#include "imagedev/cartslot.h"
+
+#define C64_MAX_ROMBANK 64 // .crt files contain multiple 'CHIPs', i.e. rom banks (of variable size) with headers. Known carts have at most 64 'CHIPs'.
+
+typedef struct {
+ int addr, size, index, start;
+} C64_ROM;
+
+typedef struct _c64_cart_t c64_cart_t;
+struct _c64_cart_t {
+ C64_ROM bank[C64_MAX_ROMBANK];
+ INT8 game;
+ INT8 exrom;
+ UINT8 mapper;
+ UINT8 n_banks;
+};
+
+class legacy_c64_state : public driver_device
+{
+public:
+ legacy_c64_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_iec(*this, CBM_IEC_TAG),
+ m_roml_writable(0)
+ { }
+
+ optional_device<cbm_iec_device> m_iec;
+
+ DECLARE_READ8_MEMBER( c64_lightpen_x_cb );
+ DECLARE_READ8_MEMBER( c64_lightpen_y_cb );
+ DECLARE_READ8_MEMBER( c64_lightpen_button_cb );
+ DECLARE_READ8_MEMBER( c64_dma_read );
+ DECLARE_READ8_MEMBER( c64_dma_read_ultimax );
+ DECLARE_READ8_MEMBER( c64_dma_read_color );
+ DECLARE_WRITE_LINE_MEMBER( c64_vic_interrupt );
+ DECLARE_READ8_MEMBER( c64_rdy_cb );
+
+ int m_old_level;
+ int m_old_data;
+ int m_old_exrom;
+ int m_old_game;
+ UINT8 m_vicirq;
+ emu_timer *m_datasette_timer;
+ emu_timer *m_cartridge_timer;
+ UINT8 *m_colorram;
+ UINT8 *m_basic;
+ UINT8 *m_kernal;
+ UINT8 *m_chargen;
+ UINT8 *m_memory;
+ int m_pal;
+ int m_tape_on;
+ UINT8 *m_c64_roml;
+ UINT8 *m_c64_romh;
+ UINT8 *m_vicaddr;
+ UINT8 *m_c128_vicaddr;
+ UINT8 m_game;
+ UINT8 m_exrom;
+ UINT8 *m_io_mirror;
+ UINT8 m_port_data;
+ UINT8 *m_roml;
+ UINT8 *m_romh;
+ int m_roml_writable;
+ int m_ultimax;
+ int m_cia1_on;
+ int m_io_enabled;
+ int m_is_sx64;
+ UINT8 *m_io_ram_w_ptr;
+ UINT8 *m_io_ram_r_ptr;
+ c64_cart_t m_cart;
+ int m_nmilevel;
+
+ DECLARE_DRIVER_INIT( c64 );
+ DECLARE_DRIVER_INIT( c64pal );
+ DECLARE_DRIVER_INIT( ultimax );
+ DECLARE_DRIVER_INIT( c64gs );
+ DECLARE_DRIVER_INIT( sx64 );
+};
+
+
+/*----------- defined in machine/c64.c -----------*/
+
+/* private area */
+
+extern READ8_DEVICE_HANDLER(c64_m6510_port_read);
+extern WRITE8_DEVICE_HANDLER(c64_m6510_port_write);
+
+READ8_HANDLER ( c64_colorram_read );
+WRITE8_HANDLER ( c64_colorram_write );
+
+MACHINE_START( c64 );
+MACHINE_RESET( c64 );
+INTERRUPT_GEN( c64_frame_interrupt );
+TIMER_CALLBACK( c64_tape_timer );
+
+/* private area */
+WRITE8_HANDLER(c64_roml_w);
+
+READ8_HANDLER(c64_ioarea_r);
+WRITE8_HANDLER(c64_ioarea_w);
+
+WRITE8_HANDLER ( c64_write_io );
+READ8_HANDLER ( c64_read_io );
+int c64_paddle_read (device_t *device, int which);
+
+extern const mos6526_interface c64_ntsc_cia0, c64_pal_cia0;
+extern const mos6526_interface c64_ntsc_cia1, c64_pal_cia1;
+
+MACHINE_CONFIG_EXTERN( c64_cartslot );
+MACHINE_CONFIG_EXTERN( ultimax_cartslot );
+
+#endif /* C64_H_ */
diff --git a/src/mess/includes/c65.h b/src/mess/includes/c65.h
new file mode 100644
index 00000000000..8fe7dbdee99
--- /dev/null
+++ b/src/mess/includes/c65.h
@@ -0,0 +1,88 @@
+/*****************************************************************************
+ *
+ * includes/c65.h
+ *
+ ****************************************************************************/
+
+#ifndef C65_H_
+#define C65_H_
+
+#include "includes/c64_legacy.h"
+#include "machine/6526cia.h"
+
+typedef struct
+{
+ int version;
+ UINT8 data[4];
+} dma_t;
+
+typedef struct
+{
+ int state;
+
+ UINT8 reg[0x0f];
+
+ UINT8 buffer[0x200];
+ int cpu_pos;
+ int fdc_pos;
+
+ UINT16 status;
+
+ attotime time;
+ int head,track,sector;
+} fdc_t;
+
+typedef struct
+{
+ UINT8 reg;
+} expansion_ram_t;
+
+class c65_state : public legacy_c64_state
+{
+public:
+ c65_state(const machine_config &mconfig, device_type type, const char *tag)
+ : legacy_c64_state(mconfig, type, tag) { }
+
+ UINT8 *m_chargen;
+ UINT8 *m_interface;
+ int m_charset_select;
+ int m_c64mode;
+ UINT8 m_6511_port;
+ UINT8 m_keyline;
+ int m_old_value;
+ int m_nmilevel;
+ dma_t m_dma;
+ int m_dump_dma;
+ fdc_t m_fdc;
+ expansion_ram_t m_expansion_ram;
+ int m_io_on;
+ int m_io_dc00_on;
+ DECLARE_DRIVER_INIT(c65);
+ DECLARE_DRIVER_INIT(c65pal);
+};
+
+
+/*----------- defined in machine/c65.c -----------*/
+
+/*extern UINT8 *c65_memory; */
+/*extern UINT8 *c65_basic; */
+/*extern UINT8 *c65_kernal; */
+/*extern UINT8 *c65_dos; */
+/*extern UINT8 *c65_monitor; */
+/*extern UINT8 *c65_graphics; */
+
+void c65_bankswitch (running_machine &machine);
+//void c65_colorram_write (running_machine &machine, int offset, int value);
+
+int c65_dma_read(running_machine &machine, int offset);
+int c65_dma_read_color(running_machine &machine, int offset);
+void c65_vic_interrupt(running_machine &machine, int level);
+void c65_bankswitch_interface(running_machine &machine, int value);
+
+MACHINE_START( c65 );
+INTERRUPT_GEN( c65_frame_interrupt );
+
+extern const mos6526_interface c65_ntsc_cia0, c65_pal_cia0;
+extern const mos6526_interface c65_ntsc_cia1, c65_pal_cia1;
+
+#endif /* C65_H_ */
diff --git a/src/mess/includes/c80.h b/src/mess/includes/c80.h
new file mode 100644
index 00000000000..45a2104c49b
--- /dev/null
+++ b/src/mess/includes/c80.h
@@ -0,0 +1,49 @@
+#ifndef __C80__
+#define __C80__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80pio.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "d2"
+#define Z80PIO1_TAG "d11"
+#define Z80PIO2_TAG "d12"
+
+class c80_state : public driver_device
+{
+public:
+ c80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_pio1(*this, Z80PIO1_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_pio1;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( pio1_pa_r );
+ DECLARE_WRITE8_MEMBER( pio1_pa_w );
+ DECLARE_WRITE8_MEMBER( pio1_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( pio1_brdy_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
+
+ /* keyboard state */
+ int m_keylatch;
+
+ /* display state */
+ int m_digit;
+ int m_pio1_a5;
+ int m_pio1_brdy;
+};
+
+#endif
diff --git a/src/mess/includes/cbm.h b/src/mess/includes/cbm.h
new file mode 100644
index 00000000000..0de3973bf92
--- /dev/null
+++ b/src/mess/includes/cbm.h
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ *
+ * includes/cbm.h
+ *
+ ****************************************************************************/
+
+#ifndef CBM_H_
+#define CBM_H_
+
+#include "imagedev/cassette.h"
+
+
+/* global header file for c16, c64, c65, c128, vc20 */
+
+/*----------- defined in machine/cbm.c -----------*/
+
+/* keyboard lines */
+extern UINT8 c64_keyline[10];
+void cbm_common_init(void);
+void cbm_common_interrupt( device_t *device );
+
+UINT8 cbm_common_cia0_port_a_r( device_t *device, UINT8 output_b );
+UINT8 cbm_common_cia0_port_b_r( device_t *device, UINT8 output_a );
+
+/***********************************************
+
+ CBM Datasette Tapes
+
+***********************************************/
+
+extern const cassette_interface cbm_cassette_interface;
+
+
+#endif /* CBM_H_ */
diff --git a/src/mess/includes/cbmb.h b/src/mess/includes/cbmb.h
new file mode 100644
index 00000000000..7e7d8061371
--- /dev/null
+++ b/src/mess/includes/cbmb.h
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ *
+ * includes/cbmb.h
+ *
+ * Commodore B Series Computer
+ *
+ * peter.trauner@jk.uni-linz.ac.at
+ *
+ ****************************************************************************/
+
+#ifndef CBMB_H_
+#define CBMB_H_
+
+#include "video/mc6845.h"
+#include "machine/6526cia.h"
+#include "machine/ieee488.h"
+#include "imagedev/cartslot.h"
+
+class cbmb_state : public driver_device
+{
+public:
+ cbmb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_ieee(*this, IEEE488_TAG),
+ m_basic(*this, "basic"),
+ m_videoram(*this, "videoram"),
+ m_kernal(*this, "kernal"),
+ m_colorram(*this, "colorram"){ }
+
+ required_device<ieee488_device> m_ieee;
+ required_shared_ptr<UINT8> m_basic;
+ required_shared_ptr<UINT8> m_videoram;
+ required_shared_ptr<UINT8> m_kernal;
+ optional_shared_ptr<UINT8> m_colorram;
+
+ DECLARE_READ8_MEMBER( vic_lightpen_x_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_y_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_button_cb );
+ DECLARE_READ8_MEMBER( vic_dma_read );
+ DECLARE_READ8_MEMBER( vic_dma_read_color );
+ DECLARE_READ8_MEMBER( vic_rdy_cb );
+
+ /* keyboard lines */
+ int m_cbmb_keyline_a;
+ int m_cbmb_keyline_b;
+ int m_cbmb_keyline_c;
+
+ int m_p500;
+ int m_cbm700;
+ int m_cbm_ntsc;
+ int m_keyline_a;
+ int m_keyline_b;
+ int m_keyline_c;
+ UINT8 *m_chargen;
+ int m_old_level;
+ int m_irq_level;
+ int m_font;
+ DECLARE_WRITE8_MEMBER(cbmb_colorram_w);
+ DECLARE_DRIVER_INIT(cbm600);
+ DECLARE_DRIVER_INIT(p500);
+ DECLARE_DRIVER_INIT(cbm600hu);
+ DECLARE_DRIVER_INIT(cbm600pal);
+ DECLARE_DRIVER_INIT(cbm700);
+};
+
+/*----------- defined in machine/cbmb.c -----------*/
+
+extern const mos6526_interface cbmb_cia;
+
+
+READ8_DEVICE_HANDLER( cbmb_tpi0_port_a_r );
+WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_a_w );
+READ8_DEVICE_HANDLER( cbmb_tpi0_port_b_r );
+WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_b_w );
+
+WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_a );
+WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_b );
+WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_c );
+READ8_DEVICE_HANDLER( cbmb_keyboard_line_a );
+READ8_DEVICE_HANDLER( cbmb_keyboard_line_b );
+READ8_DEVICE_HANDLER( cbmb_keyboard_line_c );
+WRITE_LINE_DEVICE_HANDLER( cbmb_irq );
+
+int cbmb_dma_read(running_machine &machine, int offset);
+int cbmb_dma_read_color(running_machine &machine, int offset);
+
+WRITE_LINE_DEVICE_HANDLER( cbmb_change_font );
+
+MACHINE_RESET( cbmb );
+
+MACHINE_CONFIG_EXTERN( cbmb_cartslot );
+
+
+/*----------- defined in video/cbmb.c -----------*/
+
+VIDEO_START( cbmb_crtc );
+MC6845_UPDATE_ROW( cbm600_update_row );
+MC6845_UPDATE_ROW( cbm700_update_row );
+WRITE_LINE_DEVICE_HANDLER( cbmb_display_enable_changed );
+
+void cbm600_vh_init(running_machine &machine);
+void cbm700_vh_init(running_machine &machine);
+VIDEO_START( cbm700 );
+
+void cbmb_vh_set_font(running_machine &machine, int font);
+
+
+#endif /* CBMB_H_ */
diff --git a/src/mess/includes/cgc7900.h b/src/mess/includes/cgc7900.h
new file mode 100644
index 00000000000..7fa003e4fc1
--- /dev/null
+++ b/src/mess/includes/cgc7900.h
@@ -0,0 +1,96 @@
+#pragma once
+
+#ifndef __CGC7900__
+#define __CGC7900__
+
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+#include "cpu/mcs48/mcs48.h"
+#include "formats/basicdsk.h"
+#include "machine/ram.h"
+#include "machine/i8251.h"
+#include "sound/ay8910.h"
+
+#define M68000_TAG "uh8"
+#define INS8251_0_TAG "uc10"
+#define INS8251_1_TAG "uc8"
+#define MM58167_TAG "uc6"
+#define AY8910_TAG "uc4"
+#define K1135A_TAG "uc11"
+#define I8035_TAG "i8035"
+#define AM2910_TAG "11d"
+#define SCREEN_TAG "screen"
+
+class cgc7900_state : public driver_device
+{
+public:
+ cgc7900_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M68000_TAG),
+ m_chrom_ram(*this, "chrom_ram"),
+ m_plane_ram(*this, "plane_ram"),
+ m_clut_ram(*this, "clut_ram"),
+ m_overlay_ram(*this, "overlay_ram"),
+ m_roll_bitmap(*this, "roll_bitmap"),
+ m_pan_x(*this, "pan_x"),
+ m_pan_y(*this, "pan_y"),
+ m_zoom(*this, "zoom"),
+ m_blink_select(*this, "blink_select"),
+ m_plane_select(*this, "plane_select"),
+ m_plane_switch(*this, "plane_switch"),
+ m_color_status_fg(*this, "color_status_fg"),
+ m_color_status_bg(*this, "color_status_bg"),
+ m_roll_overlay(*this, "roll_overlay"){ }
+
+ required_device<cpu_device> m_maincpu;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ16_MEMBER( keyboard_r );
+ DECLARE_WRITE16_MEMBER( keyboard_w );
+ DECLARE_WRITE16_MEMBER( interrupt_mask_w );
+ DECLARE_READ16_MEMBER( disk_data_r );
+ DECLARE_WRITE16_MEMBER( disk_data_w );
+ DECLARE_READ16_MEMBER( disk_status_r );
+ DECLARE_WRITE16_MEMBER( disk_command_w );
+ DECLARE_READ16_MEMBER( z_mode_r );
+ DECLARE_WRITE16_MEMBER( z_mode_w );
+ DECLARE_WRITE16_MEMBER( color_status_w );
+ DECLARE_READ16_MEMBER( sync_r );
+
+ void update_clut();
+ void draw_bitmap(screen_device *screen, bitmap_ind16 &bitmap);
+ void draw_overlay(screen_device *screen, bitmap_ind16 &bitmap);
+
+ /* interrupt state */
+ UINT16 m_int_mask;
+
+ /* video state */
+ required_shared_ptr<UINT16> m_chrom_ram;
+ required_shared_ptr<UINT16> m_plane_ram;
+ required_shared_ptr<UINT16> m_clut_ram;
+ required_shared_ptr<UINT16> m_overlay_ram;
+ UINT8 *m_char_rom;
+ required_shared_ptr<UINT16> m_roll_bitmap;
+ required_shared_ptr<UINT16> m_pan_x;
+ required_shared_ptr<UINT16> m_pan_y;
+ required_shared_ptr<UINT16> m_zoom;
+ required_shared_ptr<UINT16> m_blink_select;
+ required_shared_ptr<UINT16> m_plane_select;
+ required_shared_ptr<UINT16> m_plane_switch;
+ required_shared_ptr<UINT16> m_color_status_fg;
+ required_shared_ptr<UINT16> m_color_status_bg;
+ required_shared_ptr<UINT16> m_roll_overlay;
+ int m_blink;
+};
+
+/*----------- defined in video/cgc7900.c -----------*/
+
+MACHINE_CONFIG_EXTERN( cgc7900_video );
+
+#endif
diff --git a/src/mess/includes/cgenie.h b/src/mess/includes/cgenie.h
new file mode 100644
index 00000000000..60b94160ee1
--- /dev/null
+++ b/src/mess/includes/cgenie.h
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ *
+ * includes/cgenie.h
+ *
+ ****************************************************************************/
+
+#ifndef CGENIE_H_
+#define CGENIE_H_
+
+#include "machine/wd17xx.h"
+
+// CRTC 6845
+typedef struct
+{
+ UINT8 cursor_address_lo;
+ UINT8 cursor_address_hi;
+ UINT8 screen_address_lo;
+ UINT8 screen_address_hi;
+ UINT8 cursor_bottom;
+ UINT8 cursor_top;
+ UINT8 scan_lines;
+ UINT8 crt_mode;
+ UINT8 vertical_sync_pos;
+ UINT8 vertical_displayed;
+ UINT8 vertical_adjust;
+ UINT8 vertical_total;
+ UINT8 horizontal_length;
+ UINT8 horizontal_sync_pos;
+ UINT8 horizontal_displayed;
+ UINT8 horizontal_total;
+ UINT8 idx;
+ UINT8 cursor_visible;
+ UINT8 cursor_phase;
+} CRTC6845;
+
+
+class cgenie_state : public driver_device
+{
+public:
+ cgenie_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_colorram(*this, "colorram"),
+ m_fontram(*this, "fontram"){ }
+
+ required_shared_ptr<UINT8> m_colorram;
+ required_shared_ptr<UINT8> m_fontram;
+
+ UINT8 *m_videoram;
+ int m_tv_mode;
+ int m_font_offset[4];
+ int m_port_ff;
+ UINT8 m_irq_status;
+ UINT8 m_motor_drive;
+ UINT8 m_head;
+ UINT8 m_cass_level;
+ UINT8 m_cass_bit;
+ UINT8 m_psg_a_out;
+ UINT8 m_psg_b_out;
+ UINT8 m_psg_a_inp;
+ UINT8 m_psg_b_inp;
+ UINT8 m_control_port;
+ CRTC6845 m_crt;
+ int m_graphics;
+ bitmap_ind16 m_bitmap;
+ bitmap_ind16 m_dlybitmap;
+ int m_off_x;
+ int m_off_y;
+};
+
+
+/*----------- defined in machine/cgenie.c -----------*/
+
+READ8_DEVICE_HANDLER( cgenie_sh_control_port_r );
+WRITE8_DEVICE_HANDLER( cgenie_sh_control_port_w );
+
+extern const wd17xx_interface cgenie_wd17xx_interface;
+
+
+READ8_HANDLER ( cgenie_psg_port_a_r );
+READ8_HANDLER ( cgenie_psg_port_b_r );
+WRITE8_HANDLER ( cgenie_psg_port_a_w );
+WRITE8_HANDLER ( cgenie_psg_port_b_w );
+
+MACHINE_START( cgenie );
+MACHINE_RESET( cgenie );
+
+READ8_HANDLER ( cgenie_colorram_r );
+READ8_HANDLER ( cgenie_fontram_r );
+
+WRITE8_HANDLER ( cgenie_colorram_w );
+WRITE8_HANDLER ( cgenie_fontram_w );
+
+WRITE8_HANDLER ( cgenie_port_ff_w );
+ READ8_HANDLER ( cgenie_port_ff_r );
+int cgenie_port_xx_r(int offset);
+
+INTERRUPT_GEN( cgenie_timer_interrupt );
+INTERRUPT_GEN( cgenie_frame_interrupt );
+
+ READ8_HANDLER ( cgenie_status_r );
+ READ8_HANDLER ( cgenie_track_r );
+ READ8_HANDLER ( cgenie_sector_r );
+ READ8_HANDLER ( cgenie_data_r );
+
+WRITE8_HANDLER ( cgenie_command_w );
+WRITE8_HANDLER ( cgenie_track_w );
+WRITE8_HANDLER ( cgenie_sector_w );
+WRITE8_HANDLER ( cgenie_data_w );
+
+ READ8_HANDLER ( cgenie_irq_status_r );
+
+WRITE8_HANDLER ( cgenie_motor_w );
+
+ READ8_HANDLER ( cgenie_keyboard_r );
+int cgenie_videoram_r(running_machine &machine,int offset);
+WRITE8_HANDLER ( cgenie_videoram_w );
+
+
+/*----------- defined in video/cgenie.c -----------*/
+
+VIDEO_START( cgenie );
+SCREEN_UPDATE_IND16( cgenie );
+
+READ8_HANDLER ( cgenie_index_r );
+READ8_HANDLER ( cgenie_register_r );
+
+WRITE8_HANDLER ( cgenie_index_w );
+WRITE8_HANDLER ( cgenie_register_w );
+
+int cgenie_get_register(running_machine &machine, int indx);
+void cgenie_mode_select(running_machine &machine, int graphics);
+
+
+#endif /* CGENIE_H_ */
diff --git a/src/mess/includes/channelf.h b/src/mess/includes/channelf.h
new file mode 100644
index 00000000000..70ca1a62a8b
--- /dev/null
+++ b/src/mess/includes/channelf.h
@@ -0,0 +1,68 @@
+/*****************************************************************************
+ *
+ * includes/channelf.h
+ *
+ ****************************************************************************/
+
+#ifndef CHANNELF_H_
+#define CHANNELF_H_
+
+#include "emu.h"
+#include "cpu/f8/f8.h"
+#include "imagedev/cartslot.h"
+
+
+/* SKR - 2102 RAM chip on carts 10 and 18 I/O ports */
+typedef struct
+{
+ UINT8 d; /* data bit:inverted logic, but reading/writing cancel out */
+ UINT8 r_w; /* inverted logic: 0 means read, 1 means write */
+ UINT8 a[10]; /* addr bits: inverted logic, but reading/writing cancel out */
+ UINT16 addr; /* calculated addr from addr bits */
+ UINT8 ram[1024]; /* RAM array */
+} r2102_t;
+
+
+class channelf_state : public driver_device
+{
+public:
+ channelf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ DECLARE_READ8_MEMBER(channelf_port_0_r);
+ DECLARE_READ8_MEMBER(channelf_port_1_r);
+ DECLARE_READ8_MEMBER(channelf_port_4_r);
+ DECLARE_READ8_MEMBER(channelf_port_5_r);
+ DECLARE_READ8_MEMBER(channelf_2102A_r);
+ DECLARE_READ8_MEMBER(channelf_2102B_r);
+ DECLARE_WRITE8_MEMBER(channelf_port_0_w);
+ DECLARE_WRITE8_MEMBER(channelf_port_1_w);
+ DECLARE_WRITE8_MEMBER(channelf_port_4_w);
+ DECLARE_WRITE8_MEMBER(channelf_port_5_w);
+ DECLARE_WRITE8_MEMBER(channelf_2102A_w);
+ DECLARE_WRITE8_MEMBER(channelf_2102B_w);
+ UINT8 *m_p_videoram;
+ UINT8 m_latch[6];
+ r2102_t m_r2102;
+ UINT8 m_val_reg;
+ UINT8 m_row_reg;
+ UINT8 m_col_reg;
+ UINT8 port_read_with_latch(UINT8 ext, UINT8 latch_state);
+};
+
+
+/*----------- defined in video/channelf.c -----------*/
+
+PALETTE_INIT( channelf );
+VIDEO_START( channelf );
+SCREEN_UPDATE_IND16( channelf );
+
+
+/*----------- defined in audio/channelf.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(CHANNELF, channelf_sound);
+
+void channelf_sound_w(device_t *device, int mode);
+
+
+#endif /* CHANNELF_H_ */
diff --git a/src/mess/includes/coco.h b/src/mess/includes/coco.h
new file mode 100644
index 00000000000..3b44f435314
--- /dev/null
+++ b/src/mess/includes/coco.h
@@ -0,0 +1,262 @@
+/***************************************************************************
+
+ coco.h
+
+ TRS-80 Radio Shack Color Computer Family
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __COCO__
+#define __COCO__
+
+
+#include "emu.h"
+#include "imagedev/cassette.h"
+#include "imagedev/bitbngr.h"
+#include "machine/6821pia.h"
+#include "machine/cococart.h"
+#include "machine/coco_vhd.h"
+#include "machine/ram.h"
+#include "sound/dac.h"
+#include "sound/wave.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+INPUT_PORTS_EXTERN( coco_analog_control );
+INPUT_PORTS_EXTERN( coco_cart_autostart );
+
+SLOT_INTERFACE_EXTERN( coco_cart );
+
+/* constants */
+#define JOYSTICK_DELTA 10
+#define JOYSTICK_SENSITIVITY 100
+
+/* devices */
+#define MAINCPU_TAG "maincpu"
+#define PIA0_TAG "pia0"
+#define PIA1_TAG "pia1"
+#define SAM_TAG "sam"
+#define VDG_TAG "vdg"
+#define SCREEN_TAG "screen"
+#define DAC_TAG "dac"
+#define CARTRIDGE_TAG "ext"
+#define BITBANGER_TAG "bitbanger"
+#define VHD0_TAG "vhd0"
+#define VHD1_TAG "vhd1"
+
+/* inputs */
+#define CTRL_SEL_TAG "ctrl_sel"
+#define HIRES_INTF_TAG "hires_intf"
+#define CART_AUTOSTART_TAG "cart_autostart"
+#define JOYSTICK_RX_TAG "joystick_rx"
+#define JOYSTICK_RY_TAG "joystick_ry"
+#define JOYSTICK_LX_TAG "joystick_lx"
+#define JOYSTICK_LY_TAG "joystick_ly"
+#define JOYSTICK_BUTTONS_TAG "joystick_buttons"
+#define RAT_MOUSE_RX_TAG "rat_mouse_rx"
+#define RAT_MOUSE_RY_TAG "rat_mouse_ry"
+#define RAT_MOUSE_LX_TAG "rat_mouse_lx"
+#define RAT_MOUSE_LY_TAG "rat_mouse_ly"
+#define RAT_MOUSE_BUTTONS_TAG "rat_mouse_buttons"
+#define DIECOM_LIGHTGUN_RX_TAG "dclg_rx"
+#define DIECOM_LIGHTGUN_RY_TAG "dclg_ry"
+#define DIECOM_LIGHTGUN_LX_TAG "dclg_lx"
+#define DIECOM_LIGHTGUN_LY_TAG "dclg_ly"
+#define DIECOM_LIGHTGUN_BUTTONS_TAG "dclg_triggers"
+
+MACHINE_CONFIG_EXTERN( coco_sound );
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class coco_state : public driver_device
+{
+public:
+ coco_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<pia6821_device> m_pia_0;
+ required_device<pia6821_device> m_pia_1;
+ required_device<dac_device> m_dac;
+ required_device<device_t> m_wave;
+ required_device<cococart_slot_device> m_cococart;
+ required_device<ram_device> m_ram;
+ required_device<cassette_image_device> m_cassette;
+ optional_device<bitbanger_device> m_bitbanger;
+ optional_device<coco_vhd_image_device> m_vhd_0;
+ optional_device<coco_vhd_image_device> m_vhd_1;
+
+ static const pia6821_interface pia0_config;
+ static const pia6821_interface pia1_config;
+ static const cococart_interface cartridge_config;
+ static const bitbanger_config coco_bitbanger_config;
+ static const cassette_interface coco_cassette_interface;
+
+ /* driver update handlers */
+ static INPUT_CHANGED(keyboard_changed);
+ static INPUT_CHANGED(joystick_mode_changed);
+ static void bitbanger_callback(running_machine &machine, UINT8 bit);
+
+ /* IO */
+ virtual DECLARE_READ8_MEMBER( ff00_read );
+ virtual DECLARE_WRITE8_MEMBER( ff00_write );
+ virtual DECLARE_READ8_MEMBER( ff20_read );
+ virtual DECLARE_WRITE8_MEMBER( ff20_write );
+ virtual DECLARE_READ8_MEMBER( ff40_read );
+ virtual DECLARE_WRITE8_MEMBER( ff40_write );
+ DECLARE_READ8_MEMBER( ff60_read );
+ DECLARE_WRITE8_MEMBER( ff60_write );
+
+ /* floating bus */
+ DECLARE_READ8_MEMBER( floating_bus_read ) { return floating_bus_read(); }
+
+protected:
+ /* device-level overrides */
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ /* interrupts */
+ virtual bool firq_get_line(void);
+ virtual bool irq_get_line(void);
+ void recalculate_irq(void);
+ void recalculate_firq(void);
+
+ /* changed handlers */
+ virtual void pia1_pa_changed(void);
+ virtual void pia1_pb_changed(void);
+ virtual void bitbanger_changed(bool newvalue);
+
+ /* miscellaneous */
+ virtual void update_keyboard_input(UINT8 value, UINT8 z);
+ virtual void cart_w(bool state);
+ DECLARE_WRITE_LINE_MEMBER( cart_w ) { cart_w((bool) state); }
+ virtual void update_cart_base(UINT8 *cart_base) = 0;
+
+ /* PIA0 */
+ DECLARE_WRITE8_MEMBER( pia0_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( pia0_ca2_w );
+ DECLARE_WRITE_LINE_MEMBER( pia0_cb2_w );
+ DECLARE_WRITE_LINE_MEMBER( pia0_irq_a );
+ DECLARE_WRITE_LINE_MEMBER( pia0_irq_b );
+
+ /* PIA1 */
+ DECLARE_READ8_MEMBER( pia1_pa_r );
+ DECLARE_READ8_MEMBER( pia1_pb_r );
+ DECLARE_WRITE8_MEMBER( pia1_pa_w );
+ DECLARE_WRITE8_MEMBER( pia1_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( pia1_ca2_w );
+ DECLARE_WRITE_LINE_MEMBER( pia1_cb2_w );
+ DECLARE_WRITE_LINE_MEMBER( pia1_firq_a );
+ DECLARE_WRITE_LINE_MEMBER( pia1_firq_b );
+
+private:
+ // timer constants
+ static const device_timer_id TIMER_HIRES_JOYSTICK_X = 0;
+ static const device_timer_id TIMER_HIRES_JOYSTICK_Y = 1;
+ static const device_timer_id TIMER_DIECOM_LIGHTGUN = 2;
+
+ typedef enum
+ {
+ SOUNDMUX_SEL1 = 1,
+ SOUNDMUX_SEL2 = 2,
+ SOUNDMUX_ENABLE = 4
+ } soundmux_status_t;
+
+ typedef enum
+ {
+ JOYSTICK_NONE = 0x00,
+ JOYSTICK_NORMAL = 0x01,
+ JOYSTICK_RAT_MOUSE = 0x02,
+ JOYSTICK_DIECOM_LIGHT_GUN = 0x03
+ } joystick_type_t;
+
+ typedef enum
+ {
+ HIRES_NONE = 0x00,
+ HIRES_RIGHT = 0x01,
+ HIRES_RIGHT_COCOMAX3 = 0x02,
+ HIRES_LEFT = 0x03,
+ HIRES_LEFT_COCOMAX3 = 0x04,
+ } hires_type_t;
+
+ typedef struct
+ {
+ ioport_port *m_input[2][2];
+ ioport_port *m_buttons;
+
+ UINT8 input(int joystick, int axis) const { return m_input[joystick][axis] ? m_input[joystick][axis]->read() : 0x00; }
+ UINT8 buttons(void) const { return m_buttons ? m_buttons->read() : 0x00; }
+ } analog_input_t;
+
+ void analog_port_start(analog_input_t *analog, const char *rx_tag, const char *ry_tag, const char *lx_tag, const char *ly_tag, const char *buttons_tag);
+
+ /* wrappers for configuration */
+ joystick_type_t joystick_type(int index);
+ hires_type_t hires_interface_type(void);
+ bool is_joystick_hires(int joystick_index);
+
+ soundmux_status_t soundmux_status(void);
+ UINT8 sound_value(void);
+ void update_sound(void);
+ bool joyin(void);
+ void poll_joystick(bool *joyin, UINT8 *buttons);
+ void poll_keyboard(void);
+ void poll_hires_joystick(void);
+ void update_cassout(int cassout);
+ void update_prinout(bool prinout);
+ DECLARE_WRITE_LINE_MEMBER( bitbanger_callback );
+ void diecom_lightgun_clock(void);
+
+ /* thin wrappers for PIA output */
+ UINT8 dac_output(void) { return m_dac_output; } /* PA drives the DAC */
+ bool sel1(void) { return m_pia_0->ca2_output() ? true : false; }
+ bool sel2(void) { return m_pia_0->cb2_output() ? true : false; }
+ bool snden(void) { return m_pia_1->cb2_output() ? true : false; }
+
+ /* VHD selection */
+ coco_vhd_image_device *current_vhd(void);
+
+ /* floating bus */
+ UINT8 floating_bus_read(void);
+
+ /* disassembly override */
+ static offs_t dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
+
+ /* input ports */
+ ioport_port *m_keyboard[7];
+ ioport_port *m_joystick_type_control;
+ ioport_port *m_joystick_hires_control;
+ analog_input_t m_joystick;
+ analog_input_t m_rat_mouse;
+ analog_input_t m_diecom_lightgun;
+
+ /* DAC output */
+ UINT8 m_dac_output;
+
+ /* hires interface */
+ emu_timer *m_hiresjoy_transition_timer[2];
+ bool m_hiresjoy_ca;
+
+ /* diecom lightgun */
+ emu_timer *m_diecom_lightgun_timer;
+ bool m_dclg_previous_bit;
+ UINT8 m_dclg_output_h;
+ UINT8 m_dclg_output_v;
+ UINT8 m_dclg_state;
+ UINT16 m_dclg_timer;
+
+ /* VHD selection */
+ UINT8 m_vhd_select;
+};
+
+#endif /* __COCO__ */
diff --git a/src/mess/includes/coco12.h b/src/mess/includes/coco12.h
new file mode 100644
index 00000000000..3b02ac5f03d
--- /dev/null
+++ b/src/mess/includes/coco12.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+
+ coco12.h
+
+ TRS-80 Radio Shack Color Computer 1/2 Family
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __COCO12__
+#define __COCO12__
+
+
+#include "includes/coco.h"
+#include "machine/6883sam.h"
+#include "video/mc6847.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define SAM_TAG "sam"
+#define VDG_TAG "vdg"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class coco12_state : public coco_state
+{
+public:
+ coco12_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ required_device<sam6883_device> m_sam;
+ required_device<mc6847_base_device> m_vdg;
+
+ static const mc6847_interface mc6847_config;
+ static const sam6883_interface sam6883_config;
+
+protected:
+ virtual void device_start();
+ virtual void update_cart_base(UINT8 *cart_base);
+
+ /* PIA1 */
+ virtual void pia1_pb_changed(void);
+
+private:
+ DECLARE_WRITE_LINE_MEMBER( horizontal_sync );
+ DECLARE_WRITE_LINE_MEMBER( field_sync );
+
+ DECLARE_READ8_MEMBER( sam_read );
+
+ void configure_sam(void);
+};
+
+
+#endif /* __COCO12__ */
diff --git a/src/mess/includes/coco3.h b/src/mess/includes/coco3.h
new file mode 100644
index 00000000000..beeae2cc990
--- /dev/null
+++ b/src/mess/includes/coco3.h
@@ -0,0 +1,63 @@
+/***************************************************************************
+
+ coco3.h
+
+ TRS-80 Radio Shack Color Computer 1/2 Family
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __COCO3__
+#define __COCO3__
+
+
+#include "includes/coco.h"
+#include "video/gime.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define GIME_TAG "gime"
+#define VDG_TAG "vdg"
+#define COMPOSITE_SCREEN_TAG "composite"
+#define RGB_SCREEN_TAG "rgb"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class coco3_state : public coco_state
+{
+public:
+ coco3_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ required_device<gime_base_device> m_gime;
+
+ virtual DECLARE_WRITE8_MEMBER( ff20_write );
+ virtual DECLARE_READ8_MEMBER( ff40_read );
+ virtual DECLARE_WRITE8_MEMBER( ff40_write );
+
+ DECLARE_WRITE_LINE_MEMBER(gime_firq_w) { recalculate_firq(); }
+ DECLARE_WRITE_LINE_MEMBER(gime_irq_w) { recalculate_irq(); }
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+protected:
+ virtual void update_cart_base(UINT8 *cart_base);
+
+ /* interrupts */
+ virtual bool firq_get_line(void);
+ virtual bool irq_get_line(void);
+
+ /* miscellaneous */
+ virtual void update_keyboard_input(UINT8 value, UINT8 z);
+ virtual void cart_w(bool line);
+};
+
+#endif // __COCO3__
diff --git a/src/mess/includes/coleco.h b/src/mess/includes/coleco.h
new file mode 100644
index 00000000000..6e898bfcd23
--- /dev/null
+++ b/src/mess/includes/coleco.h
@@ -0,0 +1,48 @@
+#pragma once
+
+#ifndef __COLECO__
+#define __COLECO__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/sn76496.h"
+#include "video/tms9928a.h"
+#include "machine/coleco.h"
+#include "imagedev/cartslot.h"
+
+#define Z80_TAG "z80"
+
+class coleco_state : public driver_device
+{
+public:
+ coleco_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( paddle_1_r );
+ DECLARE_READ8_MEMBER( paddle_2_r );
+ DECLARE_WRITE8_MEMBER( paddle_off_w );
+ DECLARE_WRITE8_MEMBER( paddle_on_w );
+
+ int m_joy_mode;
+ int m_last_nmi_state;
+
+ // analog controls
+ attotime m_joy_pulse_reload[2];
+ emu_timer *m_joy_pulse_timer[2];
+ emu_timer *m_joy_irq_timer[2];
+ emu_timer *m_joy_d7_timer[2];
+ int m_joy_irq_state[2];
+ int m_joy_d7_state[2];
+ UINT8 m_joy_analog_state[2];
+ UINT8 m_joy_analog_reload[2];
+};
+
+#endif
diff --git a/src/mess/includes/compis.h b/src/mess/includes/compis.h
new file mode 100644
index 00000000000..0c8c35551ea
--- /dev/null
+++ b/src/mess/includes/compis.h
@@ -0,0 +1,202 @@
+/*****************************************************************************
+ *
+ * includes/compis.h
+ *
+ * machine driver header
+ *
+ * Per Ola Ingvarsson
+ * Tomas Karlsson
+ *
+ ****************************************************************************/
+
+#ifndef COMPIS_H_
+#define COMPIS_H_
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/mcs48/mcs48.h"
+#include "video/upd7220.h"
+#include "machine/ctronics.h"
+#include "machine/i8251.h"
+#include "machine/pit8253.h"
+#include "machine/i8255.h"
+#include "machine/pic8259.h"
+#include "machine/mm58274c.h"
+#include "machine/upd765.h"
+#include "imagedev/flopdrv.h"
+#include "formats/cpis_dsk.h"
+
+
+struct mem_state
+{
+ UINT16 lower;
+ UINT16 upper;
+ UINT16 middle;
+ UINT16 middle_size;
+ UINT16 peripheral;
+};
+
+struct timer_state
+{
+ UINT16 control;
+ UINT16 maxA;
+ UINT16 maxB;
+ UINT16 count;
+ emu_timer * int_timer;
+ emu_timer * time_timer;
+ UINT8 time_timer_active;
+ attotime last_time;
+};
+
+struct dma_state
+{
+ UINT32 source;
+ UINT32 dest;
+ UINT16 count;
+ UINT16 control;
+ UINT8 finished;
+ emu_timer * finish_timer;
+};
+
+struct intr_state
+{
+ UINT8 pending;
+ UINT16 ack_mask;
+ UINT16 priority_mask;
+ UINT16 in_service;
+ UINT16 request;
+ UINT16 status;
+ UINT16 poll_status;
+ UINT16 timer;
+ UINT16 dma[2];
+ UINT16 ext[4];
+};
+
+typedef struct
+{
+ struct timer_state timer[3];
+ struct dma_state dma[2];
+ struct intr_state intr;
+ struct mem_state mem;
+} i186_state;
+
+
+/* Keyboard */
+typedef struct
+{
+ UINT8 nationality; /* Character set, keyboard layout (Swedish) */
+ UINT8 release_time; /* Autorepeat release time (0.8) */
+ UINT8 speed; /* Transmission speed (14) */
+ UINT8 roll_over; /* Key roll-over (MKEY) */
+ UINT8 click; /* Key click (NO) */
+ UINT8 break_nmi; /* Keyboard break (NMI) */
+ UINT8 beep_freq; /* Beep frequency (low) */
+ UINT8 beep_dura; /* Beep duration (short) */
+ UINT8 password[8]; /* Password */
+ UINT8 owner[16]; /* Owner */
+ UINT8 network_id; /* Network workstation number (1) */
+ UINT8 boot_order[4]; /* Boot device order (FD HD NW PD) */
+ UINT8 key_code;
+ UINT8 key_status;
+} TYP_COMPIS_KEYBOARD;
+
+/* USART 8251 */
+typedef struct
+{
+ UINT8 status;
+ UINT8 bytes_sent;
+} TYP_COMPIS_USART;
+
+/* Printer */
+typedef struct
+{
+ UINT8 data;
+ UINT8 strobe;
+} TYP_COMPIS_PRINTER;
+
+
+/* Main emulation */
+typedef struct
+{
+ TYP_COMPIS_PRINTER printer; /* Printer */
+ TYP_COMPIS_USART usart; /* USART 8251 */
+ TYP_COMPIS_KEYBOARD keyboard; /* Keyboard */
+} TYP_COMPIS;
+
+
+class compis_state : public driver_device
+{
+public:
+ compis_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_8253(*this, "pit8253"),
+ m_8254(*this, "pit8254"),
+ m_8259m(*this, "pic8259_master"),
+ m_8259s(*this, "pic8259_slave"),
+ m_8255(*this, "ppi8255"),
+ m_centronics(*this, "centronics"),
+ m_uart(*this, "uart"),
+ m_rtc(*this, "mm58274c"),
+ m_fdc(*this, "upd765"),
+ m_crtc(*this, "upd7220"),
+ m_video_ram(*this, "video_ram") { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_8253;
+ required_device<device_t> m_8254;
+ required_device<device_t> m_8259m;
+ required_device<device_t> m_8259s;
+ required_device<i8255_device> m_8255;
+ required_device<centronics_device> m_centronics;
+ required_device<i8251_device> m_uart;
+ required_device<device_t> m_rtc;
+ required_device<device_t> m_fdc;
+ required_device<upd7220_device> m_crtc;
+ DECLARE_READ16_MEMBER(compis_fdc_dack_r);
+ DECLARE_READ16_MEMBER(compis_usart_r);
+ DECLARE_WRITE16_MEMBER(compis_usart_w);
+ DECLARE_READ16_MEMBER(compis_i186_internal_port_r);
+ DECLARE_WRITE16_MEMBER(compis_i186_internal_port_w);
+ DECLARE_WRITE8_MEMBER(vram_w);
+ DECLARE_WRITE8_MEMBER(compis_fdc_w);
+ DECLARE_READ8_MEMBER(compis_fdc_r);
+ DECLARE_WRITE_LINE_MEMBER(compis_fdc_int);
+ DECLARE_WRITE_LINE_MEMBER(compis_fdc_dma_drq);
+ DECLARE_READ8_MEMBER(compis_ppi_port_b_r);
+ DECLARE_WRITE8_MEMBER(compis_ppi_port_c_w);
+ DECLARE_READ16_MEMBER(compis_osp_pit_r);
+ DECLARE_WRITE16_MEMBER(compis_osp_pit_w);
+ DECLARE_WRITE_LINE_MEMBER(compis_usart_rxready);
+ DECLARE_WRITE_LINE_MEMBER(compis_pic8259_master_set_int_line);
+ DECLARE_WRITE_LINE_MEMBER(compis_pic8259_slave_set_int_line);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ i186_state m_i186;
+ TYP_COMPIS m_compis;
+ UINT8 *m_p_videoram;
+ void update_dma_control(int which, int new_control);
+ void internal_timer_update(int which, int new_count, int new_maxA, int new_maxB, int new_control);
+ void internal_timer_sync(int which);
+ void handle_eoi(int data);
+ void compis_fdc_tc(int state);
+
+ required_shared_ptr<UINT8> m_video_ram;
+ DECLARE_DRIVER_INIT(compis);
+};
+
+
+/*----------- defined in machine/compis.c -----------*/
+
+extern const i8255_interface compis_ppi_interface;
+extern const struct pit8253_config compis_pit8253_config;
+extern const struct pit8253_config compis_pit8254_config;
+extern const struct pic8259_interface compis_pic8259_master_config;
+extern const struct pic8259_interface compis_pic8259_slave_config;
+extern const i8251_interface compis_usart_interface;
+extern const upd765_interface compis_fdc_interface;
+
+MACHINE_START(compis);
+MACHINE_RESET(compis);
+INTERRUPT_GEN(compis_vblank_int);
+
+#endif /* COMPIS_H_ */
diff --git a/src/mess/includes/comquest.h b/src/mess/includes/comquest.h
new file mode 100644
index 00000000000..0cc88d870a7
--- /dev/null
+++ b/src/mess/includes/comquest.h
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ *
+ * includes/comquest.h
+ *
+ ****************************************************************************/
+
+#ifndef COMQUEST_H_
+#define COMQUEST_H_
+
+
+class comquest_state : public driver_device
+{
+public:
+ comquest_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_data[128][8];
+ void *m_timer;
+ int m_line;
+ int m_dma_activ;
+ int m_state;
+ int m_count;
+ DECLARE_READ8_MEMBER(comquest_read);
+ DECLARE_WRITE8_MEMBER(comquest_write);
+};
+
+
+/*----------- defined in video/comquest.c -----------*/
+
+VIDEO_START( comquest );
+SCREEN_UPDATE_IND16( comquest );
+
+
+#endif /* COMQUEST_H_ */
diff --git a/src/mess/includes/comx35.h b/src/mess/includes/comx35.h
new file mode 100644
index 00000000000..f9b658a127d
--- /dev/null
+++ b/src/mess/includes/comx35.h
@@ -0,0 +1,110 @@
+#pragma once
+
+#ifndef __COMX35__
+#define __COMX35__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "sound/cdp1869.h"
+#include "sound/wave.h"
+#include "formats/comx35_comx.h"
+#include "imagedev/cassette.h"
+#include "imagedev/printer.h"
+#include "imagedev/snapquik.h"
+#include "machine/cdp1871.h"
+#include "machine/comxexp.h"
+#include "machine/comxpl80.h"
+#include "machine/comx_clm.h"
+#include "machine/comx_eb.h"
+#include "machine/comx_epr.h"
+#include "machine/comx_fd.h"
+#include "machine/comx_joy.h"
+#include "machine/comx_prn.h"
+#include "machine/comx_ram.h"
+#include "machine/comx_thm.h"
+#include "machine/ram.h"
+#include "machine/rescap.h"
+
+#define SCREEN_TAG "screen"
+
+#define CDP1870_TAG "u1"
+#define CDP1869_TAG "u2"
+#define CDP1802_TAG "u3"
+#define CDP1871_TAG "u4"
+#define EXPANSION_TAG "slot"
+
+#define COMX35_CHARRAM_SIZE 0x800
+#define COMX35_CHARRAM_MASK 0x7ff
+
+class comx35_state : public driver_device
+{
+public:
+ comx35_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_vis(*this, CDP1869_TAG),
+ m_kbe(*this, CDP1871_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_expansion(*this, EXPANSION_TAG),
+ m_ef4(0)
+ { }
+
+ required_device<cosmac_device> m_maincpu;
+ required_device<cdp1869_device> m_vis;
+ required_device<cdp1871_device> m_kbe;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+ required_device<comx_expansion_slot_device> m_expansion;
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ enum
+ {
+ TIMER_ID_RESET
+ };
+
+ void check_interrupt();
+
+ DECLARE_READ8_MEMBER( mem_r );
+ DECLARE_WRITE8_MEMBER( mem_w );
+ DECLARE_READ8_MEMBER( io_r );
+ DECLARE_WRITE8_MEMBER( io_w );
+ DECLARE_WRITE8_MEMBER( cdp1869_w );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef4_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_READ_LINE_MEMBER( shift_r );
+ DECLARE_READ_LINE_MEMBER( control_r );
+ DECLARE_WRITE_LINE_MEMBER( ef4_w );
+ DECLARE_WRITE_LINE_MEMBER( int_w );
+ DECLARE_WRITE_LINE_MEMBER( prd_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+
+ // processor state
+ int m_clear; // CPU mode
+ int m_q; // Q flag
+ int m_ef4; // EF4 flag
+ int m_iden; // interrupt/DMA enable
+ int m_dma; // memory refresh DMA
+ int m_int; // interrupt request
+ int m_prd; // predisplay
+ int m_cr1; // interrupt enable
+
+ // video state
+ UINT8 *m_charram; // character memory
+};
+
+// ---------- defined in video/comx35.c ----------
+
+MACHINE_CONFIG_EXTERN( comx35_pal_video );
+MACHINE_CONFIG_EXTERN( comx35_ntsc_video );
+
+#endif
diff --git a/src/mess/includes/concept.h b/src/mess/includes/concept.h
new file mode 100644
index 00000000000..a31af4e7b38
--- /dev/null
+++ b/src/mess/includes/concept.h
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ *
+ * includes/concept.h
+ *
+ * Corvus Concept driver
+ *
+ * Raphael Nabet, 2003
+ *
+ ****************************************************************************/
+
+#ifndef CONCEPT_H_
+#define CONCEPT_H_
+
+#include "machine/6522via.h"
+#include "machine/wd17xx.h"
+
+/* keyboard interface */
+enum
+{
+ KeyQueueSize = 32,
+ MaxKeyMessageLen = 1
+};
+
+typedef struct
+{
+ read8_space_func reg_read;
+ write8_space_func reg_write;
+ read8_space_func rom_read;
+ write8_space_func rom_write;
+} expansion_slot_t;
+
+
+class concept_state : public driver_device
+{
+public:
+ concept_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_videoram(*this,"videoram") { }
+
+ required_shared_ptr<UINT16> m_videoram;
+ UINT8 m_pending_interrupts;
+ char m_clock_enable;
+ char m_clock_address;
+ UINT8 m_KeyQueue[KeyQueueSize];
+ int m_KeyQueueHead;
+ int m_KeyQueueLen;
+ UINT32 m_KeyStateSave[3];
+ UINT8 m_fdc_local_status;
+ UINT8 m_fdc_local_command;
+ expansion_slot_t m_expansion_slots[4];
+ DECLARE_READ16_MEMBER(concept_io_r);
+ DECLARE_WRITE16_MEMBER(concept_io_w);
+ DECLARE_WRITE8_MEMBER(concept_fdc_reg_w);
+ DECLARE_READ8_MEMBER(concept_hdc_reg_r);
+ DECLARE_WRITE8_MEMBER(concept_hdc_reg_w);
+};
+
+
+/*----------- defined in machine/concept.c -----------*/
+
+extern const via6522_interface concept_via6522_intf;
+extern const wd17xx_interface concept_wd17xx_interface;
+
+MACHINE_START(concept);
+VIDEO_START(concept);
+SCREEN_UPDATE_IND16(concept);
+INTERRUPT_GEN( concept_interrupt );
+
+
+#endif /* CONCEPT_H_ */
diff --git a/src/mess/includes/corvushd.h b/src/mess/includes/corvushd.h
new file mode 100644
index 00000000000..c8fe5081629
--- /dev/null
+++ b/src/mess/includes/corvushd.h
@@ -0,0 +1,182 @@
+/*****************************************************************************
+ *
+ * includes/corvushd.h
+ *
+ * Implementation of the Corvus Systems Flat Cable Hard Disk controller
+ *
+ ****************************************************************************/
+
+#ifndef CORVUSHD_H_
+#define CORVUSHD_H_
+
+
+//
+// Controller Commands
+//
+
+// Read/Write Commands
+
+#define READ_SECTOR_256 0x02
+#define WRITE_SECTOR_256 0x03
+#define READ_CHUNK_128 0x12
+#define READ_CHUNK_256 0x22
+#define READ_CHUNK_512 0x32
+#define WRITE_CHUNK_128 0x13
+#define WRITE_CHUNK_256 0x23
+#define WRITE_CHUNK_512 0x33
+
+// Semaphore Commands
+
+#define SEMAPHORE_LOCK_CODE 0x0b
+#define SEMAPHORE_LOCK_MOD 0x01
+#define SEMAPHORE_UNLOCK_CODE 0x0b
+#define SEMAPHORE_UNLOCK_MOD 0x11
+#define SEMAPHORE_INIT_CODE 0x1a
+#define SEMAPHORE_INIT_MOD 0x10
+#define SEMAPHORE_STATUS_CODE 0x1a
+#define SEMAPHORE_STATUS_MOD 0x41
+
+// Pipe Commands
+
+#define PIPE_READ_CODE 0x1a
+#define PIPE_READ_MOD 0x20
+#define PIPE_WRITE_CODE 0x1a
+#define PIPE_WRITE_MOD 0x21
+#define PIPE_CLOSE_CODE 0x1a
+#define PIPE_CLOSE_MOD 0x40
+#define PIPE_STATUS_CODE 0x1a
+#define PIPE_STATUS_MOD 0x41
+#define PIPE_OPEN_WRITE_CODE 0x1b
+#define PIPE_OPEN_WRITE_MOD 0x80
+#define PIPE_AREA_INIT_CODE 0x1b
+#define PIPE_AREA_INIT_MOD 0xa0
+#define PIPE_OPEN_READ_CODE 0x1b
+#define PIPE_OPEN_READ_MOD 0xc0
+
+// Active User Table Commands
+
+#define ADDACTIVE_CODE 0x34
+#define ADDACTIVE_MOD 0x03
+#define DELACTIVEUSR_REVBH_CODE 0x34
+#define DELACTIVEUSR_REVBH_MOD 0x00
+#define DELACTIVENUM_OMNI_CODE 0x34
+#define DELACTIVENUM_OMNI_MOD 0x00
+#define DELACTIVEUSR_OMNI_CODE 0x34
+#define DELACTIVEUSR_OMNI_MOD 0x31
+#define FINDACTIVE_CODE 0x34
+#define FINDACTIVE_MOD 0x05
+#define READTEMPBLOCK 0xc4
+#define WRITETEMPBLOCK 0xb4
+
+// Miscellaneous Commands
+
+#define BOOT 0x14
+#define READ_BOOT_BLOCK 0x44
+#define GET_DRIVE_PARAMETERS 0x10
+#define PARK_HEADS_REVH 0x11
+#define PARK_HEADS_OMNI 0x80
+#define ECHO 0xf4
+
+// Put drive in Prep Mode
+
+#define PREP_MODE_SELECT 0x11
+
+// Prep Mode Commands
+
+#define PREP_RESET_DRIVE 0x00
+#define PREP_FORMAT_DRIVE 0x01
+#define PREP_FILL_DRIVE_OMNI 0x81
+#define PREP_VERIFY 0x07
+#define PREP_READ_FIRMWARE 0x32
+#define PREP_WRITE_FIRMWARE 0x33
+
+//
+// Controller Status Codes
+//
+
+// Disk status codes
+
+#define STAT_SUCCESS 0x00
+
+#define STAT_HEADER_FAULT 0x00
+#define STAT_SEEK_TIMEOUT 0x01
+#define STAT_SEEK_FAULT 0x02
+#define STAT_SEEK_ERROR 0x03
+#define STAT_HEADER_CRC_ERROR 0x04
+#define STAT_REZERO_FAULT 0x05
+#define STAT_REZERO_TIMEOUT 0x06
+#define STAT_DRIVE_NOT_ONLINE 0x07
+#define STAT_WRITE_FAULT 0x08
+#define STAT_NOT_USED 0x09
+#define STAT_READ_DATA_FAULT 0x0a
+#define STAT_DATA_CRC_ERROR 0x0b
+#define STAT_SECTOR_LOCATE_ERR 0x0c
+#define STAT_WRITE_PROTECTED 0x0d
+#define STAT_ILL_SECTOR_ADDRESS 0x0e
+#define STAT_ILL_CMD_OP_CODE 0x0f
+#define STAT_DRIVE_NOT_ACK 0x10
+#define STAT_ACK_STUCK_ACTIVE 0x11
+#define STAT_TIMEOUT 0x12
+#define STAT_FAULT 0x13
+#define STAT_CRC 0x14
+#define STAT_SEEK 0x15
+#define STAT_VERIFICATION 0x16
+#define STAT_SPEED_ERROR 0x17
+#define STAT_ILL_ADDRESS 0x18
+#define STAT_RW_FAULT_ERROR 0x19
+#define STAT_SERVO_ERROR 0x1a
+#define STAT_GUARD_BAND 0x1b
+#define STAT_PLO_ERROR 0x1c
+#define STAT_RW_UNSAFE 0x1d
+
+// Disk status modifiers (added to status code)
+
+#define STAT_RECOVERABLE_ERR 0x20
+#define STAT_VERIFY_ERR 0x40
+#define STAT_FATAL_ERR 0x80
+
+// Semaphore status codes
+
+#define SEM_PRIOR_STATE_NOT_SET 0x00
+#define SEM_PRIOR_STATE_SET 0x80
+#define SEM_TABLE_FULL 0xfd
+#define SEM_DISK_ERROR 0xfe
+
+// Pipe Status codes
+
+#define PIPE_REQ_SUCCESSFUL 0x00
+#define PIPE_EMPTY_PIPE_READ 0x08
+#define PIPE_NOT_OPEN 0x09
+#define PIPE_WRITE_TO_FULL_PIPE 0x0a
+#define PIPE_OPEN_OPEN_PIPE 0x0b
+#define PIPE_PIPE_NOT_EXIST 0x0c
+#define PIPE_NO_ROOM_FOR_NEW 0x0d
+#define PIPE_ILLEGAL_COMMAND 0x0e
+#define PIPE_AREA_NOT_INIT 0x0f
+
+// Pipe State codes
+
+#define PIPE_OPEN_WRITE_EMPTY 0x01
+#define PIPE_OPEN_READ_EMPTY 0x02
+#define PIPE_NOT_OPEN_FULL 0x80
+#define PIPE_OPEN_WRITE_FULL 0x81
+#define PIPE_OPEN_READ_FULL 0x82
+
+// Status Register Bits
+
+#define CONTROLLER_BUSY 0x80 // Set = Busy, Clear = Ready
+#define CONTROLLER_DIRECTION 0x40 // Set = Controller->Host, Clear = Host->Controller
+
+
+/*----------- defined in machine/corvushd.c -----------*/
+
+//
+// Prototypes
+//
+UINT8 corvus_hdc_init( running_machine &machine );
+READ8_HANDLER ( corvus_hdc_status_r );
+READ8_HANDLER ( corvus_hdc_data_r );
+WRITE8_HANDLER ( corvus_hdc_data_w );
+
+
+#endif /* CORVUSHD_H_ */
diff --git a/src/mess/includes/cosmicos.h b/src/mess/includes/cosmicos.h
new file mode 100644
index 00000000000..e0d01c52115
--- /dev/null
+++ b/src/mess/includes/cosmicos.h
@@ -0,0 +1,126 @@
+#pragma once
+
+#ifndef __COSMICOS__
+#define __COSMICOS__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+#include "imagedev/snapquik.h"
+#include "machine/rescap.h"
+#include "sound/cdp1864.h"
+#include "sound/speaker.h"
+#include "video/dm9368.h"
+
+#define CDP1802_TAG "ic19"
+#define CDP1864_TAG "ic3"
+#define DM9368_TAG "ic10"
+#define SCREEN_TAG "screen"
+
+enum
+{
+ LED_RUN = 0,
+ LED_LOAD,
+ LED_PAUSE,
+ LED_RESET,
+ LED_D7,
+ LED_D6,
+ LED_D5,
+ LED_D4,
+ LED_D3,
+ LED_D2,
+ LED_D1,
+ LED_D0,
+ LED_Q,
+ LED_CASSETTE
+};
+
+class cosmicos_state : public driver_device
+{
+public:
+ cosmicos_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cti(*this, CDP1864_TAG),
+ m_led(*this, DM9368_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cosmac_device> m_maincpu;
+ required_device<cdp1864_device> m_cti;
+ required_device<dm9368_device> m_led;
+ required_device<cassette_image_device> m_cassette;
+ required_device<device_t> m_speaker;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( video_off_r );
+ DECLARE_READ8_MEMBER( video_on_r );
+ DECLARE_WRITE8_MEMBER( audio_latch_w );
+ DECLARE_READ8_MEMBER( hex_keyboard_r );
+ DECLARE_WRITE8_MEMBER( hex_keylatch_w );
+ DECLARE_READ8_MEMBER( reset_counter_r );
+ DECLARE_WRITE8_MEMBER( segment_w );
+ DECLARE_READ8_MEMBER( data_r );
+ DECLARE_WRITE8_MEMBER( display_w );
+ DECLARE_WRITE_LINE_MEMBER( dmaout_w );
+ DECLARE_WRITE_LINE_MEMBER( efx_w );
+ DECLARE_READ_LINE_MEMBER( wait_r );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef1_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_READ_LINE_MEMBER( ef4_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_READ8_MEMBER( dma_r );
+ DECLARE_INPUT_CHANGED_MEMBER( data );
+ DECLARE_INPUT_CHANGED_MEMBER( enter );
+ DECLARE_INPUT_CHANGED_MEMBER( single_step );
+ DECLARE_INPUT_CHANGED_MEMBER( run );
+ DECLARE_INPUT_CHANGED_MEMBER( load );
+ DECLARE_INPUT_CHANGED_MEMBER( cosmicos_pause );
+ DECLARE_INPUT_CHANGED_MEMBER( reset );
+ DECLARE_INPUT_CHANGED_MEMBER( clear_data );
+ DECLARE_INPUT_CHANGED_MEMBER( memory_protect );
+ DECLARE_INPUT_CHANGED_MEMBER( memory_disable );
+ DECLARE_DIRECT_UPDATE_MEMBER(cosmicos_direct_update_handler);
+
+ void set_cdp1802_mode(int mode);
+ void clear_input_data();
+ void set_ram_mode();
+
+
+ /* CPU state */
+ int m_wait;
+ int m_clear;
+ int m_sc1;
+
+ /* memory state */
+ UINT8 m_data;
+ int m_boot;
+ int m_ram_protect;
+ int m_ram_disable;
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* display state */
+ UINT8 m_segment;
+ int m_digit;
+ int m_counter;
+ int m_q;
+ int m_dmaout;
+ int m_efx;
+ int m_video_on;
+ DECLARE_DRIVER_INIT(cosmicos);
+};
+
+#endif
diff --git a/src/mess/includes/crvision.h b/src/mess/includes/crvision.h
new file mode 100644
index 00000000000..09c1de2b57f
--- /dev/null
+++ b/src/mess/includes/crvision.h
@@ -0,0 +1,97 @@
+#pragma once
+
+#ifndef __CRVISION__
+#define __CRVISION__
+
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+#include "machine/ctronics.h"
+#include "machine/6821pia.h"
+#include "sound/sn76496.h"
+#include "sound/wave.h"
+#include "video/tms9928a.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define M6502_TAG "u2"
+#define TMS9929_TAG "u3"
+#define PIA6821_TAG "u21"
+#define SN76489_TAG "u22"
+#define CENTRONICS_TAG "centronics"
+
+#define BANK_ROM1 "bank1"
+#define BANK_ROM2 "bank2"
+
+class crvision_state : public driver_device
+{
+public:
+ crvision_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6502_TAG),
+ m_pia(*this, PIA6821_TAG),
+ m_psg(*this, SN76489_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<pia6821_device> m_pia;
+ required_device<device_t> m_psg;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( centronics_status_r );
+ DECLARE_WRITE8_MEMBER( centronics_ctrl_w );
+ DECLARE_WRITE8_MEMBER( pia_pa_w );
+ DECLARE_READ8_MEMBER( pia_pa_r );
+ DECLARE_READ8_MEMBER( pia_pb_r );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
+
+ UINT8 read_keyboard(int pa);
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* joystick state */
+ UINT8 m_joylatch;
+};
+
+class crvision_pal_state : public crvision_state
+{
+public:
+ crvision_pal_state(const machine_config &mconfig, device_type type, const char *tag)
+ : crvision_state(mconfig, type, tag)
+ { }
+
+ virtual void machine_start();
+};
+
+class laser2001_state : public crvision_state
+{
+public:
+ laser2001_state(const machine_config &mconfig, device_type type, const char *tag)
+ : crvision_state(mconfig, type, tag)
+ { }
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( pia_pa_r );
+ DECLARE_WRITE8_MEMBER( pia_pa_w );
+ DECLARE_READ8_MEMBER( pia_pb_r );
+ DECLARE_WRITE8_MEMBER( pia_pb_w );
+ DECLARE_READ_LINE_MEMBER( pia_ca1_r );
+ DECLARE_WRITE_LINE_MEMBER( pia_ca2_w );
+ DECLARE_READ_LINE_MEMBER( pia_cb1_r );
+ DECLARE_WRITE_LINE_MEMBER( pia_cb2_w );
+};
+
+#endif
diff --git a/src/mess/includes/cxhumax.h b/src/mess/includes/cxhumax.h
new file mode 100644
index 00000000000..ab0d0ff0897
--- /dev/null
+++ b/src/mess/includes/cxhumax.h
@@ -0,0 +1,264 @@
+#ifndef CXHUMAX_H_
+#define CXHUMAX_H_
+
+#include "cpu/arm7/arm7.h"
+#include "cpu/arm7/arm7core.h"
+#include "machine/intelfsh.h"
+#include "machine/i2cmem.h"
+#include "machine/terminal.h"
+
+#define MAX_CX_TIMERS 16
+
+typedef struct
+{
+ UINT32 value;
+ UINT32 limit;
+ UINT32 mode;
+ UINT32 timebase;
+ emu_timer *timer;
+} cx_timer_t;
+
+typedef struct
+{
+ cx_timer_t timer[MAX_CX_TIMERS];
+ UINT32 timer_irq;
+} cx_timer_regs_t;
+
+class cxhumax_state : public driver_device
+{
+public:
+ cxhumax_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_flash(*this, "flash"),
+ m_ram(*this, "ram"),
+ m_terminal(*this, TERMINAL_TAG) { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<intel_28f320j3d_device> m_flash;
+ required_shared_ptr<UINT32> m_ram;
+ required_device<generic_terminal_device> m_terminal;
+
+ DECLARE_WRITE32_MEMBER ( flash_w );
+ DECLARE_READ32_MEMBER ( flash_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_hsx_w );
+ DECLARE_READ32_MEMBER ( cx_hsx_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_romdescr_w );
+ DECLARE_READ32_MEMBER ( cx_romdescr_r );
+ DECLARE_WRITE32_MEMBER ( cx_isaromdescr_w );
+ DECLARE_READ32_MEMBER ( cx_isaromdescr_r );
+ DECLARE_WRITE32_MEMBER ( cx_isadescr_w );
+ DECLARE_READ32_MEMBER ( cx_isadescr_r );
+ DECLARE_WRITE32_MEMBER ( cx_rommap_w );
+ DECLARE_READ32_MEMBER ( cx_rommap_r );
+ DECLARE_WRITE32_MEMBER ( cx_rommode_w );
+ DECLARE_READ32_MEMBER ( cx_rommode_r );
+ DECLARE_WRITE32_MEMBER ( cx_xoemask_w );
+ DECLARE_READ32_MEMBER ( cx_xoemask_r );
+ DECLARE_WRITE32_MEMBER ( cx_pci_w );
+ DECLARE_READ32_MEMBER ( cx_pci_r );
+ DECLARE_WRITE32_MEMBER ( cx_extdesc_w );
+ DECLARE_READ32_MEMBER ( cx_extdesc_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_remap_w );
+ DECLARE_WRITE32_MEMBER ( cx_scratch_w );
+ DECLARE_READ32_MEMBER ( cx_scratch_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_timers_w );
+ DECLARE_READ32_MEMBER ( cx_timers_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_uart2_w );
+ DECLARE_READ32_MEMBER ( cx_uart2_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_pll_w );
+ DECLARE_READ32_MEMBER ( cx_pll_r );
+ DECLARE_WRITE32_MEMBER ( cx_clkdiv_w );
+ DECLARE_READ32_MEMBER ( cx_clkdiv_r );
+ DECLARE_WRITE32_MEMBER ( cx_pllprescale_w );
+ DECLARE_READ32_MEMBER ( cx_pllprescale_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_chipcontrol_w );
+ DECLARE_READ32_MEMBER ( cx_chipcontrol_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_intctrl_w );
+ DECLARE_READ32_MEMBER ( cx_intctrl_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_ss_w );
+ DECLARE_READ32_MEMBER ( cx_ss_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_i2c0_w );
+ DECLARE_READ32_MEMBER ( cx_i2c0_r );
+ DECLARE_WRITE32_MEMBER ( cx_i2c1_w );
+ DECLARE_READ32_MEMBER ( cx_i2c1_r );
+ DECLARE_WRITE32_MEMBER ( cx_i2c2_w );
+ DECLARE_READ32_MEMBER ( cx_i2c2_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_mc_cfg_w );
+ DECLARE_READ32_MEMBER ( cx_mc_cfg_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_drm0_w );
+ DECLARE_READ32_MEMBER ( cx_drm0_r );
+ DECLARE_WRITE32_MEMBER ( cx_drm1_w );
+ DECLARE_READ32_MEMBER ( cx_drm1_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_hdmi_w );
+ DECLARE_READ32_MEMBER ( cx_hdmi_r );
+
+ DECLARE_WRITE32_MEMBER ( cx_gxa_w );
+ DECLARE_READ32_MEMBER ( cx_gxa_r );
+
+ DECLARE_READ32_MEMBER ( dummy_flash_r );
+
+ UINT32 m_romdescr_reg;
+ UINT32 m_isaromdescr_regs[0x0C/4];
+ UINT32 m_isadescr_regs[0x10/4];
+ UINT32 m_rommode_reg;
+ UINT32 m_xoemask_reg;
+ UINT32 m_pci_regs[0x08/4];
+ UINT32 m_extdesc_regs[0x80/4];
+
+ UINT32 m_scratch_reg;
+ cx_timer_regs_t m_timer_regs;
+
+ UINT32 m_uart2_regs[0x30/4];
+
+ UINT32 m_pll_regs[0x14/4];
+ UINT32 m_clkdiv_regs[0x18/4];
+ UINT32 m_pllprescale_reg;
+
+ UINT32 m_intctrl_regs[0x38/4];
+
+ UINT32 m_ss_regs[0x18/4];
+ UINT8 m_ss_tx_fifo[8]; // 8 entries (size hardcoded to 8 bits per entry - TODO)
+
+ UINT32 m_i2c0_regs[0x20/4];
+ UINT32 m_i2c1_regs[0x20/4];
+ device_t *m_i2cmem;
+ UINT32 m_i2c2_regs[0x20/4];
+
+ UINT32 m_mccfg_regs[0x0C/4];
+
+ UINT32 m_chipcontrol_regs[0x74/4];
+
+ UINT32 m_drm0_regs[0xfc/4];
+ UINT32 m_drm1_regs[0xfc/4];
+
+ UINT32 m_hdmi_regs[0x400/4];
+
+ UINT32 m_gxa_cmd_regs[0x130/4];
+};
+
+#define INTDEST 0 // Interrupt destination (1=IRQ, 0=FIQ)
+#define INTENABLE 1 // Enables the interrupt generation
+#define INTIRQ 2 // Normal interrupt
+#define INTFIQ 3 // Fast interrupt
+#define INTSTATCLR 4 // Read: interrupt status, Write: clear pending interrupt
+#define INTSTATSET 5 // Read: interrupt status, Write: sets a pending interrupt
+#define INTGROUP1 0
+#define INTGROUP2 1
+
+#define INTREG(group, index) (((group) << 3) | (index))
+
+#define GXA_CMD_RW_REGISTER 0x00
+#define GXA_CMD_QMARK 0x02
+#define GXA_CMD_PALETTE_FETCH 0x03
+#define GXA_CMD_VFILTER_COEFF_FETCH 0x04
+#define GXA_CMD_HFILTER_COEFF_FETCH 0x05
+#define GXA_CMD_BLT_21 0x21
+#define GXA_CMD_BLT_23 0x23
+#define GXA_CMD_BLT_25 0x25
+#define GXA_CMD_BLT_27 0x27
+#define GXA_CMD_BLT_2B 0x2b
+#define GXA_CMD_BLT_2F 0x2f
+#define GXA_CMD_LINE_30 0x30
+#define GXA_CMD_LINE_32 0x32
+#define GXA_CMD_BLT_31 0x31
+#define GXA_CMD_BLT 0x33
+#define GXA_CMD_LINE_34 0x34
+#define GXA_CMD_LINE_36 0x36
+#define GXA_CMD_BLT_35 0x35
+#define GXA_CMD_BLT_37 0x37
+#define GXA_CMD_LINE_3A 0x3a
+#define GXA_CMD_BLT_3B 0x3b
+#define GXA_CMD_LINE_3E 0x3e
+#define GXA_CMD_BLT_3F 0x3f
+#define GXA_CMD_SBLT_ABLEND 0x71
+#define GXA_CMD_SBLT_ROP 0x7b
+
+#define GXA_CMD_REG 0x07
+
+#define GXA_CFG2_REG 0x3f
+#define IRQ_STAT_QMARK 21
+#define IRQ_EN_QMARK 17
+
+#define INT_UART2_BIT (1<<1)
+#define INT_TIMER_BIT (1<<7)
+#define INT_PWM_BIT (1 << 14)
+#define INT_PIO103_BIT (1 << 15)
+
+#define PCI_CFG_ADDR_REG 0
+#define PCI_CFG_DATA_REG 1
+
+#define TIMER_VALUE 0
+#define TIMER_LIMIT 1
+#define TIMER_MODE 2
+#define TIMER_TIMEBASE 3
+
+#define UART_FIFO_REG 0
+#define UART_IRQE_REG 1
+#define UART_IRQE_TIDE_BIT (1<<6)
+#define UART_BRDL_REG 0
+#define UART_BRDU_REG 1
+#define UART_FIFC_REG 2
+#define UART_FRMC_REG 3
+#define UART_FRMC_BDS_BIT (1<<7)
+#define UART_STAT_REG 5
+#define UART_STAT_TSR_BIT (1<<5)
+#define UART_STAT_TID_BIT (1<<6)
+
+#define SREG_MPG_0_INTFRAC_REG 0
+#define SREG_MPG_1_INTFRAC_REG 1
+#define SREG_ARM_INTFRAC_REG 2
+#define SREG_MEM_INTFRAC_REG 3
+#define SREG_USB_INTFRAC_REG 4
+
+#define SREG_DIV_0_REG 0
+#define SREG_DIV_1_REG 1
+#define SREG_DIV_2_REG 2
+#define SREG_DIV_3_REG 3
+#define SREG_DIV_4_REG 4
+#define SREG_DIV_5_REG 5
+
+#define PIN_CONFIG_0_REG 0 // Pin Configuration 0 Register
+#define SREG_MODE_REG 3 // SREG Mode Register
+#define PIN_ALT_FUNC_REG 4 // Alternate Pin Function Select Register
+#define PLL_LOCK_STAT_0_REG 9 // Resource Lock Register
+#define PLL_IO_CTL_REG 20 // IO Control Register
+#define SREG_TEST_REG 28 // Test Register
+
+#define I2C_MODE_REG 0
+#define I2C_CTRL_REG 1
+#define I2C_STAT_REG 2
+#define I2C_RDATA_REG 3
+
+#define I2C_WACK_BIT (1<<1)
+#define I2C_INT_BIT (1<<0)
+
+#define SS_CNTL_REG 0
+#define SS_FIFC_REG 1
+#define SS_BAUD_REG 2
+#define SS_FIFO_REG 4
+#define SS_STAT_REG 5
+
+#define MC_CFG0 0
+#define MC_CFG1 1
+#define MC_CFG2 2
+
+#define DRM_ACTIVE_X_REG 1
+#define DRM_ACTIVE_Y_REG 2
+#define DRM_BCKGND_REG 3
+#define DRM_OSD_PTR_REG 32
+
+#endif /* CXHUMAX_H_ */
diff --git a/src/mess/includes/cybiko.h b/src/mess/includes/cybiko.h
new file mode 100644
index 00000000000..b1e76d6ea69
--- /dev/null
+++ b/src/mess/includes/cybiko.h
@@ -0,0 +1,100 @@
+/*****************************************************************************
+ *
+ * includes/cybiko.h
+ *
+ * Cybiko Wireless Inter-tainment System
+ *
+ * (c) 2001-2007 Tim Schuerewegen
+ *
+ * Cybiko Classic (V1)
+ * Cybiko Classic (V2)
+ * Cybiko Xtreme
+ *
+ ****************************************************************************/
+
+#ifndef CYBIKO_H_
+#define CYBIKO_H_
+
+/* Core includes */
+#include "emu.h"
+#include "emuopts.h"
+#include "sound/speaker.h"
+
+/* Components */
+#include "cpu/h83002/h8.h"
+#include "video/hd66421.h"
+#include "machine/pcf8593.h"
+#include "machine/at45dbxx.h"
+#include "machine/sst39vfx.h"
+#include "machine/ram.h"
+
+typedef struct
+{
+ int sck; // serial clock
+ int txd; // transmit data
+ int rxd; // receive data
+} CYBIKO_RS232_PINS;
+
+typedef struct
+{
+ CYBIKO_RS232_PINS pin;
+ UINT8 rx_bits, rx_byte, tx_byte, tx_bits;
+} CYBIKO_RS232;
+
+class cybiko_state : public driver_device
+{
+public:
+ cybiko_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_crtc(*this, "hd66421"),
+ m_speaker(*this, SPEAKER_TAG),
+ m_rtc(*this, "rtc"),
+ m_flash1(*this, "flash1")
+ { }
+
+ CYBIKO_RS232 m_rs232;
+ DECLARE_READ16_MEMBER(cybiko_lcd_r);
+ DECLARE_WRITE16_MEMBER(cybiko_lcd_w);
+ DECLARE_READ16_MEMBER(cybikov1_key_r);
+ DECLARE_READ16_MEMBER(cybikov2_key_r);
+ DECLARE_READ16_MEMBER(cybikoxt_key_r);
+ DECLARE_WRITE16_MEMBER(cybiko_usb_w);
+ DECLARE_READ8_MEMBER(cybikov1_io_reg_r);
+ DECLARE_READ8_MEMBER(cybikov2_io_reg_r);
+ DECLARE_READ8_MEMBER(cybikoxt_io_reg_r);
+ DECLARE_WRITE8_MEMBER(cybikov1_io_reg_w);
+ DECLARE_WRITE8_MEMBER(cybikov2_io_reg_w);
+ DECLARE_WRITE8_MEMBER(cybikoxt_io_reg_w);
+ int cybiko_key_r( offs_t offset, int mem_mask);
+ void cybiko_rs232_write_byte(int data);
+ void cybiko_rs232_pin_sck(int data);
+ void cybiko_rs232_pin_txd(int data);
+ int cybiko_rs232_pin_rxd();
+ int cybiko_rs232_rx_queue();
+
+ required_device<hd66421_device> m_crtc;
+ required_device<device_t> m_speaker;
+ required_device<device_t> m_rtc;
+ optional_device<device_t> m_flash1;
+ DECLARE_DRIVER_INIT(cybikoxt);
+ DECLARE_DRIVER_INIT(cybikov1);
+ DECLARE_DRIVER_INIT(cybikov2);
+};
+
+
+/*----------- defined in machine/cybiko.c -----------*/
+
+// driver init
+
+// machine start
+MACHINE_START( cybikov1 );
+MACHINE_START( cybikov2 );
+MACHINE_START( cybikoxt );
+
+// machine reset
+MACHINE_RESET( cybikov1 );
+MACHINE_RESET( cybikov2 );
+MACHINE_RESET( cybikoxt );
+
+
+#endif /* CYBIKO_H_ */
diff --git a/src/mess/includes/dai.h b/src/mess/includes/dai.h
new file mode 100644
index 00000000000..1ef82b017f4
--- /dev/null
+++ b/src/mess/includes/dai.h
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ *
+ * includes/dai.h
+ *
+ ****************************************************************************/
+
+#ifndef DAI_H_
+#define DAI_H_
+
+#include "cpu/i8085/i8085.h"
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "machine/tms5501.h"
+#include "imagedev/cassette.h"
+#include "sound/wave.h"
+
+
+// ======================> dai_sound_device
+
+class dai_sound_device : public device_t,
+ public device_sound_interface
+{
+public:
+ // construction/destruction
+ dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ DECLARE_WRITE_LINE_MEMBER(set_input_ch0);
+ DECLARE_WRITE_LINE_MEMBER(set_input_ch1);
+ DECLARE_WRITE_LINE_MEMBER(set_input_ch2);
+ DECLARE_WRITE8_MEMBER(set_volume);
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+private:
+ sound_stream * m_mixer_channel;
+ int m_dai_input[3];
+ UINT8 m_osc_volume[3];
+ UINT8 m_noise_volume;
+
+ static const UINT16 s_osc_volume_table[];
+ static const UINT16 s_noise_volume_table[];
+};
+
+
+
+class dai_state : public driver_device
+{
+public:
+ dai_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_pit(*this, "pit8253"),
+ m_tms5501(*this, "tms5501"),
+ m_sound(*this, "custom")
+ { }
+
+ required_device<device_t> m_pit;
+ required_device<tms5501_device> m_tms5501;
+ required_device<dai_sound_device> m_sound;
+
+ UINT8 m_paddle_select;
+ UINT8 m_paddle_enable;
+ UINT8 m_cassette_motor[2];
+ UINT8 m_keyboard_scan_mask;
+ unsigned short m_4_colours_palette[4];
+ DECLARE_WRITE8_MEMBER(dai_stack_interrupt_circuit_w);
+ DECLARE_READ8_MEMBER(dai_io_discrete_devices_r);
+ DECLARE_WRITE8_MEMBER(dai_io_discrete_devices_w);
+ DECLARE_READ8_MEMBER(dai_amd9511_r);
+ DECLARE_WRITE8_MEMBER(dai_amd9511_w);
+ DECLARE_READ8_MEMBER(dai_pit_r);
+ DECLARE_WRITE8_MEMBER(dai_pit_w);
+ DECLARE_READ8_MEMBER(dai_keyboard_r);
+ DECLARE_WRITE8_MEMBER(dai_keyboard_w);
+};
+
+
+/*----------- defined in machine/dai.c -----------*/
+
+extern const struct pit8253_config dai_pit8253_intf;
+extern const i8255_interface dai_ppi82555_intf;
+extern const tms5501_interface dai_tms5501_interface;
+
+MACHINE_START( dai );
+MACHINE_RESET( dai );
+
+
+/*----------- defined in video/dai.c -----------*/
+
+extern const unsigned char dai_palette[16*3];
+
+VIDEO_START( dai );
+SCREEN_UPDATE_IND16( dai );
+PALETTE_INIT( dai );
+
+
+/*----------- defined in audio/dai.c -----------*/
+
+extern const device_type DAI_SOUND;
+
+#endif /* DAI_H_ */
diff --git a/src/mess/includes/dgn_beta.h b/src/mess/includes/dgn_beta.h
new file mode 100644
index 00000000000..a4237524530
--- /dev/null
+++ b/src/mess/includes/dgn_beta.h
@@ -0,0 +1,177 @@
+/*****************************************************************************
+ *
+ * includes/dgn_beta.h
+ *
+ ****************************************************************************/
+
+#ifndef DGN_BETA_H_
+#define DGN_BETA_H_
+
+#include "video/mc6845.h"
+#include "machine/wd17xx.h"
+#include "machine/6821pia.h"
+
+/* Tags */
+
+#define MAINCPU_TAG "maincpu"
+#define DMACPU_TAG "dmacpu"
+#define PIA_0_TAG "pia_0"
+#define PIA_1_TAG "pia_1"
+#define PIA_2_TAG "pia_2"
+#define FDC_TAG "wd2797"
+
+
+#define DGNBETA_CPU_SPEED_HZ 2000000 /* 2MHz */
+#define DGNBETA_FRAMES_PER_SECOND 50
+
+#define RamSize 256 /* 256K by default */
+#define RamPageSize 4096 /* ram pages are 4096 bytes */
+
+#define MaxTasks 16 /* Tasks 0..15 */
+#define MaxPage 16 /* 16 4K pages */
+#define NoPagingTask MaxTasks /* Task registers to use when paging disabled 16 */
+
+#define RAMPage 0 /* Page with RAM in at power on */
+#define VideoPage 6 /* Page where video ram mapped */
+#define IOPage MaxPage-1 /* Page for I/O */
+#define ROMPage MaxPage-2 /* Page for ROM */
+#define LastPage MaxPage-1
+
+#define RAMPageValue 0x00 /* page with RAM at power on */
+#define VideoPageValue 0x1F /* Default page for video ram */
+#define NoMemPageValue 0xC0 /* Page guaranteed not to have memory in */
+#define ROMPageValue 0xFE /* Page with boot ROM */
+#define IOPageValue 0xFF /* Page with I/O & Boot ROM */
+
+#define TextVidBasePage 0x18 /* Base page of text video ram */
+
+/***** Keyboard stuff *****/
+#define NoKeyrows 0x0a /* Number of rows in keyboard */
+
+/* From Dragon Beta OS9 keyboard driver */
+#define KAny 0x04 /* Any key pressed mask PB2 */
+#define KOutClk 0x08 /* Ouput shift register clock */
+#define KInClk 0x10 /* Input shift register clock */
+#define KOutDat KInClk /* Also used for data into output shifter */
+#define KInDat 0x20 /* Keyboard data in from keyboard (serial stream) */
+
+/***** WD2797 pins *****/
+
+#define DSMask 0x03 /* PA0 & PA1 are binary encoded drive */
+#define ENPCtrl 0x20 /* PA5 on PIA */
+#define DDenCtrl 0x40 /* PA6 on PIA */
+
+/***** Video Modes *****/
+
+typedef enum
+{
+ TEXT_40x25, /* Text mode 40x25 */
+ TEXT_80x25, /* Text mode 80x25 */
+ GRAPH_320x256x4, /* Graphics 320x256x4 */
+ GRAPH_320x256x16, /* Graphics 320x256x16 */
+ GRAPH_640x512x2 /* Graphics 640X512X2 */
+} BETA_VID_MODES;
+
+#define iosize (0xfEFF-0xfc00)
+
+typedef struct
+{
+ int value; /* Value of the page register */
+ UINT8 *memory; /* The memory it actually points to */
+} PageReg;
+
+
+class dgn_beta_state : public driver_device
+{
+public:
+ dgn_beta_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_mc6845(*this, "crtc"),
+ m_videoram(*this, "videoram"){ }
+
+ required_device<mc6845_device> m_mc6845;
+ required_shared_ptr<UINT8> m_videoram;
+
+ UINT8 *m_system_rom;
+ int m_LogDatWrites;
+ int m_Keyboard[NoKeyrows];
+ int m_RowShifter;
+ int m_Keyrow;
+ int m_d_pia0_pb_last;
+ int m_d_pia0_cb2_last;
+ int m_KInDat_next;
+ int m_KAny_next;
+ int m_d_pia1_pa_last;
+ int m_d_pia1_pb_last;
+ int m_DMA_NMI_LAST;
+ int m_wd2797_written;
+ int m_TaskReg;
+ int m_PIATaskReg;
+ int m_EnableMapRegs;
+ PageReg m_PageRegs[MaxTasks+1][MaxPage+1];
+ int m_beta_6845_RA;
+ int m_beta_scr_x;
+ int m_beta_scr_y;
+ int m_beta_HSync;
+ int m_beta_VSync;
+ int m_beta_DE;
+ int m_LogRegWrites;
+ int m_BoxColour;
+ int m_BoxMinX;
+ int m_BoxMinY;
+ int m_BoxMaxX;
+ int m_BoxMaxY;
+ int m_HSyncMin;
+ int m_VSyncMin;
+ int m_DEPos;
+ int m_NoScreen;
+ bitmap_ind16 *m_bit;
+ int m_MinAddr;
+ int m_MaxAddr;
+ int m_MinX;
+ int m_MaxX;
+ int m_MinY;
+ int m_MaxY;
+ int m_VidAddr;
+ int m_ClkMax;
+ int m_GCtrl;
+ int m_FlashCount;
+ int m_FlashBit;
+ int m_s_DoubleY;
+ int m_DoubleHL;
+ int m_ColourRAM[4];
+ int m_Field;
+ int m_DrawInterlace;
+};
+
+
+/*----------- defined in machine/dgn_beta.c -----------*/
+
+extern const wd17xx_interface dgnbeta_wd17xx_interface;
+extern const pia6821_interface dgnbeta_pia_intf[];
+
+MACHINE_START( dgnbeta );
+MACHINE_RESET( dgnbeta );
+
+// Page IO at FE00
+READ8_HANDLER( dgn_beta_page_r );
+WRITE8_HANDLER( dgn_beta_page_w );
+
+/* WD2797 FDC */
+READ8_HANDLER(dgnbeta_wd2797_r);
+WRITE8_HANDLER(dgnbeta_wd2797_w);
+
+void dgn_beta_frame_interrupt (running_machine &machine, int data);
+
+
+/*----------- defined in video/dgn_beta.c -----------*/
+
+/* mc6845 video display generator */
+void dgnbeta_vid_set_gctrl(running_machine &machine, int data);
+
+/* 74HC670 4x4bit colour ram */
+WRITE8_HANDLER(dgnbeta_colour_ram_w);
+
+extern const mc6845_interface dgnbeta_crtc6845_interface;
+
+#endif /* DGN_BETA_H_ */
diff --git a/src/mess/includes/dgnalpha.h b/src/mess/includes/dgnalpha.h
new file mode 100644
index 00000000000..4c044c9646a
--- /dev/null
+++ b/src/mess/includes/dgnalpha.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+
+ dgnalpha.h
+
+ Dragon Alpha
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __DGNALPHA__
+#define __DGNALPHA__
+
+
+#include "includes/dragon.h"
+#include "sound/ay8910.h"
+#include "machine/wd17xx.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+/* devices */
+#define PIA2_TAG "pia2"
+#define AY8912_TAG "ay8912"
+#define WD2797_TAG "wd2797"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class dragon_alpha_state : public dragon64_state
+{
+public:
+ dragon_alpha_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ required_device<pia6821_device> m_pia_2;
+ required_device<device_t> m_ay8912;
+ required_device<device_t> m_fdc;
+
+ static const pia6821_interface pia2_config;
+ static const ay8910_interface ay8912_interface;
+ static const wd17xx_interface fdc_interface;
+
+protected:
+ /* driver overrides */
+ virtual void device_start(void);
+ virtual void device_reset(void);
+
+ /* interrupts */
+ virtual bool firq_get_line(void);
+
+ /* PIA1 */
+ virtual DECLARE_READ8_MEMBER( ff20_read );
+ virtual DECLARE_WRITE8_MEMBER( ff20_write );
+
+private:
+ UINT8 m_just_reset;
+
+ /* pia2 */
+ DECLARE_WRITE8_MEMBER( pia2_pa_w );
+ DECLARE_WRITE_LINE_MEMBER( pia2_firq_a );
+ DECLARE_WRITE_LINE_MEMBER( pia2_firq_b );
+
+ /* psg */
+ DECLARE_READ8_MEMBER( psg_porta_read );
+ DECLARE_WRITE8_MEMBER( psg_porta_write );
+
+ /* fdc */
+ DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+
+ /* modem */
+ UINT8 modem_r(offs_t offset);
+ void modem_w(offs_t offset, UINT8 data);
+};
+
+#endif /* __DGNALPHA__ */
diff --git a/src/mess/includes/dm7000.h b/src/mess/includes/dm7000.h
new file mode 100644
index 00000000000..a19408a64a8
--- /dev/null
+++ b/src/mess/includes/dm7000.h
@@ -0,0 +1,80 @@
+#ifndef DM7000_H_
+#define DM7000_H_
+
+#include "emu.h"
+#include "cpu/powerpc/ppc.h"
+#include "machine/terminal.h"
+
+class dm7000_state : public driver_device
+{
+public:
+ dm7000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_terminal(*this, TERMINAL_TAG) { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<generic_terminal_device> m_terminal;
+
+ DECLARE_WRITE8_MEMBER ( dm7000_iic0_w );
+ DECLARE_READ8_MEMBER ( dm7000_iic0_r );
+ DECLARE_WRITE8_MEMBER ( dm7000_iic1_w );
+ DECLARE_READ8_MEMBER ( dm7000_iic1_r );
+
+ DECLARE_WRITE8_MEMBER ( dm7000_scc0_w );
+ DECLARE_READ8_MEMBER ( dm7000_scc0_r );
+ DECLARE_WRITE8_MEMBER(kbd_put);
+ UINT8 m_scc0_lcr;
+ UINT8 m_scc0_lsr;
+ UINT8 m_term_data;
+
+
+ DECLARE_WRITE8_MEMBER ( dm7000_gpio0_w );
+ DECLARE_READ8_MEMBER ( dm7000_gpio0_r );
+
+ DECLARE_WRITE8_MEMBER ( dm7000_scp0_w );
+ DECLARE_READ8_MEMBER ( dm7000_scp0_r );
+
+ DECLARE_WRITE16_MEMBER ( dm7000_enet_w );
+ DECLARE_READ16_MEMBER ( dm7000_enet_r );
+ UINT16 m_enet_regs[32];
+
+ UINT32 dcr[1024];
+};
+
+/* */
+#define UART_DLL 0
+#define UART_RBR 0
+#define UART_THR 0
+#define UART_DLH 1
+#define UART_IER 1
+#define UART_IIR 2
+#define UART_FCR 2
+#define UART_LCR 3
+#define UART_LCR_DLAB 0x80
+#define UART_MCR 4
+#define UART_LSR 5
+#define UART_LSR_TEMT 0x20
+#define UART_LSR_THRE 0x40
+#define UART_MSR 6
+#define UART_SCR 7
+
+/* */
+#define SCP_SPMODE 0
+#define SCP_RXDATA 1
+#define SCP_TXDATA 2
+#define SCP_SPCOM 3
+#define SCP_STATUS 4
+#define SCP_STATUS_RXRDY 1
+#define SCP_CDM 6
+
+/* STB045xxx DCRs */
+
+#define DCRSTB045_CICVCR 0x033 /* CIC Video Control Register */
+#define DCRSTB045_SCCR 0x120 /* Serial Clock Control Register */
+#define DCRSTB045_VIDEO_CNTL 0x140 /* Video Control Register */
+#define DCRSTB045_CMD_STAT 0x14a /* Command status */
+#define DCRSTB045_DISP_MODE 0x154 /* Display Mode Register */
+#define DCRSTB045_FRAME_BUFR_BASE 0x179 /* Frame Buffers Base Address Register */
+
+#endif /* DM7000_H_ */
diff --git a/src/mess/includes/dragon.h b/src/mess/includes/dragon.h
new file mode 100644
index 00000000000..849bf87dbeb
--- /dev/null
+++ b/src/mess/includes/dragon.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+
+ dragon.h
+
+ Dragon Family
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __DRAGON__
+#define __DRAGON__
+
+
+#include "includes/coco12.h"
+#include "imagedev/printer.h"
+#include "machine/6551acia.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define PRINTER_TAG "printer"
+#define ACIA_TAG "acia"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class dragon_state : public coco12_state
+{
+public:
+ dragon_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ required_device<printer_image_device> m_printer;
+
+protected:
+ virtual void pia1_pa_changed(void);
+};
+
+
+/* dragon64 has an ACIA chip */
+class dragon64_state : public dragon_state
+{
+public:
+ dragon64_state(const machine_config &mconfig, device_type type, const char *tag);
+
+ required_device<acia6551_device> m_acia;
+
+protected:
+ virtual DECLARE_READ8_MEMBER( ff00_read );
+ virtual DECLARE_WRITE8_MEMBER( ff00_write );
+
+ virtual void pia1_pb_changed(void);
+ void page_rom(bool romswitch);
+};
+
+#endif /* __DRAGON__ */
diff --git a/src/mess/includes/einstein.h b/src/mess/includes/einstein.h
new file mode 100644
index 00000000000..dbbe3d271d5
--- /dev/null
+++ b/src/mess/includes/einstein.h
@@ -0,0 +1,143 @@
+/*****************************************************************************
+ *
+ * includes/einstein.h
+ *
+ ****************************************************************************/
+
+#ifndef EINSTEIN_H_
+#define EINSTEIN_H_
+
+#include "video/mc6845.h"
+#include "cpu/z80/z80daisy.h"
+#include "imagedev/floppy.h"
+#include "machine/wd1772.h"
+#include "machine/z80ctc.h"
+
+/***************************************************************************
+ CONSTANTS
+***************************************************************************/
+
+/* xtals */
+#define XTAL_X001 XTAL_10_738635MHz
+#define XTAL_X002 XTAL_8MHz
+
+/* integrated circuits */
+#define IC_I001 "i001" /* Z8400A */
+#define IC_I030 "i030" /* AY-3-8910 */
+#define IC_I038 "i038" /* TMM9129 */
+#define IC_I042 "i042" /* WD1770-PH */
+#define IC_I050 "i050" /* ADC0844CCN */
+#define IC_I058 "i058" /* Z8430A */
+#define IC_I060 "i060" /* uPD8251A */
+#define IC_I063 "i063" /* Z8420A */
+
+/* interrupt sources */
+#define EINSTEIN_KEY_INT (1<<0)
+#define EINSTEIN_ADC_INT (1<<1)
+#define EINSTEIN_FIRE_INT (1<<2)
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+class einstein_state : public driver_device
+{
+public:
+ einstein_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_fdc(*this, IC_I042)
+ { }
+
+ required_device<wd1770_t> m_fdc;
+ device_t *m_color_screen;
+ z80ctc_device *m_ctc;
+
+ int m_rom_enabled;
+ int m_interrupt;
+ int m_interrupt_mask;
+ int m_ctc_trigger;
+
+ /* keyboard */
+ UINT8 m_keyboard_line;
+ UINT8 m_keyboard_data;
+
+ /* 80 column device */
+ mc6845_device *m_mc6845;
+ screen_device *m_crtc_screen;
+ UINT8 *m_crtc_ram;
+ UINT8 m_de;
+
+ static const floppy_format_type floppy_formats[];
+ DECLARE_WRITE8_MEMBER(einstein_80col_ram_w);
+ DECLARE_READ8_MEMBER(einstein_80col_ram_r);
+ DECLARE_READ8_MEMBER(einstein_80col_state_r);
+ DECLARE_WRITE8_MEMBER(einstein_keyboard_line_write);
+ DECLARE_READ8_MEMBER(einstein_keyboard_data_read);
+ DECLARE_WRITE8_MEMBER(einstein_rom_w);
+ DECLARE_READ8_MEMBER(einstein_kybintmsk_r);
+ DECLARE_WRITE8_MEMBER(einstein_kybintmsk_w);
+ DECLARE_WRITE8_MEMBER(einstein_adcintmsk_w);
+ DECLARE_WRITE8_MEMBER(einstein_fire_int_w);
+};
+
+
+// ======================> einstein_keyboard_daisy_device
+
+class einstein_keyboard_daisy_device : public device_t,
+ public device_z80daisy_interface
+{
+public:
+ // construction/destruction
+ einstein_keyboard_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+private:
+ virtual void device_start();
+ // z80daisy_interface overrides
+ virtual int z80daisy_irq_state();
+ virtual int z80daisy_irq_ack();
+ virtual void z80daisy_irq_reti();
+};
+
+extern const device_type EINSTEIN_KEYBOARD_DAISY;
+
+
+// ======================> einstein_adc_daisy_device
+
+class einstein_adc_daisy_device : public device_t,
+ public device_z80daisy_interface
+{
+public:
+ // construction/destruction
+ einstein_adc_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+private:
+ virtual void device_start();
+ // z80daisy_interface overrides
+ virtual int z80daisy_irq_state();
+ virtual int z80daisy_irq_ack();
+ virtual void z80daisy_irq_reti();
+
+};
+
+extern const device_type EINSTEIN_ADC_DAISY;
+
+// ======================> einstein_fire_daisy_device
+
+class einstein_fire_daisy_device : public device_t,
+ public device_z80daisy_interface
+{
+public:
+ // construction/destruction
+ einstein_fire_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+private:
+ virtual void device_start();
+ // z80daisy_interface overrides
+ virtual int z80daisy_irq_state();
+ virtual int z80daisy_irq_ack();
+ virtual void z80daisy_irq_reti();
+};
+
+extern const device_type EINSTEIN_FIRE_DAISY;
+
+#endif /* EINSTEIN_H_ */
diff --git a/src/mess/includes/electron.h b/src/mess/includes/electron.h
new file mode 100644
index 00000000000..6465d7b9d7c
--- /dev/null
+++ b/src/mess/includes/electron.h
@@ -0,0 +1,90 @@
+/*****************************************************************************
+ *
+ * includes/electron.h
+ *
+ * Acorn Electron
+ *
+ * Driver by Wilbert Pol
+ *
+ ****************************************************************************/
+
+#ifndef ELECTRON_H_
+#define ELECTRON_H_
+
+
+/* Interrupts */
+#define INT_HIGH_TONE 0x40
+#define INT_TRANSMIT_EMPTY 0x20
+#define INT_RECEIVE_FULL 0x10
+#define INT_RTC 0x08
+#define INT_DISPLAY_END 0x04
+#define INT_SET 0x100
+#define INT_CLEAR 0x200
+
+/* ULA context */
+
+typedef struct
+{
+ UINT8 interrupt_status;
+ UINT8 interrupt_control;
+ UINT8 rompage;
+ UINT16 screen_start;
+ UINT16 screen_base;
+ int screen_size;
+ UINT16 screen_addr;
+ UINT8 *vram;
+ int current_pal[16];
+ int communication_mode;
+ int screen_mode;
+ int cassette_motor_mode;
+ int capslock_mode;
+// int scanline;
+ /* tape reading related */
+ UINT32 tape_value;
+ int tape_steps;
+ int bit_count;
+ int high_tone_set;
+ int start_bit;
+ int stop_bit;
+ int tape_running;
+ UINT8 tape_byte;
+} ULA;
+
+
+class electron_state : public driver_device
+{
+public:
+ electron_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ ULA m_ula;
+ emu_timer *m_tape_timer;
+ int m_map4[256];
+ int m_map16[256];
+ emu_timer *m_scanline_timer;
+ DECLARE_READ8_MEMBER(electron_read_keyboard);
+ DECLARE_READ8_MEMBER(electron_jim_r);
+ DECLARE_WRITE8_MEMBER(electron_jim_w);
+ DECLARE_READ8_MEMBER(electron_1mhz_r);
+ DECLARE_WRITE8_MEMBER(electron_1mhz_w);
+ DECLARE_READ8_MEMBER(electron_ula_r);
+ DECLARE_WRITE8_MEMBER(electron_ula_w);
+ void electron_tape_start();
+ void electron_tape_stop();
+};
+
+
+/*----------- defined in machine/electron.c -----------*/
+
+MACHINE_START( electron );
+
+void electron_interrupt_handler(running_machine &machine, int mode, int interrupt);
+
+
+/*----------- defined in video/electron.c -----------*/
+
+VIDEO_START( electron );
+SCREEN_UPDATE_IND16( electron );
+
+
+#endif /* ELECTRON_H_ */
diff --git a/src/mess/includes/elf.h b/src/mess/includes/elf.h
new file mode 100644
index 00000000000..050e361f840
--- /dev/null
+++ b/src/mess/includes/elf.h
@@ -0,0 +1,64 @@
+#pragma once
+
+#ifndef __INCLUDES_ELF__
+#define __INCLUDES_ELF__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+#include "machine/mm74c922.h"
+#include "video/cdp1861.h"
+#include "video/dm9368.h"
+#include "machine/rescap.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "a6"
+#define CDP1861_TAG "a14"
+#define MM74C923_TAG "a10"
+#define DM9368_L_TAG "a12"
+#define DM9368_H_TAG "a8"
+
+class elf2_state : public driver_device
+{
+public:
+ elf2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_vdc(*this, CDP1861_TAG),
+ m_kb(*this, MM74C923_TAG),
+ m_led_l(*this, DM9368_L_TAG),
+ m_led_h(*this, DM9368_H_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cdp1861_device> m_vdc;
+ required_device<mm74c922_device> m_kb;
+ required_device<dm9368_device> m_led_l;
+ required_device<dm9368_device> m_led_h;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( dispon_r );
+ DECLARE_READ8_MEMBER( data_r );
+ DECLARE_WRITE8_MEMBER( data_w );
+ DECLARE_WRITE8_MEMBER( memory_w );
+ DECLARE_READ_LINE_MEMBER( wait_r );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef4_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_READ8_MEMBER( dma_r );
+ DECLARE_WRITE_LINE_MEMBER( da_w );
+ DECLARE_INPUT_CHANGED_MEMBER( input_w );
+
+ // display state
+ UINT8 m_data;
+};
+
+#endif
diff --git a/src/mess/includes/enterp.h b/src/mess/includes/enterp.h
new file mode 100644
index 00000000000..521180b0d64
--- /dev/null
+++ b/src/mess/includes/enterp.h
@@ -0,0 +1,41 @@
+#ifndef __ENTERP_H__
+#define __ENTERP_H__
+
+
+/* there are 64us per line, although in reality
+ about 50 are visible. */
+#define ENTERPRISE_SCREEN_WIDTH (50*16)
+
+/* there are 312 lines per screen, although in reality
+ about 35*8 are visible */
+#define ENTERPRISE_SCREEN_HEIGHT (35*8)
+
+
+#define NICK_PALETTE_SIZE 256
+
+
+class ep_state : public driver_device
+{
+public:
+ ep_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 exdos_card_value; /* state of the wd1770 irq/drq lines */
+ UINT8 keyboard_line; /* index of keyboard line to read */
+ bitmap_ind16 m_bitmap;
+ struct _NICK_STATE *nick;
+ DECLARE_READ8_MEMBER(exdos_card_r);
+ DECLARE_WRITE8_MEMBER(exdos_card_w);
+};
+
+
+/*----------- defined in video/epnick.c -----------*/
+
+PALETTE_INIT( epnick );
+VIDEO_START( epnick );
+SCREEN_UPDATE_IND16( epnick );
+
+WRITE8_HANDLER( epnick_reg_w );
+
+
+#endif /* __ENTERP_H__ */
diff --git a/src/mess/includes/eti660.h b/src/mess/includes/eti660.h
new file mode 100644
index 00000000000..daa89affd5d
--- /dev/null
+++ b/src/mess/includes/eti660.h
@@ -0,0 +1,66 @@
+#pragma once
+
+#ifndef __ETI660__
+#define __ETI660__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+#include "machine/6821pia.h"
+#include "machine/rescap.h"
+#include "sound/cdp1864.h"
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "ic3"
+#define CDP1864_TAG "ic4"
+#define MC6821_TAG "ic5"
+
+enum
+{
+ LED_POWER = 0,
+ LED_PULSE
+};
+
+class eti660_state : public driver_device
+{
+public:
+ eti660_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cti(*this, CDP1864_TAG),
+ m_pia(*this, MC6821_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cosmac_device> m_maincpu;
+ required_device<cdp1864_device> m_cti;
+ required_device<pia6821_device> m_pia;
+ required_device<cassette_image_device> m_cassette;
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( pia_r );
+ DECLARE_WRITE8_MEMBER( pia_w );
+ DECLARE_WRITE8_MEMBER( colorram_w );
+ DECLARE_READ_LINE_MEMBER( rdata_r );
+ DECLARE_READ_LINE_MEMBER( bdata_r );
+ DECLARE_READ_LINE_MEMBER( gdata_r );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef4_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_WRITE8_MEMBER( dma_w );
+ DECLARE_READ8_MEMBER( pia_pa_r );
+ DECLARE_WRITE8_MEMBER( pia_pa_w );
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* video state */
+ UINT8 m_color_ram[0x100];
+ UINT8 m_color;
+};
+
+#endif
diff --git a/src/mess/includes/europc.h b/src/mess/includes/europc.h
new file mode 100644
index 00000000000..2faebe56dae
--- /dev/null
+++ b/src/mess/includes/europc.h
@@ -0,0 +1,152 @@
+/*****************************************************************************
+ *
+ * includes/europc.h
+ *
+ ****************************************************************************/
+
+#ifndef EUROPC_H_
+#define EUROPC_H_
+
+
+/*
+layout of an uk europc
+
+ESC, [SPACE], F1,F2,F3,F4,[SPACE],F5,F6,F7,F8,[SPACE],F9,F0,F11,F12
+[SPACE]
+\|, 1,2,3,4,5,6,7,8,9,0 -,+, BACKSPACE,[SPACE], NUM LOCK, SCROLL LOCK, PRINT SCREEN, KEYPAD -
+TAB,Q,W,E,R,T,Y,U,I,O,P,[,], RETURN, [SPACE], KEYPAD 7, KEYPAD 8, KEYPAD 9, KEYPAD +
+CTRL, A,S,D,F,G,H,J,K,L,;,@,~, RETURN, [SPACE],KEYPAD 4,KEYPAD 5,KEYPAD 6, KEYPAD +
+LEFT SHIFT, Z,X,C,V,B,N,M,<,>,?,RIGHT SHIFT,[SPACE],KEYPAD 1, KEYPAD 2, KEYPAD 3, KEYPAD ENTER
+ALT,[SPACE], SPACE BAR,[SPACE],CAPS LOCK,[SPACE], KEYPAD 0, KEYPAD ., KEYPAD ENTER
+
+\ and ~ had to be swapped
+i am not sure if keypad enter delivers the mf2 keycode
+ */
+#define EUROPC_KEYBOARD \
+ PORT_START("pc_keyboard_0") /* IN4 */\
+ PORT_BIT ( 0x0001, 0x0000, IPT_UNUSED ) /* unused scancode 0 */\
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) /* Esc 01 81 */\
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 !") PORT_CODE(KEYCODE_1) /* 1 02 82 */\
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 @") PORT_CODE(KEYCODE_2) /* 2 03 83 */\
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3 #") PORT_CODE(KEYCODE_3) /* 3 04 84 */\
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) /* 4 05 85 */\
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5 %") PORT_CODE(KEYCODE_5) /* 5 06 86 */\
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6 ^") PORT_CODE(KEYCODE_6) /* 6 07 87 */\
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7 &") PORT_CODE(KEYCODE_7) /* 7 08 88 */\
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 *") PORT_CODE(KEYCODE_8) /* 8 09 89 */\
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (") PORT_CODE(KEYCODE_9) /* 9 0A 8A */\
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 )") PORT_CODE(KEYCODE_0) /* 0 0B 8B */\
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("- _") PORT_CODE(KEYCODE_MINUS) /* - 0C 8C */\
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("= +") PORT_CODE(KEYCODE_EQUALS) /* = 0D 8D */\
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("<--") PORT_CODE(KEYCODE_BACKSPACE) /* Backspace 0E 8E */\
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) /* Tab 0F 8F */\
+ \
+ PORT_START("pc_keyboard_1") /* IN5 */\
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) /* Q 10 90 */\
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) /* W 11 91 */\
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) /* E 12 92 */\
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) /* R 13 93 */\
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) /* T 14 94 */\
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) /* Y 15 95 */\
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) /* U 16 96 */\
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) /* I 17 97 */\
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) /* O 18 98 */\
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) /* P 19 99 */\
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE) /* [ 1A 9A */\
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) /* ] 1B 9B */\
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) /* Enter 1C 9C */\
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) /* Ctrl 1D 9D */\
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) /* A 1E 9E */\
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) /* S 1F 9F */\
+ \
+ PORT_START("pc_keyboard_2") /* IN6 */\
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) /* D 20 A0 */\
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) /* F 21 A1 */\
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) /* G 22 A2 */\
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) /* H 23 A3 */\
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) /* J 24 A4 */\
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) /* K 25 A5 */\
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) /* L 26 A6 */\
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) /* ; 27 A7 */\
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE) /* ' 28 A8 */\
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("` ~") PORT_CODE(KEYCODE_BACKSLASH) /* ` 29 A9 */\
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L-Shift") PORT_CODE(KEYCODE_LSHIFT) /* Left Shift 2A AA */\
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_TILDE) /* \ 2B AB */\
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) /* Z 2C AC */\
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) /* X 2D AD */\
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) /* C 2E AE */\
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) /* V 2F AF */\
+ \
+ PORT_START("pc_keyboard_3") /* IN7 */\
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) /* B 30 B0 */\
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) /* N 31 B1 */\
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) /* M 32 B2 */\
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) /* , 33 B3 */\
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) /* . 34 B4 */\
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) /* / 35 B5 */\
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R-Shift") PORT_CODE(KEYCODE_RSHIFT) /* Right Shift 36 B6 */\
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("PrtScr") PORT_CODE(KEYCODE_PRTSCR) /* Keypad * (PrtSc) 37 B7 */\
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alt") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) /* Alt 38 B8 */\
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) /* Space 39 B9 */\
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Caps") PORT_CODE(KEYCODE_CAPSLOCK) /* Caps Lock 3A BA */\
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) /* F1 3B BB */\
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) /* F2 3C BC */\
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) /* F3 3D BD */\
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) /* F4 3E BE */\
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) /* F5 3F BF */\
+ \
+ PORT_START("pc_keyboard_4") /* IN8 */\
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) /* F6 40 C0 */\
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) /* F7 41 C1 */\
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) /* F8 42 C2 */\
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) /* F9 43 C3 */\
+ PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) /* F10 44 C4 */\
+ PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NumLock") PORT_CODE(KEYCODE_NUMLOCK) /* Num Lock 45 C5 */\
+ PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("ScrLock") PORT_CODE(KEYCODE_SCRLOCK) /* Scroll Lock 46 C6 */\
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 7 (Home)") PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_HOME ) /* Keypad 7 (Home) 47 C7 */\
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 8 (Up)") PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_UP ) /* Keypad 8 (Up arrow) 48 C8 */\
+ PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 9 (PgUp)") PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_PGUP) /* Keypad 9 (PgUp) 49 C9 */\
+ PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP -") PORT_CODE(KEYCODE_MINUS_PAD) /* Keypad - 4A CA */\
+ PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 4 (Left)") PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_LEFT ) /* Keypad 4 (Left arrow) 4B CB */\
+ PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 5") PORT_CODE(KEYCODE_5_PAD) /* Keypad 5 4C CC */\
+ PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 6 (Right)") PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_RIGHT ) /* Keypad 6 (Right arrow) 4D CD */\
+ PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP +") PORT_CODE(KEYCODE_PLUS_PAD) /* Keypad + 4E CE */\
+ PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 1 (End)") PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_END ) /* Keypad 1 (End) 4F CF */\
+ \
+ PORT_START("pc_keyboard_5") /* IN9 */\
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 2 (Down)") PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_DOWN ) /* Keypad 2 (Down arrow) 50 D0 */\
+ PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 3 (PgDn)") PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_PGDN ) /* Keypad 3 (PgDn) 51 D1 */\
+ PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP 0 (Ins)") PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_INSERT ) /* Keypad 0 (Ins) 52 D2 */\
+ PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP . (Del)") PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(KEYCODE_DEL ) /* Keypad . (Del) 53 D3 */\
+ PORT_BIT ( 0x0070, 0x0000, IPT_UNUSED )\
+ /* 0x40 non us backslash 2 not available */\
+ PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) /* F11 57 D7 */\
+ PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) /* F12 58 D8 */\
+ PORT_BIT ( 0xfe00, 0x0000, IPT_UNUSED )\
+ \
+ PORT_START("pc_keyboard_6") /* IN10 */\
+ PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("KP Enter") PORT_CODE(KEYCODE_ENTER_PAD) /* PAD Enter 60 e0 */\
+ PORT_BIT ( 0xfffe, 0x0000, IPT_UNUSED )\
+ \
+ PORT_START("pc_keyboard_7") /* IN11 */\
+ PORT_BIT ( 0xffff, 0x0000, IPT_UNUSED )
+
+
+/*----------- defined in machine/europc.c -----------*/
+
+WRITE8_HANDLER( europc_pio_w );
+ READ8_HANDLER( europc_pio_r );
+
+extern WRITE8_HANDLER ( europc_jim_w );
+extern READ8_HANDLER ( europc_jim_r );
+extern READ8_HANDLER ( europc_jim2_r );
+
+extern READ8_HANDLER( europc_rtc_r );
+extern WRITE8_HANDLER( europc_rtc_w );
+extern NVRAM_HANDLER( europc_rtc );
+
+void europc_rtc_set_time(running_machine &machine);
+void europc_rtc_init(running_machine &machine);
+
+
+#endif /* EUROPC_H_ */
diff --git a/src/mess/includes/exp85.h b/src/mess/includes/exp85.h
new file mode 100644
index 00000000000..821f6d2583c
--- /dev/null
+++ b/src/mess/includes/exp85.h
@@ -0,0 +1,39 @@
+#ifndef __EXP85__
+#define __EXP85__
+
+#define SCREEN_TAG "screen"
+#define I8085A_TAG "u100"
+#define I8155_TAG "u106"
+#define I8355_TAG "u105"
+
+class exp85_state : public driver_device
+{
+public:
+ exp85_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8085A_TAG),
+ m_terminal(*this, TERMINAL_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_speaker(*this, SPEAKER_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<serial_terminal_device> m_terminal;
+ required_device<cassette_image_device> m_cassette;
+ required_device<device_t> m_speaker;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( i8355_a_r );
+ DECLARE_WRITE8_MEMBER( i8355_a_w );
+ DECLARE_READ_LINE_MEMBER( sid_r );
+ DECLARE_WRITE_LINE_MEMBER( sod_w );
+ DECLARE_WRITE_LINE_MEMBER( terminal_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_rst75 );
+
+ /* cassette state */
+ int m_tape_control;
+};
+
+#endif
diff --git a/src/mess/includes/fidelz80.h b/src/mess/includes/fidelz80.h
new file mode 100644
index 00000000000..c345c60c303
--- /dev/null
+++ b/src/mess/includes/fidelz80.h
@@ -0,0 +1,69 @@
+/***************************************************************************
+
+ fidelz80.h
+
+****************************************************************************/
+
+#pragma once
+
+#ifndef _FIDELZ80_H_
+#define _FIDELZ80_H_
+
+class fidelz80_state : public driver_device
+{
+public:
+ fidelz80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_speech(*this, "speech"),
+ m_beep(*this, BEEPER_TAG),
+ m_i8041(*this, "mcu"),
+ m_i8243(*this, "i8243")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<device_t> m_speech;
+ optional_device<device_t> m_beep;
+ optional_device<cpu_device> m_i8041;
+ optional_device<i8243_device> m_i8243;
+
+ UINT16 m_kp_matrix; // keypad/leds matrix
+ UINT8 m_led_data; // data for the two individual leds, in 0bxxxx12xx format
+ UINT8 m_led_selected; // 5 bit selects for 7 seg leds and for common other leds, bits are (7seg leds are 0 1 2 3, common other leds are C) 0bxx3210xc
+ UINT16 m_digit_data; // data for seg leds
+ UINT8 m_digit_line_status[4]; // prevent overwrite of m_digit_data
+
+ virtual void machine_reset();
+
+ //model VCC/UVC
+ void update_display(running_machine &machine);
+ DECLARE_READ8_MEMBER( fidelz80_portc_r );
+ DECLARE_WRITE8_MEMBER( fidelz80_portb_w );
+ DECLARE_WRITE8_MEMBER( fidelz80_portc_w );
+ DECLARE_WRITE8_MEMBER( cc10_porta_w );
+ DECLARE_READ8_MEMBER( vcc_portb_r );
+ DECLARE_WRITE8_MEMBER( vcc_porta_w );
+
+ //model ABC/VBC
+ DECLARE_WRITE8_MEMBER( abc_speech_w );
+ DECLARE_WRITE8_MEMBER(kp_matrix_w);
+ DECLARE_READ8_MEMBER(unknown_r);
+ DECLARE_READ8_MEMBER(exp_i8243_p2_r);
+ DECLARE_WRITE8_MEMBER(exp_i8243_p2_w);
+ DECLARE_READ8_MEMBER(rand_r);
+ DECLARE_WRITE8_MEMBER(mcu_data_w);
+ DECLARE_WRITE8_MEMBER(mcu_command_w);
+ DECLARE_READ8_MEMBER(mcu_data_r);
+ DECLARE_READ8_MEMBER(mcu_status_r);
+
+ //model VSC
+ DECLARE_WRITE8_MEMBER(vsc_porta_w);
+ DECLARE_WRITE8_MEMBER(vsc_portb_w);
+ DECLARE_WRITE8_MEMBER(vsc_portc_w);
+ DECLARE_READ8_MEMBER(vsc_pio_porta_r);
+ DECLARE_READ8_MEMBER(vsc_pio_portb_r);
+ DECLARE_WRITE8_MEMBER(vsc_pio_portb_w);
+};
+
+
+#endif // _FIDELZ80_H_
diff --git a/src/mess/includes/fm7.h b/src/mess/includes/fm7.h
new file mode 100644
index 00000000000..4a1cf04748d
--- /dev/null
+++ b/src/mess/includes/fm7.h
@@ -0,0 +1,255 @@
+/*
+ *
+ * FM-7 header file
+ *
+ */
+
+#ifndef FM7_H_
+#define FM7_H_
+
+// Interrupt flags
+#define IRQ_FLAG_KEY 0x01
+#define IRQ_FLAG_PRINTER 0x02
+#define IRQ_FLAG_TIMER 0x04
+#define IRQ_FLAG_OTHER 0x08
+// the following are not read in port 0xfd03
+#define IRQ_FLAG_MFD 0x10
+#define IRQ_FLAG_TXRDY 0x20
+#define IRQ_FLAG_RXRDY 0x40
+#define IRQ_FLAG_SYNDET 0x80
+
+// system types
+#define SYS_FM7 1
+#define SYS_FM77AV 2
+#define SYS_FM77AV40EX 3
+#define SYS_FM11 4
+#define SYS_FM16 5
+
+// keyboard scancode formats
+#define KEY_MODE_FM7 0 // FM-7 ASCII type code
+#define KEY_MODE_FM16B 1 // FM-16B (FM-77AV and later only)
+#define KEY_MODE_SCAN 2 // Scancode Make/Break (PC-like)
+
+typedef struct
+{
+ UINT8 buffer[12];
+ UINT8 tx_count;
+ UINT8 rx_count;
+ UINT8 command_length;
+ UINT8 answer_length;
+ UINT8 latch; // 0=ready to receive
+ UINT8 ack;
+ UINT8 position;
+} fm7_encoder_t;
+
+typedef struct
+{
+ UINT8 bank_addr[8][16];
+ UINT8 segment;
+ UINT8 window_offset;
+ UINT8 enabled;
+ UINT8 mode;
+} fm7_mmr_t;
+
+typedef struct
+{
+ UINT8 sub_busy;
+ UINT8 sub_halt;
+ UINT8 sub_reset; // high if reset caused by subrom change
+ UINT8 attn_irq;
+ UINT8 vram_access; // VRAM access flag
+ UINT8 crt_enable;
+ UINT16 vram_offset;
+ UINT16 vram_offset2;
+ UINT8 fm7_pal[8];
+ UINT16 fm77av_pal_selected;
+ UINT8 fm77av_pal_r[4096];
+ UINT8 fm77av_pal_g[4096];
+ UINT8 fm77av_pal_b[4096];
+ UINT8 subrom; // currently active sub CPU ROM (AV only)
+ UINT8 cgrom; // currently active CGROM (AV only)
+ UINT8 modestatus;
+ UINT8 multi_page;
+ UINT8 fine_offset;
+ UINT8 nmi_mask;
+ UINT8 active_video_page;
+ UINT8 display_video_page;
+ UINT8 vsync_flag;
+} fm7_video_t;
+
+typedef struct
+{
+ UINT8 command;
+ UINT8 lcolour;
+ UINT8 mask;
+ UINT8 compare_data;
+ UINT8 compare[8];
+ UINT8 bank_disable;
+ UINT8 tilepaint_b;
+ UINT8 tilepaint_r;
+ UINT8 tilepaint_g;
+ UINT16 addr_offset;
+ UINT16 line_style;
+ UINT16 x0;
+ UINT16 x1;
+ UINT16 y0;
+ UINT16 y1;
+ UINT8 busy;
+} fm7_alu_t;
+
+
+class fm7_state : public driver_device
+{
+public:
+ fm7_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_shared_ram(*this, "shared_ram"),
+ m_boot_ram(*this, "boot_ram")
+ { }
+
+ optional_shared_ptr<UINT8> m_shared_ram;
+ optional_shared_ptr<UINT8> m_boot_ram;
+
+ UINT8 m_irq_flags;
+ UINT8 m_irq_mask;
+ emu_timer* m_timer;
+ emu_timer* m_subtimer;
+ emu_timer* m_keyboard_timer;
+ UINT8 m_basic_rom_en;
+ UINT8 m_init_rom_en;
+ unsigned int m_key_delay;
+ unsigned int m_key_repeat;
+ UINT16 m_current_scancode;
+ UINT32 m_key_data[4];
+ UINT32 m_mod_data;
+ UINT8 m_key_scan_mode;
+ UINT8 m_break_flag;
+ UINT8 m_psg_regsel;
+ UINT8 m_psg_data;
+ UINT8 m_fdc_side;
+ UINT8 m_fdc_drive;
+ UINT8 m_fdc_irq_flag;
+ UINT8 m_fdc_drq_flag;
+ UINT8 m_fm77av_ym_irq;
+ UINT8 m_speaker_active;
+ UINT16 m_kanji_address;
+ fm7_encoder_t m_encoder;
+ fm7_mmr_t m_mmr;
+ UINT8 m_cp_prev;
+ UINT8* m_video_ram;
+ emu_timer* m_fm77av_vsync_timer;
+ UINT8 m_type;
+ fm7_video_t m_video;
+ fm7_alu_t m_alu;
+ int m_sb_prev;
+ DECLARE_READ8_MEMBER(fm7_subintf_r);
+ DECLARE_WRITE8_MEMBER(fm7_subintf_w);
+ DECLARE_READ8_MEMBER(fm7_sub_busyflag_r);
+ DECLARE_WRITE8_MEMBER(fm7_sub_busyflag_w);
+ DECLARE_READ8_MEMBER(fm7_cancel_ack);
+ DECLARE_READ8_MEMBER(fm7_attn_irq_r);
+ DECLARE_READ8_MEMBER(fm7_vram_access_r);
+ DECLARE_WRITE8_MEMBER(fm7_vram_access_w);
+ DECLARE_READ8_MEMBER(fm7_vram_r);
+ DECLARE_WRITE8_MEMBER(fm7_vram_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram_banked_w);
+ DECLARE_READ8_MEMBER(fm7_vram0_r);
+ DECLARE_READ8_MEMBER(fm7_vram1_r);
+ DECLARE_READ8_MEMBER(fm7_vram2_r);
+ DECLARE_READ8_MEMBER(fm7_vram3_r);
+ DECLARE_READ8_MEMBER(fm7_vram4_r);
+ DECLARE_READ8_MEMBER(fm7_vram5_r);
+ DECLARE_READ8_MEMBER(fm7_vram6_r);
+ DECLARE_READ8_MEMBER(fm7_vram7_r);
+ DECLARE_READ8_MEMBER(fm7_vram8_r);
+ DECLARE_READ8_MEMBER(fm7_vram9_r);
+ DECLARE_READ8_MEMBER(fm7_vramA_r);
+ DECLARE_READ8_MEMBER(fm7_vramB_r);
+ DECLARE_WRITE8_MEMBER(fm7_vram0_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram1_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram2_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram3_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram4_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram5_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram6_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram7_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram8_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram9_w);
+ DECLARE_WRITE8_MEMBER(fm7_vramA_w);
+ DECLARE_WRITE8_MEMBER(fm7_vramB_w);
+ DECLARE_READ8_MEMBER(fm7_crt_r);
+ DECLARE_WRITE8_MEMBER(fm7_crt_w);
+ DECLARE_WRITE8_MEMBER(fm7_vram_offset_w);
+ DECLARE_WRITE8_MEMBER(fm7_multipage_w);
+ DECLARE_READ8_MEMBER(fm7_palette_r);
+ DECLARE_WRITE8_MEMBER(fm7_palette_w);
+ DECLARE_WRITE8_MEMBER(fm77av_analog_palette_w);
+ DECLARE_READ8_MEMBER(fm77av_video_flags_r);
+ DECLARE_WRITE8_MEMBER(fm77av_video_flags_w);
+ DECLARE_READ8_MEMBER(fm77av_sub_modestatus_r);
+ DECLARE_WRITE8_MEMBER(fm77av_sub_modestatus_w);
+ DECLARE_WRITE8_MEMBER(fm77av_sub_bank_w);
+ DECLARE_READ8_MEMBER(fm77av_alu_r);
+ DECLARE_WRITE8_MEMBER(fm77av_alu_w);
+ DECLARE_READ8_MEMBER(fm7_sub_ram_ports_banked_r);
+ DECLARE_WRITE8_MEMBER(fm7_sub_ram_ports_banked_w);
+ DECLARE_READ8_MEMBER(fm7_console_ram_banked_r);
+ DECLARE_WRITE8_MEMBER(fm7_console_ram_banked_w);
+ DECLARE_WRITE8_MEMBER(fm7_irq_mask_w);
+ DECLARE_READ8_MEMBER(fm7_irq_cause_r);
+ DECLARE_WRITE8_MEMBER(fm7_beeper_w);
+ DECLARE_READ8_MEMBER(fm7_sub_beeper_r);
+ DECLARE_READ8_MEMBER(vector_r);
+ DECLARE_WRITE8_MEMBER(vector_w);
+ DECLARE_READ8_MEMBER(fm7_fd04_r);
+ DECLARE_READ8_MEMBER(fm7_rom_en_r);
+ DECLARE_WRITE8_MEMBER(fm7_rom_en_w);
+ DECLARE_WRITE8_MEMBER(fm7_init_en_w);
+ DECLARE_READ8_MEMBER(fm7_fdc_r);
+ DECLARE_WRITE8_MEMBER(fm7_fdc_w);
+ DECLARE_READ8_MEMBER(fm7_keyboard_r);
+ DECLARE_READ8_MEMBER(fm7_sub_keyboard_r);
+ DECLARE_READ8_MEMBER(fm77av_key_encoder_r);
+ DECLARE_WRITE8_MEMBER(fm77av_key_encoder_w);
+ DECLARE_READ8_MEMBER(fm7_cassette_printer_r);
+ DECLARE_WRITE8_MEMBER(fm7_cassette_printer_w);
+ DECLARE_READ8_MEMBER(fm77av_boot_mode_r);
+ DECLARE_READ8_MEMBER(fm7_psg_select_r);
+ DECLARE_WRITE8_MEMBER(fm7_psg_select_w);
+ DECLARE_WRITE8_MEMBER(fm77av_ym_select_w);
+ DECLARE_READ8_MEMBER(fm7_psg_data_r);
+ DECLARE_WRITE8_MEMBER(fm7_psg_data_w);
+ DECLARE_WRITE8_MEMBER(fm77av_bootram_w);
+ DECLARE_READ8_MEMBER(fm7_main_shared_r);
+ DECLARE_WRITE8_MEMBER(fm7_main_shared_w);
+ DECLARE_READ8_MEMBER(fm7_fmirq_r);
+ DECLARE_READ8_MEMBER(fm7_unknown_r);
+ DECLARE_READ8_MEMBER(fm7_mmr_r);
+ DECLARE_WRITE8_MEMBER(fm7_mmr_w);
+ DECLARE_READ8_MEMBER(fm7_kanji_r);
+ DECLARE_WRITE8_MEMBER(fm7_kanji_w);
+ void fm77av_encoder_setup_command();
+ void fm77av_encoder_handle_command();
+ DECLARE_DRIVER_INIT(fm7);
+};
+
+
+/*----------- defined in drivers/fm7.c -----------*/
+
+
+
+/*----------- defined in video/fm7.c -----------*/
+
+TIMER_CALLBACK( fm77av_vsync );
+
+
+
+
+
+
+
+VIDEO_START( fm7 );
+SCREEN_UPDATE_IND16( fm7 );
+PALETTE_INIT( fm7 );
+
+#endif /*FM7_H_*/
diff --git a/src/mess/includes/fmtowns.h b/src/mess/includes/fmtowns.h
new file mode 100644
index 00000000000..18898147b8e
--- /dev/null
+++ b/src/mess/includes/fmtowns.h
@@ -0,0 +1,295 @@
+#ifndef FMTOWNS_H_
+#define FMTOWNS_H_
+
+
+#include "emu.h"
+#include "cpu/i386/i386.h"
+#include "sound/2612intf.h"
+#include "sound/rf5c68.h"
+#include "sound/cdda.h"
+#include "sound/speaker.h"
+#include "imagedev/chd_cd.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "formats/basicdsk.h"
+#include "machine/wd17xx.h"
+#include "imagedev/flopdrv.h"
+#include "machine/upd71071.h"
+#include "machine/ram.h"
+#include "machine/nvram.h"
+#include "imagedev/harddriv.h"
+#include "machine/scsi.h"
+#include "machine/fm_scsi.h"
+
+#define IRQ_LOG 0 // set to 1 to log IRQ line activity
+
+READ8_HANDLER( towns_gfx_high_r );
+WRITE8_HANDLER( towns_gfx_high_w );
+READ8_HANDLER( towns_gfx_r );
+WRITE8_HANDLER( towns_gfx_w );
+READ8_HANDLER( towns_video_cff80_r );
+WRITE8_HANDLER( towns_video_cff80_w );
+READ8_HANDLER( towns_video_cff80_mem_r );
+WRITE8_HANDLER( towns_video_cff80_mem_w );
+READ8_HANDLER(towns_video_440_r);
+WRITE8_HANDLER(towns_video_440_w);
+READ8_HANDLER(towns_video_5c8_r);
+WRITE8_HANDLER(towns_video_5c8_w);
+READ8_HANDLER(towns_video_fd90_r);
+WRITE8_HANDLER(towns_video_fd90_w);
+READ8_HANDLER(towns_video_ff81_r);
+WRITE8_HANDLER(towns_video_ff81_w);
+READ32_HANDLER(towns_video_unknown_r);
+READ8_HANDLER(towns_spriteram_low_r);
+WRITE8_HANDLER(towns_spriteram_low_w);
+READ8_HANDLER(towns_spriteram_r);
+WRITE8_HANDLER(towns_spriteram_w);
+
+struct towns_cdrom_controller
+{
+ UINT8 command;
+ UINT8 status;
+ UINT8 cmd_status[4];
+ UINT8 cmd_status_ptr;
+ UINT8 extra_status;
+ UINT8 parameter[8];
+ UINT8 mpu_irq_enable;
+ UINT8 dma_irq_enable;
+ UINT8 buffer[2048];
+ INT32 buffer_ptr;
+ UINT32 lba_current;
+ UINT32 lba_last;
+ UINT32 cdda_current;
+ UINT32 cdda_length;
+ emu_timer* read_timer;
+};
+
+struct towns_video_controller
+{
+ UINT8 towns_vram_wplane;
+ UINT8 towns_vram_rplane;
+ UINT8 towns_vram_page_sel;
+ UINT8 towns_palette_select;
+ UINT8 towns_palette_r[256];
+ UINT8 towns_palette_g[256];
+ UINT8 towns_palette_b[256];
+ UINT8 towns_degipal[8];
+ UINT8 towns_dpmd_flag;
+ UINT8 towns_crtc_mix;
+ UINT8 towns_crtc_sel; // selected CRTC register
+ UINT16 towns_crtc_reg[32];
+ UINT8 towns_video_sel; // selected video register
+ UINT8 towns_video_reg[2];
+ UINT8 towns_sprite_sel; // selected sprite register
+ UINT8 towns_sprite_reg[8];
+ UINT8 towns_sprite_flag; // sprite drawing flag
+ UINT8 towns_sprite_page; // VRAM page (not layer) sprites are drawn to
+ UINT8 towns_tvram_enable;
+ UINT16 towns_kanji_offset;
+ UINT8 towns_kanji_code_h;
+ UINT8 towns_kanji_code_l;
+ rectangle towns_crtc_layerscr[2]; // each layer has independent sizes
+ UINT8 towns_display_plane;
+ UINT8 towns_display_page_sel;
+ UINT8 towns_vblank_flag;
+ UINT8 towns_layer_ctrl;
+ emu_timer* sprite_timer;
+};
+
+class towns_state : public driver_device
+{
+ public:
+ towns_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_nvram(*this, "nvram")
+ { }
+
+ /* devices */
+ device_t* m_maincpu;
+ device_t* m_dma_1;
+ device_t* m_dma_2;
+ device_t* m_fdc;
+ device_t* m_pic_master;
+ device_t* m_pic_slave;
+ device_t* m_pit;
+ ram_device* m_messram;
+ cdrom_image_device* m_cdrom;
+ device_t* m_cdda;
+ device_t* m_speaker;
+ class fmscsi_device* m_scsi;
+ ram_device* m_ram;
+
+ UINT16 m_ftimer;
+ UINT16 m_freerun_timer;
+ emu_timer* m_towns_freerun_counter;
+ UINT16 m_intervaltimer2_period;
+ UINT8 m_intervaltimer2_irqmask;
+ UINT8 m_intervaltimer2_timeout_flag;
+ UINT8 m_intervaltimer2_timeout_flag2;
+ emu_timer* m_towns_intervaltimer2;
+ UINT8 m_nmi_mask;
+ UINT8 m_compat_mode;
+ UINT8 m_towns_system_port;
+ UINT32 m_towns_ankcg_enable;
+ UINT32 m_towns_mainmem_enable;
+ UINT32 m_towns_ram_enable;
+ UINT32* m_towns_vram;
+ UINT8* m_towns_gfxvram;
+ UINT8* m_towns_txtvram;
+ int m_towns_selected_drive;
+ UINT8 m_towns_fdc_irq6mask;
+ UINT8* m_towns_serial_rom;
+ int m_towns_srom_position;
+ UINT8 m_towns_srom_clk;
+ UINT8 m_towns_srom_reset;
+ UINT8 m_towns_rtc_select;
+ UINT8 m_towns_rtc_data;
+ UINT8 m_towns_rtc_reg[16];
+ emu_timer* m_towns_rtc_timer;
+ UINT8 m_towns_timer_mask;
+ UINT16 m_towns_machine_id; // default is 0x0101
+ UINT8 m_towns_kb_status;
+ UINT8 m_towns_kb_irq1_enable;
+ UINT8 m_towns_kb_output; // key output
+ UINT8 m_towns_kb_extend; // extended key output
+ emu_timer* m_towns_kb_timer;
+ emu_timer* m_towns_mouse_timer;
+ UINT8 m_towns_fm_irq_flag;
+ UINT8 m_towns_pcm_irq_flag;
+ UINT8 m_towns_pcm_channel_flag;
+ UINT8 m_towns_pcm_channel_mask;
+ UINT8 m_towns_pad_mask;
+ UINT8 m_towns_mouse_output;
+ UINT8 m_towns_mouse_x;
+ UINT8 m_towns_mouse_y;
+ UINT8 m_towns_volume[8]; // volume ports
+ UINT8 m_towns_volume_select;
+ UINT8 m_towns_scsi_control;
+ UINT8 m_towns_scsi_status;
+ UINT8 m_towns_spkrdata;
+ UINT8 m_towns_speaker_input;
+ UINT8 m_timer0;
+ UINT8 m_timer1;
+
+ emu_timer* m_towns_wait_timer;
+ struct towns_cdrom_controller m_towns_cd;
+ struct towns_video_controller m_video;
+
+ UINT32 m_kb_prev[4];
+ UINT8 m_prev_pad_mask;
+ UINT8 m_prev_x;
+ UINT8 m_prev_y;
+
+ required_shared_ptr<UINT32> m_nvram;
+
+ virtual void driver_start();
+ virtual void machine_reset();
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ DECLARE_READ8_MEMBER(towns_system_r);
+ DECLARE_WRITE8_MEMBER(towns_system_w);
+ DECLARE_READ8_MEMBER(towns_intervaltimer2_r);
+ DECLARE_WRITE8_MEMBER(towns_intervaltimer2_w);
+ DECLARE_READ8_MEMBER(towns_sys6c_r);
+ DECLARE_WRITE8_MEMBER(towns_sys6c_w);
+ DECLARE_READ8_MEMBER(towns_dma1_r);
+ DECLARE_WRITE8_MEMBER(towns_dma1_w);
+ DECLARE_READ8_MEMBER(towns_dma2_r);
+ DECLARE_WRITE8_MEMBER(towns_dma2_w);
+ DECLARE_READ8_MEMBER(towns_floppy_r);
+ DECLARE_WRITE8_MEMBER(towns_floppy_w);
+ DECLARE_READ8_MEMBER(towns_keyboard_r);
+ DECLARE_WRITE8_MEMBER(towns_keyboard_w);
+ DECLARE_READ8_MEMBER(towns_port60_r);
+ DECLARE_WRITE8_MEMBER(towns_port60_w);
+ DECLARE_READ32_MEMBER(towns_sys5e8_r);
+ DECLARE_WRITE32_MEMBER(towns_sys5e8_w);
+ DECLARE_READ8_MEMBER(towns_sound_ctrl_r);
+ DECLARE_WRITE8_MEMBER(towns_sound_ctrl_w);
+ DECLARE_READ32_MEMBER(towns_padport_r);
+ DECLARE_WRITE32_MEMBER(towns_pad_mask_w);
+ DECLARE_READ8_MEMBER(towns_cmos8_r);
+ DECLARE_WRITE8_MEMBER(towns_cmos8_w);
+ DECLARE_READ8_MEMBER(towns_cmos_low_r);
+ DECLARE_WRITE8_MEMBER(towns_cmos_low_w);
+ DECLARE_READ8_MEMBER(towns_cmos_r);
+ DECLARE_WRITE8_MEMBER(towns_cmos_w);
+ DECLARE_READ8_MEMBER(towns_sys480_r);
+ DECLARE_WRITE8_MEMBER(towns_sys480_w);
+ DECLARE_READ32_MEMBER(towns_video_404_r);
+ DECLARE_WRITE32_MEMBER(towns_video_404_w);
+ DECLARE_READ8_MEMBER(towns_cdrom_r);
+ DECLARE_WRITE8_MEMBER(towns_cdrom_w);
+ DECLARE_READ32_MEMBER(towns_rtc_r);
+ DECLARE_WRITE32_MEMBER(towns_rtc_w);
+ DECLARE_WRITE32_MEMBER(towns_rtc_select_w);
+ DECLARE_READ8_MEMBER(towns_volume_r);
+ DECLARE_WRITE8_MEMBER(towns_volume_w);
+ DECLARE_READ8_MEMBER(towns_41ff_r);
+
+ DECLARE_READ8_MEMBER(towns_gfx_high_r);
+ DECLARE_WRITE8_MEMBER(towns_gfx_high_w);
+ DECLARE_READ8_MEMBER(towns_gfx_r);
+ DECLARE_WRITE8_MEMBER(towns_gfx_w);
+ DECLARE_READ8_MEMBER(towns_video_cff80_r);
+ DECLARE_WRITE8_MEMBER(towns_video_cff80_w);
+ DECLARE_READ8_MEMBER(towns_video_cff80_mem_r);
+ DECLARE_WRITE8_MEMBER(towns_video_cff80_mem_w);
+ DECLARE_READ8_MEMBER(towns_video_440_r);
+ DECLARE_WRITE8_MEMBER(towns_video_440_w);
+ DECLARE_READ8_MEMBER(towns_video_5c8_r);
+ DECLARE_WRITE8_MEMBER(towns_video_5c8_w);
+ DECLARE_READ8_MEMBER(towns_video_fd90_r);
+ DECLARE_WRITE8_MEMBER(towns_video_fd90_w);
+ DECLARE_READ8_MEMBER(towns_video_ff81_r);
+ DECLARE_READ32_MEMBER(towns_video_unknown_r);
+ DECLARE_WRITE8_MEMBER(towns_video_ff81_w);
+ DECLARE_READ8_MEMBER(towns_spriteram_low_r);
+ DECLARE_WRITE8_MEMBER(towns_spriteram_low_w);
+ DECLARE_READ8_MEMBER(towns_spriteram_r);
+ DECLARE_WRITE8_MEMBER(towns_spriteram_w);
+
+ DECLARE_WRITE_LINE_MEMBER(mb8877a_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(mb8877a_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(pit_out2_changed);
+
+ void towns_update_video_banks(address_space&);
+ void init_serial_rom(running_machine&);
+ void init_rtc(running_machine&);
+ void kb_sendcode(UINT8 scancode, int release);
+ UINT8 speaker_get_spk();
+ void speaker_set_spkrdata(UINT8 data);
+ void speaker_set_input(UINT8 data);
+
+ private:
+ static const device_timer_id TIMER_RTC = 0;
+ static const device_timer_id TIMER_FREERUN = 1;
+ static const device_timer_id TIMER_INTERVAL2 = 2;
+ static const device_timer_id TIMER_KEYBOARD = 3;
+ static const device_timer_id TIMER_MOUSE = 4;
+ static const device_timer_id TIMER_WAIT = 5;
+ void rtc_second();
+ void freerun_inc();
+ void intervaltimer2_timeout();
+ void poll_keyboard();
+ void mouse_timeout();
+ void wait_end();
+};
+
+class marty_state : public towns_state
+{
+ public:
+ marty_state(const machine_config &mconfig, device_type type, const char *tag)
+ : towns_state(mconfig, type, tag)
+ { }
+
+ virtual void driver_start();
+};
+
+INTERRUPT_GEN( towns_vsync_irq );
+//VIDEO_START( towns );
+//SCREEN_UPDATE_RGB32( towns );
+
+#endif /*FMTOWNS_H_*/
diff --git a/src/mess/includes/galaxy.h b/src/mess/includes/galaxy.h
new file mode 100644
index 00000000000..5f0686e451d
--- /dev/null
+++ b/src/mess/includes/galaxy.h
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ *
+ * includes/galaxy.h
+ *
+ ****************************************************************************/
+
+#ifndef GALAXY_H_
+#define GALAXY_H_
+
+#include "imagedev/snapquik.h"
+
+
+class galaxy_state : public driver_device
+{
+public:
+ galaxy_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ int m_interrupts_enabled;
+ UINT8 m_latch_value;
+ UINT32 m_gal_cnt;
+ UINT8 m_code;
+ UINT8 m_first;
+ UINT32 m_start_addr;
+ emu_timer *m_gal_video_timer;
+ bitmap_ind16 m_bitmap;
+ DECLARE_READ8_MEMBER(galaxy_keyboard_r);
+ DECLARE_WRITE8_MEMBER(galaxy_latch_w);
+ DECLARE_DRIVER_INIT(galaxy);
+ DECLARE_DRIVER_INIT(galaxyp);
+};
+
+
+/*----------- defined in machine/galaxy.c -----------*/
+
+MACHINE_RESET( galaxy );
+INTERRUPT_GEN( galaxy_interrupt );
+SNAPSHOT_LOAD( galaxy );
+
+MACHINE_RESET( galaxyp );
+
+
+
+/*----------- defined in video/galaxy.c -----------*/
+
+VIDEO_START( galaxy );
+SCREEN_UPDATE_IND16( galaxy );
+
+void galaxy_set_timer(running_machine &machine);
+
+#endif /* GALAXY_H_ */
diff --git a/src/mess/includes/galeb.h b/src/mess/includes/galeb.h
new file mode 100644
index 00000000000..23b7404a847
--- /dev/null
+++ b/src/mess/includes/galeb.h
@@ -0,0 +1,30 @@
+/*****************************************************************************
+ *
+ * includes/galeb.h
+ *
+ ****************************************************************************/
+
+#ifndef GALEB_H_
+#define GALEB_H_
+
+
+class galeb_state : public driver_device
+{
+public:
+ galeb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_shared_ptr<UINT8> m_video_ram;
+ DECLARE_READ8_MEMBER(galeb_keyboard_r);
+};
+
+/*----------- defined in video/galeb.c -----------*/
+
+extern const gfx_layout galeb_charlayout;
+
+extern VIDEO_START( galeb );
+extern SCREEN_UPDATE_IND16( galeb );
+
+
+#endif /* GALEB_H_ */
diff --git a/src/mess/includes/gamecom.h b/src/mess/includes/gamecom.h
new file mode 100644
index 00000000000..74c4fdc31bd
--- /dev/null
+++ b/src/mess/includes/gamecom.h
@@ -0,0 +1,261 @@
+/*****************************************************************************
+ *
+ * includes/gamecom.h
+ *
+ * Tiger Game.com
+ *
+ * Driver by Wilbert Pol
+ *
+ ****************************************************************************/
+
+#ifndef GAMECOM_H_
+#define GAMECOM_H_
+
+#include "emu.h"
+#include "cpu/sm8500/sm8500.h"
+#include "imagedev/cartslot.h"
+#include "rendlay.h"
+
+/* SM8521 register addresses */
+enum
+{
+ SM8521_R0 = 0x00,
+ SM8521_R1 = 0x01,
+ SM8521_R2 = 0x02,
+ SM8521_R3 = 0x03,
+ SM8521_R4 = 0x04,
+ SM8521_R5 = 0x05,
+ SM8521_R6 = 0x06,
+ SM8521_R7 = 0x07,
+ SM8521_R8 = 0x08,
+ SM8521_R9 = 0x09,
+ SM8521_R10 = 0x0A,
+ SM8521_R11 = 0x0B,
+ SM8521_R12 = 0x0C,
+ SM8521_R13 = 0x0D,
+ SM8521_R14 = 0x0E,
+ SM8521_R15 = 0x0F,
+ SM8521_IE0 = 0x10,
+ SM8521_IE1 = 0x11,
+ SM8521_IR0 = 0x12,
+ SM8521_IR1 = 0x13,
+ SM8521_P0 = 0x14,
+ SM8521_P1 = 0x15,
+ SM8521_P2 = 0x16,
+ SM8521_P3 = 0x17,
+ SM8521_18 = 0x18, /* reserved */
+ SM8521_SYS = 0x19,
+ SM8521_CKC = 0x1A,
+ SM8521_1B = 0x1B, /* reserved */
+ SM8521_SPH = 0x1C,
+ SM8521_SPL = 0x1D,
+ SM8521_PS0 = 0x1E,
+ SM8521_PS1 = 0x1F,
+ SM8521_P0C = 0x20,
+ SM8521_P1C = 0x21,
+ SM8521_P2C = 0x22,
+ SM8521_P3C = 0x23,
+ SM8521_MMU0 = 0x24,
+ SM8521_MMU1 = 0x25,
+ SM8521_MMU2 = 0x26,
+ SM8521_MMU3 = 0x27,
+ SM8521_MMU4 = 0x28,
+ SM8521_29 = 0x29, /* reserved */
+ SM8521_2A = 0x2A, /* reserved */
+ SM8521_URTT = 0x2B,
+ SM8521_URTR = 0x2C,
+ SM8521_URTS = 0x2D,
+ SM8521_URTC = 0x2E,
+ SM8521_2F = 0x2F, /* reserved */
+ SM8521_LCDC = 0x30,
+ SM8521_LCH = 0x31,
+ SM8521_LCV = 0x32,
+ SM8521_33 = 0x33, /* reserved */
+ SM8521_DMC = 0x34,
+ SM8521_DMX1 = 0x35,
+ SM8521_DMY1 = 0x36,
+ SM8521_DMDX = 0x37,
+ SM8521_DMDY = 0x38,
+ SM8521_DMX2 = 0x39,
+ SM8521_DMY2 = 0x3A,
+ SM8521_DMPL = 0x3B,
+ SM8521_DMBR = 0x3C,
+ SM8521_DMVP = 0x3D,
+ SM8521_3E = 0x3E, /* reserved */
+ SM8521_3F = 0x3F, /* reserved */
+ SM8521_SGC = 0x40,
+ SM8521_41 = 0x41, /* reserved */
+ SM8521_SG0L = 0x42,
+ SM8521_43 = 0x43, /* reserved */
+ SM8521_SG1L = 0x44,
+ SM8521_45 = 0x45, /* reserved */
+ SM8521_SG0TH = 0x46,
+ SM8521_SG0TL = 0x47,
+ SM8521_SG1TH = 0x48,
+ SM8521_SG1TL = 0x49,
+ SM8521_SG2L = 0x4A,
+ SM8521_4B = 0x4B, /* reserved */
+ SM8521_SG2TH = 0x4C,
+ SM8521_SG2TL = 0x4D,
+ SM8521_SGDA = 0x4E,
+ SM8521_4F = 0x4F, /* reserved */
+ SM8521_TM0C = 0x50,
+ SM8521_TM0D = 0x51,
+ SM8521_TM1C = 0x52,
+ SM8521_TM1D = 0x53,
+ SM8521_CLKT = 0x54,
+ SM8521_55 = 0x55, /* reserved */
+ SM8521_56 = 0x56, /* reserved */
+ SM8521_57 = 0x57, /* reserved */
+ SM8521_58 = 0x58, /* reserved */
+ SM8521_59 = 0x59, /* reserved */
+ SM8521_5A = 0x5A, /* reserved */
+ SM8521_5B = 0x5B, /* reserved */
+ SM8521_5C = 0x5C, /* reserved */
+ SM8521_5D = 0x5D, /* reserved */
+ SM8521_WDT = 0x5E,
+ SM8521_WDTC = 0x5F,
+ SM8521_SG0W0 = 0x60,
+ SM8521_SG0W1 = 0x61,
+ SM8521_SG0W2 = 0x62,
+ SM8521_SG0W3 = 0x63,
+ SM8521_SG0W4 = 0x64,
+ SM8521_SG0W5 = 0x65,
+ SM8521_SG0W6 = 0x66,
+ SM8521_SG0W7 = 0x67,
+ SM8521_SG0W8 = 0x68,
+ SM8521_SG0W9 = 0x69,
+ SM8521_SG0W10 = 0x6A,
+ SM8521_SG0W11 = 0x6B,
+ SM8521_SG0W12 = 0x6C,
+ SM8521_SG0W13 = 0x6D,
+ SM8521_SG0W14 = 0x6E,
+ SM8521_SG0W15 = 0x6F,
+ SM8521_SG1W0 = 0x70,
+ SM8521_SG1W1 = 0x71,
+ SM8521_SG1W2 = 0x72,
+ SM8521_SG1W3 = 0x73,
+ SM8521_SG1W4 = 0x74,
+ SM8521_SG1W5 = 0x75,
+ SM8521_SG1W6 = 0x76,
+ SM8521_SG1W7 = 0x77,
+ SM8521_SG1W8 = 0x78,
+ SM8521_SG1W9 = 0x79,
+ SM8521_SG1W10 = 0x7A,
+ SM8521_SG1W11 = 0x7B,
+ SM8521_SG1W12 = 0x7C,
+ SM8521_SG1W13 = 0x7D,
+ SM8521_SG1W14 = 0x7E,
+ SM8521_SG1W15 = 0x7F
+};
+
+typedef struct
+{
+ int enabled;
+ int transfer_mode;
+ int decrement_y;
+ int decrement_x;
+ int overwrite_mode;
+ int width_x;
+ int width_y;
+ int width_x_count;
+ int width_y_count;
+ int source_x;
+ int source_x_current;
+ int source_y;
+ int source_width;
+ int dest_x;
+ int dest_x_current;
+ int dest_y;
+ int dest_width;
+ int state_count;
+ int state_pixel;
+ int state_limit;
+ UINT8 palette[4];
+ UINT8 *source_bank;
+ unsigned int source_current;
+ unsigned int source_line;
+ unsigned int source_mask;
+ UINT8 *dest_bank;
+ unsigned int dest_current;
+ unsigned int dest_line;
+ unsigned int dest_mask;
+} GAMECOM_DMA;
+
+typedef struct
+{
+ int enabled;
+ int state_count;
+ int state_limit;
+ int check_value;
+} GAMECOM_TIMER;
+
+typedef struct
+{
+ UINT8 sgc;
+ UINT8 sg0l;
+ UINT8 sg1l;
+ UINT8 sg2l;
+ UINT16 sg0t;
+ UINT16 sg1t;
+ UINT16 sg2t;
+ UINT8 sgda;
+ UINT8 sg0w[16];
+ UINT8 sg1w[16];
+} gamecom_sound_t;
+
+
+class gamecom_state : public driver_device
+{
+public:
+ gamecom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_p_nvram(*this,"p_nvram"),
+ m_p_videoram(*this,"p_videoram") { }
+
+ required_device<cpu_device> m_maincpu;
+ DECLARE_READ8_MEMBER( gamecom_internal_r );
+ DECLARE_READ8_MEMBER( gamecom_pio_r );
+ DECLARE_WRITE8_MEMBER( gamecom_internal_w );
+ DECLARE_WRITE8_MEMBER( gamecom_pio_w );
+ required_shared_ptr<UINT8> m_p_nvram;
+ UINT8 *m_p_ram;
+ required_shared_ptr<UINT8> m_p_videoram;
+ UINT8 *m_cartridge1;
+ UINT8 *m_cartridge2;
+ UINT8 *m_cartridge;
+ emu_timer *m_clock_timer;
+ emu_timer *m_scanline_timer;
+ GAMECOM_DMA m_dma;
+ GAMECOM_TIMER m_timer[2];
+ gamecom_sound_t m_sound;
+ int m_stylus_x;
+ int m_stylus_y;
+ int m_scanline;
+ unsigned int m_base_address;
+ bitmap_ind16 m_bitmap;
+ void gamecom_set_mmu(UINT8 mmu, UINT8 data);
+ void handle_stylus_press(int column);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_DRIVER_INIT(gamecom);
+};
+
+
+/*----------- defined in machine/gamecom.c -----------*/
+
+extern MACHINE_RESET( gamecom );
+extern DEVICE_IMAGE_LOAD( gamecom_cart1 );
+extern DEVICE_IMAGE_LOAD( gamecom_cart2 );
+
+extern void gamecom_handle_dma( device_t *device, int cycles );
+extern void gamecom_update_timers( device_t *device, int cycles );
+
+
+/*----------- defined in video/gamecom.c -----------*/
+
+VIDEO_START( gamecom );
+
+
+#endif /* GAMECOM_H_ */
diff --git a/src/mess/includes/gamepock.h b/src/mess/includes/gamepock.h
new file mode 100644
index 00000000000..5188a45f7ad
--- /dev/null
+++ b/src/mess/includes/gamepock.h
@@ -0,0 +1,41 @@
+#ifndef _GAMEPOCK_H_
+#define _GAMEPOCK_H_
+
+typedef struct {
+ UINT8 enabled;
+ UINT8 start_page;
+ UINT8 address;
+ UINT8 y_inc;
+ UINT8 ram[256]; /* There are actually 50 x 4 x 8 bits. This just makes addressing easier. */
+} HD44102CH;
+
+class gamepock_state : public driver_device
+{
+public:
+ gamepock_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ virtual void machine_reset();
+
+ UINT8 m_port_a;
+ UINT8 m_port_b;
+ HD44102CH m_hd44102ch[3];
+
+ void hd44102ch_w( int which, int c_d, UINT8 data );
+ void hd44102ch_init( int which );
+ void lcd_update();
+
+ DECLARE_WRITE8_MEMBER( port_a_w );
+ DECLARE_READ8_MEMBER( port_b_r );
+ DECLARE_WRITE8_MEMBER( port_b_w );
+ DECLARE_READ8_MEMBER( port_c_r );
+};
+
+
+/*----------- defined in machine/gamepock.c -----------*/
+
+SCREEN_UPDATE_IND16( gamepock );
+
+int gamepock_io_callback( device_t *device, int ioline, int state );
+
+#endif
diff --git a/src/mess/includes/gb.h b/src/mess/includes/gb.h
new file mode 100644
index 00000000000..5530a4b3ef1
--- /dev/null
+++ b/src/mess/includes/gb.h
@@ -0,0 +1,288 @@
+/*****************************************************************************
+ *
+ * includes/gb.h
+ *
+ ****************************************************************************/
+
+#ifndef GB_H_
+#define GB_H_
+
+
+
+/* Interrupts */
+#define VBL_INT 0 /* V-Blank */
+#define LCD_INT 1 /* LCD Status */
+#define TIM_INT 2 /* Timer */
+#define SIO_INT 3 /* Serial I/O */
+#define EXT_INT 4 /* Joypad */
+
+#ifdef TIMER
+#undef TIMER
+#endif
+
+/* Cartridge types */
+#define CART_RAM 0x01 /* Cartridge has RAM */
+#define BATTERY 0x02 /* Cartridge has a battery to save RAM */
+#define TIMER 0x04 /* Cartridge has a real-time-clock (MBC3 only) */
+#define RUMBLE 0x08 /* Cartridge has a rumble motor (MBC5 only) */
+#define SRAM 0x10 /* Cartridge has SRAM */
+#define UNKNOWN 0x80 /* Cartridge is of an unknown type */
+
+#define DMG_FRAMES_PER_SECOND 59.732155
+#define SGB_FRAMES_PER_SECOND 61.17
+
+
+#define MAX_ROMBANK 512
+#define MAX_RAMBANK 256
+
+
+#define _NR_GB_VID_REGS 0x40
+
+struct layer_struct {
+ UINT8 enabled;
+ UINT8 *bg_tiles;
+ UINT8 *bg_map;
+ UINT8 xindex;
+ UINT8 xshift;
+ UINT8 xstart;
+ UINT8 xend;
+ /* GBC specific */
+ UINT8 *gbc_map;
+ INT16 bgline;
+};
+
+typedef struct {
+ int window_lines_drawn;
+
+ UINT8 gb_vid_regs[_NR_GB_VID_REGS];
+ UINT8 bg_zbuf[160];
+
+ UINT16 cgb_bpal[32]; /* CGB current background palette table */
+ UINT16 cgb_spal[32]; /* CGB current sprite palette table */
+
+ UINT8 gb_bpal[4]; /* Background palette */
+ UINT8 gb_spal0[4]; /* Sprite 0 palette */
+ UINT8 gb_spal1[4]; /* Sprite 1 palette */
+
+ /* Things used to render current line */
+ int current_line; /* Current line */
+ int cmp_line; /* Compare line */
+ int sprCount; /* Number of sprites on current line */
+ int sprite[10]; /* References to sprites to draw on current line */
+ int previous_line; /* Previous line we've drawn in */
+ int start_x; /* Pixel to start drawing from (inclusive) */
+ int end_x; /* Pixel to end drawing (exclusive) */
+ int mode; /* Keep track of internal STAT mode */
+ int state; /* Current state of the video state machine */
+ int lcd_irq_line;
+ int triggering_line_irq;
+ int line_irq;
+ int triggering_mode_irq;
+ int mode_irq;
+ int delayed_line_irq;
+ int sprite_cycles;
+ int scrollx_adjust;
+ int oam_locked;
+ int vram_locked;
+ int pal_locked;
+ int hdma_enabled;
+ int hdma_possible;
+ struct layer_struct layer[2];
+ emu_timer *lcd_timer;
+ int gbc_mode;
+
+ memory_region *gb_vram; /* Pointer to VRAM */
+ memory_region *gb_oam; /* Pointer to OAM memory */
+ UINT8 *gb_vram_ptr;
+ UINT8 *gb_chrgen; /* Character generator */
+ UINT8 *gb_bgdtab; /* Background character table */
+ UINT8 *gb_wndtab; /* Window character table */
+ UINT8 gb_tile_no_mod;
+ UINT8 *gbc_chrgen; /* CGB Character generator */
+ UINT8 *gbc_bgdtab; /* CGB Background character table */
+ UINT8 *gbc_wndtab; /* CGB Window character table */
+} gb_lcd_t;
+
+
+
+class gb_state : public driver_device
+{
+public:
+ gb_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ UINT16 m_sgb_pal_data[4096];
+ UINT8 m_sgb_pal_map[20][18];
+ UINT16 m_sgb_pal[128];
+ UINT8 *m_sgb_tile_data;
+ UINT8 m_sgb_tile_map[2048];
+ UINT8 m_sgb_window_mask;
+ UINT8 m_sgb_hack;
+ //gb_state driver_data;
+ UINT8 m_gb_io[0x10];
+
+ /* Timer related */
+ UINT16 m_divcount;
+ UINT8 m_shift;
+ UINT16 m_shift_cycles;
+ UINT8 m_triggering_irq;
+ UINT8 m_reloading;
+
+ /* Serial I/O related */
+ UINT32 m_SIOCount; /* Serial I/O counter */
+ emu_timer *m_gb_serial_timer;
+
+ /* SGB variables */
+ UINT8 m_sgb_atf_data[4050]; /* (SGB) Attributes files */
+ INT8 m_sgb_packets;
+ UINT8 m_sgb_bitcount;
+ UINT8 m_sgb_bytecount;
+ UINT8 m_sgb_start;
+ UINT8 m_sgb_rest;
+ UINT8 m_sgb_controller_no;
+ UINT8 m_sgb_controller_mode;
+ UINT8 m_sgb_data[112];
+ UINT32 m_sgb_atf;
+
+ /* Cartridge/mapper */
+ UINT16 m_MBCType; /* MBC type: 0 for none */
+ UINT8 m_CartType; /* Cartridge type (battery, ram, rtc, etc) */
+ UINT8 *m_ROMMap[MAX_ROMBANK]; /* Addresses of ROM banks */
+ UINT16 m_ROMBank; /* Index of ROM bank currently used at 4000-7fff */
+ UINT16 m_ROMBank00; /* Index of ROM bank currently used at 0000-3fff */
+ UINT8 m_ROMMask; /* Mask for the ROM bank number */
+ UINT16 m_ROMBanks; /* Total number of ROM banks */
+ UINT8 *m_RAMMap[MAX_RAMBANK]; /* Addresses of RAM banks */
+ UINT8 m_RAMBank; /* Number of RAM bank currently used */
+ UINT8 m_RAMMask; /* Mask for the RAM bank number */
+ UINT8 m_RAMBanks; /* Total number of RAM banks */
+ UINT8 m_MBC1Mode; /* MBC1 ROM/RAM mode */
+ UINT8 *m_MBC3RTCData; /* MBC3 RTC data */
+ UINT8 m_MBC3RTCMap[5]; /* MBC3 RTC banks */
+ UINT8 m_MBC3RTCBank; /* MBC3 RTC bank */
+ UINT8 *m_GBC_RAMMap[8]; /* (CGB) Addresses of internal RAM banks */
+ UINT8 m_GBC_RAMBank; /* (CGB) Current CGB RAM bank */
+ UINT8 m_gbTama5Memory[32];
+ UINT8 m_gbTama5Byte;
+ UINT8 m_gbTama5Address;
+ UINT8 m_gbLastTama5Command;
+ UINT8 *m_gb_cart;
+ UINT8 *m_gb_cart_ram;
+ UINT8 *m_gb_dummy_rom_bank;
+ UINT8 *m_gb_dummy_ram_bank;
+
+ UINT8 m_mmm01_bank_offset;
+ UINT8 m_mmm01_reg1;
+ UINT8 m_mmm01_bank;
+ UINT8 m_mmm01_bank_mask;
+ gb_lcd_t m_lcd;
+ void (*update_scanline)( running_machine &machine );
+
+ bitmap_ind16 m_bitmap;
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc1);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc2);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc3);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc5);
+ DECLARE_WRITE8_MEMBER(gb_ram_bank_select_mbc6);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc6_1);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc6_2);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc7);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_unknown_mbc7);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_wisdom);
+ DECLARE_WRITE8_MEMBER(gb_ram_bank_select_mbc1);
+ DECLARE_WRITE8_MEMBER(gb_ram_bank_select_mbc3);
+ DECLARE_WRITE8_MEMBER(gb_ram_bank_select_mbc5);
+ DECLARE_WRITE8_MEMBER(gb_ram_enable);
+ DECLARE_WRITE8_MEMBER(gb_mem_mode_select_mbc1);
+ DECLARE_WRITE8_MEMBER(gb_mem_mode_select_mbc3);
+ DECLARE_WRITE8_MEMBER(gb_ram_tama5);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_mmm01_0000_w);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_mmm01_2000_w);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_mmm01_4000_w);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_mmm01_6000_w);
+ DECLARE_WRITE8_MEMBER(gb_rom_bank_select_mbc1_kor);
+ DECLARE_WRITE8_MEMBER(gb_ram_bank_select_mbc1_kor);
+ DECLARE_WRITE8_MEMBER(gb_mem_mode_select_mbc1_kor);
+ DECLARE_WRITE8_MEMBER(gb_io_w);
+ DECLARE_WRITE8_MEMBER(gb_io2_w);
+ DECLARE_WRITE8_MEMBER(sgb_io_w);
+ DECLARE_READ8_MEMBER(gb_ie_r);
+ DECLARE_WRITE8_MEMBER(gb_ie_w);
+ DECLARE_READ8_MEMBER(gb_io_r);
+ DECLARE_WRITE8_MEMBER(gbc_io2_w);
+ DECLARE_READ8_MEMBER(gbc_io2_r);
+ DECLARE_READ8_MEMBER(megaduck_video_r);
+ DECLARE_WRITE8_MEMBER(megaduck_video_w);
+ DECLARE_WRITE8_MEMBER(megaduck_sound_w1);
+ DECLARE_READ8_MEMBER(megaduck_sound_r1);
+ DECLARE_WRITE8_MEMBER(megaduck_sound_w2);
+ DECLARE_READ8_MEMBER(megaduck_sound_r2);
+ DECLARE_WRITE8_MEMBER(megaduck_rom_bank_select_type1);
+ DECLARE_WRITE8_MEMBER(megaduck_rom_bank_select_type2);
+ DECLARE_READ8_MEMBER(gb_video_r);
+ DECLARE_READ8_MEMBER(gb_vram_r);
+ DECLARE_WRITE8_MEMBER(gb_vram_w);
+ DECLARE_READ8_MEMBER(gb_oam_r);
+ DECLARE_WRITE8_MEMBER(gb_oam_w);
+ DECLARE_WRITE8_MEMBER(gb_video_w);
+ DECLARE_READ8_MEMBER(gbc_video_r);
+ DECLARE_WRITE8_MEMBER(gbc_video_w);
+};
+
+
+/*----------- defined in machine/gb.c -----------*/
+
+DEVICE_START(gb_cart);
+DEVICE_IMAGE_LOAD(gb_cart);
+INTERRUPT_GEN( gb_scanline_interrupt );
+void gb_timer_callback(lr35902_cpu_device *device, int cycles);
+MACHINE_START( gb );
+MACHINE_RESET( gb );
+MACHINE_RESET( gbpocket );
+
+/* -- Super Game Boy specific -- */
+#define SGB_BORDER_PAL_OFFSET 64 /* Border colours stored from pal 4-7 */
+#define SGB_XOFFSET 48 /* GB screen starts at column 48 */
+#define SGB_YOFFSET 40 /* GB screen starts at row 40 */
+
+
+extern MACHINE_START( sgb );
+extern MACHINE_RESET( sgb );
+
+MACHINE_START( gbc );
+MACHINE_RESET( gbc );
+
+
+/* -- Megaduck specific -- */
+extern DEVICE_IMAGE_LOAD(megaduck_cart);
+extern MACHINE_START( megaduck );
+extern MACHINE_RESET( megaduck );
+
+
+/*----------- defined in video/gb.c -----------*/
+
+
+
+enum
+{
+ GB_VIDEO_DMG = 1,
+ GB_VIDEO_MGB,
+ GB_VIDEO_SGB,
+ GB_VIDEO_CGB
+};
+
+PALETTE_INIT( gb );
+PALETTE_INIT( gbp );
+PALETTE_INIT( sgb );
+PALETTE_INIT( gbc );
+PALETTE_INIT( megaduck );
+
+MACHINE_START( gb_video );
+MACHINE_START( gbc_video );
+void gb_video_reset( running_machine &machine, int mode );
+UINT8 *gb_get_vram_ptr(running_machine &machine);
+
+
+#endif /* GB_H_ */
diff --git a/src/mess/includes/gba.h b/src/mess/includes/gba.h
new file mode 100644
index 00000000000..e0a10253ebb
--- /dev/null
+++ b/src/mess/includes/gba.h
@@ -0,0 +1,246 @@
+#ifndef _GBA_H_
+#define _GBA_H_
+
+#include "machine/intelfsh.h"
+
+#define DISPSTAT_VBL 0x0001
+#define DISPSTAT_HBL 0x0002
+#define DISPSTAT_VCNT 0x0004
+#define DISPSTAT_VBL_IRQ_EN 0x0008
+#define DISPSTAT_HBL_IRQ_EN 0x0010
+#define DISPSTAT_VCNT_IRQ_EN 0x0020
+#define DISPSTAT_VCNT_VALUE 0xff00
+
+#define INT_VBL 0x0001
+#define INT_HBL 0x0002
+#define INT_VCNT 0x0004
+#define INT_TM0_OVERFLOW 0x0008
+#define INT_TM1_OVERFLOW 0x0010
+#define INT_TM2_OVERFLOW 0x0020
+#define INT_TM3_OVERFLOW 0x0040
+#define INT_SIO 0x0080
+#define INT_DMA0 0x0100
+#define INT_DMA1 0x0200
+#define INT_DMA2 0x0400
+#define INT_DMA3 0x0800
+#define INT_KEYPAD 0x1000
+#define INT_GAMEPAK 0x2000
+
+#define DISPCNT_MODE 0x0007
+#define DISPCNT_FRAMESEL 0x0010
+#define DISPCNT_HBL_FREE 0x0020
+
+#define DISPCNT_VRAM_MAP 0x0040
+#define DISPCNT_VRAM_MAP_2D 0x0000
+#define DISPCNT_VRAM_MAP_1D 0x0040
+
+#define DISPCNT_BLANK 0x0080
+#define DISPCNT_BG0_EN 0x0100
+#define DISPCNT_BG1_EN 0x0200
+#define DISPCNT_BG2_EN 0x0400
+#define DISPCNT_BG3_EN 0x0800
+#define DISPCNT_OBJ_EN 0x1000
+#define DISPCNT_WIN0_EN 0x2000
+#define DISPCNT_WIN1_EN 0x4000
+#define DISPCNT_OBJWIN_EN 0x8000
+
+#define OBJ_Y_COORD 0x00ff
+#define OBJ_ROZMODE 0x0300
+#define OBJ_ROZMODE_NONE 0x0000
+#define OBJ_ROZMODE_ROZ 0x0100
+#define OBJ_ROZMODE_DISABLE 0x0200
+#define OBJ_ROZMODE_DBLROZ 0x0300
+
+#define OBJ_MODE 0x0c00
+#define OBJ_MODE_NORMAL 0x0000
+#define OBJ_MODE_ALPHA 0x0400
+#define OBJ_MODE_WINDOW 0x0800
+#define OBJ_MODE_UNDEFINED 0x0c00
+
+#define OBJ_MOSAIC 0x1000
+
+#define OBJ_PALMODE 0x2000
+#define OBJ_PALMODE_16 0x0000
+#define OBJ_PALMODE_256 0x2000
+
+#define OBJ_SHAPE 0xc000
+#define OBJ_SHAPE_SQR 0x0000
+#define OBJ_SHAPE_HORIZ 0x4000
+#define OBJ_SHAPE_VERT 0x8000
+
+#define OBJ_X_COORD 0x01ff
+#define OBJ_SCALE_PARAM 0x3e00
+#define OBJ_SCALE_PARAM_SHIFT 9
+#define OBJ_HFLIP 0x1000
+#define OBJ_VFLIP 0x2000
+#define OBJ_SIZE 0xc000
+#define OBJ_SIZE_8 0x0000
+#define OBJ_SIZE_16 0x4000
+#define OBJ_SIZE_32 0x8000
+#define OBJ_SIZE_64 0xc000
+
+#define OBJ_TILENUM 0x03ff
+#define OBJ_PRIORITY 0x0c00
+#define OBJ_PRIORITY_SHIFT 10
+#define OBJ_PALNUM 0xf000
+#define OBJ_PALNUM_SHIFT 12
+
+#define BGCNT_SCREENSIZE 0xc000
+#define BGCNT_SCREENSIZE_SHIFT 14
+#define BGCNT_PALETTESET_WRAP 0x2000
+#define BGCNT_SCREENBASE 0x1f00
+#define BGCNT_SCREENBASE_SHIFT 8
+#define BGCNT_PALETTE256 0x0080
+#define BGCNT_MOSAIC 0x0040
+#define BGCNT_CHARBASE 0x003c
+#define BGCNT_CHARBASE_SHIFT 2
+#define BGCNT_PRIORITY 0x0003
+
+#define BLDCNT_BG0TP1 0x0001
+#define BLDCNT_BG1TP1 0x0002
+#define BLDCNT_BG2TP1 0x0004
+#define BLDCNT_BG3TP1 0x0008
+#define BLDCNT_OBJTP1 0x0010
+#define BLDCNT_BDTP1 0x0020
+#define BLDCNT_SFX 0x00c0
+#define BLDCNT_SFX_NONE 0x0000
+#define BLDCNT_SFX_ALPHA 0x0040
+#define BLDCNT_SFX_LIGHTEN 0x0080
+#define BLDCNT_SFX_DARKEN 0x00c0
+#define BLDCNT_BG0TP2 0x0100
+#define BLDCNT_BG1TP2 0x0200
+#define BLDCNT_BG2TP2 0x0400
+#define BLDCNT_BG3TP2 0x0800
+#define BLDCNT_OBJTP2 0x1000
+#define BLDCNT_BDTP2 0x2000
+#define BLDCNT_TP2_SHIFT 8
+
+#define TILEOBJ_TILE 0x03ff
+#define TILEOBJ_HFLIP 0x0400
+#define TILEOBJ_VFLIP 0x0800
+#define TILEOBJ_PALETTE 0xf000
+
+enum
+{
+ EEP_IDLE,
+ EEP_COMMAND,
+ EEP_ADDR,
+ EEP_AFTERADDR,
+ EEP_READ,
+ EEP_WRITE,
+ EEP_AFTERWRITE,
+ EEP_READFIRST
+};
+
+/* driver state */
+class gba_state : public driver_device
+{
+public:
+ gba_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_gba_pram(*this, "gba_pram"),
+ m_gba_vram(*this, "gba_vram"),
+ m_gba_oam(*this, "gba_oam") { }
+
+ required_shared_ptr<UINT32> m_gba_pram;
+ required_shared_ptr<UINT32> m_gba_vram;
+ required_shared_ptr<UINT32> m_gba_oam;
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ bitmap_ind16 m_bitmap;
+
+ UINT32 m_DISPSTAT;
+ UINT32 m_BG2X, m_BG2Y, m_BG3X, m_BG3Y;
+ UINT16 m_DISPCNT, m_GRNSWAP;
+ UINT16 m_BG0CNT, m_BG1CNT, m_BG2CNT, m_BG3CNT;
+ UINT16 m_BG0HOFS, m_BG0VOFS, m_BG1HOFS, m_BG1VOFS, m_BG2HOFS, m_BG2VOFS, m_BG3HOFS, m_BG3VOFS;
+ UINT16 m_BG2PA, m_BG2PB, m_BG2PC, m_BG2PD, m_BG3PA, m_BG3PB, m_BG3PC, m_BG3PD;
+ UINT16 m_WIN0H, m_WIN1H, m_WIN0V, m_WIN1V, m_WININ, m_WINOUT;
+ UINT16 m_MOSAIC;
+ UINT16 m_BLDCNT;
+ UINT16 m_BLDALPHA;
+ UINT16 m_BLDY;
+ UINT8 m_SOUNDCNT_X;
+ UINT16 m_SOUNDCNT_H;
+ UINT16 m_SOUNDBIAS;
+ UINT16 m_SIOMULTI0, m_SIOMULTI1, m_SIOMULTI2, m_SIOMULTI3;
+ UINT16 m_SIOCNT, m_SIODATA8;
+ UINT16 m_KEYCNT;
+ UINT16 m_RCNT;
+ UINT16 m_JOYCNT;
+ UINT32 m_JOY_RECV, m_JOY_TRANS;
+ UINT16 m_JOYSTAT;
+ UINT16 m_IR, m_IE, m_IF, m_IME;
+ UINT16 m_WAITCNT;
+ UINT8 m_POSTFLG;
+ UINT8 m_HALTCNT;
+
+ UINT8 m_windowOn;
+ UINT8 m_fxOn;
+ UINT8 m_gfxBG2Changed;
+ UINT8 m_gfxBG3Changed;
+ INT32 m_gfxBG2X;
+ INT32 m_gfxBG2Y;
+ INT32 m_gfxBG3X;
+ INT32 m_gfxBG3Y;
+
+
+
+ UINT32 m_dma_regs[16];
+ UINT32 m_dma_src[4], m_dma_dst[4], m_dma_cnt[4], m_dma_srcadd[4], m_dma_dstadd[4];
+ UINT32 m_timer_regs[4];
+ UINT16 m_timer_reload[4];
+ int m_timer_recalc[4];
+
+ UINT32 m_gba_sram[0x10000/4];
+ UINT8 m_gba_eeprom[0x2000];
+ UINT32 m_flash_size;
+ UINT32 m_flash_mask;
+ intelfsh8_device *m_mFlashDev;
+ int m_eeprom_state, m_eeprom_command, m_eeprom_count, m_eeprom_addr, m_eeprom_bits, m_eeprom_addr_bits;
+ UINT8 m_eep_data;
+
+ /* nvram-specific for MESS */
+ UINT8 *m_nvptr;
+ UINT32 m_nvsize;
+ device_t *m_nvimage;
+
+ emu_timer *m_dma_timer[4], *m_tmr_timer[4], *m_irq_timer;
+ emu_timer *m_scan_timer, *m_hbl_timer;
+
+ double m_timer_hz[4];
+
+ int m_fifo_a_ptr, m_fifo_b_ptr, m_fifo_a_in, m_fifo_b_in;
+ UINT8 m_fifo_a[20], m_fifo_b[20];
+ UINT32 m_xferscan[7][240+2048];
+
+ UINT32 m_bios_last_address;
+ int m_bios_protected;
+
+ int m_flash_battery_load;
+
+ DIRECT_UPDATE_MEMBER(gba_direct);
+ DECLARE_READ32_MEMBER(gba_io_r);
+ DECLARE_WRITE32_MEMBER(gba_io_w);
+ DECLARE_WRITE32_MEMBER(gba_pram_w);
+ DECLARE_WRITE32_MEMBER(gba_vram_w);
+ DECLARE_WRITE32_MEMBER(gba_oam_w);
+ DECLARE_READ32_MEMBER(gba_bios_r);
+ DECLARE_READ32_MEMBER(gba_10000000_r);
+ DECLARE_READ32_MEMBER(sram_r);
+ DECLARE_WRITE32_MEMBER(sram_w);
+ DECLARE_READ32_MEMBER(flash_r);
+ DECLARE_WRITE32_MEMBER(flash_w);
+ DECLARE_READ32_MEMBER(eeprom_r);
+ DECLARE_WRITE32_MEMBER(eeprom_w);
+ DECLARE_DRIVER_INIT(gbadv);
+};
+
+/*----------- defined in video/gba.c -----------*/
+
+void gba_draw_scanline(running_machine &machine, int y);
+
+#endif
diff --git a/src/mess/includes/genpc.h b/src/mess/includes/genpc.h
new file mode 100644
index 00000000000..082b0922420
--- /dev/null
+++ b/src/mess/includes/genpc.h
@@ -0,0 +1,142 @@
+/*****************************************************************************
+ *
+ * includes/pc.h
+ *
+ ****************************************************************************/
+
+#ifndef GENPC_H_
+#define GENPC_H_
+
+#include "machine/ins8250.h"
+#include "machine/i8255.h"
+#include "machine/am9517a.h"
+#include "machine/isa.h"
+#include "machine/pc_kbdc.h"
+#include "imagedev/cassette.h"
+
+#define MCFG_IBM5160_MOTHERBOARD_ADD(_tag, _cputag) \
+ MCFG_DEVICE_ADD(_tag, IBM5160_MOTHERBOARD, 0) \
+ ibm5160_mb_device::static_set_cputag(*device, _cputag); \
+
+// ======================> ibm5160_mb_device
+class ibm5160_mb_device : public device_t
+{
+public:
+ // construction/destruction
+ ibm5160_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ // inline configuration
+ static void static_set_cputag(device_t &device, const char *tag);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual ioport_constructor device_input_ports() const;
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ void install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name);
+ void install_device_write(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_device_func whandler, const char *whandler_name);
+ void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler);
+public:
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_pic8259;
+ required_device<am9517a_device> m_dma8237;
+ required_device<device_t> m_pit8253;
+ required_device<i8255_device> m_ppi8255;
+ required_device<device_t> m_speaker;
+ required_device<isa8_device> m_isabus;
+ required_device<pc_kbdc_device> m_pc_kbdc;
+
+ /* U73 is an LS74 - dual flip flop */
+ /* Q2 is set by OUT1 from the 8253 and goes to DRQ1 on the 8237 */
+ UINT8 m_u73_q2;
+ UINT8 m_out1;
+ int m_dma_channel;
+ UINT8 m_dma_offset[4];
+ UINT8 m_pc_spkrdata;
+ UINT8 m_pc_input;
+
+ UINT8 m_nmi_enabled;
+
+ int m_ppi_portc_switch_high;
+ int m_ppi_speaker;
+ int m_ppi_keyboard_clear;
+ UINT8 m_ppi_keyb_clock;
+ UINT8 m_ppi_portb;
+ UINT8 m_ppi_clock_signal;
+ UINT8 m_ppi_data_signal;
+ UINT8 m_ppi_shift_register;
+ UINT8 m_ppi_shift_enable;
+
+ static IRQ_CALLBACK(pc_irq_callback);
+
+ // interface to the keyboard
+ DECLARE_WRITE_LINE_MEMBER( keyboard_clock_w );
+ DECLARE_WRITE_LINE_MEMBER( keyboard_data_w );
+
+ virtual DECLARE_READ8_MEMBER ( pc_ppi_porta_r );
+ virtual DECLARE_READ8_MEMBER ( pc_ppi_portc_r );
+ virtual DECLARE_WRITE8_MEMBER( pc_ppi_portb_w );
+
+ DECLARE_WRITE_LINE_MEMBER( pc_pit8253_out1_changed );
+ DECLARE_WRITE_LINE_MEMBER( pc_pit8253_out2_changed );
+
+ DECLARE_WRITE_LINE_MEMBER( pc_dma_hrq_changed );
+ DECLARE_WRITE_LINE_MEMBER( pc_dma8237_out_eop );
+ DECLARE_READ8_MEMBER( pc_dma_read_byte );
+ DECLARE_WRITE8_MEMBER( pc_dma_write_byte );
+ DECLARE_READ8_MEMBER( pc_dma8237_1_dack_r );
+ DECLARE_READ8_MEMBER( pc_dma8237_2_dack_r );
+ DECLARE_READ8_MEMBER( pc_dma8237_3_dack_r );
+ DECLARE_WRITE8_MEMBER( pc_dma8237_1_dack_w );
+ DECLARE_WRITE8_MEMBER( pc_dma8237_2_dack_w );
+ DECLARE_WRITE8_MEMBER( pc_dma8237_3_dack_w );
+ DECLARE_WRITE8_MEMBER( pc_dma8237_0_dack_w );
+ DECLARE_WRITE_LINE_MEMBER( pc_dack0_w );
+ DECLARE_WRITE_LINE_MEMBER( pc_dack1_w );
+ DECLARE_WRITE_LINE_MEMBER( pc_dack2_w );
+ DECLARE_WRITE_LINE_MEMBER( pc_dack3_w );
+
+ DECLARE_WRITE_LINE_MEMBER( pc_cpu_line );
+ DECLARE_WRITE_LINE_MEMBER( pc_speaker_set_spkrdata );
+
+ const char *m_cputag;
+};
+
+
+// device type definition
+extern const device_type IBM5160_MOTHERBOARD;
+
+
+#define MCFG_IBM5150_MOTHERBOARD_ADD(_tag, _cputag) \
+ MCFG_DEVICE_ADD(_tag, IBM5150_MOTHERBOARD, 0) \
+ ibm5150_mb_device::static_set_cputag(*device, _cputag); \
+
+
+// ======================> ibm5150_mb_device
+class ibm5150_mb_device : public ibm5160_mb_device
+{
+public:
+ // construction/destruction
+ ibm5150_mb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual machine_config_constructor device_mconfig_additions() const;
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+
+ required_device<cassette_image_device> m_cassette;
+public:
+ virtual DECLARE_READ8_MEMBER ( pc_ppi_porta_r );
+ virtual DECLARE_READ8_MEMBER ( pc_ppi_portc_r );
+ virtual DECLARE_WRITE8_MEMBER( pc_ppi_portb_w );
+};
+
+
+// device type definition
+extern const device_type IBM5150_MOTHERBOARD;
+
+#endif /* GENPC_H_ */
diff --git a/src/mess/includes/gmaster.h b/src/mess/includes/gmaster.h
new file mode 100644
index 00000000000..8f50e752a9e
--- /dev/null
+++ b/src/mess/includes/gmaster.h
@@ -0,0 +1,42 @@
+#ifndef __GMASTER_H__
+#define __GMASTER_H__
+
+typedef struct
+{
+ UINT8 data[8];
+ int index;
+ int x, y;
+ /*bool*/int mode; // true read does not increase address
+ /*bool*/int delayed;
+ UINT8 pixels[8][64/*>=62 sure*/];
+} GMASTER_VIDEO;
+
+typedef struct
+{
+ UINT8 ports[5];
+} GMASTER_MACHINE;
+
+
+class gmaster_state : public driver_device
+{
+public:
+ gmaster_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ GMASTER_VIDEO m_video;
+ GMASTER_MACHINE m_gmachine;
+ DECLARE_READ8_MEMBER(gmaster_io_r);
+ DECLARE_WRITE8_MEMBER(gmaster_io_w);
+ DECLARE_READ8_MEMBER(gmaster_port_r);
+ DECLARE_WRITE8_MEMBER(gmaster_port_w);
+ DECLARE_DRIVER_INIT(gmaster);
+};
+
+
+/*----------- defined in audio/gmaster.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(GMASTER, gmaster_sound);
+
+int gmaster_io_callback(device_t *device, int ioline, int state);
+
+#endif /* __GMASTER_H__ */
diff --git a/src/mess/includes/gp32.h b/src/mess/includes/gp32.h
new file mode 100644
index 00000000000..94482504466
--- /dev/null
+++ b/src/mess/includes/gp32.h
@@ -0,0 +1,167 @@
+#ifndef _GP32_H_
+#define _GP32_H_
+
+#define INT_ADC 31
+#define INT_RTC 30
+#define INT_UTXD1 29
+#define INT_UTXD0 28
+#define INT_IIC 27
+#define INT_USBH 26
+#define INT_USBD 25
+#define INT_URXD1 24
+#define INT_URXD0 23
+#define INT_SPI 22
+#define INT_MMC 21
+#define INT_DMA3 20
+#define INT_DMA2 19
+#define INT_DMA1 18
+#define INT_DMA0 17
+#define INT_RESERVED 16
+#define INT_UERR 15
+#define INT_TIMER4 14
+#define INT_TIMER3 13
+#define INT_TIMER2 12
+#define INT_TIMER1 11
+#define INT_TIMER0 10
+#define INT_WDT 9
+#define INT_TICK 8
+#define INT_EINT7 7
+#define INT_EINT6 6
+#define INT_EINT5 5
+#define INT_EINT4 4
+#define INT_EINT3 3
+#define INT_EINT2 2
+#define INT_EINT1 1
+#define INT_EINT0 0
+
+typedef struct
+{
+ UINT32 vramaddr_cur;
+ UINT32 vramaddr_max;
+ UINT32 offsize;
+ UINT32 pagewidth_cur;
+ UINT32 pagewidth_max;
+ UINT32 bppmode;
+ UINT32 bswp, hwswp;
+ UINT32 hozval, lineval;
+ int vpos, hpos;
+} s3c240x_lcd_t;
+
+typedef struct
+{
+ int add_latch;
+ int chip;
+ int cmd_latch;
+ int do_read;
+ int do_write;
+ int read;
+ int wp;
+ int busy;
+ UINT8 datarx;
+ UINT8 datatx;
+} smc_t;
+
+typedef struct
+{
+ int l3d;
+ int l3m;
+ int l3c;
+} i2s_t;
+
+typedef struct
+{
+ UINT8 data[4];
+ int data_index;
+ UINT16 address;
+} s3c240x_iic_t;
+
+typedef struct
+{
+ UINT16 fifo[16/2];
+ int fifo_index;
+} s3c240x_iis_t;
+
+
+class gp32_state : public driver_device
+{
+public:
+ gp32_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_s3c240x_ram(*this, "s3c240x_ram"){ }
+
+ virtual void video_start();
+
+ required_shared_ptr<UINT32> m_s3c240x_ram;
+ UINT8 *m_eeprom_data;
+ UINT32 m_s3c240x_lcd_regs[0x400/4];
+ emu_timer *m_s3c240x_lcd_timer;
+ s3c240x_lcd_t m_s3c240x_lcd;
+ UINT32 m_s3c240x_lcd_palette[0x400/4];
+ UINT32 m_s3c240x_clkpow_regs[0x18/4];
+ UINT32 m_s3c240x_irq_regs[0x18/4];
+ emu_timer *m_s3c240x_pwm_timer[5];
+ UINT32 m_s3c240x_pwm_regs[0x44/4];
+ emu_timer *m_s3c240x_dma_timer[4];
+ UINT32 m_s3c240x_dma_regs[0x7c/4];
+ smc_t m_smc;
+ i2s_t m_i2s;
+ UINT32 m_s3c240x_gpio[0x60/4];
+ UINT32 m_s3c240x_memcon_regs[0x34/4];
+ UINT32 m_s3c240x_usb_host_regs[0x5C/4];
+ UINT32 m_s3c240x_uart_0_regs[0x2C/4];
+ UINT32 m_s3c240x_uart_1_regs[0x2C/4];
+ UINT32 m_s3c240x_usb_device_regs[0xBC/4];
+ UINT32 m_s3c240x_watchdog_regs[0x0C/4];
+ s3c240x_iic_t m_s3c240x_iic;
+ emu_timer *m_s3c240x_iic_timer;
+ UINT32 m_s3c240x_iic_regs[0x10/4];
+ s3c240x_iis_t m_s3c240x_iis;
+ emu_timer *m_s3c240x_iis_timer;
+ UINT32 m_s3c240x_iis_regs[0x14/4];
+ UINT32 m_s3c240x_rtc_regs[0x4C/4];
+ UINT32 m_s3c240x_adc_regs[0x08/4];
+ UINT32 m_s3c240x_spi_regs[0x18/4];
+ UINT32 m_s3c240x_mmc_regs[0x40/4];
+ bitmap_rgb32 m_bitmap;
+ DECLARE_READ32_MEMBER(s3c240x_lcd_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_lcd_w);
+ DECLARE_READ32_MEMBER(s3c240x_lcd_palette_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_lcd_palette_w);
+ DECLARE_READ32_MEMBER(s3c240x_clkpow_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_clkpow_w);
+ DECLARE_READ32_MEMBER(s3c240x_irq_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_irq_w);
+ DECLARE_READ32_MEMBER(s3c240x_pwm_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_pwm_w);
+ DECLARE_READ32_MEMBER(s3c240x_dma_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_dma_w);
+ DECLARE_READ32_MEMBER(s3c240x_gpio_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_gpio_w);
+ DECLARE_READ32_MEMBER(s3c240x_memcon_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_memcon_w);
+ DECLARE_READ32_MEMBER(s3c240x_usb_host_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_usb_host_w);
+ DECLARE_READ32_MEMBER(s3c240x_uart_0_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_uart_0_w);
+ DECLARE_READ32_MEMBER(s3c240x_uart_1_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_uart_1_w);
+ DECLARE_READ32_MEMBER(s3c240x_usb_device_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_usb_device_w);
+ DECLARE_READ32_MEMBER(s3c240x_watchdog_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_watchdog_w);
+ DECLARE_READ32_MEMBER(s3c240x_iic_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_iic_w);
+ DECLARE_READ32_MEMBER(s3c240x_iis_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_iis_w);
+ DECLARE_READ32_MEMBER(s3c240x_rtc_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_rtc_w);
+ DECLARE_READ32_MEMBER(s3c240x_adc_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_adc_w);
+ DECLARE_READ32_MEMBER(s3c240x_spi_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_spi_w);
+ DECLARE_READ32_MEMBER(s3c240x_mmc_r);
+ DECLARE_WRITE32_MEMBER(s3c240x_mmc_w);
+};
+
+
+#endif
diff --git a/src/mess/includes/hec2hrp.h b/src/mess/includes/hec2hrp.h
new file mode 100644
index 00000000000..54b6005fa3a
--- /dev/null
+++ b/src/mess/includes/hec2hrp.h
@@ -0,0 +1,180 @@
+/////////////////////////////////////////////////////////////////////
+////// HECTOR HEADER FILE /////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////
+/*
+ Hector 2HR+
+ Victor
+ Hector 2HR
+ Hector HRX
+ Hector MX40c
+ Hector MX80c
+ Hector 1
+ Interact
+
+ 12/05/2009 Skeleton driver - Micko : mmicko@gmail.com
+ 31/06/2009 Video - Robbbert
+
+ 29/10/2009 Update skeleton to functional machine
+ by yo_fr (jj.stac @ aliceadsl.fr)
+
+ => add Keyboard,
+ => add color,
+ => add cassette,
+ => add sn76477 sound and 1bit sound,
+ => add joysticks (stick, pot, fire)
+ => add BR/HR switching
+ => add bank switch for HRX
+ => add device MX80c and bank switching for the ROM
+ 03/01/2010 Update and clean prog by yo_fr (jj.stac@aliceadsl.fr)
+ => add the port mapping for keyboard
+ 20/11/2010 : synchronization between uPD765 and Z80 are now OK, CP/M runnig! JJStacino
+ 11/11/2011 : add the minidisque support -3 pouces 1/2 driver- JJStacino (jj.stac @ aliceadsl.fr)
+
+ don't forget to keep some information about these machine see DChector project : http://dchector.free.fr/ made by DanielCoulom
+ (and thank's to Daniel!) and Yves site : http://hectorvictor.free.fr/ (thank's too Yves!)
+
+ TODO : Add the cartridge function,
+ Adjust the one shot and A/D timing (sn76477)
+*/
+
+#include "machine/upd765.h"
+#include "machine/wd17xx.h"
+
+/* Enum status for high memory bank (c000 - ffff)*/
+enum
+{
+ HECTOR_BANK_PROG = 0, /* first BANK is program ram*/
+ HECTOR_BANK_VIDEO /* second BANK is Video ram */
+};
+/* Status for rom memory bank (0000 - 3fff) in MX machine*/
+enum
+{
+ HECTORMX_BANK_PAGE0 = 0, /* first BANK is base rom*/
+ HECTORMX_BANK_PAGE1, /* second BANK is basic rom */
+ HECTORMX_BANK_PAGE2 /* 3 BANK is monitrix / assemblex rom */
+};
+/* Status for rom memory bank (0000 - 3fff) in Mini Disc machine*/
+enum
+{
+ HECTOR_BANK_BASE = 0, /* first BANK is normal rom*/
+ HECTOR_BANK_DISC /* second BANK is extra rom for mini disc use*/
+};
+/* Enum status for low memory bank (00000 - 0fff) for DISC II*/
+enum
+{
+ DISCII_BANK_RAM = 0, /* first BANK is program ram*/
+ DISCII_BANK_ROM /* second BANK is ROM */
+};
+
+class hec2hrp_state : public driver_device
+{
+public:
+ hec2hrp_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_videoram(*this,"videoram"),
+ m_hector_videoram(*this,"hector_videoram") { }
+
+ optional_shared_ptr<UINT8> m_videoram;
+ optional_shared_ptr<UINT8> m_hector_videoram;
+ UINT8 m_hector_flag_hr;
+ UINT8 m_hector_flag_80c;
+ UINT8 m_hector_color[4];
+ UINT8 m_hector_disc2_data_r_ready;
+ UINT8 m_hector_disc2_data_w_ready;
+ UINT8 m_hector_disc2_data_read;
+ UINT8 m_hector_disc2_data_write;
+ UINT8 m_hector_disc2_RNMI;
+ UINT8 m_state3000;
+ UINT8 m_write_cassette;
+ emu_timer *m_Cassette_timer;
+ UINT8 m_CK_signal ;
+ UINT8 m_flag_clk;
+ double m_Pin_Value[29][2];
+ int m_AU[17];
+ int m_ValMixer;
+ int m_oldstate3000;
+ int m_oldstate1000;
+ UINT8 m_pot0;
+ UINT8 m_pot1;
+ UINT8 m_actions;
+ UINT8 m_hector_port_a;
+ UINT8 m_hector_port_b;
+ UINT8 m_hector_port_c_h;
+ UINT8 m_hector_port_c_l;
+ UINT8 m_hector_port_cmd;
+ UINT8 m_cassette_bit;
+ UINT8 m_cassette_bit_mem;
+ UINT8 m_Data_K7;
+ int m_counter_write;
+ emu_timer *m_DMA_timer;
+ emu_timer *m_INT_timer;
+ int m_NMI_current_state;
+ int m_hector_cmd[10];
+ int m_hector_nb_cde;
+ int m_hector_flag_result;
+ int m_print;
+ UINT8 m_hector_videoram_hrx[0x04000];
+ DECLARE_READ8_MEMBER(hector_179x_register_r);
+ DECLARE_WRITE8_MEMBER(hector_179x_register_w);
+ DECLARE_WRITE8_MEMBER(hector_switch_bank_w);
+ DECLARE_WRITE8_MEMBER(hector_keyboard_w);
+ DECLARE_READ8_MEMBER(hector_keyboard_r);
+ DECLARE_WRITE8_MEMBER(hector_sn_2000_w);
+ DECLARE_WRITE8_MEMBER(hector_sn_2800_w);
+ DECLARE_READ8_MEMBER(hector_cassette_r);
+ DECLARE_WRITE8_MEMBER(hector_sn_3000_w);
+ DECLARE_WRITE8_MEMBER(hector_color_a_w);
+ DECLARE_WRITE8_MEMBER(hector_color_b_w);
+ DECLARE_READ8_MEMBER(hector_io_8255_r);
+ DECLARE_WRITE8_MEMBER(hector_io_8255_w);
+ DECLARE_WRITE8_MEMBER(hector_mx40_io_port_w);
+ DECLARE_WRITE8_MEMBER(hector_mx80_io_port_w);
+};
+
+/*----------- defined in machine/hec2hrp.c -----------*/
+
+/* Protoype of memory Handler*/
+WRITE8_HANDLER( hector_switch_bank_rom_w );
+
+void hector_init( running_machine &machine);
+void hector_reset(running_machine &machine, int hr, int with_D2);
+void hector_disc2_reset( running_machine &machine);
+
+/* Prototype of I/O Handler*/
+READ8_HANDLER( hector_mx_io_port_r );
+/*----------- defined in video/hec2video.c -----------*/
+
+void hector_80c(running_machine &machine, bitmap_ind16 &bitmap, UINT8 *page, int ymax, int yram) ;
+void hector_hr(running_machine &machine, bitmap_ind16 &bitmap, UINT8 *page, int ymax, int yram) ;
+VIDEO_START( hec2hrp );
+SCREEN_UPDATE_IND16( hec2hrp );
+
+/* Sound function*/
+extern const sn76477_interface hector_sn76477_interface;
+
+/*----------- defined in machine/hecdisk2.c -----------*/
+
+// disc2 handling
+WRITE_LINE_DEVICE_HANDLER( hector_disk2_fdc_interrupt );
+READ8_HANDLER( hector_disc2_io00_port_r);
+WRITE8_HANDLER( hector_disc2_io00_port_w);
+READ8_HANDLER( hector_disc2_io20_port_r);
+WRITE8_HANDLER( hector_disc2_io20_port_w);
+READ8_HANDLER( hector_disc2_io30_port_r);
+WRITE8_HANDLER( hector_disc2_io30_port_w);
+READ8_HANDLER( hector_disc2_io40_port_r);
+WRITE8_HANDLER( hector_disc2_io40_port_w);
+READ8_HANDLER( hector_disc2_io50_port_r);
+WRITE8_HANDLER( hector_disc2_io50_port_w);
+READ8_HANDLER( hector_disc2_io61_port_r);
+WRITE8_HANDLER( hector_disc2_io61_port_w);
+READ8_HANDLER( hector_disc2_io70_port_r);
+WRITE8_HANDLER( hector_disc2_io70_port_w);
+
+void hector_disc2_init( running_machine &machine);
+void hector_minidisc_init( running_machine &machine);
+
+extern const upd765_interface hector_disc2_upd765_interface;
+extern const floppy_interface hector_disc2_floppy_interface;
+extern const wd17xx_interface hector_wd17xx_interface; // Special for minidisc
+extern const floppy_interface minidisc_floppy_interface;
diff --git a/src/mess/includes/hp48.h b/src/mess/includes/hp48.h
new file mode 100644
index 00000000000..7a35ae22678
--- /dev/null
+++ b/src/mess/includes/hp48.h
@@ -0,0 +1,195 @@
+/**********************************************************************
+
+ Copyright (C) Antoine Mine' 2008
+
+ Hewlett Packard HP48 S/SX & G/GX
+
+**********************************************************************/
+
+#ifdef CHARDEV
+#include "devices/chardev.h"
+#endif
+
+/* model */
+typedef enum {
+ HP48_S,
+ HP48_SX,
+ HP48_G,
+ HP48_GX,
+ HP48_GP,
+} hp48_models;
+
+/* memory module configuration */
+typedef struct
+{
+ /* static part */
+ UINT32 off_mask; /* offset bit-mask, indicates the real size */
+ read8_space_func read;
+ const char *read_name;
+ write8_space_func write;
+ const char *write_name;
+ void* data; /* non-NULL for banks */
+ int isnop;
+
+ /* configurable part */
+ UINT8 state; /* one of HP48_MODULE_ */
+ UINT32 base; /* base address */
+ UINT32 mask; /* often improperly called size, it is an address select mask */
+
+} hp48_module;
+
+
+/* screen image averaging */
+#define HP48_NB_SCREENS 3
+
+class hp48_state : public driver_device
+{
+public:
+ hp48_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 *m_videoram;
+ UINT8 m_io[64];
+ hp48_models m_model;
+ UINT16 m_out;
+ UINT8 m_kdn;
+ hp48_module m_modules[6];
+ UINT32 m_port_size[2];
+ UINT8 m_port_write[2];
+ UINT8* m_port_data[2];
+ UINT32 m_bank_switch;
+ UINT32 m_io_addr;
+ UINT16 m_crc;
+ UINT8 m_timer1;
+ UINT32 m_timer2;
+#ifdef CHARDEV
+ chardev* m_chardev;
+#endif
+ UINT8 m_screens[ HP48_NB_SCREENS ][ 64 ][ 144 ];
+ int m_cur_screen;
+ DECLARE_DRIVER_INIT(hp48);
+};
+
+
+/***************************************************************************
+ MACROS
+***************************************************************************/
+
+/* read from I/O memory */
+#define HP48_IO_4(x) (state->m_io[(x)])
+#define HP48_IO_8(x) (state->m_io[(x)] | (state->m_io[(x)+1] << 4))
+#define HP48_IO_12(x) (state->m_io[(x)] | (state->m_io[(x)+1] << 4) | (state->m_io[(x)+2] << 8))
+#define HP48_IO_20(x) (state->m_io[(x)] | (state->m_io[(x)+1] << 4) | (state->m_io[(x)+2] << 8) | \
+ (state->m_io[(x)+3] << 12) | (state->m_io[(x)+4] << 16))
+
+
+/*----------- defined in machine/hp48.c -----------*/
+
+/***************************************************************************
+ GLOBAL VARIABLES & CONSTANTS
+***************************************************************************/
+
+/* I/O memory */
+
+
+
+/***************************************************************************
+ FUNCTION PROTOTYPES
+***************************************************************************/
+
+
+/************************ Saturn's I/O *******************************/
+
+/* memory controller */
+void hp48_mem_reset( device_t *device );
+void hp48_mem_config( device_t *device, int v );
+void hp48_mem_unconfig( device_t *device, int v );
+int hp48_mem_id( device_t *device );
+
+/* CRC computation */
+void hp48_mem_crc( device_t *device, int addr, int data );
+
+/* IN/OUT registers */
+int hp48_reg_in( device_t *device );
+void hp48_reg_out( device_t *device, int v );
+
+/* keybord interrupt system */
+void hp48_rsi( device_t *device );
+
+
+/***************************** serial ********************************/
+
+extern void hp48_rs232_start_recv_byte( running_machine &machine, UINT8 data );
+
+
+/****************************** cards ********************************/
+
+/* port specification */
+struct hp48_port_interface
+{
+ int port; /* port index: 0 or 1 (for port 1 and 2) */
+ int module; /* memory module where the port is visible */
+ int max_size; /* maximum size, in bytes 128 KB or 4 GB */
+};
+
+class hp48_port_image_device : public device_t,
+ public device_image_interface,
+ public hp48_port_interface
+{
+public:
+ // construction/destruction
+ hp48_port_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // image-level overrides
+ virtual iodevice_t image_type() const { return IO_MEMCARD; }
+
+ virtual bool is_readable() const { return 1; }
+ virtual bool is_writeable() const { return 1; }
+ virtual bool is_creatable() const { return 1; }
+ virtual bool must_be_loaded() const { return 0; }
+ virtual bool is_reset_on_load() const { return 0; }
+ virtual const char *image_interface() const { return NULL; }
+ virtual const char *file_extensions() const { return "crd"; }
+ virtual const option_guide *create_option_guide() const { return NULL; }
+
+ virtual bool call_load();
+ virtual void call_unload();
+ virtual bool call_create(int format_type, option_resolution *format_options);
+protected:
+ // device-level overrides
+ virtual void device_config_complete();
+ virtual void device_start();
+private:
+ void hp48_fill_port();
+ void hp48_unfill_port();
+};
+
+extern const struct hp48_port_interface hp48sx_port1_config;
+extern const struct hp48_port_interface hp48sx_port2_config;
+extern const struct hp48_port_interface hp48gx_port1_config;
+extern const struct hp48_port_interface hp48gx_port2_config;
+
+// device type definition
+extern const device_type HP48_PORT;
+
+#define MCFG_HP48_PORT_ADD(_tag, _intrf) \
+ MCFG_DEVICE_ADD(_tag, HP48_PORT, 0) \
+ MCFG_DEVICE_CONFIG(_intrf)
+
+/****************************** machine ******************************/
+
+
+extern MACHINE_START( hp48s );
+extern MACHINE_START( hp48sx );
+extern MACHINE_START( hp48g );
+extern MACHINE_START( hp48gx );
+extern MACHINE_START( hp48gp );
+
+extern MACHINE_RESET( hp48 );
+
+/*----------- defined in video/hp48.c -----------*/
+
+/****************************** video ********************************/
+
+extern SCREEN_UPDATE_IND16 ( hp48 );
+extern PALETTE_INIT ( hp48 );
diff --git a/src/mess/includes/huebler.h b/src/mess/includes/huebler.h
new file mode 100644
index 00000000000..1ea6b69586d
--- /dev/null
+++ b/src/mess/includes/huebler.h
@@ -0,0 +1,49 @@
+#ifndef __HUEBLER__
+#define __HUEBLER__
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define Z80CTC_TAG "z80ctc"
+#define Z80SIO_TAG "z80sio"
+#define Z80PIO1_TAG "z80pio1"
+#define Z80PIO2_TAG "z80pio2"
+
+#include "imagedev/cassette.h"
+
+class amu880_state : public driver_device
+{
+public:
+ amu880_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_cassette(*this, CASSETTE_TAG),
+ m_key_d6(0),
+ m_key_d7(0),
+ m_key_a8(1)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( keyboard_r );
+
+ void scan_keyboard();
+
+ // keyboard state
+ const UINT8 *m_kb_rom;
+ int m_key_d6;
+ int m_key_d7;
+ int m_key_a4;
+ int m_key_a5;
+ int m_key_a8;
+
+ // video state
+ required_shared_ptr<UINT8> m_video_ram;
+ const UINT8 *m_char_rom;
+};
+
+#endif
diff --git a/src/mess/includes/intv.h b/src/mess/includes/intv.h
new file mode 100644
index 00000000000..2976d347f21
--- /dev/null
+++ b/src/mess/includes/intv.h
@@ -0,0 +1,156 @@
+/*****************************************************************************
+ *
+ * includes/intv.h
+ *
+ ****************************************************************************/
+
+#ifndef INTV_H_
+#define INTV_H_
+
+typedef struct
+{
+ int visible;
+ int xpos;
+ int ypos;
+ int coll;
+ int collision;
+ int doublex;
+ int doubley;
+ int quady;
+ int xflip;
+ int yflip;
+ int behind_foreground;
+ int grom;
+ int card;
+ int color;
+ int doubleyres;
+ int dirty;
+} intv_sprite_type;
+
+class intv_state : public driver_device
+{
+public:
+ intv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_intellivoice(*this, "sp0256_speech"),
+ m_sound(*this, "ay8914.1"),
+ m_ecs_sound(*this, "ay8914.2"),
+ m_intvkbd_dualport_ram(*this, "dualport_ram"),
+ m_videoram(*this, "videoram")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_intellivoice;
+ required_device<device_t> m_sound;
+ optional_device<device_t> m_ecs_sound;
+ optional_shared_ptr<UINT16> m_intvkbd_dualport_ram;
+ optional_shared_ptr<UINT8> m_videoram;
+
+
+ DECLARE_READ16_MEMBER(intv_stic_r);
+ DECLARE_WRITE16_MEMBER(intv_stic_w);
+ DECLARE_READ16_MEMBER(intv_gram_r);
+ DECLARE_WRITE16_MEMBER(intv_gram_w);
+ DECLARE_READ16_MEMBER(intv_ram8_r);
+ DECLARE_WRITE16_MEMBER(intv_ram8_w);
+ DECLARE_READ16_MEMBER(intv_ram16_r);
+ DECLARE_WRITE16_MEMBER(intv_ram16_w);
+
+ DECLARE_READ16_MEMBER(intv_cart_ram8_r);
+ DECLARE_WRITE16_MEMBER(intv_cart_ram8_w);
+
+ DECLARE_READ8_MEMBER( intv_right_control_r );
+ DECLARE_READ8_MEMBER( intv_left_control_r );
+
+ bitmap_ind16 m_bitmap;
+
+ intv_sprite_type m_sprite[STIC_MOBS];
+ UINT8 m_sprite_buffers[STIC_MOBS][STIC_CARD_WIDTH*2][STIC_CARD_HEIGHT*4*2*2];
+ UINT16 m_backtab_buffer[STIC_BACKTAB_HEIGHT][STIC_BACKTAB_WIDTH];
+ UINT8 m_backtab_row;
+ UINT8 m_bus_copy_mode;
+ int m_color_stack_mode;
+ int m_stic_registers[STIC_REGISTERS];
+ int m_color_stack_offset;
+ int m_stic_handshake;
+ int m_border_color;
+ int m_col_delay;
+ int m_row_delay;
+ int m_left_edge_inhibit;
+ int m_top_edge_inhibit;
+ UINT8 m_gramdirty;
+ UINT8 m_gram[512];
+ UINT8 m_gramdirtybytes[512];
+ UINT16 m_ram16[0x160];
+ int m_x_scale;
+ int m_y_scale;
+ int m_sr1_int_pending;
+ UINT8 m_ram8[256];
+ UINT8 m_cart_ram8[2048];
+
+ // ecs
+ DECLARE_WRITE16_MEMBER(ecs_bank1_page_select);
+ DECLARE_WRITE16_MEMBER(ecs_bank2_page_select);
+ DECLARE_WRITE16_MEMBER(ecs_bank3_page_select);
+ DECLARE_WRITE16_MEMBER(wsmlb_bank_page_select);
+ DECLARE_READ16_MEMBER(intv_ecs_ram8_r);
+ DECLARE_WRITE16_MEMBER(intv_ecs_ram8_w);
+
+ DECLARE_READ8_MEMBER( intv_ecs_porta_r );
+ DECLARE_WRITE8_MEMBER( intv_ecs_porta_w );
+ DECLARE_READ8_MEMBER( intv_ecs_portb_r );
+
+ UINT8 m_ecs_ram8[2048];
+ UINT8 m_ecs_psg_porta;
+
+ // Keyboard Component
+ DECLARE_READ8_MEMBER(intvkbd_tms9927_r);
+ DECLARE_WRITE8_MEMBER(intvkbd_tms9927_w);
+ DECLARE_WRITE16_MEMBER( intvkbd_dualport16_w );
+ DECLARE_READ8_MEMBER( intvkbd_dualport8_lsb_r );
+ DECLARE_WRITE8_MEMBER( intvkbd_dualport8_lsb_w );
+ DECLARE_READ8_MEMBER( intvkbd_dualport8_msb_r );
+ DECLARE_WRITE8_MEMBER( intvkbd_dualport8_msb_w );
+
+ UINT8 m_tms9927_num_rows;
+ UINT8 m_tms9927_cursor_col;
+ UINT8 m_tms9927_cursor_row;
+ UINT8 m_tms9927_last_row;
+
+ int m_intvkbd_text_blanked;
+ int m_intvkbd_keyboard_col;
+ int m_tape_int_pending;
+ int m_tape_interrupts_enabled;
+ int m_tape_unknown_write[6];
+ int m_tape_motor_mode;
+ DECLARE_DRIVER_INIT(intvkbd);
+ DECLARE_DRIVER_INIT(intv);
+};
+
+/*----------- defined in video/intv.c -----------*/
+
+extern VIDEO_START( intv );
+extern SCREEN_UPDATE_IND16( intv );
+extern SCREEN_UPDATE_IND16( intvkbd );
+
+void intv_stic_screenrefresh(running_machine &machine);
+
+/*----------- defined in machine/intv.c -----------*/
+
+/* for the console alone... */
+
+DEVICE_START( intv_cart );
+DEVICE_IMAGE_LOAD( intv_cart );
+
+extern MACHINE_RESET( intv );
+extern INTERRUPT_GEN( intv_interrupt );
+
+// ECS
+extern MACHINE_RESET( intvecs );
+
+/* for the console + keyboard component... */
+
+DEVICE_IMAGE_LOAD( intvkbd_cart );
+
+#endif /* INTV_H_ */
diff --git a/src/mess/includes/irisha.h b/src/mess/includes/irisha.h
new file mode 100644
index 00000000000..a39228ccd92
--- /dev/null
+++ b/src/mess/includes/irisha.h
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ *
+ * includes/irisha.h
+ *
+ ****************************************************************************/
+
+#ifndef IRISHA_H_
+#define IRISHA_H_
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/i8251.h"
+#include "sound/speaker.h"
+
+class irisha_state : public driver_device
+{
+public:
+ irisha_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_pit(*this, "pit8253"),
+ m_speaker(*this, SPEAKER_TAG)
+ { }
+
+ required_device<device_t> m_pit;
+ required_device<device_t> m_speaker;
+
+ int m_keyboard_mask;
+ UINT8 m_keypressed;
+ UINT8 m_keyboard_cnt;
+ UINT8 m_ppi_porta;
+ UINT8 m_ppi_portc;
+ int m_sg1_line;
+ DECLARE_READ8_MEMBER(irisha_keyboard_r);
+ DECLARE_READ8_MEMBER(irisha_8255_portb_r);
+ DECLARE_READ8_MEMBER(irisha_8255_portc_r);
+ DECLARE_WRITE8_MEMBER(irisha_8255_porta_w);
+ DECLARE_WRITE8_MEMBER(irisha_8255_portb_w);
+ DECLARE_WRITE8_MEMBER(irisha_8255_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(speaker_w);
+ void update_speaker();
+
+ DECLARE_DRIVER_INIT(irisha);
+};
+
+
+/*----------- defined in machine/irisha.c -----------*/
+
+extern MACHINE_START( irisha );
+extern MACHINE_RESET( irisha );
+extern const i8255_interface irisha_ppi8255_interface;
+extern const struct pit8253_config irisha_pit8253_intf;
+extern const struct pic8259_interface irisha_pic8259_config;
+
+
+
+/*----------- defined in video/irisha.c -----------*/
+
+extern VIDEO_START( irisha );
+extern SCREEN_UPDATE_IND16( irisha );
+
+#endif /* IRISHA_H_ */
diff --git a/src/mess/includes/jtc.h b/src/mess/includes/jtc.h
new file mode 100644
index 00000000000..9f454aed8c6
--- /dev/null
+++ b/src/mess/includes/jtc.h
@@ -0,0 +1,88 @@
+#pragma once
+
+#ifndef __JTC__
+#define __JTC__
+
+
+#include "emu.h"
+#include "cpu/z8/z8.h"
+#include "imagedev/cassette.h"
+#include "machine/ctronics.h"
+#include "machine/ram.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+
+#define SCREEN_TAG "screen"
+#define UB8830D_TAG "ub8830d"
+#define CENTRONICS_TAG "centronics"
+
+#define JTC_ES40_VIDEORAM_SIZE 0x2000
+
+class jtc_state : public driver_device
+{
+public:
+ jtc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, UB8830D_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cassette;
+ required_device<device_t> m_speaker;
+ required_device<centronics_device> m_centronics;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( p2_w );
+ DECLARE_READ8_MEMBER( p3_r );
+ DECLARE_WRITE8_MEMBER( p3_w );
+
+ optional_shared_ptr<UINT8> m_video_ram;
+};
+
+class jtces88_state : public jtc_state
+{
+public:
+ jtces88_state(const machine_config &mconfig, device_type type, const char *tag)
+ : jtc_state(mconfig, type, tag)
+ { }
+};
+
+class jtces23_state : public jtc_state
+{
+public:
+ jtces23_state(const machine_config &mconfig, device_type type, const char *tag)
+ : jtc_state(mconfig, type, tag)
+ { }
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+};
+
+class jtces40_state : public jtc_state
+{
+public:
+ jtces40_state(const machine_config &mconfig, device_type type, const char *tag)
+ : jtc_state(mconfig, type, tag)
+ { }
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( videoram_r );
+ DECLARE_WRITE8_MEMBER( videoram_w );
+ DECLARE_WRITE8_MEMBER( banksel_w );
+
+ UINT8 m_video_bank;
+ UINT8 *m_color_ram_r;
+ UINT8 *m_color_ram_g;
+ UINT8 *m_color_ram_b;
+};
+
+#endif
diff --git a/src/mess/includes/jupiter.h b/src/mess/includes/jupiter.h
new file mode 100644
index 00000000000..87bd5f5f52d
--- /dev/null
+++ b/src/mess/includes/jupiter.h
@@ -0,0 +1,57 @@
+#pragma once
+
+#ifndef __JUPITER__
+#define __JUPITER__
+
+#define MCM6571AP_TAG "vid125_6c"
+#define S6820_TAG "vid125_4a"
+#define Z80_TAG "cpu126_4c"
+#define INS1771N1_TAG "fdi027_4c"
+#define MC6820P_TAG "fdi027_4b"
+#define MC6850P_TAG "rsi068_6a"
+#define MC6821P_TAG "sdm058_4b"
+
+class jupiter2_state : public driver_device
+{
+public:
+ jupiter2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, MCM6571AP_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+
+ virtual void machine_start();
+ DECLARE_DRIVER_INIT(jupiter);
+};
+
+class jupiter3_state : public driver_device
+{
+public:
+ jupiter3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_p_videoram(*this, "p_videoram"),
+ m_p_ram(*this, "p_ram")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+
+ DECLARE_WRITE8_MEMBER(kbd_put);
+ DECLARE_READ8_MEMBER(status_r);
+ DECLARE_READ8_MEMBER(key_r);
+ DECLARE_READ8_MEMBER(ff_r);
+ UINT8 m_term_data;
+
+ required_shared_ptr<UINT8> m_p_videoram;
+ required_shared_ptr<UINT8> m_p_ram;
+ const UINT8 *m_p_chargen;
+
+ virtual void machine_reset();
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_DRIVER_INIT(jupiter3);
+};
+
+#endif
diff --git a/src/mess/includes/kaypro.h b/src/mess/includes/kaypro.h
new file mode 100644
index 00000000000..3252a5ad150
--- /dev/null
+++ b/src/mess/includes/kaypro.h
@@ -0,0 +1,109 @@
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80pio.h"
+#include "machine/z80sio.h"
+#include "machine/com8116.h"
+#include "machine/ctronics.h"
+#include "machine/wd17xx.h"
+#include "formats/basicdsk.h"
+#include "imagedev/snapquik.h"
+#include "imagedev/flopdrv.h"
+#include "sound/beep.h"
+#include "video/mc6845.h"
+
+
+class kaypro_state : public driver_device
+{
+public:
+ kaypro_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pio_g(*this, "z80pio_g"),
+ m_pio_s(*this, "z80pio_s"),
+ m_sio(*this, "z80sio"),
+ m_sio2x(*this, "z80sio_2x"),
+ m_centronics(*this, "centronics"),
+ m_fdc(*this, "wd1793"),
+ m_crtc(*this, "crtc"),
+ m_beep(*this, BEEPER_TAG),
+ m_p_videoram(*this, "p_videoram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<z80pio_device> m_pio_g;
+ optional_device<z80pio_device> m_pio_s;
+ required_device<z80sio_device> m_sio;
+ optional_device<z80sio_device> m_sio2x;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_fdc;
+ optional_device<mc6845_device> m_crtc;
+ required_device<device_t> m_beep;
+ DECLARE_READ8_MEMBER(kaypro2x_87_r);
+ DECLARE_READ8_MEMBER(kaypro2x_system_port_r);
+ DECLARE_READ8_MEMBER(kaypro2x_status_r);
+ DECLARE_READ8_MEMBER(kaypro2x_videoram_r);
+ DECLARE_WRITE8_MEMBER(kaypro2x_system_port_w);
+ DECLARE_WRITE8_MEMBER(kaypro2x_index_w);
+ DECLARE_WRITE8_MEMBER(kaypro2x_register_w);
+ DECLARE_WRITE8_MEMBER(kaypro2x_videoram_w);
+ DECLARE_READ8_MEMBER(pio_system_r);
+ DECLARE_WRITE8_MEMBER(common_pio_system_w);
+ DECLARE_WRITE8_MEMBER(kayproii_pio_system_w);
+ DECLARE_WRITE8_MEMBER(kaypro4_pio_system_w);
+ DECLARE_WRITE_LINE_MEMBER(kaypro_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(kaypro_fdc_drq_w);
+ DECLARE_READ8_MEMBER(kaypro_videoram_r);
+ DECLARE_WRITE8_MEMBER(kaypro_videoram_w);
+ const UINT8 *m_p_chargen;
+ required_shared_ptr<UINT8> m_p_videoram;
+ UINT8 m_system_port;
+ UINT8 m_mc6845_cursor[16];
+ UINT8 m_mc6845_reg[32];
+ UINT8 m_mc6845_ind;
+ UINT8 m_speed;
+ UINT8 m_flash;
+ UINT8 m_framecnt;
+ UINT16 m_cursor;
+ UINT16 m_mc6845_video_address;
+ struct _kay_kbd_t *m_kbd;
+ void mc6845_cursor_configure();
+ void mc6845_screen_configure();
+};
+
+
+/*----------- defined in machine/kay_kbd.c -----------*/
+
+UINT8 kay_kbd_c_r( running_machine &machine );
+UINT8 kay_kbd_d_r( running_machine &machine );
+void kay_kbd_d_w( running_machine &machine, UINT8 data );
+INTERRUPT_GEN( kay_kbd_interrupt );
+MACHINE_RESET( kay_kbd );
+INPUT_PORTS_EXTERN( kay_kbd );
+
+
+/*----------- defined in machine/kaypro.c -----------*/
+
+extern const z80pio_interface kayproii_pio_g_intf;
+extern const z80pio_interface kayproii_pio_s_intf;
+extern const z80pio_interface kaypro4_pio_s_intf;
+extern const z80sio_interface kaypro_sio_intf;
+extern const wd17xx_interface kaypro_wd1793_interface;
+
+READ8_DEVICE_HANDLER( kaypro_sio_r );
+WRITE8_DEVICE_HANDLER( kaypro_sio_w );
+
+MACHINE_RESET( kayproii );
+MACHINE_START( kayproii );
+MACHINE_RESET( kaypro2x );
+
+QUICKLOAD_LOAD( kayproii );
+QUICKLOAD_LOAD( kaypro2x );
+
+/*----------- defined in video/kaypro.c -----------*/
+
+MC6845_UPDATE_ROW( kaypro2x_update_row );
+PALETTE_INIT( kaypro );
+VIDEO_START( kaypro );
+SCREEN_UPDATE_IND16( kayproii );
+SCREEN_UPDATE_IND16( omni2 );
+SCREEN_UPDATE_RGB32( kaypro2x );
diff --git a/src/mess/includes/kc.h b/src/mess/includes/kc.h
new file mode 100644
index 00000000000..66f7177bfaa
--- /dev/null
+++ b/src/mess/includes/kc.h
@@ -0,0 +1,191 @@
+/*****************************************************************************
+ *
+ * includes/kc.h
+ *
+ ****************************************************************************/
+
+#ifndef KC_H_
+#define KC_H_
+
+/* Devices */
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+
+// Components
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80ctc.h"
+#include "machine/z80pio.h"
+#include "machine/ram.h"
+#include "machine/kc_keyb.h"
+#include "machine/rescap.h"
+#include "cpu/z80/z80daisy.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+
+// Devices
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+
+// Formats
+#include "formats/kc_cas.h"
+
+// Expansions
+#include "machine/kcexp.h"
+#include "machine/kc_ram.h"
+#include "machine/kc_rom.h"
+#include "machine/kc_d002.h"
+#include "machine/kc_d004.h"
+
+// from service manual
+#define KC85_3_CLOCK 1751938
+#define KC85_4_CLOCK 1773447
+
+#define KC85_4_SCREEN_PIXEL_RAM_SIZE 0x04000
+#define KC85_4_SCREEN_COLOUR_RAM_SIZE 0x04000
+
+#define KC85_PALETTE_SIZE 24
+#define KC85_SCREEN_WIDTH 320
+#define KC85_SCREEN_HEIGHT 256
+
+// cassette input polling frequency
+#define KC_CASSETTE_TIMER_FREQUENCY attotime::from_hz(44100)
+
+
+class kc_state : public driver_device
+{
+public:
+ kc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_z80pio(*this, "z80pio"),
+ m_z80ctc(*this, "z80ctc"),
+ m_ram(*this, RAM_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_z80pio;
+ required_device<z80ctc_device> m_z80ctc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_speaker;
+ required_device<cassette_image_device> m_cassette;
+
+ // defined in machine/kc.c
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ // modules read/write
+ DECLARE_READ8_MEMBER ( expansion_read );
+ DECLARE_WRITE8_MEMBER( expansion_write );
+ DECLARE_READ8_MEMBER ( expansion_4000_r );
+ DECLARE_WRITE8_MEMBER( expansion_4000_w );
+ DECLARE_READ8_MEMBER ( expansion_8000_r );
+ DECLARE_WRITE8_MEMBER( expansion_8000_w );
+ DECLARE_READ8_MEMBER ( expansion_c000_r );
+ DECLARE_WRITE8_MEMBER( expansion_c000_w );
+ DECLARE_READ8_MEMBER ( expansion_e000_r );
+ DECLARE_WRITE8_MEMBER( expansion_e000_w );
+ DECLARE_READ8_MEMBER ( expansion_io_read );
+ DECLARE_WRITE8_MEMBER( expansion_io_write );
+
+ // bankswitch
+ virtual void update_0x00000();
+ virtual void update_0x04000();
+ virtual void update_0x08000();
+ virtual void update_0x0c000();
+ virtual void update_0x0e000();
+
+ // PIO callback
+ DECLARE_READ8_MEMBER( pio_porta_r );
+ DECLARE_READ8_MEMBER( pio_portb_r );
+ DECLARE_WRITE_LINE_MEMBER( pio_ardy_cb);
+ DECLARE_WRITE_LINE_MEMBER( pio_brdy_cb);
+ DECLARE_WRITE8_MEMBER( pio_porta_w );
+ DECLARE_WRITE8_MEMBER( pio_portb_w );
+
+ // CTC callback
+ DECLARE_WRITE_LINE_MEMBER( ctc_zc0_callback );
+ DECLARE_WRITE_LINE_MEMBER( ctc_zc1_callback );
+ DECLARE_WRITE_LINE_MEMBER( ctc_zc2_callback );
+
+ // keyboard
+ DECLARE_WRITE_LINE_MEMBER( keyboard_cb );
+
+ // cassette
+ void update_cassette(int state);
+ void cassette_set_motor(int motor_state);
+
+ // speaker
+ void speaker_update();
+
+ // defined in video/kc.c
+ virtual void video_start();
+ virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER( video_toggle_blink_state );
+ void video_draw_8_pixels(bitmap_ind16 &bitmap, int x, int y, UINT8 colour_byte, UINT8 gfx_byte);
+
+ // driver state
+ UINT8 * m_ram_base;
+ UINT8 * m_video_ram;
+ int m_pio_data[2];
+ int m_high_resolution;
+ UINT8 m_ardy;
+ UINT8 m_brdy;
+ int m_kc85_blink_state;
+ int m_k0_line;
+ int m_k1_line;
+ UINT8 m_speaker_level;
+
+ // cassette
+ emu_timer * m_cassette_timer;
+ emu_timer * m_cassette_oneshot_timer;
+ int m_astb;
+ int m_cassette_in;
+
+ kcexp_slot_device * m_expansions[3];
+};
+
+
+class kc85_4_state : public kc_state
+{
+public:
+ kc85_4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kc_state(mconfig, type, tag)
+ { }
+
+ // defined in machine/kc.c
+ virtual void machine_reset();
+
+ virtual void update_0x04000();
+ virtual void update_0x08000();
+ virtual void update_0x0c000();
+
+ DECLARE_READ8_MEMBER( kc85_4_86_r );
+ DECLARE_READ8_MEMBER( kc85_4_84_r );
+ DECLARE_WRITE8_MEMBER( kc85_4_86_w );
+ DECLARE_WRITE8_MEMBER( kc85_4_84_w );
+
+ // defined in video/kc.c
+ virtual void video_start();
+ virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ void video_control_w(int data);
+
+ // driver state
+ UINT8 m_port_84_data;
+ UINT8 m_port_86_data;
+ UINT8 * m_display_video_ram;
+};
+
+
+/*----------- defined in video/kc.c -----------*/
+
+extern PALETTE_INIT( kc85 );
+
+/*----------- defined in machine/kc.c -----------*/
+
+QUICKLOAD_LOAD( kc );
+TIMER_DEVICE_CALLBACK( kc_scanline );
+
+#endif /* KC_H_ */
diff --git a/src/mess/includes/kramermc.h b/src/mess/includes/kramermc.h
new file mode 100644
index 00000000000..2d3dffefa59
--- /dev/null
+++ b/src/mess/includes/kramermc.h
@@ -0,0 +1,37 @@
+/*****************************************************************************
+ *
+ * includes/kramermc.h
+ *
+ ****************************************************************************/
+
+#ifndef KRAMERMC_H_
+#define KRAMERMC_H_
+
+#include "machine/z80pio.h"
+
+class kramermc_state : public driver_device
+{
+public:
+ kramermc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_key_row;
+ DECLARE_DRIVER_INIT(kramermc);
+};
+
+
+/*----------- defined in machine/kramermc.c -----------*/
+
+MACHINE_RESET( kramermc );
+
+extern const z80pio_interface kramermc_z80pio_intf;
+
+/*----------- defined in video/kramermc.c -----------*/
+
+extern const gfx_layout kramermc_charlayout;
+
+VIDEO_START( kramermc );
+SCREEN_UPDATE_IND16( kramermc );
+
+
+#endif /* KRAMERMC_h_ */
diff --git a/src/mess/includes/kyocera.h b/src/mess/includes/kyocera.h
new file mode 100644
index 00000000000..1333a56a945
--- /dev/null
+++ b/src/mess/includes/kyocera.h
@@ -0,0 +1,208 @@
+#pragma once
+
+#ifndef __KYOCERA__
+#define __KYOCERA__
+
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "machine/ctronics.h"
+#include "machine/i8155.h"
+#include "machine/i8251.h"
+#include "machine/im6402.h"
+#include "machine/ram.h"
+#include "machine/rp5c01.h"
+#include "machine/upd1990a.h"
+#include "video/hd44102.h"
+#include "video/hd61830.h"
+#include "sound/speaker.h"
+#include "rendlay.h"
+
+#define SCREEN_TAG "screen"
+#define I8085_TAG "m19"
+#define I8155_TAG "m25"
+#define UPD1990A_TAG "m18"
+#define IM6402_TAG "m22"
+#define MC14412_TAG "m31"
+#define HD44102_0_TAG "m1"
+#define HD44102_1_TAG "m2"
+#define HD44102_2_TAG "m3"
+#define HD44102_3_TAG "m4"
+#define HD44102_4_TAG "m5"
+#define HD44102_5_TAG "m6"
+#define HD44102_6_TAG "m7"
+#define HD44102_7_TAG "m8"
+#define HD44102_8_TAG "m9"
+#define HD44102_9_TAG "m10"
+#define CENTRONICS_TAG "centronics"
+
+//#define I8085_TAG "m19"
+//#define I8155_TAG "m12"
+//#define MC14412_TAG "m8"
+#define RP5C01A_TAG "m301"
+#define TCM5089_TAG "m11"
+#define I8251_TAG "m20"
+#define HD61830_TAG "m18"
+
+class kc85_state : public driver_device
+{
+public:
+ kc85_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8085_TAG),
+ m_rtc(*this, UPD1990A_TAG),
+ m_uart(*this, IM6402_TAG),
+ m_lcdc0(*this, HD44102_0_TAG),
+ m_lcdc1(*this, HD44102_1_TAG),
+ m_lcdc2(*this, HD44102_2_TAG),
+ m_lcdc3(*this, HD44102_3_TAG),
+ m_lcdc4(*this, HD44102_4_TAG),
+ m_lcdc5(*this, HD44102_5_TAG),
+ m_lcdc6(*this, HD44102_6_TAG),
+ m_lcdc7(*this, HD44102_7_TAG),
+ m_lcdc8(*this, HD44102_8_TAG),
+ m_lcdc9(*this, HD44102_9_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<upd1990a_device> m_rtc;
+ optional_device<im6402_device> m_uart;
+ required_device<hd44102_device> m_lcdc0;
+ required_device<hd44102_device> m_lcdc1;
+ required_device<hd44102_device> m_lcdc2;
+ required_device<hd44102_device> m_lcdc3;
+ required_device<hd44102_device> m_lcdc4;
+ required_device<hd44102_device> m_lcdc5;
+ required_device<hd44102_device> m_lcdc6;
+ required_device<hd44102_device> m_lcdc7;
+ required_device<hd44102_device> m_lcdc8;
+ required_device<hd44102_device> m_lcdc9;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_speaker;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( uart_status_r );
+ DECLARE_WRITE8_MEMBER( uart_ctrl_w );
+ DECLARE_WRITE8_MEMBER( modem_w );
+ DECLARE_WRITE8_MEMBER( ctrl_w );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_READ8_MEMBER( lcd_r );
+ DECLARE_WRITE8_MEMBER( lcd_w );
+ DECLARE_WRITE8_MEMBER( i8155_pa_w );
+ DECLARE_WRITE8_MEMBER( i8155_pb_w );
+ DECLARE_READ8_MEMBER( i8155_pc_r );
+ DECLARE_WRITE_LINE_MEMBER( i8155_to_w );
+
+ /* memory state */
+ UINT8 m_bank; /* memory bank selection */
+
+ /* keyboard state */
+ UINT16 m_keylatch; /* keyboard latch */
+
+ /* sound state */
+ int m_buzzer; /* buzzer select */
+ int m_bell; /* bell output */
+};
+
+class trsm100_state : public kc85_state
+{
+public:
+ trsm100_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kc85_state(mconfig, type, tag) { }
+
+ virtual void machine_start();
+};
+
+class pc8201_state : public kc85_state
+{
+public:
+ pc8201_state(const machine_config &mconfig, device_type type, const char *tag)
+ : kc85_state(mconfig, type, tag) { }
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( bank_r );
+ DECLARE_WRITE8_MEMBER( bank_w );
+ DECLARE_WRITE8_MEMBER( scp_w );
+ DECLARE_READ8_MEMBER( uart_status_r );
+ DECLARE_WRITE8_MEMBER( romah_w );
+ DECLARE_WRITE8_MEMBER( romal_w );
+ DECLARE_WRITE8_MEMBER( romam_w );
+ DECLARE_READ8_MEMBER( romrd_r );
+
+ void bankswitch(UINT8 data);
+
+ // ROM cassette
+ int m_rom_sel;
+ UINT32 m_rom_addr;
+
+ /* peripheral state */
+ int m_iosel; /* serial interface select */
+};
+
+class tandy200_state : public driver_device
+{
+public:
+ tandy200_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8085_TAG),
+ m_rtc(*this, RP5C01A_TAG),
+ m_lcdc(*this, HD61830_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<rp5c01_device> m_rtc;
+ required_device<hd61830_device> m_lcdc;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_speaker;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( bank_r );
+ DECLARE_WRITE8_MEMBER( bank_w );
+ DECLARE_READ8_MEMBER( stbk_r );
+ DECLARE_WRITE8_MEMBER( stbk_w );
+ DECLARE_WRITE8_MEMBER( i8155_pa_w );
+ DECLARE_WRITE8_MEMBER( i8155_pb_w );
+ DECLARE_READ8_MEMBER( i8155_pc_r );
+ DECLARE_WRITE_LINE_MEMBER( i8155_to_w );
+
+ void bankswitch(UINT8 data);
+
+ /* memory state */
+ UINT8 m_bank; /* memory bank selection */
+
+ /* keyboard state */
+ UINT16 m_keylatch; /* keyboard latch */
+ int m_tp; /* timing pulse */
+
+ /* sound state */
+ int m_buzzer; /* buzzer select */
+ int m_bell; /* bell output */
+};
+
+/* ---------- defined in video/kyocera.c ---------- */
+
+MACHINE_CONFIG_EXTERN( kc85_video );
+MACHINE_CONFIG_EXTERN( tandy200_video );
+
+#endif
diff --git a/src/mess/includes/lc80.h b/src/mess/includes/lc80.h
new file mode 100644
index 00000000000..7c06aa7e52f
--- /dev/null
+++ b/src/mess/includes/lc80.h
@@ -0,0 +1,58 @@
+#ifndef __LC80__
+#define __LC80__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+#include "machine/z80pio.h"
+#include "machine/z80ctc.h"
+#include "sound/speaker.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "d201"
+#define Z80CTC_TAG "d208"
+#define Z80PIO1_TAG "d206"
+#define Z80PIO2_TAG "d207"
+//#define SPEAKER_TAG "b237"
+
+class lc80_state : public driver_device
+{
+public:
+ lc80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_pio2(*this, Z80PIO2_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_pio2;
+ required_device<cassette_image_device> m_cassette;
+ required_device<device_t> m_speaker;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ DECLARE_WRITE_LINE_MEMBER( ctc_z0_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
+ DECLARE_WRITE8_MEMBER( pio1_pa_w );
+ DECLARE_READ8_MEMBER( pio1_pb_r );
+ DECLARE_WRITE8_MEMBER( pio1_pb_w );
+ DECLARE_READ8_MEMBER( pio2_pb_r );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
+
+ void update_display();
+
+ // display state
+ UINT8 m_digit;
+ UINT8 m_segment;
+};
+
+#endif
diff --git a/src/mess/includes/lisa.h b/src/mess/includes/lisa.h
new file mode 100644
index 00000000000..0ce0073f8c8
--- /dev/null
+++ b/src/mess/includes/lisa.h
@@ -0,0 +1,185 @@
+/*****************************************************************************
+ *
+ * includes/lisa.h
+ *
+ * Lisa driver declarations
+ *
+ ****************************************************************************/
+
+#ifndef LISA_H_
+#define LISA_H_
+
+#include "machine/6522via.h"
+#include "machine/8530scc.h"
+
+#define COP421_TAG "u9f"
+#define KB_COP421_TAG "kbcop"
+
+/* lisa MMU segment regs */
+typedef struct real_mmu_entry
+{
+ UINT16 sorg;
+ UINT16 slim;
+} real_mmu_entry;
+
+/* MMU regs translated into a more efficient format */
+enum mmu_entry_t { RAM_stack_r, RAM_r, RAM_stack_rw, RAM_rw, IO, invalid, special_IO };
+
+typedef struct mmu_entry
+{
+ offs_t sorg; /* (real_sorg & 0x0fff) << 9 */
+ mmu_entry_t type; /* <-> (real_slim & 0x0f00) */
+ int slim; /* (~ ((real_slim & 0x00ff) << 9)) & 0x01ffff */
+} mmu_entry;
+
+enum floppy_hardware_t
+{
+ twiggy, /* twiggy drives (Lisa 1) */
+ sony_lisa2, /* 3.5'' drive with LisaLite adapter (Lisa 2) */
+ sony_lisa210 /* 3.5'' drive with modified fdc hardware (Lisa 2/10, Mac XL) */
+};
+
+enum clock_mode_t
+{
+ clock_timer_disable = 0,
+ timer_disable = 1,
+ timer_interrupt = 2, /* timer underflow generates interrupt */
+ timer_power_on = 3 /* timer underflow turns system on if it is off and gens interrupt */
+}; /* clock mode */
+
+/* clock registers */
+typedef struct _clock_regs_t
+{
+ long alarm; /* alarm (20-bit binary) */
+ int years; /* years (4-bit binary ) */
+ int days1; /* days (BCD : 1-366) */
+ int days2;
+ int days3;
+ int hours1; /* hours (BCD : 0-23) */
+ int hours2;
+ int minutes1; /* minutes (BCD : 0-59) */
+ int minutes2;
+ int seconds1; /* seconds (BCD : 0-59) */
+ int seconds2;
+ int tenths; /* tenths of second (BCD : 0-9) */
+
+ int clock_write_ptr; /* clock byte to be written next (-1 if clock write disabled) */
+
+ enum clock_mode_t clock_mode;
+} clock_regs_t;
+
+typedef struct _lisa_features_t
+{
+ unsigned int has_fast_timers : 1; /* I/O board VIAs are clocked at 1.25 MHz (?) instead of .5 MHz (?) (Lisa 2/10, Mac XL) */
+ /* Note that the beep routine in boot ROMs implies that
+ VIA clock is 1.25 times faster with fast timers than with
+ slow timers. I read the schematics again and again, and
+ I simply don't understand : in one case the VIA is
+ connected to the 68k E clock, which is CPUCK/10, and in
+ another case, to a generated PH2 clock which is CPUCK/4,
+ with additionnal logic to keep it in phase with the 68k
+ memory cycle. After hearing the beep when MacWorks XL
+ boots, I bet the correct values are .625 MHz and .5 MHz.
+ Maybe the schematics are wrong, and PH2 is CPUCK/8.
+ Maybe the board uses a 6522 variant with different
+ timings. */
+ floppy_hardware_t floppy_hardware;
+ unsigned int has_double_sided_floppy : 1; /* true on lisa 1 and *hacked* lisa 2/10 / Mac XL */
+ unsigned int has_mac_xl_video : 1; /* modified video for MacXL */
+} lisa_features_t;
+
+
+class lisa_state : public driver_device
+{
+public:
+ lisa_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_scc(*this, "scc"),
+ m_fdc_rom(*this,"fdc_rom"),
+ m_fdc_ram(*this,"fdc_ram") { }
+
+ required_device<device_t> m_maincpu;
+ required_device<scc8530_t> m_scc;
+
+ required_shared_ptr<UINT8> m_fdc_rom;
+ required_shared_ptr<UINT8> m_fdc_ram;
+ UINT8 *m_ram_ptr;
+ UINT8 *m_rom_ptr;
+ UINT8 *m_videoROM_ptr;
+ int m_setup;
+ int m_seg;
+ real_mmu_entry m_real_mmu_regs[4][128];
+ mmu_entry m_mmu_regs[4][128];
+ int m_diag2;
+ int m_test_parity;
+ UINT16 m_mem_err_addr_latch;
+ int m_parity_error_pending;
+ int m_bad_parity_count;
+ UINT8 *m_bad_parity_table;
+ int m_VTMSK;
+ int m_VTIR;
+ UINT16 m_video_address_latch;
+ UINT16 *m_videoram_ptr;
+ int m_KBIR;
+ int m_FDIR;
+ int m_DISK_DIAG;
+ int m_MT1;
+ int m_PWM_floppy_motor_speed;
+ int m_model;
+ lisa_features_t m_features;
+ int m_COPS_Ready;
+ int m_COPS_command;
+ int m_fifo_data[8];
+ int m_fifo_size;
+ int m_fifo_head;
+ int m_fifo_tail;
+ int m_mouse_data_offset;
+ int m_COPS_force_unplug;
+ emu_timer *m_mouse_timer;
+ int m_hold_COPS_data;
+ int m_NMIcode;
+ clock_regs_t m_clock_regs;
+ int m_key_matrix[8];
+ int m_last_mx;
+ int m_last_my;
+ int m_frame_count;
+ int m_videoROM_address;
+ DECLARE_READ8_MEMBER(lisa_fdc_io_r);
+ DECLARE_WRITE8_MEMBER(lisa_fdc_io_w);
+ DECLARE_READ8_MEMBER(lisa_fdc_r);
+ DECLARE_READ8_MEMBER(lisa210_fdc_r);
+ DECLARE_WRITE8_MEMBER(lisa_fdc_w);
+ DECLARE_WRITE8_MEMBER(lisa210_fdc_w);
+ DECLARE_READ16_MEMBER(lisa_r);
+ DECLARE_WRITE16_MEMBER(lisa_w);
+ DECLARE_READ16_MEMBER(lisa_IO_r);
+ DECLARE_WRITE16_MEMBER(lisa_IO_w);
+
+ void set_scc_interrupt(bool value);
+ DECLARE_DRIVER_INIT(lisa210);
+ DECLARE_DRIVER_INIT(mac_xl);
+ DECLARE_DRIVER_INIT(lisa2);
+};
+
+
+/*----------- defined in machine/lisa.c -----------*/
+
+extern const via6522_interface lisa_via6522_0_intf;
+extern const via6522_interface lisa_via6522_1_intf;
+
+VIDEO_START( lisa );
+SCREEN_UPDATE_IND16( lisa );
+
+extern NVRAM_HANDLER(lisa);
+
+
+MACHINE_START( lisa );
+MACHINE_RESET( lisa );
+
+INTERRUPT_GEN( lisa_interrupt );
+
+
+
+#endif /* LISA_H_ */
+
diff --git a/src/mess/includes/llc.h b/src/mess/includes/llc.h
new file mode 100644
index 00000000000..385e0cc9f5a
--- /dev/null
+++ b/src/mess/includes/llc.h
@@ -0,0 +1,73 @@
+/*****************************************************************************
+ *
+ * includes/llc.h
+ *
+ ****************************************************************************/
+
+#ifndef LLC_H_
+#define LLC_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80pio.h"
+#include "machine/z80ctc.h"
+#include "machine/ram.h"
+#include "machine/k7659kb.h"
+#include "sound/speaker.h"
+
+class llc_state : public driver_device
+{
+public:
+ llc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_speaker(*this, SPEAKER_TAG),
+ m_p_videoram(*this, "videoram"){ }
+
+ DECLARE_WRITE8_MEMBER(llc2_rom_disable_w);
+ DECLARE_WRITE8_MEMBER(llc2_basic_enable_w);
+ DECLARE_WRITE8_MEMBER(kbd_put);
+ DECLARE_READ8_MEMBER(llc1_port1_a_r);
+ DECLARE_READ8_MEMBER(llc1_port2_a_r);
+ DECLARE_READ8_MEMBER(llc1_port2_b_r);
+ DECLARE_WRITE8_MEMBER(llc1_port1_a_w);
+ DECLARE_WRITE8_MEMBER(llc1_port1_b_w);
+ DECLARE_READ8_MEMBER(llc2_port1_b_r);
+ DECLARE_READ8_MEMBER(llc2_port2_a_r);
+ DECLARE_WRITE8_MEMBER(llc2_port1_b_w);
+ const UINT8 *m_p_chargen;
+ optional_device<device_t> m_speaker;
+ optional_shared_ptr<UINT8> m_p_videoram;
+ bool m_rv;
+ UINT8 m_term_status;
+ UINT8 m_llc1_key;
+private:
+ UINT8 m_porta;
+ UINT8 m_term_data;
+public:
+ DECLARE_DRIVER_INIT(llc2);
+ DECLARE_DRIVER_INIT(llc1);
+};
+
+
+/*----------- defined in machine/llc.c -----------*/
+extern MACHINE_START( llc1 );
+extern MACHINE_RESET( llc1 );
+
+extern const z80pio_interface llc1_z80pio1_intf;
+extern const z80pio_interface llc1_z80pio2_intf;
+extern const z80pio_interface llc2_z80pio1_intf;
+extern const z80pio_interface llc2_z80pio2_intf;
+
+extern const z80ctc_interface llc1_ctc_intf;
+extern const z80ctc_interface llc2_ctc_intf;
+
+extern MACHINE_RESET( llc2 );
+
+/*----------- defined in video/llc.c -----------*/
+
+extern VIDEO_START( llc );
+extern SCREEN_UPDATE_IND16( llc1 );
+extern SCREEN_UPDATE_IND16( llc2 );
+
+#endif
diff --git a/src/mess/includes/lviv.h b/src/mess/includes/lviv.h
new file mode 100644
index 00000000000..58dc202c048
--- /dev/null
+++ b/src/mess/includes/lviv.h
@@ -0,0 +1,47 @@
+/*****************************************************************************
+ *
+ * includes/lviv.h
+ *
+ ****************************************************************************/
+
+#ifndef LVIV_H_
+#define LVIV_H_
+
+#include "imagedev/snapquik.h"
+#include "machine/i8255.h"
+
+class lviv_state : public driver_device
+{
+public:
+ lviv_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ unsigned char * m_video_ram;
+ unsigned short m_colortable[1][4];
+ UINT8 m_ppi_port_outputs[2][3];
+ UINT8 m_startup_mem_map;
+ DECLARE_READ8_MEMBER(lviv_io_r);
+ DECLARE_WRITE8_MEMBER(lviv_io_w);
+ DECLARE_DIRECT_UPDATE_MEMBER(lviv_directoverride);
+};
+
+
+/*----------- defined in machine/lviv.c -----------*/
+
+extern const i8255_interface lviv_ppi8255_interface_0;
+extern const i8255_interface lviv_ppi8255_interface_1;
+
+MACHINE_RESET( lviv );
+SNAPSHOT_LOAD( lviv );
+
+
+/*----------- defined in video/lviv.c -----------*/
+
+extern VIDEO_START( lviv );
+extern SCREEN_UPDATE_IND16( lviv );
+extern const unsigned char lviv_palette[8*3];
+extern PALETTE_INIT( lviv );
+extern void lviv_update_palette(running_machine &, UINT8);
+
+
+#endif /* LVIV_H_ */
diff --git a/src/mess/includes/lynx.h b/src/mess/includes/lynx.h
new file mode 100644
index 00000000000..6fbca456403
--- /dev/null
+++ b/src/mess/includes/lynx.h
@@ -0,0 +1,271 @@
+/*****************************************************************************
+ *
+ * includes/lynx.h
+ *
+ ****************************************************************************/
+
+#ifndef LYNX_H_
+#define LYNX_H_
+
+#include "imagedev/cartslot.h"
+
+
+#define LYNX_CART 0
+#define LYNX_QUICKLOAD 1
+
+
+class lynx_state;
+typedef struct
+{
+ UINT8 *mem;
+ // global
+ UINT16 screen;
+ UINT16 colbuf;
+ UINT16 colpos; // byte where value of collision is written
+ INT16 xoff, yoff;
+ // in command
+ int mode;
+ UINT8 spr_coll;
+ UINT8 spritenr;
+ INT16 x_pos,y_pos;
+ UINT16 width, height; // uint16 important for blue lightning
+ INT16 tilt_accumulator;
+ UINT16 height_accumulator, width_accumulator;
+ UINT16 width_offset, height_offset;
+ INT16 stretch, tilt;
+ UINT8 color[16]; // or stored
+ void (*line_function)(lynx_state *state, const int y, const int xdir);
+ UINT16 bitmap;
+
+ UINT8 spr_ctl0;
+ UINT8 spr_ctl1;
+ UINT16 scb;
+ UINT16 scb_next;
+ UINT8 sprite_collide;
+
+ int everon;
+ UINT8 fred;
+ int memory_accesses;
+ attotime time;
+
+ int no_collide;
+ int vstretch;
+ int lefthanded;
+ int busy;
+} BLITTER;
+
+typedef struct
+{
+ UINT8 serctl;
+ UINT8 data_received, data_to_send, buffer;
+ int received;
+ int sending;
+ int buffer_loaded;
+} UART;
+
+typedef struct
+{
+ UINT8 data[0x100];
+ UINT8 high;
+ int low;
+ int signed_math;
+ int accumulate;
+ int accumulate_overflow;
+} SUZY;
+
+typedef struct
+{
+ UINT8 data[0x100];
+ UINT16 disp_addr;
+ UINT8 vb_rest;
+} MIKEY;
+
+typedef struct
+{
+ UINT8 bakup;
+ UINT8 cntrl1;
+ UINT8 cntrl2;
+ UINT8 counter;
+ emu_timer *timer;
+ int timer_active;
+} LYNX_TIMER;
+
+#define NR_LYNX_TIMERS 8
+
+class lynx_state : public driver_device
+{
+public:
+ lynx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_mem_0000(*this, "mem_0000"),
+ m_mem_fc00(*this, "mem_fc00"),
+ m_mem_fd00(*this, "mem_fd00"),
+ m_mem_fe00(*this, "mem_fe00"),
+ m_mem_fffa(*this, "mem_fffa"){ }
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ required_shared_ptr<UINT8> m_mem_0000;
+ required_shared_ptr<UINT8> m_mem_fc00;
+ required_shared_ptr<UINT8> m_mem_fd00;
+ required_shared_ptr<UINT8> m_mem_fe00;
+ required_shared_ptr<UINT8> m_mem_fffa;
+ UINT16 m_granularity;
+ int m_sign_AB;
+ int m_sign_CD;
+ UINT32 m_palette[0x10];
+ int m_rotate;
+ device_t *m_audio;
+ SUZY m_suzy;
+ BLITTER m_blitter;
+ UINT8 m_memory_config;
+ MIKEY m_mikey;
+ LYNX_TIMER m_timer[NR_LYNX_TIMERS];
+ UART m_uart;
+ bitmap_ind16 m_bitmap;
+ bitmap_ind16 m_bitmap_temp;
+ DECLARE_READ8_MEMBER(suzy_read);
+ DECLARE_WRITE8_MEMBER(suzy_write);
+ DECLARE_WRITE8_MEMBER(lynx_uart_w);
+ DECLARE_READ8_MEMBER(mikey_read);
+ DECLARE_WRITE8_MEMBER(mikey_write);
+ DECLARE_READ8_MEMBER(lynx_memory_config_r);
+ DECLARE_WRITE8_MEMBER(lynx_memory_config_w);
+ void lynx_divide();
+ void lynx_multiply();
+ UINT8 lynx_timer_read(int which, int offset);
+ void lynx_timer_write(int which, int offset, UINT8 data);
+};
+
+
+/*----------- defined in machine/lynx.c -----------*/
+
+MACHINE_START( lynx );
+MACHINE_RESET( lynx );
+
+void lynx_timer_count_down(running_machine &machine, int nr);
+
+INTERRUPT_GEN( lynx_frame_int );
+
+/* These functions are also needed for the Quickload */
+int lynx_verify_cart (char *header, int kind);
+void lynx_crc_keyword(device_image_interface &image);
+
+MACHINE_CONFIG_EXTERN( lynx_cartslot );
+
+
+/*----------- defined in audio/lynx.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(LYNX, lynx_sound);
+DECLARE_LEGACY_SOUND_DEVICE(LYNX2, lynx2_sound);
+
+void lynx_audio_write(device_t *device, int offset, UINT8 data);
+UINT8 lynx_audio_read(device_t *device, int offset);
+void lynx_audio_count_down(device_t *device, int nr);
+
+/*---------- suzy registers ------------- */
+#define TMPADRL 0x00 // Temporary address (not sure what this is used for)
+#define TMPADRH 0x01
+#define TILTACUML 0x02 // Tilt accumulator (signed fixed-point, eight bits to the left of decimal)
+#define TILTACUMH 0x03
+#define HOFFL 0x04 // X offset to edge of visible window
+#define HOFFH 0x05
+#define VOFFL 0x06 // Y offset to edge of visible window
+#define VOFFH 0x07
+#define VIDBASL 0x08 // Video buffer address
+#define VIDBASH 0x09
+#define COLLBASL 0x0A // Collision buffer address
+#define COLLBASH 0x0B
+#define VIDADRL 0x0C // Current Video Build Address
+#define VIDADRH 0x0D
+#define COLLADRL 0x0E // Current Collision Build Address
+#define COLLADRH 0x0F
+#define SCBNEXTL 0x10 // Address of next SCB
+#define SCBNEXTH 0x11
+#define SPRDLINEL 0x12 // Sprite data start address
+#define SPRDLINEH 0x13
+#define HPOSSTRTL 0x14 // Starting Hpos
+#define HPOSSTRTH 0x15
+#define VPOSSTRTL 0x16 // Starting Vpos
+#define VPOSSTRTH 0x17
+#define SPRHSIZL 0x18 // H Size
+#define SPRHSIZH 0x19
+#define SPRVSIZL 0x1A // V Size
+#define SPRVSIZH 0x1B
+#define STRETCHL 0x1C // H/V Size Adder (signed fixed-point)
+#define STRETCHH 0x1D
+#define TILTL 0x1E // H Position Adder (signed fixed-point)
+#define TILTH 0x1F
+#define SPRDOFFL 0x20 // Offset to Next Sprite Data Line
+#define SPRDOFFH 0x21
+#define SPRVPOSL 0x22 // Current Vpos
+#define SPRVPOSH 0x23
+#define COLLOFFL 0x24 // Offset to Collision Depository
+#define COLLOFFH 0x25
+#define VSIZACUML 0x26 // Vertical Size Accumulator
+#define VSIZACUMH 0x27
+#define HSIZOFFL 0x28 // Horizontal Size Offset
+#define HSIZOFFH 0x29
+#define VSIZOFFL 0x2A // Vertical Size Offset
+#define VSIZOFFH 0x2B
+#define SCBADRL 0x2C // Address of Current SCB
+#define SCBADRH 0x2D
+#define PROCADRL 0x2E // Current Spr Data Proc Address
+
+#define MATH_D 0x52
+#define MATH_C 0x53
+#define MATH_B 0x54
+#define MATH_A 0x55
+#define MATH_P 0x56
+#define MATH_N 0x57
+#define MATH_H 0x60
+#define MATH_G 0x61
+#define MATH_F 0x62
+#define MATH_E 0x63
+
+#define MATH_M 0x6c
+#define MATH_L 0x6d
+#define MATH_K 0x6e
+#define MATH_J 0x6f
+
+#define SPRCTL0 0x80 // Sprite Control Bits 0 (W)(U)
+#define SPRCTL1 0x81 // Sprite Control Bits 1 (W)(U)
+#define SPRCOLL 0x82 // Sprite Collision Number (W)
+#define SPRINIT 0x83 // Sprite Initialization Bits (W)(U)
+
+#define SUZYHREV 0x88 // Suzy Hardware Revision (R) = '01'
+
+#define SUZYBUSEN 0x90 // Suzy Bus Enable (W)
+#define SPRGO 0x91 // Sprite Process Start Bit (W)
+#define SPRSYS 0x92 // System Control Bits (R/W)
+
+#define JOYSTICK 0xB0 // Read Joystick and Switches(R)
+#define SWITCHES 0xB1 // Read Other Switches (R)
+#define RCART 0xB2 // Read / Write Cartridge Bank 0 (R/W)
+#define RCART_BANK1 0xB3 // Read / Write Cartridge Bank 1 (R/W) (Unused in existing cartridges?)
+
+//0xC0 LEDs (W)
+//0xC2 Parallel Port Status(R/W)
+//0xC3 Parallel Port Data (R/W)
+//0xC4 Howie (R/W)
+
+// SCB offsets
+
+//8-bit
+#define SCB_SPRCTL0 0x00 // 8 bit
+#define SCB_SPRCTL1 0x01 // 8 bit
+#define SCB_SPRCOLL 0x02 // 4 bit
+
+//16-bit
+#define SCB_SCBNEXT 0x03 // L,H Address of Next SCB
+#define SCB_SPRDLINE 0x05 // L,H Start of Sprite Data Line Address
+#define SCB_HPOSSTRT 0x07 // L,H Starting Hpos
+#define SCB_VPOSSTRT 0x09 // L,H Starting Vpos
+#define SCB_SPRHSIZ 0x0B // L,H H Size
+#define SCB_SPRVSIZ 0x0D // L,H V Size
+#define SCB_STRETCH 0x0F // L H H/V Size Adder
+#define SCB_TILT 0x11 // L,H H Position Adder
+
+#endif /* LYNX_H_ */
diff --git a/src/mess/includes/m5.h b/src/mess/includes/m5.h
new file mode 100644
index 00000000000..0982d010208
--- /dev/null
+++ b/src/mess/includes/m5.h
@@ -0,0 +1,75 @@
+#ifndef __M5__
+#define __M5__
+
+#include "machine/z80ctc.h"
+
+#define Z80_TAG "ic17"
+#define Z80CTC_TAG "ic19"
+#define SN76489AN_TAG "ic15"
+#define TMS9918A_TAG "ic10"
+#define TMS9929A_TAG "ic10"
+#define I8255A_TAG "i8255a"
+#define Z80_FD5_TAG "z80fd5"
+#define UPD765_TAG "upd765"
+#define CENTRONICS_TAG "centronics"
+#define SCREEN_TAG "screen"
+
+class m5_state : public driver_device
+{
+public:
+ m5_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_fd5cpu(*this, Z80_FD5_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_ppi(*this, I8255A_TAG),
+ m_fdc(*this, UPD765_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_fd5cpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<i8255_device> m_ppi;
+ required_device<device_t> m_fdc;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( sts_r );
+ DECLARE_WRITE8_MEMBER( com_w );
+
+ DECLARE_READ8_MEMBER( ppi_pa_r );
+ DECLARE_WRITE8_MEMBER( ppi_pa_w );
+ DECLARE_WRITE8_MEMBER( ppi_pb_w );
+ DECLARE_READ8_MEMBER( ppi_pc_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+
+ DECLARE_READ8_MEMBER( fd5_data_r );
+ DECLARE_WRITE8_MEMBER( fd5_data_w );
+ DECLARE_READ8_MEMBER( fd5_com_r );
+ DECLARE_WRITE8_MEMBER( fd5_com_w );
+ DECLARE_WRITE8_MEMBER( fd5_ctrl_w );
+ DECLARE_WRITE8_MEMBER( fd5_tc_w );
+
+ // video state
+// const TMS9928a_interface *m_vdp_intf;
+
+ // floppy state
+ UINT8 m_fd5_data;
+ UINT8 m_fd5_com;
+ int m_intra;
+ int m_ibfa;
+ int m_obfa;
+ DECLARE_DRIVER_INIT(pal);
+ DECLARE_DRIVER_INIT(ntsc);
+};
+
+#endif
diff --git a/src/mess/includes/mac.h b/src/mess/includes/mac.h
new file mode 100644
index 00000000000..e6f906059dc
--- /dev/null
+++ b/src/mess/includes/mac.h
@@ -0,0 +1,483 @@
+/*****************************************************************************
+ *
+ * includes/mac.h
+ *
+ * Macintosh driver declarations
+ *
+ ****************************************************************************/
+
+#ifndef MAC_H_
+#define MAC_H_
+
+#include "machine/8530scc.h"
+#include "machine/6522via.h"
+#include "machine/ram.h"
+#include "machine/egret.h"
+#include "machine/cuda.h"
+#include "machine/nubus.h"
+#include "machine/ncr539x.h"
+#include "machine/mackbd.h"
+#include "sound/asc.h"
+#include "sound/awacs.h"
+
+#define MAC_SCREEN_NAME "screen"
+#define MAC_539X_1_TAG "539x_1"
+#define MAC_539X_2_TAG "539x_2"
+
+// model helpers
+#define ADB_IS_BITBANG ((mac->m_model == MODEL_MAC_SE || mac->m_model == MODEL_MAC_CLASSIC) || (mac->m_model >= MODEL_MAC_II && mac->m_model <= MODEL_MAC_IICI) || (mac->m_model == MODEL_MAC_SE30) || (mac->m_model == MODEL_MAC_QUADRA_700))
+#define ADB_IS_BITBANG_CLASS ((m_model == MODEL_MAC_SE || m_model == MODEL_MAC_CLASSIC) || (m_model >= MODEL_MAC_II && m_model <= MODEL_MAC_IICI) || (m_model == MODEL_MAC_SE30) || (m_model == MODEL_MAC_QUADRA_700))
+#define ADB_IS_EGRET (mac->m_model >= MODEL_MAC_LC && mac->m_model <= MODEL_MAC_CLASSIC_II) || ((mac->m_model >= MODEL_MAC_IISI) && (mac->m_model <= MODEL_MAC_IIVI))
+#define ADB_IS_CUDA ((mac->m_model >= MODEL_MAC_COLOR_CLASSIC && mac->m_model <= MODEL_MAC_LC_580) || ((mac->m_model >= MODEL_MAC_QUADRA_660AV) && (mac->m_model <= MODEL_MAC_QUADRA_630)) || (mac->m_model >= MODEL_MAC_POWERMAC_6100))
+#define ADB_IS_PM_VIA1 (mac->m_model >= MODEL_MAC_PORTABLE && mac->m_model <= MODEL_MAC_PB100)
+#define ADB_IS_PM_VIA2 (mac->m_model >= MODEL_MAC_PB140 && mac->m_model <= MODEL_MAC_PBDUO_270c)
+#define ADB_IS_PM_VIA1_CLASS (m_model >= MODEL_MAC_PORTABLE && m_model <= MODEL_MAC_PB100)
+#define ADB_IS_PM_VIA2_CLASS (m_model >= MODEL_MAC_PB140 && m_model <= MODEL_MAC_PBDUO_270c)
+#define ADB_IS_PM_CLASS ((m_model >= MODEL_MAC_PORTABLE && m_model <= MODEL_MAC_PB100) || (m_model >= MODEL_MAC_PB140 && m_model <= MODEL_MAC_PBDUO_270c))
+
+/* for Egret and CUDA streaming MCU commands, command types */
+typedef enum
+{
+ MCU_STREAMING_NONE = 0,
+ MCU_STREAMING_PRAMRD,
+ MCU_STREAMING_PRAMWR,
+ MCU_STREAMING_WRAMRD,
+ MCU_STREAMING_WRAMWR
+} mac_streaming_t;
+
+enum
+{
+ RBV_TYPE_RBV = 0,
+ RBV_TYPE_V8,
+ RBV_TYPE_SONORA,
+ RBV_TYPE_DAFB
+};
+
+/* tells which model is being emulated (set by macxxx_init) */
+typedef enum
+{
+ MODEL_MAC_128K512K, // 68000 machines
+ MODEL_MAC_512KE,
+ MODEL_MAC_PLUS,
+ MODEL_MAC_SE,
+ MODEL_MAC_CLASSIC,
+
+ MODEL_MAC_PORTABLE, // Portable/PB100 are sort of hybrid classic and Mac IIs
+ MODEL_MAC_PB100,
+
+ MODEL_MAC_II, // Mac II class 68020/030 machines
+ MODEL_MAC_II_FDHD,
+ MODEL_MAC_IIX,
+ MODEL_MAC_IICX,
+ MODEL_MAC_IICI,
+ MODEL_MAC_IISI,
+ MODEL_MAC_IIVX,
+ MODEL_MAC_IIVI,
+ MODEL_MAC_IIFX,
+ MODEL_MAC_SE30,
+
+ MODEL_MAC_LC, // LC class 68030 machines, generally using a V8 or compatible gate array
+ MODEL_MAC_LC_II,
+ MODEL_MAC_LC_III,
+ MODEL_MAC_LC_III_PLUS,
+ MODEL_MAC_CLASSIC_II,
+ MODEL_MAC_COLOR_CLASSIC,
+
+ MODEL_MAC_LC_475, // LC III clones with Cuda instead of Egret and 68LC040 on most models
+ MODEL_MAC_LC_520,
+ MODEL_MAC_LC_550,
+ MODEL_MAC_TV,
+ MODEL_MAC_LC_575,
+ MODEL_MAC_LC_580,
+
+ MODEL_MAC_PB140, // 68030 PowerBooks. 140/145/145B/170 all have the same machine ID
+ MODEL_MAC_PB160, // 160/180/165 all have the same machine ID too
+ MODEL_MAC_PB165c,
+ MODEL_MAC_PB180c,
+ MODEL_MAC_PB150, // 150 is fairly radically different from the other 1x0s
+
+ MODEL_MAC_PBDUO_210, // 68030 PowerBook Duos
+ MODEL_MAC_PBDUO_230,
+ MODEL_MAC_PBDUO_250,
+ MODEL_MAC_PBDUO_270c,
+
+ MODEL_MAC_QUADRA_700, // 68(LC)040 desktops
+ MODEL_MAC_QUADRA_610,
+ MODEL_MAC_QUADRA_650,
+ MODEL_MAC_QUADRA_800,
+ MODEL_MAC_QUADRA_900,
+ MODEL_MAC_QUADRA_950,
+ MODEL_MAC_QUADRA_660AV,
+ MODEL_MAC_QUADRA_840AV,
+ MODEL_MAC_QUADRA_605,
+ MODEL_MAC_QUADRA_630,
+
+ MODEL_MAC_PB550c, // 68(LC)040 PowerBooks
+ MODEL_MAC_PB520,
+ MODEL_MAC_PB520c,
+ MODEL_MAC_PB540,
+ MODEL_MAC_PB540c,
+ MODEL_MAC_PB190,
+ MODEL_MAC_PB190cs,
+
+ MODEL_MAC_POWERMAC_6100, // NuBus PowerMacs
+ MODEL_MAC_POWERMAC_7100,
+ MODEL_MAC_POWERMAC_8100
+} model_t;
+
+// video parameters for classic Macs
+#define MAC_H_VIS (512)
+#define MAC_V_VIS (342)
+#define MAC_H_TOTAL (704) // (512+192)
+#define MAC_V_TOTAL (370) // (342+28)
+
+/*----------- defined in machine/mac.c -----------*/
+
+extern const via6522_interface mac_via6522_intf;
+extern const via6522_interface mac_via6522_2_intf;
+extern const via6522_interface mac_via6522_adb_intf;
+
+void mac_scsi_irq(running_machine &machine, int state);
+void mac_asc_irq(device_t *device, int state);
+void mac_fdc_set_enable_lines(device_t *device, int enable_mask);
+
+MACHINE_START( macscsi );
+MACHINE_START( mac );
+MACHINE_RESET( mac );
+
+
+NVRAM_HANDLER( mac );
+
+/*----------- defined in video/mac.c -----------*/
+
+VIDEO_START( mac );
+VIDEO_START( macrbv );
+VIDEO_START( macv8 );
+VIDEO_START( macsonora );
+VIDEO_START( macdafb );
+
+VIDEO_RESET(macrbv);
+VIDEO_RESET(macdafb);
+VIDEO_RESET(maceagle);
+VIDEO_RESET(macsonora);
+
+SCREEN_UPDATE_IND16( mac );
+SCREEN_UPDATE_IND16( macse30 );
+SCREEN_UPDATE_IND16( macprtb );
+SCREEN_UPDATE_IND16( macpb140 );
+SCREEN_UPDATE_IND16( macpb160 );
+SCREEN_UPDATE_RGB32( macrbv );
+SCREEN_UPDATE_RGB32( macrbvvram );
+SCREEN_UPDATE_RGB32( macdafb );
+SCREEN_UPDATE_RGB32( macpbwd );
+
+PALETTE_INIT( mac );
+PALETTE_INIT( macgsc );
+
+/*----------- defined in audio/mac.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound);
+
+void mac_enable_sound( device_t *device, int on );
+void mac_set_sound_buffer( device_t *device, int buffer );
+void mac_set_volume( device_t *device, int volume );
+
+void mac_sh_updatebuffer(device_t *device);
+
+/* Mac driver data */
+
+class mac_state : public driver_device
+{
+public:
+ mac_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_via1(*this, "via6522_0"),
+ m_via2(*this, "via6522_1"),
+ m_asc(*this, "asc"),
+ m_awacs(*this, "awacs"),
+ m_egret(*this, EGRET_TAG),
+ m_cuda(*this, CUDA_TAG),
+ m_ram(*this, RAM_TAG),
+ m_screen(*this, MAC_SCREEN_NAME),
+ m_539x_1(*this, MAC_539X_1_TAG),
+ m_539x_2(*this, MAC_539X_2_TAG),
+ m_mackbd(*this, MACKBD_TAG),
+ m_vram(*this,"vram"),
+ m_vram16(*this,"vram16")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<via6522_device> m_via1;
+ optional_device<via6522_device> m_via2;
+ optional_device<asc_device> m_asc;
+ optional_device<awacs_device> m_awacs;
+ optional_device<egret_device> m_egret;
+ optional_device<cuda_device> m_cuda;
+ required_device<ram_device> m_ram;
+ optional_device<screen_device> m_screen;
+ optional_device<ncr539x_device> m_539x_1;
+ optional_device<ncr539x_device> m_539x_2;
+ optional_device<mackbd_device> m_mackbd;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ model_t m_model;
+
+ UINT32 m_overlay;
+ int m_drive_select;
+ int m_scsiirq_enable;
+
+ UINT32 m_via2_vbl;
+ UINT32 m_se30_vbl_enable;
+ UINT8 m_nubus_irq_state;
+
+ /* used to store the reply to most keyboard commands */
+ int m_keyboard_reply;
+
+ /* Keyboard communication in progress? */
+ int m_kbd_comm;
+ int m_kbd_receive;
+ /* timer which is used to time out inquiry */
+ emu_timer *m_inquiry_timeout;
+
+ int m_kbd_shift_reg;
+ int m_kbd_shift_count;
+
+ /* keyboard matrix to detect transition */
+ int m_key_matrix[7];
+
+ /* keycode buffer (used for keypad/arrow key transition) */
+ int m_keycode_buf[2];
+ int m_keycode_buf_index;
+
+ int m_mouse_bit_x;
+ int m_mouse_bit_y;
+ int last_mx, last_my;
+ int count_x, count_y;
+ int m_last_was_x;
+ int m_screen_buffer;
+
+ int irq_count, ca1_data, ca2_data;
+
+ /* state of rTCEnb and rTCClk lines */
+ UINT8 m_rtc_rTCEnb;
+ UINT8 m_rtc_rTCClk;
+
+ /* serial transmit/receive register : bits are shifted in/out of this byte */
+ UINT8 m_rtc_data_byte;
+ /* serial transmitted/received bit count */
+ UINT8 m_rtc_bit_count;
+ /* direction of the current transfer (0 : VIA->RTC, 1 : RTC->VIA) */
+ UINT8 m_rtc_data_dir;
+ /* when rtc_data_dir == 1, state of rTCData as set by RTC (-> data bit seen by VIA) */
+ UINT8 m_rtc_data_out;
+
+ /* set to 1 when command in progress */
+ UINT8 m_rtc_cmd;
+
+ /* write protect flag */
+ UINT8 m_rtc_write_protect;
+
+ /* internal seconds register */
+ UINT8 m_rtc_seconds[/*8*/4];
+ /* 20-byte long PRAM, or 256-byte long XPRAM */
+ UINT8 m_rtc_ram[256];
+ /* current extended address and RTC state */
+ UINT8 m_rtc_xpaddr;
+ UINT8 m_rtc_state;
+
+ // Mac ADB state
+ INT32 m_adb_irq_pending, m_adb_waiting_cmd, m_adb_datasize, m_adb_buffer[257];
+ INT32 m_adb_state, m_adb_command, m_adb_send, m_adb_timer_ticks, m_adb_extclock, m_adb_direction;
+ INT32 m_adb_listenreg, m_adb_listenaddr, m_adb_last_talk, m_adb_srq_switch;
+ INT32 m_adb_streaming, m_adb_stream_ptr;
+
+ // Portable/PB100 Power Manager IC comms (chapter 4, "Guide to the Macintosh Family Hardware", second edition)
+ UINT8 m_pm_data_send, m_pm_data_recv, m_pm_ack, m_pm_req, m_pm_cmd[32], m_pm_out[32], m_pm_dptr, m_pm_sptr, m_pm_slen, m_pm_state;
+ UINT8 m_pmu_int_status, m_pmu_last_adb_command, m_pmu_poll;
+ emu_timer *m_pmu_send_timer;
+
+ // 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc.
+ emu_timer *m_6015_timer;
+
+ // RBV and friends (V8, etc)
+ UINT8 m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime;
+ UINT32 m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr;
+ UINT32 m_rbv_palette[256];
+ UINT8 m_sonora_vctl[8];
+ emu_timer *m_vbl_timer, *m_cursor_timer;
+ UINT16 m_cursor_line;
+ UINT16 m_dafb_int_status;
+ int m_dafb_scsi1_drq, m_dafb_scsi2_drq;
+ UINT8 m_dafb_mode;
+ UINT32 m_dafb_base, m_dafb_stride;
+
+ // this is shared among all video setups with vram
+ optional_shared_ptr<UINT32> m_vram;
+ optional_shared_ptr<UINT16> m_vram16;
+
+ // interrupts
+ int m_scc_interrupt, m_via_interrupt, m_via2_interrupt, m_scsi_interrupt, m_asc_interrupt, m_last_taken_interrupt;
+
+ // defined in machine/mac.c
+ void v8_resize();
+ void set_memory_overlay(int overlay);
+ void scc_mouse_irq( int x, int y );
+ void nubus_slot_interrupt(UINT8 slot, UINT32 state);
+ void set_scc_interrupt(bool value);
+ void set_via_interrupt(int value);
+ void set_via2_interrupt(int value);
+ void field_interrupts();
+ void rtc_write_rTCEnb(int data);
+ void rtc_shift_data(int data);
+ void vblank_irq();
+ void rtc_incticks();
+ void adb_talk();
+ void mouse_callback();
+ void rbv_recalc_irqs();
+ void pmu_exec();
+ void mac_adb_newaction(int state);
+
+ DECLARE_READ16_MEMBER ( mac_via_r );
+ DECLARE_WRITE16_MEMBER ( mac_via_w );
+ DECLARE_READ16_MEMBER ( mac_via2_r );
+ DECLARE_WRITE16_MEMBER ( mac_via2_w );
+ DECLARE_READ16_MEMBER ( mac_autovector_r );
+ DECLARE_WRITE16_MEMBER ( mac_autovector_w );
+ DECLARE_READ16_MEMBER ( mac_iwm_r );
+ DECLARE_WRITE16_MEMBER ( mac_iwm_w );
+ DECLARE_READ16_MEMBER ( mac_scc_r );
+ DECLARE_WRITE16_MEMBER ( mac_scc_w );
+ DECLARE_WRITE16_MEMBER ( mac_scc_2_w );
+ DECLARE_READ16_MEMBER ( macplus_scsi_r );
+ DECLARE_WRITE16_MEMBER ( macplus_scsi_w );
+ DECLARE_WRITE16_MEMBER ( macii_scsi_w );
+ DECLARE_READ32_MEMBER (macii_scsi_drq_r);
+ DECLARE_WRITE32_MEMBER (macii_scsi_drq_w);
+
+ DECLARE_READ32_MEMBER( rbv_ramdac_r );
+ DECLARE_WRITE32_MEMBER( rbv_ramdac_w );
+ DECLARE_WRITE32_MEMBER( ariel_ramdac_w );
+ DECLARE_READ8_MEMBER( mac_sonora_vctl_r );
+ DECLARE_WRITE8_MEMBER( mac_sonora_vctl_w );
+ DECLARE_READ8_MEMBER ( mac_rbv_r );
+ DECLARE_WRITE8_MEMBER ( mac_rbv_w );
+
+ DECLARE_READ32_MEMBER(mac_read_id);
+
+ DECLARE_READ16_MEMBER(mac_config_r);
+
+ DECLARE_READ32_MEMBER(biu_r);
+ DECLARE_WRITE32_MEMBER(biu_w);
+ DECLARE_READ8_MEMBER(oss_r);
+ DECLARE_WRITE8_MEMBER(oss_w);
+ DECLARE_READ32_MEMBER(buserror_r);
+ DECLARE_READ8_MEMBER(swimiop_r);
+ DECLARE_WRITE8_MEMBER(swimiop_w);
+ DECLARE_READ8_MEMBER(scciop_r);
+ DECLARE_WRITE8_MEMBER(scciop_w);
+
+ DECLARE_READ8_MEMBER(hmc_r);
+ DECLARE_WRITE8_MEMBER(hmc_w);
+ DECLARE_READ8_MEMBER(amic_dma_r);
+ DECLARE_WRITE8_MEMBER(amic_dma_w);
+ DECLARE_READ8_MEMBER(pmac_diag_r);
+
+ DECLARE_READ8_MEMBER(mac_gsc_r);
+ DECLARE_WRITE8_MEMBER(mac_gsc_w);
+
+ DECLARE_READ8_MEMBER(mac_5396_r);
+ DECLARE_WRITE8_MEMBER(mac_5396_w);
+
+ DECLARE_READ32_MEMBER(dafb_r);
+ DECLARE_WRITE32_MEMBER(dafb_w);
+ DECLARE_READ32_MEMBER(dafb_dac_r);
+ DECLARE_WRITE32_MEMBER(dafb_dac_w);
+
+ DECLARE_READ32_MEMBER(macwd_r);
+ DECLARE_WRITE32_MEMBER(macwd_w);
+
+ DECLARE_WRITE_LINE_MEMBER(nubus_irq_9_w);
+ DECLARE_WRITE_LINE_MEMBER(nubus_irq_a_w);
+ DECLARE_WRITE_LINE_MEMBER(nubus_irq_b_w);
+ DECLARE_WRITE_LINE_MEMBER(nubus_irq_c_w);
+ DECLARE_WRITE_LINE_MEMBER(nubus_irq_d_w);
+ DECLARE_WRITE_LINE_MEMBER(nubus_irq_e_w);
+
+ DECLARE_WRITE_LINE_MEMBER(irq_539x_1_w);
+ DECLARE_WRITE_LINE_MEMBER(drq_539x_1_w);
+
+ DECLARE_WRITE_LINE_MEMBER(cuda_reset_w);
+
+ DECLARE_DIRECT_UPDATE_MEMBER(overlay_opbaseoverride);
+private:
+ int has_adb();
+ void rtc_init();
+ void rtc_execute_cmd(int data);
+ void adb_reset();
+ void adb_vblank();
+ int adb_pollkbd(int update);
+ int adb_pollmouse();
+ void adb_accummouse( UINT8 *MouseX, UINT8 *MouseY );
+ void pmu_one_byte_reply(UINT8 result);
+ void pmu_three_byte_reply(UINT8 result1, UINT8 result2, UINT8 result3);
+
+ // wait states for accessing the VIA
+ int m_via_cycles;
+
+ // ADB mouse state
+ int m_adb_mouseaddr;
+ int m_adb_lastmousex, m_adb_lastmousey, m_adb_lastbutton, m_adb_mouse_initialized;
+
+ // ADB keyboard state
+ int m_adb_keybaddr;
+ int m_adb_keybinitialized, m_adb_currentkeys[2], m_adb_modifiers;
+
+ UINT8 m_oss_regs[0x400];
+
+ // AMIC for x100 PowerMacs
+ UINT8 m_amic_regs[0x200];
+
+ // HMC for x100 PowerMacs
+ UINT64 m_hmc_reg, m_hmc_shiftout;
+
+public:
+ emu_timer *m_scanline_timer;
+ emu_timer *m_adb_timer;
+ DECLARE_DRIVER_INIT(maclc2);
+ DECLARE_DRIVER_INIT(maciifdhd);
+ DECLARE_DRIVER_INIT(macse30);
+ DECLARE_DRIVER_INIT(macprtb);
+ DECLARE_DRIVER_INIT(maciivx);
+ DECLARE_DRIVER_INIT(macpd210);
+ DECLARE_DRIVER_INIT(macii);
+ DECLARE_DRIVER_INIT(macclassic);
+ DECLARE_DRIVER_INIT(macquadra700);
+ DECLARE_DRIVER_INIT(macclassic2);
+ DECLARE_DRIVER_INIT(maciifx);
+ DECLARE_DRIVER_INIT(maclc);
+ DECLARE_DRIVER_INIT(macpb160);
+ DECLARE_DRIVER_INIT(macplus);
+ DECLARE_DRIVER_INIT(macse);
+ DECLARE_DRIVER_INIT(macpb140);
+ DECLARE_DRIVER_INIT(mac128k512k);
+ DECLARE_DRIVER_INIT(macpm6100);
+ DECLARE_DRIVER_INIT(mac512ke);
+ DECLARE_DRIVER_INIT(maclc520);
+ DECLARE_DRIVER_INIT(maciici);
+ DECLARE_DRIVER_INIT(maciix);
+ DECLARE_DRIVER_INIT(maclrcclassic);
+ DECLARE_DRIVER_INIT(maciisi);
+ DECLARE_DRIVER_INIT(maciicx);
+ DECLARE_DRIVER_INIT(maclc3);
+ DECLARE_DRIVER_INIT(maclc3plus);
+ DECLARE_DRIVER_INIT(macpm7100);
+ DECLARE_DRIVER_INIT(macpm8100);
+ DECLARE_DRIVER_INIT(macpb100);
+};
+
+#endif /* MAC_H_ */
+
+
diff --git a/src/mess/includes/macpci.h b/src/mess/includes/macpci.h
new file mode 100644
index 00000000000..a2e37f9bdaa
--- /dev/null
+++ b/src/mess/includes/macpci.h
@@ -0,0 +1,164 @@
+/*****************************************************************************
+ *
+ * includes/macpci.h
+ *
+ * PCI-based Power Macintosh driver declarations
+ *
+ ****************************************************************************/
+
+#ifndef MACPCI_H_
+#define MACPCI_H_
+
+#include "machine/8530scc.h"
+#include "machine/6522via.h"
+#include "machine/ram.h"
+#include "machine/cuda.h"
+#include "machine/ncr539x.h"
+#include "sound/awacs.h"
+
+#define C7M (7833600)
+#define C15M (C7M*2)
+
+#define MAC_SCREEN_NAME "screen"
+#define MAC_539X_1_TAG "539x_1"
+#define MAC_539X_2_TAG "539x_2"
+
+/* tells which model is being emulated (set by macxxx_init) */
+typedef enum
+{
+ PCIMODEL_MAC_PM5200,
+ PCIMODEL_MAC_PM6200,
+ PCIMODEL_MAC_PM5300,
+ PCIMODEL_MAC_PM7200,
+ PCIMODEL_MAC_PM7500,
+ PCIMODEL_MAC_PM8500,
+ PCIMODEL_MAC_PM9500,
+ PCIMODEL_MAC_PM7215,
+ PCIMODEL_MAC_PM5260,
+ PCIMODEL_MAC_PM5400,
+ PCIMODEL_MAC_PM7600,
+ PCIMODEL_MAC_PM8200,
+ PCIMODEL_MAC_PM6300,
+ PCIMODEL_MAC_PM6400,
+ PCIMODEL_MAC_PM4400,
+ PCIMODEL_MAC_PM5500,
+ PCIMODEL_MAC_PM7220,
+ PCIMODEL_MAC_PM7300,
+ PCIMODEL_MAC_PM6500,
+ PCIMODEL_MAC_PM8600,
+ PCIMODEL_MAC_PM9600,
+
+ PCIMODEL_MAC_20TH,
+
+ PCIMODEL_MAC_G3_GOSSAMER,
+ PCIMODEL_MAC_G3_ALLINONE,
+
+ PCIMODEL_MAC_PB5x0PPC,
+ PCIMODEL_MAC_PB1400,
+ PCIMODEL_MAC_PB2300,
+ PCIMODEL_MAC_PB2400,
+ PCIMODEL_MAC_PB3400,
+ PCIMODEL_MAC_PB5300,
+
+ PCIMODEL_MAC_PBG3KANGA,
+ PCIMODEL_MAC_PBG3WALLST1,
+ PCIMODEL_MAC_PBG3WALLST2,
+
+ PCIMODEL_MAC_PIPPIN, // Apple/Bandai Pippin
+
+} model_t;
+
+/*----------- defined in machine/pcimac.c -----------*/
+
+extern const via6522_interface pcimac_via6522_intf;
+
+
+/* Mac driver data */
+
+class macpci_state : public driver_device
+{
+public:
+ macpci_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_via1(*this, "via6522_0"),
+ m_awacs(*this, "awacs"),
+ m_cuda(*this, CUDA_TAG),
+ m_ram(*this, RAM_TAG),
+ m_screen(*this, MAC_SCREEN_NAME),
+ m_539x_1(*this, MAC_539X_1_TAG),
+ m_539x_2(*this, MAC_539X_2_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<via6522_device> m_via1;
+ optional_device<awacs_device> m_awacs;
+ required_device<cuda_device> m_cuda;
+ required_device<ram_device> m_ram;
+ optional_device<screen_device> m_screen;
+ optional_device<ncr539x_device> m_539x_1;
+ optional_device<ncr539x_device> m_539x_2;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ model_t m_model;
+
+ // 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc.
+ emu_timer *m_6015_timer;
+
+ // RBV and friends (V8, etc)
+ UINT8 m_rbv_regs[256], m_rbv_ier, m_rbv_ifr, m_rbv_type, m_rbv_montype, m_rbv_vbltime;
+ UINT32 m_rbv_colors[3], m_rbv_count, m_rbv_clutoffs, m_rbv_immed10wr;
+ UINT32 m_rbv_palette[256];
+ UINT8 m_sonora_vctl[8];
+ emu_timer *m_vbl_timer, *m_cursor_timer;
+ UINT16 m_cursor_line;
+ UINT16 m_dafb_int_status;
+ int m_dafb_scsi1_drq, m_dafb_scsi2_drq;
+ UINT8 m_dafb_mode;
+ UINT32 m_dafb_base, m_dafb_stride;
+
+ // this is shared among all video setups with vram
+ UINT32 *m_vram;
+
+ // defined in machine/mac.c
+ void set_via_interrupt(int value);
+ void vblank_irq();
+ void mac_adb_newaction(int state);
+
+ DECLARE_READ16_MEMBER ( mac_via_r );
+ DECLARE_WRITE16_MEMBER ( mac_via_w );
+ DECLARE_READ16_MEMBER ( mac_scc_r );
+ DECLARE_WRITE16_MEMBER ( mac_scc_w );
+ DECLARE_WRITE16_MEMBER ( mac_scc_2_w );
+
+ DECLARE_READ32_MEMBER(mac_read_id);
+
+ DECLARE_READ8_MEMBER(mac_5396_r);
+ DECLARE_WRITE8_MEMBER(mac_5396_w);
+
+ DECLARE_WRITE_LINE_MEMBER(irq_539x_1_w);
+ DECLARE_WRITE_LINE_MEMBER(drq_539x_1_w);
+
+ DECLARE_WRITE_LINE_MEMBER(cuda_reset_w);
+
+ // hack functions
+ DECLARE_READ64_MEMBER ( unk1_r );
+ DECLARE_READ64_MEMBER ( unk2_r );
+
+ DECLARE_DRIVER_INIT(pippin);
+private:
+ // wait states for accessing the VIA
+ int m_via_cycles;
+
+ // hack
+ UINT16 m_unk1_test;
+
+public:
+ emu_timer *m_scanline_timer;
+};
+
+#endif /* PCIMAC_H_ */
+
+
diff --git a/src/mess/includes/mbc55x.h b/src/mess/includes/mbc55x.h
new file mode 100644
index 00000000000..89bb2201894
--- /dev/null
+++ b/src/mess/includes/mbc55x.h
@@ -0,0 +1,228 @@
+/*
+ mbc55x.h
+ Includes for the Sanyo MBC-550, MBC-555.
+
+ Phill Harvey-Smith
+ 2011-01-29.
+*/
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "machine/ram.h"
+#include "machine/ctronics.h"
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/wd17xx.h"
+#include "machine/i8251.h"
+#include "sound/speaker.h"
+#include "video/mc6845.h"
+#include "imagedev/flopdrv.h"
+#include "formats/pc_dsk.h"
+#include "debugger.h"
+#include "debug/debugcon.h"
+
+#define MAINCPU_TAG "maincpu"
+
+#define SCREEN_TAG "screen"
+#define SCREEN_WIDTH_PIXELS 640
+#define SCREEN_HEIGHT_LINES 250
+#define SCREEN_NO_COLOURS 8
+
+#define VIDEO_MEM_SIZE (32*1024)
+#define VID_MC6845_NAME "mc6845"
+
+// Red and blue colour planes sit at a fixed location, green
+// is in main memory.
+
+#define COLOUR_PLANE_SIZE 0x4000
+
+#define RED_PLANE_OFFSET (0*COLOUR_PLANE_SIZE)
+#define BLUE_PLANE_OFFSET (1*COLOUR_PLANE_SIZE)
+
+#define COLOUR_PLANE_MEMBASE 0xF0000
+#define RED_PLANE_MEMBASE (COLOUR_PLANE_MEMBASE+RED_PLANE_OFFSET)
+#define BLUE_PLANE_MEMBASE (COLOUR_PLANE_MEMBASE+BLUE_PLANE_OFFSET)
+
+#define RED_PLANE_TAG "red"
+#define BLUE_PLANE_TAG "blue"
+
+// Keyboard
+
+#define MBC55X_KEYROWS 7
+#define KEYBOARD_QUEUE_SIZE 32
+
+#define KB_BITMASK 0x1000
+#define KB_SHIFTS 12
+
+#define KEY_SPECIAL_TAG "KEY_SPECIAL"
+#define KEY_BIT_LSHIFT 0x01
+#define KEY_BIT_RSHIFT 0x02
+#define KEY_BIT_CTRL 0x04
+#define KEY_BIT_GRAPH 0x08
+
+#define PPI8255_TAG "ppi8255"
+#define PIC8259_TAG "pic8259"
+
+// From tech manual clock c1 is fed from c0, but it approx 100Hz
+#define PIT8253_TAG "pit8253"
+#define PIT_C0_CLOCK 78600
+#define PIT_C1_CLOCK 100
+#define PIT_C2_CLOCK 1789770
+
+#define MONO_TAG "mono"
+#define I8251A_KB_TAG "i8251a_kb"
+#define FDC_TAG "wd1793"
+
+
+typedef struct
+{
+ UINT8 keyrows[MBC55X_KEYROWS];
+ emu_timer *keyscan_timer;
+
+ UINT8 key_special;
+} keyboard_t;
+
+
+class mbc55x_state : public driver_device
+{
+public:
+ mbc55x_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, MAINCPU_TAG),
+ m_crtc(*this, VID_MC6845_NAME),
+ m_kb_uart(*this, I8251A_KB_TAG),
+ m_pit(*this, PIT8253_TAG),
+ m_ppi(*this, PPI8255_TAG),
+ m_pic(*this, PIC8259_TAG),
+ m_fdc(*this, FDC_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<mc6845_device> m_crtc;
+ required_device<i8251_device> m_kb_uart;
+ required_device<device_t> m_pit;
+ required_device<i8255_device> m_ppi;
+ required_device<device_t> m_pic;
+ required_device<device_t> m_fdc;
+ required_device<device_t> m_speaker;
+ required_device<ram_device> m_ram;
+ //DECLARE_READ8_MEMBER(pic8259_r);
+ //DECLARE_WRITE8_MEMBER(pic8259_w);
+ //DECLARE_READ8_MEMBER(mbc55x_disk_r);
+ //DECLARE_WRITE8_MEMBER(mbc55x_disk_w);
+ DECLARE_READ8_MEMBER(mbc55x_usart_r);
+ DECLARE_WRITE8_MEMBER(mbc55x_usart_w);
+ //DECLARE_READ8_MEMBER(mbc55x_kb_usart_r);
+ //DECLARE_WRITE8_MEMBER(mbc55x_kb_usart_w);
+ DECLARE_READ8_MEMBER(vram_page_r);
+ DECLARE_WRITE8_MEMBER(vram_page_w);
+ DECLARE_READ8_MEMBER(ppi8255_r);
+ DECLARE_WRITE8_MEMBER(ppi8255_w);
+ //DECLARE_READ8_MEMBER(pit8253_r);
+ //DECLARE_WRITE8_MEMBER(pit8253_w);
+ DECLARE_READ16_MEMBER(mbc55x_io_r);
+ DECLARE_WRITE16_MEMBER(mbc55x_io_w);
+ DECLARE_READ8_MEMBER(mbc55x_ppi_porta_r);
+ DECLARE_READ8_MEMBER(mbc55x_ppi_portb_r);
+ DECLARE_READ8_MEMBER(mbc55x_ppi_portc_r);
+ DECLARE_WRITE8_MEMBER(mbc55x_ppi_porta_w);
+ DECLARE_WRITE8_MEMBER(mbc55x_ppi_portb_w);
+ DECLARE_WRITE8_MEMBER(mbc55x_ppi_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(vid_hsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(vid_vsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(pit8253_t2);
+ DECLARE_WRITE_LINE_MEMBER(mbc55x_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(mbc55x_fdc_drq_w);
+ UINT32 m_debug_machine;
+ UINT32 m_debug_video;
+ UINT8 m_video_mem[VIDEO_MEM_SIZE];
+ UINT8 m_vram_page;
+
+ keyboard_t m_keyboard;
+ DECLARE_READ8_MEMBER(mbcpic8259_r);
+ DECLARE_WRITE8_MEMBER(mbcpic8259_w);
+ DECLARE_READ8_MEMBER(mbcpit8253_r);
+ DECLARE_WRITE8_MEMBER(mbcpit8253_w);
+ DECLARE_READ8_MEMBER(mbc55x_disk_r);
+ DECLARE_WRITE8_MEMBER(mbc55x_disk_w);
+ DECLARE_READ8_MEMBER(mbc55x_kb_usart_r);
+ DECLARE_WRITE8_MEMBER(mbc55x_kb_usart_w);
+ DECLARE_DRIVER_INIT(mbc55x);
+};
+
+/* IO chips */
+
+
+typedef struct
+{
+} msm_rx_t;
+
+/*----------- defined in drivers/mbc55x.c -----------*/
+
+extern const unsigned char mbc55x_palette[SCREEN_NO_COLOURS][3];
+
+
+/*----------- defined in machine/mbc55x.c -----------*/
+
+extern const struct pit8253_config mbc55x_pit8253_config;
+extern const struct pic8259_interface mbc55x_pic8259_config;
+extern const i8255_interface mbc55x_ppi8255_interface;
+extern const i8251_interface mbc55x_i8251a_interface;
+extern const i8251_interface mbc55x_i8251b_interface;
+
+MACHINE_RESET(mbc55x);
+MACHINE_START(mbc55x);
+
+
+/* Memory controller */
+#define RAM_BANK00_TAG "bank0"
+#define RAM_BANK01_TAG "bank1"
+#define RAM_BANK02_TAG "bank2"
+#define RAM_BANK03_TAG "bank3"
+#define RAM_BANK04_TAG "bank4"
+#define RAM_BANK05_TAG "bank5"
+#define RAM_BANK06_TAG "bank6"
+#define RAM_BANK07_TAG "bank7"
+#define RAM_BANK08_TAG "bank8"
+#define RAM_BANK09_TAG "bank9"
+#define RAM_BANK0A_TAG "banka"
+#define RAM_BANK0B_TAG "bankb"
+#define RAM_BANK0C_TAG "bankc"
+#define RAM_BANK0D_TAG "bankd"
+#define RAM_BANK0E_TAG "banke"
+
+#define RAM_BANK_SIZE (64*1024)
+#define RAM_BANK_COUNT 15
+
+
+READ8_HANDLER(ppi8255_r);
+WRITE8_HANDLER(ppi8255_w);
+
+/* Floppy drive interface */
+
+#define FDC_PAUSE 10000
+
+extern const wd17xx_interface mbc55x_wd17xx_interface;
+
+
+/*----------- defined in video/mbc55x.c -----------*/
+
+extern const mc6845_interface mb55x_mc6845_intf;
+
+READ16_HANDLER (mbc55x_video_io_r);
+WRITE16_HANDLER (mbc55x_video_io_w);
+
+VIDEO_START( mbc55x );
+SCREEN_VBLANK( mbc55x );
+VIDEO_RESET( mbc55x );
+
+#define RED 0
+#define GREEN 1
+#define BLUE 2
+
+#define LINEAR_ADDR(seg,ofs) ((seg<<4)+ofs)
+
+#define OUTPUT_SEGOFS(mess,seg,ofs) logerror("%s=%04X:%04X [%08X]\n",mess,seg,ofs,((seg<<4)+ofs))
diff --git a/src/mess/includes/mbee.h b/src/mess/includes/mbee.h
new file mode 100644
index 00000000000..afb4800a072
--- /dev/null
+++ b/src/mess/includes/mbee.h
@@ -0,0 +1,167 @@
+/*****************************************************************************
+ *
+ * includes/mbee.h
+ *
+ ****************************************************************************/
+
+#ifndef MBEE_H_
+#define MBEE_H_
+
+#include "machine/wd17xx.h"
+#include "imagedev/snapquik.h"
+#include "machine/z80pio.h"
+#include "imagedev/cassette.h"
+#include "machine/ctronics.h"
+#include "machine/mc146818.h"
+#include "video/mc6845.h"
+#include "sound/speaker.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/mc146818.h"
+#include "sound/wave.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+
+
+class mbee_state : public driver_device
+{
+public:
+ mbee_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pio(*this, "z80pio"),
+ m_cass(*this, CASSETTE_TAG),
+ m_wave(*this, WAVE_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_printer(*this, "centronics"),
+ m_crtc(*this, "crtc"),
+ m_fdc(*this, "fdc"),
+ m_rtc(*this, "rtc")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_pio;
+ required_device<cassette_image_device> m_cass;
+ required_device<device_t> m_wave;
+ required_device<device_t> m_speaker;
+ required_device<centronics_device> m_printer;
+ required_device<mc6845_device> m_crtc;
+ optional_device<device_t> m_fdc;
+ optional_device<device_t> m_rtc;
+ DECLARE_WRITE8_MEMBER( mbee_04_w );
+ DECLARE_WRITE8_MEMBER( mbee_06_w );
+ DECLARE_READ8_MEMBER( mbee_07_r );
+ DECLARE_READ8_MEMBER( mbeeic_0a_r );
+ DECLARE_WRITE8_MEMBER( mbeeic_0a_w );
+ DECLARE_READ8_MEMBER( mbeepc_telcom_low_r );
+ DECLARE_READ8_MEMBER( mbeepc_telcom_high_r );
+ DECLARE_READ8_MEMBER( mbee256_speed_low_r );
+ DECLARE_READ8_MEMBER( mbee256_speed_high_r );
+ DECLARE_READ8_MEMBER( mbee256_18_r );
+ DECLARE_WRITE8_MEMBER( mbee64_50_w );
+ DECLARE_WRITE8_MEMBER( mbee128_50_w );
+ DECLARE_WRITE8_MEMBER( mbee256_50_w );
+ DECLARE_READ8_MEMBER( m6545_status_r );
+ DECLARE_WRITE8_MEMBER( m6545_index_w );
+ DECLARE_READ8_MEMBER( m6545_data_r );
+ DECLARE_WRITE8_MEMBER( m6545_data_w );
+ DECLARE_READ8_MEMBER( mbee_low_r );
+ DECLARE_READ8_MEMBER( mbee_high_r );
+ DECLARE_READ8_MEMBER( mbeeic_high_r );
+ DECLARE_WRITE8_MEMBER( mbeeic_high_w );
+ DECLARE_WRITE8_MEMBER( mbee_low_w );
+ DECLARE_WRITE8_MEMBER( mbee_high_w );
+ DECLARE_READ8_MEMBER( mbeeic_08_r );
+ DECLARE_WRITE8_MEMBER( mbeeic_08_w );
+ DECLARE_READ8_MEMBER( mbee_0b_r );
+ DECLARE_WRITE8_MEMBER( mbee_0b_w );
+ DECLARE_READ8_MEMBER( mbeeppc_1c_r );
+ DECLARE_WRITE8_MEMBER( mbeeppc_1c_w );
+ DECLARE_WRITE8_MEMBER( mbee256_1c_w );
+ DECLARE_READ8_MEMBER( mbeeppc_low_r );
+ DECLARE_READ8_MEMBER( mbeeppc_high_r );
+ DECLARE_WRITE8_MEMBER( mbeeppc_high_w );
+ DECLARE_WRITE8_MEMBER( mbeeppc_low_w );
+ DECLARE_WRITE8_MEMBER( pio_port_a_w );
+ DECLARE_WRITE8_MEMBER( pio_port_b_w );
+ DECLARE_READ8_MEMBER( pio_port_b_r );
+ DECLARE_WRITE_LINE_MEMBER( pio_ardy );
+ DECLARE_READ8_MEMBER(mbee_fdc_status_r);
+ DECLARE_WRITE8_MEMBER(mbee_fdc_motor_w);
+ DECLARE_WRITE_LINE_MEMBER(mbee_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(mbee_fdc_drq_w);
+ size_t m_size;
+ UINT8 m_clock_pulse;
+ UINT8 m_mbee256_key_available;
+ UINT8 m_fdc_intrq;
+ UINT8 m_fdc_drq;
+ UINT8 m_mbee256_was_pressed[15];
+ UINT8 m_mbee256_q[20];
+ UINT8 m_mbee256_q_pos;
+ UINT8 m_framecnt;
+ UINT8 *m_p_gfxram;
+ UINT8 *m_p_colorram;
+ UINT8 *m_p_videoram;
+ UINT8 *m_p_attribram;
+ UINT8 m_08;
+ UINT8 m_0a;
+ UINT8 m_0b;
+ UINT8 m_1c;
+ UINT8 m_is_premium;
+ UINT8 m_sy6545_cursor[16];
+ UINT8 m_sy6545_status;
+ UINT8 m_speed;
+ UINT8 m_flash;
+ UINT16 m_cursor;
+ UINT8 m_sy6545_reg[32];
+ UINT8 m_sy6545_ind;
+ void sy6545_cursor_configure();
+ void keyboard_matrix_r(int offs);
+ void mbee_video_kbd_scan(int param);
+ DECLARE_DRIVER_INIT(mbeepc85);
+ DECLARE_DRIVER_INIT(mbee256);
+ DECLARE_DRIVER_INIT(mbee56);
+ DECLARE_DRIVER_INIT(mbeett);
+ DECLARE_DRIVER_INIT(mbeeppc);
+ DECLARE_DRIVER_INIT(mbee);
+ DECLARE_DRIVER_INIT(mbeepc);
+ DECLARE_DRIVER_INIT(mbeeic);
+ DECLARE_DRIVER_INIT(mbee128);
+ DECLARE_DRIVER_INIT(mbee64);
+};
+
+
+/*----------- defined in machine/mbee.c -----------*/
+
+extern const wd17xx_interface mbee_wd17xx_interface;
+extern const z80pio_interface mbee_z80pio_intf;
+
+MACHINE_RESET( mbee );
+MACHINE_RESET( mbee56 );
+MACHINE_RESET( mbee64 );
+MACHINE_RESET( mbee128 );
+MACHINE_RESET( mbee256 );
+MACHINE_RESET( mbeett );
+INTERRUPT_GEN( mbee_interrupt );
+QUICKLOAD_LOAD( mbee );
+
+
+/*----------- defined in video/mbee.c -----------*/
+
+MC6845_UPDATE_ROW( mbee_update_row );
+MC6845_UPDATE_ROW( mbeeic_update_row );
+MC6845_UPDATE_ROW( mbeeppc_update_row );
+MC6845_ON_UPDATE_ADDR_CHANGED( mbee_update_addr );
+MC6845_ON_UPDATE_ADDR_CHANGED( mbee256_update_addr );
+
+VIDEO_START( mbee );
+SCREEN_UPDATE_RGB32( mbee );
+VIDEO_START( mbeeic );
+SCREEN_UPDATE_RGB32( mbeeic );
+VIDEO_START( mbeeppc );
+SCREEN_UPDATE_RGB32( mbeeppc );
+PALETTE_INIT( mbeeic );
+PALETTE_INIT( mbeepc85b );
+PALETTE_INIT( mbeeppc );
+
+#endif /* MBEE_H_ */
diff --git a/src/mess/includes/mc1000.h b/src/mess/includes/mc1000.h
new file mode 100644
index 00000000000..58f902a9793
--- /dev/null
+++ b/src/mess/includes/mc1000.h
@@ -0,0 +1,84 @@
+#ifndef __MC1000__
+#define __MC1000__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/cassette.h"
+#include "video/mc6847.h"
+#include "sound/ay8910.h"
+#include "machine/ctronics.h"
+#include "machine/rescap.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "u13"
+#define AY8910_TAG "u21"
+#define MC6845_TAG "mc6845"
+#define MC6847_TAG "u19"
+#define CENTRONICS_TAG "centronics"
+
+#define MC1000_MC6845_VIDEORAM_SIZE 0x800
+#define MC1000_MC6847_VIDEORAM_SIZE 0x1800
+
+class mc1000_state : public driver_device
+{
+public:
+ mc1000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_vdg(*this, MC6847_TAG),
+ m_crtc(*this, MC6845_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ ,
+ m_mc6845_video_ram(*this, "mc6845_vram"),
+ m_mc6847_video_ram(*this, "mc6847_vram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<mc6847_base_device> m_vdg;
+ optional_device<device_t> m_crtc;
+ required_device<centronics_device> m_centronics;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( printer_r );
+ DECLARE_WRITE8_MEMBER( printer_w );
+ DECLARE_WRITE8_MEMBER( mc6845_ctrl_w );
+ DECLARE_WRITE8_MEMBER( mc6847_attr_w );
+ DECLARE_WRITE_LINE_MEMBER( fs_w );
+ DECLARE_WRITE_LINE_MEMBER( hs_w );
+ DECLARE_READ8_MEMBER( videoram_r );
+ DECLARE_WRITE8_MEMBER( keylatch_w );
+ DECLARE_READ8_MEMBER( keydata_r );
+ DIRECT_UPDATE_MEMBER(mc1000_direct_update_handler);
+
+ void bankswitch();
+
+ /* cpu state */
+ int m_ne555_int;
+
+ /* memory state */
+ int m_rom0000;
+ int m_mc6845_bank;
+ int m_mc6847_bank;
+
+ /* keyboard state */
+ int m_keylatch;
+
+ /* video state */
+ int m_hsync;
+ int m_vsync;
+ required_shared_ptr<UINT8> m_mc6845_video_ram;
+ required_shared_ptr<UINT8> m_mc6847_video_ram;
+ UINT8 m_mc6847_attr;
+ DECLARE_DRIVER_INIT(mc1000);
+};
+
+#endif
diff --git a/src/mess/includes/mc68328.h b/src/mess/includes/mc68328.h
new file mode 100644
index 00000000000..77265833789
--- /dev/null
+++ b/src/mess/includes/mc68328.h
@@ -0,0 +1,175 @@
+/**********************************************************************
+
+ Motorola 68328 ("DragonBall") System-on-a-Chip implementation
+
+ By MooglyGuy
+ contact mooglyguy@gmail.com with licensing and usage questions.
+
+**********************************************************************/
+
+/*****************************************************************************************************************
+
+ P P P P P P P P P P P P P P
+ E E E E E E E J J J J J J J
+ 1 2 3 4 5 6 7 0 1 2 3 4 5 6
+ D D D D D / / / / / / / / / / / / / /
+ 3 4 5 6 7 ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
+ / / / / / ! ! C C C C C C C C C C C C C C C
+ P V P P P P D D G D D D D T T L U V S S S S S S S S G S S S S S S S
+ B C B B B B D D 1 1 N 1 1 1 1 M C W W C A A A A B B B B N C C C C D D D
+ 3 C 4 5 6 7 8 9 0 1 D 2 3 4 5 S K E E C 0 1 2 3 0 1 2 3 D 0 1 2 3 0 1 2
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ +-------------------------------------------------------------------------------+
+ | |
+ | |
+ | |
+ | |
+ | |
+ D2/PB2--| |--PJ7/!CSD3
+ D1/PB1--| |--VCC
+ D0/PB0--| |--PD0/!KBD0/!INT0
+ TDO--| |--PD1/!KBD1/!INT1
+ TDI--| |--PD2/!KBD2/!INT2
+ GND--| |--PD3/!KBD3/!INT3
+ !OE--| |--PD4/!KBD4/!INT4
+ !UDS/PC1--| |--PD5/!KBD5/!INT5
+ !AS--| |--PD6/!KBD6/!INT6
+ A0--| |--PD7/!KBD7/!INT7
+ !LDS--| |--GND
+ R/!W--| |--LD0
+ !DTACK/PC5--| |--LD1
+ !RESET--| |--LD2
+ VCC--| |--LD3
+ !WE/PC6--| |--LFRM
+ !JTAGRST--| |--LLP
+ BBUSW--| MC68328PV |--LCLK
+ A1--| TOP VIEW |--LACD
+ A2--| |--VCC
+ A3--| |--PK0/SPMTXD0
+ A4--| |--PK1/SPMRXD0
+ A5--| |--PK2/SPMCLK0
+ A6--| |--PK3/SPSEN
+ GND--| |--PK4/SPSRXD1
+ A7--| |--PK5/SPSCLK1
+ A8--| |--PK6/!CE2
+ A9--| |--PK7/!CE1
+ A10--| |--GND
+ A11--| |--PM0/!CTS
+ A12--| |--PM1/!RTS
+ A13--| |--PM2/!IRQ6
+ A14--| |--PM3/!IRQ3
+ VCC--| |--PM4/!IRQ2
+ A15--| |--PM5/!IRQ1
+ A16/PA0--| |--PM6/!PENIRQ
+ | |
+ | _ |
+ | (_) |
+ |\ |
+ | \ |
+ +-------------------------------------------------------------------------------+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ P P P P P G P P P P P P P P V P P P P P P P P G P P P V C G P P P E X P
+ A A A A A N A A F F F F F F C F F G G G G G G N G G C C L N C M L X T L
+ 1 2 3 4 5 D 6 7 0 1 2 3 4 5 C 6 7 7 6 5 4 3 2 D 1 0 0 C K D 4 7 L T A L
+ / / / / / / / / / / / / / / / / / / / / / / / / O / / G A L V
+ A A A A A A A A A A A A A A A R T ! T ! P R T M ! U N L C
+ 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 T I T I T W X X O I A D C
+ 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 C N O N O M D D C R R
+ O 1 U 2 U O L Q T
+ T T K 7 G
+ 1 2 P
+ I
+ O
+
+ Figure 12-1. MC68328 144-Lead Plastic Thin-Quad Flat Pack Pin Assignment
+
+ Source: MC68328 (DragonBall)(tm) Integrated Processor User's Manual
+
+*****************************************************************************************************************/
+
+#ifndef __MC68328_H_
+#define __MC68328_H_
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+typedef struct _mc68328_interface mc68328_interface;
+struct _mc68328_interface
+{
+ const char *m68k_cpu_tag;
+
+ write8_device_func out_port_a_func; /* 8-bit output */
+ write8_device_func out_port_b_func; /* 8-bit output */
+ write8_device_func out_port_c_func; /* 8-bit output */
+ write8_device_func out_port_d_func; /* 8-bit output */
+ write8_device_func out_port_e_func; /* 8-bit output */
+ write8_device_func out_port_f_func; /* 8-bit output */
+ write8_device_func out_port_g_func; /* 8-bit output */
+ write8_device_func out_port_j_func; /* 8-bit output */
+ write8_device_func out_port_k_func; /* 8-bit output */
+ write8_device_func out_port_m_func; /* 8-bit output */
+
+ read8_device_func in_port_a_func; /* 8-bit input */
+ read8_device_func in_port_b_func; /* 8-bit input */
+ read8_device_func in_port_c_func; /* 8-bit input */
+ read8_device_func in_port_d_func; /* 8-bit input */
+ read8_device_func in_port_e_func; /* 8-bit input */
+ read8_device_func in_port_f_func; /* 8-bit input */
+ read8_device_func in_port_g_func; /* 8-bit input */
+ read8_device_func in_port_j_func; /* 8-bit input */
+ read8_device_func in_port_k_func; /* 8-bit input */
+ read8_device_func in_port_m_func; /* 8-bit input */
+
+ write8_device_func out_pwm_func; /* 1-bit output */
+
+ write16_device_func out_spim_func; /* 16-bit output */
+ read16_device_func in_spim_func; /* 16-bit input */
+ void (*spim_xch_trigger)( device_t *device ); /* SPIM exchange trigger */
+};
+#define MC68328_INTERFACE(name) const mc68328_interface (name)=
+
+#define MC68328_TAG "dragonball"
+
+/***************************************************************************
+ DEVICE CONFIGURATION MACROS
+***************************************************************************/
+
+#define MCFG_MC68328_ADD(_intrf) \
+ MCFG_DEVICE_ADD("dragonball", MC68328, 0) \
+ MCFG_DEVICE_CONFIG(_intrf)
+
+/*----------- defined in machine/mc68328.c -----------*/
+
+/***************************************************************************
+ READ/WRITE HANDLERS
+***************************************************************************/
+
+WRITE16_DEVICE_HANDLER( mc68328_w );
+READ16_DEVICE_HANDLER( mc68328_r );
+
+
+/***************************************************************************
+ EXTERNAL I/O LINES
+***************************************************************************/
+
+void mc68328_set_penirq_line(device_t *device, int state);
+void mc68328_set_port_d_lines(device_t *device, UINT8 state, int bit);
+
+/***************************************************************************
+ DEVICE INTERFACE
+***************************************************************************/
+
+DECLARE_LEGACY_DEVICE(MC68328, mc68328);
+
+/*----------- defined in video/mc68328.c -----------*/
+
+/***************************************************************************
+ VIDEO INTERFACE
+***************************************************************************/
+
+PALETTE_INIT( mc68328 );
+VIDEO_START( mc68328 );
+SCREEN_UPDATE_IND16( mc68328 );
+
+#endif // __MC68328_H_
diff --git a/src/mess/includes/mc80.h b/src/mess/includes/mc80.h
new file mode 100644
index 00000000000..af1dd9cbda2
--- /dev/null
+++ b/src/mess/includes/mc80.h
@@ -0,0 +1,85 @@
+/*****************************************************************************
+ *
+ * includes/mc80.h
+ *
+ ****************************************************************************/
+
+#ifndef MC80_H_
+#define MC80_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "machine/z80ctc.h"
+#include "machine/z80pio.h"
+#include "machine/z80sio.h"
+
+class mc80_state : public driver_device
+{
+public:
+ mc80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_p_videoram(*this, "p_videoram"){ }
+
+ DECLARE_WRITE8_MEMBER(mc8030_zve_write_protect_w);
+ DECLARE_WRITE8_MEMBER(mc8030_vis_w);
+ DECLARE_WRITE8_MEMBER(mc8030_eprom_prog_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z0_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z1_w);
+ DECLARE_READ8_MEMBER(mc80_port_b_r);
+ DECLARE_READ8_MEMBER(mc80_port_a_r);
+ DECLARE_WRITE8_MEMBER(mc80_port_a_w);
+ DECLARE_WRITE8_MEMBER(mc80_port_b_w);
+ DECLARE_READ8_MEMBER(zve_port_a_r);
+ DECLARE_READ8_MEMBER(zve_port_b_r);
+ DECLARE_WRITE8_MEMBER(zve_port_a_w);
+ DECLARE_WRITE8_MEMBER(zve_port_b_w);
+ DECLARE_READ8_MEMBER(asp_port_a_r);
+ DECLARE_READ8_MEMBER(asp_port_b_r);
+ DECLARE_WRITE8_MEMBER(asp_port_a_w);
+ DECLARE_WRITE8_MEMBER(asp_port_b_w);
+ optional_shared_ptr<UINT8> m_p_videoram;
+};
+
+
+/*----------- defined in machine/mc80.c -----------*/
+
+/*****************************************************************************/
+/* Implementation for MC80.2x */
+/*****************************************************************************/
+
+extern MACHINE_RESET(mc8020);
+extern const z80ctc_interface mc8020_ctc_intf;
+extern const z80pio_interface mc8020_z80pio_intf;
+
+/*****************************************************************************/
+/* Implementation for MC80.3x */
+/*****************************************************************************/
+
+
+extern MACHINE_RESET(mc8030);
+extern const z80pio_interface mc8030_zve_z80pio_intf;
+extern const z80pio_interface mc8030_asp_z80pio_intf;
+extern const z80ctc_interface mc8030_zve_z80ctc_intf;
+extern const z80ctc_interface mc8030_asp_z80ctc_intf;
+extern const z80sio_interface mc8030_asp_z80sio_intf;
+
+
+/*----------- defined in video/mc80.c -----------*/
+
+/*****************************************************************************/
+/* Implementation for MC80.2x */
+/*****************************************************************************/
+
+
+extern VIDEO_START( mc8020 );
+extern SCREEN_UPDATE_IND16( mc8020 );
+
+/*****************************************************************************/
+/* Implementation for MC80.3x */
+/*****************************************************************************/
+
+
+extern VIDEO_START( mc8030 );
+extern SCREEN_UPDATE_IND16( mc8030 );
+
+#endif /* MC80_H_ */
diff --git a/src/mess/includes/micronic.h b/src/mess/includes/micronic.h
new file mode 100644
index 00000000000..2dfab0f9244
--- /dev/null
+++ b/src/mess/includes/micronic.h
@@ -0,0 +1,65 @@
+/*****************************************************************************
+
+ includes/micronic.h
+
+*****************************************************************************/
+
+#ifndef __MICRONIC__
+#define __MICRONIC__
+
+#include "cpu/z80/z80.h"
+#include "video/hd61830.h"
+#include "machine/mc146818.h"
+#include "machine/ram.h"
+#include "sound/beep.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define MC146818_TAG "mc146818"
+#define HD61830_TAG "hd61830"
+
+class micronic_state : public driver_device
+{
+public:
+ micronic_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_lcdc(*this, HD61830_TAG),
+ m_beep(*this, BEEPER_TAG),
+ m_rtc(*this, MC146818_TAG),
+ m_ram(*this, RAM_TAG)
+ ,
+ m_ram_base(*this, "ram_base"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<hd61830_device> m_lcdc;
+ required_device<device_t> m_beep;
+ required_device<mc146818_device> m_rtc;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( keypad_r );
+ DECLARE_READ8_MEMBER( status_flag_r );
+ DECLARE_WRITE8_MEMBER( status_flag_w );
+ DECLARE_WRITE8_MEMBER( kp_matrix_w );
+ DECLARE_WRITE8_MEMBER( beep_w );
+ DECLARE_READ8_MEMBER( irq_flag_r );
+ DECLARE_WRITE8_MEMBER( port_2c_w );
+ DECLARE_WRITE8_MEMBER( bank_select_w );
+ DECLARE_WRITE8_MEMBER( lcd_contrast_w );
+ DECLARE_WRITE8_MEMBER( rtc_address_w );
+ DECLARE_READ8_MEMBER( rtc_data_r );
+ DECLARE_WRITE8_MEMBER( rtc_data_w );
+ DECLARE_WRITE_LINE_MEMBER( mc146818_irq );
+
+ required_shared_ptr<UINT8> m_ram_base;
+ UINT8 m_banks_num;
+ UINT8 m_kp_matrix;
+ UINT8 m_lcd_contrast;
+ bool m_lcd_backlight;
+ UINT8 m_status_flag;
+};
+
+#endif
diff --git a/src/mess/includes/microtan.h b/src/mess/includes/microtan.h
new file mode 100644
index 00000000000..1a5a2411596
--- /dev/null
+++ b/src/mess/includes/microtan.h
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * Microtan 65
+ *
+ * variables and function prototypes
+ *
+ * Juergen Buchmueller <pullmoll@t-online.de>, Jul 2000
+ *
+ * Thanks go to Geoff Macdonald <mail@geoff.org.uk>
+ * for his site http://www.geo255.redhotant.com
+ * and to Fabrice Frances <frances@ensica.fr>
+ * for his site http://www.ifrance.com/oric/microtan.html
+ *
+ ******************************************************************************/
+
+#ifndef MICROTAN_H_
+#define MICROTAN_H_
+
+#include "imagedev/snapquik.h"
+#include "machine/6522via.h"
+
+
+class microtan_state : public driver_device
+{
+public:
+ microtan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_videoram(*this, "videoram"){ }
+
+ required_shared_ptr<UINT8> m_videoram;
+ UINT8 m_chunky_graphics;
+ UINT8 *m_chunky_buffer;
+ UINT8 m_keypad_column;
+ UINT8 m_keyboard_ascii;
+ emu_timer *m_timer;
+ int m_via_0_irq_line;
+ int m_via_1_irq_line;
+ int m_kbd_irq_line;
+ UINT8 m_keyrows[10];
+ int m_lastrow;
+ int m_mask;
+ int m_key;
+ int m_repeat;
+ int m_repeater;
+ tilemap_t *m_bg_tilemap;
+ DECLARE_READ8_MEMBER(microtan_sound_r);
+ DECLARE_WRITE8_MEMBER(microtan_sound_w);
+ DECLARE_READ8_MEMBER(microtan_bffx_r);
+ DECLARE_WRITE8_MEMBER(microtan_bffx_w);
+ DECLARE_WRITE8_MEMBER(microtan_videoram_w);
+ DECLARE_DRIVER_INIT(microtan);
+};
+
+
+/*----------- defined in machine/microtan.c -----------*/
+
+extern const via6522_interface microtan_via6522_0;
+extern const via6522_interface microtan_via6522_1;
+
+MACHINE_RESET( microtan );
+
+SNAPSHOT_LOAD( microtan );
+QUICKLOAD_LOAD( microtan_hexfile );
+
+INTERRUPT_GEN( microtan_interrupt );
+
+
+
+/*----------- defined in video/microtan.c -----------*/
+
+
+extern VIDEO_START( microtan );
+extern SCREEN_UPDATE_IND16( microtan );
+
+
+#endif /* MICROTAN_H_ */
diff --git a/src/mess/includes/mikro80.h b/src/mess/includes/mikro80.h
new file mode 100644
index 00000000000..35f6b6b86de
--- /dev/null
+++ b/src/mess/includes/mikro80.h
@@ -0,0 +1,48 @@
+/*****************************************************************************
+ *
+ * includes/mikro80.h
+ *
+ ****************************************************************************/
+
+#ifndef MIKRO80_H_
+#define MIKRO80_H_
+
+#include "machine/i8255.h"
+
+class mikro80_state : public driver_device
+{
+public:
+ mikro80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_cursor_ram(*this, "cursor_ram"),
+ m_video_ram(*this, "video_ram"){ }
+
+ required_shared_ptr<UINT8> m_cursor_ram;
+ required_shared_ptr<UINT8> m_video_ram;
+ int m_keyboard_mask;
+ int m_key_mask;
+ DECLARE_READ8_MEMBER(mikro80_8255_portb_r);
+ DECLARE_READ8_MEMBER(mikro80_8255_portc_r);
+ DECLARE_WRITE8_MEMBER(mikro80_8255_porta_w);
+ DECLARE_WRITE8_MEMBER(mikro80_8255_portc_w);
+ DECLARE_READ8_MEMBER(mikro80_keyboard_r);
+ DECLARE_WRITE8_MEMBER(mikro80_keyboard_w);
+ DECLARE_WRITE8_MEMBER(mikro80_tape_w);
+ DECLARE_READ8_MEMBER(mikro80_tape_r);
+ DECLARE_DRIVER_INIT(radio99);
+ DECLARE_DRIVER_INIT(mikro80);
+};
+
+
+/*----------- defined in machine/mikro80.c -----------*/
+
+extern const i8255_interface mikro80_ppi8255_interface;
+
+extern MACHINE_RESET( mikro80 );
+
+/*----------- defined in video/mikro80.c -----------*/
+
+extern VIDEO_START( mikro80 );
+extern SCREEN_UPDATE_IND16( mikro80 );
+
+#endif /* UT88_H_ */
diff --git a/src/mess/includes/mikromik.h b/src/mess/includes/mikromik.h
new file mode 100644
index 00000000000..29e4c0f76c8
--- /dev/null
+++ b/src/mess/includes/mikromik.h
@@ -0,0 +1,123 @@
+#pragma once
+
+#ifndef __MIKROMIKKO__
+#define __MIKROMIKKO__
+
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/am9517a.h"
+#include "machine/i8212.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "machine/upd765.h"
+#include "machine/upd7201.h"
+#include "video/i8275.h"
+#include "video/upd7220.h"
+#include "sound/speaker.h"
+
+#define SCREEN_TAG "screen"
+#define I8085A_TAG "ic40"
+#define I8212_TAG "ic12"
+#define I8237_TAG "ic45"
+#define I8253_TAG "ic6"
+#define UPD765_TAG "ic15"
+#define I8275_TAG "ic59"
+#define UPD7201_TAG "ic11"
+#define UPD7220_TAG "ic101"
+
+class mm1_state : public driver_device
+{
+public:
+ mm1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8085A_TAG),
+ m_iop(*this, I8212_TAG),
+ m_dmac(*this, I8237_TAG),
+ m_pit(*this, I8253_TAG),
+ m_crtc(*this, I8275_TAG),
+ m_fdc(*this, UPD765_TAG),
+ m_mpsc(*this, UPD7201_TAG),
+ m_hgdc(*this, UPD7220_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_ram(*this, RAM_TAG),
+ m_video_ram(*this, "video_ram")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<i8212_device> m_iop;
+ required_device<am9517a_device> m_dmac;
+ required_device<device_t> m_pit;
+ required_device<device_t> m_crtc;
+ required_device<device_t> m_fdc;
+ required_device<upd7201_device> m_mpsc;
+ required_device<upd7220_device> m_hgdc;
+ required_device<device_t> m_speaker;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<ram_device> m_ram;
+ required_shared_ptr<UINT8> m_video_ram;
+
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( mmu_r );
+ DECLARE_WRITE8_MEMBER( mmu_w );
+ DECLARE_WRITE8_MEMBER( ls259_w );
+ DECLARE_READ8_MEMBER( kb_r );
+ DECLARE_WRITE_LINE_MEMBER( dma_hrq_changed );
+ DECLARE_READ8_MEMBER( mpsc_dack_r );
+ DECLARE_WRITE8_MEMBER( mpsc_dack_w );
+ DECLARE_WRITE_LINE_MEMBER( tc_w );
+ DECLARE_WRITE_LINE_MEMBER( dack3_w );
+ DECLARE_WRITE_LINE_MEMBER( itxc_w );
+ DECLARE_WRITE_LINE_MEMBER( irxc_w );
+ DECLARE_WRITE_LINE_MEMBER( auxc_w );
+ DECLARE_WRITE_LINE_MEMBER( drq2_w );
+ DECLARE_WRITE_LINE_MEMBER( drq1_w );
+ DECLARE_READ_LINE_MEMBER( dsra_r );
+
+ void scan_keyboard();
+
+ const UINT8 *m_mmu_rom;
+ int m_a8;
+
+ // keyboard state
+ int m_sense;
+ int m_drive;
+ UINT8 m_keydata;
+ const UINT8 *m_key_rom;
+
+ // video state
+ bitmap_ind16 m_bitmap;
+ const UINT8 *m_char_rom;
+ int m_llen;
+
+ // serial state
+ int m_intc;
+ int m_rx21;
+ int m_tx21;
+ int m_rcl;
+
+ // floppy state
+ int m_recall;
+ int m_dack3;
+ int m_tc;
+};
+
+
+//----------- defined in video/mikromik.c -----------
+
+MACHINE_CONFIG_EXTERN( mm1m6_video );
+
+
+
+#endif
diff --git a/src/mess/includes/mpf1.h b/src/mess/includes/mpf1.h
new file mode 100644
index 00000000000..638e80554b8
--- /dev/null
+++ b/src/mess/includes/mpf1.h
@@ -0,0 +1,60 @@
+#pragma once
+
+#ifndef __MPF1__
+#define __MPF1__
+
+
+#include "emu.h"
+#include "audio/spchroms.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "imagedev/cassette.h"
+#include "machine/i8255.h"
+#include "machine/z80ctc.h"
+#include "machine/z80pio.h"
+#include "machine/z80sio.h"
+#include "sound/speaker.h"
+#include "sound/tms5220.h"
+
+#define Z80_TAG "u1"
+#define Z80CTC_TAG "u11"
+#define Z80PIO_TAG "u10"
+#define I8255A_TAG "u14"
+#define TMS5220_TAG "tms5220"
+
+class mpf1_state : public driver_device
+{
+public:
+ mpf1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<device_t> m_speaker;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( ppi_pa_r );
+ DECLARE_WRITE8_MEMBER( ppi_pb_w );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_irq );
+ DECLARE_DIRECT_UPDATE_MEMBER(mpf1_direct_update_handler);
+
+ int m_break;
+ int m_m1;
+
+ UINT8 m_lednum;
+
+ emu_timer *m_led_refresh_timer;
+ DECLARE_DRIVER_INIT(mpf1);
+};
+
+#endif
diff --git a/src/mess/includes/mpz80.h b/src/mess/includes/mpz80.h
new file mode 100644
index 00000000000..5cd33f52803
--- /dev/null
+++ b/src/mess/includes/mpz80.h
@@ -0,0 +1,103 @@
+#pragma once
+
+#ifndef __MPZ80__
+#define __MPZ80__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ram.h"
+#include "machine/s100.h"
+#include "machine/s100_dj2db.h"
+#include "machine/s100_djdma.h"
+#include "machine/s100_mm65k16s.h"
+#include "machine/s100_wunderbus.h"
+#include "machine/terminal.h"
+
+#define Z80_TAG "17a"
+#define AM9512_TAG "17d"
+#define TERMINAL_TAG "terminal"
+
+class mpz80_state : public driver_device
+{
+public:
+ mpz80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ram(*this, RAM_TAG),
+ m_terminal(*this, TERMINAL_TAG),
+ m_s100(*this, S100_TAG),
+ m_nmi(1),
+ m_pint(1),
+ m_int_pend(0),
+ m_pretrap(0),
+ m_trap(0),
+ m_trap_reset(0),
+ m_trap_void(1),
+ m_trap_halt(1),
+ m_trap_int(1),
+ m_trap_stop(1),
+ m_trap_aux(1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+ required_device<generic_terminal_device> m_terminal;
+ required_device<s100_device> m_s100;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ inline offs_t get_address(offs_t offset);
+ inline offs_t get_io_address(offs_t offset);
+
+ inline void check_traps();
+ inline void check_interrupt();
+
+ DECLARE_READ8_MEMBER( mmu_r );
+ DECLARE_WRITE8_MEMBER( mmu_w );
+ DECLARE_READ8_MEMBER( mmu_io_r );
+ DECLARE_WRITE8_MEMBER( mmu_io_w );
+ DECLARE_READ8_MEMBER( trap_addr_r );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_READ8_MEMBER( switch_r );
+ DECLARE_READ8_MEMBER( status_r );
+ DECLARE_WRITE8_MEMBER( disp_seg_w );
+ DECLARE_WRITE8_MEMBER( disp_col_w );
+ DECLARE_WRITE8_MEMBER( task_w );
+ DECLARE_WRITE8_MEMBER( mask_w );
+ DECLARE_WRITE8_MEMBER( terminal_w );
+ DECLARE_WRITE_LINE_MEMBER( s100_pint_w );
+ DECLARE_WRITE_LINE_MEMBER( s100_nmi_w );
+ DECLARE_DIRECT_UPDATE_MEMBER(mpz80_direct_update_handler);
+
+ // memory state
+ UINT32 m_addr;
+ UINT8 m_task;
+ UINT8 m_mask;
+
+ // interrupt state
+ int m_nmi;
+ int m_pint;
+ int m_int_pend;
+
+ // trap state
+ UINT8 m_pretrap_addr;
+ UINT8 m_trap_addr;
+ UINT8 m_status;
+ UINT16 m_trap_start;
+ int m_pretrap;
+ int m_trap;
+ int m_trap_reset;
+ int m_trap_void;
+ int m_trap_halt;
+ int m_trap_int;
+ int m_trap_stop;
+ int m_trap_aux;
+ UINT8 *m_map_ram;
+ DECLARE_DRIVER_INIT(mpz80);
+};
+
+#endif
diff --git a/src/mess/includes/msbc1.h b/src/mess/includes/msbc1.h
new file mode 100644
index 00000000000..5a582e79b45
--- /dev/null
+++ b/src/mess/includes/msbc1.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#ifndef __MSBC1__
+#define __MSBC1__
+
+#define MC68000R12_TAG "u50"
+#define MK68564_0_TAG "u14"
+#define MK68564_1_TAG "u15"
+#define MC68230L10_TAG "u16"
+
+class msbc1_state : public driver_device
+{
+public:
+ msbc1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ virtual void machine_reset();
+};
+
+#endif
diff --git a/src/mess/includes/msx.h b/src/mess/includes/msx.h
new file mode 100644
index 00000000000..39f2f2a9ade
--- /dev/null
+++ b/src/mess/includes/msx.h
@@ -0,0 +1,149 @@
+/*****************************************************************************
+ *
+ * includes/msx.h
+ *
+ ****************************************************************************/
+
+#ifndef __MSX_H__
+#define __MSX_H__
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "machine/i8255.h"
+#include "machine/rp5c01.h"
+#include "machine/wd17xx.h"
+#include "machine/ctronics.h"
+#include "sound/ay8910.h"
+#include "sound/dac.h"
+#include "sound/wave.h"
+#include "sound/k051649.h"
+#include "sound/2413intf.h"
+#include "video/v9938.h"
+#include "video/tms9928a.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "formats/basicdsk.h"
+#include "formats/fmsx_cas.h"
+#include "formats/msx_dsk.h"
+//#include "osdepend.h"
+#include "hashfile.h"
+#include "includes/msx_slot.h"
+
+#define MSX_MAX_CARTS (2)
+
+#define TC8521_TAG "rtc"
+
+class msx_state : public driver_device
+{
+public:
+ msx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_v9938(*this, "v9938"),
+ m_cass(*this, CASSETTE_TAG),
+ m_ym(*this, "ym2413"),
+ m_dac(*this, "dac"),
+ m_rtc(*this, TC8521_TAG)
+ { }
+
+ DECLARE_WRITE8_MEMBER(msx_page0_w);
+ DECLARE_WRITE8_MEMBER(msx_page0_1_w);
+ DECLARE_WRITE8_MEMBER(msx_page1_w);
+ DECLARE_WRITE8_MEMBER(msx_page1_1_w);
+ DECLARE_WRITE8_MEMBER(msx_page1_2_w);
+ DECLARE_WRITE8_MEMBER(msx_page2_w);
+ DECLARE_WRITE8_MEMBER(msx_page2_1_w);
+ DECLARE_WRITE8_MEMBER(msx_page2_2_w);
+ DECLARE_WRITE8_MEMBER(msx_page2_3_w);
+ DECLARE_WRITE8_MEMBER(msx_page3_w);
+ DECLARE_WRITE8_MEMBER(msx_page3_1_w);
+ DECLARE_WRITE8_MEMBER(msx_sec_slot_w);
+ DECLARE_READ8_MEMBER(msx_sec_slot_r);
+ DECLARE_WRITE8_MEMBER(msx_ram_mapper_w);
+ DECLARE_READ8_MEMBER(msx_ram_mapper_r);
+ DECLARE_READ8_MEMBER(msx_kanji_r);
+ DECLARE_WRITE8_MEMBER(msx_kanji_w);
+ DECLARE_WRITE8_MEMBER(msx_90in1_w);
+ DECLARE_WRITE8_MEMBER(msx_ppi_port_a_w);
+ DECLARE_WRITE8_MEMBER(msx_ppi_port_c_w);
+ DECLARE_READ8_MEMBER(msx_ppi_port_b_r);
+ DECLARE_WRITE8_MEMBER(msx_fmpac_w);
+ DECLARE_READ8_MEMBER(msx_rtc_reg_r);
+ DECLARE_WRITE8_MEMBER(msx_rtc_reg_w);
+ DECLARE_WRITE8_MEMBER(msx_rtc_latch_w);
+ DECLARE_WRITE_LINE_MEMBER(msx_wd179x_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(msx_wd179x_drq_w);
+
+
+ /* PSG */
+ int m_psg_b;
+ int m_opll_active;
+ /* mouse */
+ UINT16 m_mouse[2];
+ int m_mouse_stat[2];
+ /* rtc */
+ int m_rtc_latch;
+ /* disk */
+ UINT8 m_dsk_stat;
+ /* kanji */
+ UINT8 *m_kanji_mem;
+ int m_kanji_latch;
+ /* memory */
+ const msx_slot_layout *layout;
+ slot_state *m_cart_state[MSX_MAX_CARTS];
+ slot_state *m_state[4];
+ const msx_slot *m_slot[4];
+ UINT8 *m_ram_pages[4];
+ UINT8 *m_empty, m_ram_mapper[4];
+ UINT8 m_ramio_set_bits;
+ slot_state *m_all_state[4][4][4];
+ int m_slot_expanded[4];
+ UINT8 m_primary_slot;
+ UINT8 m_secondary_slot[4];
+ UINT8 m_superloadrunner_bank;
+ UINT8 m_korean90in1_bank;
+ UINT8 *m_top_page;
+ int m_port_c_old;
+ int keylatch;
+ void msx_memory_map_all ();
+ void msx_memory_map_page (UINT8 page);
+ void msx_ch_reset_core ();
+ void msx_memory_reset ();
+
+ optional_device<v9938_device> m_v9938;
+ required_device<cassette_image_device> m_cass;
+ required_device<device_t> m_ym;
+ required_device<dac_device> m_dac;
+ optional_device<rp5c01_device> m_rtc;
+ DECLARE_READ8_MEMBER(msx_psg_port_a_r);
+ DECLARE_READ8_MEMBER(msx_psg_port_b_r);
+ DECLARE_WRITE8_MEMBER(msx_psg_port_a_w);
+ DECLARE_WRITE8_MEMBER(msx_psg_port_b_w);
+ DECLARE_DRIVER_INIT(msx);
+};
+
+
+/*----------- defined in machine/msx.c -----------*/
+
+extern const i8255_interface msx_ppi8255_interface;
+extern const wd17xx_interface msx_wd17xx_interface;
+/* start/stop functions */
+extern MACHINE_START( msx );
+extern MACHINE_START( msx2 );
+extern MACHINE_RESET( msx );
+extern MACHINE_RESET( msx2 );
+extern INTERRUPT_GEN( msx_interrupt );
+extern TIMER_DEVICE_CALLBACK( msx2_interrupt );
+
+DEVICE_IMAGE_LOAD( msx_cart );
+DEVICE_IMAGE_UNLOAD( msx_cart );
+
+void msx_vdp_interrupt(device_t *, v99x8_device &device, int i);
+
+/* I/O functions */
+READ8_DEVICE_HANDLER( msx_printer_status_r );
+WRITE8_DEVICE_HANDLER( msx_printer_strobe_w );
+WRITE8_DEVICE_HANDLER( msx_printer_data_w );
+
+
+#endif /* __MSX_H__ */
diff --git a/src/mess/includes/msx_slot.h b/src/mess/includes/msx_slot.h
new file mode 100644
index 00000000000..b8889207282
--- /dev/null
+++ b/src/mess/includes/msx_slot.h
@@ -0,0 +1,258 @@
+/*****************************************************************************
+ *
+ * includes/msx_slot.h
+ *
+ ****************************************************************************/
+
+#ifndef MSX_SLOT_H_
+#define MSX_SLOT_H_
+
+
+enum {
+ MSX_LAYOUT_SLOT_ENTRY,
+ MSX_LAYOUT_KANJI_ENTRY,
+ MSX_LAYOUT_RAMIO_SET_BITS_ENTRY,
+ MSX_LAYOUT_LAST
+};
+
+typedef struct {
+ int entry;
+ int type;
+ int slot_primary, slot_secondary, slot_page, page_extent;
+ int size, option;
+} msx_slot_layout;
+
+#define MSX_LAYOUT_INIT(msx) \
+static const msx_slot_layout msx_slot_layout_##msx[] = {
+
+#define MSX_LAYOUT_SLOT(prim, sec, page, extend, type, size, option) \
+ { \
+ MSX_LAYOUT_SLOT_ENTRY, \
+ SLOT_##type, \
+ prim, \
+ sec, \
+ page, \
+ extend, \
+ size, \
+ option \
+ },
+
+#define MSX_LAYOUT_KANJI(offset) \
+ { \
+ MSX_LAYOUT_KANJI_ENTRY, \
+ SLOT_EMPTY, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ offset \
+ },
+
+#define MSX_LAYOUT_RAMIO_SET_BITS(offset) \
+ { \
+ MSX_LAYOUT_RAMIO_SET_BITS_ENTRY, \
+ SLOT_EMPTY, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ offset \
+ },
+
+#define MSX_LAYOUT_END \
+ { \
+ MSX_LAYOUT_LAST, \
+ SLOT_END, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ 0 \
+ } \
+};
+
+
+enum msx_slot_type {
+ SLOT_EMPTY = 0,
+ SLOT_MSXDOS2,
+ SLOT_KONAMI_SCC,
+ SLOT_KONAMI,
+ SLOT_ASCII8,
+ SLOT_ASCII16,
+ SLOT_GAMEMASTER2,
+ SLOT_ASCII8_SRAM,
+ SLOT_ASCII16_SRAM,
+ SLOT_RTYPE,
+ SLOT_MAJUTSUSHI,
+ SLOT_FMPAC,
+ SLOT_SUPERLOADRUNNER,
+ SLOT_SYNTHESIZER,
+ SLOT_CROSS_BLAIM,
+ SLOT_DISK_ROM,
+ SLOT_KOREAN_80IN1,
+ SLOT_KOREAN_126IN1,
+ SLOT_KOREAN_90IN1,
+ SLOT_LAST_CARTRIDGE_TYPE = SLOT_KOREAN_90IN1,
+ SLOT_SOUNDCARTRIDGE,
+ SLOT_ROM,
+ SLOT_RAM,
+ SLOT_RAM_MM,
+ SLOT_CARTRIDGE1,
+ SLOT_CARTRIDGE2,
+ SLOT_DISK_ROM2,
+ SLOT_END
+};
+
+enum msx_mem_type {
+ MSX_MEM_ROM,
+ MSX_MEM_RAM,
+ MSX_MEM_HANDLER
+};
+
+typedef struct {
+ int m_type;
+ int m_start_page;
+ int m_bank_mask;
+ int m_banks[4];
+ int m_size;
+ UINT8 *m_mem;
+ const char *m_sramfile;
+ union {
+ struct {
+ UINT8 *mem;
+ int sram_support;
+ int sram_active;
+ int opll_active;
+ } fmpac;
+ struct {
+ int active;
+ } scc;
+ struct {
+ UINT8 *mem;
+ int sram_mask;
+ int empty_mask;
+ } sram;
+ struct {
+ int scc_active;
+ int sccp_active;
+ int ram_mode[4];
+ int banks_saved[4];
+ int mode;
+ } sccp;
+ } m_cart;
+} slot_state;
+
+typedef struct {
+ int slot_type;
+ int mem_type;
+ char name[32];
+ int (*init)(running_machine &machine, slot_state*, int page, UINT8 *mem, int size);
+ void (*reset)(running_machine &machine, slot_state*);
+ void (*map)(running_machine &machine, slot_state*, int page);
+ void (*write)(running_machine &machine, slot_state*, UINT16, UINT8);
+ int (*loadsram)(running_machine &machine, slot_state*);
+ int (*savesram)(running_machine &machine, slot_state*);
+} msx_slot;
+
+extern const msx_slot msx_slot_list[];
+
+#define MSX_SLOT_START \
+const msx_slot msx_slot_list[] = {
+
+#define MSX_SLOT_ROM(type, ent) { \
+ type, \
+ MSX_MEM_ROM, \
+ #type, \
+ slot_##ent##_init, \
+ slot_##ent##_reset, \
+ slot_##ent##_map, \
+ NULL, \
+ NULL, \
+ NULL \
+},
+
+#define MSX_SLOT_RAM(type, ent) { \
+ type, \
+ MSX_MEM_RAM, \
+ #type, \
+ slot_##ent##_init, \
+ slot_##ent##_reset, \
+ slot_##ent##_map, \
+ NULL, \
+ NULL, \
+ NULL \
+},
+
+#define MSX_SLOT(type, ent) { \
+ type, \
+ MSX_MEM_HANDLER, \
+ #type, \
+ slot_##ent##_init, \
+ slot_##ent##_reset, \
+ slot_##ent##_map, \
+ slot_##ent##_write, \
+ NULL, \
+ NULL \
+},
+
+#define MSX_SLOT_SRAM(type, ent) { \
+ type, \
+ MSX_MEM_HANDLER, \
+ #type, \
+ slot_##ent##_init, \
+ slot_##ent##_reset, \
+ slot_##ent##_map, \
+ slot_##ent##_write, \
+ slot_##ent##_loadsram, \
+ slot_##ent##_savesram \
+},
+
+#define MSX_SLOT_NULL(type) { \
+ type, \
+ MSX_MEM_ROM, \
+ #type, \
+ NULL, \
+ NULL, \
+ NULL, \
+ NULL, \
+ NULL, \
+ NULL \
+},
+
+#define MSX_SLOT_END \
+ { SLOT_END, 0, "", NULL, NULL, NULL, NULL, NULL } \
+};
+
+#define MSX_SLOT_INIT(nm) static int \
+ slot_##nm##_init (running_machine &machine, slot_state *state, int page, UINT8 *mem, int size)
+#define MSX_SLOT_MAP(nm) \
+ static void slot_##nm##_map (running_machine &machine, slot_state *state, int page)
+#define MSX_SLOT_WRITE(nm) \
+ static void slot_##nm##_write (running_machine &machine, slot_state *state, UINT16 addr, UINT8 val)
+#define MSX_SLOT_RESET(nm) \
+ static void slot_##nm##_reset (running_machine &machine, slot_state *state)
+#define MSX_SLOT_LOADSRAM(nm) \
+ static int slot_##nm##_loadsram (running_machine &machine, slot_state *state)
+#define MSX_SLOT_SAVESRAM(nm) \
+ static int slot_##nm##_savesram (running_machine &machine, slot_state *state)
+
+typedef struct {
+ char name[9];
+ const msx_slot_layout *layout;
+} msx_driver_struct;
+
+extern const msx_driver_struct msx_driver_list[];
+
+#define MSX_DRIVER_LIST \
+const msx_driver_struct msx_driver_list[] = {
+#define MSX_DRIVER(foo) \
+ { #foo, msx_slot_layout_##foo },
+#define MSX_DRIVER_END \
+ { "", NULL } \
+};
+
+
+#endif /* MSX_SLOT_H_ */
diff --git a/src/mess/includes/mtx.h b/src/mess/includes/mtx.h
new file mode 100644
index 00000000000..f103cf5bebd
--- /dev/null
+++ b/src/mess/includes/mtx.h
@@ -0,0 +1,82 @@
+/*************************************************************************
+
+ Memotech MTX 500, MTX 512 and RS 128
+
+*************************************************************************/
+
+#ifndef __MTX__
+#define __MTX__
+
+#include "imagedev/snapquik.h"
+#include "imagedev/cassette.h"
+#include "machine/ctronics.h"
+#include "machine/z80ctc.h"
+
+#define Z80_TAG "z80"
+#define Z80CTC_TAG "z80ctc"
+#define Z80DART_TAG "z80dart"
+#define FD1793_TAG "fd1793" // SDX
+#define FD1791_TAG "fd1791" // FDX
+#define SN76489A_TAG "sn76489a"
+#define MC6845_TAG "mc6845"
+#define SCREEN_TAG "screen"
+#define CENTRONICS_TAG "centronics"
+
+class mtx_state : public driver_device
+{
+public:
+ mtx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ /* keyboard state */
+ UINT8 m_key_sense;
+
+ /* video state */
+ UINT8 *m_video_ram;
+ UINT8 *m_attr_ram;
+
+ /* sound state */
+ UINT8 m_sound_latch;
+
+ /* devices */
+ z80ctc_device *m_z80ctc;
+ device_t *m_z80dart;
+ cassette_image_device *m_cassette;
+ centronics_device *m_centronics;
+
+ /* timers */
+ device_t *m_cassette_timer;
+ DECLARE_WRITE8_MEMBER(mtx_bankswitch_w);
+ DECLARE_WRITE8_MEMBER(mtx_sound_latch_w);
+ DECLARE_WRITE8_MEMBER(mtx_sense_w);
+ DECLARE_READ8_MEMBER(mtx_key_lo_r);
+ DECLARE_READ8_MEMBER(mtx_key_hi_r);
+ DECLARE_WRITE8_MEMBER(hrx_address_w);
+ DECLARE_READ8_MEMBER(hrx_data_r);
+ DECLARE_WRITE8_MEMBER(hrx_data_w);
+ DECLARE_READ8_MEMBER(hrx_attr_r);
+ DECLARE_WRITE8_MEMBER(hrx_attr_w);
+};
+
+/*----------- defined in machine/mtx.c -----------*/
+
+MACHINE_START( mtx512 );
+MACHINE_RESET( mtx512 );
+SNAPSHOT_LOAD( mtx );
+
+
+/* Sound */
+READ8_DEVICE_HANDLER( mtx_sound_strobe_r );
+
+/* Cassette */
+WRITE8_DEVICE_HANDLER( mtx_cst_w );
+
+/* Printer */
+READ8_DEVICE_HANDLER( mtx_strobe_r );
+READ8_DEVICE_HANDLER( mtx_prt_r );
+
+/* Keyboard */
+
+/* HRX */
+
+#endif /* __MTX_H__ */
diff --git a/src/mess/includes/mz700.h b/src/mess/includes/mz700.h
new file mode 100644
index 00000000000..d013b1b968c
--- /dev/null
+++ b/src/mess/includes/mz700.h
@@ -0,0 +1,106 @@
+/******************************************************************************
+ * Sharp MZ700
+ *
+ * variables and function prototypes
+ *
+ * Juergen Buchmueller <pullmoll@t-online.de>, Jul 2000
+ *
+ * Reference: http://sharpmz.computingmuseum.com
+ *
+ ******************************************************************************/
+
+#ifndef MZ700_H_
+#define MZ700_H_
+
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "machine/z80pio.h"
+
+
+class mz_state : public driver_device
+{
+public:
+ mz_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ int m_mz700; /* 1 if running on an mz700 */
+
+ device_t *m_pit;
+ i8255_device *m_ppi;
+
+ int m_cursor_timer;
+ int m_other_timer;
+
+ int m_intmsk; /* PPI8255 pin PC2 */
+
+ int m_mz700_ram_lock; /* 1 if ram lock is active */
+ int m_mz700_ram_vram; /* 1 if vram is banked in */
+
+ /* mz800 specific */
+ UINT8 *m_cgram;
+
+ int m_mz700_mode; /* 1 if in mz700 mode */
+ int m_mz800_ram_lock; /* 1 if lock is active */
+ int m_mz800_ram_monitor; /* 1 if monitor rom banked in */
+
+ int m_hires_mode; /* 1 if in 640x200 mode */
+ int m_screen; /* screen designation */
+ UINT8 *m_colorram;
+ UINT8 *m_videoram;
+ UINT8 m_speaker_level;
+ UINT8 m_prev_state;
+ UINT16 m_mz800_ramaddr;
+ UINT8 m_mz800_palette[4];
+ UINT8 m_mz800_palette_bank;
+ DECLARE_READ8_MEMBER(mz700_e008_r);
+ DECLARE_WRITE8_MEMBER(mz700_e008_w);
+ DECLARE_READ8_MEMBER(mz800_bank_0_r);
+ DECLARE_WRITE8_MEMBER(mz700_bank_0_w);
+ DECLARE_WRITE8_MEMBER(mz800_bank_0_w);
+ DECLARE_READ8_MEMBER(mz800_bank_1_r);
+ DECLARE_WRITE8_MEMBER(mz700_bank_1_w);
+ DECLARE_WRITE8_MEMBER(mz700_bank_2_w);
+ DECLARE_WRITE8_MEMBER(mz700_bank_3_w);
+ DECLARE_WRITE8_MEMBER(mz700_bank_4_w);
+ DECLARE_WRITE8_MEMBER(mz700_bank_5_w);
+ DECLARE_WRITE8_MEMBER(mz700_bank_6_w);
+ DECLARE_READ8_MEMBER(mz800_crtc_r);
+ DECLARE_WRITE8_MEMBER(mz800_write_format_w);
+ DECLARE_WRITE8_MEMBER(mz800_read_format_w);
+ DECLARE_WRITE8_MEMBER(mz800_display_mode_w);
+ DECLARE_WRITE8_MEMBER(mz800_scroll_border_w);
+ DECLARE_READ8_MEMBER(mz800_ramdisk_r);
+ DECLARE_WRITE8_MEMBER(mz800_ramdisk_w);
+ DECLARE_WRITE8_MEMBER(mz800_ramaddr_w);
+ DECLARE_WRITE8_MEMBER(mz800_palette_w);
+ DECLARE_WRITE8_MEMBER(mz800_cgram_w);
+ DECLARE_DRIVER_INIT(mz800);
+ DECLARE_DRIVER_INIT(mz700);
+};
+
+
+/*----------- defined in machine/mz700.c -----------*/
+
+extern const struct pit8253_config mz700_pit8253_config;
+extern const struct pit8253_config mz800_pit8253_config;
+extern const i8255_interface mz700_ppi8255_interface;
+extern const z80pio_interface mz800_z80pio_config;
+
+MACHINE_START( mz700 );
+
+/* bank switching */
+
+/* bankswitching, mz800 only */
+
+
+
+
+/*----------- defined in video/mz700.c -----------*/
+
+PALETTE_INIT( mz700 );
+SCREEN_UPDATE_IND16( mz700 );
+VIDEO_START( mz800 );
+SCREEN_UPDATE_IND16( mz800 );
+
+
+#endif /* MZ700_H_ */
diff --git a/src/mess/includes/mz80.h b/src/mess/includes/mz80.h
new file mode 100644
index 00000000000..f6cae9ccd4e
--- /dev/null
+++ b/src/mess/includes/mz80.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ *
+ * includes/mz80.h
+ *
+ ****************************************************************************/
+
+#ifndef MZ80_H_
+#define MZ80_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "imagedev/cassette.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+
+class mz80_state : public driver_device
+{
+public:
+ mz80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pit(*this, "pit8253"),
+ m_ppi(*this, "ppi8255"),
+ m_cass(*this, CASSETTE_TAG),
+ m_speaker(*this, SPEAKER_TAG)
+ ,
+ m_p_ram(*this, "p_ram"),
+ m_p_videoram(*this, "p_videoram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_pit;
+ required_device<i8255_device> m_ppi;
+ required_device<cassette_image_device> m_cass;
+ required_device<device_t> m_speaker;
+ DECLARE_READ8_MEMBER(mz80k_strobe_r);
+ DECLARE_WRITE8_MEMBER(mz80k_strobe_w);
+ DECLARE_READ8_MEMBER(mz80k_8255_portb_r);
+ DECLARE_READ8_MEMBER(mz80k_8255_portc_r);
+ DECLARE_WRITE8_MEMBER(mz80k_8255_porta_w);
+ DECLARE_WRITE8_MEMBER(mz80k_8255_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(pit_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(pit_out2_changed);
+ bool m_mz80k_vertical;
+ bool m_mz80k_tempo_strobe;
+ UINT8 m_speaker_level;
+ bool m_prev_state;
+ UINT8 m_mz80k_cursor_cnt;
+ UINT8 m_mz80k_keyboard_line;
+ required_shared_ptr<const UINT8> m_p_ram;
+ const UINT8 *m_p_chargen;
+ required_shared_ptr<const UINT8> m_p_videoram;
+ DECLARE_DRIVER_INIT(mz80k);
+};
+
+
+/*----------- defined in machine/mz80.c -----------*/
+
+extern MACHINE_RESET( mz80k );
+extern const i8255_interface mz80k_8255_int;
+extern const struct pit8253_config mz80k_pit8253_config;
+
+
+/*----------- defined in video/mz80.c -----------*/
+
+extern const gfx_layout mz80k_charlayout;
+extern const gfx_layout mz80kj_charlayout;
+
+extern VIDEO_START( mz80k );
+extern SCREEN_UPDATE_IND16( mz80k );
+extern SCREEN_UPDATE_IND16( mz80kj );
+extern SCREEN_UPDATE_IND16( mz80a );
+
+#endif /* MZ80_H_ */
diff --git a/src/mess/includes/nascom1.h b/src/mess/includes/nascom1.h
new file mode 100644
index 00000000000..0289fe0e036
--- /dev/null
+++ b/src/mess/includes/nascom1.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ *
+ * includes/nascom1.h
+ *
+ ****************************************************************************/
+
+#ifndef NASCOM1_H_
+#define NASCOM1_H_
+
+#include "imagedev/snapquik.h"
+#include "machine/wd17xx.h"
+
+typedef struct
+{
+ UINT8 stat_flags;
+ UINT8 stat_count;
+} nascom1_portstat_t;
+
+typedef struct
+{
+ UINT8 select;
+ UINT8 irq;
+ UINT8 drq;
+} nascom2_fdc_t;
+
+
+class nascom1_state : public driver_device
+{
+public:
+ nascom1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_videoram(*this, "videoram"){ }
+
+ required_shared_ptr<UINT8> m_videoram;
+ device_t *m_hd6402;
+ int m_tape_size;
+ UINT8 *m_tape_image;
+ int m_tape_index;
+ nascom1_portstat_t m_portstat;
+ nascom2_fdc_t m_nascom2_fdc;
+ DECLARE_READ8_MEMBER(nascom2_fdc_select_r);
+ DECLARE_WRITE8_MEMBER(nascom2_fdc_select_w);
+ DECLARE_READ8_MEMBER(nascom2_fdc_status_r);
+ DECLARE_READ8_MEMBER(nascom1_port_00_r);
+ DECLARE_WRITE8_MEMBER(nascom1_port_00_w);
+ DECLARE_READ8_MEMBER(nascom1_port_01_r);
+ DECLARE_WRITE8_MEMBER(nascom1_port_01_w);
+ DECLARE_READ8_MEMBER(nascom1_port_02_r);
+ DECLARE_DRIVER_INIT(nascom1);
+};
+
+
+/*----------- defined in machine/nascom1.c -----------*/
+
+extern const wd17xx_interface nascom2_wd17xx_interface;
+
+DEVICE_IMAGE_LOAD( nascom1_cassette );
+DEVICE_IMAGE_UNLOAD( nascom1_cassette );
+SNAPSHOT_LOAD( nascom1 );
+
+
+
+READ8_DEVICE_HANDLER( nascom1_hd6402_si );
+WRITE8_DEVICE_HANDLER( nascom1_hd6402_so );
+
+MACHINE_RESET( nascom1 );
+MACHINE_RESET( nascom2 );
+
+/*----------- defined in video/nascom1.c -----------*/
+
+SCREEN_UPDATE_IND16( nascom1 );
+SCREEN_UPDATE_IND16( nascom2 );
+
+
+#endif /* NASCOM1_H_ */
diff --git a/src/mess/includes/nc.h b/src/mess/includes/nc.h
new file mode 100644
index 00000000000..d03a11cedcf
--- /dev/null
+++ b/src/mess/includes/nc.h
@@ -0,0 +1,103 @@
+/*****************************************************************************
+ *
+ * includes/nc.h
+ *
+ ****************************************************************************/
+
+#ifndef NC_H_
+#define NC_H_
+
+
+#define NC_NUM_COLOURS 4
+
+#define NC_SCREEN_WIDTH 480
+#define NC_SCREEN_HEIGHT 64
+
+#define NC200_SCREEN_WIDTH 480
+#define NC200_SCREEN_HEIGHT 128
+
+#define NC200_NUM_COLOURS 4
+
+enum
+{
+ NC_TYPE_1xx, /* nc100/nc150 */
+ NC_TYPE_200 /* nc200 */
+};
+
+
+class nc_state : public driver_device
+{
+public:
+ nc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ emu_timer *m_serial_timer;
+ char m_memory_config[4];
+ emu_timer *m_keyboard_timer;
+ int m_membank_rom_mask;
+ int m_membank_internal_ram_mask;
+ UINT8 m_poweroff_control;
+ int m_card_status;
+ unsigned char m_uart_control;
+ int m_irq_mask;
+ int m_irq_status;
+ int m_irq_latch;
+ int m_irq_latch_mask;
+ int m_sound_channel_periods[2];
+ emu_file *m_file;
+ int m_previous_inputport_10_state;
+ int m_previous_alarm_state;
+ UINT8 m_nc200_uart_interrupt_irq;
+ unsigned char *m_card_ram;
+ int m_membank_card_ram_mask;
+ unsigned long m_display_memory_start;
+ UINT8 m_type;
+ int m_card_size;
+ int m_nc200_backlight;
+ DECLARE_READ8_MEMBER(nc_memory_management_r);
+ DECLARE_WRITE8_MEMBER(nc_memory_management_w);
+ DECLARE_WRITE8_MEMBER(nc_irq_mask_w);
+ DECLARE_WRITE8_MEMBER(nc_irq_status_w);
+ DECLARE_READ8_MEMBER(nc_irq_status_r);
+ DECLARE_READ8_MEMBER(nc_key_data_in_r);
+ DECLARE_WRITE8_MEMBER(nc_sound_w);
+ DECLARE_WRITE8_MEMBER(nc_uart_control_w);
+ DECLARE_WRITE8_MEMBER(nc100_display_memory_start_w);
+ DECLARE_WRITE8_MEMBER(nc100_uart_control_w);
+ DECLARE_WRITE8_MEMBER(nc100_poweroff_control_w);
+ DECLARE_READ8_MEMBER(nc100_card_battery_status_r);
+ DECLARE_WRITE8_MEMBER(nc100_memory_card_wait_state_w);
+ DECLARE_WRITE8_MEMBER(nc200_display_memory_start_w);
+ DECLARE_READ8_MEMBER(nc200_card_battery_status_r);
+ DECLARE_READ8_MEMBER(nc200_printer_status_r);
+ DECLARE_WRITE8_MEMBER(nc200_uart_control_w);
+ DECLARE_WRITE8_MEMBER(nc200_memory_card_wait_state_w);
+ DECLARE_WRITE8_MEMBER(nc200_poweroff_control_w);
+};
+
+
+/*----------- defined in video/nc.c -----------*/
+
+extern VIDEO_START( nc );
+extern SCREEN_UPDATE_IND16( nc );
+extern PALETTE_INIT( nc );
+
+void nc200_video_set_backlight(running_machine &machine, int state);
+
+
+/*----------- defined in drivers/nc.c -----------*/
+
+/* pointer to loaded data */
+/* mask used to stop access over end of card ram area */
+
+
+void nc_set_card_present_state(running_machine &machine, int state);
+
+
+/*----------- defined in machine/nc.c -----------*/
+
+DEVICE_START( nc_pcmcia_card );
+DEVICE_IMAGE_LOAD( nc_pcmcia_card );
+DEVICE_IMAGE_UNLOAD( nc_pcmcia_card );
+
+#endif /* NC_H_ */
diff --git a/src/mess/includes/nes.h b/src/mess/includes/nes.h
new file mode 100644
index 00000000000..c395c214249
--- /dev/null
+++ b/src/mess/includes/nes.h
@@ -0,0 +1,287 @@
+/*****************************************************************************
+ *
+ * includes/nes.h
+ *
+ * Nintendo Entertainment System (Famicom)
+ *
+ ****************************************************************************/
+
+#ifndef NES_H_
+#define NES_H_
+
+
+/***************************************************************************
+ CONSTANTS
+***************************************************************************/
+
+#define NTSC_CLOCK N2A03_DEFAULTCLOCK /* 1.789772 MHz */
+#define PAL_CLOCK (26601712.0/16) /* 1.662607 MHz */
+
+#define NES_BATTERY_SIZE 0x2000
+
+
+/***************************************************************************
+ TYPE DEFINITIONS
+***************************************************************************/
+
+struct nes_input
+{
+ UINT32 shift;
+ UINT32 i0, i1, i2;
+};
+
+/*PPU fast banking constants and structures */
+
+#define CHRROM 0
+#define CHRRAM 1
+
+typedef struct
+{
+ int source; //defines source of base pointer
+ int origin; //defines offset of 0x400 byte segment at base pointer
+ UINT8* access; //source translated + origin -> valid pointer!
+} chr_bank;
+
+/*PPU nametable fast banking constants and structures */
+
+#define CIRAM 0
+#define ROM 1
+#define EXRAM 2
+#define MMC5FILL 3
+#define CART_NTRAM 4
+
+#define NES_BATTERY 0
+#define NES_WRAM 1
+
+typedef struct
+{
+ int source; /* defines source of base pointer */
+ int origin; /* defines offset of 0x400 byte segment at base pointer */
+ int writable; /* ExRAM, at least, can be write-protected AND used as nametable */
+ UINT8* access; /* direct access when possible */
+} name_table;
+
+typedef void (*nes_prg_callback)(running_machine &machine, int start, int bank);
+typedef void (*nes_chr_callback)(running_machine &machine, int start, int bank, int source);
+
+class nes_state : public driver_device
+{
+public:
+ nes_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ /* input_related - this part has to be cleaned up (e.g. in_2 and in_3 are not really necessary here...) */
+ nes_input m_in_0, m_in_1, m_in_2, m_in_3;
+ UINT8 m_fck_scan, m_fck_mode;
+
+ int m_prg_bank[5];
+ chr_bank m_chr_map[8]; //quick banking structure, because some of this changes multiple times per scanline!
+ name_table m_nt_page[4]; //quick banking structure for a maximum of 4K of RAM/ROM/ExRAM
+
+ int m_chr_open_bus;
+ int m_prgram_bank5_start, m_battery_bank5_start, m_empty_bank5_start;
+
+ UINT8 m_ce_mask, m_ce_state;
+ UINT8 m_vrc_ls_prg_a, m_vrc_ls_prg_b, m_vrc_ls_chr;
+
+ int m_MMC5_floodtile;
+ int m_MMC5_floodattr;
+ int m_mmc5_vram_control;
+ UINT8 m_mmc5_high_chr;
+ UINT8 m_mmc5_split_scr;
+ UINT8 *m_extended_ntram;
+
+ UINT8 m_mmc5_last_chr_a;
+ UINT16 m_mmc5_vrom_regA[8];
+ UINT16 m_mmc5_vrom_regB[4];
+ UINT8 m_mmc5_prg_regs[4];
+ UINT8 m_mmc5_bank_security;
+ UINT8 m_mmc5_prg_mode;
+ UINT8 m_mmc5_chr_mode;
+ UINT8 m_mmc5_chr_high;
+ UINT8 m_mmc5_split_ctrl;
+ UINT8 m_mmc5_split_yst;
+ UINT8 m_mmc5_split_bank;
+
+ /* video-related */
+ int m_nes_vram_sprite[8]; /* Used only by mmc5 for now */
+ int m_last_frame_flip;
+
+ /* misc */
+ write8_space_func m_mmc_write_low;
+ const char *m_mmc_write_low_name;
+ write8_space_func m_mmc_write_mid;
+ const char *m_mmc_write_mid_name;
+ write8_space_func m_mmc_write;
+ const char *m_mmc_write_name;
+ read8_space_func m_mmc_read_low;
+ const char *m_mmc_read_low_name;
+ read8_space_func m_mmc_read_mid;
+ const char *m_mmc_read_mid_name;
+ read8_space_func m_mmc_read;
+ const char *m_mmc_read_name;
+ emu_timer *m_irq_timer;
+
+ nes_prg_callback m_mmc3_prg_cb; // these are used to simplify a lot emulation of some MMC3 pirate clones
+ nes_chr_callback m_mmc3_chr_cb;
+
+ /* devices */
+ device_t *m_maincpu;
+ ppu2c0x_device *m_ppu;
+ device_t *m_sound;
+ device_t *m_cart;
+
+ /* misc region to be allocated at init */
+ // variables which don't change at run-time
+ UINT8 *m_rom;
+ UINT8 *m_prg;
+ UINT8 *m_vrom;
+ UINT8 *m_vram;
+ UINT8 *m_wram;
+ UINT8 *m_ciram; //PPU nametable RAM - external to PPU!
+ UINT8 *m_battery_ram;
+ UINT8 *m_mapper_ram;
+ UINT8 *m_mapper_bram;
+
+ /***** Mapper-related variables *****/
+
+ // common ones
+ int m_IRQ_enable, m_IRQ_enable_latch;
+ UINT16 m_IRQ_count, m_IRQ_count_latch;
+ UINT8 m_IRQ_toggle;
+ UINT8 m_IRQ_reset;
+ UINT8 m_IRQ_status;
+ UINT8 m_IRQ_mode;
+ UINT8 m_IRQ_clear;
+ int m_mult1, m_mult2;
+
+ UINT8 m_mmc_chr_source; // This is set at init to CHRROM or CHRRAM. a few mappers can swap between
+ // the two (this is done in the specific handlers).
+
+ UINT8 m_mmc_cmd1, m_mmc_cmd2; // These represent registers where the mapper writes important values
+ UINT8 m_mmc_count; // This is used as counter in mappers like 1 and 45
+
+ int m_mmc_prg_base, m_mmc_prg_mask; // MMC3 based multigame carts select a block of banks by using these (and then act like normal MMC3),
+ int m_mmc_chr_base, m_mmc_chr_mask; // while MMC3 and clones (mapper 118 & 119) simply set them as 0 and 0xff resp.
+
+ UINT8 m_mmc_prg_bank[6]; // Many mappers writes only some bits of the selected bank (for both PRG and CHR),
+ UINT8 m_mmc_vrom_bank[16]; // hence these are handy to latch bank values.
+
+ UINT16 m_MMC5_vrom_bank[12]; // MMC5 has 10bit wide VROM regs!
+ UINT8 m_mmc_extra_bank[16]; // some MMC3 clone have 2 series of PRG/CHR banks...
+ // we collect them all here: first 4 elements PRG banks, then 6/8 CHR banks
+
+ UINT8 m_mmc_latch1, m_mmc_latch2;
+ UINT8 m_mmc_reg[16];
+
+ UINT8 m_mmc_dipsetting;
+
+ // misc mapper related variables which should be merged with the above one, where possible
+ int m_mmc1_reg_write_enable;
+ int m_mmc1_latch;
+ int m_mmc1_count;
+
+ int m_mmc3_latch;
+ int m_mmc3_wram_protect;
+ int m_mmc3_alt_irq;
+
+ int m_MMC5_rom_bank_mode;
+ int m_MMC5_vrom_bank_mode;
+ int m_MMC5_vram_protect;
+ int m_MMC5_scanline;
+ int m_vrom_page_a;
+ int m_vrom_page_b;
+ // int vrom_next[4];
+
+ UINT8 m_mmc6_reg;
+
+ // these might be unified in single mmc_reg[] array, together with state->m_mmc_cmd1 & state->m_mmc_cmd2
+ // but be careful that MMC3 clones often use state->m_mmc_cmd1/state->m_mmc_cmd2 (from base MMC3) AND additional regs below!
+ UINT8 m_mapper83_reg[10];
+ UINT8 m_mapper83_low_reg[4];
+ UINT8 m_txc_reg[4]; // used by mappers 132, 172 & 173
+ UINT8 m_subor_reg[4]; // used by mappers 166 & 167
+ UINT8 m_sachen_reg[8]; // used by mappers 137, 138, 139 & 141
+ UINT8 m_map52_reg_written;
+ UINT8 m_map114_reg, m_map114_reg_enabled;
+
+ /***** NES-cart related *****/
+
+ /* load-time cart variables which remain constant */
+ UINT16 m_prg_chunks; // iNES 2.0 allows for more chunks (a recently dumped multigame cart has 256 chunks of both PRG & CHR!)
+ UINT16 m_chr_chunks;
+ UINT16 m_vram_chunks;
+ UINT8 m_trainer;
+ UINT8 m_battery; // if there is PRG RAM with battery backup
+ UINT32 m_battery_size;
+ UINT8 m_prg_ram; // if there is PRG RAM with no backup
+ UINT32 m_wram_size;
+ UINT32 m_mapper_ram_size;
+ UINT32 m_mapper_bram_size;
+
+ /* system variables which don't change at run-time */
+ UINT16 m_mapper; // for iNES
+ UINT16 m_pcb_id; // for UNIF & xml
+ UINT8 m_four_screen_vram;
+ UINT8 m_hard_mirroring;
+ UINT8 m_crc_hack; // this is needed to detect different boards sharing the same Mappers (shame on .nes format)
+ UINT8 m_ines20;
+
+ /***** FDS-floppy related *****/
+
+ int m_disk_expansion;
+
+ UINT8 m_fds_sides;
+ UINT8 *m_fds_data; // here, we store a copy of the disk
+ UINT8 *m_fds_ram; // here, we emulate the RAM adapter
+
+ /* Variables which can change */
+ UINT8 m_fds_motor_on;
+ UINT8 m_fds_door_closed;
+ UINT8 m_fds_current_side;
+ UINT32 m_fds_head_position;
+ UINT8 m_fds_status0;
+ UINT8 m_fds_read_mode;
+ UINT8 m_fds_write_reg;
+
+ /* these are used in the mapper 20 handlers */
+ int m_fds_last_side;
+ int m_fds_count;
+ DECLARE_READ8_MEMBER(nes_IN0_r);
+ DECLARE_READ8_MEMBER(nes_IN1_r);
+ DECLARE_WRITE8_MEMBER(nes_IN0_w);
+ DECLARE_WRITE8_MEMBER(nes_IN1_w);
+ DECLARE_READ8_MEMBER(nes_fds_r);
+ DECLARE_WRITE8_MEMBER(nes_fds_w);
+ DECLARE_WRITE8_MEMBER(nes_vh_sprite_dma_w);
+ DECLARE_DRIVER_INIT(famicom);
+};
+
+
+/*----------- defined in machine/nes.c -----------*/
+
+
+/* protos */
+
+DEVICE_IMAGE_LOAD(nes_cart);
+DEVICE_START(nes_disk);
+DEVICE_IMAGE_LOAD(nes_disk);
+DEVICE_IMAGE_UNLOAD(nes_disk);
+
+MACHINE_START( nes );
+MACHINE_RESET( nes );
+
+
+
+int nes_ppu_vidaccess( device_t *device, int address, int data );
+
+void nes_partialhash(hash_collection &dest, const unsigned char *data, unsigned long length, const char *functions);
+
+/*----------- defined in video/nes.c -----------*/
+
+PALETTE_INIT( nes );
+VIDEO_START( nes );
+SCREEN_UPDATE_IND16( nes );
+
+
+#endif /* NES_H_ */
diff --git a/src/mess/includes/newbrain.h b/src/mess/includes/newbrain.h
new file mode 100644
index 00000000000..02f982fbcda
--- /dev/null
+++ b/src/mess/includes/newbrain.h
@@ -0,0 +1,226 @@
+#pragma once
+
+#ifndef __NEWBRAIN__
+#define __NEWBRAIN__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "cpu/cop400/cop400.h"
+#include "machine/upd765.h"
+#include "machine/6850acia.h"
+#include "machine/adc0808.h"
+#include "machine/z80ctc.h"
+#include "machine/z80sio.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+#include "imagedev/cassette.h"
+#include "machine/rescap.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "409"
+#define COP420_TAG "419"
+#define MC6850_TAG "459"
+#define ADC0809_TAG "427"
+#define DAC0808_TAG "461"
+#define Z80CTC_TAG "458"
+#define FDC_Z80_TAG "416"
+#define UPD765_TAG "418"
+
+#define NEWBRAIN_EIM_RAM_SIZE 0x10000
+
+#define NEWBRAIN_ENRG1_CLK 0x01
+#define NEWBRAIN_ENRG1_TVP 0x04
+#define NEWBRAIN_ENRG1_CTS 0x10
+#define NEWBRAIN_ENRG1_DO 0x20
+#define NEWBRAIN_ENRG1_PO 0x80
+#define NEWBRAIN_ENRG1_UST_BIT_1_MASK 0x30
+#define NEWBRAIN_ENRG1_UST_BIT_0_MASK 0xc0
+
+#define NEWBRAIN_ENRG2_USERP 0x01
+#define NEWBRAIN_ENRG2_ANP 0x02
+#define NEWBRAIN_ENRG2_MLTMD 0x04
+#define NEWBRAIN_ENRG2_MSPD 0x08
+#define NEWBRAIN_ENRG2_ENOR 0x10
+#define NEWBRAIN_ENRG2_ANSW 0x20
+#define NEWBRAIN_ENRG2_ENOT 0x40
+#define NEWBRAIN_ENRG2_CENTRONICS_OUT 0x80
+
+#define NEWBRAIN_VIDEO_RV 0x01
+#define NEWBRAIN_VIDEO_FS 0x02
+#define NEWBRAIN_VIDEO_32_40 0x04
+#define NEWBRAIN_VIDEO_UCR 0x08
+#define NEWBRAIN_VIDEO_80L 0x40
+
+class newbrain_state : public driver_device
+{
+public:
+ newbrain_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_copcpu(*this, COP420_TAG),
+ m_cassette1(*this, CASSETTE_TAG),
+ m_cassette2(*this, CASSETTE2_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_copcpu;
+ required_device<cassette_image_device> m_cassette1;
+ required_device<cassette_image_device> m_cassette2;
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ enum
+ {
+ TIMER_ID_RESET,
+ TIMER_ID_PWRUP
+ };
+
+ DECLARE_WRITE8_MEMBER( enrg1_w );
+ DECLARE_WRITE8_MEMBER( a_enrg1_w );
+ DECLARE_READ8_MEMBER( ust_r );
+ DECLARE_READ8_MEMBER( a_ust_r );
+ DECLARE_READ8_MEMBER( user_r );
+ DECLARE_WRITE8_MEMBER( user_w );
+ DECLARE_READ8_MEMBER( clclk_r );
+ DECLARE_WRITE8_MEMBER( clclk_w );
+ DECLARE_READ8_MEMBER( clusr_r );
+ DECLARE_WRITE8_MEMBER( clusr_w );
+ DECLARE_READ8_MEMBER( cop_l_r );
+ DECLARE_WRITE8_MEMBER( cop_l_w );
+ DECLARE_WRITE8_MEMBER( cop_g_w );
+ DECLARE_READ8_MEMBER( cop_g_r );
+ DECLARE_WRITE8_MEMBER( cop_d_w );
+ DECLARE_READ8_MEMBER( cop_in_r );
+ DECLARE_WRITE8_MEMBER( cop_sk_w );
+ DECLARE_READ8_MEMBER( cop_si_r );
+ DECLARE_WRITE8_MEMBER( cop_so_w );
+ DECLARE_READ8_MEMBER( tvl_r );
+ DECLARE_WRITE8_MEMBER( tvl_w );
+ DECLARE_WRITE8_MEMBER( tvctl_w );
+ DECLARE_READ8_MEMBER( cop_r );
+ DECLARE_WRITE8_MEMBER( cop_w );
+
+ void check_interrupt();
+ void bankswitch();
+ void tvram_w(UINT8 data, int a6);
+ inline int get_reset_t();
+ inline int get_pwrup_t();
+ void screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ // processor state
+ int m_pwrup; // power up
+ int m_userint; // user interrupt
+ int m_userint0; // parallel port interrupt
+ int m_clkint; // clock interrupt
+ int m_aciaint; // ACIA interrupt
+ int m_copint; // COP interrupt
+ int m_anint; // A/DC interrupt
+ int m_bee; // identity
+ UINT8 m_enrg1; // enable register 1
+ UINT8 m_enrg2; // enable register 2
+ int m_acia_rxd; // ACIA receive
+ int m_acia_txd; // ACIA transmit
+
+ // COP420 state
+ UINT8 m_cop_bus; // data bus
+ int m_cop_so; // serial out
+ int m_cop_tdo; // tape data output
+ int m_cop_tdi; // tape data input
+ int m_cop_rd; // memory read
+ int m_cop_wr; // memory write
+ int m_cop_access; // COP access
+
+ // keyboard state
+ int m_keylatch; // keyboard row
+ int m_keydata; // keyboard column
+
+ // video state
+ int m_segment_data[16]; // VF segment data
+ int m_tvcnsl; // TV console required
+ int m_tvctl; // TV control register
+ UINT16 m_tvram; // TV start address
+ UINT8 *m_char_rom; // character ROM
+
+ // user bus state
+ UINT8 m_user;
+
+ // devices
+ UINT8 m_copdata;
+ int m_copstate;
+ int m_copbytes;
+ int m_copregint;
+};
+
+class newbrain_eim_state : public newbrain_state
+{
+public:
+ newbrain_eim_state(const machine_config &mconfig, device_type type, const char *tag)
+ : newbrain_state(mconfig, type, tag),
+ m_fdccpu(*this, FDC_Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_acia(*this, MC6850_TAG),
+ m_fdc(*this, UPD765_TAG),
+ m_floppy(*this, FLOPPY_0)
+ { }
+
+ required_device<cpu_device> m_fdccpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<acia6850_device> m_acia;
+ required_device<device_t> m_fdc;
+ required_device<device_t> m_floppy;
+
+ virtual void machine_start();
+
+ DECLARE_WRITE8_MEMBER( fdc_auxiliary_w );
+ DECLARE_READ8_MEMBER( fdc_control_r );
+ DECLARE_READ8_MEMBER( ust2_r );
+ DECLARE_WRITE8_MEMBER( enrg2_w );
+ DECLARE_WRITE8_MEMBER( pr_w );
+ DECLARE_READ8_MEMBER( user_r );
+ DECLARE_WRITE8_MEMBER( user_w );
+ DECLARE_READ8_MEMBER( anout_r );
+ DECLARE_WRITE8_MEMBER( anout_w );
+ DECLARE_READ8_MEMBER( anin_r );
+ DECLARE_WRITE8_MEMBER( anio_w );
+ DECLARE_READ8_MEMBER( st0_r );
+ DECLARE_READ8_MEMBER( st1_r );
+ DECLARE_READ8_MEMBER( st2_r );
+ DECLARE_READ8_MEMBER( usbs_r );
+ DECLARE_WRITE8_MEMBER( usbs_w );
+ DECLARE_WRITE8_MEMBER( paging_w );
+ DECLARE_READ_LINE_MEMBER( acia_rx );
+ DECLARE_WRITE_LINE_MEMBER( acia_tx );
+ DECLARE_WRITE_LINE_MEMBER( acia_interrupt );
+ DECLARE_WRITE_LINE_MEMBER( fdc_interrupt );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z0_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
+ DECLARE_WRITE_LINE_MEMBER( adc_eoc_w );
+
+ void bankswitch();
+
+ // paging state
+ int m_paging; // paging enabled
+ int m_mpm; // multi paging mode ?
+ int m_a16; // address line 16
+ UINT8 m_pr[16]; // expansion interface paging register
+ UINT8 *m_eim_ram; // expansion interface RAM
+
+ // floppy state
+ int m_fdc_int; // interrupt
+ int m_fdc_att; // attention
+};
+
+// ---------- defined in video/newbrain.c ----------
+
+MACHINE_CONFIG_EXTERN( newbrain_video );
+
+#endif
diff --git a/src/mess/includes/next.h b/src/mess/includes/next.h
new file mode 100644
index 00000000000..470f2b8b02e
--- /dev/null
+++ b/src/mess/includes/next.h
@@ -0,0 +1,187 @@
+#pragma once
+
+#ifndef __NEXT__
+#define __NEXT__
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+#include "imagedev/flopdrv.h"
+#include "machine/nscsi_bus.h"
+#include "machine/mccs1850.h"
+#include "machine/8530scc.h"
+#include "machine/nextkbd.h"
+#include "machine/n82077aa.h"
+#include "machine/ncr5390.h"
+#include "machine/mb8795.h"
+#include "machine/nextmo.h"
+#include "imagedev/chd_cd.h"
+#include "imagedev/harddriv.h"
+
+class next_state : public driver_device
+{
+public:
+ next_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ maincpu(*this, "maincpu"),
+ rtc(*this, "rtc"),
+ scc(*this, "scc"),
+ keyboard(*this, "keyboard"),
+ scsibus(*this, "scsibus"),
+ scsi(*this, "scsibus:7:ncr5390"),
+ net(*this, "net"),
+ mo(*this, "mo"),
+ fdc(*this, "fdc"),
+ vram(*this, "vram")
+ { }
+
+ required_device<cpu_device> maincpu;
+ required_device<mccs1850_device> rtc;
+ required_device<scc8530_t> scc;
+ required_device<nextkbd_device> keyboard;
+ required_device<nscsi_bus_device> scsibus;
+ required_device<ncr5390_device> scsi;
+ required_device<mb8795_device> net;
+ required_device<nextmo_device> mo;
+ optional_device<n82077aa_device> fdc; // 040 only
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ void setup(UINT32 scr1, int size_x, int size_y, int skip, bool color);
+
+ READ8_MEMBER( io_r );
+ WRITE8_MEMBER( io_w );
+ READ32_MEMBER( rom_map_r );
+ READ32_MEMBER( scr2_r );
+ WRITE32_MEMBER( scr2_w );
+ READ32_MEMBER( scr1_r );
+ READ32_MEMBER( irq_status_r );
+ READ32_MEMBER( irq_mask_r );
+ WRITE32_MEMBER( irq_mask_w );
+ READ32_MEMBER( modisk_r );
+ READ32_MEMBER( network_r );
+ READ32_MEMBER( event_counter_r );
+ READ32_MEMBER( dsp_r );
+ READ32_MEMBER( fdc_control_r );
+ WRITE32_MEMBER( fdc_control_w );
+ READ32_MEMBER( dma_ctrl_r );
+ WRITE32_MEMBER( dma_ctrl_w );
+ WRITE32_MEMBER( dma_040_ctrl_w );
+ READ32_MEMBER( dma_regs_r );
+ WRITE32_MEMBER( dma_regs_w );
+ READ32_MEMBER( scsictrl_r );
+ WRITE32_MEMBER( scsictrl_w );
+ READ32_MEMBER( phy_r );
+ WRITE32_MEMBER( phy_w );
+ READ32_MEMBER( timer_data_r );
+ WRITE32_MEMBER( timer_data_w );
+ READ32_MEMBER( timer_ctrl_r );
+ WRITE32_MEMBER( timer_ctrl_w );
+
+ UINT32 scr1;
+ UINT32 scr2;
+ UINT32 irq_status;
+ UINT32 irq_mask;
+ int irq_level;
+ required_shared_ptr<UINT32> vram;
+ UINT8 scsictrl, scsistat;
+
+ UINT32 phy[2];
+
+ attotime timer_tbase;
+ UINT16 timer_vbase;
+ UINT32 timer_data, timer_next_data;
+ UINT32 timer_ctrl;
+ emu_timer *timer_tm;
+
+ UINT32 eventc_latch;
+
+ void scc_irq(bool state);
+ void keyboard_irq(bool state);
+ void power_irq(bool state);
+ void nmi_irq(bool state);
+
+ DECLARE_WRITE_LINE_MEMBER(scsi_irq);
+ DECLARE_WRITE_LINE_MEMBER(scsi_drq);
+
+ void fdc_irq(bool state);
+ void fdc_drq(bool state);
+
+ void net_tx_irq(bool state);
+ void net_rx_irq(bool state);
+ void net_tx_drq(bool state);
+ void net_rx_drq(bool state);
+
+ void mo_irq(bool state);
+ void mo_drq(bool state);
+
+ // static const SCSIConfigTable scsi_devices;
+ static const floppy_format_type floppy_formats[];
+ static const cdrom_interface cdrom_intf;
+ static const harddisk_interface harddisk_intf;
+
+protected:
+ struct dma_slot {
+ UINT32 start, limit, chain_start, chain_limit, current;
+ UINT8 state;
+ bool supdate, restart, drq;
+ };
+
+ enum {
+ // write bits
+ DMA_SETENABLE = 0x01,
+ DMA_SETSUPDATE = 0x02,
+ DMA_SETREAD = 0x04,
+ DMA_CLRCOMPLETE = 0x08,
+ DMA_RESET = 0x10,
+ DMA_INITBUF = 0x20,
+ DMA_INITBUFTURBO = 0x40,
+
+ // read bits
+ DMA_ENABLE = 0x01,
+ DMA_SUPDATE = 0x02,
+ DMA_READ = 0x04,
+ DMA_COMPLETE = 0x08,
+ DMA_BUSEXC = 0x10,
+ };
+
+ static const char *dma_targets[0x20];
+ static const int dma_irqs[0x20];
+ static const bool dma_has_saved[0x20];
+ static const int scsi_clocks[4];
+
+ dma_slot dma_slots[0x20];
+ UINT32 esp;
+
+ int screen_sx, screen_sy, screen_skip;
+ bool screen_color;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ void timer_start();
+ void timer_update();
+
+ void irq_set(int id, bool raise);
+ void irq_check();
+ const char *dma_name(int slot);
+ void dma_do_ctrl_w(int slot, UINT8 data);
+ void dma_drq_w(int slot, bool state);
+ void dma_read(int slot, UINT8 &val, bool &eof, bool &err);
+ void dma_write(int slot, UINT8 val, bool eof, bool &err);
+ void dma_check_update(int slot);
+ void dma_check_end(int slot, bool eof);
+ void dma_done(int slot);
+ void dma_end(int slot);
+public:
+ DECLARE_DRIVER_INIT(nexts2);
+ DECLARE_DRIVER_INIT(next);
+ DECLARE_DRIVER_INIT(nextsc);
+ DECLARE_DRIVER_INIT(nextst);
+ DECLARE_DRIVER_INIT(nextct);
+ DECLARE_DRIVER_INIT(nextstc);
+ DECLARE_DRIVER_INIT(nextctc);
+ DECLARE_DRIVER_INIT(nexts);
+};
+
+#endif
diff --git a/src/mess/includes/ob68k1a.h b/src/mess/includes/ob68k1a.h
new file mode 100644
index 00000000000..200090b50b1
--- /dev/null
+++ b/src/mess/includes/ob68k1a.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#ifndef __OB68K1A__
+#define __OB68K1A__
+
+#include "machine/ram.h"
+
+#define MC68000L10_TAG "u50"
+#define MC6821_0_TAG "u32"
+#define MC6821_1_TAG "u33"
+#define MC6840_TAG "u35"
+#define MC6850_0_TAG "u34"
+#define MC6850_1_TAG "u26"
+#define COM8116_TAG "u56"
+
+class ob68k1a_state : public driver_device
+{
+public:
+ ob68k1a_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, MC68000L10_TAG),
+ m_dbrg(*this, COM8116_TAG),
+ m_acia0(*this, MC6850_0_TAG),
+ m_pia0(*this, MC6821_0_TAG),
+ m_pia1(*this, MC6821_1_TAG),
+ m_terminal(*this, TERMINAL_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<com8116_device> m_dbrg;
+ required_device<device_t> m_acia0;
+ required_device<pia6821_device> m_pia0;
+ required_device<pia6821_device> m_pia1;
+ required_device<serial_terminal_device> m_terminal;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_WRITE8_MEMBER( com8116_w );
+ DECLARE_READ8_MEMBER( pia_r );
+ DECLARE_WRITE8_MEMBER( pia_w );
+};
+
+#endif
diff --git a/src/mess/includes/odyssey2.h b/src/mess/includes/odyssey2.h
new file mode 100644
index 00000000000..12019e19f58
--- /dev/null
+++ b/src/mess/includes/odyssey2.h
@@ -0,0 +1,147 @@
+/*****************************************************************************
+ *
+ * includes/odyssey2.h
+ *
+ ****************************************************************************/
+
+#ifndef ODYSSEY2_H_
+#define ODYSSEY2_H_
+
+#define P1_BANK_LO_BIT (0x01)
+#define P1_BANK_HI_BIT (0x02)
+#define P1_KEYBOARD_SCAN_ENABLE (0x04) /* active low */
+#define P1_VDC_ENABLE (0x08) /* active low */
+#define P1_EXT_RAM_ENABLE (0x10) /* active low */
+#define P1_VDC_COPY_MODE_ENABLE (0x40)
+
+#define P2_KEYBOARD_SELECT_MASK (0x07) /* select row to scan */
+
+#define VDC_CONTROL_REG_STROBE_XY (0x02)
+
+#define I824X_START_ACTIVE_SCAN 6
+#define I824X_END_ACTIVE_SCAN (6 + 160)
+#define I824X_START_Y 1
+#define I824X_SCREEN_HEIGHT 243
+#define I824X_LINE_CLOCKS 228
+
+typedef union {
+ UINT8 reg[0x100];
+ struct {
+ struct {
+ UINT8 y,x,color,res;
+ } sprites[4];
+ struct {
+ UINT8 y,x,ptr,color;
+ } foreground[12];
+ struct {
+ struct {
+ UINT8 y,x,ptr,color;
+ } single[4];
+ } quad[4];
+ UINT8 shape[4][8];
+ UINT8 control;
+ UINT8 status;
+ UINT8 collision;
+ UINT8 color;
+ UINT8 y;
+ UINT8 x;
+ UINT8 res;
+ UINT8 shift1,shift2,shift3;
+ UINT8 sound;
+ UINT8 res2[5+0x10];
+ UINT8 hgrid[2][0x10];
+ UINT8 vgrid[0x10];
+ } s;
+} o2_vdc_t;
+
+typedef struct
+{
+ UINT8 X;
+ UINT8 Y;
+ UINT8 Y0;
+ UINT8 R;
+ UINT8 M;
+ UINT8 TA;
+ UINT8 TB;
+ UINT8 busy;
+ UINT8 ram[1024];
+} ef9341_t;
+
+
+class odyssey2_state : public driver_device
+{
+public:
+ odyssey2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ int m_the_voice_lrq_state;
+ UINT8 *m_ram;
+ UINT8 m_p1;
+ UINT8 m_p2;
+ size_t m_cart_size;
+ o2_vdc_t m_o2_vdc;
+ UINT32 m_o2_snd_shift[2];
+ UINT8 m_x_beam_pos;
+ UINT8 m_y_beam_pos;
+ UINT8 m_control_status;
+ UINT8 m_collision_status;
+ int m_iff;
+ emu_timer *m_i824x_line_timer;
+ emu_timer *m_i824x_hblank_timer;
+ bitmap_ind16 m_tmp_bitmap;
+ int m_start_vpos;
+ int m_start_vblank;
+ UINT8 m_lum;
+ sound_stream *m_sh_channel;
+ UINT16 m_sh_count;
+ //ef9341_t ef9341;
+ DECLARE_READ8_MEMBER(odyssey2_t0_r);
+ DECLARE_READ8_MEMBER(odyssey2_bus_r);
+ DECLARE_WRITE8_MEMBER(odyssey2_bus_w);
+ DECLARE_READ8_MEMBER(g7400_bus_r);
+ DECLARE_WRITE8_MEMBER(g7400_bus_w);
+ DECLARE_READ8_MEMBER(odyssey2_getp1);
+ DECLARE_WRITE8_MEMBER(odyssey2_putp1);
+ DECLARE_READ8_MEMBER(odyssey2_getp2);
+ DECLARE_WRITE8_MEMBER(odyssey2_putp2);
+ DECLARE_READ8_MEMBER(odyssey2_getbus);
+ DECLARE_WRITE8_MEMBER(odyssey2_putbus);
+ DECLARE_READ8_MEMBER(odyssey2_video_r);
+ DECLARE_WRITE8_MEMBER(odyssey2_video_w);
+ DECLARE_WRITE8_MEMBER(odyssey2_lum_w);
+ DECLARE_READ8_MEMBER(odyssey2_t1_r);
+ DECLARE_DRIVER_INIT(odyssey2);
+};
+
+
+/*----------- defined in video/odyssey2.c -----------*/
+
+extern const UINT8 odyssey2_colors[];
+
+VIDEO_START( odyssey2 );
+SCREEN_UPDATE_IND16( odyssey2 );
+PALETTE_INIT( odyssey2 );
+
+STREAM_UPDATE( odyssey2_sh_update );
+
+void odyssey2_ef9341_w( running_machine &machine, int command, int b, UINT8 data );
+UINT8 odyssey2_ef9341_r( running_machine &machine, int command, int b );
+
+DECLARE_LEGACY_SOUND_DEVICE(ODYSSEY2, odyssey2_sound);
+
+/*----------- defined in machine/odyssey2.c -----------*/
+
+MACHINE_RESET( odyssey2 );
+
+/* i/o ports */
+
+
+
+
+void odyssey2_the_voice_lrq_callback( device_t *device, int state );
+
+
+int odyssey2_cart_verify(const UINT8 *cartdata, size_t size);
+
+
+#endif /* ODYSSEY2_H_ */
diff --git a/src/mess/includes/ondra.h b/src/mess/includes/ondra.h
new file mode 100644
index 00000000000..90718954b9e
--- /dev/null
+++ b/src/mess/includes/ondra.h
@@ -0,0 +1,36 @@
+/*****************************************************************************
+ *
+ * includes/ondra.h
+ *
+ ****************************************************************************/
+
+#ifndef ONDRA_H_
+#define ONDRA_H_
+
+class ondra_state : public driver_device
+{
+public:
+ ondra_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_video_enable;
+ UINT8 m_bank1_status;
+ UINT8 m_bank2_status;
+ DECLARE_READ8_MEMBER(ondra_keyboard_r);
+ DECLARE_WRITE8_MEMBER(ondra_port_03_w);
+ DECLARE_WRITE8_MEMBER(ondra_port_09_w);
+ DECLARE_WRITE8_MEMBER(ondra_port_0a_w);
+};
+
+
+/*----------- defined in machine/ondra.c -----------*/
+
+extern MACHINE_START( ondra );
+extern MACHINE_RESET( ondra );
+
+/*----------- defined in video/ondra.c -----------*/
+
+extern VIDEO_START( ondra );
+extern SCREEN_UPDATE_IND16( ondra );
+
+#endif
diff --git a/src/mess/includes/orao.h b/src/mess/includes/orao.h
new file mode 100644
index 00000000000..e253e87fcb1
--- /dev/null
+++ b/src/mess/includes/orao.h
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ *
+ * includes/orao.h
+ *
+ ****************************************************************************/
+
+#ifndef ORAO_H_
+#define ORAO_H_
+
+
+class orao_state : public driver_device
+{
+public:
+ orao_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_memory(*this, "memory"),
+ m_video_ram(*this, "video_ram"){ }
+
+ required_shared_ptr<UINT8> m_memory;
+ required_shared_ptr<UINT8> m_video_ram;
+ DECLARE_READ8_MEMBER(orao_io_r);
+ DECLARE_WRITE8_MEMBER(orao_io_w);
+ DECLARE_DRIVER_INIT(orao);
+ DECLARE_DRIVER_INIT(orao103);
+};
+
+
+/*----------- defined in machine/orao.c -----------*/
+
+extern MACHINE_RESET( orao );
+
+
+
+
+/*----------- defined in video/orao.c -----------*/
+
+extern VIDEO_START( orao );
+extern SCREEN_UPDATE_IND16( orao );
+
+
+#endif /* ORAO_H_ */
diff --git a/src/mess/includes/oric.h b/src/mess/includes/oric.h
new file mode 100644
index 00000000000..96164afe79b
--- /dev/null
+++ b/src/mess/includes/oric.h
@@ -0,0 +1,128 @@
+/*****************************************************************************
+ *
+ * includes/oric.h
+ *
+ ****************************************************************************/
+
+#ifndef ORIC_H_
+#define ORIC_H_
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "sound/ay8910.h"
+#include "sound/wave.h"
+#include "machine/6522via.h"
+#include "machine/6551acia.h"
+#include "machine/ctronics.h"
+#include "machine/wd17xx.h"
+//#include <stdio.h>
+#include "machine/applefdc.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/cassette.h"
+#include "formats/oric_dsk.h"
+#include "formats/ap2_dsk.h"
+#include "formats/oric_tap.h"
+
+enum
+{
+ TELESTRAT_MEM_BLOCK_UNDEFINED,
+ TELESTRAT_MEM_BLOCK_RAM,
+ TELESTRAT_MEM_BLOCK_ROM
+};
+
+typedef struct
+{
+ int MemType;
+ unsigned char *ptr;
+} telestrat_mem_block;
+
+
+/* current state of the display */
+/* some attributes persist until they are turned off.
+This structure holds this persistant information */
+typedef struct
+{
+ /* foreground and background colour used for rendering */
+ /* if flash attribute is set, these two will both be equal to background colour */
+ UINT8 active_foreground_colour;
+ UINT8 active_background_colour;
+ /* current foreground and background colour */
+ UINT8 foreground_colour;
+ UINT8 background_colour;
+ UINT8 mode;
+ /* text attributes */
+ UINT8 text_attributes;
+
+ offs_t read_addr;
+
+ /* current addr to fetch data */
+ UINT8 *char_data;
+ /* base of char data */
+ UINT8 *char_base;
+
+ /* if (1<<3), display graphics, if 0, hide graphics */
+ /* current count */
+ UINT8 flash_count;
+} oric_vh_state;
+
+
+class oric_state : public driver_device
+{
+public:
+ oric_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_ram(*this, "ram") { }
+
+ optional_shared_ptr<UINT8> m_ram;
+ bool m_is_telestrat;
+ UINT8 m_irqs;
+ UINT8 *m_ram_0x0c000;
+ UINT8 m_keyboard_line;
+ UINT8 m_key_sense_bit;
+ UINT8 m_keyboard_mask;
+ UINT8 m_via_port_a_data;
+ UINT8 m_psg_control;
+ UINT8 m_previous_portb_data;
+ UINT8 m_port_3fa_w;
+ UINT8 m_port_3fb_w;
+ UINT8 m_wd179x_int_state;
+ UINT8 m_port_314_r;
+ UINT8 m_port_318_r;
+ UINT8 m_port_314_w;
+ UINT8 m_telestrat_bank_selection;
+ UINT8 m_telestrat_via2_port_a_data;
+ UINT8 m_telestrat_via2_port_b_data;
+ telestrat_mem_block m_telestrat_blocks[8];
+ oric_vh_state m_vh_state;
+ DECLARE_WRITE8_MEMBER(oric_psg_porta_write);
+ DECLARE_WRITE8_MEMBER(apple2_v2_interface_w);
+ DECLARE_READ8_MEMBER(oric_jasmin_r);
+ DECLARE_WRITE8_MEMBER(oric_jasmin_w);
+ DECLARE_READ8_MEMBER(oric_microdisc_r);
+ DECLARE_WRITE8_MEMBER(oric_microdisc_w);
+ DECLARE_READ8_MEMBER(oric_IO_r);
+ DECLARE_WRITE8_MEMBER(oric_IO_w);
+};
+
+
+/*----------- defined in machine/oric.c -----------*/
+
+extern const via6522_interface oric_6522_interface;
+extern const via6522_interface telestrat_via2_interface;
+extern const wd17xx_interface oric_wd17xx_interface;
+
+MACHINE_START( oric );
+MACHINE_RESET( oric );
+
+
+/* Telestrat specific */
+MACHINE_START( telestrat );
+
+
+/*----------- defined in video/oric.c -----------*/
+
+VIDEO_START( oric );
+SCREEN_UPDATE_IND16( oric );
+
+
+#endif /* ORIC_H_ */
diff --git a/src/mess/includes/orion.h b/src/mess/includes/orion.h
new file mode 100644
index 00000000000..0fca1b1df9a
--- /dev/null
+++ b/src/mess/includes/orion.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ *
+ * includes/orion.h
+ *
+ ****************************************************************************/
+
+#ifndef ORION_H_
+#define ORION_H_
+
+#include "includes/radio86.h"
+#include "machine/i8255.h"
+
+class orion_state : public radio86_state
+{
+public:
+ orion_state(const machine_config &mconfig, device_type type, const char *tag)
+ : radio86_state(mconfig, type, tag) { }
+
+ UINT8 m_orion128_video_mode;
+ UINT8 m_orion128_video_page;
+ UINT8 m_orion128_video_width;
+ UINT8 m_video_mode_mask;
+ UINT8 m_orionpro_pseudo_color;
+ UINT8 m_romdisk_lsb;
+ UINT8 m_romdisk_msb;
+ UINT8 m_orion128_memory_page;
+ UINT8 m_orionz80_memory_page;
+ UINT8 m_orionz80_dispatcher;
+ UINT8 m_speaker;
+ UINT8 m_orionpro_ram0_segment;
+ UINT8 m_orionpro_ram1_segment;
+ UINT8 m_orionpro_ram2_segment;
+ UINT8 m_orionpro_page;
+ UINT8 m_orionpro_128_page;
+ UINT8 m_orionpro_rom2_segment;
+ UINT8 m_orionpro_dispatcher;
+ DECLARE_READ8_MEMBER(orion128_system_r);
+ DECLARE_WRITE8_MEMBER(orion128_system_w);
+ DECLARE_READ8_MEMBER(orion128_romdisk_r);
+ DECLARE_WRITE8_MEMBER(orion128_romdisk_w);
+ DECLARE_WRITE8_MEMBER(orion128_video_mode_w);
+ DECLARE_WRITE8_MEMBER(orion128_video_page_w);
+ DECLARE_WRITE8_MEMBER(orion128_memory_page_w);
+ DECLARE_WRITE8_MEMBER(orion_disk_control_w);
+ DECLARE_READ8_MEMBER(orion128_floppy_r);
+ DECLARE_WRITE8_MEMBER(orion128_floppy_w);
+ DECLARE_READ8_MEMBER(orionz80_floppy_rtc_r);
+ DECLARE_WRITE8_MEMBER(orionz80_floppy_rtc_w);
+ DECLARE_WRITE8_MEMBER(orionz80_sound_w);
+ DECLARE_WRITE8_MEMBER(orionz80_sound_fe_w);
+ DECLARE_WRITE8_MEMBER(orionz80_memory_page_w);
+ DECLARE_WRITE8_MEMBER(orionz80_dispatcher_w);
+ DECLARE_READ8_MEMBER(orionz80_io_r);
+ DECLARE_WRITE8_MEMBER(orionz80_io_w);
+ DECLARE_WRITE8_MEMBER(orionpro_memory_page_w);
+ DECLARE_READ8_MEMBER(orionpro_io_r);
+ DECLARE_WRITE8_MEMBER(orionpro_io_w);
+};
+
+
+/*----------- defined in machine/orion.c -----------*/
+
+extern const i8255_interface orion128_ppi8255_interface_1;
+
+extern MACHINE_START( orion128 );
+extern MACHINE_RESET( orion128 );
+
+extern MACHINE_START( orionz80 );
+extern MACHINE_RESET( orionz80 );
+extern INTERRUPT_GEN( orionz80_interrupt );
+
+
+extern MACHINE_RESET( orionpro );
+
+/*----------- defined in video/orion.c -----------*/
+
+extern VIDEO_START( orion128 );
+extern SCREEN_UPDATE_IND16( orion128 );
+extern PALETTE_INIT( orion128 );
+
+#endif /* ORION_H_ */
+
diff --git a/src/mess/includes/osborne1.h b/src/mess/includes/osborne1.h
new file mode 100644
index 00000000000..fc827c701ea
--- /dev/null
+++ b/src/mess/includes/osborne1.h
@@ -0,0 +1,113 @@
+/*****************************************************************************
+ *
+ * includes/osborne1.h
+ *
+ ****************************************************************************/
+
+#ifndef OSBORNE1_H_
+#define OSBORNE1_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "sound/beep.h"
+#include "machine/6821pia.h"
+#include "machine/6850acia.h"
+#include "machine/ieee488.h"
+#include "machine/ram.h"
+#include "machine/wd17xx.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+
+class osborne1_state : public driver_device
+{
+public:
+ osborne1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pia0(*this, "pia_0"),
+ m_pia1(*this, "pia_1"),
+ m_fdc(*this, "mb8877"),
+ m_beep(*this, BEEPER_TAG),
+ m_ram(*this, RAM_TAG),
+ m_ieee(*this, IEEE488_TAG)
+ { }
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ bitmap_ind16 m_bitmap;
+
+ required_device<cpu_device> m_maincpu;
+ required_device<pia6821_device> m_pia0;
+ required_device<pia6821_device> m_pia1;
+ required_device<device_t> m_fdc;
+ required_device<device_t> m_beep;
+ required_device<ram_device> m_ram;
+ required_device<ieee488_device> m_ieee;
+
+ DECLARE_WRITE8_MEMBER(osborne1_0000_w);
+ DECLARE_WRITE8_MEMBER(osborne1_1000_w);
+ DECLARE_READ8_MEMBER(osborne1_2000_r);
+ DECLARE_WRITE8_MEMBER(osborne1_2000_w);
+ DECLARE_WRITE8_MEMBER(osborne1_3000_w);
+ DECLARE_WRITE8_MEMBER(osborne1_videoram_w);
+ DECLARE_WRITE8_MEMBER(osborne1_bankswitch_w);
+ DECLARE_WRITE_LINE_MEMBER(ieee_pia_irq_a_func);
+ DECLARE_READ8_MEMBER(ieee_pia_pb_r);
+ DECLARE_WRITE8_MEMBER(ieee_pia_pb_w);
+ DECLARE_WRITE8_MEMBER(video_pia_out_cb2_dummy);
+ DECLARE_WRITE8_MEMBER(video_pia_port_a_w);
+ DECLARE_WRITE8_MEMBER(video_pia_port_b_w);
+ DECLARE_WRITE_LINE_MEMBER(video_pia_irq_a_func);
+ DECLARE_DIRECT_UPDATE_MEMBER(osborne1_opbase);
+
+ bool m_bank2_enabled;
+ bool m_bank3_enabled;
+ UINT8 *m_bank4_ptr;
+ UINT8 *m_empty_4K;
+ /* IRQ states */
+ bool m_pia_0_irq_state;
+ bool m_pia_1_irq_state;
+ /* video related */
+ UINT8 m_new_start_x;
+ UINT8 m_new_start_y;
+ emu_timer *m_video_timer;
+ UINT8 *m_p_chargen;
+ /* bankswitch setting */
+ UINT8 m_bankswitch;
+ bool m_in_irq_handler;
+ bool m_beep_state;
+ DECLARE_DRIVER_INIT(osborne1);
+};
+
+
+/*----------- defined in machine/osborne1.c -----------*/
+
+extern const pia6821_interface osborne1_ieee_pia_config;
+extern const pia6821_interface osborne1_video_pia_config;
+
+MACHINE_RESET( osborne1 );
+
+
+// ======================> osborne1_daisy_device
+
+class osborne1_daisy_device : public device_t,
+ public device_z80daisy_interface
+{
+public:
+ // construction/destruction
+ osborne1_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+private:
+ virtual void device_start();
+ // z80daisy_interface overrides
+ virtual int z80daisy_irq_state();
+ virtual int z80daisy_irq_ack();
+ virtual void z80daisy_irq_reti();
+};
+
+extern const device_type OSBORNE1_DAISY;
+
+#endif /* OSBORNE1_H_ */
diff --git a/src/mess/includes/osi.h b/src/mess/includes/osi.h
new file mode 100644
index 00000000000..0dcc6138eb8
--- /dev/null
+++ b/src/mess/includes/osi.h
@@ -0,0 +1,122 @@
+#pragma once
+
+#ifndef __OSI__
+#define __OSI__
+
+
+#include "emu.h"
+#include "cpu/m6502/m6502.h"
+#include "formats/basicdsk.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "machine/6850acia.h"
+#include "machine/6821pia.h"
+#include "machine/ram.h"
+#include "sound/discrete.h"
+#include "sound/beep.h"
+
+#define SCREEN_TAG "screen"
+#define M6502_TAG "m6502"
+#define DISCRETE_TAG "discrete"
+
+#define X1 3932160
+#define UK101_X1 XTAL_8MHz
+
+#define OSI600_VIDEORAM_SIZE 0x400
+#define OSI630_COLORRAM_SIZE 0x400
+
+class sb2m600_state : public driver_device
+{
+public:
+ sb2m600_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6502_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_discrete(*this, DISCRETE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_video_ram(*this, "video_ram"),
+ m_color_ram(*this, "color_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cassette;
+ optional_device<device_t> m_discrete;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_WRITE8_MEMBER( keyboard_w );
+ DECLARE_WRITE8_MEMBER( ctrl_w );
+ DECLARE_READ_LINE_MEMBER( cassette_rx );
+ DECLARE_WRITE_LINE_MEMBER( cassette_tx );
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* video state */
+ int m_32;
+ int m_coloren;
+ required_shared_ptr<UINT8> m_video_ram;
+ optional_shared_ptr<UINT8> m_color_ram;
+
+ /* floppy state */
+ int m_fdc_index;
+};
+
+class c1p_state : public sb2m600_state
+{
+public:
+ c1p_state(const machine_config &mconfig, device_type type, const char *tag)
+ : sb2m600_state(mconfig, type, tag),
+ m_beep(*this, BEEPER_TAG)
+ { }
+
+ required_device<device_t> m_beep;
+
+ virtual void machine_start();
+
+ DECLARE_WRITE8_MEMBER( osi630_ctrl_w );
+ DECLARE_WRITE8_MEMBER( osi630_sound_w );
+ DECLARE_DRIVER_INIT(c1p);
+};
+
+class c1pmf_state : public c1p_state
+{
+public:
+ c1pmf_state(const machine_config &mconfig, device_type type, const char *tag)
+ : c1p_state(mconfig, type, tag),
+ m_floppy(*this, FLOPPY_0)
+ { }
+
+ required_device<device_t> m_floppy;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( osi470_pia_pa_r );
+ DECLARE_WRITE8_MEMBER( osi470_pia_pa_w );
+ DECLARE_WRITE8_MEMBER( osi470_pia_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( osi470_pia_cb2_w );
+};
+
+class uk101_state : public sb2m600_state
+{
+public:
+ uk101_state(const machine_config &mconfig, device_type type, const char *tag)
+ : sb2m600_state(mconfig, type, tag)
+ { }
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( keyboard_w );
+};
+
+/* ---------- defined in video/osi.c ---------- */
+
+MACHINE_CONFIG_EXTERN( osi600_video );
+MACHINE_CONFIG_EXTERN( uk101_video );
+MACHINE_CONFIG_EXTERN( osi630_video );
+
+#endif
diff --git a/src/mess/includes/p2000t.h b/src/mess/includes/p2000t.h
new file mode 100644
index 00000000000..3e27cceb668
--- /dev/null
+++ b/src/mess/includes/p2000t.h
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ *
+ * includes/p2000t.h
+ *
+ ****************************************************************************/
+
+#ifndef P2000T_H_
+#define P2000T_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/speaker.h"
+#include "video/saa5050.h"
+
+
+class p2000t_state : public driver_device
+{
+public:
+ p2000t_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_speaker(*this, SPEAKER_TAG),
+ m_p_videoram(*this, "p_videoram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_speaker;
+ DECLARE_READ8_MEMBER(p2000t_port_000f_r);
+ DECLARE_READ8_MEMBER(p2000t_port_202f_r);
+ DECLARE_WRITE8_MEMBER(p2000t_port_101f_w);
+ DECLARE_WRITE8_MEMBER(p2000t_port_303f_w);
+ DECLARE_WRITE8_MEMBER(p2000t_port_505f_w);
+ DECLARE_WRITE8_MEMBER(p2000t_port_707f_w);
+ DECLARE_WRITE8_MEMBER(p2000t_port_888b_w);
+ DECLARE_WRITE8_MEMBER(p2000t_port_8c90_w);
+ DECLARE_WRITE8_MEMBER(p2000t_port_9494_w);
+ optional_shared_ptr<UINT8> m_p_videoram;
+ UINT8 m_port_101f;
+ UINT8 m_port_202f;
+ UINT8 m_port_303f;
+ UINT8 m_port_707f;
+ INT8 m_frame_count;
+};
+
+
+/*----------- defined in machine/p2000t.c -----------*/
+
+
+
+
+/*----------- defined in video/p2000m.c -----------*/
+
+extern VIDEO_START( p2000m );
+extern SCREEN_UPDATE_IND16( p2000m );
+
+
+#endif /* P2000T_H_ */
diff --git a/src/mess/includes/partner.h b/src/mess/includes/partner.h
new file mode 100644
index 00000000000..18feadf4cfb
--- /dev/null
+++ b/src/mess/includes/partner.h
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ *
+ * includes/partner.h
+ *
+ ****************************************************************************/
+
+#ifndef partner_H_
+#define partner_H_
+
+#include "machine/i8255.h"
+#include "machine/8257dma.h"
+#include "machine/wd17xx.h"
+
+class partner_state : public radio86_state
+{
+public:
+ partner_state(const machine_config &mconfig, device_type type, const char *tag)
+ : radio86_state(mconfig, type, tag) { }
+
+ UINT8 m_mem_page;
+ UINT8 m_win_mem_page;
+ DECLARE_READ8_MEMBER(partner_floppy_r);
+ DECLARE_WRITE8_MEMBER(partner_floppy_w);
+ DECLARE_WRITE8_MEMBER(partner_win_memory_page_w);
+ DECLARE_WRITE8_MEMBER(partner_mem_page_w);
+ DECLARE_DRIVER_INIT(partner);
+};
+
+
+/*----------- defined in machine/partner.c -----------*/
+
+extern MACHINE_RESET( partner );
+extern MACHINE_START( partner );
+
+extern const i8257_interface partner_dma;
+extern const wd17xx_interface partner_wd17xx_interface;
+
+#endif /* partner_H_ */
diff --git a/src/mess/includes/pc.h b/src/mess/includes/pc.h
new file mode 100644
index 00000000000..311cfe9515e
--- /dev/null
+++ b/src/mess/includes/pc.h
@@ -0,0 +1,135 @@
+/*****************************************************************************
+ *
+ * includes/pc.h
+ *
+ ****************************************************************************/
+
+#ifndef PC_H_
+#define PC_H_
+
+#include "machine/ins8250.h"
+#include "machine/i8255.h"
+#include "machine/8237dma.h"
+#include "machine/serial.h"
+#include "machine/ser_mouse.h"
+#include "machine/pc_kbdc.h"
+
+class pc_state : public driver_device
+{
+public:
+ pc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag)
+ , m_pc_kbdc(*this, "pc_kbdc")
+ {
+ }
+
+ device_t *m_maincpu;
+ device_t *m_pic8259;
+ device_t *m_dma8237;
+ device_t *m_pit8253;
+ optional_device<pc_kbdc_device> m_pc_kbdc;
+
+ /* U73 is an LS74 - dual flip flop */
+ /* Q2 is set by OUT1 from the 8253 and goes to DRQ1 on the 8237 */
+ UINT8 m_u73_q2;
+ UINT8 m_out1;
+ UINT8 m_memboard[4]; /* used only by ec1840 and ec1841 */
+ int m_dma_channel;
+ UINT8 m_dma_offset[2][4];
+ UINT8 m_pc_spkrdata;
+ UINT8 m_pc_input;
+
+ int m_ppi_portc_switch_high;
+ int m_ppi_speaker;
+ int m_ppi_keyboard_clear;
+ UINT8 m_ppi_keyb_clock;
+ UINT8 m_ppi_portb;
+ UINT8 m_ppi_clock_signal;
+ UINT8 m_ppi_data_signal;
+ UINT8 m_ppi_shift_register;
+ UINT8 m_ppi_shift_enable;
+
+ // interface to the keyboard
+ DECLARE_WRITE_LINE_MEMBER( keyboard_clock_w );
+ DECLARE_WRITE_LINE_MEMBER( keyboard_data_w );
+
+ DECLARE_READ8_MEMBER(pc_page_r);
+ DECLARE_WRITE8_MEMBER(pc_page_w);
+ DECLARE_READ8_MEMBER(pc_dma_read_byte);
+ DECLARE_WRITE8_MEMBER(pc_dma_write_byte);
+ DECLARE_WRITE8_MEMBER(pc_nmi_enable_w);
+ DECLARE_READ8_MEMBER(pcjr_nmi_enable_r);
+ DECLARE_READ8_MEMBER(input_port_0_r);
+ DECLARE_READ8_MEMBER(pc_rtc_r);
+ DECLARE_WRITE8_MEMBER(pc_rtc_w);
+ DECLARE_WRITE8_MEMBER(pc_EXP_w);
+ DECLARE_READ8_MEMBER(pc_EXP_r);
+ DECLARE_READ8_MEMBER(unk_r);
+ DECLARE_READ8_MEMBER(ec1841_memboard_r);
+ DECLARE_WRITE8_MEMBER(ec1841_memboard_w);
+ DECLARE_DRIVER_INIT(europc);
+ DECLARE_DRIVER_INIT(mc1502);
+ DECLARE_DRIVER_INIT(bondwell);
+ DECLARE_DRIVER_INIT(pcjr);
+ DECLARE_DRIVER_INIT(pccga);
+ DECLARE_DRIVER_INIT(t1000hx);
+ DECLARE_DRIVER_INIT(ppc512);
+ DECLARE_DRIVER_INIT(pc200);
+ DECLARE_DRIVER_INIT(ibm5150);
+ DECLARE_DRIVER_INIT(pcmda);
+ DECLARE_DRIVER_INIT(pc1512);
+ DECLARE_DRIVER_INIT(pc1640);
+ DECLARE_DRIVER_INIT(pc_vga);
+};
+
+/*----------- defined in machine/pc.c -----------*/
+
+extern const i8237_interface ibm5150_dma8237_config;
+extern const struct pit8253_config ibm5150_pit8253_config;
+extern const struct pit8253_config pcjr_pit8253_config;
+extern const struct pit8253_config mc1502_pit8253_config;
+extern const struct pic8259_interface ibm5150_pic8259_config;
+extern const struct pic8259_interface pcjr_pic8259_config;
+extern const ins8250_interface ibm5150_com_interface[4];
+extern const rs232_port_interface ibm5150_serport_config[4];
+extern const i8255_interface ibm5150_ppi8255_interface;
+extern const i8255_interface ibm5160_ppi8255_interface;
+extern const i8255_interface pc_ppi8255_interface;
+extern const i8255_interface pcjr_ppi8255_interface;
+extern const i8255_interface mc1502_ppi8255_interface;
+extern const i8255_interface mc1502_ppi8255_interface_2;
+
+UINT8 pc_speaker_get_spk(running_machine &machine);
+void pc_speaker_set_spkrdata(running_machine &machine, UINT8 data);
+void pc_speaker_set_input(running_machine &machine, UINT8 data);
+
+void mess_init_pc_common( running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int), void (*set_hdc_int_func)(running_machine &,int,int));
+
+
+
+READ8_DEVICE_HANDLER( mc1502_wd17xx_drq_r );
+READ8_DEVICE_HANDLER( mc1502_wd17xx_aux_r );
+READ8_DEVICE_HANDLER( mc1502_wd17xx_motor_r );
+WRITE8_DEVICE_HANDLER( mc1502_wd17xx_aux_w );
+
+
+MACHINE_START( pc );
+MACHINE_RESET( pc );
+MACHINE_START( pcjr );
+MACHINE_RESET( pcjr );
+MACHINE_START( mc1502 );
+
+DEVICE_IMAGE_LOAD( pcjr_cartridge );
+
+TIMER_DEVICE_CALLBACK( pc_frame_interrupt );
+TIMER_DEVICE_CALLBACK( pc_vga_frame_interrupt );
+TIMER_DEVICE_CALLBACK( pcjr_frame_interrupt );
+TIMER_DEVICE_CALLBACK( null_frame_interrupt );
+
+
+
+
+void pc_rtc_init(running_machine &machine);
+
+
+#endif /* PC_H_ */
diff --git a/src/mess/includes/pc1251.h b/src/mess/includes/pc1251.h
new file mode 100644
index 00000000000..e52ae2c5578
--- /dev/null
+++ b/src/mess/includes/pc1251.h
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ *
+ * includes/pc1251.h
+ *
+ * Pocket Computer 1251
+ *
+ ****************************************************************************/
+
+#ifndef PC1251_H_
+#define PC1251_H_
+
+#include "machine/nvram.h"
+
+#define PC1251_CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
+
+
+class pc1251_state : public driver_device
+{
+public:
+ pc1251_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_outa;
+ UINT8 m_outb;
+ int m_power;
+ UINT8 m_reg[0x100];
+
+ DECLARE_DRIVER_INIT(pc1251);
+};
+
+
+/*----------- defined in machine/pc1251.c -----------*/
+
+void pc1251_outa(device_t *device, int data);
+void pc1251_outb(device_t *device, int data);
+void pc1251_outc(device_t *device, int data);
+
+int pc1251_reset(device_t *device);
+int pc1251_brk(device_t *device);
+int pc1251_ina(device_t *device);
+int pc1251_inb(device_t *device);
+
+MACHINE_START( pc1251 );
+
+
+/*----------- defined in video/pc1251.c -----------*/
+
+READ8_HANDLER(pc1251_lcd_read);
+WRITE8_HANDLER(pc1251_lcd_write);
+SCREEN_UPDATE_IND16( pc1251 );
+
+
+#endif /* PC1251_H_ */
diff --git a/src/mess/includes/pc1350.h b/src/mess/includes/pc1350.h
new file mode 100644
index 00000000000..8824f197a74
--- /dev/null
+++ b/src/mess/includes/pc1350.h
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ *
+ * includes/pc1350.h
+ *
+ * Pocket Computer 1350
+ *
+ ****************************************************************************/
+
+#ifndef PC1350_H_
+#define PC1350_H_
+
+#include "machine/nvram.h"
+
+#define PC1350_CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
+
+
+class pc1350_state : public driver_device
+{
+public:
+ pc1350_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_outa;
+ UINT8 m_outb;
+ int m_power;
+ UINT8 m_reg[0x1000];
+};
+
+
+/*----------- defined in machine/pc1350.c -----------*/
+
+void pc1350_outa(device_t *device, int data);
+void pc1350_outb(device_t *device, int data);
+void pc1350_outc(device_t *device, int data);
+
+int pc1350_brk(device_t *device);
+int pc1350_ina(device_t *device);
+int pc1350_inb(device_t *device);
+
+MACHINE_START( pc1350 );
+
+
+/*----------- defined in video/pc1350.c -----------*/
+
+READ8_HANDLER(pc1350_lcd_read);
+WRITE8_HANDLER(pc1350_lcd_write);
+SCREEN_UPDATE_IND16( pc1350 );
+
+int pc1350_keyboard_line_r(running_machine &machine);
+
+
+#endif /* PC1350_H_ */
diff --git a/src/mess/includes/pc1401.h b/src/mess/includes/pc1401.h
new file mode 100644
index 00000000000..2343ca2ae5b
--- /dev/null
+++ b/src/mess/includes/pc1401.h
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ *
+ * includes/pc1401.h
+ *
+ * Pocket Computer 1401
+ *
+ ****************************************************************************/
+
+#ifndef PC1401_H_
+#define PC1401_H_
+
+#include "machine/nvram.h"
+
+#define CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
+
+
+class pc1401_state : public driver_device
+{
+public:
+ pc1401_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_portc;
+ UINT8 m_outa;
+ UINT8 m_outb;
+ int m_power;
+ UINT8 m_reg[0x100];
+ DECLARE_DRIVER_INIT(pc1401);
+};
+
+
+/*----------- defined in machine/pc1401.c -----------*/
+
+int pc1401_reset(device_t *device);
+int pc1401_brk(device_t *device);
+void pc1401_outa(device_t *device, int data);
+void pc1401_outb(device_t *device, int data);
+void pc1401_outc(device_t *device, int data);
+int pc1401_ina(device_t *device);
+int pc1401_inb(device_t *device);
+
+MACHINE_START( pc1401 );
+
+
+/*----------- defined in video/pc1401.c -----------*/
+
+READ8_HANDLER(pc1401_lcd_read);
+WRITE8_HANDLER(pc1401_lcd_write);
+SCREEN_UPDATE_IND16( pc1401 );
+
+
+#endif /* PC1401_H_ */
diff --git a/src/mess/includes/pc1403.h b/src/mess/includes/pc1403.h
new file mode 100644
index 00000000000..051737c1af6
--- /dev/null
+++ b/src/mess/includes/pc1403.h
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ *
+ * includes/pc1403.h
+ *
+ * Pocket Computer 1403
+ *
+ ****************************************************************************/
+
+#ifndef PC1403_H_
+#define PC1403_H_
+
+#include "machine/nvram.h"
+
+#define CONTRAST (machine.root_device().ioport("DSW0")->read() & 0x07)
+
+
+class pc1403_state : public driver_device
+{
+public:
+ pc1403_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_portc;
+ UINT8 m_outa;
+ int m_power;
+ UINT8 m_asic[4];
+ int m_DOWN;
+ int m_RIGHT;
+ UINT8 m_reg[0x100];
+
+ DECLARE_DRIVER_INIT(pc1403);
+};
+
+
+/*----------- defined in machine/pc1403.c -----------*/
+
+int pc1403_reset(device_t *device);
+int pc1403_brk(device_t *device);
+void pc1403_outa(device_t *device, int data);
+//void pc1403_outb(device_t *device, int data);
+void pc1403_outc(device_t *device, int data);
+int pc1403_ina(device_t *device);
+//int pc1403_inb(device_t *device);
+
+MACHINE_START( pc1403 );
+
+READ8_HANDLER(pc1403_asic_read);
+WRITE8_HANDLER(pc1403_asic_write);
+
+
+/*----------- defined in video/pc1403.c -----------*/
+
+VIDEO_START( pc1403 );
+SCREEN_UPDATE_IND16( pc1403 );
+
+READ8_HANDLER(pc1403_lcd_read);
+WRITE8_HANDLER(pc1403_lcd_write);
+
+
+#endif /* PC1403_H_ */
diff --git a/src/mess/includes/pc1512.h b/src/mess/includes/pc1512.h
new file mode 100644
index 00000000000..baf49230a0e
--- /dev/null
+++ b/src/mess/includes/pc1512.h
@@ -0,0 +1,259 @@
+#pragma once
+
+#ifndef __PC1512__
+#define __PC1512__
+
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/mcs48/mcs48.h"
+#include "formats/basicdsk.h"
+#include "formats/pc_dsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/am9517a.h"
+#include "machine/ctronics.h"
+#include "machine/ins8250.h"
+#include "machine/isa.h"
+#include "machine/isa_wdxt_gen.h"
+#include "machine/mc146818.h"
+#include "machine/pic8259.h"
+#include "machine/pit8253.h"
+#include "machine/pc1512kb.h"
+#include "machine/upd765.h"
+#include "machine/ram.h"
+#include "sound/speaker.h"
+#include "video/mc6845.h"
+
+#define I8086_TAG "ic120"
+#define I8087_TAG "ic119"
+#define I8048_TAG "i8048"
+#define I8237A5_TAG "ic130"
+#define I8259A2_TAG "ic109"
+#define I8253_TAG "ic114"
+#define MC146818_TAG "ic134"
+#define UPD765AC2_TAG "ic112"
+#define INS8250_TAG "ic106"
+#define AMS40041_TAG "ic126"
+#define CENTRONICS_TAG "centronics"
+#define SPEAKER_TAG "speaker"
+#define ISA_BUS_TAG "isa"
+#define SCREEN_TAG "screen"
+
+class pc1512_state : public driver_device
+{
+public:
+ pc1512_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8086_TAG),
+ m_dmac(*this, I8237A5_TAG),
+ m_pic(*this, I8259A2_TAG),
+ m_pit(*this, I8253_TAG),
+ m_rtc(*this, MC146818_TAG),
+ m_fdc(*this, UPD765AC2_TAG),
+ m_uart(*this, INS8250_TAG),
+ m_vdu(*this, AMS40041_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_kb(*this, PC1512_KEYBOARD_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_bus(*this, ISA_BUS_TAG),
+ m_pit1(0),
+ m_pit2(0),
+ m_status1(0),
+ m_status2(0),
+ m_port61(0),
+ m_nmi_enable(0),
+ m_kb_bits(0),
+ m_kbclk(1),
+ m_kbdata(1),
+ m_dreq0(0),
+ m_nden(1),
+ m_dint(0),
+ m_ddrq(0),
+ m_fdc_dsr(0),
+ m_neop(0),
+ m_ack_int_enable(1),
+ m_ack(0),
+ m_speaker_drive(0)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<am9517a_device> m_dmac;
+ required_device<device_t> m_pic;
+ required_device<device_t> m_pit;
+ required_device<mc146818_device> m_rtc;
+ required_device<device_t> m_fdc;
+ required_device<ins8250_device> m_uart;
+ required_device<ams40041_device> m_vdu;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_speaker;
+ required_device<pc1512_keyboard_device> m_kb;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ optional_device<device_t> m_floppy1;
+ required_device<isa8_device> m_bus;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ void update_speaker();
+ void update_fdc_int();
+ void update_fdc_drq();
+ void update_fdc_tc();
+ void update_ack();
+ void set_fdc_dsr(UINT8 data);
+ int get_display_mode(UINT8 mode);
+ offs_t get_char_rom_offset();
+ int get_color(UINT8 data);
+ void draw_alpha(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
+ void draw_graphics_1(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
+ void draw_graphics_2(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param);
+
+ DECLARE_READ8_MEMBER( video_ram_r );
+ DECLARE_WRITE8_MEMBER( video_ram_w );
+ DECLARE_READ8_MEMBER( system_r );
+ DECLARE_WRITE8_MEMBER( system_w );
+ DECLARE_READ8_MEMBER( mouse_r );
+ DECLARE_WRITE8_MEMBER( mouse_w );
+ DECLARE_WRITE8_MEMBER( dma_page_w );
+ DECLARE_WRITE8_MEMBER( nmi_mask_w );
+ DECLARE_READ8_MEMBER( printer_r );
+ DECLARE_WRITE8_MEMBER( printer_w );
+ DECLARE_READ8_MEMBER( fdc_r );
+ DECLARE_WRITE8_MEMBER( fdc_w );
+ DECLARE_READ8_MEMBER( vdu_r );
+ DECLARE_WRITE8_MEMBER( vdu_w );
+ DECLARE_WRITE_LINE_MEMBER( kbdata_w );
+ DECLARE_WRITE_LINE_MEMBER( kbclk_w );
+ DECLARE_WRITE_LINE_MEMBER( pit1_w );
+ DECLARE_WRITE_LINE_MEMBER( pit2_w );
+ DECLARE_WRITE_LINE_MEMBER( ack_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_int_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+ DECLARE_WRITE_LINE_MEMBER( hrq_w );
+ DECLARE_WRITE_LINE_MEMBER( eop_w );
+ DECLARE_READ8_MEMBER( memr_r );
+ DECLARE_WRITE8_MEMBER( memw_w );
+ DECLARE_READ8_MEMBER( ior1_r );
+ DECLARE_READ8_MEMBER( ior2_r );
+ DECLARE_READ8_MEMBER( ior3_r );
+ DECLARE_WRITE8_MEMBER( iow0_w );
+ DECLARE_WRITE8_MEMBER( iow1_w );
+ DECLARE_WRITE8_MEMBER( iow2_w );
+ DECLARE_WRITE8_MEMBER( iow3_w );
+ DECLARE_WRITE_LINE_MEMBER( dack0_w );
+ DECLARE_WRITE_LINE_MEMBER( dack1_w );
+ DECLARE_WRITE_LINE_MEMBER( dack2_w );
+ DECLARE_WRITE_LINE_MEMBER( dack3_w );
+ DECLARE_INPUT_CHANGED_MEMBER( mouse_button_1_changed );
+ DECLARE_INPUT_CHANGED_MEMBER( mouse_button_2_changed );
+ DECLARE_INPUT_CHANGED_MEMBER( mouse_x_changed );
+ DECLARE_INPUT_CHANGED_MEMBER( mouse_y_changed );
+
+ // system status register
+ int m_pit1;
+ int m_pit2;
+ UINT8 m_status1;
+ UINT8 m_status2;
+ UINT8 m_port61;
+
+ // interrupt state
+ int m_nmi_enable;
+
+ // keyboard state
+ UINT8 m_kbd;
+ int m_kb_bits;
+ int m_kbclk;
+ int m_kbdata;
+
+ // mouse state
+ UINT8 m_mouse_x;
+ UINT8 m_mouse_y;
+
+ // DMA state
+ UINT8 m_dma_page[4];
+ int m_dma_channel;
+ int m_dreq0;
+
+ // floppy state
+ int m_nden;
+ int m_dint;
+ int m_ddrq;
+ UINT8 m_fdc_dsr;
+ int m_neop;
+
+ // printer state
+ int m_ack_int_enable;
+ int m_ack;
+ UINT8 m_printer_data;
+ UINT8 m_printer_control;
+
+ // video state
+ UINT8 *m_video_ram;
+ UINT8 *m_char_rom;
+ int m_toggle;
+ int m_lpen;
+ int m_blink;
+ int m_cursor;
+ int m_blink_ctr;
+ UINT8 m_vdu_mode;
+ UINT8 m_vdu_color;
+ UINT8 m_vdu_plane;
+ UINT8 m_vdu_rdsel;
+ UINT8 m_vdu_border;
+
+ // sound state
+ int m_speaker_drive;
+};
+
+class pc1640_state : public pc1512_state
+{
+public:
+ pc1640_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pc1512_state(mconfig, type, tag),
+ m_opt(0)
+ { }
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( video_ram_r );
+ DECLARE_WRITE8_MEMBER( video_ram_w );
+ DECLARE_READ8_MEMBER( io_r );
+ DECLARE_READ8_MEMBER( iga_r );
+ DECLARE_WRITE8_MEMBER( iga_w );
+ DECLARE_READ8_MEMBER( printer_r );
+
+ // video state
+ int m_opt;
+ UINT8 m_egc_ctrl;
+ UINT8 m_emcr; // extended mode control register
+ UINT8 m_emcrp; // extended mode control register protection read counter
+ UINT8 m_sar; // sequencer address register
+ UINT8 m_sdr[8]; // sequencer data registers
+ UINT8 m_gcar; // graphics controller address register
+ UINT8 m_gcdr[16]; // graphics controller data registers
+ UINT8 m_crtcar; // CRT controller address register
+ UINT8 m_crtcdr[32]; // CRT controller data registers
+ UINT8 m_plr; // Plantronics mode register
+};
+
+// ---------- defined in video/pc1512.c ----------
+
+MACHINE_CONFIG_EXTERN( pc1512_video );
+
+// ---------- defined in video/pc1640.c ----------
+
+MACHINE_CONFIG_EXTERN( pc1640_video );
+
+#endif
diff --git a/src/mess/includes/pc4.h b/src/mess/includes/pc4.h
new file mode 100644
index 00000000000..617315d67db
--- /dev/null
+++ b/src/mess/includes/pc4.h
@@ -0,0 +1,67 @@
+/***************************************************************************
+
+ VTech Laser PC4
+
+****************************************************************************/
+
+#pragma once
+
+#ifndef _PC4_H_
+#define _PC4_H_
+
+
+#include "sound/beep.h"
+
+class pc4_state : public driver_device
+{
+public:
+ pc4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_beep(*this, BEEPER_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_beep;
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ virtual void machine_start();
+
+ DECLARE_WRITE8_MEMBER( beep_w );
+ DECLARE_WRITE8_MEMBER( bank_w );
+ DECLARE_READ8_MEMBER( kb_r );
+
+ //LCD controller
+ void update_ac(void);
+ void set_busy_flag(UINT16 usec);
+ void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+
+ DECLARE_WRITE8_MEMBER(lcd_control_w);
+ DECLARE_READ8_MEMBER(lcd_control_r);
+ DECLARE_WRITE8_MEMBER(lcd_data_w);
+ DECLARE_READ8_MEMBER(lcd_data_r);
+ DECLARE_WRITE8_MEMBER( lcd_offset_w );
+
+ static const device_timer_id BUSY_TIMER = 0;
+ static const device_timer_id BLINKING_TIMER = 1;
+
+ emu_timer *m_blink_timer;
+ emu_timer *m_busy_timer;
+
+ UINT8 m_busy_flag;
+ UINT8 m_ddram[0xa0];
+ UINT8 m_cgram[0x40];
+ INT16 m_ac;
+ UINT8 m_ac_mode;
+ UINT8 m_data_bus_flag;
+ INT16 m_cursor_pos;
+ UINT8 m_display_on;
+ UINT8 m_cursor_on;
+ UINT8 m_blink_on;
+ UINT8 m_shift_on;
+ INT8 m_disp_shift;
+ INT8 m_direction;
+ UINT8 m_blink;
+};
+
+#endif // _PC4_H_
diff --git a/src/mess/includes/pc8001.h b/src/mess/includes/pc8001.h
new file mode 100644
index 00000000000..9a11f471352
--- /dev/null
+++ b/src/mess/includes/pc8001.h
@@ -0,0 +1,82 @@
+#pragma once
+
+#ifndef __PC8001__
+#define __PC8001__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/cassette.h"
+#include "machine/ctronics.h"
+#include "machine/8257dma.h"
+#include "machine/i8255.h"
+#include "machine/i8251.h"
+#include "machine/ram.h"
+#include "machine/upd1990a.h"
+#include "sound/speaker.h"
+#include "video/upd3301.h"
+
+#define Z80_TAG "z80"
+#define I8251_TAG "i8251"
+#define I8255A_TAG "i8255"
+#define I8257_TAG "i8257"
+#define UPD1990A_TAG "upd1990a"
+#define UPD3301_TAG "upd3301"
+#define CENTRONICS_TAG "centronics"
+#define SCREEN_TAG "screen"
+
+class pc8001_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_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<upd1990a_device> m_rtc;
+ required_device<device_t> m_dma;
+ required_device<upd3301_device> m_crtc;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_speaker;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+
+ DECLARE_WRITE8_MEMBER( port10_w );
+ DECLARE_WRITE8_MEMBER( port30_w );
+ DECLARE_READ8_MEMBER( port40_r );
+ DECLARE_WRITE8_MEMBER( port40_w );
+ DECLARE_WRITE_LINE_MEMBER( crtc_drq_w );
+ DECLARE_WRITE_LINE_MEMBER( hrq_w );
+ DECLARE_WRITE8_MEMBER( dma_mem_w );
+ DECLARE_READ8_MEMBER( dma_io_r );
+ DECLARE_WRITE8_MEMBER( dma_io_w );
+
+ /* video state */
+ UINT8 *m_char_rom;
+ int m_width80;
+ int m_color;
+};
+
+class pc8001mk2_state : public pc8001_state
+{
+public:
+ pc8001mk2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pc8001_state(mconfig, type, tag)
+ { }
+
+ DECLARE_WRITE8_MEMBER( port31_w );
+};
+
+#endif
diff --git a/src/mess/includes/pc8401a.h b/src/mess/includes/pc8401a.h
new file mode 100644
index 00000000000..e010d74cae2
--- /dev/null
+++ b/src/mess/includes/pc8401a.h
@@ -0,0 +1,100 @@
+#pragma once
+
+#ifndef __PC8401A__
+#define __PC8401A__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/cartslot.h"
+#include "machine/i8255.h"
+#include "machine/i8251.h"
+#include "machine/ram.h"
+#include "machine/upd1990a.h"
+#include "video/mc6845.h"
+#include "video/sed1330.h"
+
+#define SCREEN_TAG "screen"
+#define CRT_SCREEN_TAG "screen2"
+
+#define Z80_TAG "z80"
+#define I8255A_TAG "i8255a"
+#define UPD1990A_TAG "upd1990a"
+#define AY8910_TAG "ay8910"
+#define SED1330_TAG "sed1330"
+#define MC6845_TAG "mc6845"
+#define I8251_TAG "i8251"
+
+#define PC8401A_CRT_VIDEORAM_SIZE 0x2000
+
+class pc8401a_state : public driver_device
+{
+public:
+ pc8401a_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_lcdc(*this, SED1330_TAG),
+ m_crtc(*this, MC6845_TAG),
+ m_screen_lcd(*this, SCREEN_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<upd1990a_device> m_rtc;
+ required_device<sed1330_device> m_lcdc;
+ required_device<mc6845_device> m_crtc;
+ required_device<device_t> m_screen_lcd;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+
+ DECLARE_WRITE8_MEMBER( mmr_w );
+ DECLARE_READ8_MEMBER( mmr_r );
+ DECLARE_READ8_MEMBER( rtc_r );
+ DECLARE_WRITE8_MEMBER( rtc_cmd_w );
+ DECLARE_WRITE8_MEMBER( rtc_ctrl_w );
+ DECLARE_READ8_MEMBER( io_rom_data_r );
+ DECLARE_WRITE8_MEMBER( io_rom_addr_w );
+ DECLARE_READ8_MEMBER( port70_r );
+ DECLARE_READ8_MEMBER( port71_r );
+ DECLARE_WRITE8_MEMBER( port70_w );
+ DECLARE_WRITE8_MEMBER( port71_w );
+ DECLARE_READ8_MEMBER( ppi_pc_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+
+ void scan_keyboard();
+ void bankswitch(UINT8 data);
+
+ // keyboard state
+ int m_key_strobe; // key pressed
+
+ // memory state
+ UINT8 m_mmr; // memory mapping register
+ UINT32 m_io_addr; // I/O ROM address counter
+
+ // video state
+ UINT8 *m_crt_ram; // CRT video RAM
+
+ UINT8 m_key_latch;
+};
+
+class pc8500_state : public pc8401a_state
+{
+public:
+ pc8500_state(const machine_config &mconfig, device_type type, const char *tag)
+ : pc8401a_state(mconfig, type, tag)
+ { }
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+};
+
+// ---------- defined in video/pc8401a.c ----------
+
+MACHINE_CONFIG_EXTERN( pc8401a_video );
+MACHINE_CONFIG_EXTERN( pc8500_video );
+
+#endif
diff --git a/src/mess/includes/pce.h b/src/mess/includes/pce.h
new file mode 100644
index 00000000000..17f01b25edc
--- /dev/null
+++ b/src/mess/includes/pce.h
@@ -0,0 +1,156 @@
+/*****************************************************************************
+ *
+ * includes/pce.h
+ *
+ * NEC PC Engine/TurboGrafx16
+ *
+ ****************************************************************************/
+
+#ifndef PCE_H_
+#define PCE_H_
+
+#include "cdrom.h"
+#include "sound/msm5205.h"
+#include "machine/nvram.h"
+#include "video/huc6260.h"
+
+#define C6280_TAG "c6280"
+
+#define MAIN_CLOCK 21477270
+#define PCE_CD_CLOCK 9216000
+
+#define PCE_HEADER_SIZE 512
+
+#define TG_16_JOY_SIG 0x00
+#define PCE_JOY_SIG 0x40
+#define NO_CD_SIG 0x80
+#define CD_SIG 0x00
+/* these might be used to indicate something, but they always seem to return 1 */
+#define CONST_SIG 0x30
+
+/* the largest possible cartridge image (street fighter 2 - 2.5MB) */
+#define PCE_ROM_MAXSIZE 0x280000
+
+typedef struct
+{
+ UINT8 regs[16];
+ UINT8 *bram;
+ UINT8 *adpcm_ram;
+ int bram_locked;
+ int adpcm_read_ptr;
+ UINT8 adpcm_read_buf;
+ int adpcm_write_ptr;
+ UINT8 adpcm_write_buf;
+ int adpcm_length;
+ int adpcm_clock_divider;
+ UINT32 msm_start_addr;
+ UINT32 msm_end_addr;
+ UINT32 msm_half_addr;
+ UINT8 msm_nibble;
+ UINT8 msm_idle;
+ UINT8 msm_repeat;
+
+ /* SCSI signals */
+ int scsi_BSY; /* Busy. Bus in use */
+ int scsi_SEL; /* Select. Initiator has won arbitration and has selected a target */
+ int scsi_CD; /* Control/Data. Target is sending control (data) information */
+ int scsi_IO; /* Input/Output. Target is sending (receiving) information */
+ int scsi_MSG; /* Message. Target is sending or receiving a message */
+ int scsi_REQ; /* Request. Target is requesting a data transfer */
+ int scsi_ACK; /* Acknowledge. Initiator acknowledges that it is ready for a data transfer */
+ int scsi_ATN; /* Attention. Initiator has a message ready for the target */
+ int scsi_RST; /* Reset. Initiator forces all targets and any other initiators to do a warm reset */
+ int scsi_last_RST; /* To catch setting of RST signal */
+ int cd_motor_on;
+ int selected;
+ UINT8 *command_buffer;
+ int command_buffer_index;
+ int status_sent;
+ int message_after_status;
+ int message_sent;
+ UINT8 *data_buffer;
+ int data_buffer_size;
+ int data_buffer_index;
+ int data_transferred;
+
+ /* Arcade Card specific */
+ UINT8 *acard_ram;
+ UINT8 acard_latch;
+ UINT8 acard_ctrl[4];
+ UINT32 acard_base_addr[4];
+ UINT16 acard_addr_offset[4];
+ UINT16 acard_addr_inc[4];
+ UINT32 acard_shift;
+ UINT8 acard_shift_reg;
+
+ UINT32 current_frame;
+ UINT32 end_frame;
+ UINT32 last_frame;
+ UINT8 cdda_status;
+ UINT8 cdda_play_mode;
+ UINT8 *subcode_buffer;
+ UINT8 end_mark;
+ cdrom_file *cd;
+ const cdrom_toc* toc;
+ emu_timer *data_timer;
+ emu_timer *adpcm_dma_timer;
+
+ emu_timer *cdda_fadeout_timer;
+ emu_timer *cdda_fadein_timer;
+ double cdda_volume;
+ emu_timer *adpcm_fadeout_timer;
+ emu_timer *adpcm_fadein_timer;
+ double adpcm_volume;
+} pce_cd_t;
+
+
+class pce_state : public driver_device
+{
+public:
+ pce_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_cd_ram(*this, "cd_ram"),
+ m_user_ram(*this, "user_ram"),
+ m_huc6260(*this, "huc6260")
+ { }
+
+ required_shared_ptr<UINT8> m_cd_ram;
+ required_shared_ptr<unsigned char> m_user_ram;
+ optional_device<huc6260_device> m_huc6260;
+ UINT8 m_io_port_options;
+ UINT8 m_sys3_card;
+ UINT8 m_acard;
+ pce_cd_t m_cd;
+ UINT8 *m_cartridge_ram;
+ int m_joystick_port_select;
+ int m_joystick_data_select;
+ UINT8 m_joy_6b_packet[5];
+ DECLARE_WRITE8_MEMBER(pce_sf2_banking_w);
+ DECLARE_WRITE8_MEMBER(pce_cartridge_ram_w);
+ DECLARE_WRITE8_MEMBER(mess_pce_joystick_w);
+ DECLARE_READ8_MEMBER(mess_pce_joystick_r);
+ DECLARE_WRITE8_MEMBER(pce_cd_bram_w);
+ DECLARE_WRITE8_MEMBER(pce_cd_intf_w);
+ DECLARE_READ8_MEMBER(pce_cd_intf_r);
+ DECLARE_READ8_MEMBER(pce_cd_acard_r);
+ DECLARE_WRITE8_MEMBER(pce_cd_acard_w);
+ DECLARE_READ8_MEMBER(pce_cd_acard_wram_r);
+ DECLARE_WRITE8_MEMBER(pce_cd_acard_wram_w);
+ DECLARE_DRIVER_INIT(sgx);
+ DECLARE_DRIVER_INIT(tg16);
+ DECLARE_DRIVER_INIT(mess_pce);
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+};
+
+
+/*----------- defined in machine/pce.c -----------*/
+
+DEVICE_IMAGE_LOAD(pce_cart);
+
+extern const msm5205_interface pce_cd_msm5205_interface;
+
+MACHINE_START( pce );
+MACHINE_RESET( mess_pce );
+
+
+#endif /* PCE_H_ */
diff --git a/src/mess/includes/pcw.h b/src/mess/includes/pcw.h
new file mode 100644
index 00000000000..7fc926e94e0
--- /dev/null
+++ b/src/mess/includes/pcw.h
@@ -0,0 +1,109 @@
+/*****************************************************************************
+ *
+ * includes/pcw.h
+ *
+ ****************************************************************************/
+
+#ifndef PCW_H_
+#define PCW_H_
+
+
+#define PCW_BORDER_HEIGHT 8
+#define PCW_BORDER_WIDTH 8
+#define PCW_NUM_COLOURS 2
+#define PCW_DISPLAY_WIDTH 720
+#define PCW_DISPLAY_HEIGHT 256
+
+#define PCW_SCREEN_WIDTH (PCW_DISPLAY_WIDTH + (PCW_BORDER_WIDTH<<1))
+#define PCW_SCREEN_HEIGHT (PCW_DISPLAY_HEIGHT + (PCW_BORDER_HEIGHT<<1))
+#define PCW_PRINTER_WIDTH (80*16)
+#define PCW_PRINTER_HEIGHT (20*16)
+
+
+class pcw_state : public driver_device
+{
+public:
+ pcw_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ int m_boot;
+ int m_system_status;
+ int m_fdc_interrupt_code;
+ int m_interrupt_counter;
+ UINT8 m_banks[4];
+ unsigned char m_bank_force;
+ UINT8 m_timer_irq_flag;
+ UINT8 m_nmi_flag;
+ UINT8 m_printer_command;
+ UINT8 m_printer_data;
+ UINT8 m_printer_status;
+ INT16 m_printer_headpos;
+ UINT16 m_kb_scan_row;
+ UINT8 m_mcu_keyboard_data[16];
+ UINT8 m_mcu_transmit_reset_seq;
+ UINT8 m_mcu_transmit_count;
+ UINT8 m_mcu_selected;
+ UINT8 m_mcu_buffer;
+ UINT8 m_mcu_prev;
+ unsigned int m_roller_ram_addr;
+ unsigned short m_roller_ram_offset;
+ unsigned char m_vdu_video_control_register;
+ UINT8 m_printer_serial; // value if shift/store data pin
+ UINT8 m_printer_shift; // state of shift register
+ UINT8 m_printer_shift_output; // output presented to the paper feed motor and print head motor
+ UINT8 m_head_motor_state;
+ UINT8 m_linefeed_motor_state;
+ UINT16 m_printer_pins;
+ UINT8 m_printer_p2; // MCU port P2 state
+ UINT32 m_paper_feed; // amount of paper fed through printer, by n/360 inches. One line feed is 61/360in (from the linefeed command in CP/M;s ptr menu)
+ bitmap_ind16* m_prn_output;
+ UINT8 m_printer_p2_prev;
+ emu_timer* m_prn_stepper;
+ emu_timer* m_prn_pins;
+ DECLARE_READ8_MEMBER(pcw_keyboard_r);
+ DECLARE_READ8_MEMBER(pcw_keyboard_data_r);
+ DECLARE_READ8_MEMBER(pcw_interrupt_counter_r);
+ DECLARE_WRITE8_MEMBER(pcw_bank_select_w);
+ DECLARE_WRITE8_MEMBER(pcw_bank_force_selection_w);
+ DECLARE_WRITE8_MEMBER(pcw_roller_ram_addr_w);
+ DECLARE_WRITE8_MEMBER(pcw_pointer_table_top_scan_w);
+ DECLARE_WRITE8_MEMBER(pcw_vdu_video_control_register_w);
+ DECLARE_WRITE8_MEMBER(pcw_system_control_w);
+ DECLARE_READ8_MEMBER(pcw_system_status_r);
+ DECLARE_READ8_MEMBER(pcw_expansion_r);
+ DECLARE_WRITE8_MEMBER(pcw_expansion_w);
+ DECLARE_READ8_MEMBER(pcw_fdc_r);
+ DECLARE_WRITE8_MEMBER(pcw_fdc_w);
+ DECLARE_WRITE8_MEMBER(pcw_printer_data_w);
+ DECLARE_WRITE8_MEMBER(pcw_printer_command_w);
+ DECLARE_READ8_MEMBER(pcw_printer_data_r);
+ DECLARE_READ8_MEMBER(pcw_printer_status_r);
+ DECLARE_READ8_MEMBER(mcu_printer_p1_r);
+ DECLARE_WRITE8_MEMBER(mcu_printer_p1_w);
+ DECLARE_READ8_MEMBER(mcu_printer_p2_r);
+ DECLARE_WRITE8_MEMBER(mcu_printer_p2_w);
+ DECLARE_READ8_MEMBER(mcu_printer_t1_r);
+ DECLARE_READ8_MEMBER(mcu_printer_t0_r);
+ DECLARE_READ8_MEMBER(mcu_kb_scan_r);
+ DECLARE_WRITE8_MEMBER(mcu_kb_scan_w);
+ DECLARE_READ8_MEMBER(mcu_kb_scan_high_r);
+ DECLARE_WRITE8_MEMBER(mcu_kb_scan_high_w);
+ DECLARE_READ8_MEMBER(mcu_kb_data_r);
+ DECLARE_READ8_MEMBER(mcu_kb_t1_r);
+ DECLARE_READ8_MEMBER(mcu_kb_t0_r);
+ DECLARE_READ8_MEMBER(pcw9512_parallel_r);
+ DECLARE_WRITE8_MEMBER(pcw9512_parallel_w);
+ void mcu_transmit_serial(UINT8 bit);
+ DECLARE_DRIVER_INIT(pcw);
+};
+
+
+/*----------- defined in video/pcw.c -----------*/
+
+extern VIDEO_START( pcw );
+extern SCREEN_UPDATE_IND16( pcw );
+extern SCREEN_UPDATE_IND16( pcw_printer );
+extern PALETTE_INIT( pcw );
+
+
+#endif /* PCW_H_ */
diff --git a/src/mess/includes/pcw16.h b/src/mess/includes/pcw16.h
new file mode 100644
index 00000000000..0ead19bc5ff
--- /dev/null
+++ b/src/mess/includes/pcw16.h
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ *
+ * includes/pcw16.h
+ *
+ ****************************************************************************/
+
+#ifndef PCW16_H_
+#define PCW16_H_
+
+
+#define PCW16_BORDER_HEIGHT 8
+#define PCW16_BORDER_WIDTH 8
+#define PCW16_NUM_COLOURS 32
+#define PCW16_DISPLAY_WIDTH 640
+#define PCW16_DISPLAY_HEIGHT 480
+
+#define PCW16_SCREEN_WIDTH (PCW16_DISPLAY_WIDTH + (PCW16_BORDER_WIDTH<<1))
+#define PCW16_SCREEN_HEIGHT (PCW16_DISPLAY_HEIGHT + (PCW16_BORDER_HEIGHT<<1))
+
+
+class pcw16_state : public driver_device
+{
+public:
+ pcw16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ unsigned long m_interrupt_counter;
+ int m_banks[4];
+ int m_4_bit_port;
+ int m_fdc_int_code;
+ int m_system_status;
+ char *m_mem_ptr[4];
+ unsigned char m_keyboard_data_shift;
+ int m_keyboard_parity_table[256];
+ int m_keyboard_bits;
+ int m_keyboard_bits_output;
+ int m_keyboard_state;
+ int m_keyboard_previous_state;
+ unsigned char m_rtc_seconds;
+ unsigned char m_rtc_minutes;
+ unsigned char m_rtc_hours;
+ unsigned char m_rtc_days_max;
+ unsigned char m_rtc_days;
+ unsigned char m_rtc_months;
+ unsigned char m_rtc_years;
+ unsigned char m_rtc_control;
+ unsigned char m_rtc_256ths_seconds;
+ int m_previous_fdc_int_state;
+ int m_colour_palette[16];
+ int m_video_control;
+ DECLARE_WRITE8_MEMBER(pcw16_palette_w);
+ DECLARE_READ8_MEMBER(pcw16_no_mem_r);
+ DECLARE_READ8_MEMBER(pcw16_bankhw_r);
+ DECLARE_WRITE8_MEMBER(pcw16_bankhw_w);
+ DECLARE_WRITE8_MEMBER(pcw16_video_control_w);
+ DECLARE_READ8_MEMBER(pcw16_keyboard_data_shift_r);
+ DECLARE_WRITE8_MEMBER(pcw16_keyboard_data_shift_w);
+ DECLARE_READ8_MEMBER(pcw16_keyboard_status_r);
+ DECLARE_WRITE8_MEMBER(pcw16_keyboard_control_w);
+ DECLARE_READ8_MEMBER(rtc_year_invalid_r);
+ DECLARE_READ8_MEMBER(rtc_month_r);
+ DECLARE_READ8_MEMBER(rtc_days_r);
+ DECLARE_READ8_MEMBER(rtc_hours_r);
+ DECLARE_READ8_MEMBER(rtc_minutes_r);
+ DECLARE_READ8_MEMBER(rtc_seconds_r);
+ DECLARE_READ8_MEMBER(rtc_256ths_seconds_r);
+ DECLARE_WRITE8_MEMBER(rtc_control_w);
+ DECLARE_WRITE8_MEMBER(rtc_seconds_w);
+ DECLARE_WRITE8_MEMBER(rtc_minutes_w);
+ DECLARE_WRITE8_MEMBER(rtc_hours_w);
+ DECLARE_WRITE8_MEMBER(rtc_days_w);
+ DECLARE_WRITE8_MEMBER(rtc_month_w);
+ DECLARE_WRITE8_MEMBER(rtc_year_w);
+ DECLARE_READ8_MEMBER(pcw16_system_status_r);
+ DECLARE_READ8_MEMBER(pcw16_timer_interrupt_counter_r);
+ DECLARE_WRITE8_MEMBER(pcw16_system_control_w);
+ DECLARE_WRITE8_MEMBER(pcw16_superio_fdc_datarate_w);
+ DECLARE_WRITE8_MEMBER(pcw16_superio_fdc_digital_output_register_w);
+ DECLARE_WRITE8_MEMBER(pcw16_superio_fdc_data_w);
+ DECLARE_READ8_MEMBER(pcw16_superio_fdc_data_r);
+ DECLARE_READ8_MEMBER(pcw16_superio_fdc_main_status_register_r);
+ DECLARE_READ8_MEMBER(pcw16_superio_fdc_digital_input_register_r);
+ DECLARE_READ8_MEMBER(pcw16_mem_r);
+ DECLARE_WRITE8_MEMBER(pcw16_mem_w);
+ void pcw16_keyboard_init();
+ void pcw16_keyboard_refresh_outputs();
+ void pcw16_keyboard_set_clock_state(int state);
+ void pcw16_keyboard_int(int state);
+ void pcw16_keyboard_reset();
+ int pcw16_keyboard_can_transmit();
+ void pcw16_keyboard_signal_byte_received(int data);
+ void pcw16_refresh_ints();
+ void rtc_setup_max_days();
+ UINT8 pcw16_read_mem(UINT8 bank, UINT16 offset);
+ void pcw16_write_mem(UINT8 bank, UINT16 offset, UINT8 data);
+ UINT8 read_bank_data(UINT8 type, UINT16 offset);
+ void write_bank_data(UINT8 type, UINT16 offset, UINT8 data);
+};
+
+
+/*----------- defined in video/pcw16.c -----------*/
+
+extern PALETTE_INIT( pcw16 );
+extern VIDEO_START( pcw16 );
+extern SCREEN_UPDATE_IND16( pcw16 );
+
+
+#endif /* PCW16_H_ */
diff --git a/src/mess/includes/pdp1.h b/src/mess/includes/pdp1.h
new file mode 100644
index 00000000000..18b3633d502
--- /dev/null
+++ b/src/mess/includes/pdp1.h
@@ -0,0 +1,273 @@
+/*****************************************************************************
+ *
+ * includes/pdp1.h
+ *
+ ****************************************************************************/
+
+#ifndef PDP1_H_
+#define PDP1_H_
+
+
+/* defines for each bit and mask in input port "CSW" */
+enum
+{
+ /* bit numbers */
+ pdp1_control_bit = 0,
+
+ pdp1_extend_bit = 1,
+ pdp1_start_nobrk_bit= 2,
+ pdp1_start_brk_bit = 3,
+ pdp1_stop_bit = 4,
+ pdp1_continue_bit = 5,
+ pdp1_examine_bit = 6,
+ pdp1_deposit_bit = 7,
+ pdp1_read_in_bit = 8,
+ pdp1_reader_bit = 9,
+ pdp1_tape_feed_bit = 10,
+ pdp1_single_step_bit= 11,
+ pdp1_single_inst_bit= 12,
+
+ /* masks */
+ pdp1_control = (1 << pdp1_control_bit),
+ pdp1_extend = (1 << pdp1_extend_bit),
+ pdp1_start_nobrk = (1 << pdp1_start_nobrk_bit),
+ pdp1_start_brk = (1 << pdp1_start_brk_bit),
+ pdp1_stop = (1 << pdp1_stop_bit),
+ pdp1_continue = (1 << pdp1_continue_bit),
+ pdp1_examine = (1 << pdp1_examine_bit),
+ pdp1_deposit = (1 << pdp1_deposit_bit),
+ pdp1_read_in = (1 << pdp1_read_in_bit),
+ pdp1_reader = (1 << pdp1_reader_bit),
+ pdp1_tape_feed = (1 << pdp1_tape_feed_bit),
+ pdp1_single_step = (1 << pdp1_single_step_bit),
+ pdp1_single_inst = (1 << pdp1_single_inst_bit)
+};
+
+/* defines for each bit in input port pdp1_spacewar_controllers*/
+#define ROTATE_LEFT_PLAYER1 0x01
+#define ROTATE_RIGHT_PLAYER1 0x02
+#define THRUST_PLAYER1 0x04
+#define FIRE_PLAYER1 0x08
+#define ROTATE_LEFT_PLAYER2 0x10
+#define ROTATE_RIGHT_PLAYER2 0x20
+#define THRUST_PLAYER2 0x40
+#define FIRE_PLAYER2 0x80
+#define HSPACE_PLAYER1 0x100
+#define HSPACE_PLAYER2 0x200
+
+/* defines for each field in input port pdp1_config */
+enum
+{
+ pdp1_config_extend_bit = 0,
+ pdp1_config_extend_mask = 0x3, /* 2 bits */
+ pdp1_config_hw_mul_div_bit = 2,
+ pdp1_config_hw_mul_div_mask = 0x1,
+ /*pdp1_config_hw_obsolete_bit = 3,
+ pdp1_config_hw_obsolete_mask = 0x1,*/
+ pdp1_config_type_20_sbs_bit = 4,
+ pdp1_config_type_20_sbs_mask = 0x1,
+ pdp1_config_lightpen_bit = 5,
+ pdp1_config_lightpen_mask = 0x1
+};
+
+/* defines for each field in input port pdp1_lightpen_state */
+enum
+{
+ pdp1_lightpen_down_bit = 0,
+ pdp1_lightpen_smaller_bit = 1,
+ pdp1_lightpen_larger_bit = 2,
+
+ pdp1_lightpen_down = (1 << pdp1_lightpen_down_bit),
+ pdp1_lightpen_smaller = (1 << pdp1_lightpen_smaller_bit),
+ pdp1_lightpen_larger = (1 << pdp1_lightpen_larger_bit)
+};
+
+/* defines for our font */
+enum
+{
+ pdp1_charnum = /*104*/128, /* ASCII set + 8 special characters */
+ /* for whatever reason, 104 breaks some characters */
+
+ pdp1_fontdata_size = 8 * pdp1_charnum
+};
+
+enum
+{
+ /* size and position of crt window */
+ crt_window_width = 512,
+ crt_window_height = 512,
+ crt_window_offset_x = 0,
+ crt_window_offset_y = 0,
+ /* size and position of operator control panel window */
+ panel_window_width = 384,
+ panel_window_height = 128,
+ panel_window_offset_x = crt_window_width,
+ panel_window_offset_y = 0,
+ /* size and position of typewriter window */
+ typewriter_window_width = 640,
+ typewriter_window_height = 160,
+ typewriter_window_offset_x = 0,
+ typewriter_window_offset_y = crt_window_height
+};
+
+enum
+{
+ total_width = crt_window_width + panel_window_width,
+ total_height = crt_window_height + typewriter_window_height,
+
+ /* respect 4:3 aspect ratio to keep pixels square */
+ virtual_width_1 = ((total_width+3)/4)*4,
+ virtual_height_1 = ((total_height+2)/3)*3,
+ virtual_width_2 = virtual_height_1*4/3,
+ virtual_height_2 = virtual_width_1*3/4,
+ virtual_width = (virtual_width_1 > virtual_width_2) ? virtual_width_1 : virtual_width_2,
+ virtual_height = (virtual_height_1 > virtual_height_2) ? virtual_height_1 : virtual_height_2
+};
+
+enum
+{ /* refresh rate in Hz: can be changed at will */
+ refresh_rate = 60
+};
+
+/* Color codes */
+enum
+{
+ /* first pen_crt_num_levels colors used for CRT (with remanence) */
+ pen_crt_num_levels = 69,
+ pen_crt_max_intensity = pen_crt_num_levels-1,
+
+ /* next colors used for control panel and typewriter */
+ pen_black = pen_crt_num_levels,
+ pen_white,
+ pen_green,
+ pen_dk_green,
+ pen_red,
+ pen_lt_gray,
+
+ /* color constants for control panel */
+ pen_panel_bg = pen_black,
+ pen_panel_caption = pen_white,
+ color_panel_caption = 0,
+ pen_switch_nut = pen_lt_gray,
+ pen_switch_button = pen_white,
+ pen_lit_lamp = pen_green,
+ pen_unlit_lamp = pen_dk_green,
+
+ /* color constants for typewriter */
+ pen_typewriter_bg = pen_white,
+ color_typewriter_black = 1,
+ color_typewriter_red = 2,
+
+ /* color constants used for light pen */
+ pen_lightpen_nonpressed = pen_red,
+ pen_lightpen_pressed = pen_green
+};
+
+/* tape reader registers */
+typedef struct tape_reader_t
+{
+ device_image_interface *fd; /* file descriptor of tape image */
+
+ int motor_on; /* 1-bit reader motor on */
+
+ int rb; /* 18-bit reader buffer */
+ int rcl; /* 1-bit reader clutch */
+ int rc; /* 2-bit reader counter */
+ int rby; /* 1-bit reader binary mode flip-flop */
+ int rcp; /* 1-bit reader "need a completion pulse" flip-flop */
+
+ emu_timer *timer; /* timer to simulate reader timing */
+} tape_reader_t;
+
+
+
+/* tape puncher registers */
+typedef struct tape_puncher_t
+{
+ device_image_interface *fd; /* file descriptor of tape image */
+
+ emu_timer *timer; /* timer to generate completion pulses */
+} tape_puncher_t;
+
+
+
+/* typewriter registers */
+typedef struct typewriter_t
+{
+ device_image_interface *fd; /* file descriptor of output image */
+
+ int tb; /* typewriter buffer */
+
+ emu_timer *tyo_timer;/* timer to generate completion pulses */
+} typewriter_t;
+
+/* MIT parallel drum (mostly similar to type 23) */
+typedef struct parallel_drum_t
+{
+ device_image_interface *fd; /* file descriptor of drum image */
+
+ int il; /* initial location (12-bit) */
+ int wc; /* word counter (12-bit) */
+ int wcl; /* word core location counter (16-bit) */
+ int rfb; /* read field buffer (5-bit) */
+ int wfb; /* write field buffer (5-bit) */
+
+ int dba;
+
+ emu_timer *rotation_timer; /* timer called each time dc is 0 */
+ emu_timer *il_timer; /* timer called each time dc is il */
+} parallel_drum_t;
+
+
+typedef struct lightpen_t
+{
+ char active;
+ char down;
+ short x, y;
+ short radius;
+} lightpen_t;
+
+
+class pdp1_state : public driver_device
+{
+public:
+ pdp1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ pdp1_reset_param_t m_reset_param;
+ int m_io_status;
+ tape_reader_t m_tape_reader;
+ tape_puncher_t m_tape_puncher;
+ typewriter_t m_typewriter;
+ emu_timer *m_dpy_timer;
+ lightpen_t m_lightpen;
+ parallel_drum_t m_parallel_drum;
+ int m_old_typewriter_keys[4];
+ int m_old_lightpen;
+ int m_old_control_keys;
+ int m_old_tw_keys;
+ int m_old_ta_keys;
+ int m_typewriter_color;
+ bitmap_ind16 m_panel_bitmap;
+ bitmap_ind16 m_typewriter_bitmap;
+ lightpen_t m_lightpen_state;
+ lightpen_t m_previous_lightpen_state;
+ int m_pos;
+ int m_case_shift;
+ device_t *m_crt;
+};
+
+
+
+/*----------- defined in video/pdp1.c -----------*/
+
+VIDEO_START( pdp1 );
+SCREEN_VBLANK( pdp1 );
+SCREEN_UPDATE_IND16( pdp1 );
+
+void pdp1_plot(running_machine &machine, int x, int y);
+void pdp1_typewriter_drawchar(running_machine &machine, int character);
+void pdp1_update_lightpen_state(running_machine &machine, const lightpen_t *new_state);
+
+
+#endif /* PDP1_H_ */
diff --git a/src/mess/includes/pecom.h b/src/mess/includes/pecom.h
new file mode 100644
index 00000000000..79d953fca6f
--- /dev/null
+++ b/src/mess/includes/pecom.h
@@ -0,0 +1,52 @@
+#ifndef __PECOM__
+#define __PECOM__
+
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cassette.h"
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "cdp1802"
+#define CDP1869_TAG "cdp1869"
+
+#define PECOM_CHAR_RAM_SIZE 0x800
+
+class pecom_state : public driver_device
+{
+public:
+ pecom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_cdp1802(*this, CDP1802_TAG),
+ m_cdp1869(*this, CDP1869_TAG)
+ { }
+
+ required_device<cosmac_device> m_cdp1802;
+ required_device<cdp1869_device> m_cdp1869;
+
+ UINT8 *m_charram; /* character generator ROM */
+ int m_reset; /* CPU mode */
+ int m_dma; /* memory refresh DMA */
+
+ /* timers */
+ emu_timer *m_reset_timer; /* power on reset timer */
+
+ DECLARE_READ8_MEMBER(pecom_cdp1869_charram_r);
+ DECLARE_WRITE8_MEMBER(pecom_cdp1869_charram_w);
+ DECLARE_READ8_MEMBER(pecom_cdp1869_pageram_r);
+ DECLARE_WRITE8_MEMBER(pecom_cdp1869_pageram_w);
+ DECLARE_WRITE8_MEMBER(pecom_bank_w);
+ DECLARE_READ8_MEMBER(pecom_keyboard_r);
+ DECLARE_WRITE8_MEMBER(pecom_cdp1869_w);
+};
+
+/*----------- defined in machine/pecom.c -----------*/
+
+extern MACHINE_START( pecom );
+extern MACHINE_RESET( pecom );
+
+extern const cosmac_interface pecom64_cdp1802_config;
+
+/* ---------- defined in video/pecom.c ---------- */
+
+MACHINE_CONFIG_EXTERN( pecom_video );
+
+#endif
diff --git a/src/mess/includes/pes.h b/src/mess/includes/pes.h
new file mode 100644
index 00000000000..30b5543a395
--- /dev/null
+++ b/src/mess/includes/pes.h
@@ -0,0 +1,45 @@
+/***************************************************************************
+
+ pes.h
+
+****************************************************************************/
+
+#pragma once
+
+#ifndef _PES_H_
+#define _PES_H_
+
+#include "machine/terminal.h"
+
+class pes_state : public driver_device
+{
+public:
+ pes_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_terminal(*this, TERMINAL_TAG),
+ m_speech(*this, "tms5220")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<generic_terminal_device> m_terminal;
+ required_device<device_t> m_speech;
+
+ UINT8 m_wsstate; // /WS
+ UINT8 m_rsstate; // /RS
+ UINT8 m_port3_state; // Port3 state as last written
+ UINT8 m_infifo[32]; // input fifo
+ UINT8 m_infifo_tail_ptr; // " tail
+ UINT8 m_infifo_head_ptr; // " head
+
+ virtual void machine_reset();
+ DECLARE_WRITE8_MEMBER(rsws_w);
+ DECLARE_WRITE8_MEMBER(port1_w);
+ DECLARE_WRITE8_MEMBER(port3_w);
+ DECLARE_READ8_MEMBER(port1_r);
+ DECLARE_READ8_MEMBER(port3_r);
+ DECLARE_DRIVER_INIT(pes);
+};
+
+
+#endif // _PES_H_
diff --git a/src/mess/includes/pet.h b/src/mess/includes/pet.h
new file mode 100644
index 00000000000..1b813b0aa65
--- /dev/null
+++ b/src/mess/includes/pet.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ commodore pet series computer
+
+ peter.trauner@jk.uni-linz.ac.at
+***************************************************************************/
+
+#ifndef PET_H_
+#define PET_H_
+
+#include "video/mc6845.h"
+#include "machine/6821pia.h"
+#include "machine/6522via.h"
+#include "machine/ieee488.h"
+#include "imagedev/cartslot.h"
+
+typedef struct
+{
+ int bank; /* rambank to be switched in 0x9000 */
+ int rom; /* rom socket 6502? at 0x9000 */
+} spet_t;
+
+
+class pet_state : public driver_device
+{
+public:
+ pet_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_ieee(*this, IEEE488_TAG),
+ m_videoram(*this, "videoram"),
+ m_memory(*this, "memory"){ }
+
+ required_device<ieee488_device> m_ieee;
+
+ int m_pet_basic1; /* basic version 1 for quickloader */
+ int m_superpet;
+ int m_cbm8096;
+
+ int m_pia0_irq;
+ int m_pia1_irq;
+ int m_via_irq;
+ optional_shared_ptr<UINT8> m_videoram;
+ int m_font;
+ optional_shared_ptr<UINT8> m_memory;
+ UINT8 *m_supermemory;
+ UINT8 *m_pet80_bank1_base;
+ int m_keyline_select;
+ emu_timer *m_datasette1_timer;
+ emu_timer *m_datasette2_timer;
+ spet_t m_spet;
+ int m_pia_level;
+ DECLARE_DRIVER_INIT(superpet);
+ DECLARE_DRIVER_INIT(pet80);
+ DECLARE_DRIVER_INIT(pet);
+ DECLARE_DRIVER_INIT(pet2001);
+};
+
+/*----------- defined in video/pet.c -----------*/
+
+/* call to init videodriver */
+void pet_vh_init (running_machine &machine);
+void pet80_vh_init (running_machine &machine);
+void superpet_vh_init (running_machine &machine);
+SCREEN_UPDATE_IND16( pet );
+MC6845_UPDATE_ROW( pet40_update_row );
+MC6845_UPDATE_ROW( pet80_update_row );
+WRITE_LINE_DEVICE_HANDLER( pet_display_enable_changed );
+
+
+/*----------- defined in machine/pet.c -----------*/
+
+extern const via6522_interface pet_via;
+extern const pia6821_interface pet_pia0;
+extern const pia6821_interface petb_pia0;
+extern const pia6821_interface pet_pia1;
+
+
+WRITE8_HANDLER(cbm8096_w);
+extern READ8_HANDLER(superpet_r);
+extern WRITE8_HANDLER(superpet_w);
+
+MACHINE_RESET( pet );
+INTERRUPT_GEN( pet_frame_interrupt );
+
+MACHINE_CONFIG_EXTERN( pet_cartslot );
+MACHINE_CONFIG_EXTERN( pet4_cartslot );
+
+#endif /* PET_H_ */
diff --git a/src/mess/includes/phc25.h b/src/mess/includes/phc25.h
new file mode 100644
index 00000000000..8dbfa79e48c
--- /dev/null
+++ b/src/mess/includes/phc25.h
@@ -0,0 +1,54 @@
+#pragma once
+
+#ifndef __PHC25__
+#define __PHC25__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+#include "machine/ctronics.h"
+#include "video/mc6847.h"
+#include "sound/ay8910.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define AY8910_TAG "ay8910"
+#define MC6847_TAG "mc6847"
+#define CENTRONICS_TAG "centronics"
+
+#define PHC25_VIDEORAM_SIZE 0x1800
+
+class phc25_state : public driver_device
+{
+public:
+ phc25_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_vdg(*this, MC6847_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<mc6847_base_device> m_vdg;
+ required_device<centronics_device> m_centronics;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void video_start();
+
+ DECLARE_READ8_MEMBER( port40_r );
+ DECLARE_WRITE8_MEMBER( port40_w );
+ DECLARE_READ8_MEMBER( video_ram_r );
+
+ static UINT8 ntsc_char_rom_r(running_machine &machine, UINT8 ch, int line);
+ static UINT8 pal_char_rom_r(running_machine &machine, UINT8 ch, int line);
+
+ /* video state */
+ required_shared_ptr<UINT8> m_video_ram;
+ UINT8 *m_char_rom;
+};
+
+#endif
diff --git a/src/mess/includes/pk8020.h b/src/mess/includes/pk8020.h
new file mode 100644
index 00000000000..5f99beb6471
--- /dev/null
+++ b/src/mess/includes/pk8020.h
@@ -0,0 +1,61 @@
+/*****************************************************************************
+ *
+ * includes/pk8020.h
+ *
+ ****************************************************************************/
+
+#ifndef PK8020_H_
+#define PK8020_H_
+
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/i8251.h"
+#include "imagedev/cassette.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+
+class pk8020_state : public driver_device
+{
+public:
+ pk8020_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_color;
+ UINT8 m_video_page;
+ UINT8 m_wide;
+ UINT8 m_font;
+ UINT8 m_attr;
+ UINT8 m_text_attr;
+ UINT8 m_takt;
+ UINT8 m_video_page_access;
+ UINT8 m_portc_data;
+ UINT8 m_sound_gate;
+ UINT8 m_sound_level;
+ DECLARE_READ8_MEMBER(keyboard_r);
+ DECLARE_READ8_MEMBER(sysreg_r);
+ DECLARE_WRITE8_MEMBER(sysreg_w);
+ DECLARE_READ8_MEMBER(text_r);
+ DECLARE_WRITE8_MEMBER(text_w);
+ DECLARE_READ8_MEMBER(gzu_r);
+ DECLARE_WRITE8_MEMBER(gzu_w);
+ DECLARE_READ8_MEMBER(devices_r);
+ DECLARE_WRITE8_MEMBER(devices_w);
+};
+
+
+/*----------- defined in machine/pk8020.c -----------*/
+extern MACHINE_RESET( pk8020 );
+extern const i8255_interface pk8020_ppi8255_interface_1;
+extern const i8255_interface pk8020_ppi8255_interface_2;
+extern const i8255_interface pk8020_ppi8255_interface_3;
+extern const struct pit8253_config pk8020_pit8253_intf;
+extern const struct pic8259_interface pk8020_pic8259_config;
+extern INTERRUPT_GEN( pk8020_interrupt );
+/*----------- defined in video/pk8020.c -----------*/
+
+extern PALETTE_INIT( pk8020 );
+extern VIDEO_START( pk8020 );
+extern SCREEN_UPDATE_IND16( pk8020 );
+
+#endif /* pk8020_H_ */
diff --git a/src/mess/includes/plus4.h b/src/mess/includes/plus4.h
new file mode 100644
index 00000000000..85b724b2073
--- /dev/null
+++ b/src/mess/includes/plus4.h
@@ -0,0 +1,113 @@
+#pragma once
+
+#ifndef __PLUS4__
+#define __PLUS4__
+
+#include "emu.h"
+#include "formats/cbm_snqk.h"
+#include "includes/cbm.h"
+#include "audio/t6721.h"
+#include "audio/mos7360.h"
+#include "machine/6551acia.h"
+#include "machine/plus4exp.h"
+#include "machine/plus4user.h"
+#include "machine/cbmiec.h"
+#include "machine/cbmipt.h"
+#include "machine/mos6529.h"
+#include "machine/pls100.h"
+#include "machine/ram.h"
+
+#define MOS7501_TAG "u2"
+#define MOS7360_TAG "u1"
+#define MOS6551_TAG "u3"
+#define MOS6529_USER_TAG "u5"
+#define MOS6529_KB_TAG "u27"
+#define T6721_TAG "t6721"
+#define PLA_TAG "u19"
+#define SCREEN_TAG "screen"
+#define CASSETTE_TAG "cassette"
+
+class plus4_state : public driver_device
+{
+public:
+ plus4_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, MOS7501_TAG),
+ m_pla(*this, PLA_TAG),
+ m_ted(*this, MOS7360_TAG),
+ m_acia(*this, MOS6551_TAG),
+ m_spi_user(*this, MOS6529_USER_TAG),
+ m_spi_kb(*this, MOS6529_KB_TAG),
+ m_t6721(*this, T6721_TAG),
+ m_iec(*this, CBM_IEC_TAG),
+ m_exp(*this, PLUS4_EXPANSION_SLOT_TAG),
+ m_user(*this, PLUS4_USER_PORT_TAG),
+ m_ram(*this, RAM_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_function(NULL),
+ m_addr(0),
+ m_rom_en(1),
+ m_ted_irq(CLEAR_LINE),
+ m_acia_irq(CLEAR_LINE),
+ m_exp_irq(CLEAR_LINE)
+ { }
+
+ required_device<legacy_cpu_device> m_maincpu;
+ required_device<pls100_device> m_pla;
+ required_device<mos7360_device> m_ted;
+ optional_device<acia6551_device> m_acia;
+ optional_device<mos6529_device> m_spi_user;
+ required_device<mos6529_device> m_spi_kb;
+ optional_device<device_t> m_t6721;
+ required_device<cbm_iec_device> m_iec;
+ required_device<plus4_expansion_slot_device> m_exp;
+ optional_device<plus4_user_port_device> m_user;
+ required_device<ram_device> m_ram;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void check_interrupts();
+ void bankswitch(offs_t offset, int phi0, int mux, int ras, int *scs, int *phi2, int *user, int *_6551, int *addr_clk, int *keyport, int *kernal, int *cs0, int *cs1);
+ UINT8 read_memory(address_space &space, offs_t offset, int ba, int scs, int phi2, int user, int _6551, int addr_clk, int keyport, int kernal, int cs0, int cs1);
+ UINT8 read_keyboard(UINT8 databus);
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ DECLARE_READ8_MEMBER( cpu_r );
+ DECLARE_READ8_MEMBER( c16_cpu_r );
+ DECLARE_WRITE8_MEMBER( cpu_w );
+
+ DECLARE_WRITE_LINE_MEMBER( ted_irq_w );
+ DECLARE_READ8_MEMBER( ted_ram_r );
+ DECLARE_READ8_MEMBER( ted_rom_r );
+ DECLARE_READ8_MEMBER( ted_k_r );
+
+ DECLARE_READ8_MEMBER( spi_kb_r );
+ DECLARE_WRITE8_MEMBER( spi_kb_w );
+
+ DECLARE_READ8_MEMBER( exp_dma_r );
+ DECLARE_WRITE8_MEMBER( exp_dma_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
+
+ // memory state
+ const UINT8 *m_kernal;
+ const UINT8 *m_function;
+ UINT8 m_addr;
+ int m_rom_en;
+
+ // interrupt state
+ int m_ted_irq;
+ int m_acia_irq;
+ int m_exp_irq;
+
+ // keyboard state
+ UINT8 m_port6529;
+ UINT8 m_keyline[10];
+};
+
+
+
+#endif
diff --git a/src/mess/includes/pmd85.h b/src/mess/includes/pmd85.h
new file mode 100644
index 00000000000..8f3641f5627
--- /dev/null
+++ b/src/mess/includes/pmd85.h
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ *
+ * includes/pmd85.h
+ *
+ ****************************************************************************/
+
+#ifndef PMD85_H_
+#define PMD85_H_
+
+#include "machine/i8255.h"
+
+class pmd85_state : public driver_device
+{
+public:
+ pmd85_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_rom_module_present;
+ UINT8 m_ppi_port_outputs[4][3];
+ UINT8 m_startup_mem_map;
+ UINT8 m_pmd853_memory_mapping;
+ int m_previous_level;
+ int m_clk_level;
+ int m_clk_level_tape;
+ UINT8 m_model;
+ emu_timer * m_cassette_timer;
+ void (*update_memory)(running_machine &);
+ DECLARE_READ8_MEMBER(pmd85_io_r);
+ DECLARE_WRITE8_MEMBER(pmd85_io_w);
+ DECLARE_READ8_MEMBER(mato_io_r);
+ DECLARE_WRITE8_MEMBER(mato_io_w);
+ DECLARE_DIRECT_UPDATE_MEMBER(pmd85_opbaseoverride);
+ DECLARE_DRIVER_INIT(mato);
+ DECLARE_DRIVER_INIT(pmd852a);
+ DECLARE_DRIVER_INIT(pmd851);
+ DECLARE_DRIVER_INIT(pmd853);
+ DECLARE_DRIVER_INIT(alfa);
+ DECLARE_DRIVER_INIT(c2717);
+};
+
+
+/*----------- defined in machine/pmd85.c -----------*/
+
+extern const struct pit8253_config pmd85_pit8253_interface;
+extern const i8255_interface pmd85_ppi8255_interface[4];
+extern const i8255_interface alfa_ppi8255_interface[3];
+extern const i8255_interface mato_ppi8255_interface;
+
+extern MACHINE_RESET( pmd85 );
+
+
+/*----------- defined in video/pmd85.c -----------*/
+
+extern VIDEO_START( pmd85 );
+extern SCREEN_UPDATE_IND16( pmd85 );
+extern const unsigned char pmd85_palette[3*3];
+extern PALETTE_INIT( pmd85 );
+
+
+#endif /* PMD85_H_ */
diff --git a/src/mess/includes/pocketc.h b/src/mess/includes/pocketc.h
new file mode 100644
index 00000000000..3a0c9c9e688
--- /dev/null
+++ b/src/mess/includes/pocketc.h
@@ -0,0 +1,23 @@
+/*****************************************************************************
+ *
+ * includes/pocketc.h
+ *
+ ****************************************************************************/
+
+#ifndef POCKETC_H_
+#define POCKETC_H_
+
+
+/*----------- defined in video/pocketc.c -----------*/
+
+extern PALETTE_INIT( pocketc );
+extern VIDEO_START( pocketc );
+
+extern const unsigned short pocketc_colortable[8][2];
+
+typedef const char *POCKETC_FIGURE[];
+void pocketc_draw_special(bitmap_ind16 &bitmap,
+ int x, int y, const POCKETC_FIGURE fig, int color);
+
+
+#endif /* POCKETC_H_ */
diff --git a/src/mess/includes/pokemini.h b/src/mess/includes/pokemini.h
new file mode 100644
index 00000000000..993c5998e33
--- /dev/null
+++ b/src/mess/includes/pokemini.h
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ *
+ * includes/pokemini.h
+ *
+ ****************************************************************************/
+
+#ifndef POKEMINI_H_
+#define POKEMINI_H_
+
+#include "sound/speaker.h"
+#include "machine/i2cmem.h"
+#include "cpu/minx/minx.h"
+#include "imagedev/cartslot.h"
+#include "rendlay.h"
+
+#define MACHINE_START_MEMBER(name) void name::machine_start()
+
+typedef struct
+{
+ UINT8 colors_inverted;
+ UINT8 background_enabled;
+ UINT8 sprites_enabled;
+ UINT8 copy_enabled;
+ UINT8 map_size;
+ UINT8 map_size_x;
+ UINT8 frame_count;
+ UINT8 max_frame_count;
+ UINT32 bg_tiles;
+ UINT32 spr_tiles;
+ UINT8 count;
+ emu_timer *count_timer;
+} PRC;
+
+
+typedef struct
+{
+ emu_timer *seconds_timer;
+ emu_timer *hz256_timer;
+ emu_timer *timer1; /* Timer 1 low or 16bit */
+ emu_timer *timer1_hi; /* Timer 1 hi */
+ emu_timer *timer2; /* Timer 2 low or 16bit */
+ emu_timer *timer2_hi; /* Timer 2 high */
+ emu_timer *timer3; /* Timer 3 low or 16bit */
+ emu_timer *timer3_hi; /* Timer 3 high */
+} TIMERS;
+
+
+class pokemini_state : public driver_device
+{
+public:
+ pokemini_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu")
+ ,
+ m_p_ram(*this, "p_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_shared_ptr<UINT8> m_p_ram;
+ UINT8 m_pm_reg[0x100];
+ PRC m_prc;
+ TIMERS m_timers;
+ bitmap_ind16 m_bitmap;
+ virtual void video_start();
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+};
+
+
+/*----------- defined in machine/pokemini.c -----------*/
+
+WRITE8_DEVICE_HANDLER( pokemini_hwreg_w );
+READ8_DEVICE_HANDLER( pokemini_hwreg_r );
+
+DEVICE_IMAGE_LOAD( pokemini_cart );
+
+#endif /* POKEMINI_H */
diff --git a/src/mess/includes/poly88.h b/src/mess/includes/poly88.h
new file mode 100644
index 00000000000..2fdcd818181
--- /dev/null
+++ b/src/mess/includes/poly88.h
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ *
+ * includes/poly88.h
+ *
+ ****************************************************************************/
+
+#ifndef POLY88_H_
+#define POLY88_H_
+
+#include "machine/i8251.h"
+#include "imagedev/snapquik.h"
+
+class poly88_state : public driver_device
+{
+public:
+ poly88_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_shared_ptr<UINT8> m_video_ram;
+ UINT8 *m_FNT;
+ UINT8 m_intr;
+ UINT8 m_last_code;
+ UINT8 m_int_vector;
+ emu_timer * m_cassette_timer;
+ emu_timer * m_usart_timer;
+ int m_previous_level;
+ int m_clk_level;
+ int m_clk_level_tape;
+ DECLARE_WRITE8_MEMBER(poly88_baud_rate_w);
+ DECLARE_READ8_MEMBER(poly88_keyboard_r);
+ DECLARE_WRITE8_MEMBER(poly88_intr_w);
+ DECLARE_DRIVER_INIT(poly88);
+};
+
+
+/*----------- defined in machine/poly88.c -----------*/
+
+MACHINE_RESET(poly88);
+INTERRUPT_GEN( poly88_interrupt );
+
+extern const i8251_interface poly88_usart_interface;
+
+extern SNAPSHOT_LOAD( poly88 );
+
+
+/*----------- defined in video/poly88.c -----------*/
+
+extern VIDEO_START( poly88 );
+extern SCREEN_UPDATE_IND16( poly88 );
+
+#endif /* POLY88_H_ */
+
diff --git a/src/mess/includes/poly880.h b/src/mess/includes/poly880.h
new file mode 100644
index 00000000000..e8000d7b4a9
--- /dev/null
+++ b/src/mess/includes/poly880.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#ifndef __POLY880__
+#define __POLY880__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "imagedev/cassette.h"
+#include "machine/z80pio.h"
+#include "machine/z80ctc.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "i1"
+#define Z80CTC_TAG "i4"
+#define Z80PIO1_TAG "i2"
+#define Z80PIO2_TAG "i3"
+
+class poly880_state : public driver_device
+{
+public:
+ poly880_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+
+ DECLARE_WRITE8_MEMBER( cldig_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z0_w );
+ DECLARE_WRITE_LINE_MEMBER( ctc_z1_w );
+ DECLARE_WRITE8_MEMBER( pio1_pa_w );
+ DECLARE_READ8_MEMBER( pio1_pb_r );
+ DECLARE_WRITE8_MEMBER( pio1_pb_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
+
+ void update_display();
+
+ /* display state */
+ UINT8 m_digit;
+ UINT8 m_segment;
+};
+
+#endif
diff --git a/src/mess/includes/portfoli.h b/src/mess/includes/portfoli.h
new file mode 100644
index 00000000000..8b3fe1f4e88
--- /dev/null
+++ b/src/mess/includes/portfoli.h
@@ -0,0 +1,89 @@
+#pragma once
+
+#ifndef __PORTFOLIO__
+#define __PORTFOLIO__
+
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "imagedev/cartslot.h"
+#include "machine/ram.h"
+#include "imagedev/printer.h"
+#include "machine/ctronics.h"
+#include "machine/i8255.h"
+#include "machine/ins8250.h"
+#include "machine/nvram.h"
+#include "sound/speaker.h"
+#include "video/hd61830.h"
+
+#define SCREEN_TAG "screen"
+#define M80C88A_TAG "u1"
+#define M82C55A_TAG "hpc101_u1"
+#define M82C50A_TAG "hpc102_u1"
+#define HD61830_TAG "hd61830"
+#define CENTRONICS_TAG "centronics"
+#define TIMER_TICK_TAG "tick"
+
+class portfolio_state : public driver_device
+{
+public:
+ portfolio_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M80C88A_TAG),
+ m_lcdc(*this, HD61830_TAG),
+ m_ppi(*this, M82C55A_TAG),
+ m_uart(*this, M82C50A_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_timer_tick(*this, TIMER_TICK_TAG)
+ ,
+ m_contrast(*this, "contrast"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<hd61830_device> m_lcdc;
+ required_device<i8255_device> m_ppi;
+ required_device<ins8250_device> m_uart;
+ required_device<device_t> m_speaker;
+ required_device<timer_device> m_timer_tick;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void check_interrupt();
+ void trigger_interrupt(int level);
+ void scan_keyboard();
+
+ DECLARE_READ8_MEMBER( irq_status_r );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_READ8_MEMBER( battery_r );
+ DECLARE_READ8_MEMBER( counter_r );
+ DECLARE_READ8_MEMBER( pid_r );
+
+ DECLARE_WRITE8_MEMBER( irq_mask_w );
+ DECLARE_WRITE8_MEMBER( sivr_w );
+ DECLARE_WRITE8_MEMBER( speaker_w );
+ DECLARE_WRITE8_MEMBER( power_w );
+ DECLARE_WRITE8_MEMBER( unknown_w );
+ DECLARE_WRITE8_MEMBER( counter_w );
+ DECLARE_WRITE8_MEMBER( ncc1_w );
+
+ DECLARE_WRITE_LINE_MEMBER( i8250_intrpt_w );
+
+ /* interrupt state */
+ UINT8 m_ip; /* interrupt pending */
+ UINT8 m_ie; /* interrupt enable */
+ UINT8 m_sivr; /* serial interrupt vector register */
+
+ /* counter state */
+ UINT16 m_counter;
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* video state */
+ required_shared_ptr<UINT8> m_contrast;
+
+ /* peripheral state */
+ UINT8 m_pid; /* peripheral identification */
+};
+
+#endif
diff --git a/src/mess/includes/pp01.h b/src/mess/includes/pp01.h
new file mode 100644
index 00000000000..dbb865a4a4a
--- /dev/null
+++ b/src/mess/includes/pp01.h
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ *
+ * includes/pp01.h
+ *
+ ****************************************************************************/
+
+#ifndef PP01_H_
+#define PP01_H_
+
+#include "machine/pit8253.h"
+#include "machine/i8255.h"
+
+class pp01_state : public driver_device
+{
+public:
+ pp01_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_video_scroll;
+ UINT8 m_memory_block[16];
+ UINT8 m_video_write_mode;
+ UINT8 m_key_line;
+ DECLARE_WRITE8_MEMBER(pp01_video_write_mode_w);
+ DECLARE_WRITE8_MEMBER(pp01_video_r_1_w);
+ DECLARE_WRITE8_MEMBER(pp01_video_g_1_w);
+ DECLARE_WRITE8_MEMBER(pp01_video_b_1_w);
+ DECLARE_WRITE8_MEMBER(pp01_video_r_2_w);
+ DECLARE_WRITE8_MEMBER(pp01_video_g_2_w);
+ DECLARE_WRITE8_MEMBER(pp01_video_b_2_w);
+ DECLARE_WRITE8_MEMBER(pp01_mem_block_w);
+ DECLARE_READ8_MEMBER(pp01_mem_block_r);
+};
+
+
+/*----------- defined in machine/pp01.c -----------*/
+extern const struct pit8253_config pp01_pit8253_intf;
+extern const i8255_interface pp01_ppi8255_interface;
+extern MACHINE_START( pp01 );
+extern MACHINE_RESET( pp01 );
+/*----------- defined in video/pp01.c -----------*/
+
+extern VIDEO_START( pp01 );
+extern SCREEN_UPDATE_IND16( pp01 );
+extern PALETTE_INIT( pp01 );
+
+#endif
diff --git a/src/mess/includes/primo.h b/src/mess/includes/primo.h
new file mode 100644
index 00000000000..e826194a8c7
--- /dev/null
+++ b/src/mess/includes/primo.h
@@ -0,0 +1,51 @@
+/*****************************************************************************
+ *
+ * includes/primo.h
+ *
+ ****************************************************************************/
+
+#ifndef PRIMO_H_
+#define PRIMO_H_
+
+#include "imagedev/snapquik.h"
+#include "machine/cbmiec.h"
+
+class primo_state : public driver_device
+{
+public:
+ primo_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_iec(*this, CBM_IEC_TAG)
+ { }
+
+ required_device<cbm_iec_device> m_iec;
+
+ UINT16 m_video_memory_base;
+ UINT8 m_port_FD;
+ int m_nmi;
+ DECLARE_READ8_MEMBER(primo_be_1_r);
+ DECLARE_READ8_MEMBER(primo_be_2_r);
+ DECLARE_WRITE8_MEMBER(primo_ki_1_w);
+ DECLARE_WRITE8_MEMBER(primo_ki_2_w);
+ DECLARE_WRITE8_MEMBER(primo_FD_w);
+ DECLARE_DRIVER_INIT(primo48);
+ DECLARE_DRIVER_INIT(primo64);
+ DECLARE_DRIVER_INIT(primo32);
+};
+
+
+/*----------- defined in machine/primo.c -----------*/
+
+extern MACHINE_RESET( primoa );
+extern MACHINE_RESET( primob );
+extern INTERRUPT_GEN( primo_vblank_interrupt );
+extern SNAPSHOT_LOAD( primo );
+extern QUICKLOAD_LOAD( primo );
+
+
+/*----------- defined in video/primo.c -----------*/
+
+extern SCREEN_UPDATE_IND16( primo );
+
+
+#endif /* PRIMO_H_ */
diff --git a/src/mess/includes/prof180x.h b/src/mess/includes/prof180x.h
new file mode 100644
index 00000000000..e30fbf941a4
--- /dev/null
+++ b/src/mess/includes/prof180x.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#ifndef __PROF180X__
+#define __PROF180X__
+
+#define HD64180_TAG "hd64180"
+#define FDC9268_TAG "fdc9268"
+#define FDC9229_TAG "fdc9229"
+#define MK3835_TAG "mk3835"
+#define SCREEN_TAG "screen"
+#define CENTRONICS_TAG "centronics"
+
+class prof180x_state : public driver_device
+{
+public:
+ prof180x_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_WRITE8_MEMBER( flr_w );
+ DECLARE_READ8_MEMBER( status0_r );
+ DECLARE_READ8_MEMBER( status1_r );
+ DECLARE_READ8_MEMBER( status_r );
+
+ void bankswitch();
+ void ls259_w(int flag, int value);
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ int m_c0;
+ int m_c1;
+ int m_c2;
+ int m_mm0;
+ int m_mm1;
+};
+
+#endif
diff --git a/src/mess/includes/prof80.h b/src/mess/includes/prof80.h
new file mode 100644
index 00000000000..78ee3a80297
--- /dev/null
+++ b/src/mess/includes/prof80.h
@@ -0,0 +1,92 @@
+#pragma once
+
+#ifndef __PROF80__
+#define __PROF80__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ecbbus.h"
+#include "machine/ecb_grip.h"
+#include "machine/ram.h"
+#include "machine/rescap.h"
+#include "machine/upd1990a.h"
+#include "machine/upd765.h"
+
+#define Z80_TAG "z1"
+#define UPD765_TAG "z38"
+#define UPD1990A_TAG "z43"
+#define SCREEN_TAG "screen"
+
+// ------------------------------------------------------------------------
+
+#define UNIO_Z80STI_TAG "z5"
+#define UNIO_Z80SIO_TAG "z15"
+#define UNIO_Z80PIO_TAG "z13"
+#define UNIO_CENTRONICS1_TAG "n3"
+#define UNIO_CENTRONICS2_TAG "n4"
+
+class prof80_state : public driver_device
+{
+public:
+ prof80_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_fdc(*this, UPD765_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_ecb(*this, ECBBUS_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<upd1990a_device> m_rtc;
+ required_device<device_t> m_fdc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<ecbbus_device> m_ecb;
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void machine_start();
+ virtual void machine_reset();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ enum
+ {
+ TIMER_ID_MOTOR
+ };
+
+ DECLARE_WRITE8_MEMBER( flr_w );
+ DECLARE_READ8_MEMBER( status_r );
+ DECLARE_READ8_MEMBER( status2_r );
+ DECLARE_WRITE8_MEMBER( par_w );
+ DECLARE_WRITE_LINE_MEMBER( floppy_index_w );
+
+ void bankswitch();
+ void ls259_w(int fa, int sa, int fb, int sb);
+ void floppy_motor_off();
+
+ // memory state
+ UINT8 m_mmu[16]; // MMU block register
+ int m_init; // MMU enable
+
+ // RTC state
+ int m_c0;
+ int m_c1;
+ int m_c2;
+
+ // floppy state
+ int m_fdc_index; // floppy index hole sensor
+ int m_motor; // floppy motor
+
+ // timers
+ emu_timer *m_floppy_motor_off_timer;
+
+};
+
+#endif
diff --git a/src/mess/includes/ps2.h b/src/mess/includes/ps2.h
new file mode 100644
index 00000000000..275817d58f3
--- /dev/null
+++ b/src/mess/includes/ps2.h
@@ -0,0 +1,17 @@
+/*****************************************************************************
+ *
+ * includes/ps2.h
+ *
+ ****************************************************************************/
+
+#ifndef PS2_H_
+#define PS2_H_
+
+
+/*----------- defined in machine/ps2.c -----------*/
+
+ READ8_HANDLER(ps2_pos_r);
+WRITE8_HANDLER(ps2_pos_w);
+
+
+#endif /* PS2_H_ */
diff --git a/src/mess/includes/psion.h b/src/mess/includes/psion.h
new file mode 100644
index 00000000000..345dca49a7e
--- /dev/null
+++ b/src/mess/includes/psion.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+
+ Psion Organiser II series
+
+****************************************************************************/
+
+#pragma once
+
+#ifndef _PSION_H_
+#define _PSION_H_
+
+#include "cpu/m6800/m6800.h"
+#include "machine/psion_pack.h"
+#include "video/hd44780.h"
+#include "sound/beep.h"
+
+#define MCFG_PSION_CUSTOM_LCDC_ADD( _tag , _config) \
+ MCFG_DEVICE_ADD( _tag, PSION_CUSTOM_LCDC, 0 ) \
+ MCFG_DEVICE_CONFIG(_config)
+
+// ======================> psion_custom_lcdc
+
+class psion_custom_lcdc : public hd44780_device
+{
+
+public:
+ // construction/destruction
+ psion_custom_lcdc(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // hd44780_device overrides
+ virtual DECLARE_WRITE8_MEMBER(control_write);
+ virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+};
+
+
+// ======================> psion_state
+
+class psion_state : public driver_device
+{
+public:
+ psion_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_lcdc(*this, "hd44780"),
+ m_beep(*this, BEEPER_TAG),
+ m_pack1(*this, "pack1"),
+ m_pack2(*this, "pack2"),
+ m_sys_register(*this, "sys_register"),
+ m_ram(*this, "ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<hd44780_device> m_lcdc;
+ required_device<device_t> m_beep;
+ required_device<datapack_device> m_pack1;
+ required_device<datapack_device> m_pack2;
+
+ UINT16 m_kb_counter;
+ UINT8 m_enable_nmi;
+ optional_shared_ptr<UINT8> m_sys_register;
+ UINT8 m_tcsr_value;
+ UINT8 m_stby_pwr;
+ UINT8 m_pulse;
+
+ UINT8 m_port2_ddr; // datapack i/o ddr
+ UINT8 m_port2; // datapack i/o data bus
+ UINT8 m_port6_ddr; // datapack control lines ddr
+ UINT8 m_port6; // datapack control lines
+
+ // RAM/ROM banks
+ required_shared_ptr<UINT8> m_ram;
+ UINT8 *m_paged_ram;
+ UINT8 m_rom_bank;
+ UINT8 m_ram_bank;
+ UINT8 m_ram_bank_count;
+ UINT8 m_rom_bank_count;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT8 kb_read(running_machine &machine);
+ void update_banks(running_machine &machine);
+ DECLARE_WRITE8_MEMBER( hd63701_int_reg_w );
+ DECLARE_READ8_MEMBER( hd63701_int_reg_r );
+ void io_rw(address_space &space, UINT16 offset);
+ DECLARE_WRITE8_MEMBER( io_w );
+ DECLARE_READ8_MEMBER( io_r );
+};
+
+// device type definition
+extern const device_type PSION_CUSTOM_LCDC;
+
+#endif // _PSION_H_
diff --git a/src/mess/includes/px8.h b/src/mess/includes/px8.h
new file mode 100644
index 00000000000..144c7005816
--- /dev/null
+++ b/src/mess/includes/px8.h
@@ -0,0 +1,82 @@
+#pragma once
+
+#ifndef __PX8__
+#define __PX8__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/m6800/m6800.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+#include "machine/i8251.h"
+#include "machine/pf10.h"
+#include "sound/wave.h"
+
+#define UPD70008_TAG "4a"
+#define UPD7508_TAG "2e"
+#define HD6303_TAG "13d"
+#define SED1320_TAG "7c"
+#define I8251_TAG "13e"
+#define UPD7001_TAG "1d"
+#define SCREEN_TAG "screen"
+
+#define PX8_VIDEORAM_MASK 0x17ff
+
+class px8_state : public driver_device
+{
+public:
+ px8_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, UPD70008_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+ /* video state */
+ required_shared_ptr<UINT8> m_video_ram; /* LCD video RAM */
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ READ8_MEMBER( gah40m_r );
+ WRITE8_MEMBER( gah40m_w );
+ READ8_MEMBER( gah40s_r );
+ WRITE8_MEMBER( gah40s_w );
+ WRITE8_MEMBER( gah40s_ier_w );
+ READ8_MEMBER( krtn_0_3_r );
+ READ8_MEMBER( krtn_4_7_r );
+ WRITE8_MEMBER( ksc_w );
+
+ void bankswitch();
+ UINT8 krtn_read();
+
+ /* GAH40M state */
+ UINT16 m_icr; /* input capture register */
+ UINT16 m_frc; /* free running counter */
+ UINT8 m_ier; /* interrupt acknowledge register */
+ UINT8 m_isr; /* interrupt status register */
+ UINT8 m_sio; /* serial I/O register */
+ int m_bank0; /* */
+
+ /* GAH40S state */
+ UINT16 m_cnt; /* microcassette tape counter */
+ int m_swpr; /* P-ROM power switch */
+ UINT16 m_pra; /* P-ROM address */
+ UINT8 m_prd; /* P-ROM data */
+
+ /* memory state */
+ int m_bk2; /* */
+
+ /* keyboard state */
+ int m_ksc; /* keyboard scan column */
+};
+
+#endif
diff --git a/src/mess/includes/ql.h b/src/mess/includes/ql.h
new file mode 100644
index 00000000000..98b785a351a
--- /dev/null
+++ b/src/mess/includes/ql.h
@@ -0,0 +1,138 @@
+#pragma once
+
+#ifndef __QL__
+#define __QL__
+
+#include "machine/ram.h"
+#include "machine/wd17xx.h"
+
+#define SCREEN_TAG "screen"
+
+#define M68008_TAG "ic18"
+#define I8749_TAG "ic24"
+#define I8051_TAG "i8051"
+#define ZX8301_TAG "ic22"
+#define ZX8302_TAG "ic23"
+#define WD1772_TAG "wd1772"
+
+#define ROMBANK_TAG "rombank"
+#define RAMBANK_TAG "rambank"
+
+#define PRINTER_TAG "printer"
+
+#define X1 XTAL_15MHz
+#define X2 XTAL_32_768kHz
+#define X3 XTAL_4_436MHz
+#define X4 XTAL_11MHz
+
+#define QL_CONFIG_PORT "QLCONFIG"
+#define DISK_TYPE_MASK 0x03
+#define DISK_TYPE_NONE 0x00
+#define DISK_TYPE_TRUMP 0x01
+#define DISK_TYPE_SANDY 0x02
+
+#define TRUMP_DRIVE1_MASK 0x01
+#define TRUMP_DRIVE0_MASK 0x02
+#define TRUMP_MOTOR_MASK 0x04
+#define TRUMP_SIDE_SHIFT 3
+#define TRUMP_SIDE_MASK (1 << TRUMP_SIDE_SHIFT)
+
+#define CART_ROM_BASE 0x0c000
+#define CART_ROM_END 0x0ffff
+#define TRUMP_ROM_BASE 0x10000
+#define TRUMP_ROM_LEN 0x08000
+#define TRUMP_ROM_END (TRUMP_ROM_BASE+(TRUMP_ROM_LEN-1))
+
+#define TRUMP_IO_BASE 0x1c000
+#define TRUMP_IO_LEN 0x04000
+#define TRUMP_IO_END (TRUMP_IO_BASE+(TRUMP_IO_LEN-1))
+
+#define SANDY_ROM_BASE 0x18000
+#define SANDY_IO_BASE 0xc3fc0
+#define SANDY_IO_LEN 0x00040
+#define SANDY_IO_END (SANDY_IO_BASE+(SANDY_IO_LEN-1))
+
+#define SANDY_DRIVE0_MASK 0x02
+#define SANDY_DRIVE1_MASK 0x04
+#define SANDY_MOTOR_MASK 0x08
+#define SANDY_SIDE_SHIFT 0
+#define SANDY_SIDE_MASK (1 << SANDY_SIDE_SHIFT)
+#define SANDY_DDEN_SHIFT 4
+#define SANDY_DDEN_MASK (1 << SANDY_DDEN_SHIFT)
+#define SANDY_PRINTER_STROBE 0x20
+#define SANDY_PRINTER_INTMASK 0x40
+
+
+class ql_state : public driver_device
+{
+public:
+ ql_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M68008_TAG),
+ m_ipc(*this, I8749_TAG),
+ m_zx8301(*this, ZX8301_TAG),
+ m_zx8302(*this, ZX8302_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_mdv1(*this, MDV_1),
+ m_mdv2(*this, MDV_2),
+ m_ram(*this, RAM_TAG),
+ m_fdc(*this, WD1772_TAG),
+ m_printer(*this, PRINTER_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_ipc;
+ required_device<zx8301_device> m_zx8301;
+ required_device<zx8302_device> m_zx8302;
+ required_device<device_t> m_speaker;
+ required_device<microdrive_image_device> m_mdv1;
+ required_device<microdrive_image_device> m_mdv2;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_fdc;
+ required_device<printer_image_device> m_printer;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( ipc_w );
+ DECLARE_WRITE8_MEMBER( ipc_port1_w );
+ DECLARE_WRITE8_MEMBER( ipc_port2_w );
+ DECLARE_READ8_MEMBER( ipc_port2_r );
+ DECLARE_READ8_MEMBER( ipc_t1_r );
+ DECLARE_READ8_MEMBER( ipc_bus_r );
+ DECLARE_READ8_MEMBER( ql_ram_r );
+ DECLARE_WRITE8_MEMBER( ql_ram_w );
+ DECLARE_WRITE_LINE_MEMBER( ql_baudx4_w );
+ DECLARE_WRITE_LINE_MEMBER( ql_comdata_w );
+ DECLARE_WRITE_LINE_MEMBER( zx8302_mdselck_w );
+ DECLARE_WRITE_LINE_MEMBER( zx8302_mdrdw_w );
+ DECLARE_WRITE_LINE_MEMBER( zx8302_erase_w );
+ DECLARE_WRITE_LINE_MEMBER( zx8302_raw1_w );
+ DECLARE_READ_LINE_MEMBER( zx8302_raw1_r );
+ DECLARE_WRITE_LINE_MEMBER( zx8302_raw2_w );
+ DECLARE_READ_LINE_MEMBER( zx8302_raw2_r );
+
+ /* IPC state */
+ UINT8 m_keylatch;
+ int m_ipl;
+ int m_comdata;
+ int m_baudx4;
+
+ // Trump card & Sandy superdisk
+ DECLARE_READ8_MEMBER( disk_io_r );
+ DECLARE_WRITE8_MEMBER( disk_io_w );
+ DECLARE_READ8_MEMBER( trump_card_rom_r );
+ DECLARE_READ8_MEMBER( cart_rom_r );
+
+ void trump_card_set_control(UINT8 data);
+ void sandy_set_control(UINT8 data);
+
+ int m_disk_type;
+ int m_disk_io_base;
+ UINT8 m_disk_io_byte;
+ UINT8 m_printer_char;
+};
+
+#endif
diff --git a/src/mess/includes/radio86.h b/src/mess/includes/radio86.h
new file mode 100644
index 00000000000..f7e26cd062e
--- /dev/null
+++ b/src/mess/includes/radio86.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ *
+ * includes/radio86.h
+ *
+ ****************************************************************************/
+
+#ifndef radio86_H_
+#define radio86_H_
+
+#include "machine/i8255.h"
+#include "machine/8257dma.h"
+#include "video/i8275.h"
+
+class radio86_state : public driver_device
+{
+public:
+ radio86_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ bitmap_ind16 m_bitmap;
+
+ UINT8 m_tape_value;
+ UINT8 m_mikrosha_font_page;
+ int m_keyboard_mask;
+ UINT8* m_radio_ram_disk;
+ UINT8 m_romdisk_lsb;
+ UINT8 m_romdisk_msb;
+ UINT8 m_disk_sel;
+ DECLARE_READ8_MEMBER(radio_cpu_state_r);
+ DECLARE_READ8_MEMBER(radio_io_r);
+ DECLARE_WRITE8_MEMBER(radio_io_w);
+ DECLARE_WRITE8_MEMBER(radio86_pagesel);
+ DECLARE_DRIVER_INIT(radioram);
+ DECLARE_DRIVER_INIT(radio86);
+};
+
+
+/*----------- defined in drivers/radio86.c -----------*/
+
+INPUT_PORTS_EXTERN( radio86 );
+INPUT_PORTS_EXTERN( ms7007 );
+
+
+/*----------- defined in machine/radio86.c -----------*/
+
+extern MACHINE_RESET( radio86 );
+
+
+
+extern const i8255_interface radio86_ppi8255_interface_1;
+extern const i8255_interface radio86_ppi8255_interface_2;
+extern const i8255_interface rk7007_ppi8255_interface;
+
+extern const i8255_interface mikrosha_ppi8255_interface_1;
+extern const i8255_interface mikrosha_ppi8255_interface_2;
+
+extern const i8275_interface radio86_i8275_interface;
+extern const i8275_interface partner_i8275_interface;
+extern const i8275_interface mikrosha_i8275_interface;
+extern const i8275_interface apogee_i8275_interface;
+
+extern const i8257_interface radio86_dma;
+
+
+extern void radio86_init_keyboard(running_machine &machine);
+
+
+/*----------- defined in video/radio86.c -----------*/
+
+extern I8275_DISPLAY_PIXELS(radio86_display_pixels);
+extern I8275_DISPLAY_PIXELS(partner_display_pixels);
+extern I8275_DISPLAY_PIXELS(mikrosha_display_pixels);
+extern I8275_DISPLAY_PIXELS(apogee_display_pixels);
+
+extern SCREEN_UPDATE_IND16( radio86 );
+extern PALETTE_INIT( radio86 );
+
+#endif /* radio86_H_ */
diff --git a/src/mess/includes/rm380z.h b/src/mess/includes/rm380z.h
new file mode 100644
index 00000000000..aed486ec141
--- /dev/null
+++ b/src/mess/includes/rm380z.h
@@ -0,0 +1,129 @@
+
+/*
+
+Research Machines RM 380Z
+
+*/
+
+#ifndef RM380Z_H_
+#define RM380Z_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "machine/ram.h"
+#include "imagedev/flopdrv.h"
+#include "machine/wd17xx.h"
+#include "machine/keyboard.h"
+
+//
+//
+//
+
+#define RM380Z_MAINCPU_TAG "maincpu"
+#define RM380Z_PORTS_ENABLED_HIGH ( m_port0 & 0x80 )
+#define RM380Z_PORTS_ENABLED_LOW ( ( m_port0 & 0x80 ) == 0x00 )
+
+#define RM380Z_VIDEOMODE_40COL 0x01
+#define RM380Z_VIDEOMODE_80COL 0x02
+
+#define RM380Z_CHDIMX 5
+#define RM380Z_CHDIMY 9
+#define RM380Z_NCX 8
+#define RM380Z_NCY 16
+#define RM380Z_SCREENCOLS 80
+#define RM380Z_SCREENROWS 24
+
+#define RM380Z_VIDEORAM_SIZE 0x600
+#define RM380Z_SCREENSIZE 0x1200
+
+
+//
+//
+//
+
+
+class rm380z_state : public driver_device
+{
+private:
+
+ void put_point(int charnum,int x,int y,int col);
+ void init_graphic_chars();
+
+ void putChar(int charnum,int attribs,int x,int y,bitmap_ind16 &bitmap,unsigned char* chsb,int vmode);
+ void decode_videoram_char(int pos,UINT8& chr,UINT8& attrib);
+ void scroll_videoram();
+ void config_videomode();
+ void check_scroll_register();
+
+ int writenum;
+
+protected:
+ virtual void machine_reset();
+ virtual void machine_start();
+
+public:
+
+ UINT8 m_port0;
+ UINT8 m_port0_kbd;
+ UINT8 m_port1;
+ UINT8 m_fbfd;
+ UINT8 m_fbfe;
+
+ UINT8 m_graphic_chars[0x80][(RM380Z_CHDIMX+1)*(RM380Z_CHDIMY+1)];
+
+ UINT8 m_mainVideoram[RM380Z_VIDEORAM_SIZE];
+ UINT8 m_vramchars[RM380Z_SCREENSIZE];
+ UINT8 m_vramattribs[RM380Z_SCREENSIZE];
+ UINT8 m_vram[RM380Z_SCREENSIZE];
+
+ int m_rasterlineCtr;
+ emu_timer* m_vblankTimer;
+
+ int m_old_fbfd;
+ int m_old_old_fbfd;
+
+ int m_videomode;
+ int m_old_videomode;
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_messram;
+ optional_device<device_t> m_fdc;
+
+ rm380z_state(const machine_config &mconfig, device_type type, const char *tag): driver_device(mconfig, type, tag),
+ m_maincpu(*this, RM380Z_MAINCPU_TAG),
+ m_messram(*this, RAM_TAG),
+ m_fdc(*this, "wd1771")
+ {
+ }
+
+ DECLARE_WRITE8_MEMBER( port_write );
+ DECLARE_READ8_MEMBER( port_read );
+ DECLARE_WRITE8_MEMBER( port_write_1b00 );
+ DECLARE_READ8_MEMBER( port_read_1b00 );
+
+ DECLARE_READ8_MEMBER( main_read );
+ DECLARE_WRITE8_MEMBER( main_write );
+
+ DECLARE_READ8_MEMBER( videoram_read );
+ DECLARE_WRITE8_MEMBER( videoram_write );
+
+ UINT8 hiram[0x1000];
+ DECLARE_READ8_MEMBER( hiram_read );
+ DECLARE_WRITE8_MEMBER( hiram_write );
+
+ DECLARE_READ8_MEMBER( rm380z_portlow_r );
+ DECLARE_WRITE8_MEMBER( rm380z_portlow_w );
+ DECLARE_READ8_MEMBER( rm380z_porthi_r );
+ DECLARE_WRITE8_MEMBER( rm380z_porthi_w );
+
+ DECLARE_WRITE8_MEMBER(disk_0_control);
+
+ DECLARE_WRITE8_MEMBER( keyboard_put );
+
+ void config_memory_map();
+ int keyboard_decode();
+ void update_screen(bitmap_ind16 &bitmap);
+};
+
+
+#endif
diff --git a/src/mess/includes/rmnimbus.h b/src/mess/includes/rmnimbus.h
new file mode 100644
index 00000000000..70bc69308ec
--- /dev/null
+++ b/src/mess/includes/rmnimbus.h
@@ -0,0 +1,449 @@
+/*
+ rmnimbus.c
+ Machine driver for the Research Machines Nimbus.
+
+ Phill Harvey-Smith
+ 2009-11-29.
+*/
+
+#include "machine/z80sio.h"
+#include "machine/wd17xx.h"
+#include "machine/scsibus.h"
+#include "machine/6522via.h"
+
+#define MAINCPU_TAG "maincpu"
+#define IOCPU_TAG "iocpu"
+
+#define num_ioports 0x80
+#define NIMBUS_KEYROWS 11
+#define KEYBOARD_QUEUE_SIZE 32
+
+#define SCREEN_WIDTH_PIXELS 640
+#define SCREEN_HEIGHT_LINES 250
+#define SCREEN_NO_COLOURS 16
+
+#define NO_VIDREGS (0x30/2)
+
+/* Nimbus sub-bios structures for debugging */
+
+typedef struct
+{
+ UINT16 ofs_brush;
+ UINT16 seg_brush;
+ UINT16 ofs_data;
+ UINT16 seg_data;
+ UINT16 count;
+} t_area_params;
+
+typedef struct
+{
+ UINT16 ofs_font;
+ UINT16 seg_font;
+ UINT16 ofs_data;
+ UINT16 seg_data;
+ UINT16 x;
+ UINT16 y;
+ UINT16 length;
+} t_plot_string_params;
+
+typedef struct
+{
+ UINT16 style;
+ UINT16 style_index;
+ UINT16 colour1;
+ UINT16 colour2;
+ UINT16 transparency;
+ UINT16 boundary_spec;
+ UINT16 boundary_colour;
+ UINT16 save_colour;
+} t_nimbus_brush;
+
+#define SCREEN_WIDTH_PIXELS 640
+#define SCREEN_HEIGHT_LINES 250
+#define SCREEN_NO_COLOURS 16
+
+
+/* 80186 internal stuff */
+struct mem_state
+{
+ UINT16 lower;
+ UINT16 upper;
+ UINT16 middle;
+ UINT16 middle_size;
+ UINT16 peripheral;
+};
+
+struct timer_state
+{
+ UINT16 control;
+ UINT16 maxA;
+ UINT16 maxB;
+ UINT16 count;
+ emu_timer *int_timer;
+ emu_timer *time_timer;
+ UINT8 time_timer_active;
+ attotime last_time;
+};
+
+struct dma_state
+{
+ UINT32 source;
+ UINT32 dest;
+ UINT16 count;
+ UINT16 control;
+ UINT8 finished;
+ emu_timer *finish_timer;
+};
+
+struct intr_state
+{
+ UINT8 pending;
+ UINT16 ack_mask;
+ UINT16 priority_mask;
+ UINT16 in_service;
+ UINT16 request;
+ UINT16 status;
+ UINT16 poll_status;
+ UINT16 timer;
+ UINT16 dma[2];
+ UINT16 ext[4];
+ UINT16 ext_vector[2]; // external vectors, when in cascade mode
+};
+
+typedef struct
+{
+ struct timer_state timer[3];
+ struct dma_state dma[2];
+ struct intr_state intr;
+ struct mem_state mem;
+} i186_state;
+
+typedef struct
+{
+ UINT8 keyrows[NIMBUS_KEYROWS];
+ emu_timer *keyscan_timer;
+ UINT8 queue[KEYBOARD_QUEUE_SIZE];
+ UINT8 head;
+ UINT8 tail;
+} keyboard_t;
+
+// Static data related to Floppy and SCSI hard disks
+typedef struct
+{
+ UINT8 reg400;
+ UINT8 reg410_in;
+ UINT8 reg410_out;
+ UINT8 reg418;
+
+ UINT8 drq_ff;
+ UINT8 int_ff;
+} nimbus_drives_t;
+
+/* 8031 Peripheral controler */
+typedef struct
+{
+ UINT8 ipc_in;
+ UINT8 ipc_out;
+ UINT8 status_in;
+ UINT8 status_out;
+ UINT8 int_8c_pending;
+ UINT8 int_8e_pending;
+ UINT8 int_8f_pending;
+} ipc_interface_t;
+
+/* Mouse/Joystick */
+typedef struct
+{
+ UINT8 m_mouse_px;
+ UINT8 m_mouse_py;
+
+ UINT8 m_mouse_x;
+ UINT8 m_mouse_y;
+ UINT8 m_mouse_pc;
+ UINT8 m_mouse_pcx;
+ UINT8 m_mouse_pcy;
+
+ UINT8 m_intstate_x;
+ UINT8 m_intstate_y;
+
+ UINT8 m_reg0a4;
+
+ emu_timer *m_mouse_timer;
+} _mouse_joy_state;
+
+
+class rmnimbus_state : public driver_device
+{
+public:
+ rmnimbus_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT32 m_debug_machine;
+ i186_state m_i186;
+ keyboard_t m_keyboard;
+ nimbus_drives_t m_nimbus_drives;
+ ipc_interface_t m_ipc_interface;
+ UINT8 m_mcu_reg080;
+ UINT8 m_iou_reg092;
+ UINT8 m_last_playmode;
+ _mouse_joy_state m_nimbus_mouse;
+ UINT8 m_ay8910_a;
+ UINT16 m_IOPorts[num_ioports];
+ UINT8 m_sio_int_state;
+ UINT8 m_video_mem[SCREEN_WIDTH_PIXELS][SCREEN_HEIGHT_LINES];
+ UINT16 m_vidregs[NO_VIDREGS];
+ UINT8 m_bpp;
+ UINT16 m_pixel_mask;
+ UINT8 m_hs_count;
+ UINT32 m_debug_video;
+ DECLARE_READ16_MEMBER(nimbus_i186_internal_port_r);
+ DECLARE_WRITE16_MEMBER(nimbus_i186_internal_port_w);
+ DECLARE_READ8_MEMBER(nimbus_mcu_r);
+ DECLARE_WRITE8_MEMBER(nimbus_mcu_w);
+ DECLARE_READ16_MEMBER(nimbus_io_r);
+ DECLARE_WRITE16_MEMBER(nimbus_io_w);
+ DECLARE_READ8_MEMBER(nimbus_disk_r);
+ DECLARE_WRITE8_MEMBER(nimbus_disk_w);
+ DECLARE_READ8_MEMBER(nimbus_pc8031_r);
+ DECLARE_WRITE8_MEMBER(nimbus_pc8031_w);
+ DECLARE_READ8_MEMBER(nimbus_pc8031_iou_r);
+ DECLARE_WRITE8_MEMBER(nimbus_pc8031_iou_w);
+ DECLARE_READ8_MEMBER(nimbus_pc8031_port_r);
+ DECLARE_WRITE8_MEMBER(nimbus_pc8031_port_w);
+ DECLARE_READ8_MEMBER(nimbus_iou_r);
+ DECLARE_WRITE8_MEMBER(nimbus_iou_w);
+ DECLARE_READ8_MEMBER(nimbus_sound_ay8910_r);
+ DECLARE_WRITE8_MEMBER(nimbus_sound_ay8910_w);
+ DECLARE_WRITE8_MEMBER(nimbus_sound_ay8910_porta_w);
+ DECLARE_WRITE8_MEMBER(nimbus_sound_ay8910_portb_w);
+ DECLARE_READ8_MEMBER(nimbus_mouse_js_r);
+ DECLARE_WRITE8_MEMBER(nimbus_mouse_js_w);
+ DECLARE_READ16_MEMBER(nimbus_video_io_r);
+ DECLARE_WRITE16_MEMBER(nimbus_video_io_w);
+ DECLARE_DRIVER_INIT(nimbus);
+};
+
+
+/*----------- defined in drivers/rmnimbus.c -----------*/
+
+extern const unsigned char nimbus_palette[SCREEN_NO_COLOURS][3];
+
+
+/*----------- defined in machine/rmnimbus.c -----------*/
+
+MACHINE_RESET(nimbus);
+MACHINE_START(nimbus);
+
+/* 80186 Internal */
+
+/* external int priority masks */
+
+#define EXTINT_CTRL_PRI_MASK 0x07
+#define EXTINT_CTRL_MSK 0x08
+#define EXTINT_CTRL_LTM 0x10
+#define EXTINT_CTRL_CASCADE 0x20
+#define EXTINT_CTRL_SFNM 0x40
+
+/* DMA control register */
+
+#define DEST_MIO 0x8000
+#define DEST_DECREMENT 0x4000
+#define DEST_INCREMENT 0x2000
+#define DEST_NO_CHANGE (DEST_DECREMENT | DEST_INCREMENT)
+#define DEST_INCDEC_MASK (DEST_DECREMENT | DEST_INCREMENT)
+#define SRC_MIO 0X1000
+#define SRC_DECREMENT 0x0800
+#define SRC_INCREMENT 0x0400
+#define SRC_NO_CHANGE (SRC_DECREMENT | SRC_INCREMENT)
+#define SRC_INCDEC_MASK (SRC_DECREMENT | SRC_INCREMENT)
+#define TERMINATE_ON_ZERO 0x0200
+#define INTERRUPT_ON_ZERO 0x0100
+#define SYNC_MASK 0x00C0
+#define SYNC_SOURCE 0x0040
+#define SYNC_DEST 0x0080
+#define CHANNEL_PRIORITY 0x0020
+#define TIMER_DRQ 0x0010
+#define CHG_NOCHG 0x0004
+#define ST_STOP 0x0002
+#define BYTE_WORD 0x0001
+
+/* Nimbus specific */
+
+/* External int vectors for chained interupts */
+#define EXTERNAL_INT_DISK 0x80
+#define EXTERNAL_INT_MSM5205 0x84
+#define EXTERNAL_INT_MOUSE_YU 0x88
+#define EXTERNAL_INT_MOUSE_YD 0x89
+#define EXTERNAL_INT_MOUSE_XL 0x8A
+#define EXTERNAL_INT_MOUSE_XR 0x8B
+#define EXTERNAL_INT_PC8031_8C 0x8c
+#define EXTERNAL_INT_PC8031_8E 0x8E
+#define EXTERNAL_INT_PC8031_8F 0x8F
+#define EXTERNAL_INT_Z80SIO 0x9C
+
+
+/* Memory controler */
+#define RAM_BANK00_TAG "bank0"
+#define RAM_BANK01_TAG "bank1"
+#define RAM_BANK02_TAG "bank2"
+#define RAM_BANK03_TAG "bank3"
+#define RAM_BANK04_TAG "bank4"
+#define RAM_BANK05_TAG "bank5"
+#define RAM_BANK06_TAG "bank6"
+#define RAM_BANK07_TAG "bank7"
+
+#define HIBLOCK_BASE_MASK 0x08
+#define HIBLOCK_SELECT_MASK 0x10
+
+
+
+/* Z80 SIO for keyboard */
+
+#define Z80SIO_TAG "z80sio"
+
+extern const z80sio_interface nimbus_sio_intf;
+
+/* Floppy/Fixed drive interface */
+
+#define FDC_TAG "wd2793"
+#define FDC_PAUSE 10000
+
+extern const wd17xx_interface nimbus_wd17xx_interface;
+
+
+#define NO_DRIVE_SELECTED 0xFF
+
+/* SASI harddisk interface */
+#define HARDDISK0_TAG "harddisk0"
+#define HARDDISK1_TAG "harddisk1"
+#define HARDDISK2_TAG "harddisk2"
+#define HARDDISK3_TAG "harddisk3"
+
+#define SCSIBUS_TAG "scsibus"
+
+void nimbus_scsi_linechange(device_t *device, UINT8 line, UINT8 state);
+
+/* Masks for writes to port 0x400 */
+#define FDC_DRIVE0_MASK 0x01
+#define FDC_DRIVE1_MASK 0x02
+#define FDC_DRIVE2_MASK 0x04
+#define FDC_DRIVE3_MASK 0x08
+#define FDC_SIDE_MASK 0x10
+#define FDC_MOTOR_MASKO 0x20
+#define HDC_DRQ_MASK 0x40
+#define FDC_DRQ_MASK 0x80
+#define FDC_DRIVE_MASK (FDC_DRIVE0_MASK | FDC_DRIVE1_MASK | FDC_DRIVE2_MASK | FDC_DRIVE3_MASK)
+
+#define FDC_SIDE() ((state->m_nimbus_drives.reg400 & FDC_SIDE_MASK) >> 4)
+#define FDC_MOTOR() ((state->m_nimbus_drives.reg400 & FDC_MOTOR_MASKO) >> 5)
+#define FDC_DRIVE() (scsibus_driveno(state->m_nimbus_drives.reg400 & FDC_DRIVE_MASK))
+#define HDC_DRQ_ENABLED() ((state->m_nimbus_drives.reg400 & HDC_DRQ_MASK) ? 1 : 0)
+#define FDC_DRQ_ENABLED(state) ((state->m_nimbus_drives.reg400 & FDC_DRQ_MASK) ? 1 : 0)
+
+/* Masks for port 0x410 read*/
+
+#define FDC_READY_MASK 0x01
+#define FDC_INDEX_MASK 0x02
+#define FDC_MOTOR_MASKI 0x04
+#define HDC_MSG_MASK 0x08
+#define HDC_BSY_MASK 0x10
+#define HDC_IO_MASK 0X20
+#define HDC_CD_MASK 0x40
+#define HDC_REQ_MASK 0x80
+
+#define FDC_BITS_410 (FDC_READY_MASK | FDC_INDEX_MASK | FDC_MOTOR_MASKI)
+#define HDC_BITS_410 (HDC_MSG_MASK | HDC_BSY_MASK | HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
+#define INV_BITS_410 (HDC_BSY_MASK | HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
+
+#define HDC_INT_TRIGGER (HDC_IO_MASK | HDC_CD_MASK | HDC_REQ_MASK)
+
+/* Masks for port 0x410 write*/
+
+#define HDC_RESET_MASK 0x01
+#define HDC_SEL_MASK 0x02
+#define HDC_IRQ_MASK 0x04
+#define HDC_IRQ_ENABLED(state) ((state->m_nimbus_drives.reg410_out & HDC_IRQ_MASK) ? 1 : 0)
+
+
+#define SCSI_ID_NONE 0x80
+
+
+/* 8031/8051 Peripheral controler */
+
+#define IPC_OUT_ADDR 0X01
+#define IPC_OUT_READ_PEND 0X02
+#define IPC_OUT_BYTE_AVAIL 0X04
+
+#define IPC_IN_ADDR 0X01
+#define IPC_IN_BYTE_AVAIL 0X02
+#define IPC_IN_READ_PEND 0X04
+
+
+
+
+#define ER59256_TAG "er59256"
+
+/* IO unit */
+
+#define DISK_INT_ENABLE 0x01
+#define MSM5205_INT_ENABLE 0x04
+#define MOUSE_INT_ENABLE 0x08
+#define PC8031_INT_ENABLE 0x10
+
+
+/* Sound hardware */
+
+#define AY8910_TAG "ay8910"
+#define MONO_TAG "mono"
+
+
+
+
+#define MSM5205_TAG "msm5205"
+
+void nimbus_msm5205_vck(device_t *device);
+
+/* Mouse / Joystick */
+
+#define JOYSTICK0_TAG "joystick0"
+#define MOUSE_BUTTON_TAG "mousebtn"
+#define MOUSEX_TAG "mousex"
+#define MOUSEY_TAG "mousey"
+
+enum
+{
+ MOUSE_PHASE_STATIC = 0,
+ MOUSE_PHASE_POSITIVE,
+ MOUSE_PHASE_NEGATIVE
+};
+
+
+#define MOUSE_INT_ENABLED(state) (((state)->m_iou_reg092 & MOUSE_INT_ENABLE) ? 1 : 0)
+
+/* Paralell / User port BBC compatible ! */
+
+#define VIA_TAG "via6522"
+#define CENTRONICS_TAG "centronics"
+
+#define VIA_INT 0x03
+
+extern const via6522_interface nimbus_via;
+
+WRITE_LINE_DEVICE_HANDLER(nimbus_ack_w);
+
+
+/*----------- defined in video/rmnimbus.c -----------*/
+
+
+VIDEO_START( nimbus );
+SCREEN_VBLANK( nimbus );
+SCREEN_UPDATE_IND16( nimbus );
+VIDEO_RESET( nimbus );
+
+#define RED 0
+#define GREEN 1
+#define BLUE 2
+
+#define LINEAR_ADDR(seg,ofs) ((seg<<4)+ofs)
+
+#define OUTPUT_SEGOFS(mess,seg,ofs) logerror("%s=%04X:%04X [%08X]\n",mess,seg,ofs,((seg<<4)+ofs))
diff --git a/src/mess/includes/sage2.h b/src/mess/includes/sage2.h
new file mode 100644
index 00000000000..c364dfbbb73
--- /dev/null
+++ b/src/mess/includes/sage2.h
@@ -0,0 +1,88 @@
+
+#include "emu.h"
+#include "cpu/m68000/m68000.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ctronics.h"
+#include "machine/i8251.h"
+#include "machine/i8255.h"
+#include "machine/ieee488.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/ram.h"
+#include "machine/terminal.h"
+#include "machine/upd765.h"
+
+#define M68000_TAG "u68"
+#define I8255A_0_TAG "u22"
+#define I8255A_1_TAG "u39"
+#define I8253_0_TAG "u74"
+#define I8253_1_TAG "u75"
+#define I8259_TAG "u73"
+#define I8251_0_TAG "u58"
+#define I8251_1_TAG "u67"
+#define UPD765_TAG "u21"
+#define TMS9914_TAG "u6"
+#define CENTRONICS_TAG "centronics"
+
+class sage2_state : public driver_device
+{
+public:
+ sage2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M68000_TAG),
+ m_pic(*this, I8259_TAG),
+ m_usart0(*this, I8251_0_TAG),
+ m_usart1(*this, I8251_1_TAG),
+ m_fdc(*this, UPD765_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ieee488(*this, IEEE488_TAG),
+ m_terminal(*this, TERMINAL_TAG),
+ m_reset(1),
+ m_fdc_int(0),
+ m_fdie(0),
+ m_sl0(1),
+ m_sl1(1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_pic;
+ required_device<i8251_device> m_usart0;
+ required_device<i8251_device> m_usart1;
+ required_device<device_t> m_fdc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<centronics_device> m_centronics;
+ required_device<ieee488_device> m_ieee488;
+ required_device<generic_terminal_device> m_terminal;
+
+ virtual void machine_reset();
+
+ void update_fdc_int();
+
+ DECLARE_READ8_MEMBER( mmu_r );
+ DECLARE_WRITE8_MEMBER( mmu_w );
+ DECLARE_WRITE_LINE_MEMBER( br1_w );
+ DECLARE_WRITE_LINE_MEMBER( br2_w );
+ DECLARE_WRITE8_MEMBER( ppi0_pc_w );
+ DECLARE_READ8_MEMBER( ppi1_pb_r );
+ DECLARE_WRITE8_MEMBER( ppi1_pc_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_int_w );
+ DECLARE_WRITE_LINE_MEMBER( ack_w );
+
+ DECLARE_WRITE8_MEMBER(kbd_put);
+
+ DECLARE_DIRECT_UPDATE_MEMBER(sage2_direct_update_handler);
+
+ int m_reset;
+
+ // floppy state
+ int m_fdc_int;
+ int m_fdie;
+ int m_sl0;
+ int m_sl1;
+ DECLARE_DRIVER_INIT(sage2);
+};
diff --git a/src/mess/includes/samcoupe.h b/src/mess/includes/samcoupe.h
new file mode 100644
index 00000000000..03f72270d45
--- /dev/null
+++ b/src/mess/includes/samcoupe.h
@@ -0,0 +1,104 @@
+/*****************************************************************************
+ *
+ * includes/coupe.h
+ *
+ * SAM Coupe
+ *
+ * Driver by Lee Hammerton
+ *
+ ****************************************************************************/
+
+#ifndef SAMCOUPE_H_
+#define SAMCOUPE_H_
+
+/* screen dimensions */
+#define SAM_BLOCK 8
+
+#define SAM_TOTAL_WIDTH SAM_BLOCK*96
+#define SAM_TOTAL_HEIGHT 312
+#define SAM_SCREEN_WIDTH SAM_BLOCK*64
+#define SAM_SCREEN_HEIGHT 192
+#define SAM_BORDER_LEFT SAM_BLOCK*4
+#define SAM_BORDER_RIGHT SAM_BLOCK*4
+#define SAM_BORDER_TOP 37
+#define SAM_BORDER_BOTTOM 46
+
+/* interrupt sources */
+#define SAM_LINE_INT 0x01
+#define SAM_MOUSE_INT 0x02
+#define SAM_MIDIIN_INT 0x04
+#define SAM_FRAME_INT 0x08
+#define SAM_MIDIOUT_INT 0x10
+
+
+class samcoupe_state : public driver_device
+{
+public:
+ samcoupe_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ bitmap_ind16 m_bitmap;
+
+ emu_timer *m_video_update_timer;
+
+ UINT8 m_lmpr, m_hmpr, m_vmpr; /* memory pages */
+ UINT8 m_lext, m_hext; /* extended memory page */
+ UINT8 m_border; /* border */
+ UINT8 m_clut[16]; /* color lookup table, 16 entries */
+ UINT8 m_line_int; /* line interrupt */
+ UINT8 m_status; /* status register */
+
+ /* attribute */
+ UINT8 m_attribute;
+
+ /* mouse */
+ int m_mouse_index;
+ emu_timer *m_mouse_reset;
+ UINT8 m_mouse_data[9];
+ int m_mouse_x, m_mouse_y;
+ UINT8 *m_videoram;
+ DECLARE_WRITE8_MEMBER(samcoupe_ext_mem_w);
+ DECLARE_READ8_MEMBER(samcoupe_disk_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_disk_w);
+ DECLARE_READ8_MEMBER(samcoupe_pen_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_clut_w);
+ DECLARE_READ8_MEMBER(samcoupe_status_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_line_int_w);
+ DECLARE_READ8_MEMBER(samcoupe_lmpr_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_lmpr_w);
+ DECLARE_READ8_MEMBER(samcoupe_hmpr_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_hmpr_w);
+ DECLARE_READ8_MEMBER(samcoupe_vmpr_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_vmpr_w);
+ DECLARE_READ8_MEMBER(samcoupe_midi_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_midi_w);
+ DECLARE_READ8_MEMBER(samcoupe_keyboard_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_border_w);
+ DECLARE_READ8_MEMBER(samcoupe_attributes_r);
+};
+
+
+/*----------- defined in drivers/samcoupe.c -----------*/
+
+void samcoupe_irq(device_t *device, UINT8 src);
+
+
+/*----------- defined in machine/samcoupe.c -----------*/
+
+void samcoupe_update_memory(address_space *space);
+UINT8 samcoupe_mouse_r(running_machine &machine);
+
+MACHINE_START( samcoupe );
+MACHINE_RESET( samcoupe );
+
+
+/*----------- defined in video/samcoupe.c -----------*/
+
+TIMER_CALLBACK( sam_video_update_callback );
+
+
+#endif /* SAMCOUPE_H_ */
diff --git a/src/mess/includes/sapi1.h b/src/mess/includes/sapi1.h
new file mode 100644
index 00000000000..697a45a8e14
--- /dev/null
+++ b/src/mess/includes/sapi1.h
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ *
+ * includes/sapi1.h
+ *
+ ****************************************************************************/
+
+#ifndef SAPI_1_H_
+#define SAPI_1_H_
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "cpu/z80/z80.h"
+#include "machine/ram.h"
+#include "machine/keyboard.h"
+#include "machine/terminal.h"
+
+
+class sapi1_state : public driver_device
+{
+public:
+ sapi1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_sapi_video_ram(*this, "sapi_video_ram"){ }
+
+ required_shared_ptr<UINT8> m_sapi_video_ram;
+ UINT8 m_keyboard_mask;
+ UINT8 m_refresh_counter;
+ UINT8 m_zps3_25;
+ DECLARE_READ8_MEMBER(sapi1_keyboard_r);
+ DECLARE_WRITE8_MEMBER(sapi1_keyboard_w);
+ DECLARE_READ8_MEMBER(sapi2_keyboard_status_r);
+ DECLARE_READ8_MEMBER(sapi2_keyboard_data_r);
+ DECLARE_WRITE8_MEMBER(sapi3_00_w);
+ DECLARE_READ8_MEMBER(sapi3_25_r);
+ DECLARE_WRITE8_MEMBER(sapi3_25_w);
+ DECLARE_WRITE8_MEMBER(kbd_put);
+ UINT8 m_term_data;
+ DECLARE_DRIVER_INIT(sapi1);
+ DECLARE_DRIVER_INIT(sapizps3);
+};
+
+
+/*----------- defined in machine/sapi1.c -----------*/
+
+extern MACHINE_START( sapi1 );
+extern MACHINE_RESET( sapi1 );
+extern MACHINE_RESET( sapizps3 );
+
+
+/*----------- defined in video/sapi1.c -----------*/
+
+extern VIDEO_START( sapi1 );
+extern SCREEN_UPDATE_IND16( sapi1 );
+extern VIDEO_START( sapizps3 );
+extern SCREEN_UPDATE_IND16( sapizps3 );
+
+#endif
diff --git a/src/mess/includes/sg1000.h b/src/mess/includes/sg1000.h
new file mode 100644
index 00000000000..4b425a458ec
--- /dev/null
+++ b/src/mess/includes/sg1000.h
@@ -0,0 +1,122 @@
+#ifndef __SG1000__
+#define __SG1000__
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "machine/ram.h"
+#include "imagedev/printer.h"
+#include "formats/basicdsk.h"
+#include "formats/sc3000_bit.h"
+#include "machine/ctronics.h"
+#include "machine/i8255.h"
+#include "machine/i8251.h"
+#include "machine/upd765.h"
+#include "video/tms9928a.h"
+#include "sound/sn76496.h"
+#include "crsshair.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define SN76489AN_TAG "sn76489an"
+#define UPD765_TAG "upd765"
+#define UPD8251_TAG "upd8251"
+#define UPD9255_TAG "upd9255"
+#define UPD9255_0_TAG "upd9255_0"
+#define UPD9255_1_TAG "upd9255_1"
+#define CENTRONICS_TAG "centronics"
+#define TMS9918A_TAG "tms9918a"
+
+#define IS_CARTRIDGE_TV_DRAW(ptr) \
+ (!strncmp("annakmn", (const char *)&ptr[0x13b3], 7))
+
+#define IS_CARTRIDGE_THE_CASTLE(ptr) \
+ (!strncmp("ASCII 1986", (const char *)&ptr[0x1cc3], 10))
+
+#define IS_CARTRIDGE_BASIC_LEVEL_III(ptr) \
+ (!strncmp("SC-3000 BASIC Level 3 ver 1.0", (const char *)&ptr[0x6a20], 29))
+
+#define IS_CARTRIDGE_MUSIC_EDITOR(ptr) \
+ (!strncmp("PIANO", (const char *)&ptr[0x0841], 5))
+
+INPUT_PORTS_EXTERN( sk1100 );
+extern const i8255_interface ( sc3000_ppi_intf );
+extern const cassette_interface sc3000_cassette_interface;
+
+class sg1000_state : public driver_device
+{
+public:
+ sg1000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ void install_cartridge(UINT8 *ptr, int size);
+
+ DECLARE_WRITE8_MEMBER( tvdraw_axis_w );
+ DECLARE_READ8_MEMBER( tvdraw_status_r );
+ DECLARE_READ8_MEMBER( tvdraw_data_r );
+ DECLARE_READ8_MEMBER( joysel_r );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_nmi );
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+
+ /* TV Draw state */
+ UINT8 m_tvdraw_data;
+};
+
+class sc3000_state : public sg1000_state
+{
+public:
+ sc3000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : sg1000_state(mconfig, type, tag),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+
+ void install_cartridge(UINT8 *ptr, int size);
+
+ DECLARE_READ8_MEMBER( ppi_pa_r );
+ DECLARE_READ8_MEMBER( ppi_pb_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+};
+
+class sf7000_state : public sc3000_state
+{
+public:
+ sf7000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : sc3000_state(mconfig, type, tag),
+ m_fdc(*this, UPD765_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_floppy0(*this, FLOPPY_0)
+ { }
+
+ required_device<device_t> m_fdc;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_floppy0;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( ppi_pa_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
+
+ /* floppy state */
+ int m_fdc_irq;
+ int m_fdc_index;
+};
+
+#endif
diff --git a/src/mess/includes/sms.h b/src/mess/includes/sms.h
new file mode 100644
index 00000000000..f9d2a6f2420
--- /dev/null
+++ b/src/mess/includes/sms.h
@@ -0,0 +1,215 @@
+/*****************************************************************************
+ *
+ * includes/sms.h
+ *
+ ****************************************************************************/
+
+#ifndef SMS_H_
+#define SMS_H_
+
+#define LOG_REG
+#define LOG_PAGING
+#define LOG_COLOR
+
+#define NVRAM_SIZE (0x08000)
+#define CPU_ADDRESSABLE_SIZE (0x10000)
+
+#define MAX_CARTRIDGES 16
+
+class sms_state : public driver_device
+{
+public:
+ void map_cart_16k( UINT16 address, UINT16 bank );
+ void map_cart_8k( UINT16 address, UINT16 bank );
+ void map_bios_16k( UINT16 address, UINT16 bank );
+ void map_bios_8k( UINT16 address, UINT16 bank );
+
+public:
+ sms_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ // device_ts
+ device_t *m_main_cpu;
+ device_t *m_control_cpu;
+ sega315_5124_device *m_vdp;
+ eeprom_device *m_eeprom;
+ device_t *m_ym;
+ device_t *m_main_scr;
+ device_t *m_left_lcd;
+ device_t *m_right_lcd;
+ address_space *m_space;
+
+ UINT8 m_bios_page_count;
+ UINT8 m_fm_detect;
+ UINT8 m_ctrl_reg;
+ int m_paused;
+ UINT8 m_bios_port;
+ UINT8 *m_BIOS;
+ UINT8 *m_mapper_ram;
+ UINT8 m_mapper[4];
+ // we are going to use 1-6, same as bank numbers. Notice, though, that most mappers
+ // only work on 16K banks and, hence, banks 4-6 are not always directly set
+ // (they often use bank3 + 0x2000 and bank5 + 0x2000)
+ UINT8 *m_banking_bios[8];
+ UINT8 *m_banking_cart[8];
+ UINT8 *m_banking_none;
+ UINT8 m_gg_sio[5];
+ UINT8 m_store_control;
+ UINT8 m_input_port0;
+ UINT8 m_input_port1;
+
+ // for gamegear LCD persistence hack
+ bitmap_rgb32 m_prev_bitmap;
+
+ // for 3D glass binocular hack
+ bitmap_rgb32 m_prevleft_bitmap;
+ bitmap_rgb32 m_prevright_bitmap;
+
+ /* Model identifiers */
+ UINT8 m_is_gamegear;
+ UINT8 m_is_region_japan;
+ UINT8 m_has_bios_0400;
+ UINT8 m_has_bios_2000;
+ UINT8 m_has_bios_full;
+ UINT8 m_has_bios;
+ UINT8 m_has_fm;
+
+ /* Data needed for Rapid Fire Unit support */
+ emu_timer *m_rapid_fire_timer;
+ UINT8 m_rapid_fire_state_1;
+ UINT8 m_rapid_fire_state_2;
+
+ /* Data needed for Paddle Control controller */
+ UINT32 m_last_paddle_read_time;
+ UINT8 m_paddle_read_state;
+
+ /* Data needed for Sports Pad controller */
+ UINT32 m_last_sports_pad_time_1;
+ UINT32 m_last_sports_pad_time_2;
+ UINT8 m_sports_pad_state_1;
+ UINT8 m_sports_pad_state_2;
+ UINT8 m_sports_pad_last_data_1;
+ UINT8 m_sports_pad_last_data_2;
+ UINT8 m_sports_pad_1_x;
+ UINT8 m_sports_pad_1_y;
+ UINT8 m_sports_pad_2_x;
+ UINT8 m_sports_pad_2_y;
+
+ /* Data needed for Light Phaser */
+ emu_timer *m_lphaser_1_timer;
+ emu_timer *m_lphaser_2_timer;
+ UINT8 m_lphaser_1_latch;
+ UINT8 m_lphaser_2_latch;
+ int m_lphaser_x_offs; /* Needed to 'calibrate' lphaser; set at cart loading */
+
+ /* Data needed for SegaScope (3D glasses) */
+ UINT8 m_sscope_state;
+
+ /* Cartridge slot info */
+ UINT8 m_current_cartridge;
+ struct
+ {
+ UINT8 *ROM; /* Pointer to ROM image data */
+ UINT32 size; /* Size of the ROM image */
+ UINT32 features; /* on-cartridge special hardware */
+ UINT8 *cartSRAM; /* on-cartridge SRAM */
+ UINT8 sram_save; /* should be the contents of the on-cartridge SRAM be saved */
+ UINT8 *cartRAM; /* additional on-cartridge RAM (64KB for Ernie Els Golf) */
+ UINT32 ram_size; /* size of the on-cartridge RAM */
+ UINT8 ram_page; /* currently swapped in cartridge RAM */
+
+ /* Data needed for Terebi Oekaki (TV Draw) */
+ UINT8 m_tvdraw_data;
+
+ /* Data needed for 4pak mapper */
+ UINT8 m_4pak_page0;
+ UINT8 m_4pak_page1;
+ UINT8 m_4pak_page2;
+
+ /* Data needed for 93c46 */
+ bool m_93c46_enabled;
+ UINT8 m_93c46_lines;
+ } m_cartridge[MAX_CARTRIDGES];
+ DECLARE_WRITE8_MEMBER(sms_input_write);
+ DECLARE_WRITE8_MEMBER(sms_fm_detect_w);
+ DECLARE_READ8_MEMBER(sms_fm_detect_r);
+ DECLARE_WRITE8_MEMBER(sms_io_control_w);
+ DECLARE_READ8_MEMBER(sms_count_r);
+ DECLARE_READ8_MEMBER(sms_input_port_0_r);
+ DECLARE_READ8_MEMBER(sms_input_port_1_r);
+ DECLARE_WRITE8_MEMBER(sms_ym2413_register_port_0_w);
+ DECLARE_WRITE8_MEMBER(sms_ym2413_data_port_0_w);
+ DECLARE_READ8_MEMBER(gg_input_port_2_r);
+ DECLARE_READ8_MEMBER(sms_sscope_r);
+ DECLARE_WRITE8_MEMBER(sms_sscope_w);
+ DECLARE_READ8_MEMBER(sms_mapper_r);
+ DECLARE_WRITE8_MEMBER(sms_tvdraw_axis_w);
+ DECLARE_READ8_MEMBER(sms_tvdraw_status_r);
+ DECLARE_READ8_MEMBER(sms_tvdraw_data_r);
+ DECLARE_WRITE8_MEMBER(sms_93c46_w);
+ DECLARE_READ8_MEMBER(sms_93c46_r);
+ DECLARE_WRITE8_MEMBER(sms_mapper_w);
+ DECLARE_WRITE8_MEMBER(sms_korean_zemina_banksw_w);
+ DECLARE_WRITE8_MEMBER(sms_codemasters_page0_w);
+ DECLARE_WRITE8_MEMBER(sms_codemasters_page1_w);
+ DECLARE_WRITE8_MEMBER(sms_4pak_page0_w);
+ DECLARE_WRITE8_MEMBER(sms_4pak_page1_w);
+ DECLARE_WRITE8_MEMBER(sms_4pak_page2_w);
+ DECLARE_WRITE8_MEMBER(sms_janggun_bank0_w);
+ DECLARE_WRITE8_MEMBER(sms_janggun_bank1_w);
+ DECLARE_WRITE8_MEMBER(sms_janggun_bank2_w);
+ DECLARE_WRITE8_MEMBER(sms_janggun_bank3_w);
+ DECLARE_WRITE8_MEMBER(sms_bios_w);
+ DECLARE_WRITE8_MEMBER(sms_cartram2_w);
+ DECLARE_WRITE8_MEMBER(sms_cartram_w);
+ DECLARE_WRITE8_MEMBER(gg_sio_w);
+ DECLARE_READ8_MEMBER(gg_sio_r);
+ DECLARE_READ8_MEMBER(sms_store_cart_select_r);
+ DECLARE_WRITE8_MEMBER(sms_store_cart_select_w);
+ DECLARE_READ8_MEMBER(sms_store_select1);
+ DECLARE_READ8_MEMBER(sms_store_select2);
+ DECLARE_READ8_MEMBER(sms_store_control_r);
+ DECLARE_WRITE8_MEMBER(sms_store_control_w);
+ DECLARE_DRIVER_INIT(sg1000m3);
+ DECLARE_DRIVER_INIT(gamegear);
+ DECLARE_DRIVER_INIT(gamegeaj);
+ DECLARE_DRIVER_INIT(sms2kr);
+ DECLARE_DRIVER_INIT(smsj);
+ DECLARE_DRIVER_INIT(sms1);
+ DECLARE_DRIVER_INIT(smssdisp);
+};
+
+
+/*----------- defined in machine/sms.c -----------*/
+
+/* Function prototypes */
+
+INPUT_CHANGED( lgun1_changed );
+INPUT_CHANGED( lgun2_changed );
+
+WRITE_LINE_DEVICE_HANDLER( sms_pause_callback );
+WRITE_LINE_DEVICE_HANDLER( sms_store_int_callback );
+
+DEVICE_START( sms_cart );
+DEVICE_IMAGE_LOAD( sms_cart );
+
+MACHINE_START( sms );
+MACHINE_RESET( sms );
+
+
+#define IO_EXPANSION (0x80) /* Expansion slot enable (1= disabled, 0= enabled) */
+#define IO_CARTRIDGE (0x40) /* Cartridge slot enable (1= disabled, 0= enabled) */
+#define IO_CARD (0x20) /* Card slot disabled (1= disabled, 0= enabled) */
+#define IO_WORK_RAM (0x10) /* Work RAM disabled (1= disabled, 0= enabled) */
+#define IO_BIOS_ROM (0x08) /* BIOS ROM disabled (1= disabled, 0= enabled) */
+#define IO_CHIP (0x04) /* I/O chip disabled (1= disabled, 0= enabled) */
+
+
+
+VIDEO_START( sms1 );
+VIDEO_START( gamegear );
+SCREEN_UPDATE_RGB32( sms1 );
+SCREEN_UPDATE_RGB32( sms );
+SCREEN_UPDATE_RGB32( gamegear );
+
+#endif /* SMS_H_ */
diff --git a/src/mess/includes/sorcerer.h b/src/mess/includes/sorcerer.h
new file mode 100644
index 00000000000..3fc2a631364
--- /dev/null
+++ b/src/mess/includes/sorcerer.h
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ *
+ * includes/sorcerer.h
+ *
+ ****************************************************************************/
+
+#ifndef SORCERER_H_
+#define SORCERER_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/dac.h"
+#include "sound/wave.h"
+#include "machine/ay31015.h"
+#include "machine/ctronics.h"
+#include "machine/ram.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+#include "imagedev/flopdrv.h"
+#include "formats/sorc_dsk.h"
+#include "machine/micropolis.h"
+
+#define SORCERER_USING_RS232 0
+#define SCREEN_UPDATE_MEMBER(name) UINT32 name::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+#define VIDEO_START_MEMBER(name) void name::video_start()
+
+typedef struct {
+ struct {
+ int length; /* time cassette level is at input.level */
+ int level; /* cassette level */
+ int bit; /* bit being read */
+ } input;
+ struct {
+ int length; /* time cassette level is at output.level */
+ int level; /* cassette level */
+ int bit; /* bit to to output */
+ } output;
+} cass_data_t;
+
+
+class sorcerer_state : public driver_device
+{
+public:
+ sorcerer_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_cass1(*this, CASSETTE_TAG),
+ m_cass2(*this, CASSETTE2_TAG),
+ m_wave1(*this, WAVE_TAG),
+ m_wave2(*this, WAVE2_TAG),
+ m_dac(*this, "dac"),
+ m_uart(*this, "uart"),
+ m_centronics(*this, "centronics"),
+ m_ram(*this, RAM_TAG),
+ m_iop_config(*this, "CONFIG"),
+ m_iop_vs(*this, "VS")
+ { }
+
+ DECLARE_READ8_MEMBER(sorcerer_fc_r);
+ DECLARE_READ8_MEMBER(sorcerer_fd_r);
+ DECLARE_READ8_MEMBER(sorcerer_fe_r);
+ DECLARE_READ8_MEMBER(sorcerer_ff_r);
+ DECLARE_WRITE8_MEMBER(sorcerer_fc_w);
+ DECLARE_WRITE8_MEMBER(sorcerer_fd_w);
+ DECLARE_WRITE8_MEMBER(sorcerer_fe_w);
+ DECLARE_WRITE8_MEMBER(sorcerer_ff_w);
+ UINT8 m_fe;
+ UINT8 m_keyboard_line;
+ const UINT8 *m_p_videoram;
+ emu_timer *m_serial_timer;
+ emu_timer *m_cassette_timer;
+ cass_data_t m_cass_data;
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cass1;
+ required_device<cassette_image_device> m_cass2;
+ required_device<device_t> m_wave1;
+ required_device<device_t> m_wave2;
+ required_device<dac_device> m_dac;
+ required_device<device_t> m_uart;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+ required_ioport m_iop_config;
+ required_ioport m_iop_vs;
+ DECLARE_DRIVER_INIT(sorcerer);
+};
+
+
+/*----------- defined in machine/sorcerer.c -----------*/
+
+
+MACHINE_START( sorcererd );
+MACHINE_START( sorcerer );
+MACHINE_RESET( sorcerer );
+SNAPSHOT_LOAD( sorcerer );
+
+#endif /* SORCERER_H_ */
diff --git a/src/mess/includes/special.h b/src/mess/includes/special.h
new file mode 100644
index 00000000000..d9853b72c15
--- /dev/null
+++ b/src/mess/includes/special.h
@@ -0,0 +1,122 @@
+/*****************************************************************************
+ *
+ * includes/special.h
+ *
+ ****************************************************************************/
+
+#ifndef SPECIAL_H_
+#define SPECIAL_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/i8085/i8085.h"
+#include "sound/dac.h"
+#include "sound/wave.h"
+#include "machine/i8255.h"
+#include "machine/pit8253.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+#include "formats/rk_cas.h"
+#include "formats/smx_dsk.h"
+#include "machine/wd17xx.h"
+#include "machine/ram.h"
+
+
+class special_state : public driver_device
+{
+public:
+ special_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ppi(*this, "ppi8255"),
+ m_fdc(*this, "wd1793"),
+ m_dac(*this, "dac"),
+ m_cass(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_p_videoram(*this, "p_videoram")
+ { }
+
+ DECLARE_WRITE8_MEMBER(specimx_select_bank);
+ DECLARE_WRITE8_MEMBER(video_memory_w);
+ DECLARE_WRITE8_MEMBER(specimx_video_color_w);
+ DECLARE_READ8_MEMBER(specimx_video_color_r);
+ DECLARE_READ8_MEMBER(specimx_disk_ctrl_r);
+ DECLARE_WRITE8_MEMBER(specimx_disk_ctrl_w);
+ DECLARE_READ8_MEMBER(erik_rr_reg_r);
+ DECLARE_WRITE8_MEMBER(erik_rr_reg_w);
+ DECLARE_READ8_MEMBER(erik_rc_reg_r);
+ DECLARE_WRITE8_MEMBER(erik_rc_reg_w);
+ DECLARE_READ8_MEMBER(erik_disk_reg_r);
+ DECLARE_WRITE8_MEMBER(erik_disk_reg_w);
+ DECLARE_READ8_MEMBER(specialist_8255_porta_r);
+ DECLARE_READ8_MEMBER(specialist_8255_portb_r);
+ DECLARE_READ8_MEMBER(specialist_8255_portc_r);
+ DECLARE_WRITE8_MEMBER(specialist_8255_porta_w);
+ DECLARE_WRITE8_MEMBER(specialist_8255_portb_w);
+ DECLARE_WRITE8_MEMBER(specialist_8255_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(specimx_pit8253_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(specimx_pit8253_out1_changed);
+ DECLARE_WRITE_LINE_MEMBER(specimx_pit8253_out2_changed);
+ void specimx_set_bank(offs_t i, UINT8 data);
+ void erik_set_bank();
+ UINT8 *m_specimx_colorram;
+ UINT8 m_erik_color_1;
+ UINT8 m_erik_color_2;
+ UINT8 m_erik_background;
+ UINT8 m_specimx_color;
+ device_t *m_specimx_audio;
+ int m_specialist_8255_porta;
+ int m_specialist_8255_portb;
+ int m_specialist_8255_portc;
+ UINT8 m_RR_register;
+ UINT8 m_RC_register;
+ required_device<cpu_device> m_maincpu;
+ optional_device<i8255_device> m_ppi;
+ optional_device<device_t> m_fdc;
+ optional_device<dac_device> m_dac;
+ optional_device<cassette_image_device> m_cass;
+ optional_device<ram_device> m_ram;
+ optional_shared_ptr<UINT8> m_p_videoram;
+ DECLARE_DRIVER_INIT(erik);
+ DECLARE_DRIVER_INIT(special);
+};
+
+
+/*----------- defined in machine/special.c -----------*/
+
+extern const struct pit8253_config specimx_pit8253_intf;
+extern const i8255_interface specialist_ppi8255_interface;
+
+MACHINE_RESET( special );
+
+MACHINE_RESET( specimx );
+MACHINE_START ( specimx );
+
+MACHINE_RESET( erik );
+
+/*----------- defined in video/special.c -----------*/
+
+VIDEO_START( special );
+SCREEN_UPDATE_IND16( special );
+
+VIDEO_START( specialp );
+SCREEN_UPDATE_IND16( specialp );
+
+VIDEO_START( specimx );
+SCREEN_UPDATE_IND16( specimx );
+
+VIDEO_START( erik );
+SCREEN_UPDATE_IND16( erik );
+PALETTE_INIT( erik );
+
+PALETTE_INIT( specimx );
+extern const rgb_t specimx_palette[16];
+
+/*----------- defined in audio/special.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(SPECIMX, specimx_sound);
+
+void specimx_set_input(device_t *device, int index, int state);
+
+#endif /* SPECIAL_H_ */
diff --git a/src/mess/includes/spectrum.h b/src/mess/includes/spectrum.h
new file mode 100644
index 00000000000..7882f63f66a
--- /dev/null
+++ b/src/mess/includes/spectrum.h
@@ -0,0 +1,171 @@
+/*****************************************************************************
+ *
+ * includes/spectrum.h
+ *
+ ****************************************************************************/
+
+#ifndef __SPECTRUM_H__
+#define __SPECTRUM_H__
+
+#include "imagedev/snapquik.h"
+#include "imagedev/cartslot.h"
+
+/* Spectrum crystals */
+
+#define X1 XTAL_14MHz // Main clock
+#define X2 XTAL_4_433619MHz // PAL color subcarrier
+
+/* Spectrum screen size in pixels */
+#define SPEC_UNSEEN_LINES 16 /* Non-visible scanlines before first border
+ line. Some of these may be vertical retrace. */
+#define SPEC_TOP_BORDER 48 /* Number of border lines before actual screen */
+#define SPEC_DISPLAY_YSIZE 192 /* Vertical screen resolution */
+#define SPEC_BOTTOM_BORDER 56 /* Number of border lines at bottom of screen */
+#define SPEC_SCREEN_HEIGHT (SPEC_TOP_BORDER + SPEC_DISPLAY_YSIZE + SPEC_BOTTOM_BORDER)
+
+#define SPEC_LEFT_BORDER 48 /* Number of left hand border pixels */
+#define SPEC_DISPLAY_XSIZE 256 /* Horizontal screen resolution */
+#define SPEC_RIGHT_BORDER 48 /* Number of right hand border pixels */
+#define SPEC_SCREEN_WIDTH (SPEC_LEFT_BORDER + SPEC_DISPLAY_XSIZE + SPEC_RIGHT_BORDER)
+
+#define SPEC_LEFT_BORDER_CYCLES 24 /* Cycles to display left hand border */
+#define SPEC_DISPLAY_XSIZE_CYCLES 128 /* Horizontal screen resolution */
+#define SPEC_RIGHT_BORDER_CYCLES 24 /* Cycles to display right hand border */
+#define SPEC_RETRACE_CYCLES 48 /* Cycles taken for horizonal retrace */
+#define SPEC_CYCLES_PER_LINE 224 /* Number of cycles to display a single line */
+
+/* 128K machines take an extra 4 cycles per scan line - add this to retrace */
+#define SPEC128_UNSEEN_LINES 15
+#define SPEC128_RETRACE_CYCLES 52
+#define SPEC128_CYCLES_PER_LINE 228
+
+/* Border sizes for TS2068. These are guesses based on the number of cycles
+ available per frame. */
+#define TS2068_TOP_BORDER 32
+#define TS2068_BOTTOM_BORDER 32
+#define TS2068_SCREEN_HEIGHT (TS2068_TOP_BORDER + SPEC_DISPLAY_YSIZE + TS2068_BOTTOM_BORDER)
+
+/* Double the border sizes to maintain ratio of screen to border */
+#define TS2068_LEFT_BORDER 96 /* Number of left hand border pixels */
+#define TS2068_DISPLAY_XSIZE 512 /* Horizontal screen resolution */
+#define TS2068_RIGHT_BORDER 96 /* Number of right hand border pixels */
+#define TS2068_SCREEN_WIDTH (TS2068_LEFT_BORDER + TS2068_DISPLAY_XSIZE + TS2068_RIGHT_BORDER)
+
+typedef struct
+{
+ /* driver defined ID for this write */
+ int Event_ID;
+ /* driver defined data for this write */
+ int Event_Data;
+ /* time at which this write occurred */
+ int Event_Time;
+} EVENT_LIST_ITEM;
+
+
+class spectrum_state : public driver_device
+{
+public:
+ spectrum_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_video_ram(*this, "video_ram"){ }
+
+ int m_port_fe_data;
+ int m_port_7ffd_data;
+ int m_port_1ffd_data; /* scorpion and plus3 */
+ int m_port_ff_data; /* Display enhancement control */
+ int m_port_f4_data; /* Horizontal Select Register */
+
+ int m_floppy;
+
+ /* video support */
+ int m_frame_invert_count;
+ int m_frame_number; /* Used for handling FLASH 1 */
+ int m_flash_invert;
+ UINT8 m_retrace_cycles;
+ optional_shared_ptr<UINT8> m_video_ram;
+ UINT8 *m_screen_location;
+
+ int m_ROMSelection;
+
+ /* Last border colour output in the previous frame */
+ int m_CurrBorderColor;
+ int m_LastDisplayedBorderColor; /* Negative value indicates redraw */
+
+ EVENT_LIST_ITEM *m_pCurrentItem;
+ int m_NumEvents;
+ int m_TotalEvents;
+ char *m_pEventListBuffer;
+ int m_LastFrameStartTime;
+ int m_CyclesPerFrame;
+
+ UINT8 *m_ram_0000;
+ UINT8 m_ram_disabled_by_beta;
+ DECLARE_WRITE8_MEMBER(spectrum_port_fe_w);
+ DECLARE_READ8_MEMBER(spectrum_port_fe_r);
+ DECLARE_READ8_MEMBER(spectrum_port_1f_r);
+ DECLARE_READ8_MEMBER(spectrum_port_7f_r);
+ DECLARE_READ8_MEMBER(spectrum_port_df_r);
+ DECLARE_READ8_MEMBER(spectrum_port_ula_r);
+ DECLARE_DIRECT_UPDATE_MEMBER(spectrum_direct);
+ DECLARE_DRIVER_INIT(spectrum);
+ DECLARE_DRIVER_INIT(plus2);
+ DECLARE_DRIVER_INIT(plus3);
+};
+
+
+/*----------- defined in drivers/spectrum.c -----------*/
+
+INPUT_PORTS_EXTERN( spectrum );
+INPUT_PORTS_EXTERN( spec_plus );
+
+MACHINE_CONFIG_EXTERN( spectrum );
+MACHINE_RESET( spectrum );
+
+
+/*----------- defined in drivers/spec128.c -----------*/
+
+MACHINE_CONFIG_EXTERN( spectrum_128 );
+
+void spectrum_128_update_memory(running_machine &machine);
+
+/*----------- defined in drivers/specpls3.c -----------*/
+
+void spectrum_plus3_update_memory(running_machine &machine);
+
+/*----------- defined in drivers/timex.c -----------*/
+
+void ts2068_update_memory(running_machine &machine);
+
+/*----------- defined in video/spectrum.c -----------*/
+
+PALETTE_INIT( spectrum );
+
+VIDEO_START( spectrum );
+VIDEO_START( spectrum_128 );
+
+SCREEN_UPDATE_IND16( spectrum );
+SCREEN_VBLANK( spectrum );
+
+void spectrum_border_force_redraw (running_machine &machine);
+void spectrum_border_set_last_color (running_machine &machine, int NewColor);
+void spectrum_border_draw(running_machine &machine, bitmap_ind16 &bitmap, int full_refresh,
+ int TopBorderLines, int ScreenLines, int BottomBorderLines,
+ int LeftBorderPixels, int ScreenPixels, int RightBorderPixels,
+ int LeftBorderCycles, int ScreenCycles, int RightBorderCycles,
+ int HorizontalRetraceCycles, int VRetraceTime, int EventID);
+
+void spectrum_EventList_Initialise(running_machine &machine, int NumEntries);
+void spectrum_EventList_Reset(running_machine &machine);
+void spectrum_EventList_SetOffsetStartTime(running_machine &machine, int StartTime);
+void spectrum_EventList_AddItemOffset(running_machine &machine, int ID, int Data,int Time);
+int spectrum_EventList_NumEvents(running_machine &machine);
+EVENT_LIST_ITEM *spectrum_EventList_GetFirstItem(running_machine &machine);
+
+/*----------- defined in video/timex.c -----------*/
+
+VIDEO_START( ts2068 );
+SCREEN_UPDATE_IND16( ts2068 );
+
+SCREEN_UPDATE_IND16( tc2048 );
+
+#endif /* __SPECTRUM_H__ */
diff --git a/src/mess/includes/ssystem3.h b/src/mess/includes/ssystem3.h
new file mode 100644
index 00000000000..5e230283bef
--- /dev/null
+++ b/src/mess/includes/ssystem3.h
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ *
+ * includes/ssystem3.h
+ *
+ ****************************************************************************/
+
+#ifndef SSYSTEM3_H_
+#define SSYSTEM3_H_
+
+
+typedef struct
+{
+ int signal;
+ // int on;
+
+ int count, bit, started;
+ UINT8 data;
+ attotime time, high_time, low_time;
+ union {
+ struct {
+ UINT8 header[7];
+ UINT8 field[8][8/2];
+ UINT8 unknown[5];
+ } s;
+ UINT8 data[7+8*8/2+5];
+ } u;
+} playfield_t;
+
+typedef struct
+{
+ UINT8 data[5];
+ int clock;
+ int count;
+} lcd_t;
+
+
+class ssystem3_state : public driver_device
+{
+public:
+ ssystem3_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 m_porta;
+ UINT8 *m_videoram;
+ playfield_t m_playfield;
+ lcd_t m_lcd;
+ DECLARE_DRIVER_INIT(ssystem3);
+};
+
+
+/*----------- defined in drivers/ssystem3.c -----------*/
+
+void ssystem3_playfield_getfigure(running_machine &machine, int x, int y, int *figure, int *black);
+
+/*----------- defined in video/ssystem3.c -----------*/
+
+extern PALETTE_INIT( ssystem3 );
+extern VIDEO_START( ssystem3 );
+extern SCREEN_UPDATE_IND16( ssystem3 );
+
+void ssystem3_lcd_reset(running_machine &machine);
+void ssystem3_lcd_write(running_machine &machine, int clock, int data);
+
+#endif /* SSYSTEM3_H_ */
diff --git a/src/mess/includes/studio2.h b/src/mess/includes/studio2.h
new file mode 100644
index 00000000000..146228996e5
--- /dev/null
+++ b/src/mess/includes/studio2.h
@@ -0,0 +1,92 @@
+#pragma once
+
+#ifndef __STUDIO2__
+#define __STUDIO2__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cartslot.h"
+#include "formats/studio2_st2.h"
+#include "sound/beep.h"
+#include "sound/cdp1864.h"
+#include "sound/discrete.h"
+#include "video/cdp1861.h"
+
+#define CDP1802_TAG "ic1"
+#define CDP1861_TAG "ic2"
+#define CDP1864_TAG "cdp1864"
+#define SCREEN_TAG "screen"
+
+class studio2_state : public driver_device
+{
+public:
+ studio2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_speaker(*this, BEEPER_TAG),
+ m_vdc(*this, CDP1861_TAG)
+ { }
+
+ required_device<cosmac_device> m_maincpu;
+ required_device<device_t> m_speaker;
+ optional_device<cdp1861_device> m_vdc;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( dispon_r );
+ DECLARE_WRITE8_MEMBER( keylatch_w );
+ DECLARE_WRITE8_MEMBER( dispon_w );
+ READ_LINE_MEMBER( clear_r );
+ READ_LINE_MEMBER( ef3_r );
+ READ_LINE_MEMBER( ef4_r );
+ WRITE_LINE_MEMBER( q_w );
+ DECLARE_INPUT_CHANGED_MEMBER( reset_w );
+
+ /* keyboard state */
+ UINT8 m_keylatch;
+ DECLARE_DRIVER_INIT(studio2);
+};
+
+class visicom_state : public studio2_state
+{
+public:
+ visicom_state(const machine_config &mconfig, device_type type, const char *tag)
+ : studio2_state(mconfig, type, tag),
+ m_color_ram(*this, "color_ram"),
+ m_color_ram1(*this, "color_ram1")
+ { }
+
+ required_shared_ptr<UINT8> m_color_ram;
+ required_shared_ptr<UINT8> m_color_ram1;
+};
+
+class mpt02_state : public studio2_state
+{
+public:
+ mpt02_state(const machine_config &mconfig, device_type type, const char *tag)
+ : studio2_state(mconfig, type, tag),
+ m_cti(*this, CDP1864_TAG),
+ m_color_ram(*this, "color_ram")
+ { }
+
+ required_device<cdp1864_device> m_cti;
+
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( dma_w );
+ DECLARE_READ_LINE_MEMBER( rdata_r );
+ DECLARE_READ_LINE_MEMBER( bdata_r );
+ DECLARE_READ_LINE_MEMBER( gdata_r );
+
+ /* video state */
+ required_shared_ptr<UINT8> m_color_ram;
+ UINT8 m_color;
+};
+
+#endif
diff --git a/src/mess/includes/super6.h b/src/mess/includes/super6.h
new file mode 100644
index 00000000000..e5a0f991442
--- /dev/null
+++ b/src/mess/includes/super6.h
@@ -0,0 +1,82 @@
+#pragma once
+
+#ifndef __SUPER6__
+#define __SUPER6__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/com8116.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dart.h"
+#include "machine/z80dma.h"
+#include "machine/z80pio.h"
+#include "machine/ram.h"
+#include "machine/terminal.h"
+#include "machine/wd17xx.h"
+
+#define Z80_TAG "u30"
+#define Z80CTC_TAG "u20"
+#define Z80DART_TAG "u38"
+#define Z80DMA_TAG "u21"
+#define Z80PIO_TAG "u7"
+#define WD2793_TAG "u27"
+#define BR1945_TAG "u31"
+#define SCREEN_TAG "screen"
+#define TERMINAL_TAG "terminal"
+
+class super6_state : public driver_device
+{
+public:
+ super6_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_dart(*this, Z80DART_TAG),
+ m_dma(*this, Z80DMA_TAG),
+ m_pio(*this, Z80PIO_TAG),
+ m_fdc(*this, WD2793_TAG),
+ m_brg(*this, BR1945_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_terminal(*this, TERMINAL_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<z80dart_device> m_dart;
+ required_device<z80dma_device> m_dma;
+ required_device<z80pio_device> m_pio;
+ required_device<device_t> m_fdc;
+ required_device<com8116_device> m_brg;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<serial_terminal_device> m_terminal;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( fdc_r );
+ DECLARE_WRITE8_MEMBER( fdc_w );
+ DECLARE_WRITE8_MEMBER( s100_w );
+ DECLARE_WRITE8_MEMBER( bank0_w );
+ DECLARE_WRITE8_MEMBER( bank1_w );
+ DECLARE_WRITE8_MEMBER( baud_w );
+ DECLARE_WRITE_LINE_MEMBER( fr_w );
+ DECLARE_WRITE_LINE_MEMBER( intrq_w );
+ DECLARE_WRITE_LINE_MEMBER( drq_w );
+
+ void bankswitch();
+
+ // memory state
+ UINT8 m_s100;
+ UINT8 m_bank0;
+ UINT8 m_bank1;
+};
+
+#endif
diff --git a/src/mess/includes/super80.h b/src/mess/includes/super80.h
new file mode 100644
index 00000000000..56c25ab4dd1
--- /dev/null
+++ b/src/mess/includes/super80.h
@@ -0,0 +1,101 @@
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "sound/wave.h"
+#include "imagedev/snapquik.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "sound/speaker.h"
+#include "machine/ctronics.h"
+#include "video/mc6845.h"
+#include "machine/z80pio.h"
+
+/* Bits in shared variable:
+ d5 cassette LED
+ d4 super80v rom or pcg bankswitch (1=pcg ram, 0=char gen rom)
+ d2 super80v video or colour bankswitch (1=video ram, 0=colour ram)
+ d2 super80 screen off (=2mhz) or on (bursts of 2mhz at 50hz = 1mhz) */
+
+
+
+class super80_state : public driver_device
+{
+public:
+ super80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_pio(*this, "z80pio"),
+ m_cass(*this, CASSETTE_TAG),
+ m_wave(*this, WAVE_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_centronics(*this, "centronics"),
+ m_6845(*this, "crtc")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_pio;
+ required_device<cassette_image_device> m_cass;
+ required_device<device_t> m_wave;
+ required_device<device_t> m_speaker;
+ required_device<centronics_device> m_centronics;
+ optional_device<mc6845_device> m_6845;
+ READ8_MEMBER( super80v_low_r );
+ READ8_MEMBER( super80v_high_r );
+ WRITE8_MEMBER( super80v_low_w );
+ WRITE8_MEMBER( super80v_high_w );
+ WRITE8_MEMBER( super80v_10_w );
+ WRITE8_MEMBER( super80v_11_w );
+ WRITE8_MEMBER( super80_f1_w );
+ READ8_MEMBER( super80_dc_r );
+ READ8_MEMBER( super80_f2_r );
+ WRITE8_MEMBER( super80_dc_w );
+ WRITE8_MEMBER( super80_f0_w );
+ WRITE8_MEMBER( super80r_f0_w );
+ READ8_MEMBER( super80_read_ff );
+ WRITE8_MEMBER( pio_port_a_w );
+ //READ8_MEMBER( pio_port_b_r );
+ virtual void machine_reset();
+ UINT8 m_shared;
+ UINT8 m_keylatch;
+ UINT8 m_cass_data[4];
+ UINT8 m_int_sw;
+ UINT8 m_last_data;
+ UINT16 m_vidpg;
+ UINT8 m_current_palette;
+ UINT8 m_current_charset;
+ const UINT8 *m_p_chargen;
+ UINT8 m_s_options;
+ UINT8 m_mc6845_cursor[16];
+ UINT8 m_mc6845_reg[32];
+ UINT8 m_mc6845_ind;
+ UINT8 m_framecnt;
+ UINT8 m_speed;
+ UINT8 m_flash;
+ UINT16 m_cursor;
+ UINT8 *m_p_videoram;
+ UINT8 *m_p_colorram;
+ UINT8 *m_p_pcgram;
+ void mc6845_cursor_configure();
+ DECLARE_DRIVER_INIT(super80);
+ DECLARE_DRIVER_INIT(super80v);
+};
+
+
+/*----------- defined in video/super80.c -----------*/
+
+PALETTE_INIT( super80m );
+SCREEN_UPDATE_IND16( super80 );
+SCREEN_UPDATE_IND16( super80d );
+SCREEN_UPDATE_IND16( super80e );
+SCREEN_UPDATE_IND16( super80m );
+VIDEO_START( super80 );
+SCREEN_VBLANK( super80m );
+VIDEO_START( super80v );
+SCREEN_UPDATE_RGB32( super80v );
+MC6845_UPDATE_ROW( super80v_update_row );
+
+/*----------- defined in machine/super80.c -----------*/
+
+MACHINE_RESET( super80 );
+
+extern const z80pio_interface super80_pio_intf;
+
diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h
new file mode 100644
index 00000000000..e87d01734ba
--- /dev/null
+++ b/src/mess/includes/svi318.h
@@ -0,0 +1,99 @@
+/*****************************************************************************
+ *
+ * includes/svi318.h
+ *
+ * Spectravideo SVI-318 and SVI-328
+ *
+ ****************************************************************************/
+
+#ifndef SVI318_H_
+#define SVI318_H_
+
+#include "machine/i8255.h"
+#include "machine/ins8250.h"
+#include "machine/wd17xx.h"
+
+typedef struct
+{
+ /* general */
+ UINT8 svi318; /* Are we dealing with an SVI-318 or a SVI-328 model. 0 = 328, 1 = 318 */
+ /* memory */
+ UINT8 *empty_bank;
+ UINT8 bank_switch;
+ UINT8 bankLow;
+ UINT8 bankHigh1;
+ UINT8 *bankLow_ptr;
+ UINT8 bankLow_read_only;
+ UINT8 *bankHigh1_ptr;
+ UINT8 bankHigh1_read_only;
+ UINT8 *bankHigh2_ptr;
+ UINT8 bankHigh2_read_only;
+ /* keyboard */
+ UINT8 keyboard_row;
+ /* SVI-806 80 column card */
+ UINT8 svi806_present;
+ UINT8 svi806_ram_enabled;
+ memory_region *svi806_ram;
+ UINT8 *svi806_gfx;
+} SVI_318;
+
+typedef struct
+{
+ UINT8 driveselect;
+ int drq;
+ int irq;
+ UINT8 heads[2];
+} SVI318_FDC_STRUCT;
+
+
+class svi318_state : public driver_device
+{
+public:
+ svi318_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ SVI_318 m_svi;
+ UINT8 *m_pcart;
+ UINT32 m_pcart_rom_size;
+ SVI318_FDC_STRUCT m_fdc;
+ DECLARE_WRITE8_MEMBER(svi318_ppi_w);
+ DECLARE_READ8_MEMBER(svi318_psg_port_a_r);
+ DECLARE_WRITE8_MEMBER(svi318_psg_port_b_w);
+ DECLARE_WRITE8_MEMBER(svi318_fdc_drive_motor_w);
+ DECLARE_WRITE8_MEMBER(svi318_fdc_density_side_w);
+ DECLARE_READ8_MEMBER(svi318_fdc_irqdrq_r);
+ DECLARE_WRITE8_MEMBER(svi806_ram_enable_w);
+ DECLARE_WRITE8_MEMBER(svi318_writemem1);
+ DECLARE_WRITE8_MEMBER(svi318_writemem2);
+ DECLARE_WRITE8_MEMBER(svi318_writemem3);
+ DECLARE_WRITE8_MEMBER(svi318_writemem4);
+ DECLARE_READ8_MEMBER(svi318_io_ext_r);
+ DECLARE_WRITE8_MEMBER(svi318_io_ext_w);
+ DECLARE_DRIVER_INIT(svi318);
+};
+
+
+/*----------- defined in machine/svi318.c -----------*/
+
+extern const i8255_interface svi318_ppi8255_interface;
+extern const ins8250_interface svi318_ins8250_interface[2];
+extern const wd17xx_interface svi_wd17xx_interface;
+
+MACHINE_START( svi318_pal );
+MACHINE_START( svi318_ntsc );
+MACHINE_RESET( svi318 );
+
+DEVICE_START( svi318_cart );
+DEVICE_IMAGE_LOAD( svi318_cart );
+DEVICE_IMAGE_UNLOAD( svi318_cart );
+
+
+
+
+int svi318_cassette_present(running_machine &machine, int id);
+
+MC6845_UPDATE_ROW( svi806_crtc6845_update_row );
+VIDEO_START( svi328_806 );
+MACHINE_RESET( svi328_806 );
+
+#endif /* SVI318_H_ */
diff --git a/src/mess/includes/svision.h b/src/mess/includes/svision.h
new file mode 100644
index 00000000000..0b72f109de7
--- /dev/null
+++ b/src/mess/includes/svision.h
@@ -0,0 +1,71 @@
+/*****************************************************************************
+ *
+ * includes/svision.h
+ *
+ ****************************************************************************/
+
+#ifndef SVISION_H_
+#define SVISION_H_
+
+typedef struct
+{
+ emu_timer *timer1;
+ int timer_shot;
+} svision_t;
+
+typedef struct
+{
+ int state;
+ int on, clock, data;
+ UINT8 input;
+ emu_timer *timer;
+} svision_pet_t;
+
+typedef struct
+{
+ UINT32 palette[4/*0x40?*/]; /* rgb8 */
+ int palette_on;
+} tvlink_t;
+
+
+class svision_state : public driver_device
+{
+public:
+ svision_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_reg(*this, "reg"),
+ m_videoram(*this, "videoram"){ }
+
+ required_shared_ptr<UINT8> m_reg;
+ required_shared_ptr<UINT8> m_videoram;
+ device_t *m_sound;
+ int *m_dma_finished;
+ svision_t m_svision;
+ svision_pet_t m_pet;
+ tvlink_t m_tvlink;
+ DECLARE_READ8_MEMBER(svision_r);
+ DECLARE_WRITE8_MEMBER(svision_w);
+ DECLARE_READ8_MEMBER(tvlink_r);
+ DECLARE_WRITE8_MEMBER(tvlink_w);
+ DECLARE_DRIVER_INIT(svisions);
+ DECLARE_DRIVER_INIT(svision);
+};
+
+
+/*----------- defined in drivers/svision.c -----------*/
+
+void svision_irq( running_machine &machine );
+
+
+/*----------- defined in audio/svision.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(SVISION, svision_sound);
+
+int *svision_dma_finished(device_t *device);
+void svision_sound_decrement(device_t *device);
+void svision_soundport_w(device_t *device, int which, int offset, int data);
+WRITE8_DEVICE_HANDLER( svision_sounddma_w );
+WRITE8_DEVICE_HANDLER( svision_noise_w );
+
+
+#endif /* SVISION_H_ */
diff --git a/src/mess/includes/sym1.h b/src/mess/includes/sym1.h
new file mode 100644
index 00000000000..ad947c38a41
--- /dev/null
+++ b/src/mess/includes/sym1.h
@@ -0,0 +1,62 @@
+/*****************************************************************************
+ *
+ * includes/sym1.h
+ *
+ * Synertek Systems Corp. SYM-1
+ *
+ * Early driver by PeT <mess@utanet.at>, May 2000
+ * Rewritten by Dirk Best, October 2007
+ *
+ ****************************************************************************/
+
+#ifndef SYM1_H_
+#define SYM1_H_
+
+#include "machine/6532riot.h"
+#include "machine/6522via.h"
+#include "machine/74145.h"
+
+/* SYM-1 main (and only) oscillator Y1 */
+#define SYM1_CLOCK XTAL_1MHz
+
+
+class sym1_state : public driver_device
+{
+public:
+ sym1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) ,
+ m_ram_1k(*this, "ram_1k"),
+ m_ram_2k(*this, "ram_2k"),
+ m_ram_3k(*this, "ram_3k"),
+ m_monitor(*this, "monitor"),
+ m_riot_ram(*this, "riot_ram"){ }
+
+ required_shared_ptr<UINT8> m_ram_1k;
+ required_shared_ptr<UINT8> m_ram_2k;
+ required_shared_ptr<UINT8> m_ram_3k;
+ required_shared_ptr<UINT8> m_monitor;
+ required_shared_ptr<UINT8> m_riot_ram;
+ UINT8 m_riot_port_a;
+ UINT8 m_riot_port_b;
+ emu_timer *m_led_update;
+ DECLARE_DRIVER_INIT(sym1);
+};
+
+
+/*----------- defined in drivers/sym1.c -----------*/
+
+/* Pointer to the monitor ROM, which includes the reset vectors for the CPU */
+
+
+/*----------- defined in machine/sym1.c -----------*/
+
+extern const riot6532_interface sym1_r6532_interface;
+extern const ttl74145_interface sym1_ttl74145_intf;
+extern const via6522_interface sym1_via0;
+extern const via6522_interface sym1_via1;
+extern const via6522_interface sym1_via2;
+
+MACHINE_RESET( sym1 );
+
+
+#endif /* SYM1_H_ */
diff --git a/src/mess/includes/tandy1t.h b/src/mess/includes/tandy1t.h
new file mode 100644
index 00000000000..5033906c87d
--- /dev/null
+++ b/src/mess/includes/tandy1t.h
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ *
+ * includes/tandy1t.h
+ *
+ ****************************************************************************/
+
+#ifndef TANDY1T_H_
+#define TANDY1T_H_
+
+
+/*----------- defined in machine/tandy1t.c -----------*/
+
+extern WRITE8_HANDLER ( pc_t1t_p37x_w );
+extern READ8_HANDLER ( pc_t1t_p37x_r );
+
+extern WRITE8_HANDLER ( tandy1000_pio_w );
+extern READ8_HANDLER(tandy1000_pio_r);
+
+extern NVRAM_HANDLER( tandy1000 );
+
+MACHINE_RESET( tandy1000rl );
+READ8_HANDLER( tandy1000_bank_r );
+WRITE8_HANDLER( tandy1000_bank_w );
+
+INPUT_PORTS_EXTERN( t1000_keyboard );
+
+
+#endif /* TANDY1T_H_ */
diff --git a/src/mess/includes/tandy2k.h b/src/mess/includes/tandy2k.h
new file mode 100644
index 00000000000..6b139b852c9
--- /dev/null
+++ b/src/mess/includes/tandy2k.h
@@ -0,0 +1,141 @@
+#ifndef __TANDY2K__
+#define __TANDY2K__
+
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/mcs48/mcs48.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/harddriv.h"
+#include "machine/ctronics.h"
+#include "machine/i8255.h"
+#include "machine/i8251.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/ram.h"
+#include "machine/tandy2kb.h"
+#include "machine/upd765.h"
+#include "sound/speaker.h"
+#include "video/crt9007.h"
+#include "video/crt9021.h"
+#include "video/crt9212.h"
+
+#define SCREEN_TAG "screen"
+#define I80186_TAG "u76"
+#define I8255A_TAG "u75"
+#define I8251A_TAG "u41"
+#define I8253_TAG "u40"
+#define I8259A_0_TAG "u42"
+#define I8259A_1_TAG "u43"
+#define I8272A_TAG "u121"
+#define CRT9007_TAG "u16"
+#define CRT9212_0_TAG "u55"
+#define CRT9212_1_TAG "u15"
+#define CRT9021B_TAG "u14"
+#define WD1010_TAG "u18"
+#define WD1100_11_TAG "u12"
+#define CENTRONICS_TAG "centronics"
+
+class tandy2k_state : public driver_device
+{
+public:
+ tandy2k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I80186_TAG),
+ m_uart(*this, I8251A_TAG),
+ m_pit(*this, I8253_TAG),
+ m_fdc(*this, I8272A_TAG),
+ m_pic0(*this, I8259A_0_TAG),
+ m_pic1(*this, I8259A_1_TAG),
+ m_vpac(*this, CRT9007_TAG),
+ m_drb0(*this, CRT9212_0_TAG),
+ m_drb1(*this, CRT9212_1_TAG),
+ m_vac(*this, CRT9021B_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_kb(*this, TANDY2K_KEYBOARD_TAG),
+ m_kbdclk(0)
+ ,
+ m_hires_ram(*this, "hires_ram"),
+ m_char_ram(*this, "char_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<i8251_device> m_uart;
+ required_device<device_t> m_pit;
+ required_device<device_t> m_fdc;
+ required_device<device_t> m_pic0;
+ required_device<device_t> m_pic1;
+ required_device<crt9007_device> m_vpac;
+ required_device<crt9212_device> m_drb0;
+ required_device<crt9212_device> m_drb1;
+ required_device<crt9021_device> m_vac;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_speaker;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<tandy2k_keyboard_device> m_kb;
+
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void speaker_update();
+ void dma_request(int line, int state);
+
+ DECLARE_READ8_MEMBER( videoram_r );
+ DECLARE_READ8_MEMBER( enable_r );
+ DECLARE_WRITE8_MEMBER( enable_w );
+ DECLARE_WRITE8_MEMBER( dma_mux_w );
+ DECLARE_READ8_MEMBER( kbint_clr_r );
+ DECLARE_READ16_MEMBER( vpac_r );
+ DECLARE_WRITE16_MEMBER( vpac_w );
+ DECLARE_WRITE8_MEMBER( addr_ctrl_w );
+ DECLARE_WRITE_LINE_MEMBER( busdmarq0_w );
+ DECLARE_WRITE_LINE_MEMBER( rxrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( txrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( outspkr_w );
+ DECLARE_WRITE_LINE_MEMBER( intbrclk_w );
+ DECLARE_WRITE_LINE_MEMBER( rfrqpulse_w );
+ DECLARE_READ8_MEMBER( ppi_pb_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_WRITE_LINE_MEMBER( vpac_vlt_w );
+ DECLARE_WRITE_LINE_MEMBER( vpac_drb_w );
+ DECLARE_WRITE_LINE_MEMBER( vac_ld_ht_w );
+ DECLARE_WRITE_LINE_MEMBER( kbdclk_w );
+ DECLARE_WRITE_LINE_MEMBER( kbddat_w );
+
+ /* DMA state */
+ UINT8 m_dma_mux;
+
+ /* keyboard state */
+ int m_kbdclk;
+ int m_kbddat;
+ UINT8 m_kbdin;
+
+ /* serial state */
+ int m_extclk;
+ int m_rxrdy;
+ int m_txrdy;
+
+ /* PPI state */
+ int m_pb_sel;
+
+ /* video state */
+ required_shared_ptr<UINT16> m_hires_ram;
+ required_shared_ptr<UINT16> m_char_ram;
+ UINT16 m_palette[16];
+ UINT8 m_vram_base;
+ int m_vidouts;
+ int m_clkspd;
+ int m_clkcnt;
+
+ /* sound state */
+ int m_outspkr;
+ int m_spkrdata;
+};
+
+#endif
diff --git a/src/mess/includes/tdv2324.h b/src/mess/includes/tdv2324.h
new file mode 100644
index 00000000000..60de447ae01
--- /dev/null
+++ b/src/mess/includes/tdv2324.h
@@ -0,0 +1,86 @@
+#pragma once
+
+#ifndef __TDV2324__
+#define __TDV2324__
+
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "cpu/m6800/m6800.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/harddriv.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/ram.h"
+#include "machine/s1410.h"
+#include "machine/wd17xx.h"
+#include "machine/z80dart.h"
+#include "video/tms9927.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define P8085AH_0_TAG "17f"
+#define P8259A_TAG "17d"
+#define P8253_5_0_TAG "17c"
+#define P8253_5_1_TAG "18c"
+#define ER3400_TAG "12a"
+
+#define P8085AH_1_TAG "6c"
+#define TMS9937NL_TAG "7e"
+#define MK3887N4_TAG "15d"
+
+#define MC68B02P_TAG "12b"
+#define FD1797PL02_TAG "fd1797"
+
+#define SCREEN_TAG "screen"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class tdv2324_state : public driver_device
+{
+public:
+ tdv2324_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, P8085AH_0_TAG),
+ m_subcpu(*this, P8085AH_1_TAG),
+ m_fdccpu(*this, MC68B02P_TAG),
+ m_sio(*this, MK3887N4_TAG),
+ m_pic(*this, P8259A_TAG),
+ m_pit0(*this, P8253_5_0_TAG),
+ m_pit1(*this, P8253_5_1_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<cpu_device> m_fdccpu;
+ required_device<z80dart_device> m_sio;
+ required_device<device_t> m_pic;
+ required_device<device_t> m_pit0;
+ required_device<device_t> m_pit1;
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( tdv2324_main_io_30 );
+ DECLARE_READ8_MEMBER( tdv2324_main_io_e6 );
+ DECLARE_WRITE8_MEMBER( tdv2324_main_io_e2 );
+
+ UINT8 m_sub_status;
+ UINT8 m_sub_data;
+
+ // video state
+ required_shared_ptr<UINT8> m_video_ram;
+};
+
+
+#endif
diff --git a/src/mess/includes/tek405x.h b/src/mess/includes/tek405x.h
new file mode 100644
index 00000000000..a92ea4fddc6
--- /dev/null
+++ b/src/mess/includes/tek405x.h
@@ -0,0 +1,146 @@
+#pragma once
+
+#ifndef __TEK405X__
+#define __TEK405X__
+
+#include "machine/ram.h"
+
+#define MC6800_TAG "u61"
+#define MC6820_Y_TAG "u561"
+#define MC6820_X_TAG "u565"
+#define MC6820_TAPE_TAG "u361"
+#define MC6820_KB_TAG "u461"
+#define MC6820_GPIB_TAG "u265"
+#define MC6820_COM_TAG "u5"
+#define MC6850_TAG "u25"
+#define RS232_TAG "rs232"
+#define SCREEN_TAG "screen"
+
+#define AM2901A_TAG "am2901a"
+
+class tek4051_state : public driver_device
+{
+public:
+ tek4051_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, MC6800_TAG),
+ m_gpib_pia(*this, MC6820_GPIB_TAG),
+ m_com_pia(*this, MC6820_COM_TAG),
+ m_acia(*this, MC6850_TAG),
+ m_gpib(*this, IEEE488_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_gpib_pia;
+ required_device<device_t> m_com_pia;
+ required_device<acia6850_device> m_acia;
+ required_device<ieee488_device> m_gpib;
+ required_device<device_t> m_speaker;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+
+ void bankswitch(UINT8 data);
+ void update_irq();
+ void update_nmi();
+ void scan_keyboard();
+
+ DECLARE_WRITE8_MEMBER( lbs_w );
+
+ DECLARE_READ8_MEMBER( x_pia_pa_r );
+ DECLARE_WRITE8_MEMBER( x_pia_pa_w );
+ DECLARE_WRITE8_MEMBER( x_pia_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( adot_w );
+ DECLARE_READ_LINE_MEMBER( viewcause_r );
+ DECLARE_WRITE_LINE_MEMBER( bufclk_w );
+ DECLARE_WRITE_LINE_MEMBER( x_pia_irqa_w );
+ DECLARE_WRITE_LINE_MEMBER( x_pia_irqb_w );
+
+ DECLARE_READ8_MEMBER( sa_r );
+ DECLARE_WRITE8_MEMBER( y_pia_pa_w );
+ DECLARE_WRITE8_MEMBER( sb_w );
+ DECLARE_READ_LINE_MEMBER( rdbyte_r );
+ DECLARE_READ_LINE_MEMBER( mdata_r );
+ DECLARE_READ_LINE_MEMBER( fmark_r );
+ DECLARE_WRITE_LINE_MEMBER( sot_w );
+ DECLARE_WRITE_LINE_MEMBER( y_pia_irqa_w );
+ DECLARE_WRITE_LINE_MEMBER( y_pia_irqb_w );
+
+ DECLARE_READ8_MEMBER( kb_pia_pa_r );
+ DECLARE_READ8_MEMBER( kb_pia_pb_r );
+ DECLARE_WRITE8_MEMBER( kb_pia_pb_w );
+ DECLARE_READ_LINE_MEMBER( key_r );
+ DECLARE_WRITE_LINE_MEMBER( kb_halt_w );
+ DECLARE_WRITE_LINE_MEMBER( kb_pia_irqa_w );
+ DECLARE_WRITE_LINE_MEMBER( kb_pia_irqb_w );
+
+ DECLARE_READ8_MEMBER( tape_pia_pa_r );
+ DECLARE_WRITE8_MEMBER( tape_pia_pa_w );
+ DECLARE_WRITE8_MEMBER( tape_pia_pb_w );
+ DECLARE_READ_LINE_MEMBER( rmark_r );
+ DECLARE_READ_LINE_MEMBER( lohole_r );
+ DECLARE_READ_LINE_MEMBER( filfnd_r );
+ DECLARE_READ_LINE_MEMBER( uphole_r );
+ DECLARE_WRITE_LINE_MEMBER( tape_pia_irqa_w );
+ DECLARE_WRITE_LINE_MEMBER( tape_pia_irqb_w );
+
+ DECLARE_WRITE8_MEMBER( dio_w );
+ DECLARE_READ8_MEMBER( gpib_pia_pb_r );
+ DECLARE_WRITE8_MEMBER( gpib_pia_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( talk_w );
+ DECLARE_WRITE_LINE_MEMBER( gpib_pia_irqa_w );
+ DECLARE_WRITE_LINE_MEMBER( gpib_pia_irqb_w );
+
+ DECLARE_WRITE8_MEMBER( com_pia_pa_w );
+ DECLARE_READ8_MEMBER( com_pia_pb_r );
+ DECLARE_WRITE8_MEMBER( com_pia_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( com_pia_irqa_w );
+ DECLARE_WRITE_LINE_MEMBER( com_pia_irqb_w );
+ DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
+
+ // interrupts
+ int m_x_pia_irqa;
+ int m_x_pia_irqb;
+ int m_y_pia_irqa;
+ int m_y_pia_irqb;
+ int m_tape_pia_irqa;
+ int m_tape_pia_irqb;
+ int m_kb_pia_irqa;
+ int m_kb_pia_irqb;
+ int m_gpib_pia_irqa;
+ int m_gpib_pia_irqb;
+ int m_com_pia_irqa;
+ int m_com_pia_irqb;
+ int m_acia_irq;
+
+ // keyboard
+ int m_kbhalt;
+ int m_kc;
+ int m_key;
+
+ // GPIB
+ int m_talk;
+};
+
+class tek4052_state : public driver_device
+{
+public:
+ tek4052_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, AM2901A_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+};
+
+#endif
diff --git a/src/mess/includes/thomson.h b/src/mess/includes/thomson.h
new file mode 100644
index 00000000000..59e8dbdf3d4
--- /dev/null
+++ b/src/mess/includes/thomson.h
@@ -0,0 +1,394 @@
+/**********************************************************************
+
+ Copyright (C) Antoine Mine' 2006
+
+ Thomson 8-bit computers
+
+**********************************************************************/
+
+#ifndef _THOMSON_H_
+#define _THOMSON_H_
+
+#include "emu.h"
+#include "cpu/m6809/m6809.h"
+#include "machine/6821pia.h"
+#include "machine/mc6846.h"
+#include "machine/6850acia.h"
+#include "machine/6551acia.h"
+#include "sound/dac.h"
+#include "audio/mea8000.h"
+#include "machine/ctronics.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "machine/mc6843.h"
+#include "machine/mc6846.h"
+#include "machine/mc6854.h"
+#include "formats/thom_cas.h"
+#include "formats/thom_dsk.h"
+#include "machine/thomflop.h"
+
+
+/*----------- defined in machine/thomson.c -----------*/
+
+/*************************** common ********************************/
+
+/* 6821 PIAs */
+#define THOM_PIA_SYS "pia_0" /* system PIA */
+#define THOM_PIA_GAME "pia_1" /* music & game PIA (joypad + sound) */
+#define THOM_PIA_IO "pia_2" /* CC 90-232 I/O extension (parallel & RS-232) */
+#define THOM_PIA_MODEM "pia_3" /* MD 90-120 MODEM extension */
+
+/* sound ports */
+#define THOM_SOUND_BUZ 0 /* 1-bit buzzer */
+#define THOM_SOUND_GAME 1 /* 6-bit game port DAC */
+#define THOM_SOUND_SPEECH 2 /* speech synthesis */
+
+/* bank-switching */
+#define THOM_CART_BANK "bank2" /* cartridge ROM */
+#define THOM_RAM_BANK "bank3" /* data RAM */
+#define THOM_FLOP_BANK "bank4" /* external floppy controller ROM */
+#define THOM_BASE_BANK "bank5" /* system RAM */
+
+extern const pia6821_interface to7_pia6821_sys;
+extern const pia6821_interface to7_pia6821_io;
+extern const pia6821_interface to7_pia6821_modem;
+extern const pia6821_interface to7_pia6821_game;
+extern const pia6821_interface to770_pia6821_sys;
+extern const pia6821_interface mo5_pia6821_sys;
+extern const pia6821_interface to9_pia6821_sys;
+extern const pia6821_interface to8_pia6821_sys;
+extern const pia6821_interface to9p_pia6821_sys;
+extern const pia6821_interface mo6_pia6821_game;
+extern const pia6821_interface mo6_pia6821_sys;
+extern const pia6821_interface mo5nr_pia6821_sys;
+extern const pia6821_interface mo5nr_pia6821_game;
+
+/***************************** TO7 / T9000 *************************/
+
+/* cartridge bank-switching */
+extern DEVICE_IMAGE_LOAD( to7_cartridge );
+extern WRITE8_HANDLER ( to7_cartridge_w );
+extern READ8_HANDLER ( to7_cartridge_r );
+
+/* dispatch MODEM or speech synthesis extension */
+extern READ8_HANDLER ( to7_modem_mea8000_r );
+extern WRITE8_HANDLER ( to7_modem_mea8000_w );
+
+/* MIDI extension (actually an 6850 ACIA) */
+extern READ8_HANDLER ( to7_midi_r );
+extern WRITE8_HANDLER ( to7_midi_w );
+
+extern MACHINE_START ( to7 );
+extern MACHINE_RESET ( to7 );
+
+/* centronics */
+extern const centronics_interface to7_centronics_config;
+extern const centronics_interface mo6_centronics_config;
+
+/* timer */
+extern const mc6846_interface to7_timer;
+
+/* speech synthesis */
+extern const mea8000_interface to7_speech;
+
+/* modem */
+extern const acia6850_interface to7_modem;
+
+
+/***************************** TO7/70 ******************************/
+
+/* gate-array */
+extern READ8_HANDLER ( to770_gatearray_r );
+extern WRITE8_HANDLER ( to770_gatearray_w );
+
+extern MACHINE_START ( to770 );
+extern MACHINE_RESET ( to770 );
+
+extern const mc6846_interface to770_timer;
+
+/***************************** MO5 ******************************/
+
+/* gate-array */
+extern READ8_HANDLER ( mo5_gatearray_r );
+extern WRITE8_HANDLER ( mo5_gatearray_w );
+
+/* cartridge / extended RAM bank-switching */
+extern DEVICE_IMAGE_LOAD( mo5_cartridge );
+extern WRITE8_HANDLER ( mo5_ext_w );
+extern WRITE8_HANDLER ( mo5_cartridge_w );
+extern READ8_HANDLER ( mo5_cartridge_r );
+
+extern MACHINE_START ( mo5 );
+extern MACHINE_RESET ( mo5 );
+
+
+/***************************** TO9 ******************************/
+
+/* IEEE extension */
+extern WRITE8_HANDLER ( to9_ieee_w );
+extern READ8_HANDLER ( to9_ieee_r );
+
+/* ROM bank-switching */
+extern WRITE8_HANDLER ( to9_cartridge_w );
+extern READ8_HANDLER ( to9_cartridge_r );
+
+/* system gate-array */
+extern READ8_HANDLER ( to9_gatearray_r );
+extern WRITE8_HANDLER ( to9_gatearray_w );
+
+/* video gate-array */
+extern READ8_HANDLER ( to9_vreg_r );
+extern WRITE8_HANDLER ( to9_vreg_w );
+
+/* keyboard */
+extern READ8_HANDLER ( to9_kbd_r );
+extern WRITE8_HANDLER ( to9_kbd_w );
+
+extern MACHINE_START ( to9 );
+extern MACHINE_RESET ( to9 );
+
+extern const mc6846_interface to9_timer;
+
+
+/***************************** TO8 ******************************/
+
+/* bank-switching */
+#define TO8_SYS_LO "bank5" /* system RAM low 2 Kb */
+#define TO8_SYS_HI "bank6" /* system RAM hi 2 Kb */
+#define TO8_DATA_LO "bank7" /* data RAM low 2 Kb */
+#define TO8_DATA_HI "bank8" /* data RAM hi 2 Kb */
+#define TO8_BIOS_BANK "bank9" /* BIOS ROM */
+
+extern UINT8 to8_data_vpage;
+extern UINT8 to8_cart_vpage;
+
+extern WRITE8_HANDLER ( to8_cartridge_w );
+extern READ8_HANDLER ( to8_cartridge_r );
+
+/* system gate-array */
+extern READ8_HANDLER ( to8_gatearray_r );
+extern WRITE8_HANDLER ( to8_gatearray_w );
+
+/* video gate-array */
+extern READ8_HANDLER ( to8_vreg_r );
+extern WRITE8_HANDLER ( to8_vreg_w );
+
+/* floppy */
+extern READ8_HANDLER ( to8_floppy_r );
+extern WRITE8_HANDLER ( to8_floppy_w );
+
+extern MACHINE_START ( to8 );
+extern MACHINE_RESET ( to8 );
+
+extern const mc6846_interface to8_timer;
+
+
+/***************************** TO9+ ******************************/
+
+extern MACHINE_START ( to9p );
+extern MACHINE_RESET ( to9p );
+
+extern const mc6846_interface to9p_timer;
+
+
+/***************************** MO6 ******************************/
+
+extern READ8_HANDLER ( mo6_cartridge_r );
+extern WRITE8_HANDLER ( mo6_cartridge_w );
+extern WRITE8_HANDLER ( mo6_ext_w );
+
+/* system gate-array */
+extern READ8_HANDLER ( mo6_gatearray_r );
+extern WRITE8_HANDLER ( mo6_gatearray_w );
+
+/* video gate-array */
+extern READ8_HANDLER ( mo6_vreg_r );
+extern WRITE8_HANDLER ( mo6_vreg_w );
+
+extern MACHINE_START ( mo6 );
+extern MACHINE_RESET ( mo6 );
+
+
+/***************************** MO5 NR ******************************/
+
+/* network */
+extern READ8_HANDLER ( mo5nr_net_r );
+extern WRITE8_HANDLER ( mo5nr_net_w );
+
+/* printer */
+extern READ8_HANDLER ( mo5nr_prn_r );
+extern WRITE8_HANDLER ( mo5nr_prn_w );
+
+extern MACHINE_START ( mo5nr );
+extern MACHINE_RESET ( mo5nr );
+
+
+/*----------- defined in video/thomson.c -----------*/
+
+/*
+ TO7 video:
+ one line (64 us) =
+ 56 left border pixels ( 7 us)
+ + 320 active pixels (40 us)
+ + 56 right border pixels ( 7 us)
+ + horizontal retrace (10 us)
+
+ one image (20 ms) =
+ 47 top border lines (~3 ms)
+ + 200 active lines (12.8 ms)
+ + 47 bottom border lines (~3 ms)
+ + vertical retrace (~1 ms)
+
+ TO9 and up introduced a half (160 pixels) and double (640 pixels)
+ horizontal mode, but still in 40 us (no change in refresh rate).
+*/
+
+
+/***************************** dimensions **************************/
+
+/* original screen dimension (may be different from emulated screen!) */
+#define THOM_ACTIVE_WIDTH 320
+#define THOM_BORDER_WIDTH 56
+#define THOM_ACTIVE_HEIGHT 200
+#define THOM_BORDER_HEIGHT 47
+#define THOM_TOTAL_WIDTH 432
+#define THOM_TOTAL_HEIGHT 294
+
+/* Emulated screen dimension may be doubled to allow hi-res 640x200 mode.
+ Emulated screen can have smaller borders.
+ */
+
+/* maximum number of video pages:
+ 1 for TO7 generation (including MO5)
+ 4 for TO8 generation (including TO9, MO6)
+ */
+#define THOM_NB_PAGES 4
+
+/* page 0 is banked */
+#define THOM_VRAM_BANK "bank1"
+
+extern UINT8* thom_vram;
+
+/*********************** video signals *****************************/
+
+struct thom_vsignal {
+ unsigned count; /* pixel counter */
+ unsigned init; /* 1 -> active vertical windos, 0 -> border/VBLANK */
+ unsigned inil; /* 1 -> active horizontal window, 0 -> border/HBLANK */
+ unsigned lt3; /* bit 3 of us counter */
+ unsigned line; /* line counter */
+};
+
+/* current video position */
+extern struct thom_vsignal thom_get_vsignal ( running_machine &machine );
+
+
+/************************* lightpen ********************************/
+
+/* specific TO7 / T9000 lightpen code (no video gate-array) */
+extern unsigned to7_lightpen_gpl ( running_machine &machine, int decx, int decy );
+
+/* video position corresponding to lightpen (with some offset) */
+extern struct thom_vsignal thom_get_lightpen_vsignal ( running_machine &machine, int xdec, int ydec,
+ int xdec2 );
+
+/* specify a lightpencall-back function, called nb times per frame */
+extern void thom_set_lightpen_callback ( running_machine &machine, int nb, void (*cb) ( running_machine &machine, int step ) );
+
+
+/***************************** commons *****************************/
+
+extern VIDEO_START ( thom );
+extern SCREEN_UPDATE_IND16 ( thom );
+extern PALETTE_INIT ( thom );
+extern SCREEN_VBLANK ( thom );
+
+/* pass video init signal */
+extern void thom_set_init_callback ( running_machine &machine, void (*cb) ( running_machine &machine, int init ) );
+
+/* TO7 TO7/70 MO5 video bank switch */
+extern void thom_set_mode_point ( running_machine &machine, int point );
+
+/* set the palette index for the border color */
+extern void thom_set_border_color ( running_machine &machine, unsigned color );
+
+/* set one of 16 palette indices to one of 4096 colors */
+extern void thom_set_palette ( running_machine &machine, unsigned index, UINT16 color );
+
+
+/* video modes */
+#define THOM_VMODE_TO770 0
+#define THOM_VMODE_MO5 1
+#define THOM_VMODE_BITMAP4 2
+#define THOM_VMODE_BITMAP4_ALT 3
+#define THOM_VMODE_80 4
+#define THOM_VMODE_BITMAP16 5
+#define THOM_VMODE_PAGE1 6
+#define THOM_VMODE_PAGE2 7
+#define THOM_VMODE_OVERLAY 8
+#define THOM_VMODE_OVERLAY3 9
+#define THOM_VMODE_TO9 10
+#define THOM_VMODE_80_TO9 11
+#define THOM_VMODE_NB 12
+
+/* change the current video-mode */
+extern void thom_set_video_mode ( running_machine &machine, unsigned mode );
+
+/* select which video page shown among the 4 available */
+extern void thom_set_video_page ( running_machine &machine, unsigned page );
+
+/* to tell there is some floppy activity, stays up for a few frames */
+extern void thom_floppy_active ( running_machine &machine, int write );
+
+
+/***************************** TO7 / T9000 *************************/
+
+extern WRITE8_HANDLER ( to7_vram_w );
+
+
+/***************************** TO7/70 ******************************/
+
+extern WRITE8_HANDLER ( to770_vram_w );
+
+
+/***************************** TO8 ******************************/
+
+/* write to video memory through system space (always page 1) */
+WRITE8_HANDLER ( to8_sys_lo_w );
+WRITE8_HANDLER ( to8_sys_hi_w );
+
+/* write to video memory through data space */
+WRITE8_HANDLER ( to8_data_lo_w );
+WRITE8_HANDLER ( to8_data_hi_w );
+
+/* write to video memory page through cartridge addresses space */
+WRITE8_HANDLER ( to8_vcart_w );
+
+
+
+class to7_io_line_device : public device_t,
+ public device_serial_interface
+{
+public:
+ // construction/destruction
+ to7_io_line_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ virtual void input_callback(UINT8 state);
+
+ /* read data register */
+ DECLARE_READ8_MEMBER(porta_in);
+
+ /* write data register */
+ DECLARE_WRITE8_MEMBER(porta_out);
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+};
+
+extern const device_type TO7_IO_LINE;
+
+#define MCFG_TO7_IO_LINE_ADD(_tag) \
+ MCFG_DEVICE_ADD((_tag), TO7_IO_LINE, 0)
+
+#endif /* _THOMSON_H_ */
diff --git a/src/mess/includes/ti85.h b/src/mess/includes/ti85.h
new file mode 100644
index 00000000000..f16dcc089da
--- /dev/null
+++ b/src/mess/includes/ti85.h
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ *
+ * includes/ti85.h
+ *
+ ****************************************************************************/
+
+#ifndef TI85_H_
+#define TI85_H_
+
+#include "imagedev/snapquik.h"
+#include "video/t6a04.h"
+#include "sound/speaker.h"
+
+
+class ti85_state : public driver_device
+{
+public:
+ ti85_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_speaker(*this, SPEAKER_TAG),
+// m_serial(*this, "tiserial"),
+ m_nvram(*this, "nvram")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<device_t> m_speaker;
+ //optional_device<device_t> m_serial;
+ optional_shared_ptr<UINT8> m_nvram;
+
+ UINT8 m_LCD_memory_base;
+ UINT8 m_LCD_contrast;
+ UINT8 m_LCD_status;
+ UINT8 m_timer_interrupt_mask;
+ UINT8 m_timer_interrupt_status;
+ UINT8 m_ON_interrupt_mask;
+ UINT8 m_ON_interrupt_status;
+ UINT8 m_ON_pressed;
+ UINT8 m_ti8x_memory_page_1;
+ UINT8 m_ti8x_memory_page_2;
+ UINT8 m_LCD_mask;
+ UINT8 m_power_mode;
+ UINT8 m_keypad_mask;
+ UINT8 m_video_buffer_width;
+ UINT8 m_interrupt_speed;
+ UINT8 m_port4_bit0;
+ UINT8 m_ti81_port_7_data;
+ UINT8 *m_ti8x_ram;
+ UINT8 m_PCR;
+ UINT8 m_red_out;
+ UINT8 m_white_out;
+ UINT8 m_ti8x_port2;
+ UINT8 m_ti83p_port4;
+ int m_ti_video_memory_size;
+ int m_ti_screen_x_size;
+ int m_ti_screen_y_size;
+ int m_ti_number_of_frames;
+ UINT8 * m_frames;
+ UINT8 * m_bios;
+ DECLARE_READ8_MEMBER(ti85_port_0000_r);
+ DECLARE_READ8_MEMBER(ti8x_keypad_r);
+ DECLARE_READ8_MEMBER(ti85_port_0006_r);
+ DECLARE_READ8_MEMBER(ti8x_serial_r);
+ DECLARE_READ8_MEMBER(ti86_port_0005_r);
+ DECLARE_READ8_MEMBER(ti83_port_0000_r);
+ DECLARE_READ8_MEMBER(ti8x_plus_serial_r);
+ DECLARE_WRITE8_MEMBER(ti81_port_0007_w);
+ DECLARE_WRITE8_MEMBER(ti85_port_0000_w);
+ DECLARE_WRITE8_MEMBER(ti8x_keypad_w);
+ DECLARE_WRITE8_MEMBER(ti85_port_0002_w);
+ DECLARE_WRITE8_MEMBER(ti85_port_0003_w);
+ DECLARE_WRITE8_MEMBER(ti85_port_0004_w);
+ DECLARE_WRITE8_MEMBER(ti85_port_0005_w);
+ DECLARE_WRITE8_MEMBER(ti85_port_0006_w);
+ DECLARE_WRITE8_MEMBER(ti8x_serial_w);
+ DECLARE_WRITE8_MEMBER(ti86_port_0005_w);
+ DECLARE_WRITE8_MEMBER(ti86_port_0006_w);
+ DECLARE_WRITE8_MEMBER(ti82_port_0002_w);
+ DECLARE_WRITE8_MEMBER(ti83_port_0000_w);
+ DECLARE_WRITE8_MEMBER(ti83_port_0002_w);
+ DECLARE_WRITE8_MEMBER(ti83_port_0003_w);
+ DECLARE_WRITE8_MEMBER(ti8x_plus_serial_w);
+ DECLARE_WRITE8_MEMBER(ti83p_port_0002_w);
+ DECLARE_WRITE8_MEMBER(ti83p_port_0003_w);
+ DECLARE_WRITE8_MEMBER(ti83p_port_0004_w);
+ DECLARE_WRITE8_MEMBER(ti83p_port_0006_w);
+ DECLARE_WRITE8_MEMBER(ti83p_port_0007_w);
+ DECLARE_READ8_MEMBER( ti85_port_0002_r );
+ DECLARE_READ8_MEMBER( ti85_port_0003_r );
+ DECLARE_READ8_MEMBER( ti85_port_0004_r );
+ DECLARE_READ8_MEMBER( ti85_port_0005_r );
+ DECLARE_READ8_MEMBER( ti86_port_0006_r );
+ DECLARE_READ8_MEMBER( ti82_port_0002_r );
+ DECLARE_READ8_MEMBER( ti83_port_0002_r );
+ DECLARE_READ8_MEMBER( ti83_port_0003_r );
+ DECLARE_READ8_MEMBER( ti83p_port_0002_r );
+};
+
+
+/*----------- defined in machine/ti85.c -----------*/
+
+MACHINE_START( ti81 );
+MACHINE_START( ti83p );
+MACHINE_START( ti86 );
+MACHINE_RESET( ti85 );
+
+NVRAM_HANDLER( ti83p );
+NVRAM_HANDLER( ti86 );
+
+SNAPSHOT_LOAD( ti8x );
+
+
+/*----------- defined in video/ti85.c -----------*/
+
+VIDEO_START( ti85 );
+SCREEN_UPDATE_IND16( ti85 );
+PALETTE_INIT( ti85 );
+PALETTE_INIT( ti82 );
+
+
+#endif /* TI85_H_ */
diff --git a/src/mess/includes/ti89.h b/src/mess/includes/ti89.h
new file mode 100644
index 00000000000..98d70bb6993
--- /dev/null
+++ b/src/mess/includes/ti89.h
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ *
+ * includes/ti89.h
+ *
+ ****************************************************************************/
+
+#ifndef TI89_H_
+#define TI89_H_
+
+#include "machine/intelfsh.h"
+
+class ti68k_state : public driver_device
+{
+public:
+ ti68k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_flash(*this, "flash")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<sharp_unk128mbit_device> m_flash;
+
+ // hardware versions
+ enum { m_HW1=1, m_HW2, m_HW3, m_HW4 };
+
+ // HW specifications
+ UINT8 m_hw_version;
+ bool m_flash_mem;
+ UINT32 m_initial_pc;
+
+ // keyboard
+ UINT16 m_kb_mask;
+ UINT8 m_on_key;
+
+ // LCD
+ UINT8 m_lcd_on;
+ UINT32 m_lcd_base;
+ UINT16 m_lcd_width;
+ UINT16 m_lcd_height;
+ UINT16 m_lcd_contrast;
+
+ // I/O
+ UINT16 m_io_hw1[0x10];
+ UINT16 m_io_hw2[0x80];
+
+ // Timer
+ UINT8 m_timer_on;
+ UINT8 m_timer_val;
+ UINT16 m_timer_mask;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ UINT8 keypad_r (running_machine &machine);
+ DECLARE_WRITE16_MEMBER ( ti68k_io_w );
+ DECLARE_READ16_MEMBER ( ti68k_io_r );
+ DECLARE_WRITE16_MEMBER ( ti68k_io2_w );
+ DECLARE_READ16_MEMBER ( ti68k_io2_r );
+ DECLARE_WRITE16_MEMBER ( flash_w );
+ DECLARE_READ16_MEMBER ( flash_r );
+ UINT64 m_timer;
+};
+
+#endif // TI89_H_
diff --git a/src/mess/includes/tiki100.h b/src/mess/includes/tiki100.h
new file mode 100644
index 00000000000..026ef5e5557
--- /dev/null
+++ b/src/mess/includes/tiki100.h
@@ -0,0 +1,84 @@
+#pragma once
+
+#ifndef __TIKI100__
+#define __TIKI100__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ram.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dart.h"
+#include "machine/z80pio.h"
+#include "machine/wd17xx.h"
+#include "sound/ay8910.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define Z80DART_TAG "z80dart"
+#define Z80PIO_TAG "z80pio"
+#define Z80CTC_TAG "z80ctc"
+#define FD1797_TAG "fd1797"
+#define AY8912_TAG "ay8912"
+
+#define TIKI100_VIDEORAM_SIZE 0x8000
+#define TIKI100_VIDEORAM_MASK 0x7fff
+
+#define BANK_ROM 0
+#define BANK_RAM 1
+#define BANK_VIDEO_RAM 2
+
+class tiki100_state : public driver_device
+{
+public:
+ tiki100_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_fdc(*this, FD1797_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device> m_ctc;
+ required_device<device_t> m_fdc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ READ8_MEMBER( gfxram_r );
+ WRITE8_MEMBER( gfxram_w );
+ READ8_MEMBER( keyboard_r );
+ WRITE8_MEMBER( keyboard_w );
+ WRITE8_MEMBER( video_mode_w );
+ WRITE8_MEMBER( palette_w );
+ WRITE8_MEMBER( system_w );
+ WRITE_LINE_MEMBER( ctc_z1_w );
+ WRITE8_MEMBER( video_scroll_w );
+
+ void bankswitch();
+
+ /* memory state */
+ int m_rome;
+ int m_vire;
+
+ /* video state */
+ UINT8 *m_video_ram;
+ UINT8 m_scroll;
+ UINT8 m_mode;
+ UINT8 m_palette;
+
+ /* keyboard state */
+ int m_keylatch;
+};
+
+#endif
diff --git a/src/mess/includes/tmc1800.h b/src/mess/includes/tmc1800.h
new file mode 100644
index 00000000000..8344e3ec6e0
--- /dev/null
+++ b/src/mess/includes/tmc1800.h
@@ -0,0 +1,177 @@
+#pragma once
+
+#ifndef __TMC1800__
+#define __TMC1800__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+#include "machine/ram.h"
+#include "machine/rescap.h"
+#include "sound/beep.h"
+#include "sound/cdp1864.h"
+#include "video/cdp1861.h"
+
+#define TMC2000_COLORRAM_SIZE 0x200
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "cdp1802"
+#define CDP1861_TAG "cdp1861"
+#define CDP1864_TAG "m3"
+
+class tmc1800_state : public driver_device
+{
+public:
+ tmc1800_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_vdc(*this, CDP1861_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cdp1861_device> m_vdc;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( keylatch_w );
+ DECLARE_READ8_MEMBER( dispon_r );
+ DECLARE_WRITE8_MEMBER( dispoff_w );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+
+ /* keyboard state */
+ int m_keylatch; /* key latch */
+ DECLARE_DRIVER_INIT(tmc1800);
+};
+
+class osc1000b_state : public driver_device
+{
+public:
+ osc1000b_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( keylatch_w );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+
+ /* keyboard state */
+ int m_keylatch; /* key latch */
+};
+
+class tmc2000_state : public driver_device
+{
+public:
+ tmc2000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cti(*this, CDP1864_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cdp1864_device> m_cti;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_WRITE8_MEMBER( keylatch_w );
+ DECLARE_WRITE8_MEMBER( bankswitch_w );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_WRITE8_MEMBER( dma_w );
+ DECLARE_READ_LINE_MEMBER( rdata_r );
+ DECLARE_READ_LINE_MEMBER( bdata_r );
+ DECLARE_READ_LINE_MEMBER( gdata_r );
+ DECLARE_INPUT_CHANGED_MEMBER( run_pressed );
+
+ void bankswitch();
+
+ // memory
+ int m_rac;
+ int m_roc;
+
+ /* video state */
+ UINT8 *m_colorram; /* color memory */
+ UINT8 m_color;
+
+ /* keyboard state */
+ int m_keylatch; /* key latch */
+};
+
+class nano_state : public driver_device
+{
+public:
+ nano_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cti(*this, CDP1864_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cdp1864_device> m_cti;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ enum
+ {
+ TIMER_ID_EF4
+ };
+
+ DECLARE_WRITE8_MEMBER( keylatch_w );
+ DECLARE_WRITE8_MEMBER( bankswitch_w );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_INPUT_CHANGED_MEMBER( run_pressed );
+ DECLARE_INPUT_CHANGED_MEMBER( monitor_pressed );
+
+ /* keyboard state */
+ int m_keylatch; /* key latch */
+};
+
+/* ---------- defined in video/tmc1800.c ---------- */
+
+MACHINE_CONFIG_EXTERN( tmc1800_video );
+MACHINE_CONFIG_EXTERN( osc1000b_video );
+MACHINE_CONFIG_EXTERN( tmc2000_video );
+MACHINE_CONFIG_EXTERN( nano_video );
+
+#endif
diff --git a/src/mess/includes/tmc2000e.h b/src/mess/includes/tmc2000e.h
new file mode 100644
index 00000000000..83e516d1a61
--- /dev/null
+++ b/src/mess/includes/tmc2000e.h
@@ -0,0 +1,71 @@
+#pragma once
+
+#ifndef __TMC2000E__
+#define __TMC2000E__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "formats/basicdsk.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/printer.h"
+#include "machine/rescap.h"
+#include "machine/ram.h"
+#include "sound/cdp1864.h"
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "cdp1802"
+#define CDP1864_TAG "cdp1864"
+
+#define TMC2000E_COLORRAM_SIZE 0x100 // ???
+
+class tmc2000e_state : public driver_device
+{
+public:
+ tmc2000e_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_cti(*this, CDP1864_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ ,
+ m_colorram(*this, "colorram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cdp1864_device> m_cti;
+ required_device<cassette_image_device> m_cassette;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( vismac_r );
+ DECLARE_WRITE8_MEMBER( vismac_w );
+ DECLARE_READ8_MEMBER( floppy_r );
+ DECLARE_WRITE8_MEMBER( floppy_w );
+ DECLARE_READ8_MEMBER( ascii_keyboard_r );
+ DECLARE_READ8_MEMBER( io_r );
+ DECLARE_WRITE8_MEMBER( io_w );
+ DECLARE_WRITE8_MEMBER( io_select_w );
+ DECLARE_WRITE8_MEMBER( keyboard_latch_w );
+ DECLARE_READ_LINE_MEMBER( rdata_r );
+ DECLARE_READ_LINE_MEMBER( bdata_r );
+ DECLARE_READ_LINE_MEMBER( gdata_r );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_WRITE8_MEMBER( dma_w );
+
+ /* video state */
+ int m_cdp1864_efx; /* EFx */
+ required_shared_ptr<UINT8> m_colorram; /* color memory */
+ UINT8 m_color;
+
+ /* keyboard state */
+ int m_keylatch; /* key latch */
+ int m_reset; /* reset activated */
+};
+
+#endif
diff --git a/src/mess/includes/tmc600.h b/src/mess/includes/tmc600.h
new file mode 100644
index 00000000000..e4fa4e8c2f7
--- /dev/null
+++ b/src/mess/includes/tmc600.h
@@ -0,0 +1,75 @@
+#pragma once
+
+#ifndef __TMC600__
+#define __TMC600__
+
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "formats/basicdsk.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+#include "machine/ctronics.h"
+#include "machine/ram.h"
+#include "sound/cdp1869.h"
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "cdp1802"
+#define CDP1869_TAG "cdp1869"
+#define CENTRONICS_TAG "centronics"
+
+#define TMC600_PAGE_RAM_SIZE 0x400
+#define TMC600_PAGE_RAM_MASK 0x3ff
+
+class tmc600_state : public driver_device
+{
+public:
+ tmc600_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_vis(*this, CDP1869_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_page_ram(*this, "page_ram")
+ { }
+
+ required_device<cosmac_device> m_maincpu;
+ required_device<cdp1869_device> m_vis;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+
+ virtual void video_start();
+
+ DECLARE_WRITE8_MEMBER( keyboard_latch_w );
+ DECLARE_WRITE8_MEMBER( vismac_register_w );
+ DECLARE_WRITE8_MEMBER( vismac_data_w );
+ DECLARE_WRITE8_MEMBER( page_ram_w );
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+
+ UINT8 get_color(UINT16 pma);
+
+ // video state
+ int m_vismac_reg_latch; // video register latch
+ int m_vismac_color_latch; // color latch
+ int m_vismac_bkg_latch; // background color latch
+ int m_blink; // cursor blink
+
+ required_shared_ptr<UINT8> m_page_ram; // page memory
+ UINT8 *m_color_ram; // color memory
+ UINT8 *m_char_rom; // character generator ROM
+
+ // keyboard state
+ int m_keylatch; // key latch
+};
+
+// ---------- defined in video/tmc600.c ----------
+
+MACHINE_CONFIG_EXTERN( tmc600_video );
+
+#endif
diff --git a/src/mess/includes/trs80.h b/src/mess/includes/trs80.h
new file mode 100644
index 00000000000..acf050dc14a
--- /dev/null
+++ b/src/mess/includes/trs80.h
@@ -0,0 +1,145 @@
+/*****************************************************************************
+ *
+ * includes/trs80.h
+ *
+ ****************************************************************************/
+
+#ifndef TRS80_H_
+#define TRS80_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+#include "machine/ay31015.h"
+#include "machine/ctronics.h"
+#include "machine/wd17xx.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/snapquik.h"
+#include "formats/trs_cas.h"
+#include "formats/trs_cmd.h"
+#include "formats/trs_dsk.h"
+
+
+class trs80_state : public driver_device
+{
+public:
+ trs80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_printer(*this, "centronics"),
+ m_ay31015(*this, "tr1602"),
+ m_fdc(*this, "wd179x"),
+ m_speaker(*this, SPEAKER_TAG),
+ m_cass(*this, CASSETTE_TAG),
+ m_p_videoram(*this, "p_videoram")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ optional_device<centronics_device> m_printer;
+ optional_device<device_t> m_ay31015;
+ optional_device<device_t> m_fdc;
+ required_device<device_t> m_speaker;
+ required_device<cassette_image_device> m_cass;
+ DECLARE_WRITE8_MEMBER ( trs80_ff_w );
+ DECLARE_WRITE8_MEMBER ( lnw80_fe_w );
+ DECLARE_WRITE8_MEMBER ( sys80_fe_w );
+ DECLARE_WRITE8_MEMBER ( sys80_f8_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_ff_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_f4_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_ec_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_eb_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_ea_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_e9_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_e8_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_e4_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_e0_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4p_9c_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_90_w );
+ DECLARE_WRITE8_MEMBER ( trs80m4_84_w );
+ DECLARE_READ8_MEMBER ( lnw80_fe_r );
+ DECLARE_READ8_MEMBER ( trs80_ff_r );
+ DECLARE_READ8_MEMBER ( sys80_f9_r );
+ DECLARE_READ8_MEMBER ( trs80m4_ff_r );
+ DECLARE_READ8_MEMBER ( trs80m4_ec_r );
+ DECLARE_READ8_MEMBER ( trs80m4_eb_r );
+ DECLARE_READ8_MEMBER ( trs80m4_ea_r );
+ DECLARE_READ8_MEMBER ( trs80m4_e8_r );
+ DECLARE_READ8_MEMBER ( trs80m4_e4_r );
+ DECLARE_READ8_MEMBER ( trs80m4_e0_r );
+ DECLARE_READ8_MEMBER( trs80_irq_status_r );
+ DECLARE_READ8_MEMBER( trs80_printer_r );
+ DECLARE_WRITE8_MEMBER( trs80_printer_w );
+ DECLARE_WRITE8_MEMBER( trs80_cassunit_w );
+ DECLARE_WRITE8_MEMBER( trs80_motor_w );
+ DECLARE_READ8_MEMBER( trs80_keyboard_r );
+ DECLARE_WRITE8_MEMBER ( trs80m4_88_w );
+ DECLARE_READ8_MEMBER( trs80_videoram_r );
+ DECLARE_WRITE8_MEMBER( trs80_videoram_w );
+ DECLARE_READ8_MEMBER( trs80_gfxram_r );
+ DECLARE_WRITE8_MEMBER( trs80_gfxram_w );
+ DECLARE_READ8_MEMBER (trs80_wd179x_r);
+ const UINT8 *m_p_chargen;
+ optional_shared_ptr<UINT8> m_p_videoram;
+ UINT8 *m_p_gfxram;
+ UINT8 m_model4;
+ UINT8 m_mode;
+ UINT8 m_irq;
+ UINT8 m_mask;
+ UINT8 m_nmi_mask;
+ UINT8 m_port_ec;
+ UINT8 m_tape_unit;
+ UINT8 m_reg_load;
+ UINT8 m_nmi_data;
+#ifdef USE_TRACK
+ UINT8 m_track[4];
+#endif
+ UINT8 m_head;
+#ifdef USE_SECTOR
+ UINT8 m_sector[4];
+#endif
+ UINT8 m_cassette_data;
+ emu_timer *m_cassette_data_timer;
+ double m_old_cassette_val;
+ UINT16 m_start_address;
+ UINT8 m_crtc_reg;
+ UINT8 m_size_store;
+ DECLARE_DRIVER_INIT(trs80m4);
+ DECLARE_DRIVER_INIT(trs80l2);
+ DECLARE_DRIVER_INIT(trs80m4p);
+ DECLARE_DRIVER_INIT(lnw80);
+ DECLARE_DRIVER_INIT(trs80);
+};
+
+
+/*----------- defined in machine/trs80.c -----------*/
+
+extern const wd17xx_interface trs80_wd17xx_interface;
+
+MACHINE_START( trs80 );
+MACHINE_RESET( trs80 );
+MACHINE_RESET( trs80m4 );
+MACHINE_RESET( lnw80 );
+
+
+INTERRUPT_GEN( trs80_rtc_interrupt );
+INTERRUPT_GEN( trs80_fdc_interrupt );
+
+
+
+/*----------- defined in video/trs80.c -----------*/
+
+VIDEO_START( trs80 );
+SCREEN_UPDATE_IND16( trs80 );
+SCREEN_UPDATE_IND16( ht1080z );
+SCREEN_UPDATE_IND16( meritum );
+SCREEN_UPDATE_IND16( lnw80 );
+SCREEN_UPDATE_IND16( radionic );
+SCREEN_UPDATE_IND16( trs80m4 );
+
+
+PALETTE_INIT( lnw80 );
+
+
+#endif /* TRS80_H_ */
diff --git a/src/mess/includes/trs80m2.h b/src/mess/includes/trs80m2.h
new file mode 100644
index 00000000000..70f8397b836
--- /dev/null
+++ b/src/mess/includes/trs80m2.h
@@ -0,0 +1,137 @@
+#pragma once
+
+#ifndef __TRS80M2__
+#define __TRS80M2__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "cpu/mcs48/mcs48.h"
+#include "cpu/m68000/m68000.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ctronics.h"
+#include "machine/pic8259.h"
+#include "machine/ram.h"
+#include "machine/trs80m2kb.h"
+#include "machine/wd17xx.h"
+#include "machine/z80ctc.h"
+#include "machine/z80dma.h"
+#include "machine/z80pio.h"
+#include "machine/z80dart.h"
+#include "video/mc6845.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "u12"
+#define Z80CTC_TAG "u19"
+#define Z80DMA_TAG "u20"
+#define Z80PIO_TAG "u22"
+#define Z80SIO_TAG "u18"
+#define FD1791_TAG "u6"
+#define MC6845_TAG "u11"
+#define CENTRONICS_TAG "j2"
+#define M68000_TAG "m16_u22"
+#define AM9519A_TAG "m16_u11"
+
+class trs80m2_state : public driver_device
+{
+public:
+ trs80m2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_pio(*this, Z80PIO_TAG),
+ m_crtc(*this, MC6845_TAG),
+ m_fdc(*this, FD1791_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_floppy(*this, FLOPPY_0),
+ m_ram(*this, RAM_TAG),
+ m_kb(*this, TRS80M2_KEYBOARD_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80ctc_device>m_ctc;
+ required_device<z80pio_device> m_pio;
+ required_device<mc6845_device> m_crtc;
+ required_device<device_t> m_fdc;
+ required_device<centronics_device> m_centronics;
+ required_device<device_t> m_floppy;
+ required_device<ram_device> m_ram;
+ required_device<trs80m2_keyboard_device> m_kb;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+ DECLARE_WRITE8_MEMBER( drvslt_w );
+ DECLARE_WRITE8_MEMBER( rom_enable_w );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_READ8_MEMBER( rtc_r );
+ DECLARE_READ8_MEMBER( nmi_r );
+ DECLARE_WRITE8_MEMBER( nmi_w );
+ DECLARE_READ8_MEMBER( keyboard_busy_r );
+ DECLARE_READ8_MEMBER( keyboard_data_r );
+ DECLARE_WRITE8_MEMBER( keyboard_ctrl_w );
+ DECLARE_WRITE8_MEMBER( keyboard_latch_w );
+ DECLARE_READ8_MEMBER( fdc_r );
+ DECLARE_WRITE8_MEMBER( fdc_w );
+ DECLARE_WRITE_LINE_MEMBER( de_w );
+ DECLARE_WRITE_LINE_MEMBER( vsync_w );
+ DECLARE_READ8_MEMBER( pio_pa_r );
+ DECLARE_WRITE8_MEMBER( pio_pa_w );
+ DECLARE_WRITE_LINE_MEMBER( strobe_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
+ DECLARE_WRITE_LINE_MEMBER( kb_clock_w );
+
+ void scan_keyboard();
+
+ // memory state
+ int m_boot_rom;
+ int m_bank;
+ int m_msel;
+
+ // keyboard state
+ UINT8 m_key_latch;
+ UINT8 m_key_data;
+ int m_key_bit;
+ int m_kbclk;
+ int m_kbdata;
+ int m_kbirq;
+
+ // video state
+ UINT8 *m_video_ram;
+ UINT8 *m_char_rom;
+ int m_blnkvid;
+ int m_80_40_char_en;
+ int m_de;
+ int m_rtc_int;
+ int m_enable_rtc_int;
+};
+
+class trs80m16_state : public trs80m2_state
+{
+public:
+ trs80m16_state(const machine_config &mconfig, device_type type, const char *tag)
+ : trs80m2_state(mconfig, type, tag),
+ m_subcpu(*this, M68000_TAG),
+ m_pic(*this, AM9519A_TAG)
+ { }
+
+ required_device<cpu_device> m_subcpu;
+ required_device<device_t> m_pic;
+
+ virtual void machine_start();
+
+ DECLARE_WRITE8_MEMBER( ual_w );
+ DECLARE_WRITE8_MEMBER( tcl_w );
+
+ UINT16 m_ual;
+ UINT8 m_limit[2];
+ UINT8 m_offset[2];
+};
+
+#endif
diff --git a/src/mess/includes/tsispch.h b/src/mess/includes/tsispch.h
new file mode 100644
index 00000000000..1437cb2b36e
--- /dev/null
+++ b/src/mess/includes/tsispch.h
@@ -0,0 +1,49 @@
+/***************************************************************************
+
+ tsispch.h
+
+****************************************************************************/
+
+#pragma once
+
+#ifndef _TSISPCH_H_
+#define _TSISPCH_H_
+
+#include "machine/terminal.h"
+
+class tsispch_state : public driver_device
+{
+public:
+ tsispch_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_dsp(*this, "dsp"),
+ m_terminal(*this, TERMINAL_TAG),
+ m_uart(*this, "i8251a_u15"),
+ m_pic(*this, "pic8259")
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_dsp;
+ required_device<device_t> m_terminal;
+ required_device<device_t> m_uart;
+ required_device<device_t> m_pic;
+
+ UINT8 m_infifo[32]; // input fifo
+ UINT8 m_infifo_tail_ptr; // " tail
+ UINT8 m_infifo_head_ptr; // " head
+ UINT8 m_paramReg; // status leds and resets and etc
+
+ virtual void machine_reset();
+ DECLARE_WRITE8_MEMBER(i8251_rxd);
+ DECLARE_READ8_MEMBER(dsw_r);
+ DECLARE_WRITE8_MEMBER(peripheral_w);
+ DECLARE_READ16_MEMBER(dsp_data_r);
+ DECLARE_WRITE16_MEMBER(dsp_data_w);
+ DECLARE_READ16_MEMBER(dsp_status_r);
+ DECLARE_WRITE16_MEMBER(dsp_status_w);
+ DECLARE_DRIVER_INIT(prose2k);
+};
+
+
+#endif // _TSISPCH_H_
diff --git a/src/mess/includes/tvc.h b/src/mess/includes/tvc.h
new file mode 100644
index 00000000000..f32bbace7f8
--- /dev/null
+++ b/src/mess/includes/tvc.h
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ *
+ * includes/tvc.h
+ *
+ ****************************************************************************/
+
+#pragma once
+
+#ifndef TVC_H_
+#define TVC_H_
+
+#include "cpu/z80/z80.h"
+#include "video/mc6845.h"
+#include "machine/ram.h"
+#include "machine/ctronics.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+#include "formats/tvc_cas.h"
+
+#include "machine/tvcexp.h"
+#include "machine/tvc_hbf.h"
+
+#define TVC_RAM_BANK 1
+#define TVC_ROM_BANK 2
+
+#define CENTRONICS_TAG "centronics"
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> tvc_sound_interface
+
+struct tvc_sound_interface
+{
+ devcb_write_line m_sndint_cb;
+};
+
+// ======================> tvc_sound_device
+
+class tvc_sound_device : public device_t,
+ public device_sound_interface,
+ public tvc_sound_interface
+{
+public:
+ // construction/destruction
+ tvc_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ DECLARE_WRITE8_MEMBER(write);
+ void reset_divider();
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_reset();
+ virtual void device_config_complete();
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+private:
+ static const device_timer_id TIMER_SNDINT = 0;
+
+ sound_stream * m_stream;
+ int m_freq;
+ int m_enabled;
+ int m_volume;
+ int m_incr;
+ int m_signal;
+ UINT8 m_ports[3];
+ emu_timer * m_sndint_timer;
+ devcb_resolved_write_line m_sndint_func;
+};
+
+
+// ======================> tvc_state
+
+class tvc_state : public driver_device
+{
+public:
+ tvc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ram(*this, RAM_TAG),
+ m_sound(*this, "custom"),
+ m_cassette(*this, CASSETTE_TAG),
+ m_centronics(*this, CENTRONICS_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+ required_device<tvc_sound_device> m_sound;
+ required_device<cassette_image_device> m_cassette;
+ required_device<centronics_device> m_centronics;
+
+ void machine_start();
+ void machine_reset();
+
+ void tvc_set_mem_page(UINT8 data);
+ DECLARE_WRITE8_MEMBER(tvc_bank_w);
+ DECLARE_WRITE8_MEMBER(tvc_vram_bank_w);
+ DECLARE_WRITE8_MEMBER(tvc_palette_w);
+ DECLARE_WRITE8_MEMBER(tvc_keyboard_w);
+ DECLARE_READ8_MEMBER(tvc_keyboard_r);
+ DECLARE_READ8_MEMBER(tvc_int_state_r);
+ DECLARE_WRITE8_MEMBER(tvc_flipflop_w);
+ DECLARE_WRITE8_MEMBER(tvc_border_color_w);
+ DECLARE_WRITE8_MEMBER(tvc_sound_w);
+ DECLARE_WRITE8_MEMBER(tvc_cassette_w);
+ DECLARE_READ8_MEMBER(tvc_5b_r);
+ DECLARE_WRITE_LINE_MEMBER(tvc_int_ff_set);
+ DECLARE_WRITE_LINE_MEMBER(tvc_centronics_ack);
+
+ // expansions
+ DECLARE_WRITE8_MEMBER(tvc_expansion_w);
+ DECLARE_READ8_MEMBER(tvc_expansion_r);
+ DECLARE_READ8_MEMBER(tvc_exp_id_r);
+ DECLARE_WRITE8_MEMBER(tvc_expint_ack_w);
+
+ tvcexp_slot_device * m_expansions[4];
+ UINT8 m_video_mode;
+ UINT8 m_keyline;
+ UINT8 m_active_slot;
+ UINT8 m_int_flipflop;
+ UINT8 m_col[4];
+ UINT8 m_bank_type[4];
+ UINT8 m_bank;
+ UINT8 m_vram_bank;
+ UINT8 m_cassette_ff;
+ UINT8 m_centronics_ff;
+};
+
+
+// device type definition
+extern const device_type TVC_SOUND;
+
+#endif /* TVC_H_ */
diff --git a/src/mess/includes/tx0.h b/src/mess/includes/tx0.h
new file mode 100644
index 00000000000..f319e60720d
--- /dev/null
+++ b/src/mess/includes/tx0.h
@@ -0,0 +1,277 @@
+/*****************************************************************************
+ *
+ * includes/tx0.h
+ *
+ ****************************************************************************/
+
+#ifndef TX0_H_
+#define TX0_H_
+
+enum state_t
+{
+ MTS_UNSELECTED,
+ MTS_SELECTING,
+ MTS_SELECTED,
+ MTS_UNSELECTING
+};
+
+enum backspace_state_t
+{
+ MTBSS_STATE0,
+ MTBSS_STATE1,
+ MTBSS_STATE2,
+ MTBSS_STATE3,
+ MTBSS_STATE4,
+ MTBSS_STATE5,
+ MTBSS_STATE6
+};
+
+enum state_2_t
+{
+ MTRDS_STATE0,
+ MTRDS_STATE1,
+ MTRDS_STATE2,
+ MTRDS_STATE3,
+ MTRDS_STATE4,
+ MTRDS_STATE5,
+ MTRDS_STATE6
+};
+
+enum state_3_t
+{
+ MTWTS_STATE0,
+ MTWTS_STATE1,
+ MTWTS_STATE2,
+ MTWTS_STATE3
+};
+
+enum irg_pos_t
+{
+ MTIRGP_START,
+ MTIRGP_ENDMINUS1,
+ MTIRGP_END
+};
+
+
+
+/* tape reader registers */
+typedef struct tape_reader_t
+{
+ device_image_interface *fd; /* file descriptor of tape image */
+
+ int motor_on; /* 1-bit reader motor on */
+
+ int rcl; /* 1-bit reader clutch */
+ int rc; /* 2-bit reader counter */
+
+ emu_timer *timer; /* timer to simulate reader timing */
+} tape_reader_t;
+
+
+
+/* tape puncher registers */
+typedef struct tape_puncher_t
+{
+ device_image_interface *fd; /* file descriptor of tape image */
+
+ emu_timer *timer; /* timer to generate completion pulses */
+} tape_puncher_t;
+
+
+
+/* typewriter registers */
+typedef struct typewriter_t
+{
+ device_image_interface *fd; /* file descriptor of output image */
+
+ emu_timer *prt_timer;/* timer to generate completion pulses */
+} typewriter_t;
+
+
+/* magnetic tape unit registers */
+typedef struct magtape_t
+{
+ device_image_interface *img; /* image descriptor */
+
+ state_t state;
+
+ int command;
+ int binary_flag;
+
+ union
+ {
+ backspace_state_t backspace_state;
+ struct
+ {
+ state_2_t state;
+ int space_flag;
+ } read;
+ struct
+ {
+ state_3_t state;
+ int counter;
+ } write;
+ } u;
+
+ int sel_pending;
+ int cpy_pending;
+
+ irg_pos_t irg_pos; /* position relative to inter-record gap */
+
+ int long_parity;
+
+ emu_timer *timer; /* timer to simulate reader timing */
+} magtape_t;
+
+
+class tx0_state : public driver_device
+{
+public:
+ tx0_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ tape_reader_t m_tape_reader;
+ tape_puncher_t m_tape_puncher;
+ typewriter_t m_typewriter;
+ emu_timer *m_dis_timer;
+ magtape_t m_magtape;
+ int m_old_typewriter_keys[4];
+ int m_old_control_keys;
+ int m_old_tsr_keys;
+ int m_tsr_index;
+ int m_typewriter_color;
+ bitmap_ind16 m_panel_bitmap;
+ bitmap_ind16 m_typewriter_bitmap;
+ int m_pos;
+ int m_case_shift;
+ device_t *m_crt;
+ DECLARE_DRIVER_INIT(tx0);
+};
+
+
+/*----------- defined in video/tx0.c -----------*/
+
+VIDEO_START( tx0 );
+SCREEN_VBLANK( tx0 );
+SCREEN_UPDATE_IND16( tx0 );
+
+void tx0_plot(running_machine &machine, int x, int y);
+void tx0_typewriter_drawchar(running_machine &machine, int character);
+
+/* defines for each bit and mask in input port "CSW" */
+enum
+{
+ /* bit numbers */
+ tx0_control_bit = 0,
+
+ tx0_stop_c0_bit = 1,
+ tx0_stop_c1_bit = 2,
+ tx0_gbl_cm_sel_bit = 3,
+ tx0_stop_bit = 4,
+ tx0_restart_bit = 5,
+ tx0_read_in_bit = 6,
+
+ tx0_toggle_dn_bit = 12,
+ tx0_toggle_up_bit = 13,
+ tx0_cm_sel_bit = 14,
+ tx0_lr_sel_bit = 15,
+
+ /* masks */
+ tx0_control = (1 << tx0_control_bit),
+
+ tx0_stop_cyc0 = (1 << tx0_stop_c0_bit),
+ tx0_stop_cyc1 = (1 << tx0_stop_c1_bit),
+ tx0_gbl_cm_sel = (1 << tx0_gbl_cm_sel_bit),
+ tx0_stop = (1 << tx0_stop_bit),
+ tx0_restart = (1 << tx0_restart_bit),
+ tx0_read_in = (1 << tx0_read_in_bit),
+
+ tx0_toggle_dn = (1 << tx0_toggle_dn_bit),
+ tx0_toggle_up = (1 << tx0_toggle_up_bit),
+ tx0_cm_sel = (1 << tx0_cm_sel_bit),
+ tx0_lr_sel = (1 << tx0_lr_sel_bit)
+};
+
+/* defines for our font */
+enum
+{
+ tx0_charnum = /*96*/128, /* ASCII set + xx special characters */
+ /* for whatever reason, 96 breaks some characters */
+
+ tx0_fontdata_size = 8 * tx0_charnum
+};
+
+enum
+{
+ /* size and position of crt window */
+ crt_window_width = /*511*/512,
+ crt_window_height = /*511*/512,
+ crt_window_offset_x = 0,
+ crt_window_offset_y = 0,
+ /* size and position of operator control panel window */
+ panel_window_width = 272,
+ panel_window_height = 264,
+ panel_window_offset_x = crt_window_width,
+ panel_window_offset_y = 0,
+ /* size and position of typewriter window */
+ typewriter_window_width = 640,
+ typewriter_window_height = 160,
+ typewriter_window_offset_x = 0,
+ typewriter_window_offset_y = crt_window_height
+};
+
+enum
+{
+ total_width = crt_window_width + panel_window_width,
+ total_height = crt_window_height + typewriter_window_height,
+
+ /* respect 4:3 aspect ratio to keep pixels square */
+ virtual_width_1 = ((total_width+3)/4)*4,
+ virtual_height_1 = ((total_height+2)/3)*3,
+ virtual_width_2 = virtual_height_1*4/3,
+ virtual_height_2 = virtual_width_1*3/4,
+ virtual_width = (virtual_width_1 > virtual_width_2) ? virtual_width_1 : virtual_width_2,
+ virtual_height = (virtual_height_1 > virtual_height_2) ? virtual_height_1 : virtual_height_2
+};
+
+enum
+{ /* refresh rate in Hz: can be changed at will */
+ refresh_rate = 60
+};
+
+/* Color codes */
+enum
+{
+ /* first pen_crt_num_levels colors used for CRT (with remanence) */
+ pen_crt_num_levels = 69,
+ pen_crt_max_intensity = pen_crt_num_levels-1,
+
+ /* next colors used for control panel and typewriter */
+ pen_black = pen_crt_num_levels,
+ pen_white,
+ pen_green,
+ pen_dk_green,
+ pen_red,
+ pen_lt_gray,
+
+ /* color constants for control panel */
+ pen_panel_bg = pen_black,
+ pen_panel_caption = pen_white,
+ color_panel_caption = 0,
+ pen_switch_nut = pen_lt_gray,
+ pen_switch_button = pen_white,
+ pen_lit_lamp = pen_green,
+ pen_unlit_lamp = pen_dk_green,
+
+ /* color constants for typewriter */
+ pen_typewriter_bg = pen_white,
+ color_typewriter_black = 1, /* palette 1 = black on white */
+ color_typewriter_red = 2, /* palette 2 = red on white */
+
+ /* color constants used for light pen */
+ pen_lightpen_nonpressed = pen_red,
+ pen_lightpen_pressed = pen_green
+};
+
+
+#endif /* TX0_H_ */
diff --git a/src/mess/includes/ut88.h b/src/mess/includes/ut88.h
new file mode 100644
index 00000000000..f78eb121e43
--- /dev/null
+++ b/src/mess/includes/ut88.h
@@ -0,0 +1,65 @@
+/*****************************************************************************
+ *
+ * includes/ut88.h
+ *
+ ****************************************************************************/
+
+#ifndef UT88_H_
+#define UT88_H_
+
+#include "emu.h"
+#include "cpu/i8085/i8085.h"
+#include "sound/dac.h"
+#include "sound/wave.h"
+#include "machine/i8255.h"
+#include "imagedev/cassette.h"
+
+
+class ut88_state : public driver_device
+{
+public:
+ ut88_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_cass(*this, CASSETTE_TAG),
+ m_ppi(*this, "ppi8255"),
+ m_dac(*this, "dac"),
+ m_p_videoram(*this, "p_videoram")
+ { }
+
+ required_device<cassette_image_device> m_cass;
+ optional_device<i8255_device> m_ppi;
+ optional_device<dac_device> m_dac;
+ DECLARE_READ8_MEMBER(ut88_keyboard_r);
+ DECLARE_WRITE8_MEMBER(ut88_keyboard_w);
+ DECLARE_WRITE8_MEMBER(ut88_sound_w);
+ DECLARE_READ8_MEMBER(ut88_tape_r);
+ DECLARE_READ8_MEMBER(ut88mini_keyboard_r);
+ DECLARE_WRITE8_MEMBER(ut88mini_write_led);
+ DECLARE_READ8_MEMBER(ut88_8255_portb_r);
+ DECLARE_READ8_MEMBER(ut88_8255_portc_r);
+ DECLARE_WRITE8_MEMBER(ut88_8255_porta_w);
+ optional_shared_ptr<UINT8> m_p_videoram;
+ int m_keyboard_mask;
+ int m_lcd_digit[6];
+ DECLARE_DRIVER_INIT(ut88);
+ DECLARE_DRIVER_INIT(ut88mini);
+};
+
+
+/*----------- defined in machine/ut88.c -----------*/
+
+extern const i8255_interface ut88_ppi8255_interface;
+
+extern MACHINE_RESET( ut88 );
+extern MACHINE_START( ut88mini );
+extern MACHINE_RESET( ut88mini );
+
+/*----------- defined in video/ut88.c -----------*/
+
+extern const gfx_layout ut88_charlayout;
+
+extern VIDEO_START( ut88 );
+extern SCREEN_UPDATE_IND16( ut88 );
+
+
+#endif /* UT88_H_ */
diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h
new file mode 100644
index 00000000000..a8fca63ffd0
--- /dev/null
+++ b/src/mess/includes/v1050.h
@@ -0,0 +1,167 @@
+#pragma once
+
+#ifndef __V1050__
+#define __V1050__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/m6502/m6502.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/harddriv.h"
+#include "formats/basicdsk.h"
+#include "machine/ctronics.h"
+#include "machine/i8214.h"
+#include "machine/i8251.h"
+#include "machine/i8255.h"
+#include "machine/msm58321.h"
+#include "machine/ram.h"
+#include "machine/scsibus.h"
+#include "machine/v1050kb.h"
+#include "machine/wd17xx.h"
+#include "video/mc6845.h"
+
+#define SCREEN_TAG "screen"
+
+#define Z80_TAG "u80"
+#define UPB8214_TAG "u38"
+#define I8255A_DISP_TAG "u79"
+#define I8255A_MISC_TAG "u10"
+#define I8255A_RTC_TAG "u36"
+#define I8251A_KB_TAG "u85"
+#define I8251A_SIO_TAG "u8"
+#define MSM58321RS_TAG "u26"
+#define MB8877_TAG "u13"
+#define FDC9216_TAG "u25"
+#define M6502_TAG "u76"
+#define I8255A_M6502_TAG "u101"
+#define H46505_TAG "u75"
+#define CENTRONICS_TAG "centronics"
+#define TIMER_KB_TAG "timer_kb"
+#define TIMER_SIO_TAG "timer_sio"
+#define TIMER_ACK_TAG "timer_ack"
+#define TIMER_RST_TAG "timer_rst"
+#define SASIBUS_TAG "sasi"
+
+#define V1050_VIDEORAM_SIZE 0x8000
+#define V1050_VIDEORAM_MASK 0x7fff
+
+#define INT_RS_232 0x01
+#define INT_WINCHESTER 0x02
+#define INT_KEYBOARD 0x04
+#define INT_FLOPPY 0x08
+#define INT_VSYNC 0x10
+#define INT_DISPLAY 0x20
+#define INT_EXPANSION_B 0x40
+#define INT_EXPANSION_A 0x80
+
+class v1050_state : public driver_device
+{
+public:
+ v1050_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_subcpu(*this, M6502_TAG),
+ m_pic(*this, UPB8214_TAG),
+ m_rtc(*this, MSM58321RS_TAG),
+ m_uart_kb(*this, I8251A_KB_TAG),
+ m_uart_sio(*this, I8251A_SIO_TAG),
+ m_fdc(*this, MB8877_TAG),
+ m_crtc(*this, H46505_TAG),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_timer_sio(*this, TIMER_SIO_TAG),
+ m_timer_ack(*this, TIMER_ACK_TAG),
+ m_timer_rst(*this, TIMER_RST_TAG),
+ m_sasibus(*this, SASIBUS_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_subcpu;
+ required_device<i8214_device> m_pic;
+ required_device<msm58321_device> m_rtc;
+ required_device<i8251_device> m_uart_kb;
+ required_device<i8251_device> m_uart_sio;
+ required_device<device_t> m_fdc;
+ required_device<mc6845_device> m_crtc;
+ required_device<centronics_device> m_centronics;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<timer_device> m_timer_sio;
+ required_device<timer_device> m_timer_ack;
+ required_device<timer_device> m_timer_rst;
+ required_device<device_t> m_sasibus;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+
+ DECLARE_READ8_MEMBER( kb_data_r );
+ DECLARE_READ8_MEMBER( kb_status_r );
+ DECLARE_WRITE8_MEMBER( v1050_i8214_w );
+ DECLARE_READ8_MEMBER( vint_clr_r );
+ DECLARE_WRITE8_MEMBER( vint_clr_w );
+ DECLARE_READ8_MEMBER( dint_clr_r );
+ DECLARE_WRITE8_MEMBER( dint_clr_w );
+ DECLARE_WRITE8_MEMBER( bank_w );
+ DECLARE_WRITE8_MEMBER( dint_w );
+ DECLARE_WRITE8_MEMBER( dvint_clr_w );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_WRITE8_MEMBER( keyboard_w );
+ DECLARE_WRITE8_MEMBER( p2_w );
+ DECLARE_WRITE8_MEMBER( misc_ppi_pa_w );
+ DECLARE_WRITE8_MEMBER( misc_ppi_pc_w );
+ DECLARE_WRITE8_MEMBER( rtc_ppi_pb_w );
+ DECLARE_READ8_MEMBER( rtc_ppi_pc_r );
+ DECLARE_WRITE8_MEMBER( rtc_ppi_pc_w );
+ DECLARE_WRITE_LINE_MEMBER( kb_rxrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( sio_rxrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( sio_txrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+ DECLARE_READ8_MEMBER( attr_r );
+ DECLARE_WRITE8_MEMBER( attr_w );
+ DECLARE_READ8_MEMBER( videoram_r );
+ DECLARE_WRITE8_MEMBER( videoram_w );
+ DECLARE_WRITE_LINE_MEMBER( crtc_vs_w );
+ DECLARE_READ8_MEMBER( sasi_status_r );
+ DECLARE_WRITE8_MEMBER( sasi_ctrl_w );
+
+ void bankswitch();
+ void set_interrupt(UINT8 mask, int state);
+ void scan_keyboard();
+
+ // interrupt state
+ UINT8 m_int_mask; // interrupt mask
+ UINT8 m_int_state; // interrupt status
+ int m_f_int_enb; // floppy interrupt enable
+
+ // keyboard state
+ UINT8 m_keylatch; // keyboard row select
+ UINT8 m_keydata;
+ int m_keyavail;
+
+ // serial state
+ int m_rxrdy; // receiver ready
+ int m_txrdy; // transmitter ready
+ int m_baud_sel; // baud select
+
+ // memory state
+ UINT8 m_bank; // bank register
+
+ // video state
+ required_shared_ptr<UINT8> m_video_ram; // video RAM
+ UINT8 *m_attr_ram; // attribute RAM
+ UINT8 m_attr; // attribute latch
+};
+
+//----------- defined in video/v1050.c -----------
+
+MACHINE_CONFIG_EXTERN( v1050_video );
+
+#endif
diff --git a/src/mess/includes/vc4000.h b/src/mess/includes/vc4000.h
new file mode 100644
index 00000000000..c8c44e0d025
--- /dev/null
+++ b/src/mess/includes/vc4000.h
@@ -0,0 +1,113 @@
+/*****************************************************************************
+ *
+ * includes/vc4000.h
+ *
+ ****************************************************************************/
+
+#ifndef VC4000_H_
+#define VC4000_H_
+
+#include "emu.h"
+#include "cpu/s2650/s2650.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/snapquik.h"
+#include "imagedev/cassette.h"
+#include "sound/wave.h"
+
+// define this to use digital inputs instead of the slow
+// autocentering analog mame joys
+#define ANALOG_HACK
+
+
+typedef struct
+{
+ UINT8 bitmap[10],x1,x2,y1,y2, res1, res2;
+} SPRITE_HELPER;
+
+typedef struct
+{
+ const SPRITE_HELPER *data;
+ int mask;
+ int state;
+ int delay;
+ int size;
+ int y;
+ UINT8 scolor;
+ int finished;
+ int finished_now;
+} SPRITE;
+
+typedef struct
+{
+ SPRITE sprites[4];
+ int line;
+ UINT8 sprite_collision;
+ UINT8 background_collision;
+ union
+ {
+ UINT8 data[0x100];
+ struct
+ {
+ SPRITE_HELPER sprites[3];
+ UINT8 res[0x10];
+ SPRITE_HELPER sprite4;
+ UINT8 res2[0x30];
+ UINT8 grid[20][2];
+ UINT8 grid_control[5];
+ UINT8 res3[0x13];
+ UINT8 sprite_sizes;
+ UINT8 sprite_colors[2];
+ UINT8 score_control;
+ UINT8 res4[2];
+ UINT8 background;
+ UINT8 sound;
+ UINT8 bcd[2];
+ UINT8 background_collision;
+ UINT8 sprite_collision;
+ } d;
+ } reg;
+} vc4000_video_t;
+
+class vc4000_state : public driver_device
+{
+public:
+ vc4000_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_cass(*this, CASSETTE_TAG)
+ { }
+
+ DECLARE_WRITE8_MEMBER(vc4000_sound_ctl);
+ DECLARE_READ8_MEMBER(vc4000_key_r);
+ DECLARE_READ8_MEMBER(vc4000_video_r);
+ DECLARE_WRITE8_MEMBER(vc4000_video_w);
+ DECLARE_READ8_MEMBER(vc4000_vsync_r);
+ DECLARE_READ8_MEMBER(elektor_cass_r);
+ DECLARE_WRITE8_MEMBER(elektor_cass_w);
+ vc4000_video_t m_video;
+ UINT8 m_sprite_collision[0x20];
+ UINT8 m_background_collision[0x20];
+ UINT8 m_joy1_x;
+ UINT8 m_joy1_y;
+ UINT8 m_joy2_x;
+ UINT8 m_joy2_y;
+ UINT8 m_objects[512];
+ UINT8 m_irq_pause;
+ bitmap_ind16 *m_bitmap;
+ optional_device<cassette_image_device> m_cass;
+};
+
+
+/*----------- defined in video/vc4000.c -----------*/
+
+extern INTERRUPT_GEN( vc4000_video_line );
+extern VIDEO_START( vc4000 );
+extern SCREEN_UPDATE_IND16( vc4000 );
+
+
+/*----------- defined in audio/vc4000.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(VC4000, vc4000_sound);
+void vc4000_soundport_w (device_t *device, int mode, int data);
+
+
+#endif /* VC4000_H_ */
diff --git a/src/mess/includes/vcs80.h b/src/mess/includes/vcs80.h
new file mode 100644
index 00000000000..836ebcc3f13
--- /dev/null
+++ b/src/mess/includes/vcs80.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#ifndef __VCS80__
+#define __VCS80__
+
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80pio.h"
+#include "machine/ram.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "z80"
+#define Z80PIO_TAG "z80pio"
+
+class vcs80_state : public driver_device
+{
+public:
+ vcs80_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_pio(*this, Z80PIO_TAG)
+ { }
+
+ required_device<z80pio_device> m_pio;
+
+ virtual void machine_start();
+
+ DECLARE_READ8_MEMBER( pio_r );
+ DECLARE_WRITE8_MEMBER( pio_w );
+ DECLARE_READ8_MEMBER( pio_pa_r );
+ DECLARE_WRITE8_MEMBER( pio_pb_w );
+
+ DECLARE_DIRECT_UPDATE_MEMBER(vcs80_direct_update_handler);
+ /* keyboard state */
+ int m_keylatch;
+ int m_keyclk;
+ DECLARE_DRIVER_INIT(vcs80);
+};
+
+#endif
diff --git a/src/mess/includes/vector06.h b/src/mess/includes/vector06.h
new file mode 100644
index 00000000000..84714a33993
--- /dev/null
+++ b/src/mess/includes/vector06.h
@@ -0,0 +1,82 @@
+/*****************************************************************************
+ *
+ * includes/vector06.h
+ *
+ ****************************************************************************/
+
+#ifndef VECTOR06_H_
+#define VECTOR06_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/i8085/i8085.h"
+#include "sound/wave.h"
+#include "machine/i8255.h"
+#include "machine/ram.h"
+#include "machine/wd17xx.h"
+#include "imagedev/cassette.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/flopdrv.h"
+#include "formats/basicdsk.h"
+
+
+class vector06_state : public driver_device
+{
+public:
+ vector06_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_cass(*this, CASSETTE_TAG),
+ m_fdc(*this, "wd1793"),
+ m_ppi(*this, "ppi8255"),
+ m_ppi2(*this, "ppi8255_2"),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_cass;
+ required_device<device_t> m_fdc;
+ required_device<i8255_device> m_ppi;
+ required_device<i8255_device> m_ppi2;
+ required_device<ram_device> m_ram;
+ DECLARE_READ8_MEMBER(vector06_8255_portb_r);
+ DECLARE_READ8_MEMBER(vector06_8255_portc_r);
+ DECLARE_WRITE8_MEMBER(vector06_8255_porta_w);
+ DECLARE_WRITE8_MEMBER(vector06_8255_portb_w);
+ DECLARE_WRITE8_MEMBER(vector06_color_set);
+ DECLARE_READ8_MEMBER(vector06_romdisk_portb_r);
+ DECLARE_WRITE8_MEMBER(vector06_romdisk_porta_w);
+ DECLARE_WRITE8_MEMBER(vector06_romdisk_portc_w);
+ DECLARE_READ8_MEMBER(vector06_8255_1_r);
+ DECLARE_WRITE8_MEMBER(vector06_8255_1_w);
+ DECLARE_READ8_MEMBER(vector06_8255_2_r);
+ DECLARE_WRITE8_MEMBER(vector06_8255_2_w);
+ DECLARE_WRITE8_MEMBER(vector06_disc_w);
+ UINT8 m_keyboard_mask;
+ UINT8 m_color_index;
+ UINT8 m_video_mode;
+ UINT16 m_romdisk_msb;
+ UINT8 m_romdisk_lsb;
+ UINT8 m_vblank_state;
+ void vector06_set_video_mode(int width);
+};
+
+
+/*----------- defined in machine/vector06.c -----------*/
+
+extern const i8255_interface vector06_ppi8255_interface;
+extern const i8255_interface vector06_ppi8255_2_interface;
+
+extern MACHINE_START( vector06 );
+extern MACHINE_RESET( vector06 );
+
+extern INTERRUPT_GEN( vector06_interrupt );
+
+
+/*----------- defined in video/vector06.c -----------*/
+
+extern PALETTE_INIT( vector06 );
+extern VIDEO_START( vector06 );
+extern SCREEN_UPDATE_IND16( vector06 );
+
+#endif /* VECTOR06_H_ */
diff --git a/src/mess/includes/vic10.h b/src/mess/includes/vic10.h
new file mode 100644
index 00000000000..d20ddcb2d0b
--- /dev/null
+++ b/src/mess/includes/vic10.h
@@ -0,0 +1,84 @@
+#pragma once
+
+#ifndef __VIC10__
+#define __VIC10__
+
+
+#include "emu.h"
+#include "includes/cbm.h"
+#include "machine/6526cia.h"
+#include "machine/cbmipt.h"
+#include "machine/ram.h"
+#include "sound/dac.h"
+#include "sound/sid6581.h"
+#include "video/mos6566.h"
+
+#define M6510_TAG "u3"
+#define MOS6566_TAG "u2"
+#define MOS6581_TAG "u6"
+#define MOS6526_TAG "u9"
+#define SCREEN_TAG "screen"
+#define TIMER_C1531_TAG "c1531"
+
+class vic10_state : public driver_device
+{
+public:
+ vic10_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6510_TAG),
+ m_vic(*this, MOS6566_TAG),
+ m_sid(*this, MOS6581_TAG),
+ m_cia(*this, MOS6526_TAG),
+ m_exp(*this, VIC10_EXPANSION_SLOT_TAG),
+ m_ram(*this, RAM_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_cassette_timer(*this, TIMER_C1531_TAG),
+ m_cia_irq(CLEAR_LINE),
+ m_vic_irq(CLEAR_LINE),
+ m_exp_irq(CLEAR_LINE)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<mos6566_device> m_vic;
+ required_device<device_t> m_sid;
+ required_device<mos6526_device> m_cia;
+ required_device<vic10_expansion_slot_device> m_exp;
+ required_device<ram_device> m_ram;
+ optional_device<cassette_image_device> m_cassette;
+ optional_device<timer_device> m_cassette_timer;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void check_interrupts();
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ DECLARE_WRITE_LINE_MEMBER( vic_irq_w );
+ DECLARE_READ8_MEMBER( vic_videoram_r );
+ DECLARE_READ8_MEMBER( vic_colorram_r );
+ DECLARE_READ8_MEMBER( vic_lightpen_x_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_y_cb );
+ DECLARE_READ8_MEMBER( vic_lightpen_button_cb );
+ DECLARE_READ8_MEMBER( vic_rdy_cb );
+ DECLARE_WRITE_LINE_MEMBER( cia_irq_w );
+ DECLARE_READ8_MEMBER( cia_pa_r );
+ DECLARE_READ8_MEMBER( cia_pb_r );
+ DECLARE_WRITE8_MEMBER( cia_pb_w );
+ DECLARE_READ8_MEMBER( cpu_r );
+ DECLARE_WRITE8_MEMBER( cpu_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
+
+ // video state
+ UINT8 *m_color_ram;
+
+ // interrupt state
+ int m_cia_irq;
+ int m_vic_irq;
+ int m_exp_irq;
+};
+
+
+
+#endif
diff --git a/src/mess/includes/vic20.h b/src/mess/includes/vic20.h
new file mode 100644
index 00000000000..15ea8953593
--- /dev/null
+++ b/src/mess/includes/vic20.h
@@ -0,0 +1,96 @@
+#pragma once
+
+#ifndef __VIC20__
+#define __VIC20__
+
+
+#include "emu.h"
+#include "includes/cbm.h"
+#include "formats/cbm_snqk.h"
+#include "cpu/m6502/m6502.h"
+#include "imagedev/cartslot.h"
+#include "machine/6522via.h"
+#include "machine/cbmiec.h"
+#include "machine/cbmipt.h"
+#include "machine/ieee488.h"
+#include "machine/ram.h"
+#include "machine/vcsctrl.h"
+#include "machine/vic20exp.h"
+#include "machine/vic20user.h"
+#include "sound/dac.h"
+#include "sound/mos6560.h"
+
+#define M6502_TAG "ue10"
+#define M6522_0_TAG "uab3"
+#define M6522_1_TAG "uab1"
+#define M6560_TAG "ub7"
+#define M6561_TAG "ub7"
+#define IEC_TAG "iec"
+#define TIMER_C1530_TAG "c1530"
+#define SCREEN_TAG "screen"
+#define CONTROL1_TAG "joy1"
+#define CONTROL2_TAG "joy2"
+
+class vic20_state : public driver_device
+{
+public:
+ vic20_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, M6502_TAG),
+ m_via0(*this, M6522_0_TAG),
+ m_via1(*this, M6522_1_TAG),
+ m_vic(*this, M6560_TAG),
+ m_iec(*this, CBM_IEC_TAG),
+ m_joy1(*this, CONTROL1_TAG),
+ m_joy2(*this, CONTROL2_TAG),
+ m_exp(*this, VIC20_EXPANSION_SLOT_TAG),
+ m_user(*this, VIC20_USER_PORT_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_ram(*this, RAM_TAG),
+ m_cassette_timer(*this, TIMER_C1530_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<via6522_device> m_via0;
+ required_device<via6522_device> m_via1;
+ required_device<device_t> m_vic;
+ required_device<cbm_iec_device> m_iec;
+ required_device<vcs_control_port_device> m_joy1;
+ required_device<vcs_control_port_device> m_joy2;
+ required_device<vic20_expansion_slot_device> m_exp;
+ required_device<vic20_user_port_device> m_user;
+ required_device<cassette_image_device> m_cassette;
+ required_device<ram_device> m_ram;
+ required_device<timer_device> m_cassette_timer;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+
+ DECLARE_READ8_MEMBER( via0_pa_r );
+ DECLARE_WRITE8_MEMBER( via0_pa_w );
+ DECLARE_WRITE_LINE_MEMBER( via0_ca2_w );
+
+ DECLARE_READ8_MEMBER( via1_pa_r );
+ DECLARE_READ8_MEMBER( via1_pb_r );
+ DECLARE_WRITE8_MEMBER( via1_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( via1_ca2_w );
+ DECLARE_WRITE_LINE_MEMBER( via1_cb2_w );
+
+ DECLARE_WRITE_LINE_MEMBER( exp_reset_w );
+
+ // memory state
+ UINT8 *m_basic;
+ UINT8 *m_kernal;
+ UINT8 *m_charom;
+
+ // video state
+ UINT8 *m_color_ram;
+
+ // keyboard state
+ int m_key_col;
+};
+
+#endif
diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h
new file mode 100644
index 00000000000..75d85c0c31f
--- /dev/null
+++ b/src/mess/includes/victor9k.h
@@ -0,0 +1,130 @@
+#pragma once
+
+#ifndef __VICTOR9K__
+#define __VICTOR9K__
+
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "cpu/mcs48/mcs48.h"
+#include "imagedev/flopdrv.h"
+#include "machine/ram.h"
+#include "machine/ctronics.h"
+#include "machine/6522via.h"
+#include "machine/ieee488.h"
+#include "machine/mc6852.h"
+#include "machine/pit8253.h"
+#include "machine/pic8259.h"
+#include "machine/upd7201.h"
+#include "machine/victor9kb.h"
+#include "sound/hc55516.h"
+#include "video/mc6845.h"
+
+#define SCREEN_TAG "screen"
+#define I8088_TAG "8l"
+#define I8048_TAG "5d"
+#define I8253_TAG "13h"
+#define I8259A_TAG "7l"
+#define UPD7201_TAG "16e"
+#define HD46505S_TAG "11a"
+#define MC6852_TAG "13b"
+#define HC55516_TAG "1m"
+#define M6522_1_TAG "m6522_1"
+#define M6522_2_TAG "m6522_2"
+#define M6522_3_TAG "m6522_3"
+#define M6522_4_TAG "m6522_4"
+#define M6522_5_TAG "m6522_5"
+#define M6522_6_TAG "m6522_6"
+#define CENTRONICS_TAG "centronics"
+
+class victor9k_state : public driver_device
+{
+public:
+ victor9k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8088_TAG),
+ m_fdc_cpu(*this, I8048_TAG),
+ m_ieee488(*this, IEEE488_TAG),
+ m_pic(*this, I8259A_TAG),
+ m_ssda(*this, MC6852_TAG),
+ m_via1(*this, M6522_1_TAG),
+ m_via2(*this, M6522_2_TAG),
+ m_cvsd(*this, HC55516_TAG),
+ m_crtc(*this, HD46505S_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_kb(*this, VICTOR9K_KEYBOARD_TAG)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cpu_device> m_fdc_cpu;
+ required_device<ieee488_device> m_ieee488;
+ required_device<device_t> m_pic;
+ required_device<mc6852_device> m_ssda;
+ required_device<via6522_device> m_via1;
+ required_device<via6522_device> m_via2;
+ required_device<device_t> m_cvsd;
+ required_device<mc6845_device> m_crtc;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+ required_device<victor9k_keyboard_device> m_kb;
+
+ virtual void machine_start();
+
+ DECLARE_WRITE_LINE_MEMBER( ssda_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via1_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via2_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via3_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via4_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via5_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( via6_irq_w );
+ DECLARE_WRITE8_MEMBER( via1_pa_w );
+ DECLARE_READ8_MEMBER( via1_pb_r );
+ DECLARE_WRITE8_MEMBER( via1_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( codec_vol_w );
+ DECLARE_READ8_MEMBER( via2_pa_r );
+ DECLARE_WRITE8_MEMBER( via2_pa_w );
+ DECLARE_WRITE8_MEMBER( via2_pb_w );
+ DECLARE_READ8_MEMBER( via3_pa_r );
+ DECLARE_READ8_MEMBER( via3_pb_r );
+ DECLARE_WRITE8_MEMBER( via3_pa_w );
+ DECLARE_WRITE8_MEMBER( via3_pb_w );
+ DECLARE_WRITE8_MEMBER( via4_pa_w );
+ DECLARE_WRITE8_MEMBER( via4_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( mode_w );
+ DECLARE_READ8_MEMBER( via5_pa_r );
+ DECLARE_WRITE8_MEMBER( via5_pb_w );
+ DECLARE_READ8_MEMBER( via6_pa_r );
+ DECLARE_READ8_MEMBER( via6_pb_r );
+ DECLARE_WRITE8_MEMBER( via6_pa_w );
+ DECLARE_WRITE8_MEMBER( via6_pb_w );
+ DECLARE_WRITE_LINE_MEMBER( drw_w );
+ DECLARE_WRITE_LINE_MEMBER( erase_w );
+ DECLARE_WRITE_LINE_MEMBER( kbrdy_w );
+
+ /* video state */
+ required_shared_ptr<UINT8> m_video_ram;
+ int m_brt;
+ int m_cont;
+
+ /* interrupts */
+ int m_via1_irq;
+ int m_via2_irq;
+ int m_via3_irq;
+ int m_via4_irq;
+ int m_via5_irq;
+ int m_via6_irq;
+ int m_ssda_irq;
+
+ /* floppy state */
+ int m_lms[2]; /* motor speed */
+ int m_st[2]; /* stepper phase */
+ int m_se[2]; /* stepper enable */
+ int m_drive; /* selected drive */
+ int m_side; /* selected side */
+};
+
+#endif
diff --git a/src/mess/includes/vidbrain.h b/src/mess/includes/vidbrain.h
new file mode 100644
index 00000000000..64428098393
--- /dev/null
+++ b/src/mess/includes/vidbrain.h
@@ -0,0 +1,87 @@
+#pragma once
+
+#ifndef __VIDBRAIN__
+#define __VIDBRAIN__
+
+#include "emu.h"
+#include "cpu/f8/f8.h"
+#include "imagedev/cartslot.h"
+#include "machine/f3853.h"
+#include "machine/ram.h"
+#include "machine/vidbrain_exp.h"
+#include "machine/vb_std.h"
+#include "machine/vb_money_minder.h"
+#include "machine/vb_timeshare.h"
+#include "sound/dac.h"
+#include "sound/discrete.h"
+#include "video/uv201.h"
+
+#define F3850_TAG "cd34"
+#define F3853_TAG "cd5"
+#define F3870_TAG "f3870"
+#define UV201_TAG "uv201"
+#define SCREEN_TAG "screen"
+#define DISCRETE_TAG "discrete"
+#define DAC_TAG "dac"
+
+class vidbrain_state : public driver_device
+{
+public:
+ vidbrain_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, F3850_TAG),
+ m_smi(*this, F3853_TAG),
+ m_uv(*this, UV201_TAG),
+ m_discrete(*this, DISCRETE_TAG),
+ m_dac(*this, DAC_TAG),
+ m_exp(*this, VIDEOBRAIN_EXPANSION_SLOT_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<f3853_device> m_smi;
+ required_device<uv201_device> m_uv;
+ required_device<device_t> m_discrete;
+ required_device<dac_device> m_dac;
+ required_device<videobrain_expansion_slot_device> m_exp;
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ enum
+ {
+ TIMER_JOYSTICK
+ };
+
+ DECLARE_WRITE8_MEMBER( keyboard_w );
+ DECLARE_READ8_MEMBER( keyboard_r );
+ DECLARE_WRITE8_MEMBER( sound_w );
+ DECLARE_WRITE8_MEMBER( f3853_w );
+ DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
+ DECLARE_WRITE_LINE_MEMBER( ext_int_w );
+ DECLARE_WRITE_LINE_MEMBER( hblank_w );
+
+ void interrupt_check();
+
+ // F3853 SMI state
+ UINT16 m_vector;
+ int m_int_enable;
+ int m_ext_int_latch;
+ int m_timer_int_latch;
+
+ // keyboard state
+ UINT8 m_keylatch;
+ int m_joy_enable;
+
+ // sound state
+ int m_sound_clk;
+
+ // timers
+ emu_timer *m_timer_ne555;
+};
+
+//----------- defined in video/vidbrain.c -----------
+
+MACHINE_CONFIG_EXTERN( vidbrain_video );
+
+#endif
diff --git a/src/mess/includes/vip.h b/src/mess/includes/vip.h
new file mode 100644
index 00000000000..b7533b36dd6
--- /dev/null
+++ b/src/mess/includes/vip.h
@@ -0,0 +1,113 @@
+#pragma once
+
+#ifndef __VIP__
+#define __VIP__
+
+#include "emu.h"
+#include "cpu/cosmac/cosmac.h"
+#include "imagedev/cassette.h"
+#include "imagedev/snapquik.h"
+#include "machine/ram.h"
+#include "machine/vip_byteio.h"
+#include "machine/vip_exp.h"
+#include "sound/discrete.h"
+#include "video/cdp1861.h"
+
+#define SCREEN_TAG "screen"
+#define CDP1802_TAG "u1"
+#define CDP1861_TAG "u2"
+#define DISCRETE_TAG "discrete"
+
+
+class vip_state : public driver_device
+{
+public:
+ vip_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, CDP1802_TAG),
+ m_vdc(*this, CDP1861_TAG),
+ m_cassette(*this, CASSETTE_TAG),
+ m_beeper(*this, DISCRETE_TAG),
+ m_byteio(*this, VIP_BYTEIO_PORT_TAG),
+ m_exp(*this, VIP_EXPANSION_SLOT_TAG),
+ m_ram(*this, RAM_TAG),
+ m_8000(1),
+ m_vdc_int(CLEAR_LINE),
+ m_vdc_dma_out(CLEAR_LINE),
+ m_vdc_ef1(CLEAR_LINE),
+ m_exp_int(CLEAR_LINE),
+ m_exp_dma_out(CLEAR_LINE),
+ m_exp_dma_in(CLEAR_LINE),
+ m_byteio_ef3(CLEAR_LINE),
+ m_byteio_ef4(CLEAR_LINE),
+ m_exp_ef1(CLEAR_LINE),
+ m_exp_ef3(CLEAR_LINE),
+ m_exp_ef4(CLEAR_LINE)
+ { }
+
+ required_device<cosmac_device> m_maincpu;
+ required_device<cdp1861_device> m_vdc;
+ required_device<cassette_image_device> m_cassette;
+ required_device<discrete_sound_device> m_beeper;
+ required_device<vip_byteio_port_device> m_byteio;
+ required_device<vip_expansion_slot_device> m_exp;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void update_interrupts();
+
+ DECLARE_READ8_MEMBER( read );
+ DECLARE_WRITE8_MEMBER( write );
+ DECLARE_READ8_MEMBER( io_r );
+ DECLARE_WRITE8_MEMBER( io_w );
+
+ DECLARE_READ_LINE_MEMBER( clear_r );
+ DECLARE_READ_LINE_MEMBER( ef1_r );
+ DECLARE_READ_LINE_MEMBER( ef2_r );
+ DECLARE_READ_LINE_MEMBER( ef3_r );
+ DECLARE_READ_LINE_MEMBER( ef4_r );
+ DECLARE_WRITE_LINE_MEMBER( q_w );
+ DECLARE_READ8_MEMBER( dma_r );
+ DECLARE_WRITE8_MEMBER( dma_w );
+
+ DECLARE_WRITE_LINE_MEMBER( vdc_int_w );
+ DECLARE_WRITE_LINE_MEMBER( vdc_dma_out_w );
+ DECLARE_WRITE_LINE_MEMBER( vdc_ef1_w );
+
+ DECLARE_WRITE_LINE_MEMBER( byteio_inst_w );
+
+ DECLARE_WRITE_LINE_MEMBER( exp_int_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_dma_out_w );
+ DECLARE_WRITE_LINE_MEMBER( exp_dma_in_w );
+
+ DECLARE_INPUT_CHANGED_MEMBER( reset_w );
+ DECLARE_INPUT_CHANGED_MEMBER( beeper_w );
+
+ // memory state
+ int m_8000;
+
+ // interrupt state
+ int m_vdc_int;
+ int m_vdc_dma_out;
+ int m_vdc_ef1;
+ int m_exp_int;
+ int m_exp_dma_out;
+ int m_exp_dma_in;
+ int m_byteio_ef3;
+ int m_byteio_ef4;
+ int m_exp_ef1;
+ int m_exp_ef3;
+ int m_exp_ef4;
+
+ // keyboard state
+ int m_keylatch;
+
+ // expansion state
+ UINT8 m_byteio_data;
+};
+
+#endif
diff --git a/src/mess/includes/vixen.h b/src/mess/includes/vixen.h
new file mode 100644
index 00000000000..b7cfcc3c9b9
--- /dev/null
+++ b/src/mess/includes/vixen.h
@@ -0,0 +1,109 @@
+#pragma once
+
+#ifndef __VIXEN__
+#define __VIXEN__
+
+#include "machine/ram.h"
+
+#define Z8400A_TAG "5f"
+#define FDC1797_TAG "5n"
+#define P8155H_TAG "2n"
+#define P8155H_IO_TAG "c7"
+#define P8251A_TAG "c3"
+#define DISCRETE_TAG "discrete"
+#define SCREEN_TAG "screen"
+
+class vixen_state : public driver_device
+{
+public:
+ vixen_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z8400A_TAG),
+ m_fdc(*this, FDC1797_TAG),
+ m_io_i8155(*this, P8155H_IO_TAG),
+ m_usart(*this, P8251A_TAG),
+ m_discrete(*this, DISCRETE_TAG),
+ m_ieee488(*this, IEEE488_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_fdint(0),
+ m_vsync(0),
+ m_srq(1),
+ m_atn(1),
+ m_rxrdy(0),
+ m_txrdy(0)
+ ,
+ m_video_ram(*this, "video_ram"){ }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<device_t> m_fdc;
+ required_device<device_t> m_io_i8155;
+ required_device<i8251_device> m_usart;
+ required_device<device_t> m_discrete;
+ required_device<ieee488_device> m_ieee488;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ void update_interrupt();
+
+ DECLARE_WRITE8_MEMBER( ctl_w );
+ DECLARE_READ8_MEMBER( status_r );
+ DECLARE_WRITE8_MEMBER( cmd_w );
+ DECLARE_READ8_MEMBER( ieee488_r );
+ DECLARE_READ8_MEMBER( port3_r );
+ DECLARE_READ8_MEMBER( i8155_pa_r );
+ DECLARE_WRITE8_MEMBER( i8155_pb_w );
+ DECLARE_WRITE8_MEMBER( i8155_pc_w );
+ DECLARE_WRITE8_MEMBER( io_i8155_pb_w );
+ DECLARE_WRITE8_MEMBER( io_i8155_pc_w );
+ DECLARE_WRITE_LINE_MEMBER( io_i8155_to_w );
+ DECLARE_WRITE_LINE_MEMBER( srq_w );
+ DECLARE_WRITE_LINE_MEMBER( atn_w );
+ DECLARE_WRITE_LINE_MEMBER( rxrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( txrdy_w );
+ DECLARE_WRITE_LINE_MEMBER( fdint_w );
+ DIRECT_UPDATE_MEMBER(vixen_direct_update_handler);
+
+ // memory state
+ int m_reset;
+
+ // keyboard state
+ UINT8 m_col;
+
+ // interrupt state
+ int m_cmd_d0;
+ int m_cmd_d1;
+
+ int m_fdint;
+ int m_vsync;
+
+ int m_srq;
+ int m_atn;
+ int m_enb_srq_int;
+ int m_enb_atn_int;
+
+ int m_rxrdy;
+ int m_txrdy;
+ int m_int_clk;
+ int m_enb_xmt_int;
+ int m_enb_rcv_int;
+ int m_enb_ring_int;
+
+ // video state
+ int m_alt;
+ int m_256;
+ required_shared_ptr<UINT8> m_video_ram;
+ const UINT8 *m_sync_rom;
+ const UINT8 *m_char_rom;
+ DECLARE_DRIVER_INIT(vixen);
+};
+
+#endif
diff --git a/src/mess/includes/vtech2.h b/src/mess/includes/vtech2.h
new file mode 100644
index 00000000000..f4e81716565
--- /dev/null
+++ b/src/mess/includes/vtech2.h
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ *
+ * includes/vtech2.h
+ *
+ ****************************************************************************/
+
+#ifndef VTECH2_H_
+#define VTECH2_H_
+
+
+#define TRKSIZE_FM 3172 /* size of a standard FM mode track */
+
+class vtech2_state : public driver_device
+{
+public:
+ vtech2_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT8 *m_videoram;
+ int m_laser_latch;
+ char m_laser_frame_message[64+1];
+ int m_laser_frame_time;
+ UINT8 *m_mem;
+ int m_laser_bank_mask;
+ int m_laser_bank[4];
+ int m_laser_video_bank;
+ UINT8 m_laser_track_x2[2];
+ UINT8 m_laser_fdc_status;
+ UINT8 m_laser_fdc_data[TRKSIZE_FM];
+ int m_laser_data;
+ int m_laser_fdc_edge;
+ int m_laser_fdc_bits;
+ int m_laser_drive;
+ int m_laser_fdc_start;
+ int m_laser_fdc_write;
+ int m_laser_fdc_offs;
+ int m_laser_fdc_latch;
+ int m_level_old;
+ int m_cassette_bit;
+ int m_row_a;
+ int m_row_b;
+ int m_row_c;
+ int m_row_d;
+ int m_laser_bg_mode;
+ int m_laser_two_color;
+ DECLARE_WRITE8_MEMBER(laser_bank_select_w);
+ DECLARE_WRITE8_MEMBER(laser_fdc_w);
+ DECLARE_WRITE8_MEMBER(laser_bg_mode_w);
+ DECLARE_WRITE8_MEMBER(laser_two_color_w);
+ DECLARE_READ8_MEMBER(laser_fdc_r);
+ DECLARE_DRIVER_INIT(laser);
+};
+
+
+/*----------- defined in machine/vtech2.c -----------*/
+
+MACHINE_RESET( laser350 );
+MACHINE_RESET( laser500 );
+MACHINE_RESET( laser700 );
+
+DEVICE_IMAGE_LOAD( laser_cart );
+DEVICE_IMAGE_UNLOAD( laser_cart );
+
+
+
+/*----------- defined in video/vtech2.c -----------*/
+
+extern VIDEO_START( laser );
+extern SCREEN_UPDATE_IND16( laser );
+
+
+#endif /* VTECH2_H_ */
diff --git a/src/mess/includes/wangpc.h b/src/mess/includes/wangpc.h
new file mode 100644
index 00000000000..fd6eeef5467
--- /dev/null
+++ b/src/mess/includes/wangpc.h
@@ -0,0 +1,200 @@
+#pragma once
+
+#ifndef __WANGPC__
+#define __WANGPC__
+
+#include "emu.h"
+#include "cpu/i86/i86.h"
+#include "formats/pc_dsk.h"
+#include "machine/am9517a.h"
+#include "machine/ctronics.h"
+#include "machine/i8255.h"
+#include "machine/im6402.h"
+#include "machine/pic8259.h"
+#include "machine/pit8253.h"
+#include "machine/ram.h"
+#include "machine/mc2661.h"
+#include "machine/upd765.h"
+#include "machine/wangpcbus.h"
+#include "machine/wangpckb.h"
+#include "machine/wangpc_emb.h"
+#include "machine/wangpc_lic.h"
+#include "machine/wangpc_lvc.h"
+#include "machine/wangpc_mcc.h"
+#include "machine/wangpc_mvc.h"
+#include "machine/wangpc_rtc.h"
+#include "machine/wangpc_tig.h"
+#include "machine/wangpc_wdc.h"
+
+#define I8086_TAG "i8086"
+#define AM9517A_TAG "am9517a"
+#define I8259A_TAG "i8259"
+#define I8255A_TAG "i8255a"
+#define I8253_TAG "i8253"
+#define IM6402_TAG "im6402"
+#define SCN2661_TAG "scn2661"
+#define UPD765_TAG "upd765"
+#define CENTRONICS_TAG "centronics"
+
+class wangpc_state : public driver_device
+{
+public:
+ // constructor
+ wangpc_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, I8086_TAG),
+ m_dmac(*this, AM9517A_TAG),
+ m_pic(*this, I8259A_TAG),
+ m_ppi(*this, I8255A_TAG),
+ m_pit(*this, I8253_TAG),
+ m_uart(*this, IM6402_TAG),
+ m_epci(*this, SCN2661_TAG),
+ m_fdc(*this, UPD765_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_centronics(*this, CENTRONICS_TAG),
+ m_kb(*this, WANGPC_KEYBOARD_TAG),
+ m_bus(*this, WANGPC_BUS_TAG),
+ m_timer2_irq(1),
+ m_acknlg(1),
+ m_dav(1),
+ m_busy(1),
+ m_dma_eop(1),
+ m_uart_dr(0),
+ m_uart_tbre(0),
+ m_fpu_irq(0),
+ m_bus_irq2(0),
+ m_enable_eop(0),
+ m_disable_dreq2(0),
+ m_fdc_drq(0),
+ m_fdc_dd0(0),
+ m_fdc_dd1(0),
+ m_fdc_tc(0),
+ m_ds1(1),
+ m_ds2(1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<am9517a_device> m_dmac;
+ required_device<device_t> m_pic;
+ required_device<i8255_device> m_ppi;
+ required_device<device_t> m_pit;
+ required_device<im6402_device> m_uart;
+ required_device<mc2661_device> m_epci;
+ required_device<device_t> m_fdc;
+ required_device<ram_device> m_ram;
+ required_device<legacy_floppy_image_device> m_floppy0;
+ required_device<legacy_floppy_image_device> m_floppy1;
+ required_device<centronics_device> m_centronics;
+ required_device<wangpc_keyboard_device> m_kb;
+ required_device<wangpcbus_device> m_bus;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ void select_drive(int drive, bool select);
+ void set_motor(int drive, bool motor);
+ void fdc_reset();
+ void fdc_tc();
+ void check_level1_interrupts();
+ void check_level2_interrupts();
+ void update_fdc_drq();
+ void update_fdc_tc();
+
+ DECLARE_WRITE8_MEMBER( fdc_ctrl_w );
+ DECLARE_READ8_MEMBER( deselect_drive1_r );
+ DECLARE_WRITE8_MEMBER( deselect_drive1_w );
+ DECLARE_READ8_MEMBER( select_drive1_r );
+ DECLARE_WRITE8_MEMBER( select_drive1_w );
+ DECLARE_READ8_MEMBER( deselect_drive2_r );
+ DECLARE_WRITE8_MEMBER( deselect_drive2_w );
+ DECLARE_READ8_MEMBER( select_drive2_r );
+ DECLARE_WRITE8_MEMBER( select_drive2_w );
+ DECLARE_READ8_MEMBER( motor1_off_r );
+ DECLARE_WRITE8_MEMBER( motor1_off_w );
+ DECLARE_READ8_MEMBER( motor1_on_r );
+ DECLARE_WRITE8_MEMBER( motor1_on_w );
+ DECLARE_READ8_MEMBER( motor2_off_r );
+ DECLARE_WRITE8_MEMBER( motor2_off_w );
+ DECLARE_READ8_MEMBER( motor2_on_r );
+ DECLARE_WRITE8_MEMBER( motor2_on_w );
+ DECLARE_READ8_MEMBER( fdc_reset_r );
+ DECLARE_WRITE8_MEMBER( fdc_reset_w );
+ DECLARE_READ8_MEMBER( fdc_tc_r );
+ DECLARE_WRITE8_MEMBER( fdc_tc_w );
+ DECLARE_WRITE8_MEMBER( dma_page_w );
+ DECLARE_READ8_MEMBER( status_r );
+ DECLARE_WRITE8_MEMBER( timer0_irq_clr_w );
+ DECLARE_READ8_MEMBER( timer2_irq_clr_r );
+ DECLARE_WRITE8_MEMBER( nmi_mask_w );
+ DECLARE_READ8_MEMBER( led_on_r );
+ DECLARE_WRITE8_MEMBER( fpu_mask_w );
+ DECLARE_READ8_MEMBER( dma_eop_clr_r );
+ DECLARE_WRITE8_MEMBER( uart_tbre_clr_w );
+ DECLARE_READ8_MEMBER( uart_r );
+ DECLARE_WRITE8_MEMBER( uart_w );
+ DECLARE_READ8_MEMBER( centronics_r );
+ DECLARE_WRITE8_MEMBER( centronics_w );
+ DECLARE_READ8_MEMBER( busy_clr_r );
+ DECLARE_WRITE8_MEMBER( acknlg_clr_w );
+ DECLARE_READ8_MEMBER( led_off_r );
+ DECLARE_WRITE8_MEMBER( parity_nmi_clr_w );
+ DECLARE_READ8_MEMBER( option_id_r );
+
+ DECLARE_WRITE_LINE_MEMBER( hrq_w );
+ DECLARE_WRITE_LINE_MEMBER( eop_w );
+ DECLARE_READ8_MEMBER( memr_r );
+ DECLARE_WRITE8_MEMBER( memw_w );
+ DECLARE_READ8_MEMBER( ior2_r );
+ DECLARE_WRITE8_MEMBER( iow2_w );
+ DECLARE_WRITE_LINE_MEMBER( dack0_w );
+ DECLARE_WRITE_LINE_MEMBER( dack1_w );
+ DECLARE_WRITE_LINE_MEMBER( dack2_w );
+ DECLARE_WRITE_LINE_MEMBER( dack3_w );
+ DECLARE_READ8_MEMBER( ppi_pa_r );
+ DECLARE_READ8_MEMBER( ppi_pb_r );
+ DECLARE_READ8_MEMBER( ppi_pc_r );
+ DECLARE_WRITE8_MEMBER( ppi_pc_w );
+ DECLARE_WRITE_LINE_MEMBER( pit0_w );
+ DECLARE_WRITE_LINE_MEMBER( pit2_w );
+ DECLARE_WRITE_LINE_MEMBER( uart_dr_w );
+ DECLARE_WRITE_LINE_MEMBER( uart_tbre_w );
+ DECLARE_WRITE_LINE_MEMBER( epci_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_int_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+ DECLARE_WRITE_LINE_MEMBER( ack_w );
+ DECLARE_WRITE_LINE_MEMBER( busy_w );
+ DECLARE_WRITE_LINE_MEMBER( bus_irq2_w );
+
+ static void on_disk0_change(device_image_interface &image);
+ static void on_disk1_change(device_image_interface &image);
+
+ UINT8 m_dma_page[4];
+ int m_dack;
+
+ int m_timer2_irq;
+ int m_acknlg;
+ int m_dav;
+ int m_busy;
+ int m_dma_eop;
+ int m_uart_dr;
+ int m_uart_tbre;
+ int m_fpu_irq;
+ int m_bus_irq2;
+
+ int m_enable_eop;
+ int m_disable_dreq2;
+ int m_fdc_drq;
+ int m_fdc_dd0;
+ int m_fdc_dd1;
+ int m_fdc_tc;
+ int m_ds1;
+ int m_ds2;
+
+ int m_led[6]; // HACK until keyboard works
+};
+
+
+
+#endif
diff --git a/src/mess/includes/wswan.h b/src/mess/includes/wswan.h
new file mode 100644
index 00000000000..39c34fb7066
--- /dev/null
+++ b/src/mess/includes/wswan.h
@@ -0,0 +1,178 @@
+/*****************************************************************************
+ *
+ * includes/wswan.h
+ *
+ ****************************************************************************/
+
+#ifndef WSWAN_H_
+#define WSWAN_H_
+
+#define WSWAN_TYPE_MONO 0
+#define WSWAN_TYPE_COLOR 1
+
+#define WSWAN_X_PIXELS (28*8)
+#define WSWAN_Y_PIXELS (18*8)
+
+/* Interrupt flags */
+#define WSWAN_IFLAG_STX 0x1
+#define WSWAN_IFLAG_KEY 0x2
+#define WSWAN_IFLAG_RTC 0x4
+#define WSWAN_IFLAG_SRX 0x8
+#define WSWAN_IFLAG_LCMP 0x10
+#define WSWAN_IFLAG_VBLTMR 0x20
+#define WSWAN_IFLAG_VBL 0x40
+#define WSWAN_IFLAG_HBLTMR 0x80
+/* Interrupts */
+#define WSWAN_INT_STX 0
+#define WSWAN_INT_KEY 1
+#define WSWAN_INT_RTC 2
+#define WSWAN_INT_SRX 3
+#define WSWAN_INT_LCMP 4
+#define WSWAN_INT_VBLTMR 5
+#define WSWAN_INT_VBL 6
+#define WSWAN_INT_HBLTMR 7
+
+#define INTERNAL_EEPROM_SIZE 1024
+
+#include "emu.h"
+#include "cpu/v30mz/v30mz.h"
+#include "imagedev/cartslot.h"
+#include "machine/nvram.h"
+
+
+typedef struct
+{
+ UINT8 mode; /* eeprom mode */
+ UINT16 address; /* Read/write address */
+ UINT8 command; /* Commands: 00, 01, 02, 03, 04, 08, 0C */
+ UINT8 start; /* start bit */
+ UINT8 write_enabled; /* write enabled yes/no */
+ int size; /* size of eeprom/sram area */
+ UINT8 *data; /* pointer to start of sram/eeprom data */
+ UINT8 *page; /* pointer to current sram/eeprom page */
+} EEPROM;
+
+typedef struct
+{
+ UINT8 present; /* Is an RTC present */
+ UINT8 setting; /* Timer setting byte */
+ UINT8 year; /* Year */
+ UINT8 month; /* Month */
+ UINT8 day; /* Day */
+ UINT8 day_of_week; /* Day of the week */
+ UINT8 hour; /* Hour, high bit = 0 => AM, high bit = 1 => PM */
+ UINT8 minute; /* Minute */
+ UINT8 second; /* Second */
+ UINT8 index; /* index for reading/writing of current of alarm time */
+} RTC;
+
+typedef struct
+{
+ UINT32 source; /* Source address */
+ UINT16 size; /* Size */
+ UINT8 enable; /* Enabled */
+} SoundDMA;
+
+typedef struct
+{
+ UINT8 layer_bg_enable; /* Background layer on/off */
+ UINT8 layer_fg_enable; /* Foreground layer on/off */
+ UINT8 sprites_enable; /* Sprites on/off */
+ UINT8 window_sprites_enable; /* Sprite window on/off */
+ UINT8 window_fg_mode; /* 0:inside/outside, 1:??, 2:inside, 3:outside */
+ UINT8 current_line; /* Current scanline : 0-158 (159?) */
+ UINT8 line_compare; /* Line to trigger line interrupt on */
+ UINT32 sprite_table_address; /* Address of the sprite table */
+ UINT8 sprite_table_buffer[512];
+ UINT8 sprite_first; /* First sprite to draw */
+ UINT8 sprite_count; /* Number of sprites to draw */
+ UINT16 layer_bg_address; /* Address of the background screen map */
+ UINT16 layer_fg_address; /* Address of the foreground screen map */
+ UINT8 window_fg_left; /* Left coordinate of foreground window */
+ UINT8 window_fg_top; /* Top coordinate of foreground window */
+ UINT8 window_fg_right; /* Right coordinate of foreground window */
+ UINT8 window_fg_bottom; /* Bottom coordinate of foreground window */
+ UINT8 window_sprites_left; /* Left coordinate of sprites window */
+ UINT8 window_sprites_top; /* Top coordinate of sprites window */
+ UINT8 window_sprites_right; /* Right coordinate of sprites window */
+ UINT8 window_sprites_bottom; /* Bottom coordinate of sprites window */
+ UINT8 layer_bg_scroll_x; /* Background layer X scroll */
+ UINT8 layer_bg_scroll_y; /* Background layer Y scroll */
+ UINT8 layer_fg_scroll_x; /* Foreground layer X scroll */
+ UINT8 layer_fg_scroll_y; /* Foreground layer Y scroll */
+ UINT8 lcd_enable; /* LCD on/off */
+ UINT8 icons; /* FIXME: What do we do with these? Maybe artwork? */
+ UINT8 color_mode; /* monochrome/color mode */
+ UINT8 colors_16; /* 4/16 colors mode */
+ UINT8 tile_packed; /* layered/packed tile mode switch */
+ UINT8 timer_hblank_enable; /* Horizontal blank interrupt on/off */
+ UINT8 timer_hblank_mode; /* Horizontal blank timer mode */
+ UINT16 timer_hblank_reload; /* Horizontal blank timer reload value */
+ UINT16 timer_hblank_count; /* Horizontal blank timer counter value */
+ UINT8 timer_vblank_enable; /* Vertical blank interrupt on/off */
+ UINT8 timer_vblank_mode; /* Vertical blank timer mode */
+ UINT16 timer_vblank_reload; /* Vertical blank timer reload value */
+ UINT16 timer_vblank_count; /* Vertical blank timer counter value */
+ UINT8 *vram; /* pointer to start of ram/vram (set by MACHINE_RESET) */
+ UINT8 *palette_vram; /* pointer to start of palette area in ram/vram (set by MACHINE_RESET), WSC only */
+ int main_palette[8];
+ emu_timer *timer;
+} VDP;
+
+class wswan_state : public driver_device
+{
+public:
+ wswan_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu")
+ { }
+
+ virtual void video_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ required_device<cpu_device> m_maincpu;
+ DECLARE_READ8_MEMBER(wswan_port_r);
+ DECLARE_WRITE8_MEMBER(wswan_port_w);
+ DECLARE_READ8_MEMBER(wswan_sram_r);
+ DECLARE_WRITE8_MEMBER(wswan_sram_w);
+ VDP m_vdp;
+ UINT8 m_ws_portram[256];
+ UINT8 *m_ROMMap[256];
+ UINT32 m_ROMBanks;
+ UINT8 m_internal_eeprom[INTERNAL_EEPROM_SIZE];
+ UINT8 m_system_type;
+ EEPROM m_eeprom;
+ RTC m_rtc;
+ SoundDMA m_sound_dma;
+ UINT8 *m_ws_ram;
+ UINT8 *m_ws_bios_bank;
+ UINT8 m_bios_disabled;
+ int m_pal[16][16];
+ bitmap_ind16 m_bitmap;
+ UINT8 m_rotate;
+ void wswan_clear_irq_line(int irq);
+};
+
+
+/*----------- defined in machine/wswan.c -----------*/
+
+MACHINE_START( wswan );
+MACHINE_START( wscolor );
+MACHINE_RESET( wswan );
+DEVICE_START(wswan_cart);
+DEVICE_IMAGE_LOAD(wswan_cart);
+
+
+/*----------- defined in video/wswan.c -----------*/
+
+void wswan_refresh_scanline( running_machine &machine );
+
+
+/*----------- defined in audio/wswan.c -----------*/
+
+DECLARE_LEGACY_SOUND_DEVICE(WSWAN, wswan_sound);
+
+WRITE8_DEVICE_HANDLER( wswan_sound_port_w );
+
+#endif /* WSWAN_H_ */
diff --git a/src/mess/includes/x07.h b/src/mess/includes/x07.h
new file mode 100644
index 00000000000..a57e512a1b4
--- /dev/null
+++ b/src/mess/includes/x07.h
@@ -0,0 +1,262 @@
+/*********************************************************************
+
+ includes/x07.h
+
+*********************************************************************/
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/beep.h"
+#include "machine/ram.h"
+#include "sound/wave.h"
+#include "imagedev/cartslot.h"
+#include "imagedev/cassette.h"
+#include "imagedev/printer.h"
+#include "formats/x07_cas.h"
+#include "rendlay.h"
+
+//default value for user defined keys, taken for official documentation
+static const char *const udk_ini[12] = {
+ "tim?TIME$\r",
+ "cldCLOAD\"",
+ "locLOCATE ",
+ "lstLIST ",
+ "runRUN\r",
+ "",
+ "dat?DATE$\r",
+ "csvCSAVE\"",
+ "prtPRINT ",
+ "slpSLEEP",
+ "cntCONT\r",
+ ""
+};
+
+static const UINT16 udk_offset[12] =
+{
+ 0x0000, 0x002a, 0x0054, 0x007e, 0x00a8, 0x00d2,
+ 0x0100, 0x012a, 0x0154, 0x017e, 0x01a8, 0x01d2
+};
+
+static const UINT8 printer_charcode[256] =
+{
+ 0xff, 0x7f, 0xbf, 0x3f, 0xdf, 0x5f, 0x9f, 0x1f,
+ 0xef, 0x6f, 0xaf, 0x2f, 0xcf, 0x4f, 0x8f, 0x0f,
+ 0xf7, 0x77, 0xb7, 0x37, 0xd7, 0x57, 0x97, 0x17,
+ 0xe7, 0x67, 0xa7, 0x27, 0xc7, 0x47, 0x87, 0x07,
+ 0xfb, 0x7b, 0xbb, 0x3b, 0xdb, 0x5b, 0x9b, 0x1b,
+ 0xeb, 0x6b, 0xab, 0x2b, 0xcb, 0x4b, 0x8b, 0x0b,
+ 0xf3, 0x73, 0xb3, 0x33, 0xd3, 0x53, 0x93, 0x13,
+ 0xe3, 0x63, 0xa3, 0x23, 0xc3, 0x43, 0x83, 0x03,
+ 0xfd, 0x7d, 0xbd, 0x3d, 0xdd, 0x5d, 0x9d, 0x1d,
+ 0xed, 0x6d, 0xad, 0x2d, 0xcd, 0x4d, 0x8d, 0x0d,
+ 0xf5, 0x75, 0xb5, 0x35, 0xd5, 0x55, 0x95, 0x15,
+ 0xe5, 0x65, 0xa5, 0x25, 0xc5, 0x45, 0x85, 0x05,
+ 0xf9, 0x79, 0xb9, 0x39, 0xd9, 0x59, 0x99, 0x19,
+ 0xe9, 0x69, 0xa9, 0x29, 0xc9, 0x49, 0x89, 0x09,
+ 0xf1, 0x71, 0xb1, 0x31, 0xd1, 0x51, 0x91, 0x11,
+ 0xe1, 0x61, 0xa1, 0x21, 0xc1, 0x41, 0x81, 0x01,
+ 0xfe, 0x7e, 0xbe, 0x3e, 0xde, 0x5e, 0x9e, 0x1e,
+ 0xee, 0x6e, 0xae, 0x2e, 0xce, 0x4e, 0x8e, 0x0e,
+ 0xf6, 0x76, 0xb6, 0x36, 0xd6, 0x56, 0x96, 0x16,
+ 0xe6, 0x66, 0xa6, 0x26, 0xc6, 0x46, 0x86, 0x06,
+ 0xfa, 0x7a, 0xba, 0x3a, 0xda, 0x5a, 0x9a, 0x1a,
+ 0xea, 0x6a, 0xaa, 0x2a, 0xca, 0x4a, 0x8a, 0x0a,
+ 0xf2, 0x72, 0xb2, 0x32, 0xd2, 0x52, 0x92, 0x12,
+ 0xe2, 0x62, 0xa2, 0x22, 0xc2, 0x42, 0x82, 0x02,
+ 0xfc, 0x7c, 0xbc, 0x3c, 0xdc, 0x5c, 0x9c, 0x1c,
+ 0xec, 0x6c, 0xac, 0x2c, 0xcc, 0x4c, 0x8c, 0x0c,
+ 0xf4, 0x74, 0xb4, 0x34, 0xd4, 0x54, 0x94, 0x14,
+ 0xe4, 0x64, 0xa4, 0x24, 0xc4, 0x44, 0x84, 0x04,
+ 0xf8, 0x78, 0xb8, 0x38, 0xd8, 0x58, 0x98, 0x18,
+ 0xe8, 0x68, 0xa8, 0x28, 0xc8, 0x48, 0x88, 0x08,
+ 0xf0, 0x70, 0xb0, 0x30, 0xd0, 0x50, 0x90, 0x10,
+ 0xe0, 0x60, 0xa0, 0x20, 0xc0, 0x40, 0x80, 0x00
+};
+
+static const UINT8 t6834_cmd_len[0x47] =
+{
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x04, 0x03,
+ 0x01, 0x02, 0x09, 0x01, 0x09, 0x01, 0x01, 0x02,
+ 0x03, 0x03, 0x03, 0x03, 0x05, 0x04, 0x82, 0x02,
+ 0x01, 0x01, 0x0a, 0x02, 0x01, 0x81, 0x81, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x03,
+ 0x02, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x09, 0x01, 0x03, 0x03, 0x01, 0x01
+};
+
+typedef struct
+{
+ const char *tag; //input port tag
+ UINT8 mask; //bit mask
+ UINT8 codes[7]; //port codes
+} x07_kb;
+
+static const x07_kb x07_keycodes[56] =
+{
+ {"BZ", 0x01, {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}},
+ {"S1", 0x01, {0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12}},
+ {"S1", 0x02, {0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16}},
+ {"S1", 0x04, {0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}},
+ {"S1", 0x08, {0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d}},
+ {"S1", 0x10, {0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e}},
+ {"S1", 0x20, {0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f}},
+ {"S1", 0x40, {0x20, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20}},
+ {"S2", 0x01, {0x5a, 0x7a, 0x1a, 0x00, 0xc2, 0xaf, 0xe1}},
+ {"S2", 0x02, {0x58, 0x78, 0x18, 0x00, 0xbb, 0x00, 0x98}},
+ {"S2", 0x04, {0x43, 0x63, 0x03, 0x00, 0xbf, 0x00, 0xe4}},
+ {"S2", 0x08, {0x56, 0x76, 0x16, 0x00, 0xcb, 0x00, 0x95}},
+ {"S2", 0x10, {0x42, 0x62, 0x02, 0x00, 0xba, 0x00, 0xed}},
+ {"S2", 0x20, {0x4e, 0x6e, 0x0e, 0x00, 0xd0, 0x00, 0x89}},
+ {"S2", 0x40, {0x4d, 0x6d, 0x0d, 0x30, 0xd3, 0x00, 0xf5}},
+ {"S2", 0x80, {0x2c, 0x3c, 0x00, 0x00, 0xc8, 0xa4, 0x9c}},
+ {"S3", 0x01, {0x41, 0x61, 0x01, 0x00, 0xc1, 0x00, 0x88}},
+ {"S3", 0x02, {0x53, 0x73, 0x13, 0x00, 0xc4, 0x00, 0x9f}},
+ {"S3", 0x04, {0x44, 0x64, 0x04, 0x00, 0xbc, 0x00, 0xef}},
+ {"S3", 0x08, {0x46, 0x66, 0x06, 0x00, 0xca, 0x00, 0xfd}},
+ {"S3", 0x10, {0x47, 0x67, 0x07, 0x00, 0xb7, 0x00, 0x9d}},
+ {"S3", 0x20, {0x48, 0x68, 0x08, 0x00, 0xb8, 0x00, 0xfe}},
+ {"S3", 0x40, {0x4a, 0x6a, 0x0a, 0x31, 0xcf, 0x00, 0xe5}},
+ {"S3", 0x80, {0x4b, 0x6b, 0x0b, 0x32, 0xc9, 0x00, 0x9b}},
+ {"S4", 0x01, {0x51, 0x71, 0x11, 0x00, 0xc0, 0x00, 0x8b}},
+ {"S4", 0x02, {0x57, 0x77, 0x17, 0x00, 0xc3, 0x00, 0xfb}},
+ {"S4", 0x04, {0x45, 0x65, 0x05, 0x00, 0xb2, 0xa8, 0x99}},
+ {"S4", 0x08, {0x52, 0x72, 0x12, 0x00, 0xbd, 0x00, 0xf6}},
+ {"S4", 0x10, {0x54, 0x74, 0x14, 0x00, 0xb6, 0x00, 0x97}},
+ {"S4", 0x20, {0x59, 0x79, 0x19, 0x35, 0xdd, 0x00, 0x96}},
+ {"S4", 0x40, {0x55, 0x75, 0x15, 0x34, 0xc5, 0x00, 0x94}},
+ {"S4", 0x80, {0x49, 0x69, 0x09, 0x00, 0xc6, 0x00, 0xf9}},
+ {"S5", 0x01, {0x31, 0x21, 0x00, 0x00, 0xc7, 0x00, 0xe9}},
+ {"S5", 0x02, {0x32, 0x22, 0x00, 0x00, 0xcc, 0x00, 0x90}},
+ {"S5", 0x04, {0x33, 0x23, 0x00, 0x00, 0xb1, 0xa7, 0x91}},
+ {"S5", 0x08, {0x34, 0x24, 0x00, 0x00, 0xb3, 0xa9, 0x92}},
+ {"S5", 0x10, {0x35, 0x25, 0x00, 0x00, 0xb4, 0xaa, 0x93}},
+ {"S5", 0x20, {0x36, 0x26, 0x00, 0x00, 0xb5, 0xab, 0xec}},
+ {"S5", 0x40, {0x37, 0x27, 0x37, 0x00, 0xd4, 0xac, 0xe0}},
+ {"S5", 0x80, {0x38, 0x28, 0x37, 0x00, 0xd5, 0xad, 0xf2}},
+ {"S7", 0x01, {0x2e, 0x3e, 0x00, 0x2e, 0xd9, 0xa1, 0x9a}},
+ {"S7", 0x02, {0x2f, 0x3f, 0x00, 0x00, 0xd2, 0xa5, 0x80}},
+ {"S7", 0x04, {0x3f, 0xa5, 0x00, 0x00, 0x00, 0x00, 0x00}},
+ {"S7", 0x08, {0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d, 0x0d}},
+ {"S7", 0x10, {0x4f, 0x6f, 0x0f, 0x36, 0xd7, 0x00, 0x9e}},
+ {"S7", 0x20, {0x50, 0x70, 0x10, 0x00, 0xbe, 0x00, 0xf7}},
+ {"S7", 0x40, {0x40, 0x60, 0x00, 0x00, 0xde, 0x00, 0xe7}},
+ {"S7", 0x80, {0x5b, 0x7b, 0x00, 0x00, 0xdf, 0xa2, 0x84}},
+ {"S8", 0x01, {0x4c, 0x6c, 0x0c, 0x33, 0xd8, 0x00, 0xf4}},
+ {"S8", 0x02, {0x3b, 0x2b, 0x00, 0x00, 0xda, 0x00, 0x82}},
+ {"S8", 0x04, {0x3a, 0x2a, 0x00, 0x00, 0xb9, 0x00, 0x81}},
+ {"S8", 0x08, {0x5d, 0x7d, 0x00, 0x00, 0xd1, 0xa3, 0x85}},
+ {"S8", 0x10, {0x39, 0x29, 0x39, 0x00, 0xd6, 0xae, 0xf1}},
+ {"S8", 0x20, {0x30, 0x7c, 0x00, 0x00, 0xdc, 0xa6, 0x8a}},
+ {"S8", 0x40, {0x2d, 0x3d, 0x00, 0x00, 0xce, 0x00, 0xf0}},
+ {"S8", 0x80, {0x3d, 0x7e, 0x00, 0x00, 0xcd, 0x00, 0xfc}}
+};
+
+class x07_state : public driver_device
+{
+public:
+ x07_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_printer(*this, "printer"),
+ m_beep(*this, BEEPER_TAG),
+ m_ram(*this, RAM_TAG),
+ m_cassette(*this, CASSETTE_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<printer_image_device> m_printer;
+ required_device<device_t> m_beep;
+ required_device<ram_device> m_ram;
+ required_device<cassette_image_device> m_cassette;
+
+ void machine_start();
+ void machine_reset();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_READ8_MEMBER( x07_io_r );
+ DECLARE_WRITE8_MEMBER( x07_io_w );
+
+ DECLARE_INPUT_CHANGED_MEMBER( kb_keys );
+ DECLARE_INPUT_CHANGED_MEMBER( kb_func_keys );
+ DECLARE_INPUT_CHANGED_MEMBER( kb_break );
+ DECLARE_INPUT_CHANGED_MEMBER( kb_update_udk );
+
+ void t6834_cmd(UINT8 cmd);
+ void t6834_r();
+ void t6834_w();
+ void cassette_w();
+ void cassette_r();
+ void printer_w();
+ void kb_irq();
+ void cassette_load();
+ void cassette_save();
+ void receive_bit(int bit);
+
+ inline UINT8 get_char(UINT16 pos);
+ inline UINT8 kb_get_index(UINT8 char_code);
+ inline void draw_char(UINT8 x, UINT8 y, UINT8 char_pos);
+ inline void draw_point(UINT8 x, UINT8 y, UINT8 color);
+ inline void draw_udk();
+
+ /* general */
+ UINT8 m_sleep;
+ UINT8 m_warm_start;
+ UINT8 m_t6834_ram[0x800];
+ UINT8 m_regs_r[8];
+ UINT8 m_regs_w[8];
+ UINT8 m_alarm[8];
+
+ struct fifo_buffer
+ {
+ UINT8 data[0x100];
+ UINT8 read;
+ UINT8 write;
+ };
+ fifo_buffer m_in;
+ fifo_buffer m_out;
+
+ UINT8 m_udk_on;
+ UINT8 m_draw_udk;
+ UINT8 m_sp_on;
+ UINT8 m_font_code;
+ emu_timer *m_rsta_clear;
+ emu_timer *m_rstb_clear;
+ emu_timer *m_beep_stop;
+
+ /* LCD */
+ UINT8 m_lcd_on;
+ UINT8 m_lcd_map[32][120];
+ UINT8 m_scroll_min;
+ UINT8 m_scroll_max;
+ UINT8 m_blink;
+
+ struct lcd_position
+ {
+ UINT8 x;
+ UINT8 y;
+ UINT8 on;
+ };
+ lcd_position m_locate;
+ lcd_position m_cursor;
+
+ /* keyboard */
+ UINT8 m_kb_on;
+ UINT8 m_repeat_key; //not supported
+ UINT8 m_kb_size;
+
+ /* cassette */
+ UINT8 m_cass_motor;
+ UINT8 m_cass_data;
+ UINT32 m_cass_clk;
+ UINT8 m_bit_count;
+ int m_cass_state;
+ emu_timer *m_cass_poll;
+ emu_timer *m_cass_tick;
+
+ /* printer */
+ UINT8 m_prn_sendbit;
+ UINT8 m_prn_char_code;
+ UINT8 m_prn_buffer[0x100];
+ UINT8 m_prn_size;
+};
diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h
new file mode 100644
index 00000000000..9de743429b4
--- /dev/null
+++ b/src/mess/includes/x1.h
@@ -0,0 +1,221 @@
+/*****************************************************************************
+ *
+ * includes/x1.h
+ *
+ ****************************************************************************/
+
+#ifndef X1_H_
+#define X1_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "cpu/z80/z80daisy.h"
+#include "machine/z80ctc.h"
+//#include "machine/z80sio.h"
+#include "machine/z80dart.h"
+#include "machine/i8255.h"
+#include "machine/wd17xx.h"
+#include "machine/z80dma.h"
+#include "video/mc6845.h"
+#include "sound/2151intf.h"
+#include "sound/ay8910.h"
+#include "sound/wave.h"
+#include "imagedev/cassette.h"
+#include "imagedev/flopdrv.h"
+#include "imagedev/cartslot.h"
+#include "formats/basicdsk.h"
+#include "formats/x1_tap.h"
+
+
+// ======================> x1_keyboard_device
+
+class x1_keyboard_device : public device_t,
+ public device_z80daisy_interface
+{
+public:
+ // construction/destruction
+ x1_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+private:
+ virtual void device_start();
+ // z80daisy_interface overrides
+ virtual int z80daisy_irq_state();
+ virtual int z80daisy_irq_ack();
+ virtual void z80daisy_irq_reti();
+};
+
+typedef struct
+{
+ UINT8 gfx_bank;
+ UINT8 disp_bank;
+ UINT8 pcg_mode;
+ UINT8 v400_mode;
+ UINT8 ank_sel;
+
+ UINT8 pri;
+ UINT8 blackclip; // x1 turbo specific
+} scrn_reg_t;
+
+typedef struct
+{
+ UINT8 pal;
+ UINT8 gfx_pal;
+ UINT8 txt_pal[8];
+ UINT8 txt_disp;
+} turbo_reg_t;
+
+typedef struct
+{
+ UINT8 sec, min, hour, day, wday, month, year;
+} x1_rtc_t;
+
+
+class x1_state : public driver_device
+{
+public:
+ x1_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_x1_cpu(*this,"x1_cpu"),
+ m_cass(*this, CASSETTE_TAG),
+ m_fdc(*this, "fdc"),
+ m_crtc(*this, "crtc"),
+ m_ctc(*this, "ctc")
+ { }
+
+ DECLARE_READ8_MEMBER(x1_mem_r);
+ DECLARE_WRITE8_MEMBER(x1_mem_w);
+ DECLARE_READ8_MEMBER(x1_io_r);
+ DECLARE_WRITE8_MEMBER(x1_io_w);
+ DECLARE_READ8_MEMBER(x1_sub_io_r);
+ DECLARE_WRITE8_MEMBER(x1_sub_io_w);
+ DECLARE_READ8_MEMBER(x1_rom_r);
+ DECLARE_WRITE8_MEMBER(x1_rom_w);
+ DECLARE_WRITE8_MEMBER(x1_rom_bank_0_w);
+ DECLARE_WRITE8_MEMBER(x1_rom_bank_1_w);
+ DECLARE_READ8_MEMBER(x1_fdc_r);
+ DECLARE_WRITE8_MEMBER(x1_fdc_w);
+ DECLARE_READ8_MEMBER(x1_pcg_r);
+ DECLARE_WRITE8_MEMBER(x1_pcg_w);
+ DECLARE_WRITE8_MEMBER(x1_pal_r_w);
+ DECLARE_WRITE8_MEMBER(x1_pal_g_w);
+ DECLARE_WRITE8_MEMBER(x1_pal_b_w);
+ DECLARE_WRITE8_MEMBER(x1_ex_gfxram_w);
+ DECLARE_WRITE8_MEMBER(x1_scrn_w);
+ DECLARE_WRITE8_MEMBER(x1_pri_w);
+ DECLARE_WRITE8_MEMBER(x1_6845_w);
+ DECLARE_READ8_MEMBER(x1_kanji_r);
+ DECLARE_WRITE8_MEMBER(x1_kanji_w);
+ DECLARE_READ8_MEMBER(x1_emm_r);
+ DECLARE_WRITE8_MEMBER(x1_emm_w);
+ DECLARE_READ8_MEMBER(x1turbo_pal_r);
+ DECLARE_READ8_MEMBER(x1turbo_txpal_r);
+ DECLARE_READ8_MEMBER(x1turbo_txdisp_r);
+ DECLARE_READ8_MEMBER(x1turbo_gfxpal_r);
+ DECLARE_WRITE8_MEMBER(x1turbo_pal_w);
+ DECLARE_WRITE8_MEMBER(x1turbo_txpal_w);
+ DECLARE_WRITE8_MEMBER(x1turbo_txdisp_w);
+ DECLARE_WRITE8_MEMBER(x1turbo_gfxpal_w);
+ DECLARE_WRITE8_MEMBER(x1turbo_blackclip_w);
+ DECLARE_READ8_MEMBER(x1turbo_mem_r);
+ DECLARE_WRITE8_MEMBER(x1turbo_mem_w);
+ DECLARE_READ8_MEMBER(x1turbo_io_r);
+ DECLARE_WRITE8_MEMBER(x1turbo_io_w);
+ DECLARE_WRITE8_MEMBER(x1turboz_4096_palette_w);
+ DECLARE_READ8_MEMBER(x1turboz_blackclip_r);
+ DECLARE_READ8_MEMBER(x1turbo_bank_r);
+ DECLARE_WRITE8_MEMBER(x1turbo_bank_w);
+ DECLARE_READ8_MEMBER(x1_porta_r);
+ DECLARE_READ8_MEMBER(x1_portb_r);
+ DECLARE_READ8_MEMBER(x1_portc_r);
+ DECLARE_WRITE8_MEMBER(x1_porta_w);
+ DECLARE_WRITE8_MEMBER(x1_portb_w);
+ DECLARE_WRITE8_MEMBER(x1_portc_w);
+
+ UINT8 *m_tvram;
+ UINT8 *m_avram;
+ UINT8 *m_kvram;
+ UINT8 m_hres_320;
+ UINT8 m_io_switch;
+ UINT8 m_io_sys;
+ UINT8 m_vsync;
+ UINT8 m_vdisp;
+ UINT8 m_io_bank_mode;
+ UINT8 *m_gfx_bitmap_ram;
+ UINT8 m_pcg_reset;
+ UINT8 m_sub_obf;
+ UINT8 m_ctc_irq_flag;
+ scrn_reg_t m_scrn_reg;
+ turbo_reg_t m_turbo_reg;
+ x1_rtc_t m_rtc;
+ emu_timer *m_rtc_timer;
+ UINT8 m_pcg_write_addr;
+ UINT8 m_sub_cmd;
+ UINT8 m_sub_cmd_length;
+ UINT8 m_sub_val[8];
+ int m_sub_val_ptr;
+ int m_key_i;
+ UINT8 m_irq_vector;
+ UINT8 m_cmt_current_cmd;
+ UINT8 m_cmt_test;
+ UINT8 m_rom_index[3];
+ UINT32 m_kanji_offset;
+ UINT8 m_bios_offset;
+ UINT8 m_x_b;
+ UINT8 m_x_g;
+ UINT8 m_x_r;
+ UINT16 m_kanji_addr_latch;
+ UINT32 m_kanji_addr;
+ UINT8 m_kanji_eksel;
+ UINT8 m_pcg_reset_occurred;
+ UINT32 m_old_key1;
+ UINT32 m_old_key2;
+ UINT32 m_old_key3;
+ UINT32 m_old_key4;
+ UINT32 m_old_fkey;
+ UINT8 m_key_irq_flag;
+ UINT8 m_key_irq_vector;
+ UINT32 m_emm_addr;
+ UINT8 *m_pal_4096;
+ UINT8 m_crtc_vreg[0x100],m_crtc_index;
+ UINT8 m_is_turbo;
+ UINT8 m_ex_bank;
+ UINT8 m_ram_bank;
+ void set_current_palette();
+ UINT16 get_pcg_addr(UINT16 width, UINT8 y_char_size);
+ UINT16 check_chr_addr();
+ UINT16 check_pcg_addr();
+ UINT8 get_game_key(UINT8 port);
+ UINT8 check_keyboard_shift();
+ UINT16 check_keyboard_press();
+
+ required_device<cpu_device> m_x1_cpu;
+ required_device<cassette_image_device> m_cass;
+ required_device<device_t> m_fdc;
+ required_device<mc6845_device> m_crtc;
+ required_device<z80ctc_device> m_ctc;
+ DECLARE_DRIVER_INIT(x1_kanji);
+};
+
+
+
+/*----------- shared with x1twin.c -----------*/
+
+VIDEO_START( x1 );
+SCREEN_UPDATE_RGB32( x1 );
+
+TIMER_DEVICE_CALLBACK(x1_keyboard_callback);
+TIMER_CALLBACK(x1_rtc_increment);
+TIMER_DEVICE_CALLBACK( x1_cmt_wind_timer );
+
+MACHINE_RESET( x1 );
+MACHINE_RESET( x1turbo );
+MACHINE_START( x1 );
+PALETTE_INIT(x1);
+
+
+
+/*----------- defined in machine/x1.c -----------*/
+
+extern const device_type X1_KEYBOARD;
+
+#endif /* X1_H_ */
diff --git a/src/mess/includes/x68k.h b/src/mess/includes/x68k.h
new file mode 100644
index 00000000000..a7124cfcc31
--- /dev/null
+++ b/src/mess/includes/x68k.h
@@ -0,0 +1,298 @@
+/*****************************************************************************
+ *
+ * includes/x68k.h
+ *
+ * Sharp X68000
+ *
+ ****************************************************************************/
+
+#ifndef X68K_H_
+#define X68K_H_
+
+#include "machine/rp5c15.h"
+
+#define MC68901_TAG "mc68901"
+#define RP5C15_TAG "rp5c15"
+
+#define GFX16 0
+#define GFX256 1
+#define GFX65536 2
+
+enum
+{
+ MFP_IRQ_GPIP0 = 0,
+ MFP_IRQ_GPIP1,
+ MFP_IRQ_GPIP2,
+ MFP_IRQ_GPIP3,
+ MFP_IRQ_TIMERD,
+ MFP_IRQ_TIMERC,
+ MFP_IRQ_GPIP4,
+ MFP_IRQ_GPIP5,
+ MFP_IRQ_TIMERB,
+ MFP_IRQ_TX_ERROR,
+ MFP_IRQ_TX_EMPTY,
+ MFP_IRQ_RX_ERROR,
+ MFP_IRQ_RX_FULL,
+ MFP_IRQ_TIMERA,
+ MFP_IRQ_GPIP6,
+ MFP_IRQ_GPIP7
+}; // MC68901 IRQ priority levels
+
+class x68k_state : public driver_device
+{
+public:
+ x68k_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_mfpdev(*this, MC68901_TAG),
+ m_rtc(*this, RP5C15_TAG),
+ m_nvram16(*this, "nvram16"),
+ m_nvram32(*this, "nvram32"),
+ m_gvram16(*this, "gvram16"),
+ m_tvram16(*this, "tvram16"),
+ m_gvram32(*this, "gvram32"),
+ m_tvram32(*this, "tvram32")
+ { }
+
+ required_device<mc68901_device> m_mfpdev;
+ required_device<rp5c15_device> m_rtc;
+
+ optional_shared_ptr<UINT16> m_nvram16;
+ optional_shared_ptr<UINT32> m_nvram32;
+
+ optional_shared_ptr<UINT16> m_gvram16;
+ optional_shared_ptr<UINT16> m_tvram16;
+ optional_shared_ptr<UINT32> m_gvram32;
+ optional_shared_ptr<UINT32> m_tvram32;
+
+ DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w );
+ DECLARE_READ8_MEMBER( mfp_gpio_r );
+
+ struct
+ {
+ int sram_writeprotect;
+ int monitor;
+ int contrast;
+ int keyctrl;
+ UINT16 cputype;
+ } m_sysport;
+ struct
+ {
+ int led_ctrl[4];
+ int led_eject[4];
+ int eject[4];
+ int motor[4];
+ int media_density[4];
+ int disk_inserted[4];
+ int selected_drive;
+ int drq_state;
+ } m_fdc;
+ struct
+ {
+ int ioc7; // "Function B operation of joystick # one option"
+ int ioc6; // "Function A operation of joystick # one option"
+ int joy1_enable; // IOC4
+ int joy2_enable; // IOC5
+ } m_joy;
+ struct
+ {
+ int rate; // ADPCM sample rate
+ int pan; // ADPCM output switch
+ int clock; // ADPCM clock speed
+ } m_adpcm;
+ struct
+ {
+ int gpdr; // [0] GPIP data register. Typically all inputs.
+ int aer; // [1] GPIP active edge register. Determines on which transition an IRQ is triggered. 0 = 1->0
+ int ddr; // [2] GPIP data direction register. Determines which GPIP bits are inputs (0) or outputs (1)
+ int iera; // [3] Interrupt enable register A.
+ int ierb; // [4] Interrupt enable register B.
+ int ipra; // [5] Interrupt pending register A.
+ int iprb; // [6] Interrupt pending register B.
+ int isra; // [7] Interrupt in-service register A.
+ int isrb; // [8] Interrupt in-service register B.
+ int imra; // [9] Interrupt mask register A.
+ int imrb; // [10] Interrupt mask register B.
+ int vr; // [11] Vector register
+ int tacr; // [12] Timer A control register
+ int tbcr; // [13] Timer B control register
+ int tcdcr; // [14] Timer C & D control register
+ int tadr; // [15] Timer A data register
+ int tbdr; // [16] Timer B data register
+ int tcdr; // [17] Timer C data register
+ int tddr; // [18] Timer D data register
+ int scr; // [19] Synchronous character register
+ int ucr; // [20] USART control register
+ int rsr; // [21] Receiver status register
+ int tsr; // [22] Transmitter status register
+ int udr; // [23] USART data register
+ struct
+ {
+ int counter;
+ int prescaler;
+ } timer[4];
+ struct
+ {
+ unsigned char recv_buffer;
+ unsigned char send_buffer;
+ int recv_enable;
+ int send_enable;
+ } usart;
+ int vector;
+ int irqline;
+ int eoi_mode;
+ int current_irq;
+ unsigned char gpio;
+ } m_mfp; // MC68901 Multifunction Peripheral (4MHz)
+ struct
+ {
+ unsigned short reg[24]; // registers
+ int operation; // operation port (0xe80481)
+ int vblank; // 1 if in VBlank
+ int hblank; // 1 if in HBlank
+ int htotal; // Horizontal Total (in characters)
+ int vtotal; // Vertical Total
+ int hbegin; // Horizontal Begin
+ int vbegin; // Vertical Begin
+ int hend; // Horizontal End
+ int vend; // Vertical End
+ int hsync_end; // Horizontal Sync End
+ int vsync_end; // Vertical Sync End
+ int hsyncadjust; // Horizontal Sync Adjustment
+ float hmultiple; // Horizontal pixel multiplier
+ float vmultiple; // Vertical scanline multiplier (x2 for doublescan modes)
+ int height;
+ int width;
+ int visible_height;
+ int visible_width;
+ int hshift;
+ int vshift;
+ int video_width; // horizontal total (in pixels)
+ int video_height; // vertical total
+ int bg_visible_height;
+ int bg_visible_width;
+ int bg_hshift;
+ int bg_vshift;
+ int bg_hvres; // bits 0,1 = H-Res, bits 2,3 = V-Res, bit 4 = L/H Freq (0=15.98kHz, 1=31.5kHz)
+ int bg_double; // 1 if PCG is to be doubled.
+ int interlace; // 1024 vertical resolution is interlaced
+ } m_crtc; // CRTC
+ struct
+ { // video controller at 0xe82000
+ unsigned short text_pal[0x100];
+ unsigned short gfx_pal[0x100];
+ unsigned short reg[3];
+ int text_pri;
+ int sprite_pri;
+ int gfx_pri;
+ int gfxlayer_pri[4]; // block displayed for each priority level
+ int tile8_dirty[1024];
+ int tile16_dirty[256];
+ } m_video;
+ struct
+ {
+ int delay; // keypress delay after initial press
+ int repeat; // keypress repeat rate
+ int enabled; // keyboard enabled?
+ unsigned char led_status; // keyboard LED status
+ unsigned char buffer[16];
+ int headpos; // scancodes are added here
+ int tailpos; // scancodes are read from here
+ int keynum; // number of scancodes in buffer
+ int keytime[0x80]; // time until next keypress
+ int keyon[0x80]; // is 1 if key is pressed, used to determine if the key state has changed from 1 to 0
+ int last_pressed; // last key pressed, for repeat key handling
+ } m_keyboard;
+ struct
+ {
+ int irqstatus;
+ int fdcvector;
+ int fddvector;
+ int hdcvector;
+ int prnvector;
+ } m_ioc;
+ struct
+ {
+ int inputtype; // determines which input is to be received
+ int irqactive; // non-zero if IRQ is being serviced
+ char last_mouse_x; // previous mouse x-axis value
+ char last_mouse_y; // previous mouse y-axis value
+ int bufferempty; // non-zero if buffer is empty
+ } m_mouse;
+ struct
+ {
+ // port A
+ int mux1; // multiplexer value
+ int seq1; // part of 6-button input sequence.
+ emu_timer* io_timeout1;
+ // port B
+ int mux2; // multiplexer value
+ int seq2; // part of 6-button input sequence.
+ emu_timer* io_timeout2;
+ } m_mdctrl;
+ UINT16* m_sram;
+ UINT8 m_ppi_port[3];
+ int m_current_vector[8];
+ UINT8 m_current_irq_line;
+ unsigned int m_scanline;
+ int m_led_state;
+ emu_timer* m_kb_timer;
+ emu_timer* m_mouse_timer;
+ emu_timer* m_led_timer;
+ emu_timer* m_net_timer;
+ unsigned char m_scc_prev;
+ UINT16 m_ppi_prev;
+ int m_mfp_prev;
+ emu_timer* m_scanline_timer;
+ emu_timer* m_raster_irq;
+ emu_timer* m_vblank_irq;
+ UINT16* m_spriteram;
+ UINT16* m_spritereg;
+ tilemap_t* m_bg0_8;
+ tilemap_t* m_bg1_8;
+ tilemap_t* m_bg0_16;
+ tilemap_t* m_bg1_16;
+ int m_sprite_shift;
+ int m_oddscanline;
+ bool m_is_32bit;
+ DECLARE_DRIVER_INIT(x68kxvi);
+ DECLARE_DRIVER_INIT(x68030);
+ DECLARE_DRIVER_INIT(x68000);
+};
+
+
+/*----------- defined in drivers/x68k.c -----------*/
+
+#ifdef UNUSED_FUNCTION
+void mfp_trigger_irq(int);
+TIMER_CALLBACK(mfp_timer_a_callback);
+TIMER_CALLBACK(mfp_timer_b_callback);
+TIMER_CALLBACK(mfp_timer_c_callback);
+TIMER_CALLBACK(mfp_timer_d_callback);
+#endif
+
+/*----------- defined in video/x68k.c -----------*/
+
+TIMER_CALLBACK(x68k_crtc_raster_irq);
+TIMER_CALLBACK(x68k_crtc_vblank_irq);
+TIMER_CALLBACK(x68k_hsync);
+
+PALETTE_INIT( x68000 );
+READ16_HANDLER( x68k_spritereg_r );
+WRITE16_HANDLER( x68k_spritereg_w );
+READ16_HANDLER( x68k_spriteram_r );
+WRITE16_HANDLER( x68k_spriteram_w );
+WRITE16_HANDLER( x68k_crtc_w );
+READ16_HANDLER( x68k_crtc_r );
+WRITE16_HANDLER( x68k_gvram_w );
+READ16_HANDLER( x68k_gvram_r );
+WRITE16_HANDLER( x68k_tvram_w );
+READ16_HANDLER( x68k_tvram_r );
+WRITE32_HANDLER( x68k_gvram32_w );
+READ32_HANDLER( x68k_gvram32_r );
+WRITE32_HANDLER( x68k_tvram32_w );
+READ32_HANDLER( x68k_tvram32_r );
+SCREEN_UPDATE_IND16( x68000 );
+VIDEO_START( x68000 );
+
+
+#endif /* X68K_H_ */
diff --git a/src/mess/includes/xerox820.h b/src/mess/includes/xerox820.h
new file mode 100644
index 00000000000..eebeb9b7040
--- /dev/null
+++ b/src/mess/includes/xerox820.h
@@ -0,0 +1,106 @@
+#ifndef __XEROX820__
+#define __XEROX820__
+
+#include "machine/ram.h"
+#include "machine/z80ctc.h"
+
+#define SCREEN_TAG "screen"
+
+#define Z80_TAG "u46"
+#define Z80KBPIO_TAG "u105"
+#define Z80GPPIO_TAG "u101"
+#define Z80SIO_TAG "u96"
+#define Z80CTC_TAG "u99"
+#define FD1797_TAG "u109"
+#define COM8116_TAG "u76"
+#define I8086_TAG "i8086"
+
+#define XEROX820_VIDEORAM_SIZE 0x1000
+#define XEROX820_VIDEORAM_MASK 0x0fff
+
+class xerox820_state : public driver_device
+{
+public:
+ xerox820_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_kbpio(*this, Z80KBPIO_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_fdc(*this, FD1797_TAG),
+ m_speaker(*this, SPEAKER_TAG),
+ m_beeper(*this, BEEPER_TAG),
+ m_ram(*this, RAM_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1),
+ m_video_ram(*this, "video_ram"){ }
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ virtual void video_start();
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<z80pio_device> m_kbpio;
+ required_device<z80ctc_device> m_ctc;
+ required_device<device_t> m_fdc;
+ optional_device<device_t> m_speaker;
+ optional_device<device_t> m_beeper;
+ required_device<ram_device> m_ram;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+
+ DECLARE_WRITE8_MEMBER( scroll_w );
+ //DECLARE_WRITE8_MEMBER( x120_system_w );
+ DECLARE_READ8_MEMBER( kbpio_pa_r );
+ DECLARE_WRITE8_MEMBER( kbpio_pa_w );
+ DECLARE_READ8_MEMBER( kbpio_pb_r );
+ DECLARE_WRITE_LINE_MEMBER( intrq_w );
+ DECLARE_WRITE_LINE_MEMBER( drq_w );
+
+ void scan_keyboard();
+ void bankswitch(int bank);
+ void set_floppy_parameters(size_t length);
+ void common_kbpio_pa_w(UINT8 data);
+
+ /* keyboard state */
+ int m_keydata; /* keyboard data */
+ bool m_bit5;
+
+ /* video state */
+ required_shared_ptr<UINT8> m_video_ram; /* video RAM */
+ UINT8 *m_char_rom; /* character ROM */
+ UINT8 m_scroll; /* vertical scroll */
+ UINT8 m_framecnt;
+ int m_ncset2; /* national character set */
+ int m_vatt; /* X120 video attribute */
+ int m_lowlite; /* low light attribute */
+ int m_chrom; /* character ROM index */
+
+ /* floppy state */
+ int m_fdc_irq; /* interrupt request */
+ int m_fdc_drq; /* data request */
+ int m_8n5; /* 5.25" / 8" drive select */
+ int m_dsdd; /* double sided disk detect */
+};
+
+class xerox820ii_state : public xerox820_state
+{
+public:
+ xerox820ii_state(const machine_config &mconfig, device_type type, const char *tag)
+ : xerox820_state(mconfig, type, tag)
+ { }
+
+ virtual void machine_reset();
+
+ DECLARE_WRITE8_MEMBER( bell_w );
+ DECLARE_WRITE8_MEMBER( slden_w );
+ DECLARE_WRITE8_MEMBER( chrom_w );
+ DECLARE_WRITE8_MEMBER( lowlite_w );
+ DECLARE_WRITE8_MEMBER( sync_w );
+ DECLARE_WRITE8_MEMBER( kbpio_pa_w );
+
+ void bankswitch(int bank);
+};
+
+#endif
diff --git a/src/mess/includes/xor100.h b/src/mess/includes/xor100.h
new file mode 100644
index 00000000000..904aa6e2379
--- /dev/null
+++ b/src/mess/includes/xor100.h
@@ -0,0 +1,71 @@
+#pragma once
+
+#ifndef __XOR100__
+#define __XOR100__
+
+#include "machine/ram.h"
+#include "machine/z80ctc.h"
+
+#define SCREEN_TAG "screen"
+#define Z80_TAG "5b"
+#define I8251_A_TAG "12b"
+#define I8251_B_TAG "14b"
+#define I8255A_TAG "8a"
+#define COM5016_TAG "15c"
+#define Z80CTC_TAG "11b"
+#define WD1795_TAG "wd1795"
+#define CENTRONICS_TAG "centronics"
+
+class xor100_state : public driver_device
+{
+public:
+ xor100_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, Z80_TAG),
+ m_dbrg(*this, COM5016_TAG),
+ m_uart_b(*this, I8251_B_TAG),
+ m_fdc(*this, WD1795_TAG),
+ m_ctc(*this, Z80CTC_TAG),
+ m_ram(*this, RAM_TAG),
+ m_terminal(*this, TERMINAL_TAG),
+ m_floppy0(*this, FLOPPY_0),
+ m_floppy1(*this, FLOPPY_1)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<com8116_device> m_dbrg;
+ required_device<i8251_device> m_uart_b;
+ required_device<device_t> m_fdc;
+ required_device<z80ctc_device> m_ctc;
+ required_device<ram_device> m_ram;
+ required_device<generic_terminal_device> m_terminal;
+ required_device<device_t> m_floppy0;
+ required_device<device_t> m_floppy1;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+
+ DECLARE_WRITE8_MEMBER( mmu_w );
+ DECLARE_WRITE8_MEMBER( prom_toggle_w );
+ DECLARE_READ8_MEMBER( prom_disable_r );
+ DECLARE_WRITE8_MEMBER( baud_w );
+ DECLARE_WRITE8_MEMBER( i8251_b_data_w );
+ DECLARE_READ8_MEMBER( fdc_wait_r );
+ DECLARE_WRITE8_MEMBER( fdc_dcont_w );
+ DECLARE_WRITE8_MEMBER( fdc_dsel_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_irq_w );
+ DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
+
+ void bankswitch();
+
+ // memory state
+ int m_mode;
+ int m_bank;
+
+ // floppy state
+ int m_fdc_irq;
+ int m_fdc_drq;
+ int m_fdc_dden;
+};
+
+#endif
diff --git a/src/mess/includes/z80ne.h b/src/mess/includes/z80ne.h
new file mode 100644
index 00000000000..538656a3027
--- /dev/null
+++ b/src/mess/includes/z80ne.h
@@ -0,0 +1,122 @@
+/*****************************************************************************
+ *
+ * includes/z80ne.h
+ *
+ * Nuova Elettronica Z80NE
+ *
+ * http://www.z80ne.com/
+ *
+ ****************************************************************************/
+
+#ifndef Z80NE_H_
+#define Z80NE_H_
+
+#include "video/mc6847.h"
+
+
+/***************************************************************************
+ CONSTANTS
+***************************************************************************/
+
+#define Z80NE_CPU_SPEED_HZ 1920000 /* 1.92 MHz */
+
+#define LX383_KEYS 16
+#define LX383_DOWNSAMPLING 16
+
+#define LX385_TAPE_SAMPLE_FREQ 38400
+
+/* wave duration threshold */
+typedef enum
+{
+ TAPE_300BPS = 300, /* 300 bps */
+ TAPE_600BPS = 600, /* 600 bps */
+ TAPE_1200BPS = 1200 /* 1200 bps */
+} z80netape_speed;
+
+typedef struct {
+ struct {
+ int length; /* time cassette level is at input.level */
+ int level; /* cassette level */
+ int bit; /* bit being read */
+ } input;
+ struct {
+ int length; /* time cassette level is at output.level */
+ int level; /* cassette level */
+ int bit; /* bit to to output */
+ } output;
+ z80netape_speed speed; /* 300 - 600 - 1200 */
+ int wave_filter;
+ int wave_length;
+ int wave_short;
+ int wave_long;
+} cass_data_t;
+
+typedef struct {
+ int drq;
+ int intrq;
+ UINT8 drive; /* current drive */
+ UINT8 head; /* current head */
+} wd17xx_state_t;
+
+
+class z80ne_state : public driver_device
+{
+public:
+ z80ne_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_vdg(*this, "mc6847"),
+ m_videoram(*this,"videoram") {}
+
+ optional_device<mc6847_base_device> m_vdg;
+ optional_shared_ptr<UINT8> m_videoram;
+ UINT8 m_lx383_scan_counter;
+ UINT8 m_lx383_key[LX383_KEYS];
+ int m_lx383_downsampler;
+ int m_nmi_delay_counter;
+ int m_reset_delay_counter;
+ device_t *m_ay31015;
+ UINT8 m_lx385_ctrl;
+ device_t *m_lx388_kr2376;
+ emu_timer *m_cassette_timer;
+ cass_data_t m_cass_data;
+ wd17xx_state_t m_wd17xx_state;
+ DECLARE_READ8_MEMBER(lx383_r);
+ DECLARE_WRITE8_MEMBER(lx383_w);
+ DECLARE_READ8_MEMBER(lx385_data_r);
+ DECLARE_READ8_MEMBER(lx385_ctrl_r);
+ DECLARE_WRITE8_MEMBER(lx385_data_w);
+ DECLARE_WRITE8_MEMBER(lx385_ctrl_w);
+ DECLARE_READ8_MEMBER(lx388_data_r);
+ DECLARE_READ8_MEMBER(lx388_read_field_sync);
+ DECLARE_DIRECT_UPDATE_MEMBER(z80ne_default);
+ DECLARE_DIRECT_UPDATE_MEMBER(z80ne_nmi_delay_count);
+ DECLARE_DIRECT_UPDATE_MEMBER(z80ne_reset_delay_count);
+ DECLARE_DRIVER_INIT(z80netf);
+ DECLARE_DRIVER_INIT(z80net);
+ DECLARE_DRIVER_INIT(z80netb);
+ DECLARE_DRIVER_INIT(z80ne);
+};
+
+
+/*----------- defined in machine/z80ne.c -----------*/
+
+READ8_DEVICE_HANDLER(lx388_mc6847_videoram_r);
+READ8_DEVICE_HANDLER(lx390_fdc_r);
+WRITE8_DEVICE_HANDLER(lx390_fdc_w);
+READ8_DEVICE_HANDLER(lx390_reset_bank);
+WRITE8_DEVICE_HANDLER(lx390_motor_w);
+
+
+MACHINE_RESET(z80ne);
+MACHINE_RESET(z80net);
+MACHINE_RESET(z80netb);
+MACHINE_RESET(z80netf);
+MACHINE_START(z80ne);
+MACHINE_START(z80net);
+MACHINE_START(z80netb);
+MACHINE_START(z80netf);
+
+INPUT_CHANGED(z80ne_reset);
+INPUT_CHANGED(z80ne_nmi);
+
+#endif /* Z80NE_H_ */
diff --git a/src/mess/includes/z88.h b/src/mess/includes/z88.h
new file mode 100644
index 00000000000..050bd010291
--- /dev/null
+++ b/src/mess/includes/z88.h
@@ -0,0 +1,96 @@
+/*****************************************************************************
+ *
+ * includes/z88.h
+ *
+ ****************************************************************************/
+
+#ifndef Z88_H_
+#define Z88_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "machine/upd65031.h"
+#include "machine/ram.h"
+#include "machine/z88cart.h"
+#include "machine/z88_flash.h"
+#include "machine/z88_ram.h"
+#include "machine/z88_rom.h"
+#include "sound/speaker.h"
+#include "rendlay.h"
+
+#define Z88_NUM_COLOURS 3
+
+#define Z88_SCREEN_WIDTH 640
+#define Z88_SCREEN_HEIGHT 64
+
+#define Z88_SCR_HW_REV (1<<4)
+#define Z88_SCR_HW_HRS (1<<5)
+#define Z88_SCR_HW_UND (1<<1)
+#define Z88_SCR_HW_FLS (1<<3)
+#define Z88_SCR_HW_GRY (1<<2)
+#define Z88_SCR_HW_CURS (Z88_SCR_HW_HRS|Z88_SCR_HW_FLS|Z88_SCR_HW_REV)
+#define Z88_SCR_HW_NULL (Z88_SCR_HW_HRS|Z88_SCR_HW_GRY|Z88_SCR_HW_REV)
+
+enum
+{
+ Z88_BANK_ROM = 1,
+ Z88_BANK_RAM,
+ Z88_BANK_CART,
+ Z88_BANK_UNMAP
+};
+
+
+class z88_state : public driver_device
+{
+public:
+ z88_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag),
+ m_maincpu(*this, "maincpu"),
+ m_ram(*this, RAM_TAG)
+ { }
+
+ required_device<cpu_device> m_maincpu;
+ required_device<ram_device> m_ram;
+
+ virtual void machine_start();
+ virtual void machine_reset();
+ void bankswitch_update(int bank, UINT16 page, int rams);
+ DECLARE_READ8_MEMBER(kb_r);
+
+ // cartridges read/write
+ DECLARE_READ8_MEMBER(bank0_cart_r);
+ DECLARE_READ8_MEMBER(bank1_cart_r);
+ DECLARE_READ8_MEMBER(bank2_cart_r);
+ DECLARE_READ8_MEMBER(bank3_cart_r);
+ DECLARE_WRITE8_MEMBER(bank0_cart_w);
+ DECLARE_WRITE8_MEMBER(bank1_cart_w);
+ DECLARE_WRITE8_MEMBER(bank2_cart_w);
+ DECLARE_WRITE8_MEMBER(bank3_cart_w);
+
+ // defined in video/z88.c
+ inline void plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT16 color);
+ inline UINT8* convert_address(UINT32 offset);
+ void vh_render_8x8(bitmap_ind16 &bitmap, int x, int y, UINT16 pen0, UINT16 pen1, UINT8 *gfx);
+ void vh_render_6x8(bitmap_ind16 &bitmap, int x, int y, UINT16 pen0, UINT16 pen1, UINT8 *gfx);
+ void vh_render_line(bitmap_ind16 &bitmap, int x, int y, UINT16 pen);
+ void lcd_update(bitmap_ind16 &bitmap, UINT16 sbf, UINT16 hires0, UINT16 hires1, UINT16 lores0, UINT16 lores1, int flash);
+
+ struct
+ {
+ UINT8 slot;
+ UINT8 page;
+ } m_bank[4];
+
+ int m_bank_type[4];
+ UINT8 * m_bios;
+ UINT8 * m_ram_base;
+ z88cart_slot_device * m_carts[4];
+};
+
+
+/*----------- defined in video/z88.c -----------*/
+
+extern PALETTE_INIT( z88 );
+
+
+#endif /* Z88_H_ */
diff --git a/src/mess/includes/zx.h b/src/mess/includes/zx.h
new file mode 100644
index 00000000000..5bb2f87dc53
--- /dev/null
+++ b/src/mess/includes/zx.h
@@ -0,0 +1,75 @@
+/*****************************************************************************
+ *
+ * includes/zx.h
+ *
+ ****************************************************************************/
+
+#ifndef ZX_H_
+#define ZX_H_
+
+#include "emu.h"
+#include "cpu/z80/z80.h"
+#include "sound/speaker.h"
+#include "sound/wave.h"
+#include "imagedev/cassette.h"
+#include "formats/zx81_p.h"
+#include "machine/ram.h"
+
+
+class zx_state : public driver_device
+{
+public:
+ zx_state(const machine_config &mconfig, device_type type, const char *tag)
+ : driver_device(mconfig, type, tag) { }
+
+ UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+
+ bitmap_ind16 m_bitmap;
+
+ DECLARE_READ8_MEMBER(zx_ram_r);
+ DECLARE_READ8_MEMBER(zx80_io_r);
+ DECLARE_READ8_MEMBER(zx81_io_r);
+ DECLARE_READ8_MEMBER(pc8300_io_r);
+ DECLARE_READ8_MEMBER(pow3000_io_r);
+ DECLARE_WRITE8_MEMBER(zx80_io_w);
+ DECLARE_WRITE8_MEMBER(zx81_io_w);
+ emu_timer *m_ula_nmi;
+ int m_ula_irq_active;
+ int m_ula_frame_vsync;
+ int m_ula_scanline_count;
+ UINT8 m_tape_bit;
+ UINT8 m_speaker_state;
+ int m_old_x;
+ int m_old_y;
+ UINT8 m_old_c;
+ UINT8 m_charline[32];
+ UINT8 m_charline_ptr;
+ int m_offs1;
+ void zx_ula_bkgnd(UINT8 color);
+ DECLARE_WRITE8_MEMBER(zx_ram_w);
+ DECLARE_DIRECT_UPDATE_MEMBER(zx_setdirect);
+ DECLARE_DIRECT_UPDATE_MEMBER(pc8300_setdirect);
+ DECLARE_DIRECT_UPDATE_MEMBER(pow3000_setdirect);
+ DECLARE_DRIVER_INIT(zx);
+};
+
+
+/*----------- defined in machine/zx.c -----------*/
+
+MACHINE_RESET( zx80 );
+MACHINE_RESET( pow3000 );
+MACHINE_RESET( pc8300 );
+
+/*----------- defined in video/zx.c -----------*/
+
+VIDEO_START( zx );
+SCREEN_VBLANK( zx );
+
+void zx_ula_bkgnd(running_machine &machine, int color);
+void zx_ula_r(running_machine &machine, int offs, const char *region, const UINT8 param);
+
+//extern int ula_nmi_active;
+//extern int ula_scancode_count;
+
+
+#endif /* ZX_H_ */