summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/subor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes/subor.cpp')
-rw-r--r--src/devices/bus/nes/subor.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/devices/bus/nes/subor.cpp b/src/devices/bus/nes/subor.cpp
index 0fa25b2b5bb..109e1625fdd 100644
--- a/src/devices/bus/nes/subor.cpp
+++ b/src/devices/bus/nes/subor.cpp
@@ -17,12 +17,11 @@
#include "subor.h"
#ifdef NES_PCB_DEBUG
-#define VERBOSE 1
+#define VERBOSE (LOG_GENERAL)
#else
-#define VERBOSE 0
+#define VERBOSE (0)
#endif
-
-#define LOG_MMC(...) do { if (VERBOSE) logerror(__VA_ARGS__); } while (0)
+#include "logmacro.h"
//**************************************************************************
// DEVICE DEFINITIONS
@@ -98,7 +97,6 @@ void nes_subor2_device::device_start()
void nes_subor0_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(0x20);
chr8(0, m_chr_source);
@@ -108,7 +106,6 @@ void nes_subor0_device::pcb_reset()
void nes_subor1_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(0x07);
chr8(0, m_chr_source);
@@ -185,12 +182,10 @@ void nes_subor2_device::ppu_latch(offs_t offset)
uint8_t nes_subor2_device::nt_r(offs_t offset)
{
- int page = ((offset & 0xc00) >> 10);
-
- /* Nametable reads report the current page; this seems to work without issues */
- m_page = page;
+ // Nametable reads report the current page; this seems to work without issues
+ m_page = BIT(offset, 10, 2);
- return m_nt_access[page][offset & 0x3ff];
+ return device_nes_cart_interface::nt_r(offset);
}
/*-------------------------------------------------
@@ -236,7 +231,7 @@ void nes_subor2_device::update_banks()
uint8_t nes_subor2_device::read_l(offs_t offset)
{
- LOG_MMC("subor2 read_l, offset: %04x\n", offset);
+ LOG("subor2 read_l, offset: %04x\n", offset);
if (offset == 0x1200)
{
@@ -252,9 +247,9 @@ uint8_t nes_subor2_device::read_l(offs_t offset)
void nes_subor0_device::write_h(offs_t offset, uint8_t data)
{
uint8_t subor_helper1, subor_helper2;
- LOG_MMC("subor0 write_h, offset: %04x, data: %02x\n", offset, data);
+ LOG("subor0 write_h, offset: %04x, data: %02x\n", offset, data);
- m_reg[(offset >> 13) & 0x03] = data;
+ m_reg[BIT(offset, 13, 2)] = data;
subor_helper1 = ((m_reg[0] ^ m_reg[1]) << 1) & 0x20;
subor_helper2 = ((m_reg[2] ^ m_reg[3]) << 0) & 0x1f;
@@ -282,9 +277,9 @@ void nes_subor0_device::write_h(offs_t offset, uint8_t data)
void nes_subor1_device::write_h(offs_t offset, uint8_t data)
{
uint8_t subor_helper1, subor_helper2;
- LOG_MMC("subor1 write_h, offset: %04x, data: %02x\n", offset, data);
+ LOG("subor1 write_h, offset: %04x, data: %02x\n", offset, data);
- m_reg[(offset >> 13) & 0x03] = data;
+ m_reg[BIT(offset, 13, 2)] = data;
subor_helper1 = ((m_reg[0] ^ m_reg[1]) << 1) & 0x20;
subor_helper2 = ((m_reg[2] ^ m_reg[3]) << 0) & 0x1f;
@@ -311,7 +306,7 @@ void nes_subor1_device::write_h(offs_t offset, uint8_t data)
void nes_subor2_device::write_l(offs_t offset, uint8_t data)
{
- LOG_MMC("subor2 write_l, offset: %04x, data: %02x\n", offset, data);
+ LOG("subor2 write_l, offset: %04x, data: %02x\n", offset, data);
switch (offset)
{