mirror of https://github.com/stella-emu/stella.git
More bugfixes as indicated by Coverity.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3235 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
9e23bc3580
commit
8b7043d74a
|
@ -189,8 +189,8 @@ void FBSurfaceSDL2::reload()
|
||||||
void FBSurfaceSDL2::resize(uInt32 width, uInt32 height)
|
void FBSurfaceSDL2::resize(uInt32 width, uInt32 height)
|
||||||
{
|
{
|
||||||
// We will only resize when necessary, and not using static textures
|
// We will only resize when necessary, and not using static textures
|
||||||
if((myTexAccess == SDL_TEXTUREACCESS_STATIC) ||
|
if((myTexAccess == SDL_TEXTUREACCESS_STATIC) || (mySurface &&
|
||||||
(int(width) <= mySurface->w && int(height) <= mySurface->h))
|
int(width) <= mySurface->w && int(height) <= mySurface->h))
|
||||||
return; // don't need to resize at all
|
return; // don't need to resize at all
|
||||||
|
|
||||||
if(mySurface)
|
if(mySurface)
|
||||||
|
|
|
@ -277,57 +277,9 @@ void FrameBufferSDL2::postFrameUpdate()
|
||||||
void FrameBufferSDL2::setWindowIcon()
|
void FrameBufferSDL2::setWindowIcon()
|
||||||
{
|
{
|
||||||
#ifndef BSPF_MAC_OSX // Currently not needed for OSX
|
#ifndef BSPF_MAC_OSX // Currently not needed for OSX
|
||||||
#include "stella.xpm" // The Stella icon
|
#include "stella_icon.hxx" // The Stella icon
|
||||||
|
|
||||||
// Set the window icon
|
SDL_Surface* surface = SDL_CreateRGBSurfaceFrom(stella_icon, 32, 32, 32,
|
||||||
uInt32 w, h, ncols, nbytes;
|
|
||||||
uInt32 rgba[256], icon[32 * 32];
|
|
||||||
uInt8 mask[32][4];
|
|
||||||
|
|
||||||
sscanf(stella_icon[0], "%2u %2u %2u %2u", &w, &h, &ncols, &nbytes);
|
|
||||||
if((w != 32) || (h != 32) || (ncols > 255) || (nbytes > 1))
|
|
||||||
{
|
|
||||||
myOSystem.logMessage("ERROR: Couldn't load the application icon.", 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(uInt32 i = 0; i < ncols; i++)
|
|
||||||
{
|
|
||||||
uInt8 code;
|
|
||||||
char color[32];
|
|
||||||
uInt32 col;
|
|
||||||
|
|
||||||
sscanf(stella_icon[1 + i], "%c c %s", &code, color);
|
|
||||||
if(!strcmp(color, "None"))
|
|
||||||
col = 0x00000000;
|
|
||||||
else if(!strcmp(color, "black"))
|
|
||||||
col = 0xFF000000;
|
|
||||||
else if (color[0] == '#')
|
|
||||||
{
|
|
||||||
sscanf(color + 1, "%06x", &col);
|
|
||||||
col |= 0xFF000000;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
myOSystem.logMessage("ERROR: Couldn't load the application icon.", 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
rgba[code] = col;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(mask, 0, sizeof(mask));
|
|
||||||
for(h = 0; h < 32; h++)
|
|
||||||
{
|
|
||||||
const char* line = stella_icon[1 + ncols + h];
|
|
||||||
for(w = 0; w < 32; w++)
|
|
||||||
{
|
|
||||||
icon[w + 32 * h] = rgba[int(line[w])];
|
|
||||||
if(rgba[int(line[w])] & 0xFF000000)
|
|
||||||
mask[h][w >> 3] |= 1 << (7 - (w & 0x07));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Surface *surface = SDL_CreateRGBSurfaceFrom(icon, 32, 32, 32,
|
|
||||||
32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000);
|
32 * 4, 0xFF0000, 0x00FF00, 0x0000FF, 0xFF000000);
|
||||||
SDL_SetWindowIcon(myWindow, surface);
|
SDL_SetWindowIcon(myWindow, surface);
|
||||||
SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
|
|
|
@ -145,7 +145,8 @@ class FrameBufferSDL2 : public FrameBuffer
|
||||||
@param h The requested height of the new surface.
|
@param h The requested height of the new surface.
|
||||||
@param data If non-null, use the given data values as a static surface
|
@param data If non-null, use the given data values as a static surface
|
||||||
*/
|
*/
|
||||||
unique_ptr<FBSurface> createSurface(uInt32 w, uInt32 h, const uInt32* data) const override;
|
unique_ptr<FBSurface> createSurface(uInt32 w, uInt32 h, const uInt32* data)
|
||||||
|
const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Grabs or ungrabs the mouse based on the given boolean value.
|
Grabs or ungrabs the mouse based on the given boolean value.
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#define STELLA_VERSION "4.6.7"
|
#define STELLA_VERSION "4.7_pre"
|
||||||
#define STELLA_BUILD atoi("$Rev$" + 6)
|
#define STELLA_BUILD atoi("$Rev$" + 6)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
static uInt32 stella_icon[] = {
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000,
|
||||||
|
0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000,
|
||||||
|
0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF,
|
||||||
|
0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000,
|
||||||
|
0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000,
|
||||||
|
0xFF000000, 0xFF000000, 0xFF000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0xFF000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
|
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
|
||||||
|
};
|
|
@ -831,7 +831,7 @@ string CartDebug::loadConfigFile()
|
||||||
{
|
{
|
||||||
// Skip leading space
|
// Skip leading space
|
||||||
int c = in.peek();
|
int c = in.peek();
|
||||||
while(c == ' ' && c == '\t')
|
while(c == ' ' || c == '\t')
|
||||||
{
|
{
|
||||||
in.get();
|
in.get();
|
||||||
c = in.peek();
|
c = in.peek();
|
||||||
|
|
|
@ -203,8 +203,8 @@ int DebuggerParser::decipher_arg(const string& str)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(arg.substr(0, 1) == "\\") {
|
if(arg.substr(0, 1) == "\\") {
|
||||||
bin = true;
|
|
||||||
dec = false;
|
dec = false;
|
||||||
|
bin = true;
|
||||||
arg.erase(0, 1);
|
arg.erase(0, 1);
|
||||||
} else if(arg.substr(0, 1) == "#") {
|
} else if(arg.substr(0, 1) == "#") {
|
||||||
dec = true;
|
dec = true;
|
||||||
|
@ -216,11 +216,6 @@ int DebuggerParser::decipher_arg(const string& str)
|
||||||
arg.erase(0, 1);
|
arg.erase(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// sanity check mutually exclusive options:
|
|
||||||
if(derefByte && derefWord) return -1;
|
|
||||||
if(lobyte && hibyte) return -1;
|
|
||||||
if(bin && dec) return -1;
|
|
||||||
|
|
||||||
// Special cases (registers):
|
// Special cases (registers):
|
||||||
const CpuState& state = static_cast<const CpuState&>(debugger.cpuDebug().getState());
|
const CpuState& state = static_cast<const CpuState&>(debugger.cpuDebug().getState());
|
||||||
if(arg == "a") result = state.A;
|
if(arg == "a") result = state.A;
|
||||||
|
@ -1015,7 +1010,7 @@ void DebuggerParser::executeJump()
|
||||||
// The specific address we want may not exist (it may be part of a data section)
|
// The specific address we want may not exist (it may be part of a data section)
|
||||||
// If so, scroll backward a little until we find it
|
// If so, scroll backward a little until we find it
|
||||||
while(((line = debugger.cartDebug().addressToLine(address)) == -1) &&
|
while(((line = debugger.cartDebug().addressToLine(address)) == -1) &&
|
||||||
((address & 0xFFF) >= 0))
|
(address >= 0))
|
||||||
address--;
|
address--;
|
||||||
|
|
||||||
if(line >= 0 && address >= 0)
|
if(line >= 0 && address >= 0)
|
||||||
|
|
|
@ -636,7 +636,7 @@ void PromptWidget::killLastWord()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void PromptWidget::addToHistory(const char* str)
|
void PromptWidget::addToHistory(const char* str)
|
||||||
{
|
{
|
||||||
strcpy(_history[_historyIndex], str);
|
strncpy(_history[_historyIndex], str, kLineBufferSize-1);
|
||||||
_historyIndex = (_historyIndex + 1) % kHistorySize;
|
_historyIndex = (_historyIndex + 1) % kHistorySize;
|
||||||
_historyLine = 0;
|
_historyLine = 0;
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ cerr << "opened file: " << kvNameTable[i] << endl;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cerr << "opened file: " << "kvshared.wav" << endl;
|
cerr << "opened file: " << "kvshared.wav" << endl;
|
||||||
fseek(mySampleFile, 45, SEEK_SET);
|
// fseek(mySampleFile, 45, SEEK_SET);
|
||||||
myFileOpened = true;
|
myFileOpened = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,9 +232,9 @@ void KidVid::setNextSong()
|
||||||
mySongCounter = ourSongStart[temp+1] - ourSongStart[temp];
|
mySongCounter = ourSongStart[temp+1] - ourSongStart[temp];
|
||||||
|
|
||||||
if(mySharedData)
|
if(mySharedData)
|
||||||
fseek(mySharedSampleFile, ourSongStart[temp], SEEK_SET);
|
; // fseek(mySharedSampleFile, ourSongStart[temp], SEEK_SET);
|
||||||
else
|
else
|
||||||
fseek(mySampleFile, ourSongStart[temp], SEEK_SET);
|
; // fseek(mySampleFile, ourSongStart[temp], SEEK_SET);
|
||||||
|
|
||||||
myFilePointer++;
|
myFilePointer++;
|
||||||
myTapeBusy = true;
|
myTapeBusy = true;
|
||||||
|
@ -250,10 +250,10 @@ void KidVid::setNextSong()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void KidVid::getNextSampleByte()
|
void KidVid::getNextSampleByte()
|
||||||
{
|
{
|
||||||
#if 1
|
// static int oddeven = 0;
|
||||||
static int oddeven = 0;
|
|
||||||
if(mySongCounter == 0)
|
if(mySongCounter == 0)
|
||||||
mySampleByte = 0x80;
|
mySampleByte = 0x80;
|
||||||
|
#if 0
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
oddeven = oddeven^1;
|
oddeven = oddeven^1;
|
||||||
|
|
|
@ -90,7 +90,7 @@ class NullDevice : public Device
|
||||||
@return The byte at the specified address
|
@return The byte at the specified address
|
||||||
*/
|
*/
|
||||||
uInt8 peek(uInt16 address) override {
|
uInt8 peek(uInt16 address) override {
|
||||||
cerr << hex << "NullDevice: peek(" << address << ")\n";
|
cerr << "NullDevice: peek(" << address << ")\n";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ class NullDevice : public Device
|
||||||
@return True if the poke changed the device address space, else false
|
@return True if the poke changed the device address space, else false
|
||||||
*/
|
*/
|
||||||
bool poke(uInt16 address, uInt8 value) override {
|
bool poke(uInt16 address, uInt8 value) override {
|
||||||
cerr << hex << "NullDevice: poke(" << address << "," << value << ")\n";
|
cerr << "NullDevice: poke(" << address << "," << value << ")\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,13 +42,13 @@ void Properties::set(PropertyType key, const string& value)
|
||||||
if(key != LastPropType)
|
if(key != LastPropType)
|
||||||
{
|
{
|
||||||
myProperties[key] = value;
|
myProperties[key] = value;
|
||||||
|
if(BSPF_equalsIgnoreCase(myProperties[key], "AUTO-DETECT"))
|
||||||
|
myProperties[key] = "AUTO";
|
||||||
|
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
case Cartridge_Type:
|
case Cartridge_Type:
|
||||||
case Display_Format:
|
case Display_Format:
|
||||||
if(BSPF_equalsIgnoreCase(myProperties[key], "AUTO-DETECT"))
|
|
||||||
myProperties[key] = "AUTO";
|
|
||||||
case Cartridge_Sound:
|
case Cartridge_Sound:
|
||||||
case Console_LeftDifficulty:
|
case Console_LeftDifficulty:
|
||||||
case Console_RightDifficulty:
|
case Console_RightDifficulty:
|
||||||
|
|
|
@ -50,40 +50,17 @@ TIA::TIA(Console& console, Sound& sound, Settings& settings)
|
||||||
myFrameYStart(34),
|
myFrameYStart(34),
|
||||||
myFrameHeight(210),
|
myFrameHeight(210),
|
||||||
myMaximumNumberOfScanlines(262),
|
myMaximumNumberOfScanlines(262),
|
||||||
myStartScanline(0),
|
myStartScanline(0)
|
||||||
myColorLossEnabled(false),
|
|
||||||
myPartialFrameFlag(false),
|
|
||||||
myAutoFrameEnabled(false),
|
|
||||||
myFrameCounter(0),
|
|
||||||
myPALFrameCounter(0),
|
|
||||||
myBitsEnabled(true),
|
|
||||||
myCollisionsEnabled(true),
|
|
||||||
myJitterEnabled(false),
|
|
||||||
myNextFrameJitter(0),
|
|
||||||
myCurrentFrameJitter(0)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Allocate buffers for two frame buffers
|
// Allocate buffers for two frame buffers
|
||||||
myCurrentFrameBuffer = new uInt8[160 * 320];
|
myCurrentFrameBuffer = new uInt8[160 * 320];
|
||||||
myPreviousFrameBuffer = new uInt8[160 * 320];
|
myPreviousFrameBuffer = new uInt8[160 * 320];
|
||||||
|
|
||||||
// Make sure all TIA bits are enabled
|
|
||||||
enableBits(true);
|
|
||||||
|
|
||||||
// Turn off debug colours (this also sets up the PriorityEncoder)
|
|
||||||
toggleFixedColors(0);
|
|
||||||
|
|
||||||
// Compute all of the mask tables
|
// Compute all of the mask tables
|
||||||
TIATables::computeAllTables();
|
TIATables::computeAllTables();
|
||||||
|
|
||||||
// Zero audio registers
|
// Set initial state
|
||||||
myAUDV0 = myAUDV1 = myAUDF0 = myAUDF1 = myAUDC0 = myAUDC1 = 0;
|
initialize();
|
||||||
|
|
||||||
// Should undriven pins be randomly pulled high or low?
|
|
||||||
myTIAPinsDriven = mySettings.getBool("tiadriven");
|
|
||||||
|
|
||||||
// Enable scanline jittering
|
|
||||||
myJitterEnabled = mySettings.getBool("tv.jitter");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -94,61 +71,41 @@ TIA::~TIA()
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void TIA::reset()
|
void TIA::initialize()
|
||||||
{
|
{
|
||||||
// Reset the sound device
|
myFramePointer = nullptr;
|
||||||
mySound.reset();
|
myFramePointerOffset = myFramePointerClocks = myStopDisplayOffset = 0;
|
||||||
|
|
||||||
// Currently no objects are enabled or selectively disabled
|
myClockWhenFrameStarted = myClockStartDisplay = myClockStopDisplay =
|
||||||
myEnabledObjects = 0;
|
myClockAtLastUpdate = myClocksToEndOfScanLine = myVSYNCFinishClock = 0;
|
||||||
myDisabledObjects = 0xFF;
|
|
||||||
myAllowHMOVEBlanks = true;
|
|
||||||
|
|
||||||
// Some default values for the registers
|
myScanlineCountForLastFrame = myStartScanline = 0;
|
||||||
myVSYNC = myVBLANK = 0;
|
|
||||||
myNUSIZ0 = myNUSIZ1 = 0;
|
myVSYNC = myVBLANK = myNUSIZ0 = myNUSIZ1 = 0;
|
||||||
|
|
||||||
|
myPlayfieldPriorityAndScore = myCTRLPF = 0;
|
||||||
myColor[P0Color] = myColor[P1Color] = myColor[PFColor] = myColor[BKColor] = 0;
|
myColor[P0Color] = myColor[P1Color] = myColor[PFColor] = myColor[BKColor] = 0;
|
||||||
myColor[M0Color] = myColor[M1Color] = myColor[BLColor] = myColor[HBLANKColor] = 0;
|
myColor[M0Color] = myColor[M1Color] = myColor[BLColor] = myColor[HBLANKColor] = 0;
|
||||||
|
myColorPtr = nullptr;
|
||||||
|
|
||||||
myPlayfieldPriorityAndScore = 0;
|
|
||||||
myCTRLPF = 0;
|
|
||||||
myREFP0 = myREFP1 = false;
|
myREFP0 = myREFP1 = false;
|
||||||
myPF = 0;
|
myPF = 0;
|
||||||
myGRP0 = myGRP1 = myDGRP0 = myDGRP1 = 0;
|
myGRP0 = myGRP1 = myDGRP0 = myDGRP1 = myCurrentGRP0 = myCurrentGRP1 = 0;
|
||||||
myENAM0 = myENAM1 = myENABL = myDENABL = false;
|
myENAM0 = myENAM1 = myENABL = myDENABL = false;
|
||||||
myHMP0 = myHMP1 = myHMM0 = myHMM1 = myHMBL = 0;
|
myHMP0 = myHMP1 = myHMM0 = myHMM1 = myHMBL = 0;
|
||||||
myVDELP0 = myVDELP1 = myVDELBL = myRESMP0 = myRESMP1 = false;
|
myVDELP0 = myVDELP1 = myVDELBL = myRESMP0 = myRESMP1 = false;
|
||||||
|
|
||||||
myCollision = 0;
|
myCollision = 0;
|
||||||
myCollisionEnabledMask = 0xFFFFFFFF;
|
myCollisionEnabledMask = 0xFFFFFFFF;
|
||||||
myPOSP0 = myPOSP1 = myPOSM0 = myPOSM1 = myPOSBL = 0;
|
myPOSP0 = myPOSP1 = myPOSM0 = myPOSM1 = myPOSBL = 0;
|
||||||
|
|
||||||
// Some default values for the "current" variables
|
myMotionClockP0 = myMotionClockP1 = myMotionClockM0 =
|
||||||
myCurrentGRP0 = 0;
|
myMotionClockM1 = myMotionClockBL = 0;
|
||||||
myCurrentGRP1 = 0;
|
|
||||||
|
|
||||||
myMotionClockP0 = 0;
|
|
||||||
myMotionClockP1 = 0;
|
|
||||||
myMotionClockM0 = 0;
|
|
||||||
myMotionClockM1 = 0;
|
|
||||||
myMotionClockBL = 0;
|
|
||||||
|
|
||||||
|
myStartP0 = myStartP1 = myStartM0 = myStartM1 = 0;
|
||||||
mySuppressP0 = mySuppressP1 = 0;
|
mySuppressP0 = mySuppressP1 = 0;
|
||||||
|
|
||||||
myHMP0mmr = myHMP1mmr = myHMM0mmr = myHMM1mmr = myHMBLmmr = false;
|
myHMP0mmr = myHMP1mmr = myHMM0mmr = myHMM1mmr = myHMBLmmr = false;
|
||||||
|
|
||||||
myCurrentHMOVEPos = myPreviousHMOVEPos = 0x7FFFFFFF;
|
|
||||||
myHMOVEBlankEnabled = false;
|
|
||||||
|
|
||||||
enableBits(true);
|
|
||||||
|
|
||||||
myDumpEnabled = false;
|
|
||||||
myDumpDisabledCycle = 0;
|
|
||||||
myINPT4 = myINPT5 = 0x80;
|
|
||||||
|
|
||||||
myFrameCounter = myPALFrameCounter = 0;
|
|
||||||
myScanlineCountForLastFrame = 0;
|
|
||||||
myNextFrameJitter = myCurrentFrameJitter = 0;
|
|
||||||
|
|
||||||
myP0Mask = &TIATables::PxMask[0][0][0];
|
myP0Mask = &TIATables::PxMask[0][0][0];
|
||||||
myP1Mask = &TIATables::PxMask[0][0][0];
|
myP1Mask = &TIATables::PxMask[0][0][0];
|
||||||
myM0Mask = &TIATables::MxMask[0][0][0];
|
myM0Mask = &TIATables::MxMask[0][0][0];
|
||||||
|
@ -156,9 +113,43 @@ void TIA::reset()
|
||||||
myBLMask = &TIATables::BLMask[0][0];
|
myBLMask = &TIATables::BLMask[0][0];
|
||||||
myPFMask = TIATables::PFMask[0];
|
myPFMask = TIATables::PFMask[0];
|
||||||
|
|
||||||
// Recalculate the size of the display
|
myAUDV0 = myAUDV1 = myAUDF0 = myAUDF1 = myAUDC0 = myAUDC1 = 0;
|
||||||
|
|
||||||
|
myDumpEnabled = false;
|
||||||
|
myDumpDisabledCycle = 0;
|
||||||
|
myINPT4 = myINPT5 = 0x80;
|
||||||
|
|
||||||
|
myCurrentHMOVEPos = myPreviousHMOVEPos = 0x7FFFFFFF;
|
||||||
|
myHMOVEBlankEnabled = false;
|
||||||
|
myAllowHMOVEBlanks = true;
|
||||||
|
|
||||||
|
myTIAPinsDriven = mySettings.getBool("tiadriven");
|
||||||
|
|
||||||
|
myEnabledObjects = 0;
|
||||||
|
myDisabledObjects = 0xFF;
|
||||||
|
|
||||||
|
myColorLossEnabled = myPartialFrameFlag = myAutoFrameEnabled = false;
|
||||||
|
|
||||||
|
myFrameCounter = myPALFrameCounter = 0;
|
||||||
|
myFramerate = 60.0;
|
||||||
|
|
||||||
|
myBitsEnabled = myCollisionsEnabled = true;
|
||||||
|
myJitterEnabled = mySettings.getBool("tv.jitter");
|
||||||
|
myNextFrameJitter = myCurrentFrameJitter = 0;
|
||||||
|
|
||||||
|
// Make sure all TIA bits are enabled
|
||||||
|
enableBits(true);
|
||||||
|
|
||||||
|
// Turn off debug colours (this also sets up the PriorityEncoder)
|
||||||
toggleFixedColors(0);
|
toggleFixedColors(0);
|
||||||
frameReset();
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void TIA::reset()
|
||||||
|
{
|
||||||
|
initialize(); // Set initial state
|
||||||
|
mySound.reset(); // Reset the sound device
|
||||||
|
frameReset(); // Recalculate the size of the display
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -362,6 +362,9 @@ class TIA : public Device
|
||||||
*/
|
*/
|
||||||
void enableCollisions(bool mode);
|
void enableCollisions(bool mode);
|
||||||
|
|
||||||
|
// Reset all instance variables to the initial state
|
||||||
|
void initialize();
|
||||||
|
|
||||||
// Update the current frame buffer to the specified color clock
|
// Update the current frame buffer to the specified color clock
|
||||||
void updateFrame(Int32 clock);
|
void updateFrame(Int32 clock);
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,14 @@ using namespace Common;
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, bool traponfatal)
|
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, bool traponfatal)
|
||||||
: rom(rom_ptr),
|
: rom(rom_ptr),
|
||||||
ram(ram_ptr)
|
ram(ram_ptr),
|
||||||
|
halfadd(0),
|
||||||
|
cpsr(0),
|
||||||
|
mamcr(0),
|
||||||
|
instructions(0),
|
||||||
|
fetches(0),
|
||||||
|
reads(0),
|
||||||
|
writes(0)
|
||||||
{
|
{
|
||||||
trapFatalErrors(traponfatal);
|
trapFatalErrors(traponfatal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -617,7 +617,7 @@ void VideoDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
|
|
||||||
case kTVModeChanged:
|
case kTVModeChanged:
|
||||||
handleTVModeChange(NTSCFilter::Preset(myTVMode->getSelectedTag().toInt()));
|
handleTVModeChange(NTSCFilter::Preset(myTVMode->getSelectedTag().toInt()));
|
||||||
|
break;
|
||||||
case kTVSharpChanged: myTVSharpLabel->setValue(myTVSharp->getValue());
|
case kTVSharpChanged: myTVSharpLabel->setValue(myTVSharp->getValue());
|
||||||
break;
|
break;
|
||||||
case kTVHueChanged: myTVHueLabel->setValue(myTVHue->getValue());
|
case kTVHueChanged: myTVHueLabel->setValue(myTVHue->getValue());
|
||||||
|
|
Loading…
Reference in New Issue