summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/gba_lcd.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2023-02-20 15:09:59 -0500
committer AJR <ajrhacker@users.noreply.github.com>2023-02-20 15:15:01 -0500
commit161475f27b496596c9d88590e7fffc83bd78e975 (patch)
tree6b5415f8f1d38ae6dfbad39158bfba33ec826a6b /src/devices/video/gba_lcd.cpp
parentebfec312b03bba31846ac0d14090a43418ae98f1 (diff)
gba_lcd.cpp, gf4500.cpp: Clean up error logging code and some macro usage
Diffstat (limited to 'src/devices/video/gba_lcd.cpp')
-rw-r--r--src/devices/video/gba_lcd.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/devices/video/gba_lcd.cpp b/src/devices/video/gba_lcd.cpp
index 1bc8a87e7fe..78c278b1aa5 100644
--- a/src/devices/video/gba_lcd.cpp
+++ b/src/devices/video/gba_lcd.cpp
@@ -15,7 +15,8 @@
#include "screen.h"
-#include <cstdarg>
+#define VERBOSE (0)
+#include "logmacro.h"
namespace {
@@ -65,21 +66,6 @@ namespace {
#define DISPSTAT_SET(val) HWLO_SET(0x004, val)
#define DISPSTAT_RESET(val) HWLO_RESET(0x004, val)
-#define VERBOSE_LEVEL (0)
-
-inline void ATTR_PRINTF(3,4) verboselog(device_t &device, int n_level, const char *s_fmt, ...)
-{
- if (VERBOSE_LEVEL >= n_level)
- {
- va_list v;
- char buf[32768];
- va_start(v, s_fmt);
- vsprintf(buf, s_fmt, v);
- va_end(v);
- device.logerror("%08x: %s", device.machine().describe_context(), buf);
- }
-}
-
class object
{
public:
@@ -132,7 +118,7 @@ public:
height = size_table[shape][size][1];
if (shape == 4)
- verboselog(m_device, 0, "WARNING: attempted to draw an object of invalid shape\n");
+ m_device.logerror("WARNING: attempted to draw an object of invalid shape\n");
}
private:
@@ -164,7 +150,7 @@ inline uint8_t gba_lcd_device::bg_video_mode()
if (mode > 5)
{
- verboselog(*this, 0, "WARNING: attempted to set invalid BG video mode %d\n", mode);
+ logerror("WARNING: attempted to set invalid BG video mode %d\n", mode);
return 0;
}
@@ -1583,10 +1569,10 @@ uint32_t gba_lcd_device::video_r(offs_t offset, uint32_t mem_mask)
throw emu_fatalerror("gba_lcd_device::video_r: Not enough register names in gba_lcd_device");
if (ACCESSING_BITS_0_15)
- verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2], retval & 0x0000ffff);
+ LOG("%s: GBA I/O Read: %s = %04x\n", machine().describe_context(), reg_names[offset * 2], retval & 0x0000ffff);
if (ACCESSING_BITS_16_31)
- verboselog(*this, 2, "GBA I/O Read: %s = %04x\n", reg_names[offset * 2 + 1], (retval & 0xffff0000) >> 16);
+ LOG("%s: GBA I/O Read: %s = %04x\n", machine().describe_context(), reg_names[offset * 2 + 1], (retval & 0xffff0000) >> 16);
return retval;
}
@@ -1599,10 +1585,10 @@ void gba_lcd_device::video_w(offs_t offset, uint32_t data, uint32_t mem_mask)
throw emu_fatalerror("gba_lcd_device::video_w: Not enough register names in gba_lcd_device");
if (ACCESSING_BITS_0_15)
- verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2], data & 0x0000ffff);
+ LOG("%s: GBA I/O Write: %s = %04x\n", machine().describe_context(), reg_names[offset * 2], data & 0x0000ffff);
if (ACCESSING_BITS_16_31)
- verboselog(*this, 2, "GBA I/O Write: %s = %04x\n", reg_names[offset * 2 + 1], (data & 0xffff0000) >> 16);
+ LOG("%s: GBA I/O Write: %s = %04x\n", machine().describe_context(), reg_names[offset * 2 + 1], (data & 0xffff0000) >> 16);
switch (offset)
{