Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d2f745873a | |||
| 30217f1573 | |||
| 99b00cb506 | |||
| d5ada05caa | |||
| a44d58c3f2 | |||
| ffa7f54c7b | |||
| 9bfc60ba63 | |||
| e67fec4d66 |
@@ -99,7 +99,7 @@
|
||||
02695368143169EB003A07D4 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
|
||||
02695369143169EB003A07D4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
0269536C143169EB003A07D4 /* Atari800-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Atari800-Info.plist"; sourceTree = "<group>"; };
|
||||
0269536E143169EB003A07D4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
0269536E143169EB003A07D4 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
026953E214317379003A07D4 /* afile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = afile.c; path = "atari800-src/afile.c"; sourceTree = SOURCE_ROOT; };
|
||||
026953E314317379003A07D4 /* afile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = afile.h; path = "atari800-src/afile.h"; sourceTree = SOURCE_ROOT; };
|
||||
026953E414317379003A07D4 /* akey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = akey.h; path = "atari800-src/akey.h"; sourceTree = SOURCE_ROOT; };
|
||||
@@ -184,8 +184,8 @@
|
||||
02E763C314319545008050EA /* ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ui.h; path = "atari800-src/ui.h"; sourceTree = SOURCE_ROOT; };
|
||||
02E763C61431958E008050EA /* input.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = input.c; path = "atari800-src/input.c"; sourceTree = SOURCE_ROOT; };
|
||||
02E763C71431958E008050EA /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = input.h; path = "atari800-src/input.h"; sourceTree = SOURCE_ROOT; };
|
||||
87FBC0A71C079E4800AECF5A /* OEA8SystemResponderClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OEA8SystemResponderClient.h; path = "../../OpenEmu/Atari 8-bit/OEA8SystemResponderClient.h"; sourceTree = "<group>"; };
|
||||
94619CA315C4D2B10019AC8E /* OE5200SystemResponderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OE5200SystemResponderClient.h; path = "../../OpenEmu/Atari 5200/OE5200SystemResponderClient.h"; sourceTree = "<group>"; };
|
||||
87FBC0A71C079E4800AECF5A /* OEA8SystemResponderClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OEA8SystemResponderClient.h; path = "../../OpenEmu/SystemPlugins/Atari 8-bit/OEA8SystemResponderClient.h"; sourceTree = "<group>"; };
|
||||
94619CA315C4D2B10019AC8E /* OE5200SystemResponderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OE5200SystemResponderClient.h; path = "../../OpenEmu/SystemPlugins/Atari 5200/OE5200SystemResponderClient.h"; sourceTree = "<group>"; };
|
||||
9491E45A1989AF050075135C /* sound.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sound.c; path = "atari800-src/sound.c"; sourceTree = SOURCE_ROOT; };
|
||||
9491E45C1989B1CA0075135C /* artifact.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = artifact.c; path = "atari800-src/artifact.c"; sourceTree = SOURCE_ROOT; };
|
||||
9491E45D1989B1CA0075135C /* artifact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = artifact.h; path = "atari800-src/artifact.h"; sourceTree = SOURCE_ROOT; };
|
||||
@@ -203,7 +203,7 @@
|
||||
94DEA00F171918A200073397 /* crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = crc32.c; path = "atari800-src/crc32.c"; sourceTree = SOURCE_ROOT; };
|
||||
94DEA010171918A200073397 /* crc32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crc32.h; path = "atari800-src/crc32.h"; sourceTree = SOURCE_ROOT; };
|
||||
94DEA012171918D200073397 /* emuos.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = emuos.c; path = "atari800-src/emuos.c"; sourceTree = SOURCE_ROOT; };
|
||||
94DEA018171951AD00073397 /* OpenEmuBase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenEmuBase.framework; path = "../OpenEmu-SDK/build/Release/OpenEmuBase.framework"; sourceTree = "<group>"; };
|
||||
94DEA018171951AD00073397 /* OpenEmuBase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = OpenEmuBase.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -230,6 +230,7 @@
|
||||
02695362143169EB003A07D4 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
usesTabs = 0;
|
||||
};
|
||||
02695362143169EB003A07D4 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -438,7 +439,7 @@
|
||||
};
|
||||
buildConfigurationList = 0269535B143169EA003A07D4 /* Build configuration list for PBXProject "Atari800" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
|
||||
@@ -82,7 +82,6 @@ typedef struct {
|
||||
uint8_t *_soundBuffer;
|
||||
ATR5200ControllerState controllerStates[4];
|
||||
}
|
||||
- (void)renderToBuffer;
|
||||
- (ATR5200ControllerState)controllerStateForPlayer:(NSUInteger)playerNum;
|
||||
//int16_t convertSample(uint8_t);
|
||||
@end
|
||||
@@ -97,7 +96,6 @@ static ATR800GameCore *_currentCore;
|
||||
{
|
||||
if((self = [super init]))
|
||||
{
|
||||
_videoBuffer = malloc(Screen_WIDTH * Screen_HEIGHT * 4);
|
||||
_soundBuffer = malloc(2048); // 4096 if stereo?
|
||||
}
|
||||
|
||||
@@ -119,7 +117,7 @@ static ATR800GameCore *_currentCore;
|
||||
{
|
||||
// Set the default palette (NTSC)
|
||||
NSString *palettePath = [[[NSBundle bundleForClass:[self class]] resourcePath] stringByAppendingPathComponent:@"Default.act"];
|
||||
strcpy(COLOURS_NTSC_external.filename, [palettePath UTF8String]);
|
||||
strcpy(COLOURS_NTSC_external.filename, palettePath.fileSystemRepresentation);
|
||||
COLOURS_NTSC_external.loaded = TRUE;
|
||||
|
||||
Atari800_tv_mode = Atari800_TV_NTSC;
|
||||
@@ -135,7 +133,7 @@ static ATR800GameCore *_currentCore;
|
||||
// Set 5200.rom BIOS path
|
||||
char biosFileName[2048];
|
||||
NSString *biosPath = [self biosDirectoryPath];
|
||||
strcpy(biosFileName, [[biosPath stringByAppendingPathComponent:@"5200.rom"] UTF8String]);
|
||||
strcpy(biosFileName, [[biosPath stringByAppendingPathComponent:@"5200.rom"] fileSystemRepresentation]);
|
||||
|
||||
SYSROM_SetPath(biosFileName, 1, SYSROM_5200);
|
||||
|
||||
@@ -147,9 +145,9 @@ static ATR800GameCore *_currentCore;
|
||||
{
|
||||
char basicFileName[2048], osbFileName[2048], xlFileName[2048];
|
||||
NSString *biosPath = [self biosDirectoryPath];
|
||||
strcpy(basicFileName, [[biosPath stringByAppendingPathComponent:@"ataribas.rom"] UTF8String]);
|
||||
strcpy(osbFileName, [[biosPath stringByAppendingPathComponent:@"atariosb.rom"] UTF8String]);
|
||||
strcpy(xlFileName, [[biosPath stringByAppendingPathComponent:@"atarixl.rom"] UTF8String]);
|
||||
strcpy(basicFileName, [[biosPath stringByAppendingPathComponent:@"ataribas.rom"] fileSystemRepresentation]);
|
||||
strcpy(osbFileName, [[biosPath stringByAppendingPathComponent:@"atariosb.rom"] fileSystemRepresentation]);
|
||||
strcpy(xlFileName, [[biosPath stringByAppendingPathComponent:@"atarixl.rom"] fileSystemRepresentation]);
|
||||
|
||||
SYSROM_SetPath(basicFileName, 1, SYSROM_BASIC_C);
|
||||
SYSROM_SetPath(osbFileName, 2, SYSROM_B_NTSC, SYSROM_800_CUSTOM);
|
||||
@@ -220,7 +218,7 @@ static ATR800GameCore *_currentCore;
|
||||
}
|
||||
|
||||
// Open and try to automatically detect file type, not 100% accurate
|
||||
if(!AFILE_OpenFile([path UTF8String], 1, 1, FALSE))
|
||||
if(!AFILE_OpenFile(path.fileSystemRepresentation, 1, 1, FALSE))
|
||||
{
|
||||
NSLog(@"Failed to open file");
|
||||
return NO;
|
||||
@@ -250,8 +248,6 @@ static ATR800GameCore *_currentCore;
|
||||
//NSLog(@"Sound_out.channels %d frag_frames %d freq %d sample_size %d", Sound_out.channels, Sound_out.frag_frames, Sound_out.freq, Sound_out.sample_size);
|
||||
|
||||
[[self ringBufferAtIndex:0] write:_soundBuffer maxLength:size];
|
||||
|
||||
[self renderToBuffer];
|
||||
}
|
||||
|
||||
- (void)resetEmulation
|
||||
@@ -271,9 +267,35 @@ static ATR800GameCore *_currentCore;
|
||||
|
||||
#pragma mark - Video
|
||||
|
||||
- (const void *)videoBuffer
|
||||
- (const void *)getVideoBufferWithHint:(void *)hint
|
||||
{
|
||||
return _videoBuffer;
|
||||
if (!hint) {
|
||||
if (!_videoBuffer) _videoBuffer = (uint8_t *)malloc(Screen_WIDTH * Screen_HEIGHT * 4);
|
||||
hint = _videoBuffer;
|
||||
}
|
||||
|
||||
// TODO: support paletted video in OE
|
||||
int i, j;
|
||||
UBYTE *source = (UBYTE *)(Screen_atari);
|
||||
UBYTE *destination = (uint8_t*)hint;
|
||||
for (i = 0; i < Screen_HEIGHT; i++)
|
||||
{
|
||||
for (j = 0; j < Screen_WIDTH; j++)
|
||||
{
|
||||
UBYTE r,g,b;
|
||||
r = Colours_GetR(*source);
|
||||
g = Colours_GetG(*source);
|
||||
b = Colours_GetB(*source);
|
||||
*destination++ = b;
|
||||
*destination++ = g;
|
||||
*destination++ = r;
|
||||
*destination++ = 0xff;
|
||||
source++;
|
||||
}
|
||||
// source += Screen_WIDTH - ATARI_VISIBLE_WIDTH;
|
||||
}
|
||||
|
||||
return hint;
|
||||
}
|
||||
|
||||
- (OEIntSize)bufferSize
|
||||
@@ -303,11 +325,6 @@ static ATR800GameCore *_currentCore;
|
||||
return GL_UNSIGNED_INT_8_8_8_8_REV;
|
||||
}
|
||||
|
||||
- (GLenum)internalPixelFormat
|
||||
{
|
||||
return GL_RGB8;
|
||||
}
|
||||
|
||||
#pragma mark - Audio
|
||||
|
||||
- (double)audioSampleRate
|
||||
@@ -324,13 +341,13 @@ static ATR800GameCore *_currentCore;
|
||||
|
||||
- (void)saveStateToFileAtPath:(NSString *)fileName completionHandler:(void (^)(BOOL, NSError *))block
|
||||
{
|
||||
BOOL success = StateSav_SaveAtariState([fileName UTF8String], "wb", TRUE);
|
||||
BOOL success = StateSav_SaveAtariState(fileName.fileSystemRepresentation, "wb", TRUE);
|
||||
if(block) block(success==YES, nil);
|
||||
}
|
||||
|
||||
- (void)loadStateFromFileAtPath:(NSString *)fileName completionHandler:(void (^)(BOOL, NSError *))block
|
||||
{
|
||||
BOOL success = StateSav_ReadAtariState([fileName UTF8String], "rb");
|
||||
BOOL success = StateSav_ReadAtariState(fileName.fileSystemRepresentation, "rb");
|
||||
if(block) block(success==YES, nil);
|
||||
}
|
||||
|
||||
@@ -361,12 +378,12 @@ static ATR800GameCore *_currentCore;
|
||||
|
||||
}
|
||||
|
||||
- (oneway void)keyDown:(unsigned short)keyHIDCode characters:(NSString *)characters charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers flags:(NSEventModifierFlags)modifierFlags
|
||||
- (oneway void)keyDown:(NSUInteger)keyHIDCode
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
- (oneway void)keyUp:(unsigned short)keyHIDCode characters:(NSString *)characters charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers flags:(NSEventModifierFlags)modifierFlags
|
||||
- (oneway void)keyUp:(NSUInteger)keyHIDCode
|
||||
{
|
||||
|
||||
}
|
||||
@@ -584,29 +601,6 @@ static ATR800GameCore *_currentCore;
|
||||
|
||||
#pragma mark - Misc Helper Methods
|
||||
|
||||
- (void)renderToBuffer
|
||||
{
|
||||
int i, j;
|
||||
UBYTE *source = (UBYTE *)(Screen_atari);
|
||||
UBYTE *destination = _videoBuffer;
|
||||
for (i = 0; i < Screen_HEIGHT; i++)
|
||||
{
|
||||
for (j = 0; j < Screen_WIDTH; j++)
|
||||
{
|
||||
UBYTE r,g,b;
|
||||
r = Colours_GetR(*source);
|
||||
g = Colours_GetG(*source);
|
||||
b = Colours_GetB(*source);
|
||||
*destination++ = b;
|
||||
*destination++ = g;
|
||||
*destination++ = r;
|
||||
*destination++ = 0xff;
|
||||
source++;
|
||||
}
|
||||
// source += Screen_WIDTH - ATARI_VISIBLE_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
- (ATR5200ControllerState)controllerStateForPlayer:(NSUInteger)playerNum
|
||||
{
|
||||
ATR5200ControllerState state = {0,0,0,0,0,0,0,0};
|
||||
|
||||
Reference in New Issue
Block a user