From cd2cc2f8110a66f2eaf0351cfd307d270c952cb6 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Mon, 7 Oct 2013 06:31:30 +0000 Subject: [PATCH] (MESS) irisha : cleanup (nw) --- .gitattributes | 3 - src/mess/drivers/irisha.c | 307 ++++++++++++++++++++++++++++++++++--- src/mess/includes/irisha.h | 63 -------- src/mess/machine/irisha.c | 149 ------------------ src/mess/mess.mak | 2 - src/mess/video/irisha.c | 42 ----- 6 files changed, 283 insertions(+), 283 deletions(-) delete mode 100644 src/mess/includes/irisha.h delete mode 100644 src/mess/machine/irisha.c delete mode 100644 src/mess/video/irisha.c diff --git a/.gitattributes b/.gitattributes index 35c21a79b2d..9620f8cb704 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6779,7 +6779,6 @@ src/mess/includes/hp48.h svneol=native#text/plain src/mess/includes/huebler.h svneol=native#text/plain src/mess/includes/hx20.h svneol=native#text/plain src/mess/includes/intv.h svneol=native#text/plain -src/mess/includes/irisha.h svneol=native#text/plain src/mess/includes/jtc.h svneol=native#text/plain src/mess/includes/jupiter.h svneol=native#text/plain src/mess/includes/kaypro.h svneol=native#text/plain @@ -7556,7 +7555,6 @@ src/mess/machine/iq151_staper.c svneol=native#text/plain src/mess/machine/iq151_staper.h svneol=native#text/plain src/mess/machine/iq151cart.c svneol=native#text/plain src/mess/machine/iq151cart.h svneol=native#text/plain -src/mess/machine/irisha.c svneol=native#text/plain src/mess/machine/isa.c svneol=native#text/plain src/mess/machine/isa.h svneol=native#text/plain src/mess/machine/isa_adlib.c svneol=native#text/plain @@ -8357,7 +8355,6 @@ src/mess/video/iq151_video32.c svneol=native#text/plain src/mess/video/iq151_video32.h svneol=native#text/plain src/mess/video/iq151_video64.c svneol=native#text/plain src/mess/video/iq151_video64.h svneol=native#text/plain -src/mess/video/irisha.c svneol=native#text/plain src/mess/video/isa_cga.c svneol=native#text/plain src/mess/video/isa_cga.h svneol=native#text/plain src/mess/video/isa_ega.c svneol=native#text/plain diff --git a/src/mess/drivers/irisha.c b/src/mess/drivers/irisha.c index f802f788a46..bee8a371072 100644 --- a/src/mess/drivers/irisha.c +++ b/src/mess/drivers/irisha.c @@ -2,26 +2,78 @@ Irisha driver by Miodrag Milanovic - 27/03/2008 Preliminary driver. + 2008-03-27 Preliminary driver. + + Jump addresses: + Option 1: 0800 (Monitor - the only choice that works) + Option 2: 046E + Option 3: 0423 (then jumps to 4000) + Option 4: 0501 + Option 5: 042E ****************************************************************************/ -#include "includes/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_p_videoram(*this, "videoram") + , m_maincpu(*this, "maincpu") + , m_pit(*this, "pit8253") + , m_speaker(*this, "speaker") + { } + + 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); + TIMER_CALLBACK_MEMBER(irisha_key); + DECLARE_WRITE_LINE_MEMBER(irisha_pic_set_int_line); + UINT32 screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + required_shared_ptr m_p_videoram; +private: + bool m_sg1_line; + bool m_keypressed; + UINT8 m_keyboard_cnt; + UINT8 m_ppi_porta; + UINT8 m_ppi_portc; + void update_speaker(); + virtual void machine_start(); + virtual void machine_reset(); + ioport_port *m_io_ports[10]; + required_device m_maincpu; + required_device m_pit; + required_device m_speaker; +}; + /* Address maps */ static ADDRESS_MAP_START(irisha_mem, AS_PROGRAM, 8, irisha_state ) - AM_RANGE( 0x0000, 0x3fff ) AM_ROM // ROM - AM_RANGE( 0x4000, 0xffff ) AM_RAM // RAM + AM_RANGE(0x0000, 0x3fff) AM_ROM // ROM + AM_RANGE(0x4000, 0xdfff) AM_RAM // RAM + AM_RANGE(0xe000, 0xffff) AM_RAM AM_SHARE("videoram") ADDRESS_MAP_END static ADDRESS_MAP_START( irisha_io , AS_IO, 8, irisha_state ) - AM_RANGE( 0x04, 0x05) AM_READ(irisha_keyboard_r) - AM_RANGE( 0x06, 0x06) AM_DEVREADWRITE("uart",i8251_device, data_r, data_w) - AM_RANGE( 0x07, 0x07) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w) - AM_RANGE( 0x08, 0x0B) AM_DEVREADWRITE("pit8253", pit8253_device, read, write ) - AM_RANGE( 0x0C, 0x0F) AM_DEVREADWRITE("pic8259", pic8259_device, read, write ) AM_MASK( 0x01 ) - AM_RANGE( 0x10, 0x13) AM_DEVREADWRITE("ppi8255", i8255_device, read, write) + AM_RANGE(0x04, 0x05) AM_READ(irisha_keyboard_r) + AM_RANGE(0x06, 0x06) AM_DEVREADWRITE("uart",i8251_device, data_r, data_w) + AM_RANGE(0x07, 0x07) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w) + AM_RANGE(0x08, 0x0B) AM_DEVREADWRITE("pit8253", pit8253_device, read, write ) + AM_RANGE(0x0C, 0x0F) AM_DEVREADWRITE("pic8259", pic8259_device, read, write ) AM_MASK( 0x01 ) + AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("ppi8255", i8255_device, read, write) ADDRESS_MAP_END /* Input ports */ @@ -127,6 +179,41 @@ static INPUT_PORTS_START( irisha ) PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) INPUT_PORTS_END +/************************************************* + + Video + +*************************************************/ + +UINT32 irisha_state::screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + UINT8 gfx; + UINT16 y,ma=0,x; + UINT16 *p; + + for (y = 0; y < 200; y++) + { + p = &bitmap.pix16(y); + + for (x = ma; x < ma+40; x++) + { + gfx = m_p_videoram[x]; + + /* Display a scanline of a character */ + *p++ = BIT(gfx, 7); + *p++ = BIT(gfx, 6); + *p++ = BIT(gfx, 5); + *p++ = BIT(gfx, 4); + *p++ = BIT(gfx, 3); + *p++ = BIT(gfx, 2); + *p++ = BIT(gfx, 1); + *p++ = BIT(gfx, 0); + } + ma+=40; + } + return 0; +} + /* F4 Character Displayer */ static const gfx_layout irisha_charlayout = { @@ -145,6 +232,184 @@ static GFXDECODE_START( irisha ) GFXDECODE_ENTRY( "maincpu", 0x3800, irisha_charlayout, 0, 1 ) GFXDECODE_END + +/************************************************* + + i8253 + +*************************************************/ + +static const struct pit8253_interface irisha_pit8253_intf = +{ + { + { + XTAL_16MHz / 9, + DEVCB_LINE_VCC, + DEVCB_DEVICE_LINE_MEMBER("pic8259", pic8259_device, ir0_w) + }, + { + XTAL_16MHz / 9 / 8 / 8, + DEVCB_LINE_VCC, + DEVCB_NULL // UART transmit/receive clock + }, + { + XTAL_16MHz / 9, + DEVCB_NULL, + DEVCB_DRIVER_LINE_MEMBER(irisha_state, speaker_w) + } + } +}; + + +/************************************************* + + i8255 + +*************************************************/ + +READ8_MEMBER(irisha_state::irisha_8255_portb_r) +{ + if (m_keypressed==1) + { + m_keypressed = 0; + return 0x80; + } + + return 0x00; +} + +READ8_MEMBER(irisha_state::irisha_8255_portc_r) +{ + logerror("irisha_8255_portc_r\n"); + return 0; +} + +WRITE8_MEMBER(irisha_state::irisha_8255_porta_w) +{ + logerror("irisha_8255_porta_w %02x\n",data); + + m_ppi_porta = data; + + update_speaker(); +} + +WRITE8_MEMBER(irisha_state::irisha_8255_portb_w) +{ + logerror("irisha_8255_portb_w %02x\n",data); +} + +WRITE8_MEMBER(irisha_state::irisha_8255_portc_w) +{ + //logerror("irisha_8255_portc_w %02x\n",data); + + if BIT(data, 6) + m_pit->gate2_w((BIT(m_ppi_porta, 5) && !BIT(data, 5)) ? 1 : 0); + + m_ppi_portc = data; + + update_speaker(); +} + +static I8255A_INTERFACE( irisha_ppi8255_interface ) +{ + DEVCB_NULL, + DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_porta_w), + DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portb_r), + DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portb_w), + DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portc_r), + DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portc_w), +}; + + +/************************************************* + + i8259 + +*************************************************/ + +WRITE_LINE_MEMBER(irisha_state::irisha_pic_set_int_line) +{ + m_maincpu->set_input_line(0, state ? HOLD_LINE : CLEAR_LINE); +} + + +/************************************************* + + Sound + +*************************************************/ + +void irisha_state::update_speaker() +{ + int level = ( (BIT(m_ppi_portc, 5)) || (BIT(m_ppi_porta, 4)) || !m_sg1_line) ? 1 : 0; + + m_speaker->level_w(level); +} + + +WRITE_LINE_MEMBER(irisha_state::speaker_w) +{ + m_sg1_line = state; + update_speaker(); +} + + +/************************************************* + + Keyboard + +*************************************************/ + +TIMER_CALLBACK_MEMBER(irisha_state::irisha_key) +{ + m_keypressed = 1; + m_keyboard_cnt = 0; +} + +READ8_MEMBER(irisha_state::irisha_keyboard_r) +{ + UINT8 keycode; + + if (m_keyboard_cnt!=0 && m_keyboard_cnt<11) + keycode = m_io_ports[m_keyboard_cnt-1]->read() ^ 0xff; + else + keycode = 0xff; + + m_keyboard_cnt++; + + return keycode; +} + + +/************************************************* + + Machine + +*************************************************/ + +void irisha_state::machine_start() +{ + static const char *const keynames[] = { + "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", + "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" + }; + + for ( UINT8 i = 0; i < 10; i++ ) + m_io_ports[i] = ioport( keynames[i] ); + + machine().scheduler().timer_pulse(attotime::from_msec(30), timer_expired_delegate(FUNC(irisha_state::irisha_key),this)); +} + +void irisha_state::machine_reset() +{ + m_sg1_line = 0; + m_keypressed = 0; + m_keyboard_cnt = 0; + m_ppi_porta = 0; + m_ppi_portc = 0; +} + + /* Machine driver */ static MACHINE_CONFIG_START( irisha, irisha_state ) /* basic machine hardware */ @@ -152,13 +417,6 @@ static MACHINE_CONFIG_START( irisha, irisha_state ) MCFG_CPU_PROGRAM_MAP(irisha_mem) MCFG_CPU_IO_MAP(irisha_io) - - MCFG_I8255_ADD( "ppi8255", irisha_ppi8255_interface ) - - MCFG_PIT8253_ADD( "pit8253", irisha_pit8253_intf ) - - MCFG_PIC8259_ADD( "pic8259", WRITELINE(irisha_state,irisha_pic_set_int_line), VCC, NULL ) - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(50) @@ -166,19 +424,20 @@ static MACHINE_CONFIG_START( irisha, irisha_state ) MCFG_SCREEN_SIZE(320, 200) MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 200-1) MCFG_SCREEN_UPDATE_DRIVER(irisha_state, screen_update_irisha) - MCFG_GFXDECODE(irisha) MCFG_PALETTE_LENGTH(2) MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white) - - /* uart */ - MCFG_I8251_ADD("uart", default_i8251_interface) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) + + /* Devices */ + MCFG_I8251_ADD("uart", default_i8251_interface) + MCFG_PIT8253_ADD( "pit8253", irisha_pit8253_intf ) + MCFG_I8255_ADD( "ppi8255", irisha_ppi8255_interface ) + MCFG_PIC8259_ADD( "pic8259", WRITELINE(irisha_state,irisha_pic_set_int_line), VCC, NULL ) MACHINE_CONFIG_END /* ROM definition */ @@ -190,5 +449,5 @@ ROM_START( irisha ) ROM_END /* Driver */ -/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ -COMP( 1983, irisha, 0, 0, irisha, irisha, irisha_state, irisha, "MGU", "Irisha", GAME_NOT_WORKING | GAME_NO_SOUND) +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ +COMP( 1983, irisha, 0, 0, irisha, irisha, driver_device, 0, "MGU", "Irisha", GAME_NOT_WORKING) diff --git a/src/mess/includes/irisha.h b/src/mess/includes/irisha.h deleted file mode 100644 index 70f2ea3b6a9..00000000000 --- a/src/mess/includes/irisha.h +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - * - * 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_maincpu(*this, "maincpu"), - m_pit(*this, "pit8253"), - m_speaker(*this, "speaker") { } - - required_device m_maincpu; - required_device m_pit; - required_device 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); - virtual void machine_start(); - virtual void machine_reset(); - virtual void video_start(); - UINT32 screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(irisha_key); - DECLARE_WRITE_LINE_MEMBER(irisha_pic_set_int_line); - - ioport_port *m_io_ports[10]; -}; - - -/*----------- defined in machine/irisha.c -----------*/ - -extern const i8255_interface irisha_ppi8255_interface; -extern const struct pit8253_interface irisha_pit8253_intf; - -#endif /* IRISHA_H_ */ diff --git a/src/mess/machine/irisha.c b/src/mess/machine/irisha.c deleted file mode 100644 index bb08dc53cab..00000000000 --- a/src/mess/machine/irisha.c +++ /dev/null @@ -1,149 +0,0 @@ -/*************************************************************************** - - Irisha machine driver by Miodrag Milanovic - - 27/03/2008 Preliminary driver. - -****************************************************************************/ - - -#include "includes/irisha.h" - - -/* Driver initialization */ -DRIVER_INIT_MEMBER(irisha_state,irisha) -{ - m_keyboard_mask = 0; -} - - - -TIMER_CALLBACK_MEMBER(irisha_state::irisha_key) -{ - m_keypressed = 1; - m_keyboard_cnt = 0; -} - -void irisha_state::machine_start() -{ - static const char *const keynames[] = { - "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", - "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" - }; - - for ( int i = 0; i < 10; i++ ) - { - m_io_ports[i] = ioport( keynames[i] ); - } - - machine().scheduler().timer_pulse(attotime::from_msec(30), timer_expired_delegate(FUNC(irisha_state::irisha_key),this)); -} - -void irisha_state::machine_reset() -{ - m_keypressed = 0; -} - -void irisha_state::update_speaker() -{ - int level = ((m_ppi_portc & 0x20) || (m_ppi_porta & 0x10) || !m_sg1_line) ? 1 : 0; - - m_speaker->level_w(level); -} - - -READ8_MEMBER(irisha_state::irisha_8255_portb_r) -{ - if (m_keypressed==1) { - m_keypressed = 0; - return 0x80; - } - - return 0x00; -} - -READ8_MEMBER(irisha_state::irisha_8255_portc_r) -{ - logerror("irisha_8255_portc_r\n"); - return 0; -} - -READ8_MEMBER(irisha_state::irisha_keyboard_r) -{ - UINT8 keycode; - if (m_keyboard_cnt!=0 && m_keyboard_cnt<11) { - keycode = m_io_ports[m_keyboard_cnt-1]->read() ^ 0xff; - } else { - keycode = 0xff; - } - m_keyboard_cnt++; - return keycode; -} - -WRITE8_MEMBER(irisha_state::irisha_8255_porta_w) -{ - logerror("irisha_8255_porta_w %02x\n",data); - - m_ppi_porta = data; - - update_speaker(); -} - -WRITE8_MEMBER(irisha_state::irisha_8255_portb_w) -{ - logerror("irisha_8255_portb_w %02x\n",data); -} - -WRITE8_MEMBER(irisha_state::irisha_8255_portc_w) -{ - //logerror("irisha_8255_portc_w %02x\n",data); - - if (data & 0x40) - m_pit->gate2_w((BIT(m_ppi_porta, 5) && !BIT(data, 5)) ? 1 : 0); - - m_ppi_portc = data; - - update_speaker(); -} - -WRITE_LINE_MEMBER(irisha_state::speaker_w) -{ - m_sg1_line = state; - update_speaker(); -} - -I8255A_INTERFACE( irisha_ppi8255_interface ) -{ - DEVCB_NULL, - DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_porta_w), - DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portb_r), - DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portb_w), - DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portc_r), - DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portc_w), -}; - -WRITE_LINE_MEMBER(irisha_state::irisha_pic_set_int_line) -{ - m_maincpu->set_input_line(0, state ? HOLD_LINE : CLEAR_LINE); -} - -const struct pit8253_interface irisha_pit8253_intf = -{ - { - { - XTAL_16MHz / 9, - DEVCB_LINE_VCC, - DEVCB_DEVICE_LINE_MEMBER("pic8259", pic8259_device, ir0_w) - }, - { - XTAL_16MHz / 9 / 8 / 8, - DEVCB_LINE_VCC, - DEVCB_NULL // UART transmit/receive clock - }, - { - XTAL_16MHz / 9, - DEVCB_NULL, - DEVCB_DRIVER_LINE_MEMBER(irisha_state, speaker_w) - } - } -}; diff --git a/src/mess/mess.mak b/src/mess/mess.mak index b1cd5db3967..5f358596d55 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -1603,8 +1603,6 @@ $(MESSOBJ)/memotech.a: \ $(MESSOBJ)/mgu.a: \ $(MESS_DRIVERS)/irisha.o \ - $(MESS_MACHINE)/irisha.o \ - $(MESS_VIDEO)/irisha.o \ $(MESSOBJ)/microkey.a: \ $(MESS_DRIVERS)/primo.o \ diff --git a/src/mess/video/irisha.c b/src/mess/video/irisha.c deleted file mode 100644 index c334f63f771..00000000000 --- a/src/mess/video/irisha.c +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************** - - Irisha video driver by Miodrag Milanovic - - 27/03/2008 Preliminary driver. - -****************************************************************************/ - - -#include "emu.h" -#include "includes/irisha.h" - - -void irisha_state::video_start() -{ -} - -UINT32 irisha_state::screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - UINT8 code1; //, code2; - UINT8 col; - int y, x, b; - address_space &space = m_maincpu->space(AS_PROGRAM); - - // draw image - for (y = 0; y < 200; y++) - { - for (x = 0; x < 40; x++) - { - code1 = space.read_byte(0xe000 + x + y * 40); -// code2 = space.read_byte(0xc000 + x + y * 40); - for (b = 0; b < 8; b++) - { - col = ((code1 >> b) & 0x01); - bitmap.pix16(y, x * 8 + (7 - b)) = col; - } - } - } - - - return 0; -}