X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pico%2Fcart.c;h=b35eb533233871e60ac451c0def626a4d6f72ba3;hb=3d5e32fe21b56d59a116195a66f300735af5a7ec;hp=3bab61586e9a01aee5508b1f1a21aa8c880f1184;hpb=32cc15e8116db5fa6eb191212f76352707fb25a0;p=picodrive.git diff --git a/pico/cart.c b/pico/cart.c index 3bab6158..b35eb533 100644 --- a/pico/cart.c +++ b/pico/cart.c @@ -50,7 +50,7 @@ typedef struct _cso_struct } cso_struct; -static int uncompress2(void *dest, int destLen, void *source, int sourceLen) +static int uncompress_buf(void *dest, int destLen, void *source, int sourceLen) { z_stream stream; int err; @@ -298,7 +298,7 @@ size_t pm_read(void *ptr, size_t bytes, pm_file *stream) } cso->block_in_buff = block; } - rret = uncompress2(tmp_dst, 2048, cso->in_buff, read_len); + rret = uncompress_buf(tmp_dst, 2048, cso->in_buff, read_len); if (rret != 0) { elprintf(EL_STATUS, "cso: uncompress failed @ %08x with %i", read_pos, rret); break; @@ -332,9 +332,7 @@ int pm_seek(pm_file *stream, long offset, int whence) if (stream->type == PMT_UNCOMPRESSED) { fseek(stream->file, offset, whence); - int ret = ftell(stream->file); - elprintf(EL_STATUS, "seeked ok."); //HACK for VITA - return ret; + return ftell(stream->file); } #ifndef NO_ZLIB else if (stream->type == PMT_ZIP) @@ -515,7 +513,7 @@ int PicoCartLoad(pm_file *f,unsigned char **prom,unsigned int *psize,int is_sms) bytes_read = pm_read(rom,size,f); // Load up the rom if (bytes_read <= 0) { elprintf(EL_STATUS, "read failed"); - free(rom); + plat_munmap(rom, rom_alloc_size); return 3; }