Skip to content

Commit 993d404

Browse files
committed
machine/spg110_video.cpp: Hide logging behind logmacro
1 parent 587598e commit 993d404

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

src/devices/machine/spg110_video.cpp

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include <algorithm>
88

9+
#include "logmacro.h"
10+
911

1012
DEFINE_DEVICE_TYPE(SPG110_VIDEO, spg110_video_device, "spg110_video", "SPG110 System-on-a-Chip (Video)")
1113

@@ -434,20 +436,20 @@ void spg110_video_device::update_video_irqs()
434436

435437

436438

437-
void spg110_video_device::vcomp_val_201c_w(uint16_t data) { logerror("%s: vcomp_val_201c_w: %04x\n", machine().describe_context(), data); } // during startup text only
438-
void spg110_video_device::segment_202x_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_tilebase[offset]); logerror("%s: segment/tilebase write: %02x %04x\n", machine().describe_context(), offset, data); } // confirmed as tile base, seems to apply to both layers and sprites, unlike spg2xx which has separate registers
439+
void spg110_video_device::vcomp_val_201c_w(uint16_t data) { LOG("%s: vcomp_val_201c_w: %04x\n", machine().describe_context(), data); } // during startup text only
440+
void spg110_video_device::segment_202x_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_tilebase[offset]); LOG("%s: segment/tilebase write: %02x %04x\n", machine().describe_context(), offset, data); } // confirmed as tile base, seems to apply to both layers and sprites, unlike spg2xx which has separate registers
439441

440-
void spg110_video_device::adr_mode_2028_w(uint16_t data) { logerror("%s: adr_mode_2028_w: %04x\n", machine().describe_context(), data); } // startup
442+
void spg110_video_device::adr_mode_2028_w(uint16_t data) { LOG("%s: adr_mode_2028_w: %04x\n", machine().describe_context(), data); } // startup
441443
uint16_t spg110_video_device::adr_mode_2028_r() { return 0x0000; }
442444

443-
void spg110_video_device::ext_bus_2029_w(uint16_t data) { logerror("%s: ext_bus_2029_w: %04x\n", machine().describe_context(), data); } // 0006, 0008 on startup
445+
void spg110_video_device::ext_bus_2029_w(uint16_t data) { LOG("%s: ext_bus_2029_w: %04x\n", machine().describe_context(), data); } // 0006, 0008 on startup
444446
uint16_t spg110_video_device::ext_bus_2029_r() { return 0x0000; }
445447

446-
void spg110_video_device::win_mask_1_2031_w(uint16_t data) { logerror("%s: win_mask_1_2031_w: %04x\n", machine().describe_context(), data); } // 014a or 0000 when ball is in trap
447-
void spg110_video_device::win_mask_2_2032_w(uint16_t data) { logerror("%s: win_mask_2_2032_w: %04x\n", machine().describe_context(), data); } // 014a most of the time, 0000 very rarely
448-
void spg110_video_device::win_attribute_w(uint16_t data) { logerror("%s: win_attribute_w: %04x\n", machine().describe_context(), data); } // changes, situational, eg when pausing
449-
void spg110_video_device::win_mask_3_2034_w(uint16_t data) { logerror("%s: win_mask_3_2034_w: %04x\n", machine().describe_context(), data); } // 0141 on every scene transition
450-
void spg110_video_device::win_mask_4_2035_w(uint16_t data) { logerror("%s: win_mask_4_2035_w: %04x\n", machine().describe_context(), data); } // 0141 on every scene transition
448+
void spg110_video_device::win_mask_1_2031_w(uint16_t data) { LOG("%s: win_mask_1_2031_w: %04x\n", machine().describe_context(), data); } // 014a or 0000 when ball is in trap
449+
void spg110_video_device::win_mask_2_2032_w(uint16_t data) { LOG("%s: win_mask_2_2032_w: %04x\n", machine().describe_context(), data); } // 014a most of the time, 0000 very rarely
450+
void spg110_video_device::win_attribute_w(uint16_t data) { LOG("%s: win_attribute_w: %04x\n", machine().describe_context(), data); } // changes, situational, eg when pausing
451+
void spg110_video_device::win_mask_3_2034_w(uint16_t data) { LOG("%s: win_mask_3_2034_w: %04x\n", machine().describe_context(), data); } // 0141 on every scene transition
452+
void spg110_video_device::win_mask_4_2035_w(uint16_t data) { LOG("%s: win_mask_4_2035_w: %04x\n", machine().describe_context(), data); } // 0141 on every scene transition
451453

452454
void spg110_video_device::irq_tm_v_2036_w(uint16_t data)
453455
{
@@ -473,19 +475,19 @@ void spg110_video_device::irq_tm_h_2037_w(uint16_t data)
473475
void spg110_video_device::effect_control_2039_w(uint16_t data)
474476
{
475477
// 0803 on every scene transition
476-
logerror("%s: effect_control_2039_w: %04x\n", machine().describe_context(), data);
478+
LOG("%s: effect_control_2039_w: %04x\n", machine().describe_context(), data);
477479
}
478480

479481
void spg110_video_device::huereference_203c_w(uint16_t data)
480482
{
481483
// 0006 on startup, twice
482-
logerror("%s: huereference_203c_w: %04x\n", machine().describe_context(), data);
483-
}
484+
LOG("%s: huereference_203c_w: %04x\n", machine().describe_context(), data);
485+
}
484486

