mirror of
https://github.com/holub/mame
synced 2025-10-07 09:25:34 +03:00
mc6845: Fix MT #7282; improve logging (nw)
This commit is contained in:
parent
4e5394a76b
commit
2b0e0b2f0c
@ -43,7 +43,10 @@
|
|||||||
|
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|
||||||
//#define VERBOSE 1
|
#define LOG_REGS (1 << 0U)
|
||||||
|
#define LOG_CONFIG (1 << 1U)
|
||||||
|
#define VERBOSE (0)
|
||||||
|
|
||||||
#include "logmacro.h"
|
#include "logmacro.h"
|
||||||
|
|
||||||
|
|
||||||
@ -120,6 +123,12 @@ void mc6845_device::device_post_load()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mc6845_device::device_clock_changed()
|
||||||
|
{
|
||||||
|
recompute_parameters(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void mc6845_device::call_on_update_address(int strobe)
|
void mc6845_device::call_on_update_address(int strobe)
|
||||||
{
|
{
|
||||||
if (!m_on_update_addr_changed_cb.isnull())
|
if (!m_on_update_addr_changed_cb.isnull())
|
||||||
@ -202,7 +211,7 @@ uint8_t mc6845_device::register_r()
|
|||||||
|
|
||||||
void mc6845_device::register_w(uint8_t data)
|
void mc6845_device::register_w(uint8_t data)
|
||||||
{
|
{
|
||||||
LOG("%s:M6845 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data);
|
LOGMASKED(LOG_REGS, "%s:M6845 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data);
|
||||||
|
|
||||||
switch (m_register_address_latch)
|
switch (m_register_address_latch)
|
||||||
{
|
{
|
||||||
@ -331,7 +340,7 @@ uint8_t mos8563_device::register_r()
|
|||||||
|
|
||||||
void mos8563_device::register_w(uint8_t data)
|
void mos8563_device::register_w(uint8_t data)
|
||||||
{
|
{
|
||||||
LOG("%s:MOS8563 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data);
|
LOGMASKED(LOG_REGS, "%s:MOS8563 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data);
|
||||||
|
|
||||||
switch (m_register_address_latch)
|
switch (m_register_address_latch)
|
||||||
{
|
{
|
||||||
@ -418,7 +427,7 @@ uint8_t hd6345_device::register_r()
|
|||||||
|
|
||||||
void hd6345_device::register_w(uint8_t data)
|
void hd6345_device::register_w(uint8_t data)
|
||||||
{
|
{
|
||||||
LOG("%s:HD6345 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data);
|
LOGMASKED(LOG_REGS, "%s:HD6345 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data);
|
||||||
|
|
||||||
switch (m_register_address_latch)
|
switch (m_register_address_latch)
|
||||||
{
|
{
|
||||||
@ -560,7 +569,7 @@ void mc6845_device::recompute_parameters(bool postload)
|
|||||||
else
|
else
|
||||||
visarea.set(0 + m_visarea_adjust_min_x, max_visible_x + m_visarea_adjust_max_x, 0 + m_visarea_adjust_min_y, max_visible_y + m_visarea_adjust_max_y);
|
visarea.set(0 + m_visarea_adjust_min_x, max_visible_x + m_visarea_adjust_max_x, 0 + m_visarea_adjust_min_y, max_visible_y + m_visarea_adjust_max_y);
|
||||||
|
|
||||||
LOG("M6845 config screen: HTOTAL: %d VTOTAL: %d MAX_X: %d MAX_Y: %d HSYNC: %d-%d VSYNC: %d-%d Freq: %ffps\n",
|
LOGMASKED(LOG_CONFIG, "M6845 config screen: HTOTAL: %d VTOTAL: %d MAX_X: %d MAX_Y: %d HSYNC: %d-%d VSYNC: %d-%d Freq: %ffps\n",
|
||||||
horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, hsync_on_pos, hsync_off_pos - 1, vsync_on_pos, vsync_off_pos - 1, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
|
horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, hsync_on_pos, hsync_off_pos - 1, vsync_on_pos, vsync_off_pos - 1, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
|
||||||
|
|
||||||
if (has_screen())
|
if (has_screen())
|
||||||
@ -1038,7 +1047,7 @@ uint32_t mc6845_device::screen_update(screen_device &screen, bitmap_rgb32 &bitma
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOG("M6845: Invalid screen parameters - display disabled!!!\n");
|
LOGMASKED(LOG_CONFIG, "M6845: Invalid screen parameters - display disabled!!!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -112,6 +112,7 @@ protected:
|
|||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
virtual void device_post_load() 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;
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||||
|
|
||||||
bool m_supports_disp_start_addr_r;
|
bool m_supports_disp_start_addr_r;
|
||||||
|
Loading…
Reference in New Issue
Block a user