mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
ega: irq and row preset
at: irq2 is redirected to pic2 ir1
This commit is contained in:
parent
4b82bafcf3
commit
ed5ba1c0b3
@ -507,23 +507,23 @@ ROM_END
|
||||
|
||||
INPUT_PORTS_START( ega )
|
||||
PORT_START( "config" )
|
||||
PORT_CONFNAME( 0x0f, 0x09, "dipswitches" )
|
||||
PORT_CONFSETTING( 0x00, "0000 - MDA PRIMARY, EGA COLOR, 40x25" ) /* DIAG: ?? 40 cols, RGBI */
|
||||
PORT_CONFSETTING( 0x08, "0001 - MDA PRIMARY, EGA COLOR, 80x25" ) /* DIAG: ?? 80 cols, RGBI */
|
||||
PORT_CONFSETTING( 0x04, "0010 - MDA PRIMARY, EGA HI RES EMULATE (SAME AS 0001)" ) /* DIAG: ?? 80 cols, RGBI */
|
||||
PORT_CONFSETTING( 0x0c, "0011 - MDA PRIMARY, EGA HI RES ENHANCED" ) /* DIAG: Color Display 40 cols, RrGgBb */
|
||||
PORT_CONFSETTING( 0x02, "0100 - CGA 40 PRIMARY, EGA MONOCHROME" ) /* DIAG: ??, Mono RGBI */
|
||||
PORT_CONFSETTING( 0x0a, "0101 - CGA 80 PRIMARY, EGA MONOCHROME" ) /* DIAG: ??, Mono RGBI */
|
||||
PORT_CONFSETTING( 0x06, "0110 - MDA SECONDARY, EGA COLOR, 40x25" ) /* DIAG: Color Display 40 cols, RGBI */
|
||||
PORT_CONFSETTING( 0x0e, "0111 - MDA SECONDARY, EGA COLOR, 80x25" ) /* DIAG: Color Display 80 cols, RGBI */
|
||||
PORT_CONFSETTING( 0x01, "1000 - MDA SECONDARY, EGA HI RES EMULATE (SAME AS 0111)" ) /* DIAG: Color Display 80 cols, RGBI */
|
||||
PORT_CONFSETTING( 0x09, "1001 - MDA SECONDARY, EGA HI RES ENHANCED" ) /* DIAG: Color Display 40 cols, RrGgBb */
|
||||
PORT_CONFSETTING( 0x05, "1010 - COLOR 40 SECONDARY, EGA" ) /* DIAG: Monochrome display, Mono RGBI */
|
||||
PORT_CONFSETTING( 0x0d, "1011 - COLOR 80 SECONDARY, EGA" ) /* DIAG: Monochrome display, Mono RGBI */
|
||||
PORT_CONFSETTING( 0x03, "1100 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_CONFSETTING( 0x0b, "1101 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_CONFSETTING( 0x07, "1110 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_CONFSETTING( 0x0f, "1111 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_DIPNAME( 0x0f, 0x09, "Display Type" )
|
||||
PORT_DIPSETTING( 0x00, "0000 - MDA PRIMARY, EGA COLOR, 40x25" ) /* DIAG: ?? 40 cols, RGBI */
|
||||
PORT_DIPSETTING( 0x08, "0001 - MDA PRIMARY, EGA COLOR, 80x25" ) /* DIAG: ?? 80 cols, RGBI */
|
||||
PORT_DIPSETTING( 0x04, "0010 - MDA PRIMARY, EGA HI RES EMULATE (SAME AS 0001)" ) /* DIAG: ?? 80 cols, RGBI */
|
||||
PORT_DIPSETTING( 0x0c, "0011 - MDA PRIMARY, EGA HI RES ENHANCED" ) /* DIAG: Color Display 40 cols, RrGgBb */
|
||||
PORT_DIPSETTING( 0x02, "0100 - CGA 40 PRIMARY, EGA MONOCHROME" ) /* DIAG: ??, Mono RGBI */
|
||||
PORT_DIPSETTING( 0x0a, "0101 - CGA 80 PRIMARY, EGA MONOCHROME" ) /* DIAG: ??, Mono RGBI */
|
||||
PORT_DIPSETTING( 0x06, "0110 - MDA SECONDARY, EGA COLOR, 40x25" ) /* DIAG: Color Display 40 cols, RGBI */
|
||||
PORT_DIPSETTING( 0x0e, "0111 - MDA SECONDARY, EGA COLOR, 80x25" ) /* DIAG: Color Display 80 cols, RGBI */
|
||||
PORT_DIPSETTING( 0x01, "1000 - MDA SECONDARY, EGA HI RES EMULATE (SAME AS 0111)" ) /* DIAG: Color Display 80 cols, RGBI */
|
||||
PORT_DIPSETTING( 0x09, "1001 - MDA SECONDARY, EGA HI RES ENHANCED" ) /* DIAG: Color Display 40 cols, RrGgBb */
|
||||
PORT_DIPSETTING( 0x05, "1010 - COLOR 40 SECONDARY, EGA" ) /* DIAG: Monochrome display, Mono RGBI */
|
||||
PORT_DIPSETTING( 0x0d, "1011 - COLOR 80 SECONDARY, EGA" ) /* DIAG: Monochrome display, Mono RGBI */
|
||||
PORT_DIPSETTING( 0x03, "1100 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_DIPSETTING( 0x0b, "1101 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_DIPSETTING( 0x07, "1110 - RESERVED" ) /* ??, RGBI */
|
||||
PORT_DIPSETTING( 0x0f, "1111 - RESERVED" ) /* ??, RGBI */
|
||||
INPUT_PORTS_END
|
||||
|
||||
//**************************************************************************
|
||||
@ -554,7 +554,7 @@ void isa8_ega_device::device_add_mconfig(machine_config &config)
|
||||
m_crtc_ega->res_out_hsync_callback().set(FUNC(isa8_ega_device::hsync_changed));
|
||||
m_crtc_ega->res_out_vsync_callback().set(FUNC(isa8_ega_device::vsync_changed));
|
||||
m_crtc_ega->res_out_vblank_callback().set(FUNC(isa8_ega_device::vblank_changed));
|
||||
m_crtc_ega->res_out_irq_callback().set([this](int state) { m_isa->irq2_w(state); });
|
||||
m_crtc_ega->res_out_irq_callback().set([this](int state) { m_irq = state; m_isa->irq2_w(state); });
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -588,7 +588,7 @@ isa8_ega_device::isa8_ega_device(const machine_config &mconfig, device_type type
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
device_isa8_card_interface(mconfig, *this),
|
||||
m_crtc_ega(*this, EGA_CRTC_NAME), m_videoram(nullptr), m_charA(nullptr), m_charB(nullptr),
|
||||
m_misc_output(0), m_feature_control(0), m_frame_cnt(0), m_hsync(0), m_vsync(0), m_vblank(0), m_display_enable(0), m_video_mode(0),
|
||||
m_misc_output(0), m_feature_control(0), m_frame_cnt(0), m_hsync(0), m_vsync(0), m_vblank(0), m_display_enable(0), m_irq(0), m_video_mode(0),
|
||||
m_palette(*this, "palette")
|
||||
{
|
||||
}
|
||||
@ -669,6 +669,7 @@ void isa8_ega_device::device_reset()
|
||||
m_vsync = 0;
|
||||
m_vblank = 0;
|
||||
m_display_enable = 0;
|
||||
m_irq = 0;
|
||||
|
||||
install_banks();
|
||||
|
||||
@ -754,7 +755,7 @@ void isa8_ega_device::install_banks()
|
||||
}
|
||||
}
|
||||
|
||||
CRTC_EGA_ROW_UPDATE( isa8_ega_device::ega_update_row )
|
||||
CRTC_EGA_PIXEL_UPDATE( isa8_ega_device::ega_update_row )
|
||||
{
|
||||
if (m_video_mode == EGA_MODE_GRAPHICS)
|
||||
pc_ega_graphics(bitmap, cliprect, ma, ra, y, x, cursor_x);
|
||||
@ -791,7 +792,7 @@ WRITE_LINE_MEMBER( isa8_ega_device::vblank_changed )
|
||||
}
|
||||
|
||||
|
||||
CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics )
|
||||
CRTC_EGA_PIXEL_UPDATE( isa8_ega_device::pc_ega_graphics )
|
||||
{
|
||||
uint16_t *p = &bitmap.pix(y, x * 8);
|
||||
|
||||
@ -852,7 +853,7 @@ CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_graphics )
|
||||
}
|
||||
|
||||
|
||||
CRTC_EGA_ROW_UPDATE( isa8_ega_device::pc_ega_text )
|
||||
CRTC_EGA_PIXEL_UPDATE( isa8_ega_device::pc_ega_text )
|
||||
{
|
||||
uint16_t *p = &bitmap.pix(y, x * ( ( m_sequencer.data[0x01] & 0x01 ) ? 8 : 9 ) );
|
||||
|
||||
@ -1289,7 +1290,7 @@ uint8_t isa8_ega_device::pc_ega8_3c0_r(offs_t offset)
|
||||
|
||||
data = ( data & 0x0f );
|
||||
data |= ( ( m_feature_control & 0x03 ) << 5 );
|
||||
data |= ( m_vsync ? 0x00 : 0x80 );
|
||||
data |= ( m_irq ? 0x00 : 0x80 );
|
||||
data |= ( ( ( dips >> ( ( ( m_misc_output & 0x0c ) >> 2 ) ) ) & 0x01 ) << 4 );
|
||||
}
|
||||
break;
|
||||
|
@ -32,8 +32,8 @@ public:
|
||||
uint8_t pc_ega8_3d0_r(offs_t offset);
|
||||
void pc_ega8_3d0_w(offs_t offset, uint8_t data);
|
||||
|
||||
CRTC_EGA_ROW_UPDATE(pc_ega_graphics);
|
||||
CRTC_EGA_ROW_UPDATE(pc_ega_text);
|
||||
CRTC_EGA_PIXEL_UPDATE(pc_ega_graphics);
|
||||
CRTC_EGA_PIXEL_UPDATE(pc_ega_text);
|
||||
|
||||
protected:
|
||||
isa8_ega_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
@ -55,7 +55,7 @@ private:
|
||||
DECLARE_WRITE_LINE_MEMBER(vsync_changed);
|
||||
DECLARE_WRITE_LINE_MEMBER(vblank_changed);
|
||||
|
||||
CRTC_EGA_ROW_UPDATE(ega_update_row);
|
||||
CRTC_EGA_PIXEL_UPDATE(ega_update_row);
|
||||
|
||||
public:
|
||||
required_device<crtc_ega_device> m_crtc_ega;
|
||||
@ -104,6 +104,7 @@ public:
|
||||
uint8_t m_vsync;
|
||||
uint8_t m_vblank;
|
||||
uint8_t m_display_enable;
|
||||
uint8_t m_irq;
|
||||
int m_video_mode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
@ -27,7 +27,7 @@ crtc_ega_device::crtc_ega_device(const machine_config &mconfig, const char *tag,
|
||||
, m_horiz_char_total(0), m_horiz_disp(0), m_horiz_blank_start(0), m_horiz_blank_end(0)
|
||||
, m_ena_vert_access(0), m_de_skew(0)
|
||||
, m_horiz_retr_start(0), m_horiz_retr_end(0), m_horiz_retr_skew(0)
|
||||
, m_vert_total(0), m_preset_row_scan(0), m_byte_panning(0), m_max_ras_addr(0)
|
||||
, m_vert_total(0), m_preset_row_scan(0), m_max_ras_addr(0)
|
||||
, m_cursor_start_ras(0), m_cursor_disable(0), m_cursor_end_ras(0), m_cursor_skew(0)
|
||||
, m_disp_start_addr(0), m_cursor_addr(0), m_light_pen_addr(0)
|
||||
, m_vert_retr_start(0), m_vert_retr_end(0)
|
||||
@ -106,7 +106,6 @@ void crtc_ega_device::register_w(uint8_t data)
|
||||
m_line_compare = ((data & 0x10) << 4) | (m_line_compare & 0x00ff);
|
||||
break;
|
||||
case 0x08: m_preset_row_scan = data & 0x1f;
|
||||
m_byte_panning = ((data & 0x60) >> 5);
|
||||
break;
|
||||
case 0x09: m_max_ras_addr = data & 0x1f;
|
||||
break;
|
||||
@ -280,7 +279,7 @@ void crtc_ega_device::set_vblank(int state)
|
||||
|
||||
if (!m_res_out_vblank_cb.isnull())
|
||||
m_res_out_vblank_cb(m_vblank);
|
||||
if (!m_res_out_irq_cb.isnull() && m_irq_enable)
|
||||
if (!m_res_out_irq_cb.isnull() && !m_irq_enable)
|
||||
m_res_out_irq_cb(m_vblank);
|
||||
}
|
||||
}
|
||||
@ -532,6 +531,7 @@ uint32_t crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bit
|
||||
{
|
||||
uint16_t y;
|
||||
uint16_t disp_addr = m_disp_start_addr + (m_offset << 1) * cliprect.min_y;
|
||||
uint8_t row_preset = m_preset_row_scan;
|
||||
|
||||
assert(!m_row_update_cb.isnull());
|
||||
|
||||
@ -543,7 +543,7 @@ uint32_t crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bit
|
||||
for (y = cliprect.min_y; y <= cliprect.max_y; y++)
|
||||
{
|
||||
/* compute the current raster line */
|
||||
uint8_t ra = y % (m_max_ras_addr + 1);
|
||||
uint8_t ra = (y + row_preset) % (m_max_ras_addr + 1);
|
||||
|
||||
/* check if the cursor is visible and is on this scanline */
|
||||
int cursor_visible = m_cursor_state &&
|
||||
@ -572,7 +572,10 @@ uint32_t crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bit
|
||||
disp_addr += (m_offset << 1);
|
||||
|
||||
if (y == m_line_compare)
|
||||
{
|
||||
row_preset = 0;
|
||||
disp_addr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* call the tear down function if any */
|
||||
@ -625,7 +628,6 @@ void crtc_ega_device::device_start()
|
||||
m_horiz_retr_end = 0;
|
||||
m_horiz_retr_skew = 0;
|
||||
m_preset_row_scan = 0;
|
||||
m_byte_panning = 0;
|
||||
m_cursor_start_ras = 0x20;
|
||||
m_cursor_disable = 0;
|
||||
m_cursor_end_ras = 0;
|
||||
@ -679,7 +681,6 @@ void crtc_ega_device::device_start()
|
||||
save_item(NAME(m_horiz_retr_skew));
|
||||
save_item(NAME(m_vert_total));
|
||||
save_item(NAME(m_preset_row_scan));
|
||||
save_item(NAME(m_byte_panning));
|
||||
save_item(NAME(m_max_ras_addr));
|
||||
save_item(NAME(m_cursor_disable));
|
||||
save_item(NAME(m_cursor_skew));
|
||||
@ -691,6 +692,7 @@ void crtc_ega_device::device_start()
|
||||
save_item(NAME(m_vert_blank_start));
|
||||
save_item(NAME(m_vert_blank_end));
|
||||
save_item(NAME(m_line_compare));
|
||||
save_item(NAME(m_irq_enable));
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
#define CRTC_EGA_BEGIN_UPDATE(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
#define CRTC_EGA_ROW_UPDATE(_name) void _name(bitmap_ind16 &bitmap, \
|
||||
#define CRTC_EGA_PIXEL_UPDATE(_name) void _name(bitmap_ind16 &bitmap, \
|
||||
const rectangle &cliprect, uint16_t ma, uint8_t ra, \
|
||||
uint16_t y, uint8_t x, int8_t cursor_x)
|
||||
#define CRTC_EGA_END_UPDATE(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
@ -108,7 +108,6 @@ private:
|
||||
uint8_t m_horiz_retr_skew; /* 0x05 */
|
||||
uint16_t m_vert_total; /* 0x06/0x07 */
|
||||
uint8_t m_preset_row_scan; /* 0x08 */
|
||||
uint8_t m_byte_panning; /* 0x08 */
|
||||
uint8_t m_max_ras_addr; /* 0x09 */
|
||||
uint8_t m_cursor_start_ras; /* 0x0a */
|
||||
uint8_t m_cursor_disable; /* 0x0a */
|
||||
|
@ -146,7 +146,7 @@ void fruitpc_state::fruitpc(machine_config &config)
|
||||
ISA8(config, m_isabus, 0);
|
||||
m_isabus->set_memspace("maincpu", AS_PROGRAM);
|
||||
m_isabus->set_iospace("maincpu", AS_IO);
|
||||
m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir2_w));
|
||||
m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir1_w));
|
||||
m_isabus->irq3_callback().set("pic8259_1", FUNC(pic8259_device::ir3_w));
|
||||
m_isabus->irq4_callback().set("pic8259_1", FUNC(pic8259_device::ir4_w));
|
||||
m_isabus->irq5_callback().set("pic8259_1", FUNC(pic8259_device::ir5_w));
|
||||
|
@ -230,7 +230,7 @@ void magtouch_state::magtouch(machine_config &config)
|
||||
ISA8(config, m_isabus, 0);
|
||||
m_isabus->set_memspace("maincpu", AS_PROGRAM);
|
||||
m_isabus->set_iospace("maincpu", AS_IO);
|
||||
m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir2_w));
|
||||
m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir1_w));
|
||||
m_isabus->irq3_callback().set("pic8259_1", FUNC(pic8259_device::ir3_w));
|
||||
//m_isabus->irq4_callback().set("pic8259_1", FUNC(pic8259_device::ir4_w));
|
||||
m_isabus->irq5_callback().set("pic8259_1", FUNC(pic8259_device::ir5_w));
|
||||
|
@ -209,7 +209,7 @@ void pcat_dyn_state::pcat_dyn(machine_config &config)
|
||||
ISA8(config, m_isabus, 0);
|
||||
m_isabus->set_memspace("maincpu", AS_PROGRAM);
|
||||
m_isabus->set_iospace("maincpu", AS_IO);
|
||||
m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir2_w));
|
||||
m_isabus->irq2_callback().set("pic8259_2", FUNC(pic8259_device::ir1_w));
|
||||
m_isabus->irq3_callback().set("pic8259_1", FUNC(pic8259_device::ir3_w));
|
||||
//m_isabus->irq4_callback().set("pic8259_1", FUNC(pic8259_device::ir4_w));
|
||||
//m_isabus->irq5_callback().set("pic8259_1", FUNC(pic8259_device::ir5_w));
|
||||
|
@ -1121,7 +1121,7 @@ void apollo_state::common(machine_config &config)
|
||||
|
||||
ISA16(config, m_isa, 0);
|
||||
m_isa->set_custom_spaces();
|
||||
m_isa->irq2_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir2_w)); // in place of irq 2 on at irq 9 is used
|
||||
m_isa->irq2_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir1_w)); // in place of irq 2 on at irq 9 is used
|
||||
m_isa->irq3_callback().set(m_pic8259_master, FUNC(pic8259_device::ir3_w));
|
||||
m_isa->irq4_callback().set(m_pic8259_master, FUNC(pic8259_device::ir4_w));
|
||||
m_isa->irq5_callback().set(m_pic8259_master, FUNC(pic8259_device::ir5_w));
|
||||
|
@ -110,7 +110,7 @@ void at_mb_device::device_add_mconfig(machine_config &config)
|
||||
ISA16(config, m_isabus, 0);
|
||||
m_isabus->set_memspace(":maincpu", AS_PROGRAM);
|
||||
m_isabus->set_iospace(":maincpu", AS_IO);
|
||||
m_isabus->irq2_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir2_w)); // in place of irq 2 on at irq 9 is used
|
||||
m_isabus->irq2_callback().set(m_pic8259_slave, FUNC(pic8259_device::ir1_w)); // in place of irq 2 on at irq 9 is used
|
||||
m_isabus->irq3_callback().set("pic8259_master", FUNC(pic8259_device::ir3_w));
|
||||
m_isabus->irq4_callback().set("pic8259_master", FUNC(pic8259_device::ir4_w));
|
||||
m_isabus->irq5_callback().set("pic8259_master", FUNC(pic8259_device::ir5_w));
|
||||
|
Loading…
Reference in New Issue
Block a user