diff options
author | Vas Crabb <vas@vastheman.com> | 2021-12-01 15:20:12 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2021-12-01 15:20:12 +1100 |
commit | 42f81753d2a130ffcdae524cca3d93831034c770 (patch) | |
tree | 94a39b0eb7717871ed67f8287b2bd323b0b01d7a /src/devices | |
parent | 989fd54201eef7f4c03d3dd499a83e194b29d87d (diff) |
Soul-crushingly frustrating clean-up:
* Patched up a pile of code that was rotting behind UNUSED_FUNCTION, and
switched to [[maybe_unused]] attribute so it can't rot so easily.
* Reduced a bit more redundancy in fruit machine layouts.
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/machine/smartmed.cpp | 4 | ||||
-rw-r--r-- | src/devices/sound/aica.cpp | 10 | ||||
-rw-r--r-- | src/devices/sound/aica.h | 4 | ||||
-rw-r--r-- | src/devices/sound/mos6560.cpp | 2 | ||||
-rw-r--r-- | src/devices/sound/scsp.cpp | 8 | ||||
-rw-r--r-- | src/devices/video/stvvdp1.cpp | 13 | ||||
-rw-r--r-- | src/devices/video/stvvdp2.cpp | 4 | ||||
-rw-r--r-- | src/devices/video/zeus2.h | 44 |
8 files changed, 28 insertions, 61 deletions
diff --git a/src/devices/machine/smartmed.cpp b/src/devices/machine/smartmed.cpp index c0d6f7d4faa..1e7dc925ce0 100644 --- a/src/devices/machine/smartmed.cpp +++ b/src/devices/machine/smartmed.cpp @@ -35,15 +35,13 @@ inline uint32_t get_UINT32BE(UINT32BE word) return (word.bytes[0] << 24) | (word.bytes[1] << 16) | (word.bytes[2] << 8) | word.bytes[3]; } -#ifdef UNUSED_FUNCTION -inline void set_UINT32BE(UINT32BE *word, uint32_t data) +[[maybe_unused]] inline void set_UINT32BE(UINT32BE *word, uint32_t data) { word->bytes[0] = (data >> 24) & 0xff; word->bytes[1] = (data >> 16) & 0xff; word->bytes[2] = (data >> 8) & 0xff; word->bytes[3] = data & 0xff; } -#endif /* SmartMedia image header */ struct SM_disk_image_header diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp index c994dcd9e38..597a52ad126 100644 --- a/src/devices/sound/aica.cpp +++ b/src/devices/sound/aica.cpp @@ -1036,7 +1036,6 @@ u16 aica_device::r16(u32 addr) } -#ifdef UNUSED_FUNCTION void aica_device::TimersAddTicks(int ticks) { if (m_TimCnt[0] <= 0xff00) @@ -1075,7 +1074,6 @@ void aica_device::TimersAddTicks(int ticks) m_udata.data[0x98 / 2] |= m_TimCnt[2] >> 8; } } -#endif s32 aica_device::UpdateSlot(AICA_SLOT *slot) { @@ -1380,14 +1378,6 @@ void aica_device::exec_dma() CheckPendingIRQ_SH4(); } -#ifdef UNUSED_FUNCTION -int aica_device::IRQCB(void *param) -{ - CheckPendingIRQ(param); - return -1; -} -#endif - //------------------------------------------------- // sound_stream_update - handle a stream update //------------------------------------------------- diff --git a/src/devices/sound/aica.h b/src/devices/sound/aica.h index 8509953a228..09a042b1aad 100644 --- a/src/devices/sound/aica.h +++ b/src/devices/sound/aica.h @@ -45,6 +45,7 @@ protected: virtual space_config_vector memory_space_config() const override; address_space_config m_data_config; + private: enum AICA_STATE {AICA_ATTACK,AICA_DECAY1,AICA_DECAY2,AICA_RELEASE}; @@ -123,7 +124,8 @@ private: void UpdateRegR(int reg); void w16(u32 addr,u16 val); u16 r16(u32 addr); - inline s32 UpdateSlot(AICA_SLOT *slot); + [[maybe_unused]] void TimersAddTicks(int ticks); + s32 UpdateSlot(AICA_SLOT *slot); void DoMasterSamples(std::vector<read_stream_view> const &inputs, write_stream_view &bufl, write_stream_view &bufr); void exec_dma(); diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp index fadef01dd20..a140e63602b 100644 --- a/src/devices/sound/mos6560.cpp +++ b/src/devices/sound/mos6560.cpp @@ -416,7 +416,7 @@ uint8_t mos6560_device::read(offs_t offset) break; case 6: /*lightpen horizontal */ case 7: /*lightpen vertical */ -#ifdef UNUSED_FUNCTION +#if 0 if (LIGHTPEN_BUTTON && ((machine().time().as_double() - m_lightpenreadtime) * MOS656X_VRETRACERATE >= 1)) { /* only 1 update each frame */ diff --git a/src/devices/sound/scsp.cpp b/src/devices/sound/scsp.cpp index 57fbf951c51..1b9a5a8cb8f 100644 --- a/src/devices/sound/scsp.cpp +++ b/src/devices/sound/scsp.cpp @@ -1427,14 +1427,6 @@ void scsp_device::exec_dma() } } -#ifdef UNUSED_FUNCTION -int IRQCB(void *param) -{ - CheckPendingIRQ(param); - return -1; -} -#endif - u16 scsp_device::read(offs_t offset) { diff --git a/src/devices/video/stvvdp1.cpp b/src/devices/video/stvvdp1.cpp index d3fce6d03ba..d26b65309be 100644 --- a/src/devices/video/stvvdp1.cpp +++ b/src/devices/video/stvvdp1.cpp @@ -438,19 +438,6 @@ uint32_t saturn_state::saturn_vdp1_framebuffer0_r(offs_t offset, uint32_t mem_ma return result; } -#ifdef UNUSED_FUNCTION -void saturn_state::saturn_vdp1_framebuffer1_w(offs_t offset, uint32_t data) -{ - //popmessage ("STV VDP1 Framebuffer 1 WRITE offset %08x data %08x",offset, data); -} - -uint32_t saturn_state::saturn_vdp1_framebuffer1_r() -{ - //popmessage ("STV VDP1 Framebuffer 1 READ offset %08x",offset); - return 0xffff; -} -#endif - /* diff --git a/src/devices/video/stvvdp2.cpp b/src/devices/video/stvvdp2.cpp index 2d9349aa5f5..66cfb7c2ec0 100644 --- a/src/devices/video/stvvdp2.cpp +++ b/src/devices/video/stvvdp2.cpp @@ -5597,7 +5597,7 @@ void saturn_state::stv_vdp2_draw_rotation_screen(bitmap_rgb32 &bitmap, const rec stv2_current_tilemap.transparency |= STV_TRANSPARENCY_ALPHA; } - #ifdef UNUSED_FUNCTION +#if 0 // old reference code mycliprect = cliprect; @@ -5608,7 +5608,7 @@ void saturn_state::stv_vdp2_draw_rotation_screen(bitmap_rgb32 &bitmap, const rec stv2_current_tilemap.window_control.enabled[0] = 0; stv2_current_tilemap.window_control.enabled[1] = 0; } - #endif +#endif stv2_current_tilemap.fade_control = fade_control; diff --git a/src/devices/video/zeus2.h b/src/devices/video/zeus2.h index 1b546349468..cdc38aa2227 100644 --- a/src/devices/video/zeus2.h +++ b/src/devices/video/zeus2.h @@ -281,7 +281,7 @@ public: } else { if (m_zeusbase[0x57] & 0x4) - m_frameColor[addr + 1] = m_zeusbase[0x59]; + m_frameColor[addr + 1] = m_zeusbase[0x59]; if (m_zeusbase[0x57] & 0x10) *(uint32_t*)&m_frameDepth[addr] = m_zeusbase[0x5a]; } @@ -300,13 +300,11 @@ public: return WAVERAM_BLOCK0(blocknum); } -#ifdef UNUSED_FUNCTION - inline void *waveram0_ptr_from_texture_addr(uint32_t addr, int width) + [[maybe_unused]] inline void *waveram0_ptr_from_texture_addr(uint32_t addr, int width) { uint32_t blocknum = ((addr & ~1) * width) / 8; return WAVERAM_BLOCK0(blocknum); } -#endif /************************************* * Inlines for rendering @@ -328,51 +326,51 @@ public: result |= ((((color) << 6) & 0xc0) | (((color) << 4) & 0x30) | (((color) << 2) & 0x0c) | (((color) << 0) & 0x03)) << 0; return result; } -#ifdef UNUSED_FUNCTION - inline void WAVERAM_plot(int y, int x, uint32_t color) + + [[maybe_unused]] inline void WAVERAM_plot(int y, int x, uint32_t color) { if (zeus_cliprect.contains(x, y)) - WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); + { + uint32_t addr = frame_addr_from_xy(x, y, true); + m_frameColor[addr] = color; + } } -#endif -#ifdef UNUSED_FUNCTION - inline void waveram_plot_depth(int y, int x, uint32_t color, uint16_t depth) + [[maybe_unused]] inline void waveram_plot_depth(int y, int x, uint32_t color, int32_t depth) { if (zeus_cliprect.contains(x, y)) { - WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); - WAVERAM_WRITEDEPTH(zeus_renderbase, y, x, depth); + uint32_t addr = frame_addr_from_xy(x, y, true); + m_frameColor[addr] = color; + m_frameDepth[addr] = depth; } } -#endif -#ifdef UNUSED_FUNCTION - inline void waveram_plot_check_depth(int y, int x, uint32_t color, uint16_t depth) + [[maybe_unused]] inline void waveram_plot_check_depth(int y, int x, uint32_t color, int32_t depth) { if (zeus_cliprect.contains(x, y)) { - uint16_t *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x); + uint32_t addr = frame_addr_from_xy(x, y, true); + int32_t *depthptr = &m_frameDepth[addr]; if (depth <= *depthptr) { - WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); + m_frameColor[addr] = color; *depthptr = depth; } } } -#endif -#ifdef UNUSED_FUNCTION - inline void waveram_plot_check_depth_nowrite(int y, int x, uint32_t color, uint16_t depth) + [[maybe_unused]] inline void waveram_plot_check_depth_nowrite(int y, int x, uint32_t color, int32_t depth) { if (zeus_cliprect.contains(x, y)) { - uint16_t *depthptr = WAVERAM_PTRDEPTH(zeus_renderbase, y, x); + uint32_t addr = frame_addr_from_xy(x, y, true); + int32_t *depthptr = &m_frameDepth[addr]; if (depth <= *depthptr) - WAVERAM_WRITEPIX(zeus_renderbase, y, x, color); + m_frameColor[addr] = color; } } -#endif + /************************************* * Inlines for texel accesses *************************************/ |