summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes/hes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes/hes.cpp')
-rw-r--r--src/devices/bus/nes/hes.cpp39
1 files changed, 12 insertions, 27 deletions
diff --git a/src/devices/bus/nes/hes.cpp b/src/devices/bus/nes/hes.cpp
index 946ea1f9585..fcc5087c97d 100644
--- a/src/devices/bus/nes/hes.cpp
+++ b/src/devices/bus/nes/hes.cpp
@@ -18,12 +18,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"
//-------------------------------------------------
@@ -33,26 +32,12 @@
DEFINE_DEVICE_TYPE(NES_HES, nes_hes_device, "nes_hes", "NES Cart HES PCB")
-nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_HES, tag, owner, clock)
{
}
-void nes_hes_device::device_start()
-{
- common_start();
-}
-
-void nes_hes_device::pcb_reset()
-{
- m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
- prg32(0);
- chr8(0, m_chr_source);
-}
-
-
-
/*-------------------------------------------------
mapper specific handlers
-------------------------------------------------*/
@@ -69,19 +54,19 @@ void nes_hes_device::pcb_reset()
iNES: mapper 113
- In MESS: Supported.
+ In MAME: Supported.
-------------------------------------------------*/
-void nes_hes_device::write_l(offs_t offset, uint8_t data)
+void nes_hes_device::write_l(offs_t offset, u8 data)
{
- LOG_MMC(("hes write_l, offset: %04x, data: %02x\n", offset, data));
+ LOG("hes write_l, offset: %04x, data: %02x\n", offset, data);
- if (!(offset & 0x100))
+ offset += 0x100;
+ if (BIT(offset, 8)) // $41xx, $43xx, ... $5fxx
{
- prg32((data & 0x38) >> 3);
- chr8((data & 0x07) | ((data & 0x40) >> 3), CHRROM);
- if (m_pcb_ctrl_mirror)
- set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ prg32(BIT(data, 3, 3));
+ chr8(bitswap<4>(data, 6, 2, 1, 0), CHRROM);
+ set_nt_mirroring(BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
}