summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/mc6845.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/mc6845.h')
-rw-r--r--src/devices/video/mc6845.h117
1 files changed, 18 insertions, 99 deletions
diff --git a/src/devices/video/mc6845.h b/src/devices/video/mc6845.h
index 431c1a3608b..096102847a4 100644
--- a/src/devices/video/mc6845.h
+++ b/src/devices/video/mc6845.h
@@ -62,7 +62,9 @@ public:
// construction/destruction
mc6845_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ // HACK: show the full screen_device htotal/vtotal if true (regulate with UI slider controls)
void set_show_border_area(bool show) { m_show_border_area = show; }
+ // HACK: a static alternative of above, potentially unsafe.
void set_visarea_adjust(int min_x, int max_x, int min_y, int max_y)
{
m_visarea_adjust_min_x = min_x;
@@ -96,16 +98,16 @@ public:
void register_w(uint8_t data);
// read display enable line state
- DECLARE_READ_LINE_MEMBER( de_r );
+ int de_r();
// read cursor line state
- DECLARE_READ_LINE_MEMBER( cursor_r );
+ int cursor_r();
// read horizontal sync line state
- DECLARE_READ_LINE_MEMBER( hsync_r );
+ int hsync_r();
// read vertical sync line state
- DECLARE_READ_LINE_MEMBER( vsync_r );
+ int vsync_r();
/* return the current value on the MA0-MA13 pins */
uint16_t get_ma();
@@ -115,6 +117,7 @@ public:
/* simulates the LO->HI clocking of the light pen pin (pin 3) */
void assert_light_pen_input();
+ void assert_light_pen_input(u16);
/* set number of pixels per video memory address */
void set_hpixels_per_column(int hpixels_per_column);
@@ -132,7 +135,6 @@ protected:
virtual void device_reset() override;
virtual void device_post_load() override;
virtual void device_clock_changed() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
attotime cclks_to_attotime(uint64_t clocks) const { return clocks_to_attotime(clocks * m_clk_scale); }
uint64_t attotime_to_cclks(const attotime &duration) const { return attotime_to_clocks(duration) / m_clk_scale; }
@@ -188,20 +190,10 @@ protected:
int16_t m_cursor_x;
/* timers */
- static const device_timer_id TIMER_LINE = 0;
- static const device_timer_id TIMER_DE_OFF = 1;
- static const device_timer_id TIMER_CUR_ON = 2;
- static const device_timer_id TIMER_CUR_OFF = 3;
- static const device_timer_id TIMER_HSYNC_ON = 4;
- static const device_timer_id TIMER_HSYNC_OFF = 5;
- static const device_timer_id TIMER_LIGHT_PEN_LATCH = 6;
- static const device_timer_id TIMER_UPD_ADR = 7;
- static const device_timer_id TIMER_UPD_TRANS = 8;
-
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;
@@ -237,7 +229,15 @@ protected:
void set_cur(int state);
bool match_line();
virtual bool check_cursor_visible(uint16_t ra, uint16_t line_addr);
- 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);
+ TIMER_CALLBACK_MEMBER(adr_update_tick);
+ TIMER_CALLBACK_MEMBER(transparent_update_tick);
virtual void update_cursor_state();
virtual uint8_t draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -402,85 +402,6 @@ protected:
virtual void device_reset() override;
};
-class mos8563_device : public mc6845_device,
- public device_memory_interface,
- public device_palette_interface
-{
-public:
- mos8563_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- void address_w(uint8_t data);
- uint8_t status_r();
- uint8_t register_r();
- void register_w(uint8_t data);
-
- inline uint8_t read_videoram(offs_t offset);
- inline void write_videoram(offs_t offset, uint8_t data);
-
- MC6845_UPDATE_ROW( vdc_update_row );
-
-protected:
- mos8563_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
-
- // device_memory_interface overrides
- virtual space_config_vector memory_space_config() const override;
-
- // device_palette_interface overrides
- virtual uint32_t palette_entries() const override { return 16; }
-
- const address_space_config m_videoram_space_config;
-
- uint8_t m_char_buffer[80];
- uint8_t m_attr_buffer[80];
-
- bool m_char_blink_state;
- uint8_t m_char_blink_count;
-
- /* register file */
- uint16_t m_attribute_addr; /* 0x14/0x15 */
- uint8_t m_horiz_char; /* 0x16 */
- uint8_t m_vert_char_disp; /* 0x17 */
- uint8_t m_vert_scroll; /* 0x18 */
- uint8_t m_horiz_scroll; /* 0x19 */
- uint8_t m_color; /* 0x1a */
- uint8_t m_row_addr_incr; /* 0x1b */
- uint8_t m_char_base_addr; /* 0x1c */
- uint8_t m_underline_ras; /* 0x1d */
- uint8_t m_word_count; /* 0x1e */
- uint8_t m_data; /* 0x1f */
- uint16_t m_block_addr; /* 0x20/0x21 */
- uint16_t m_de_begin; /* 0x22/0x23 */
- uint8_t m_dram_refresh; /* 0x24 */
- uint8_t m_sync_polarity; /* 0x25 */
-
- int m_revision;
-
- virtual void update_cursor_state() override;
- virtual uint8_t draw_scanline(int y, bitmap_rgb32 &bitmap, const rectangle &cliprect) override;
-
- static const device_timer_id TIMER_BLOCK_COPY = 9;
-
- emu_timer *m_block_copy_timer;
-
- void mos8563_videoram_map(address_map &map);
-};
-
-class mos8568_device : public mos8563_device
-{
-public:
- mos8568_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
-protected:
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
-};
-
DECLARE_DEVICE_TYPE(MC6845, mc6845_device)
DECLARE_DEVICE_TYPE(MC6845_1, mc6845_1_device)
@@ -491,7 +412,5 @@ DECLARE_DEVICE_TYPE(SY6545_1, sy6545_1_device)
DECLARE_DEVICE_TYPE(SY6845E, sy6845e_device)
DECLARE_DEVICE_TYPE(HD6345, hd6345_device)
DECLARE_DEVICE_TYPE(AMS40489, ams40489_device)
-DECLARE_DEVICE_TYPE(MOS8563, mos8563_device)
-DECLARE_DEVICE_TYPE(MOS8568, mos8568_device)
#endif // MAME_VIDEO_MC6845_H