mirror of
https://github.com/parasyte/alt64
synced 2024-11-15 21:55:03 -05:00
slight cleanup
This commit is contained in:
parent
fc740cf581
commit
12a827958e
144
src/main.c
144
src/main.c
@ -1148,76 +1148,6 @@ void loadgbrom(display_context_t disp, TCHAR *rom_path)
|
||||
}
|
||||
}
|
||||
}
|
||||
void loadmsx2rom(display_context_t disp, TCHAR *rom_path)
|
||||
{
|
||||
|
||||
FRESULT romresult;
|
||||
FIL romfile;
|
||||
UINT rombytesread;
|
||||
romresult = f_open(&romfile, rom_path, FA_READ);
|
||||
|
||||
if (romresult == FR_OK)
|
||||
{
|
||||
int romfsize = f_size(&romfile);
|
||||
|
||||
//max 128KB rom
|
||||
if (romfsize > 128 * 1024)
|
||||
{
|
||||
//error
|
||||
|
||||
drawShortInfoBox(disp, " error: rom > 128KB", 1);
|
||||
input_mapping = abort_screen;
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawShortInfoBox(disp, " loading please wait", 0);
|
||||
|
||||
FRESULT result;
|
||||
FIL file;
|
||||
UINT bytesread;
|
||||
result = f_open(&file, "/"ED64_FIRMWARE_PATH"/ultraMSX2.z64", FA_READ);
|
||||
|
||||
if (result == FR_OK)
|
||||
{
|
||||
int fsize = f_size(&file);
|
||||
|
||||
|
||||
result =
|
||||
f_read (
|
||||
&file, /* [IN] File object */
|
||||
(void *)0xb0000000, /* [OUT] Buffer to store read data */
|
||||
fsize, /* [IN] Number of bytes to read */
|
||||
&bytesread /* [OUT] Number of bytes read */
|
||||
);
|
||||
|
||||
f_close(&file);
|
||||
|
||||
|
||||
romresult =
|
||||
f_read (
|
||||
&romfile, /* [IN] File object */
|
||||
(void *)0xb0000000 + 0x2df48, /* [OUT] Buffer to store read data */ //TODO: why is the offset this particular number
|
||||
romfsize, /* [IN] Number of bytes to read */
|
||||
&rombytesread /* [OUT] Number of bytes read */
|
||||
);
|
||||
|
||||
f_close(&romfile);
|
||||
|
||||
|
||||
boot_cic = CIC_6102;
|
||||
boot_save = 0; //save off/cpak
|
||||
force_tv = 0; //no force
|
||||
cheats_on = 0; //cheats off
|
||||
checksum_fix_on = 0;
|
||||
|
||||
checksum_sdram();
|
||||
bootRom(disp, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loadggrom(display_context_t disp, TCHAR *rom_path) //TODO: this could be merged with MSX
|
||||
{
|
||||
@ -1277,6 +1207,76 @@ void loadggrom(display_context_t disp, TCHAR *rom_path) //TODO: this could be me
|
||||
f_close(&romfile);
|
||||
|
||||
|
||||
boot_cic = CIC_6102;
|
||||
boot_save = 0; //save off/cpak
|
||||
force_tv = 0; //no force
|
||||
cheats_on = 0; //cheats off
|
||||
checksum_fix_on = 0;
|
||||
|
||||
checksum_sdram();
|
||||
bootRom(disp, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void loadmsx2rom(display_context_t disp, TCHAR *rom_path)
|
||||
{
|
||||
|
||||
FRESULT romresult;
|
||||
FIL romfile;
|
||||
UINT rombytesread;
|
||||
romresult = f_open(&romfile, rom_path, FA_READ);
|
||||
|
||||
if (romresult == FR_OK)
|
||||
{
|
||||
int romfsize = f_size(&romfile);
|
||||
|
||||
//max 128KB rom
|
||||
if (romfsize > 128 * 1024)
|
||||
{
|
||||
//error
|
||||
|
||||
drawShortInfoBox(disp, " error: rom > 512KB", 1);
|
||||
input_mapping = abort_screen;
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
drawShortInfoBox(disp, " loading please wait", 0);
|
||||
|
||||
FRESULT result;
|
||||
FIL file;
|
||||
UINT bytesread;
|
||||
result = f_open(&file, "/"ED64_FIRMWARE_PATH"/ultraMSX2.z64", FA_READ);
|
||||
|
||||
if (result == FR_OK)
|
||||
{
|
||||
int fsize = f_size(&file);
|
||||
|
||||
|
||||
result =
|
||||
f_read (
|
||||
&file, /* [IN] File object */
|
||||
(void *)0xb0000000, /* [OUT] Buffer to store read data */
|
||||
fsize, /* [IN] Number of bytes to read */
|
||||
&bytesread /* [OUT] Number of bytes read */
|
||||
);
|
||||
|
||||
f_close(&file);
|
||||
|
||||
|
||||
romresult =
|
||||
f_read (
|
||||
&romfile, /* [IN] File object */
|
||||
(void *)0xb0000000 + 0x2df48, /* [OUT] Buffer to store read data */ //TODO: why is the offset this particular number
|
||||
romfsize, /* [IN] Number of bytes to read */
|
||||
&rombytesread /* [OUT] Number of bytes read */
|
||||
);
|
||||
|
||||
f_close(&romfile);
|
||||
|
||||
|
||||
boot_cic = CIC_6102;
|
||||
boot_save = 0; //save off/cpak
|
||||
force_tv = 0; //no force
|
||||
@ -4079,6 +4079,8 @@ void handleInput(display_context_t disp, sprite_t *contr)
|
||||
}
|
||||
else if (!strcmp(extension, "MPK"))
|
||||
{ //mpk file
|
||||
while (!(disp = display_lock()))
|
||||
;
|
||||
clearScreen(disp);
|
||||
drawBoxNumber(disp, 4);
|
||||
display_show(disp);
|
||||
@ -4131,8 +4133,8 @@ void handleInput(display_context_t disp, sprite_t *contr)
|
||||
new_scroll_pos(&cursor, &page, MAX_LIST, count);
|
||||
clearScreen(disp); //part clear?
|
||||
display_dir(list, cursor, page, MAX_LIST, count, disp);
|
||||
view_mpk(disp);
|
||||
drawBoxNumber(disp, 4);
|
||||
view_mpk(disp);
|
||||
display_show(disp);
|
||||
if (sound_on)
|
||||
playSound(2);
|
||||
|
@ -187,8 +187,8 @@ void view_mpk_file(display_context_t disp, char *mpk_filename)
|
||||
32768, /* [IN] Number of bytes to read */
|
||||
&bytesread /* [OUT] Number of bytes read */
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
f_close(&file);
|
||||
|
||||
printText("File contents:", 11, 5, disp);
|
||||
@ -305,7 +305,7 @@ void view_mpk_file(display_context_t disp, char *mpk_filename)
|
||||
else
|
||||
{
|
||||
printText("empty", 11, -1, disp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
|
||||
if (result == FR_OK)
|
||||
{
|
||||
controller_init();
|
||||
|
||||
|
||||
int err = 0;
|
||||
for (int j = 0; j < 128; j++)
|
||||
{
|
||||
@ -438,9 +438,9 @@ void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
|
||||
|
||||
f_close(&file);
|
||||
|
||||
|
||||
|
||||
sprintf(buff, "File: %s%i.MPK", mpk_filename, v);
|
||||
|
||||
|
||||
printText(buff, 9, -1, disp);
|
||||
printText("backup done...", 9, -1, disp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user