summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/discrete.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes/discrete.cpp')
-rw-r--r--src/devices/bus/nes/discrete.cpp80
1 files changed, 19 insertions, 61 deletions
diff --git a/src/devices/bus/nes/discrete.cpp b/src/devices/bus/nes/discrete.cpp
index 6cdaa63d3ba..7705c4ba1bc 100644
--- a/src/devices/bus/nes/discrete.cpp
+++ b/src/devices/bus/nes/discrete.cpp
@@ -20,12 +20,11 @@
#ifdef NES_PCB_DEBUG
-#define VERBOSE 1
+#define VERBOSE (LOG_GENERAL)
#else
-#define VERBOSE 0
+#define VERBOSE (0)
#endif
-
-#define LOG_MMC(x) do { if (VERBOSE) logerror x; } while (0)
+#include "logmacro.h"
//-------------------------------------------------
@@ -38,22 +37,22 @@ DEFINE_DEVICE_TYPE(NES_74X377, nes_74x377_device, "nes_74x377",
DEFINE_DEVICE_TYPE(NES_74X161X138, nes_74x161x138_device, "nes_bitcorp_dis", "NES Cart Discrete Logic (74*161/138) PCB")
-nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_74X161X161X32, tag, owner, clock)
{
}
-nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_74X139X74, tag, owner, clock)
{
}
-nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_74X377, tag, owner, clock)
{
}
-nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_74X161X138, tag, owner, clock)
{
}
@@ -61,54 +60,13 @@ nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, cons
-void nes_74x161x161x32_device::device_start()
-{
- common_start();
-}
-
void nes_74x161x161x32_device::pcb_reset()
{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg16_89ab(0);
- prg16_cdef(m_prg_chunks - 1);
- chr8(0, m_chr_source);
-}
-
-void nes_74x139x74_device::device_start()
-{
- common_start();
-}
-
-void nes_74x139x74_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, m_chr_source);
-}
-
-void nes_74x377_device::device_start()
-{
- common_start();
-}
-
-void nes_74x377_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
-void nes_74x161x138_device::device_start()
-{
- common_start();
-}
-
-void nes_74x161x138_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
+ if (m_pcb_ctrl_mirror)
+ set_nt_mirroring(PPU_MIRROR_LOW);
}
@@ -131,9 +89,9 @@ void nes_74x161x138_device::pcb_reset()
-------------------------------------------------*/
// there are two 'variants' depending on hardwired or mapper ctrl mirroring
-void nes_74x161x161x32_device::write_h(offs_t offset, uint8_t data)
+void nes_74x161x161x32_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("74x161x161x32 write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("74x161x161x32 write_h, offset: %04x, data: %02x\n", offset, data);
// this pcb is subject to bus conflict
data = account_bus_conflict(offset, data);
@@ -152,11 +110,11 @@ void nes_74x161x161x32_device::write_h(offs_t offset, uint8_t data)
-------------------------------------------------*/
-void nes_74x139x74_device::write_m(offs_t offset, uint8_t data)
+void nes_74x139x74_device::write_m(offs_t offset, u8 data)
{
- LOG_MMC(("74x139x74 write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("74x139x74 write_m, offset: %04x, data: %02x\n", offset, data);
- chr8(((data & 0x02) >> 1) | ((data & 0x01) << 1), CHRROM);
+ chr8(bitswap<2>(data, 0, 1), CHRROM);
}
/*-------------------------------------------------
@@ -167,7 +125,7 @@ void nes_74x139x74_device::write_m(offs_t offset, uint8_t data)
iNES: mapper 11
- In MESS: Supported
+ In MAME: Supported
Note: bit2 & bit3 are actually related to CIC lockout
defeating, and real Color Dreams titles use only
@@ -176,9 +134,9 @@ void nes_74x139x74_device::write_m(offs_t offset, uint8_t data)
-------------------------------------------------*/
-void nes_74x377_device::write_h(offs_t offset, uint8_t data)
+void nes_74x377_device::write_h(offs_t offset, u8 data)
{
- LOG_MMC(("74x377 write_h, offset: %04x, data: %02x\n", offset, data));
+ LOG("74x377 write_h, offset: %04x, data: %02x\n", offset, data);
// this pcb is subject to bus conflict, but not the prototype of Secret Scout, which actually breaks in case of conflict...
data = account_bus_conflict(offset, data);
@@ -197,9 +155,9 @@ void nes_74x377_device::write_h(offs_t offset, uint8_t data)
-------------------------------------------------*/
-void nes_74x161x138_device::write_m(offs_t offset, uint8_t data)
+void nes_74x161x138_device::write_m(offs_t offset, u8 data)
{
- LOG_MMC(("74x161x138 write_m, offset: %04x, data: %02x\n", offset, data));
+ LOG("74x161x138 write_m, offset: %04x, data: %02x\n", offset, data);
chr8(data >> 2, CHRROM);
prg32(data);