From c1f914a9745c5ca8f24b5a00ecdde7f4887dcab6 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 03:59:57 -0600 Subject: [PATCH 01/40] Update JavaBridge.cpp Add newline --- Source/Android/Bridge/JavaBridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/Bridge/JavaBridge.cpp b/Source/Android/Bridge/JavaBridge.cpp index 9fa3973c2..a80d37634 100644 --- a/Source/Android/Bridge/JavaBridge.cpp +++ b/Source/Android/Bridge/JavaBridge.cpp @@ -166,4 +166,4 @@ void JavaBridge::RecentRomsUpdated(void) } } -#endif \ No newline at end of file +#endif From dfe0957988dfeaec037ae228882cc3b78f451aa0 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:15:04 -0600 Subject: [PATCH 02/40] Update JavaBridge.h Add space after single line comments and add newline --- Source/Android/Bridge/JavaBridge.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Android/Bridge/JavaBridge.h b/Source/Android/Bridge/JavaBridge.h index 121cf45ad..f70370e38 100644 --- a/Source/Android/Bridge/JavaBridge.h +++ b/Source/Android/Bridge/JavaBridge.h @@ -11,18 +11,18 @@ class JavaBridge : public: JavaBridge(JavaVM* vm); - //Render window functions + // Render window functions void GfxThreadInit(); void GfxThreadDone(); void SwapWindow(); - //Rom List + // ROM List void RomListReset(void); void RomListAddItem(const char * FullFileName, const char * FileName, const char * GoodName, uint32_t TextColor); void RomListLoaded(void); void RecentRomsUpdated(void); - //Notification + // Notification void DisplayError(const char * Message); void DisplayMessage(const char * Message, int DisplayTime); void DisplayMessage2(const char * Message); @@ -39,4 +39,4 @@ private: jclass m_NotifierClass; }; -#endif \ No newline at end of file +#endif From 5542fe3aa24527b5fa840b4bd39ae7ff1b23d4dc Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:15:12 -0600 Subject: [PATCH 03/40] Update JavaRomList.cpp Add newline --- Source/Android/Bridge/JavaRomList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/Bridge/JavaRomList.cpp b/Source/Android/Bridge/JavaRomList.cpp index c69d4d327..0d34fd913 100644 --- a/Source/Android/Bridge/JavaRomList.cpp +++ b/Source/Android/Bridge/JavaRomList.cpp @@ -29,4 +29,4 @@ void CJavaRomList::RomListLoaded(void) } } -#endif \ No newline at end of file +#endif From edae59bdb2309c8f09edc1193d9e867268990ec4 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:15:19 -0600 Subject: [PATCH 04/40] Update JavaRomList.h Add newline --- Source/Android/Bridge/JavaRomList.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/Bridge/JavaRomList.h b/Source/Android/Bridge/JavaRomList.h index b1fcb5950..f9885b20d 100644 --- a/Source/Android/Bridge/JavaRomList.h +++ b/Source/Android/Bridge/JavaRomList.h @@ -8,4 +8,4 @@ public: void RomListReset(void); void RomAddedToList(int32_t ListPos); void RomListLoaded(void); -}; \ No newline at end of file +}; From 4b0d331a68ef39015ee9aee55477477541961e13 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:15:37 -0600 Subject: [PATCH 05/40] Update jniBridge.h Add newline --- Source/Android/Bridge/jniBridge.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/Bridge/jniBridge.h b/Source/Android/Bridge/jniBridge.h index 9376ebbc1..24d9b99a0 100644 --- a/Source/Android/Bridge/jniBridge.h +++ b/Source/Android/Bridge/jniBridge.h @@ -8,4 +8,4 @@ JNIEnv* Android_JNI_GetEnv(void); extern jobject g_Activity; extern jobject g_GLThread; -#endif \ No newline at end of file +#endif From 1442297d4fc404780e7f9c096671d6a42c012f77 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:15:49 -0600 Subject: [PATCH 06/40] Update jniBridgeSettings.cpp Remove extra newline --- Source/Android/Bridge/jniBridgeSettings.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Android/Bridge/jniBridgeSettings.cpp b/Source/Android/Bridge/jniBridgeSettings.cpp index cdf6260b3..3d15d9514 100644 --- a/Source/Android/Bridge/jniBridgeSettings.cpp +++ b/Source/Android/Bridge/jniBridgeSettings.cpp @@ -27,4 +27,3 @@ void CJniBridegSettings::RefreshSettings(void *) { m_bCPURunning = g_Settings->LoadBool(GameRunning_CPU_Running); } - From 36e0269f07bc178127b3b8d90ba651216b031857 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:16:19 -0600 Subject: [PATCH 07/40] Update NotificationClass.h Remove some title case and add newline --- Source/Android/Bridge/NotificationClass.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Android/Bridge/NotificationClass.h b/Source/Android/Bridge/NotificationClass.h index 16501bb7e..c03491bdd 100644 --- a/Source/Android/Bridge/NotificationClass.h +++ b/Source/Android/Bridge/NotificationClass.h @@ -9,14 +9,14 @@ public: CNotificationImp(void); virtual ~CNotificationImp(); - //Error Messages + // Error messages void DisplayError(const char * Message) const; void DisplayError(LanguageStringID StringID) const; void FatalError(const char * Message) const; void FatalError(LanguageStringID StringID) const; - //User Feedback + // User feedback void DisplayWarning(const char * Message) const; void DisplayWarning(LanguageStringID StringID) const; @@ -25,7 +25,7 @@ public: void DisplayMessage2(const char * Message) const; - // Ask a Yes/No Question to the user, yes = true, no = false + // Ask a yes/no question to the user, yes = true, no = false bool AskYesNoQuestion(const char * Question) const; void BreakPoint(const char * FileName, int32_t LineNumber); @@ -40,4 +40,4 @@ private: mutable time_t m_NextMsg; }; -CNotificationImp & Notify(void); \ No newline at end of file +CNotificationImp & Notify(void); From 8e8ba73a31245677c808bd70fcfd97792d7bddde Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:16:27 -0600 Subject: [PATCH 08/40] Update SyncBridge.cpp Add newline --- Source/Android/Bridge/SyncBridge.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Android/Bridge/SyncBridge.cpp b/Source/Android/Bridge/SyncBridge.cpp index b75b9cc09..85f7ac9eb 100644 --- a/Source/Android/Bridge/SyncBridge.cpp +++ b/Source/Android/Bridge/SyncBridge.cpp @@ -22,5 +22,4 @@ void SyncBridge::SwapWindow() } } - -#endif \ No newline at end of file +#endif From 91c26d520780f530eb84f7b946a5ef8b9924fe5d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:17:32 -0600 Subject: [PATCH 09/40] Update SyncBridge.h Add space after single line comment and add newline --- Source/Android/Bridge/SyncBridge.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Android/Bridge/SyncBridge.h b/Source/Android/Bridge/SyncBridge.h index 711c5fc98..71148a809 100644 --- a/Source/Android/Bridge/SyncBridge.h +++ b/Source/Android/Bridge/SyncBridge.h @@ -10,7 +10,7 @@ class SyncBridge : public: SyncBridge (JavaBridge * javaBridge); - //Render window functions + // Render window functions void GfxThreadInit(); void GfxThreadDone(); void SwapWindow(); @@ -23,4 +23,4 @@ private: JavaBridge * m_JavaBridge; }; -#endif \ No newline at end of file +#endif From dcd8e957efbffc1ad9e50aac46e489c712a632d8 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:17:47 -0600 Subject: [PATCH 10/40] Update UISettings.cpp Change Rom to ROM --- Source/Android/Bridge/UISettings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Android/Bridge/UISettings.cpp b/Source/Android/Bridge/UISettings.cpp index db39a9acf..58b5a9dbd 100644 --- a/Source/Android/Bridge/UISettings.cpp +++ b/Source/Android/Bridge/UISettings.cpp @@ -9,8 +9,8 @@ void RegisterUISettings(void) { g_Settings->AddHandler((SettingID)(FirstUISettings + Asserts_Version), new CSettingTypeApplication("Settings", "Asserts Version", (uint32_t)0)); g_Settings->AddHandler((SettingID)(FirstUISettings + Screen_Orientation), new CSettingTypeApplication("Settings", "Screen Orientation", (uint32_t)0)); - g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileCount), new CSettingTypeApplication("Settings", "Remembered Rom Files", (uint32_t)10)); - g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileIndex), new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None)); + g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileCount), new CSettingTypeApplication("Settings", "Remembered ROM Files", (uint32_t)10)); + g_Settings->AddHandler((SettingID)(FirstUISettings + File_RecentGameFileIndex), new CSettingTypeApplicationIndex("Recent File", "Recent ROM", Default_None)); g_Settings->AddHandler((SettingID)(FirstUISettings + TouchScreen_ButtonScale), new CSettingTypeApplication("Touch Screen", "Button Scale", (uint32_t)100)); g_Settings->AddHandler((SettingID)(FirstUISettings + TouchScreen_Layout), new CSettingTypeApplication("Touch Screen", "Layout", "Analog")); g_Settings->AddHandler((SettingID)(FirstUISettings + Controller_ConfigFile), new CSettingTypeRelativePath("Config", "Controller.cfg")); From 1f5e4d18eeb6a13a97109d33f69728f4430cede4 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:19:02 -0600 Subject: [PATCH 11/40] Update UISettings.h Eliminate some title case, add space after single line comment, and add newline --- Source/Android/Bridge/UISettings.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Android/Bridge/UISettings.h b/Source/Android/Bridge/UISettings.h index c713092ff..f5f857606 100644 --- a/Source/Android/Bridge/UISettings.h +++ b/Source/Android/Bridge/UISettings.h @@ -7,27 +7,27 @@ enum UISettingID Asserts_Version, Screen_Orientation, - //Recent Game + // Recent game File_RecentGameFileCount, File_RecentGameFileIndex, - //Touch Screen + // Touch screen TouchScreen_ButtonScale, TouchScreen_Layout, - //Controller Config + // Controller config Controller_ConfigFile, Controller_CurrentProfile, Controller_Deadzone, Controller_Sensitivity, - //Support Window + // Support window SupportWindow_FirstRun, SupportWindow_AlwaysShow, SupportWindow_ShowingSupportWindow, SupportWindow_RunCount, - //Game Settings + // Game settings Game_RunCount, }; @@ -56,4 +56,4 @@ bool UISettingsLoadStringIndex(UISettingID Type, int32_t index, std::string & Va std::string UISettingsLoadStringIndex(UISettingID Type, int32_t index); std::string UISettingsLoadStringVal(UISettingID Type); bool UISettingsLoadStringVal(UISettingID Type, char * Buffer, int32_t BufferSize); -*/ \ No newline at end of file +*/ From ba77c09090cc2fde49916b849f8608605312c9c1 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:19:10 -0600 Subject: [PATCH 12/40] Update about.cpp Add newline --- Source/Android/PluginInput/about.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/PluginInput/about.cpp b/Source/Android/PluginInput/about.cpp index e02ec3c0a..d41733a57 100644 --- a/Source/Android/PluginInput/about.cpp +++ b/Source/Android/PluginInput/about.cpp @@ -7,4 +7,4 @@ void ShowAboutWindow (void * hParent) #ifdef _WIN32 MessageBox((HWND)hParent,L"Android Input Plugin",L"Dll About",MB_OK); #endif -} \ No newline at end of file +} From f52e6cd2e2599aeec88801a70d1f71383fc4938b Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:20:03 -0600 Subject: [PATCH 13/40] Update alist.h Remove another header, take multiline comments and make them single line comments --- Source/Android/PluginRSP/alist.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Source/Android/PluginRSP/alist.h b/Source/Android/PluginRSP/alist.h index a3ba2d578..634a51e44 100644 --- a/Source/Android/PluginRSP/alist.h +++ b/Source/Android/PluginRSP/alist.h @@ -1,8 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once class CHle; @@ -33,9 +28,7 @@ void alist_iirf( CHle * hle, bool init, uint16_t dmemo, uint16_t dmemi, uint16_t void alist_resample_zoh( CHle * hle, uint16_t dmemo, uint16_t dmemi, uint16_t count, uint32_t pitch, uint32_t pitch_accu); void alist_filter( CHle * hle, uint16_t dmem, uint16_t count, uint32_t address, const uint32_t* lut_address); -/* -* Audio flags -*/ +// Audio flags #define A_INIT 0x01 #define A_CONTINUE 0x00 From 71db981ac118036bead7e7dd8f2c8f0e30274a78 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:20:19 -0600 Subject: [PATCH 14/40] Update arithmetics.h Remove header --- Source/Android/PluginRSP/arithmetics.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Source/Android/PluginRSP/arithmetics.h b/Source/Android/PluginRSP/arithmetics.h index cd8b57fed..c005768f6 100644 --- a/Source/Android/PluginRSP/arithmetics.h +++ b/Source/Android/PluginRSP/arithmetics.h @@ -1,8 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once static inline int16_t clamp_s16(int_fast32_t x) From de0522b67ce70fd3baffb636876dd13f8449705f Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:20:40 -0600 Subject: [PATCH 15/40] Update audio.cpp Remove header and add newline --- Source/Android/PluginRSP/audio.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Android/PluginRSP/audio.cpp b/Source/Android/PluginRSP/audio.cpp index 78f6f793f..a76446b3c 100644 --- a/Source/Android/PluginRSP/audio.cpp +++ b/Source/Android/PluginRSP/audio.cpp @@ -1,8 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include #include "audio.h" @@ -110,4 +105,4 @@ void adpcm_compute_residuals(int16_t* dst, const int16_t* src, accu += book1[i] * l1 + book2[i] * l2 + rdot(i, book2, src); dst[i] = clamp_s16(accu >> 11); } -} \ No newline at end of file +} From e77c32c5508790d76b0c6636a8fb1dfd98450ce8 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:21:06 -0600 Subject: [PATCH 16/40] Update audio.h Remove header, change multiline comment into single line comment --- Source/Android/PluginRSP/audio.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Android/PluginRSP/audio.h b/Source/Android/PluginRSP/audio.h index d7a92c789..2aeee057f 100644 --- a/Source/Android/PluginRSP/audio.h +++ b/Source/Android/PluginRSP/audio.h @@ -1,8 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once extern const int16_t RESAMPLE_LUT[64 * 4]; @@ -13,7 +8,7 @@ static inline int16_t adpcm_predict_sample(uint8_t byte, uint8_t mask, unsigned lshift, unsigned rshift) { int16_t sample = (uint16_t)(byte & mask) << lshift; - sample >>= rshift; /* signed */ + sample >>= rshift; // signed return sample; } From 3b6dbf77c3b194ad05c53ba3b5e1f920470a5fea Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:22:29 -0600 Subject: [PATCH 17/40] Update mem.cpp Remove header, convert multiline comments into single line comments, add newline --- Source/Android/PluginRSP/mem.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Source/Android/PluginRSP/mem.cpp b/Source/Android/PluginRSP/mem.cpp index 990a1628d..f940c7980 100644 --- a/Source/Android/PluginRSP/mem.cpp +++ b/Source/Android/PluginRSP/mem.cpp @@ -1,14 +1,9 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2012 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include #include "mem.h" -/* Global functions */ +// Global functions void load_u8(uint8_t* dst, const unsigned char* buffer, unsigned address, size_t count) { while (count != 0) @@ -31,7 +26,7 @@ void store_u16(unsigned char* buffer, unsigned address, const uint16_t* src, siz void load_u32(uint32_t* dst, const unsigned char* buffer, unsigned address, size_t count) { - /* Optimization for uint32_t */ + // Optimization for uint32_t memcpy(dst, u32(buffer, address), count * sizeof(uint32_t)); } @@ -47,6 +42,6 @@ void load_u16(uint16_t* dst, const unsigned char* buffer, unsigned address, size void store_u32(unsigned char* buffer, unsigned address, const uint32_t* src, size_t count) { - /* Optimization for uint32_t */ + // Optimization for uint32_t memcpy(u32(buffer, address), src, count * sizeof(uint32_t)); -} \ No newline at end of file +} From 13d6fae9d8cbcca9844aa4359e67e908b73ac84f Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:23:01 -0600 Subject: [PATCH 18/40] Update mem.h Remove header, convert multiline comments into single line comments --- Source/Android/PluginRSP/mem.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Android/PluginRSP/mem.h b/Source/Android/PluginRSP/mem.h index b045d8bb4..2ab2b04a5 100644 --- a/Source/Android/PluginRSP/mem.h +++ b/Source/Android/PluginRSP/mem.h @@ -1,8 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once #include @@ -69,7 +64,7 @@ static inline void dmem_store_u32(CHle * hle, const uint32_t* src, uint16_t addr store_u32(hle->dmem(), address & 0xfff, src, count); } -/* convenient functions DRAM access */ +// Convenient functions DRAM access static inline uint8_t* dram_u8(CHle * hle, uint32_t address) { return u8(hle->dram(), address & 0xffffff); From 8b36f3d63792695b54e0b469ce63f2b21eccd990 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:24:43 -0600 Subject: [PATCH 19/40] Update Rsp.h Convert multiline comment into single line comment, capitalize DWORD, add hyphen to 32-bits, correct typo, and change "pre bswap" to "pre-bswap'd" --- Source/Android/PluginRSP/Rsp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Android/PluginRSP/Rsp.h b/Source/Android/PluginRSP/Rsp.h index 7cd5de457..22dec66f9 100644 --- a/Source/Android/PluginRSP/Rsp.h +++ b/Source/Android/PluginRSP/Rsp.h @@ -5,8 +5,7 @@ typedef struct { void * hInst; - int32_t MemoryBswaped; /* If this is set to TRUE, then the memory has been pre - bswap on a dword (32 bits) boundry */ + int32_t MemoryBswaped; // If this is set to TRUE, then the memory has been pre-bswap'd on a DWORD (32-bits) boundary uint8_t * RDRAM; uint8_t * DMEM; uint8_t * IMEM; From ee899b1757f26788657fc0bf53339d06522d0559 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Sat, 13 Mar 2021 04:24:52 -0600 Subject: [PATCH 20/40] Update stdafx.cpp Add newline --- Source/Android/PluginRSP/stdafx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/PluginRSP/stdafx.cpp b/Source/Android/PluginRSP/stdafx.cpp index 1577c4e3b..fd4f341c7 100644 --- a/Source/Android/PluginRSP/stdafx.cpp +++ b/Source/Android/PluginRSP/stdafx.cpp @@ -1 +1 @@ -#include "stdafx.h" \ No newline at end of file +#include "stdafx.h" From dd65b9c0e27a8a19137e50b0d42c0eed91aa7c34 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Mon, 15 Mar 2021 23:57:14 -0500 Subject: [PATCH 21/40] Update jniBridge.cpp Change multi-line comments into single line comments, fix some typos, remove some title case, improve grammar, update some things for consistency --- Source/Android/Bridge/jniBridge.cpp | 49 +++++++++++++++-------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/Source/Android/Bridge/jniBridge.cpp b/Source/Android/Bridge/jniBridge.cpp index 6233df79e..c5c770d94 100644 --- a/Source/Android/Bridge/jniBridge.cpp +++ b/Source/Android/Bridge/jniBridge.cpp @@ -116,7 +116,7 @@ static void watch_uninstall(const char *baseDir) inotify_rm_watch(fileDescriptor, IN_DELETE); __android_log_print(ANDROID_LOG_INFO, "watch_uninstall", "closing the INOTIFY instance"); close(fileDescriptor); - __android_log_print(ANDROID_LOG_INFO, "watch_uninstall", "Waiting to test if dir removed"); + __android_log_print(ANDROID_LOG_INFO, "watch_uninstall", "Waiting to test if directory removed"); pjutil::Sleep(2000); __android_log_print(ANDROID_LOG_INFO, "watch_uninstall", "Sleep Done"); @@ -144,10 +144,10 @@ EXPORT jint CALL JNI_OnLoad(JavaVM* vm, void* reserved) __android_log_print(ANDROID_LOG_ERROR, "jniBridge", "Failed to get the environment using GetEnv()"); return -1; } - /* - * Create mThreadKey so we can keep track of the JNIEnv assigned to each thread - * Refer to http://developer.android.com/guide/practices/design/jni.html for the rationale behind this - */ + + // Create mThreadKey so we can keep track of the JNIEnv assigned to each thread + // Refer to http://developer.android.com/guide/practices/design/jni.html for the rationale behind this + if (pthread_key_create(&g_ThreadKey, Android_JNI_ThreadDestroyed) != 0) { __android_log_print(ANDROID_LOG_ERROR, "jniBridge", "Error initializing pthread key"); @@ -172,7 +172,7 @@ void AddRecentRom(const char * ImagePath) if (ImagePath == NULL) { return; } WriteTrace(TraceUserInterface, TraceDebug, "Start (ImagePath: %s)", ImagePath); - //Get Information about the stored rom list + // Get information about the stored ROM list size_t MaxRememberedFiles = UISettingsLoadDword(File_RecentGameFileCount); strlist RecentGames; size_t i; @@ -186,7 +186,7 @@ void AddRecentRom(const char * ImagePath) RecentGames.push_back(RecentGame); } - //See if the game is already in the list if so then move it to the top of the list + // See if the game is already in the list, and if so then move it to the top of the list strlist::iterator iter; for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++) { @@ -238,7 +238,7 @@ void GameCpuRunning(void * /*NotUsed*/) { if (g_JavaBridge) { - WriteTrace(TraceUserInterface, TraceDebug, "Notify java emulation stopped"); + WriteTrace(TraceUserInterface, TraceDebug, "Notify Java emulation stopped"); g_JavaBridge->EmulationStarted(); } else @@ -248,7 +248,7 @@ void GameCpuRunning(void * /*NotUsed*/) } else { - WriteTrace(TraceUserInterface, TraceError, "Failed to get java environment"); + WriteTrace(TraceUserInterface, TraceError, "Failed to get Java environment"); } } else @@ -257,7 +257,7 @@ void GameCpuRunning(void * /*NotUsed*/) { if (g_JavaBridge) { - WriteTrace(TraceUserInterface, TraceDebug, "Notify java emulation stopped"); + WriteTrace(TraceUserInterface, TraceDebug, "Notify Java emulation stopped"); g_JavaBridge->EmulationStopped(); } else @@ -266,11 +266,11 @@ void GameCpuRunning(void * /*NotUsed*/) } // call in to java that emulation done - WriteTrace(TraceUserInterface, TraceDebug, "clean up global activity"); + WriteTrace(TraceUserInterface, TraceDebug, "Clean up global activity"); env->DeleteGlobalRef(g_Activity); g_Activity = NULL; - WriteTrace(TraceUserInterface, TraceDebug, "clean up global gl thread"); + WriteTrace(TraceUserInterface, TraceDebug, "Clean up global gl thread"); if (g_JavaBridge) { g_JavaBridge->GfxThreadDone(); @@ -306,7 +306,7 @@ EXPORT jboolean CALL Java_emu_project64_jni_NativeExports_appInit(JNIEnv* env, j if (g_JavaVM == NULL) { - Notify().DisplayError("No java VM"); + Notify().DisplayError("No Java VM"); return false; } @@ -392,7 +392,7 @@ EXPORT jboolean CALL Java_emu_project64_jni_NativeExports_IsSettingSet(JNIEnv* e EXPORT void CALL Java_emu_project64_jni_NativeExports_LoadRomList(JNIEnv* env, jclass cls) { - WriteTrace(TraceUserInterface, TraceDebug, "start"); + WriteTrace(TraceUserInterface, TraceDebug, "Start"); if (g_JavaRomList == NULL) { g_JavaRomList = new CJavaRomList; @@ -451,14 +451,14 @@ EXPORT void CALL Java_emu_project64_jni_NativeExports_ExternalEvent(JNIEnv* env, EXPORT void CALL Java_emu_project64_jni_NativeExports_ResetApplicationSettings(JNIEnv* env, jclass cls) { - WriteTrace(TraceUserInterface, TraceDebug, "start"); + WriteTrace(TraceUserInterface, TraceDebug, "Start"); CSettingTypeApplication::ResetAll(); WriteTrace(TraceUserInterface, TraceDebug, "Done"); } EXPORT jbyteArray CALL Java_emu_project64_jni_NativeExports_GetString(JNIEnv* env, jclass cls, int StringID) { - WriteTrace(TraceUserInterface, TraceDebug, "start (StringID: %d)", StringID); + WriteTrace(TraceUserInterface, TraceDebug, "Start (StringID: %d)", StringID); jbyteArray result = NULL; if (g_Lang) { @@ -479,7 +479,7 @@ EXPORT jbyteArray CALL Java_emu_project64_jni_NativeExports_GetString(JNIEnv* en EXPORT void CALL Java_emu_project64_jni_NativeExports_SetSpeed(JNIEnv* env, jclass cls, int Speed) { - WriteTrace(TraceUserInterface, TraceDebug, "start (Speed: %d)", Speed); + WriteTrace(TraceUserInterface, TraceDebug, "Start (Speed: %d)", Speed); if (g_BaseSystem) { g_BaseSystem->SetSpeed(Speed); @@ -490,7 +490,7 @@ EXPORT void CALL Java_emu_project64_jni_NativeExports_SetSpeed(JNIEnv* env, jcla EXPORT int CALL Java_emu_project64_jni_NativeExports_GetSpeed(JNIEnv* env, jclass cls) { int speed = 0; - WriteTrace(TraceUserInterface, TraceDebug, "start"); + WriteTrace(TraceUserInterface, TraceDebug, "Start"); if (g_BaseSystem) { speed = g_BaseSystem->GetSpeed(); @@ -502,7 +502,7 @@ EXPORT int CALL Java_emu_project64_jni_NativeExports_GetSpeed(JNIEnv* env, jclas EXPORT int CALL Java_emu_project64_jni_NativeExports_GetBaseSpeed(JNIEnv* env, jclass cls) { int speed = 0; - WriteTrace(TraceUserInterface, TraceDebug, "start"); + WriteTrace(TraceUserInterface, TraceDebug, "Start"); if (g_BaseSystem) { speed = g_BaseSystem->GetBaseSpeed(); @@ -629,7 +629,7 @@ static void Android_JNI_ThreadDestroyed(void* value) { __android_log_print(ANDROID_LOG_ERROR, "Android_JNI_ThreadDestroyed", "start"); - /* The thread is being destroyed, detach it from the Java VM and set the mThreadKey value to NULL as required */ + // The thread is being destroyed, detach it from the Java VM and set the mThreadKey value to NULL as required JNIEnv *env = (JNIEnv*)value; if (env != NULL) { @@ -641,10 +641,11 @@ static void Android_JNI_ThreadDestroyed(void* value) JNIEnv* Android_JNI_GetEnv(void) { - /* From http://developer.android.com/guide/practices/jni.html + /* + * From http://developer.android.com/guide/practices/jni.html * All threads are Linux threads, scheduled by the kernel. * They're usually started from managed code (using Thread.start), but they can also be created elsewhere and then - * attached to the JavaVM. For example, a thread started with pthread_create can be attached with the + * attached to the Java VM. For example, a thread started with pthread_create can be attached with the * JNI AttachCurrentThread or AttachCurrentThreadAsDaemon functions. Until a thread is attached, it has no JNIEnv, * and cannot make JNI calls. * Attaching a natively-created thread causes a java.lang.Thread object to be constructed and added to the "main" @@ -657,7 +658,7 @@ JNIEnv* Android_JNI_GetEnv(void) int status = g_JavaVM->AttachCurrentThread(&env, NULL); if (status < 0) { - __android_log_print(ANDROID_LOG_ERROR, "jniBridge", "failed to attach current thread"); + __android_log_print(ANDROID_LOG_ERROR, "jniBridge", "Failed to attach current thread"); return 0; } @@ -679,4 +680,4 @@ void Android_JNI_SetupThread(void) Android_JNI_GetEnv(); } -#endif \ No newline at end of file +#endif From e6fc59d7d7d82159bced394283cc7554aa0d5e4d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Mon, 15 Mar 2021 23:59:26 -0500 Subject: [PATCH 22/40] Update NotificationClass.cpp Add some spaces after comments begin, remove some title case --- Source/Android/Bridge/NotificationClass.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Android/Bridge/NotificationClass.cpp b/Source/Android/Bridge/NotificationClass.cpp index fbef4edf1..0b2f43ccf 100644 --- a/Source/Android/Bridge/NotificationClass.cpp +++ b/Source/Android/Bridge/NotificationClass.cpp @@ -32,7 +32,7 @@ void CNotificationImp::DisplayError(const char * Message) const #ifdef ANDROID g_JavaBridge->DisplayError(Message); #else - Message = NULL; // not used + Message = NULL; // Not used #endif } @@ -67,7 +67,7 @@ void CNotificationImp::DisplayWarning(const char * Message) const #ifdef ANDROID g_JavaBridge->DisplayError(Message); #else - Message = NULL; // not used + Message = NULL; // Not used #endif } @@ -84,14 +84,14 @@ void CNotificationImp::DisplayMessage(int DisplayTime, LanguageStringID StringID DisplayMessage(DisplayTime, g_Lang->GetString(StringID).c_str()); } -//User Feedback +// User feedback void CNotificationImp::DisplayMessage(int DisplayTime, const char * Message) const { #ifdef ANDROID if (g_JavaBridge == NULL) { return; } g_JavaBridge->DisplayMessage(Message, DisplayTime); #else - // ignore warning usage + // Ignore warning usage DisplayTime = DisplayTime; Message = Message; #endif @@ -104,12 +104,12 @@ void CNotificationImp::DisplayMessage2(const char * Message) const g_JavaBridge->DisplayMessage2(Message); #else - // ignore warning usage + // Ignore warning usage Message = Message; #endif } -// Ask a Yes/No Question to the user, yes = true, no = false +// Ask a yes/no question to the user, yes = true, no = false bool CNotificationImp::AskYesNoQuestion(const char * /*Question*/) const { return false; From 27e0080393a8a140796950762e5b982cb8047c7a Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:03:05 -0500 Subject: [PATCH 23/40] Update Controller_1.1.h Change multi-line comments into single line comments, fix some typos, remove some title case, improve grammar, update some things for consistency, fix abbreviations --- Source/Android/PluginInput/Controller_1.1.h | 120 +++++++++++--------- 1 file changed, 67 insertions(+), 53 deletions(-) diff --git a/Source/Android/PluginInput/Controller_1.1.h b/Source/Android/PluginInput/Controller_1.1.h index 7e7dae4e5..f136fbf07 100644 --- a/Source/Android/PluginInput/Controller_1.1.h +++ b/Source/Android/PluginInput/Controller_1.1.h @@ -1,13 +1,13 @@ -/********************************************************************************** -Common Controller plugin spec, version #1.1 -**********************************************************************************/ +// Common controller plugin specification, version 1.1 + #pragma once #include enum { PLUGIN_TYPE_CONTROLLER = 4 }; -/*** Conteroller plugin's ****/ +// Controller plugins + enum { PLUGIN_NONE = 1, @@ -25,12 +25,13 @@ enum #define CALL #endif -/***** Structures *****/ +// Structures + typedef struct { - uint16_t Version; /* Should be set to 0x0101 */ - uint16_t Type; /* Set to PLUGIN_TYPE_CONTROLLER */ - char Name[100]; /* Name of the DLL */ + uint16_t Version; // Should be set to 0x0101 + uint16_t Type; // Set to PLUGIN_TYPE_CONTROLLER + char Name[100]; // Name of the DLL int32_t Reserved1; int32_t Reserved2; } PLUGIN_INFO; @@ -43,7 +44,7 @@ typedef struct } CONTROL; #pragma warning(push) -#pragma warning(disable : 4201) // warning C4201: nonstandard extension used : nameless struct/union +#pragma warning(disable : 4201) // warning C4201: nonstandard extension used: nameless struct/union typedef union { @@ -80,26 +81,27 @@ typedef struct void * hMainWindow; void * hinst; - int32_t MemoryBswaped; // memory in client- or server-native endian - uint8_t * HEADER; // the ROM header (first 40h bytes of the ROM) - CONTROL * Controls; // pointer to array of 4 controllers, i.e.: CONTROL Controls[4]; + int32_t MemoryBswaped; // Memory in client or server-native endian + uint8_t * HEADER; // The ROM header (first 40h bytes of the ROM) + CONTROL * Controls; // Pointer to array of 4 controllers, i.e.: CONTROL Controls[4]; } CONTROL_INFO; -/****************************************************************** +/* Function: CloseDLL Purpose: This function is called when the emulator is closing -down allowing the dll to de-initialise. +down allowing the DLL to de-initialize. input: none output: none -*******************************************************************/ +*/ + EXPORT void CALL CloseDLL(void); -/****************************************************************** +/* Function: ControllerCommand Purpose: To process the raw data that has just been sent to a specific controller. -input: - Controller Number (0 to 3) and -1 signalling end of -processing the pif ram. +input: - Controller Number (0 to 3) and -1 signaling end of +processing the PIF RAM. - Pointer of data to be processed. output: none @@ -107,113 +109,125 @@ note: This function is only needed if the DLL is allowing raw data, or the plugin is set to raw the data that is being processed looks like this: -initilize controller: 01 03 00 FF FF FF +initialize controller: 01 03 00 FF FF FF read controller: 01 04 01 FF FF FF FF -*******************************************************************/ +*/ + EXPORT void CALL ControllerCommand(int Control, uint8_t * Command); -/****************************************************************** +/* Function: DllAbout Purpose: This function is optional function that is provided to give further information about the DLL. input: a handle to the window that calls this function output: none -*******************************************************************/ +*/ + EXPORT void CALL DllAbout(void * hParent); -/****************************************************************** +/* Function: DllConfig Purpose: This function is optional function that is provided -to allow the user to configure the dll +to allow the user to configure the DLL input: a handle to the window that calls this function output: none -*******************************************************************/ +*/ + EXPORT void CALL DllConfig(void * hParent); -/****************************************************************** +/* Function: DllTest Purpose: This function is optional function that is provided -to allow the user to test the dll +to allow the user to test the DLL input: a handle to the window that calls this function output: none -*******************************************************************/ +*/ + EXPORT void CALL DllTest(void * hParent); -/****************************************************************** +/* Function: GetDllInfo Purpose: This function allows the emulator to gather information -about the dll by filling in the PluginInfo structure. -input: a pointer to a PLUGIN_INFO stucture that needs to be +about the DLL by filling in the PluginInfo structure. +input: a pointer to a PLUGIN_INFO structure that needs to be filled by the function. (see def above) output: none -*******************************************************************/ +*/ + EXPORT void CALL GetDllInfo(PLUGIN_INFO * PluginInfo); -/****************************************************************** +/* Function: GetKeys Purpose: To get the current state of the controllers buttons. input: - Controller Number (0 to 3) - A pointer to a BUTTONS structure to be filled with the controller state. output: none -*******************************************************************/ +*/ + EXPORT void CALL GetKeys(int32_t Control, BUTTONS * Keys); -/****************************************************************** +/* Function: InitiateControllers -Purpose: This function initialises how each of the controllers +Purpose: This function initializes how each of the controllers should be handled. input: - The handle to the main window. - A controller structure that needs to be filled for the emulator to know how to handle each controller. output: none -*******************************************************************/ +*/ + EXPORT void CALL InitiateControllers(CONTROL_INFO ControlInfo); -/****************************************************************** +/* Function: ReadController -Purpose: To process the raw data in the pif ram that is about to +Purpose: To process the raw data in the PIF RAM that is about to be read. -input: - Controller Number (0 to 3) and -1 signalling end of -processing the pif ram. +input: - Controller Number (0 to 3) and -1 signaling end of +processing the PIF RAM. - Pointer of data to be processed. output: none note: This function is only needed if the DLL is allowing raw data. -*******************************************************************/ +*/ + EXPORT void CALL ReadController(int Control, uint8_t * Command); -/****************************************************************** +/* Function: RomClosed -Purpose: This function is called when a rom is closed. +Purpose: This function is called when a ROM is closed. input: none output: none -*******************************************************************/ +*/ + EXPORT void CALL RomClosed(void); -/****************************************************************** +/* Function: RomOpen -Purpose: This function is called when a rom is open. (from the +Purpose: This function is called when a ROM is open. (from the emulation thread) input: none output: none -*******************************************************************/ +*/ + EXPORT void CALL RomOpen(void); -/****************************************************************** +/* Function: WM_KeyDown Purpose: To pass the WM_KeyDown message from the emulator to the plugin. input: wParam and lParam of the WM_KEYDOWN message. output: none -*******************************************************************/ +*/ + EXPORT void CALL WM_KeyDown(uint32_t wParam, uint32_t lParam); -/****************************************************************** +/* Function: WM_KeyUp Purpose: To pass the WM_KEYUP message from the emulator to the plugin. input: wParam and lParam of the WM_KEYDOWN message. output: none -*******************************************************************/ -EXPORT void CALL WM_KeyUp(uint32_t wParam, uint32_t lParam); \ No newline at end of file +*/ + +EXPORT void CALL WM_KeyUp(uint32_t wParam, uint32_t lParam); From 3e442fc7bdebf1a4f704e77350e8a65d4f5da241 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:04:30 -0500 Subject: [PATCH 24/40] Update Main.cpp Fix typos, fix abbreviations, fix title case, and clean up some more spacing --- Source/Android/PluginInput/Main.cpp | 47 ++++++++++++++++++----------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/Source/Android/PluginInput/Main.cpp b/Source/Android/PluginInput/Main.cpp index 835d6f52c..bc25fd25e 100644 --- a/Source/Android/PluginInput/Main.cpp +++ b/Source/Android/PluginInput/Main.cpp @@ -15,10 +15,11 @@ void ShowAboutWindow (void * hParent); /****************************************************************** Function: CloseDLL Purpose: This function is called when the emulator is closing -down allowing the dll to de-initialise. +down allowing the DLL to de-initialize. input: none output: none *******************************************************************/ + EXPORT void CALL CloseDLL (void) { } @@ -27,8 +28,8 @@ EXPORT void CALL CloseDLL (void) Function: ControllerCommand Purpose: To process the raw data that has just been sent to a specific controller. -input: - Controller Number (0 to 3) and -1 signalling end of -processing the pif ram. +input: - Controller Number (0 to 3) and -1 signaling end of +processing the PIF RAM. - Pointer of data to be processed. output: none @@ -36,9 +37,10 @@ note: This function is only needed if the DLL is allowing raw data, or the plugin is set to raw the data that is being processed looks like this: -initilize controller: 01 03 00 FF FF FF +initialize controller: 01 03 00 FF FF FF read controller: 01 04 01 FF FF FF FF *******************************************************************/ + EXPORT void CALL ControllerCommand ( int /*Control*/, uint8_t * /*Command*/) { } @@ -50,6 +52,7 @@ to give further information about the DLL. input: a handle to the window that calls this function output: none *******************************************************************/ + EXPORT void CALL DllAbout ( void * hParent ) { #ifdef _WIN32 @@ -60,10 +63,11 @@ EXPORT void CALL DllAbout ( void * hParent ) /****************************************************************** Function: DllConfig Purpose: This function is optional function that is provided -to allow the user to configure the dll +to allow the user to configure the DLL input: a handle to the window that calls this function output: none *******************************************************************/ + EXPORT void CALL DllConfig ( void * /*hParent*/ ) { } @@ -71,10 +75,11 @@ EXPORT void CALL DllConfig ( void * /*hParent*/ ) /****************************************************************** Function: DllTest Purpose: This function is optional function that is provided -to allow the user to test the dll +to allow the user to test the DLL input: a handle to the window that calls this function output: none *******************************************************************/ + EXPORT void CALL DllTest ( void * /*hParent*/ ) { } @@ -82,19 +87,20 @@ EXPORT void CALL DllTest ( void * /*hParent*/ ) /****************************************************************** Function: GetDllInfo Purpose: This function allows the emulator to gather information -about the dll by filling in the PluginInfo structure. -input: a pointer to a PLUGIN_INFO stucture that needs to be +about the DLL by filling in the PluginInfo structure. +input: a pointer to a PLUGIN_INFO structure that needs to be filled by the function. (see def above) output: none *******************************************************************/ + EXPORT void CALL GetDllInfo ( PLUGIN_INFO * PluginInfo ) { PluginInfo->Version = 0x0101; PluginInfo->Type = PLUGIN_TYPE_CONTROLLER; #ifdef _DEBUG - sprintf(PluginInfo->Name, "Android Input Debug Plugin %s", VER_FILE_VERSION_STR); + sprintf(PluginInfo->Name, "Android input debug plugin %s", VER_FILE_VERSION_STR); #else - sprintf(PluginInfo->Name, "Android Input Plugin %s", VER_FILE_VERSION_STR); + sprintf(PluginInfo->Name, "Android input plugin %s", VER_FILE_VERSION_STR); #endif } @@ -106,6 +112,7 @@ input: - Controller Number (0 to 3) the controller state. output: none *******************************************************************/ + EXPORT void CALL GetKeys(int Control, BUTTONS * Keys ) { if (Control == 0) @@ -116,13 +123,14 @@ EXPORT void CALL GetKeys(int Control, BUTTONS * Keys ) /****************************************************************** Function: InitiateControllers -Purpose: This function initialises how each of the controllers +Purpose: This function initializes how each of the controllers should be handled. input: - The handle to the main window. - A controller structure that needs to be filled for the emulator to know how to handle each controller. output: none *******************************************************************/ + EXPORT void CALL InitiateControllers (CONTROL_INFO ControlInfo) { g_control_info = ControlInfo; @@ -132,36 +140,39 @@ EXPORT void CALL InitiateControllers (CONTROL_INFO ControlInfo) /****************************************************************** Function: ReadController -Purpose: To process the raw data in the pif ram that is about to +Purpose: To process the raw data in the PIF RAM that is about to be read. -input: - Controller Number (0 to 3) and -1 signalling end of -processing the pif ram. +input: - Controller Number (0 to 3) and -1 signaling end of +processing the PIF RAM. - Pointer of data to be processed. output: none note: This function is only needed if the DLL is allowing raw data. *******************************************************************/ + EXPORT void CALL ReadController ( int /*Control*/, uint8_t * /*Command*/ ) { } /****************************************************************** Function: RomClosed -Purpose: This function is called when a rom is closed. +Purpose: This function is called when a ROM is closed. input: none output: none *******************************************************************/ + EXPORT void CALL RomClosed (void) { } /****************************************************************** Function: RomOpen -Purpose: This function is called when a rom is open. (from the +Purpose: This function is called when a ROM is open. (from the emulation thread) input: none output: none *******************************************************************/ + EXPORT void CALL RomOpen (void) { memset(&g_buttons, 0, sizeof(g_buttons)); @@ -174,6 +185,7 @@ plugin. input: wParam and lParam of the WM_KEYDOWN message. output: none *******************************************************************/ + EXPORT void CALL WM_KeyDown( uint32_t /*wParam*/, uint32_t /*lParam*/ ) { } @@ -185,6 +197,7 @@ plugin. input: wParam and lParam of the WM_KEYDOWN message. output: none *******************************************************************/ + EXPORT void CALL WM_KeyUp( uint32_t /*wParam*/, uint32_t /*lParam*/ ) { } @@ -216,4 +229,4 @@ EXPORT void CALL Java_emu_project64_jni_NativeInput_setState(JNIEnv* env, jclass } env->ReleaseBooleanArrayElements(Buttons, elements, 0); } -#endif \ No newline at end of file +#endif From 68c3b7e45932cb74f396977d4f6528303ca8b738 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:08:10 -0500 Subject: [PATCH 25/40] Update alist.cpp Fix title case, fix typos, change from multi-line comments to single line comments, fix abbreviations, add some spacing, remove some leftover headers, add newline --- Source/Android/PluginRSP/alist.cpp | 137 ++++++++++++++--------------- 1 file changed, 66 insertions(+), 71 deletions(-) diff --git a/Source/Android/PluginRSP/alist.cpp b/Source/Android/PluginRSP/alist.cpp index 5ccd903e2..ac7c2c5c3 100644 --- a/Source/Android/PluginRSP/alist.cpp +++ b/Source/Android/PluginRSP/alist.cpp @@ -1,10 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include #include "alist.h" @@ -19,7 +12,8 @@ struct ramp_t int64_t target; }; -/* local functions */ +// Local functions + static void swap(int16_t **a, int16_t **b) { int16_t* tmp = *b; @@ -74,7 +68,8 @@ static int16_t ramp_step(struct ramp_t* ramp) return (int16_t)(ramp->value >> 16); } -/* global functions */ +// Global functions + void alist_process(CHle * hle, const acmd_callback_t abi[], unsigned int abi_size) { uint32_t w1, w2; @@ -140,7 +135,7 @@ void alist_clear(CHle * hle, uint16_t dmem, uint16_t count) void alist_load(CHle * hle, uint16_t dmem, uint32_t address, uint16_t count) { - /* enforce DMA alignment constraints */ + // Enforce DMA alignment constraints dmem &= ~3; address &= ~7; count = align(count, 8); @@ -149,7 +144,7 @@ void alist_load(CHle * hle, uint16_t dmem, uint32_t address, uint16_t count) void alist_save(CHle * hle, uint16_t dmem, uint32_t address, uint16_t count) { - /* enforce DMA alignment constraints */ + // Enforce DMA alignment constraints dmem &= ~3; address &= ~7; count = align(count, 8); @@ -271,19 +266,19 @@ void alist_envmix_exp( CHle * hle, bool init, bool aux, uint16_t dmem_dl, uint16 } else { - wet = *(int16_t *)(save_buffer + 0); /* 0-1 */ - dry = *(int16_t *)(save_buffer + 2); /* 2-3 */ - ramps[0].target = *(int32_t *)(save_buffer + 4); /* 4-5 */ - ramps[1].target = *(int32_t *)(save_buffer + 6); /* 6-7 */ - exp_rates[0] = *(int32_t *)(save_buffer + 8); /* 8-9 (save_buffer is a 16bit pointer) */ - exp_rates[1] = *(int32_t *)(save_buffer + 10); /* 10-11 */ - exp_seq[0] = *(int32_t *)(save_buffer + 12); /* 12-13 */ - exp_seq[1] = *(int32_t *)(save_buffer + 14); /* 14-15 */ - ramps[0].value = *(int32_t *)(save_buffer + 16); /* 12-13 */ - ramps[1].value = *(int32_t *)(save_buffer + 18); /* 14-15 */ + wet = *(int16_t *)(save_buffer + 0); // 0-1 + dry = *(int16_t *)(save_buffer + 2); // 2-3 + ramps[0].target = *(int32_t *)(save_buffer + 4); // 4-5 + ramps[1].target = *(int32_t *)(save_buffer + 6); // 6-7 + exp_rates[0] = *(int32_t *)(save_buffer + 8); // 8-9 (save_buffer is a 16-bit pointer) + exp_rates[1] = *(int32_t *)(save_buffer + 10); // 10-11 + exp_seq[0] = *(int32_t *)(save_buffer + 12); // 12-13 + exp_seq[1] = *(int32_t *)(save_buffer + 14); // 14-15 + ramps[0].value = *(int32_t *)(save_buffer + 16); // 12-13 + ramps[1].value = *(int32_t *)(save_buffer + 18); // 14-15 } - /* init which ensure ramp.step != 0 iff ramp.value == ramp.target */ + // init which ensure ramp.step != 0 iff ramp.value == ramp.target ramps[0].step = ramps[0].target - ramps[0].value; ramps[1].step = ramps[1].target - ramps[1].value; @@ -323,16 +318,16 @@ void alist_envmix_exp( CHle * hle, bool init, bool aux, uint16_t dmem_dl, uint16 } } - *(int16_t *)(save_buffer + 0) = wet; /* 0-1 */ - *(int16_t *)(save_buffer + 2) = dry; /* 2-3 */ - *(int32_t *)(save_buffer + 4) = (int32_t)ramps[0].target; /* 4-5 */ - *(int32_t *)(save_buffer + 6) = (int32_t)ramps[1].target; /* 6-7 */ - *(int32_t *)(save_buffer + 8) = exp_rates[0]; /* 8-9 (save_buffer is a 16bit pointer) */ - *(int32_t *)(save_buffer + 10) = exp_rates[1]; /* 10-11 */ - *(int32_t *)(save_buffer + 12) = exp_seq[0]; /* 12-13 */ - *(int32_t *)(save_buffer + 14) = exp_seq[1]; /* 14-15 */ - *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; /* 12-13 */ - *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; /* 14-15 */ + *(int16_t *)(save_buffer + 0) = wet; // 0-1 + *(int16_t *)(save_buffer + 2) = dry; // 2-3 + *(int32_t *)(save_buffer + 4) = (int32_t)ramps[0].target; // 4-5 + *(int32_t *)(save_buffer + 6) = (int32_t)ramps[1].target; // 6-7 + *(int32_t *)(save_buffer + 8) = exp_rates[0]; // 8-9 (save_buffer is a 16-bit pointer) + *(int32_t *)(save_buffer + 10) = exp_rates[1]; // 10-11 + *(int32_t *)(save_buffer + 12) = exp_seq[0]; // 12-13 + *(int32_t *)(save_buffer + 14) = exp_seq[1]; // 14-15 + *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; // 12-13 + *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; // 14-15 memcpy(hle->dram() + address, (uint8_t *)save_buffer, sizeof(save_buffer)); } @@ -362,16 +357,16 @@ void alist_envmix_ge( CHle * hle, bool init, bool aux, uint16_t dmem_dl, uint16_ } else { - wet = *(int16_t *)(save_buffer + 0); /* 0-1 */ - dry = *(int16_t *)(save_buffer + 2); /* 2-3 */ - ramps[0].target = *(int32_t *)(save_buffer + 4); /* 4-5 */ - ramps[1].target = *(int32_t *)(save_buffer + 6); /* 6-7 */ - ramps[0].step = *(int32_t *)(save_buffer + 8); /* 8-9 (save_buffer is a 16bit pointer) */ - ramps[1].step = *(int32_t *)(save_buffer + 10); /* 10-11 */ - /* *(int32_t *)(save_buffer + 12);*/ /* 12-13 */ - /* *(int32_t *)(save_buffer + 14);*/ /* 14-15 */ - ramps[0].value = *(int32_t *)(save_buffer + 16); /* 12-13 */ - ramps[1].value = *(int32_t *)(save_buffer + 18); /* 14-15 */ + wet = *(int16_t *)(save_buffer + 0); // 0-1 + dry = *(int16_t *)(save_buffer + 2); // 2-3 + ramps[0].target = *(int32_t *)(save_buffer + 4); // 4-5 + ramps[1].target = *(int32_t *)(save_buffer + 6); // 6-7 + ramps[0].step = *(int32_t *)(save_buffer + 8); // 8-9 (save_buffer is a 16-bit pointer) + ramps[1].step = *(int32_t *)(save_buffer + 10); // 10-11 + /* *(int32_t *)(save_buffer + 12);*/ // 12-13 + /* *(int32_t *)(save_buffer + 14);*/ // 14-15 + ramps[0].value = *(int32_t *)(save_buffer + 16); // 12-13 + ramps[1].value = *(int32_t *)(save_buffer + 18); // 14-15 } count >>= 1; @@ -395,16 +390,16 @@ void alist_envmix_ge( CHle * hle, bool init, bool aux, uint16_t dmem_dl, uint16_ alist_envmix_mix(n, buffers, gains, in[k^S]); } - *(int16_t *)(save_buffer + 0) = wet; /* 0-1 */ - *(int16_t *)(save_buffer + 2) = dry; /* 2-3 */ - *(int32_t *)(save_buffer + 4) = (int32_t)ramps[0].target; /* 4-5 */ - *(int32_t *)(save_buffer + 6) = (int32_t)ramps[1].target; /* 6-7 */ - *(int32_t *)(save_buffer + 8) = (int32_t)ramps[0].step; /* 8-9 (save_buffer is a 16bit pointer) */ - *(int32_t *)(save_buffer + 10) = (int32_t)ramps[1].step; /* 10-11 */ - /**(int32_t *)(save_buffer + 12);*/ /* 12-13 */ - /**(int32_t *)(save_buffer + 14);*/ /* 14-15 */ - *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; /* 12-13 */ - *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; /* 14-15 */ + *(int16_t *)(save_buffer + 0) = wet; // 0-1 + *(int16_t *)(save_buffer + 2) = dry; // 2-3 + *(int32_t *)(save_buffer + 4) = (int32_t)ramps[0].target; // 4-5 + *(int32_t *)(save_buffer + 6) = (int32_t)ramps[1].target; // 6-7 + *(int32_t *)(save_buffer + 8) = (int32_t)ramps[0].step; // 8-9 (save_buffer is a 16-bit pointer) + *(int32_t *)(save_buffer + 10) = (int32_t)ramps[1].step; // 10-11 + /**(int32_t *)(save_buffer + 12);*/ // 12-13 + /**(int32_t *)(save_buffer + 14);*/ // 14-15 + *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; // 12-13 + *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; // 14-15 memcpy(hle->dram() + address, (uint8_t *)save_buffer, 80); } @@ -432,14 +427,14 @@ void alist_envmix_lin(CHle * hle, bool init, uint16_t dmem_dl, uint16_t dmem_dr, } else { - wet = *(int16_t *)(save_buffer + 0); /* 0-1 */ - dry = *(int16_t *)(save_buffer + 2); /* 2-3 */ - ramps[0].target = *(int16_t *)(save_buffer + 4) << 16; /* 4-5 */ - ramps[1].target = *(int16_t *)(save_buffer + 6) << 16; /* 6-7 */ - ramps[0].step = *(int32_t *)(save_buffer + 8); /* 8-9 (save_buffer is a 16bit pointer) */ - ramps[1].step = *(int32_t *)(save_buffer + 10); /* 10-11 */ - ramps[0].value = *(int32_t *)(save_buffer + 16); /* 16-17 */ - ramps[1].value = *(int32_t *)(save_buffer + 18); /* 16-17 */ + wet = *(int16_t *)(save_buffer + 0); // 0-1 + dry = *(int16_t *)(save_buffer + 2); // 2-3 + ramps[0].target = *(int16_t *)(save_buffer + 4) << 16; // 4-5 + ramps[1].target = *(int16_t *)(save_buffer + 6) << 16; // 6-7 + ramps[0].step = *(int32_t *)(save_buffer + 8); // 8-9 (save_buffer is a 16-bit pointer) + ramps[1].step = *(int32_t *)(save_buffer + 10); // 10-11 + ramps[0].value = *(int32_t *)(save_buffer + 16); // 16-17 + ramps[1].value = *(int32_t *)(save_buffer + 18); // 16-17 } count >>= 1; @@ -463,14 +458,14 @@ void alist_envmix_lin(CHle * hle, bool init, uint16_t dmem_dl, uint16_t dmem_dr, alist_envmix_mix(4, buffers, gains, in[k^S]); } - *(int16_t *)(save_buffer + 0) = wet; /* 0-1 */ - *(int16_t *)(save_buffer + 2) = dry; /* 2-3 */ - *(int16_t *)(save_buffer + 4) = (int16_t)(ramps[0].target >> 16); /* 4-5 */ - *(int16_t *)(save_buffer + 6) = (int16_t)(ramps[1].target >> 16); /* 6-7 */ - *(int32_t *)(save_buffer + 8) = (int32_t)ramps[0].step; /* 8-9 (save_buffer is a 16bit pointer) */ - *(int32_t *)(save_buffer + 10) = (int32_t)ramps[1].step; /* 10-11 */ - *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; /* 16-17 */ - *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; /* 18-19 */ + *(int16_t *)(save_buffer + 0) = wet; // 0-1 + *(int16_t *)(save_buffer + 2) = dry; // 2-3 + *(int16_t *)(save_buffer + 4) = (int16_t)(ramps[0].target >> 16); // 4-5 + *(int16_t *)(save_buffer + 6) = (int16_t)(ramps[1].target >> 16); // 6-7 + *(int32_t *)(save_buffer + 8) = (int32_t)ramps[0].step; // 8-9 (save_buffer is a 16-bit pointer) + *(int32_t *)(save_buffer + 10) = (int32_t)ramps[1].step; // 10-11 + *(int32_t *)(save_buffer + 16) = (int32_t)ramps[0].value; // 16-17 + *(int32_t *)(save_buffer + 18) = (int32_t)ramps[1].value; // 18-19 memcpy(hle->dram() + address, (uint8_t *)save_buffer, 80); } @@ -499,7 +494,7 @@ void alist_envmix_nead( CHle * hle, bool swap_wet_LR, uint16_t dmem_dl, uint16_t int16_t *wl = (int16_t*)(hle->alist_buffer() + dmem_wl); int16_t *wr = (int16_t*)(hle->alist_buffer() + dmem_wr); - /* make sure count is a multiple of 8 */ + // Make sure count is a multiple of 8 count = align(count, 8); if (swap_wet_LR) @@ -769,7 +764,7 @@ void alist_filter( CHle * hle, uint16_t dmem,uint16_t count, uint32_t address, c v[1] += in1[4] * lutt6[2]; v[1] += in1[7] * lutt6[3]; v[1] += in1[6] * lutt6[0]; - v[1] += in2[1] * lutt6[1]; /* 1 */ + v[1] += in2[1] * lutt6[1]; // 1 v[0] = in1[3] * lutt6[6]; v[0] += in1[2] * lutt6[7]; @@ -957,4 +952,4 @@ void alist_iirf(CHle * hle, bool init, uint16_t dmemo, uint16_t dmemi, uint16_t dram_store_u16(hle, (uint16_t*)&frame[6], address + 4, 4); dram_store_u16(hle, (uint16_t*)&ibuf[(index-2)&3], address+8, 2); dram_store_u16(hle, (uint16_t*)&ibuf[(index-1)&3], address+10, 2); -} \ No newline at end of file +} From 8bc1ce355cbfd80258e2f8db30d36fd63b412825 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:14:09 -0500 Subject: [PATCH 26/40] Update alist_audio.cpp Remove some title case, fix typos, fix abbreviations, add some spacing, add newline, remove leftover header --- Source/Android/PluginRSP/alist_audio.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Source/Android/PluginRSP/alist_audio.cpp b/Source/Android/PluginRSP/alist_audio.cpp index d36a47d56..ff2896adc 100644 --- a/Source/Android/PluginRSP/alist_audio.cpp +++ b/Source/Android/PluginRSP/alist_audio.cpp @@ -1,10 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include @@ -16,7 +9,8 @@ enum { DMEM_BASE = 0x5c0 }; -/* helper functions */ +// Helper functions + static uint32_t get_address(CHle * hle, uint32_t so) { return alist_get_address(hle, so, hle->alist_audio().segments, N_SEGMENTS); @@ -32,7 +26,8 @@ static void clear_segments(CHle * hle) memset(hle->alist_audio().segments, 0, N_SEGMENTS*sizeof(hle->alist_audio().segments[0])); } -/* audio commands definition */ +// Audio commands definition + static void SPNOOP(CHle * UNUSED(hle), uint32_t UNUSED(w1), uint32_t UNUSED(w2)) { } @@ -142,7 +137,7 @@ static void ADPCM(CHle * hle, uint32_t w1, uint32_t w2) hle, flags & 0x1, flags & 0x2, - false, /* unsupported in this ucode */ + false, // Unsupported in this microcode hle->alist_audio().out, hle->alist_audio().in, align(hle->alist_audio().count, 32), @@ -260,7 +255,8 @@ static void POLEF(CHle * hle, uint32_t w1, uint32_t w2) address); } -/* global functions */ +// Global functions + void alist_process_audio(CHle * hle) { static const acmd_callback_t ABI[0x10] = { @@ -300,4 +296,4 @@ void alist_process_audio_bc(CHle * hle) clear_segments(hle); alist_process(hle, ABI, 0x10); -} \ No newline at end of file +} From 82a551bc9790e208e48d241d4491a3451c8dca8e Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:16:28 -0500 Subject: [PATCH 27/40] Update alist_naudio.cpp Remove leftover header, add punctuation, remove title case, improved grammar, add newline --- Source/Android/PluginRSP/alist_naudio.cpp | 32 +++++++++++------------ 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Source/Android/PluginRSP/alist_naudio.cpp b/Source/Android/PluginRSP/alist_naudio.cpp index 33f99038a..61f3a0caf 100644 --- a/Source/Android/PluginRSP/alist_naudio.cpp +++ b/Source/Android/PluginRSP/alist_naudio.cpp @@ -1,16 +1,9 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include "alist.h" #include "mem.h" -enum { NAUDIO_COUNT = 0x170 }; /* ie 184 samples */ +enum { NAUDIO_COUNT = 0x170 }; // i.e. 184 samples enum { NAUDIO_MAIN = 0x4f0, NAUDIO_MAIN2 = 0x660, @@ -20,7 +13,8 @@ enum { NAUDIO_WET_RIGHT = 0xe20 }; -/* audio commands definition */ +// Audio commands definition + static void UNKNOWN(CHle * hle, uint32_t w1, uint32_t w2) { uint8_t acmd = (w1 >> 24); @@ -40,7 +34,7 @@ static void NAUDIO_0000(CHle * hle, uint32_t w1, uint32_t w2) static void NAUDIO_02B0(CHle * hle, uint32_t UNUSED(w1), uint32_t w2) { - /* emulate code at 0x12b0 (inside SETVOL), because PC always execute in IMEM */ + // Emulate code at 0x12b0 (inside SETVOL), because PC always execute in IMEM hle->alist_naudio().rate[1] &= ~0xffff; hle->alist_naudio().rate[1] |= (w2 & 0xffff); } @@ -179,7 +173,7 @@ static void ADPCM(CHle * hle, uint32_t w1, uint32_t w2) hle, flags & 0x1, flags & 0x2, - false, /* unsuported by this ucode */ + false, // Unsupported by this microcode dmemo, dmemi, (count + 0x1f) & ~0x1f, @@ -199,7 +193,7 @@ static void RESAMPLE(CHle * hle, uint32_t w1, uint32_t w2) alist_resample( hle, flags & 0x1, - false, /* TODO: check which ABI supports it */ + false, // TODO: check which ABI supports it dmemo, dmemi, NAUDIO_COUNT, @@ -224,7 +218,8 @@ static void MP3(CHle * hle, uint32_t w1, uint32_t w2) mp3_task(hle, index, address); } -/* global functions */ +// Global functions + void alist_process_naudio(CHle * hle) { static const acmd_callback_t ABI[0x10] = @@ -240,7 +235,8 @@ void alist_process_naudio(CHle * hle) void alist_process_naudio_bk(CHle * hle) { - /* TODO: see what differs from alist_process_naudio */ + // TODO: see what differs from alist_process_naudio + static const acmd_callback_t ABI[0x10] = { SPNOOP, ADPCM, CLEARBUFF, ENVMIXER, LOADBUFF, RESAMPLE, SAVEBUFF, NAUDIO_0000, @@ -253,7 +249,8 @@ void alist_process_naudio_bk(CHle * hle) void alist_process_naudio_dk(CHle * hle) { - /* TODO: see what differs from alist_process_naudio */ + // TODO: see what differs from alist_process_naudio + static const acmd_callback_t ABI[0x10] = { SPNOOP, ADPCM, CLEARBUFF, ENVMIXER, LOADBUFF, RESAMPLE, SAVEBUFF, MIXER, @@ -278,7 +275,8 @@ void alist_process_naudio_mp3(CHle * hle) void alist_process_naudio_cbfd(CHle * hle) { - /* TODO: see what differs from alist_process_naudio_mp3 */ + // TODO: see what differs from alist_process_naudio_mp3 + static const acmd_callback_t ABI[0x10] = { UNKNOWN, ADPCM, CLEARBUFF, ENVMIXER, LOADBUFF, RESAMPLE, SAVEBUFF, MP3, @@ -287,4 +285,4 @@ void alist_process_naudio_cbfd(CHle * hle) }; alist_process(hle, ABI, 0x10); -} \ No newline at end of file +} From b84c27abde2d6a84e183f49df9e90dcfbb9d964d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:17:37 -0500 Subject: [PATCH 28/40] Update alist_nead.cpp Improved grammar, fix title case, remove leftover header, add newline, update comments for consistency --- Source/Android/PluginRSP/alist_nead.cpp | 26 ++++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Source/Android/PluginRSP/alist_nead.cpp b/Source/Android/PluginRSP/alist_nead.cpp index a283ad555..232d9e058 100644 --- a/Source/Android/PluginRSP/alist_nead.cpp +++ b/Source/Android/PluginRSP/alist_nead.cpp @@ -1,16 +1,10 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include "alist.h" #include "mem.h" -/* audio commands definition */ +// Audio commands definition + static void UNKNOWN(CHle * hle, uint32_t w1, uint32_t w2) { uint8_t acmd = (w1 >> 24); @@ -107,7 +101,7 @@ static void RESAMPLE(CHle * hle, uint32_t w1, uint32_t w2) alist_resample( hle, flags & 0x1, - false, /* TODO: check which ABI supports it */ + false, // TODO: check which ABI supports it hle->alist_nead().out, hle->alist_nead().in, (hle->alist_nead().count + 0xf) & ~0xf, @@ -174,14 +168,14 @@ static void ENVMIXER_MK(CHle * hle, uint32_t w1, uint32_t w2) uint16_t dmem_wl = (w2 >> 4) & 0xff0; uint16_t dmem_wr = (w2 << 4) & 0xff0; - xors[2] = 0; /* unsupported by this ucode */ - xors[3] = 0; /* unsupported by this ucode */ + xors[2] = 0; // Unsupported by this microcode + xors[3] = 0; // Unsupported by this microcode xors[0] = 0 - (int16_t)((w1 & 0x2) >> 1); xors[1] = 0 - (int16_t)((w1 & 0x1) ); alist_envmix_nead( hle, - false, /* unsupported by this ucode */ + false, // Unsupported by this microcode dmem_dl, dmem_dr, dmem_wl, dmem_wr, dmemi, count, @@ -268,7 +262,7 @@ static void ADDMIXER(CHle * hle, uint32_t w1, uint32_t w2) static void HILOGAIN(CHle * hle, uint32_t w1, uint32_t w2) { - int8_t gain = (w1 >> 16); /* Q4.4 signed */ + int8_t gain = (w1 >> 16); // Q4.4 signed uint16_t count = w1; uint16_t dmem = (w2 >> 16); @@ -282,12 +276,12 @@ static void FILTER(CHle * hle, uint32_t w1, uint32_t w2) if (flags > 1) { hle->alist_nead().filter_count = w1; - hle->alist_nead().filter_lut_address[0] = address; /* t6 */ + hle->alist_nead().filter_lut_address[0] = address; // t6 } else { uint16_t dmem = w1; - hle->alist_nead().filter_lut_address[1] = address + 0x10; /* t5 */ + hle->alist_nead().filter_lut_address[1] = address + 0x10; // t5 alist_filter(hle, dmem, hle->alist_nead().filter_count, address, hle->alist_nead().filter_lut_address); } } @@ -488,4 +482,4 @@ void alist_process_nead_ac(CHle * hle) }; alist_process(hle, ABI, 0x18); -} \ No newline at end of file +} From 4a62811889c75583d81c07ffdb833ae41967e030 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:21:03 -0500 Subject: [PATCH 29/40] Update common.h Remove leftover header, remove title case, reword some comments to sound much better --- Source/Android/PluginRSP/common.h | 32 +++++++++++-------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/Source/Android/PluginRSP/common.h b/Source/Android/PluginRSP/common.h index ca60c3480..400173d8c 100644 --- a/Source/Android/PluginRSP/common.h +++ b/Source/Android/PluginRSP/common.h @@ -1,25 +1,18 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once -/* macro for unused variable warning suppression */ +// Macro for unused variable warning suppression #ifdef __GNUC__ # define UNUSED(x) UNUSED_ ## x __attribute__((__unused__)) #else # define UNUSED(x) /* x */ #endif -/* macro for inline keyword */ +// Macro for inline keyword #ifdef _MSC_VER #define inline __inline #endif -/* Dll function linking */ +// DLL function linking #if defined(_WIN32) #define EXPORT extern "C" __declspec(dllexport) #define CALL __cdecl @@ -28,7 +21,7 @@ #define CALL #endif -/* Plugin types */ +// Plugin types enum { PLUGIN_TYPE_RSP = 1, @@ -37,17 +30,14 @@ enum PLUGIN_TYPE_CONTROLLER = 4, }; -/***** Structures *****/ - +// Structures typedef struct { - uint16_t Version; /* Should be set to 0x0101 */ - uint16_t Type; /* Set to PLUGIN_TYPE_RSP */ - char Name[100]; /* Name of the DLL */ + uint16_t Version; // Should be set to 0x0101 + uint16_t Type; // Set to PLUGIN_TYPE_RSP + char Name[100]; // Name of the DLL - /* If DLL supports memory these memory options then set them to TRUE or FALSE - if it does not support it */ - int NormalMemory; /* a normal BYTE array */ - int MemoryBswaped; /* a normal BYTE array where the memory has been pre - bswap on a dword (32 bits) boundry */ + // If DLL supports memory, these memory options then set them to TRUE or FALSE if it does not support it + int NormalMemory; // A normal BYTE array + int MemoryBswaped; // A normal BYTE array where the memory has been pre-bswap'd on a DWORD (32-bits) boundary } PLUGIN_INFO; From 4b0930956c5979616948fa24d88999349ff05d04 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:29:28 -0500 Subject: [PATCH 30/40] Update hle.cpp Remove leftover header, remove title case, improve grammar, add some TODO comments, add some spacing and correct some ROM names, add newline --- Source/Android/PluginRSP/hle.cpp | 106 +++++++++++++++---------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/Source/Android/PluginRSP/hle.cpp b/Source/Android/PluginRSP/hle.cpp index d2c657bd7..f76f7f02b 100644 --- a/Source/Android/PluginRSP/hle.cpp +++ b/Source/Android/PluginRSP/hle.cpp @@ -1,10 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2012 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include "mem.h" #include "ucodes.h" @@ -12,7 +5,8 @@ #define min(a,b) (((a) < (b)) ? (a) : (b)) -/* helper functions prototypes */ +// Helper functions prototypes + static unsigned int sum_bytes(const uint8_t *bytes, uint32_t size); CHle::CHle(const RSP_INFO & Rsp_Info) : @@ -88,7 +82,8 @@ void CHle::hle_execute(void) } } -/* local functions */ +// Local functions + static unsigned int sum_bytes(const uint8_t * bytes, unsigned int size) { unsigned int sum = 0; @@ -101,16 +96,19 @@ static unsigned int sum_bytes(const uint8_t * bytes, unsigned int size) return sum; } -/** -* Try to figure if the RSP was launched using osSpTask* functions -* and not run directly (in which case DMEM[0xfc0-0xfff] is meaningless). -* -* Previously, the ucode_size field was used to determine this, -* but it is not robust enough (hi Pokemon Stadium !) because games could write anything -* in this field : most ucode_boot discard the value and just use 0xf7f anyway. -* -* Using ucode_boot_size should be more robust in this regard. -**/ +/* +TODO: + +Try to figure if the RSP was launched using osSpTask* functions +and not run directly (in which case DMEM[0xfc0-0xfff] is meaningless). + +Previously, the ucode_size field was used to determine this, +but it is not robust enough (hi Pokémon Stadium!) because games could write anything +in this field: most ucode_boot discard the value and just use 0xf7f anyway. + +Using ucode_boot_size should be more robust in this regard. +*/ + bool CHle::is_task(void) { return (*dmem_u32(this, TASK_UCODE_BOOT_SIZE) <= 0x1000); @@ -118,7 +116,7 @@ bool CHle::is_task(void) bool CHle::try_fast_task_dispatching(void) { - /* identify task ucode by its type */ + // Identify task microcode by its type switch (*dmem_u32(this, TASK_TYPE)) { case 1: @@ -148,7 +146,7 @@ bool CHle::try_fast_task_dispatching(void) bool CHle::try_fast_audio_dispatching(void) { - /* identify audio ucode by using the content of ucode_data */ + // Identify audio microcode by using the content of ucode_data uint32_t ucode_data = *dmem_u32(this, TASK_UCODE_DATA); uint32_t v; @@ -159,13 +157,13 @@ bool CHle::try_fast_audio_dispatching(void) v = *dram_u32(this, ucode_data + 0x28); switch (v) { - case 0x1e24138c: /* audio ABI (most common) */ + case 0x1e24138c: // Audio ABI (most common) alist_process_audio(this); return true; - case 0x1dc8138c: /* GoldenEye */ + case 0x1dc8138c: // GoldenEye 007 alist_process_audio_ge(this); return true; - case 0x1e3c1390: /* BlastCorp, DiddyKongRacing */ + case 0x1e3c1390: // Blast Corp, Diddy Kong Racing alist_process_audio_bc(this); return true; default: @@ -177,40 +175,40 @@ bool CHle::try_fast_audio_dispatching(void) v = *dram_u32(this, ucode_data + 0x10); switch (v) { - case 0x11181350: /* MarioKart, WaveRace (E) */ + case 0x11181350: // Mario Kart, Wave Race (E) alist_process_nead_mk(this); return true; - case 0x111812e0: /* StarFox (J) */ + case 0x111812e0: // StarFox 64 (J) alist_process_nead_sfj(this); return true; - case 0x110412ac: /* WaveRace (J RevB) */ + case 0x110412ac: // Wave Race (J Rev B) alist_process_nead_wrjb(this); return true; - case 0x110412cc: /* StarFox/LylatWars (except J) */ + case 0x110412cc: // StarFox/LylatWars (except J) alist_process_nead_sf(this); return true; - case 0x1cd01250: /* FZeroX */ + case 0x1cd01250: // F-Zero X alist_process_nead_fz(this); return true; - case 0x1f08122c: /* YoshisStory */ + case 0x1f08122c: // Yoshi's Story alist_process_nead_ys(this); return true; - case 0x1f38122c: /* 1080° Snowboarding */ + case 0x1f38122c: // 1080° Snowboarding alist_process_nead_1080(this); return true; - case 0x1f681230: /* Zelda OoT / Zelda MM (J, J RevA) */ + case 0x1f681230: // Zelda Ocarina of Time / Zelda Majora's Mask (J, J Rev A) alist_process_nead_oot(this); return true; - case 0x1f801250: /* Zelda MM (except J, J RevA, E Beta), PokemonStadium 2 */ + case 0x1f801250: // Zelda Majora's Mask (except J, J Rev A, E Beta), Pokémon Stadium 2 alist_process_nead_mm(this); return true; - case 0x109411f8: /* Zelda MM (E Beta) */ + case 0x109411f8: // Zelda Majora's Mask (E Beta) alist_process_nead_mmb(this); return true; - case 0x1eac11b8: /* AnimalCrossing */ + case 0x1eac11b8: // Animal Crossing alist_process_nead_ac(this); return true; - case 0x00010010: /* MusyX v2 (IndianaJones, BattleForNaboo) */ + case 0x00010010: // MusyX v2 (Indiana Jones, Battle For Naboo) musyx_v2_task(this); return true; default: @@ -224,24 +222,24 @@ bool CHle::try_fast_audio_dispatching(void) switch (v) { case 0x00000001: /* MusyX v1 - RogueSquadron, ResidentEvil2, PolarisSnoCross, - TheWorldIsNotEnough, RugratsInParis, NBAShowTime, - HydroThunder, Tarzan, GauntletLegend, Rush2049 */ + Rogue Squadron, Resident Evil 2, Polaris Sno Cross, + The World Is Not Enough, Rugrats In Paris, NBA Show Time, + Hydro Thunder, Tarzan, Gauntlet Legend, Rush 2049 */ musyx_v1_task(this); return true; - case 0x0000127c: /* naudio (many games) */ + case 0x0000127c: // naudio (many games) alist_process_naudio(this); return true; - case 0x00001280: /* BanjoKazooie */ + case 0x00001280: // Banjo Kazooie alist_process_naudio_bk(this); return true; - case 0x1c58126c: /* DonkeyKong */ + case 0x1c58126c: // Donkey Kong alist_process_naudio_dk(this); return true; - case 0x1ae8143c: /* BanjoTooie, JetForceGemini, MickeySpeedWayUSA, PerfectDark */ + case 0x1ae8143c: // Banjo Tooie, Jet Force Gemini, Mickey SpeedWay USA, Perfect Dark alist_process_naudio_mp3(this); return true; - case 0x1ab0140c: /* ConkerBadFurDay */ + case 0x1ab0140c: // Conker's Bad Fur Day alist_process_naudio_cbfd(this); return true; default: @@ -257,12 +255,12 @@ void CHle::normal_task_dispatching(void) sum_bytes((const uint8_t *)dram_u32(this, *dmem_u32(this, TASK_UCODE)), min(*dmem_u32(this, TASK_UCODE_SIZE), 0xf80) >> 1); switch (sum) { - /* StoreVe12: found in Zelda Ocarina of Time [misleading task->type == 4] */ + // StoreVe12: found in Zelda Ocarina of Time [misleading task->type == 4] case 0x278: - /* Nothing to emulate */ + // Nothing to emulate return; - /* GFX: Twintris [misleading task->type == 0] */ + // GFX: Twintris [misleading task->type == 0] case 0x212ee: if (m_ForwardGFX) { @@ -271,17 +269,17 @@ void CHle::normal_task_dispatching(void) } break; - /* JPEG: found in Pokemon Stadium J */ + // JPEG: found in Pokémon Stadium J case 0x2c85a: jpeg_decode_PS0(this); return; - /* JPEG: found in Zelda Ocarina of Time, Pokemon Stadium 1, Pokemon Stadium 2 */ + // JPEG: found in Zelda Ocarina of Time, Pokémon Stadium 1, Pokémon Stadium 2 case 0x2caa6: jpeg_decode_PS(this); return; - /* JPEG: found in Ogre Battle, Bottom of the 9th */ + // JPEG: found in Ogre Battle, Bottom of the 9th case 0x130de: case 0x278b0: jpeg_decode_OB(this); @@ -300,7 +298,7 @@ void CHle::non_task_dispatching(void) if (sum == 0x9e2) { - /* CIC x105 ucode (used during boot of CIC x105 games) */ + // CIC x105 microcode (used during boot of CIC x105 games) cicx105_ucode(this); return; } @@ -320,7 +318,7 @@ void CHle::VerboseMessage(const char *message, ...) #if defined(_WIN32) && defined(_DEBUG) // These can get annoying. #if 0 - MessageBox(NULL, message, "HLE Verbose Message", MB_OK); + MessageBox(NULL, message, "HLE verbose message", MB_OK); #endif #endif } @@ -328,6 +326,6 @@ void CHle::VerboseMessage(const char *message, ...) void CHle::WarnMessage(const char *message, ...) { #if defined(_WIN32) && defined(_DEBUG) - MessageBoxA(NULL, message, "HLE Warning Message", MB_OK); + MessageBoxA(NULL, message, "HLE warning message", MB_OK); #endif -} \ No newline at end of file +} From 94e7a2dfae1c2ed5f0dbfd518432843672970542 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:31:26 -0500 Subject: [PATCH 31/40] Update hle.h Remove leftover header, remove title case, fix flag names, convert multi line comments into single line comments --- Source/Android/PluginRSP/hle.h | 114 ++++++++++++++++----------------- 1 file changed, 55 insertions(+), 59 deletions(-) diff --git a/Source/Android/PluginRSP/hle.h b/Source/Android/PluginRSP/hle.h index 37f7664a5..5e840d26d 100644 --- a/Source/Android/PluginRSP/hle.h +++ b/Source/Android/PluginRSP/hle.h @@ -1,69 +1,65 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html - #pragma once #include #include "Rsp.h" #include "ucodes.h" -//Signal Processor interface flags +// Signal processor interface flags + enum { - SP_CLR_HALT = 0x00001, /* Bit 0: clear halt */ - SP_SET_HALT = 0x00002, /* Bit 1: set halt */ - SP_CLR_BROKE = 0x00004, /* Bit 2: clear broke */ - SP_CLR_INTR = 0x00008, /* Bit 3: clear intr */ - SP_SET_INTR = 0x00010, /* Bit 4: set intr */ - SP_CLR_SSTEP = 0x00020, /* Bit 5: clear sstep */ - SP_SET_SSTEP = 0x00040, /* Bit 6: set sstep */ - SP_CLR_INTR_BREAK = 0x00080, /* Bit 7: clear intr on break */ - SP_SET_INTR_BREAK = 0x00100, /* Bit 8: set intr on break */ - SP_CLR_SIG0 = 0x00200, /* Bit 9: clear signal 0 */ - SP_SET_SIG0 = 0x00400, /* Bit 10: set signal 0 */ - SP_CLR_SIG1 = 0x00800, /* Bit 11: clear signal 1 */ - SP_SET_SIG1 = 0x01000, /* Bit 12: set signal 1 */ - SP_CLR_SIG2 = 0x02000, /* Bit 13: clear signal 2 */ - SP_SET_SIG2 = 0x04000, /* Bit 14: set signal 2 */ - SP_CLR_SIG3 = 0x08000, /* Bit 15: clear signal 3 */ - SP_SET_SIG3 = 0x10000, /* Bit 16: set signal 3 */ - SP_CLR_SIG4 = 0x20000, /* Bit 17: clear signal 4 */ - SP_SET_SIG4 = 0x40000, /* Bit 18: set signal 4 */ - SP_CLR_SIG5 = 0x80000, /* Bit 19: clear signal 5 */ - SP_SET_SIG5 = 0x100000, /* Bit 20: set signal 5 */ - SP_CLR_SIG6 = 0x200000, /* Bit 21: clear signal 6 */ - SP_SET_SIG6 = 0x400000, /* Bit 22: set signal 6 */ - SP_CLR_SIG7 = 0x800000, /* Bit 23: clear signal 7 */ - SP_SET_SIG7 = 0x1000000, /* Bit 24: set signal 7 */ + SP_CLR_HALT = 0x00001, /* Bit 0: Clear halt */ + SP_SET_HALT = 0x00002, /* Bit 1: Set halt */ + SP_CLR_BROKE = 0x00004, /* Bit 2: Clear broke */ + SP_CLR_INTR = 0x00008, /* Bit 3: Clear INTR */ + SP_SET_INTR = 0x00010, /* Bit 4: Set INTR */ + SP_CLR_SSTEP = 0x00020, /* Bit 5: Clear SSTEP */ + SP_SET_SSTEP = 0x00040, /* Bit 6: Set SSTEP */ + SP_CLR_INTR_BREAK = 0x00080, /* Bit 7: Clear INTR on break */ + SP_SET_INTR_BREAK = 0x00100, /* Bit 8: Set INTR on break */ + SP_CLR_SIG0 = 0x00200, /* Bit 9: Clear signal 0 */ + SP_SET_SIG0 = 0x00400, /* Bit 10: Set signal 0 */ + SP_CLR_SIG1 = 0x00800, /* Bit 11: Clear signal 1 */ + SP_SET_SIG1 = 0x01000, /* Bit 12: Set signal 1 */ + SP_CLR_SIG2 = 0x02000, /* Bit 13: Clear signal 2 */ + SP_SET_SIG2 = 0x04000, /* Bit 14: Set signal 2 */ + SP_CLR_SIG3 = 0x08000, /* Bit 15: Clear signal 3 */ + SP_SET_SIG3 = 0x10000, /* Bit 16: Set signal 3 */ + SP_CLR_SIG4 = 0x20000, /* Bit 17: Clear signal 4 */ + SP_SET_SIG4 = 0x40000, /* Bit 18: Set signal 4 */ + SP_CLR_SIG5 = 0x80000, /* Bit 19: Clear signal 5 */ + SP_SET_SIG5 = 0x100000, /* Bit 20: Set signal 5 */ + SP_CLR_SIG6 = 0x200000, /* Bit 21: Clear signal 6 */ + SP_SET_SIG6 = 0x400000, /* Bit 22: Set signal 6 */ + SP_CLR_SIG7 = 0x800000, /* Bit 23: Clear signal 7 */ + SP_SET_SIG7 = 0x1000000, /* Bit 24: Set signal 7 */ - SP_STATUS_HALT = 0x001, /* Bit 0: halt */ - SP_STATUS_BROKE = 0x002, /* Bit 1: broke */ - SP_STATUS_DMA_BUSY = 0x004, /* Bit 2: dma busy */ - SP_STATUS_DMA_FULL = 0x008, /* Bit 3: dma full */ - SP_STATUS_IO_FULL = 0x010, /* Bit 4: io full */ - SP_STATUS_SSTEP = 0x020, /* Bit 5: single step */ - SP_STATUS_INTR_BREAK = 0x040, /* Bit 6: interrupt on break */ - SP_STATUS_SIG0 = 0x080, /* Bit 7: signal 0 set */ - SP_STATUS_SIG1 = 0x100, /* Bit 8: signal 1 set */ - SP_STATUS_SIG2 = 0x200, /* Bit 9: signal 2 set */ - SP_STATUS_SIG3 = 0x400, /* Bit 10: signal 3 set */ - SP_STATUS_SIG4 = 0x800, /* Bit 11: signal 4 set */ - SP_STATUS_SIG5 = 0x1000, /* Bit 12: signal 5 set */ - SP_STATUS_SIG6 = 0x2000, /* Bit 13: signal 6 set */ - SP_STATUS_SIG7 = 0x4000, /* Bit 14: signal 7 set */ + SP_STATUS_HALT = 0x001, /* Bit 0: Halt */ + SP_STATUS_BROKE = 0x002, /* Bit 1: Broke */ + SP_STATUS_DMA_BUSY = 0x004, /* Bit 2: DMA busy */ + SP_STATUS_DMA_FULL = 0x008, /* Bit 3: DMA full */ + SP_STATUS_IO_FULL = 0x010, /* Bit 4: IO full */ + SP_STATUS_SSTEP = 0x020, /* Bit 5: Single step */ + SP_STATUS_INTR_BREAK = 0x040, /* Bit 6: Interrupt on break */ + SP_STATUS_SIG0 = 0x080, /* Bit 7: Signal 0 set */ + SP_STATUS_SIG1 = 0x100, /* Bit 8: Signal 1 set */ + SP_STATUS_SIG2 = 0x200, /* Bit 9: Signal 2 set */ + SP_STATUS_SIG3 = 0x400, /* Bit 10: Signal 3 set */ + SP_STATUS_SIG4 = 0x800, /* Bit 11: Signal 4 set */ + SP_STATUS_SIG5 = 0x1000, /* Bit 12: Signal 5 set */ + SP_STATUS_SIG6 = 0x2000, /* Bit 13: Signal 6 set */ + SP_STATUS_SIG7 = 0x4000, /* Bit 14: Signal 7 set */ }; -//Mips interface flags +// MIPS interface flags + enum { - MI_INTR_SP = 0x01, /* Bit 0: SP intr */ - MI_INTR_SI = 0x02, /* Bit 1: SI intr */ - MI_INTR_AI = 0x04, /* Bit 2: AI intr */ - MI_INTR_VI = 0x08, /* Bit 3: VI intr */ - MI_INTR_PI = 0x10, /* Bit 4: PI intr */ - MI_INTR_DP = 0x20, /* Bit 5: DP intr */ + MI_INTR_SP = 0x01, /* Bit 0: SP INTR */ + MI_INTR_SI = 0x02, /* Bit 1: SI INTR */ + MI_INTR_AI = 0x04, /* Bit 2: AI INTR */ + MI_INTR_VI = 0x08, /* Bit 3: VI INTR */ + MI_INTR_PI = 0x10, /* Bit 4: PI INTR */ + MI_INTR_DP = 0x20, /* Bit 5: DP INTR */ }; class CHle @@ -134,19 +130,19 @@ private: void(*m_ProcessRdpList)(void); void(*m_ShowCFB)(void); - /* alist.cpp */ + // alist.cpp uint8_t m_alist_buffer[0x1000]; - /* alist_audio.cpp */ + // alist_audio.cpp struct alist_audio_t m_alist_audio; - /* alist_naudio.cpp */ + // alist_naudio.cpp struct alist_naudio_t m_alist_naudio; - /* alist_nead.cpp */ + // alist_nead.cpp struct alist_nead_t m_alist_nead; - /* mp3.cpp */ + // mp3.cpp uint8_t m_mp3_buffer[0x1000]; bool m_AudioHle; From e00a90e14eba634d050cfd225f64fdc012b1fa2a Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:35:47 -0500 Subject: [PATCH 32/40] Update jpeg.cpp Remove leftover header, fix title case, convert multi line comments into single line comments, add some spacing, add newline, add TODO to find a better resource instead of French Wikipedia --- Source/Android/PluginRSP/jpeg.cpp | 96 ++++++++++++++----------------- 1 file changed, 44 insertions(+), 52 deletions(-) diff --git a/Source/Android/PluginRSP/jpeg.cpp b/Source/Android/PluginRSP/jpeg.cpp index 14dce8126..77071e8c8 100644 --- a/Source/Android/PluginRSP/jpeg.cpp +++ b/Source/Android/PluginRSP/jpeg.cpp @@ -1,11 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2012 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html - #include "stdafx.h" #include @@ -17,27 +9,27 @@ typedef void(*tile_line_emitter_t)(CHle * hle, const int16_t *y, const int16_t *u, uint32_t address); typedef void(*subblock_transform_t)(int16_t *dst, const int16_t *src); -/* standard jpeg ucode decoder */ +// Standard JPEG microcode decoder static void jpeg_decode_std(CHle * hle, const char *const version, const subblock_transform_t transform_luma, const subblock_transform_t transform_chroma, const tile_line_emitter_t emit_line); -/* helper functions */ +// Helper functions static uint8_t clamp_u8(int16_t x); static int16_t clamp_s12(int16_t x); static uint16_t clamp_RGBA_component(int16_t x); -/* pixel conversion & formatting */ +// Pixel conversion and formatting static uint32_t GetUYVY(int16_t y1, int16_t y2, int16_t u, int16_t v); static uint16_t GetRGBA(int16_t y, int16_t u, int16_t v); -/* tile line emitters */ +// Tile line emitters static void EmitYUVTileLine(CHle * hle, const int16_t *y, const int16_t *u, uint32_t address); static void EmitRGBATileLine(CHle * hle, const int16_t *y, const int16_t *u, uint32_t address); -/* macroblocks operations */ +// Macroblocks operations static void decode_macroblock_ob(int16_t *macroblock, int32_t *y_dc, int32_t *u_dc, int32_t *v_dc, const int16_t *qtable); static void decode_macroblock_std(const subblock_transform_t transform_luma, const subblock_transform_t transform_chroma, @@ -47,7 +39,7 @@ static void decode_macroblock_std(const subblock_transform_t transform_luma, static void EmitTilesMode0(CHle * hle, const tile_line_emitter_t emit_line, const int16_t *macroblock, uint32_t address); static void EmitTilesMode2(CHle * hle, const tile_line_emitter_t emit_line, const int16_t *macroblock, uint32_t address); -/* subblocks operations */ +// Sub blocks operations static void TransposeSubBlock(int16_t *dst, const int16_t *src); static void ZigZagSubBlock(int16_t *dst, const int16_t *src); static void ReorderSubBlock(int16_t *dst, const int16_t *src, const unsigned int *table); @@ -59,7 +51,7 @@ static void InverseDCTSubBlock(int16_t *dst, const int16_t *src); static void RescaleYSubBlock(int16_t *dst, const int16_t *src); static void RescaleUVSubBlock(int16_t *dst, const int16_t *src); -/* transposed dequantization table */ +// Transposed dequantization table static const int16_t DEFAULT_QTABLE[SUBBLOCK_SIZE] = { 16, 12, 14, 14, 18, 24, 49, 72, 11, 12, 13, 17, 22, 35, 64, 92, @@ -71,7 +63,7 @@ static const int16_t DEFAULT_QTABLE[SUBBLOCK_SIZE] = { 61, 55, 56, 62, 77, 92, 101, 99 }; -/* zig-zag indices */ +// Zig-zag indices static const unsigned int ZIGZAG_TABLE[SUBBLOCK_SIZE] = { 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, @@ -83,7 +75,7 @@ static const unsigned int ZIGZAG_TABLE[SUBBLOCK_SIZE] = { 35, 36, 48, 49, 57, 58, 62, 63 }; -/* transposition indices */ +// Transposition indices static const unsigned int TRANSPOSE_TABLE[SUBBLOCK_SIZE] = { 0, 8, 16, 24, 32, 40, 48, 56, 1, 9, 17, 25, 33, 41, 49, 57, @@ -100,40 +92,37 @@ static const unsigned int TRANSPOSE_TABLE[SUBBLOCK_SIZE] = { static const float IDCT_C3 = 1.175875602f; static const float IDCT_C6 = 0.541196100f; static const float IDCT_K[10] = { - 0.765366865f, /* C2-C6 */ - -1.847759065f, /* -C2-C6 */ - -0.390180644f, /* C5-C3 */ - -1.961570561f, /* -C5-C3 */ - 1.501321110f, /* C1+C3-C5-C7 */ - 2.053119869f, /* C1+C3-C5+C7 */ - 3.072711027f, /* C1+C3+C5-C7 */ - 0.298631336f, /* -C1+C3+C5-C7 */ - -0.899976223f, /* C7-C3 */ - -2.562915448f /* -C1-C3 */ + 0.765366865f, // C2-C6 + -1.847759065f, // -C2-C6 + -0.390180644f, // C5-C3 + -1.961570561f, // -C5-C3 + 1.501321110f, // C1+C3-C5-C7 + 2.053119869f, // C1+C3-C5+C7 + 3.072711027f, // C1+C3+C5-C7 + 0.298631336f, // -C1+C3+C5-C7 + -0.899976223f, // C7-C3 + -2.562915448f // -C1-C3 }; -/* global functions */ +// Global functions + +// JPEG decoding microcode found in Japanese-exclusive version of Pokémon Stadium -/*************************************************************************** -* JPEG decoding ucode found in Japanese exclusive version of Pokemon Stadium. -**************************************************************************/ void jpeg_decode_PS0(CHle * hle) { jpeg_decode_std(hle, "PS0", RescaleYSubBlock, RescaleUVSubBlock, EmitYUVTileLine); } -/*************************************************************************** -* JPEG decoding ucode found in Ocarina of Time, Pokemon Stadium 1 and -* Pokemon Stadium 2. -**************************************************************************/ +// JPEG decoding microcode found in Ocarina of Time, Pokémon Stadium 1, and Pokémon Stadium 2 + void jpeg_decode_PS(CHle * hle) { jpeg_decode_std(hle, "PS", NULL, NULL, EmitRGBATileLine); } -/*************************************************************************** -* JPEG decoding ucode found in Ogre Battle and Bottom of the 9th. -**************************************************************************/ + +// JPEG decoding microcode found in Ogre Battle and Bottom of the 9th + void jpeg_decode_OB(CHle * hle) { int16_t qtable[SUBBLOCK_SIZE]; @@ -173,7 +162,8 @@ void jpeg_decode_OB(CHle * hle) } } -/* local functions */ +// Local functions + static void jpeg_decode_std(CHle * hle, const char *const version, const subblock_transform_t transform_luma, const subblock_transform_t transform_chroma, const tile_line_emitter_t emit_line) { int16_t qtables[3][SUBBLOCK_SIZE]; @@ -186,7 +176,7 @@ static void jpeg_decode_std(CHle * hle, const char *const version, const subbloc uint32_t qtableV_ptr; unsigned int subblock_count; unsigned int macroblock_size; - /* macroblock contains at most 6 subblocks */ + // Macroblock contains at most 6 sub blocks int16_t macroblock[6 * SUBBLOCK_SIZE]; uint32_t data_ptr; @@ -375,7 +365,7 @@ static void decode_macroblock_ob(int16_t *macroblock, int32_t *y_dc, int32_t *u_ for (sb = 0; sb < 6; ++sb) { int16_t tmp_sb[SUBBLOCK_SIZE]; - /* update DC */ + // Update DC int32_t dc = (int32_t)macroblock[0]; switch (sb) { case 0: @@ -462,7 +452,7 @@ static void ReorderSubBlock(int16_t *dst, const int16_t *src, const unsigned int { unsigned int i; - /* source and destination sublocks cannot overlap */ + // Source and destination sub blocks cannot overlap assert(abs(dst - src) > SUBBLOCK_SIZE); for (i = 0; i < SUBBLOCK_SIZE; ++i) @@ -498,12 +488,14 @@ static void RShiftSubBlock(int16_t *dst, const int16_t *src, unsigned int shift) dst[i] = src[i] >> shift; } -/*************************************************************************** - * Fast 2D IDCT using separable formulation and normalization - * Computations use single precision floats - * Implementation based on Wikipedia : - * http://fr.wikipedia.org/wiki/Transform%C3%A9e_en_cosinus_discr%C3%A8te - **************************************************************************/ +/* +TODO: find a better, more general resource for this +Fast 2D IDCT using separable formulation and normalization +Computations use single precision floats +Implementation based on Wikipedia: +https://fr.wikipedia.org/wiki/Transform%C3%A9e_en_cosinus_discr%C3%A8te +*/ + static void InverseDCT1D(const float *const x, float *dst, unsigned int stride) { float e[4]; @@ -550,7 +542,7 @@ static void InverseDCTSubBlock(int16_t *dst, const int16_t *src) float block[SUBBLOCK_SIZE]; unsigned int i, j; - /* idct 1d on rows (+transposition) */ + // IDCT 1D on rows (+transposition) for (i = 0; i < 8; ++i) { for (j = 0; j < 8; ++j) @@ -560,12 +552,12 @@ static void InverseDCTSubBlock(int16_t *dst, const int16_t *src) InverseDCT1D(x, &block[i], 8); } - /* idct 1d on columns (thanks to previous transposition) */ + // IDCT 1D on columns (thanks to previous transposition) for (i = 0; i < 8; ++i) { InverseDCT1D(&block[i * 8], x, 1); - /* C4 = 1 normalization implies a division by 8 */ + // C4 = 1 normalization implies a division by 8 for (j = 0; j < 8; ++j) { dst[i + j * 8] = (int16_t)x[j] >> 3; @@ -589,4 +581,4 @@ static void RescaleUVSubBlock(int16_t *dst, const int16_t *src) { dst[i] = (((int)clamp_s12(src[i]) * 0xe00) >> 16) + 0x80; } -} \ No newline at end of file +} From b42c787ae0db63b1c002745431e480387d4f1b29 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:38:30 -0500 Subject: [PATCH 33/40] Update main.cpp Fix some typos, fix abbreviations, convert multi line comments into single line comments, add newline, add spacing --- Source/Android/PluginRSP/main.cpp | 87 +++++++++++++++++-------------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/Source/Android/PluginRSP/main.cpp b/Source/Android/PluginRSP/main.cpp index a464f5782..5234d0b48 100644 --- a/Source/Android/PluginRSP/main.cpp +++ b/Source/Android/PluginRSP/main.cpp @@ -15,13 +15,14 @@ BOOL WINAPI DllMain(void * hinst, DWORD /*fdwReason*/, LPVOID /*lpvReserved*/) } #endif -/****************************************************************** - Function: CloseDLL - Purpose: This function is called when the emulator is closing - down allowing the dll to de-initialise. - input: none - output: none - *******************************************************************/ +/* +Function: CloseDLL +Purpose: This function is called when the emulator is closing +down allowing the DLL to de-initialize. +input: none +output: none +*/ + void CloseDLL(void) { if (g_hle) @@ -31,13 +32,14 @@ void CloseDLL(void) } } -/****************************************************************** - Function: DllAbout - Purpose: This function is optional function that is provided - to give further information about the DLL. - input: a handle to the window that calls this function - output: none - *******************************************************************/ +/* +Function: DllAbout +Purpose: This function is optional function that is provided +to give further information about the DLL. +input: a handle to the window that calls this function +output: none +*/ + void DllAbout(void * hParent) { #ifdef _WIN32 @@ -45,17 +47,18 @@ void DllAbout(void * hParent) #endif } -/****************************************************************** +/* Function: DoRspCycles -Purpose: This function is to allow the RSP to run in parrel with +Purpose: This function is to allow the RSP to run in parallel with the r4300 switching control back to the r4300 once the function ends. -input: The number of cylces that is meant to be executed +input: The number of cycles that is meant to be executed output: The number of cycles that was executed. This value can be greater than the number of cycles that the RSP should have performed. -(this value is ignored if the RSP is stoped) -*******************************************************************/ +(this value is ignored if the RSP is stopped) +*/ + uint32_t DoRspCycles(uint32_t Cycles) { if (g_hle) @@ -65,38 +68,40 @@ uint32_t DoRspCycles(uint32_t Cycles) return Cycles; } -/****************************************************************** - Function: GetDllInfo - Purpose: This function allows the emulator to gather information - about the dll by filling in the PluginInfo structure. - input: a pointer to a PLUGIN_INFO stucture that needs to be - filled by the function. (see def above) - output: none - *******************************************************************/ +/* +Function: GetDllInfo +Purpose: This function allows the emulator to gather information +about the DLL by filling in the PluginInfo structure. +input: a pointer to a PLUGIN_INFO structure that needs to be +filled by the function. (see def above) +output: none +*/ + void GetDllInfo(PLUGIN_INFO * PluginInfo) { PluginInfo->Version = 0x0102; PluginInfo->Type = PLUGIN_TYPE_RSP; #ifdef _DEBUG - sprintf(PluginInfo->Name, "RSP HLE Debug Plugin %s", VER_FILE_VERSION_STR); + sprintf(PluginInfo->Name, "RSP HLE debug plugin %s", VER_FILE_VERSION_STR); #else - sprintf(PluginInfo->Name, "RSP HLE Plugin %s", VER_FILE_VERSION_STR); + sprintf(PluginInfo->Name, "RSP HLE plugin %s", VER_FILE_VERSION_STR); #endif PluginInfo->NormalMemory = false; PluginInfo->MemoryBswaped = true; } -/****************************************************************** +/* Function: InitiateRSP Purpose: This function is called when the DLL is started to give -information from the emulator that the n64 RSP +information from the emulator that the N64 RSP interface needs input: Rsp_Info is passed to this function which is defined above. CycleCount is the number of cycles between switching -control between teh RSP and r4300i core. +control between the RSP and r4300i core. output: none -*******************************************************************/ +*/ + void InitiateRSP(RSP_INFO Rsp_Info, uint32_t * /*CycleCount*/) { if (g_hle) @@ -107,26 +112,28 @@ void InitiateRSP(RSP_INFO Rsp_Info, uint32_t * /*CycleCount*/) g_hle = new CHle(Rsp_Info); } -/****************************************************************** +/* Function: RomOpen -Purpose: This function is called when a rom is opened. +Purpose: This function is called when a ROM is opened. input: none output: none -*******************************************************************/ +*/ + void RomOpen(void) { } -/****************************************************************** +/* Function: RomClosed -Purpose: This function is called when a rom is closed. +Purpose: This function is called when a ROM is closed. input: none output: none -*******************************************************************/ +*/ + void RomClosed(void) { } void PluginLoaded(void) { -} \ No newline at end of file +} From 7f0e8a84cf235e6b48922f270d141b6bbeb273ac Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:42:37 -0500 Subject: [PATCH 34/40] Update mp3.cpp Fix typos, remove title case, remove leftover header, add TODO, add newline --- Source/Android/PluginRSP/mp3.cpp | 156 +++++++++++++++---------------- 1 file changed, 74 insertions(+), 82 deletions(-) diff --git a/Source/Android/PluginRSP/mp3.cpp b/Source/Android/PluginRSP/mp3.cpp index bc887a98e..5e8775003 100644 --- a/Source/Android/PluginRSP/mp3.cpp +++ b/Source/Android/PluginRSP/mp3.cpp @@ -1,11 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html - #include "stdafx.h" #include @@ -151,7 +143,7 @@ static const uint16_t DeWindowLUT [0x420] = { static void MP3AB0(int32_t* v) { - /* Part 2 - 100% Accurate */ + // Part 2 - 100% accurate static const uint16_t LUT2[8] = { 0xFEC4, 0xF4FA, 0xC5E4, 0xE1C4, @@ -166,7 +158,7 @@ static void MP3AB0(int32_t* v) v[24 + i] = ((v[0 + i] - v[8 + i]) * LUT2[i]) >> 0x10; } - /* Part 3: 4-wide butterflies */ + // Part 3: 4-wide butterflies for (i = 0; i < 4; i++) { @@ -177,7 +169,7 @@ static void MP3AB0(int32_t* v) v[12 + i] = ((v[24 + i] - v[28 + i]) * LUT3[i]) >> 0x10; } - /* Part 4: 2-wide butterflies - 100% Accurate */ + // Part 4: 2-wide butterflies - 100% accurate for (i = 0; i < 16; i += 4) { @@ -192,34 +184,34 @@ static void MP3AB0(int32_t* v) void mp3_task(CHle * hle, unsigned int index, uint32_t address) { uint32_t inPtr, outPtr; - uint32_t t6;/* = 0x08A0; - I think these are temporary storage buffers */ - uint32_t t5;/* = 0x0AC0; */ - uint32_t t4;/* = (w1 & 0x1E); */ + uint32_t t6;// = 0x08A0; - I think these are temporary storage buffers + uint32_t t5;// = 0x0AC0; + uint32_t t4;// = (w1 & 0x1E); - /* Initialization Code */ - uint32_t readPtr; /* s5 */ - uint32_t writePtr; /* s6 */ + // Initialization code + uint32_t readPtr; // s5 + uint32_t writePtr; // s6 uint32_t tmp; int cnt, cnt2; - /* I think these are temporary storage buffers */ + // I think these are temporary storage buffers t6 = 0x08A0; t5 = 0x0AC0; t4 = index; writePtr = readPtr = address; - /* Just do that for efficiency... may remove and use directly later anyway */ + // TODO: Just do that for efficiency...may remove and use directly later anyway memcpy(hle->mp3_buffer() + 0xCE8, hle->dram() + readPtr, 8); - /* This must be a header byte or whatnot */ + // This must be a header byte or whatnot readPtr += 8; for (cnt = 0; cnt < 0x480; cnt += 0x180) { - /* DMA: 0xCF0 <- RDRAM[s5] : 0x180 */ + // DMA: 0xCF0 <- RDRAM[s5] : 0x180 memcpy(hle->mp3_buffer() + 0xCF0, hle->dram() + readPtr, 0x180); - inPtr = 0xCF0; /* s7 */ - outPtr = 0xE70; /* s3 */ - /* --------------- Inner Loop Start -------------------- */ + inPtr = 0xCF0; // s7 + outPtr = 0xE70; // s3 + // --------------- Inner Loop Start -------------------- for (cnt2 = 0; cnt2 < 0x180; cnt2 += 0x40) { t6 &= 0xFFE0; @@ -234,7 +226,7 @@ void mp3_task(CHle * hle, unsigned int index, uint32_t address) inPtr += 0x40; outPtr += 0x40; } - /* --------------- Inner Loop End -------------------- */ + // --------------- Inner Loop End -------------------- memcpy(hle->dram() + writePtr, hle->mp3_buffer() + 0xe70, 0x180); writePtr += 0x180; readPtr += 0x180; @@ -243,9 +235,9 @@ void mp3_task(CHle * hle, unsigned int index, uint32_t address) static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, uint32_t t5, uint32_t t4) { - /* Part 1: 100% Accurate */ + // Part 1: 100% accurate - /* 0, 1, 3, 2, 7, 6, 4, 5, 7, 6, 4, 5, 0, 1, 3, 2 */ + // 0, 1, 3, 2, 7, 6, 4, 5, 7, 6, 4, 5, 0, 1, 3, 2 static const uint16_t LUT6[16] = { 0xFFB2, 0xFD3A, 0xF10A, 0xF854, @@ -322,43 +314,43 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, v[21] = *(int16_t *)(hle->mp3_buffer() + inPtr + (0x2A ^ S16)); v[15] += v[21]; - /* Part 2-4 */ + // Part 2-4 MP3AB0(v); - /* Part 5 - 1-Wide Butterflies - 100% Accurate but need SSVs!!! */ + // Part 5 - 1-Wide Butterflies - 100% accurate but need SSVs! t0 = t6 + 0x100; t1 = t6 + 0x200; t2 = t5 + 0x100; t3 = t5 + 0x200; - /* 0x13A8 */ + // 0x13A8 v[1] = 0; v[11] = ((v[16] - v[17]) * 0xB504) >> 0x10; v[16] = -v[16] - v[17]; v[2] = v[18] + v[19]; - /* ** Store v[11] -> (T6 + 0)** */ + // ** Store v[11] -> (T6 + 0)** *(int16_t *)(hle->mp3_buffer() + ((t6 + (short)0x0))) = (short)v[11]; v[11] = -v[11]; - /* ** Store v[16] -> (T3 + 0)** */ + // ** Store v[16] -> (T3 + 0)** *(int16_t *)(hle->mp3_buffer() + ((t3 + (short)0x0))) = (short)v[16]; - /* ** Store v[11] -> (T5 + 0)** */ + // ** Store v[11] -> (T5 + 0)** *(int16_t *)(hle->mp3_buffer() + ((t5 + (short)0x0))) = (short)v[11]; - /* 0x13E8 - Verified.... */ + // 0x13E8 - Verified... v[2] = -v[2]; - /* ** Store v[2] -> (T2 + 0)** */ + // ** Store v[2] -> (T2 + 0)** *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0x0))) = (short)v[2]; v[3] = (((v[18] - v[19]) * 0x16A09) >> 0x10) + v[2]; - /* ** Store v[3] -> (T0 + 0)** */ + // ** Store v[3] -> (T0 + 0)** *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0x0))) = (short)v[3]; - /* 0x1400 - Verified */ + // 0x1400 - Verified... v[4] = -v[20] - v[21]; v[6] = v[22] + v[23]; v[5] = ((v[20] - v[21]) * 0x16A09) >> 0x10; - /* ** Store v[4] -> (T3 + 0xFF80) */ + // ** Store v[4] -> (T3 + 0xFF80) *(int16_t *)(hle->mp3_buffer() + ((t3 + (short)0xFF80))) = (short)v[4]; v[7] = ((v[22] - v[23]) * 0x2D413) >> 0x10; v[5] = v[5] - v[4]; @@ -366,11 +358,11 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, v[6] = v[6] + v[6]; v[5] = v[5] - v[6]; v[4] = -v[4] - v[6]; - /* *** Store v[7] -> (T1 + 0xFF80) */ + // *** Store v[7] -> (T1 + 0xFF80) *(int16_t *)(hle->mp3_buffer() + ((t1 + (short)0xFF80))) = (short)v[7]; - /* *** Store v[4] -> (T2 + 0xFF80) */ + // *** Store v[4] -> (T2 + 0xFF80) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0xFF80))) = (short)v[4]; - /* *** Store v[5] -> (T0 + 0xFF80) */ + // *** Store v[5] -> (T0 + 0xFF80) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0xFF80))) = (short)v[5]; v[8] = v[24] + v[25]; @@ -391,29 +383,29 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, v[14] = -(v[14] + v[14]) + v[3]; v[17] = v[13] - v[10]; v[9] = v[9] + v[14]; - /* ** Store v[9] -> (T6 + 0x40) */ + // ** Store v[9] -> (T6 + 0x40) *(int16_t *)(hle->mp3_buffer() + ((t6 + (short)0x40))) = (short)v[9]; v[11] = v[11] - v[13]; - /* ** Store v[17] -> (T0 + 0xFFC0) */ + // ** Store v[17] -> (T0 + 0xFFC0) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0xFFC0))) = (short)v[17]; v[12] = v[8] - v[12]; - /* ** Store v[11] -> (T0 + 0x40) */ + // ** Store v[11] -> (T0 + 0x40) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0x40))) = (short)v[11]; v[8] = -v[8]; - /* ** Store v[15] -> (T1 + 0xFFC0) */ + // ** Store v[15] -> (T1 + 0xFFC0) *(int16_t *)(hle->mp3_buffer() + ((t1 + (short)0xFFC0))) = (short)v[15]; v[10] = -v[10] - v[12]; - /* ** Store v[12] -> (T2 + 0x40) */ + // ** Store v[12] -> (T2 + 0x40) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0x40))) = (short)v[12]; - /* ** Store v[8] -> (T3 + 0xFFC0) */ + // ** Store v[8] -> (T3 + 0xFFC0) *(int16_t *)(hle->mp3_buffer() + ((t3 + (short)0xFFC0))) = (short)v[8]; - /* ** Store v[14] -> (T5 + 0x40) */ + // ** Store v[14] -> (T5 + 0x40) *(int16_t *)(hle->mp3_buffer() + ((t5 + (short)0x40))) = (short)v[14]; - /* ** Store v[10] -> (T2 + 0xFFC0) */ + // ** Store v[10] -> (T2 + 0xFFC0) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0xFFC0))) = (short)v[10]; - /* 0x14FC - Verified... */ + // 0x14FC - Verified... - /* Part 6 - 100% Accurate */ + // Part 6 - 100% accurate v[0] = *(int16_t *)(hle->mp3_buffer() + inPtr + (0x00 ^ S16)); v[31] = *(int16_t *)(hle->mp3_buffer() + inPtr + (0x3E ^ S16)); @@ -485,7 +477,7 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, MP3AB0(v); - /* Part 7: - 100% Accurate + SSV - Unoptimized */ + // Part 7: - 100% accurate + SSV - Unoptimized v[0] = (v[17] + v[16]) >> 1; v[1] = ((v[17] * (int)((short)0xA57E * 2)) + (v[16] * 0xB504)) >> 0x10; @@ -495,15 +487,15 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, v[5] = (((v[20] - v[21]) * 0x16A09) >> 0x10) + v[1]; v[6] = (((v[22] + v[23]) << 1) + v[0]) - v[2]; v[7] = (((v[22] - v[23]) * 0x2D413) >> 0x10) + v[0] + v[1] + v[3]; - /* 0x16A8 */ - /* Save v[0] -> (T3 + 0xFFE0) */ + // 0x16A8 + // Save v[0] -> (T3 + 0xFFE0) *(int16_t *)(hle->mp3_buffer() + ((t3 + (short)0xFFE0))) = (short) - v[0]; v[8] = v[24] + v[25]; v[9] = ((v[24] - v[25]) * 0x16A09) >> 0x10; v[10] = ((v[26] + v[27]) << 1) + v[8]; v[11] = (((v[26] - v[27]) * 0x2D413) >> 0x10) + v[8] + v[9]; v[12] = v[4] - ((v[28] + v[29]) << 1); - /* ** Store v12 -> (T2 + 0x20) */ + // ** Store v12 -> (T2 + 0x20) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0x20))) = (short)v[12]; v[13] = (((v[28] - v[29]) * 0x2D413) >> 0x10) - v[12] - v[5]; v[14] = v[30] + v[31]; @@ -511,54 +503,54 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, v[14] = v[14] + v[14]; v[14] = v[6] - v[14]; v[15] = (((v[30] - v[31]) * 0x5A827) >> 0x10) - v[7]; - /* Store v14 -> (T5 + 0x20) */ + // Store v14 -> (T5 + 0x20) *(int16_t *)(hle->mp3_buffer() + ((t5 + (short)0x20))) = (short)v[14]; v[14] = v[14] + v[1]; - /* Store v[14] -> (T6 + 0x20) */ + // Store v[14] -> (T6 + 0x20) *(int16_t *)(hle->mp3_buffer() + ((t6 + (short)0x20))) = (short)v[14]; - /* Store v[15] -> (T1 + 0xFFE0) */ + // Store v[15] -> (T1 + 0xFFE0) *(int16_t *)(hle->mp3_buffer() + ((t1 + (short)0xFFE0))) = (short)v[15]; v[9] = v[9] + v[10]; v[1] = v[1] + v[6]; v[6] = v[10] - v[6]; v[1] = v[9] - v[1]; - /* Store v[6] -> (T5 + 0x60) */ + // Store v[6] -> (T5 + 0x60) *(int16_t *)(hle->mp3_buffer() + ((t5 + (short)0x60))) = (short)v[6]; v[10] = v[10] + v[2]; v[10] = v[4] - v[10]; - /* Store v[10] -> (T2 + 0xFFA0) */ + // Store v[10] -> (T2 + 0xFFA0) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0xFFA0))) = (short)v[10]; v[12] = v[2] - v[12]; - /* Store v[12] -> (T2 + 0xFFE0) */ + // Store v[12] -> (T2 + 0xFFE0) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0xFFE0))) = (short)v[12]; v[5] = v[4] + v[5]; v[4] = v[8] - v[4]; - /* Store v[4] -> (T2 + 0x60) */ + // Store v[4] -> (T2 + 0x60) *(int16_t *)(hle->mp3_buffer() + ((t2 + (short)0x60))) = (short)v[4]; v[0] = v[0] - v[8]; - /* Store v[0] -> (T3 + 0xFFA0) */ + // Store v[0] -> (T3 + 0xFFA0) *(int16_t *)(hle->mp3_buffer() + ((t3 + (short)0xFFA0))) = (short)v[0]; v[7] = v[7] - v[11]; - /* Store v[7] -> (T1 + 0xFFA0) */ + // Store v[7] -> (T1 + 0xFFA0) *(int16_t *)(hle->mp3_buffer() + ((t1 + (short)0xFFA0))) = (short)v[7]; v[11] = v[11] - v[3]; - /* Store v[1] -> (T6 + 0x60) */ + // Store v[1] -> (T6 + 0x60) *(int16_t *)(hle->mp3_buffer() + ((t6 + (short)0x60))) = (short)v[1]; v[11] = v[11] - v[5]; - /* Store v[11] -> (T0 + 0x60) */ + // Store v[11] -> (T0 + 0x60) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0x60))) = (short)v[11]; v[3] = v[3] - v[13]; - /* Store v[3] -> (T0 + 0x20) */ + // Store v[3] -> (T0 + 0x20) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0x20))) = (short)v[3]; v[13] = v[13] + v[2]; - /* Store v[13] -> (T0 + 0xFFE0) */ + // Store v[13] -> (T0 + 0xFFE0) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0xFFE0))) = (short)v[13]; v[2] = (v[5] - v[2]) - v[9]; - /* Store v[2] -> (T0 + 0xFFA0) */ + // Store v[2] -> (T0 + 0xFFA0) *(int16_t *)(hle->mp3_buffer() + ((t0 + (short)0xFFA0))) = (short)v[2]; - /* 0x7A8 - Verified... */ + // 0x7A8 - Verified... - /* Step 8 - Dewindowing */ + // Step 8 - Dewindowing addptr = t6 & 0xFFE0; @@ -580,9 +572,9 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, } v0 = v2 + v4; v18 = v6 + v8; - /* Clamp(v0); */ - /* Clamp(v18); */ - /* clamp??? */ + // Clamp(v0); + // Clamp(v18); + // clamp??? *(int16_t *)(hle->mp3_buffer() + (outPtr ^ S16)) = v0; *(int16_t *)(hle->mp3_buffer() + ((outPtr + 2)^S16)) = v18; outPtr += 4; @@ -641,9 +633,9 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, } v0 = v2 + v4; v18 = v6 + v8; - /* Clamp(v0); */ - /* Clamp(v18); */ - /* clamp??? */ + // Clamp(v0); + // Clamp(v18); + // clamp??? *(int16_t *)(hle->mp3_buffer() + ((outPtr + 2)^S16)) = v0; *(int16_t *)(hle->mp3_buffer() + ((outPtr + 4)^S16)) = v18; outPtr += 4; @@ -658,22 +650,22 @@ static void InnerLoop(CHle * hle, uint32_t outPtr, uint32_t inPtr, uint32_t t6, hi1 = (int)hi1 >> 0x10; for (i = 0; i < 8; i++) { - /* v0 */ + // v0 vt = (*(int16_t *)(hle->mp3_buffer() + ((tmp - 0x40)^S16)) * hi0); *(int16_t *)((uint8_t *)hle->mp3_buffer() + ((tmp - 0x40)^S16)) = clamp_s16(vt); - /* v17 */ + // v17 vt = (*(int16_t *)(hle->mp3_buffer() + ((tmp - 0x30)^S16)) * hi0); *(int16_t *)((uint8_t *)hle->mp3_buffer() + ((tmp - 0x30)^S16)) = clamp_s16(vt); - /* v2 */ + // v2 vt = (*(int16_t *)(hle->mp3_buffer() + ((tmp - 0x1E)^S16)) * hi1); *(int16_t *)((uint8_t *)hle->mp3_buffer() + ((tmp - 0x1E)^S16)) = clamp_s16(vt); - /* v4 */ + // v4 vt = (*(int16_t *)(hle->mp3_buffer() + ((tmp - 0xE)^S16)) * hi1); *(int16_t *)((uint8_t *)hle->mp3_buffer() + ((tmp - 0xE)^S16)) = clamp_s16(vt); tmp += 2; } -} \ No newline at end of file +} From ba36ce31bb8466b0a8f95983921d37460fa04870 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:45:09 -0500 Subject: [PATCH 35/40] Update musyx.cpp Fix title case, remove leftover header, add a TODO (was there supposed to be a comment there?), convert multi line comments into single line comments, fix typos, add newline --- Source/Android/PluginRSP/musyx.cpp | 127 ++++++++++++++--------------- 1 file changed, 62 insertions(+), 65 deletions(-) diff --git a/Source/Android/PluginRSP/musyx.cpp b/Source/Android/PluginRSP/musyx.cpp index 483854172..bb3d854cd 100644 --- a/Source/Android/PluginRSP/musyx.cpp +++ b/Source/Android/PluginRSP/musyx.cpp @@ -1,8 +1,3 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2013 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include @@ -10,7 +5,8 @@ #include "audio.h" #include "mem.h" -/* various constants */ +// Various constants + enum { SUBFRAME_SIZE = 192 }; enum { MAX_VOICES = 32 }; @@ -24,7 +20,7 @@ enum SFD_SFX_PTR = 0xc, SFD_VOICES = 0x10, - /* v2 only */ + // v2 only SFD2_10_PTR = 0x10, SFD2_14_BITMASK = 0x14, SFD2_15_BITMASK = 0x15, @@ -47,11 +43,11 @@ enum VOICE_ADPCM_FRAMES = 0x3c, VOICE_SKIP_SAMPLES = 0x3e, - /* for PCM16 */ + // For PCM16 VOICE_U16_40 = 0x40, VOICE_U16_42 = 0x42, - /* for ADPCM */ + // For ADPCM VOICE_ADPCM_TABLE_PTR = 0x40, VOICE_INTERLEAVED_PTR = 0x44, @@ -93,25 +89,27 @@ enum SFX_FIR4_HCOEFFS = 0x40 }; -/* struct definition */ +// Struct definition + typedef struct { - /* internal subframes */ + // Internal sub-frames int16_t left[SUBFRAME_SIZE]; int16_t right[SUBFRAME_SIZE]; int16_t cc0[SUBFRAME_SIZE]; int16_t e50[SUBFRAME_SIZE]; - /* internal subframes base volumes */ + // Internal sub-frames base volumes int32_t base_vol[4]; - /* */ + // TODO: comment? int16_t subframe_740_last4[4]; } musyx_t; typedef void (*mix_sfx_with_main_subframes_t)(musyx_t *musyx, const int16_t *subframe, const uint16_t* gains); -/* helper functions prototypes */ +// Helper functions prototypes + static void load_base_vol(CHle * hle, int32_t *base_vol, uint32_t address); static void save_base_vol(CHle * hle, const int32_t *base_vol, uint32_t address); static void update_base_vol(CHle * hle, int32_t *base_vol, uint32_t voice_mask, uint32_t last_sample_ptr, uint8_t mask_15, uint32_t ptr_24); @@ -150,9 +148,8 @@ static int32_t dot4(const int16_t *x, const int16_t *y) return accu; } -/************************************************************************** -* MusyX v1 audio ucode -**************************************************************************/ +// MusyX v1 audio microcode + void musyx_v1_task(CHle * hle) { uint32_t sfd_ptr = *dmem_u32(hle, TASK_DATA_PTR); @@ -164,14 +161,14 @@ void musyx_v1_task(CHle * hle) state_ptr = *dram_u32(hle, sfd_ptr + SFD_STATE_PTR); - /* load initial state */ + // Load initial state load_base_vol(hle, musyx.base_vol, state_ptr + STATE_BASE_VOL); dram_load_u16(hle, (uint16_t *)musyx.cc0, state_ptr + STATE_CC0, SUBFRAME_SIZE); dram_load_u16(hle, (uint16_t *)musyx.subframe_740_last4, state_ptr + STATE_740_LAST4_V1, 4); for (;;) { - /* parse SFD structure */ + // Parse SFD structure uint16_t sfx_index = *dram_u16(hle, sfd_ptr + SFD_SFX_INDEX); uint32_t voice_mask = *dram_u32(hle, sfd_ptr + SFD_VOICE_BITMASK); uint32_t sfx_ptr = *dram_u32(hle, sfd_ptr + SFD_SFX_PTR); @@ -179,17 +176,17 @@ void musyx_v1_task(CHle * hle) uint32_t last_sample_ptr = state_ptr + STATE_LAST_SAMPLE; uint32_t output_ptr; - /* initialize internal subframes using updated base volumes */ + // Initialize internal sub-frames using updated base volumes update_base_vol(hle, musyx.base_vol, voice_mask, last_sample_ptr, 0, 0); init_subframes_v1(&musyx); - /* active voices get mixed into L,R,cc0,e50 subframes (optional) */ + // Active voices get mixed into L,R,cc0,e50 subframes (optional) output_ptr = voice_stage(hle, &musyx, voice_ptr, last_sample_ptr); - /* apply delay-based effects (optional) */ + // Apply delay-based effects (optional) sfx_stage(hle, mix_sfx_with_main_subframes_v1, &musyx, sfx_ptr, sfx_index); - /* emit interleaved L,R subframes */ + // Emit interleaved L,R sub-frames interleave_stage_v1(hle, &musyx, output_ptr); --sfd_count; @@ -202,15 +199,14 @@ void musyx_v1_task(CHle * hle) state_ptr = *dram_u32(hle, sfd_ptr + SFD_STATE_PTR); } - /* writeback updated state */ + // Writeback updated state save_base_vol(hle, musyx.base_vol, state_ptr + STATE_BASE_VOL); dram_store_u16(hle, (uint16_t *)musyx.cc0, state_ptr + STATE_CC0, SUBFRAME_SIZE); dram_store_u16(hle, (uint16_t *)musyx.subframe_740_last4, state_ptr + STATE_740_LAST4_V1, 4); } -/************************************************************************** -* MusyX v2 audio ucode -**************************************************************************/ +// MusyX v2 audio microcode + void musyx_v2_task(CHle * hle) { uint32_t sfd_ptr = *dmem_u32(hle, TASK_DATA_PTR); @@ -221,7 +217,7 @@ void musyx_v2_task(CHle * hle) for (;;) { - /* parse SFD structure */ + // Parse SFD structure uint16_t sfx_index = *dram_u16(hle, sfd_ptr + SFD_SFX_INDEX); uint32_t voice_mask = *dram_u32(hle, sfd_ptr + SFD_VOICE_BITMASK); uint32_t state_ptr = *dram_u32(hle, sfd_ptr + SFD_STATE_PTR); @@ -240,31 +236,31 @@ void musyx_v2_task(CHle * hle) uint32_t last_sample_ptr = state_ptr + STATE_LAST_SAMPLE; uint32_t output_ptr; - /* load state */ + // Load state load_base_vol(hle, musyx.base_vol, state_ptr + STATE_BASE_VOL); dram_load_u16(hle, (uint16_t *)musyx.subframe_740_last4, state_ptr + STATE_740_LAST4_V2, 4); - /* initialize internal subframes using updated base volumes */ + // Initialize internal sub-frames using updated base volumes update_base_vol(hle, musyx.base_vol, voice_mask, last_sample_ptr, mask_15, ptr_24); init_subframes_v2(&musyx); if (ptr_10) { - /* TODO */ + // TODO: hle->WarnMessage("ptr_10=%08x mask_14=%02x ptr_24=%08x", ptr_10, mask_14, ptr_24); } - /* active voices get mixed into L,R,cc0,e50 subframes (optional) */ + // Active voices get mixed into L,R,cc0,e50 sub-frames (optional) output_ptr = voice_stage(hle, &musyx, voice_ptr, last_sample_ptr); - /* apply delay-based effects (optional) */ + // Apply delay-based effects (optional) sfx_stage(hle, mix_sfx_with_main_subframes_v2, &musyx, sfx_ptr, sfx_index); dram_store_u16(hle, (uint16_t*)musyx.left, output_ptr , SUBFRAME_SIZE); dram_store_u16(hle, (uint16_t*)musyx.right, output_ptr + 2*SUBFRAME_SIZE, SUBFRAME_SIZE); dram_store_u16(hle, (uint16_t*)musyx.cc0, output_ptr + 4*SUBFRAME_SIZE, SUBFRAME_SIZE); - /* store state */ + // Store state save_base_vol(hle, musyx.base_vol, state_ptr + STATE_BASE_VOL); dram_store_u16(hle, (uint16_t*)musyx.subframe_740_last4, state_ptr + STATE_740_LAST4_V2, 4); @@ -318,7 +314,7 @@ static void update_base_vol(CHle * hle, int32_t *base_vol, hle->VerboseMessage("base_vol voice_mask = %08x", voice_mask); hle->VerboseMessage("BEFORE: base_vol = %08x %08x %08x %08x", base_vol[0], base_vol[1], base_vol[2], base_vol[3]); - /* optim: skip voices contributions entirely if voice_mask is empty */ + // optimization: skip voices contributions entirely if voice_mask is empty if (voice_mask != 0) { for (i = 0, mask = 1; i < MAX_VOICES; ++i, mask <<= 1, last_sample_ptr += 8) @@ -335,7 +331,7 @@ static void update_base_vol(CHle * hle, int32_t *base_vol, } } - /* optim: skip contributions entirely if mask_15 is empty */ + // optimization: skip contributions entirely if mask_15 is empty if (mask_15 != 0) { for(i = 0, mask = 1; i < 4; ++i, mask <<= 1, ptr_24 += 8) @@ -352,7 +348,7 @@ static void update_base_vol(CHle * hle, int32_t *base_vol, } } - /* apply 3% decay */ + // Apply 3% decay for (k = 0; k < 4; ++k) { base_vol[k] = (base_vol[k] * 0x0000f850) >> 16; @@ -406,29 +402,30 @@ static void init_subframes_v2(musyx_t *musyx) } } -/* Process voices, and returns interleaved subframe destination address */ +// Process voices, and returns interleaved sub-frame destination address + static uint32_t voice_stage(CHle * hle, musyx_t *musyx, uint32_t voice_ptr, uint32_t last_sample_ptr) { uint32_t output_ptr; int i = 0; - /* voice stage can be skipped if first voice has no samples */ + // Voice stage can be skipped if first voice has no samples if (*dram_u16(hle, voice_ptr + VOICE_CATSRC_0 + CATSRC_SIZE1) == 0) { - hle->VerboseMessage("Skipping Voice stage"); + hle->VerboseMessage("Skipping voice stage"); output_ptr = *dram_u32(hle, voice_ptr + VOICE_INTERLEAVED_PTR); } else { - /* otherwise process voices until a non null output_ptr is encountered */ + // Otherwise process voices until a non null output_ptr is encountered for (;;) { - /* load voice samples (PCM16 or APDCM) */ + // Load voice samples (PCM16 or APDCM) int16_t samples[SAMPLE_BUFFER_SIZE]; unsigned segbase; unsigned offset; - hle->VerboseMessage("Processing Voice #%d", i); + hle->VerboseMessage("Processing voice #%d", i); if (*dram_u8(hle, voice_ptr + VOICE_ADPCM_FRAMES) == 0) { @@ -439,17 +436,17 @@ static uint32_t voice_stage(CHle * hle, musyx_t *musyx, uint32_t voice_ptr, uint load_samples_ADPCM(hle, voice_ptr, samples, &segbase, &offset); } - /* mix them with each internal subframes */ + // Mix them with each internal sub-frame mix_voice_samples(hle, musyx, voice_ptr, samples, segbase, offset, last_sample_ptr + i * 8); - /* check break condition */ + // Check break condition output_ptr = *dram_u32(hle, voice_ptr + VOICE_INTERLEAVED_PTR); if (output_ptr != 0) { break; } - /* next voice */ + // Next voice ++i; voice_ptr += VOICE_SIZE; } @@ -524,8 +521,8 @@ static void load_samples_PCM16(CHle * hle, uint32_t voice_ptr, int16_t *samples, static void load_samples_ADPCM(CHle * hle, uint32_t voice_ptr, int16_t *samples, unsigned *segbase, unsigned *offset) { - /* decompressed samples cannot exceed 0x400 bytes; - * ADPCM has a compression ratio of 5/16 */ + // Decompressed samples cannot exceed 0x400 bytes + // ADPCM has a compression ratio of 5/16 uint8_t buffer[SAMPLE_BUFFER_SIZE * 2 * 5 / 16]; int16_t adpcm_table[128]; @@ -620,16 +617,16 @@ static void mix_voice_samples(CHle * hle, musyx_t *musyx, uint32_t voice_ptr, co { int i, k; - /* parse VOICE structure */ + // Parse VOICE structure const uint16_t pitch_q16 = *dram_u16(hle, voice_ptr + VOICE_PITCH_Q16); - const uint16_t pitch_shift = *dram_u16(hle, voice_ptr + VOICE_PITCH_SHIFT); /* Q4.12 */ + const uint16_t pitch_shift = *dram_u16(hle, voice_ptr + VOICE_PITCH_SHIFT); // Q4.12 const uint16_t end_point = *dram_u16(hle, voice_ptr + VOICE_END_POINT); const uint16_t restart_point = *dram_u16(hle, voice_ptr + VOICE_RESTART_POINT); const uint16_t u16_4e = *dram_u16(hle, voice_ptr + VOICE_U16_4E); - /* init values and pointers */ + // Initialize values and pointers const int16_t *sample = samples + segbase + offset + u16_4e; const int16_t *const sample_end = samples + segbase + end_point; const int16_t *const sample_restart = samples + (restart_point & 0x7fff) + @@ -655,7 +652,7 @@ static void mix_voice_samples(CHle * hle, musyx_t *musyx, uint32_t voice_ptr, co for (i = 0; i < SUBFRAME_SIZE; ++i) { - /* update sample and lut pointers and then pitch_accu */ + // Update sample and LUT pointers and then pitch_accu const int16_t *lut = (RESAMPLE_LUT + ((pitch_accu & 0xfc00) >> 8)); int dist; int16_t v; @@ -664,30 +661,30 @@ static void mix_voice_samples(CHle * hle, musyx_t *musyx, uint32_t voice_ptr, co pitch_accu &= 0xffff; pitch_accu += pitch_step; - /* handle end/restart points */ + // Handle end/restart points dist = sample - sample_end; if (dist >= 0) { sample = sample_restart + dist; } - /* apply resample filter */ + // Apply resample filter v = clamp_s16(dot4(sample, lut)); for (k = 0; k < 4; ++k) { - /* envmix */ + // Envmix int32_t accu = (v * (v4_env[k] >> 16)) >> 15; v4[k] = clamp_s16(accu); *(v4_dst[k]) = clamp_s16(accu + *(v4_dst[k])); - /* update envelopes and dst pointers */ + // Update envelopes and DST pointers ++(v4_dst[k]); v4_env[k] += v4_env_step[k]; } } - /* save last resampled sample */ + // Save last resampled sample dram_store_u16(hle, (uint16_t *)v4, last_sample_ptr, 4); hle->VerboseMessage("last_sample = %04x %04x %04x %04x", v4[0], v4[1], v4[2], v4[3]); @@ -722,7 +719,7 @@ static void sfx_stage(CHle * hle, mix_sfx_with_main_subframes_t mix_sfx_with_mai return; } - /* load sfx parameters */ + // Load SFX parameters cbuffer_ptr = *dram_u32(hle, sfx_ptr + SFX_CBUFFER_PTR); cbuffer_length = *dram_u32(hle, sfx_ptr + SFX_CBUFFER_LENGTH); @@ -742,7 +739,7 @@ static void sfx_stage(CHle * hle, mix_sfx_with_main_subframes_t mix_sfx_with_mai hle->VerboseMessage("tap count=%d\n" "delays: %08x %08x %08x %08x %08x %08x %08x %08x\n" "gains: %04x %04x %04x %04x %04x %04x %04x %04x", tap_count, tap_delays[0], tap_delays[1], tap_delays[2], tap_delays[3], tap_delays[4], tap_delays[5], tap_delays[6], tap_delays[7], tap_gains[0], tap_gains[1], tap_gains[2], tap_gains[3], tap_gains[4], tap_gains[5], tap_gains[6], tap_gains[7]); hle->VerboseMessage("sfx_gains=%04x %04x", sfx_gains[0], sfx_gains[1]); - /* mix up to 8 delayed subframes */ + // Mix up to 8 delayed sub-frames memset(subframe, 0, SUBFRAME_SIZE * sizeof(subframe[0])); for (i = 0; i < tap_count; ++i) { @@ -764,10 +761,10 @@ static void sfx_stage(CHle * hle, mix_sfx_with_main_subframes_t mix_sfx_with_mai mix_subframes(subframe, delayed, tap_gains[i]); } - /* add resulting subframe to main subframes */ + // Add resulting sub-frame to main sub-frames mix_sfx_with_main_subframes(musyx, subframe, sfx_gains); - /* apply FIR4 filter and writeback filtered result */ + // Apply FIR4 filter and writeback filtered result memcpy(buffer, musyx->subframe_740_last4, 4 * sizeof(int16_t)); memcpy(musyx->subframe_740_last4, subframe + SUBFRAME_SIZE - 4, 4 * sizeof(int16_t)); mix_fir4(musyx->e50, buffer + 1, fir4_hgain, fir4_hcoeffs); @@ -870,7 +867,7 @@ static void interleave_stage_v2(CHle * hle, musyx_t *musyx, uint16_t mask_16, ui hle->VerboseMessage("mask_16=%04x ptr_18=%08x ptr_1c=%08x output_ptr=%08x", mask_16, ptr_18, ptr_1c, output_ptr); - /* compute L_total, R_total and update subframe @ptr_1c */ + // Compute L_total, R_total and update sub-frame @ptr_1c memset(subframe, 0, SUBFRAME_SIZE*sizeof(subframe[0])); for(i = 0; i < SUBFRAME_SIZE; ++i) @@ -901,7 +898,7 @@ static void interleave_stage_v2(CHle * hle, musyx_t *musyx, uint16_t mask_16, ui } } - /* interleave L_total and R_total */ + // Interleave L_total and R_total dst = dram_u32(hle, output_ptr); for(i = 0; i < SUBFRAME_SIZE; ++i) { @@ -910,6 +907,6 @@ static void interleave_stage_v2(CHle * hle, musyx_t *musyx, uint16_t mask_16, ui *(dst++) = (l << 16) | r; } - /* writeback subframe @ptr_1c */ + // Writeback sub-frame @ptr_1c dram_store_u16(hle, (uint16_t*)subframe, ptr_1c, SUBFRAME_SIZE); -} \ No newline at end of file +} From a8c6a1446316df9df13125b90a0734876dcc1cf4 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:49:14 -0500 Subject: [PATCH 36/40] Update ucodes.h Remove title case, remove leftover header, fix typos, fix abbreviations --- Source/Android/PluginRSP/ucodes.h | 55 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/Source/Android/PluginRSP/ucodes.h b/Source/Android/PluginRSP/ucodes.h index d9babacc3..055762cb5 100644 --- a/Source/Android/PluginRSP/ucodes.h +++ b/Source/Android/PluginRSP/ucodes.h @@ -1,46 +1,43 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2014 Bobby Smiles -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #pragma once class CHle; -/* cic_x105 ucode */ +// cic_x105 microcode + void cicx105_ucode(CHle * hle); -/* audio list ucodes - audio */ +// Audio list microcodes + enum { N_SEGMENTS = 16 }; struct alist_audio_t { - /* segments */ + // Segments uint32_t segments[N_SEGMENTS]; - /* main buffers */ + // Main buffers uint16_t in; uint16_t out; uint16_t count; - /* auxiliary buffers */ + // Auxiliary buffers uint16_t dry_right; uint16_t wet_left; uint16_t wet_right; - /* gains */ + // Gains int16_t dry; int16_t wet; - /* envelopes (0:left, 1:right) */ + // Envelopes (0:left, 1:right) int16_t vol[2]; int16_t target[2]; int32_t rate[2]; - /* ADPCM loop point address */ + // ADPCM loop point address uint32_t loop; - /* storage for ADPCM table and polef coefficients */ + // Storage for ADPCM table and polef coefficients int16_t table[16 * 8]; }; @@ -48,22 +45,23 @@ void alist_process_audio(CHle * hle); void alist_process_audio_ge(CHle * hle); void alist_process_audio_bc(CHle * hle); -/* audio list ucodes - naudio */ +// Audio list microcodes - naudio + struct alist_naudio_t { - /* gains */ + // Gains int16_t dry; int16_t wet; - /* envelopes (0:left, 1:right) */ + // Envelopes (0:left, 1:right) int16_t vol[2]; int16_t target[2]; int32_t rate[2]; - /* ADPCM loop point address */ + // ADPCM loop point address uint32_t loop; - /* storage for ADPCM table and polef coefficients */ + // Storage for ADPCM table and polef coefficients int16_t table[16 * 8]; }; @@ -73,25 +71,26 @@ void alist_process_naudio_dk(CHle * hle); void alist_process_naudio_mp3(CHle * hle); void alist_process_naudio_cbfd(CHle * hle); -/* audio list ucodes - nead */ +// Audio list microcodes - nead + struct alist_nead_t { - /* main buffers */ + // Main buffers uint16_t in; uint16_t out; uint16_t count; - /* envmixer ramps */ + // Envmixer ramps uint16_t env_values[3]; uint16_t env_steps[3]; - /* ADPCM loop point address */ + // ADPCM loop point address uint32_t loop; - /* storage for ADPCM table and polef coefficients */ + // Storage for ADPCM table and polef coefficients int16_t table[16 * 8]; - /* filter audio command state */ + // Filter audio command state uint16_t filter_count; uint32_t filter_lut_address[2]; }; @@ -108,14 +107,14 @@ void alist_process_nead_mm(CHle * hle); void alist_process_nead_mmb(CHle * hle); void alist_process_nead_ac(CHle * hle); -/* mp3 ucode */ +// MP3 microcode void mp3_task(CHle * hle, unsigned int index, uint32_t address); -/* musyx ucodes */ +// Musyx microcodes void musyx_v1_task(CHle * hle); void musyx_v2_task(CHle * hle); -/* jpeg ucodes */ +// JPEG microcodes void jpeg_decode_PS0(CHle * hle); void jpeg_decode_PS(CHle * hle); void jpeg_decode_OB(CHle * hle); From bfc721376011cdb3309afc617c2a1abb0e4c0822 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:50:30 -0500 Subject: [PATCH 37/40] Update cicx105.cpp Fix typos, abbreviations, and update multi line comments to single line comments, correct some names, and remove leftover header --- Source/Android/PluginRSP/cicx105.cpp | 32 +++++++++++----------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/Source/Android/PluginRSP/cicx105.cpp b/Source/Android/PluginRSP/cicx105.cpp index 39c2cf41d..45dfc1b23 100644 --- a/Source/Android/PluginRSP/cicx105.cpp +++ b/Source/Android/PluginRSP/cicx105.cpp @@ -1,36 +1,30 @@ -// Project64 - A Nintendo 64 emulator -// http://www.pj64-emu.com/ -// Copyright(C) 2001-2021 Project64 -// Copyright(C) 2012 Bobby Smiles -// Copyright(C) 2009 Richard Goedeken -// Copyright(C) 2002 Hacktarux -// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html #include "stdafx.h" #include -/** -* During IPL3 stage of CIC x105 games, the RSP performs some checks and transactions -* necessary for booting the game. -* -* We only implement the needed DMA transactions for booting. -* -* Found in Banjo-Tooie, Zelda, Perfect Dark, ...) -**/ +/* +During IPL3 stage of CIC x105 games, the RSP performs some checks and transactions +necessary for booting the game. + +We only implement the needed DMA transactions for booting. + +Found in Banjo-Tooie, Zelda, Perfect Dark, ...) +*/ + void cicx105_ucode(CHle * hle) { - /* memcpy is okay to use because access constrains are met (alignment, size) */ + // memcpy is okay to use because access constraints are met (alignment, size) unsigned int i; unsigned char *dst = hle->dram() + 0x2fb1f0; unsigned char *src = hle->imem() + 0x120; - /* dma_read(0x1120, 0x1e8, 0x1e8) */ + // dma_read(0x1120, 0x1e8, 0x1e8) memcpy(hle->imem() + 0x120, hle->dram() + 0x1e8, 0x1f0); - /* dma_write(0x1120, 0x2fb1f0, 0xfe817000) */ + // dma_write(0x1120, 0x2fb1f0, 0xfe817000) for (i = 0; i < 24; ++i) { memcpy(dst, src, 8); dst += 0xff0; src += 0x8; } -} \ No newline at end of file +} From 0ba33db46bd28f360f1bb960bb96729e9bb12fc6 Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 00:54:47 -0500 Subject: [PATCH 38/40] Update README.md Add some more of the relevant contributors to the list Also if anybody wants to be added/removed from the list, feel free to open an issue or get in contact with Zilmar or me. Also if you guys have any suggestions for additions, also get in touch. --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d2372d7f5..ab9f55b98 100644 --- a/README.md +++ b/README.md @@ -50,12 +50,15 @@ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c6 We use semantic versioning for Project64. For the versions available, see the [tags on this repository](https://github.com/project64/project64/tags) -## Authors +## Author / Contributors * **Zilmar** - *Current maintainer* - [Zilmar](https://github.com/project64) -* **Jabo** - *Previous member* - Jabo -* **Smiff** - *Previous member* - Smiff -* **Gent** - *Previous member* - Gent +* **Jabo** - *Previous contributor* - Jabo +* **Smiff** - *Previous contributor* - Smiff +* **Gent** - *Previous contributor* - Gent +* **Bobby Smiles** - *Previous contributor* - Bobby Smiles +* **Richard Goedeken** - *Previous contributor* - Richard Goedeken +* **Hacktarux** - *Previous contributor* - Hacktarux See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project. From a7c175d0fdc50b5df394889533df7babf1a03c6a Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 02:02:10 -0500 Subject: [PATCH 39/40] Update README.md Revert some changes --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index ab9f55b98..1d64675ab 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,6 @@ We use semantic versioning for Project64. For the versions available, see the [t * **Jabo** - *Previous contributor* - Jabo * **Smiff** - *Previous contributor* - Smiff * **Gent** - *Previous contributor* - Gent -* **Bobby Smiles** - *Previous contributor* - Bobby Smiles -* **Richard Goedeken** - *Previous contributor* - Richard Goedeken -* **Hacktarux** - *Previous contributor* - Hacktarux See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project. From a786dd7e130ec8d672742138cbb3e7282159801d Mon Sep 17 00:00:00 2001 From: "Derek \"Turtle\" Roe" Date: Tue, 16 Mar 2021 02:17:43 -0500 Subject: [PATCH 40/40] Fix headers Oops, accidentally removed some headers that should stay --- Source/Android/PluginRSP/alist.cpp | 8 ++++++++ Source/Android/PluginRSP/alist.h | 6 ++++++ Source/Android/PluginRSP/alist_audio.cpp | 8 ++++++++ Source/Android/PluginRSP/alist_naudio.cpp | 8 ++++++++ Source/Android/PluginRSP/alist_nead.cpp | 8 ++++++++ Source/Android/PluginRSP/arithmetics.h | 6 ++++++ Source/Android/PluginRSP/audio.cpp | 6 ++++++ Source/Android/PluginRSP/audio.h | 6 ++++++ Source/Android/PluginRSP/cicx105.cpp | 8 ++++++++ Source/Android/PluginRSP/common.h | 8 ++++++++ Source/Android/PluginRSP/hle.cpp | 8 ++++++++ Source/Android/PluginRSP/hle.h | 6 ++++++ Source/Android/PluginRSP/jpeg.cpp | 8 ++++++++ Source/Android/PluginRSP/mem.cpp | 6 ++++++ Source/Android/PluginRSP/mem.h | 6 ++++++ Source/Android/PluginRSP/mp3.cpp | 8 ++++++++ Source/Android/PluginRSP/musyx.cpp | 6 ++++++ Source/Android/PluginRSP/ucodes.h | 6 ++++++ 18 files changed, 126 insertions(+) diff --git a/Source/Android/PluginRSP/alist.cpp b/Source/Android/PluginRSP/alist.cpp index ac7c2c5c3..63802628d 100644 --- a/Source/Android/PluginRSP/alist.cpp +++ b/Source/Android/PluginRSP/alist.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include #include "alist.h" diff --git a/Source/Android/PluginRSP/alist.h b/Source/Android/PluginRSP/alist.h index 634a51e44..67410f215 100644 --- a/Source/Android/PluginRSP/alist.h +++ b/Source/Android/PluginRSP/alist.h @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once class CHle; diff --git a/Source/Android/PluginRSP/alist_audio.cpp b/Source/Android/PluginRSP/alist_audio.cpp index ff2896adc..77694b272 100644 --- a/Source/Android/PluginRSP/alist_audio.cpp +++ b/Source/Android/PluginRSP/alist_audio.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include diff --git a/Source/Android/PluginRSP/alist_naudio.cpp b/Source/Android/PluginRSP/alist_naudio.cpp index 61f3a0caf..66dc8a0d7 100644 --- a/Source/Android/PluginRSP/alist_naudio.cpp +++ b/Source/Android/PluginRSP/alist_naudio.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include "alist.h" diff --git a/Source/Android/PluginRSP/alist_nead.cpp b/Source/Android/PluginRSP/alist_nead.cpp index 232d9e058..68240814c 100644 --- a/Source/Android/PluginRSP/alist_nead.cpp +++ b/Source/Android/PluginRSP/alist_nead.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include "alist.h" diff --git a/Source/Android/PluginRSP/arithmetics.h b/Source/Android/PluginRSP/arithmetics.h index c005768f6..9ddd4e565 100644 --- a/Source/Android/PluginRSP/arithmetics.h +++ b/Source/Android/PluginRSP/arithmetics.h @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once static inline int16_t clamp_s16(int_fast32_t x) diff --git a/Source/Android/PluginRSP/audio.cpp b/Source/Android/PluginRSP/audio.cpp index a76446b3c..afd5da4d6 100644 --- a/Source/Android/PluginRSP/audio.cpp +++ b/Source/Android/PluginRSP/audio.cpp @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include #include "audio.h" diff --git a/Source/Android/PluginRSP/audio.h b/Source/Android/PluginRSP/audio.h index 2aeee057f..6dfe6cdb8 100644 --- a/Source/Android/PluginRSP/audio.h +++ b/Source/Android/PluginRSP/audio.h @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once extern const int16_t RESAMPLE_LUT[64 * 4]; diff --git a/Source/Android/PluginRSP/cicx105.cpp b/Source/Android/PluginRSP/cicx105.cpp index 45dfc1b23..12e543483 100644 --- a/Source/Android/PluginRSP/cicx105.cpp +++ b/Source/Android/PluginRSP/cicx105.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2012 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include diff --git a/Source/Android/PluginRSP/common.h b/Source/Android/PluginRSP/common.h index 400173d8c..67dd04b55 100644 --- a/Source/Android/PluginRSP/common.h +++ b/Source/Android/PluginRSP/common.h @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once // Macro for unused variable warning suppression diff --git a/Source/Android/PluginRSP/hle.cpp b/Source/Android/PluginRSP/hle.cpp index f76f7f02b..e603b8449 100644 --- a/Source/Android/PluginRSP/hle.cpp +++ b/Source/Android/PluginRSP/hle.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2012 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include "mem.h" #include "ucodes.h" diff --git a/Source/Android/PluginRSP/hle.h b/Source/Android/PluginRSP/hle.h index 5e840d26d..04095a12d 100644 --- a/Source/Android/PluginRSP/hle.h +++ b/Source/Android/PluginRSP/hle.h @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once #include #include "Rsp.h" diff --git a/Source/Android/PluginRSP/jpeg.cpp b/Source/Android/PluginRSP/jpeg.cpp index 77071e8c8..2ca29b430 100644 --- a/Source/Android/PluginRSP/jpeg.cpp +++ b/Source/Android/PluginRSP/jpeg.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2012 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include diff --git a/Source/Android/PluginRSP/mem.cpp b/Source/Android/PluginRSP/mem.cpp index f940c7980..ac67e6cda 100644 --- a/Source/Android/PluginRSP/mem.cpp +++ b/Source/Android/PluginRSP/mem.cpp @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2012 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include diff --git a/Source/Android/PluginRSP/mem.h b/Source/Android/PluginRSP/mem.h index 2ab2b04a5..553775acd 100644 --- a/Source/Android/PluginRSP/mem.h +++ b/Source/Android/PluginRSP/mem.h @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once #include diff --git a/Source/Android/PluginRSP/mp3.cpp b/Source/Android/PluginRSP/mp3.cpp index 5e8775003..f51a221ac 100644 --- a/Source/Android/PluginRSP/mp3.cpp +++ b/Source/Android/PluginRSP/mp3.cpp @@ -1,3 +1,11 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// Copyright(C) 2009 Richard Goedeken +// Copyright(C) 2002 Hacktarux +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include diff --git a/Source/Android/PluginRSP/musyx.cpp b/Source/Android/PluginRSP/musyx.cpp index bb3d854cd..caea2554c 100644 --- a/Source/Android/PluginRSP/musyx.cpp +++ b/Source/Android/PluginRSP/musyx.cpp @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2013 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #include "stdafx.h" #include diff --git a/Source/Android/PluginRSP/ucodes.h b/Source/Android/PluginRSP/ucodes.h index 055762cb5..4b3a5788f 100644 --- a/Source/Android/PluginRSP/ucodes.h +++ b/Source/Android/PluginRSP/ucodes.h @@ -1,3 +1,9 @@ +// Project64 - A Nintendo 64 emulator +// http://www.pj64-emu.com/ +// Copyright(C) 2001-2021 Project64 +// Copyright(C) 2014 Bobby Smiles +// GNU/GPLv2 licensed: https://gnu.org/licenses/gpl-2.0.html + #pragma once class CHle;