notaz.gp2x.de
/
picodrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
32x and sms savestates. Core-independent z80 state. SS bugfixing/refactoring.
[picodrive.git]
/
pico
/
cart.c
diff --git
a/pico/cart.c
b/pico/cart.c
index
8d30a93
..
8ac330a
100644
(file)
--- a/
pico/cart.c
+++ b/
pico/cart.c
@@
-9,6
+9,7
@@
\r
#include "pico_int.h"
\r
#include "../zlib/zlib.h"
\r
\r
#include "pico_int.h"
\r
#include "../zlib/zlib.h"
\r
+#include "../cpu/debug.h"
\r
#include "../unzip/unzip.h"
\r
#include "../unzip/unzip_stream.h"
\r
\r
#include "../unzip/unzip.h"
\r
#include "../unzip/unzip_stream.h"
\r
\r
@@
-438,6
+439,9
@@
static unsigned char *PicoCartAlloc(int filesize, int is_sms)
if (filesize > (1 << s))
\r
s++;
\r
rom_alloc_size = 1 << s;
\r
if (filesize > (1 << s))
\r
s++;
\r
rom_alloc_size = 1 << s;
\r
+ // be sure we can cover all address space
\r
+ if (rom_alloc_size < 0x10000)
\r
+ rom_alloc_size = 0x10000;
\r
}
\r
else {
\r
// make alloc size at least sizeof(mcd_state),
\r
}
\r
else {
\r
// make alloc size at least sizeof(mcd_state),
\r
@@
-555,6
+559,7
@@
int PicoCartInsert(unsigned char *rom, unsigned int romsize, const char *carthw_
PicoCartUnloadHook();
\r
PicoCartUnloadHook = NULL;
\r
}
\r
PicoCartUnloadHook();
\r
PicoCartUnloadHook = NULL;
\r
}
\r
+ pdb_cleanup();
\r
\r
PicoAHW &= PAHW_MCD|PAHW_SMS;
\r
\r
\r
PicoAHW &= PAHW_MCD|PAHW_SMS;
\r
\r
@@
-590,6
+595,17
@@
int PicoCartInsert(unsigned char *rom, unsigned int romsize, const char *carthw_
return 0;
\r
}
\r
\r
return 0;
\r
}
\r
\r
+int PicoCartResize(int newsize)
\r
+{
\r
+ void *tmp = plat_mremap(Pico.rom, rom_alloc_size, newsize);
\r
+ if (tmp == NULL)
\r
+ return -1;
\r
+
\r
+ Pico.rom = tmp;
\r
+ rom_alloc_size = newsize;
\r
+ return 0;
\r
+}
\r
+
\r
void PicoCartUnload(void)
\r
{
\r
if (PicoCartUnloadHook != NULL) {
\r
void PicoCartUnload(void)
\r
{
\r
if (PicoCartUnloadHook != NULL) {
\r