summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/crtc_ega.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/crtc_ega.h')
-rw-r--r--src/devices/video/crtc_ega.h34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/devices/video/crtc_ega.h b/src/devices/video/crtc_ega.h
index e5a267bed90..62bcac8c5c3 100644
--- a/src/devices/video/crtc_ega.h
+++ b/src/devices/video/crtc_ega.h
@@ -11,9 +11,9 @@
#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_count, int8_t cursor_x)
+ uint16_t y, uint8_t x, int8_t cursor_x)
#define CRTC_EGA_END_UPDATE(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -33,6 +33,7 @@ public:
auto res_out_hsync_callback() { return m_res_out_hsync_cb.bind(); }
auto res_out_vsync_callback() { return m_res_out_vsync_cb.bind(); }
auto res_out_vblank_callback() { return m_res_out_vblank_cb.bind(); }
+ auto res_out_irq_callback() { return m_res_out_irq_cb.bind(); }
template <typename... T> void set_begin_update_callback(T &&... args) { m_begin_update_cb.set(std::forward<T>(args)...); }
template <typename... T> void set_row_update_callback(T &&... args) { m_row_update_cb.set(std::forward<T>(args)...); }
@@ -73,13 +74,13 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_post_load() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
devcb_write_line m_res_out_de_cb;
devcb_write_line m_res_out_hsync_cb;
devcb_write_line m_res_out_vsync_cb;
devcb_write_line m_res_out_vblank_cb;
+ devcb_write_line m_res_out_irq_cb;
/* if specified, this gets called before any pixel update,
optionally return a pointer that will be passed to the
@@ -107,9 +108,7 @@ 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_scan_doubling; /* 0x09 */
uint8_t m_cursor_start_ras; /* 0x0a */
uint8_t m_cursor_disable; /* 0x0a */
uint8_t m_cursor_end_ras; /* 0x0b */
@@ -119,8 +118,7 @@ private:
uint16_t m_light_pen_addr; /* 0x10/0x11 */
uint16_t m_vert_retr_start; /* 0x10/0x07 */
uint8_t m_vert_retr_end; /* 0x11 */
- uint8_t m_protect; /* 0x11 */
- uint8_t m_bandwidth; /* 0x11 */
+ uint8_t m_irq_enable; /* 0x11 */
uint16_t m_vert_disp_end; /* 0x12/0x07 */
uint8_t m_offset; /* 0x13 */
uint8_t m_underline_loc; /* 0x14 */
@@ -131,6 +129,7 @@ private:
/* other internal state */
uint8_t m_register_address_latch;
+ uint16_t m_start_addr_latch;
bool m_cursor_state; /* 0 = off, 1 = on */
uint8_t m_cursor_blink_count;
int m_hpixels_per_column; /* number of pixels per video memory address */
@@ -155,18 +154,10 @@ private:
int16_t m_cursor_x;
/* timers */
- static constexpr device_timer_id TIMER_LINE = 0;
- static constexpr device_timer_id TIMER_DE_OFF = 1;
- static constexpr device_timer_id TIMER_CUR_ON = 2;
- static constexpr device_timer_id TIMER_CUR_OFF = 3;
- static constexpr device_timer_id TIMER_HSYNC_ON = 4;
- static constexpr device_timer_id TIMER_HSYNC_OFF = 5;
- static constexpr device_timer_id TIMER_LIGHT_PEN_LATCH = 6;
-
emu_timer *m_line_timer;
emu_timer *m_de_off_timer;
- emu_timer *m_cur_on_timer;
- emu_timer *m_cur_off_timer;
+ emu_timer *m_cursor_on_timer;
+ emu_timer *m_cursor_off_timer;
emu_timer *m_hsync_on_timer;
emu_timer *m_hsync_off_timer;
emu_timer *m_light_pen_latch_timer;
@@ -180,7 +171,6 @@ private:
uint16_t m_hsync_off_pos;
uint16_t m_vsync_on_pos;
uint16_t m_vsync_off_pos;
- uint16_t m_current_disp_addr; /* the display address currently drawn */
uint8_t m_light_pen_latched;
bool m_has_valid_parameters;
@@ -191,7 +181,13 @@ private:
void set_vsync(int state);
void set_vblank(int state);
void set_cur(int state);
- void handle_line_timer();
+ TIMER_CALLBACK_MEMBER(handle_line_timer);
+ TIMER_CALLBACK_MEMBER(de_off_tick);
+ TIMER_CALLBACK_MEMBER(cursor_on);
+ TIMER_CALLBACK_MEMBER(cursor_off);
+ TIMER_CALLBACK_MEMBER(hsync_on);
+ TIMER_CALLBACK_MEMBER(hsync_off);
+ TIMER_CALLBACK_MEMBER(latch_light_pen);
void update_cursor_state();
};