From c0ab1c5aa4c172aa9e3e0deec5c2cc19d4f278d1 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 22 Jul 2018 20:41:57 +1000 Subject: (nw) srcclean and some cleanup: * Make more #include guards follow standard format - using MAME_ as the prefix makes it easy to see which ones come from our code in a preprocessor dump, and having both src/devices/machine/foo.h and src/mame/machine/foo.h causes issues anyway * Get #include "emu.h" out of headers - it should only be the first thing in a complilation unit or we get differences in behaviour with PCH on/off * Add out-of-line destructors to some devices - it forces the compiler to instantiate the vtable in a certain location and avoids some non-deterministic compiler behaviours --- hash/ibm5150.xml | 2 +- hash/ibm5170.xml | 2 +- makefile | 2 +- src/devices/bus/acorn/system/cass.cpp | 2 +- src/devices/bus/hp_hil/hp_hil.h | 2 - src/devices/bus/ti99/internal/evpcconn.h | 1 - src/devices/cpu/m68000/m68kcpu.h | 2 +- src/devices/cpu/mips/mips3.cpp | 282 +++--- src/devices/cpu/mips/mips3.h | 1372 +++++++++++++------------- src/devices/cpu/mips/mips3com.cpp | 2 +- src/devices/cpu/mips/mips3com.h | 4 +- src/devices/cpu/mips/mips3dsm.cpp | 14 +- src/devices/cpu/mips/ps2vif1.cpp | 124 +-- src/devices/cpu/mips/ps2vif1.h | 120 ++- src/devices/cpu/mips/ps2vu.cpp | 17 +- src/devices/cpu/mips/ps2vu.h | 59 +- src/devices/cpu/mips/r3000.cpp | 2 +- src/devices/cpu/mips/vudasm.cpp | 2 +- src/devices/cpu/mips/vudasm.h | 2 +- src/devices/machine/i8255.cpp | 2 +- src/devices/machine/i8255.h | 2 +- src/devices/machine/iopcdvd.cpp | 5 + src/devices/machine/iopcdvd.h | 20 +- src/devices/machine/iopdma.cpp | 8 +- src/devices/machine/iopdma.h | 20 +- src/devices/machine/iopintc.cpp | 5 + src/devices/machine/iopintc.h | 20 +- src/devices/machine/iopsio2.cpp | 31 +- src/devices/machine/iopsio2.h | 20 +- src/devices/machine/ioptimer.cpp | 164 +-- src/devices/machine/ioptimer.h | 42 +- src/devices/machine/mc146818.cpp | 2 +- src/devices/machine/nscsi_cd.cpp | 4 +- src/devices/machine/ps2dma.cpp | 48 +- src/devices/machine/ps2dma.h | 28 +- src/devices/machine/ps2intc.cpp | 7 + src/devices/machine/ps2intc.h | 19 +- src/devices/machine/ps2mc.cpp | 4 + src/devices/machine/ps2mc.h | 26 +- src/devices/machine/ps2pad.cpp | 4 + src/devices/machine/ps2pad.h | 32 +- src/devices/machine/ps2sif.cpp | 4 + src/devices/machine/ps2sif.h | 19 +- src/devices/machine/ps2timer.cpp | 232 ++--- src/devices/machine/ps2timer.h | 60 +- src/devices/machine/pxa255defs.h | 6 +- src/devices/machine/te7750.h | 6 +- src/devices/sound/iopspu.cpp | 25 +- src/devices/sound/iopspu.h | 24 +- src/devices/video/315_5124.cpp | 38 +- src/devices/video/ps2gif.cpp | 7 + src/devices/video/ps2gif.h | 22 +- src/devices/video/ps2gs.cpp | 351 +++---- src/devices/video/ps2gs.h | 74 +- src/emu/debug/debugcmd.cpp | 2 +- src/emu/debug/debugcpu.cpp | 2 +- src/emu/divtlb.cpp | 28 +- src/emu/divtlb.h | 2 +- src/emu/emumem.cpp | 34 +- src/emu/emumem.h | 2 +- src/emu/emumem_hedr.ipp | 2 +- src/emu/emumem_hedw.ipp | 2 +- src/emu/emumem_heu.h | 2 +- src/emu/emumem_mud.cpp | 2 +- src/emu/ui/cmddata.h | 8 +- src/frontend/mame/language.h | 8 +- src/frontend/mame/luaengine.h | 8 +- src/frontend/mame/mame.h | 8 +- src/frontend/mame/ui/icorender.h | 8 +- src/frontend/mame/ui/slider.h | 26 +- src/frontend/mame/ui/sliderchangednotifier.h | 12 +- src/frontend/mame/ui/viewgfx.h | 8 +- src/mame/audio/cage.h | 2 +- src/mame/drivers/alg.cpp | 2 +- src/mame/drivers/amust.cpp | 2 +- src/mame/drivers/apple2gs.cpp | 348 +++---- src/mame/drivers/cischeat.cpp | 6 +- src/mame/drivers/cms.cpp | 2 +- src/mame/drivers/cps1.cpp | 88 +- src/mame/drivers/decstation.cpp | 114 +-- src/mame/drivers/esq5505.cpp | 2 +- src/mame/drivers/gimix.cpp | 2 +- src/mame/drivers/goldstar.cpp | 2 +- src/mame/drivers/gpworld.cpp | 2 +- src/mame/drivers/hp9845.cpp | 2 +- src/mame/drivers/inderp.cpp | 6 +- src/mame/drivers/ironhors.cpp | 8 +- src/mame/drivers/jpms80.cpp | 2 +- src/mame/drivers/jpmsys7.cpp | 4 +- src/mame/drivers/jupiter.cpp | 4 +- src/mame/drivers/konamigv.cpp | 2 +- src/mame/drivers/m6805evs.cpp | 2 +- src/mame/drivers/mvme147.cpp | 2 +- src/mame/drivers/mz2500.cpp | 8 +- src/mame/drivers/mzr8105.cpp | 2 +- src/mame/drivers/namcos2.cpp | 6 +- src/mame/drivers/namcos23.cpp | 2 +- src/mame/drivers/ngen.cpp | 6 +- src/mame/drivers/pc88va.cpp | 12 +- src/mame/drivers/ps2sony.cpp | 174 ++-- src/mame/drivers/taitottl.cpp | 2 +- src/mame/drivers/tetrisp2.cpp | 8 +- src/mame/includes/88games.h | 2 +- src/mame/includes/ddragon3.h | 6 +- src/mame/includes/deadang.h | 2 +- src/mame/includes/deco32.h | 4 +- src/mame/includes/dietgo.h | 2 +- src/mame/includes/dynax.h | 2 +- src/mame/includes/exidy.h | 2 +- src/mame/includes/fitfight.h | 2 +- src/mame/includes/gottlieb.h | 2 +- src/mame/includes/mz2500.h | 2 +- src/mame/includes/pc8801.h | 2 +- src/mame/includes/pc88va.h | 4 +- src/mame/includes/segaxbd.h | 2 +- src/mame/includes/tetrisp2.h | 2 +- src/mame/includes/toaplan2.h | 2 +- src/mame/includes/tubep.h | 4 +- src/mame/includes/xerox820.h | 2 +- src/mame/layout/intlc44.lay | 2 +- src/mame/layout/vgmplay.lay | 4 +- src/mame/machine/cbm_snqk.h | 19 +- src/mame/machine/cedar_magnet_board.cpp | 2 +- src/mame/machine/coleco.h | 8 +- src/mame/machine/cuda.h | 8 +- src/mame/machine/decioga.cpp | 9 +- src/mame/machine/decioga.h | 15 +- src/mame/machine/msx_switched.h | 8 +- src/mame/machine/namcoic.cpp | 2 +- src/mame/machine/spec_snqk.h | 8 +- src/mame/machine/subsino.h | 8 +- src/mame/machine/trs80.cpp | 14 +- src/mame/machine/x68k_hdc.h | 2 +- src/mame/video/amigaaga.h | 7 +- src/mame/video/apple2.cpp | 2 +- src/mame/video/argus.cpp | 2 +- src/mame/video/cischeat.cpp | 2 +- src/mame/video/konami_helper.h | 12 +- src/mame/video/namco_c116.cpp | 2 +- src/mame/video/powervr2.cpp | 20 +- src/mame/video/taito_helper.h | 12 +- src/mame/video/tatsumi.cpp | 2 +- src/mame/video/tetrisp2.cpp | 6 +- 143 files changed, 2344 insertions(+), 2258 deletions(-) diff --git a/hash/ibm5150.xml b/hash/ibm5150.xml index 975dd630499..641dd785e15 100644 --- a/hash/ibm5150.xml +++ b/hash/ibm5150.xml @@ -3169,7 +3169,7 @@ Known PC Booter Games Not Dumped, Or Dumped and Lost when Demonlord's Site went - + PC Globe 4.0 1990 diff --git a/hash/ibm5170.xml b/hash/ibm5170.xml index 4d8a28c95ee..5390872eee4 100644 --- a/hash/ibm5170.xml +++ b/hash/ibm5170.xml @@ -9280,7 +9280,7 @@ - + The Incredible Machine 2 1994 diff --git a/makefile b/makefile index 7e7b02d6117..8d70932732a 100644 --- a/makefile +++ b/makefile @@ -40,7 +40,7 @@ # DEBUG = 1 # PROFILER = 1 -# SANITIZE = +# SANITIZE = # PTR64 = 1 # BIGENDIAN = 1 diff --git a/src/devices/bus/acorn/system/cass.cpp b/src/devices/bus/acorn/system/cass.cpp index 36038405a84..092a72f40a3 100644 --- a/src/devices/bus/acorn/system/cass.cpp +++ b/src/devices/bus/acorn/system/cass.cpp @@ -97,4 +97,4 @@ TIMER_DEVICE_CALLBACK_MEMBER(acorn_cass_device::cass_p) //m_bus->write_pb7(m_cass_data[1] < 12); m_cass_data[1] = 0; } -} \ No newline at end of file +} diff --git a/src/devices/bus/hp_hil/hp_hil.h b/src/devices/bus/hp_hil/hp_hil.h index a11c53be461..6ed9d791ff7 100644 --- a/src/devices/bus/hp_hil/hp_hil.h +++ b/src/devices/bus/hp_hil/hp_hil.h @@ -11,8 +11,6 @@ #pragma once -#include "emu.h" - #define HPMLC_R1_OB 0x10 diff --git a/src/devices/bus/ti99/internal/evpcconn.h b/src/devices/bus/ti99/internal/evpcconn.h index 67e5784cd4f..945c151605c 100644 --- a/src/devices/bus/ti99/internal/evpcconn.h +++ b/src/devices/bus/ti99/internal/evpcconn.h @@ -11,7 +11,6 @@ #pragma once -#include "emu.h" #include "bus/ti99/ti99defs.h" namespace bus { namespace ti99 { namespace internal { diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h index d8ad6ef2c2f..adb45a04c78 100644 --- a/src/devices/cpu/m68000/m68kcpu.h +++ b/src/devices/cpu/m68000/m68kcpu.h @@ -1523,7 +1523,7 @@ inline void m68ki_exception_address_error() m_stopped = STOP_LEVEL_HALT; return; } - + m_run_mode = RUN_MODE_BERR_AERR_RESET_WSF; if (!CPU_TYPE_IS_010_PLUS()) diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index e9d5f17b318..00ca50b1a3d 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -15,9 +15,9 @@ #include "mips3dsm.h" #include "ps2vu.h" -#define ENABLE_OVERFLOWS (0) -#define ENABLE_EE_ELF_LOADER (0) -#define ENABLE_EE_DECI2 (1) +#define ENABLE_OVERFLOWS (0) +#define ENABLE_EE_ELF_LOADER (0) +#define ENABLE_EE_DECI2 (1) /*************************************************************************** HELPER MACROS @@ -148,7 +148,7 @@ mips3_device::mips3_device(const machine_config &mconfig, device_type type, cons , m_ldr(endianness == ENDIANNESS_BIG ? &mips3_device::ldr_be : &mips3_device::ldr_le) , m_sdl(endianness == ENDIANNESS_BIG ? &mips3_device::sdl_be : &mips3_device::sdl_le) , m_sdr(endianness == ENDIANNESS_BIG ? &mips3_device::sdr_be : &mips3_device::sdr_le) - , m_data_bits(data_bits) + , m_data_bits(data_bits) , c_system_clock(0) , m_pfnmask(flavor == MIPS3_TYPE_VR4300 ? 0x000fffff : 0x00ffffff) , m_tlbentries(flavor == MIPS3_TYPE_VR4300 ? 32 : MIPS3_MAX_TLB_ENTRIES) @@ -389,34 +389,34 @@ void mips3_device::device_start() m_program = &space(AS_PROGRAM); if(m_program->endianness() == ENDIANNESS_LITTLE) { - if (m_data_bits == 32) - { - auto cache = m_program->cache<2, 0, ENDIANNESS_LITTLE>(); - m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; - m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; - } - else - { - auto cache = m_program->cache<3, 0, ENDIANNESS_LITTLE>(); - m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; - m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; - } + if (m_data_bits == 32) + { + auto cache = m_program->cache<2, 0, ENDIANNESS_LITTLE>(); + m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; + m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; + } + else + { + auto cache = m_program->cache<3, 0, ENDIANNESS_LITTLE>(); + m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; + m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; + } } else { - if (m_data_bits == 32) - { - auto cache = m_program->cache<2, 0, ENDIANNESS_BIG>(); - m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; - m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; - } - else - { - auto cache = m_program->cache<3, 0, ENDIANNESS_BIG>(); - m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; - m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; - } - } + if (m_data_bits == 32) + { + auto cache = m_program->cache<2, 0, ENDIANNESS_BIG>(); + m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; + m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; + } + else + { + auto cache = m_program->cache<3, 0, ENDIANNESS_BIG>(); + m_pr32 = [cache](offs_t address) -> u32 { return cache->read_dword(address); }; + m_prptr = [cache](offs_t address) -> const void * { return cache->read_ptr(address); }; + } + } /* set up the endianness */ m_program->accessors(m_memory); @@ -1492,37 +1492,37 @@ inline void mips3_device::WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t inline void r5900le_device::WBYTE(offs_t address, uint8_t data) { - if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_byte)(*m_program, address, data); - else mips3_device::WBYTE(address, data); + if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_byte)(*m_program, address, data); + else mips3_device::WBYTE(address, data); } inline void r5900le_device::WHALF(offs_t address, uint16_t data) { - if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_word)(*m_program, address, data); - else mips3_device::WHALF(address, data); + if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_word)(*m_program, address, data); + else mips3_device::WHALF(address, data); } inline void r5900le_device::WWORD(offs_t address, uint32_t data) { - if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_dword)(*m_program, address, data); - else mips3_device::WWORD(address, data); + if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_dword)(*m_program, address, data); + else mips3_device::WWORD(address, data); } inline void r5900le_device::WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask) { - if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_dword_masked)(*m_program, address, data, mem_mask); - else mips3_device::WWORD_MASKED(address, data, mem_mask); + if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_dword_masked)(*m_program, address, data, mem_mask); + else mips3_device::WWORD_MASKED(address, data, mem_mask); } inline void r5900le_device::WDOUBLE(offs_t address, uint64_t data) { - if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_qword)(*m_program, address, data); - else mips3_device::WDOUBLE(address, data); + if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_qword)(*m_program, address, data); + else mips3_device::WDOUBLE(address, data); } inline void r5900le_device::WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask) { - if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_qword_masked)(*m_program, address, data, mem_mask); - else mips3_device::WDOUBLE_MASKED(address, data, mem_mask); + if (address >= 0x70000000 && address < 0x70004000) (*m_memory.write_qword_masked)(*m_program, address, data, mem_mask); + else mips3_device::WDOUBLE_MASKED(address, data, mem_mask); } inline void r5900le_device::WQUAD(offs_t address, uint64_t data_hi, uint64_t data_lo) @@ -1558,61 +1558,61 @@ inline void r5900le_device::WQUAD(offs_t address, uint64_t data_hi, uint64_t dat } inline bool r5900le_device::RBYTE(offs_t address, uint32_t *result) { - if (address >= 0x70000000 && address < 0x70004000) { - *result = (*m_memory.read_byte)(*m_program, address); - return true; - } - return mips3_device::RBYTE(address, result); + if (address >= 0x70000000 && address < 0x70004000) { + *result = (*m_memory.read_byte)(*m_program, address); + return true; + } + return mips3_device::RBYTE(address, result); } inline bool r5900le_device::RHALF(offs_t address, uint32_t *result) { - if (address >= 0x70000000 && address < 0x70004000) - { - *result = (*m_memory.read_word)(*m_program, address); - return true; - } - return mips3_device::RHALF(address, result); + if (address >= 0x70000000 && address < 0x70004000) + { + *result = (*m_memory.read_word)(*m_program, address); + return true; + } + return mips3_device::RHALF(address, result); } inline bool r5900le_device::RWORD(offs_t address, uint32_t *result) { - if (address >= 0x70000000 && address < 0x70004000) - { - *result = (*m_memory.read_dword)(*m_program, address); - return true; - } - return mips3_device::RWORD(address, result); + if (address >= 0x70000000 && address < 0x70004000) + { + *result = (*m_memory.read_dword)(*m_program, address); + return true; + } + return mips3_device::RWORD(address, result); } inline bool r5900le_device::RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask) { - if (address >= 0x70000000 && address < 0x70004000) - { - *result = (*m_memory.read_dword_masked)(*m_program, address, mem_mask); - return true; - } - return mips3_device::RWORD_MASKED(address, result, mem_mask); + if (address >= 0x70000000 && address < 0x70004000) + { + *result = (*m_memory.read_dword_masked)(*m_program, address, mem_mask); + return true; + } + return mips3_device::RWORD_MASKED(address, result, mem_mask); } inline bool r5900le_device::RDOUBLE(offs_t address, uint64_t *result) { - if (address >= 0x70000000 && address < 0x70004000) - { - *result = (*m_memory.read_qword)(*m_program, address); - return true; - } - return mips3_device::RDOUBLE(address, result); + if (address >= 0x70000000 && address < 0x70004000) + { + *result = (*m_memory.read_qword)(*m_program, address); + return true; + } + return mips3_device::RDOUBLE(address, result); } inline bool r5900le_device::RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask) { - if (address >= 0x70000000 && address < 0x70004000) - { - *result = (*m_memory.read_qword_masked)(*m_program, address, mem_mask); - return true; - } - return mips3_device::RDOUBLE_MASKED(address, result, mem_mask); + if (address >= 0x70000000 && address < 0x70004000) + { + *result = (*m_memory.read_qword_masked)(*m_program, address, mem_mask); + return true; + } + return mips3_device::RDOUBLE_MASKED(address, result, mem_mask); } inline bool r5900le_device::RQUAD(offs_t address, uint64_t *result_hi, uint64_t *result_lo) @@ -2952,12 +2952,12 @@ void mips3_device::handle_cop2(uint32_t op) switch (RSREG) { - case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop2_reg(RDREG); break; - case 0x01: /* DMFCz */ handle_dmfc2(op); break; - case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop2_creg(RDREG); break; - case 0x04: /* MTCz */ set_cop2_reg(RDREG, RTVAL32); break; - case 0x05: /* DMTCz */ handle_dmtc2(op); break; - case 0x06: /* CTCz */ set_cop2_creg(RDREG, RTVAL32); break; + case 0x00: /* MFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop2_reg(RDREG); break; + case 0x01: /* DMFCz */ handle_dmfc2(op); break; + case 0x02: /* CFCz */ if (RTREG) RTVAL64 = (int32_t)get_cop2_creg(RDREG); break; + case 0x04: /* MTCz */ set_cop2_reg(RDREG, RTVAL32); break; + case 0x05: /* DMTCz */ handle_dmtc2(op); break; + case 0x06: /* CTCz */ set_cop2_creg(RDREG, RTVAL32); break; case 0x08: /* BC */ switch (RTREG) { @@ -3560,8 +3560,8 @@ void mips3_device::handle_special(uint32_t op) case 0x25: /* OR */ if (RDREG) RDVAL64 = RSVAL64 | RTVAL64; break; case 0x26: /* XOR */ if (RDREG) RDVAL64 = RSVAL64 ^ RTVAL64; break; case 0x27: /* NOR */ if (RDREG) RDVAL64 = ~(RSVAL64 | RTVAL64); break; - case 0x28: handle_extra_special(op); break; - case 0x2a: /* SLT */ if (RDREG) RDVAL64 = (int64_t)RSVAL64 < (int64_t)RTVAL64; break; + case 0x28: handle_extra_special(op); break; + case 0x2a: /* SLT */ if (RDREG) RDVAL64 = (int64_t)RSVAL64 < (int64_t)RTVAL64; break; case 0x2b: /* SLTU */ if (RDREG) RDVAL64 = (uint64_t)RSVAL64 < (uint64_t)RTVAL64; break; case 0x2c: /* DADD */ if (ENABLE_OVERFLOWS && RSVAL64 > ~RTVAL64) generate_exception(EXCEPTION_OVERFLOW, 1); @@ -3615,8 +3615,8 @@ void mips3_device::handle_idt(uint32_t op) void r5900le_device::handle_extra_base(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rt = (op >> 16) & 31; + const int rs = (op >> 21) & 31; + const int rt = (op >> 16) & 31; switch (op >> 26) { @@ -3644,8 +3644,8 @@ void r5900le_device::handle_extra_base(uint32_t op) void r5900le_device::handle_extra_special(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rd = (op >> 11) & 31; + const int rs = (op >> 21) & 31; + const int rd = (op >> 11) & 31; switch (op & 63) { @@ -3712,12 +3712,12 @@ void r5900le_device::handle_extra_cop1(uint32_t op) void r5900le_device::handle_idt(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rt = (op >> 16) & 31; - const int rd = (op >> 11) & 31; - const int sa = (op >> 6) & 31; + const int rs = (op >> 21) & 31; + const int rt = (op >> 16) & 31; + const int rd = (op >> 11) & 31; + const int sa = (op >> 6) & 31; - switch (op & 0x3f) + switch (op & 0x3f) { case 0x00: /* MADD */ { @@ -3760,9 +3760,9 @@ void r5900le_device::handle_idt(uint32_t op) handle_mmi2(op); break; case 0x10: /* MFHI1 */ - if (rd) - m_core->r[rd] = m_core->rh[REG_HI]; - break; + if (rd) + m_core->r[rd] = m_core->rh[REG_HI]; + break; case 0x11: /* MTHI1 */ m_core->rh[REG_HI] = m_core->r[rs]; break; @@ -3787,13 +3787,13 @@ void r5900le_device::handle_idt(uint32_t op) printf("Unsupported instruction: MULTU1 @%08x\n", m_core->pc - 4); fflush(stdout); fatalerror("Unsupported parallel instruction\n"); break; case 0x1a: /* DIV1 */ - if (RTVAL32) - { - m_core->rh[REG_LO] = (int32_t)((int32_t)RSVAL32 / (int32_t)RTVAL32); - m_core->rh[REG_HI] = (int32_t)((int32_t)RSVAL32 % (int32_t)RTVAL32); - } - m_core->icount -= 35; // ? - break; + if (RTVAL32) + { + m_core->rh[REG_LO] = (int32_t)((int32_t)RSVAL32 / (int32_t)RTVAL32); + m_core->rh[REG_HI] = (int32_t)((int32_t)RSVAL32 % (int32_t)RTVAL32); + } + m_core->icount -= 35; // ? + break; case 0x1b: /* DIVU1 */ if (RTVAL32) { @@ -3936,11 +3936,11 @@ void r5900le_device::handle_idt(uint32_t op) void r5900le_device::handle_mmi0(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rt = (op >> 16) & 31; - const int rd = (op >> 11) & 31; + const int rs = (op >> 21) & 31; + const int rt = (op >> 16) & 31; + const int rd = (op >> 11) & 31; - switch ((op >> 6) & 0x1f) + switch ((op >> 6) & 0x1f) { case 0x00: /* PADDW */ if (rd) @@ -4395,11 +4395,11 @@ void r5900le_device::handle_mmi0(uint32_t op) void r5900le_device::handle_mmi1(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rt = (op >> 16) & 31; - const int rd = (op >> 11) & 31; + const int rs = (op >> 21) & 31; + const int rt = (op >> 16) & 31; + const int rd = (op >> 11) & 31; - switch ((op >> 6) & 0x1f) + switch ((op >> 6) & 0x1f) { case 0x01: /* PABSW */ if (rd) @@ -4634,8 +4634,8 @@ void r5900le_device::handle_mmi1(uint32_t op) } break; case 0x12: /* PEXTUW */ - if (rd) - { + if (rd) + { uint64_t rsval = m_core->rh[rs]; uint64_t rtval = m_core->rh[rt]; m_core->rh[rd] = (rsval & 0xffffffff00000000ULL) | (rtval >> 32); @@ -4759,9 +4759,9 @@ void r5900le_device::handle_mmi1(uint32_t op) void r5900le_device::handle_mmi2(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rt = (op >> 16) & 31; - const int rd = (op >> 11) & 31; + const int rs = (op >> 21) & 31; + const int rt = (op >> 16) & 31; + const int rd = (op >> 11) & 31; switch ((op >> 6) & 0x1f) { @@ -4805,17 +4805,17 @@ void r5900le_device::handle_mmi2(uint32_t op) printf("Unsupported instruction: PMSUBW @%08x\n", m_core->pc - 4); fflush(stdout); fatalerror("Unsupported parallel instruction\n"); break; case 0x08: /* PMFHI */ - if (rd) - { - m_core->r[rd] = m_core->r[REG_HI]; - m_core->rh[rd] = m_core->rh[REG_HI]; + if (rd) + { + m_core->r[rd] = m_core->r[REG_HI]; + m_core->rh[rd] = m_core->rh[REG_HI]; } break; case 0x09: /* PMFLO */ - if (rd) - { - m_core->r[rd] = m_core->r[REG_LO]; - m_core->rh[rd] = m_core->rh[REG_LO]; + if (rd) + { + m_core->r[rd] = m_core->r[REG_LO]; + m_core->rh[rd] = m_core->rh[REG_LO]; } break; case 0x0a: /* PINTH */ @@ -4886,9 +4886,9 @@ void r5900le_device::handle_mmi2(uint32_t op) void r5900le_device::handle_mmi3(uint32_t op) { - const int rs = (op >> 21) & 31; - const int rt = (op >> 16) & 31; - const int rd = (op >> 11) & 31; + const int rs = (op >> 21) & 31; + const int rt = (op >> 16) & 31; + const int rd = (op >> 11) & 31; switch ((op >> 6) & 0x1f) { @@ -5433,25 +5433,25 @@ void mips3_device::load_elf() fread(buf, 1, size, elf); fclose(elf); - const uint32_t header_offset = *reinterpret_cast(&buf[0x1c]); - const uint16_t block_count = *reinterpret_cast(&buf[0x2c]); + const uint32_t header_offset = *reinterpret_cast(&buf[0x1c]); + const uint16_t block_count = *reinterpret_cast(&buf[0x2c]); - for (uint32_t i = 0; i < block_count; i++) - { + for (uint32_t i = 0; i < block_count; i++) + { const uint32_t *header_entry = reinterpret_cast(&buf[header_offset + i * 0x20]); - const uint32_t word_count = header_entry[4] >> 2; - const uint32_t file_offset = header_entry[1]; - const uint32_t *file_data = reinterpret_cast(&buf[file_offset]); - uint32_t addr = header_entry[3]; - for (uint32_t word = 0; word < word_count; word++) - { - WWORD(addr, file_data[word]); - addr += 4; - } + const uint32_t word_count = header_entry[4] >> 2; + const uint32_t file_offset = header_entry[1]; + const uint32_t *file_data = reinterpret_cast(&buf[file_offset]); + uint32_t addr = header_entry[3]; + for (uint32_t word = 0; word < word_count; word++) + { + WWORD(addr, file_data[word]); + addr += 4; + } } - const uint32_t entry_point = *reinterpret_cast(&buf[0x18]); + const uint32_t entry_point = *reinterpret_cast(&buf[0x18]); m_core->pc = entry_point; m_ppc = entry_point; diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h index 6323ae5fd59..e36a5aa5fc8 100644 --- a/src/devices/cpu/mips/mips3.h +++ b/src/devices/cpu/mips/mips3.h @@ -50,183 +50,183 @@ REGISTER ENUMERATION ***************************************************************************/ enum { - MIPS3_PC = STATE_GENPC, - MIPS3_R0 = 1, - MIPS3_R1, - MIPS3_R2, - MIPS3_R3, - MIPS3_R4, - MIPS3_R5, - MIPS3_R6, - MIPS3_R7, - MIPS3_R8, - MIPS3_R9, - MIPS3_R10, - MIPS3_R11, - MIPS3_R12, - MIPS3_R13, - MIPS3_R14, - MIPS3_R15, - MIPS3_R16, - MIPS3_R17, - MIPS3_R18, - MIPS3_R19, - MIPS3_R20, - MIPS3_R21, - MIPS3_R22, - MIPS3_R23, - MIPS3_R24, - MIPS3_R25, - MIPS3_R26, - MIPS3_R27, - MIPS3_R28, - MIPS3_R29, - MIPS3_R30, - MIPS3_R31, - MIPS3_HI, - MIPS3_LO, - MIPS3_FPR0, - MIPS3_FPS0, - MIPS3_FPD0, - MIPS3_FPR1, - MIPS3_FPS1, - MIPS3_FPD1, - MIPS3_FPR2, - MIPS3_FPS2, - MIPS3_FPD2, - MIPS3_FPR3, - MIPS3_FPS3, - MIPS3_FPD3, - MIPS3_FPR4, - MIPS3_FPS4, - MIPS3_FPD4, - MIPS3_FPR5, - MIPS3_FPS5, - MIPS3_FPD5, - MIPS3_FPR6, - MIPS3_FPS6, - MIPS3_FPD6, - MIPS3_FPR7, - MIPS3_FPS7, - MIPS3_FPD7, - MIPS3_FPR8, - MIPS3_FPS8, - MIPS3_FPD8, - MIPS3_FPR9, - MIPS3_FPS9, - MIPS3_FPD9, - MIPS3_FPR10, - MIPS3_FPS10, - MIPS3_FPD10, - MIPS3_FPR11, - MIPS3_FPS11, - MIPS3_FPD11, - MIPS3_FPR12, - MIPS3_FPS12, - MIPS3_FPD12, - MIPS3_FPR13, - MIPS3_FPS13, - MIPS3_FPD13, - MIPS3_FPR14, - MIPS3_FPS14, - MIPS3_FPD14, - MIPS3_FPR15, - MIPS3_FPS15, - MIPS3_FPD15, - MIPS3_FPR16, - MIPS3_FPS16, - MIPS3_FPD16, - MIPS3_FPR17, - MIPS3_FPS17, - MIPS3_FPD17, - MIPS3_FPR18, - MIPS3_FPS18, - MIPS3_FPD18, - MIPS3_FPR19, - MIPS3_FPS19, - MIPS3_FPD19, - MIPS3_FPR20, - MIPS3_FPS20, - MIPS3_FPD20, - MIPS3_FPR21, - MIPS3_FPS21, - MIPS3_FPD21, - MIPS3_FPR22, - MIPS3_FPS22, - MIPS3_FPD22, - MIPS3_FPR23, - MIPS3_FPS23, - MIPS3_FPD23, - MIPS3_FPR24, - MIPS3_FPS24, - MIPS3_FPD24, - MIPS3_FPR25, - MIPS3_FPS25, - MIPS3_FPD25, - MIPS3_FPR26, - MIPS3_FPS26, - MIPS3_FPD26, - MIPS3_FPR27, - MIPS3_FPS27, - MIPS3_FPD27, - MIPS3_FPR28, - MIPS3_FPS28, - MIPS3_FPD28, - MIPS3_FPR29, - MIPS3_FPS29, - MIPS3_FPD29, - MIPS3_FPR30, - MIPS3_FPS30, - MIPS3_FPD30, - MIPS3_FPR31, - MIPS3_FPS31, - MIPS3_FPD31, - MIPS3_CCR1_31, - MIPS3_SR, - MIPS3_EPC, - MIPS3_CAUSE, - MIPS3_COUNT, - MIPS3_COMPARE, - MIPS3_INDEX, - MIPS3_RANDOM, - MIPS3_ENTRYHI, - MIPS3_ENTRYLO0, - MIPS3_ENTRYLO1, - MIPS3_PAGEMASK, - MIPS3_WIRED, - MIPS3_BADVADDR, - MIPS3_R0H, - MIPS3_R1H, - MIPS3_R2H, - MIPS3_R3H, - MIPS3_R4H, - MIPS3_R5H, - MIPS3_R6H, - MIPS3_R7H, - MIPS3_R8H, - MIPS3_R9H, - MIPS3_R10H, - MIPS3_R11H, - MIPS3_R12H, - MIPS3_R13H, - MIPS3_R14H, - MIPS3_R15H, - MIPS3_R16H, - MIPS3_R17H, - MIPS3_R18H, - MIPS3_R19H, - MIPS3_R20H, - MIPS3_R21H, - MIPS3_R22H, - MIPS3_R23H, - MIPS3_R24H, - MIPS3_R25H, - MIPS3_R26H, - MIPS3_R27H, - MIPS3_R28H, - MIPS3_R29H, - MIPS3_R30H, - MIPS3_R31H, + MIPS3_PC = STATE_GENPC, + MIPS3_R0 = 1, + MIPS3_R1, + MIPS3_R2, + MIPS3_R3, + MIPS3_R4, + MIPS3_R5, + MIPS3_R6, + MIPS3_R7, + MIPS3_R8, + MIPS3_R9, + MIPS3_R10, + MIPS3_R11, + MIPS3_R12, + MIPS3_R13, + MIPS3_R14, + MIPS3_R15, + MIPS3_R16, + MIPS3_R17, + MIPS3_R18, + MIPS3_R19, + MIPS3_R20, + MIPS3_R21, + MIPS3_R22, + MIPS3_R23, + MIPS3_R24, + MIPS3_R25, + MIPS3_R26, + MIPS3_R27, + MIPS3_R28, + MIPS3_R29, + MIPS3_R30, + MIPS3_R31, + MIPS3_HI, + MIPS3_LO, + MIPS3_FPR0, + MIPS3_FPS0, + MIPS3_FPD0, + MIPS3_FPR1, + MIPS3_FPS1, + MIPS3_FPD1, + MIPS3_FPR2, + MIPS3_FPS2, + MIPS3_FPD2, + MIPS3_FPR3, + MIPS3_FPS3, + MIPS3_FPD3, + MIPS3_FPR4, + MIPS3_FPS4, + MIPS3_FPD4, + MIPS3_FPR5, + MIPS3_FPS5, + MIPS3_FPD5, + MIPS3_FPR6, + MIPS3_FPS6, + MIPS3_FPD6, + MIPS3_FPR7, + MIPS3_FPS7, + MIPS3_FPD7, + MIPS3_FPR8, + MIPS3_FPS8, + MIPS3_FPD8, + MIPS3_FPR9, + MIPS3_FPS9, + MIPS3_FPD9, + MIPS3_FPR10, + MIPS3_FPS10, + MIPS3_FPD10, + MIPS3_FPR11, + MIPS3_FPS11, + MIPS3_FPD11, + MIPS3_FPR12, + MIPS3_FPS12, + MIPS3_FPD12, + MIPS3_FPR13, + MIPS3_FPS13, + MIPS3_FPD13, + MIPS3_FPR14, + MIPS3_FPS14, + MIPS3_FPD14, + MIPS3_FPR15, + MIPS3_FPS15, + MIPS3_FPD15, + MIPS3_FPR16, + MIPS3_FPS16, + MIPS3_FPD16, + MIPS3_FPR17, + MIPS3_FPS17, + MIPS3_FPD17, + MIPS3_FPR18, + MIPS3_FPS18, + MIPS3_FPD18, + MIPS3_FPR19, + MIPS3_FPS19, + MIPS3_FPD19, + MIPS3_FPR20, + MIPS3_FPS20, + MIPS3_FPD20, + MIPS3_FPR21, + MIPS3_FPS21, + MIPS3_FPD21, + MIPS3_FPR22, + MIPS3_FPS22, + MIPS3_FPD22, + MIPS3_FPR23, + MIPS3_FPS23, + MIPS3_FPD23, + MIPS3_FPR24, + MIPS3_FPS24, + MIPS3_FPD24, + MIPS3_FPR25, + MIPS3_FPS25, + MIPS3_FPD25, + MIPS3_FPR26, + MIPS3_FPS26, + MIPS3_FPD26, + MIPS3_FPR27, + MIPS3_FPS27, + MIPS3_FPD27, + MIPS3_FPR28, + MIPS3_FPS28, + MIPS3_FPD28, + MIPS3_FPR29, + MIPS3_FPS29, + MIPS3_FPD29, + MIPS3_FPR30, + MIPS3_FPS30, + MIPS3_FPD30, + MIPS3_FPR31, + MIPS3_FPS31, + MIPS3_FPD31, + MIPS3_CCR1_31, + MIPS3_SR, + MIPS3_EPC, + MIPS3_CAUSE, + MIPS3_COUNT, + MIPS3_COMPARE, + MIPS3_INDEX, + MIPS3_RANDOM, + MIPS3_ENTRYHI, + MIPS3_ENTRYLO0, + MIPS3_ENTRYLO1, + MIPS3_PAGEMASK, + MIPS3_WIRED, + MIPS3_BADVADDR, + MIPS3_R0H, + MIPS3_R1H, + MIPS3_R2H, + MIPS3_R3H, + MIPS3_R4H, + MIPS3_R5H, + MIPS3_R6H, + MIPS3_R7H, + MIPS3_R8H, + MIPS3_R9H, + MIPS3_R10H, + MIPS3_R11H, + MIPS3_R12H, + MIPS3_R13H, + MIPS3_R14H, + MIPS3_R15H, + MIPS3_R16H, + MIPS3_R17H, + MIPS3_R18H, + MIPS3_R19H, + MIPS3_R20H, + MIPS3_R21H, + MIPS3_R22H, + MIPS3_R23H, + MIPS3_R24H, + MIPS3_R25H, + MIPS3_R26H, + MIPS3_R27H, + MIPS3_R28H, + MIPS3_R29H, + MIPS3_R30H, + MIPS3_R31H, }; #define MIPS3_MAX_FASTRAM 3 @@ -251,9 +251,9 @@ STRUCTURES /* MIPS3 TLB entry */ struct mips3_tlb_entry { - uint64_t page_mask; - uint64_t entry_hi; - uint64_t entry_lo[2]; + uint64_t page_mask; + uint64_t entry_hi; + uint64_t entry_lo[2]; }; #define MIPS3_MAX_TLB_ENTRIES 48 @@ -271,363 +271,363 @@ struct mips3_tlb_entry { class mips3_frontend; class mips3_device : public cpu_device, public device_vtlb_interface { - friend class mips3_frontend; + friend class mips3_frontend; protected: - /* MIPS flavors */ - enum mips3_flavor { - /* MIPS III variants */ - MIPS3_TYPE_MIPS_III, - MIPS3_TYPE_VR4300, - MIPS3_TYPE_R4600, - MIPS3_TYPE_R4650, - MIPS3_TYPE_R4700, - MIPS3_TYPE_TX4925, - - /* MIPS IV variants */ - MIPS3_TYPE_MIPS_IV, - MIPS3_TYPE_R5000, - MIPS3_TYPE_VR5500, - MIPS3_TYPE_QED5271, - MIPS3_TYPE_R5900, - MIPS3_TYPE_RM7000 - }; + /* MIPS flavors */ + enum mips3_flavor { + /* MIPS III variants */ + MIPS3_TYPE_MIPS_III, + MIPS3_TYPE_VR4300, + MIPS3_TYPE_R4600, + MIPS3_TYPE_R4650, + MIPS3_TYPE_R4700, + MIPS3_TYPE_TX4925, + + /* MIPS IV variants */ + MIPS3_TYPE_MIPS_IV, + MIPS3_TYPE_R5000, + MIPS3_TYPE_VR5500, + MIPS3_TYPE_QED5271, + MIPS3_TYPE_R5900, + MIPS3_TYPE_RM7000 + }; public: - // construction/destruction - mips3_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, mips3_flavor flavor, endianness_t endiannes, uint32_t data_bits); + // construction/destruction + mips3_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, mips3_flavor flavor, endianness_t endiannes, uint32_t data_bits); - void set_icache_size(size_t icache_size) { c_icache_size = icache_size; } - void set_dcache_size(size_t dcache_size) { c_dcache_size = dcache_size; } - void set_system_clock(uint32_t system_clock) { c_system_clock = system_clock; } + void set_icache_size(size_t icache_size) { c_icache_size = icache_size; } + void set_dcache_size(size_t dcache_size) { c_dcache_size = dcache_size; } + void set_system_clock(uint32_t system_clock) { c_system_clock = system_clock; } - TIMER_CALLBACK_MEMBER(compare_int_callback); + TIMER_CALLBACK_MEMBER(compare_int_callback); - void add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); - void clear_fastram(uint32_t select_start); - void mips3drc_set_options(uint32_t options); - void mips3drc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles); - void burn_cycles(int32_t cycles); + void add_fastram(offs_t start, offs_t end, uint8_t readonly, void *base); + void clear_fastram(uint32_t select_start); + void mips3drc_set_options(uint32_t options); + void mips3drc_add_hotspot(offs_t pc, uint32_t opcode, uint32_t cycles); + void burn_cycles(int32_t cycles); protected: - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - virtual void device_stop() override; - - // device_execute_interface overrides - virtual uint32_t execute_min_cycles() const override { return 1; } - virtual uint32_t execute_max_cycles() const override { return 40; } - virtual uint32_t execute_input_lines() const override { return 6; } - virtual void execute_run() override; - virtual void execute_set_input(int inputnum, int state) override; - virtual void execute_burn(int32_t cycles) override { m_totalcycles += cycles; } - - // device_memory_interface overrides - virtual space_config_vector memory_space_config() const override; - virtual bool memory_translate(int spacenum, int intention, offs_t &address) override; - - // device_state_interface overrides - virtual void state_export(const device_state_entry &entry) override; - virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; - - // device_disasm_interface overrides - virtual std::unique_ptr create_disassembler() override; - - void invalid_instruction(uint32_t op); - - virtual bool RBYTE(offs_t address, uint32_t *result); - virtual bool RHALF(offs_t address, uint32_t *result); - virtual bool RWORD(offs_t address, uint32_t *result); - virtual bool RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask); - virtual bool RDOUBLE(offs_t address, uint64_t *result); - virtual bool RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask); - virtual void WBYTE(offs_t address, uint8_t data); - virtual void WHALF(offs_t address, uint16_t data); - virtual void WWORD(offs_t address, uint32_t data); - virtual void WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask); - virtual void WDOUBLE(offs_t address, uint64_t data); - virtual void WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask); - - struct internal_mips3_state { - /* core registers */ - uint32_t pc; - int icount; - uint64_t r[35]; - uint32_t sa; - - /* upper 64 bits of 128-bit GPRs (R5900 only) */ - uint64_t rh[35]; - - /* COP registers */ - uint64_t cpr[3][32]; - uint64_t ccr[3][32]; - uint32_t llbit; - float acc; - - /* VU0 registers (R5900 only) */ - float vfr[32][4]; // 0..3 = x..w - uint32_t vcr[32]; - float vumem[0x1000]; - float* vfmem; - uint32_t* vimem; - float vacc[4]; - float p; - - uint32_t* vr; - float* i; - float* q; - - uint32_t mode; /* current global mode */ - - /* parameters for subroutines */ - uint64_t numcycles; /* return value from gettotalcycles */ - const char * format; /* format string for print_debug */ - uint32_t arg0; /* print_debug argument 1 */ - uint32_t arg1; /* print_debug argument 2 */ - - uint64_t count_zero_time; - uint32_t compare_armed; - uint32_t jmpdest; /* destination jump target */ - }; - - /* core state */ - internal_mips3_state *m_core; - - address_space_config m_program_config; - mips3_flavor m_flavor; - - /* internal stuff */ - uint32_t m_ppc; - uint32_t m_nextpc; - uint32_t m_pcbase; - uint8_t m_cf[4][8]; - bool m_delayslot; - int m_op; - int m_interrupt_cycles; - uint32_t m_ll_value; - uint64_t m_lld_value; - uint32_t m_badcop_value; - - /* endian-dependent load/store */ - typedef void (mips3_device::*loadstore_func)(uint32_t op); - loadstore_func m_lwl; - loadstore_func m_lwr; - loadstore_func m_swl; - loadstore_func m_swr; - loadstore_func m_ldl; - loadstore_func m_ldr; - loadstore_func m_sdl; - loadstore_func m_sdr; - - address_space * m_program; - uint32_t m_data_bits; - std::function m_pr32; - std::function m_prptr; - uint32_t c_system_clock; - uint32_t m_cpu_clock; - emu_timer * m_compare_int_timer; - - /* derived info based on flavor */ - uint32_t m_pfnmask; - uint8_t m_tlbentries; - - /* memory accesses */ - bool m_bigendian; - uint32_t m_byte_xor; - uint32_t m_word_xor; - data_accessors m_memory; - - /* cache memory */ - size_t c_icache_size; - size_t c_dcache_size; - - /* MMU */ - mips3_tlb_entry m_tlb[MIPS3_MAX_TLB_ENTRIES]; - - /* fast RAM */ - uint32_t m_fastram_select; - struct { - offs_t start; /* start of the RAM block */ - offs_t end; /* end of the RAM block */ - bool readonly; /* true if read-only */ - void * base; /* base in memory where the RAM lives */ - uint8_t * offset_base8; /* base in memory where the RAM lives, 8-bit pointer, with the start offset pre-applied */ - uint16_t * offset_base16; /* base in memory where the RAM lives, 16-bit pointer, with the start offset pre-applied */ - uint32_t * offset_base32; /* base in memory where the RAM lives, 32-bit pointer, with the start offset pre-applied */ - } m_fastram[MIPS3_MAX_FASTRAM]; - - uint32_t m_debugger_temp; - - /* core state */ - drc_cache m_cache; /* pointer to the DRC code cache */ - std::unique_ptr m_drcuml;/* DRC UML generator state */ - std::unique_ptr m_drcfe; /* pointer to the DRC front-end state */ - uint32_t m_drcoptions; /* configurable DRC options */ - - /* internal stuff */ - uint8_t m_cache_dirty; /* true if we need to flush the cache */ - - /* tables */ - uint8_t m_fpmode[4]; /* FPU mode table */ - - /* register mappings */ - uml::parameter m_regmap[34]; /* parameter to register mappings for all 32 integer registers */ - uml::parameter m_regmaplo[34]; /* parameter to register mappings for all 32 integer registers */ - - /* subroutines */ - uml::code_handle * m_entry; /* entry point */ - uml::code_handle * m_nocode; /* nocode exception handler */ - uml::code_handle * m_out_of_cycles; /* out of cycles exception handler */ - uml::code_handle * m_tlb_mismatch; /* tlb mismatch handler */ - uml::code_handle * m_read8[3]; /* read byte */ - uml::code_handle * m_write8[3]; /* write byte */ - uml::code_handle * m_read16[3]; /* read half */ - uml::code_handle * m_write16[3]; /* write half */ - uml::code_handle * m_read32[3]; /* read word */ - uml::code_handle * m_read32mask[3]; /* read word masked */ - uml::code_handle * m_write32[3]; /* write word */ - uml::code_handle * m_write32mask[3]; /* write word masked */ - uml::code_handle * m_read64[3]; /* read double */ - uml::code_handle * m_read64mask[3]; /* read double masked */ - uml::code_handle * m_write64[3]; /* write double */ - uml::code_handle * m_write64mask[3]; /* write double masked */ - uml::code_handle * m_exception[18/*EXCEPTION_COUNT*/]; /* array of exception handlers */ - uml::code_handle * m_exception_norecover[18/*EXCEPTION_COUNT*/]; /* array of no-recover exception handlers */ - - /* hotspots */ - uint32_t m_hotspot_select; - struct { - offs_t pc; /* PC to consider */ - uint32_t opcode; /* required opcode at that PC */ - uint32_t cycles; /* number of cycles to eat when hit */ - } m_hotspot[MIPS3_MAX_HOTSPOTS]; - bool m_isdrc; - - - void generate_exception(int exception, int backup); - void generate_tlb_exception(int exception, offs_t address); - void check_irqs(); + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_stop() override; + + // device_execute_interface overrides + virtual uint32_t execute_min_cycles() const override { return 1; } + virtual uint32_t execute_max_cycles() const override { return 40; } + virtual uint32_t execute_input_lines() const override { return 6; } + virtual void execute_run() override; + virtual void execute_set_input(int inputnum, int state) override; + virtual void execute_burn(int32_t cycles) override { m_totalcycles += cycles; } + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + virtual bool memory_translate(int spacenum, int intention, offs_t &address) override; + + // device_state_interface overrides + virtual void state_export(const device_state_entry &entry) override; + virtual void state_string_export(const device_state_entry &entry, std::string &str) const override; + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + void invalid_instruction(uint32_t op); + + virtual bool RBYTE(offs_t address, uint32_t *result); + virtual bool RHALF(offs_t address, uint32_t *result); + virtual bool RWORD(offs_t address, uint32_t *result); + virtual bool RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask); + virtual bool RDOUBLE(offs_t address, uint64_t *result); + virtual bool RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask); + virtual void WBYTE(offs_t address, uint8_t data); + virtual void WHALF(offs_t address, uint16_t data); + virtual void WWORD(offs_t address, uint32_t data); + virtual void WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask); + virtual void WDOUBLE(offs_t address, uint64_t data); + virtual void WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask); + + struct internal_mips3_state { + /* core registers */ + uint32_t pc; + int icount; + uint64_t r[35]; + uint32_t sa; + + /* upper 64 bits of 128-bit GPRs (R5900 only) */ + uint64_t rh[35]; + + /* COP registers */ + uint64_t cpr[3][32]; + uint64_t ccr[3][32]; + uint32_t llbit; + float acc; + + /* VU0 registers (R5900 only) */ + float vfr[32][4]; // 0..3 = x..w + uint32_t vcr[32]; + float vumem[0x1000]; + float* vfmem; + uint32_t* vimem; + float vacc[4]; + float p; + + uint32_t* vr; + float* i; + float* q; + + uint32_t mode; /* current global mode */ + + /* parameters for subroutines */ + uint64_t numcycles; /* return value from gettotalcycles */ + const char * format; /* format string for print_debug */ + uint32_t arg0; /* print_debug argument 1 */ + uint32_t arg1; /* print_debug argument 2 */ + + uint64_t count_zero_time; + uint32_t compare_armed; + uint32_t jmpdest; /* destination jump target */ + }; + + /* core state */ + internal_mips3_state *m_core; + + address_space_config m_program_config; + mips3_flavor m_flavor; + + /* internal stuff */ + uint32_t m_ppc; + uint32_t m_nextpc; + uint32_t m_pcbase; + uint8_t m_cf[4][8]; + bool m_delayslot; + int m_op; + int m_interrupt_cycles; + uint32_t m_ll_value; + uint64_t m_lld_value; + uint32_t m_badcop_value; + + /* endian-dependent load/store */ + typedef void (mips3_device::*loadstore_func)(uint32_t op); + loadstore_func m_lwl; + loadstore_func m_lwr; + loadstore_func m_swl; + loadstore_func m_swr; + loadstore_func m_ldl; + loadstore_func m_ldr; + loadstore_func m_sdl; + loadstore_func m_sdr; + + address_space * m_program; + uint32_t m_data_bits; + std::function m_pr32; + std::function m_prptr; + uint32_t c_system_clock; + uint32_t m_cpu_clock; + emu_timer * m_compare_int_timer; + + /* derived info based on flavor */ + uint32_t m_pfnmask; + uint8_t m_tlbentries; + + /* memory accesses */ + bool m_bigendian; + uint32_t m_byte_xor; + uint32_t m_word_xor; + data_accessors m_memory; + + /* cache memory */ + size_t c_icache_size; + size_t c_dcache_size; + + /* MMU */ + mips3_tlb_entry m_tlb[MIPS3_MAX_TLB_ENTRIES]; + + /* fast RAM */ + uint32_t m_fastram_select; + struct { + offs_t start; /* start of the RAM block */ + offs_t end; /* end of the RAM block */ + bool readonly; /* true if read-only */ + void * base; /* base in memory where the RAM lives */ + uint8_t * offset_base8; /* base in memory where the RAM lives, 8-bit pointer, with the start offset pre-applied */ + uint16_t * offset_base16; /* base in memory where the RAM lives, 16-bit pointer, with the start offset pre-applied */ + uint32_t * offset_base32; /* base in memory where the RAM lives, 32-bit pointer, with the start offset pre-applied */ + } m_fastram[MIPS3_MAX_FASTRAM]; + + uint32_t m_debugger_temp; + + /* core state */ + drc_cache m_cache; /* pointer to the DRC code cache */ + std::unique_ptr m_drcuml;/* DRC UML generator state */ + std::unique_ptr m_drcfe; /* pointer to the DRC front-end state */ + uint32_t m_drcoptions; /* configurable DRC options */ + + /* internal stuff */ + uint8_t m_cache_dirty; /* true if we need to flush the cache */ + + /* tables */ + uint8_t m_fpmode[4]; /* FPU mode table */ + + /* register mappings */ + uml::parameter m_regmap[34]; /* parameter to register mappings for all 32 integer registers */ + uml::parameter m_regmaplo[34]; /* parameter to register mappings for all 32 integer registers */ + + /* subroutines */ + uml::code_handle * m_entry; /* entry point */ + uml::code_handle * m_nocode; /* nocode exception handler */ + uml::code_handle * m_out_of_cycles; /* out of cycles exception handler */ + uml::code_handle * m_tlb_mismatch; /* tlb mismatch handler */ + uml::code_handle * m_read8[3]; /* read byte */ + uml::code_handle * m_write8[3]; /* write byte */ + uml::code_handle * m_read16[3]; /* read half */ + uml::code_handle * m_write16[3]; /* write half */ + uml::code_handle * m_read32[3]; /* read word */ + uml::code_handle * m_read32mask[3]; /* read word masked */ + uml::code_handle * m_write32[3]; /* write word */ + uml::code_handle * m_write32mask[3]; /* write word masked */ + uml::code_handle * m_read64[3]; /* read double */ + uml::code_handle * m_read64mask[3]; /* read double masked */ + uml::code_handle * m_write64[3]; /* write double */ + uml::code_handle * m_write64mask[3]; /* write double masked */ + uml::code_handle * m_exception[18/*EXCEPTION_COUNT*/]; /* array of exception handlers */ + uml::code_handle * m_exception_norecover[18/*EXCEPTION_COUNT*/]; /* array of no-recover exception handlers */ + + /* hotspots */ + uint32_t m_hotspot_select; + struct { + offs_t pc; /* PC to consider */ + uint32_t opcode; /* required opcode at that PC */ + uint32_t cycles; /* number of cycles to eat when hit */ + } m_hotspot[MIPS3_MAX_HOTSPOTS]; + bool m_isdrc; + + + void generate_exception(int exception, int backup); + void generate_tlb_exception(int exception, offs_t address); + void check_irqs(); public: - void mips3com_update_cycle_counting(); - void mips3com_asid_changed(); - void mips3com_tlbr(); - void mips3com_tlbwi(); - void mips3com_tlbwr(); - void mips3com_tlbp(); + void mips3com_update_cycle_counting(); + void mips3com_asid_changed(); + void mips3com_tlbr(); + void mips3com_tlbwi(); + void mips3com_tlbwr(); + void mips3com_tlbp(); private: - uint32_t compute_config_register(); - uint32_t compute_prid_register(); - - void tlb_map_entry(int tlbindex); - void tlb_write_common(int tlbindex); - - uint64_t get_cop0_reg(int idx); - void set_cop0_reg(int idx, uint64_t val); - uint64_t get_cop0_creg(int idx); - void set_cop0_creg(int idx, uint64_t val); - void handle_cop0(uint32_t op); - - uint32_t get_cop1_reg32(int idx); - uint64_t get_cop1_reg64(int idx); - void set_cop1_reg32(int idx, uint32_t val); - void set_cop1_reg64(int idx, uint64_t val); - uint64_t get_cop1_creg(int idx); - void set_cop1_creg(int idx, uint64_t val); - void handle_cop1_fr0(uint32_t op); - void handle_cop1_fr1(uint32_t op); - void handle_cop1x_fr0(uint32_t op); - void handle_cop1x_fr1(uint32_t op); - - virtual uint64_t get_cop2_reg(int idx); - virtual void set_cop2_reg(int idx, uint64_t val); - virtual uint64_t get_cop2_creg(int idx); - virtual void set_cop2_creg(int idx, uint64_t val); - void handle_cop2(uint32_t op); - - void handle_special(uint32_t op); - void handle_regimm(uint32_t op); - virtual void handle_extra_base(uint32_t op); - virtual void handle_extra_special(uint32_t op); - virtual void handle_extra_regimm(uint32_t op); - virtual void handle_extra_cop0(uint32_t op); - virtual void handle_extra_cop1(uint32_t op); - virtual void handle_extra_cop2(uint32_t op); - virtual void handle_idt(uint32_t op); - virtual void handle_ldc2(uint32_t op); - virtual void handle_sdc2(uint32_t op); - virtual void handle_dmfc2(uint32_t op); - virtual void handle_dmtc2(uint32_t op); - - void lwl_be(uint32_t op); - void lwr_be(uint32_t op); - void ldl_be(uint32_t op); - void ldr_be(uint32_t op); - void swl_be(uint32_t op); - void swr_be(uint32_t op); - void sdl_be(uint32_t op); - void sdr_be(uint32_t op); - void lwl_le(uint32_t op); - void lwr_le(uint32_t op); - void ldl_le(uint32_t op); - void ldr_le(uint32_t op); - void swl_le(uint32_t op); - void swr_le(uint32_t op); - void sdl_le(uint32_t op); - void sdr_le(uint32_t op); - void load_fast_iregs(drcuml_block &block); - void save_fast_iregs(drcuml_block &block); - void code_flush_cache(); - void code_compile_block(uint8_t mode, offs_t pc); + uint32_t compute_config_register(); + uint32_t compute_prid_register(); + + void tlb_map_entry(int tlbindex); + void tlb_write_common(int tlbindex); + + uint64_t get_cop0_reg(int idx); + void set_cop0_reg(int idx, uint64_t val); + uint64_t get_cop0_creg(int idx); + void set_cop0_creg(int idx, uint64_t val); + void handle_cop0(uint32_t op); + + uint32_t get_cop1_reg32(int idx); + uint64_t get_cop1_reg64(int idx); + void set_cop1_reg32(int idx, uint32_t val); + void set_cop1_reg64(int idx, uint64_t val); + uint64_t get_cop1_creg(int idx); + void set_cop1_creg(int idx, uint64_t val); + void handle_cop1_fr0(uint32_t op); + void handle_cop1_fr1(uint32_t op); + void handle_cop1x_fr0(uint32_t op); + void handle_cop1x_fr1(uint32_t op); + + virtual uint64_t get_cop2_reg(int idx); + virtual void set_cop2_reg(int idx, uint64_t val); + virtual uint64_t get_cop2_creg(int idx); + virtual void set_cop2_creg(int idx, uint64_t val); + void handle_cop2(uint32_t op); + + void handle_special(uint32_t op); + void handle_regimm(uint32_t op); + virtual void handle_extra_base(uint32_t op); + virtual void handle_extra_special(uint32_t op); + virtual void handle_extra_regimm(uint32_t op); + virtual void handle_extra_cop0(uint32_t op); + virtual void handle_extra_cop1(uint32_t op); + virtual void handle_extra_cop2(uint32_t op); + virtual void handle_idt(uint32_t op); + virtual void handle_ldc2(uint32_t op); + virtual void handle_sdc2(uint32_t op); + virtual void handle_dmfc2(uint32_t op); + virtual void handle_dmtc2(uint32_t op); + + void lwl_be(uint32_t op); + void lwr_be(uint32_t op); + void ldl_be(uint32_t op); + void ldr_be(uint32_t op); + void swl_be(uint32_t op); + void swr_be(uint32_t op); + void sdl_be(uint32_t op); + void sdr_be(uint32_t op); + void lwl_le(uint32_t op); + void lwr_le(uint32_t op); + void ldl_le(uint32_t op); + void ldr_le(uint32_t op); + void swl_le(uint32_t op); + void swr_le(uint32_t op); + void sdl_le(uint32_t op); + void sdr_le(uint32_t op); + void load_fast_iregs(drcuml_block &block); + void save_fast_iregs(drcuml_block &block); + void code_flush_cache(); + void code_compile_block(uint8_t mode, offs_t pc); public: - void func_get_cycles(); - void func_printf_exception(); - void func_printf_debug(); - void func_printf_probe(); - void func_unimplemented(); + void func_get_cycles(); + void func_printf_exception(); + void func_printf_debug(); + void func_printf_probe(); + void func_unimplemented(); private: - /* internal compiler state */ - struct compiler_state { - compiler_state &operator=(compiler_state &) = delete; - - uint32_t cycles; /* accumulated cycles */ - uint8_t checkints; /* need to check interrupts before next instruction */ - uint8_t checksoftints; /* need to check software interrupts before next instruction */ - uml::code_label labelnum; /* index for local labels */ - }; - - void static_generate_entry_point(); - void static_generate_nocode_handler(); - void static_generate_out_of_cycles(); - void static_generate_tlb_mismatch(); - void static_generate_exception(uint8_t exception, int recover, const char *name); - void static_generate_memory_accessor(int mode, int size, int iswrite, int ismasked, const char *name, uml::code_handle *&handleptr); - - void generate_update_mode(drcuml_block &block); - void generate_update_cycles(drcuml_block &block, compiler_state &compiler, uml::parameter param, bool allow_exception); - void generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); - void generate_sequence_instruction(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - void generate_delay_slot_and_branch(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t linkreg); - - bool generate_opcode(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - bool generate_special(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - bool generate_regimm(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - bool generate_idt(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - - bool generate_set_cop0_reg(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t reg); - bool generate_get_cop0_reg(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t reg); - bool generate_cop0(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - bool generate_cop1(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - bool generate_cop1x(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); - - void check_cop0_access(drcuml_block &block); - void check_cop1_access(drcuml_block &block); - void generate_badcop(drcuml_block &block, const int cop); - - void log_add_disasm_comment(drcuml_block &block, uint32_t pc, uint32_t op); - const char *log_desc_flags_to_string(uint32_t flags); - void log_register_list(const char *string, const uint32_t *reglist, const uint32_t *regnostarlist); - void log_opcode_desc(const opcode_desc *desclist, int indent); + /* internal compiler state */ + struct compiler_state { + compiler_state &operator=(compiler_state &) = delete; + + uint32_t cycles; /* accumulated cycles */ + uint8_t checkints; /* need to check interrupts before next instruction */ + uint8_t checksoftints; /* need to check software interrupts before next instruction */ + uml::code_label labelnum; /* index for local labels */ + }; + + void static_generate_entry_point(); + void static_generate_nocode_handler(); + void static_generate_out_of_cycles(); + void static_generate_tlb_mismatch(); + void static_generate_exception(uint8_t exception, int recover, const char *name); + void static_generate_memory_accessor(int mode, int size, int iswrite, int ismasked, const char *name, uml::code_handle *&handleptr); + + void generate_update_mode(drcuml_block &block); + void generate_update_cycles(drcuml_block &block, compiler_state &compiler, uml::parameter param, bool allow_exception); + void generate_checksum_block(drcuml_block &block, compiler_state &compiler, const opcode_desc *seqhead, const opcode_desc *seqlast); + void generate_sequence_instruction(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + void generate_delay_slot_and_branch(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t linkreg); + + bool generate_opcode(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + bool generate_special(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + bool generate_regimm(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + bool generate_idt(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + + bool generate_set_cop0_reg(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t reg); + bool generate_get_cop0_reg(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc, uint8_t reg); + bool generate_cop0(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + bool generate_cop1(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + bool generate_cop1x(drcuml_block &block, compiler_state &compiler, const opcode_desc *desc); + + void check_cop0_access(drcuml_block &block); + void check_cop1_access(drcuml_block &block); + void generate_badcop(drcuml_block &block, const int cop); + + void log_add_disasm_comment(drcuml_block &block, uint32_t pc, uint32_t op); + const char *log_desc_flags_to_string(uint32_t flags); + void log_register_list(const char *string, const uint32_t *reglist, const uint32_t *regnostarlist); + void log_opcode_desc(const opcode_desc *desclist, int indent); void load_elf(); }; @@ -635,268 +635,268 @@ private: class vr4300be_device : public mips3_device { public: - // construction/destruction - vr4300be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, VR4300BE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + vr4300be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, VR4300BE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_BIG, 32) // checkme + { + } }; class vr4300le_device : public mips3_device { public: - // construction/destruction - vr4300le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, VR4300LE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + vr4300le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, VR4300LE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class vr4310be_device : public mips3_device { public: - // construction/destruction - vr4310be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, VR4310BE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + vr4310be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, VR4310BE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_BIG, 32) // checkme + { + } }; class vr4310le_device : public mips3_device { public: - // construction/destruction - vr4310le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, VR4310LE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + vr4310le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, VR4310LE, tag, owner, clock, MIPS3_TYPE_VR4300, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class r4600be_device : public mips3_device { public: - // construction/destruction - r4600be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R4600BE, tag, owner, clock, MIPS3_TYPE_R4600, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + r4600be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4600BE, tag, owner, clock, MIPS3_TYPE_R4600, ENDIANNESS_BIG, 32) // checkme + { + } }; class r4600le_device : public mips3_device { public: - // construction/destruction - r4600le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R4600LE, tag, owner, clock, MIPS3_TYPE_R4600, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + r4600le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4600LE, tag, owner, clock, MIPS3_TYPE_R4600, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class r4650be_device : public mips3_device { public: - // construction/destruction - r4650be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R4650BE, tag, owner, clock, MIPS3_TYPE_R4650, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + r4650be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4650BE, tag, owner, clock, MIPS3_TYPE_R4650, ENDIANNESS_BIG, 32) // checkme + { + } }; class r4650le_device : public mips3_device { public: - // construction/destruction - r4650le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R4650LE, tag, owner, clock, MIPS3_TYPE_R4650, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + r4650le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4650LE, tag, owner, clock, MIPS3_TYPE_R4650, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class r4700be_device : public mips3_device { public: - // construction/destruction - r4700be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R4700BE, tag, owner, clock, MIPS3_TYPE_R4700, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + r4700be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4700BE, tag, owner, clock, MIPS3_TYPE_R4700, ENDIANNESS_BIG, 32) // checkme + { + } }; class r4700le_device : public mips3_device { public: - // construction/destruction - r4700le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R4700LE, tag, owner, clock, MIPS3_TYPE_R4700, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + r4700le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R4700LE, tag, owner, clock, MIPS3_TYPE_R4700, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class tx4925be_device : public mips3_device { public: - // construction/destruction - tx4925be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, TX4925BE, tag, owner, clock, MIPS3_TYPE_TX4925, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + tx4925be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, TX4925BE, tag, owner, clock, MIPS3_TYPE_TX4925, ENDIANNESS_BIG, 32) // checkme + { + } }; class tx4925le_device : public mips3_device { public: - // construction/destruction - tx4925le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, TX4925LE, tag, owner, clock, MIPS3_TYPE_TX4925, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + tx4925le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, TX4925LE, tag, owner, clock, MIPS3_TYPE_TX4925, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class r5000be_device : public mips3_device { public: - // construction/destruction - r5000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R5000BE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + r5000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R5000BE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_BIG, 32) // checkme + { + } }; class r5000le_device : public mips3_device { public: - // construction/destruction - r5000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R5000LE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + r5000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R5000LE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class vr5500be_device : public mips3_device { public: - // construction/destruction - vr5500be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, VR5500BE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_BIG, 32) { - } + // construction/destruction + vr5500be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, VR5500BE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_BIG, 32) { + } }; class vr5500le_device : public mips3_device { public: - // construction/destruction - vr5500le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, VR5500LE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + vr5500le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, VR5500LE, tag, owner, clock, MIPS3_TYPE_R5000, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class r5900le_device : public mips3_device { public: - // construction/destruction - template - r5900le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&vu0_tag) - : r5900le_device(mconfig, tag, owner, clock) + // construction/destruction + template + r5900le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&vu0_tag) + : r5900le_device(mconfig, tag, owner, clock) { m_vu0.set_tag(std::forward(vu0_tag)); - } + } - r5900le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, R5900LE, tag, owner, clock, MIPS3_TYPE_R5900, ENDIANNESS_LITTLE, 64) - , m_vu0(*this, finder_base::DUMMY_TAG) + r5900le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, R5900LE, tag, owner, clock, MIPS3_TYPE_R5900, ENDIANNESS_LITTLE, 64) + , m_vu0(*this, finder_base::DUMMY_TAG) { - } + } protected: virtual void device_start() override; - // device_disasm_interface overrides - virtual std::unique_ptr create_disassembler() override; - - bool RBYTE(offs_t address, uint32_t *result) override; - bool RHALF(offs_t address, uint32_t *result) override; - bool RWORD(offs_t address, uint32_t *result) override; - bool RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask) override; - bool RDOUBLE(offs_t address, uint64_t *result) override; - bool RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask) override; - void WBYTE(offs_t address, uint8_t data) override; - void WHALF(offs_t address, uint16_t data) override; - void WWORD(offs_t address, uint32_t data) override; - void WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask) override; - void WDOUBLE(offs_t address, uint64_t data) override; - void WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask) override; - - bool RQUAD(offs_t address, uint64_t *result_hi, uint64_t *result_lo); + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + bool RBYTE(offs_t address, uint32_t *result) override; + bool RHALF(offs_t address, uint32_t *result) override; + bool RWORD(offs_t address, uint32_t *result) override; + bool RWORD_MASKED(offs_t address, uint32_t *result, uint32_t mem_mask) override; + bool RDOUBLE(offs_t address, uint64_t *result) override; + bool RDOUBLE_MASKED(offs_t address, uint64_t *result, uint64_t mem_mask) override; + void WBYTE(offs_t address, uint8_t data) override; + void WHALF(offs_t address, uint16_t data) override; + void WWORD(offs_t address, uint32_t data) override; + void WWORD_MASKED(offs_t address, uint32_t data, uint32_t mem_mask) override; + void WDOUBLE(offs_t address, uint64_t data) override; + void WDOUBLE_MASKED(offs_t address, uint64_t data, uint64_t mem_mask) override; + + bool RQUAD(offs_t address, uint64_t *result_hi, uint64_t *result_lo); void WQUAD(offs_t address, uint64_t data_hi, uint64_t data_lo); - uint64_t get_cop2_reg(int idx) override; - void set_cop2_reg(int idx, uint64_t val) override; - uint64_t get_cop2_creg(int idx) override; - void set_cop2_creg(int idx, uint64_t val) override; - - void handle_extra_base(uint32_t op) override; - void handle_extra_special(uint32_t op) override; - void handle_extra_regimm(uint32_t op) override; - void handle_extra_cop0(uint32_t op) override; - void handle_extra_cop1(uint32_t op) override; - void handle_extra_cop2(uint32_t op) override; - void handle_idt(uint32_t op) override; - void handle_mmi0(uint32_t op); - void handle_mmi1(uint32_t op); - void handle_mmi2(uint32_t op); - void handle_mmi3(uint32_t op); - void handle_ldc2(uint32_t op) override; - void handle_sdc2(uint32_t op) override; - void handle_dmfc2(uint32_t op) override; - void handle_dmtc2(uint32_t op) override; - - required_device m_vu0; + uint64_t get_cop2_reg(int idx) override; + void set_cop2_reg(int idx, uint64_t val) override; + uint64_t get_cop2_creg(int idx) override; + void set_cop2_creg(int idx, uint64_t val) override; + + void handle_extra_base(uint32_t op) override; + void handle_extra_special(uint32_t op) override; + void handle_extra_regimm(uint32_t op) override; + void handle_extra_cop0(uint32_t op) override; + void handle_extra_cop1(uint32_t op) override; + void handle_extra_cop2(uint32_t op) override; + void handle_idt(uint32_t op) override; + void handle_mmi0(uint32_t op); + void handle_mmi1(uint32_t op); + void handle_mmi2(uint32_t op); + void handle_mmi3(uint32_t op); + void handle_ldc2(uint32_t op) override; + void handle_sdc2(uint32_t op) override; + void handle_dmfc2(uint32_t op) override; + void handle_dmtc2(uint32_t op) override; + + required_device m_vu0; }; class qed5271be_device : public mips3_device { public: - // construction/destruction - qed5271be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, QED5271BE, tag, owner, clock, MIPS3_TYPE_QED5271, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + qed5271be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, QED5271BE, tag, owner, clock, MIPS3_TYPE_QED5271, ENDIANNESS_BIG, 32) // checkme + { + } }; class qed5271le_device : public mips3_device { public: - // construction/destruction - qed5271le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, QED5271LE, tag, owner, clock, MIPS3_TYPE_QED5271, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + qed5271le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, QED5271LE, tag, owner, clock, MIPS3_TYPE_QED5271, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class rm7000be_device : public mips3_device { public: - // construction/destruction - rm7000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, RM7000BE, tag, owner, clock, MIPS3_TYPE_RM7000, ENDIANNESS_BIG, 32) // checkme - { - } + // construction/destruction + rm7000be_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, RM7000BE, tag, owner, clock, MIPS3_TYPE_RM7000, ENDIANNESS_BIG, 32) // checkme + { + } }; class rm7000le_device : public mips3_device { public: - // construction/destruction - rm7000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : mips3_device(mconfig, RM7000LE, tag, owner, clock, MIPS3_TYPE_RM7000, ENDIANNESS_LITTLE, 32) // checkme - { - } + // construction/destruction + rm7000le_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : mips3_device(mconfig, RM7000LE, tag, owner, clock, MIPS3_TYPE_RM7000, ENDIANNESS_LITTLE, 32) // checkme + { + } }; class mips3_frontend : public drc_frontend { public: - // construction/destruction - mips3_frontend(mips3_device *mips3, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); + // construction/destruction + mips3_frontend(mips3_device *mips3, uint32_t window_start, uint32_t window_end, uint32_t max_sequence); protected: - // required overrides - virtual bool describe(opcode_desc &desc, const opcode_desc *prev) override; + // required overrides + virtual bool describe(opcode_desc &desc, const opcode_desc *prev) override; private: - // internal helpers - bool describe_special(uint32_t op, opcode_desc &desc); - bool describe_regimm(uint32_t op, opcode_desc &desc); - bool describe_idt(uint32_t op, opcode_desc &desc); - bool describe_cop0(uint32_t op, opcode_desc &desc); - bool describe_cop1(uint32_t op, opcode_desc &desc); - bool describe_cop1x(uint32_t op, opcode_desc &desc); - bool describe_cop2(uint32_t op, opcode_desc &desc); - - // internal state - mips3_device *m_mips3; + // internal helpers + bool describe_special(uint32_t op, opcode_desc &desc); + bool describe_regimm(uint32_t op, opcode_desc &desc); + bool describe_idt(uint32_t op, opcode_desc &desc); + bool describe_cop0(uint32_t op, opcode_desc &desc); + bool describe_cop1(uint32_t op, opcode_desc &desc); + bool describe_cop1x(uint32_t op, opcode_desc &desc); + bool describe_cop2(uint32_t op, opcode_desc &desc); + + // internal state + mips3_device *m_mips3; }; diff --git a/src/devices/cpu/mips/mips3com.cpp b/src/devices/cpu/mips/mips3com.cpp index 294dd6b20e5..3893dfb19e0 100644 --- a/src/devices/cpu/mips/mips3com.cpp +++ b/src/devices/cpu/mips/mips3com.cpp @@ -367,7 +367,7 @@ void mips3_device::tlb_map_entry(int tlbindex) } /* get the number of pages from the page mask */ - /* R5900: if the S bit is set in EntryLo, it is the scratchpad, and is always 4 pages. */ + /* R5900: if the S bit is set in EntryLo, it is the scratchpad, and is always 4 pages. */ if ((entry->entry_lo[0] & 0x80000000) && m_flavor == MIPS3_TYPE_R5900) count = 4; else diff --git a/src/devices/cpu/mips/mips3com.h b/src/devices/cpu/mips/mips3com.h index 96fc9c28b09..83195ca037f 100644 --- a/src/devices/cpu/mips/mips3com.h +++ b/src/devices/cpu/mips/mips3com.h @@ -124,9 +124,9 @@ #define SR_IMEX4 0x00004000 #define SR_IMEX5 0x00008000 #define SR_DE 0x00010000 -#define SR_EIE 0x00010000 /* R5900/EE only, Enable IE bit */ +#define SR_EIE 0x00010000 /* R5900/EE only, Enable IE bit */ #define SR_CE 0x00020000 -#define SR_EDI 0x00020000 /* R5900/EE only, EI/DI instruction enable */ +#define SR_EDI 0x00020000 /* R5900/EE only, EI/DI instruction enable */ #define SR_CH 0x00040000 #define SR_SR 0x00100000 #define SR_TS 0x00200000 diff --git a/src/devices/cpu/mips/mips3dsm.cpp b/src/devices/cpu/mips/mips3dsm.cpp index e39bbab03c7..f394b99cb76 100644 --- a/src/devices/cpu/mips/mips3dsm.cpp +++ b/src/devices/cpu/mips/mips3dsm.cpp @@ -172,12 +172,12 @@ uint32_t mips3_disassembler::dasm_cop0(uint32_t pc, uint32_t op, std::ostream &s case 0x02: util::stream_format(stream, "tlbwi"); break; case 0x06: util::stream_format(stream, "tlbwr"); break; case 0x08: util::stream_format(stream, "tlbp"); break; - case 0x10: util::stream_format(stream, "rfe"); flags = STEP_OUT; break; - case 0x18: util::stream_format(stream, "eret"); break; - default: dasm_extra_cop0(pc, op, stream); break; + case 0x10: util::stream_format(stream, "rfe"); flags = STEP_OUT; break; + case 0x18: util::stream_format(stream, "eret"); break; + default: dasm_extra_cop0(pc, op, stream); break; } break; - default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; + default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; } return flags; } @@ -841,9 +841,9 @@ uint32_t ee_disassembler::dasm_extra_special(uint32_t pc, uint32_t op, std::ostr switch (op & 63) { - case 0x28: util::stream_format(stream, "mfsa %s", reg[rd]); break; - case 0x29: util::stream_format(stream, "mtsa %s", reg[rs]); break; - default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; + case 0x28: util::stream_format(stream, "mfsa %s", reg[rd]); break; + case 0x29: util::stream_format(stream, "mtsa %s", reg[rs]); break; + default: util::stream_format(stream, "dc.l $%08x [invalid]", op); break; } return 0; } diff --git a/src/devices/cpu/mips/ps2vif1.cpp b/src/devices/cpu/mips/ps2vif1.cpp index cb5e5da275e..203511141b7 100644 --- a/src/devices/cpu/mips/ps2vif1.cpp +++ b/src/devices/cpu/mips/ps2vif1.cpp @@ -14,6 +14,10 @@ #include "emu.h" #include "ps2vif1.h" +#include "ps2vu.h" +#include "video/ps2gs.h" +#include "video/ps2gif.h" + DEFINE_DEVICE_TYPE(SONYPS2_VIF1, ps2_vif1_device, "ps2vif1", "PlayStation 2 VIF1") /*static*/ const size_t ps2_vif1_device::BUFFER_SIZE = 0x40; @@ -32,39 +36,43 @@ ps2_vif1_device::ps2_vif1_device(const machine_config &mconfig, const char *tag, { } +ps2_vif1_device::~ps2_vif1_device() +{ +} + void ps2_vif1_device::device_start() { set_icountptr(m_icount); save_item(NAME(m_icount)); - save_item(NAME(m_buffer)); - save_item(NAME(m_curr)); - save_item(NAME(m_end)); - - save_item(NAME(m_status)); - save_item(NAME(m_control)); - save_item(NAME(m_err)); - save_item(NAME(m_mark)); - save_item(NAME(m_cycle)); - save_item(NAME(m_mode)); - save_item(NAME(m_num)); - save_item(NAME(m_mask)); - save_item(NAME(m_code)); - save_item(NAME(m_itops)); - save_item(NAME(m_base)); - save_item(NAME(m_offset)); - save_item(NAME(m_tops)); - save_item(NAME(m_itop)); - save_item(NAME(m_top)); - - save_item(NAME(m_row_fill)); - save_item(NAME(m_col_fill)); - - save_item(NAME(m_data_needed)); - save_item(NAME(m_data_index)); - save_item(NAME(m_command)); - save_item(NAME(m_alignment)); + save_item(NAME(m_buffer)); + save_item(NAME(m_curr)); + save_item(NAME(m_end)); + + save_item(NAME(m_status)); + save_item(NAME(m_control)); + save_item(NAME(m_err)); + save_item(NAME(m_mark)); + save_item(NAME(m_cycle)); + save_item(NAME(m_mode)); + save_item(NAME(m_num)); + save_item(NAME(m_mask)); + save_item(NAME(m_code)); + save_item(NAME(m_itops)); + save_item(NAME(m_base)); + save_item(NAME(m_offset)); + save_item(NAME(m_tops)); + save_item(NAME(m_itop)); + save_item(NAME(m_top)); + + save_item(NAME(m_row_fill)); + save_item(NAME(m_col_fill)); + + save_item(NAME(m_data_needed)); + save_item(NAME(m_data_index)); + save_item(NAME(m_command)); + save_item(NAME(m_alignment)); save_item(NAME(m_mpg_count)); save_item(NAME(m_mpg_addr)); @@ -83,37 +91,37 @@ void ps2_vif1_device::device_reset() { m_icount = 0; - memset(m_buffer, 0, sizeof(uint32_t) * BUFFER_SIZE); - m_curr = 0; - m_end = 0; - - m_status = 0; - m_control = 0; - m_err = 0; - m_mark = 0; - m_cycle = 0; - m_mode = 0; - m_num = 0; - m_mask = 0; - m_code = 0; - m_itops = 0; - m_base = 0; - m_offset = 0; - m_tops = 0; - m_itop = 0; - m_top = 0; - - memset(m_row_fill, 0, sizeof(uint32_t) * 4); - memset(m_col_fill, 0, sizeof(uint32_t) * 4); - - m_data_needed = 0; - m_data_index = 0; - m_command = 0; - m_alignment = 0; - - m_mpg_count = 0; - m_mpg_addr = 0; - m_mpg_insn = 0; + memset(m_buffer, 0, sizeof(uint32_t) * BUFFER_SIZE); + m_curr = 0; + m_end = 0; + + m_status = 0; + m_control = 0; + m_err = 0; + m_mark = 0; + m_cycle = 0; + m_mode = 0; + m_num = 0; + m_mask = 0; + m_code = 0; + m_itops = 0; + m_base = 0; + m_offset = 0; + m_tops = 0; + m_itop = 0; + m_top = 0; + + memset(m_row_fill, 0, sizeof(uint32_t) * 4); + memset(m_col_fill, 0, sizeof(uint32_t) * 4); + + m_data_needed = 0; + m_data_index = 0; + m_command = 0; + m_alignment = 0; + + m_mpg_count = 0; + m_mpg_addr = 0; + m_mpg_insn = 0; m_unpack_count = 0; m_unpack_addr = 0; diff --git a/src/devices/cpu/mips/ps2vif1.h b/src/devices/cpu/mips/ps2vif1.h index 0ef8482280a..6241381e7dc 100644 --- a/src/devices/cpu/mips/ps2vif1.h +++ b/src/devices/cpu/mips/ps2vif1.h @@ -9,8 +9,8 @@ * */ -#ifndef DEVICES_MACHINE_VIF1_H -#define DEVICES_MACHINE_VIF1_H +#ifndef MAME_CPU_MIPS_PS2VIF1_H +#define MAME_CPU_MIPS_PS2VIF1_H #pragma once @@ -21,17 +21,18 @@ class ps2_vif1_device : public device_t, public device_execute_interface { public: template - ps2_vif1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gs_tag, U &&vu1_tag) - : ps2_vif1_device(mconfig, tag, owner, clock) - { + ps2_vif1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gs_tag, U &&vu1_tag) + : ps2_vif1_device(mconfig, tag, owner, clock) + { m_gs.set_tag(std::forward(gs_tag)); m_vu1.set_tag(std::forward(vu1_tag)); } ps2_vif1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_vif1_device() override; - DECLARE_READ64_MEMBER(mmio_r); - DECLARE_WRITE64_MEMBER(mmio_w); + DECLARE_READ64_MEMBER(mmio_r); + DECLARE_WRITE64_MEMBER(mmio_w); DECLARE_READ32_MEMBER(regs_r); DECLARE_WRITE32_MEMBER(regs_w); @@ -41,8 +42,8 @@ public: bool fifo_available(uint32_t count) const { return (BUFFER_SIZE - m_end) >= count; } protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; virtual void execute_run() override; uint32_t calculate_unpack_count(); @@ -66,42 +67,42 @@ protected: STAT_MODE_DATA = 3, STAT_E_WAIT = (1 << 2), - STAT_GS_WAIT = (1 << 3), - STAT_MARK = (1 << 6), - STAT_DBUF = (1 << 7), + STAT_GS_WAIT = (1 << 3), + STAT_MARK = (1 << 6), + STAT_DBUF = (1 << 7), STAT_STALL_STOP = (1 << 8), STAT_STALL_FBRK = (1 << 9), STAT_STALL_INT = (1 << 10), - STAT_INT = (1 << 11), - STAT_BAD_TAG = (1 << 12), - STAT_BAD_CODE = (1 << 13), + STAT_INT = (1 << 11), + STAT_BAD_TAG = (1 << 12), + STAT_BAD_CODE = (1 << 13), STAT_FDR_TO_HOST = (1 << 23) }; enum : uint8_t { - CMD_INT = 0x80, - CMD_UNPACK_MASK = 0x10 + CMD_INT = 0x80, + CMD_UNPACK_MASK = 0x10 }; enum : uint8_t { - FMT_S32 = 0x00, - FMT_S16 = 0x01, - FMT_S8 = 0x02, - //FMT_UNK0 = 0x03, - FMT_V2_32 = 0x04, - FMT_V2_16 = 0x05, - FMT_V2_8 = 0x06, - //FMT_UNK1 = 0x07, - FMT_V3_32 = 0x08, - FMT_V3_16 = 0x09, - FMT_V3_8 = 0x0a, - //FMT_UNK2 = 0x0b, - FMT_V4_32 = 0x0c, - FMT_V4_16 = 0x0d, - FMT_V4_8 = 0x0e, - FMT_V4_5 = 0x0f, + FMT_S32 = 0x00, + FMT_S16 = 0x01, + FMT_S8 = 0x02, + //FMT_UNK0 = 0x03, + FMT_V2_32 = 0x04, + FMT_V2_16 = 0x05, + FMT_V2_8 = 0x06, + //FMT_UNK1 = 0x07, + FMT_V3_32 = 0x08, + FMT_V3_16 = 0x09, + FMT_V3_8 = 0x0a, + //FMT_UNK2 = 0x0b, + FMT_V4_32 = 0x0c, + FMT_V4_16 = 0x0d, + FMT_V4_8 = 0x0e, + FMT_V4_5 = 0x0f, }; required_device m_gs; @@ -109,28 +110,28 @@ protected: int m_icount; - uint32_t m_buffer[0x40]; - uint32_t m_curr; - uint32_t m_end; - - uint32_t m_status; - uint32_t m_control; - uint32_t m_err; - uint32_t m_mark; - uint32_t m_cycle; - uint32_t m_mode; - uint32_t m_num; - uint32_t m_mask; - uint32_t m_code; - uint32_t m_itops; - uint32_t m_base; - uint32_t m_offset; - uint32_t m_tops; - uint32_t m_itop; - uint32_t m_top; - - uint32_t m_row_fill[4]; - uint32_t m_col_fill[4]; + uint32_t m_buffer[0x40]; + uint32_t m_curr; + uint32_t m_end; + + uint32_t m_status; + uint32_t m_control; + uint32_t m_err; + uint32_t m_mark; + uint32_t m_cycle; + uint32_t m_mode; + uint32_t m_num; + uint32_t m_mask; + uint32_t m_code; + uint32_t m_itops; + uint32_t m_base; + uint32_t m_offset; + uint32_t m_tops; + uint32_t m_itop; + uint32_t m_top; + + uint32_t m_row_fill[4]; + uint32_t m_col_fill[4]; uint32_t m_data_needed; uint32_t m_data_index; @@ -149,13 +150,10 @@ protected: bool m_unpack_add_tops; uint8_t m_unpack_format; - static const size_t BUFFER_SIZE; - static const uint32_t FORMAT_SIZE[0x10]; + static const size_t BUFFER_SIZE; + static const uint32_t FORMAT_SIZE[0x10]; }; DECLARE_DEVICE_TYPE(SONYPS2_VIF1, ps2_vif1_device) -#include "video/ps2gs.h" -#include "ps2vu.h" - -#endif // DEVICES_MACHINE_PS2VIF1_H +#endif // MAME_CPU_MIPS_PS2VIF1_H diff --git a/src/devices/cpu/mips/ps2vu.cpp b/src/devices/cpu/mips/ps2vu.cpp index 3af58884aba..491af559fc9 100644 --- a/src/devices/cpu/mips/ps2vu.cpp +++ b/src/devices/cpu/mips/ps2vu.cpp @@ -11,6 +11,7 @@ #include "emu.h" #include "ps2vu.h" + #include "ps2vif1.h" #include "video/ps2gs.h" #include "video/ps2gif.h" @@ -20,8 +21,16 @@ DEFINE_DEVICE_TYPE(SONYPS2_VU0, sonyvu0_device, "sonyvu0", "Sony PlayStation 2 VU0") DEFINE_DEVICE_TYPE(SONYPS2_VU1, sonyvu1_device, "sonyvu1", "Sony PlayStation 2 VU1") -sonyvu_device::sonyvu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, - address_map_constructor micro_cons, address_map_constructor vu_cons, chip_type chiptype, uint32_t mem_size) +sonyvu_device::sonyvu_device( + const machine_config &mconfig, + device_type type, + const char *tag, + device_t *owner, + uint32_t clock, + address_map_constructor micro_cons, + address_map_constructor vu_cons, + chip_type chiptype, + uint32_t mem_size) : cpu_device(mconfig, type, tag, owner, clock) , m_micro_config("micro", ENDIANNESS_BIG, 64, 12, 0, micro_cons) , m_vu_config("vu", ENDIANNESS_BIG, 32, 12, 0, vu_cons) @@ -736,10 +745,10 @@ void sonyvu_device::execute_lower(const uint32_t op) { case 0x30: if (rs == 0 && rt == 0 && dest == 0) - { // NOP + { // NOP } else - { // MOVE + { // MOVE printf("Unsupported VU instruction: MOVE\n"); fflush(stdout); fatalerror("Unsupported VU instruction\n"); break; } break; diff --git a/src/devices/cpu/mips/ps2vu.h b/src/devices/cpu/mips/ps2vu.h index 9f22e9384ad..04b94c9a5f1 100644 --- a/src/devices/cpu/mips/ps2vu.h +++ b/src/devices/cpu/mips/ps2vu.h @@ -138,37 +138,37 @@ protected: // address spaces const address_space_config m_micro_config; const address_space_config m_vu_config; - address_space *m_micro_space; - address_space *m_vu_space; + address_space *m_micro_space; + address_space *m_vu_space; // core registers - uint32_t m_mem_size; - uint32_t m_mem_mask; + uint32_t m_mem_size; + uint32_t m_mem_mask; required_shared_ptr m_micro_mem; required_shared_ptr m_vu_mem; - float* m_vfmem; - uint32_t* m_vimem; + float* m_vfmem; + uint32_t* m_vimem; - float m_vfr[32][4]; // 0..3 = x..w - uint32_t m_vcr[32]; - float m_acc[4]; + float m_vfr[32][4]; // 0..3 = x..w + uint32_t m_vcr[32]; + float m_acc[4]; - float* m_v; + float* m_v; - uint32_t m_status_flag; - uint32_t m_mac_flag; - uint32_t m_clip_flag; - uint32_t m_r; - float m_i; - float m_q; + uint32_t m_status_flag; + uint32_t m_mac_flag; + uint32_t m_clip_flag; + uint32_t m_r; + float m_i; + float m_q; - uint32_t m_pc; - uint32_t m_delay_pc; - uint32_t m_start_pc; + uint32_t m_pc; + uint32_t m_delay_pc; + uint32_t m_start_pc; - bool m_running; + bool m_running; - int m_icount; + int m_icount; }; class sonyvu1_device : public sonyvu_device @@ -185,8 +185,8 @@ public: ps2_vif1_device* interface(); - DECLARE_READ64_MEMBER(vif_r); - DECLARE_WRITE64_MEMBER(vif_w); + DECLARE_READ64_MEMBER(vif_r); + DECLARE_WRITE64_MEMBER(vif_w); protected: virtual void device_start() override; @@ -232,17 +232,14 @@ protected: required_device m_vu1; - float* m_vu1_regs; - uint32_t m_control; - uint32_t m_vpu_stat; - uint32_t m_cmsar0; - uint32_t m_cmsar1; + float* m_vu1_regs; + uint32_t m_control; + uint32_t m_vpu_stat; + uint32_t m_cmsar0; + uint32_t m_cmsar1; }; DECLARE_DEVICE_TYPE(SONYPS2_VU1, sonyvu1_device) DECLARE_DEVICE_TYPE(SONYPS2_VU0, sonyvu0_device) -#include "video/ps2gs.h" -#include "cpu/mips/ps2vif1.h" - #endif // MAME_CPU_MIPS_PS2VU_H diff --git a/src/devices/cpu/mips/r3000.cpp b/src/devices/cpu/mips/r3000.cpp index a0084fd4c48..6495c922f86 100644 --- a/src/devices/cpu/mips/r3000.cpp +++ b/src/devices/cpu/mips/r3000.cpp @@ -15,7 +15,7 @@ #define ENABLE_OVERFLOWS (0) -#define ENABLE_IOP_KPUTS (1) +#define ENABLE_IOP_KPUTS (1) /*************************************************************************** diff --git a/src/devices/cpu/mips/vudasm.cpp b/src/devices/cpu/mips/vudasm.cpp index e3f7ab470d8..cb207498d1d 100644 --- a/src/devices/cpu/mips/vudasm.cpp +++ b/src/devices/cpu/mips/vudasm.cpp @@ -298,7 +298,7 @@ void sonyvu_disassembler::dasm_lower(uint32_t pc, uint32_t op, std::ostream &str util::stream_format(stream, "mtir %s, %s%s", VIREG[rt], VFREG[rs], fsf); break; case 0x3d: // MFIR - util::stream_format(stream, "mtir.%s %s%s %s", dest, VFREG[rt], destc, VIREG[rs] ); + util::stream_format(stream, "mtir.%s %s%s %s", dest, VFREG[rt], destc, VIREG[rs] ); break; case 0x3e: // ILWR util::stream_format(stream, "ilwr.%s %s, (%s)%s", dest, VIREG[rt], VIREG[rs], dest); diff --git a/src/devices/cpu/mips/vudasm.h b/src/devices/cpu/mips/vudasm.h index a2bbf5fb310..abd67ed89aa 100644 --- a/src/devices/cpu/mips/vudasm.h +++ b/src/devices/cpu/mips/vudasm.h @@ -38,4 +38,4 @@ private: static const char * VIREG[32]; }; -#endif // MAME_CPU_MIPS_VUDASM_H \ No newline at end of file +#endif // MAME_CPU_MIPS_VUDASM_H diff --git a/src/devices/machine/i8255.cpp b/src/devices/machine/i8255.cpp index ff2a43f3caf..4d1bee6e2a6 100644 --- a/src/devices/machine/i8255.cpp +++ b/src/devices/machine/i8255.cpp @@ -590,7 +590,7 @@ void i8255_device::set_mode(uint8_t data) m_control = m_control & ~CONTROL_PORT_C_UPPER_INPUT; m_control = m_control & ~CONTROL_PORT_C_LOWER_INPUT; } - + // group A if (!m_dont_clear_output_latches) m_output[PORT_A] = 0; diff --git a/src/devices/machine/i8255.h b/src/devices/machine/i8255.h index 3258f29256a..59ead81e797 100644 --- a/src/devices/machine/i8255.h +++ b/src/devices/machine/i8255.h @@ -117,7 +117,7 @@ protected: const bool m_force_portb_in; const bool m_force_portc_out; const bool m_dont_clear_output_latches; - + private: inline void check_interrupt(int port); inline void set_ibf(int port, int state); diff --git a/src/devices/machine/iopcdvd.cpp b/src/devices/machine/iopcdvd.cpp index 24c7136221c..a1e32e48a1c 100644 --- a/src/devices/machine/iopcdvd.cpp +++ b/src/devices/machine/iopcdvd.cpp @@ -9,6 +9,7 @@ * */ +#include "emu.h" #include "iopcdvd.h" DEFINE_DEVICE_TYPE(SONYIOP_CDVD, iop_cdvd_device, "iopcdvd", "PlayStation 2 disc controller") @@ -21,6 +22,10 @@ iop_cdvd_device::iop_cdvd_device(const machine_config &mconfig, const char *tag, { } +iop_cdvd_device::~iop_cdvd_device() +{ +} + void iop_cdvd_device::device_start() { save_item(NAME(m_channel[0].m_buffer)); diff --git a/src/devices/machine/iopcdvd.h b/src/devices/machine/iopcdvd.h index ddc164760cb..e5d95f0322f 100644 --- a/src/devices/machine/iopcdvd.h +++ b/src/devices/machine/iopcdvd.h @@ -9,32 +9,32 @@ * */ -#ifndef DEVICES_MACHINE_IOPCDVD_H -#define DEVICES_MACHINE_IOPCDVD_H +#ifndef MAME_MACHINE_IOPCDVD_H +#define MAME_MACHINE_IOPCDVD_H #pragma once -#include "emu.h" #include "iopintc.h" class iop_cdvd_device : public device_t { public: template - iop_cdvd_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag) - : iop_cdvd_device(mconfig, tag, owner, (uint32_t)0) - { + iop_cdvd_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag) + : iop_cdvd_device(mconfig, tag, owner, (uint32_t)0) + { m_intc.set_tag(std::forward(intc_tag)); } - iop_cdvd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + iop_cdvd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~iop_cdvd_device() override; DECLARE_READ8_MEMBER(read); DECLARE_WRITE8_MEMBER(write); protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; void handle_data_command(uint8_t data); void data_fifo_push(uint8_t data); @@ -70,4 +70,4 @@ protected: DECLARE_DEVICE_TYPE(SONYIOP_CDVD, iop_cdvd_device) -#endif // DEVICES_MACHINE_IOPCDVD_H \ No newline at end of file +#endif // MAME_MACHINE_IOPCDVD_H diff --git a/src/devices/machine/iopdma.cpp b/src/devices/machine/iopdma.cpp index 883a03eafd0..97b170a0a1a 100644 --- a/src/devices/machine/iopdma.cpp +++ b/src/devices/machine/iopdma.cpp @@ -11,8 +11,10 @@ #include "emu.h" #include "iopdma.h" + #include "cpu/mips/ps2vu.h" + DEFINE_DEVICE_TYPE(SONYIOP_DMA, iop_dma_device, "iopdma", "PlayStation 2 IOP DMAC") iop_dma_device::iop_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -27,6 +29,10 @@ iop_dma_device::iop_dma_device(const machine_config &mconfig, const char *tag, d { } +iop_dma_device::~iop_dma_device() +{ +} + void iop_dma_device::device_start() { set_icountptr(m_icount); @@ -237,7 +243,7 @@ void iop_dma_device::transfer_spu(uint32_t chan) //if (first_bank) //m_intc->raise_interrupt(iop_intc_device::INT_SPU); - transfer_finish(chan); + transfer_finish(chan); } } diff --git a/src/devices/machine/iopdma.h b/src/devices/machine/iopdma.h index 36e38556026..2492f7929ec 100644 --- a/src/devices/machine/iopdma.h +++ b/src/devices/machine/iopdma.h @@ -9,12 +9,11 @@ * */ -#ifndef DEVICES_MACHINE_IOPDMA_H -#define DEVICES_MACHINE_IOPDMA_H +#ifndef MAME_MACHINE_IOPDMA_H +#define MAME_MACHINE_IOPDMA_H #pragma once -#include "emu.h" #include "ps2sif.h" #include "iopintc.h" #include "iopsio2.h" @@ -24,9 +23,9 @@ class iop_dma_device : public device_t, public device_execute_interface { public: template - iop_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&intc_tag, U &&ram_tag, V &&sif_tag, W &&spu_tag, X &&sio2_tag) - : iop_dma_device(mconfig, tag, owner, clock) - { + iop_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&intc_tag, U &&ram_tag, V &&sif_tag, W &&spu_tag, X &&sio2_tag) + : iop_dma_device(mconfig, tag, owner, clock) + { m_intc.set_tag(std::forward(intc_tag)); m_ram.set_tag(std::forward(ram_tag)); m_sif.set_tag(std::forward(sif_tag)); @@ -34,7 +33,8 @@ public: m_sio2.set_tag(std::forward(sio2_tag)); } - iop_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + iop_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~iop_dma_device() override; DECLARE_READ32_MEMBER(bank0_r); DECLARE_WRITE32_MEMBER(bank0_w); @@ -127,8 +127,8 @@ protected: uint32_t m_count; }; - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; virtual void execute_run() override; void set_dpcr(uint32_t data, uint32_t index); @@ -161,4 +161,4 @@ protected: DECLARE_DEVICE_TYPE(SONYIOP_DMA, iop_dma_device) -#endif // DEVICES_MACHINE_IOPDMA_H \ No newline at end of file +#endif // MAME_MACHINE_IOPDMA_H diff --git a/src/devices/machine/iopintc.cpp b/src/devices/machine/iopintc.cpp index 9cace039047..9ffc14a6fe3 100644 --- a/src/devices/machine/iopintc.cpp +++ b/src/devices/machine/iopintc.cpp @@ -9,6 +9,7 @@ * */ +#include "emu.h" #include "iopintc.h" DEFINE_DEVICE_TYPE(SONYIOP_INTC, iop_intc_device, "iopintc", "PlayStation 2 IOP INTC") @@ -19,6 +20,10 @@ iop_intc_device::iop_intc_device(const machine_config &mconfig, const char *tag, { } +iop_intc_device::~iop_intc_device() +{ +} + void iop_intc_device::device_start() { save_item(NAME(m_status)); diff --git a/src/devices/machine/iopintc.h b/src/devices/machine/iopintc.h index d58b1ef52c7..ed326e3c7bf 100644 --- a/src/devices/machine/iopintc.h +++ b/src/devices/machine/iopintc.h @@ -9,25 +9,25 @@ * */ -#ifndef DEVICES_MACHINE_IOPINTC_H -#define DEVICES_MACHINE_IOPINTC_H +#ifndef MAME_MACHINE_IOPINTC_H +#define MAME_MACHINE_IOPINTC_H #pragma once -#include "emu.h" #include "cpu/mips/r3000.h" class iop_intc_device : public device_t { public: template - iop_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&iop_tag) - : iop_intc_device(mconfig, tag, owner, (uint32_t)0) - { + iop_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&iop_tag) + : iop_intc_device(mconfig, tag, owner, (uint32_t)0) + { m_iop.set_tag(std::forward(iop_tag)); } - iop_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + iop_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~iop_intc_device() override; DECLARE_READ32_MEMBER(read); DECLARE_WRITE32_MEMBER(write); @@ -45,8 +45,8 @@ public: }; protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; void update_interrupts(); @@ -58,4 +58,4 @@ protected: DECLARE_DEVICE_TYPE(SONYIOP_INTC, iop_intc_device) -#endif // DEVICES_MACHINE_IOPINTC_H \ No newline at end of file +#endif // MAME_MACHINE_IOPINTC_H diff --git a/src/devices/machine/iopsio2.cpp b/src/devices/machine/iopsio2.cpp index a779d8d4631..d0a15d97446 100644 --- a/src/devices/machine/iopsio2.cpp +++ b/src/devices/machine/iopsio2.cpp @@ -9,6 +9,7 @@ * */ +#include "emu.h" #include "iopsio2.h" DEFINE_DEVICE_TYPE(SONYIOP_SIO2, iop_sio2_device, "iopsio2", "PlayStation 2 IOP SIO2") @@ -24,6 +25,10 @@ iop_sio2_device::iop_sio2_device(const machine_config &mconfig, const char *tag, { } +iop_sio2_device::~iop_sio2_device() +{ +} + void iop_sio2_device::device_start() { if (!m_response_timer) @@ -241,29 +246,29 @@ void iop_sio2_device::transmit_to_device_hack(uint8_t data) if (!m_cmd_size) { - m_response_timer->adjust(attotime::from_ticks(8*pad(m_curr_port)->xmit_fifo_depth(), 250'000), m_curr_port); - m_curr_port++; + m_response_timer->adjust(attotime::from_ticks(8*pad(m_curr_port)->xmit_fifo_depth(), 250'000), m_curr_port); + m_curr_port++; }*/ break; case ps2_mc_device::SIO_DEVICE_ID: /*if (m_cmd_size || cmd_complete) { - logerror("Pushing %02x to memory card, m_cmd_size is %d\n", data, m_cmd_size); - m_mc0->recv_fifo_push(data); + logerror("Pushing %02x to memory card, m_cmd_size is %d\n", data, m_cmd_size); + m_mc0->recv_fifo_push(data); } if (cmd_complete) { - logerror("Command is complete, processing fifos\n"); - m_unknown_0x6c = 0x00001100; - m_mc0->process_fifos(); - while (m_mc0->xmit_fifo_depth() && m_end_byte < BUFFER_SIZE) - { - logerror("xmit fifo is %d, end byte is %d\n", m_mc0->xmit_fifo_depth(), m_end_byte); - receive_from_device_hack(m_mc0->xmit_fifo_pop()); - } - m_unknown_0x74 = m_cmd_length; + logerror("Command is complete, processing fifos\n"); + m_unknown_0x6c = 0x00001100; + m_mc0->process_fifos(); + while (m_mc0->xmit_fifo_depth() && m_end_byte < BUFFER_SIZE) + { + logerror("xmit fifo is %d, end byte is %d\n", m_mc0->xmit_fifo_depth(), m_end_byte); + receive_from_device_hack(m_mc0->xmit_fifo_pop()); + } + m_unknown_0x74 = m_cmd_length; }*/ m_unknown_0x6c = 0x0001d100; // TODO: As above receive_from_device_hack(0); diff --git a/src/devices/machine/iopsio2.h b/src/devices/machine/iopsio2.h index bfe69680c5c..fe1193ba09e 100644 --- a/src/devices/machine/iopsio2.h +++ b/src/devices/machine/iopsio2.h @@ -9,12 +9,11 @@ * */ -#ifndef DEVICES_MACHINE_IOPSIO2_H -#define DEVICES_MACHINE_IOPSIO2_H +#ifndef MAME_MACHINE_IOPSIO2_H +#define MAME_MACHINE_IOPSIO2_H #pragma once -#include "emu.h" #include "iopintc.h" #include "ps2pad.h" #include "ps2mc.h" @@ -23,16 +22,17 @@ class iop_sio2_device : public device_t { public: template - iop_sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag, U &&pad0_tag, V &&pad1_tag, W &&mc0_tag) - : iop_sio2_device(mconfig, tag, owner, (uint32_t)0) - { + iop_sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag, U &&pad0_tag, V &&pad1_tag, W &&mc0_tag) + : iop_sio2_device(mconfig, tag, owner, (uint32_t)0) + { m_intc.set_tag(std::forward(intc_tag)); m_pad0.set_tag(std::forward(pad0_tag)); m_pad1.set_tag(std::forward(pad1_tag)); m_mc0.set_tag(std::forward(mc0_tag)); } - iop_sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + iop_sio2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~iop_sio2_device() override; DECLARE_READ32_MEMBER(read); DECLARE_WRITE32_MEMBER(write); @@ -43,8 +43,8 @@ public: void receive_from_device_hack(uint8_t data); // TODO: Turn me into a bus interface! protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; TIMER_CALLBACK_MEMBER(response_timer); @@ -87,4 +87,4 @@ protected: DECLARE_DEVICE_TYPE(SONYIOP_SIO2, iop_sio2_device) -#endif // DEVICES_MACHINE_IOPSIO2_H \ No newline at end of file +#endif // MAME_MACHINE_IOPSIO2_H diff --git a/src/devices/machine/ioptimer.cpp b/src/devices/machine/ioptimer.cpp index 31c6c4fd6f2..a02f6c88ea5 100644 --- a/src/devices/machine/ioptimer.cpp +++ b/src/devices/machine/ioptimer.cpp @@ -18,8 +18,8 @@ iop_timer_device::iop_timer_device(const machine_config &mconfig, const char *ta : device_t(mconfig, SONYIOP_TIMER, tag, owner, clock) , m_compare_timer(nullptr) , m_overflow_timer(nullptr) - , m_last_update_time(attotime::zero) - , m_elapsed_time(attotime::zero) + , m_last_update_time(attotime::zero) + , m_elapsed_time(attotime::zero) , m_zero_return(false) , m_count(0) , m_compare(0) @@ -49,8 +49,8 @@ void iop_timer_device::device_reset() { m_ctrl = 0; - m_last_update_time = attotime::zero; - m_elapsed_time = attotime::zero; + m_last_update_time = attotime::zero; + m_elapsed_time = attotime::zero; m_zero_return = false; @@ -101,14 +101,14 @@ void iop_timer_device::update_overflow_timer() uint32_t ticks = 0; if (m_zero_return) { - if (m_compare > m_count) - ticks = m_compare - m_count; - else - ticks = (uint32_t)(0x100000000ULL - (m_count - m_compare)); + if (m_compare > m_count) + ticks = m_compare - m_count; + else + ticks = (uint32_t)(0x100000000ULL - (m_count - m_compare)); } else { - ticks = (uint32_t)(0x100000000ULL - m_count); + ticks = (uint32_t)(0x100000000ULL - m_count); } */ m_overflow_timer->adjust(attotime::never); @@ -116,38 +116,38 @@ void iop_timer_device::update_overflow_timer() void iop_timer_device::update_count() { - attotime curr_time = machine().scheduler().time(); - attotime time_delta = curr_time - m_last_update_time; - m_last_update_time = curr_time; - m_elapsed_time += time_delta; - uint32_t ticks = (uint32_t)m_elapsed_time.as_ticks(clock()); - if (ticks > 0) - { - m_elapsed_time -= attotime::from_ticks(ticks, clock()); - m_count += ticks; - } + attotime curr_time = machine().scheduler().time(); + attotime time_delta = curr_time - m_last_update_time; + m_last_update_time = curr_time; + m_elapsed_time += time_delta; + uint32_t ticks = (uint32_t)m_elapsed_time.as_ticks(clock()); + if (ticks > 0) + { + m_elapsed_time -= attotime::from_ticks(ticks, clock()); + m_count += ticks; + } } void iop_timer_device::set_ctrl(uint32_t data) { - static const char *gatm_names[4] = { "low?", "reset+rising?", "reset+falling?", "reset+both?" }; - logerror("%s: set_ctrl: GATE=%d, GATM=%s, ZRET=%d\n", machine().describe_context(), data & CTRL_GATE, gatm_names[(data & CTRL_GATM) >> 1], (data & CTRL_ZRET) >> 3); - logerror("%s: CMPE=%d, OVFE=%d, REP_INT=%d, TOG_INT=%d\n", machine().describe_context(), (data & CTRL_CMPE) >> 4, (data & CTRL_OVFE) >> 5, (data & CTRL_REPI) >> 6, (data & CTRL_TOGI) >> 7); + static const char *gatm_names[4] = { "low?", "reset+rising?", "reset+falling?", "reset+both?" }; + logerror("%s: set_ctrl: GATE=%d, GATM=%s, ZRET=%d\n", machine().describe_context(), data & CTRL_GATE, gatm_names[(data & CTRL_GATM) >> 1], (data & CTRL_ZRET) >> 3); + logerror("%s: CMPE=%d, OVFE=%d, REP_INT=%d, TOG_INT=%d\n", machine().describe_context(), (data & CTRL_CMPE) >> 4, (data & CTRL_OVFE) >> 5, (data & CTRL_REPI) >> 6, (data & CTRL_TOGI) >> 7); - const uint32_t old = m_ctrl; - m_ctrl = data | CTRL_INTE; - const uint32_t changed = old ^ data; + const uint32_t old = m_ctrl; + m_ctrl = data | CTRL_INTE; + const uint32_t changed = old ^ data; if (!changed) return; - m_gate_enable = data & CTRL_GATE; - m_gate_mode = (timer_gate_mode)((data & CTRL_GATM) >> 1); - m_zero_return = (data & CTRL_ZRET) >> 3; - m_cmp_int_enabled = (data & CTRL_CMPE) >> 4; - m_ovf_int_enabled = (data & CTRL_OVFE) >> 5; + m_gate_enable = data & CTRL_GATE; + m_gate_mode = (timer_gate_mode)((data & CTRL_GATM) >> 1); + m_zero_return = (data & CTRL_ZRET) >> 3; + m_cmp_int_enabled = (data & CTRL_CMPE) >> 4; + m_ovf_int_enabled = (data & CTRL_OVFE) >> 5; m_repeat_int = (data & CTRL_REPI) >> 6; m_toggle_int = (data & CTRL_TOGI) >> 7; - m_ienable = 1; + m_ienable = 1; m_count = 0; if (changed & CTRL_CMPE) @@ -200,64 +200,64 @@ TIMER_CALLBACK_MEMBER(iop_timer_device::overflow) READ32_MEMBER(iop_timer_device::read) { - uint32_t ret = 0; - switch (offset) - { - case 0x00: - { - //const uint32_t old = m_count; - update_count(); - ret = m_count; - //if (old != m_count) - //logerror("%s: IOP timer read: COUNT (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - } - - case 0x01: - ret = m_ctrl | (m_ovf_int ? CTRL_OVFF : 0) | (m_cmp_int ? CTRL_CMPF : 0); - logerror("%s: IOP timer read: MODE (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - - case 0x02: - ret = m_compare; - logerror("%s: IOP timer read: COMPARE (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - - default: - break; - } - return ret; + uint32_t ret = 0; + switch (offset) + { + case 0x00: + { + //const uint32_t old = m_count; + update_count(); + ret = m_count; + //if (old != m_count) + //logerror("%s: IOP timer read: COUNT (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + } + + case 0x01: + ret = m_ctrl | (m_ovf_int ? CTRL_OVFF : 0) | (m_cmp_int ? CTRL_CMPF : 0); + logerror("%s: IOP timer read: MODE (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + + case 0x02: + ret = m_compare; + logerror("%s: IOP timer read: COMPARE (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + + default: + break; + } + return ret; } WRITE32_MEMBER(iop_timer_device::write) { - switch (offset) - { - case 0x00: - m_count = data; - logerror("%s: IOP timer write: COUNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); - update_compare_timer(); - update_overflow_timer(); - break; - - case 0x01: - set_ctrl(data); - break; - - case 0x02: - { - logerror("%s: IOP timer write: COMPARE = %08x & %08x\n", machine().describe_context(), data, mem_mask); + switch (offset) + { + case 0x00: + m_count = data; + logerror("%s: IOP timer write: COUNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + update_compare_timer(); + update_overflow_timer(); + break; + + case 0x01: + set_ctrl(data); + break; + + case 0x02: + { + logerror("%s: IOP timer write: COMPARE = %08x & %08x\n", machine().describe_context(), data, mem_mask); if (m_compare == data) break; - m_compare = data; - if (!m_toggle_int) - m_ienable = true; - update_compare_timer(); - break; + m_compare = data; + if (!m_toggle_int) + m_ienable = true; + update_compare_timer(); + break; } - default: - break; - } + default: + break; + } } diff --git a/src/devices/machine/ioptimer.h b/src/devices/machine/ioptimer.h index dcaaf0a9004..316349e7a90 100644 --- a/src/devices/machine/ioptimer.h +++ b/src/devices/machine/ioptimer.h @@ -9,8 +9,8 @@ * */ -#ifndef DEVICES_MACHINE_IOPTIMER_H -#define DEVICES_MACHINE_IOPTIMER_H +#ifndef MAME_MACHINE_IOPTIMER_H +#define MAME_MACHINE_IOPTIMER_H #pragma once @@ -20,7 +20,7 @@ class iop_timer_device : public device_t { public: - iop_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + iop_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); template devcb_base &set_int_cb(Object &&cb) { return m_int_cb.set_callback(std::forward(cb)); } @@ -50,8 +50,8 @@ protected: GATM_BOTH }; - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; TIMER_CALLBACK_MEMBER(compare); TIMER_CALLBACK_MEMBER(overflow); @@ -59,10 +59,10 @@ protected: void set_ctrl(uint32_t data); void update_gate(); - void update_interrupts(); + void update_interrupts(); void update_compare_timer(); - void update_overflow_timer(); + void update_overflow_timer(); void update_count(); @@ -71,28 +71,28 @@ protected: uint32_t m_ctrl; - attotime m_last_update_time; - attotime m_elapsed_time; - bool m_zero_return; - uint32_t m_count; - uint32_t m_compare; + attotime m_last_update_time; + attotime m_elapsed_time; + bool m_zero_return; + uint32_t m_count; + uint32_t m_compare; - bool m_gate_enable; - timer_gate_mode m_gate_mode; + bool m_gate_enable; + timer_gate_mode m_gate_mode; - bool m_cmp_int_enabled; - bool m_cmp_int; + bool m_cmp_int_enabled; + bool m_cmp_int; - bool m_ovf_int_enabled; - bool m_ovf_int; + bool m_ovf_int_enabled; + bool m_ovf_int; bool m_repeat_int; bool m_toggle_int; - bool m_ienable; - devcb_write_line m_int_cb; + bool m_ienable; + devcb_write_line m_int_cb; }; DECLARE_DEVICE_TYPE(SONYIOP_TIMER, iop_timer_device) -#endif // DEVICES_MACHINE_IOPTIMER_H \ No newline at end of file +#endif // MAME_MACHINE_IOPTIMER_H diff --git a/src/devices/machine/mc146818.cpp b/src/devices/machine/mc146818.cpp index e9421b3e505..c1a391b6ed6 100644 --- a/src/devices/machine/mc146818.cpp +++ b/src/devices/machine/mc146818.cpp @@ -620,4 +620,4 @@ WRITE8_MEMBER( mc146818_device::write_direct ) m_data[m_index] = data; break; } -} \ No newline at end of file +} diff --git a/src/devices/machine/nscsi_cd.cpp b/src/devices/machine/nscsi_cd.cpp index 3496a84081b..8211657b73c 100644 --- a/src/devices/machine/nscsi_cd.cpp +++ b/src/devices/machine/nscsi_cd.cpp @@ -36,12 +36,12 @@ MACHINE_CONFIG_START(nscsi_cdrom_device::device_add_mconfig) MCFG_CDROM_INTERFACE("cdrom") MACHINE_CONFIG_END -void nscsi_cdrom_device::set_block_size(u32 block_size) +void nscsi_cdrom_device::set_block_size(u32 block_size) { assert_always(!started(), "block size should not be set after device start"); assert_always(bytes_per_sector % block_size == 0, "block size must be a factor of sector size"); - bytes_per_block = block_size; + bytes_per_block = block_size; }; diff --git a/src/devices/machine/ps2dma.cpp b/src/devices/machine/ps2dma.cpp index e3c8275fdb8..86cc249798a 100644 --- a/src/devices/machine/ps2dma.cpp +++ b/src/devices/machine/ps2dma.cpp @@ -11,6 +11,8 @@ #include "emu.h" #include "ps2dma.h" + +#include "ps2sif.h" #include "cpu/mips/mips3.h" #include "cpu/mips/ps2vif1.h" #include "video/ps2gif.h" @@ -29,6 +31,10 @@ ps2_dmac_device::ps2_dmac_device(const machine_config &mconfig, const char *tag, { } +ps2_dmac_device::~ps2_dmac_device() +{ +} + void ps2_dmac_device::device_start() { set_icountptr(m_icount); @@ -317,32 +323,32 @@ void ps2_dmac_device::follow_source_tag(uint32_t chan) switch (id) { case ID_CNT: - channel.set_addr(channel.tag_addr() + 0x10); - channel.set_tag_addr(channel.addr() + (channel.quadword_count() << 4)); + channel.set_addr(channel.tag_addr() + 0x10); + channel.set_tag_addr(channel.addr() + (channel.quadword_count() << 4)); break; case ID_REFE: - channel.set_end_tag(true); - // Intentional fall-through - case ID_REF: - channel.set_addr(addr); - channel.set_tag_addr(channel.tag_addr() + 0x10); - break; + channel.set_end_tag(true); + // Intentional fall-through + case ID_REF: + channel.set_addr(addr); + channel.set_tag_addr(channel.tag_addr() + 0x10); + break; case ID_REFS: // We don't handle stalls yet, just act the same as REF for now - channel.set_addr(addr); - channel.set_tag_addr(channel.tag_addr() + 0x10); - break; - case ID_NEXT: - channel.set_addr(channel.tag_addr() + 0x10); - channel.set_tag_addr(addr); + channel.set_addr(addr); + channel.set_tag_addr(channel.tag_addr() + 0x10); + break; + case ID_NEXT: + channel.set_addr(channel.tag_addr() + 0x10); + channel.set_tag_addr(addr); break; case ID_END: - channel.set_addr(channel.tag_addr() + 0x10); - channel.set_end_tag(true); - break; - default: - logerror("%s: Unknown DMAtag ID: %d\n", machine().describe_context(), id); - break; + channel.set_addr(channel.tag_addr() + 0x10); + channel.set_end_tag(true); + break; + default: + logerror("%s: Unknown DMAtag ID: %d\n", machine().describe_context(), id); + break; } if (irq && channel.irq_enable()) @@ -788,4 +794,4 @@ void ps2_dmac_device::channel_t::set_chcr(uint32_t data) { m_end_tag = false; } -} \ No newline at end of file +} diff --git a/src/devices/machine/ps2dma.h b/src/devices/machine/ps2dma.h index a8a0f43476e..1eeec4f4f2a 100644 --- a/src/devices/machine/ps2dma.h +++ b/src/devices/machine/ps2dma.h @@ -9,22 +9,23 @@ * */ -#ifndef DEVICES_MACHINE_PS2DMAC_H -#define DEVICES_MACHINE_PS2DMAC_H +#ifndef MAME_MACHINE_PS2DMA_H +#define MAME_MACHINE_PS2DMA_H #pragma once -#include "ps2sif.h" -#include "video/ps2gs.h" #include "cpu/mips/ps2vu.h" +#include "video/ps2gs.h" + +class ps2_sif_device; class ps2_dmac_device : public device_t, public device_execute_interface { public: template - ps2_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&ee_tag, U &&ram_tag, V &&sif_tag, W &&gs_tag, X &&vu1_tag) - : ps2_dmac_device(mconfig, tag, owner, clock) - { + ps2_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&ee_tag, U &&ram_tag, V &&sif_tag, W &&gs_tag, X &&vu1_tag) + : ps2_dmac_device(mconfig, tag, owner, clock) + { m_ee.set_tag(std::forward(ee_tag)); m_ram.set_tag(std::forward(ram_tag)); m_sif.set_tag(std::forward(sif_tag)); @@ -32,7 +33,8 @@ public: m_vu1.set_tag(std::forward(vu1_tag)); } - ps2_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_dmac_device() override; enum channel_type : uint32_t { @@ -57,12 +59,12 @@ public: DECLARE_WRITE32_MEMBER(disable_mask_w); protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; virtual void execute_run() override; - enum tag_id - { + enum tag_id + { ID_REFE = 0, ID_CNT, ID_NEXT, @@ -148,4 +150,4 @@ protected: DECLARE_DEVICE_TYPE(SONYPS2_DMAC, ps2_dmac_device) -#endif // DEVICES_MACHINE_PS2DMAC_H +#endif // MAME_MACHINE_PS2DMA_H diff --git a/src/devices/machine/ps2intc.cpp b/src/devices/machine/ps2intc.cpp index e1bb2a6046b..15581ce3936 100644 --- a/src/devices/machine/ps2intc.cpp +++ b/src/devices/machine/ps2intc.cpp @@ -12,6 +12,9 @@ #include "emu.h" #include "ps2intc.h" +#include "cpu/mips/ps2vu.h" + + DEFINE_DEVICE_TYPE(SONYPS2_INTC, ps2_intc_device, "ps2intc", "PlayStation 2 EE INTC") ps2_intc_device::ps2_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -20,6 +23,10 @@ ps2_intc_device::ps2_intc_device(const machine_config &mconfig, const char *tag, { } +ps2_intc_device::~ps2_intc_device() +{ +} + void ps2_intc_device::device_start() { save_item(NAME(m_status)); diff --git a/src/devices/machine/ps2intc.h b/src/devices/machine/ps2intc.h index 3d5d305fdcf..078061fbb9d 100644 --- a/src/devices/machine/ps2intc.h +++ b/src/devices/machine/ps2intc.h @@ -9,8 +9,8 @@ * */ -#ifndef DEVICES_MACHINE_PS2INTC_H -#define DEVICES_MACHINE_PS2INTC_H +#ifndef MAME_MACHINE_PS2INTC_H +#define MAME_MACHINE_PS2INTC_H #pragma once @@ -20,13 +20,14 @@ class ps2_intc_device : public device_t { public: template - ps2_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&ee_tag) - : ps2_intc_device(mconfig, tag, owner, (uint32_t)0) - { + ps2_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&ee_tag) + : ps2_intc_device(mconfig, tag, owner, (uint32_t)0) + { m_ee.set_tag(std::forward(ee_tag)); } - ps2_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_intc_device() override; DECLARE_READ32_MEMBER(read); DECLARE_WRITE32_MEMBER(write); @@ -53,8 +54,8 @@ public: }; protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; void update_interrupts(); @@ -66,4 +67,4 @@ protected: DECLARE_DEVICE_TYPE(SONYPS2_INTC, ps2_intc_device) -#endif // DEVICES_MACHINE_PS2INTC_H +#endif // MAME_MACHINE_PS2INTC_H diff --git a/src/devices/machine/ps2mc.cpp b/src/devices/machine/ps2mc.cpp index 68ec1a54a1b..b253f6153b7 100644 --- a/src/devices/machine/ps2mc.cpp +++ b/src/devices/machine/ps2mc.cpp @@ -22,6 +22,10 @@ ps2_mc_device::ps2_mc_device(const machine_config &mconfig, const char *tag, dev { } +ps2_mc_device::~ps2_mc_device() +{ +} + void ps2_mc_device::device_start() { save_item(NAME(m_recv_buf)); diff --git a/src/devices/machine/ps2mc.h b/src/devices/machine/ps2mc.h index c7551c1fce3..b3f120f62a1 100644 --- a/src/devices/machine/ps2mc.h +++ b/src/devices/machine/ps2mc.h @@ -9,20 +9,22 @@ * */ -#ifndef DEVICES_MACHINE_PS2MC_H -#define DEVICES_MACHINE_PS2MC_H +#ifndef MAME_MACHINE_PS2MC_H +#define MAME_MACHINE_PS2MC_H #pragma once + class ps2_mc_device : public device_t { public: - ps2_mc_device(const machine_config &mconfig, const char *tag, device_t *owner) - : ps2_mc_device(mconfig, tag, owner, (uint32_t)0) - { + ps2_mc_device(const machine_config &mconfig, const char *tag, device_t *owner) + : ps2_mc_device(mconfig, tag, owner, (uint32_t)0) + { } - ps2_mc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_mc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_mc_device() override; void recv_fifo_push(uint8_t data); // TODO: Turn me into a bus interface! uint8_t xmit_fifo_pop(); @@ -34,8 +36,8 @@ public: static const uint8_t SIO_DEVICE_ID = 0x81; protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; void xmit_fifo_push(uint8_t data); uint8_t recv_fifo_pop(); @@ -47,9 +49,9 @@ protected: enum : uint8_t { - CMD_INIT = 0x11, - CMD_GET_TERM = 0x28, - CMD_UNKNOWN_F3 = 0xf3, + CMD_INIT = 0x11, + CMD_GET_TERM = 0x28, + CMD_UNKNOWN_F3 = 0xf3, }; uint8_t m_recv_buf[512]; // Buffer size is a guess @@ -70,4 +72,4 @@ protected: DECLARE_DEVICE_TYPE(SONYPS2_MC, ps2_mc_device) -#endif // DEVICES_MACHINE_PS2MC_H +#endif // MAME_MACHINE_PS2MC_H diff --git a/src/devices/machine/ps2pad.cpp b/src/devices/machine/ps2pad.cpp index fe7e7c0a3ec..64e1009a331 100644 --- a/src/devices/machine/ps2pad.cpp +++ b/src/devices/machine/ps2pad.cpp @@ -21,6 +21,10 @@ ps2_pad_device::ps2_pad_device(const machine_config &mconfig, const char *tag, d { } +ps2_pad_device::~ps2_pad_device() +{ +} + void ps2_pad_device::device_start() { save_item(NAME(m_recv_buf)); diff --git a/src/devices/machine/ps2pad.h b/src/devices/machine/ps2pad.h index 0343e8e52ac..dcfb8125052 100644 --- a/src/devices/machine/ps2pad.h +++ b/src/devices/machine/ps2pad.h @@ -9,20 +9,22 @@ * */ -#ifndef DEVICES_MACHINE_PS2PAD_H -#define DEVICES_MACHINE_PS2PAD_H +#ifndef MAME_MACHINE_PS2PAD_H +#define MAME_MACHINE_PS2PAD_H #pragma once + class ps2_pad_device : public device_t { public: - ps2_pad_device(const machine_config &mconfig, const char *tag, device_t *owner) - : ps2_pad_device(mconfig, tag, owner, (uint32_t)0) - { + ps2_pad_device(const machine_config &mconfig, const char *tag, device_t *owner) + : ps2_pad_device(mconfig, tag, owner, (uint32_t)0) + { } - ps2_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_pad_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_pad_device() override; void recv_fifo_push(uint8_t data); // TODO: Turn me into a bus interface! uint8_t xmit_fifo_pop(); @@ -32,8 +34,8 @@ public: static const uint8_t SIO_DEVICE_ID = 0x01; protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; void xmit_fifo_push(uint8_t data); uint8_t recv_fifo_pop(); @@ -49,12 +51,12 @@ protected: enum : uint8_t { - CMD_READ_BUTTONS = 0x42, - CMD_CONFIG = 0x43, - CMD_GET_MODEL = 0x45, - CMD_GET_ACT = 0x46, - CMD_GET_COMB = 0x47, - CMD_GET_MODE = 0x4c, + CMD_READ_BUTTONS = 0x42, + CMD_CONFIG = 0x43, + CMD_GET_MODEL = 0x45, + CMD_GET_ACT = 0x46, + CMD_GET_COMB = 0x47, + CMD_GET_MODE = 0x4c, }; uint8_t m_recv_buf[64]; // Buffer size is a guess @@ -73,4 +75,4 @@ protected: DECLARE_DEVICE_TYPE(SONYPS2_PAD, ps2_pad_device) -#endif // DEVICES_MACHINE_PS2PAD_H +#endif // MAME_MACHINE_PS2PAD_H diff --git a/src/devices/machine/ps2sif.cpp b/src/devices/machine/ps2sif.cpp index 73b055d2cc5..a9dd7717b49 100644 --- a/src/devices/machine/ps2sif.cpp +++ b/src/devices/machine/ps2sif.cpp @@ -22,6 +22,10 @@ ps2_sif_device::ps2_sif_device(const machine_config &mconfig, const char *tag, d { } +ps2_sif_device::~ps2_sif_device() +{ +} + void ps2_sif_device::device_start() { save_item(NAME(m_ms_mailbox)); diff --git a/src/devices/machine/ps2sif.h b/src/devices/machine/ps2sif.h index a98a9c93485..27850ff2bcb 100644 --- a/src/devices/machine/ps2sif.h +++ b/src/devices/machine/ps2sif.h @@ -9,8 +9,8 @@ * */ -#ifndef DEVICES_MACHINE_PS2SIF_H -#define DEVICES_MACHINE_PS2SIF_H +#ifndef MAME_MACHINE_PS2SIF_H +#define MAME_MACHINE_PS2SIF_H #pragma once @@ -20,13 +20,14 @@ class ps2_sif_device : public device_t { public: template - ps2_sif_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag) - : ps2_sif_device(mconfig, tag, owner, (uint32_t)0) - { + ps2_sif_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&intc_tag) + : ps2_sif_device(mconfig, tag, owner, (uint32_t)0) + { m_intc.set_tag(std::forward(intc_tag)); } - ps2_sif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_sif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_sif_device() override; DECLARE_READ32_MEMBER(ee_r); DECLARE_WRITE32_MEMBER(ee_w); @@ -40,8 +41,8 @@ public: static const size_t MAX_FIFO_DEPTH; protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; required_device m_intc; @@ -57,4 +58,4 @@ protected: DECLARE_DEVICE_TYPE(SONYPS2_SIF, ps2_sif_device) -#endif // DEVICES_MACHINE_PS2SIF_H +#endif // MAME_MACHINE_PS2SIF_H diff --git a/src/devices/machine/ps2timer.cpp b/src/devices/machine/ps2timer.cpp index 70970a6784a..263060b98a5 100644 --- a/src/devices/machine/ps2timer.cpp +++ b/src/devices/machine/ps2timer.cpp @@ -20,8 +20,8 @@ ps2_timer_device::ps2_timer_device(const machine_config &mconfig, const char *ta , m_overflow_timer(nullptr) , m_mode(0) , m_last_enable_time(attotime::zero) - , m_last_update_time(attotime::zero) - , m_elapsed_time(attotime::zero) + , m_last_update_time(attotime::zero) + , m_elapsed_time(attotime::zero) , m_enabled(false) , m_zero_return(false) , m_count(0) @@ -53,8 +53,8 @@ void ps2_timer_device::device_reset() m_mode = 0; m_last_enable_time = attotime::zero; - m_last_update_time = attotime::zero; - m_elapsed_time = attotime::zero; + m_last_update_time = attotime::zero; + m_elapsed_time = attotime::zero; m_enabled = false; m_zero_return = false; @@ -103,36 +103,36 @@ void ps2_timer_device::update_overflow_timer() void ps2_timer_device::update_count() { - if (!m_enabled) return; - uint32_t frequency = 0; - - switch (m_clk_select) - { - case CLKS_BUSCLK1: - frequency = clock(); - break; - case CLKS_BUSCLK16: - frequency = clock() / 16; - break; - case CLKS_BUSCLK256: - frequency = clock() / 256; - break; - case CLKS_HBLNK: - frequency = clock() / 18700; - break; - } - - attotime curr_time = machine().scheduler().time(); - attotime time_delta = curr_time - m_last_update_time; - m_last_update_time = curr_time; - m_elapsed_time += time_delta; - uint32_t ticks = (uint32_t)m_elapsed_time.as_ticks(frequency); - if (ticks > 0) - { - m_elapsed_time -= attotime::from_ticks(ticks, frequency); - m_count += ticks; - m_count &= 0xffff; - } + if (!m_enabled) return; + uint32_t frequency = 0; + + switch (m_clk_select) + { + case CLKS_BUSCLK1: + frequency = clock(); + break; + case CLKS_BUSCLK16: + frequency = clock() / 16; + break; + case CLKS_BUSCLK256: + frequency = clock() / 256; + break; + case CLKS_HBLNK: + frequency = clock() / 18700; + break; + } + + attotime curr_time = machine().scheduler().time(); + attotime time_delta = curr_time - m_last_update_time; + m_last_update_time = curr_time; + m_elapsed_time += time_delta; + uint32_t ticks = (uint32_t)m_elapsed_time.as_ticks(frequency); + if (ticks > 0) + { + m_elapsed_time -= attotime::from_ticks(ticks, frequency); + m_count += ticks; + m_count &= 0xffff; + } } void ps2_timer_device::update_hold() @@ -142,24 +142,24 @@ void ps2_timer_device::update_hold() void ps2_timer_device::set_mode(uint32_t data) { - static const char *clks_names[4] = { "BUSCLK", "BUSCLK/16", "BUSCLK/256", "HBLNK" }; - static const char *gatm_names[4] = { "low", "reset+rising", "reset+falling", "reset+both" }; - logerror("%s: CLKS=%s, GATE=%d, GATS=%cBLNK\n", machine().describe_context(), clks_names[data & 3], BIT(data, 2), BIT(data, 3) ? 'V' : 'H'); - logerror("%s: GATM=%s, ZRET=%d, CUE=%d\n", machine().describe_context(), gatm_names[(data >> 4) & 3], BIT(data, 6), BIT(data, 7)); - logerror("%s: CMPE=%d, OVFE=%d, %s, %s\n", machine().describe_context(), BIT(data, 8), BIT(data, 9), BIT(data, 10) ? "Clear Equal" : "", BIT(data, 11) ? "Clear Overflow" : ""); + static const char *clks_names[4] = { "BUSCLK", "BUSCLK/16", "BUSCLK/256", "HBLNK" }; + static const char *gatm_names[4] = { "low", "reset+rising", "reset+falling", "reset+both" }; + logerror("%s: CLKS=%s, GATE=%d, GATS=%cBLNK\n", machine().describe_context(), clks_names[data & 3], BIT(data, 2), BIT(data, 3) ? 'V' : 'H'); + logerror("%s: GATM=%s, ZRET=%d, CUE=%d\n", machine().describe_context(), gatm_names[(data >> 4) & 3], BIT(data, 6), BIT(data, 7)); + logerror("%s: CMPE=%d, OVFE=%d, %s, %s\n", machine().describe_context(), BIT(data, 8), BIT(data, 9), BIT(data, 10) ? "Clear Equal" : "", BIT(data, 11) ? "Clear Overflow" : ""); - if (!(data & (MODE_EQUF | MODE_OVFF)) && data == m_mode) return; + if (!(data & (MODE_EQUF | MODE_OVFF)) && data == m_mode) return; - const uint32_t old = m_mode; - m_mode = data; - const uint32_t changed = old ^ data; + const uint32_t old = m_mode; + m_mode = data; + const uint32_t changed = old ^ data; - m_clk_select = (timer_clock_select)(data & 3); - m_gate_enable = BIT(data, 2); - m_gate_select = BIT(data, 3) ? GATS_VBLNK : GATS_HBLNK; - m_gate_mode = (timer_gate_mode)((data >> 4) & 3); - m_zero_return = BIT(data, 6); - m_enabled = BIT(data, 7); + m_clk_select = (timer_clock_select)(data & 3); + m_gate_enable = BIT(data, 2); + m_gate_select = BIT(data, 3) ? GATS_VBLNK : GATS_HBLNK; + m_gate_mode = (timer_gate_mode)((data >> 4) & 3); + m_zero_return = BIT(data, 6); + m_enabled = BIT(data, 7); if (changed & (MODE_GATE | MODE_GATS | MODE_GATM)) { @@ -172,13 +172,13 @@ void ps2_timer_device::set_mode(uint32_t data) update_overflow_timer(); } - if (changed & (MODE_CMPE | MODE_OVFE | MODE_EQUF | MODE_OVFF)) - { + if (changed & (MODE_CMPE | MODE_OVFE | MODE_EQUF | MODE_OVFF)) + { m_cmp_int_enabled = BIT(data, 8); m_ovf_int_enabled = BIT(data, 9); m_cmp_int = BIT(data, 10) ? 0 : m_cmp_int; m_ovf_int = BIT(data, 11) ? 0 : m_ovf_int; - update_interrupts(); + update_interrupts(); } } @@ -192,81 +192,81 @@ TIMER_CALLBACK_MEMBER(ps2_timer_device::overflow) READ32_MEMBER(ps2_timer_device::read) { - uint32_t ret = 0; - switch (offset) - { - case 0x00: - { - const uint32_t old = m_count; - update_count(); - ret = m_count; - if (old != m_count) - logerror("%s: PS2 timer read: COUNT (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - } - - case 0x02: - ret = m_mode; - logerror("%s: PS2 timer read: MODE (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - - case 0x04: - ret = m_compare; - logerror("%s: PS2 timer read: COMP (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - - case 0x06: - ret = m_hold; - logerror("%s: PS2 timer read: HOLD (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); - break; - - default: - break; - } - return ret; + uint32_t ret = 0; + switch (offset) + { + case 0x00: + { + const uint32_t old = m_count; + update_count(); + ret = m_count; + if (old != m_count) + logerror("%s: PS2 timer read: COUNT (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + } + + case 0x02: + ret = m_mode; + logerror("%s: PS2 timer read: MODE (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + + case 0x04: + ret = m_compare; + logerror("%s: PS2 timer read: COMP (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + + case 0x06: + ret = m_hold; + logerror("%s: PS2 timer read: HOLD (%08x & %08x)\n", machine().describe_context(), ret, mem_mask); + break; + + default: + break; + } + return ret; } WRITE32_MEMBER(ps2_timer_device::write) { - switch (offset) - { - case 0x00: - m_count = data; - logerror("%s: PS2 timer write: COUNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); - update_compare_timer(); - update_overflow_timer(); - break; - - case 0x02: - set_mode(data); - break; - - case 0x04: - { - logerror("%s: PS2 timer write: COMP = %08x & %08x\n", machine().describe_context(), data, mem_mask); + switch (offset) + { + case 0x00: + m_count = data; + logerror("%s: PS2 timer write: COUNT = %08x & %08x\n", machine().describe_context(), data, mem_mask); + update_compare_timer(); + update_overflow_timer(); + break; + + case 0x02: + set_mode(data); + break; + + case 0x04: + { + logerror("%s: PS2 timer write: COMP = %08x & %08x\n", machine().describe_context(), data, mem_mask); if (m_compare == data) break; - m_compare = data; - update_compare_timer(); - break; + m_compare = data; + update_compare_timer(); + break; } - case 0x06: - { - if (!m_can_hold) - break; + case 0x06: + { + if (!m_can_hold) + break; - logerror("%s: PS2 timer write: HOLD = %08x & %08x\n", machine().describe_context(), data, mem_mask); - if (m_hold == data) - break; + logerror("%s: PS2 timer write: HOLD = %08x & %08x\n", machine().describe_context(), data, mem_mask); + if (m_hold == data) + break; - m_hold = data; - update_hold(); - break; + m_hold = data; + update_hold(); + break; } - default: - break; - } + default: + break; + } } diff --git a/src/devices/machine/ps2timer.h b/src/devices/machine/ps2timer.h index 425fc89798b..c412745b6ad 100644 --- a/src/devices/machine/ps2timer.h +++ b/src/devices/machine/ps2timer.h @@ -9,21 +9,21 @@ * */ -#ifndef DEVICES_MACHINE_PS2TIMER_H -#define DEVICES_MACHINE_PS2TIMER_H +#ifndef MAME_MACHINE_PS2TIMER_H +#define MAME_MACHINE_PS2TIMER_H #pragma once class ps2_timer_device : public device_t { public: - ps2_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool can_hold) - : ps2_timer_device(mconfig, tag, owner, clock) - { + ps2_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, bool can_hold) + : ps2_timer_device(mconfig, tag, owner, clock) + { m_can_hold = can_hold; } - ps2_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ32_MEMBER(read); DECLARE_WRITE32_MEMBER(write); @@ -65,52 +65,52 @@ protected: GATS_VBLNK }; - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; TIMER_CALLBACK_MEMBER(compare); TIMER_CALLBACK_MEMBER(overflow); void update_gate(); - void update_interrupts(); + void update_interrupts(); void update_compare_timer(); - void update_overflow_timer(); + void update_overflow_timer(); void update_count(); - void update_hold(); + void update_hold(); - void set_mode(uint32_t data); + void set_mode(uint32_t data); emu_timer *m_compare_timer; emu_timer *m_overflow_timer; - uint32_t m_mode; + uint32_t m_mode; attotime m_last_enable_time; - attotime m_last_update_time; - attotime m_elapsed_time; - bool m_enabled; - bool m_zero_return; - uint32_t m_count; - uint32_t m_compare; + attotime m_last_update_time; + attotime m_elapsed_time; + bool m_enabled; + bool m_zero_return; + uint32_t m_count; + uint32_t m_compare; - bool m_can_hold; - uint32_t m_hold; + bool m_can_hold; + uint32_t m_hold; - timer_clock_select m_clk_select; + timer_clock_select m_clk_select; - bool m_gate_enable; - timer_gate_select m_gate_select; - timer_gate_mode m_gate_mode; + bool m_gate_enable; + timer_gate_select m_gate_select; + timer_gate_mode m_gate_mode; - bool m_cmp_int_enabled; - bool m_cmp_int; + bool m_cmp_int_enabled; + bool m_cmp_int; - bool m_ovf_int_enabled; - bool m_ovf_int; + bool m_ovf_int_enabled; + bool m_ovf_int; }; DECLARE_DEVICE_TYPE(SONYPS2_TIMER, ps2_timer_device) -#endif // DEVICES_MACHINE_PS2TIMER_H \ No newline at end of file +#endif // MAME_MACHINE_PS2TIMER_H diff --git a/src/devices/machine/pxa255defs.h b/src/devices/machine/pxa255defs.h index 6f861d9d9a0..d2c38f474f1 100644 --- a/src/devices/machine/pxa255defs.h +++ b/src/devices/machine/pxa255defs.h @@ -6,8 +6,8 @@ * **************************************************************************/ -#ifndef DEVICES_MACHINE_PXA255DEFS -#define DEVICES_MACHINE_PXA255DEFS +#ifndef MAME_MACHINE_PXA255DEFS +#define MAME_MACHINE_PXA255DEFS #pragma once @@ -376,4 +376,4 @@ #define PXA255_FIDR1 (PXA255_LCD_BASE_ADDR + 0x00000218) #define PXA255_LDCMD1 (PXA255_LCD_BASE_ADDR + 0x0000021c) -#endif // DEVICES_MACHINE_PXA255DEFS +#endif // MAME_MACHINE_PXA255DEFS diff --git a/src/devices/machine/te7750.h b/src/devices/machine/te7750.h index 32406b3c52c..4c4b3328346 100644 --- a/src/devices/machine/te7750.h +++ b/src/devices/machine/te7750.h @@ -6,8 +6,8 @@ **********************************************************************/ -#ifndef DEVICES_MACHINE_TE7750_H -#define DEVICES_MACHINE_TE7750_H +#ifndef MAME_MACHINE_TE7750_H +#define MAME_MACHINE_TE7750_H #pragma once @@ -132,4 +132,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(TE7750, te7750_device) -#endif // DEVICES_MACHINE_TE7750_H +#endif // MAME_MACHINE_TE7750_H diff --git a/src/devices/sound/iopspu.cpp b/src/devices/sound/iopspu.cpp index 9701fc85be4..88ace1df633 100644 --- a/src/devices/sound/iopspu.cpp +++ b/src/devices/sound/iopspu.cpp @@ -9,6 +9,7 @@ * */ +#include "emu.h" #include "iopspu.h" DEFINE_DEVICE_TYPE(SONYIOP_SPU, iop_spu_device, "iopspu", "PlayStation 2 IOP SPU") @@ -21,6 +22,10 @@ iop_spu_device::iop_spu_device(const machine_config &mconfig, const char *tag, d { } +iop_spu_device::~iop_spu_device() +{ +} + void iop_spu_device::device_start() { m_ram = std::make_unique(2 * 1024 * 1024); // ? @@ -139,15 +144,15 @@ uint16_t iop_spu_device::reg_read(int bank, uint32_t offset, uint16_t mem_mask) logerror("%s %d: read: Unknown 0x19a (%04x & %04x)\n", machine().describe_context(), bank, ret, mem_mask); break; - case 0x1a8: - ret = (uint16_t)(core.m_start_port_addr >> 16); + case 0x1a8: + ret = (uint16_t)(core.m_start_port_addr >> 16); logerror("%s %d: read: PORT_ADDR_HI: %04x & %04x\n", machine().describe_context(), bank, ret, mem_mask); - break; + break; - case 0x1aa: - ret = (uint16_t)core.m_start_port_addr; + case 0x1aa: + ret = (uint16_t)core.m_start_port_addr; logerror("%s %d: read: PORT_ADDR_LO: %04x & %04x\n", machine().describe_context(), bank, ret, mem_mask); - break; + break; case 0x1b0: ret = core.m_autodma_ctrl; @@ -196,19 +201,19 @@ void iop_spu_device::reg_write(int bank, uint32_t offset, uint16_t data, uint16_ core.m_unknown_0x19a = data; break; - case 0x1a8: + case 0x1a8: logerror("%s %d: write: PORT_ADDR_HI: %04x & %04x\n", machine().describe_context(), bank, data, mem_mask); core.m_start_port_addr &= ~0x000f0000; core.m_start_port_addr |= ((uint32_t)data << 16) & 0x000f0000; core.m_curr_port_addr = core.m_start_port_addr; - break; + break; - case 0x1aa: + case 0x1aa: logerror("%s %d: write: PORT_ADDR_LO: %04x & %04x\n", machine().describe_context(), bank, data, mem_mask); core.m_start_port_addr &= ~0x0000ffff; core.m_start_port_addr |= data; core.m_curr_port_addr = core.m_start_port_addr; - break; + break; case 0x1b0: logerror("%s %d: write: Auto DMA control: %04x & %04x\n", machine().describe_context(), bank, data, mem_mask); diff --git a/src/devices/sound/iopspu.h b/src/devices/sound/iopspu.h index 41176cf7738..44e26a68066 100644 --- a/src/devices/sound/iopspu.h +++ b/src/devices/sound/iopspu.h @@ -9,12 +9,11 @@ * */ -#ifndef DEVICES_MACHINE_IOPSPU_H -#define DEVICES_MACHINE_IOPSPU_H +#ifndef MAME_MACHINE_IOPSPU_H +#define MAME_MACHINE_IOPSPU_H #pragma once -#include "emu.h" #include "cpu/mips/r3000.h" #include "machine/iopintc.h" @@ -22,14 +21,15 @@ class iop_spu_device : public device_t, public device_sound_interface { public: template - iop_spu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&iop_tag, U &&intc_tag) - : iop_spu_device(mconfig, tag, owner, clock) - { + iop_spu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&iop_tag, U &&intc_tag) + : iop_spu_device(mconfig, tag, owner, clock) + { m_iop.set_tag(std::forward(iop_tag)); m_intc.set_tag(std::forward(intc_tag)); } - iop_spu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + iop_spu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~iop_spu_device() override; DECLARE_READ16_MEMBER(read); DECLARE_WRITE16_MEMBER(write); @@ -44,8 +44,8 @@ public: void dma_done(int bank); protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; @@ -57,8 +57,8 @@ protected: enum { - STATUS_DMA_DONE = (1 << 7), - STATUS_DMA_ACTIVE = (1 << 10) + STATUS_DMA_DONE = (1 << 7), + STATUS_DMA_ACTIVE = (1 << 10) }; class voice_t @@ -98,4 +98,4 @@ protected: DECLARE_DEVICE_TYPE(SONYIOP_SPU, iop_spu_device) -#endif // DEVICES_MACHINE_IOPSPU_H \ No newline at end of file +#endif // MAME_MACHINE_IOPSPU_H diff --git a/src/devices/video/315_5124.cpp b/src/devices/video/315_5124.cpp index f70662904ef..c08082d54c5 100644 --- a/src/devices/video/315_5124.cpp +++ b/src/devices/video/315_5124.cpp @@ -1008,7 +1008,7 @@ void sega315_5124_device::draw_scanline_mode4( int *line_buffer, int *priority_s /* Column 0 is the leftmost tile column that completely entered in the screen. If the leftmost pixels aren't part of a complete tile, due to horizontal scrolling, they are drawn only with color #0 of the selected palette. */ - if (tile_column == 0 && x_scroll_fine_adjust > 0) + if (tile_column == 0 && x_scroll_fine_adjust > 0) { draw_column0_x_scroll_mode4(line_buffer, priority_selected, x_scroll_fine_adjust, palette_selected, tile_line); } @@ -1262,24 +1262,24 @@ void sega315_5313_mode4_device::select_sprites( int line ) sega315_5124_device::select_sprites(line); /* - Info from Charles MacDonald regarding real hardware behavior: - (http://www.smspower.org/forums/15772-Sprites8x16Question) - - "As I recall the SMS will parses the sprite table on line N to find the - sprite numbers to display on line N+1, and on the next line it displays - those sprites. The data for the sprites is read in real-time and is not - buffered from any earlier time. The only thing that's buffered are the - eight sprite numbers. - - On the MD it has two line buffers (RAM) that it renders sprite data into - on one line, and displays that buffer on the next line while preparing - the next one. This only reveals itself if you play with the screen - blanking or left-column blanking bits, as the display process erases the - other buffer and on a blanked line nothing gets erased. - - So if you turn on either of those bits later they show the old sprite - data that hadn't been erased yet. This is how you can show a line of - sprite data further down on the screen than where the sprites were." + Info from Charles MacDonald regarding real hardware behavior: + (http://www.smspower.org/forums/15772-Sprites8x16Question) + + "As I recall the SMS will parses the sprite table on line N to find the + sprite numbers to display on line N+1, and on the next line it displays + those sprites. The data for the sprites is read in real-time and is not + buffered from any earlier time. The only thing that's buffered are the + eight sprite numbers. + + On the MD it has two line buffers (RAM) that it renders sprite data into + on one line, and displays that buffer on the next line while preparing + the next one. This only reveals itself if you play with the screen + blanking or left-column blanking bits, as the display process erases the + other buffer and on a blanked line nothing gets erased. + + So if you turn on either of those bits later they show the old sprite + data that hadn't been erased yet. This is how you can show a line of + sprite data further down on the screen than where the sprites were." */ // Runs the function that draws sprites, but only to check for diff --git a/src/devices/video/ps2gif.cpp b/src/devices/video/ps2gif.cpp index c4c714e7eb2..bfc404d2627 100644 --- a/src/devices/video/ps2gif.cpp +++ b/src/devices/video/ps2gif.cpp @@ -12,6 +12,9 @@ #include "emu.h" #include "ps2gif.h" +#include "ps2gs.h" +#include "cpu/mips/ps2vu.h" + DEFINE_DEVICE_TYPE(SONYPS2_GIF, ps2_gif_device, "ps2gif", "Playstation 2 GIF") ps2_gif_device::ps2_gif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -22,6 +25,10 @@ ps2_gif_device::ps2_gif_device(const machine_config &mconfig, const char *tag, d { } +ps2_gif_device::~ps2_gif_device() +{ +} + ps2_gif_device::tag_t::tag_t(const uint64_t hi, const uint64_t lo) : m_nloop(lo & 0x7fffULL) , m_end((lo >> 15) & 1) diff --git a/src/devices/video/ps2gif.h b/src/devices/video/ps2gif.h index 29c57e80f2b..813a67a4678 100644 --- a/src/devices/video/ps2gif.h +++ b/src/devices/video/ps2gif.h @@ -9,8 +9,8 @@ * */ -#ifndef DEVICES_VIDEO_PS2GIF_H -#define DEVICES_VIDEO_PS2GIF_H +#ifndef MAME_VIDEO_PS2GIF_H +#define MAME_VIDEO_PS2GIF_H #pragma once @@ -21,14 +21,15 @@ class ps2_gif_device : public device_t, public device_execute_interface { public: template - ps2_gif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gs_tag, U &&vu1_tag) - : ps2_gif_device(mconfig, tag, owner, clock) - { + ps2_gif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&gs_tag, U &&vu1_tag) + : ps2_gif_device(mconfig, tag, owner, clock) + { m_gs.set_tag(std::forward(gs_tag)); m_vu1.set_tag(std::forward(vu1_tag)); } - ps2_gif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ps2_gif_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_gif_device() override; DECLARE_READ32_MEMBER(read); DECLARE_WRITE32_MEMBER(write); @@ -41,8 +42,8 @@ public: bool path3_available() const { return m_path3_available; } protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; virtual void execute_run() override; void fetch_path1(uint64_t &hi, uint64_t &lo); @@ -125,7 +126,4 @@ protected: DECLARE_DEVICE_TYPE(SONYPS2_GIF, ps2_gif_device) -#include "ps2gs.h" -#include "cpu/mips/ps2vu.h" - -#endif // DEVICES_VIDEO_PS2GIF_H +#endif // MAME_VIDEO_PS2GIF_H diff --git a/src/devices/video/ps2gs.cpp b/src/devices/video/ps2gs.cpp index 2186d5033eb..aa83adff58b 100644 --- a/src/devices/video/ps2gs.cpp +++ b/src/devices/video/ps2gs.cpp @@ -12,28 +12,33 @@ #include "emu.h" #include "ps2gs.h" +#include "ps2gif.h" +#include "machine/ps2intc.h" +#include "cpu/mips/ps2vu.h" + + DEFINE_DEVICE_TYPE(SONYPS2_GS, ps2_gs_device, "ps2gs", "Playstation 2 GS") /*static*/ const size_t ps2_gs_device::FORMAT_PIXEL_WIDTHS[] = { - 32, 24, 16, 0, 0, 0, 0, 0, - 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 4, 0, 0, 0, - 0, 0, 0, 8, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 4, 0, 0, 0, - 32, 24, 16, 0, 0, 0, 0, 0, - 0, 0, 16, 0, 0, 0, 0, 0 + 32, 24, 16, 0, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 4, 0, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 0, 0, + 32, 24, 16, 0, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, 0, 0 }; /*static*/ const char* ps2_gs_device::FORMAT_NAMES[] = { - "PSMCT32", "PSMCT24", "PSMCT16", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "PCMCT16S", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "Unknown", "PSMT8", "PSMT4", "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "Unknown", "PSMT8H", "Unknown", "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "Unknown", "Unknown", "PSMT4HL", "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "Unknown", "Unknown", "PSMT4HH", "Unknown", "Unknown", "Unknown", - "PSMZ32", "PSMZ24", "PSMZ16", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "PSMZ16S", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown" + "PSMCT32", "PSMCT24", "PSMCT16", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "PCMCT16S", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "Unknown", "PSMT8", "PSMT4", "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "Unknown", "PSMT8H", "Unknown", "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "Unknown", "Unknown", "PSMT4HL", "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "Unknown", "Unknown", "PSMT4HH", "Unknown", "Unknown", "Unknown", + "PSMZ32", "PSMZ24", "PSMZ16", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "PSMZ16S", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown" }; /*static*/ const uint32_t ps2_gs_device::KICK_COUNTS[] = { @@ -48,6 +53,10 @@ ps2_gs_device::ps2_gs_device(const machine_config &mconfig, const char *tag, dev { } +ps2_gs_device::~ps2_gs_device() +{ +} + MACHINE_CONFIG_START(ps2_gs_device::device_add_mconfig) MCFG_DEVICE_ADD(m_gif, SONYPS2_GIF, clock(), DEVICE_SELF, m_vu1) MACHINE_CONFIG_END @@ -75,9 +84,9 @@ void ps2_gs_device::device_start() save_item(NAME(m_trx_dir)); - save_item(NAME(m_base_regs)); + save_item(NAME(m_base_regs)); - save_item(NAME(m_pmode)); + save_item(NAME(m_pmode)); save_item(NAME(m_read_circuit_enable)); save_item(NAME(m_use_fixed_alpha)); save_item(NAME(m_alpha_out_select)); @@ -109,13 +118,13 @@ void ps2_gs_device::device_start() save_item(NAME(m_bg_g)); save_item(NAME(m_bg_b)); - save_item(NAME(m_csr)); - save_item(NAME(m_imr)); - save_item(NAME(m_busdir)); - save_item(NAME(m_sig_label_id)); + save_item(NAME(m_csr)); + save_item(NAME(m_imr)); + save_item(NAME(m_busdir)); + save_item(NAME(m_sig_label_id)); - save_item(NAME(m_vertex_count)); - save_item(NAME(m_kick_count)); + save_item(NAME(m_vertex_count)); + save_item(NAME(m_kick_count)); save_item(NAME(m_context[0].m_xyoffset)); save_item(NAME(m_context[0].m_offset_x)); @@ -208,7 +217,7 @@ void ps2_gs_device::device_reset() memset(m_base_regs, 0, sizeof(uint64_t) * 15); - m_pmode = 0; + m_pmode = 0; memset(m_read_circuit_enable, 0, 2); m_use_fixed_alpha = 0; m_alpha_out_select = 0; @@ -240,101 +249,101 @@ void ps2_gs_device::device_reset() m_bg_g = 0; m_bg_b = 0; - m_csr = 0; - m_imr = 0; - m_busdir = 0; - m_sig_label_id = 0; + m_csr = 0; + m_imr = 0; + m_busdir = 0; + m_sig_label_id = 0; memset(m_context, 0, sizeof(context_t) * 2); - m_vertex_count = 0; - m_kick_count = 0; + m_vertex_count = 0; + m_kick_count = 0; } READ64_MEMBER(ps2_gs_device::priv_regs0_r) { - uint64_t ret = m_base_regs[offset >> 1]; - switch (offset) - { - case 0x00: - ret = m_pmode; - logerror("%s: regs0_r: PMODE (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - - case 0x04: - ret = m_smode2; - logerror("%s: regs0_r: SMODE2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - - case 0x0e: - case 0x12: - ret = m_dispfb[(offset - 0x0e) / 4]; - logerror("%s: regs0_r: DISPFB2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - - case 0x10: - case 0x14: - ret = m_display[(offset - 0x10) / 4]; - logerror("%s: regs0_r: DISPLAY2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - - case 0x1c: - ret = m_bgcolor; - logerror("%s: regs0_r: BGCOLOR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - - case 0x02: logerror("%s: regs0_r: SMODE1 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x06: logerror("%s: regs0_r: SRFSH (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x08: logerror("%s: regs0_r: SYNCH1 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x0a: logerror("%s: regs0_r: SYNCH2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x0c: logerror("%s: regs0_r: SYNCV (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x16: logerror("%s: regs0_r: EXTBUF (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x18: logerror("%s: regs0_r: EXTDATA (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - case 0x1a: logerror("%s: regs0_r: EXTWRITE (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; - default: logerror("%s: regs0_r: Unknown (%08x)\n", machine().describe_context(), 0x12000000 + (offset << 3)); break; - } - return ret; + uint64_t ret = m_base_regs[offset >> 1]; + switch (offset) + { + case 0x00: + ret = m_pmode; + logerror("%s: regs0_r: PMODE (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + + case 0x04: + ret = m_smode2; + logerror("%s: regs0_r: SMODE2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + + case 0x0e: + case 0x12: + ret = m_dispfb[(offset - 0x0e) / 4]; + logerror("%s: regs0_r: DISPFB2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + + case 0x10: + case 0x14: + ret = m_display[(offset - 0x10) / 4]; + logerror("%s: regs0_r: DISPLAY2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + + case 0x1c: + ret = m_bgcolor; + logerror("%s: regs0_r: BGCOLOR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + + case 0x02: logerror("%s: regs0_r: SMODE1 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x06: logerror("%s: regs0_r: SRFSH (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x08: logerror("%s: regs0_r: SYNCH1 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x0a: logerror("%s: regs0_r: SYNCH2 (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x0c: logerror("%s: regs0_r: SYNCV (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x16: logerror("%s: regs0_r: EXTBUF (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x18: logerror("%s: regs0_r: EXTDATA (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + case 0x1a: logerror("%s: regs0_r: EXTWRITE (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); break; + default: logerror("%s: regs0_r: Unknown (%08x)\n", machine().describe_context(), 0x12000000 + (offset << 3)); break; + } + return ret; } WRITE64_MEMBER(ps2_gs_device::priv_regs0_w) { - switch (offset) - { - case 0x00: // PMODE - m_pmode = data; - m_read_circuit_enable[0] = BIT(data, 0); - m_read_circuit_enable[1] = BIT(data, 1); - m_use_fixed_alpha = BIT(data, 5); - m_alpha_out_select = BIT(data, 6); - m_blend_to_background = BIT(data, 7); - m_fixed_alpha = (data >> 8) & 0xff; - logerror("%s: regs0_w: PMODE = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - break; - - case 0x04: // SMODE2 - m_smode2 = data; - m_interlace = BIT(data, 0); - m_frame_interlace = BIT(data, 1); - m_dpms_mode = (data >> 2) & 3; - logerror("%s: regs0_w: SMODE2 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - break; - - case 0x0e: // DISPFB1 - case 0x12: // DISPFB2 - { + switch (offset) + { + case 0x00: // PMODE + m_pmode = data; + m_read_circuit_enable[0] = BIT(data, 0); + m_read_circuit_enable[1] = BIT(data, 1); + m_use_fixed_alpha = BIT(data, 5); + m_alpha_out_select = BIT(data, 6); + m_blend_to_background = BIT(data, 7); + m_fixed_alpha = (data >> 8) & 0xff; + logerror("%s: regs0_w: PMODE = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + break; + + case 0x04: // SMODE2 + m_smode2 = data; + m_interlace = BIT(data, 0); + m_frame_interlace = BIT(data, 1); + m_dpms_mode = (data >> 2) & 3; + logerror("%s: regs0_w: SMODE2 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + break; + + case 0x0e: // DISPFB1 + case 0x12: // DISPFB2 + { const uint8_t index = (offset - 0x0e) / 4; - m_dispfb[index] = data; - m_dispfb_base[index] = (data & 0x1ff) << 11; - m_dispfb_width[index] = (data & 0x7e00) >> 3; - m_dispfb_format[index] = (data >> 15) & 0x1f; - m_dispfb_x[index] = (data >> 32) & 0x7ff; - m_dispfb_y[index] = (data >> 42) & 0x7ff; - logerror("%s: regs0_w: DISPFB%d = %08x%08x\n", machine().describe_context(), index + 1, (uint32_t)(data >> 32), (uint32_t)data); + m_dispfb[index] = data; + m_dispfb_base[index] = (data & 0x1ff) << 11; + m_dispfb_width[index] = (data & 0x7e00) >> 3; + m_dispfb_format[index] = (data >> 15) & 0x1f; + m_dispfb_x[index] = (data >> 32) & 0x7ff; + m_dispfb_y[index] = (data >> 42) & 0x7ff; + logerror("%s: regs0_w: DISPFB%d = %08x%08x\n", machine().describe_context(), index + 1, (uint32_t)(data >> 32), (uint32_t)data); break; } - case 0x10: // DISPLAY1 - case 0x14: // DISPLAY2 - { + case 0x10: // DISPLAY1 + case 0x14: // DISPLAY2 + { const uint8_t index = (offset - 0x10) / 4; m_display[index] = data; m_display_xpos[index] = data & 0xfff; @@ -343,84 +352,84 @@ WRITE64_MEMBER(ps2_gs_device::priv_regs0_w) m_magv[index] = (data >> 27) & 3; m_display_width[index] = (data >> 32) & 0xfff; m_display_height[index] = (data >> 44) & 0x7ff; - logerror("%s: regs0_w: DISPLAY%d = %08x%08x\n", machine().describe_context(), index + 1, (uint32_t)(data >> 32), (uint32_t)data); - break; + logerror("%s: regs0_w: DISPLAY%d = %08x%08x\n", machine().describe_context(), index + 1, (uint32_t)(data >> 32), (uint32_t)data); + break; } - case 0x1c: // BGCOLOR - m_bgcolor = data; - m_bg_r = data & 0xff; - m_bg_g = (data >> 8) & 0xff; - m_bg_b = (data >> 16) & 0xff; - logerror("%s: regs0_w: BGCOLOR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - break; - - case 0x02: logerror("%s: regs0_w: SMODE1 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x06: logerror("%s: regs0_w: SRFSH = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x08: logerror("%s: regs0_w: SYNCH1 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x0a: logerror("%s: regs0_w: SYNCH2 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x0c: logerror("%s: regs0_w: SYNCV = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x16: logerror("%s: regs0_w: EXTBUF = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x18: logerror("%s: regs0_w: EXTDATA = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - case 0x1a: logerror("%s: regs0_w: EXTWRITE = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; - default: logerror("%s: regs0_w: Unknown %08x = %08x%08x\n", machine().describe_context(), 0x12000000 + (offset << 3), (uint32_t)(data >> 32), (uint32_t)data); break; - } - m_base_regs[offset >> 1] = data; + case 0x1c: // BGCOLOR + m_bgcolor = data; + m_bg_r = data & 0xff; + m_bg_g = (data >> 8) & 0xff; + m_bg_b = (data >> 16) & 0xff; + logerror("%s: regs0_w: BGCOLOR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + break; + + case 0x02: logerror("%s: regs0_w: SMODE1 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x06: logerror("%s: regs0_w: SRFSH = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x08: logerror("%s: regs0_w: SYNCH1 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x0a: logerror("%s: regs0_w: SYNCH2 = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x0c: logerror("%s: regs0_w: SYNCV = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x16: logerror("%s: regs0_w: EXTBUF = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x18: logerror("%s: regs0_w: EXTDATA = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + case 0x1a: logerror("%s: regs0_w: EXTWRITE = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); break; + default: logerror("%s: regs0_w: Unknown %08x = %08x%08x\n", machine().describe_context(), 0x12000000 + (offset << 3), (uint32_t)(data >> 32), (uint32_t)data); break; + } + m_base_regs[offset >> 1] = data; } READ64_MEMBER(ps2_gs_device::priv_regs1_r) { uint64_t ret = 0; - switch (offset) - { - case 0x00: - ret = m_csr | (CSR_REV | CSR_ID | CSR_FIFO_EMPTY); - logerror("%s: regs1_r: CSR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - case 0x02: - ret = m_imr; - logerror("%s: regs1_r: IMR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - case 0x08: - ret = m_busdir; - logerror("%s: regs1_r: BUSDIR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - case 0x10: - ret = m_sig_label_id; - logerror("%s: regs1_r: SIGLBLID (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); - break; - default: - logerror("%s: regs1_r: Unknown (%08x)\n", machine().describe_context(), 0x12000000 + (offset << 3)); - break; + switch (offset) + { + case 0x00: + ret = m_csr | (CSR_REV | CSR_ID | CSR_FIFO_EMPTY); + logerror("%s: regs1_r: CSR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + case 0x02: + ret = m_imr; + logerror("%s: regs1_r: IMR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + case 0x08: + ret = m_busdir; + logerror("%s: regs1_r: BUSDIR (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + case 0x10: + ret = m_sig_label_id; + logerror("%s: regs1_r: SIGLBLID (%08x%08x)\n", machine().describe_context(), (uint32_t)(ret >> 32), (uint32_t)ret); + break; + default: + logerror("%s: regs1_r: Unknown (%08x)\n", machine().describe_context(), 0x12000000 + (offset << 3)); + break; } return ret; } WRITE64_MEMBER(ps2_gs_device::priv_regs1_w) { - switch (offset) - { - case 0x00: - logerror("%s: regs1_w: CSR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - m_csr = data &~ (CSR_RESET | CSR_SIGNAL | CSR_HSINT | CSR_VSINT | CSR_EDWINT | CSR_FLUSH); - //m_csr |= (CSR_SIGNAL | CSR_HSINT | CSR_VSINT | CSR_EDWINT | CSR_FLUSH); - break; - case 0x02: - logerror("%s: regs1_w: IMR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - m_imr = data; - break; - case 0x08: - logerror("%s: regs1_w: BUSDIR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - m_busdir = data; - break; - case 0x10: - logerror("%s: regs1_w: SIGLBLID = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); - m_sig_label_id = data; - break; - default: - logerror("%s: regs1_w: Unknown %08x = %08x%08x\n", machine().describe_context(), 0x12000000 + (offset << 3), (uint32_t)(data >> 32), (uint32_t)data); - break; - } + switch (offset) + { + case 0x00: + logerror("%s: regs1_w: CSR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + m_csr = data &~ (CSR_RESET | CSR_SIGNAL | CSR_HSINT | CSR_VSINT | CSR_EDWINT | CSR_FLUSH); + //m_csr |= (CSR_SIGNAL | CSR_HSINT | CSR_VSINT | CSR_EDWINT | CSR_FLUSH); + break; + case 0x02: + logerror("%s: regs1_w: IMR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + m_imr = data; + break; + case 0x08: + logerror("%s: regs1_w: BUSDIR = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + m_busdir = data; + break; + case 0x10: + logerror("%s: regs1_w: SIGLBLID = %08x%08x\n", machine().describe_context(), (uint32_t)(data >> 32), (uint32_t)data); + m_sig_label_id = data; + break; + default: + logerror("%s: regs1_w: Unknown %08x = %08x%08x\n", machine().describe_context(), 0x12000000 + (offset << 3), (uint32_t)(data >> 32), (uint32_t)data); + break; + } } void ps2_gs_device::write_packed(const uint8_t reg, const uint64_t hi, const uint64_t lo) diff --git a/src/devices/video/ps2gs.h b/src/devices/video/ps2gs.h index 1890ef5386f..77de9f40a6f 100644 --- a/src/devices/video/ps2gs.h +++ b/src/devices/video/ps2gs.h @@ -9,11 +9,12 @@ * */ -#ifndef DEVICES_VIDEO_PS2GS_H -#define DEVICES_VIDEO_PS2GS_H +#ifndef MAME_VIDEO_PS2GS_H +#define MAME_VIDEO_PS2GS_H #pragma once + class ps2_intc_device; class ps2_gif_device; class sonyvu1_device; @@ -23,19 +24,20 @@ class ps2_gs_device : public device_t public: template - ps2_gs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&intc_tag, U &&vu1_tag) - : ps2_gs_device(mconfig, tag, owner, clock) - { + ps2_gs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&intc_tag, U &&vu1_tag) + : ps2_gs_device(mconfig, tag, owner, clock) + { m_intc.set_tag(std::forward(intc_tag)); m_vu1.set_tag(std::forward(vu1_tag)); } ps2_gs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual ~ps2_gs_device() override; - DECLARE_READ64_MEMBER(priv_regs0_r); - DECLARE_WRITE64_MEMBER(priv_regs0_w); - DECLARE_READ64_MEMBER(priv_regs1_r); - DECLARE_WRITE64_MEMBER(priv_regs1_w); + DECLARE_READ64_MEMBER(priv_regs0_r); + DECLARE_WRITE64_MEMBER(priv_regs0_w); + DECLARE_READ64_MEMBER(priv_regs1_r); + DECLARE_WRITE64_MEMBER(priv_regs1_w); DECLARE_WRITE64_MEMBER(regs_w); @@ -51,8 +53,8 @@ public: void vblank_end(); protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; virtual void device_add_mconfig(machine_config &config) override; void copy_dword_from_host(uint64_t data); @@ -75,19 +77,19 @@ protected: enum : uint8_t { - PSMCT32 = 0x00, - PSMCT24 = 0x01, - PSMCT16 = 0x02, - PSMCT16S = 0x0a, - PSMT8 = 0x13, - PSMT4 = 0x14, - PSMT8H = 0x1b, - PSMT4HL = 0x24, - PSMT4HH = 0x2c, - PSMZ32 = 0x30, - PSMZ24 = 0x31, - PSMZ16 = 0x32, - PSMZ16S = 0x3a + PSMCT32 = 0x00, + PSMCT24 = 0x01, + PSMCT16 = 0x02, + PSMCT16S = 0x0a, + PSMT8 = 0x13, + PSMT4 = 0x14, + PSMT8H = 0x1b, + PSMT4HL = 0x24, + PSMT4HH = 0x2c, + PSMZ32 = 0x30, + PSMZ24 = 0x31, + PSMZ16 = 0x32, + PSMZ16S = 0x3a }; enum : uint8_t @@ -260,9 +262,9 @@ protected: uint64_t m_trx_dir; // 0x53 // Privileged regs - uint64_t m_base_regs[15]; + uint64_t m_base_regs[15]; - uint64_t m_pmode; // Privileged 0x00 + uint64_t m_pmode; // Privileged 0x00 bool m_read_circuit_enable[2]; bool m_use_fixed_alpha; uint8_t m_alpha_out_select; @@ -294,25 +296,21 @@ protected: uint8_t m_bg_g; uint8_t m_bg_b; - uint64_t m_csr; - uint64_t m_imr; - uint64_t m_busdir; - uint64_t m_sig_label_id; + uint64_t m_csr; + uint64_t m_imr; + uint64_t m_busdir; + uint64_t m_sig_label_id; uint32_t m_vertex_count; uint32_t m_kick_count; uint8_t m_curr_field; - static const size_t FORMAT_PIXEL_WIDTHS[0x40]; - static const char* FORMAT_NAMES[0x40]; - static const uint32_t KICK_COUNTS[8]; + static const size_t FORMAT_PIXEL_WIDTHS[0x40]; + static const char* FORMAT_NAMES[0x40]; + static const uint32_t KICK_COUNTS[8]; }; DECLARE_DEVICE_TYPE(SONYPS2_GS, ps2_gs_device) -#include "ps2gif.h" -#include "cpu/mips/ps2vu.h" -#include "machine/ps2intc.h" - -#endif // DEVICES_VIDEO_PS2GS_H +#endif // MAME_VIDEO_PS2GS_H diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 4a433017724..f253235f714 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -3162,7 +3162,7 @@ void debugger_commands::execute_memdump(int ref, const std::vector address_space &sp = memory.space(space); bool octal = sp.is_octal(); int nc = octal ? (sp.addr_width() + 2) / 3 : (sp.addr_width() + 3) / 4; - + std::vector entries[2]; sp.dump_maps(entries[0], entries[1]); for (int mode = 0; mode < 2; mode ++) diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 01e165d7519..cd17a1e40f7 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -1401,7 +1401,7 @@ device_debug::device_debug(device_t &device) else m_notifiers.push_back(-1); } - + // set up state-related stuff if (m_state != nullptr) { diff --git a/src/emu/divtlb.cpp b/src/emu/divtlb.cpp index c227147cad9..bf94cc1253a 100644 --- a/src/emu/divtlb.cpp +++ b/src/emu/divtlb.cpp @@ -91,11 +91,11 @@ void device_vtlb_interface::interface_pre_start() memset(&m_live[0], 0, m_live.size()*sizeof(m_live[0])); // allocate the lookup table - m_table.resize((size_t)1 << (m_addrwidth - m_pageshift)); - memset(&m_table[0], 0, m_table.size() * sizeof(m_table[0])); - m_refcnt.resize((size_t)1 << (m_addrwidth - m_pageshift)); - memset(&m_refcnt[0], 0, m_refcnt.size() * sizeof(m_refcnt[0])); - // pointer to first element for quick access + m_table.resize((size_t)1 << (m_addrwidth - m_pageshift)); + memset(&m_table[0], 0, m_table.size() * sizeof(m_table[0])); + m_refcnt.resize((size_t)1 << (m_addrwidth - m_pageshift)); + memset(&m_refcnt[0], 0, m_refcnt.size() * sizeof(m_refcnt[0])); + // pointer to first element for quick access m_table_base = &m_table[0]; // allocate the fixed page count array @@ -116,7 +116,7 @@ void device_vtlb_interface::interface_post_start() { device().save_item(NAME(m_live)); device().save_item(NAME(m_table)); - device().save_item(NAME(m_refcnt)); + device().save_item(NAME(m_refcnt)); if (m_fixed > 0) device().save_item(NAME(m_fixedpages)); } @@ -241,18 +241,18 @@ void device_vtlb_interface::vtlb_load(int entrynum, int numpages, offs_t address if (m_live[liveindex] != 0) { int oldtableindex = m_live[liveindex] - 1; - m_refcnt[oldtableindex]--; - if (m_refcnt[oldtableindex] == 0) { - int pagecount = m_fixedpages[entrynum]; - for (pagenum = 0; pagenum < pagecount; pagenum++) { - m_table[oldtableindex + pagenum] = 0; - } - } + m_refcnt[oldtableindex]--; + if (m_refcnt[oldtableindex] == 0) { + int pagecount = m_fixedpages[entrynum]; + for (pagenum = 0; pagenum < pagecount; pagenum++) { + m_table[oldtableindex + pagenum] = 0; + } + } } // claim this new entry m_live[liveindex] = tableindex + 1; - m_refcnt[tableindex]++; + m_refcnt[tableindex]++; // store the raw value, making sure the "fixed" flag is set value |= VTLB_FLAG_FIXED; diff --git a/src/emu/divtlb.h b/src/emu/divtlb.h index 03ee4d1ed84..c64bca0a21c 100644 --- a/src/emu/divtlb.h +++ b/src/emu/divtlb.h @@ -83,7 +83,7 @@ private: std::vector m_live; // array of live entries by table index std::vector m_fixedpages; // number of pages each fixed entry covers std::vector m_table; // table of entries by address - std::vector m_refcnt; // table of entry reference counts by address + std::vector m_refcnt; // table of entry reference counts by address vtlb_entry *m_table_base; // pointer to m_table[0] }; diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index f88a3527c24..0cfb6f07d93 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -38,7 +38,7 @@ void handler_entry::dump_map(std::vector &map) const { - fatalerror("dump_map called on non-dispatching class\n"); + fatalerror("dump_map called on non-dispatching class\n"); } void handler_entry::reflist::add(const handler_entry *entry) @@ -464,8 +464,8 @@ public: static void write_qword_static(this_type &space, offs_t address, u64 data) { address &= space.m_addrmask; if (Width == 3) space.write_native(address & ~NATIVE_MASK, data); else memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, 0xffffffffffffffffU); } static void write_qword_masked_static(this_type &space, offs_t address, u64 data, u64 mask) { address &= space.m_addrmask; memory_write_generic([&space](offs_t offset, NativeType data, NativeType mask) { space.write_native(offset, data, mask); }, address, data, mask); } - handler_entry_read *m_root_read; - handler_entry_write *m_root_write; + handler_entry_read *m_root_read; + handler_entry_write *m_root_write; std::unordered_set m_delayed_unrefs; @@ -482,8 +482,8 @@ private: offs_t nstart, nend, nmask, nmirror; u64 nunitmask; - int ncswidth; - check_optimize_all("install_read_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); + int ncswidth; + check_optimize_all("install_read_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); auto hand_r = new handler_entry_read_delegate(this, handler_r); hand_r->set_address_info(nstart, nmask); @@ -503,8 +503,8 @@ private: offs_t nstart, nend, nmask, nmirror; u64 nunitmask; - int ncswidth; - check_optimize_all("install_read_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); + int ncswidth; + check_optimize_all("install_read_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); auto hand_r = new handler_entry_read_delegate(this, handler_r); memory_units_descriptor descriptor(AccessWidth, Endian, hand_r, nstart, nend, nmask, nunitmask, ncswidth); @@ -534,8 +534,8 @@ private: offs_t nstart, nend, nmask, nmirror; u64 nunitmask; - int ncswidth; - check_optimize_all("install_write_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); + int ncswidth; + check_optimize_all("install_write_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); auto hand_w = new handler_entry_write_delegate(this, handler_w); hand_w->set_address_info(nstart, nmask); @@ -555,8 +555,8 @@ private: offs_t nstart, nend, nmask, nmirror; u64 nunitmask; - int ncswidth; - check_optimize_all("install_write_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); + int ncswidth; + check_optimize_all("install_write_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); auto hand_w = new handler_entry_write_delegate(this, handler_w); memory_units_descriptor descriptor(AccessWidth, Endian, hand_w, nstart, nend, nmask, nunitmask, ncswidth); @@ -589,8 +589,8 @@ private: offs_t nstart, nend, nmask, nmirror; u64 nunitmask; - int ncswidth; - check_optimize_all("install_readwrite_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); + int ncswidth; + check_optimize_all("install_readwrite_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); auto hand_r = new handler_entry_read_delegate (this, handler_r); hand_r->set_address_info(nstart, nmask); @@ -602,7 +602,7 @@ private: invalidate_caches(read_or_write::READWRITE); } - + template std::enable_if_t<(Width > AccessWidth)> install_readwrite_handler_helper(offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, offs_t addrselect, u64 unitmask, int cswidth, typename handler_entry_size::READ handler_r, @@ -616,8 +616,8 @@ private: offs_t nstart, nend, nmask, nmirror; u64 nunitmask; - int ncswidth; - check_optimize_all("install_readwrite_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); + int ncswidth; + check_optimize_all("install_readwrite_handler", 8 << AccessWidth, addrstart, addrend, addrmask, addrmirror, addrselect, unitmask, cswidth, nstart, nend, nmask, nmirror, nunitmask, ncswidth); auto hand_r = new handler_entry_read_delegate (this, handler_r); memory_units_descriptor descriptor(AccessWidth, Endian, hand_r, nstart, nend, nmask, nunitmask, ncswidth); @@ -751,7 +751,7 @@ void memory_manager::allocate(device_memory_interface &memory) else memory.allocate>(*this, spacenum); break; - + default: throw emu_fatalerror("Invalid width %d/shift %d specified for address_space::allocate", spaceconfig->data_width(), spaceconfig->addr_shift()); } diff --git a/src/emu/emumem.h b/src/emu/emumem.h index df3efc57385..d631fd29985 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -807,7 +807,7 @@ private: address_space & m_space; int m_notifier_id; // id to remove the notifier on destruction - + offs_t m_addrmask; // address mask offs_t m_addrstart_r; // minimum valid address for reading offs_t m_addrend_r; // maximum valid address for reading diff --git a/src/emu/emumem_hedr.ipp b/src/emu/emumem_hedr.ipp index 4c3ee5400a7..626f43a6d3f 100644 --- a/src/emu/emumem_hedr.ipp +++ b/src/emu/emumem_hedr.ipp @@ -473,7 +473,7 @@ template void handler_entry_ m_dispatch[i] = np->get_subhandler(); m_dispatch[i]->ref(); np->unref(); - + } else np->detach(handlers); } diff --git a/src/emu/emumem_hedw.ipp b/src/emu/emumem_hedw.ipp index c9c6b5a52c3..1496521d094 100644 --- a/src/emu/emumem_hedw.ipp +++ b/src/emu/emumem_hedw.ipp @@ -477,7 +477,7 @@ template void handler_entry_ m_dispatch[i] = np->get_subhandler(); m_dispatch[i]->ref(); np->unref(); - + } else np->detach(handlers); } diff --git a/src/emu/emumem_heu.h b/src/emu/emumem_heu.h index c7dcea23287..4b1857f0c6c 100644 --- a/src/emu/emumem_heu.h +++ b/src/emu/emumem_heu.h @@ -4,7 +4,7 @@ // handler_entry_read_units/handler_entry_write_units // merges/splits an access among multiple handlers (unitmask support) - + template class handler_entry_read_units : public handler_entry_read { public: diff --git a/src/emu/emumem_mud.cpp b/src/emu/emumem_mud.cpp index 8279eea5635..98e83c7055f 100644 --- a/src/emu/emumem_mud.cpp +++ b/src/emu/emumem_mud.cpp @@ -85,7 +85,7 @@ template memory_units_descriptor void memory_units_descriptor::generate(u8 ukey, typename handler_entry_size::uX umask, u32 cswidth, u32 bits_per_access, u8 base_shift, s8 shift, u32 active_count) { auto &entries = m_entries_for_key[ukey]; - + // Compute the selection masks if(!cswidth) cswidth = bits_per_access; diff --git a/src/emu/ui/cmddata.h b/src/emu/ui/cmddata.h index 675195f7c76..be636f19dc4 100644 --- a/src/emu/ui/cmddata.h +++ b/src/emu/ui/cmddata.h @@ -5,10 +5,10 @@ ui/cmddata.h *********************************************************************/ -#pragma once +#ifndef MAME_EMU_UI_CMDDATA_H +#define MAME_EMU_UI_CMDDATA_H -#ifndef __UI_CMDDATA_H__ -#define __UI_CMDDATA_H__ +#pragma once #define BUTTON_COLOR_RED rgb_t(255,64,64) #define BUTTON_COLOR_YELLOW rgb_t(255,238,0) @@ -399,4 +399,4 @@ static fix_strings_t convert_text[] = { nullptr, 0, 0 } // end of array }; -#endif /* __UI_CMDDATA_H__ */ +#endif // MAME_EMU_UI_CMDDATA_H diff --git a/src/frontend/mame/language.h b/src/frontend/mame/language.h index 2a9d934576b..73adbb88269 100644 --- a/src/frontend/mame/language.h +++ b/src/frontend/mame/language.h @@ -7,15 +7,15 @@ Multi-language support. ***************************************************************************/ +#ifndef MAME_FRONTEND_MAME_LANGUAGE_H +#define MAME_FRONTEND_MAME_LANGUAGE_H + #pragma once #ifndef __EMU_H__ #error Dont include this file directly; include emu.h instead. #endif -#ifndef __LANGUAGE_H__ -#define __LANGUAGE_H__ - //************************************************************************** // LOCALIZATION SUPPORT //************************************************************************** @@ -28,4 +28,4 @@ void load_translation(emu_options &option); const char *lang_translate(const char *word); -#endif /*__LANGUAGE_H__*/ +#endif // MAME_FRONTEND_MAME_LANGUAGE_H diff --git a/src/frontend/mame/luaengine.h b/src/frontend/mame/luaengine.h index 205c84f2e36..c8189f82083 100644 --- a/src/frontend/mame/luaengine.h +++ b/src/frontend/mame/luaengine.h @@ -8,15 +8,15 @@ ***************************************************************************/ +#ifndef MAME_FRONTEND_MAME_LUAENGINE_H +#define MAME_FRONTEND_MAME_LUAENGINE_H + #pragma once #ifndef __EMU_H__ #error Dont include this file directly; include emu.h instead. #endif -#ifndef __LUA_ENGINE_H__ -#define __LUA_ENGINE_H__ - #if defined(__GNUC__) && (__GNUC__ > 6) #pragma GCC diagnostic ignored "-Wnoexcept-type" #endif @@ -168,4 +168,4 @@ private: }; }; -#endif /* __LUA_ENGINE_H__ */ +#endif // MAME_FRONTEND_MAME_LUAENGINE_H diff --git a/src/frontend/mame/mame.h b/src/frontend/mame/mame.h index 849711cf3a5..3700aaab81b 100644 --- a/src/frontend/mame/mame.h +++ b/src/frontend/mame/mame.h @@ -7,10 +7,10 @@ Controls execution of the core MAME system. ***************************************************************************/ -#pragma once +#ifndef MAME_FRONTEND_MAME_MAME_H +#define MAME_FRONTEND_MAME_MAME_H -#ifndef __MAME_H__ -#define __MAME_H__ +#pragma once class plugin_options; class osd_interface; @@ -87,4 +87,4 @@ private: extern const char build_version[]; extern const char bare_build_version[]; -#endif /* __MAME_H__ */ +#endif // MAME_FRONTEND_MAME_MAME_H diff --git a/src/frontend/mame/ui/icorender.h b/src/frontend/mame/ui/icorender.h index 864969b616d..17bc5a1d8ea 100644 --- a/src/frontend/mame/ui/icorender.h +++ b/src/frontend/mame/ui/icorender.h @@ -10,10 +10,10 @@ http://vitiy.info/Code/ico.cpp ***************************************************************************/ -#pragma once +#ifndef MAME_FRONTEND_MAME_UI_ICORENDER_H +#define MAME_FRONTEND_MAME_UI_ICORENDER_H -#ifndef __UI_ICORENDER_H__ -#define __UI_ICORENDER_H__ +#pragma once // These next two structs represent how the icon information is stored // in an ICO file. @@ -230,4 +230,4 @@ inline void render_load_ico(bitmap_argb32 &bitmap, emu_file &file, const char *d global_free_array(buffer); } -#endif /* __UI_ICORENDER_H__ */ +#endif // MAME_FRONTEND_MAME_UI_ICORENDER_H diff --git a/src/frontend/mame/ui/slider.h b/src/frontend/mame/ui/slider.h index 7c8a1000961..7785518d093 100644 --- a/src/frontend/mame/ui/slider.h +++ b/src/frontend/mame/ui/slider.h @@ -9,29 +9,29 @@ ***************************************************************************/ +#ifndef MAME_FRONTEND_MAME_UI_SLIDER_H +#define MAME_FRONTEND_MAME_UI_SLIDER_H + #pragma once -#ifndef __UI_SLIDER__ -#define __UI_SLIDER__ +#include "sliderchangednotifier.h" #include -#include "sliderchangednotifier.h" - #define SLIDER_NOCHANGE 0x12345678 -typedef std::function slider_update; +typedef std::function slider_update; struct slider_state { - slider_update update; /* callback */ - void * arg; /* argument */ - int32_t minval; /* minimum value */ - int32_t defval; /* default value */ - int32_t maxval; /* maximum value */ - int32_t incval; /* increment value */ + slider_update update; // callback + void * arg; // argument + std::int32_t minval; // minimum value + std::int32_t defval; // default value + std::int32_t maxval; // maximum value + std::int32_t incval; // increment value int id; - std::string description; /* textual description */ + std::string description; // textual description }; -#endif // __UI_SLIDER__ +#endif // MAME_FRONTEND_MAME_UI_SLIDER_H diff --git a/src/frontend/mame/ui/sliderchangednotifier.h b/src/frontend/mame/ui/sliderchangednotifier.h index 60bcf9c79fe..eedb39684f3 100644 --- a/src/frontend/mame/ui/sliderchangednotifier.h +++ b/src/frontend/mame/ui/sliderchangednotifier.h @@ -6,16 +6,14 @@ // //====================================================================== -#pragma once +#ifndef MAME_FRONTEND_MAME_UI_SLIDERCHANGEDNOTIFIER_H +#define MAME_FRONTEND_MAME_UI_SLIDERCHANGEDNOTIFIER_H -#ifndef __SLIDER_CHANGED_NOTIFIER__ -#define __SLIDER_CHANGED_NOTIFIER__ +#pragma once #include #include -using int32_t = std::int32_t; - class running_machine; class slider_changed_notifier @@ -23,7 +21,7 @@ class slider_changed_notifier public: virtual ~slider_changed_notifier() { } - virtual int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, int32_t newval) = 0; + virtual std::int32_t slider_changed(running_machine &machine, void *arg, int id, std::string *str, std::int32_t newval) = 0; }; -#endif // __SLIDER_CHANGED_NOTIFIER__ +#endif // MAME_FRONTEND_MAME_UI_SLIDERCHANGEDNOTIFIER_H diff --git a/src/frontend/mame/ui/viewgfx.h b/src/frontend/mame/ui/viewgfx.h index 5043ded0a27..a4d2205d7a8 100644 --- a/src/frontend/mame/ui/viewgfx.h +++ b/src/frontend/mame/ui/viewgfx.h @@ -8,10 +8,10 @@ ***************************************************************************/ -#pragma once +#ifndef MAME_FRONTEND_MAME_UI_VIEWGFX_H +#define MAME_FRONTEND_MAME_UI_VIEWGFX_H -#ifndef __UI_VIEWGFX_H__ -#define __UI_VIEWGFX_H__ +#pragma once @@ -29,4 +29,4 @@ bool ui_gfx_is_relevant(running_machine &machine); uint32_t ui_gfx_ui_handler(render_container &container, mame_ui_manager &mui, bool uistate); -#endif /* __UI_VIEWGFX_H__ */ +#endif // MAME_FRONTEND_MAME_UI_VIEWGFX_H diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h index d1202918ac2..c2954dae928 100644 --- a/src/mame/audio/cage.h +++ b/src/mame/audio/cage.h @@ -79,7 +79,7 @@ private: required_memory_bank m_bootbank; required_memory_bank m_mainbank; - + required_memory_region m_bootrom; required_memory_region m_mainrom; diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp index cb88437cc90..b72d8a61b3a 100644 --- a/src/mame/drivers/alg.cpp +++ b/src/mame/drivers/alg.cpp @@ -706,7 +706,7 @@ ROM_START( marvice ) ROM_REGION( 0x800, "unk", ROMREGION_ERASEFF ) // nvram contents, should be x4 in size ROM_LOAD( "mk48z02b-20.u13", 0x0000, 0x0800, BAD_DUMP CRC(e6079615) SHA1(f528b2a600ab047ad7f87f4dbae65a7e4cd10f8c) ) - + DISK_REGION( "laserdisc" ) DISK_IMAGE_READONLY( "marvice", 0, NO_DUMP ) ROM_END diff --git a/src/mame/drivers/amust.cpp b/src/mame/drivers/amust.cpp index bd8377301a3..9b88907458d 100644 --- a/src/mame/drivers/amust.cpp +++ b/src/mame/drivers/amust.cpp @@ -109,7 +109,7 @@ public: , m_floppy0(*this, "fdc:0") , m_floppy1(*this, "fdc:1") { } - + void amust(machine_config &config); void init_amust(); diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index eace0ec89f9..3baceec044c 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -12,13 +12,13 @@ - ROM 00/01: original motherboard, 256K of RAM (banks 00/01/E0/E1 only), FPI chip manages fast/slow side - ROM 03: revised motherboard, 1M of RAM (banks 00/01/->0F/E0/E1), CYA chip replaces FPI - Expanded IIe: ROM 00/01 motherboard in a IIe case with a IIe keyboard rather than ADB - - FF6ACF is speed test in ROM - Diags: - A138 = scanline interrupt test (raster is too long to pass this) - A179 = pass - A17C = fail 1 - A0F1 = fail 2 + + FF6ACF is speed test in ROM + Diags: + A138 = scanline interrupt test (raster is too long to pass this) + A179 = pass + A17C = fail 1 + A0F1 = fail 2 ***************************************************************************/ @@ -88,9 +88,9 @@ // various timing standards #define A2GS_MASTER_CLOCK (XTAL(28'636'363)) -#define A2GS_14M (A2GS_MASTER_CLOCK/2) -#define A2GS_7M (A2GS_MASTER_CLOCK/4) -#define A2GS_1M (A2GS_MASTER_CLOCK/28) +#define A2GS_14M (A2GS_MASTER_CLOCK/2) +#define A2GS_7M (A2GS_MASTER_CLOCK/4) +#define A2GS_1M (A2GS_MASTER_CLOCK/28) #define A2GS_CPU_TAG "maincpu" #define A2GS_ADBMCU_TAG "adbmicro" @@ -102,8 +102,8 @@ #define A2GS_AUXUPPER_TAG "inhaux" #define A2GS_00UPPER_TAG "inh00" #define A2GS_01UPPER_TAG "inh01" -#define A2GS_IWM_TAG "fdc" // must be "fdc" or sonydriv pukes -#define A2GS_DOC_TAG "doc" +#define A2GS_IWM_TAG "fdc" // must be "fdc" or sonydriv pukes +#define A2GS_DOC_TAG "doc" #define A2GS_VIDEO_TAG "a2video" #define SCC_TAG "scc" #define RS232A_TAG "printer" @@ -117,9 +117,9 @@ #define A2GS_LCAUX_TAG "lcaux" #define A2GS_LC00_TAG "lc00" #define A2GS_LC01_TAG "lc01" -#define A2GS_B0CXXX_TAG "bnk0atc" -#define A2GS_B01_TAG "bnk1at0" -#define A2GS_B1CXXX_TAG "bnk1atc" +#define A2GS_B0CXXX_TAG "bnk0atc" +#define A2GS_B01_TAG "bnk1at0" +#define A2GS_B1CXXX_TAG "bnk1atc" #define A2GS_B00000_TAG "b0r00bank" #define A2GS_B00200_TAG "b0r02bank" #define A2GS_B00400_TAG "b0r04bank" @@ -255,8 +255,8 @@ public: enum glu_sys_status { - GLU_STATUS_CMDFULL = 0x01, - GLU_STATUS_MOUSEXY = 0x02, + GLU_STATUS_CMDFULL = 0x01, + GLU_STATUS_MOUSEXY = 0x02, GLU_STATUS_KEYDATIRQEN = 0x04, GLU_STATUS_KEYDATIRQ = 0x08, GLU_STATUS_DATAIRQEN = 0x10, @@ -267,21 +267,21 @@ public: enum shadow_reg_bits { - SHAD_IOLC = 0x40, // I/O and language card inhibit for banks 00/01 - SHAD_TXTPG2 = 0x20, // inhibits text-page 2 shadowing in both banks (ROM 03 h/w only) - SHAD_AUXHIRES = 0x10, // inhibits bank 01 hi-res region shadowing - SHAD_SUPERHIRES = 0x08, // inhibits bank 01 super-hi-res region shadowing - SHAD_HIRESPG2 = 0x04, // inhibits hi-res page 2 shadowing in both banks - SHAD_HIRESPG1 = 0x02, // inhibits hi-res page 1 shadowing in both banks - SHAD_TXTPG1 = 0x01 // inhibits text-page 1 shadowing in both banks + SHAD_IOLC = 0x40, // I/O and language card inhibit for banks 00/01 + SHAD_TXTPG2 = 0x20, // inhibits text-page 2 shadowing in both banks (ROM 03 h/w only) + SHAD_AUXHIRES = 0x10, // inhibits bank 01 hi-res region shadowing + SHAD_SUPERHIRES = 0x08, // inhibits bank 01 super-hi-res region shadowing + SHAD_HIRESPG2 = 0x04, // inhibits hi-res page 2 shadowing in both banks + SHAD_HIRESPG1 = 0x02, // inhibits hi-res page 1 shadowing in both banks + SHAD_TXTPG1 = 0x01 // inhibits text-page 1 shadowing in both banks }; enum speed_reg_bits { - SPEED_HIGH = 0x80, // full 2.8 MHz speed when set, Apple II 1 MHz when clear - SPEED_POWERON = 0x40, // ROM 03 only; indicates machine turned on by power switch (as opposed to ?) - SPEED_ALLBANKS = 0x10, // enables bank 0/1 shadowing in all banks (not supported) - SPEED_DISKIISL7 = 0x08, // enable Disk II motor on detect for slot 7 + SPEED_HIGH = 0x80, // full 2.8 MHz speed when set, Apple II 1 MHz when clear + SPEED_POWERON = 0x40, // ROM 03 only; indicates machine turned on by power switch (as opposed to ?) + SPEED_ALLBANKS = 0x10, // enables bank 0/1 shadowing in all banks (not supported) + SPEED_DISKIISL7 = 0x08, // enable Disk II motor on detect for slot 7 SPEED_DISKIISL6 = 0x04, // enable Disk II motor on detect for slot 6 SPEED_DISKIISL5 = 0x02, // enable Disk II motor on detect for slot 5 SPEED_DISKIISL4 = 0x01 // enable Disk II motor on detect for slot 4 @@ -289,43 +289,43 @@ public: enum disk_reg_bits { - DISKREG_35HEADSEL = 0x80, // head select for 3.5" "dumb" Sony drives - DISKREG_35ENABLE = 0x40 // 1 to enable 3.5" drives, 0 to chain through to 5.25" + DISKREG_35HEADSEL = 0x80, // head select for 3.5" "dumb" Sony drives + DISKREG_35ENABLE = 0x40 // 1 to enable 3.5" drives, 0 to chain through to 5.25" }; enum irq_sources { - IRQS_DOC = 0, - IRQS_SCAN = 1, - IRQS_ADB = 2, - IRQS_VBL = 3, - IRQS_SECOND = 4, - IRQS_QTRSEC = 5, - IRQS_SLOT = 6, - IRQS_SCC = 7 + IRQS_DOC = 0, + IRQS_SCAN = 1, + IRQS_ADB = 2, + IRQS_VBL = 3, + IRQS_SECOND = 4, + IRQS_QTRSEC = 5, + IRQS_SLOT = 6, + IRQS_SCC = 7 }; enum intflag_bits { - INTFLAG_IRQASSERTED = 0x01, + INTFLAG_IRQASSERTED = 0x01, INTFLAG_M2MOUSEMOVE = 0x02, - INTFLAG_M2MOUSESW = 0x04, - INTFLAG_VBL = 0x08, - INTFLAG_QUARTER = 0x10, - INTFLAG_AN3 = 0x20, + INTFLAG_M2MOUSESW = 0x04, + INTFLAG_VBL = 0x08, + INTFLAG_QUARTER = 0x10, + INTFLAG_AN3 = 0x20, INTFLAG_MOUSEDOWNLAST = 0x40, - INTFLAG_MOUSEDOWN = 0x80 + INTFLAG_MOUSEDOWN = 0x80 }; enum vgcint_bits { - VGCINT_EXTERNALEN = 0x01, - VGCINT_SCANLINEEN = 0x02, + VGCINT_EXTERNALEN = 0x01, + VGCINT_SCANLINEEN = 0x02, VGCINT_SECONDENABLE = 0x04, - VGCINT_EXTERNAL = 0x10, - VGCINT_SCANLINE = 0x20, - VGCINT_SECOND = 0x40, - VGCINT_ANYVGCINT = 0x80 + VGCINT_EXTERNAL = 0x10, + VGCINT_SCANLINE = 0x20, + VGCINT_SECOND = 0x40, + VGCINT_ANYVGCINT = 0x80 }; enum apple2gs_clock_mode @@ -391,7 +391,7 @@ public: int apple2_fdc_has_525(); void apple2_iwm_setdiskreg(uint8_t data); - uint8_t m_diskreg; // move into private when we can + uint8_t m_diskreg; // move into private when we can void rom1_init() { m_is_rom3 = false; } void rom3_init() { m_is_rom3 = true; } @@ -612,7 +612,7 @@ private: // FF6ACF is speed test routine in ROM 3 #define slow_cycle() \ -{ \ +{ \ if (m_last_speed) \ {\ m_slow_counter += 0x0003cccc; \ @@ -710,20 +710,20 @@ WRITE_LINE_MEMBER(apple2gs_state::a2bus_inh_w) // this facilitates the documented behavior from the Firmware Reference. READ8_MEMBER(apple2gs_state::apple2gs_read_vector) { - // when IOLC shadowing is enabled, vector fetches always go to ROM, - // regardless of the language card config. - if (!(m_shadow & SHAD_IOLC)) - { - return m_maincpu->space(AS_PROGRAM).read_byte(offset | 0xFFFFE0); - } - else // else vector fetches from bank 0 RAM - { - return m_maincpu->space(AS_PROGRAM).read_byte((offset & 0xffff) | 0xFFE0); - } + // when IOLC shadowing is enabled, vector fetches always go to ROM, + // regardless of the language card config. + if (!(m_shadow & SHAD_IOLC)) + { + return m_maincpu->space(AS_PROGRAM).read_byte(offset | 0xFFFFE0); + } + else // else vector fetches from bank 0 RAM + { + return m_maincpu->space(AS_PROGRAM).read_byte((offset & 0xffff) | 0xFFE0); + } } /*************************************************************************** - ADB MCU simulation + ADB MCU simulation ***************************************************************************/ #if !RUN_ADB_MICRO READ_LINE_MEMBER(apple2gs_state::ay3600_shift_r) @@ -909,7 +909,7 @@ void apple2gs_state::adb_do_command() case 0x13: /* mystery command 0x13 */ break; - case 0x84: // ACS demo disk #2 has a bug and writes this accidentally to $C026 + case 0x84: // ACS demo disk #2 has a bug and writes this accidentally to $C026 break; case 0xb0: case 0xb1: case 0xb2: case 0xb3: @@ -1038,7 +1038,7 @@ void apple2gs_state::adb_write_datareg(uint8_t data) /* ignore for now */ break; - case 0x84: // ACS demo disk #2 has a bug and writes this accidentally to $C026 + case 0x84: // ACS demo disk #2 has a bug and writes this accidentally to $C026 break; case 0xb0: case 0xb1: case 0xb2: case 0xb3: @@ -1049,7 +1049,7 @@ void apple2gs_state::adb_write_datareg(uint8_t data) m_adb_command_length = 2; break; - case 0xe2: // Jam Session sends this when starting a song + case 0xe2: // Jam Session sends this when starting a song break; case 0xf2: @@ -1199,12 +1199,12 @@ void apple2gs_state::machine_start() m_inh_bank = 0; m_nvram->set_base(m_clock_bram, sizeof(m_clock_bram)); - + // setup speaker toggle volumes. this should be done mathematically probably, // but these ad-hoc values aren't too bad. - static const int16_t lvlTable[16] = + static const int16_t lvlTable[16] = { - 0x0000, 0x03ff, 0x04ff, 0x05ff, 0x06ff, 0x07ff, 0x08ff, 0x09ff, + 0x0000, 0x03ff, 0x04ff, 0x05ff, 0x06ff, 0x07ff, 0x08ff, 0x09ff, 0x0aff, 0x0bff, 0x0cff, 0x0fff, 0x1fff, 0x3fff, 0x5fff, 0x7fff }; m_speaker->set_levels(16, lvlTable); @@ -1430,7 +1430,7 @@ void apple2gs_state::machine_reset() // RESEARCH: how does RESET affect LC state and aux banking states? auxbank_update(); update_slotrom_banks(); - + // with all the banking reset, now reset the CPU m_maincpu->reset(); } @@ -1571,7 +1571,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2gs_state::apple2_interrupt) } } } - else if (scanline == (192+BORDER_TOP+1)) + else if (scanline == (192+BORDER_TOP+1)) { m_adbmicro->set_input_line(1, ASSERT_LINE); } @@ -1613,7 +1613,7 @@ PALETTE_INIT_MEMBER(apple2gs_state, apple2gs) uint32_t apple2gs_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { return m_video->screen_update_GS(screen, bitmap, cliprect); -} +} /*************************************************************************** I/O @@ -2061,9 +2061,9 @@ READ8_MEMBER(apple2gs_state::c000_r) #if RUN_ADB_MICRO return keyglu_816_read(GLU_C010); #else - ret = m_transchar | (m_anykeydown ? 0x80 : 0x00); - m_strobe = 0; - return ret; + ret = m_transchar | (m_anykeydown ? 0x80 : 0x00); + m_strobe = 0; + return ret; #endif case 0x11: // read LCRAM2 (LC Dxxx bank) @@ -2111,10 +2111,10 @@ READ8_MEMBER(apple2gs_state::c000_r) case 0x1f: // read 80COL return m_video->m_80col ? 0x80 : 0x00; - case 0x22: // TEXTCOL + case 0x22: // TEXTCOL return m_textcol; - case 0x23: // VGCINT + case 0x23: // VGCINT return m_vgcint; #if RUN_ADB_MICRO case 0x24: // MOUSEDATA */ @@ -2187,18 +2187,18 @@ READ8_MEMBER(apple2gs_state::c000_r) return adb_read_kmstatus(); #endif - case 0x29: // NEWVIDEO + case 0x29: // NEWVIDEO return m_video->m_newvideo; - case 0x2d: // SLOTROMSEL + case 0x2d: // SLOTROMSEL return m_slotromsel; - case 0x2e: // VERTCNT + case 0x2e: // VERTCNT return get_vpos() >> 1; - case 0x2f: // HORIZCNT + case 0x2f: // HORIZCNT ret = m_screen->hpos() / 11; - if (ret > 0) + if (ret > 0) { ret += 0x40; } @@ -2209,23 +2209,23 @@ READ8_MEMBER(apple2gs_state::c000_r) } return ret; - case 0x31: // DISKREG + case 0x31: // DISKREG return m_diskreg; case 0x33: // CLOCKDATA return m_clkdata; - case 0x34: // BORDERCOL + case 0x34: // BORDERCOL return m_clock_control; - case 0x35: // SHADOW + case 0x35: // SHADOW return m_shadow; - case 0x36: // SPEED/CYAREG + case 0x36: // SPEED/CYAREG return m_speed; case 0x38: // SCCBREG - return m_scc->cb_r(space, 0); + return m_scc->cb_r(space, 0); case 0x39: // SCCAREG return m_scc->ca_r(space, 0); @@ -2261,12 +2261,12 @@ READ8_MEMBER(apple2gs_state::c000_r) return m_sndglu_addr & 0xff; case 0x3f: // SOUNDADRH - return (m_sndglu_addr >> 8) & 0xff; + return (m_sndglu_addr >> 8) & 0xff; - case 0x41: // INTEN + case 0x41: // INTEN return m_inten; - case 0x46: // INTFLAG + case 0x46: // INTFLAG return (m_an3 ? INTFLAG_AN3 : 0x00) | m_intflag; case 0x60: // button 3 on IIgs @@ -2422,17 +2422,17 @@ WRITE8_MEMBER(apple2gs_state::c000_w) case 0x20: break; - case 0x21: // MONOCHROME + case 0x21: // MONOCHROME m_video->m_monochrome = data; break; - case 0x22: // TEXTCOL + case 0x22: // TEXTCOL m_textcol = data; m_video->m_GSfg = (data >> 4) & 0xf; m_video->m_GSbg = data & 0xf; break; - case 0x23: // VGCINT + case 0x23: // VGCINT if ((m_vgcint & VGCINT_SECOND) && !(data & VGCINT_SECOND)) { lower_irq(IRQS_SECOND); @@ -2472,20 +2472,20 @@ WRITE8_MEMBER(apple2gs_state::c000_w) break; #endif - case 0x29: // NEWVIDEO + case 0x29: // NEWVIDEO m_video->m_newvideo = data; break; - case 0x2d: // SLOTROMSEL + case 0x2d: // SLOTROMSEL m_slotromsel = data; break; - case 0x31: // DISKREG + case 0x31: // DISKREG m_diskreg = data; apple2_iwm_setdiskreg(m_diskreg); break; - case 0x32: // VGCINTCLEAR + case 0x32: // VGCINTCLEAR //printf("%02x to VGCINTCLEAR\n", data); // one second if ((m_vgcint & VGCINT_SECOND) && !(data & VGCINT_SECOND)) @@ -2507,11 +2507,11 @@ WRITE8_MEMBER(apple2gs_state::c000_w) } break; - case 0x33: // CLOCKDATA + case 0x33: // CLOCKDATA m_clkdata = data; break; - case 0x34: // CLOCKCTL + case 0x34: // CLOCKCTL m_clock_control = data & 0x7f; m_video->m_GSborder = data & 0xf; if (data & 0x80) @@ -2520,7 +2520,7 @@ WRITE8_MEMBER(apple2gs_state::c000_w) } break; - case 0x35: // SHADOW + case 0x35: // SHADOW m_shadow = data; // handle I/O and language card inhibit bits here @@ -2536,7 +2536,7 @@ WRITE8_MEMBER(apple2gs_state::c000_w) } break; - case 0x36: // SPEED + case 0x36: // SPEED m_speed = data; if (m_speed & SPEED_ALLBANKS) @@ -2596,7 +2596,7 @@ WRITE8_MEMBER(apple2gs_state::c000_w) m_sndglu_addr |= data<<8; break; - case 0x41: // INTEN + case 0x41: // INTEN m_inten = data & 0x1f; if (!(data & 0x10)) { @@ -2609,13 +2609,13 @@ WRITE8_MEMBER(apple2gs_state::c000_w) //printf("%02x to INTEN, now %02x\n", data, m_vgcint); break; - case 0x47: // CLRVBLINT + case 0x47: // CLRVBLINT m_intflag &= ~INTFLAG_VBL; lower_irq(IRQS_VBL); lower_irq(IRQS_QTRSEC); break; - case 0x68: // STATEREG + case 0x68: // STATEREG m_altzp = (data & 0x80); m_page2 = (data & 0x40); m_ramrd = (data & 0x20); @@ -2764,11 +2764,11 @@ uint8_t apple2gs_state::read_slot_rom(address_space &space, int slotbias, int of { int slotnum = ((offset>>8) & 0xf) + slotbias; -// printf("read_slot_rom: sl %d offs %x, cnxx_slot %d\n", slotnum, offset, m_cnxx_slot); +// printf("read_slot_rom: sl %d offs %x, cnxx_slot %d\n", slotnum, offset, m_cnxx_slot); if (m_slotdevice[slotnum] != nullptr) { -// printf("slotdevice is not null\n"); +// printf("slotdevice is not null\n"); if ((m_cnxx_slot == CNXX_UNCLAIMED) && (m_slotdevice[slotnum]->take_c800()) && (!machine().side_effects_disabled())) { m_cnxx_slot = slotnum; @@ -2810,9 +2810,9 @@ uint8_t apple2gs_state::read_int_rom(address_space &space, int slotbias, int off return m_rom[slotbias + offset]; } -READ8_MEMBER(apple2gs_state::c100_r) -{ - int slot = ((offset>>8) & 0xf) + 1; +READ8_MEMBER(apple2gs_state::c100_r) +{ + int slot = ((offset>>8) & 0xf) + 1; slow_cycle(); @@ -2825,15 +2825,15 @@ READ8_MEMBER(apple2gs_state::c100_r) return read_slot_rom(space, 1, offset); } -WRITE8_MEMBER(apple2gs_state::c100_w) -{ - int slot = ((offset>>8) & 0xf) + 1; +WRITE8_MEMBER(apple2gs_state::c100_w) +{ + int slot = ((offset>>8) & 0xf) + 1; slow_cycle(); if ((m_slotromsel & (1 << slot))) { - write_slot_rom(space, 1, offset, data); + write_slot_rom(space, 1, offset, data); } } @@ -2843,9 +2843,9 @@ READ8_MEMBER(apple2gs_state::c400_int_r) { slow_cycle(); return read_int_rom(sp READ8_MEMBER(apple2gs_state::c300_r) { slow_cycle(); return read_slot_rom(space, 3, offset); } WRITE8_MEMBER(apple2gs_state::c300_w) { slow_cycle(); write_slot_rom(space, 3, offset, data); } -READ8_MEMBER(apple2gs_state::c400_r) -{ - int slot = ((offset>>8) & 0xf) + 4; +READ8_MEMBER(apple2gs_state::c400_r) +{ + int slot = ((offset>>8) & 0xf) + 4; slow_cycle(); @@ -2854,18 +2854,18 @@ READ8_MEMBER(apple2gs_state::c400_r) return read_int_rom(space, 0x3c400, offset); } - return read_slot_rom(space, 4, offset); + return read_slot_rom(space, 4, offset); } -WRITE8_MEMBER(apple2gs_state::c400_w) -{ - int slot = ((offset>>8) & 0xf) + 1; +WRITE8_MEMBER(apple2gs_state::c400_w) +{ + int slot = ((offset>>8) & 0xf) + 1; slow_cycle(); if ((m_slotromsel & (1 << slot))) { - write_slot_rom(space, 4, offset, data); + write_slot_rom(space, 4, offset, data); } } @@ -2898,12 +2898,12 @@ READ8_MEMBER(apple2gs_state::c800_int_r) update_slotrom_banks(); return m_rom[offset + 0x3c800]; } - + if (m_cnxx_slot == CNXX_INTROM) { return m_rom[offset + 0x3c800]; } - + return read_floatingbus(); } @@ -3283,10 +3283,10 @@ uint8_t apple2gs_state::read_floatingbus() READ8_MEMBER(apple2gs_state::ram0000_r) { slow_cycle(); return m_ram_ptr[offset]; } WRITE8_MEMBER(apple2gs_state::ram0000_w) { slow_cycle(); m_ram_ptr[offset] = data; } READ8_MEMBER(apple2gs_state::auxram0000_r) { slow_cycle(); return m_ram_ptr[offset+0x10000]; } -WRITE8_MEMBER(apple2gs_state::auxram0000_w) +WRITE8_MEMBER(apple2gs_state::auxram0000_w) { slow_cycle(); - m_ram_ptr[offset+0x10000] = data; + m_ram_ptr[offset+0x10000] = data; if ((offset >= 0x9e00) && (offset <= 0x9fff)) { @@ -3304,21 +3304,21 @@ WRITE8_MEMBER(apple2gs_state::b0ram0000_w) { m_ram_ptr[offset+0x20000] = data; } READ8_MEMBER( apple2gs_state::b0ram0200_r) { return m_ram_ptr[offset+0x20200]; } WRITE8_MEMBER(apple2gs_state::b0ram0200_w) { m_ram_ptr[offset+0x20200] = data; } READ8_MEMBER( apple2gs_state::b0ram0400_r) { return m_ram_ptr[offset+0x20400]; } -WRITE8_MEMBER(apple2gs_state::b0ram0400_w) -{ - m_ram_ptr[offset+0x20400] = data; - if (!(m_shadow & SHAD_TXTPG1)) +WRITE8_MEMBER(apple2gs_state::b0ram0400_w) +{ + m_ram_ptr[offset+0x20400] = data; + if (!(m_shadow & SHAD_TXTPG1)) { slow_cycle(); m_ram_ptr[offset+0x0400] = data; } } READ8_MEMBER( apple2gs_state::b0ram0800_r) { return m_ram_ptr[offset+0x20800]; } -WRITE8_MEMBER(apple2gs_state::b0ram0800_w) -{ - m_ram_ptr[offset+0x20800] = data; +WRITE8_MEMBER(apple2gs_state::b0ram0800_w) +{ + m_ram_ptr[offset+0x20800] = data; - if (offset < 0x400) // TODO: ROM 03 + if (offset < 0x400) // TODO: ROM 03 { if ((!(m_shadow & SHAD_TXTPG2)) && (m_is_rom3)) { @@ -3328,9 +3328,9 @@ WRITE8_MEMBER(apple2gs_state::b0ram0800_w) } } READ8_MEMBER( apple2gs_state::b0ram2000_r) { return m_ram_ptr[offset+0x22000]; } -WRITE8_MEMBER(apple2gs_state::b0ram2000_w) -{ - m_ram_ptr[offset+0x22000] = data; +WRITE8_MEMBER(apple2gs_state::b0ram2000_w) +{ + m_ram_ptr[offset+0x22000] = data; if (!(m_shadow & SHAD_HIRESPG1)) { slow_cycle(); @@ -3338,9 +3338,9 @@ WRITE8_MEMBER(apple2gs_state::b0ram2000_w) } } READ8_MEMBER( apple2gs_state::b0ram4000_r) { return m_ram_ptr[offset+0x24000]; } -WRITE8_MEMBER(apple2gs_state::b0ram4000_w) -{ - m_ram_ptr[offset+0x24000] = data; +WRITE8_MEMBER(apple2gs_state::b0ram4000_w) +{ + m_ram_ptr[offset+0x24000] = data; if (offset < 0x2000) { if (!(m_shadow & SHAD_HIRESPG2)) @@ -3356,9 +3356,9 @@ WRITE8_MEMBER(apple2gs_state::b1ram0000_w) { m_ram_ptr[offset+0x30000] = data; } READ8_MEMBER( apple2gs_state::b1ram0200_r) { return m_ram_ptr[offset+0x30200]; } WRITE8_MEMBER(apple2gs_state::b1ram0200_w) { m_ram_ptr[offset+0x30200] = data; } READ8_MEMBER( apple2gs_state::b1ram0400_r) { return m_ram_ptr[offset+0x30400]; } -WRITE8_MEMBER(apple2gs_state::b1ram0400_w) -{ - m_ram_ptr[offset+0x30400] = data; +WRITE8_MEMBER(apple2gs_state::b1ram0400_w) +{ + m_ram_ptr[offset+0x30400] = data; if (!(m_shadow & SHAD_TXTPG1)) { slow_cycle(); @@ -3366,9 +3366,9 @@ WRITE8_MEMBER(apple2gs_state::b1ram0400_w) } } READ8_MEMBER( apple2gs_state::b1ram0800_r) { return m_ram_ptr[offset+0x30800]; } -WRITE8_MEMBER(apple2gs_state::b1ram0800_w) -{ - m_ram_ptr[offset+0x30800] = data; +WRITE8_MEMBER(apple2gs_state::b1ram0800_w) +{ + m_ram_ptr[offset+0x30800] = data; if (offset < 0x400) { slow_cycle(); @@ -3376,18 +3376,18 @@ WRITE8_MEMBER(apple2gs_state::b1ram0800_w) } } READ8_MEMBER( apple2gs_state::b1ram2000_r) { return m_ram_ptr[offset+0x32000]; } -WRITE8_MEMBER(apple2gs_state::b1ram2000_w) +WRITE8_MEMBER(apple2gs_state::b1ram2000_w) { - m_ram_ptr[offset+0x32000] = data; + m_ram_ptr[offset+0x32000] = data; if ((!(m_shadow & SHAD_HIRESPG1) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) { auxram0000_w(space, offset+0x2000, data); } } READ8_MEMBER( apple2gs_state::b1ram4000_r) { return m_ram_ptr[offset+0x34000]; } -WRITE8_MEMBER(apple2gs_state::b1ram4000_w) -{ - m_ram_ptr[offset+0x34000] = data; +WRITE8_MEMBER(apple2gs_state::b1ram4000_w) +{ + m_ram_ptr[offset+0x34000] = data; if (offset < 0x2000) { if (!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) @@ -3404,38 +3404,38 @@ WRITE8_MEMBER(apple2gs_state::b1ram4000_w) } } -READ8_MEMBER(apple2gs_state::bank0_c000_r) -{ +READ8_MEMBER(apple2gs_state::bank0_c000_r) +{ if (m_ramrd) { return m_ram_ptr[offset + 0x3c000]; } - return m_ram_ptr[offset + 0x2c000]; + return m_ram_ptr[offset + 0x2c000]; } -WRITE8_MEMBER(apple2gs_state::bank0_c000_w) -{ +WRITE8_MEMBER(apple2gs_state::bank0_c000_w) +{ if (m_ramwrt) { m_ram_ptr[offset + 0x3c000] = data; return; } - m_ram_ptr[offset + 0x2c000] = data; + m_ram_ptr[offset + 0x2c000] = data; } READ8_MEMBER(apple2gs_state::bank1_0000_r) { return m_ram_ptr[offset + 0x30000]; } WRITE8_MEMBER(apple2gs_state::bank1_0000_w) { m_ram_ptr[offset + 0x30000] = data; } READ8_MEMBER(apple2gs_state::bank1_c000_r) { return m_ram_ptr[offset + 0x3c000]; } WRITE8_MEMBER(apple2gs_state::bank1_c000_w) { m_ram_ptr[offset + 0x3c000] = data; } -WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) -{ - m_ram_ptr[offset + 0x30000] = data; +WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) +{ + m_ram_ptr[offset + 0x30000] = data; switch (offset>>8) { - case 0x04: // text page 1 + case 0x04: // text page 1 case 0x05: case 0x06: case 0x07: @@ -3446,7 +3446,7 @@ WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) } break; - case 0x08: // text page 2 (only shadowable on ROM 03) + case 0x08: // text page 2 (only shadowable on ROM 03) case 0x09: case 0x0a: case 0x0b: @@ -3465,10 +3465,10 @@ WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) if ((!(m_shadow & SHAD_HIRESPG1) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) { slow_cycle(); - m_ram_ptr[offset + 0x10000] = data; + m_ram_ptr[offset + 0x10000] = data; } break; - + // hi-res page 2 case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 0x46: case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: @@ -3477,7 +3477,7 @@ WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) if ((!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) { slow_cycle(); - m_ram_ptr[offset + 0x10000] = data; + m_ram_ptr[offset + 0x10000] = data; } break; @@ -3485,7 +3485,7 @@ WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) if ((offset >= 0x6000) && (offset <= 0x9fff)) { if (!(m_shadow & SHAD_SUPERHIRES)) - { + { auxram0000_w(space, offset, data); } } @@ -3689,10 +3689,10 @@ void apple2gs_state::a2gs_es5503_map(address_map &map) } /*************************************************************************** - ADB microcontroller + KEYGLU emulation + ADB microcontroller + KEYGLU emulation - Huge thanks to Neil Parker's writeup on the ADB microcontroller! - http://www.llx.com/~nparker/a2/adb.html + Huge thanks to Neil Parker's writeup on the ADB microcontroller! + http://www.llx.com/~nparker/a2/adb.html ***************************************************************************/ READ8_MEMBER(apple2gs_state::adbmicro_p0_in) @@ -3789,9 +3789,9 @@ WRITE8_MEMBER(apple2gs_state::adbmicro_p3_out) { if (((data & 0x08) == 0x08) != m_adb_line) { -// m_adb_dtime = (int)(machine().time().as_ticks(XTAL(3'579'545)*2) - m_last_adb_time); -// printf("ADB change to %d (dtime %d)\n", (data>>3) & 1, m_adb_dtime); -// m_last_adb_time = machine().time().as_ticks(XTAL(3'579'545)*2); +// m_adb_dtime = (int)(machine().time().as_ticks(XTAL(3'579'545)*2) - m_last_adb_time); +// printf("ADB change to %d (dtime %d)\n", (data>>3) & 1, m_adb_dtime); +// m_last_adb_time = machine().time().as_ticks(XTAL(3'579'545)*2); m_adb_line = (data & 0x8) ? true : false; } } @@ -3952,7 +3952,7 @@ uint8_t apple2gs_state::keyglu_816_read(uint8_t offset) { m_glu_816_read_dstat = false; m_glu_regs[GLU_KG_STATUS] &= ~KGS_DATA_FULL; -// keyglu_regen_irqs(); +// keyglu_regen_irqs(); // printf("816 reads %02x from DATA\n", m_glu_regs[GLU_DATA]); } return m_glu_regs[GLU_DATA]; @@ -4527,7 +4527,7 @@ static void apple2_cards(device_slot_interface &device) device.option_add("ezcgi9938", A2BUS_EZCGI_9938); /* E-Z Color Graphics Interface (TMS9938) */ device.option_add("ezcgi9958", A2BUS_EZCGI_9958); /* E-Z Color Graphics Interface (TMS9958) */ // device.option_add("magicmusician", A2BUS_MAGICMUSICIAN); /* Magic Musician Card */ -// device.option_add("pcxport", A2BUS_PCXPORTER); /* Applied Engineering PC Transporter */ +// device.option_add("pcxport", A2BUS_PCXPORTER); /* Applied Engineering PC Transporter */ } MACHINE_CONFIG_START( apple2gs_state::apple2gs ) @@ -4936,7 +4936,7 @@ ROM_START(apple2gsr0p2) // 3/10/1986 Cortland prototype, boots as "Apple //'ing ROM_LOAD( "341-0132-d.e12", 0x000, 0x800, CRC(c506efb9) SHA1(8e14e85c645187504ec9d162b3ea614a0c421d32) ) ROM_END -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ +/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ COMP( 1989, apple2gs, 0, apple2, apple2gs, apple2gs, apple2gs_state, rom3_init, "Apple Computer", "Apple IIgs (ROM03)", MACHINE_SUPPORTS_SAVE ) COMP( 198?, apple2gsr3p, apple2gs, 0, apple2gs, apple2gs, apple2gs_state, rom3_init, "Apple Computer", "Apple IIgs (ROM03 prototype)", MACHINE_NOT_WORKING ) COMP( 1987, apple2gsr1, apple2gs, 0, apple2gsr1, apple2gs, apple2gs_state, rom1_init, "Apple Computer", "Apple IIgs (ROM01)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/cischeat.cpp b/src/mame/drivers/cischeat.cpp index ddbe81ffdba..00aba7bc985 100644 --- a/src/mame/drivers/cischeat.cpp +++ b/src/mame/drivers/cischeat.cpp @@ -1915,7 +1915,7 @@ GFXDECODE_END **************************************************************************/ // TODO: irq generation is unknown, as usual with Jaleco/NMK HW -// - irq 1 is comms related, presumably the bridge chip is capable of sending the irq signal at given times. +// - irq 1 is comms related, presumably the bridge chip is capable of sending the irq signal at given times. // Wild Pilot of course doesn't need it. // - irq 2/4 controls gameplay speed, currently unknown about the timing // - 2 updates palettes while 4 is vblank? @@ -1925,12 +1925,12 @@ GFXDECODE_END TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::bigrun_scanline) { int scanline = param; - + if(m_screen->frame_number() & 1) { if(scanline == 240) m_cpu1->set_input_line(1, HOLD_LINE); - + return; } diff --git a/src/mame/drivers/cms.cpp b/src/mame/drivers/cms.cpp index c57a4b50635..4d9090a0577 100644 --- a/src/mame/drivers/cms.cpp +++ b/src/mame/drivers/cms.cpp @@ -104,7 +104,7 @@ WRITE8_MEMBER(cms_state::map_select_w) m_map_select = (data & 0x03) << 2; logerror("map select %02x\n", data); //if (m_map_select == 0x00) - // m_bank1->set_entry(m_page_select); + // m_bank1->set_entry(m_page_select); //else m_bank1->set_entry(m_map_select); } diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index 0bbbc8dc8b5..b3ff0541096 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -10391,43 +10391,43 @@ ROM_END /* 05/13/92 MSTREET-6 - - There are quite a few variations of this board. The main differences seem to be the amount and size of roms around the 68k. - Some variations have an additional "patch" rom and palce or gal that patches various chunks of code over the main program roms. - This adds the usual "rainbow edition" style gameplay hacks, such as air fireballs, change character mid-game, etc. - The boards can be run without the patch rom by removing it and the pal/gal and linking pins 1-19, 2-18, 11-16 of the empty gal socket. - (There is also a jumper that can be soldered instead for the third connection.) - - Luckily one of my boards has an unprotected gal so I was able to decode the rom patching: - - patch rom program space - -------------------------------------- - 0x00000-0x07fff -> 0x000000-0x007fff - 0x08000-0x27fff -> 0x030000-0x04ffff - 0x28000-0x37fff -> 0x170000-0x17ffff - - Gfx: - There are six 8Mbit roms which match the official sf2ce set almost exactly (7 bytes diff in one rom). - There are also another two 2Mbit roms which contain very near identical data. - Not sure why the bootleg hardware needs this or how it should be represented in emulation. - There is also a 512Kbit rom that's purpose is unknown (possibly related to priority according to notes in other bootleg sets). - - Sound: - YM2151 is clone marked "KA51". + + There are quite a few variations of this board. The main differences seem to be the amount and size of roms around the 68k. + Some variations have an additional "patch" rom and palce or gal that patches various chunks of code over the main program roms. + This adds the usual "rainbow edition" style gameplay hacks, such as air fireballs, change character mid-game, etc. + The boards can be run without the patch rom by removing it and the pal/gal and linking pins 1-19, 2-18, 11-16 of the empty gal socket. + (There is also a jumper that can be soldered instead for the third connection.) + + Luckily one of my boards has an unprotected gal so I was able to decode the rom patching: + + patch rom program space + -------------------------------------- + 0x00000-0x07fff -> 0x000000-0x007fff + 0x08000-0x27fff -> 0x030000-0x04ffff + 0x28000-0x37fff -> 0x170000-0x17ffff + + Gfx: + There are six 8Mbit roms which match the official sf2ce set almost exactly (7 bytes diff in one rom). + There are also another two 2Mbit roms which contain very near identical data. + Not sure why the bootleg hardware needs this or how it should be represented in emulation. + There is also a 512Kbit rom that's purpose is unknown (possibly related to priority according to notes in other bootleg sets). + + Sound: + YM2151 is clone marked "KA51". YM3012 is clone marked "KA12". - MSM6295 is clone marked "TD735". - - Other: - All roms have nonsense markings such as KM418C256, KM416C256 etc. - Obviously they are not Samsung soj/tsop FPM DRAMs ;) - Main clock is 10MHz, rather than usual 12MHZ for champion edition. - Sets b and c: - Turbo mode on SW(C):1. - Press start to change character mid-game. (bug: screen goes dark when changing character, happens in attract mode as well). + MSM6295 is clone marked "TD735". + + Other: + All roms have nonsense markings such as KM418C256, KM416C256 etc. + Obviously they are not Samsung soj/tsop FPM DRAMs ;) + Main clock is 10MHz, rather than usual 12MHZ for champion edition. + Sets b and c: + Turbo mode on SW(C):1. + Press start to change character mid-game. (bug: screen goes dark when changing character, happens in attract mode as well). */ ROM_START( sf2cems6a ) /* 920313 USA (this set matches "sf2ceuab4" in FBA) */ - ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68k code */ + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68k code */ ROM_LOAD16_WORD_SWAP( "ms6.u196", 0x000000, 0x100000, CRC(596609d4) SHA1(4d876e6e44554eccbd0c5ea2d2d09e5024af0f9f) ) // == sf2m3: u196chp + u222chp (interleaved) ROM_LOAD16_WORD_SWAP( "ms6.u10", 0x100000, 0x80000, CRC(ed4186bd) SHA1(f3dfe91d8f4384275190b0d86488843c1161d86f) ) // == sf2ce: s92_21a.6f 1st half doubled, also == sf2dkot2: turboii.21 @@ -10450,25 +10450,25 @@ ROM_START( sf2cems6a ) /* 920313 USA (this set matches "sf2ceuab4" in FBA) */ ROM_CONTINUE( 0x400004, 0x20000 ) // 1st half == ms6.u19 0x00000-0x20000, 2nd half == ms6.u19 0x80000-0xa0000 ROMX_LOAD( "ms6.u29", 0x400002, 0x20000, CRC(e4eca601) SHA1(acee4988f12a037a3b50f3923892fdac65f35805), ROM_GROUPWORD | ROM_SKIP(6) ) // == sf2m8: yyc-8.9 + yyc-9.8 (interleaved) ROM_CONTINUE( 0x400006, 0x20000 ) // 1st half != ms6.u18 0x00000-0x20000 (4 bytes diff), 2nd half == ms6.u18 0x80000-0xa0000 - + ROM_REGION( 0x18000, "audiocpu", 0 ) /* z80 code */ ROM_LOAD( "ms6.u191", 0x00000, 0x08000, CRC(08f6b60e) SHA1(8258fcaca4ac419312531eec67079b97f471179c) ) // == sf2ce: s92_09.11a ROM_CONTINUE( 0x10000, 0x08000 ) ROM_REGION( 0x40000, "oki", 0 ) /* samples */ ROM_LOAD( "ms6.u210", 0x00000, 0x40000, CRC(6cfffb11) SHA1(995526183ffd35f92e9096500a3fe6237faaa2dd) ) // == sf2ce: s92_18.11c + s92_19.12c, also == sf2amf2: fun-u210.bin, sf2rules: voice.u210, sf2m8: b-16.6 - + ROM_REGION( 0x10000, "user1", 0 ) /* unknown, priority? */ ROM_LOAD( "ms6.u133", 0x00000, 0x10000, CRC(13ea1c44) SHA1(5b05fe4c3920e33d94fac5f59e09ff14b3e427fe) ) // == loads other bootleg sets ROM_END ROM_START( sf2cems6b ) /* 920322 USA */ - ROM_REGION( 0x40000, "patch", 0 ) /* patch rom */ + ROM_REGION( 0x40000, "patch", 0 ) /* patch rom */ ROM_LOAD16_WORD_SWAP( "ms6b.u0", 0x00000, 0x40000, CRC(b6f3724b) SHA1(aa8eea819fdaf205ca068067a4624715a8cf6c8c) ) - + ROM_REGION( 0x0200, "patchpld", 0 ) /* patch pld gal16v8 */ ROM_LOAD( "ms6b.44", 0x0000, 0x0117, CRC(8ceec769) SHA1(d646ed075182f3724c0c581065665b1c99ce180d) ) - + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68k code */ ROM_LOAD16_WORD_SWAP( "ms6b.u196", 0x000000, 0x100000, CRC(435153d5) SHA1(3f6f318a9b3def8d62ee576dbaaef623d55c1c64) ) ROM_LOAD16_WORD_SWAP( "ms6b.u10", 0x100000, 0x40000, CRC(c812b7b2) SHA1(23ed0e1bd8b2015b39ad5e452dff0e372df0d5c9) ) @@ -10501,22 +10501,22 @@ ROM_START( sf2cems6b ) /* 920322 USA */ ROM_REGION( 0x40000, "oki", 0 ) /* samples */ ROM_LOAD( "ms6.u210", 0x00000, 0x40000, CRC(6cfffb11) SHA1(995526183ffd35f92e9096500a3fe6237faaa2dd) ) - + ROM_REGION( 0x10000, "user1", 0 ) /* unknown, priority? */ ROM_LOAD( "ms6.u133", 0x00000, 0x10000, CRC(13ea1c44) SHA1(5b05fe4c3920e33d94fac5f59e09ff14b3e427fe) ) ROM_END ROM_START( sf2cems6c ) /* 920322 USA */ - ROM_REGION( 0x40000, "patch", 0 ) /* patch rom */ + ROM_REGION( 0x40000, "patch", 0 ) /* patch rom */ ROM_LOAD16_WORD_SWAP( "ms6c.u0", 0x00000, 0x40000, CRC(04088b61) SHA1(03c361a0c9c70c21ef53351d5f975b06f51ce2e0) ) - + ROM_REGION( 0x0200, "patchpld", 0 ) /* patch pld palce16v8, protected, using gal dump from sf2cems6b */ ROM_LOAD( "ms6b.44", 0x0000, 0x0117, CRC(8ceec769) SHA1(d646ed075182f3724c0c581065665b1c99ce180d) ) - + ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68k code */ ROM_LOAD16_WORD_SWAP( "ms6b.u196", 0x000000, 0x100000, CRC(435153d5) SHA1(3f6f318a9b3def8d62ee576dbaaef623d55c1c64) ) ROM_LOAD16_WORD_SWAP( "ms6b.u10", 0x100000, 0x40000, CRC(c812b7b2) SHA1(23ed0e1bd8b2015b39ad5e452dff0e372df0d5c9) ) - + ROM_COPY( "patch", 0x00000, 0x000000, 0x8000 ) ROM_COPY( "patch", 0x08000, 0x030000, 0x20000 ) ROM_COPY( "patch", 0x28000, 0x170000, 0x10000 ) @@ -10545,7 +10545,7 @@ ROM_START( sf2cems6c ) /* 920322 USA */ ROM_REGION( 0x40000, "oki", 0 ) /* samples */ ROM_LOAD( "ms6.u210", 0x00000, 0x40000, CRC(6cfffb11) SHA1(995526183ffd35f92e9096500a3fe6237faaa2dd) ) - + ROM_REGION( 0x10000, "user1", 0 ) /* unknown, priority? */ ROM_LOAD( "ms6.u133", 0x00000, 0x10000, CRC(13ea1c44) SHA1(5b05fe4c3920e33d94fac5f59e09ff14b3e427fe) ) ROM_END diff --git a/src/mame/drivers/decstation.cpp b/src/mame/drivers/decstation.cpp index b7596a3f4d0..43d4973902c 100644 --- a/src/mame/drivers/decstation.cpp +++ b/src/mame/drivers/decstation.cpp @@ -4,55 +4,55 @@ decstation.cpp: MIPS-based DECstation family - WANTED: all boot ROM dumps except 5000/133, all TURBOchannel card ROM dumps - - NOTE: after all the spew of failing tests (it really wants a VT102 terminal), - press 'q' at the MORE prompt and wait a few seconds for the PROM monitor to appear. - Type 'ls' for a list of commands (this is a very UNIX-flavored PROM monitor). - - Machine types: - DECstation 3100 (PMAX/KN01): - 16.67 MHz R2000 with FPU and MMU - 24 MiB max RAM - Serial: DEC "DZ" quad-UART (DC7085 gate array) - SCSI: DEC "SII" SCSI interface (DC7061 gate array) - Ethernet: AMD7990 "LANCE" controller - Monochrome or color video on-board - PMIN/KN01: - Cheaper PMAX, 12.5 MHz R2000, same as PMAX - - Personal DECstation 5000/xx (MAXine/KN02BA): - 20, 25, or 33 MHz R3000 or 100 MHz R4000 - 40 MiB max RAM - Serial: DEC "DZ" quad-UART for keyboard/mouse, SCC8530 for modem/printer - SCSI: NCR53C94 - Ethernet: AMD7990 "LANCE" controller - Audio: AMD AM79C30 - Color 1024x768 8bpp video on-board - 2 TURBOchannel slots - - DECstation 5000/1xx: (3MIN/KN02DA): - 20, 25, or 33 MHz R3000 or 100 MHz R4000 - 128 MiB max RAM - Serial: 2x SCC8530 - SCSI: NCR53C94 - Ethernet: AMD7990 "LANCE" controller - No on-board video - 3 TURBOchannel slots - - DECstation 5000/200: (3MAX/KN02): - 25 MHz R3000 - 480 MiB max RAM - Serial: DEC "DZ" quad-UART - SCSI: NCR53C94 - Ethernet: AMD7990 "LANCE" controllor - - DECstation 5000/240, 5000/261 (3MAX+/KN03) - 40 MHz R3400, or 120 MHz R4400. - 480 MiB max RAM - Serial: 2x SCC8530 - SCSI: NCR53C94 - Ethernet: AMD7990 "LANCE" controller + WANTED: all boot ROM dumps except 5000/133, all TURBOchannel card ROM dumps + + NOTE: after all the spew of failing tests (it really wants a VT102 terminal), + press 'q' at the MORE prompt and wait a few seconds for the PROM monitor to appear. + Type 'ls' for a list of commands (this is a very UNIX-flavored PROM monitor). + + Machine types: + DECstation 3100 (PMAX/KN01): + 16.67 MHz R2000 with FPU and MMU + 24 MiB max RAM + Serial: DEC "DZ" quad-UART (DC7085 gate array) + SCSI: DEC "SII" SCSI interface (DC7061 gate array) + Ethernet: AMD7990 "LANCE" controller + Monochrome or color video on-board + PMIN/KN01: + Cheaper PMAX, 12.5 MHz R2000, same as PMAX + + Personal DECstation 5000/xx (MAXine/KN02BA): + 20, 25, or 33 MHz R3000 or 100 MHz R4000 + 40 MiB max RAM + Serial: DEC "DZ" quad-UART for keyboard/mouse, SCC8530 for modem/printer + SCSI: NCR53C94 + Ethernet: AMD7990 "LANCE" controller + Audio: AMD AM79C30 + Color 1024x768 8bpp video on-board + 2 TURBOchannel slots + + DECstation 5000/1xx: (3MIN/KN02DA): + 20, 25, or 33 MHz R3000 or 100 MHz R4000 + 128 MiB max RAM + Serial: 2x SCC8530 + SCSI: NCR53C94 + Ethernet: AMD7990 "LANCE" controller + No on-board video + 3 TURBOchannel slots + + DECstation 5000/200: (3MAX/KN02): + 25 MHz R3000 + 480 MiB max RAM + Serial: DEC "DZ" quad-UART + SCSI: NCR53C94 + Ethernet: AMD7990 "LANCE" controllor + + DECstation 5000/240, 5000/261 (3MAX+/KN03) + 40 MHz R3400, or 120 MHz R4400. + 480 MiB max RAM + Serial: 2x SCC8530 + SCSI: NCR53C94 + Ethernet: AMD7990 "LANCE" controller ****************************************************************************/ @@ -95,7 +95,7 @@ protected: private: virtual void machine_start() override; virtual void machine_reset() override; - + required_device m_maincpu; required_device m_ioga; required_device m_rtc; @@ -145,20 +145,20 @@ READ32_MEMBER(decstation_state::cfb_r) switch (addr) { - case 0x3c03e0: return 1; // ROM width - case 0x3c03e4: return 4; // ROM stride - case 0x3c03e8: return 1; // ROM size in 8 KiB units - case 0x3c03ec: return 1; // card address space in 4 MiB units + case 0x3c03e0: return 1; // ROM width + case 0x3c03e4: return 4; // ROM stride + case 0x3c03e8: return 1; // ROM size in 8 KiB units + case 0x3c03ec: return 1; // card address space in 4 MiB units case 0x3c03f0: return 0x55555555; // TURBOchannel ID bytes case 0x3c03f4: return 0x00000000; case 0x3c03f8: return 0xaaaaaaaa; case 0x3c03fc: return 0xffffffff; - case 0x3c0470: return 0; // does card support parity? + case 0x3c0470: return 0; // does card support parity? } return 0xffffffff; } - + WRITE32_MEMBER(decstation_state::cfb_w) { logerror("cfb: %08x (mask %08x) @ %x\n", data, mem_mask, offset); @@ -182,7 +182,7 @@ void decstation_state::machine_reset() void decstation_state::decstation_map(address_map &map) { - map(0x00000000, 0x07ffffff).ram(); // full 128 MB + map(0x00000000, 0x07ffffff).ram(); // full 128 MB map(0x10000000, 0x103cffff).rw(FUNC(decstation_state::cfb_r), FUNC(decstation_state::cfb_w)); map(0x1c000000, 0x1c07ffff).m(m_ioga, FUNC(dec_ioga_device::map)); map(0x1c100000, 0x1c100003).rw(m_scc0, FUNC(z80scc_device::ca_r), FUNC(z80scc_device::ca_w)).umask32(0x0000ff00); diff --git a/src/mame/drivers/esq5505.cpp b/src/mame/drivers/esq5505.cpp index a78a52eecb2..e6980a3cd56 100644 --- a/src/mame/drivers/esq5505.cpp +++ b/src/mame/drivers/esq5505.cpp @@ -187,7 +187,7 @@ public: void vfxsd(machine_config &config); void eps(machine_config &config); void vfx32(machine_config &config); - + void init_eps(); void init_common(); void init_sq1(); diff --git a/src/mame/drivers/gimix.cpp b/src/mame/drivers/gimix.cpp index 3f5a33108b6..e6210099af1 100644 --- a/src/mame/drivers/gimix.cpp +++ b/src/mame/drivers/gimix.cpp @@ -99,7 +99,7 @@ public: {} void gimix(machine_config &config); - + DECLARE_INPUT_CHANGED_MEMBER(drive_size_cb); private: diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index df1666d6807..8eab017dd26 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -9407,7 +9407,7 @@ MACHINE_CONFIG_START(unkch_state::feverch) MCFG_I8255_IN_PORTA_CB(IOPORT("IN3")) MCFG_I8255_IN_PORTB_CB(IOPORT("IN4")) MCFG_I8255_IN_PORTC_CB(IOPORT("DSW1")) - + MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0) MCFG_I8255_IN_PORTA_CB(IOPORT("DSW4")) MCFG_I8255_IN_PORTB_CB(IOPORT("DSW2")) diff --git a/src/mame/drivers/gpworld.cpp b/src/mame/drivers/gpworld.cpp index f3d7b1a5ab7..3a659c2f8ec 100644 --- a/src/mame/drivers/gpworld.cpp +++ b/src/mame/drivers/gpworld.cpp @@ -67,7 +67,7 @@ public: m_palette(*this, "palette") { } void gpworld(machine_config &config); - + void init_gpworld(); private: diff --git a/src/mame/drivers/hp9845.cpp b/src/mame/drivers/hp9845.cpp index 2ae2eb70c9a..061ac9ecfbd 100644 --- a/src/mame/drivers/hp9845.cpp +++ b/src/mame/drivers/hp9845.cpp @@ -206,7 +206,7 @@ public: void hp9845a(machine_config &config); void hp9835a(machine_config &config); - + private: uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/drivers/inderp.cpp b/src/mame/drivers/inderp.cpp index 83384cd66ae..0df760d6446 100644 --- a/src/mame/drivers/inderp.cpp +++ b/src/mame/drivers/inderp.cpp @@ -234,9 +234,9 @@ ROM_END ROM_START(topaz) ROM_REGION(0x1800, "roms", 0) - ROM_LOAD("topaz0.bin", 0x0400, 0x0400, CRC(d047aee0) SHA1(b2bc2e9fb088006fd3b7eb080feaa1eac479af58)) - ROM_LOAD("topaz1.bin", 0x0800, 0x0400, CRC(72a423c2) SHA1(e3ba5d581739fc0871901f861a7692fd86e0f6aa)) - ROM_LOAD("topaz2.bin", 0x0c00, 0x0400, CRC(b8d2e7c6) SHA1(e19bec04fab15536fea51c4298c6a4cb3817630c)) + ROM_LOAD("topaz0.bin", 0x0400, 0x0400, CRC(d047aee0) SHA1(b2bc2e9fb088006fd3b7eb080feaa1eac479af58)) + ROM_LOAD("topaz1.bin", 0x0800, 0x0400, CRC(72a423c2) SHA1(e3ba5d581739fc0871901f861a7692fd86e0f6aa)) + ROM_LOAD("topaz2.bin", 0x0c00, 0x0400, CRC(b8d2e7c6) SHA1(e19bec04fab15536fea51c4298c6a4cb3817630c)) ROM_END GAME( 1979, centauri, 0, inderp, inderp, inderp_state, empty_init, ROT0, "Inder", "Centaur (Inder)", MACHINE_IS_SKELETON_MECHANICAL ) diff --git a/src/mame/drivers/ironhors.cpp b/src/mame/drivers/ironhors.cpp index 9ecef54cfbd..e3b06771e59 100644 --- a/src/mame/drivers/ironhors.cpp +++ b/src/mame/drivers/ironhors.cpp @@ -392,10 +392,10 @@ MACHINE_CONFIG_START(ironhors_state::ironhors) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) -// MCFG_SCREEN_REFRESH_RATE(61) -// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) -// MCFG_SCREEN_SIZE(32*8, 32*8) -// MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) +// MCFG_SCREEN_REFRESH_RATE(61) +// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) +// MCFG_SCREEN_SIZE(32*8, 32*8) +// MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1) MCFG_SCREEN_RAW_PARAMS(18432000/4,296,8,256-8,255,16,240) // pixel clock is a guesswork MCFG_SCREEN_UPDATE_DRIVER(ironhors_state, screen_update) diff --git a/src/mame/drivers/jpms80.cpp b/src/mame/drivers/jpms80.cpp index ab091f72d7e..2fd63643477 100644 --- a/src/mame/drivers/jpms80.cpp +++ b/src/mame/drivers/jpms80.cpp @@ -54,7 +54,7 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu") { } - + void jpms80(machine_config &config); void init_jpms80(); diff --git a/src/mame/drivers/jpmsys7.cpp b/src/mame/drivers/jpmsys7.cpp index b61a2563cd0..3e522cc34c1 100644 --- a/src/mame/drivers/jpmsys7.cpp +++ b/src/mame/drivers/jpmsys7.cpp @@ -34,8 +34,8 @@ public: { } void jpmsys7(machine_config &config); - -private: + +private: void jpmsys7_map(address_map &map); // devices diff --git a/src/mame/drivers/jupiter.cpp b/src/mame/drivers/jupiter.cpp index 827561807d5..c2ca16cb545 100644 --- a/src/mame/drivers/jupiter.cpp +++ b/src/mame/drivers/jupiter.cpp @@ -77,9 +77,9 @@ public: , m_p_ram(*this, "ram") , m_p_chargen(*this, "chargen") { } - + void jupiter3(machine_config &config); - + void init_jupiter3(); private: diff --git a/src/mame/drivers/konamigv.cpp b/src/mame/drivers/konamigv.cpp index 92c48c9296a..ca037f814a6 100644 --- a/src/mame/drivers/konamigv.cpp +++ b/src/mame/drivers/konamigv.cpp @@ -159,7 +159,7 @@ protected: void konamigv_map(address_map &map); virtual void machine_start() override; - + DECLARE_WRITE16_MEMBER(btc_trackball_w); DECLARE_READ16_MEMBER(tokimeki_serial_r); DECLARE_WRITE16_MEMBER(tokimeki_serial_w); diff --git a/src/mame/drivers/m6805evs.cpp b/src/mame/drivers/m6805evs.cpp index 96945bb8852..a7789452380 100644 --- a/src/mame/drivers/m6805evs.cpp +++ b/src/mame/drivers/m6805evs.cpp @@ -107,7 +107,7 @@ MACHINE_CONFIG_START(m6805evs_state::m6805evs) MCFG_DEVICE_ADD("maincpu", M6805, XTAL(4'000'000)) // Needs a 13-bits address bus wide version of the cpu -// MCFG_DEVICE_PROGRAM_MAP(mem_map) +// MCFG_DEVICE_PROGRAM_MAP(mem_map) MACHINE_CONFIG_END ROM_START(m6805evs) diff --git a/src/mame/drivers/mvme147.cpp b/src/mame/drivers/mvme147.cpp index 1f9a088992f..6894782c4b7 100644 --- a/src/mame/drivers/mvme147.cpp +++ b/src/mame/drivers/mvme147.cpp @@ -197,7 +197,7 @@ mvme147_state(const machine_config &mconfig, device_type type, const char *tag) , m_sccterm2(*this, "scc2") { } - + void mvme147(machine_config &config); private: diff --git a/src/mame/drivers/mz2500.cpp b/src/mame/drivers/mz2500.cpp index 7646bfaf9b0..51f2b561365 100644 --- a/src/mame/drivers/mz2500.cpp +++ b/src/mame/drivers/mz2500.cpp @@ -624,7 +624,7 @@ WRITE8_MEMBER(mz2500_state::mz2500_bank_data_w) { m_bank_val[m_bank_addr] = data & 0x3f; m_rambank[m_bank_addr]->set_bank(m_bank_val[m_bank_addr]); - + // if((data*2) >= 0x70) // printf("%s %02x\n",bank_name[m_bank_addr],m_bank_val[m_bank_addr]*2); @@ -837,7 +837,7 @@ READ8_MEMBER(mz2500_state::rmw_r) { // TODO: correct? if(m_cg_reg[0x0e] == 0x3) - return 0xff; + return 0xff; int plane; m_cg_latch[0] = m_cgram[offset+0x0000]; //B @@ -856,7 +856,7 @@ WRITE8_MEMBER(mz2500_state::rmw_w) { // TODO: correct? if(m_cg_reg[0x0e] == 0x3) - return; + return; if((m_cg_reg[0x05] & 0xc0) == 0x00) //replace { @@ -1818,7 +1818,7 @@ MACHINE_CONFIG_START(mz2500_state::mz2500) MCFG_ADDRESS_BANK("rambank5") MCFG_ADDRESS_BANK("rambank6") MCFG_ADDRESS_BANK("rambank7") - + MCFG_DEVICE_ADD("i8255_0", I8255, 0) MCFG_I8255_IN_PORTA_CB(READ8(*this, mz2500_state, mz2500_porta_r)) MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, mz2500_state, mz2500_porta_w)) diff --git a/src/mame/drivers/mzr8105.cpp b/src/mame/drivers/mzr8105.cpp index 49af5159f11..64c4d4256d6 100644 --- a/src/mame/drivers/mzr8105.cpp +++ b/src/mame/drivers/mzr8105.cpp @@ -179,7 +179,7 @@ mzr8105_state(const machine_config &mconfig, device_type type, const char *tag) } void mzr8105(machine_config &config); - + private: void mzr8105_mem(address_map &map); required_device m_maincpu; diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp index 5acf7d69597..f890c2b7d3c 100644 --- a/src/mame/drivers/namcos2.cpp +++ b/src/mame/drivers/namcos2.cpp @@ -44,9 +44,9 @@ known issues: Bubble Trouble (Golly Ghost II) - no artwork - Metal Hawk - - tilemap issues (ex : Result and stage select screen) - - ROZ wraparound isn't implemented + Metal Hawk + - tilemap issues (ex : Result and stage select screen) + - ROZ wraparound isn't implemented The Namco System II board is a 5 ( only 4 are emulated ) CPU system. The complete system consists of two boards: CPU + GRAPHICS. It contains a large diff --git a/src/mame/drivers/namcos23.cpp b/src/mame/drivers/namcos23.cpp index 1d30616c4f9..0b1516068e2 100644 --- a/src/mame/drivers/namcos23.cpp +++ b/src/mame/drivers/namcos23.cpp @@ -1444,7 +1444,7 @@ public: void timecrs2(machine_config &config); void init_s23(); - + render_t m_render; const uint16_t *m_tmlrom; const uint8_t *m_tmhrom; diff --git a/src/mame/drivers/ngen.cpp b/src/mame/drivers/ngen.cpp index a727a83f58b..ce19b83dc51 100644 --- a/src/mame/drivers/ngen.cpp +++ b/src/mame/drivers/ngen.cpp @@ -129,17 +129,17 @@ protected: DECLARE_WRITE8_MEMBER( dma_1_dack_w ) { } DECLARE_WRITE8_MEMBER( dma_2_dack_w ) { } DECLARE_WRITE8_MEMBER( dma_3_dack_w ) { popmessage("IOW3: data %02x",data); } - + MC6845_UPDATE_ROW(crtc_update_row); DECLARE_WRITE_LINE_MEMBER(timer_clk_out); - + DECLARE_WRITE_LINE_MEMBER(fdc_irq_w); void ngen386_io(address_map &map); void ngen386_mem(address_map &map); void ngen386i_mem(address_map &map); - + optional_device m_maincpu; optional_device m_i386cpu; required_device m_crtc; diff --git a/src/mame/drivers/pc88va.cpp b/src/mame/drivers/pc88va.cpp index d37be5b8d16..b709fca668c 100644 --- a/src/mame/drivers/pc88va.cpp +++ b/src/mame/drivers/pc88va.cpp @@ -19,7 +19,7 @@ hooked up by the current z80 core - PC-88VA stock version has two bogus opcodes. One is at 0xf0b15, another at 0xf0b31. Making a patch for the latter makes the system to jump into a "DIP-Switch" display. - bp f0b31,pc=0xf0b36,g + bp f0b31,pc=0xf0b36,g - unemulated upd71071 demand mode. - Fix floppy motor hook-up; @@ -540,10 +540,10 @@ WRITE8_MEMBER(pc88va_state::idp_command_w) void pc88va_state::tsp_sprite_enable(uint32_t spr_offset, uint16_t sw_bit) { uint32_t target_offset = (spr_offset & 0xffff)/2; -// address_space &space = m_maincpu->space(AS_PROGRAM); +// address_space &space = m_maincpu->space(AS_PROGRAM); -// space.write_word(spr_offset, space.read_word(spr_offset) & ~0x200); -// space.write_word(spr_offset, space.read_word(spr_offset) | (sw_bit & 0x200)); +// space.write_word(spr_offset, space.read_word(spr_offset) & ~0x200); +// space.write_word(spr_offset, space.read_word(spr_offset) | (sw_bit & 0x200)); m_tvram[target_offset] = (m_tvram[target_offset] & ~0x200) | (sw_bit & 0x200); } @@ -764,7 +764,7 @@ WRITE16_MEMBER(pc88va_state::bios_bank_w) ---- ---- ---- xxxx RBC0 (0xe0000 - 0xeffff ROM bank) */ COMBINE_DATA(&m_bank_reg); - + /* SMBC */ m_sysbank->set_bank((m_bank_reg & 0xf00) >> 8); @@ -1667,7 +1667,7 @@ MACHINE_CONFIG_START(pc88va_state::pc88va) MCFG_ADDRESS_MAP_BANK_DATA_WIDTH(16) MCFG_ADDRESS_MAP_BANK_ADDR_WIDTH(18+4) MCFG_ADDRESS_MAP_BANK_STRIDE(0x40000) - + SPEAKER(config, "mono").front_center(); MCFG_DEVICE_ADD("ym", YM2203, 3993600) //unknown clock / divider MCFG_SOUND_ROUTE(0, "mono", 0.25) diff --git a/src/mame/drivers/ps2sony.cpp b/src/mame/drivers/ps2sony.cpp index 0af9d1e9540..dd137f097fb 100644 --- a/src/mame/drivers/ps2sony.cpp +++ b/src/mame/drivers/ps2sony.cpp @@ -209,11 +209,11 @@ public: , m_screen(*this, "screen") , m_ram(*this, "ram") , m_iop_ram(*this, "iop_ram") - , m_sp_ram(*this, "sp_ram") - , m_vu0_imem(*this, "vu0imem") - , m_vu0_dmem(*this, "vu0dmem") - , m_vu1_imem(*this, "vu1imem") - , m_vu1_dmem(*this, "vu1dmem") + , m_sp_ram(*this, "sp_ram") + , m_vu0_imem(*this, "vu0imem") + , m_vu0_dmem(*this, "vu0dmem") + , m_vu1_imem(*this, "vu1imem") + , m_vu1_dmem(*this, "vu1dmem") , m_vblank_timer(nullptr) { } @@ -223,41 +223,41 @@ protected: virtual void machine_start() override; virtual void machine_reset() override; - uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(vblank); - DECLARE_READ32_MEMBER(ipu_r); - DECLARE_WRITE32_MEMBER(ipu_w); - DECLARE_READ64_MEMBER(vif0_fifo_r); - DECLARE_WRITE64_MEMBER(vif0_fifo_w); - DECLARE_READ64_MEMBER(gif_fifo_r); - DECLARE_WRITE64_MEMBER(gif_fifo_w); - DECLARE_READ64_MEMBER(ipu_fifo_r); - DECLARE_WRITE64_MEMBER(ipu_fifo_w); - DECLARE_WRITE8_MEMBER(debug_w); - DECLARE_READ32_MEMBER(unk_f430_r); - DECLARE_WRITE32_MEMBER(unk_f430_w); - DECLARE_READ32_MEMBER(unk_f440_r); - DECLARE_WRITE32_MEMBER(unk_f440_w); - DECLARE_READ32_MEMBER(unk_f520_r); - DECLARE_READ64_MEMBER(board_id_r); - - DECLARE_WRITE64_MEMBER(ee_iop_ram_w); - DECLARE_READ64_MEMBER(ee_iop_ram_r); - DECLARE_WRITE32_MEMBER(iop_debug_w); + DECLARE_READ32_MEMBER(ipu_r); + DECLARE_WRITE32_MEMBER(ipu_w); + DECLARE_READ64_MEMBER(vif0_fifo_r); + DECLARE_WRITE64_MEMBER(vif0_fifo_w); + DECLARE_READ64_MEMBER(gif_fifo_r); + DECLARE_WRITE64_MEMBER(gif_fifo_w); + DECLARE_READ64_MEMBER(ipu_fifo_r); + DECLARE_WRITE64_MEMBER(ipu_fifo_w); + DECLARE_WRITE8_MEMBER(debug_w); + DECLARE_READ32_MEMBER(unk_f430_r); + DECLARE_WRITE32_MEMBER(unk_f430_w); + DECLARE_READ32_MEMBER(unk_f440_r); + DECLARE_WRITE32_MEMBER(unk_f440_w); + DECLARE_READ32_MEMBER(unk_f520_r); + DECLARE_READ64_MEMBER(board_id_r); + + DECLARE_WRITE64_MEMBER(ee_iop_ram_w); + DECLARE_READ64_MEMBER(ee_iop_ram_r); + DECLARE_WRITE32_MEMBER(iop_debug_w); DECLARE_WRITE_LINE_MEMBER(iop_timer_irq); - void mem_map(address_map &map); - void iop_map(address_map &map); + void mem_map(address_map &map); + void iop_map(address_map &map); - required_device m_maincpu; - required_device m_iop; + required_device m_maincpu; + required_device m_iop; required_device_array m_timer; required_device m_dmac; required_device m_intc; - required_device m_sif; + required_device m_sif; required_device m_iop_timer; required_device m_iop_dma; required_device m_iop_intc; @@ -268,15 +268,15 @@ protected: required_device m_vu0; required_device m_vu1; required_device_array m_pad; - required_device m_mc; - required_device m_screen; - required_shared_ptr m_ram; - required_shared_ptr m_iop_ram; - required_shared_ptr m_sp_ram; - required_shared_ptr m_vu0_imem; - required_shared_ptr m_vu0_dmem; - required_shared_ptr m_vu1_imem; - required_shared_ptr m_vu1_dmem; + required_device m_mc; + required_device m_screen; + required_shared_ptr m_ram; + required_shared_ptr m_iop_ram; + required_shared_ptr m_sp_ram; + required_shared_ptr m_vu0_imem; + required_shared_ptr m_vu0_dmem; + required_shared_ptr m_vu1_imem; + required_shared_ptr m_vu1_dmem; uint32_t m_unk_f430_reg; uint32_t m_unk_f440_counter; @@ -551,7 +551,7 @@ void ps2sony_state::machine_reset() memset(m_ipu_out_fifo, 0, sizeof(uint64_t)*0x1000); m_ipu_out_fifo_index = 0; - m_vblank_timer->adjust(m_screen->time_until_pos(0), 1); + m_vblank_timer->adjust(m_screen->time_until_pos(0), 1); } TIMER_CALLBACK_MEMBER(ps2sony_state::vblank) @@ -576,7 +576,7 @@ TIMER_CALLBACK_MEMBER(ps2sony_state::vblank) WRITE8_MEMBER(ps2sony_state::debug_w) { - printf("%c", (char)data); + printf("%c", (char)data); } WRITE64_MEMBER(ps2sony_state::ee_iop_ram_w) @@ -679,56 +679,56 @@ uint32_t ps2sony_state::screen_update(screen_device &screen, bitmap_rgb32 &bitma void ps2sony_state::mem_map(address_map &map) { map(0x00000000, 0x01ffffff).mirror(0xe000000).ram().share(m_ram); // 32 MB RAM - map(0x10000000, 0x100007ff).rw(m_timer[0], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); - map(0x10000800, 0x10000fff).rw(m_timer[1], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); - map(0x10001000, 0x100017ff).rw(m_timer[2], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); - map(0x10001800, 0x10001fff).rw(m_timer[3], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); - map(0x10002000, 0x10002fff).rw(FUNC(ps2sony_state::ipu_r), FUNC(ps2sony_state::ipu_w)).umask64(0x00000000ffffffff); - map(0x10003000, 0x100030af).rw(m_gs, FUNC(ps2_gs_device::gif_r), FUNC(ps2_gs_device::gif_w)); - map(0x10004000, 0x1000400f).mirror(0xff0).rw(FUNC(ps2sony_state::vif0_fifo_r), FUNC(ps2sony_state::vif0_fifo_w)); - map(0x10005000, 0x1000500f).mirror(0xff0).rw(m_vu1, FUNC(sonyvu1_device::vif_r), FUNC(sonyvu1_device::vif_w)); - map(0x10006000, 0x1000600f).mirror(0xff0).rw(FUNC(ps2sony_state::gif_fifo_r), FUNC(ps2sony_state::gif_fifo_w)); - map(0x10007000, 0x1000701f).mirror(0xfe0).rw(FUNC(ps2sony_state::ipu_fifo_r), FUNC(ps2sony_state::ipu_fifo_w)); - map(0x10008000, 0x1000dfff).rw(m_dmac, FUNC(ps2_dmac_device::channel_r), FUNC(ps2_dmac_device::channel_w)).umask64(0x00000000ffffffff);; - map(0x1000e000, 0x1000efff).rw(m_dmac, FUNC(ps2_dmac_device::read), FUNC(ps2_dmac_device::write)).umask64(0x00000000ffffffff); - map(0x1000f000, 0x1000f017).rw(m_intc, FUNC(ps2_intc_device::read), FUNC(ps2_intc_device::write)).umask64(0x00000000ffffffff); - map(0x1000f130, 0x1000f137).nopr(); - map(0x1000f180, 0x1000f187).w(FUNC(ps2sony_state::debug_w)).umask64(0x00000000000000ff); - map(0x1000f200, 0x1000f24f).rw(m_sif, FUNC(ps2_sif_device::ee_r), FUNC(ps2_sif_device::ee_w)).umask64(0x00000000ffffffff); - map(0x1000f430, 0x1000f437).rw(FUNC(ps2sony_state::unk_f430_r), FUNC(ps2sony_state::unk_f430_w)).umask64(0x00000000ffffffff); // Unknown - map(0x1000f440, 0x1000f447).rw(FUNC(ps2sony_state::unk_f440_r), FUNC(ps2sony_state::unk_f440_w)).umask64(0x00000000ffffffff); // Unknown - map(0x1000f520, 0x1000f523).r(m_dmac, FUNC(ps2_dmac_device::disable_mask_r)).umask64(0x00000000ffffffff); - map(0x1000f590, 0x1000f593).w(m_dmac, FUNC(ps2_dmac_device::disable_mask_w)).umask64(0x00000000ffffffff); - map(0x11000000, 0x11000fff).mirror(0x3000).ram().share(m_vu0_imem); - map(0x11004000, 0x11004fff).mirror(0x3000).ram().share(m_vu0_dmem); - map(0x11008000, 0x1100bfff).ram().share(m_vu1_imem); - map(0x1100c000, 0x1100ffff).ram().share(m_vu1_dmem); - map(0x12000000, 0x120003ff).mirror(0xc00).rw(m_gs, FUNC(ps2_gs_device::priv_regs0_r), FUNC(ps2_gs_device::priv_regs0_w)); - map(0x12001000, 0x120013ff).mirror(0xc00).rw(m_gs, FUNC(ps2_gs_device::priv_regs1_r), FUNC(ps2_gs_device::priv_regs1_w)); - map(0x1c000000, 0x1c1fffff).rw(FUNC(ps2sony_state::ee_iop_ram_r), FUNC(ps2sony_state::ee_iop_ram_w)); // IOP has 2MB EDO RAM per Wikipedia, and writes go up to this point - map(0x1f803800, 0x1f803807).r(FUNC(ps2sony_state::board_id_r)); - map(0x1fc00000, 0x1fffffff).rom().region("bios", 0); - - map(0x70000000, 0x70003fff).ram().share(m_sp_ram); // 16KB Scratchpad RAM + map(0x10000000, 0x100007ff).rw(m_timer[0], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); + map(0x10000800, 0x10000fff).rw(m_timer[1], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); + map(0x10001000, 0x100017ff).rw(m_timer[2], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); + map(0x10001800, 0x10001fff).rw(m_timer[3], FUNC(ps2_timer_device::read), FUNC(ps2_timer_device::write)).umask64(0x00000000ffffffff); + map(0x10002000, 0x10002fff).rw(FUNC(ps2sony_state::ipu_r), FUNC(ps2sony_state::ipu_w)).umask64(0x00000000ffffffff); + map(0x10003000, 0x100030af).rw(m_gs, FUNC(ps2_gs_device::gif_r), FUNC(ps2_gs_device::gif_w)); + map(0x10004000, 0x1000400f).mirror(0xff0).rw(FUNC(ps2sony_state::vif0_fifo_r), FUNC(ps2sony_state::vif0_fifo_w)); + map(0x10005000, 0x1000500f).mirror(0xff0).rw(m_vu1, FUNC(sonyvu1_device::vif_r), FUNC(sonyvu1_device::vif_w)); + map(0x10006000, 0x1000600f).mirror(0xff0).rw(FUNC(ps2sony_state::gif_fifo_r), FUNC(ps2sony_state::gif_fifo_w)); + map(0x10007000, 0x1000701f).mirror(0xfe0).rw(FUNC(ps2sony_state::ipu_fifo_r), FUNC(ps2sony_state::ipu_fifo_w)); + map(0x10008000, 0x1000dfff).rw(m_dmac, FUNC(ps2_dmac_device::channel_r), FUNC(ps2_dmac_device::channel_w)).umask64(0x00000000ffffffff);; + map(0x1000e000, 0x1000efff).rw(m_dmac, FUNC(ps2_dmac_device::read), FUNC(ps2_dmac_device::write)).umask64(0x00000000ffffffff); + map(0x1000f000, 0x1000f017).rw(m_intc, FUNC(ps2_intc_device::read), FUNC(ps2_intc_device::write)).umask64(0x00000000ffffffff); + map(0x1000f130, 0x1000f137).nopr(); + map(0x1000f180, 0x1000f187).w(FUNC(ps2sony_state::debug_w)).umask64(0x00000000000000ff); + map(0x1000f200, 0x1000f24f).rw(m_sif, FUNC(ps2_sif_device::ee_r), FUNC(ps2_sif_device::ee_w)).umask64(0x00000000ffffffff); + map(0x1000f430, 0x1000f437).rw(FUNC(ps2sony_state::unk_f430_r), FUNC(ps2sony_state::unk_f430_w)).umask64(0x00000000ffffffff); // Unknown + map(0x1000f440, 0x1000f447).rw(FUNC(ps2sony_state::unk_f440_r), FUNC(ps2sony_state::unk_f440_w)).umask64(0x00000000ffffffff); // Unknown + map(0x1000f520, 0x1000f523).r(m_dmac, FUNC(ps2_dmac_device::disable_mask_r)).umask64(0x00000000ffffffff); + map(0x1000f590, 0x1000f593).w(m_dmac, FUNC(ps2_dmac_device::disable_mask_w)).umask64(0x00000000ffffffff); + map(0x11000000, 0x11000fff).mirror(0x3000).ram().share(m_vu0_imem); + map(0x11004000, 0x11004fff).mirror(0x3000).ram().share(m_vu0_dmem); + map(0x11008000, 0x1100bfff).ram().share(m_vu1_imem); + map(0x1100c000, 0x1100ffff).ram().share(m_vu1_dmem); + map(0x12000000, 0x120003ff).mirror(0xc00).rw(m_gs, FUNC(ps2_gs_device::priv_regs0_r), FUNC(ps2_gs_device::priv_regs0_w)); + map(0x12001000, 0x120013ff).mirror(0xc00).rw(m_gs, FUNC(ps2_gs_device::priv_regs1_r), FUNC(ps2_gs_device::priv_regs1_w)); + map(0x1c000000, 0x1c1fffff).rw(FUNC(ps2sony_state::ee_iop_ram_r), FUNC(ps2sony_state::ee_iop_ram_w)); // IOP has 2MB EDO RAM per Wikipedia, and writes go up to this point + map(0x1f803800, 0x1f803807).r(FUNC(ps2sony_state::board_id_r)); + map(0x1fc00000, 0x1fffffff).rom().region("bios", 0); + + map(0x70000000, 0x70003fff).ram().share(m_sp_ram); // 16KB Scratchpad RAM } void ps2sony_state::iop_map(address_map &map) { - map(0x00000000, 0x001fffff).ram().share(m_iop_ram); - map(0x1d000000, 0x1d00004f).rw(m_sif, FUNC(ps2_sif_device::iop_r), FUNC(ps2_sif_device::iop_w)); - map(0x1e000000, 0x1e003fff).nopr(); - map(0x1f402000, 0x1f40201f).rw(m_iop_cdvd, FUNC(iop_cdvd_device::read), FUNC(iop_cdvd_device::write)); - map(0x1f801070, 0x1f80107b).rw(m_iop_intc, FUNC(iop_intc_device::read), FUNC(iop_intc_device::write)); - map(0x1f801080, 0x1f8010f7).rw(m_iop_dma, FUNC(iop_dma_device::bank0_r), FUNC(iop_dma_device::bank0_w)); - map(0x1f801450, 0x1f801453).noprw(); - map(0x1f8014a0, 0x1f8014af).rw(m_iop_timer, FUNC(iop_timer_device::read), FUNC(iop_timer_device::write)); - map(0x1f801500, 0x1f801577).rw(m_iop_dma, FUNC(iop_dma_device::bank1_r), FUNC(iop_dma_device::bank1_w)); - map(0x1f801578, 0x1f80157b).noprw(); - map(0x1f802070, 0x1f802073).w(FUNC(ps2sony_state::iop_debug_w)).nopr(); - map(0x1f808200, 0x1f8082ff).rw(m_iop_sio2, FUNC(iop_sio2_device::read), FUNC(iop_sio2_device::write)); - map(0x1f900000, 0x1f9007ff).rw(m_iop_spu, FUNC(iop_spu_device::read), FUNC(iop_spu_device::write)); - map(0x1fc00000, 0x1fffffff).rom().region("bios", 0); - map(0x1ffe0130, 0x1ffe0133).nopw(); + map(0x00000000, 0x001fffff).ram().share(m_iop_ram); + map(0x1d000000, 0x1d00004f).rw(m_sif, FUNC(ps2_sif_device::iop_r), FUNC(ps2_sif_device::iop_w)); + map(0x1e000000, 0x1e003fff).nopr(); + map(0x1f402000, 0x1f40201f).rw(m_iop_cdvd, FUNC(iop_cdvd_device::read), FUNC(iop_cdvd_device::write)); + map(0x1f801070, 0x1f80107b).rw(m_iop_intc, FUNC(iop_intc_device::read), FUNC(iop_intc_device::write)); + map(0x1f801080, 0x1f8010f7).rw(m_iop_dma, FUNC(iop_dma_device::bank0_r), FUNC(iop_dma_device::bank0_w)); + map(0x1f801450, 0x1f801453).noprw(); + map(0x1f8014a0, 0x1f8014af).rw(m_iop_timer, FUNC(iop_timer_device::read), FUNC(iop_timer_device::write)); + map(0x1f801500, 0x1f801577).rw(m_iop_dma, FUNC(iop_dma_device::bank1_r), FUNC(iop_dma_device::bank1_w)); + map(0x1f801578, 0x1f80157b).noprw(); + map(0x1f802070, 0x1f802073).w(FUNC(ps2sony_state::iop_debug_w)).nopr(); + map(0x1f808200, 0x1f8082ff).rw(m_iop_sio2, FUNC(iop_sio2_device::read), FUNC(iop_sio2_device::write)); + map(0x1f900000, 0x1f9007ff).rw(m_iop_spu, FUNC(iop_spu_device::read), FUNC(iop_spu_device::write)); + map(0x1fc00000, 0x1fffffff).rom().region("bios", 0); + map(0x1ffe0130, 0x1ffe0133).nopw(); } static INPUT_PORTS_START( ps2sony ) diff --git a/src/mame/drivers/taitottl.cpp b/src/mame/drivers/taitottl.cpp index fdc42f64015..37fdc944bb8 100644 --- a/src/mame/drivers/taitottl.cpp +++ b/src/mame/drivers/taitottl.cpp @@ -100,7 +100,7 @@ private: // devices required_device m_maincpu; required_device m_video; - + // driver_device overrides virtual void machine_start() override; virtual void machine_reset() override; diff --git a/src/mame/drivers/tetrisp2.cpp b/src/mame/drivers/tetrisp2.cpp index d14aaccbdf6..9363b3af5aa 100644 --- a/src/mame/drivers/tetrisp2.cpp +++ b/src/mame/drivers/tetrisp2.cpp @@ -1903,7 +1903,7 @@ MACHINE_CONFIG_START(stepstag_state::stepstag) MCFG_SCREEN_SIZE(0x160, 0xf0) MCFG_SCREEN_VISIBLE_AREA(0, 0x160-1, 0, 0xf0-1) MCFG_SCREEN_UPDATE_DRIVER(stepstag_state, screen_update_stepstag_left) -// MCFG_SCREEN_PALETTE("lpalette") +// MCFG_SCREEN_PALETTE("lpalette") MCFG_SCREEN_ADD("mscreen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -1911,7 +1911,7 @@ MACHINE_CONFIG_START(stepstag_state::stepstag) MCFG_SCREEN_SIZE(0x160, 0xf0) MCFG_SCREEN_VISIBLE_AREA(0, 0x160-1, 0, 0xf0-1) MCFG_SCREEN_UPDATE_DRIVER(stepstag_state, screen_update_stepstag_mid) -// MCFG_SCREEN_PALETTE("mpalette") +// MCFG_SCREEN_PALETTE("mpalette") MCFG_SCREEN_ADD("rscreen", RASTER) MCFG_SCREEN_REFRESH_RATE(30) @@ -2664,7 +2664,7 @@ ROM_START( vjdash ) ROM_FILL( 6, 1, 0x01 ) ROM_FILL( 0x100, 1, 0x60 ) ROM_FILL( 0x101, 1, 0xfe ) - + ROM_REGION( 0x0c00000, "sprites_left", ROMREGION_ERASE ) // left screen sprites ROM_LOAD( "vjdash-01", 0x000000, 0x400000, NO_DUMP ) ROM_LOAD( "vjdash-02", 0x400000, 0x400000, NO_DUMP ) @@ -2770,7 +2770,7 @@ ROM_START( step3 ) ROM_FILL( 6, 1, 0x01 ) ROM_FILL( 0x100, 1, 0x60 ) ROM_FILL( 0x101, 1, 0xfe ) - + ROM_REGION( 0x100000, "sub", 0 ) // 68000 ROM_LOAD16_BYTE( "vj98348_step3_11_v1.1", 0x00000, 0x80000, CRC(9c36aef5) SHA1(bbac48c2c7949a6f8a6ec83515e94a343c88d1b6) ) ROM_LOAD16_BYTE( "vj98348_step3_14_v1.1", 0x00001, 0x80000, CRC(b86be557) SHA1(49dbd6ef1c50adcf3386d5423da8ae7685649c46) ) diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h index a2d6d7bd3a5..20ea3c93015 100644 --- a/src/mame/includes/88games.h +++ b/src/mame/includes/88games.h @@ -68,7 +68,7 @@ private: K052109_CB_MEMBER(tile_callback); K051960_CB_MEMBER(sprite_callback); DECLARE_WRITE8_MEMBER(banking_callback); - + void main_map(address_map &map); void sound_map(address_map &map); }; diff --git a/src/mame/includes/ddragon3.h b/src/mame/includes/ddragon3.h index 9a1deaf771e..cb07767640b 100644 --- a/src/mame/includes/ddragon3.h +++ b/src/mame/includes/ddragon3.h @@ -46,7 +46,7 @@ protected: required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; - + /* misc */ uint8_t m_pri; int vblank_level; @@ -61,7 +61,7 @@ protected: uint16_t m_fg_scrollx; uint16_t m_fg_scrolly; uint16_t m_bg_tilebase; - + uint16_t m_bg0_dx; uint16_t m_bg1_dx[2]; uint16_t m_sprite_xoff; @@ -83,7 +83,7 @@ private: required_shared_ptr m_fg_videoram; // required_shared_ptr m_spriteram; required_device m_spriteram; - + /* devices */ required_device m_audiocpu; required_device m_oki; diff --git a/src/mame/includes/deadang.h b/src/mame/includes/deadang.h index d48166d1b89..5b38e95e279 100644 --- a/src/mame/includes/deadang.h +++ b/src/mame/includes/deadang.h @@ -57,7 +57,7 @@ protected: tilemap_t *m_pf2_layer; tilemap_t *m_pf1_layer; tilemap_t *m_text_layer; - + DECLARE_WRITE16_MEMBER(text_w); DECLARE_WRITE16_MEMBER(bank_w); diff --git a/src/mame/includes/deco32.h b/src/mame/includes/deco32.h index 1e6ecd925cd..745a0b478de 100644 --- a/src/mame/includes/deco32.h +++ b/src/mame/includes/deco32.h @@ -94,7 +94,7 @@ protected: std::unique_ptr m_spriteram16_buffered[2]; // all but dragngun std::unique_ptr m_pf_rowscroll[4]; // common -private: +private: required_device m_maincpu; optional_device m_audiocpu; @@ -111,7 +111,7 @@ public: { } void captaven(machine_config &config); - + void init_captaven(); private: diff --git a/src/mame/includes/dietgo.h b/src/mame/includes/dietgo.h index 6189e28b068..d27dd420bb0 100644 --- a/src/mame/includes/dietgo.h +++ b/src/mame/includes/dietgo.h @@ -31,7 +31,7 @@ public: { } void dietgo(machine_config &config); - + void init_dietgo(); private: diff --git a/src/mame/includes/dynax.h b/src/mame/includes/dynax.h index d6940b7c3ad..2a883ca09c9 100644 --- a/src/mame/includes/dynax.h +++ b/src/mame/includes/dynax.h @@ -107,7 +107,7 @@ protected: DECLARE_WRITE8_MEMBER(dynax_blit_romregion_w); DECLARE_WRITE8_MEMBER(dynax_extra_scrollx_w); DECLARE_WRITE8_MEMBER(dynax_extra_scrolly_w); - + void hanamai_copylayer(bitmap_ind16 &bitmap, const rectangle &cliprect, int i ); DECLARE_MACHINE_START(dynax); diff --git a/src/mame/includes/exidy.h b/src/mame/includes/exidy.h index a1b16819dd3..91be7edd4cc 100644 --- a/src/mame/includes/exidy.h +++ b/src/mame/includes/exidy.h @@ -51,7 +51,7 @@ public: m_sprite_enable(*this, "sprite_enable"), m_color_latch(*this, "color_latch"), m_characterram(*this, "characterram") { } - + void base(machine_config &config); void mtrap(machine_config &config); void venture(machine_config &config); diff --git a/src/mame/includes/fitfight.h b/src/mame/includes/fitfight.h index 87414669048..bc5d61da401 100644 --- a/src/mame/includes/fitfight.h +++ b/src/mame/includes/fitfight.h @@ -30,7 +30,7 @@ public: void bbprot(machine_config &config); void fitfight(machine_config &config); - + void init_hotmindff(); void init_fitfight(); void init_histryma(); diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h index b4fbc1a74a0..b9484adf493 100644 --- a/src/mame/includes/gottlieb.h +++ b/src/mame/includes/gottlieb.h @@ -67,7 +67,7 @@ public: void init_stooges(); void init_qbert(); void init_qbertqub(); - + DECLARE_CUSTOM_INPUT_MEMBER(analog_delta_r); DECLARE_CUSTOM_INPUT_MEMBER(stooges_joystick_r); diff --git a/src/mame/includes/mz2500.h b/src/mame/includes/mz2500.h index 743214dbc9c..04f707b33ef 100644 --- a/src/mame/includes/mz2500.h +++ b/src/mame/includes/mz2500.h @@ -205,7 +205,7 @@ private: void mz2500_reconfigure_screen(); uint8_t pal_256_param(int index, int param); void reset_banks(uint8_t type); - + void mz2500_io(address_map &map); void mz2500_map(address_map &map); void mz2500_bank_window_map(address_map &map); diff --git a/src/mame/includes/pc8801.h b/src/mame/includes/pc8801.h index a39b90b4d90..e788cb976a1 100644 --- a/src/mame/includes/pc8801.h +++ b/src/mame/includes/pc8801.h @@ -3,7 +3,7 @@ /******************************************************************************************** PC-8801 (c) 1981 NEC - + ********************************************************************************************/ #pragma once diff --git a/src/mame/includes/pc88va.h b/src/mame/includes/pc88va.h index e45c864202d..5e88ebcd74d 100644 --- a/src/mame/includes/pc88va.h +++ b/src/mame/includes/pc88va.h @@ -3,7 +3,7 @@ /******************************************************************************************** PC-88VA (c) 1987 NEC - + ********************************************************************************************/ #pragma once @@ -61,7 +61,7 @@ public: m_tvram(*this, "tvram"), m_gvram(*this, "gvram"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette") { } void pc88va(machine_config &config); diff --git a/src/mame/includes/segaxbd.h b/src/mame/includes/segaxbd.h index 915a0848bad..1467ef92cb6 100644 --- a/src/mame/includes/segaxbd.h +++ b/src/mame/includes/segaxbd.h @@ -63,7 +63,7 @@ protected: DECLARE_READ16_MEMBER(adc_r); DECLARE_WRITE16_MEMBER(adc_w); DECLARE_WRITE16_MEMBER(iocontrol_w); - + // video updates uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/tetrisp2.h b/src/mame/includes/tetrisp2.h index 1a02f6b5704..03ee0bf053a 100644 --- a/src/mame/includes/tetrisp2.h +++ b/src/mame/includes/tetrisp2.h @@ -214,7 +214,7 @@ private: uint32_t screen_update_stepstag_mid(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_stepstag_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_stepstag_main(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -// inline int mypal(int x); +// inline int mypal(int x); void stepstag_map(address_map &map); void stepstag_sub_map(address_map &map); diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h index b9822f27105..a687e9da518 100644 --- a/src/mame/includes/toaplan2.h +++ b/src/mame/includes/toaplan2.h @@ -193,7 +193,7 @@ private: DECLARE_WRITE8_MEMBER(pwrkick_coin_lockout_w); DECLARE_WRITE_LINE_MEMBER(toaplan2_reset); - + void batrider_68k_mem(address_map &map); void batrider_dma_mem(address_map &map); diff --git a/src/mame/includes/tubep.h b/src/mame/includes/tubep.h index e96866ee2e4..d0164c3fffc 100644 --- a/src/mame/includes/tubep.h +++ b/src/mame/includes/tubep.h @@ -127,7 +127,7 @@ private: void tubep_second_map(address_map &map); void tubep_second_portmap(address_map &map); void tubep_sound_map(address_map &map); - void tubep_sound_portmap(address_map &map); - + void tubep_sound_portmap(address_map &map); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; }; diff --git a/src/mame/includes/xerox820.h b/src/mame/includes/xerox820.h index 3cbb101bf88..1af826313da 100644 --- a/src/mame/includes/xerox820.h +++ b/src/mame/includes/xerox820.h @@ -68,7 +68,7 @@ public: m_8n5(0), m_400_460(0) { } - + void mk83(machine_config &config); void xerox820(machine_config &config); diff --git a/src/mame/layout/intlc44.lay b/src/mame/layout/intlc44.lay index 55502dafa78..a294da1dde9 100644 --- a/src/mame/layout/intlc44.lay +++ b/src/mame/layout/intlc44.lay @@ -2,7 +2,7 @@ diff --git a/src/mame/layout/vgmplay.lay b/src/mame/layout/vgmplay.lay index 7123bd6b2af..81a719488a3 100644 --- a/src/mame/layout/vgmplay.lay +++ b/src/mame/layout/vgmplay.lay @@ -120,7 +120,7 @@ - + @@ -150,7 +150,7 @@ - + diff --git a/src/mame/machine/cbm_snqk.h b/src/mame/machine/cbm_snqk.h index 25fbcab989b..5d19d453df2 100644 --- a/src/mame/machine/cbm_snqk.h +++ b/src/mame/machine/cbm_snqk.h @@ -6,16 +6,23 @@ ***********************************************/ -#ifndef __CBM_SNQK_H__ -#define __CBM_SNQK_H__ +#ifndef MAME_MACHINE_CBM_SNQK_H +#define MAME_MACHINE_CBM_SNQK_H + +#pragma once #include "imagedev/snapquik.h" #define CBM_QUICKLOAD_DELAY_SECONDS 3 -image_init_result general_cbm_loadsnap( device_image_interface &image, const char *file_type, int snapshot_size, - address_space &space, offs_t offset, void (*cbm_sethiaddress)(address_space &space, uint16_t hiaddress) ); +image_init_result general_cbm_loadsnap( + device_image_interface &image, + const char *file_type, + int snapshot_size, + address_space &space, + offs_t offset, + void (*cbm_sethiaddress)(address_space &space, uint16_t hiaddress)); -void cbm_quick_sethiaddress( address_space &space, uint16_t hiaddress ); +void cbm_quick_sethiaddress(address_space &space, uint16_t hiaddress); -#endif /* __CBM_SNQK_H__ */ +#endif // MAME_MACHINE_CBM_SNQK_H diff --git a/src/mame/machine/cedar_magnet_board.cpp b/src/mame/machine/cedar_magnet_board.cpp index 700dbf8d193..8eeffb690dc 100644 --- a/src/mame/machine/cedar_magnet_board.cpp +++ b/src/mame/machine/cedar_magnet_board.cpp @@ -86,4 +86,4 @@ void cedar_magnet_board_interface::interface_pre_start() m_halt_clear_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::halt_clear_callback), this)); m_reset_assert_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::reset_assert_callback), this)); m_reset_clear_timer = device().machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cedar_magnet_board_interface::reset_clear_callback), this)); -} \ No newline at end of file +} diff --git a/src/mame/machine/coleco.h b/src/mame/machine/coleco.h index b6022b164c9..41b71564383 100644 --- a/src/mame/machine/coleco.h +++ b/src/mame/machine/coleco.h @@ -1,10 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Mike Balfour, Ben Bruscella, Sean Young -#pragma once +#ifndef MAME_MACHINE_COLECO_H +#define MAME_MACHINE_COLECO_H -#ifndef __COLECO_CONTROLLERS__ -#define __COLECO_CONTROLLERS__ +#pragma once INPUT_PORTS_EXTERN( coleco ); -#endif +#endif // MAME_MACHINE_COLECO_H diff --git a/src/mame/machine/cuda.h b/src/mame/machine/cuda.h index 99f786908b2..158784a1198 100644 --- a/src/mame/machine/cuda.h +++ b/src/mame/machine/cuda.h @@ -1,9 +1,9 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -#pragma once +#ifndef MAME_MACHINE_CUDA_H +#define MAME_MACHINE_CUDA_H -#ifndef __CUDA_H__ -#define __CUDA_H__ +#pragma once //************************************************************************** @@ -138,4 +138,4 @@ private: // device type definition DECLARE_DEVICE_TYPE(CUDA, cuda_device) -#endif +#endif // MAME_MACHINE_CUDA_H diff --git a/src/mame/machine/decioga.cpp b/src/mame/machine/decioga.cpp index a65338f7fcd..b870e728bc1 100644 --- a/src/mame/machine/decioga.cpp +++ b/src/mame/machine/decioga.cpp @@ -7,6 +7,7 @@ * a multi-channel DMA engine. */ +#include "emu.h" #include "decioga.h" DEFINE_DEVICE_TYPE(DECSTATION_IOGA, dec_ioga_device, "decioga", "DECstation I/O Gate Array") @@ -56,14 +57,14 @@ WRITE32_MEMBER(dec_ioga_device::csr_w) READ32_MEMBER(dec_ioga_device::intr_r) { uint32_t rv = m_intr; - m_intr &= ~0x20; // 5000/133 boot ROM tests that reading clears this bit + m_intr &= ~0x20; // 5000/133 boot ROM tests that reading clears this bit //printf("m_intr = %08x\n", m_intr); return rv; } WRITE32_MEMBER(dec_ioga_device::intr_w) { - m_intr &= ~data; // clear bits on write + m_intr &= ~data; // clear bits on write } READ32_MEMBER(dec_ioga_device::imsk_r) @@ -80,6 +81,6 @@ WRITE_LINE_MEMBER(dec_ioga_device::rtc_irq_w) { if (state == ASSERT_LINE) { - m_intr |= 0x20; // tested by 5000/133 boot ROM circa BFC027C8 + m_intr |= 0x20; // tested by 5000/133 boot ROM circa BFC027C8 } -} \ No newline at end of file +} diff --git a/src/mame/machine/decioga.h b/src/mame/machine/decioga.h index c014f5dd440..5e446f9ba2a 100644 --- a/src/mame/machine/decioga.h +++ b/src/mame/machine/decioga.h @@ -6,23 +6,16 @@ * * */ - #ifndef MAME_MACHINE_DECIOGA_H #define MAME_MACHINE_DECIOGA_H #pragma once -#include "emu.h" class dec_ioga_device : public device_t { public: - dec_ioga_device(const machine_config &mconfig, const char *tag, device_t *owner) - : dec_ioga_device(mconfig, tag, owner, (uint32_t)0) - { - } - - dec_ioga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + dec_ioga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); void map(address_map &map); @@ -30,8 +23,8 @@ public: DECLARE_WRITE_LINE_MEMBER(rtc_irq_w); protected: - virtual void device_start() override; - virtual void device_reset() override; + virtual void device_start() override; + virtual void device_reset() override; DECLARE_READ32_MEMBER(csr_r); DECLARE_WRITE32_MEMBER(csr_w); @@ -45,4 +38,4 @@ private: DECLARE_DEVICE_TYPE(DECSTATION_IOGA, dec_ioga_device) -#endif // MAME_MACHINE_DECIOGA_H \ No newline at end of file +#endif // MAME_MACHINE_DECIOGA_H diff --git a/src/mame/machine/msx_switched.h b/src/mame/machine/msx_switched.h index 9db37baec61..7db1874d1af 100644 --- a/src/mame/machine/msx_switched.h +++ b/src/mame/machine/msx_switched.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Wilbert Pol -#ifndef __MSX_SWITCHED_H -#define __MSX_SWITCHED_H +#ifndef MAME_MACHINE_MSX_SWITCHED_H +#define MAME_MACHINE_MSX_SWITCHED_H + +#pragma once class msx_switched_interface @@ -11,4 +13,4 @@ public: virtual DECLARE_WRITE8_MEMBER(switched_write) = 0; }; -#endif +#endif // MAME_MACHINE_MSX_SWITCHED_H diff --git a/src/mame/machine/namcoic.cpp b/src/mame/machine/namcoic.cpp index 038b34d7d7d..bfb3ea1e192 100644 --- a/src/mame/machine/namcoic.cpp +++ b/src/mame/machine/namcoic.cpp @@ -885,7 +885,7 @@ void namcos2_shared_state::c169_roz_unpack_params(const uint16_t *source, roz_pa void namcos2_shared_state::c169_roz_draw_helper(screen_device &screen, bitmap_ind16 &bitmap, tilemap_t &tmap, const rectangle &clip, const roz_parameters ¶ms) { if (m_gametype != NAMCOFL_SPEED_RACER && m_gametype != NAMCOFL_FINAL_LAP_R) -// if (m_gametype != NAMCOFL_FINAL_LAP_R) // Fix speedrcr some title animations, but broke at road scene +// if (m_gametype != NAMCOFL_FINAL_LAP_R) // Fix speedrcr some title animations, but broke at road scene { uint32_t size_mask = params.size - 1; bitmap_ind16 &srcbitmap = tmap.pixmap(); diff --git a/src/mame/machine/spec_snqk.h b/src/mame/machine/spec_snqk.h index ebf829e4f91..be6bb6e080d 100644 --- a/src/mame/machine/spec_snqk.h +++ b/src/mame/machine/spec_snqk.h @@ -6,8 +6,10 @@ * ****************************************************************************/ -#ifndef __SPEC_SNQK_H__ -#define __SPEC_SNQK_H__ +#ifndef MAME_MACHINE_SPEC_SNQK_H +#define MAME_MACHINE_SPEC_SNQK_H + +#pragma once #include "imagedev/snapquik.h" @@ -162,4 +164,4 @@ enum SPECTRUM_Z80_SNAPSHOT_TYPE { #define RAW_HDR 9 #define RAW_SIZE (RAW_HDR + 3*SPECTRUM_BANK) -#endif /* __SPEC_SNQK_H__ */ +#endif // MAME_MACHINE_SPEC_SNQK_H diff --git a/src/mame/machine/subsino.h b/src/mame/machine/subsino.h index 8b68bd1902a..2f4b227c4ef 100644 --- a/src/mame/machine/subsino.h +++ b/src/mame/machine/subsino.h @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Luca Elia, David Haywood, Angelo Salese, Roberto Fresca -#ifndef __MACHINE_SUBSINO__ -#define __MACHINE_SUBSINO__ +#ifndef MAME_MACHINE_SUBSINO_H +#define MAME_MACHINE_SUBSINO_H + +#pragma once extern const uint8_t crsbingo_xors[8]; @@ -16,4 +18,4 @@ void victor21_bitswaps(uint8_t *decrypt, int i); void subsino_decrypt(running_machine& machine, void (*bitswaps)(uint8_t *decrypt, int i), const uint8_t *xors, int size); -#endif +#endif // MAME_MACHINE_SUBSINO_H diff --git a/src/mame/machine/trs80.cpp b/src/mame/machine/trs80.cpp index 7e591af3052..50134a236e7 100644 --- a/src/mame/machine/trs80.cpp +++ b/src/mame/machine/trs80.cpp @@ -224,13 +224,13 @@ INTERRUPT_GEN_MEMBER(trs80_state::rtc_interrupt) // While we're here, let's countdown the motor timeout too. // Let's not... LDOS often freezes -// if (m_timeout) -// { -// m_timeout--; -// if (m_timeout == 0) -// if (m_floppy) -// m_floppy->mon_w(1); // motor off -// } +// if (m_timeout) +// { +// m_timeout--; +// if (m_timeout == 0) +// if (m_floppy) +// m_floppy->mon_w(1); // motor off +// } } diff --git a/src/mame/machine/x68k_hdc.h b/src/mame/machine/x68k_hdc.h index 051942566f5..2c499d7e4c8 100644 --- a/src/mame/machine/x68k_hdc.h +++ b/src/mame/machine/x68k_hdc.h @@ -84,7 +84,7 @@ class x68k_hdc_image_device : public device_t, }; enum sasi_status : u8 - { + { SASI_STATUS_MSG = 1 << 4, // MSG SASI_STATUS_CD = 1 << 3, // C/D (Command/Data) SASI_STATUS_IO = 1 << 2, // I/O diff --git a/src/mame/video/amigaaga.h b/src/mame/video/amigaaga.h index 3d99cc47a21..e45baac243f 100644 --- a/src/mame/video/amigaaga.h +++ b/src/mame/video/amigaaga.h @@ -1,9 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Ernesto Corvi, Mariusz Wojcieszek +#ifndef MAME_VIDEO_AMIGAAGA_H +#define MAME_VIDEO_AMIGAAGA_H -#ifndef __AMIGAAGA_H__ -#define __AMIGAAGA_H__ +#pragma once void amiga_aga_palette_write(running_machine &machine, int color_reg, uint16_t data); -#endif /* __AMIGA_H__ */ +#endif // MAME_VIDEO_AMIGAAGA_H diff --git a/src/mame/video/apple2.cpp b/src/mame/video/apple2.cpp index 52e6886463f..907eaf35b21 100644 --- a/src/mame/video/apple2.cpp +++ b/src/mame/video/apple2.cpp @@ -106,7 +106,7 @@ void a2_video_device::device_start() save_item(NAME(m_altcharset)); save_item(NAME(m_an2)); save_item(NAME(m_80store)); - save_item(NAME(m_monohgr)); + save_item(NAME(m_monohgr)); save_item(NAME(m_GSfg)); save_item(NAME(m_GSbg)); save_item(NAME(m_GSborder)); diff --git a/src/mame/video/argus.cpp b/src/mame/video/argus.cpp index f8077e64f7b..deded6f1c51 100644 --- a/src/mame/video/argus.cpp +++ b/src/mame/video/argus.cpp @@ -254,7 +254,7 @@ void argus_state::reset_common() VIDEO_START_MEMBER(argus_state,argus) { /* info offset w h col row */ -// m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg0_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 4096, 32); // full 65536 width tilemap +// m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg0_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 4096, 32); // full 65536 width tilemap m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg0_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 1024/16, 32); m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(argus_state::argus_get_bg1_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 32, 32); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(argus_state::get_tx_tile_info<3>),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32); diff --git a/src/mame/video/cischeat.cpp b/src/mame/video/cischeat.cpp index 350e70d3bb3..91ecd99365d 100644 --- a/src/mame/video/cischeat.cpp +++ b/src/mame/video/cischeat.cpp @@ -591,7 +591,7 @@ void cischeat_state::cischeat_draw_sprites(bitmap_ind16 &bitmap , const rectangl sx -= 0x800; if(sy & 0x400) sy -= 0x800; - + /* use fixed point values (16.16), for accuracy */ sx <<= 16; sy <<= 16; diff --git a/src/mame/video/konami_helper.h b/src/mame/video/konami_helper.h index b664a79345c..fc6fa2c64e2 100644 --- a/src/mame/video/konami_helper.h +++ b/src/mame/video/konami_helper.h @@ -1,18 +1,18 @@ // license:BSD-3-Clause // copyright-holders:David Haywood /* Konami video helper functions */ +#ifndef MAME_VIDEO_KONAMI_HELPER_H +#define MAME_VIDEO_KONAMI_HELPER_H #pragma once -#ifndef __KONAMI_HELPER_H__ -#define __KONAMI_HELPER_H__ void konami_decode_gfx(device_gfx_interface &gfxdecode, int gfx_index, uint8_t *data, uint32_t total, const gfx_layout *layout, int bpp); -/* helper function to sort three tile layers by priority order */ +// helper function to sort three tile layers by priority order void konami_sortlayers3(int *layer, int *pri); -/* helper function to sort four tile layers by priority order */ +// helper function to sort four tile layers by priority order void konami_sortlayers4(int *layer, int *pri); -/* helper function to sort five tile layers by priority order */ +// helper function to sort five tile layers by priority order void konami_sortlayers5(int *layer, int *pri); -#endif +#endif // MAME_VIDEO_KONAMI_HELPER_H diff --git a/src/mame/video/namco_c116.cpp b/src/mame/video/namco_c116.cpp index c1e205551ac..2f519eba05d 100644 --- a/src/mame/video/namco_c116.cpp +++ b/src/mame/video/namco_c116.cpp @@ -147,7 +147,7 @@ WRITE8_MEMBER(namco_c116_device::write) RAM = &m_ram_b[0]; break; default: // case 0x1800 (internal registers) - { /* notes from namcos2.cpp */ + { /* notes from namcos2.cpp */ /* registers 0-3: clipping */ /* register 4: ? */ diff --git a/src/mame/video/powervr2.cpp b/src/mame/video/powervr2.cpp index e0ae10e1e30..0ec94693195 100644 --- a/src/mame/video/powervr2.cpp +++ b/src/mame/video/powervr2.cpp @@ -229,10 +229,10 @@ inline uint32_t powervr2_device::float_argb_to_packed_argb(float argb[4]) { } inline void powervr2_device::packed_argb_to_float_argb(float dst[4], uint32_t in) { - dst[0] = (in >> 24) / 256.0f; - dst[1] = ((in >> 16) & 0xff) / 256.0f; - dst[2] = ((in >> 8) & 0xff) / 256.0f; - dst[3] = (in & 0xff) / 256.0f; + dst[0] = (in >> 24) / 256.0f; + dst[1] = ((in >> 16) & 0xff) / 256.0f; + dst[2] = ((in >> 8) & 0xff) / 256.0f; + dst[3] = (in & 0xff) / 256.0f; } // All 64 blending modes, 3 top bits are source mode, 3 bottom bits are destination mode @@ -1841,7 +1841,7 @@ void powervr2_device::process_ta_fifo() memcpy(poly_base_color, tafifo_buff + 4, 4 * sizeof(float)); memset(poly_offs_color, 0, sizeof(poly_offs_color)); } - memcpy(poly_last_mode_2_base_color, poly_base_color, sizeof(poly_last_mode_2_base_color)); + memcpy(poly_last_mode_2_base_color, poly_base_color, sizeof(poly_last_mode_2_base_color)); break; case 3: memcpy(poly_base_color, poly_last_mode_2_base_color, sizeof(poly_base_color)); @@ -2035,9 +2035,9 @@ void powervr2_device::process_ta_fifo() int idx; for (idx = 0; idx < 4; idx++) { memcpy(tv[idx].b, poly_base_color, - sizeof(tv[idx].b)); + sizeof(tv[idx].b)); memcpy(tv[idx].o, poly_offs_color, - sizeof(tv[idx].o)); + sizeof(tv[idx].o)); } ts = &rd->strips[rd->strips_size++]; @@ -2072,12 +2072,12 @@ void powervr2_device::process_ta_fifo() // floating-point color if (have_16_byte_header) { memcpy(vert_base_color, tafifo_buff + 8, - sizeof(vert_base_color)); + sizeof(vert_base_color)); memcpy(vert_offset_color, tafifo_buff + 12, - sizeof(vert_offset_color)); + sizeof(vert_offset_color)); } else { memcpy(vert_base_color, tafifo_buff + 4, - sizeof(vert_base_color)); + sizeof(vert_base_color)); } break; case 2: diff --git a/src/mame/video/taito_helper.h b/src/mame/video/taito_helper.h index 7bdafaffa31..88f7e86b196 100644 --- a/src/mame/video/taito_helper.h +++ b/src/mame/video/taito_helper.h @@ -1,13 +1,13 @@ // license:BSD-3-Clause // copyright-holders:Nicola Salmoria -#pragma once +#ifndef MAME_VIDEO_TAITO_HELPER_H +#define MAME_VIDEO_TAITO_HELPER_H +#pragma once -#ifndef __TAITO_HELPER_H__ -#define __TAITO_HELPER_H__ -/* These scanline drawing routines, currently used by the pc080sn, tc0080vco, tc0150rod and tc0480scp devices, were lifted from Taito F3: optimise / merge ? */ +// These scanline drawing routines, currently used by the pc080sn, tc0080vco, tc0150rod and tc0480scp devices, were lifted from Taito F3: optimise/merge? -void taitoic_drawscanline( bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, const uint16_t *src, int transparent, uint32_t orient, bitmap_ind8 &priority, int pri); +void taitoic_drawscanline(bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y, const uint16_t *src, int transparent, uint32_t orient, bitmap_ind8 &priority, int pri); -#endif +#endif // MAME_VIDEO_TAITO_HELPER_H diff --git a/src/mame/video/tatsumi.cpp b/src/mame/video/tatsumi.cpp index ad860cf729c..2472576049c 100644 --- a/src/mame/video/tatsumi.cpp +++ b/src/mame/video/tatsumi.cpp @@ -762,7 +762,7 @@ VIDEO_START_MEMBER(roundup5_state,roundup5) m_tx_layer->set_transparent_pen(0); m_gfxdecode->gfx(1)->set_source(m_tx_gfxram.get()); - + save_pointer(NAME(m_tx_gfxram), 0x20000); save_pointer(NAME(m_bg_gfxram), 0x20000); } diff --git a/src/mame/video/tetrisp2.cpp b/src/mame/video/tetrisp2.cpp index 828df0169bc..769cba99e62 100644 --- a/src/mame/video/tetrisp2.cpp +++ b/src/mame/video/tetrisp2.cpp @@ -877,12 +877,12 @@ void stepstag_state::convert_yuv422_to_rgb888(palette_device *paldev, uint16_t * gf = std::max(gf,0.0); bf = std::min(bf,255.0); bf = std::max(bf,0.0); - + uint8_t r = (uint8_t)rf; uint8_t g = (uint8_t)gf; uint8_t b = (uint8_t)bf; - - paldev->set_pen_color(offset/4, r, g, b); + + paldev->set_pen_color(offset/4, r, g, b); } WRITE16_MEMBER(stepstag_state::stepstag_palette_left_w) -- cgit v1.2.3