Skip to content

Commit

Permalink
IRISMAN 4.86.3
Browse files Browse the repository at this point in the history
- Disabled menu option for internal fan controller on PS3HEN
- Fixed listing of /net games not showing items
  • Loading branch information
aldostools committed Jun 8, 2020
1 parent 686f2fb commit 39aeebd
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 25 deletions.
17 changes: 12 additions & 5 deletions source/controlfan.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extern char temp_buffer[8192];
extern int flash;
extern u64 frame_count;
extern char self_path[MAXPATHLEN];
extern bool is_ps3hen;

static bool is_sm_sprx_loaded = false;

Expand Down Expand Up @@ -153,6 +154,8 @@ int test_controlfan_compatibility()

int get_controlfan_offsets()
{
if(is_ps3hen) return 0;

if(sys389_offset) return 1;

if(firmware == 0x341C) { // firmware 3.41 2EB128
Expand Down Expand Up @@ -430,7 +433,7 @@ int get_controlfan_offsets()
// enables sys_set_leds
sys386_offset = 0x800000000000A47CULL;

} else if((firmware == 0x475C) || (firmware == 0x476C) || (firmware == 0x478C) || (firmware == 0x481C) || (firmware == 0x482C) || (firmware == 0x483C) || (firmware == 0x484C) || (firmware == 0x485C) || (firmware == 0x486C) || (firmware == 0x487C)) { // firmware 4.75-4.85 cex
} else if((firmware == 0x475C) || (firmware == 0x476C) || (firmware == 0x478C) || (firmware == 0x481C) || (firmware == 0x482C) || (firmware == 0x483C) || (firmware == 0x484C) || (firmware == 0x485C) || (firmware == 0x486C) || (firmware == 0x487C)) { // firmware 4.75-4.87 cex

// enables sys_game_get_temperature
sys383_offset = 0x800000000000C6A8ULL;
Expand All @@ -442,7 +445,7 @@ int get_controlfan_offsets()
sys386_offset = 0x800000000000A3FCULL;

} else if((firmware == 0x475D) || (firmware == 0x476D) || (firmware == 0x478D) || (firmware == 0x481D) || (firmware == 0x482D) || (firmware == 0x483D) || (firmware == 0x484D) || (firmware == 0x485D) || (firmware == 0x486D) || (firmware == 0x487D)
|| (firmware == 0x475E) || (firmware == 0x476E) || (firmware == 0x478E) || (firmware == 0x481E) || (firmware == 0x482E) || (firmware == 0x483E) || (firmware == 0x484E) || (firmware == 0x485E) || (firmware == 0x486E) || (firmware == 0x487E)) { // firmware 4.75-4.85 dex / deh
|| (firmware == 0x475E) || (firmware == 0x476E) || (firmware == 0x478E) || (firmware == 0x481E) || (firmware == 0x482E) || (firmware == 0x483E) || (firmware == 0x484E) || (firmware == 0x485E) || (firmware == 0x486E) || (firmware == 0x487E)) { // firmware 4.75-4.87 dex / deh

// enables sys_game_get_temperature
sys383_offset = 0x800000000000C728ULL;
Expand Down Expand Up @@ -532,13 +535,13 @@ static int load_ps3_controlfan_sm_sprx()

int load_ps3_controlfan_payload()
{
if(!test_controlfan_compatibility()) return 0;
if(!syscall_base) return 0;

int ret = 0, use_sm_prx = 0;

int payload_size = MAX(ps3_controlfan_bin_size, payload_sm_bin_size);

if(!test_controlfan_compatibility()) return 0;
if(!syscall_base) return 0;

u64 *addr = (u64 *) memalign(8, payload_size + 31);

if(!addr) return 0;
Expand Down Expand Up @@ -814,6 +817,8 @@ void set_usleep_sm_main(u32 us)

void load_controlfan_config()
{
if(is_ps3hen) return;

int file_size = 0, n;
sprintf(FANCONTROL_PATH, "%s/config/fancontrol.dat", self_path);
if(file_exists(FANCONTROL_PATH) == false)
Expand Down Expand Up @@ -851,6 +856,8 @@ void load_controlfan_config()

void draw_controlfan_options()
{
if(is_ps3hen) return;

int n;

float y2, x2;
Expand Down
57 changes: 37 additions & 20 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,8 +1485,7 @@ void video_adjust()

void Select_games_folder()
{

DIR *dir, *dir2;
DIR *dir; //DIR *dir2;
int selected = 0;
char tmp[256];

Expand All @@ -1499,7 +1498,7 @@ void Select_games_folder()
mkdir_secure("/dev_hdd0/GAMES");
return;
}

/*
dir = opendir("/host_root");
if(dir)
{
Expand Down Expand Up @@ -1550,7 +1549,7 @@ void Select_games_folder()
}
closedir(dir);
}

*/
dir = opendir("/dev_hdd0/video");
if(dir)
{
Expand Down Expand Up @@ -2026,6 +2025,7 @@ static int locate_game_url(u8 *mem, int pos, int size, char *key, int *length)
if(mem[pos] == '<')
{
end = pos - start;
mem[pos] = 0;
break;
}

Expand All @@ -2045,13 +2045,18 @@ static void parse_mygames_xml()

int n = 0;
int file_size = 0;
int m = 0, l = 0;
int m = 0, l = 0, t = 0;
u8 *mem = (u8 *) LoadFile("/dev_hdd0/xmlhost/game_plugin/mygames.xml", &file_size);

while(n < file_size)
{
n = m + l + 1;
m = locate_game_url(mem, n, file_size, "<String>http://127.0.0.1/mount_ps3/", &l);

t = locate_game_url(mem, n, file_size, "<Pair key=\"title\"><String>", &l);

if(t < 0) break;

m = locate_game_url(mem, t, file_size, "<String>/mount_ps3/", &l);

if(m < 0) break;

Expand Down Expand Up @@ -2087,14 +2092,14 @@ static void parse_mygames_xml()
else
continue;

char *pos = strstr(game_path, "?"); if(pos) *pos = 0;

// add net game
strcpy(directories[ndirectories].title_id, NETHOST);
strncpy(directories[ndirectories].path_name, game_path, l);

char *pos = strstr(directories[ndirectories].path_name, "?");
if(pos) *pos = 0;
sprintf(directories[ndirectories].path_name, "%s", game_path);

sprintf(directories[ndirectories].title, "%s", get_filename(directories[ndirectories].path_name));
//sprintf(directories[ndirectories].title, "%s", get_filename(directories[ndirectories].path_name));
sprintf(directories[ndirectories].title, "%s", (char*)&mem[t]);
urldec(directories[ndirectories].title);

directories[ndirectories].title[63] = 0;
Expand Down Expand Up @@ -2606,9 +2611,9 @@ s32 main(s32 argc, const char* argv[])

if(use_cobra)
{
bAllowNetGames = get_vsh_plugin_slot_by_name("WWWD") > 0;
bAllowNetGames = is_ps3hen || (get_vsh_plugin_slot_by_name("WWWD") > 0);

if(!bAllowNetGames && !is_ps3hen)
if(!bAllowNetGames)
{
int slot = get_vsh_plugin_free_slot();

Expand Down Expand Up @@ -3203,10 +3208,8 @@ s32 main(s32 argc, const char* argv[])

if(cached_game_list) {forcedevices = 0; fdevices_old = fdevices; signal_force = false; frame_count = 300; goto skip_refresh;}


if(forcedevices || (frame_count & 63) == 0 || signal_force)
{

if(refresh_game_list && (game_list_category == GAME_LIST_NETHOST && retro_mode == NET_GAMES)) {parse_mygames_xml(); refresh_game_list = false; bSkipParseXML = true; cached_game_list = true; bCachedGameList = false;}

for(find_device = HDD0_DEVICE; find_device <= BDVD_DEVICE; find_device++)
Expand Down Expand Up @@ -10773,8 +10776,8 @@ void draw_toolsoptions(float x, float y)

y2+= 52;

DrawButton1_UTF8(box_left, y2, 520, "Control Fan & USB Wakeup", (flash && (select_option == 7)));

if(!is_ps3hen)
DrawButton1_UTF8(box_left, y2, 520, "Control Fan & USB Wakeup", (flash && (select_option == 7)));


SetCurrentFont(FONT_TTF);
Expand Down Expand Up @@ -10861,7 +10864,7 @@ void draw_toolsoptions(float x, float y)
return;

case 7: // Control Fan & USB Wakeup
draw_controlfan_options();
if(!is_ps3hen) draw_controlfan_options();

return_to_game_list(false);
return;
Expand Down Expand Up @@ -10920,12 +10923,26 @@ void draw_toolsoptions(float x, float y)
else if(new_pad & BUTTON_UP)
{
frame_count = 32;
ROT_DEC(select_option, 0, 7);
if(is_ps3hen)
{
ROT_DEC(select_option, 0, 6);
}
else
{
ROT_DEC(select_option, 0, 7);
}
}
else if(new_pad & BUTTON_DOWN)
{
frame_count = 32;
ROT_INC(select_option, 7, 0);
if(is_ps3hen)
{
ROT_INC(select_option, 6, 0);
}
else
{
ROT_INC(select_option, 7, 0);
}
}
}

Expand Down

0 comments on commit 39aeebd

Please sign in to comment.