diff --git a/core/hw/aica/sgc_if.cpp b/core/hw/aica/sgc_if.cpp index 2bd3d4787..f2694b621 100755 --- a/core/hw/aica/sgc_if.cpp +++ b/core/hw/aica/sgc_if.cpp @@ -75,17 +75,17 @@ static const double AEG_DSR_Time[64] = }; // These times come from the documentation but don't sound correct. // HT uses the AEG decay times instead and it sounds better. -static const double FEG_Time[] = -{ - -1, -1, 472800.0, 405200.0, 354400.0, 283600.0, 236400.0, 202800.0, - 177200.0, 142000.0, 118400.0, 101200.0, 88800.0, 70800.0, 59200.0, 50800.0, - 44400.0, 35600.0, 29600.0, 25200.0, 22000.0, 17600.0, 14800.0, 12800.0, - 11200.0, 8800.0, 7200.0, 6400.0, 5600.0, 4400.0, 3680.0, 3160.0, - 2760.0, 2220.0, 1840.0, 1560.0, 1360.0, 1080.0, 920.0, 800.0, - 680.0, 560.0, 440.0, 392.0, 340.0, 272.0, 228.0, 196.0, - 172.0, 158.0, 136.0, 100.0, 88.0, 72.0, 56.0, 48.0, - 44.0, 34.0, 28.0, 24.0, 22.0, 17.0, 14.0, 12.0 -}; +//static const double FEG_Time[] = +//{ +// -1, -1, 472800.0, 405200.0, 354400.0, 283600.0, 236400.0, 202800.0, +// 177200.0, 142000.0, 118400.0, 101200.0, 88800.0, 70800.0, 59200.0, 50800.0, +// 44400.0, 35600.0, 29600.0, 25200.0, 22000.0, 17600.0, 14800.0, 12800.0, +// 11200.0, 8800.0, 7200.0, 6400.0, 5600.0, 4400.0, 3680.0, 3160.0, +// 2760.0, 2220.0, 1840.0, 1560.0, 1360.0, 1080.0, 920.0, 800.0, +// 680.0, 560.0, 440.0, 392.0, 340.0, 272.0, 228.0, 196.0, +// 172.0, 158.0, 136.0, 100.0, 88.0, 72.0, 56.0, 48.0, +// 44.0, 34.0, 28.0, 24.0, 22.0, 17.0, 14.0, 12.0 +//}; static const float PLFOS_Scale[8] = { 0.f, 3.61f, 7.22f, 14.44f, 28.88f, 57.75f, 115.5f, 231.f }; static int PLFO_Scales[8][256]; diff --git a/core/hw/pvr/elan.cpp b/core/hw/pvr/elan.cpp index 70c29e381..f835da8a4 100644 --- a/core/hw/pvr/elan.cpp +++ b/core/hw/pvr/elan.cpp @@ -563,12 +563,6 @@ static glm::vec3 getNormal(const T& vtx) return { (int8_t)vtx.header.nx / 127.f, (int8_t)vtx.header.ny / 127.f, (int8_t)vtx.header.nz / 127.f }; } -template<> -glm::vec3 getNormal(const N2_VERTEX_VNU& vtx) -{ - return { vtx.normal.nx, vtx.normal.ny, vtx.normal.nz }; -} - template static void setNormal(Vertex& vd, const T& vs) { diff --git a/core/hw/pvr/spg.cpp b/core/hw/pvr/spg.cpp index 64a51b5e3..acf9bc592 100755 --- a/core/hw/pvr/spg.cpp +++ b/core/hw/pvr/spg.cpp @@ -17,7 +17,9 @@ static u32 pvr_numscanlines = 512; static u32 prv_cur_scanline = -1; static u32 vblk_cnt; +#if !defined(NDEBUG) || defined(DEBUGFAST) static float last_fps; +#endif //54 mhz pixel clock #define PIXEL_CLOCK (54*1000*1000/2) diff --git a/core/hw/pvr/ta.cpp b/core/hw/pvr/ta.cpp index 4f542a29b..2bbbaaa0e 100644 --- a/core/hw/pvr/ta.cpp +++ b/core/hw/pvr/ta.cpp @@ -486,8 +486,8 @@ static void markObjectListBlocks() return; } } - for (int y = 0; y <= TA_GLOB_TILE_CLIP.tile_y_num; y++) - for (int x = 0; x <= TA_GLOB_TILE_CLIP.tile_x_num; x++) + for (u32 y = 0; y <= TA_GLOB_TILE_CLIP.tile_y_num; y++) + for (u32 x = 0; x <= TA_GLOB_TILE_CLIP.tile_x_num; x++) { pvr_write32p(addr, TA_OL_BASE); addr += opBlockSize; diff --git a/core/hw/sh4/modules/fastmmu.cpp b/core/hw/sh4/modules/fastmmu.cpp index 9ed75062e..de6c01750 100644 --- a/core/hw/sh4/modules/fastmmu.cpp +++ b/core/hw/sh4/modules/fastmmu.cpp @@ -49,7 +49,6 @@ struct TLB_LinkedEntry { static TLB_LinkedEntry full_table[65536]; static u32 full_table_size; static TLB_LinkedEntry *entry_buckets[NBUCKETS]; -u32 mmuAddressLUT[0x100000]; static u16 bucket_index(u32 address, int size, u32 asid) { diff --git a/core/hw/sh4/modules/mmu.cpp b/core/hw/sh4/modules/mmu.cpp index b592dfcb1..0b861e54b 100644 --- a/core/hw/sh4/modules/mmu.cpp +++ b/core/hw/sh4/modules/mmu.cpp @@ -512,6 +512,8 @@ void mmu_set_state() SetMemoryHandlers(); } +u32 mmuAddressLUT[0x100000]; + void MMU_init() { memset(ITLB_LRU_USE, 0xFF, sizeof(ITLB_LRU_USE)); diff --git a/core/hw/sh4/modules/wince.h b/core/hw/sh4/modules/wince.h index 80655f1f6..8abf1bd34 100644 --- a/core/hw/sh4/modules/wince.h +++ b/core/hw/sh4/modules/wince.h @@ -18,6 +18,7 @@ */ #include "hw/sh4/sh4_sched.h" +#ifdef TRACE_WINCE_SYSCALLS #define PUserKData 0x00005800 #define SYSHANDLE_OFFSET 0x004 #define SYS_HANDLE_BASE 64 @@ -225,10 +226,8 @@ static const char *wince_methods[][256] = { }, }; -#ifdef TRACE_WINCE_SYSCALLS extern u32 unresolved_ascii_string; extern u32 unresolved_unicode_string; -#endif static inline std::string get_unicode_string(u32 addr) { @@ -238,9 +237,7 @@ static inline std::string get_unicode_string(u32 addr) u16 c; if (!read_mem16(addr, c)) { -#ifdef TRACE_WINCE_SYSCALLS unresolved_unicode_string = addr; -#endif return "(page fault)"; } if (c == 0) @@ -250,6 +247,7 @@ static inline std::string get_unicode_string(u32 addr) } return str; } + static inline std::string get_ascii_string(u32 addr) { std::string str; @@ -258,9 +256,7 @@ static inline std::string get_ascii_string(u32 addr) u8 c; if (!read_mem8(addr++, c)) { -#ifdef TRACE_WINCE_SYSCALLS unresolved_ascii_string = addr; -#endif return "(page fault)"; } if (c == 0) @@ -352,7 +348,9 @@ static bool print_wince_syscall(u32 address) return false; } +#endif +#if defined(FAST_MMU) && defined(USE_WINCE_HACK) static bool wince_resolve_address(u32 va, TLB_Entry &entry) { // WinCE hack @@ -407,3 +405,4 @@ static bool wince_resolve_address(u32 va, TLB_Entry &entry) return false; } +#endif diff --git a/core/imgread/ioctl.cpp b/core/imgread/ioctl.cpp index 33095fd93..20a632fa5 100644 --- a/core/imgread/ioctl.cpp +++ b/core/imgread/ioctl.cpp @@ -260,7 +260,6 @@ struct PhysicalDrive:Disc bool PhysicalTrack::Read(u32 FAD,u8* dst,SectorFormat* sector_type,u8* subcode,SubcodeFormat* subcode_type) { - u32 fmt=0; static u8 temp[2500]; u32 LBA=FAD-150; diff --git a/core/linux-dist/main.cpp b/core/linux-dist/main.cpp index 2443e61fb..365482ad1 100644 --- a/core/linux-dist/main.cpp +++ b/core/linux-dist/main.cpp @@ -216,6 +216,7 @@ std::string find_user_data_dir() #endif } +#ifndef __SWITCH__ static void addDirectoriesFromPath(std::vector& dirs, const std::string& path, const std::string& suffix) { std::string::size_type pos = 0; @@ -231,6 +232,7 @@ static void addDirectoriesFromPath(std::vector& dirs, const std::st if (pos < path.length()) dirs.push_back(path.substr(pos) + suffix); } +#endif // Find a file in the user and system config directories. // The following folders are checked in this order: diff --git a/core/network/picoppp.cpp b/core/network/picoppp.cpp index 7fea7cddf..2205fcfd6 100644 --- a/core/network/picoppp.cpp +++ b/core/network/picoppp.cpp @@ -738,8 +738,8 @@ static pico_device *pico_eth_create() return nullptr; const u8 mac_addr[6] = { 0xc, 0xa, 0xf, 0xe, 0, 1 }; - if (0 != pico_device_init(eth, "ETHPEER", mac_addr)) - return nullptr; + if (0 != pico_device_init(eth, "ETHPEER", mac_addr)) + return nullptr; DEBUG_LOG(NETWORK, "Device %s created", eth->name); @@ -1045,8 +1045,8 @@ static void *pico_thread_func(void *) PICO_IDLE(); } - for (auto it = tcp_listening_sockets.begin(); it != tcp_listening_sockets.end(); it++) - closesocket(it->second); + for (auto it = tcp_listening_sockets.begin(); it != tcp_listening_sockets.end(); it++) + closesocket(it->second); close_native_sockets(); pico_socket_close(pico_tcp_socket); pico_socket_close(pico_udp_socket); diff --git a/core/rec-ARM64/rec_arm64.cpp b/core/rec-ARM64/rec_arm64.cpp index d8417dd18..f96a506ed 100644 --- a/core/rec-ARM64/rec_arm64.cpp +++ b/core/rec-ARM64/rec_arm64.cpp @@ -54,7 +54,6 @@ struct DynaRBI : RuntimeBlockInfo } }; -static u32 cycle_counter; static u64 jmp_stack; static Arm64UnwindInfo unwinder; diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp index e9d124f3b..367811ca8 100644 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -317,7 +317,7 @@ void DrawSorted(bool multipass) //if any drawing commands, draw them if (!pidx_sort.empty()) { - u32 count=pidx_sort.size(); + std::size_t count = pidx_sort.size(); { //set some 'global' modes for all primitives @@ -326,7 +326,7 @@ void DrawSorted(bool multipass) glcache.StencilFunc(GL_ALWAYS,0,0); glcache.StencilOp(GL_KEEP,GL_KEEP,GL_REPLACE); - for (u32 p=0; p2) //this actually happens for some games. No idea why .. @@ -368,7 +368,7 @@ void DrawSorted(bool multipass) glcache.DepthFunc(GL_GEQUAL); glcache.DepthMask(GL_TRUE); - for (u32 p = 0; p < count; p++) + for (std::size_t p = 0; p < count; p++) { const PolyParam* params = pidx_sort[p].ppid; if (pidx_sort[p].count > 2 && !params->isp.ZWriteDis) { diff --git a/core/rend/gui.cpp b/core/rend/gui.cpp index 2238e05a2..e0994e069 100644 --- a/core/rend/gui.cpp +++ b/core/rend/gui.cpp @@ -1694,7 +1694,7 @@ static void gui_display_settings() OptionCheckbox("Widescreen Game Cheats", config::WidescreenGameHacks, "Modify the game so that it displays in 16:9 anamorphic format and use horizontal screen stretching. Only some games are supported."); - const std::array aniso{ 1, 2, 4, 8, 16 }; + const std::array aniso{ 1, 2, 4, 8, 16 }; const std::array anisoText{ "Disabled", "2x", "4x", "8x", "16x" }; u32 afSelected = 0; for (u32 i = 0; i < aniso.size(); i++) @@ -2826,7 +2826,7 @@ void gui_display_osd() ImGui::Begin("##osd", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoBackground); ImGui::SetWindowFontScale(1.5); - ImGui::TextColored(ImVec4(1, 1, 0, 0.7), "%s", message.c_str()); + ImGui::TextColored(ImVec4(1, 1, 0, 0.7f), "%s", message.c_str()); ImGui::End(); } imguiDriver->displayCrosshairs(); diff --git a/core/rend/vulkan/oit/oit_drawer.h b/core/rend/vulkan/oit/oit_drawer.h index d97f5840b..8442e89b7 100644 --- a/core/rend/vulkan/oit/oit_drawer.h +++ b/core/rend/vulkan/oit/oit_drawer.h @@ -101,7 +101,7 @@ protected: | vk::BufferUsageFlagBits::eStorageBuffer)); } return mainBuffers[bufferIndex].get(); - }; + } void MakeBuffers(int width, int height); virtual vk::Format GetColorFormat() const = 0; diff --git a/core/rend/vulkan/vmallocator.cpp b/core/rend/vulkan/vmallocator.cpp index 1c4653b4e..6a441d2c5 100644 --- a/core/rend/vulkan/vmallocator.cpp +++ b/core/rend/vulkan/vmallocator.cpp @@ -23,6 +23,7 @@ #include "vmallocator.h" #include "vulkan_context.h" +#if !defined(NDEBUG) || defined(DEBUGFAST) VKAPI_ATTR static void VKAPI_CALL vmaAllocateDeviceMemoryCallback( VmaAllocator allocator, uint32_t memoryType, @@ -44,6 +45,7 @@ VKAPI_ATTR static void VKAPI_CALL vmaFreeDeviceMemoryCallback( } static const VmaDeviceMemoryCallbacks memoryCallbacks = { vmaAllocateDeviceMemoryCallback, vmaFreeDeviceMemoryCallback }; +#endif void VMAllocator::Init(vk::PhysicalDevice physicalDevice, vk::Device device, vk::Instance instance) { diff --git a/core/windows/winmain.cpp b/core/windows/winmain.cpp index 2578d4215..8a5b1a5d2 100644 --- a/core/windows/winmain.cpp +++ b/core/windows/winmain.cpp @@ -281,9 +281,9 @@ void UpdateInputState() #endif } +#ifndef USE_SDL static HWND hWnd; -#ifndef USE_SDL // Windows class name to register #define WINDOW_CLASS "nilDC" static int window_x, window_y; diff --git a/shell/apple/emulator-osx/emulator-osx/SDLMain.mm b/shell/apple/emulator-osx/emulator-osx/SDLMain.mm index fe644ca7a..ee3122060 100644 --- a/shell/apple/emulator-osx/emulator-osx/SDLMain.mm +++ b/shell/apple/emulator-osx/emulator-osx/SDLMain.mm @@ -184,7 +184,6 @@ static void setupWindowMenu(void) static void setupHelpMenu(void) { NSMenu *helpMenu; - NSString *title; NSMenuItem *helpMenuItem; NSMenuItem *menuItem;