19 Commits

Author SHA1 Message Date
clobber 64ce7e6606 Bump version in order for sparkle updater to work. Core is now based from 1.3e 2014-07-28 16:37:57 -05:00
clobber bb6ea11c53 Disable save/load state support for now
Otherwise current states will be broken after the next update from changes in the Wii7800 fork
2014-07-28 16:36:06 -05:00
clobber f7a91239b3 Default "left difficulty" switch to its Left/(B)eginner position
Fixes audio playing in Sentinel
2014-07-28 15:44:41 -05:00
clobber 329dddbb3d Add logging 2014-07-28 15:13:56 -05:00
clobber 7dfdd52961 Allow toggling of console difficulty switches to persist 2014-07-24 16:18:56 -05:00
clobber c159d4ba46 Don't force enable POKEY sound chip 2014-07-22 21:55:15 -05:00
clobber fccfcdca60 Remove carriage returns and don't actually reinvent the erase-remove idiom 2014-07-22 21:02:42 -05:00
clobber b816c248d9 Merge changes from 1.3e (RIOT emulation improvements) 2014-07-22 12:01:12 -05:00
clobber 178157a03c Update internal ROM database
Add some protos and good dumps of games previously listed as overdumps
2014-07-20 02:38:28 -05:00
clobber 8ba23f87d1 Part of 2413579323 2014-07-19 19:06:30 -05:00
clobber 2413579323 Add 2-player input and console button support 2014-07-19 18:56:15 -05:00
clobber 99a2f187bd Patch from Joseph Zatarski to correctly load supergame cart types.
Fixes loading of good ROM dumps where previously only their overdumps would load (Tower Toppler, Realsports Baseball, Water Ski, etc)
2014-07-18 17:09:47 -05:00
clobber 25b74d66c9 Set the correct screen resolution and add PAL support 2014-07-17 01:17:21 -05:00
clobber 6125b75ff5 Silence warning 2014-07-17 01:15:41 -05:00
clobber 173fce5d24 Fix other crash on game load 2014-07-17 01:15:28 -05:00
clobber bde73deee5 Fix core-breaking, game-loading warning :P 2014-07-16 18:31:38 -05:00
clobber 561a47efe1 Add error: parameter to -loadFileAtPath: method. 2014-02-08 14:47:51 -08:00
Alexander Strange 366bb1c4a9 Compilation speed: enable modules 2014-01-19 23:03:17 -08:00
clobber 96b4606d7b Update spakle update URL and remove DSA key 2013-12-21 21:35:56 -06:00
14 changed files with 358 additions and 141 deletions
+11 -5
View File
@@ -17,13 +17,21 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3</string>
<string>1.3.0.1</string>
<key>NSPrincipalClass</key>
<string>OEGameCoreController</string>
<key>OEGameCoreClass</key>
<string>ProSystemGameCore</string>
<key>OEGameCoreOptions</key>
<dict>
<key>openemu.system.7800</key>
<dict>
<key>OEGameCoreSaveStatesNotSupported</key>
<true/>
</dict>
</dict>
<key>OEGameCorePlayerCount</key>
<string>1</string>
<string>2</string>
<key>OEProjectURL</key>
<string>http://home.comcast.net/~gscottstanton/</string>
<key>OESystemIdentifiers</key>
@@ -33,8 +41,6 @@
<key>SUEnableAutomaticChecks</key>
<string>1</string>
<key>SUFeedURL</key>
<string>http://openemu.org/updater/prosystem_appcast.xml</string>
<key>SUPublicDSAKeyFile</key>
<string>dsa_pub.pem</string>
<string>https://raw.github.com/OpenEmu/OpenEmu-Update/master/prosystem_appcast.xml</string>
</dict>
</plist>
+81 -1
View File
@@ -558,6 +558,14 @@ controller1=1
controller2=1
region=1
flags=1
[017066f522908081ec3ee624f5e4a8aa]
title=Missing in Action
type=2
pokey=false
controller1=1
controller2=1
region=0
flags=2
[3bc8f554cf86f8132a623cc2201a564b]
title=Motor Psycho
type=4
@@ -639,7 +647,15 @@ controller2=1
region=1
flags=0
[ec206c8db4316eb1ebce9fc960da7d8f]
title=Pit Fighter
title=Pit Fighter (Overdump)
type=4
pokey=false
controller1=1
controller2=1
region=0
flags=0
[05f43244465943ce819780a71a5b572a]
title=Pit Fighter
type=4
pokey=false
controller1=1
@@ -662,6 +678,14 @@ controller1=1
controller2=1
region=1
flags=0
[86546808dc60961cdb1b20e761c50ab1]
title=Plutos
type=3
pokey=false
controller1=1
controller2=1
region=0
flags=0
[584582bb09ee8122e7fc09dc7d1ed813]
title=Pole Position II
type=0
@@ -694,7 +718,23 @@ controller1=1
controller2=1
region=0
flags=0
[442761655bb25ddfe5f7ab16bf591c6f]
title=Rampart
type=1
pokey=false
controller1=1
controller2=1
region=0
flags=0
[bfad016d6e77eaccec74c0340aded8b9]
title=Realsports Baseball (Overdump)
type=1
pokey=false
controller1=1
controller2=1
region=0
flags=0
[383ed9bd1efb9b6cb3388a777678c928]
title=Realsports Baseball
type=1
pokey=false
@@ -742,6 +782,22 @@ controller1=2
controller2=2
region=0
flags=0
[5469b4de0608f23a5c4f98f331c9e75f]
title=Sentinel
type=4
pokey=false
controller1=2
controller2=2
region=1
flags=0
[2d643ac548c40e58c99d0fe433ba4ba0]
title=Sirius
type=3
pokey=false
controller1=2
controller2=2
region=0
flags=0
[cbb0746192540a13b4c7775c7ce2021f]
title=Summer Games
type=3
@@ -783,6 +839,14 @@ controller2=1
region=1
flags=0
[44f862bca77d68b56b32534eda5c198d]
title=Tank Command (Overdump)
type=1
pokey=false
controller1=1
controller2=1
region=0
flags=0
[5c4f752371a523f15e9980fea73b874d]
title=Tank Command
type=1
pokey=false
@@ -831,6 +895,14 @@ controller2=1
region=0
flags=0
[d12e665347f354048b9d13092f7868c9]
title=Tower Toppler (Overdump)
type=3
pokey=false
controller1=1
controller2=1
region=0
flags=0
[8d64763db3100aadc552db5e6868506a]
title=Tower Toppler
type=3
pokey=false
@@ -847,6 +919,14 @@ controller2=1
region=1
flags=0
[acf63758ecf3f3dd03e9d654ae6b69b7]
title=Water Ski (Overdump)
type=1
pokey=false
controller1=1
controller2=1
region=0
flags=0
[427cb05d0a1abb068998e2760d77f4fb]
title=Water Ski
type=1
pokey=false
+25 -13
View File
@@ -35,8 +35,6 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
82CAFD020FEDD54000CCDC7E /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 82CAFD010FEDD54000CCDC7E /* dsa_pub.pem */; };
82CAFD1E0FEDD5B300CCDC7E /* config.yaml in CopyFiles */ = {isa = PBXBuildFile; fileRef = 82CAFD030FEDD54800CCDC7E /* config.yaml */; };
82EC409F0FD9EC420017FC19 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 82EC409E0FD9EC420017FC19 /* libz.dylib */; };
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
@@ -88,7 +86,6 @@
dstPath = "";
dstSubfolderSpec = 16;
files = (
82CAFD1E0FEDD5B300CCDC7E /* config.yaml in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -99,8 +96,6 @@
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
82CAFD010FEDD54000CCDC7E /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = "<group>"; };
82CAFD030FEDD54800CCDC7E /* config.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = config.yaml; sourceTree = "<group>"; };
82EC409E0FD9EC420017FC19 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
8D5B49B6048680CD000E48DA /* ProSystem.oecoreplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProSystem.oecoreplugin; sourceTree = BUILT_PRODUCTS_DIR; };
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -235,7 +230,6 @@
089C167CFE841241C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
82CAFD010FEDD54000CCDC7E /* dsa_pub.pem */,
8D5B49B7048680CD000E48DA /* Info.plist */,
089C167DFE841241C02AAC07 /* InfoPlist.strings */,
);
@@ -282,7 +276,6 @@
32C88E010371C26100C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
82CAFD030FEDD54800CCDC7E /* config.yaml */,
);
name = "Other Sources";
sourceTree = "<group>";
@@ -438,7 +431,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 0420;
LastUpgradeCheck = 0500;
};
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "ProSystem" */;
compatibilityVersion = "Xcode 3.2";
@@ -464,7 +457,6 @@
buildActionMask = 2147483647;
files = (
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */,
82CAFD020FEDD54000CCDC7E /* dsa_pub.pem in Resources */,
941F59FC17A77CC90005D7EA /* ProSystem.dat in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -560,6 +552,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
EXPORTED_SYMBOLS_FILE = "";
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/core\"",
@@ -579,6 +572,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
EXPORTED_SYMBOLS_FILE = "";
HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/core\"",
@@ -596,15 +590,24 @@
1DEB913F08733D840010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_EXPERIMENTAL = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -617,16 +620,25 @@
1DEB914008733D840010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_EXPERIMENTAL = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "";
MACOSX_DEPLOYMENT_TARGET = 10.7;
+79 -19
View File
@@ -43,8 +43,9 @@
@interface ProSystemGameCore () <OE7800SystemResponderClient>
{
uint32_t *videoBuffer;
int videoWidth, videoHeight;
uint display_palette32[256];
byte keyboard_data[19];
byte keyboard_data[17];
}
@end
@@ -65,6 +66,8 @@ static void display_ResetPalette32( ) {
if((self = [super init]))
{
videoBuffer = (uint32_t *)malloc(320 * 292 * 4);
videoWidth = 320;
videoHeight = 240;
current = self;
}
@@ -78,8 +81,17 @@ static void display_ResetPalette32( ) {
#pragma mark Execution
- (BOOL)loadFileAtPath:(NSString *)path
- (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
{
memset(keyboard_data, 0, sizeof(keyboard_data));
// Difficulty switches: Left position = (B)eginner, Right position = (A)dvanced
// Left difficulty switch defaults to left position, "(B)eginner"
keyboard_data[15] = 1;
// Right difficulty switch defaults to right position, "(A)dvanced", which fixes Tower Toppler
keyboard_data[16] = 0;
if(cartridge_Load([path UTF8String])) {
//sound_Stop( );
//display_Clear( );
@@ -93,11 +105,14 @@ static void display_ResetPalette32( ) {
if (bios_Load([biosROM UTF8String]))
bios_enabled = true;
NSLog(@"Headerless MD5 hash: %s", cartridge_digest.c_str());
NSLog(@"Header info (often wrong):\ntitle: %s\ntype: %d\nregion: %s\npokey: %s", cartridge_title.c_str(), cartridge_type, cartridge_region == REGION_NTSC ? "NTSC" : "PAL", cartridge_pokey ? "true" : "false");
database_Load(cartridge_digest);
prosystem_Reset( );
std::string title = common_Trim(cartridge_title);
NSLog(@"Now Loading: %@", [NSString stringWithUTF8String:title.c_str()]);
NSLog(@"Database info:\ntitle: %@\ntype: %d\nregion: %s\npokey: %s", [NSString stringWithUTF8String:title.c_str()], cartridge_type, cartridge_region == REGION_NTSC ? "NTSC" : "PAL", cartridge_pokey ? "true" : "false");
//sound_SetSampleRate(48000);
//display_ResetPalette( );
@@ -120,23 +135,23 @@ static void display_ResetPalette32( ) {
{
prosystem_ExecuteFrame(keyboard_data); //wants input
uint height = maria_visibleArea.GetHeight( );
uint length = maria_visibleArea.GetLength( );
current->videoWidth = maria_visibleArea.GetLength();
current->videoHeight = maria_visibleArea.GetHeight();
const byte* buffer = maria_surface + ((maria_visibleArea.top - maria_displayArea.top) * maria_visibleArea.GetLength( ));
uint* surface = (uint*)videoBuffer;
//uint pitch = 320 >> 2; // should be Distance, in bytes, to the start of next line.
uint pitch = 320;
for(uint indexY = 0; indexY < height; indexY++) {
for(uint indexX = 0; indexX < length; indexX += 4) {
for(uint indexY = 0; indexY < current->videoHeight; indexY++) {
for(uint indexX = 0; indexX < current->videoWidth; indexX += 4) {
surface[indexX + 0] = display_palette32[buffer[indexX + 0]];
surface[indexX + 1] = display_palette32[buffer[indexX + 1]];
surface[indexX + 2] = display_palette32[buffer[indexX + 2]];
surface[indexX + 3] = display_palette32[buffer[indexX + 3]];
}
surface += pitch;
buffer += length;
buffer += current->videoWidth;
}
sound_Store();
@@ -151,12 +166,12 @@ static void display_ResetPalette32( ) {
- (OEIntRect)screenRect
{
return OEIntRectMake(0, 0, 320, 240);
return OEIntRectMake(0, 0, current->videoWidth, current->videoHeight);
}
- (OEIntSize)bufferSize
{
return OEIntSizeMake(320, 240);
return OEIntSizeMake(320, 292);
}
- (const void *)videoBuffer
@@ -181,7 +196,7 @@ static void display_ResetPalette32( ) {
- (NSTimeInterval)frameInterval
{
return 60;
return cartridge_region == REGION_NTSC ? 60 : 50;
}
#pragma mark Audio
@@ -225,26 +240,71 @@ static void display_ResetPalette32( ) {
// | 15 | Console | Left Difficulty
// | 16 | Console | Right Difficulty
// +----------+--------------+-------------------------------------------------
const int ProSystemMap[] = { 3, 2, 1, 0, 4, 5}; // fix for Joystick 2 and the console buttons
const int ProSystemMap[] = { 3, 2, 1, 0, 4, 5, 9, 8, 7, 6, 10, 11, 13, 14, 12, 15, 16};
- (oneway void)didPush7800Button:(OE7800Button)button forPlayer:(NSUInteger)player;
{
//keyboard_data[player-1] |= 1 << ProSystemMap[button];
keyboard_data[ProSystemMap[button]] = 1;
int playerShift = player != 1 ? 6 : 0;
switch (button) {
case OE7800ButtonUp:
case OE7800ButtonDown:
case OE7800ButtonLeft:
case OE7800ButtonRight:
case OE7800ButtonFire1:
case OE7800ButtonFire2:
keyboard_data[ProSystemMap[button + playerShift]] = 1;
break;
case OE7800ButtonSelect:
case OE7800ButtonPause:
case OE7800ButtonReset:
keyboard_data[ProSystemMap[button + 6]] = 1;
break;
case OE7800ButtonLeftDiff:
case OE7800ButtonRightDiff:
keyboard_data[ProSystemMap[button + 6]] ^= (1 << 0);
break;
default:
break;
}
}
- (oneway void)didRelease7800Button:(OE7800Button)button forPlayer:(NSUInteger)player;
{
//keyboard_data[player-1] &= ~(1 << ProSystemMap[button]);
keyboard_data[ProSystemMap[button]] = 0;
int playerShift = player != 1 ? 6 : 0;
switch (button) {
case OE7800ButtonUp:
case OE7800ButtonDown:
case OE7800ButtonLeft:
case OE7800ButtonRight:
case OE7800ButtonFire1:
case OE7800ButtonFire2:
keyboard_data[ProSystemMap[button + playerShift]] = 0;
break;
case OE7800ButtonSelect:
case OE7800ButtonPause:
case OE7800ButtonReset:
keyboard_data[ProSystemMap[button + 6]] = 0;
break;
default:
break;
}
}
- (BOOL)saveStateToFileAtPath:(NSString *)fileName
{
//return prosystem_Save([fileName UTF8String], false) ? YES : NO;
return NO;
}
- (BOOL)loadStateFromFileAtPath:(NSString *)fileName
{
//return prosystem_Load([fileName UTF8String]) ? YES : NO;
return NO;
}
@@ -298,8 +358,8 @@ static void sound_Store() {
uint length = 48000 / prosystem_frequency; /* sound_GetSampleLength(sound_format.nSamplesPerSec, prosystem_frame, prosystem_frequency); */ /* 48000 / prosystem_frequency */
sound_Resample(tia_buffer, sample, length);
// Ballblazer, Commando
//if(cartridge_pokey) {
// Ballblazer, Commando, various homebrew and hacks
if(cartridge_pokey) {
byte pokeySample[MAX_BUFFER_SIZE];
memset( pokeySample, 0, MAX_BUFFER_SIZE );
sound_Resample(pokey_buffer, pokeySample, length);
@@ -307,7 +367,7 @@ static void sound_Store() {
sample[index] += pokeySample[index];
sample[index] = sample[index] / 2;
}
//}
}
[[current ringBufferAtIndex:0] write:sample maxLength:length];
// Convert 8u to 16s
// for(int i = 0; i != length; i ++)
-9
View File
@@ -1,9 +0,0 @@
build_now: 'YES'
create_core_path: 'YES'
download_base_url: http://github.com/downloads/openemu/openemu
release_notes_base_url: http://openemu.org/category/releasenotes/stella/
appcast_basefolder: '/Users/jweinberg/Desktop/Appcast'
appcast_xml_name: 'stella_appcast.xml'
keychain_privkey_name: 'Sparkle Private Key'
css_file_name: 'rnotes.css'
bundle_extension: 'oecoreplugin'
+10 -5
View File
@@ -71,6 +71,12 @@ static bool cartridge_CC2(const byte* header) {
// GetBankOffset
// ----------------------------------------------------------------------------
static uint cartridge_GetBankOffset(byte bank) {
if ((cartridge_type == CARTRIDGE_TYPE_SUPERCART || cartridge_type == CARTRIDGE_TYPE_SUPERCART_ROM || cartridge_type == CARTRIDGE_TYPE_SUPERCART_RAM) && cartridge_size <= 65536) {
// for some of these carts, there are only 4 banks. in this case we ignore bit 3
// previously, games of this type had to be doubled. The first 4 banks needed to be duplicated at the end of the ROM
return (bank & 3) * 16384;
}
return bank * 16384;
}
@@ -129,8 +135,7 @@ static void cartridge_ReadHeader(const byte* header) {
}
}
//cartridge_pokey = (header[54] & 1)? true: false;
cartridge_pokey = true;
cartridge_pokey = (header[54] & 1)? true: false;
cartridge_controller[0] = header[55];
cartridge_controller[1] = header[56];
cartridge_region = header[57];
@@ -163,6 +168,7 @@ if (cartridge_CC2(header)) {
cartridge_ReadHeader(header);
size -= 128;
offset = 128;
cartridge_size = size;
}
else {
cartridge_size = size;
@@ -192,7 +198,7 @@ bool cartridge_Load(std::string filename) {
byte* data = NULL;
//uint size = archive_GetUncompressedFileSize(filename);
uint size;
uint size = 0;
if(size == 0) {
FILE *file = fopen(filename.c_str( ), "rb");
@@ -318,8 +324,7 @@ void cartridge_Write(word address, byte data) {
break;
}
//if(cartridge_pokey && address >= 0x4000 && address < 0x4009) {
if(address >= 0x4000 && address < 0x4009) {
if(cartridge_pokey && address >= 0x4000 && address < 0x4009) {
switch(address) {
case POKEY_AUDF1:
pokey_SetRegister(POKEY_AUDF1, data);
+2 -21
View File
@@ -136,27 +136,8 @@ std::string common_Trim(std::string target) {
// Remove
// ----------------------------------------------------------------------------
std::string common_Remove(std::string target, char value) {
int length = 0;
int index;
for(index = 0; index < target.size( ); index++) {
if(target[index] != value) {
length++;
}
}
char* buffer = new char[length + 1];
int count = 0;
for(index = 0; index < target.size( ); index++) {
if(target[index] != value) {
buffer[count] = target[index];
count++;
}
}
buffer[length] = 0;
std::string source = buffer;
delete[ ] buffer;
return source;
target.erase(std::remove(target.begin(), target.end(), value), target.end());
return target;
}
// ----------------------------------------------------------------------------
+1
View File
@@ -61,6 +61,7 @@ bool database_Load(std::string digest) {
for(int index = 0; index < 7; index++) {
fgets(buffer, 256, file);
entry[index] = common_Remove(buffer, '\n');
entry[index] = common_Remove(entry[index], '\r');
}
cartridge_title = database_GetValue(entry[0]);
+1 -1
View File
@@ -66,7 +66,7 @@ static void maria_StoreCell(byte data) {
static void maria_StoreCell(byte high, byte low) {
if(maria_horizontal < MARIA_LINERAM_SIZE) {
if(low || high) {
maria_lineRAM[maria_horizontal] = maria_palette & 16 | high | low;
maria_lineRAM[maria_horizontal] = (maria_palette & 16) | high | low;
}
else {
byte kmode = memory_ram[CTRL] & 4;
+9 -4
View File
@@ -68,6 +68,7 @@ byte memory_Read(word address) {
// Write
// ----------------------------------------------------------------------------
void memory_Write(word address, byte data) {
if(!memory_rom[address]) {
switch(address) {
case WSYNC:
@@ -113,10 +114,13 @@ void memory_Write(word address, byte data) {
case AUDV1:
tia_SetRegister(AUDV1, data);
break;
case SWCHB:
break;
case CTLSWB:
break;
case SWCHA: /*gdement: Writing here actually writes to DRA inside the RIOT chip.
This value only indirectly affects output of SWCHA. Ditto for SWCHB.*/
riot_SetDRA(data);
break;
case SWCHB:
riot_SetDRB(data);
break;
case TIM1T:
case TIM1T | 0x8:
riot_SetTimer(TIM1T, data);
@@ -148,6 +152,7 @@ void memory_Write(word address, byte data) {
memory_ram[address + 8192] = data;
}
break;
/*TODO: gdement: test here for debug port. Don't put it in the switch because that will change behavior.*/
}
}
else {
+2 -2
View File
@@ -107,9 +107,9 @@ void prosystem_ExecuteFrame(const byte* input) {
}
}
tia_Process(2);
//if(cartridge_pokey) {
if(cartridge_pokey) {
pokey_Process(2);
//}
}
}
prosystem_frame++;
if(prosystem_frame >= prosystem_frequency) {
+135 -41
View File
@@ -28,11 +28,15 @@ bool riot_timing = false;
word riot_timer = TIM64T;
byte riot_intervals;
static byte riot_dra = 0;
static byte riot_drb = 0;
static bool riot_elapsed;
static int riot_currentTime;
static word riot_clocks;
void riot_Reset(void) {
riot_SetDRA(0);
riot_SetDRB(0);
}
// ----------------------------------------------------------------------------
@@ -59,53 +63,143 @@ void riot_Reset(void) {
// | 16 | Console | Right Difficulty
// +----------+--------------+-------------------------------------------------
void riot_SetInput(const byte* input) {
(input[0x00])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x80: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x80;
(input[0x01])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x40: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x40;
(input[0x02])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x20: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x20;
(input[0x03])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x10: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x10;
if(input[0x04]) {
memory_ram[INPT0] = memory_ram[INPT0] | 0x80;
memory_ram[INPT4] = memory_ram[INPT4] &~ 0x80;
/*gdement: Comments are messy, but wanted to document how this all works.
Changed this routine to support 1 vs 2 button modes.
Also added the interaction of CTLSWA and DRA on the SWCHA output, and same for SWCHB.
SWCHA is directionals. SWCHB is console switches and button mode.
button signals are in high bits of INPT0-5.*/
memory_ram[SWCHA] = ((~memory_ram[CTLSWA]) | riot_dra); /*SWCHA as driven by RIOT*/
/*now console switches will force bits to ground:*/
if (input[0x00]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x80;
if (input[0x01]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x40;
if (input[0x02]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x20;
if (input[0x03]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x10;
if (input[0x06]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x08;
if (input[0x07]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x04;
if (input[0x08]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x02;
if (input[0x09]) memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x01;
/*Switches can always push the appropriate bit of SWCHA to ground, as in above code block.
In addition, RIOT can be configured to drive ground even when switch is open.
By doing this it's possible for real hardware to behave as if switches are permanently held (tested this).*/
/*As with swcha, the value seen at SWCHB is derived from CTLSWB and DRB (an internal RIOT register)
(Any write to SWCHB actually gets stored in DRB)
If a given bit in CTLSWB is 0 (input mode), then RIOT puts a 1 on SWCHB.
If bit in CTLSWB is 1 (output mode), then RIOT puts stored DRB value on SWCHB.
The SWCHB outputs from RIOT can be overdriven to 0 by console switches.
The CTLSWB/DRB interaction is important at bits 2 and 4, which control button mode for each player.
Bit 5 appears unused, and other bits are the console switches.
CTLSWB DRB SWCHB result on button mode (for bits 2 and 4)
------- --- ----- -----------------------------------------
0 0 1 1 button mode - this is default state after boot
0 1 1 1 button mode
1 0 0 2 button mode
1 1 1 1 button mode
This chart was confirmed on hardware
From the default state after boot, simply changing CTLSWB to 1 will result in 2 button mode.
Some games rely on this, and don't actually store anything to SWCHB.*/
memory_ram[SWCHB] = ((~memory_ram[CTLSWB]) | riot_drb); /*SWCHB as driven by RIOT*/
/*now the console switches can force certain bits to ground:*/
if (input[0x0c]) memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x01;
if (input[0x0d]) memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x02;
if (input[0x0e]) memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x08;
if (input[0x0f]) memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x40;
if (input[0x10]) memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x80;
/*When in 1 button mode, only the legacy 2600 button signal is active. The others stay off.
When in 2 button mode, only the new signals are active. 2600 button stays off. (tested)
see: http://www.atariage.com/forums/index.php?showtopic=127162
also see 7800 schematic and RIOT datasheet */
if(memory_ram[SWCHB] & 0x04) //first player in 1 button mode
{
memory_ram[INPT0] &= 0x7f; //new style buttons are always off in this mode
memory_ram[INPT1] &= 0x7f;
if(input[0x04] || input[0x05]) //in this mode, either button triggers only the legacy button signal
{
memory_ram[INPT4] &= 0x7f; //this button signal activates by turning off the high bit
}
else
{
memory_ram[INPT4] |= 0x80;
}
}
else {
memory_ram[INPT0] = memory_ram[INPT0] &~ 0x80;
memory_ram[INPT4] = memory_ram[INPT4] | 0x80;
else //first player in 2 button mode
{
memory_ram[INPT4] |= 0x80; //2600 button is always off in this mode
if(input[0x04]) //left button (button 1)
{
memory_ram[INPT1] |= 0x80; //these buttons activate by turning on the high bit.
}
else
{
memory_ram[INPT1] &= 0x7f;
}
if(input[0x05]) //right button (button 2)
{
memory_ram[INPT0] |= 0x80;
}
else
{
memory_ram[INPT0] &= 0x7f;
}
}
if(input[0x05]) {
memory_ram[INPT1] = memory_ram[INPT1] | 0x80;
memory_ram[INPT4] = memory_ram[INPT4] &~ 0x80;
/*now repeat for 2nd player*/
if(memory_ram[SWCHB] & 0x10)
{
memory_ram[INPT2] &= 0x7f;
memory_ram[INPT3] &= 0x7f;
if(input[0x0a] || input[0x0b])
{
memory_ram[INPT5] &= 0x7f;
}
else
{
memory_ram[INPT5] |= 0x80;
}
}
else {
memory_ram[INPT1] = memory_ram[INPT1] &~ 0x80;
memory_ram[INPT4] = memory_ram[INPT4] | 0x80;
else
{
memory_ram[INPT5] |= 0x80;
if(input[0x0a])
{
memory_ram[INPT3] |= 0x80;
}
else
{
memory_ram[INPT3] &= 0x7f;
}
if(input[0x0b])
{
memory_ram[INPT2] |= 0x80;
}
else
{
memory_ram[INPT2] &= 0x7f;
}
}
(input[0x06])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x08: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x08;
(input[0x07])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x04: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x04;
(input[0x08])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x02: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x02;
(input[0x09])? memory_ram[SWCHA] = memory_ram[SWCHA] &~ 0x01: memory_ram[SWCHA] = memory_ram[SWCHA] | 0x01;
if(input[0x0a]) {
memory_ram[INPT2] = memory_ram[INPT2] | 0x80;
memory_ram[INPT5] = memory_ram[INPT5] &~ 0x80;
}
else {
memory_ram[INPT2] = memory_ram[INPT2] &~ 0x80;
memory_ram[INPT5] = memory_ram[INPT5] | 0x80;
}
if(input[0x0b]) {
memory_ram[INPT3] = memory_ram[INPT3] | 0x80;
memory_ram[INPT5] = memory_ram[INPT5] &~ 0x80;
}
else {
memory_ram[INPT3] = memory_ram[INPT3] &~ 0x80;
memory_ram[INPT5] = memory_ram[INPT5] | 0x80;
}
(input[0x0c])? memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x01: memory_ram[SWCHB] = memory_ram[SWCHB] | 0x01;
(input[0x0d])? memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x02: memory_ram[SWCHB] = memory_ram[SWCHB] | 0x02;
(input[0x0e])? memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x08: memory_ram[SWCHB] = memory_ram[SWCHB] | 0x08;
(input[0x0f])? memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x40: memory_ram[SWCHB] = memory_ram[SWCHB] | 0x40;
(input[0x10])? memory_ram[SWCHB] = memory_ram[SWCHB] &~ 0x80: memory_ram[SWCHB] = memory_ram[SWCHB] | 0x80;
}
/***********************************************************************************
* riot_setDRA(byte data) and riot_setDRB(byte data) gdement
* -------------------------------------------------
* Stores a value written to SWCHA/SWCHB into the RIOT's internal DRA/DRB registers.
* These are distinct from what you see when reading SWCHA/SWCHB.
***********************************************************************************/
void riot_SetDRA(byte data) {
riot_dra=data;
}
void riot_SetDRB(byte data) {
riot_drb=data;
}
// ----------------------------------------------------------------------------
// SetTimer
// ----------------------------------------------------------------------------
+2
View File
@@ -34,6 +34,8 @@ typedef unsigned int uint;
extern void riot_Reset(void);
extern void riot_SetInput(const byte* input);
extern void riot_SetDRA(byte data);
extern void riot_SetDRB(byte data);
extern void riot_SetTimer(word timer, byte intervals);
extern void riot_UpdateTimer(byte cycles);
extern bool riot_timing;
-20
View File
@@ -1,20 +0,0 @@
-----BEGIN PUBLIC KEY-----
MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQD/nSuLzikeU6MrymSPr34AiU2RDJz6
0pm/3PPs27f6QTtbUAvGC13q6XWrE3HJU8Gz7RM0EJZGpiwb86LgqOJhjfQ7WKse
uaGdbHnvJEFsGqpKX7rnUWaWO3HAsKzDx4HzJqKupFEbTbzXl/GT3JMm+a3PXA3S
kyATydRPrX583Ih8iHO1zQs1pwp2AnUvaQXvp4QOLFWheH5napkDZBjc9B7H38dg
f4c0QqEXJw0lJbG26FxhpOWMiXwpWpOHSfb+XtmzpeTDIHxKPLMEdf2wc+xNC/M9
GdVBfM7+hCEhl1JGqNWPpT7ZzciX8Cxg+5/MIfx+BQ7xQ4wo1SN7y1bZAhUAuBcT
+ZsHbLXlR3uGHLIMg8boUKcCggEAGKgD56/tB6siFr5zEY+RTozPLmbBEcvhz5/p
hAQo7z7ODimZAA1MN1J7Hv7o1S5D9dpZuOnGhiXaN3Z50WdePb9LVH7twrB8v3Xn
ZOEHpumYNcYhvXrIx8LbhnMZmU27xSnrOQF9UfokRxGnXkNmlIwjT0NWqZCqQZwM
wVj1Bgld3YV7CpGTF3aGM6a0pk9LBB71PoczXAx0Cum87ouXXy3c8F/82RF9tgXE
ZBQ+7K2QXYPv9smbYDB+ZlsQ4VTOi3AReG5AeHTVWha3uaSFxY5vKpfau31iMRuT
b1VQ2HVynBpemwhAw4FFvj5dm94aN0Rrvq9BKM09DL4zoOlLogOCAQUAAoIBAE8B
I8z38GdbtswSoSV5JZ9z9cBMj/7x/sHi5ED9v1M8MD6AcxJSbo2cbK98xA3A9U22
6XFHthGReVLa0dyN3Ov+GhBdf8b4CBuebAAS4z8du2EvUFtwDUHorLIo2Qtq2SYR
wpznpB9+3g+z+8GZbzZkdm2mFBKa6GItj82qfEHwxB40aEBx7uQXzM3TH0rV8sMq
u91aAVUQuoiG2/IYWc5O34kKMlHUTt6+uuJiSG0ax8ysWE5XltCfSh/VJcGrzKU6
ZjGBzh8j5+KSXgoe9TuKlsnN5HDCZKaFTCvrxq889HJj0/ks4UrIF+meEyJvDt4P
O4HHoKRtUdLEBMcY0JA=
-----END PUBLIC KEY-----