485487
void spg110_video_device::lum_adjust_203d_w(uint16_t data)
486488
{
487489
// changes, usually between scenes (brightness)
488-
logerror("%s: lum_adjust_203d_w: %04x\n", machine().describe_context(), data);
490+
LOG("%s: lum_adjust_203d_w: %04x\n", machine().describe_context(), data);
489491
}
490492

491493
uint16_t spg110_video_device::sp_control_2042_r()
@@ -496,13 +498,13 @@ uint16_t spg110_video_device::sp_control_2042_r()
496498
void spg110_video_device::sp_control_2042_w(uint16_t data)
497499
{
498500
// sets bit 0x0004, masks with 0xfffb etc.
499-
logerror("%s: sp_control_2042_w: %04x\n", machine().describe_context(), data);
501+
LOG("%s: sp_control_2042_w: %04x\n", machine().describe_context(), data);
500502
}
501503

502504
void spg110_video_device::spg110_2045_w(uint16_t data)
503505
{
504506
// 0006 on startup, once
505-
logerror("%s: spg110_2045_w: %04x\n", machine().describe_context(), data);
507+
LOG("%s: spg110_2045_w: %04x\n", machine().describe_context(), data);
506508
}
507509

508510
void spg110_video_device::transparent_color_205x_w(offs_t offset, uint16_t data, uint16_t mem_mask)
@@ -527,12 +529,12 @@ void spg110_video_device::dma_len_trigger_2062_w(uint16_t data)
527529
update_video_irqs();
528530

529531
// this is presumably a counter that underflows to 0x1fff, because that's what the wait loop waits for?
530-
logerror("%s: (trigger len) %04x with values (dstseg) %04x (dststep) %04x (srchigh) %04x (src step) %04x | (dst) %04x (src) %04x\n", machine().describe_context(), data, m_dma_dst_seg, m_dma_dst_step, m_dma_src_seg, m_dma_src_step, m_dma_dst, m_dma_src);
532+
LOG("%s: (trigger len) %04x with values (dstseg) %04x (dststep) %04x (srchigh) %04x (src step) %04x | (dst) %04x (src) %04x\n", machine().describe_context(), data, m_dma_dst_seg, m_dma_dst_step, m_dma_src_seg, m_dma_src_step, m_dma_dst, m_dma_src);
531533

532534
/*
533535
if (m_dma_dst_seg != 0x0000)
534536
{
535-
logerror("unknown DMA params are not zero!\n");
537+
LOG("unknown DMA params are not zero!\n");
536538
}
537539
*/
538540

@@ -592,34 +594,34 @@ void spg110_video_device::tilemap_write_regs(int which, uint16_t* regs, int regn
592594
switch (regno)
593595
{
594596
case 0x0: // Page X scroll
595-
logerror("video_w: Page %d X Scroll = %04x\n", which, data & 0x01ff);
597+
LOG("video_w: Page %d X Scroll = %04x\n", which, data & 0x01ff);
596598
regs[regno] = data & 0x01ff;
597599
break;
598600

599601
case 0x1: // Page Y scroll
600-
logerror("video_w: Page %d Y Scroll = %04x\n", which, data & 0x00ff);
602+
LOG("video_w: Page %d Y Scroll = %04x\n", which, data & 0x00ff);
601603
regs[regno] = data & 0x00ff;
602604
break;
603605

604606
case 0x2: // Page Attributes
605-
logerror("video_w: Page %d Attributes = %04x (Priority:%d, Palette:%d, VSize:%d, HSize:%d, FlipY:%d, FlipX:%d, BPP:%d)\n", which, data
607+
LOG("video_w: Page %d Attributes = %04x (Priority:%d, Palette:%d, VSize:%d, HSize:%d, FlipY:%d, FlipX:%d, BPP:%d)\n", which, data
606608
, (data >> 12) & 3, (data >> 8) & 15, 8 << ((data >> 6) & 3), 8 << ((data >> 4) & 3), BIT(data, 3), BIT(data, 2), 2 * ((data & 3) + 1));
607609
regs[regno] = data;
608610
break;
609611

610612
case 0x3: // Page Control
611-
logerror("video_w: Page %d Control = %04x (Blend:%d, HiColor:%d, RowScroll:%d, Enable:%d, Wallpaper:%d, RegSet:%d, Bitmap:%d)\n", which, data
613+
LOG("video_w: Page %d Control = %04x (Blend:%d, HiColor:%d, RowScroll:%d, Enable:%d, Wallpaper:%d, RegSet:%d, Bitmap:%d)\n", which, data
612614
, BIT(data, 8), BIT(data, 7), BIT(data, 4), BIT(data, 3), BIT(data, 2), BIT(data, 1), BIT(data, 0));
613615
regs[regno] = data;
614616
break;
615617

616618
case 0x4: // Page Tile Address
617-
logerror("video_w: Page %d Tile Address = %04x\n", which, data);
619+
LOG("video_w: Page %d Tile Address = %04x\n", which, data);
618620
regs[regno] = data;
619621
break;
620622

621623
case 0x5: // Page Attribute Address
622-
logerror("video_w: Page %d Attribute Address = %04x\n", which, data);
624+
LOG("video_w: Page %d Attribute Address = %04x\n", which, data);
623625
regs[regno] = data;
624626
break;
625627
}

0 commit comments

Comments
 (0)