mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 23:37:46 -04:00
some fixes
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@398 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
a5f80ce405
commit
d6114368e1
7 changed files with 25 additions and 18 deletions
13
Pico/Cart.c
13
Pico/Cart.c
|
@ -20,6 +20,8 @@ void (*PicoCartUnloadHook)(void) = NULL;
|
||||||
void (*PicoCartLoadProgressCB)(int percent) = NULL;
|
void (*PicoCartLoadProgressCB)(int percent) = NULL;
|
||||||
void (*PicoCDLoadProgressCB)(int percent) = NULL; // handled in Pico/cd/cd_file.c
|
void (*PicoCDLoadProgressCB)(int percent) = NULL; // handled in Pico/cd/cd_file.c
|
||||||
|
|
||||||
|
static void PicoCartDetect(void);
|
||||||
|
|
||||||
/* cso struct */
|
/* cso struct */
|
||||||
typedef struct _cso_struct
|
typedef struct _cso_struct
|
||||||
{
|
{
|
||||||
|
@ -201,6 +203,7 @@ cso_failed:
|
||||||
file->size = ftell(f);
|
file->size = ftell(f);
|
||||||
file->type = PMT_UNCOMPRESSED;
|
file->type = PMT_UNCOMPRESSED;
|
||||||
fseek(f, 0, SEEK_SET);
|
fseek(f, 0, SEEK_SET);
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -495,6 +498,11 @@ int PicoCartInsert(unsigned char *rom,unsigned int romsize)
|
||||||
Pico.rom=rom;
|
Pico.rom=rom;
|
||||||
Pico.romsize=romsize;
|
Pico.romsize=romsize;
|
||||||
|
|
||||||
|
if (SRam.data) {
|
||||||
|
free(SRam.data);
|
||||||
|
SRam.data = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (PicoCartUnloadHook != NULL) {
|
if (PicoCartUnloadHook != NULL) {
|
||||||
PicoCartUnloadHook();
|
PicoCartUnloadHook();
|
||||||
PicoCartUnloadHook = NULL;
|
PicoCartUnloadHook = NULL;
|
||||||
|
@ -550,10 +558,9 @@ static int name_cmp(const char *name)
|
||||||
* various cart-specific things, which can't be handled by generic code
|
* various cart-specific things, which can't be handled by generic code
|
||||||
* (maybe I should start using CRC for this stuff?)
|
* (maybe I should start using CRC for this stuff?)
|
||||||
*/
|
*/
|
||||||
void PicoCartDetect(void)
|
static void PicoCartDetect(void)
|
||||||
{
|
{
|
||||||
int sram_size = 0, csum;
|
int sram_size = 0, csum;
|
||||||
if(SRam.data) free(SRam.data); SRam.data=0;
|
|
||||||
Pico.m.sram_reg = 0;
|
Pico.m.sram_reg = 0;
|
||||||
|
|
||||||
csum = PicoRead32(0x18c) & 0xffff;
|
csum = PicoRead32(0x18c) & 0xffff;
|
||||||
|
@ -590,7 +597,7 @@ void PicoCartDetect(void)
|
||||||
if (sram_size)
|
if (sram_size)
|
||||||
{
|
{
|
||||||
SRam.data = (unsigned char *) calloc(sram_size, 1);
|
SRam.data = (unsigned char *) calloc(sram_size, 1);
|
||||||
if(!SRam.data) return;
|
if (SRam.data == NULL) return;
|
||||||
}
|
}
|
||||||
SRam.changed = 0;
|
SRam.changed = 0;
|
||||||
|
|
||||||
|
|
|
@ -377,7 +377,6 @@ extern carthw_state_chunk *carthw_chunks;
|
||||||
#define CHUNK_CARTHW 64
|
#define CHUNK_CARTHW 64
|
||||||
|
|
||||||
// Cart.c
|
// Cart.c
|
||||||
PICO_INTERNAL void PicoCartDetect(void);
|
|
||||||
extern void (*PicoCartUnloadHook)(void);
|
extern void (*PicoCartUnloadHook)(void);
|
||||||
|
|
||||||
// Debug.c
|
// Debug.c
|
||||||
|
|
|
@ -75,10 +75,14 @@ PICO_INTERNAL int PicoResetMCD(int hard)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// use SRam.data for RAM cart
|
// use SRam.data for RAM cart
|
||||||
if (SRam.data) free(SRam.data);
|
if (PicoOpt&0x8000) {
|
||||||
SRam.data = NULL;
|
if (SRam.data == NULL)
|
||||||
if (PicoOpt&0x8000)
|
|
||||||
SRam.data = calloc(1, 0x12000);
|
SRam.data = calloc(1, 0x12000);
|
||||||
|
}
|
||||||
|
else if (SRam.data != NULL) {
|
||||||
|
free(SRam.data);
|
||||||
|
SRam.data = NULL;
|
||||||
|
}
|
||||||
SRam.start = SRam.end = 0; // unused
|
SRam.start = SRam.end = 0; // unused
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -642,9 +642,10 @@ Changelog
|
||||||
* Changed config file format, files are now human-readable. Game specific
|
* Changed config file format, files are now human-readable. Game specific
|
||||||
configs are now held in single file (but old game config files are still
|
configs are now held in single file (but old game config files are still
|
||||||
read).
|
read).
|
||||||
* Fixed a bug where some key combos didn't work.
|
* Fixed a bug where some key combos didn't work as expected.
|
||||||
* Fixed a regression in renderer (rare graphic glitches).
|
* Fixed a regression in renderer (some graphic glitches in rare cases).
|
||||||
* Adjusted fast rernderer to work with more games, including VR.
|
* Adjusted fast rernderer to work with more games, including VR.
|
||||||
|
* Fixed a problem where SegaCD RAM cart data was getting lost on reset.
|
||||||
|
|
||||||
1.35b
|
1.35b
|
||||||
* PSP: mp3 code should no longer fail on 1.5 firmware.
|
* PSP: mp3 code should no longer fail on 1.5 firmware.
|
||||||
|
|
|
@ -353,7 +353,7 @@ int config_writelrom(const char *fname)
|
||||||
int size;
|
int size;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if (strlen(lastRomFile) == 0) return 0;
|
if (strlen(lastRomFile) == 0) return -1;
|
||||||
|
|
||||||
f = fopen(fname, "r");
|
f = fopen(fname, "r");
|
||||||
if (f != NULL)
|
if (f != NULL)
|
||||||
|
@ -694,7 +694,7 @@ int config_readsect(const char *fname, const char *section)
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
f = fopen(fname, "r");
|
f = fopen(fname, "r");
|
||||||
if (f == NULL) return 0;
|
if (f == NULL) return -1;
|
||||||
|
|
||||||
if (section != NULL)
|
if (section != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sched.h>
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
@ -653,9 +652,6 @@ static void simpleWait(int thissec, int lim_time)
|
||||||
gettimeofday(&tval, 0);
|
gettimeofday(&tval, 0);
|
||||||
if (thissec != tval.tv_sec) tval.tv_usec+=1000000;
|
if (thissec != tval.tv_sec) tval.tv_usec+=1000000;
|
||||||
|
|
||||||
if (tval.tv_usec < lim_time)
|
|
||||||
sched_yield();
|
|
||||||
|
|
||||||
while (tval.tv_usec < lim_time)
|
while (tval.tv_usec < lim_time)
|
||||||
{
|
{
|
||||||
spend_cycles(1024);
|
spend_cycles(1024);
|
||||||
|
|
|
@ -66,7 +66,7 @@ void parse_cmd_line(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unrecognized) {
|
if (unrecognized) {
|
||||||
printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2007\n");
|
printf("\n\n\nPicoDrive v" VERSION " (c) notaz, 2006-2008\n");
|
||||||
printf("usage: %s [options] [romfile]\n", argv[0]);
|
printf("usage: %s [options] [romfile]\n", argv[0]);
|
||||||
printf( "options:\n"
|
printf( "options:\n"
|
||||||
"-menu <menu_path> launch a custom program on exit instead of default gp2xmenu\n"
|
"-menu <menu_path> launch a custom program on exit instead of default gp2xmenu\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue