mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
SekRunPS Cyclone integration
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@68 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
8b71d0ebf9
commit
7336a99a49
12 changed files with 278 additions and 47 deletions
12
Pico/Cart.c
12
Pico/Cart.c
|
@ -12,6 +12,7 @@
|
|||
#include "../unzip/unzip.h"
|
||||
#include "../unzip/unzip_stream.h"
|
||||
|
||||
|
||||
static char *rom_exts[] = { "bin", "gen", "smd", "iso" };
|
||||
|
||||
|
||||
|
@ -78,6 +79,9 @@ zip_failed:
|
|||
f = fopen(path, "rb");
|
||||
if (f == NULL) return NULL;
|
||||
|
||||
/* we use our own buffering */
|
||||
setvbuf(f, NULL, _IONBF, 0);
|
||||
|
||||
file = malloc(sizeof(*file));
|
||||
if (file == NULL) {
|
||||
fclose(f);
|
||||
|
@ -120,7 +124,8 @@ int pm_seek(pm_file *stream, long offset, int whence)
|
|||
{
|
||||
if (stream->type == PMT_UNCOMPRESSED)
|
||||
{
|
||||
return fseek(stream->file, offset, whence);
|
||||
fseek(stream->file, offset, whence);
|
||||
return ftell(stream->file);
|
||||
}
|
||||
else if (stream->type == PMT_ZIP)
|
||||
{
|
||||
|
@ -243,7 +248,10 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize)
|
|||
|
||||
// Allocate space for the rom plus padding
|
||||
rom=PicoCartAlloc(size);
|
||||
if (rom==NULL) return 1; // { fclose(f); return 1; }
|
||||
if (rom==NULL) {
|
||||
printf("out of memory (wanted %i)\n", size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pm_read(rom,size,f); // Load up the rom
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue