Skip to content

Commit

Permalink
Evo branch, lots of updates
Browse files Browse the repository at this point in the history
Slow, progressive update to xjsxjs197's WiiSXRX fork. Code updated until commit a03f618a895fb526bef35808a698dc52e0dbb4e1 (Aug 26, 2022).

- For now, discarded the "Languages" option, which tends to cause some minor random crashes on the UI, with certain actions.
- When you open a directory with CUE+BIN, only the CUE will be shown. This condition is only true if the CUE and BIN tracks contain the same name, i.e.: "Mortal Kombat Trilogy (USA)"
- CD-ROM plugin changed from CDR Mooby to CDR ISO (PCSX-df). Highly improved game compatibility, and Swap CD fix for many games.
- Keeping FranSPU sound plugin (psx4all) over the dfsound plugin (pcsxr), for the moment. This will give different compatibility/results on some titles when compared to the fork, and a tiny speedup.
- BIOS, MDEC decoder (FMV), R3000 CPU updates and fixes.

Thanks goes to the PCSX / PCSX-df / PCSX-r / PCSX-Revolution / PCSX-ReARMed teams, and xjsxjs197 code adaptations.
  • Loading branch information
niuus committed Sep 7, 2022
1 parent 4c240ac commit e633ff4
Show file tree
Hide file tree
Showing 58 changed files with 8,757 additions and 2,229 deletions.
48 changes: 39 additions & 9 deletions Gamecube/DEBUG.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <unistd.h>
#include <sys/dir.h>
#include <aesndlib.h>
#include <stdbool.h>
#include "DEBUG.h"
#include "TEXT.h"
//#include "usb.h"
Expand All @@ -27,10 +28,10 @@ extern unsigned int diff_sec(long long start,long long end);
static void check_heap_space(void){
sprintf(txtbuffer,"%dKB MEM1 available", SYS_GetArena1Size()/1024);
DEBUG_print(txtbuffer,DBG_MEMFREEINFO);

sprintf(txtbuffer,"Dynarec (KB) %04d/%04d",dyna_used,dyna_total/1024);
DEBUG_print(txtbuffer,DBG_CORE1);

sprintf(txtbuffer,"DSP is at %f%%",AESND_GetDSPProcessUsage());
DEBUG_print(txtbuffer,DBG_CORE2);
}
Expand All @@ -41,12 +42,12 @@ void DEBUG_update() {
int i;
long long nowTick = gettime();
for(i=0; i<DEBUG_TEXT_HEIGHT; i++){
if(diff_sec(texttimes[i],nowTick)>=DEBUG_STRING_LIFE)
if(diff_sec(texttimes[i],nowTick)>=DEBUG_STRING_LIFE)
{
memset(text[i],0,DEBUG_TEXT_WIDTH);
}
}
check_heap_space();
//check_heap_space();
#endif
}

Expand All @@ -56,6 +57,35 @@ int amountwritten = 0;
//char *dump_filename = "dev0:\\PSXISOS\\debug.txt";
char *dump_filename = "/PSXISOS/debug.txt";
FILE* fdebug = NULL;

FILE* fdebugLog = NULL;
char *debugLogFile = "sd:/wiisxrx/debugLog.txt";
bool canWriteLog = false;

void openLogFile() {
if (!fdebugLog) {
fdebugLog = fopen(debugLogFile, "w");
}
}

void closeLogFile() {
if (fdebugLog) {
fclose(fdebugLog);
fdebugLog = NULL;
}
}

void writeLogFile(char* string) {
if (fdebugLog && canWriteLog) {
fprintf(fdebugLog, string);
}
}

void printFunctionName() {
DEBUG_print(txtbuffer, DBG_CORE2);
writeLogFile(txtbuffer);
}

void DEBUG_print(char* string,int pos){

#ifdef SHOW_DEBUG
Expand Down Expand Up @@ -91,7 +121,7 @@ void DEBUG_print(char* string,int pos){
}
#endif
}
else if(pos == DBG_SDGECKOPRINT) {
else if(pos == DBG_SDGECKOPRINT) {
#ifdef SDPRINT
if(!f || (printToSD == 0))
return;
Expand All @@ -105,14 +135,14 @@ void DEBUG_print(char* string,int pos){
texttimes[pos] = gettime();
}
#endif

}


#define MAX_STATS 20
unsigned int stats_buffer[MAX_STATS];
unsigned int avge_counter[MAX_STATS];
void DEBUG_stats(int stats_id, char *info, unsigned int stats_type, unsigned int adjustment_value)
void DEBUG_stats(int stats_id, char *info, unsigned int stats_type, unsigned int adjustment_value)
{
#ifdef SHOW_DEBUG
switch(stats_type)
Expand All @@ -129,11 +159,11 @@ void DEBUG_stats(int stats_id, char *info, unsigned int stats_type, unsigned int
avge_counter[stats_id] = 0;
stats_buffer[stats_id] = 0;
break;

}
unsigned int value = stats_buffer[stats_id];
if(stats_type == STAT_TYPE_AVGE) value /= avge_counter[stats_id];

sprintf(txtbuffer,"%s [ %u ]", info, value);
DEBUG_print(txtbuffer,DBG_STATSBASE+stats_id);
#endif
Expand Down
7 changes: 7 additions & 0 deletions Gamecube/DEBUG.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ void refresh_stat();
#define STATS_FCOUNTER 2 //FRAME counter
#define STATS_THREE 3

extern bool canWriteLog;

extern char txtbuffer[1024];
// Amount of time each string will be held onto
#define DEBUG_STRING_LIFE 5
Expand All @@ -95,6 +97,11 @@ void DEBUG_update(void);
// Returns pointer to an array of char*
char** DEBUG_get_text(void);

void openLogFile();
void closeLogFile();
void writeLogFile(char* string);
void printFunctionName();

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit e633ff4

Please sign in to comment.