mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-06-12 04:29:29 +00:00
clean up disabled / non-working modes out of video_macosx.mm/.h
This commit is contained in:
parent
a78c76f762
commit
182a7aeadb
|
@ -22,16 +22,6 @@
|
||||||
|
|
||||||
#import <video.h>
|
#import <video.h>
|
||||||
|
|
||||||
/* Set the strategy for drawing the bitmap in the Mac OS X window */
|
|
||||||
//#define CGDRAWBITMAP
|
|
||||||
#if defined __i386__
|
|
||||||
#define CGIMAGEREF
|
|
||||||
//#define NSBITMAP
|
|
||||||
#else
|
|
||||||
#define CGIMAGEREF
|
|
||||||
//#define NSBITMAP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Using Core Graphics is fastest when rendering 32bit data.
|
// Using Core Graphics is fastest when rendering 32bit data.
|
||||||
// Using CGImageRefs allows us to use all the bitmaps that BasiliskII supports.
|
// Using CGImageRefs allows us to use all the bitmaps that BasiliskII supports.
|
||||||
// When both Basilisk II and OS X are set to 'Thousands', updating a 312x342
|
// When both Basilisk II and OS X are set to 'Thousands', updating a 312x342
|
||||||
|
|
|
@ -371,16 +371,11 @@ class OSX_monitor : public monitor_desc
|
||||||
bool init_window(const video_mode &mode);
|
bool init_window(const video_mode &mode);
|
||||||
|
|
||||||
|
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
CGColorSpaceRef colourSpace;
|
CGColorSpaceRef colourSpace;
|
||||||
uint8 *colourTable;
|
uint8 *colourTable;
|
||||||
CGImageRef imageRef;
|
CGImageRef imageRef;
|
||||||
CGDataProviderRef provider;
|
CGDataProviderRef provider;
|
||||||
short x, y, bpp, depth, bpr;
|
short x, y, bpp, depth, bpr;
|
||||||
#endif
|
|
||||||
#ifdef NSBITMAP
|
|
||||||
NSBitmapImageRep *bitmap;
|
|
||||||
#endif
|
|
||||||
void *the_buffer;
|
void *the_buffer;
|
||||||
|
|
||||||
|
|
||||||
|
@ -397,24 +392,17 @@ OSX_monitor :: OSX_monitor (const vector<video_mode> &available_modes,
|
||||||
uint32 default_id)
|
uint32 default_id)
|
||||||
: monitor_desc (available_modes, default_depth, default_id)
|
: monitor_desc (available_modes, default_depth, default_id)
|
||||||
{
|
{
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
colourSpace = nil;
|
colourSpace = nil;
|
||||||
colourTable = (uint8 *) malloc(256 * 3);
|
colourTable = (uint8 *) malloc(256 * 3);
|
||||||
imageRef = nil;
|
imageRef = nil;
|
||||||
provider = nil;
|
provider = nil;
|
||||||
#endif
|
|
||||||
#ifdef NSBITMAP
|
|
||||||
bitmap = nil;
|
|
||||||
#endif
|
|
||||||
newMode = originalMode = nil;
|
newMode = originalMode = nil;
|
||||||
the_buffer = NULL;
|
the_buffer = NULL;
|
||||||
theDisplay = nil;
|
theDisplay = nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Should also have a destructor which does
|
// Should also have a destructor which does
|
||||||
//#ifdef CGIMAGEREF
|
|
||||||
// free(colourTable);
|
// free(colourTable);
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
// Set Mac frame layout and base address (uses the_buffer/MacFrameBaseMac)
|
// Set Mac frame layout and base address (uses the_buffer/MacFrameBaseMac)
|
||||||
|
@ -501,7 +489,6 @@ OSX_monitor::init_window(const video_mode &mode)
|
||||||
unsigned char *offsetBuffer = (unsigned char *) the_buffer;
|
unsigned char *offsetBuffer = (unsigned char *) the_buffer;
|
||||||
offsetBuffer += 1; // OS X NSBitmaps are RGBA, but Basilisk generates ARGB
|
offsetBuffer += 1; // OS X NSBitmaps are RGBA, but Basilisk generates ARGB
|
||||||
|
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
switch ( mode.depth )
|
switch ( mode.depth )
|
||||||
{
|
{
|
||||||
case VDEPTH_1BIT: bpp = 1; break;
|
case VDEPTH_1BIT: bpp = 1; break;
|
||||||
|
@ -571,61 +558,6 @@ OSX_monitor::init_window(const video_mode &mode)
|
||||||
// CGDataProviderRef provider, const float decode[], bool shouldInterpolate);
|
// CGDataProviderRef provider, const float decode[], bool shouldInterpolate);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGIMAGEREF
|
|
||||||
short bitsPer, samplesPer; // How big is each Pixel?
|
|
||||||
|
|
||||||
if ( mode.depth == VDEPTH_1BIT )
|
|
||||||
bitsPer = 1;
|
|
||||||
else
|
|
||||||
bitsPer = 8;
|
|
||||||
|
|
||||||
if ( mode.depth == VDEPTH_32BIT )
|
|
||||||
samplesPer = 3;
|
|
||||||
else
|
|
||||||
samplesPer = 1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef NSBITMAP
|
|
||||||
bitmap = [NSBitmapImageRep alloc];
|
|
||||||
bitmap = [bitmap initWithBitmapDataPlanes: (unsigned char **) &offsetBuffer
|
|
||||||
pixelsWide: mode.x
|
|
||||||
pixelsHigh: mode.y
|
|
||||||
bitsPerSample: bitsPer
|
|
||||||
samplesPerPixel: samplesPer
|
|
||||||
hasAlpha: NO
|
|
||||||
isPlanar: NO
|
|
||||||
colorSpaceName: NSCalibratedRGBColorSpace
|
|
||||||
bytesPerRow: mode.bytes_per_row
|
|
||||||
bitsPerPixel: bits_from_depth(mode.depth)];
|
|
||||||
|
|
||||||
if ( ! bitmap )
|
|
||||||
{
|
|
||||||
ErrorAlert("Could not allocate an NSBitmapImageRep");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
[output readyToDraw: bitmap
|
|
||||||
imageWidth: mode.x
|
|
||||||
imageHeight: mode.y];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CGDRAWBITMAP
|
|
||||||
[output readyToDraw: offsetBuffer
|
|
||||||
width: mode.x
|
|
||||||
height: mode.y
|
|
||||||
bps: bitsPer
|
|
||||||
spp: samplesPer
|
|
||||||
bpp: bits_from_depth(mode.depth)
|
|
||||||
bpr: mode.bytes_per_row
|
|
||||||
isPlanar: NO
|
|
||||||
hasAlpha: NO];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -780,13 +712,11 @@ bool VideoInit(bool classic)
|
||||||
case DISPLAY_OPENGL:
|
case DISPLAY_OPENGL:
|
||||||
// Same as window depths and sizes?
|
// Same as window depths and sizes?
|
||||||
case DISPLAY_WINDOW:
|
case DISPLAY_WINDOW:
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
add_standard_modes(VDEPTH_1BIT);
|
add_standard_modes(VDEPTH_1BIT);
|
||||||
add_standard_modes(VDEPTH_2BIT);
|
add_standard_modes(VDEPTH_2BIT);
|
||||||
add_standard_modes(VDEPTH_4BIT);
|
add_standard_modes(VDEPTH_4BIT);
|
||||||
add_standard_modes(VDEPTH_8BIT);
|
add_standard_modes(VDEPTH_8BIT);
|
||||||
add_standard_modes(VDEPTH_16BIT);
|
add_standard_modes(VDEPTH_16BIT);
|
||||||
#endif
|
|
||||||
add_standard_modes(VDEPTH_32BIT);
|
add_standard_modes(VDEPTH_32BIT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -859,14 +789,9 @@ OSX_monitor::video_close()
|
||||||
[output disableDrawing];
|
[output disableDrawing];
|
||||||
|
|
||||||
// Free frame buffer stuff
|
// Free frame buffer stuff
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
CGImageRelease(imageRef);
|
CGImageRelease(imageRef);
|
||||||
CGColorSpaceRelease(colourSpace);
|
CGColorSpaceRelease(colourSpace);
|
||||||
CGDataProviderRelease(provider);
|
CGDataProviderRelease(provider);
|
||||||
#endif
|
|
||||||
#ifdef NSBITMAP
|
|
||||||
[bitmap release];
|
|
||||||
#endif
|
|
||||||
free(the_buffer);
|
free(the_buffer);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -929,7 +854,6 @@ OSX_monitor::set_palette(uint8 *pal, int num)
|
||||||
CGPaletteRelease(CGpal);
|
CGPaletteRelease(CGpal);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
if ( display_type != DISPLAY_WINDOW )
|
if ( display_type != DISPLAY_WINDOW )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -981,7 +905,6 @@ OSX_monitor::set_palette(uint8 *pal, int num)
|
||||||
|
|
||||||
CGColorSpaceRelease(oldColourSpace);
|
CGColorSpaceRelease(oldColourSpace);
|
||||||
CGImageRelease(oldImageRef);
|
CGImageRelease(oldImageRef);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1028,7 +951,6 @@ OSX_monitor::switch_to_current_mode(void)
|
||||||
failure = "Could not get base address of screen";
|
failure = "Could not get base address of screen";
|
||||||
|
|
||||||
}
|
}
|
||||||
#ifdef CGIMAGEREF
|
|
||||||
// Clean up the old CGImageRef stuff
|
// Clean up the old CGImageRef stuff
|
||||||
else if ( display_type == DISPLAY_WINDOW && imageRef )
|
else if ( display_type == DISPLAY_WINDOW && imageRef )
|
||||||
{
|
{
|
||||||
|
@ -1047,7 +969,6 @@ OSX_monitor::switch_to_current_mode(void)
|
||||||
else
|
else
|
||||||
failure = "Could not video_open() requested mode";
|
failure = "Could not video_open() requested mode";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else if ( ! video_open(mode) )
|
else if ( ! video_open(mode) )
|
||||||
failure = "Could not video_open() requested mode";
|
failure = "Could not video_open() requested mode";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user