mirror of https://github.com/snes9xgit/snes9x.git
Merge 8121a5b695
into 378298eef6
This commit is contained in:
commit
1f6924e45b
|
@ -179,6 +179,9 @@
|
|||
#ifndef _DISPLAY_H_
|
||||
#define _DISPLAY_H_
|
||||
|
||||
#include "port.h"
|
||||
#include "snes9x.h"
|
||||
|
||||
enum s9x_getdirtype
|
||||
{
|
||||
DEFAULT_DIR = 0,
|
||||
|
|
46
gfx.cpp
46
gfx.cpp
|
@ -886,8 +886,14 @@ static void SetupOBJ (void)
|
|||
else // evil FirstSprite+Y case
|
||||
{
|
||||
// First, find out which sprites are on which lines
|
||||
uint8 OBJOnLine[SNES_HEIGHT_EXTENDED][128];
|
||||
memset(OBJOnLine, 0, sizeof(OBJOnLine));
|
||||
uint8 OBJOnLine[SNES_HEIGHT_EXTENDED][128];
|
||||
// memset(OBJOnLine, 0, sizeof(OBJOnLine));
|
||||
/* Hold on here, that's a lot of bytes to initialise at once!
|
||||
* So we only initialise them per line, as needed. [Neb]
|
||||
* Bonus: We can quickly avoid looping if a line has no OBJs.
|
||||
*/
|
||||
bool8 AnyOBJOnLine[SNES_HEIGHT_EXTENDED];
|
||||
memset(AnyOBJOnLine, FALSE, sizeof(AnyOBJOnLine)); // better
|
||||
|
||||
for (S = 0; S < 128; S++)
|
||||
{
|
||||
|
@ -921,6 +927,11 @@ static void SetupOBJ (void)
|
|||
if (Y >= SNES_HEIGHT_EXTENDED)
|
||||
continue;
|
||||
|
||||
if (!AnyOBJOnLine[Y]) {
|
||||
memset(OBJOnLine[Y], 0, sizeof(OBJOnLine[Y]));
|
||||
AnyOBJOnLine[Y] = TRUE;
|
||||
}
|
||||
|
||||
if (PPU.OBJ[S].VFlip)
|
||||
// Yes, Width not Height. It so happens that the
|
||||
// sprites with H=2*W flip as two WxW sprites.
|
||||
|
@ -942,25 +953,28 @@ static void SetupOBJ (void)
|
|||
S = FirstSprite;
|
||||
j = 0;
|
||||
|
||||
do
|
||||
if (AnyOBJOnLine[Y])
|
||||
{
|
||||
if (OBJOnLine[Y][S])
|
||||
do
|
||||
{
|
||||
if (j >= 32)
|
||||
if (OBJOnLine[Y][S])
|
||||
{
|
||||
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
||||
break;
|
||||
if (j >= 32)
|
||||
{
|
||||
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
||||
break;
|
||||
}
|
||||
|
||||
GFX.OBJLines[Y].Tiles -= GFX.OBJVisibleTiles[S];
|
||||
if (GFX.OBJLines[Y].Tiles < 0)
|
||||
GFX.OBJLines[Y].RTOFlags |= 0x80;
|
||||
GFX.OBJLines[Y].OBJ[j].Sprite = S;
|
||||
GFX.OBJLines[Y].OBJ[j++].Line = OBJOnLine[Y][S] & ~0x80;
|
||||
}
|
||||
|
||||
GFX.OBJLines[Y].Tiles -= GFX.OBJVisibleTiles[S];
|
||||
if (GFX.OBJLines[Y].Tiles < 0)
|
||||
GFX.OBJLines[Y].RTOFlags |= 0x80;
|
||||
GFX.OBJLines[Y].OBJ[j].Sprite = S;
|
||||
GFX.OBJLines[Y].OBJ[j++].Line = OBJOnLine[Y][S] & ~0x80;
|
||||
}
|
||||
|
||||
S = (S + 1) & 0x7f;
|
||||
} while (S != FirstSprite);
|
||||
S = (S + 1) & 0x7f;
|
||||
} while (S != FirstSprite);
|
||||
}
|
||||
|
||||
if (j < 32)
|
||||
GFX.OBJLines[Y].OBJ[j].Sprite = -1;
|
||||
|
|
|
@ -179,6 +179,9 @@
|
|||
#ifndef _SNAPSHOT_H_
|
||||
#define _SNAPSHOT_H_
|
||||
|
||||
#include "port.h"
|
||||
#include "snes9x.h"
|
||||
|
||||
#define SNAPSHOT_MAGIC "#!s9xsnp"
|
||||
#define SNAPSHOT_VERSION_IRQ 7
|
||||
#define SNAPSHOT_VERSION_BAPU 8
|
||||
|
|
|
@ -215,11 +215,13 @@ int do_list(uf)
|
|||
else if ((iLevel==2) || (iLevel==3))
|
||||
string_method="Defl:F"; /* 2:fast , 3 : extra fast*/
|
||||
}
|
||||
#ifdef HAVE_BZIP2
|
||||
else
|
||||
if (file_info.compression_method==Z_BZIP2ED)
|
||||
{
|
||||
string_method="BZip2 ";
|
||||
}
|
||||
#endif
|
||||
else
|
||||
string_method="Unkn. ";
|
||||
|
||||
|
|
|
@ -1013,9 +1013,9 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
|
|||
err=UNZ_BADZIPFILE;
|
||||
|
||||
if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&
|
||||
/* #ifdef HAVE_BZIP2 */
|
||||
#ifdef HAVE_BZIP2
|
||||
(s->cur_file_info.compression_method!=Z_BZIP2ED) &&
|
||||
/* #endif */
|
||||
#endif
|
||||
(s->cur_file_info.compression_method!=Z_DEFLATED))
|
||||
err=UNZ_BADZIPFILE;
|
||||
|
||||
|
@ -1130,9 +1130,9 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
|
|||
}
|
||||
|
||||
if ((s->cur_file_info.compression_method!=0) &&
|
||||
/* #ifdef HAVE_BZIP2 */
|
||||
#ifdef HAVE_BZIP2
|
||||
(s->cur_file_info.compression_method!=Z_BZIP2ED) &&
|
||||
/* #endif */
|
||||
#endif
|
||||
(s->cur_file_info.compression_method!=Z_DEFLATED))
|
||||
err=UNZ_BADZIPFILE;
|
||||
|
||||
|
@ -1146,10 +1146,10 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
|
|||
|
||||
pfile_in_zip_read_info->stream.total_out = 0;
|
||||
|
||||
#ifdef HAVE_BZIP2
|
||||
if ((s->cur_file_info.compression_method==Z_BZIP2ED) &&
|
||||
(!raw))
|
||||
{
|
||||
#ifdef HAVE_BZIP2
|
||||
pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0;
|
||||
pfile_in_zip_read_info->bstream.bzfree = (free_func)0;
|
||||
pfile_in_zip_read_info->bstream.opaque = (voidpf)0;
|
||||
|
@ -1169,11 +1169,9 @@ extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password)
|
|||
TRYFREE(pfile_in_zip_read_info);
|
||||
return err;
|
||||
}
|
||||
#else
|
||||
pfile_in_zip_read_info->raw=1;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if ((s->cur_file_info.compression_method==Z_DEFLATED) &&
|
||||
(!raw))
|
||||
{
|
||||
|
@ -1385,10 +1383,10 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len)
|
|||
pfile_in_zip_read_info->stream.total_out += uDoCopy;
|
||||
iRead += uDoCopy;
|
||||
}
|
||||
#ifdef HAVE_BZIP2
|
||||
else
|
||||
if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED)
|
||||
{
|
||||
#ifdef HAVE_BZIP2
|
||||
uLong uTotalOutBefore,uTotalOutAfter;
|
||||
const Bytef *bufBefore;
|
||||
uLong uOutThis;
|
||||
|
@ -1430,8 +1428,8 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len)
|
|||
return (iRead==0) ? UNZ_EOF : iRead;
|
||||
if (err!=BZ_OK)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
uLong uTotalOutBefore,uTotalOutAfter;
|
||||
|
|
Loading…
Reference in New Issue