diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index fdbd29f..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -crlf -diff -merge diff --git a/.gitignore b/.gitignore index f4f0d18..553ea3c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ build/* *.perspective *.perspectivev3 *.xcodeproj/project.xcworkspace/xcuserdata/* +*.xcodeproj/project.xcworkspace/xcshareddata/* *.xcodeproj/xcuserdata/* # old school @@ -22,6 +23,12 @@ disks/* # vim *.swp +# emacs +*~ + rgetSpecific/DotC/Info-DotC.plist -libraries/sdl-mini +disks/ +Packages/ +iUAE/ +roms/ diff --git a/.gitignore.save b/.gitignore.save new file mode 100644 index 0000000..c3b8105 --- /dev/null +++ b/.gitignore.save @@ -0,0 +1,38 @@ +q + + +# XCode noise +build/* +*.pbxuser +*.mode1v3 +*.pyc +*~.nib/ +*.perspective +*.perspectivev3 +*.xcodeproj/project.xcworkspace/xcuserdata/* +*.xcodeproj/project.xcworkspace/xcshareddata/* +*.xcodeproj/xcuserdata/* + +# old school +.svn + +# osx noise +.DS_store +profile + +# iAmiga specific +disks/* + +# vim +*.swp + +# emacs +*~ + +rgetSpecific/DotC/Info-DotC.plist + +disks/ +Packages/ +iUAE/ +roms/ +Submodules/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..54c23a5 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "Submodules/SVProgressHUD"] + path = Submodules/SVProgressHUD + url = https://github.com/TransitApp/SVProgressHUD.git +[submodule "Submodules/STObjCToolbelt"] + path = Submodules/STObjCToolbelt + url = https://github.com/simontoens/STObjCToolbelt diff --git a/Classes/AddConfigurationViewController.h b/Classes/AddConfigurationViewController.h new file mode 100644 index 0000000..2148be0 --- /dev/null +++ b/Classes/AddConfigurationViewController.h @@ -0,0 +1,32 @@ +// Created by Emufr3ak on 31.01.2016 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@protocol AddConfigurationDelegate +- (void)configurationAdded:(NSString *)configurationname; +@end + +@interface AddConfigurationViewController : UITableViewController + +- (IBAction)addConfiguration:(id)sender; +- (IBAction)toggleAddConfiguration:(id)sender; + +@property (readwrite, retain) IBOutlet UIButton *add; +@property (readwrite, retain) IBOutlet UITextField *name; +@property (nonatomic, assign) id delegate; + +@end diff --git a/Classes/AddConfigurationViewController.mm b/Classes/AddConfigurationViewController.mm new file mode 100644 index 0000000..a7509ad --- /dev/null +++ b/Classes/AddConfigurationViewController.mm @@ -0,0 +1,94 @@ +// Created by Emufr3ak on 31.1.2016 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#import "AddConfigurationViewController.h" +#import "Settings.h" + +@interface AddConfigurationViewController () + +@end + +@implementation AddConfigurationViewController { + Settings *settings; + NSMutableArray *configurations; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + [_add setEnabled:false]; + + settings = [[Settings alloc] init]; + + configurations = [[settings arrayForKey:@"configurations"] mutableCopy]; + + if(!configurations) + { + configurations = [[NSMutableArray alloc] init]; + } + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(IBAction)addConfiguration:(id)sender { + if([configurations containsObject:_name.text] || [_name.text isEqual:@"None"]) + { + [[UIAlertView alloc] initWithTitle:@"Configuration Exists" + message:@"Configuration Already exists enter a new Name" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + } + else + { + [configurations addObject:[NSString stringWithString:_name.text]]; + [settings setObject:configurations forKey:@"configurations"]; + [self.navigationController popViewControllerAnimated:YES]; + + if(self.delegate) + { + [self.delegate configurationAdded:_name.text]; + } + } + +} + +-(IBAction)toggleAddConfiguration:(id)sender { + + if(_name.text.length > 0) + { + [_add setEnabled:TRUE]; + } + else + { + [_add setEnabled:FALSE]; + } +} + +-(void)dealloc { + [_add release]; + [_name release]; + [configurations release]; + [settings release]; + [super dealloc]; +} + +#pragma mark - Table view data source + +@end diff --git a/Classes/AdfImporter.h b/Classes/AdfImporter.h new file mode 100644 index 0000000..11e4b96 --- /dev/null +++ b/Classes/AdfImporter.h @@ -0,0 +1,30 @@ +// Created by Simon Toens on 25.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface AdfImporter : NSObject + +/** + * Handles .adf and .zip paths. Intended to be used with the AppDelegate's + * - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation + * method. + */ +- (BOOL)import:(NSString *)path; + +- (BOOL)isDownloadedAdf:(NSString *)path; + +@end \ No newline at end of file diff --git a/Classes/AdfImporter.mm b/Classes/AdfImporter.mm new file mode 100644 index 0000000..3685da4 --- /dev/null +++ b/Classes/AdfImporter.mm @@ -0,0 +1,97 @@ +// Created by Simon Toens on 25.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "AdfImporter.h" +#import "ZipArchive.h" + +static NSString *kAdfExtension = @"adf"; +static NSString *kZipExtension = @"zip"; +static NSString *kAdfsDirectoryName = @"downloadedadfs"; + +@implementation AdfImporter { + @private + NSFileManager *_fileManager; + NSString *_adfsDirectory; +} + +- (instancetype)init { + if (self = [super init]) { + _fileManager = [[NSFileManager defaultManager] retain]; + NSString *docunentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; + _adfsDirectory = [[docunentsDirectory stringByAppendingPathComponent:kAdfsDirectoryName] retain]; + [_fileManager createDirectoryAtPath:_adfsDirectory withIntermediateDirectories:YES attributes:nil error:NULL]; + } + return self; +} + +- (void)dealloc { + [_fileManager release]; + [_adfsDirectory release]; + [super dealloc]; +} + +# pragma mark - Public methods + +- (BOOL)import:(NSString *)path { + BOOL imported = NO; + if ([self isAdf:path]) { + imported = [self importAdf:path]; + } else if ([self isZip:path]) { + imported = [self importZippedAdf:path]; + } else { + imported = NO; + } + if (imported) { + [_fileManager removeItemAtPath:path error:NULL]; + } + return imported; +} + +- (BOOL)isDownloadedAdf:(NSString *)path { + NSString *directory = [path stringByDeletingLastPathComponent]; + return [directory isEqualToString:_adfsDirectory]; +} + +# pragma mark - Private methods + +- (BOOL)importAdf:(NSString *)adfPath { + NSString *adfFileName = [adfPath lastPathComponent]; + NSString *destPath = [_adfsDirectory stringByAppendingPathComponent:adfFileName]; + return [_fileManager copyItemAtPath:adfPath toPath:destPath error:NULL]; +} + +- (BOOL)importZippedAdf:(NSString *)zipPath { + // this does not validate the zip content + ZipArchive *zipArchive = [[ZipArchive alloc] init]; + BOOL unzipOk = [zipArchive UnzipOpenFile:zipPath]; + @try { + unzipOk = unzipOk && [zipArchive UnzipFileTo:_adfsDirectory overWrite:YES]; + } @finally { + [zipArchive UnzipCloseFile]; + } + [zipArchive release]; + return unzipOk; +} + +- (BOOL)isAdf:(NSString *)path { + return [kAdfExtension caseInsensitiveCompare:path.pathExtension] == NSOrderedSame; +} + +- (BOOL)isZip:(NSString *)path { + return [kZipExtension caseInsensitiveCompare:path.pathExtension] == NSOrderedSame; +} + +@end \ No newline at end of file diff --git a/Classes/AudioService.h b/Classes/AudioService.h new file mode 100644 index 0000000..59ef997 --- /dev/null +++ b/Classes/AudioService.h @@ -0,0 +1,36 @@ +// Created by Simon Toens on 04.10.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +/** + * The audio service handles interactions with the sound subsystem. + * + * Note that this class uses the emulator state as source of truth, it does not/should not read configuration. + */ +@interface AudioService : NSObject + +/** + * Sets the emulator volume: 0 = min, 1 = max. + */ +- (void)setVolume:(float)volume; + +/** + * Returns the emulator volume: 0 = min, 1 = max. + */ +- (float)getVolume; + +@end diff --git a/Classes/AudioService.mm b/Classes/AudioService.mm new file mode 100644 index 0000000..b7157e0 --- /dev/null +++ b/Classes/AudioService.mm @@ -0,0 +1,35 @@ +// Created by Simon Toens on 04.10.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "sysconfig.h" +#include "sysdeps.h" +#include "options.h" +#include "fame.h" +#include "audio.h" + +#import "AudioService.h" + +@implementation AudioService + +- (void)setVolume:(float)volume { + set_audio_volume(volume); +} + +- (float)getVolume { + return get_audio_volume(); +} + +@end diff --git a/Classes/CocoaUtility.m b/Classes/CocoaUtility.mm similarity index 100% rename from Classes/CocoaUtility.m rename to Classes/CocoaUtility.mm diff --git a/Classes/Controls/BaseControlsView.m b/Classes/Controls/BaseControlsView.mm similarity index 92% rename from Classes/Controls/BaseControlsView.m rename to Classes/Controls/BaseControlsView.mm index 6c0e891..6809294 100755 --- a/Classes/Controls/BaseControlsView.m +++ b/Classes/Controls/BaseControlsView.mm @@ -14,8 +14,6 @@ #import "ImageJoyButton.h" #import "StaticImage.h" #import "ButtonJoyButton.h" -#import "ButtonMouseButtonRight.h" -#import "ButtonMouseButtonLeft.h" @interface BaseControlsView() - (void)generateLayout; @@ -191,12 +189,6 @@ - (void)generateLayout { if ([type isEqualToString:@"JoyButton"]) { ButtonJoyButton *btn = [ButtonJoyButton buttonWithImage:primaryImage selectedImage:activeImage frame:r]; v = btn; - } else if ([type isEqualToString:@"MouseButtonRight"]) { - ButtonMouseButtonRight *btn = [ButtonMouseButtonRight buttonWithImage:primaryImage selectedImage:activeImage frame:r]; - v = btn; - } else if ([type isEqualToString:@"MouseButtonLeft"]) { - ButtonMouseButtonLeft *btn = [ButtonMouseButtonLeft buttonWithImage:primaryImage selectedImage:activeImage frame:r]; - v = btn; } else if ([type isEqualToString:@"StaticImage"]) { StaticImage *img = [[StaticImage alloc] initWithImage:primaryImage andFrame:r]; [img autorelease]; diff --git a/Classes/Controls/ButtonMouseButtonLeft.h b/Classes/Controls/ButtonMouseButtonLeft.h deleted file mode 100755 index 8d38008..0000000 --- a/Classes/Controls/ButtonMouseButtonLeft.h +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import "BaseLeftRightAwareView.h" - -@interface ButtonMouseButtonLeft : BaseLeftRightAwareView { -} - -+ (ButtonMouseButtonLeft*)buttonWithImage:(UIImage*)image selectedImage:(UIImage*)selectedImage frame:(CGRect)frame; - -@end diff --git a/Classes/Controls/ButtonMouseButtonLeft.m b/Classes/Controls/ButtonMouseButtonLeft.m deleted file mode 100755 index 786b545..0000000 --- a/Classes/Controls/ButtonMouseButtonLeft.m +++ /dev/null @@ -1,37 +0,0 @@ -#import "ButtonMouseButtonLeft.h" -#import "SDL_events.h" -#import "SDL_mouse_c.h" -#import "CocoaUtility.h" - -@implementation ButtonMouseButtonLeft - -#pragma mark - Instance methods - -- (void)touchDown:(id)sender { - SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT); -} - -- (void)touchUp:(id)sender { - SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT); -} - -- (void)dealloc { - [super dealloc]; -} - -#pragma mark - -#pragma mark Class methods - -+ (ButtonMouseButtonLeft*)buttonWithImage:(UIImage*)image selectedImage:(UIImage*)selectedImage frame:(CGRect)frame { - ButtonMouseButtonLeft *b = [[ButtonMouseButtonLeft alloc] initWithFrame:frame]; - - UIButton* btn = [UIButton buttonWithImage:image andSelectedImage:selectedImage]; - btn.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); - [btn addTarget:b action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown]; - [btn addTarget:b action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside]; - [b addSubview:btn]; - - return [b autorelease]; -} - -@end diff --git a/Classes/Controls/ButtonMouseButtonRight.h b/Classes/Controls/ButtonMouseButtonRight.h deleted file mode 100755 index 74fa6a2..0000000 --- a/Classes/Controls/ButtonMouseButtonRight.h +++ /dev/null @@ -1,9 +0,0 @@ -#import -#import "BaseLeftRightAwareView.h" - -@interface ButtonMouseButtonRight : BaseLeftRightAwareView { -} - -+ (ButtonMouseButtonRight*)buttonWithImage:(UIImage*)image selectedImage:(UIImage*)selectedImage frame:(CGRect)frame; - -@end diff --git a/Classes/Controls/ButtonMouseButtonRight.m b/Classes/Controls/ButtonMouseButtonRight.m deleted file mode 100755 index efd0c34..0000000 --- a/Classes/Controls/ButtonMouseButtonRight.m +++ /dev/null @@ -1,37 +0,0 @@ -#import "ButtonMouseButtonRight.h" -#import "SDL_events.h" -#import "SDL_mouse_c.h" -#import "CocoaUtility.h" - -@implementation ButtonMouseButtonRight - -#pragma mark - Instance methods - -- (void)touchDown:(id)sender { - SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_RIGHT); -} - -- (void)touchUp:(id)sender { - SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_RIGHT); -} - -- (void)dealloc { - [super dealloc]; -} - -#pragma mark - -#pragma mark Class methods - -+ (ButtonMouseButtonRight*)buttonWithImage:(UIImage*)image selectedImage:(UIImage*)selectedImage frame:(CGRect)frame { - ButtonMouseButtonRight *b = [[ButtonMouseButtonRight alloc] initWithFrame:frame]; - - UIButton* btn = [UIButton buttonWithImage:image andSelectedImage:selectedImage]; - btn.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); - [btn addTarget:b action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown]; - [btn addTarget:b action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside]; - [b addSubview:btn]; - - return [b autorelease]; -} - -@end diff --git a/Classes/Controls/InputControllProtocol.h b/Classes/Controls/InputControllProtocol.h new file mode 100644 index 0000000..5fac0c7 --- /dev/null +++ b/Classes/Controls/InputControllProtocol.h @@ -0,0 +1,13 @@ +// +// InputControllProtocol.h +// iUAE +// +// Created by Urs on 26.03.16. +// +// + +#import + +@protocol InputControllProtocol +- (void)didPushIOSJoystickButton:(int)buttonid; +@end \ No newline at end of file diff --git a/Classes/Controls/InputController.h b/Classes/Controls/InputController.h new file mode 100644 index 0000000..33dec2f --- /dev/null +++ b/Classes/Controls/InputController.h @@ -0,0 +1,14 @@ +// +// InputController.h +// iUAE +// +// Created by Urs on 26.03.16. +// +// + +#import +#import "InputControllProtocol.h" + +@interface InputController : NSObject +- (void)didPushIOSJoystickButton:(int)buttonid; +@end diff --git a/Classes/Controls/InputController.m b/Classes/Controls/InputController.m new file mode 100644 index 0000000..f83d61e --- /dev/null +++ b/Classes/Controls/InputController.m @@ -0,0 +1,32 @@ +// +// InputController.m +// iUAE +// +// Created by Urs on 26.03.16. +// +// + +#import "InputController.h" + +@implementation InputController + +- (void)didPushIOSJoystickButton:(int)buttonid +{ + /*if([configuredkey isEqualToString:@"Joypad"]) + { + TheJoyStick->setButtonOneState(FireButtonDown); + } + else + { + int asciicode = [[configuredkey stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = (SDLKey)asciicode; + SDL_PushEvent(&ed); + }*/ + +} + +@end + + diff --git a/Classes/Controls/Landscape/DynamicLandscapeControls.mm b/Classes/Controls/Landscape/DynamicLandscapeControls.mm index 49aabf8..124b709 100755 --- a/Classes/Controls/Landscape/DynamicLandscapeControls.mm +++ b/Classes/Controls/Landscape/DynamicLandscapeControls.mm @@ -101,11 +101,9 @@ - (void)createJoystick { [_joystick removeFromSuperview]; [_joystick release]; } - - if (_currentStickClass) { - _joystick = [_currentStickClass isEqual:[MMFixedStickController class]] ? [self fixedJoystick] : [self landscapeJoystick]; - [self addSubview:_joystick]; - } + + _joystick = [_currentStickClass isEqual:[MMFixedStickController class]] ? [self fixedJoystick] : [self landscapeJoystick]; + [self addSubview:_joystick]; } - (void)actionClearButtons { @@ -133,10 +131,6 @@ - (void)setPreferredStick:(NSString*)stickMode { _isFixedOverride = YES; _currentStickClass = [MMFixedStickController class]; [self createJoystick]; - } else if ([stickMode isEqualToString:@"disabled"]) { - _isFixedOverride = YES; - _currentStickClass = Nil; - [self createJoystick]; } else { _isFixedOverride = NO; [self setCurrentStick]; diff --git a/Classes/Controls/Ram-Selected.png b/Classes/Controls/Ram-Selected.png new file mode 100755 index 0000000..18327b9 Binary files /dev/null and b/Classes/Controls/Ram-Selected.png differ diff --git a/Classes/Controls/Ram_Unselected.png b/Classes/Controls/Ram_Unselected.png new file mode 100755 index 0000000..c73d4a1 Binary files /dev/null and b/Classes/Controls/Ram_Unselected.png differ diff --git a/Classes/Controls/StaticImage.m b/Classes/Controls/StaticImage.mm similarity index 100% rename from Classes/Controls/StaticImage.m rename to Classes/Controls/StaticImage.mm diff --git a/Classes/Controls/controller_selected.png b/Classes/Controls/controller_selected.png new file mode 100644 index 0000000..1c486b6 Binary files /dev/null and b/Classes/Controls/controller_selected.png differ diff --git a/Classes/Controls/controller_selected_svg.svg b/Classes/Controls/controller_selected_svg.svg new file mode 100644 index 0000000..4ec15b6 --- /dev/null +++ b/Classes/Controls/controller_selected_svg.svg @@ -0,0 +1,88 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/controller_unselected.png b/Classes/Controls/controller_unselected.png new file mode 100644 index 0000000..269bbe7 Binary files /dev/null and b/Classes/Controls/controller_unselected.png differ diff --git a/Classes/Controls/controller_unselected_svg.svg b/Classes/Controls/controller_unselected_svg.svg new file mode 100644 index 0000000..cc134cc --- /dev/null +++ b/Classes/Controls/controller_unselected_svg.svg @@ -0,0 +1,90 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/display.png b/Classes/Controls/display.png new file mode 100644 index 0000000..7b4772e Binary files /dev/null and b/Classes/Controls/display.png differ diff --git a/Classes/Controls/gamepad.png b/Classes/Controls/gamepad.png new file mode 100644 index 0000000..3c42caa Binary files /dev/null and b/Classes/Controls/gamepad.png differ diff --git a/Classes/Controls/gamepad_selected.png b/Classes/Controls/gamepad_selected.png new file mode 100644 index 0000000..e79e786 Binary files /dev/null and b/Classes/Controls/gamepad_selected.png differ diff --git a/Classes/Controls/gear_selected.png b/Classes/Controls/gear_selected.png new file mode 100644 index 0000000..961358f Binary files /dev/null and b/Classes/Controls/gear_selected.png differ diff --git a/Classes/Controls/gear_selected_svg.svg b/Classes/Controls/gear_selected_svg.svg new file mode 100644 index 0000000..df23840 --- /dev/null +++ b/Classes/Controls/gear_selected_svg.svg @@ -0,0 +1,86 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/gear_unselected.png b/Classes/Controls/gear_unselected.png new file mode 100644 index 0000000..0866ee6 Binary files /dev/null and b/Classes/Controls/gear_unselected.png differ diff --git a/Classes/Controls/gear_unselected_svg.svg b/Classes/Controls/gear_unselected_svg.svg new file mode 100644 index 0000000..dc1adda --- /dev/null +++ b/Classes/Controls/gear_unselected_svg.svg @@ -0,0 +1,83 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/keyboard.png b/Classes/Controls/keyboard.png new file mode 100644 index 0000000..721e44a Binary files /dev/null and b/Classes/Controls/keyboard.png differ diff --git a/Classes/Controls/keyboard_selected.png b/Classes/Controls/keyboard_selected.png new file mode 100644 index 0000000..2ff91a8 Binary files /dev/null and b/Classes/Controls/keyboard_selected.png differ diff --git a/Classes/Controls/keyboard_selected_svg.svg b/Classes/Controls/keyboard_selected_svg.svg new file mode 100644 index 0000000..522632b --- /dev/null +++ b/Classes/Controls/keyboard_selected_svg.svg @@ -0,0 +1,86 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/keyboard_unselected.png b/Classes/Controls/keyboard_unselected.png new file mode 100644 index 0000000..6b48d16 Binary files /dev/null and b/Classes/Controls/keyboard_unselected.png differ diff --git a/Classes/Controls/keyboard_unselected_svg.svg b/Classes/Controls/keyboard_unselected_svg.svg new file mode 100644 index 0000000..9bb90f5 --- /dev/null +++ b/Classes/Controls/keyboard_unselected_svg.svg @@ -0,0 +1,87 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/modejoy.png b/Classes/Controls/modejoy.png new file mode 100755 index 0000000..cbf2a1a Binary files /dev/null and b/Classes/Controls/modejoy.png differ diff --git a/Classes/Controls/modejoypressed.png b/Classes/Controls/modejoypressed.png new file mode 100755 index 0000000..76c6c64 Binary files /dev/null and b/Classes/Controls/modejoypressed.png differ diff --git a/Classes/Controls/modekeyoff.png b/Classes/Controls/modekeyoff.png new file mode 100755 index 0000000..054d141 Binary files /dev/null and b/Classes/Controls/modekeyoff.png differ diff --git a/Classes/Controls/modekeyon.png b/Classes/Controls/modekeyon.png new file mode 100755 index 0000000..f393b0a Binary files /dev/null and b/Classes/Controls/modekeyon.png differ diff --git a/Classes/Controls/monitor_selected.png b/Classes/Controls/monitor_selected.png new file mode 100644 index 0000000..fed53d0 Binary files /dev/null and b/Classes/Controls/monitor_selected.png differ diff --git a/Classes/Controls/monitor_selected_svg.svg b/Classes/Controls/monitor_selected_svg.svg new file mode 100644 index 0000000..220711c --- /dev/null +++ b/Classes/Controls/monitor_selected_svg.svg @@ -0,0 +1,56 @@ + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/monitor_unselected.png b/Classes/Controls/monitor_unselected.png new file mode 100644 index 0000000..98995fa Binary files /dev/null and b/Classes/Controls/monitor_unselected.png differ diff --git a/Classes/Controls/options.png b/Classes/Controls/options.png new file mode 100644 index 0000000..1aadfa2 Binary files /dev/null and b/Classes/Controls/options.png differ diff --git a/Classes/Controls/sticky.png b/Classes/Controls/sticky.png new file mode 100644 index 0000000..c9f0754 Binary files /dev/null and b/Classes/Controls/sticky.png differ diff --git a/Classes/Controls/sticky_selected.png b/Classes/Controls/sticky_selected.png new file mode 100644 index 0000000..7c81f68 Binary files /dev/null and b/Classes/Controls/sticky_selected.png differ diff --git a/Classes/Controls/sticky_selected_svg.svg b/Classes/Controls/sticky_selected_svg.svg new file mode 100644 index 0000000..6f49f5c --- /dev/null +++ b/Classes/Controls/sticky_selected_svg.svg @@ -0,0 +1,78 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/sticky_unselected.png b/Classes/Controls/sticky_unselected.png new file mode 100644 index 0000000..6261d0e Binary files /dev/null and b/Classes/Controls/sticky_unselected.png differ diff --git a/Classes/Controls/sticky_unselected_svg.svg b/Classes/Controls/sticky_unselected_svg.svg new file mode 100644 index 0000000..71059da --- /dev/null +++ b/Classes/Controls/sticky_unselected_svg.svg @@ -0,0 +1,81 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/Classes/Controls/unsticky.png b/Classes/Controls/unsticky.png new file mode 100755 index 0000000..b3c27ef Binary files /dev/null and b/Classes/Controls/unsticky.png differ diff --git a/Classes/CoreSetting.h b/Classes/CoreSetting.h new file mode 100644 index 0000000..6f40567 --- /dev/null +++ b/Classes/CoreSetting.h @@ -0,0 +1,104 @@ +// Created by Simon Toens on 11.05.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "CoreSettingGroup.h" + +//Wrapper Methods for C++ calls +/** + * A special setting (property/switch/toggle) that requires an emulator reset to take effect. For example, the rom being used. + * + * This is an abstract class. + */ +@interface CoreSetting : NSObject + +/** + * Setting instances are singletons - access them using the CoreSettings class methods. + */ +- (instancetype)initWithName:(NSString *)settingName; + +/** + * Updates this setting to the specified value. + */ +- (void)setValue:(id)value; +/** + * Returns the current value of this setting: + * - if an unapplied value exists, returns that + * - otherwise returns the 'applied' current value + */ +- (id)getValue; + +/** + * Returns YES if the setting has a new value, but a reset has not happened yet (ie the value has not taken effect). + */ +- (BOOL)hasUnappliedValue; + +/** + * Returns the message to show when this setting has been modified. + */ +- (NSString *)getModificationDescription; + +@end + +@interface DriveServiceBasedCoreSetting : CoreSetting @end // abstract +@interface DiskDriveEnabledCoreSetting : DriveServiceBasedCoreSetting @end // abstract + +@interface RomCoreSetting : DriveServiceBasedCoreSetting ++ (RomCoreSetting *)getInstance; +@end + +@interface DF1EnabledCoreSetting : DiskDriveEnabledCoreSetting @end +@interface DF2EnabledCoreSetting : DiskDriveEnabledCoreSetting @end +@interface DF3EnabledCoreSetting : DiskDriveEnabledCoreSetting @end +@interface HardDriveBasedCoreSetting : CoreSetting @end // abstract +@interface HD0PathCoreSetting : HardDriveBasedCoreSetting ++ (HD0PathCoreSetting *)getInstance; +@end +@interface HD0ReadOnlyCoreSetting : HardDriveBasedCoreSetting @end +@interface HD0SettingGroup : NSObject @end +@interface NTSCEnabledCoreSetting : CoreSetting @end +@interface CMemCoreSetting : CoreSetting ++ (CMemCoreSetting *) getInstance; +@end +@interface FMemCoreSetting : CoreSetting ++ (FMemCoreSetting *) getInstance; +@end + +/** + * Exposes all CoreSetting singletons, and is the entry point for the reset flow. + */ +@interface CoreSettings : NSObject + +/** + * Notifies that the emulator has been reset. + */ ++ (void)onReset; + +/** + * Available CoreSetting instances: + */ ++ (RomCoreSetting *)romCoreSetting; ++ (DF1EnabledCoreSetting *)df1EnabledCoreSetting; ++ (DF2EnabledCoreSetting *)df2EnabledCoreSetting; ++ (DF3EnabledCoreSetting *)df3EnabledCoreSetting; ++ (HD0PathCoreSetting *)hd0PathCoreSetting; ++ (HD0ReadOnlyCoreSetting *)hd0ReadOnlyCoreSetting; ++ (NTSCEnabledCoreSetting *)ntscEnabledCoreSetting; ++ (CMemCoreSetting *)cmemCoreSetting; + +@end + + diff --git a/Classes/CoreSetting.m b/Classes/CoreSetting.m new file mode 100644 index 0000000..884580f --- /dev/null +++ b/Classes/CoreSetting.m @@ -0,0 +1,783 @@ +// Created by Simon Toens on 11.05.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "CoreSetting.h" +#import "CoreSettingGroup.h" +#import "DiskDriveService.h" +#import "HardDriveService.h" +#import "MultiDictionary.h" +#import "Settings.h" +#import "constSettings.h" +#import "EMUFileInfo.h" +#import "EMUBrowser.h" + +extern unsigned prefs_chipmem_size; +extern unsigned prefs_fastmem_size; + +static RomCoreSetting *_romInstance; +static HD0PathCoreSetting *_hdpathInstance; +static CMemCoreSetting *_cmeminstance; +static FMemCoreSetting *_fmeminstance; + +@interface CoreSettingsRegistry : NSObject + ++ (CoreSettingsRegistry *)sharedRegistry; + +// CoreSetting instance -> the current value associated with that setting instance +@property (nonatomic, readonly) NSMutableDictionary *settingToCurrentValue; + +// CoreSetting instance -> the CoreSettingGroup instance that setting is associated with +// only has an entry if the CoreSetting conforms to the CoreSettingGroupMember protocol +@property (nonatomic, readonly) NSMutableDictionary *settingToGroup; + +// The class name of a CoreSettingGroup -> the single instance of that CoreSettingGroup +@property (nonnull, readonly) NSMutableDictionary *groupClassNameToGroup; + +// The CoreSettingGroup instance -> all CoreSetting instances that are part of it +@property (nonnull, readonly) MultiDictionary *groupToSettings; + +@end + +/** + * Method names starting with "hook_" are meant to be implemented by subclasses. + */ +@implementation CoreSetting { + @protected + CoreSettingsRegistry *_registry; + NSString *_settingName; + + @protected + Settings *_settings; +} + +/** + * Persists the given setting value. Subclasses must implement. + */ +- (void)hook_persistValue:(id)value { + [NSException raise:@"Subclasses must implement" format:@"%@", NSStringFromSelector(_cmd)]; +} + +/** + * Returns the current value of this setting as far as the emulator is concerned. Subclasses must implement. + */ +- (id)hook_getEmulatorValue { + [NSException raise:@"Subclasses must implement" format:@"%@", NSStringFromSelector(_cmd)]; + return nil; +} + +/** + * The NSString returned here is prepended to the message that describes the configuration change made by + * changing this CoreSetting's value. + * + * For example: + * [Changing the ROM] requires resetting the emulator to take effect. + * + * or: + * [Disabling a drive] requires resetting the emulator to take effect. + * + * Subclasses must implement. + */ +- (NSString *)hook_getActionDescription { + [NSException raise:@"Subclasses must implement" format:@"%@", NSStringFromSelector(_cmd)]; + return nil; +} + +/** + * Callback where subclasses can run custom logic when the emulator is reset. Subclasses may implement. + * + * This method is only called if hasUnappliedValue returns YES for this setting instance. + */ +- (void)hook_onReset:(id)value { + +} + +- (instancetype)initWithName:(NSString *)settingName { + if (self = [super init]) { + _registry = [CoreSettingsRegistry sharedRegistry]; + _settings = [[Settings alloc] init]; + _settingName = [settingName retain]; + + if ([[self class] conformsToProtocol:@protocol(CoreSettingGroupMember)]) { + [self initializeGroup]; + } + } + return self; +} + +- (void)initializeGroup { + Class groupClass = [((id)self) getGroup]; + NSString *groupClassName = NSStringFromClass(groupClass); + id group = [_registry.groupClassNameToGroup objectForKey:groupClassName]; + if (!group) { + group = [[[groupClass alloc] init] autorelease]; + [_registry.groupClassNameToGroup setObject:group forKey:groupClassName]; + } + [_registry.settingToGroup setObject:group forKey:self]; + [_registry.groupToSettings setObject:self forKey:group]; +} + +- (void)setValue:(id)value { + id currentValue = [self hook_getEmulatorValue]; + id unappliedValue = [self getUnappliedValue]; + BOOL valueIsDifferentFromPreviousValue = NO; + if ([self eq:currentValue to:value]) { + [_registry.settingToCurrentValue removeObjectForKey:self]; + valueIsDifferentFromPreviousValue = unappliedValue != nil; + } else { + valueIsDifferentFromPreviousValue = YES; + [_registry.settingToCurrentValue setObject:value ? value : [NSNull null] forKey:self]; + } + + if (valueIsDifferentFromPreviousValue) { + [self hook_persistValue:value]; + } +} + +- (id)getValue { + id value = [self getUnappliedValue]; + if (value) { + return value == [NSNull null] ? nil : value; + } + return [self hook_getEmulatorValue]; +} + +- (BOOL)hasUnappliedValue { + + return [self getUnappliedValue] != nil; +} + +- (NSString *)getModificationDescription { + return [NSString stringWithFormat:@"%@ requires resetting the emulator to take effect", [self hook_getActionDescription]]; +} + +- (id)copyWithZone:(nullable NSZone *)zone { + return [self retain]; +} + +- (NSString *)description { + return _settingName; +} + +- (BOOL)eq:(id)thing1 to:(id)thing2 { + if (thing1 == thing2) return YES; + if (!thing1 && thing2 == [NSNull null]) return YES; + if (thing1 == [NSNull null] && !thing2) return YES; + return [thing1 isEqual:thing2]; +} + +- (NSString *)getUnappliedValue { + [NSException raise:@"Subclasses must implement" format:@"%@", NSStringFromSelector(_cmd)]; + return nil; +} + +- (void)dealloc { + [_settingName release]; + [_settings release]; + [super dealloc]; +} + +@end + +@implementation DriveServiceBasedCoreSetting { + @protected + DiskDriveService *_diskDriveService; +} + +- (instancetype)initWithName:(NSString *)settingName { + if ([super initWithName:settingName]) { + _diskDriveService = [[DiskDriveService alloc] init]; + } + return self; +} + +- (void)dealloc { + [_diskDriveService release]; + [super dealloc]; +} + +@end + +@implementation RomCoreSetting + ++ (RomCoreSetting *)getInstance { + return _romInstance; +} + +- (instancetype)initWithName:(NSString *)settingName { + self = [super initWithName:settingName]; + + [self initromPath]; + _romInstance = self; + return self; +} + +- (void)initromPath { + Settings *settings = [[[Settings alloc] init] autorelease]; + EMUBrowser *browser = [[[EMUBrowser alloc] init] autorelease]; + NSString *romPath = settings.romPath; + if (romPath) { + if (![[NSFileManager defaultManager] fileExistsAtPath:romPath]) { + EMUFileInfo *fileInfo = [browser getFileInfoForFileName:[romPath lastPathComponent]]; + romPath = fileInfo ? fileInfo.path : nil; + } + } + if (!romPath) { + NSArray *romNameFilters = @[@"kick.rom", @"kick13.rom"]; + for (NSString *romNameFilter in romNameFilters) { + EMUFileInfo *fileInfo = [browser getFileInfoForFileName:romNameFilter]; + if (fileInfo) { + romPath = fileInfo.path; + break; + } + } + } + + settings.romPath = romPath; +} + +- (NSString *)hook_getActionDescription { + return @"Change"; +} + +- (void)hook_persistValue:(NSString *)romPath { + _settings.romPath = romPath; +} + +- (void)hook_onReset:(NSString *)romPath { + [_diskDriveService configureRom:romPath]; +} + +- (NSString *)hook_getEmulatorValue { + + if([_diskDriveService getRomPath]) + { + NSString *romPath = [[NSString alloc] initWithString:[_diskDriveService getRomPath]]; + return romPath; + } + else + { + return nil; + } +} + +- (NSString *)getUnappliedValue { + + if(!_settings.romPath) [self initromPath]; + + NSString *curRompath = _settings.romPath; + + NSString *actRompath = [self hook_getEmulatorValue]; + + NSString *curRomfile = [[curRompath lastPathComponent] stringByDeletingPathExtension]; + NSString *actRomfile = [[actRompath lastPathComponent] stringByDeletingPathExtension]; + + if([curRomfile isEqualToString:actRomfile] || !(curRomfile)) { + return nil; + } + else { + [self initromPath]; + NSString *fixedPath = [[NSString alloc] initWithString:_settings.romPath]; + return fixedPath; + } + +} + +@end + +@implementation CMemCoreSetting { + int _actcmem; +} + ++ (CMemCoreSetting *)getInstance { + return _cmeminstance; +} + +- (instancetype)initWithName:(NSString *)settingName { + self = [super initWithName:settingName]; + + _cmeminstance = self; + _actcmem = _settings.CMem; + + return self; +} + +- (NSString *)hook_getActionDescription { + return @"Change"; +} + +- (void)hook_persistValue:(NSNumber *)cmem { + //Round to multiple of 512 + + _settings.CMem = [cmem integerValue]; +} + +- (void)hook_onReset:(NSNumber *)cmem { + prefs_chipmem_size = _settings.CMem * 1024; + _actcmem = _settings.CMem; +} + +- (NSNumber *)hook_getEmulatorValue { + return [NSNumber numberWithInt:_actcmem]; +} + +- (NSString *)getUnappliedValue { + + int curcmem = _settings.CMem; + int actcmem = [[self hook_getEmulatorValue] integerValue]; + + if(curcmem == actcmem) { + return nil; + } + else { + NSString *scurcmem = [NSString stringWithFormat:@"%i", curcmem]; + return scurcmem; + } + +} + +@end + +@implementation FMemCoreSetting { + int _actfmem; +} + ++ (FMemCoreSetting *)getInstance { + return _fmeminstance; +} + +- (instancetype)initWithName:(NSString *)settingName { + + self = [super initWithName:settingName]; + _actfmem = _settings.FMem; + + _fmeminstance = self; + + return self; +} + +- (NSString *)hook_getActionDescription { + return @"Change"; +} + +- (void)hook_persistValue:(NSNumber *)fmem { + _settings.FMem = [fmem integerValue]; +} + +- (void)hook_onReset:(NSNumber *)cmem { + prefs_fastmem_size = _settings.FMem * 1024 * 1024; + _actfmem = _settings.FMem; +} + +- (NSNumber *)hook_getEmulatorValue { + return [NSNumber numberWithInt:_actfmem]; +} + +- (NSString *)getUnappliedValue { + + int curfmem = _settings.FMem; + int actfmem = [[self hook_getEmulatorValue] integerValue]; + + if(curfmem == actfmem) { + return nil; + } + else { + NSString *scurfmem = [NSString stringWithFormat:@"%i", curfmem]; + return scurfmem; + } + +} + +@end + +@implementation DiskDriveEnabledCoreSetting + +- (NSString *)hook_getActionDescription { + BOOL enabled = [[self getValue] boolValue]; + return enabled ? @"Enabling" : @"Disabling"; +} + +- (void)hook_persistValue:(NSNumber *)enabled { + DriveState *driveState = _settings.driveState; + [self hook_setEnabled:[enabled boolValue] onDriveState:driveState]; + _settings.driveState = driveState; +} + +- (NSNumber *)hook_getEmulatorValue { + DriveState *driveState = [_diskDriveService getDriveState]; + return [NSNumber numberWithBool:[self hook_getEnabledFromDriveState:driveState]]; +} + +- (BOOL)hook_getEnabledFromDriveState:(DriveState *)driveState { + [NSException raise:@"Subclasses must implement" format:@"%@", NSStringFromSelector(_cmd)]; + return NO; +} + +- (void)hook_setEnabled:(BOOL)enabled onDriveState:(DriveState *)driveState { + [NSException raise:@"Subclasses must implement" format:@"%@", NSStringFromSelector(_cmd)]; +} + +- (NSString *)getUnappliedValue { + return [_registry.settingToCurrentValue objectForKey:self]; +} + +@end + +@implementation DF1EnabledCoreSetting + +- (BOOL)hook_getEnabledFromDriveState:(DriveState *)driveState { + return driveState.df1Enabled; +} + +- (void)hook_setEnabled:(BOOL)enabled onDriveState:(DriveState *)driveState { + [driveState setDf1Enabled:enabled]; +} + +- (NSString *)getUnappliedValue { + return [_registry.settingToCurrentValue objectForKey:self]; +} + +@end + +@implementation DF2EnabledCoreSetting + +- (BOOL)hook_getEnabledFromDriveState:(DriveState *)driveState { + return driveState.df2Enabled; +} + +- (void)hook_setEnabled:(BOOL)enabled onDriveState:(DriveState *)driveState { + [driveState setDf2Enabled:enabled]; +} + +- (NSString *)getUnappliedValue { + return [_registry.settingToCurrentValue objectForKey:self]; +} + +@end + +@implementation DF3EnabledCoreSetting + +- (BOOL)hook_getEnabledFromDriveState:(DriveState *)driveState { + return driveState.df3Enabled; +} + +- (void)hook_setEnabled:(BOOL)enabled onDriveState:(DriveState *)driveState { + [driveState setDf3Enabled:enabled]; +} + +- (NSString *)getUnappliedValue { + return [_registry.settingToCurrentValue objectForKey:self]; +} + +@end + +@implementation HardDriveBasedCoreSetting { + @protected + HardDriveService *_hardDriveService; +} + +- (instancetype)initWithName:(NSString *)settingName { + if ([super initWithName:settingName]) { + _hardDriveService = [[HardDriveService alloc] init]; + } + return self; +} + +- (void)dealloc { + [_hardDriveService release]; + [super dealloc]; +} + +@end + +@implementation HD0PathCoreSetting + ++ (HD0PathCoreSetting *)getInstance { + return _hdpathInstance; +} + +- (instancetype)initWithName:(NSString *)settingName { + self = [super initWithName:settingName]; + + [self initHD0Path]; + _hdpathInstance = self; + return self; +} + +- (void)initHD0Path { + Settings *settings = [[[Settings alloc] init] autorelease]; + EMUBrowser *browser = [[[EMUBrowser alloc] init] autorelease]; + NSString *hdPath = settings.hardfilePath; + if (hdPath) { + if (![[NSFileManager defaultManager] fileExistsAtPath:hdPath]) { + EMUFileInfo *fileInfo = [browser getFileInfoForFileName:[hdPath lastPathComponent]]; + hdPath = fileInfo ? fileInfo.path : nil; + } + } + + settings.hardfilePath = hdPath; + [_hardDriveService unmountHardfile]; +} + +- (void)hook_persistValue:(NSString *)hd0Path { + _settings.hardfilePath = hd0Path; +} + +- (NSString *)hook_getEmulatorValue { + return [_hardDriveService getMountedHardfilePath]; +} + +- (NSString *)hook_getActionDescription { + NSString *hdfpath = [self getValue]; + return hdfpath ? @"Mounting" : @"Unmounting"; +} + +- (NSString *)getUnappliedValue { + + NSString *curHD0Path = _settings.hardfilePath; + NSString *actHD0path = [self hook_getEmulatorValue]; + + if([curHD0Path isEqualToString:actHD0path]) { + return nil; + } + else { + [self initHD0Path]; + curHD0Path = _settings.hardfilePath; + return curHD0Path; + } + +} + +- (Class)getGroup { + return HD0SettingGroup.self; +} + +@end + +@implementation HD0ReadOnlyCoreSetting + +- (void)hook_persistValue:(NSNumber *)hd0ReadOnly { + _settings.hardfileReadOnly = [hd0ReadOnly boolValue]; +} + +- (NSNumber *)hook_getEmulatorValue { + BOOL readOnly = [_hardDriveService readOnly]; + return [NSNumber numberWithBool:readOnly]; +} + +- (NSString *)hook_getActionDescription { + BOOL readOnly = [[self getValue] boolValue]; + return [NSString stringWithFormat:@"Mounting as %@", readOnly ? @"read-only" : @"read-write"]; +} + +- (NSString *)getUnappliedValue { + + //No HD File Selected means this setting is irrelevant + if(![_hdpathInstance getValue]) + { + return nil; + } + + BOOL bcurValue = _settings.hardfileReadOnly; + NSNumber *nactValue = [self hook_getEmulatorValue]; + BOOL bactValue = [nactValue boolValue]; + + if(bcurValue == bactValue) { + return nil; + } + else { + NSString *scurValue = [NSString stringWithFormat:@"%i", bcurValue]; + return scurValue; + } + + return [_registry.settingToCurrentValue objectForKey:self]; +} + +- (Class)getGroup { + return HD0SettingGroup.self; +} + +@end + +@implementation HD0SettingGroup { + @private + HardDriveService *_hardDriveService; +} + +- (instancetype)init { + if (self = [super init]) { + _hardDriveService = [[HardDriveService alloc] init]; + } + return self; +} + +- (void)dealloc { + [_hardDriveService release]; + [super dealloc]; +} + +- (void)onResetAfterMembers:(NSSet *)groupMembers { + NSString *hd0Path = [[HD0PathCoreSetting getInstance] getValue]; + if ([_hardDriveService mounted]) { + [_hardDriveService unmountHardfile]; + } + if (hd0Path) { + BOOL readOnly = [[[CoreSettings hd0ReadOnlyCoreSetting] getValue] boolValue]; + [_hardDriveService mountHardfile:hd0Path asReadOnly:readOnly]; + } +} + +- (id)copyWithZone:(nullable NSZone *)zone { + return self; +} + +@end + +extern int mainMenu_ntsc; + +@implementation NTSCEnabledCoreSetting + +- (NSString *)hook_getActionDescription { + BOOL enabled = [[self getValue] boolValue]; + return [NSString stringWithFormat:@"%@ NTSC", enabled ? @"Enabling" : @"Disabling"]; +} + +- (void)hook_persistValue:(NSNumber *)enabled { + _settings.ntsc = [enabled boolValue]; +} + +- (void)hook_onReset:(NSNumber *)enabled { + mainMenu_ntsc = [enabled intValue]; +} + +- (NSNumber *)hook_getEmulatorValue { + return [NSNumber numberWithInt:mainMenu_ntsc]; +} + +- (NSString *)getUnappliedValue { + + BOOL bcurNtsc = _settings.ntsc; + NSNumber *ncurNtsc = [self hook_getEmulatorValue]; + BOOL bactNtsc = [ncurNtsc boolValue]; + + if(bcurNtsc == bactNtsc) { + return nil; + } + else { + NSString *scurNTSC = [NSString stringWithFormat:@"%i", bcurNtsc]; + return scurNTSC; + } + +} + +@end + +@implementation CoreSettingsRegistry + ++ (CoreSettingsRegistry *)sharedRegistry { + static CoreSettingsRegistry *registry = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + registry = [[CoreSettingsRegistry alloc] init]; + }); + return registry; +} + +- (instancetype)init { + if (self = [super init]) { + _settingToCurrentValue = [[NSMutableDictionary alloc] init]; + _settingToGroup = [[NSMutableDictionary alloc] init]; + _groupClassNameToGroup = [[NSMutableDictionary alloc] init]; + _groupToSettings = [[MultiDictionary alloc] init]; + } + return self; +} + +@end + +@implementation CoreSettings + ++ (void)onReset { + CoreSettingsRegistry *reg = [CoreSettingsRegistry sharedRegistry]; + NSMutableDictionary *sToV = reg.settingToCurrentValue; + NSMutableSet *settingsBeingReset = [NSMutableSet setWithCapacity:[sToV count]]; + for (CoreSetting *setting in sToV.keyEnumerator) { + id unappliedValue = [sToV objectForKey:setting]; + if (unappliedValue) { + [setting hook_onReset:unappliedValue == [NSNull null] ? nil : unappliedValue]; + } + [settingsBeingReset addObject:setting]; + } + + NSMutableSet *handledGroups = [[[NSMutableSet alloc] init] autorelease]; + for (CoreSetting *setting in sToV.keyEnumerator) { + id group = [reg.settingToGroup objectForKey:setting]; + if (group && ![handledGroups containsObject:group]) { + [handledGroups addObject:group]; + NSMutableSet *groupedSettings = [NSMutableSet setWithSet:[reg.groupToSettings objectsForKey:group]]; + [groupedSettings intersectSet:settingsBeingReset]; + [group onResetAfterMembers:groupedSettings]; + } + } + + [sToV removeAllObjects]; +} + ++ (DF1EnabledCoreSetting *)df1EnabledCoreSetting { + static DF1EnabledCoreSetting *setting = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + setting = [[DF1EnabledCoreSetting alloc] initWithName:@"DF1Enabled"]; + }); + return setting; +} + ++ (DF2EnabledCoreSetting *)df2EnabledCoreSetting { + static DF2EnabledCoreSetting *setting = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + setting = [[DF2EnabledCoreSetting alloc] initWithName:@"DF2Enabled"]; + }); + return setting; +} + ++ (DF3EnabledCoreSetting *)df3EnabledCoreSetting { + static DF3EnabledCoreSetting *setting = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + setting = [[DF3EnabledCoreSetting alloc] initWithName:@"DF3Enabled"]; + }); + return setting; +} + ++ (HD0ReadOnlyCoreSetting *)hd0ReadOnlyCoreSetting { + static HD0ReadOnlyCoreSetting *setting = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + setting = [[HD0ReadOnlyCoreSetting alloc] initWithName:@"HD0ReadOnlyWrite"]; + }); + return setting; +} + ++ (NTSCEnabledCoreSetting *)ntscEnabledCoreSetting { + static NTSCEnabledCoreSetting *setting = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + setting = [[NTSCEnabledCoreSetting alloc] initWithName:@"NTSCEnabled"]; + }); + return setting; +} + +@end diff --git a/Classes/CoreSettingGroup.h b/Classes/CoreSettingGroup.h new file mode 100644 index 0000000..98f013e --- /dev/null +++ b/Classes/CoreSettingGroup.h @@ -0,0 +1,40 @@ +// Created by Simon Toens on 08.17.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +/** + * A CoreSettingGroup receives lifecycle callbacks for a group of related CoreSettings. + * + * Protocol adopters must provide an implementation for - (id)copyWithZone:(nullable NSZone *)zone + */ +@protocol CoreSettingGroup + +/** + * Called after all CoreSetting instances that are part of this group have been reset. + */ +- (void)onResetAfterMembers:(NSSet *)groupMembers; + +@end + +/** + * CoreSetting instances that are part of a CoreSettingGroup must adopt this protocol. + */ +@protocol CoreSettingGroupMember + +- (Class)getGroup; + +@end diff --git a/Classes/DiskDriveService.h b/Classes/DiskDriveService.h new file mode 100644 index 0000000..678cf5d --- /dev/null +++ b/Classes/DiskDriveService.h @@ -0,0 +1,82 @@ +// Created by Simon Toens on 19.06.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "DriveState.h" + +/** + * The disk drive service handles interactions with the disk drives. Also has some rom related logic. + * + * Note that this class uses the emulator state as source of truth, it does not/should not read configuration. + */ +@interface DiskDriveService : NSObject + +/** + * Returns the adf path for the specified drive (df[0], df[1] ...), nil if no disk is inserted in the specified drive. + */ +- (NSString *)getInsertedDiskForDrive:(int)driveNumber; + +/** + * Inserts the specified adf into the specified drive (df[0], df[1] ...). + */ +- (void)insertDisk:(NSString *)adfPath intoDrive:(int)driveNumber; + +/** + * Inserts the specified adfs into the drives corresponding to the adfs' positions in the array: adf at position 0 -> df0, adf at position 1 -> df1 ... + */ +- (void)insertDisks:(NSArray *)adfPaths; + +/** + * Ejects the disk from the specified drive number. + */ +- (void)ejectDiskFromDrive:(NSUInteger)driveNumber; + +/** + * Returns YES if a disk is currently inserted into the specified drive, NO otherwise. + */ +- (BOOL)diskInsertedIntoDrive:(NSUInteger)driveNumber; + +/** + * Returns YES if the specified is enabled, NO otherwise. + */ +- (BOOL)enabled:(NSUInteger)driveNumber; + +/** + * Enables/disables the specified drive. + */ +- (void)enableDrive:(NSUInteger)driveNumber enable:(BOOL)enable; + +/** + * Returns a DriveState instance that has enabled/disabled information for all drives. + */ +- (DriveState *)getDriveState; + +/** + * Enables/disables drives as specified in the given driveState instance. + */ +- (void)setDriveState:(DriveState *)driveState; + +/** + * Returns the path of the rom file the emulator is currently using. + */ +- (NSString *)getRomPath; + +/** + * Configures the emulator to use the speficied rom. + */ +- (void)configureRom:(NSString *)romPath; + +@end \ No newline at end of file diff --git a/Classes/DiskDriveService.mm b/Classes/DiskDriveService.mm new file mode 100644 index 0000000..59c48b3 --- /dev/null +++ b/Classes/DiskDriveService.mm @@ -0,0 +1,136 @@ +// Created by Simon Toens on 19.06.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "uae.h" +#import "sysconfig.h" +#import "sysdeps.h" +#import "options.h" +#import "memory.h" +#import "zfile.h" +#import "DiskDriveService.h" + +@implementation DiskDriveService + +- (NSString *)getInsertedDiskForDrive:(int)driveNumber { + if (driveNumber < NUM_DRIVES) + { + + NSString *adfPath = [NSString stringWithCString:changed_df[driveNumber] encoding:[NSString defaultCStringEncoding]]; + return [adfPath length] == 0 ? nil : adfPath; + } + return nil; +} + +- (void)insertDisk:(NSString *)adfPath intoDrive:(int)driveNumber { + if (driveNumber < NUM_DRIVES) + { + [adfPath getCString:changed_df[driveNumber] maxLength:256 encoding:[NSString defaultCStringEncoding]]; + real_changed_df[driveNumber] = 1; + } +} + +- (void)insertDisks:(NSArray *)adfPaths { + for (int driveNumber = 0; driveNumber < [adfPaths count]; driveNumber++) + { + if (driveNumber < NUM_DRIVES) + { + NSString *adfPath = [adfPaths objectAtIndex:driveNumber]; + if ([adfPath length] == 0) { + continue; // placeholder item + } + if ([[NSFileManager defaultManager] fileExistsAtPath:adfPath isDirectory:NULL]) { + [self insertDisk:adfPath intoDrive:driveNumber]; + } else { + // it is possible that the stored adf path is no longer valid - this often happens + // during debugging. If that's the case, don't even attempt to insert the floppy + NSLog(@"adf does not exist: %@", adfPath); + } + } + else + { + break; + } + } +} + +- (void)ejectDiskFromDrive:(NSUInteger)driveNumber { + if (driveNumber < NUM_DRIVES) + { + changed_df[driveNumber][0] = 0; + real_changed_df[driveNumber] = 1; + } +} + +- (BOOL)diskInsertedIntoDrive:(NSUInteger)driveNumber { + if (driveNumber < NUM_DRIVES) + { + return changed_df[driveNumber][0] != 0; + } + return NO; +} + +- (BOOL)enabled:(NSUInteger)driveNumber { + if (driveNumber < NUM_DRIVES) + { + return (disabled & (1 << driveNumber)) == 0; + } + return NO; +} + +- (void)enableDrive:(NSUInteger)driveNumber enable:(BOOL)enable { + if (driveNumber < NUM_DRIVES) { + if (enable && ![self enabled:driveNumber]) + { + disabled -= (1 << driveNumber); + } else if (!enable && [self enabled:driveNumber]) + { + disabled += (1 << driveNumber); + } + } +} + +- (DriveState *)getDriveState { + DriveState *driveState = [[[DriveState alloc] init] autorelease]; + driveState.df1Enabled = [self enabled:1]; + driveState.df2Enabled = [self enabled:2]; + driveState.df3Enabled = [self enabled:3]; + return driveState; +} + +- (void)setDriveState:(DriveState *)driveState { + if (NUM_DRIVES > 1) { + [self enableDrive:1 enable:driveState.df1Enabled]; + } + if (NUM_DRIVES > 2) { + [self enableDrive:2 enable:driveState.df2Enabled]; + } + if (NUM_DRIVES > 3) { + [self enableDrive:3 enable:driveState.df3Enabled]; + } +} + +- (NSString *)getRomPath { + NSString *romPath = [NSString stringWithCString:romfile encoding:[NSString defaultCStringEncoding]]; + return [romPath length] == 0 ? nil : romPath; +} + +- (void)configureRom:(NSString *)romPath { + [romPath getCString:romfile maxLength:sizeof(romfile) encoding:[NSString defaultCStringEncoding]]; + bReloadKickstart = 1; + uae4all_rom_reinit(); +} + +@end diff --git a/Classes/DriveState.h b/Classes/DriveState.h new file mode 100644 index 0000000..292c13b --- /dev/null +++ b/Classes/DriveState.h @@ -0,0 +1,35 @@ +// Created by Simon Toens on 10.07.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +/** + * Tracks enabled/disabled state of drives. + * + * This is a convenience class to group the state of all drives in one place - updating the properties does not affect the actual drive states! + */ +@interface DriveState : NSObject + +/** + * Returns a DriveState instace with all drives enabled. + */ ++ (DriveState *)getAllEnabled; + +@property (nonatomic, assign) BOOL df1Enabled; +@property (nonatomic, assign) BOOL df2Enabled; +@property (nonatomic, assign) BOOL df3Enabled; + +@end \ No newline at end of file diff --git a/Classes/DriveState.m b/Classes/DriveState.m new file mode 100644 index 0000000..a2a9fd2 --- /dev/null +++ b/Classes/DriveState.m @@ -0,0 +1,29 @@ +// Created by Simon Toens on 10.07.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "DriveState.h" + +@implementation DriveState + ++ (DriveState *)getAllEnabled { + DriveState *driveState = [[[DriveState alloc] init] autorelease]; + driveState.df1Enabled = YES; + driveState.df2Enabled = YES; + driveState.df3Enabled = YES; + return driveState; +} + +@end \ No newline at end of file diff --git a/Classes/EmulationViewController.h b/Classes/EmulationViewController.h index c0d743c..f11d443 100644 --- a/Classes/EmulationViewController.h +++ b/Classes/EmulationViewController.h @@ -20,7 +20,6 @@ #import @class InputControllerView; -@class JoystickViewLandscape; @class VirtualKeyboard; @class TouchHandlerView; @protocol DisplayViewSurface; @@ -63,9 +62,6 @@ typedef enum { // Views: portrait - // Views: landscape - JoystickViewLandscape *landscapeJoystickView; - // Emulator uae *emulator; NSThread *emulationThread; @@ -86,8 +82,6 @@ typedef enum { @property (nonatomic, retain) InputControllerView *inputController; @property (nonatomic, retain) TouchHandlerView *touchHandler; -@property (nonatomic, retain) JoystickViewLandscape *landscapeJoystickView; - @property (nonatomic) BOOL integralSize; diff --git a/Classes/EmulationViewController.mm b/Classes/EmulationViewController.mm index 6dfb9cd..c320bc1 100644 --- a/Classes/EmulationViewController.mm +++ b/Classes/EmulationViewController.mm @@ -21,7 +21,6 @@ #import "debug.h" #import "InputControllerView.h" #import "uae.h" -#import "JoystickViewLandscape.h" #import "CocoaUtility.h" #import "VirtualKeyboard.h" #import "TouchHandlerView.h" @@ -50,7 +49,6 @@ - (void)makeTabBarHidden:(BOOL)hide; #define kDisplayWidth 320.0f #define kDisplayHeight 240.0f -const float kDisplayRatio = (kDisplayHeight / kDisplayWidth); #define kInputFramePortrait CGRectMake(0, 0, 320.0f * S_PSCALE, 480.0f * S_PSCALE) @@ -64,7 +62,6 @@ @implementation EmulationViewController @synthesize emulator, emulatorState; @synthesize displayView, inputController; -@synthesize landscapeJoystickView; @synthesize touchHandler; @synthesize displayViewWindow; @synthesize integralSize=_integralSize; @@ -95,7 +92,6 @@ - (void)loadView { _integralSize = NO; g_emulatorViewController = self; - self.wantsFullScreenLayout = YES; self.hidesBottomBarWhenPushed = YES; self.emulatorState = EmulatorNotStarted; @@ -198,8 +194,6 @@ - (CGRect)currentDisplayFrame { if (_integralSize) { CGRect aFrame; - CGFloat scale; - CGFloat frameWidth; if (UIInterfaceOrientationIsLandscape(layoutOrientation)) { aFrame = CGRectMake(0, 0, frameSize.width, frameSize.height); // width is larger than height diff --git a/Classes/JoystickViewLandscape.h b/Classes/File Browser/DiskAssociationViewController.h similarity index 64% rename from Classes/JoystickViewLandscape.h rename to Classes/File Browser/DiskAssociationViewController.h index f6e5f94..1bb0d0e 100644 --- a/Classes/JoystickViewLandscape.h +++ b/Classes/File Browser/DiskAssociationViewController.h @@ -18,13 +18,21 @@ */ #import -#import "InputControllerView.h" +#import "SelectConfigurationViewController.h" -@interface JoystickViewLandscape : UIView { - UIImageView *arrows; - UIImageView *arrowDirection; - UIImageView *stickCentre; - BOOL tracking; +@class EMUFileInfo; + + +@interface DiskAssocationViewController : UITableViewController { + NSArray *roms; + int selectedRow; + NSArray *indexTitles; + NSIndexPath *selectedIndexPath; + id context; } +@property (nonatomic, retain) NSArray *roms, *indexTitles; +@property (nonatomic, retain) NSIndexPath *selectedIndexPath; +@property (nonatomic, retain) id context; + @end diff --git a/Classes/File Browser/DiskAssociationViewController.mm b/Classes/File Browser/DiskAssociationViewController.mm new file mode 100644 index 0000000..85638f7 --- /dev/null +++ b/Classes/File Browser/DiskAssociationViewController.mm @@ -0,0 +1,246 @@ +/* + Frodo, Commodore 64 emulator for the iPhone + Copyright (C) 2007, 2008 Stuart Carnie + See gpl.txt for license information. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#import "DiskAssociationViewController.h" +#import "EMUBrowser.h" +#import "EMUFileInfo.h" +#import "EMUFileGroup.h" +#import "Settings.h" + +@implementation DiskAssocationViewController { + NSString *disktoassociate; + Settings *settings; +} + +@synthesize roms, selectedIndexPath, indexTitles, context; + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { + // Initialization code + } + return self; +} + +- (void)viewDidLoad { + + settings = [[Settings alloc] init]; + self.title = @"Browser"; + + self.indexTitles = [NSArray arrayWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", + @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", + @"W", @"X", @"Y", @"Z", @"#", nil]; + + NSMutableArray *sections = [[NSMutableArray alloc] init]; + for (int i = 0; i < 26; i++) { + unichar c = i+65; + EMUFileGroup *g = [[EMUFileGroup alloc] initWithSectionName:[NSString stringWithFormat:@"%c", c]]; + [sections addObject:g]; + } + [sections addObject:[[EMUFileGroup alloc] initWithSectionName:@"#"]]; + + EMUBrowser *browser = [[EMUBrowser alloc] init]; + NSArray *files = [browser getAdfFileInfos]; + for (EMUFileInfo* f in files) { + unichar c = [[f fileName] characterAtIndex:0]; + if (isdigit(c)) { + EMUFileGroup *g = (EMUFileGroup*)[sections objectAtIndex:26]; + [g.files addObject:f]; + } else { + c = toupper(c) - 65; + EMUFileGroup *g = (EMUFileGroup*)[sections objectAtIndex:c]; + [g.files addObject:f]; + } + } + [browser release]; + self.roms = sections; +} + +- (void)viewDidAppear:(BOOL)animated { +// if (!prefs) +// prefs = new Prefs(); +// +// prefs->Load(Frodo::prefs_path()); +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { + // Return YES for supported orientations + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview + // Release anything that's not essential, such as cached data +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return self.roms.count; +} + +- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { + return indexTitles; +} + +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:section]; + return g.sectionName; +} + +- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index { + unichar c = [title characterAtIndex:0]; + if (c > 64 && c < 91) + return c - 65; + + return 26; +} + +- (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section { + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:section]; + return g.files.count; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + /*if (indexPath == selectedIndexPath) + return; + UITableViewCell *cell = [tableView cellForRowAtIndexPath:self.selectedIndexPath]; + + + cell.accessoryType = UITableViewCellAccessoryNone; + + cell = [tableView cellForRowAtIndexPath:indexPath]; + //cell.accessoryType = UITableViewCellAccessoryCheckmark; + self.selectedIndexPath = indexPath; + + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; + EMUFileInfo *fi = [g.files objectAtIndex:indexPath.row]; + //[self dismissModalViewControllerAnimated:YES]; + [self.navigationController popViewControllerAnimated:YES];*/ +} + +#define CELL_ID @"DiskCell" + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell; + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; + + if (g.files) + { + cell = [tableView dequeueReusableCellWithIdentifier:CELL_ID + forIndexPath:indexPath]; + [self configureCell:cell atIndexPath:indexPath]; + + } + else + { + cell = [tableView dequeueReusableCellWithIdentifier:@"EmptyCell" forIndexPath:indexPath]; + } + + return cell; + +} + +- (UITableViewCell *)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { + + /*Get Information */ + + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; + NSString *fileName = [(EMUFileInfo *)[g.files objectAtIndex:indexPath.row] fileName]; + + NSString *configurationfile = [self getconfigforDisk:fileName]; + /*Set Cell Labels */ + cell.textLabel.text = fileName; + cell.detailTextLabel.text = configurationfile; + + + return cell; + +} + +- (NSString *) getconfigforDisk:(NSString *)fileName { + + NSString *configurationfile = [settings configForDisk:fileName] ? [settings configForDisk:fileName] : [NSString stringWithFormat:@"None"]; + + return configurationfile; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if([segue.identifier isEqualToString:@"associateconfiguration"]) { + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; + disktoassociate = [[(EMUFileInfo *)[g.files objectAtIndex:indexPath.row] fileName] retain]; + + SelectConfigurationViewController *controller = (SelectConfigurationViewController *)segue.destinationViewController; + controller.delegate = self; + } +} + +- (BOOL)isRecentConfig:(NSString *)configurationname { + + if([[self getconfigforDisk:disktoassociate] isEqual:configurationname]) + { + return true; + } + + return false; +} + +- (void)didSelectConfiguration:(NSString *)configurationname { + [self saveConfiguration:configurationname]; + + /*reload affected cell */ + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + + [self.tableView beginUpdates]; + [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [self.tableView endUpdates]; +} + +- (void)didDeleteConfiguration { + [self.tableView beginUpdates]; + [self.tableView reloadData]; + [self.tableView endUpdates]; +} + +- (void)saveConfiguration:(NSString *)configurationname { + + NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; + NSString *fileName = [(EMUFileInfo *)[g.files objectAtIndex:indexPath.row] fileName]; + + [settings setConfig:configurationname forDisk:fileName]; + +} + +- (NSString *)getFirstOption { + return @"None"; +} + +- (void)dealloc { + + self.roms = nil; + self.indexTitles = nil; + self.selectedIndexPath = nil; + self.context = nil; + [settings release]; + settings = nil; + [super dealloc]; +} + +@end diff --git a/Classes/File Browser/EMUBrowser.h b/Classes/File Browser/EMUBrowser.h old mode 100755 new mode 100644 index ffe4cad..7c806a7 --- a/Classes/File Browser/EMUBrowser.h +++ b/Classes/File Browser/EMUBrowser.h @@ -18,16 +18,29 @@ */ #import +#import "EMUFileInfo.h" -@interface EMUBrowser : NSObject { - NSString *basePath; - NSArray *extensions; -} +@interface EMUBrowser : NSObject -@property (nonatomic, retain) NSString* basePath; -@property (nonatomic, retain) NSArray* extensions; -- (id)initWithBasePath:(NSString *)theBasePath; -- (NSMutableArray*)getFiles; +/** + * Returns an array of EMUFileInfo instances for all available adf files. + */ +- (NSArray *)getAdfFileInfos; + +/** + * Returns an array of EMUFileInfo instances for all available files that match the specified extensions (for ex @[adf, ADF]). + */ +- (NSArray *)getFileInfosForExtensions:(NSArray *)extensions; + +/** + * Returns a EMUFileInfo instance matching the specified file name (for ex xyz.adf), or nil if no match is found. + */ +- (EMUFileInfo *)getFileInfoForFileName:(NSString *)fileName; + +/** + * Returns an array of EMUFileInfo instances for all available files whose names match the specified file names (@[xyz.adf, blah.rom]. + */ +- (NSArray *)getFileInfosForFileNames:(NSArray *)fileName; @end diff --git a/Classes/File Browser/EMUBrowser.m b/Classes/File Browser/EMUBrowser.m old mode 100755 new mode 100644 index 7f3b88e..9e4809c --- a/Classes/File Browser/EMUBrowser.m +++ b/Classes/File Browser/EMUBrowser.m @@ -20,56 +20,59 @@ #import "EMUBrowser.h" #import "EMUFileInfo.h" -@interface EMUBrowser() - -- (NSMutableArray*)getFilesForPath:(NSString *)thePath; - -@end - - - @implementation EMUBrowser -@synthesize basePath, extensions; - -- (id)initWithBasePath:(NSString *)theBasePath { - NSAssert(theBasePath != nil, @"theBasePath cannot be nil"); +- (NSArray *)getAdfFileInfos { + return [self getFileInfosForExtensions:@[@"adf", @"ADF"]]; +} - self.extensions = [NSArray arrayWithObjects:@"adf", @"ADF", nil]; - self.basePath = theBasePath; - - return [super init]; +- (NSArray *)getFileInfosForExtensions:(NSArray *)extensions { + return [self getFileInfosWithFileNameFilter:nil extensions:extensions]; } -- (NSMutableArray*)getFiles { - NSMutableArray* list = [[NSMutableArray alloc] init]; - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); +- (EMUFileInfo *)getFileInfoForFileName:(NSString *)fileName { + NSArray *fileInfos = [self getFileInfosForFileNames:@[fileName]]; + return [fileInfos count] == 0 ? nil : [fileInfos objectAtIndex:0]; +} - NSString *documentsDirectory = [paths objectAtIndex:0]; - [list addObjectsFromArray:[self getFilesForPath:documentsDirectory]]; - - [list addObjectsFromArray:[self getFilesForPath:[[NSBundle mainBundle] bundlePath]]]; - - return [list autorelease]; +- (NSArray *)getFileInfosForFileNames:(NSArray *)fileNames { + NSMutableArray *extensions = [NSMutableArray arrayWithCapacity:[fileNames count]]; + for (NSString *fileName in fileNames) { + [extensions addObject:fileName.pathExtension]; + } + return [self getFileInfosWithFileNameFilter:fileNames extensions:extensions]; } -- (NSMutableArray*)getFilesForPath:(NSString *)thePath { - NSMutableArray* list = [[NSMutableArray alloc] init]; - - NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:thePath]; - NSArray *files = [[direnum allObjects] pathsMatchingExtensions:extensions]; - for (NSString *pname in files) { - id obj = [[EMUFileInfo alloc] initFromPath:[thePath stringByAppendingPathComponent:pname]]; - [list addObject:obj]; - [obj release]; - } - return [list autorelease]; +- (NSArray *)getFileInfosWithFileNameFilter:(NSArray *)fileNameFilters extensions:(NSArray *)extensions { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *documentsDirectory = [paths objectAtIndex:0]; + + NSArray *documentFileInfos = [self getFileInfosInDirectory:documentsDirectory fileNameFilter:fileNameFilters extensions:extensions]; + NSArray *bundleFileInfos = [self getFileInfosInDirectory:[[NSBundle mainBundle] bundlePath] fileNameFilter:fileNameFilters extensions:extensions]; + + NSMutableArray *fileInfos = [[[NSMutableArray alloc] initWithCapacity:[documentFileInfos count] + [bundleFileInfos count]] autorelease]; + [fileInfos addObjectsFromArray:documentFileInfos]; + [fileInfos addObjectsFromArray:bundleFileInfos]; + return fileInfos; } --(void)dealloc { - self.extensions = nil; - self.basePath = nil; - [super dealloc]; +- (NSArray *)getFileInfosInDirectory:(NSString *)directory fileNameFilter:(NSArray *)fileNameFilters extensions:(NSArray *)extensions { + NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:directory]; + NSArray *relativeFilePaths = [[direnum allObjects] pathsMatchingExtensions:extensions]; + NSMutableArray *fileInfos = [[[NSMutableArray alloc] initWithCapacity:[relativeFilePaths count]] autorelease]; + for (NSString *relativeFilePath in relativeFilePaths) { + NSString *filePath = [directory stringByAppendingPathComponent:relativeFilePath]; + EMUFileInfo *fileInfo = [[[EMUFileInfo alloc] initFromPath:filePath] autorelease]; + if (fileNameFilters) { + NSString *fileName = [relativeFilePath lastPathComponent]; + if ([fileNameFilters containsObject:fileName]) { + [fileInfos addObject:fileInfo]; + } + } else { + [fileInfos addObject:fileInfo]; + } + } + return fileInfos; } @end diff --git a/Classes/File Browser/EMUROMBrowserView.xib b/Classes/File Browser/EMUROMBrowserView.xib deleted file mode 100755 index 31dc04c..0000000 --- a/Classes/File Browser/EMUROMBrowserView.xib +++ /dev/null @@ -1,345 +0,0 @@ - - - - 800 - 10F569 - 788 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 117 - - - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 480} - - - 3 - MQA - - NO - YES - NO - IBCocoaTouchFramework - 1 - 0 - YES - 44 - 27 - 27 - - - - - - - view - - - - 12 - - - - delegate - - - - 17 - - - - dataSource - - - - 18 - - - - - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - - - EMUROMBrowserViewController - UIResponder - {{927, 483}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 18 - - - - - EMUROMBrowserViewController - UITableViewController - - id - id - - - - context - id - - - delegate - id - - - - IBProjectSource - Classes/File Browser/EMUROMBrowserViewController.h - - - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UITableView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITableView.h - - - - UITableViewController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITableViewController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - YES - ../iFrodo.xcodeproj - 3 - 117 - - diff --git a/Classes/File Browser/EMUROMBrowserViewController.h b/Classes/File Browser/EMUROMBrowserViewController.h old mode 100755 new mode 100644 index da72b43..d96560c --- a/Classes/File Browser/EMUROMBrowserViewController.h +++ b/Classes/File Browser/EMUROMBrowserViewController.h @@ -18,6 +18,7 @@ */ #import +#import "AdfImporter.h" @class EMUFileInfo; @@ -25,19 +26,12 @@ - (void)didSelectROM:(EMUFileInfo*)fileInfo withContext:(id)context; @end +@interface EMUROMBrowserViewController : UITableViewController -@interface EMUROMBrowserViewController : UITableViewController { - NSArray *roms; - int selectedRow; - NSArray *indexTitles; - NSIndexPath *selectedIndexPath; - id delegate; - id context; -} ++ (NSString *)getFileImportedNotificationName; -@property (nonatomic, retain) NSArray *roms, *indexTitles; -@property (nonatomic, retain) NSIndexPath *selectedIndexPath; @property (nonatomic, assign) id delegate; @property (nonatomic, retain) id context; +@property (nonatomic, retain) NSArray *extensions; // extensions of files to show @end diff --git a/Classes/File Browser/EMUROMBrowserViewController.mm b/Classes/File Browser/EMUROMBrowserViewController.mm old mode 100755 new mode 100644 index 90d7b39..606e8fd --- a/Classes/File Browser/EMUROMBrowserViewController.mm +++ b/Classes/File Browser/EMUROMBrowserViewController.mm @@ -21,25 +21,38 @@ #import "EMUBrowser.h" #import "EMUFileInfo.h" #import "EMUFileGroup.h" +#import "ScrollToRowHandler.h" + +@implementation EMUROMBrowserViewController { + @private + AdfImporter *_adfImporter; + NSArray *_indexTitles; + NSArray *_roms; + ScrollToRowHandler *_scrollToRowHandler; +} -@implementation EMUROMBrowserViewController - -@synthesize roms, selectedIndexPath, indexTitles, delegate, context; - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { - // Initialization code - } - return self; ++ (NSString *)getFileImportedNotificationName { + return @"FileImportedNotification"; } - (void)viewDidLoad { + [super viewDidLoad]; self.title = @"Browser"; - - self.indexTitles = [NSArray arrayWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", - @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", - @"W", @"X", @"Y", @"Z", @"#", nil]; - + _adfImporter = [[AdfImporter alloc] init]; + _indexTitles = [@[@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", + @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", + @"W", @"X", @"Y", @"Z", @"#"] retain]; + _scrollToRowHandler = [[ScrollToRowHandler alloc] initWithTableView:self.tableView identity:[_extensions description]]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(onAdfChanged) + name:[EMUROMBrowserViewController getFileImportedNotificationName] + object:nil]; + [self reloadAdfs]; + [_scrollToRowHandler scrollToRow]; +} + +- (void)reloadAdfs { NSMutableArray *sections = [[NSMutableArray alloc] init]; for (int i = 0; i < 26; i++) { unichar c = i+65; @@ -48,8 +61,8 @@ - (void)viewDidLoad { } [sections addObject:[[EMUFileGroup alloc] initWithSectionName:@"#"]]; - EMUBrowser *browser = [[EMUBrowser alloc] initWithBasePath:@""]; - NSArray *files = [browser getFiles]; + EMUBrowser *browser = [[[EMUBrowser alloc] init] autorelease]; + NSArray *files = [browser getFileInfosForExtensions:self.extensions]; for (EMUFileInfo* f in files) { unichar c = [[f fileName] characterAtIndex:0]; if (isdigit(c)) { @@ -61,70 +74,94 @@ - (void)viewDidLoad { [g.files addObject:f]; } } - [browser release]; - self.roms = sections; -} - -- (void)viewDidAppear:(BOOL)animated { -// if (!prefs) -// prefs = new Prefs(); -// -// prefs->Load(Frodo::prefs_path()); + [_roms release]; + _roms = [sections retain]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return self.roms.count; + return _roms.count; } - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { - return indexTitles; + return _indexTitles; } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:section]; + EMUFileGroup *g = (EMUFileGroup*)[_roms objectAtIndex:section]; return g.sectionName; } - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index { unichar c = [title characterAtIndex:0]; - if (c > 64 && c < 91) + if (c > 64 && c < 91) { return c - 65; + } return 26; } +- (void)onAdfChanged { + [_scrollToRowHandler clearRow]; + [self reloadAdfs]; + [self.tableView reloadData]; +} + - (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section { - EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:section]; + EMUFileGroup *g = (EMUFileGroup*)[_roms objectAtIndex:section]; return g.files.count; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - if (indexPath == selectedIndexPath) - return; - UITableViewCell *cell = [tableView cellForRowAtIndexPath:self.selectedIndexPath]; - cell.accessoryType = UITableViewCellAccessoryNone; - - cell = [tableView cellForRowAtIndexPath:indexPath]; - //cell.accessoryType = UITableViewCellAccessoryCheckmark; - self.selectedIndexPath = indexPath; - - EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; - EMUFileInfo *fi = [g.files objectAtIndex:indexPath.row]; - [self dismissModalViewControllerAnimated:YES]; - if (self.delegate) { - [self.delegate didSelectROM:fi withContext:context]; - } + EMUFileGroup *g = (EMUFileGroup*)[_roms objectAtIndex:indexPath.section]; + EMUFileInfo *fi = [g.files objectAtIndex:indexPath.row]; + [self.navigationController popViewControllerAnimated:YES]; + [self.delegate didSelectROM:fi withContext:self.context]; + [_scrollToRowHandler setRow:indexPath]; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + return YES; +} + +- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { + NSMutableArray *editActions = [NSMutableArray arrayWithCapacity:2]; + + EMUFileInfo *fileInfo = [self getFileInfoForIndexPath:indexPath]; + + UITableViewRowAction *shareAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"Share" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { + NSURL *url = [NSURL fileURLWithPath:fileInfo.path]; + NSString *string = @"iAmiga File Sharing"; + UIActivityViewController *activityViewController = + [[[UIActivityViewController alloc] initWithActivityItems:@[string, url] applicationActivities:nil] autorelease]; + if ([activityViewController respondsToSelector:@selector(popoverPresentationController)]) { + // iOS8: setting the sourceView is required for iPad + UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; + activityViewController.popoverPresentationController.sourceView = [cell.subviews firstObject]; // firstObject == cell actions + } + [self presentViewController:activityViewController animated:YES completion:^{ }]; + }]; + shareAction.backgroundColor = [UIColor blueColor]; + [editActions addObject:shareAction]; + + BOOL okToDelete = [_adfImporter isDownloadedAdf:fileInfo.path]; + if (okToDelete) { + UITableViewRowAction *deleteAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) { + BOOL deleted = [[NSFileManager defaultManager] removeItemAtPath:fileInfo.path error:NULL]; + if (deleted) { + [_scrollToRowHandler clearRow]; + [self reloadAdfs]; + [tableView beginUpdates]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [tableView endUpdates]; + } + }]; + [editActions addObject:deleteAction]; + } + return editActions; } #define CELL_ID @"DiskCell" @@ -132,33 +169,31 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CELL_ID]; - if (cell == nil) - cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CELL_ID] autorelease]; + if (!cell) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CELL_ID] autorelease]; + } cell.autoresizingMask = UIViewAutoresizingFlexibleWidth; - if ([indexPath compare:self.selectedIndexPath] == NSOrderedSame) - cell.accessoryType = UITableViewCellAccessoryCheckmark; - else - cell.accessoryType = UITableViewCellAccessoryNone; - - EMUFileGroup *g = (EMUFileGroup*)[self.roms objectAtIndex:indexPath.section]; - - cell.textLabel.text = [(EMUFileInfo *)[g.files objectAtIndex:indexPath.row] fileName]; + EMUFileInfo *fileInfo = [self getFileInfoForIndexPath:indexPath]; + cell.textLabel.text = [fileInfo fileName]; return cell; } +- (EMUFileInfo *)getFileInfoForIndexPath:(NSIndexPath *)indexPath { + EMUFileGroup *group = [_roms objectAtIndex:indexPath.section]; + return [group.files objectAtIndex:indexPath.row]; +} - (void)dealloc { - //if (prefs) - // delete prefs; - - self.roms = nil; - self.indexTitles = nil; - self.selectedIndexPath = nil; - self.context = nil; + self.context = nil; + self.extensions = nil; + [_roms release]; + [_indexTitles release]; + [_adfImporter release]; + [_scrollToRowHandler release]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } - @end diff --git a/Classes/HardDriveService.h b/Classes/HardDriveService.h new file mode 100644 index 0000000..069b4d4 --- /dev/null +++ b/Classes/HardDriveService.h @@ -0,0 +1,50 @@ +// Created by Simon Toens on 24.03.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +/** + * The hard drive service handles interactions with the hard drives. + * + * Currently only a single mounted hard drive (.hdf file) is supported. + * + * Note that this class uses the emulator state as source of truth, it does not/should not read configuration. + */ +@interface HardDriveService : NSObject + +/** + * Whether the hard file is mounted. + */ +- (BOOL)mounted; + +/** + * Whether the hard file is mounted as read-only. Always returns YES if nothing is mounted. + */ +- (BOOL)readOnly; + +/** + * Mounts the specified .hdf file, either as read-only or as read/write. + */ +- (void)mountHardfile:(NSString *)hardfilePath asReadOnly:(BOOL)readOnly; + +/** + * Unmounts the currently mounted .hdf file. This is a noop if nothing is mounted. + */ +- (void)unmountHardfile; + +- (NSString *)getMountedHardfilePath; + +@end \ No newline at end of file diff --git a/Classes/HardDriveService.mm b/Classes/HardDriveService.mm new file mode 100644 index 0000000..59c6eed --- /dev/null +++ b/Classes/HardDriveService.mm @@ -0,0 +1,99 @@ +// Created by Simon Toens on 24.03.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "cfgfile.h" +#import "HardDriveService.h" +#import "filesys.h" + +@implementation HardDriveService + +- (BOOL)mounted { + if(!currprefs_mountinfo) return 0; + return nr_units(currprefs_mountinfo) == 1; +} + +- (BOOL)readOnly { + return [self mounted] ? [self readOnlyInternal] : YES; +} + +- (NSString *)getMountedHardfilePath { + return [self mounted] ? [self getMountedHardfilePathInternal] : nil; +} + +- (void)mountHardfile:(NSString *)hardfilePath asReadOnly:(BOOL)readOnly { + if (![self mounted]) { + [hardfilePath getCString:uae4all_hard_file maxLength:sizeof(uae4all_hard_file) encoding:[NSString defaultCStringEncoding]]; + + int readOnlyInt = readOnly ? 1 : 0; + + // hardcoded values are defaults from uae4all2 cfg file: + // harddir: dir1:hd/dir1 + // hardfile: 32:1:2:512:/data/data/pandora.uae4all.sdl/files/blankdisks/empty.hdf + static int secspertrack = 32; + static int surfaces = 1; + static int reserved = 2; + static int blocksize = 512; + + add_filesys_unit(currprefs_mountinfo, 0, uae4all_hard_file, readOnlyInt, secspertrack, surfaces, reserved, blocksize); + } +} + +- (void)unmountHardfile { + if ([self mounted]) { + kill_filesys_unit(currprefs_mountinfo, 0); + uae4all_hard_file[0] = '\0'; + } +} + +- (NSString *)getMountedHardfilePathInternal { + char *rootdir; // the one we care about + char *volname; + int readonly, track, surfaces, reserved, cylinders, size, blocksize; + static int nr = 0; + get_filesys_unit(currprefs_mountinfo, + nr, + &volname, + &rootdir, + &readonly, + &track, + &surfaces, + &reserved, + &cylinders, + &size, + &blocksize); + return [NSString stringWithCString:rootdir encoding:[NSString defaultCStringEncoding]]; +} + +- (BOOL)readOnlyInternal { + int readonly; // the one we care about + char *rootdir, *volname; + int track, surfaces, reserved, cylinders, size, blocksize; + static int nr = 0; + get_filesys_unit(currprefs_mountinfo, + nr, + &volname, + &rootdir, + &readonly, + &track, + &surfaces, + &reserved, + &cylinders, + &size, + &blocksize); + return readonly == 1 ? YES : NO; +} + +@end diff --git a/Classes/InputControllerView.h b/Classes/InputControllerView.h index 9dbc5b0..a9ca14c 100644 --- a/Classes/InputControllerView.h +++ b/Classes/InputControllerView.h @@ -37,14 +37,12 @@ CGVector2D *_stickVector; BOOL _trackingStick; CJoyStick *TheJoyStick; - float _deadZone; // represents the deadzone radius, where the DPad state will be considered DPadCenter - - id delegate; } -@property (nonatomic, assign) id delegate; - -- (void)setStick; +@property (nonatomic, assign) id delegate; +@property (nonatomic, readwrite) BOOL clickedscreen; +- (void)reloadJoypadSettings; +- (void)onJoypadActivated; @end diff --git a/Classes/InputControllerView.mm b/Classes/InputControllerView.mm index 26d9cf1..d9b037e 100644 --- a/Classes/InputControllerView.mm +++ b/Classes/InputControllerView.mm @@ -22,75 +22,328 @@ #import "touchstick.h" #import "CGVector.h" #import "CocoaUtility.h" +#import "SDL_events.h" +#import "JoypadKey.h" +#import "KeyButtonViewHandler.h" +#import "MultiPeerconnectivityController.h" +#import "MPCConnectionStates.h" +#import "VPadMotionController.h" +#import "Settings.h" + InputControllerView *sharedInstance; extern CJoyStick g_touchStick; - +extern MPCStateType mainMenu_servermode; @interface FireButtonView : UIView { @public CJoyStick *TheJoyStick; id delegate; UIImageView *fireImage; - BOOL showImage; } -@property (nonatomic, assign) BOOL showImage; +@property (nonatomic, readwrite) BOOL showControls; +@property (nonatomic, readwrite, assign) NSString *joypadstyle; +@property (nonatomic, readwrite, assign) NSString *leftorright; +@property (nonatomic, readwrite) BOOL showbuttontouch; +@property (nonatomic, readwrite) BOOL clickedscreen; @end -@implementation FireButtonView - -@synthesize showImage; +@implementation FireButtonView { + Settings *_settings; + NSTimer *_showcontrolstimer; + BOOL _buttonapressed; + BOOL _buttonbpressed; + BOOL _buttonxpressed; + BOOL _buttonypressed; + MultiPeerConnectivityController *_mpcController; +} - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; - showImage = NO; TheJoyStick = &g_touchStick; + _settings = [[Settings alloc] init]; + + _mpcController = [MultiPeerConnectivityController getinstance]; + return self; + + } -- (void)setShowImage:(BOOL)value { - showImage = value; - if (showImage) { - if (!fireImage) { - fireImage = [UIImageView newViewFromImageResource:@"ls-fire.png"]; - fireImage.hidden = YES; - [self addSubview:fireImage]; - } - } else { - fireImage.hidden = YES; - } +- (void)initShowControlsTimer { + if (_showcontrolstimer) { + [_showcontrolstimer release]; + } + _showcontrolstimer = [[NSTimer scheduledTimerWithTimeInterval:1.000 target:self + selector:@selector(disableShowControls:) userInfo:nil repeats:YES] retain]; + _showcontrolstimer.tolerance = 0.0020; + + [self setNeedsDisplay]; +} + +- (void)disableShowControls:(NSTimer *)timer { + _showControls = NO; + [self setNeedsDisplay]; + + [_showcontrolstimer invalidate]; + [_showcontrolstimer release]; + _showcontrolstimer = nil; +} + + +-(void)drawRect:(CGRect)rect { + + if(!_showControls && !_showbuttontouch) + { + return; + } + + if([_joypadstyle isEqualToString:kJoyStyleFourButton]) + { + [self drawFireButtonsFour:rect]; + } + else + { + [self drawFireButtonsOne:rect]; + } +} + +-(void)drawFireButtonsFour:(CGRect)rect +{ + NSMutableParagraphStyle* textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy; + textStyle.alignment = NSTextAlignmentLeft; + NSDictionary* textFontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"Helvetica" size: 12], NSForegroundColorAttributeName: UIColor.whiteColor, NSParagraphStyleAttributeName: textStyle}; + + CGContextRef ctx = UIGraphicsGetCurrentContext(); + + CGRect yLabel = CGRectMake(CGRectGetMidX(rect), CGRectGetMidY(rect)/2, 20, 20); + CGRect aLabel = CGRectMake(CGRectGetMidX(rect), CGRectGetMaxY(rect)*0.75, 20, 20); + CGRect xLabel = CGRectMake(CGRectGetMidX(rect)/2, CGRectGetMidY(rect), 20, 20); + CGRect bLabel = CGRectMake(CGRectGetMaxX(rect)*0.75, CGRectGetMidY(rect), 20, 20); + + if(_showControls || _buttonypressed) + { + //Button Y + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMinY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.7, 0.7); + CGContextFillPath(ctx); + + [@"Y" drawInRect:yLabel withAttributes:textFontAttributes]; + } + + if(_showControls || _buttonapressed) + { + //Button A + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.7, 0.7); + CGContextFillPath(ctx); + + [@"A" drawInRect:aLabel withAttributes:textFontAttributes]; + } + + if(_showControls || _buttonxpressed) + { + //Button X + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.5, 0.7); + CGContextFillPath(ctx); + + [@"X" drawInRect:xLabel withAttributes:textFontAttributes]; + } + + if(_showControls || _buttonbpressed) + { + //Button B + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMaxX(rect), CGRectGetMinY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.5, 0.7); + CGContextFillPath(ctx); + + [@"B" drawInRect:bLabel withAttributes:textFontAttributes]; + } + +} + +-(void)drawFireButtonsOne:(CGRect)rect +{ + NSMutableParagraphStyle* textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy; + textStyle.alignment = NSTextAlignmentLeft; + NSDictionary* textFontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"Helvetica" size: 12], NSForegroundColorAttributeName: UIColor.whiteColor, NSParagraphStyleAttributeName: textStyle}; + + CGContextRef ctx = UIGraphicsGetCurrentContext(); + + CGRect aLabel = CGRectMake(CGRectGetMidX(rect), CGRectGetMidY(rect), 20, 20); + + if(_showControls || _buttonapressed) + { + //Button A + CGContextBeginPath(ctx); + CGContextMoveToPoint(ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); //top left + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMinY(rect)); // top right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); // bottom right + CGContextAddLineToPoint(ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.7, 0.7); + CGContextFillPath(ctx); + + [@"A" drawInRect:aLabel withAttributes:textFontAttributes]; + } } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - TheJoyStick->setButtonOneState(FireButtonDown); - [delegate fireButton:FireButtonDown]; - if (showImage) { - UITouch *touch = [touches anyObject]; - fireImage.center = [touch locationInView:self]; - fireImage.hidden = NO; - } + + CGPoint coordinates = [[[event touchesForView:self] anyObject] locationInView:self]; + + int pressedbutton; + if([_joypadstyle isEqualToString:kJoyStyleFourButton]) + { + pressedbutton = [self getButtonFour:&coordinates]; + } + else + { + pressedbutton = [self getButtonOne:&coordinates]; + } + + [_mpcController handleinputbuttons:pressedbutton buttonstate:0 deviceid:kVirtualPad]; } -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + +- (int)getButtonFour:(CGPoint *)coordinates { + + bool tophalf = (coordinates->y <= (self.frame.size.height / 2)) ? true : false; + bool lefthalf = (coordinates->x <= (self.frame.size.width / 2)) ? true : false; + int xposvertex = self.frame.size.width / 2; //Highest point of all (triangular shaped) buttons; + + int buttonheight = tophalf ? self.frame.size.height / 2 : (self.frame.size.height / 2) - 1; //Height of button + int xpointsreltovertex = lefthalf ? coordinates->x : (coordinates->x - self.frame.size.width)*-1; //X-Axis relative to highest point of triangle + + int xposbuttonyheight = ((double)xpointsreltovertex/ (double) xposvertex) * (double) buttonheight; + int pressedbutton; + + NSString *configuredkey; + + if(tophalf && (coordinates->y <= xposbuttonyheight)) + //Button Y + { + pressedbutton = BTN_Y; + _buttonypressed = true; + } + else if(!tophalf && coordinates->y >= buttonheight - xposbuttonyheight + (self.frame.size.height / 2)) + //Button A + { + pressedbutton = BTN_A; + _buttonapressed = true; + } + else if(lefthalf) + //Button X + { + pressedbutton = BTN_X; + _buttonxpressed = true; + } + else + //Button B + { + pressedbutton = BTN_B; + _buttonbpressed = true; + } + + if(configuredkey) + //If any result display needs to be refreshed + { + [self setNeedsDisplay]; + } + + return pressedbutton; +} + +-(int)getButtonOne:(CGPoint *)coordinates { + + _buttonapressed = true; + [self setNeedsDisplay]; + return BTN_A; +} + +-(int)releasebutton { + + int buttoncode; + + if(_buttonypressed) + //Button Y + { + buttoncode = BTN_Y; + _buttonypressed = false; + } + else if(_buttonapressed) + //Button A + { + buttoncode = BTN_A; + _buttonapressed = false; + } + else if(_buttonxpressed) + //Button X + { + buttoncode = BTN_X; + _buttonxpressed = false; + } + else if(_buttonbpressed) + //Button B + { + buttoncode = BTN_B; + _buttonbpressed = false; + } + + [self setNeedsDisplay]; + + + return buttoncode; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // ignore } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - TheJoyStick->setButtonOneState(FireButtonUp); - [delegate fireButton:FireButtonUp]; - if (showImage) { - fireImage.hidden = YES; - } + + int buttoncode = [self releasebutton]; + + [_mpcController handleinputbuttons:buttoncode buttonstate:1 deviceid:kVirtualPad]; + + _clickedscreen = YES; + } - (void)dealloc { - if (fireImage) + if (fireImage) { [fireImage release]; + } + [_joypadstyle release]; + [_leftorright release]; + [super dealloc]; } @@ -107,17 +360,28 @@ @interface InputControllerView() - (void)configure; @end -@implementation InputControllerView - -const CGFloat kButtonWidthPortraitPct = 0.25; -const CGFloat kButtonWidthLandscapePct = 0.25; +@implementation InputControllerView { + CGFloat _kButtonWidthPortraitPct; + CGFloat _kButtonWidthLandscapePct; + NSString *_joypadstyle; + NSString *_leftorright; + BOOL _showbuttontouch; + TouchStickDPadState _oldstate; + KeyButtonViewHandler *_keyButtonViewHandler; + MultiPeerConnectivityController *_mpcController; + int _buttontoreleasevertical; + int _buttontoreleasehorizontal; + Settings *_settings; +} @synthesize delegate; +@synthesize clickedscreen = _clickedscreen; - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self configure]; } + return self; } @@ -126,15 +390,52 @@ - (void)awakeFromNib { } - (void)configure { + // Initialization code button = [[FireButtonView alloc] initWithFrame:CGRectZero]; + button.backgroundColor = [UIColor clearColor]; button.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin; [self addSubview:button]; _deadZone = 20.0f; // radius, in pixels of the dead zone. _trackingStick = NO; _stickVector = new CGVector2D(); sharedInstance = self; - TheJoyStick = &g_touchStick; + TheJoyStick = &g_touchStick; + _oldstate = DPadCenter; + + _settings = [[Settings alloc] init]; + + _keyButtonViewHandler = [[KeyButtonViewHandler alloc] initWithSuperview:self]; + _mpcController = [MultiPeerConnectivityController getinstance]; +}; + +- (void)onJoypadActivated { + button.showControls = YES; + [button initShowControlsTimer]; + [_keyButtonViewHandler addConfiguredKeyButtonViews]; +} + +- (void)reloadJoypadSettings { + [self setJoypadstyle:_settings.joypadstyle]; + [self setLeftOrRight:_settings.joypadleftorright]; + [self setShowButtontouch:_settings.joypadshowbuttontouch]; + [_keyButtonViewHandler addConfiguredKeyButtonViews]; +} + +- (void)setJoypadstyle:(NSString *)strjoypadstyle { + _joypadstyle = strjoypadstyle; + button.joypadstyle = _joypadstyle; +} + +- (void)setLeftOrRight:(NSString *)strLeftOrRight { + _leftorright = strLeftOrRight; + button.leftorright = _leftorright; + [self setButtonSubview]; +} + +- (void)setShowButtontouch:(BOOL)showbuttontouch { + _showbuttontouch = showbuttontouch; + button.showbuttontouch = _showbuttontouch; } - (void)setDelegate:(id)theDelegate { @@ -143,16 +444,41 @@ - (void)setDelegate:(id)theDelegate { } - (void)layoutSubviews { - CGSize size = self.frame.size; - - BOOL isLandscape = UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation]); - if (isLandscape) { - button.frame = CGRectMake(0, 0, size.width * kButtonWidthLandscapePct, size.height); - //button.showImage = YES; - } else { - button.frame = CGRectMake(0, 0, size.width * kButtonWidthPortraitPct, size.height); - //button.showImage = NO; - } + [super layoutSubviews]; + + [self setButtonSubview]; +} + +- (void)setButtonSubview { + + if([_joypadstyle isEqualToString:kJoyStyleFourButton]) + { + _kButtonWidthLandscapePct = 0.5; + _kButtonWidthPortraitPct = 0.5; + } + else + { + _kButtonWidthLandscapePct = 0.25; + _kButtonWidthPortraitPct = 0.25; + } + + CGSize size = self.frame.size; + + if ([_leftorright isEqualToString:@"Left"]) + { + button.frame = CGRectMake(0, 0, size.width * _kButtonWidthLandscapePct, size.height); + } + else + { + button.frame = CGRectMake(size.width * (1.00 - _kButtonWidthLandscapePct), 0, size.width * _kButtonWidthLandscapePct, size.height); + } + + /*BOOL isLandscape = UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation]); + if (isLandscape) { + + } else { + button.frame = CGRectMake(0, 0, size.width * _kButtonWidthPortraitPct, size.height); + }*/ } - (void)didAddSubview:(UIView*)theView { @@ -160,6 +486,8 @@ - (void)didAddSubview:(UIView*)theView { } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + if ([VPadMotionController isActive]){return;} + UITouch *touch = [touches anyObject]; _stickCenter = [touch locationInView:self]; _stickVector->x = _stickVector->y = 0; @@ -168,18 +496,37 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - UITouch *touch = [touches anyObject]; + if ([VPadMotionController isActive]){return;} + + UITouch *touch = [touches anyObject]; _stickLocation = [touch locationInView:self]; _stickVector->UpdateFromPoints(_stickCenter, _stickLocation); [self calculateDPadState]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + if ([VPadMotionController isActive]){return;} + + _clickedscreen = YES; _stickVector->x = _stickVector->y = 0; [self setDPadState:DPadCenter]; } +- (BOOL)clickedscreen { + // did the user move the joypad, use fire button(s) or use key buttons? + return _clickedscreen || button.clickedscreen || _keyButtonViewHandler.anyButtonWasTouched; +} + +- (void)setClickedscreen:(BOOL)clickedscreen { + _clickedscreen = clickedscreen; + button.clickedscreen = clickedscreen; + _keyButtonViewHandler.anyButtonWasTouched = clickedscreen; +} + - (void)dealloc { + [_joypadstyle release]; + [_keyButtonViewHandler release]; + [_settings release]; delete _stickVector; [super dealloc]; } @@ -195,7 +542,7 @@ - (void)calculateDPadState { const CGFloat deg = 22.5; TouchStickDPadState dPadState; - + if (angle <= 0 + deg || angle > 360 - deg) dPadState = DPadRight; else if (angle <= 45 + deg && angle > 45 - deg) @@ -219,12 +566,24 @@ - (void)calculateDPadState { } - (void)setDPadState:(TouchStickDPadState)state { - TouchStickDPadState oldState = TheJoyStick->dPadState(); - if (oldState != state) { - TheJoyStick->setDPadState(state); - [delegate joystickStateChanged:state]; - } -} + + if (_oldstate != state) { + + _oldstate = state; + + int buttonvertical = [_mpcController dpadstatetojoypadkey:@"vertical" hatstate:state]; + int buttonhorizontal = [_mpcController dpadstatetojoypadkey:@"horizontal" hatstate:state]; + + + [_mpcController handleinputdirections:state buttontoreleasevertical:_buttontoreleasevertical buttontoreleasehorizontal:_buttontoreleasehorizontal deviceid:@"InputControllerView"]; + + + [delegate joystickStateChanged:state]; + + _buttontoreleasevertical = buttonvertical; + _buttontoreleasehorizontal = buttonhorizontal; + } +} -@end +@end \ No newline at end of file diff --git a/Classes/JoypadMainSettingsController.h b/Classes/JoypadMainSettingsController.h new file mode 100644 index 0000000..b8ff2e0 --- /dev/null +++ b/Classes/JoypadMainSettingsController.h @@ -0,0 +1,13 @@ +// +// JoypadMainSettingsController.h +// iUAE +// +// Created by Urs on 05.01.16. +// +// + +#import + +@interface JoypadMainSettingsController : UITableViewController + +@end diff --git a/Classes/JoypadMainSettingsController.mm b/Classes/JoypadMainSettingsController.mm new file mode 100644 index 0000000..546080a --- /dev/null +++ b/Classes/JoypadMainSettingsController.mm @@ -0,0 +1,33 @@ +// +// JoypadMainSettingsController.m +// iUAE +// +// Created by Urs on 05.01.16. +// +// + +#import "JoypadMainSettingsController.h" + +@interface JoypadMainSettingsController () + +@end + +@implementation JoypadMainSettingsController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +@end diff --git a/Classes/JoypadSelectionController.h b/Classes/JoypadSelectionController.h new file mode 100644 index 0000000..169782e --- /dev/null +++ b/Classes/JoypadSelectionController.h @@ -0,0 +1,16 @@ +// +// JoypadMappingMainController.h +// iUAE +// +// Created by Urs on 04.04.16. +// +// + +#import + + +@interface JoypadSelectionController : UITableViewController + +@end + + diff --git a/Classes/JoypadSelectionController.mm b/Classes/JoypadSelectionController.mm new file mode 100644 index 0000000..6870d7b --- /dev/null +++ b/Classes/JoypadSelectionController.mm @@ -0,0 +1,142 @@ +// +// JoypadMappingMainController.m +// iUAE +// +// Created by Urs on 04.04.16. +// +// + +#import "JoypadSelectionController.h" +#import "JoypadMainSettingsController.h" +#import "Settings.h" +#import "JoypadKey.h" + +@implementation JoypadSelectionController { + Settings *_settings; + NSMutableArray *_controllers; +} + + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + _controllers = [[_settings controllers] mutableCopy]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)viewDidAppear:(BOOL)animated { + _controllers = [[_settings controllers] mutableCopy]; + //[configurations insertObject:firstoption atIndex:0]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [_settings keyConfigurationCount]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell; + + if ([_settings keyConfigurationforButton:BTN_A forController:indexPath.row + 1]) + { + cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" + forIndexPath:indexPath]; + [self configureCell:cell atIndexPath:indexPath]; + + } + else + { + cell = [tableView dequeueReusableCellWithIdentifier:@"EmptyCell" forIndexPath:indexPath]; + } + + return cell; +} + +- (UITableViewCell *)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { + //NSString *configurationname = [configurations objectAtIndex:indexPath.row]; + cell.textLabel.text = [NSString stringWithFormat:@"Controller %d", indexPath.row + 1]; + + return cell; +} + +- (void)controllerAdded:(NSString *)configurationname { +} + + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + + //[self deleteConfiguration:indexPath]; + //[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + + //} else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + bool returnvalue = indexPath.row == 0 ? FALSE : TRUE; + return returnvalue; +} + +- (void)deleteController:(NSIndexPath *)indexPath { + +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + + if([segue.identifier isEqualToString:@"showcontroller"]) { + + UITableViewCell *sCell = (UITableViewCell *) sender; + NSInteger cNumber = [[self.tableView indexPathForCell:sCell] row] + 1; + [_settings setCNumber:cNumber]; + + } +} + +- (void) dealloc { + [_settings release]; + [_controllers release]; + [super dealloc]; +} + +/* + // Override to support rearranging the table view. + - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { + } + */ + +/* + // Override to support conditional rearranging of the table view. + - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; + } + */ + +/* + #pragma mark - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. + } + */ + +@end \ No newline at end of file diff --git a/Classes/JoystickViewLandscape.mm b/Classes/JoystickViewLandscape.mm deleted file mode 100644 index 91007a9..0000000 --- a/Classes/JoystickViewLandscape.mm +++ /dev/null @@ -1,161 +0,0 @@ -/* - Frodo, Commodore 64 emulator for the iPhone - Copyright (C) 2007, 2008 Stuart Carnie - See gpl.txt for license information. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ - -#import "JoystickViewLandscape.h" -#import "debug.h" -#import "CocoaUtility.h" -#import - -@implementation JoystickViewLandscape - -CGFloat kOffsetFromCentre = -70.0; -CGFloat kDefaultAlpha = 0.6; -CGFloat kDefaultShowHideDuration = 50.0 / 1000.0; -CGFloat kDefaultShowRotateDuration = 500.0 / 1000.0; -CGFloat kDefaultRotateDuration = 50.0 / 1000.0; -#define degreesToRadian(x) (M_PI * x / 180.0) - - -- (id)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - // Initialization code - self.userInteractionEnabled = YES; - arrows = [UIImageView newViewFromImageResource:@"ls-bgimage.png"]; - arrows.alpha = 0.0; - [self addSubview:arrows]; - - arrowDirection = [UIImageView newViewFromImageResource:@"ls-joystick_active.png"]; - arrowDirection.alpha = 0.0; - [self addSubview:arrowDirection]; - - stickCentre = [UIImageView newViewFromImageResource:@"ls-joystick_rest.png"]; - stickCentre.alpha = 0.0; - [self addSubview:stickCentre]; - - tracking = NO; - } - return self; -} - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - tracking = YES; - - UITouch *touch = [touches anyObject]; - arrows.center = [touch locationInView:self]; - stickCentre.center = arrows.center; - arrowDirection.center = arrows.center; - [UIView beginAnimations:@"show" context:nil]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; - [UIView setAnimationDuration:kDefaultShowHideDuration]; - - arrows.alpha = kDefaultAlpha; - stickCentre.alpha = kDefaultAlpha; - - [UIView commitAnimations]; - - [super touchesBegan:touches withEvent:event]; -} - -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - [super touchesMoved:touches withEvent:event]; -} - -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - tracking = NO; - - [UIView beginAnimations:@"hide" context:nil]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; - [UIView setAnimationDuration:kDefaultShowHideDuration]; - - arrows.alpha = 0.0; - stickCentre.alpha = 0.0; - arrowDirection.alpha = 0.0; - - [UIView commitAnimations]; - - [super touchesEnded:touches withEvent:event]; -} - -- (void)joystickStateChanged:(TouchStickDPadState)state { - if (!tracking) - return; - - bool animate = YES; - if (state == DPadCenter) { - arrowDirection.alpha = 0.0; - stickCentre.alpha = kDefaultAlpha; - return; - } else if (stickCentre.alpha > 0.0) { - stickCentre.alpha = 0.0; - arrowDirection.alpha = kDefaultAlpha; - // means we were back in the centre position, so don't animate. - animate = NO; - } - - CGAffineTransform transform = CGAffineTransformMakeTranslation(0, kOffsetFromCentre); - - switch (state) { - case DPadUpRight: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(45))); - break; - case DPadRight: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(90))); - break; - case DPadDownRight: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(135))); - break; - case DPadDown: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(180))); - break; - case DPadDownLeft: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(225))); - break; - case DPadLeft: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(270))); - break; - case DPadUpLeft: - transform = CGAffineTransformConcat(transform, CGAffineTransformMakeRotation(degreesToRadian(315))); - break; - } - - if (animate) { - [UIView beginAnimations:@"rotate" context:nil]; - [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; - [UIView setAnimationDuration:kDefaultRotateDuration]; - } - - arrowDirection.transform = transform;//CGAffineTransformTranslate(transform, 0, -kArrowRadius); - arrowDirection.alpha = kDefaultAlpha; - - if (animate) - [UIView commitAnimations]; -} - -- (void)fireButton:(FireButtonState)state { - //fireButton.image = firebutton_images[state]; -} - -- (void)dealloc { - [arrows release]; - [arrowDirection release]; - [super dealloc]; -} - - -@end diff --git a/Classes/KeyButtonConfiguration.h b/Classes/KeyButtonConfiguration.h new file mode 100644 index 0000000..0626479 --- /dev/null +++ b/Classes/KeyButtonConfiguration.h @@ -0,0 +1,37 @@ +// Created by Simon Toens on 10.10.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "SDL.h" + +@interface KeyButtonConfiguration : NSObject + +@property (nonatomic, assign) CGPoint position; +@property (nonatomic, assign) CGSize size; +@property (nonatomic, assign) SDLKey key; +@property (nonatomic, strong) NSString *keyName; +@property (nonatomic, strong) NSString *groupName; +@property (nonatomic, assign) BOOL showOutline; +@property (nonatomic, assign) BOOL enabled; + +- (BOOL)hasConfiguredKey; + +- (void)toggleShowOutline; +- (void)toggleEnabled; + +- (KeyButtonConfiguration *)clone; + +@end \ No newline at end of file diff --git a/Classes/KeyButtonConfiguration.m b/Classes/KeyButtonConfiguration.m new file mode 100644 index 0000000..98ede88 --- /dev/null +++ b/Classes/KeyButtonConfiguration.m @@ -0,0 +1,79 @@ +// Created by Simon Toens on 10.10.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "KeyButtonConfiguration.h" + +static const int kInitialValue = -1; + +@implementation KeyButtonConfiguration + +static NSString *const kUnassignedKeyName = @""; +static NSString *const kDefaultGroupName = @"default"; + +- (instancetype)init { + if (self = [super init]) { + _key = kInitialValue; + _keyName = [kUnassignedKeyName retain]; + _groupName = [kDefaultGroupName retain]; + _showOutline = YES; + _enabled = YES; + } + return self; +} + +- (void)dealloc { + [_keyName release]; + [_groupName release]; + [super dealloc]; +} + +- (BOOL)hasConfiguredKey { + return _key != kInitialValue; +} + +- (void)toggleShowOutline { + _showOutline = !_showOutline; +} + +- (void)toggleEnabled { + _enabled = !_enabled; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"Position: %@ Size: %@ Key: %i Key Name: %@", + NSStringFromCGPoint(_position), + NSStringFromCGSize(_size), + _key, + _keyName]; +} + +- (KeyButtonConfiguration *)clone { + KeyButtonConfiguration *clone = [[[KeyButtonConfiguration alloc] init] autorelease]; + clone.position = _position; + clone.size = _size; + clone.key = _key; + clone.keyName = [_keyName copy]; + clone.groupName = [_groupName copy]; + clone.showOutline = _showOutline; + clone.enabled = _enabled; + return clone; +} + +- (id)copyWithZone:(NSZone*)zone { + return [self retain]; +} + +@end \ No newline at end of file diff --git a/Classes/KeyButtonConfigurationController.h b/Classes/KeyButtonConfigurationController.h new file mode 100644 index 0000000..ba372a5 --- /dev/null +++ b/Classes/KeyButtonConfigurationController.h @@ -0,0 +1,34 @@ +// Created by Simon Toens on 05.10.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "IOSKeyboard.h" +#import "KeyButtonConfiguration.h" +#import "SDL.h" + +@interface KeyButtonConfigurationController : UIViewController + +@property (nonatomic, assign) KeyButtonConfiguration *selectedButtonViewConfiguration; +@property (nonatomic, assign) NSMutableArray *allButtonConfigurations; + +@property (nonatomic, assign) IBOutlet UIButton *configureKeyButton; +@property (nonatomic, assign) IBOutlet UISlider *buttonViewSizeSlider; + +@property (nonatomic, assign) IBOutlet UITextField *dummyTextField1; +@property (nonatomic, assign) IBOutlet UITextField *dummyTextField2; +@property (nonatomic, assign) IBOutlet UITextField *dummyTextField3; + +@end \ No newline at end of file diff --git a/Classes/KeyButtonConfigurationController.m b/Classes/KeyButtonConfigurationController.m new file mode 100644 index 0000000..ed7b04b --- /dev/null +++ b/Classes/KeyButtonConfigurationController.m @@ -0,0 +1,171 @@ +// Created by Simon Toens on 05.10.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "KeyButtonConfiguration.h" +#import "KeyButtonConfigurationController.h" +#import "IOSKeyboard.h" + +@implementation KeyButtonConfigurationController { + IOSKeyboard *_keyboard; + NSMutableDictionary *_viewConfigurationToView; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + _keyboard = [[IOSKeyboard alloc] initWithDummyFields:_dummyTextField1 fieldf:_dummyTextField2 fieldspecial:_dummyTextField3]; + _keyboard.delegate = self; + _viewConfigurationToView = [[NSMutableDictionary alloc] init]; + [self configureButtonViews]; + [self updateUIForSelectedView]; +} + +- (void)dealloc { + [_keyboard release]; + [_viewConfigurationToView release]; + [super dealloc]; +} + +- (void)keyPressed:(int)ascii keyName:(NSString *)keyName { + [_keyboard toggleKeyboard]; + _selectedButtonViewConfiguration.key = (SDLKey)ascii; + _selectedButtonViewConfiguration.keyName = keyName; + [self updateKeyLabelForView:[self getSelectedView] withValue:keyName]; +} + +- (void)updateButtonViewSizeSlider { + _buttonViewSizeSlider.value = _selectedButtonViewConfiguration.size.height; +} + +- (void)configureButtonViews { + for (KeyButtonConfiguration *buttonConfiguration in _allButtonConfigurations) { + [self addViewForButtonConfig:buttonConfiguration]; + } +} + +- (CGRect)getFrameForButtonViewConfiguration:(KeyButtonConfiguration *)buttonViewConfiguration { + return CGRectMake(buttonViewConfiguration.position.x, + buttonViewConfiguration.position.y, + buttonViewConfiguration.size.width, + buttonViewConfiguration.size.height); +} + +- (UIView *)addViewForButtonConfig:(KeyButtonConfiguration *)buttonConfig { + CGRect frame = [self getFrameForButtonViewConfiguration:buttonConfig]; + UIView *view = [[UIView alloc] initWithFrame:frame]; + UIColor *backgroundColor = _selectedButtonViewConfiguration == buttonConfig ? [self getSelectedColor] : [self getDeselectedColor]; + [view setBackgroundColor:backgroundColor]; + [self updateKeyLabelForView:view withValue:buttonConfig.keyName]; + [self.view addSubview:view]; + [view addGestureRecognizer:[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]]; + [view addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]]; + [_viewConfigurationToView setObject:view forKey:buttonConfig]; + return view; +} + +- (void)updateKeyLabelForView:(UIView *)view withValue:(NSString *)value { + if ([view.subviews count] == 0) { + CGRect labelFrame = CGRectMake(5, 5, view.frame.size.width - 10, 15); + UILabel *label = [[[UILabel alloc] initWithFrame:labelFrame] autorelease]; + label.text = value; + label.textColor = [UIColor whiteColor]; + [view addSubview:label]; + } else { + UILabel *label = [view.subviews firstObject]; + label.text = value; + } +} + +- (IBAction)onNewButton { + KeyButtonConfiguration *newButtonConfig = [_selectedButtonViewConfiguration clone]; + [_allButtonConfigurations addObject:newButtonConfig]; + newButtonConfig.position = CGPointMake(newButtonConfig.position.x + 5, newButtonConfig.position.y + 5); + UIView *newView = [self addViewForButtonConfig:newButtonConfig]; + [self updateSelectedViewTo:newView]; +} + +- (IBAction)onAssignKey { + [_keyboard toggleKeyboard]; +} + +- (IBAction)onButtonViewSlider { + CGSize newSize = CGSizeMake(_buttonViewSizeSlider.value, _buttonViewSizeSlider.value); + _selectedButtonViewConfiguration.size = newSize; + UIView *view = [self getSelectedView]; + view.frame = CGRectMake(view.frame.origin.x, view.frame.origin.y, newSize.width, newSize.height); +} + +- (IBAction)onDoneButton { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +- (void)handleTap:(UIPanGestureRecognizer *)recognizer { + [self updateSelectedViewTo:recognizer.view]; +} + +- (void)handlePan:(UIPanGestureRecognizer *)recognizer { + if (recognizer.state == UIGestureRecognizerStateBegan) { + [self updateSelectedViewTo:recognizer.view]; + } + + CGPoint translation = [recognizer translationInView:self.view]; + recognizer.view.center = CGPointMake(recognizer.view.center.x + translation.x, recognizer.view.center.y + translation.y); + [recognizer setTranslation:CGPointMake(0, 0) inView:self.view]; + + if (recognizer.state == UIGestureRecognizerStateEnded) { + _selectedButtonViewConfiguration.position = recognizer.view.frame.origin; + } +} + +- (void)updateSelectedViewTo:(UIView *)view { + UIView *currentlySelectedView = [self getSelectedView]; + if (currentlySelectedView != view) { + currentlySelectedView.backgroundColor = [self getDeselectedColor]; + view.backgroundColor = [self getSelectedColor]; + _selectedButtonViewConfiguration = [self configForView:view]; + [self updateUIForSelectedView]; + } +} + +- (void)updateUIForSelectedView { + [self updateButtonViewSizeSlider]; +} + +- (KeyButtonConfiguration *)configForView:(UIView *)view { + for (KeyButtonConfiguration *config in _viewConfigurationToView) { + UIView *mappedView = [_viewConfigurationToView objectForKey:config]; + if (view == mappedView) { + return config; + } + } + NSAssert(NO, @"Did not find config for view %@", view); + return nil; +} + +- (UIView *)getSelectedView { + UIView *selectedView = [_viewConfigurationToView objectForKey:_selectedButtonViewConfiguration]; + NSAssert(selectedView != nil, @"No mapping for view configuration %@", _selectedButtonViewConfiguration); + return selectedView; +} + +- (UIColor *)getSelectedColor { + return [UIColor redColor]; +} + +- (UIColor *)getDeselectedColor { + return [UIColor grayColor]; +} + +@end \ No newline at end of file diff --git a/Classes/KeyButtonManagementController.h b/Classes/KeyButtonManagementController.h new file mode 100644 index 0000000..662dcad --- /dev/null +++ b/Classes/KeyButtonManagementController.h @@ -0,0 +1,36 @@ +// Created by Simon Toens on 01.10.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface KeyButtonsEnabledCell : UITableViewCell + +@property (nonatomic, assign) IBOutlet UISwitch *keyButtonsEnabledSwitch; + +@end + +@interface ButtonViewConfigurationCell : UITableViewCell + +@property (nonatomic, assign) IBOutlet UILabel *keyNameLabel; +@property (nonatomic, assign) IBOutlet UISwitch *showOutlineSwitch; +@property (nonatomic, assign) IBOutlet UISwitch *enabledSwitch; + +@end + + +@interface KeyButtonManagementController : UITableViewController + +@end \ No newline at end of file diff --git a/Classes/KeyButtonManagementController.mm b/Classes/KeyButtonManagementController.mm new file mode 100644 index 0000000..45a9715 --- /dev/null +++ b/Classes/KeyButtonManagementController.mm @@ -0,0 +1,185 @@ +// Created by Simon Toens on 01.10.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "KeyButtonConfiguration.h" +#import "KeyButtonConfigurationController.h" +#import "KeyButtonManagementController.h" +#import "Settings.h" + +static NSString *const kKeyButtonsEnabledCellIdent = @"KeyButtonsEnabledCell"; +static NSString *const kNewKeyButtonCellIdent = @"NewKeyButtonCell"; +static NSString *const kConfiguredKeyButtonCellIdent = @"ConfiguredKeyButtonCell"; +static NSString *const kConfigureKeyButtonSegue = @"ConfigureKeyButtonSegue"; + +@implementation KeyButtonsEnabledCell +@end + +@implementation ButtonViewConfigurationCell +@end + +@implementation KeyButtonManagementController { +@private + Settings *_settings; + NSMutableArray *_buttonConfigurations; + BOOL _initialLoad; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + _settings = [[Settings alloc] init]; + _initialLoad = YES; + if (_settings.keyButtonsEnabled) { + _buttonConfigurations = [[self loadButtonConfiguration] retain]; + } +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self.tableView reloadData]; // re-render table when coming back from configuring a key button + if (!_initialLoad) { + [self saveButtonConfigurations]; + } + _initialLoad = NO; +} + +- (void)dealloc { + [_settings release]; + [_buttonConfigurations release]; + [super dealloc]; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return _settings.keyButtonsEnabled ? 2 : 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (section == 0) { + return 1; + } else { + return _settings.keyButtonsEnabled ? [_buttonConfigurations count] + 1 : 0; + } +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + if (indexPath.section == 0) { + KeyButtonsEnabledCell *cell = [tableView dequeueReusableCellWithIdentifier:kKeyButtonsEnabledCellIdent]; + if (!cell) { + cell = [[[KeyButtonsEnabledCell alloc] init] autorelease]; + } + [cell.keyButtonsEnabledSwitch setOn:_settings.keyButtonsEnabled]; + return cell; + } + else if (indexPath.row == 0) { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kNewKeyButtonCellIdent]; + return cell ? + cell: + [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kNewKeyButtonCellIdent]; + } else { + ButtonViewConfigurationCell *cell = [tableView dequeueReusableCellWithIdentifier:kConfiguredKeyButtonCellIdent]; + if (!cell) { + cell = [[[ButtonViewConfigurationCell alloc] init] autorelease]; + } + KeyButtonConfiguration *button = [_buttonConfigurations objectAtIndex:indexPath.row - 1]; + cell.keyNameLabel.text = button.keyName; + [cell.showOutlineSwitch setOn:button.showOutline]; + [cell.showOutlineSwitch addTarget:button action:@selector(toggleShowOutline) forControlEvents:UIControlEventValueChanged]; + [cell.showOutlineSwitch addTarget:self action:@selector(saveButtonConfigurations) forControlEvents:UIControlEventValueChanged]; + [cell.enabledSwitch setOn:button.enabled]; + [cell.enabledSwitch addTarget:button action:@selector(toggleEnabled) forControlEvents:UIControlEventValueChanged]; + [cell.enabledSwitch addTarget:self action:@selector(saveButtonConfigurations) forControlEvents:UIControlEventValueChanged]; + return cell; + } +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + return indexPath.section == 1 && indexPath.row != 0; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + [tableView beginUpdates]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [_buttonConfigurations removeObjectAtIndex:indexPath.row - 1]; + [tableView endUpdates]; + } + [self saveButtonConfigurations]; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + if (indexPath.section == 1) { + if (indexPath.row == 0) { + [self onAddKeyButton]; + } else { + NSUInteger buttonViewIndex = indexPath.row - 1; + [self performSegueWithIdentifier:kConfigureKeyButtonSegue + sender:[_buttonConfigurations objectAtIndex:buttonViewIndex]]; + } + } +} + +- (IBAction)onKeyButtonsFeatureSwitchToggled:(UISwitch *)keyButtonsEnabledSwitch { + _settings.keyButtonsEnabled = keyButtonsEnabledSwitch.isOn; + NSIndexSet *indexSet = [NSIndexSet indexSetWithIndex:1]; + [self.tableView beginUpdates]; + if (keyButtonsEnabledSwitch.isOn) { + _buttonConfigurations = [[self loadButtonConfiguration] retain]; + [self.tableView insertSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; + } else { + [self.tableView deleteSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; + [_buttonConfigurations release]; + _buttonConfigurations = nil; + } + [self.tableView endUpdates]; +} + +- (void)onAddKeyButton { + KeyButtonConfiguration *buttonConfiguration = [self newButtonViewConfiguration]; + [_buttonConfigurations addObject:buttonConfiguration]; + NSArray *indexPath = @[[NSIndexPath indexPathForItem:[_buttonConfigurations count] inSection:1]]; + [self.tableView beginUpdates]; + [self.tableView insertRowsAtIndexPaths:indexPath withRowAnimation:UITableViewRowAnimationAutomatic]; + [self.tableView endUpdates]; + [self performSegueWithIdentifier:kConfigureKeyButtonSegue sender:buttonConfiguration]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(KeyButtonConfiguration *)selectedButtonViewConfiguration { + KeyButtonConfigurationController *controller = segue.destinationViewController; + controller.selectedButtonViewConfiguration = selectedButtonViewConfiguration; + controller.allButtonConfigurations = _buttonConfigurations; +} + +- (void)saveButtonConfigurations { + _settings.keyButtonConfigurations = _buttonConfigurations; +} + +- (NSMutableArray *)loadButtonConfiguration { + return [NSMutableArray arrayWithArray:_settings.keyButtonConfigurations]; +} + +- (KeyButtonConfiguration *)newButtonViewConfiguration { + KeyButtonConfiguration *b = [[[KeyButtonConfiguration alloc] init] autorelease]; + if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + b.position = CGPointMake(200, 200); + b.size = CGSizeMake(100, 100); + } else { + b.position = CGPointMake(100, 100); + b.size = CGSizeMake(60, 60); + } + return b; +} + +@end \ No newline at end of file diff --git a/Classes/KeyButtonViewHandler.h b/Classes/KeyButtonViewHandler.h new file mode 100644 index 0000000..2bfe649 --- /dev/null +++ b/Classes/KeyButtonViewHandler.h @@ -0,0 +1,28 @@ +// Created by Simon Toens on 1.10.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface KeyButtonViewHandler : NSObject + +- (instancetype)init __unavailable; +- (instancetype)initWithSuperview:(UIView *)superview; + +- (void)addConfiguredKeyButtonViews; + +@property (nonatomic) BOOL anyButtonWasTouched; + +@end \ No newline at end of file diff --git a/Classes/KeyButtonViewHandler.m b/Classes/KeyButtonViewHandler.m new file mode 100644 index 0000000..42081a1 --- /dev/null +++ b/Classes/KeyButtonViewHandler.m @@ -0,0 +1,177 @@ +// Created by Simon Toens on 1.10.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "KeyButtonConfiguration.h" +#import "KeyButtonViewHandler.h" +#import "Settings.h" + +@interface TouchNotifier : NSObject + +@property (nonatomic) BOOL buttonWasTouched; + +@end + +@implementation TouchNotifier +@end + +@interface KeyButtonView : UIView { + @private + SDLKey _key; + NSString *_keyName; + TouchNotifier *_touchNotifier; +} + +- (instancetype)initWithFrame:(CGRect)frame + forKey:(SDLKey)key + withKeyName:(NSString *)keyName + touchNofifier:(TouchNotifier *)touchNotifier; +@end + +/** + * When touched, simulates the pressing of a configurable key. + */ +@implementation KeyButtonView + +- (instancetype)initWithFrame:(CGRect)frame + forKey:(SDLKey)key + withKeyName:(NSString *)keyName + touchNofifier:(TouchNotifier *)touchNotifier +{ + if (self = [super initWithFrame:frame]) { + _key = key; + _keyName = [keyName retain]; + _touchNotifier = [touchNotifier retain]; + } + return self; +} + +- (void)highlightBorder { + UIColor *color = [self getOutlineColor]; + self.layer.borderColor = color.CGColor; + self.layer.borderWidth = .5; +} + +- (void)addKeyLabelOnLeftSide:(BOOL)onLeftSide { + static int labelWidth = 70; + static int offset = 5; + static int labelHeight = 15; + CGRect frame = onLeftSide ? CGRectMake(offset, offset, labelWidth, labelHeight) : CGRectMake(self.frame.size.width - labelWidth - offset, offset, labelWidth, labelHeight); + UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease]; + label.text = _keyName; + label.textColor = [self getOutlineColor]; + [self addSubview:label]; +} + +- (UIColor *)getOutlineColor { + return [UIColor redColor]; +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = _key; + SDL_PushEvent(&ed); + _touchNotifier.buttonWasTouched = YES; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + SDL_Event eu = { SDL_KEYUP }; + eu.key.keysym.sym = _key; + SDL_PushEvent(&eu); +} + +- (void)dealloc { + [_keyName release]; + [_touchNotifier release]; + [super dealloc]; +} + +@end + +@implementation KeyButtonViewHandler { + @private + NSMutableArray *_keyButtonViews; + Settings *_settings; + UIView *_superview; + TouchNotifier *_touchNotifier; +} + +- (instancetype)initWithSuperview:(UIView *)superview { + if (self = [super init]) { + _keyButtonViews = [[NSMutableArray alloc] init]; + _settings = [[Settings alloc] init]; + _superview = [superview retain]; + _touchNotifier = [[TouchNotifier alloc] init]; + } + return self; +} + +- (BOOL)anyButtonWasTouched { + return _touchNotifier.buttonWasTouched; +} + +- (void)setAnyButtonWasTouched:(BOOL)anyButtonWasTouched { + _touchNotifier.buttonWasTouched = anyButtonWasTouched; +} + +- (void)addConfiguredKeyButtonViews { + [self removeExistingKeyButtonViews]; + if (!_settings.keyButtonsEnabled) { + return; + } + for (KeyButtonConfiguration *button in _settings.keyButtonConfigurations) { + if (!button.enabled) { + continue; + } + if (!button.hasConfiguredKey) { + continue; + } + CGRect frame = CGRectMake(button.position.x, button.position.y, button.size.width, button.size.height); + KeyButtonView *buttonView = [[[KeyButtonView alloc] initWithFrame:frame + forKey:button.key + withKeyName:button.keyName + touchNofifier:_touchNotifier] autorelease]; + if (button.showOutline) { + [buttonView highlightBorder]; + [buttonView addKeyLabelOnLeftSide:YES]; + } + [_superview addSubview:buttonView]; + [_keyButtonViews addObject:buttonView]; + } + [self bringAllButtonViewsToFront]; +} + +- (void)bringAllButtonViewsToFront { + for (UIView *keyButtonView in _keyButtonViews) { + [_superview bringSubviewToFront:keyButtonView]; + } +} + +- (void)removeExistingKeyButtonViews { + for (UIView *view in _keyButtonViews) { + [view removeFromSuperview]; + } + [_keyButtonViews removeAllObjects]; +} + +- (void)dealloc { + [_keyButtonViews release]; + [_settings release]; + [_superview release]; + [_touchNotifier release]; + [super dealloc]; +} + +@end \ No newline at end of file diff --git a/Classes/NSObject+Blocks.m b/Classes/NSObject+Blocks.mm similarity index 100% rename from Classes/NSObject+Blocks.m rename to Classes/NSObject+Blocks.mm diff --git a/Classes/OnScreenControllerView.mm b/Classes/OnScreenControllerView.mm new file mode 100644 index 0000000..39bfb1a --- /dev/null +++ b/Classes/OnScreenControllerView.mm @@ -0,0 +1,695 @@ +/* + Frodo, Commodore 64 emulator for the iPhone + Copyright (C) 2007, 2008 Stuart Carnie + See gpl.txt for license information. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#import "OnscreenControllerView.h" +#import "debug.h" +#import "touchstick.h" +#import "CGVector.h" +#import "CocoaUtility.h" +#import "SDL_events.h" +#import "JoypadKey.h" +#import "KeyButtonViewHandler.h" + + +OnScreenControllerView *sharedInstance; +extern CJoyStick g_touchStick; + +@interface FireButtonView : UIView { +@public + CJoyStick *TheJoyStick; + UIImageView *fireImage; +} + +@property (nonatomic, readwrite) BOOL showControls; +@property (nonatomic, readwrite, assign) NSString *joypadstyle; +@property (nonatomic, readwrite, assign) NSString *leftorright; +@property (nonatomic, readwrite) BOOL showbuttontouch; +@property (nonatomic, readwrite) BOOL clickedscreen; + +@end + +@implementation FireButtonView { + Settings *_settings; + NSTimer *_showcontrolstimer; + BOOL _buttonapressed; + BOOL _buttonbpressed; + BOOL _buttonxpressed; + BOOL _buttonypressed; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + + TheJoyStick = &g_touchStick; + + _settings = [[Settings alloc] init]; + + return self; +} + +- (void)initShowControlsTimer { + if (_showcontrolstimer) { + [_showcontrolstimer release]; + } + _showcontrolstimer = [[NSTimer scheduledTimerWithTimeInterval:1.000 target:self + selector:@selector(disableShowControls:) userInfo:nil repeats:YES] retain]; + _showcontrolstimer.tolerance = 0.0020; + + [self setNeedsDisplay]; +} + +- (void)disableShowControls:(NSTimer *)timer { + _showControls = NO; + [self setNeedsDisplay]; + + [_showcontrolstimer invalidate]; + [_showcontrolstimer release]; + _showcontrolstimer = nil; +} + + +-(void)drawRect:(CGRect)rect { + + if(!_showControls && !_showbuttontouch) + { + return; + } + + if([_joypadstyle isEqualToString:kJoyStyleFourButton]) + { + [self drawFireButtonsFour:rect]; + } + else + { + [self drawFireButtonsOne:rect]; + } +} + +-(void)drawFireButtonsFour:(CGRect)rect +{ + NSMutableParagraphStyle* textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy; + textStyle.alignment = NSTextAlignmentLeft; + NSDictionary* textFontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"Helvetica" size: 12], NSForegroundColorAttributeName: UIColor.whiteColor, NSParagraphStyleAttributeName: textStyle}; + + CGContextRef ctx = UIGraphicsGetCurrentContext(); + + CGRect yLabel = CGRectMake(CGRectGetMidX(rect), CGRectGetMidY(rect)/2, 20, 20); + CGRect aLabel = CGRectMake(CGRectGetMidX(rect), CGRectGetMaxY(rect)*0.75, 20, 20); + CGRect xLabel = CGRectMake(CGRectGetMidX(rect)/2, CGRectGetMidY(rect), 20, 20); + CGRect bLabel = CGRectMake(CGRectGetMaxX(rect)*0.75, CGRectGetMidY(rect), 20, 20); + + if(_showControls || _buttonypressed) + { + //Button Y + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMinY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.7, 0.7); + CGContextFillPath(ctx); + + [@"Y" drawInRect:yLabel withAttributes:textFontAttributes]; + } + + if(_showControls || _buttonapressed) + { + //Button A + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.7, 0.7); + CGContextFillPath(ctx); + + [@"A" drawInRect:aLabel withAttributes:textFontAttributes]; + } + + if(_showControls || _buttonxpressed) + { + //Button X + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.5, 0.7); + CGContextFillPath(ctx); + + [@"X" drawInRect:xLabel withAttributes:textFontAttributes]; + } + + if(_showControls || _buttonbpressed) + { + //Button B + CGContextBeginPath(ctx); + CGContextMoveToPoint (ctx, CGRectGetMaxX(rect), CGRectGetMinY(rect)); // top left + CGContextAddLineToPoint(ctx, CGRectGetMidX(rect), CGRectGetMidY(rect)); // mid right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.5, 0.7); + CGContextFillPath(ctx); + + [@"B" drawInRect:bLabel withAttributes:textFontAttributes]; + } + +} + +-(void)drawFireButtonsOne:(CGRect)rect +{ + NSMutableParagraphStyle* textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy; + textStyle.alignment = NSTextAlignmentLeft; + NSDictionary* textFontAttributes = @{NSFontAttributeName: [UIFont fontWithName: @"Helvetica" size: 12], NSForegroundColorAttributeName: UIColor.whiteColor, NSParagraphStyleAttributeName: textStyle}; + + CGContextRef ctx = UIGraphicsGetCurrentContext(); + + CGRect aLabel = CGRectMake(CGRectGetMidX(rect), CGRectGetMidY(rect), 20, 20); + + if(_showControls || _buttonapressed) + { + //Button A + CGContextBeginPath(ctx); + CGContextMoveToPoint(ctx, CGRectGetMinX(rect), CGRectGetMinY(rect)); //top left + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMinY(rect)); // top right + CGContextAddLineToPoint(ctx, CGRectGetMaxX(rect), CGRectGetMaxY(rect)); // bottom right + CGContextAddLineToPoint(ctx, CGRectGetMinX(rect), CGRectGetMaxY(rect)); // bottom left + CGContextClosePath(ctx); + + CGContextSetRGBFillColor(ctx, 0, 0, 0.7, 0.7); + CGContextFillPath(ctx); + + [@"A" drawInRect:aLabel withAttributes:textFontAttributes]; + } +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + + CGPoint coordinates = [[[event touchesForView:self] anyObject] locationInView:self]; + + NSString *configuredkey; + if([_joypadstyle isEqualToString:kJoyStyleFourButton]) + { + [self pushbuttonfour:&coordinates]; + } + else + { + [self pushButtonOne:&coordinates]; + } + +} + +- (void)pushButtonFour:(CGPoint *)coordinates { + + bool tophalf = (coordinates->y <= (self.frame.size.height / 2)) ? true : false; + bool lefthalf = (coordinates->x <= (self.frame.size.width / 2)) ? true : false; + int xposvertex = self.frame.size.width / 2; //Highest point of all (triangular shaped) buttons; + + int buttonheight = tophalf ? self.frame.size.height / 2 : (self.frame.size.height / 2) - 1; //Height of button + int xpointsreltovertex = lefthalf ? coordinates->x : (coordinates->x - self.frame.size.width)*-1; //X-Axis relative to highest point of triangle + + int xposbuttonyheight = ((double)xpointsreltovertex/ (double) xposvertex) * (double) buttonheight; + + NSString *configuredkey; + + if(tophalf && (coordinates->y <= xposbuttonyheight)) + //Button Y + { + [self.delegate didPushIOSJoystickButton]; + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_Y]]; + _buttonypressed = true; + } + else if(!tophalf && coordinates->y >= buttonheight - xposbuttonyheight + (self.frame.size.height / 2)) + //Button A + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_A]]; + _buttonapressed = true; + } + else if(lefthalf) + //Button X + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_X]]; + _buttonxpressed = true; + } + else + //Button B + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_B]]; + _buttonbpressed = true; + } + + if(configuredkey) + //If any result display needs to be refreshed + { + [self setNeedsDisplay]; + } + + return configuredkey; +} + +-(NSString *)pushButtonOne:(CGPoint *)coordinates { + + _buttonapressed = true; + [self setNeedsDisplay]; + return [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_A]]; +} + +-(NSString *)releasebutton { + + NSString *configuredkey; + + if(_buttonypressed) + //Button Y + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_Y]]; + _buttonypressed = false; + } + else if(_buttonapressed) + //Button A + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_A]]; + _buttonapressed = false; + } + else if(_buttonxpressed) + //Button X + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_X]]; + _buttonxpressed = false; + } + else if(_buttonbpressed) + //Button B + { + configuredkey = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", BTN_B]]; + _buttonbpressed = false; + } + + if(configuredkey) + //If any result display needs to be refreshed + { + [self setNeedsDisplay]; + } + + return configuredkey; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + // ignore +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + NSString *configuredkey = [self releasebutton]; + + if([configuredkey isEqualToString:@"Joypad"]) + { + TheJoyStick->setButtonOneState(FireButtonUp); + } + else + { + int asciicode = [[configuredkey stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + + SDL_Event ed = { SDL_KEYUP }; + ed.key.keysym.sym = (SDLKey) asciicode; + SDL_PushEvent(&ed); + } + _clickedscreen = YES; + +} + +- (void)dealloc { + if (fireImage) { + [fireImage release]; + } + + [_joypadstyle release]; + [_leftorright release]; + + [super dealloc]; +} + +@end + +@interface OnScreenControllerView(PrivateMethods) + +- (void)calculateDPadState; +- (void)setDPadState:(TouchStickDPadState)state; + +@end + +@interface OnScreenControllerView() +- (void)configure; +@end + +@implementation OnScreenControllerView { + CGFloat _kButtonWidthPortraitPct; + CGFloat _kButtonWidthLandscapePct; + NSString *_joypadstyle; + NSString *_leftorright; + BOOL _showbuttontouch; + Settings *_settings; + int _asciicodekeytoreleasehorizontal; + int _asciicodekeytoreleasevertical; + TouchStickDPadState _oldstate; + KeyButtonViewHandler *_keyButtonViewHandler; +} + +@synthesize delegate; +@synthesize clickedscreen = _clickedscreen; + +- (id)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self configure]; + } + + return self; +} + +- (void)awakeFromNib { + [self configure]; +} + +- (void)configure { + + // Initialization code + button = [[FireButtonView alloc] initWithFrame:CGRectZero]; + button.backgroundColor = [UIColor clearColor]; + button.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin; + [self addSubview:button]; + _deadZone = 20.0f; // radius, in pixels of the dead zone. + _trackingStick = NO; + _stickVector = new CGVector2D(); + sharedInstance = self; + TheJoyStick = &g_touchStick; + _oldstate = DPadCenter; + + _settings = [[Settings alloc] init]; + + _keyButtonViewHandler = [[KeyButtonViewHandler alloc] initWithSuperview:self]; +} + +- (void)onJoypadActivated { + button.showControls = YES; + [button initShowControlsTimer]; + [_keyButtonViewHandler addConfiguredKeyButtonViews]; +} + +- (void)reloadJoypadSettings { + [self setJoypadstyle:_settings.joypadstyle]; + [self setLeftOrRight:_settings .joypadleftorright]; + [self setShowButtontouch:_settings.joypadshowbuttontouch]; + [_keyButtonViewHandler addConfiguredKeyButtonViews]; +} + +- (void)setJoypadstyle:(NSString *)strjoypadstyle { + _joypadstyle = strjoypadstyle; + button.joypadstyle = _joypadstyle; +} + +- (void)setLeftOrRight:(NSString *)strLeftOrRight { + _leftorright = strLeftOrRight; + button.leftorright = _leftorright; + [self setButtonSubview]; +} + +- (void)setShowButtontouch:(BOOL)showbuttontouch { + _showbuttontouch = showbuttontouch; + button.showbuttontouch = _showbuttontouch; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + + [self setButtonSubview]; +} + +- (void)setButtonSubview { + + if([_joypadstyle isEqualToString:kJoyStyleFourButton]) + { + _kButtonWidthLandscapePct = 0.5; + _kButtonWidthPortraitPct = 0.5; + } + else + { + _kButtonWidthLandscapePct = 0.25; + _kButtonWidthPortraitPct = 0.25; + } + + CGSize size = self.frame.size; + + BOOL isLandscape = UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation]); + if (isLandscape) { + if ([_leftorright isEqualToString:@"Left"]) + { + button.frame = CGRectMake(0, 0, size.width * _kButtonWidthLandscapePct, size.height); + } + else + { + button.frame = CGRectMake(size.width * (1.00 - _kButtonWidthLandscapePct), 0, size.width * _kButtonWidthLandscapePct, size.height); + } + } else { + button.frame = CGRectMake(0, 0, size.width * _kButtonWidthPortraitPct, size.height); + } +} + +- (void)didAddSubview:(UIView*)theView { + [self bringSubviewToFront:button]; +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + UITouch *touch = [touches anyObject]; + _stickCenter = [touch locationInView:self]; + _stickVector->x = _stickVector->y = 0; + + [self setDPadState:DPadCenter]; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + UITouch *touch = [touches anyObject]; + _stickLocation = [touch locationInView:self]; + _stickVector->UpdateFromPoints(_stickCenter, _stickLocation); + [self calculateDPadState]; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + _clickedscreen = YES; + _stickVector->x = _stickVector->y = 0; + [self setDPadState:DPadCenter]; +} + +- (BOOL)clickedscreen { + // did the user move the joypad, use fire button(s) or use key buttons? + return _clickedscreen || button.clickedscreen || _keyButtonViewHandler.anyButtonWasTouched; +} + +- (void)setClickedscreen:(BOOL)clickedscreen { + _clickedscreen = clickedscreen; + button.clickedscreen = clickedscreen; + _keyButtonViewHandler.anyButtonWasTouched = clickedscreen; +} + +- (void)dealloc { + [_joypadstyle release]; + [_keyButtonViewHandler release]; + [_settings release]; + delete _stickVector; + [super dealloc]; +} + +- (void)calculateDPadState { + if (_stickVector->length() <= _deadZone) { + [self setDPadState:DPadCenter]; + return; + } + + CGFloat angle = _stickVector->angle(); + if (angle < 0) angle = 360 + angle; + + const CGFloat deg = 22.5; + TouchStickDPadState dPadState; + + if (angle <= 0 + deg || angle > 360 - deg) + dPadState = DPadRight; + else if (angle <= 45 + deg && angle > 45 - deg) + dPadState = DPadDownRight; + else if (angle <= 90 + deg && angle > 90 - deg) + dPadState = DPadDown; + else if (angle <= 135 + deg && angle > 135 - deg) + dPadState = DPadDownLeft; + else if (angle <= 180 + deg && angle > 180 - deg) + dPadState = DPadLeft; + else if (angle <= 225 + deg && angle > 225 - deg) + dPadState = DPadUpLeft; + else if (angle <= 270 + deg && angle > 270 - deg) + dPadState = DPadUp; + else if (angle <= 315 + deg && angle > 315 - deg) + dPadState = DPadUpRight; + else + dPadState = DPadCenter; + + [self setDPadState:dPadState]; +} + +- (void)setDPadState:(TouchStickDPadState)state { + if (_oldstate != state) { + [self pushKey:state]; + } + + _oldstate = state; +} + +- (void)pushKey:(TouchStickDPadState)dpadstate { + + NSString *configuredkeyhorizontal = NULL; + NSString *configuredkeyvertical = NULL; + int asciicodehorizontal = NULL; + int asciicodevertical = NULL; + + if([self dpadstatetojoypadkey:dpadstate direction:@"horizontal"]) + { + configuredkeyhorizontal = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", [self dpadstatetojoypadkey: dpadstate direction:@"horizontal"]]]; + asciicodehorizontal = [[configuredkeyhorizontal stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + } + + if([self dpadstatetojoypadkey:dpadstate direction:@"vertical"]) + { + configuredkeyvertical = [_settings stringForKey:[NSString stringWithFormat: @"_BTN_%d", [self dpadstatetojoypadkey: dpadstate direction:@"vertical"]]]; + asciicodevertical = [[configuredkeyvertical stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + } + + if(_asciicodekeytoreleasehorizontal) + { + SDL_Event ed = { SDL_KEYUP }; + ed.key.keysym.sym = (SDLKey) _asciicodekeytoreleasehorizontal; + SDL_PushEvent(&ed); + _asciicodekeytoreleasehorizontal = NULL; + } + + if(_asciicodekeytoreleasevertical) + { + SDL_Event ed = { SDL_KEYUP }; + ed.key.keysym.sym = (SDLKey) _asciicodekeytoreleasevertical; + SDL_PushEvent(&ed); + _asciicodekeytoreleasevertical = NULL; + } + + if(dpadstate == DPadCenter) + { + //In case multiple "Joypads" get implemented this line needs to be checked + TheJoyStick->setDPadState(DPadCenter); + return; + } + + if([configuredkeyhorizontal isEqualToString:@"Joypad"] && [configuredkeyvertical isEqual:@"joypad"]) + { + TheJoyStick->setDPadState(dpadstate); + return; + } + + if([configuredkeyhorizontal isEqualToString:@"Joypad"]) + { + TheJoyStick->setDPadState(dpadstate); + } + else if(configuredkeyhorizontal) + { + _asciicodekeytoreleasehorizontal = asciicodehorizontal; + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = (SDLKey) asciicodehorizontal; + SDL_PushEvent(&ed); + } + + if([configuredkeyvertical isEqualToString:@"Joypad"]) + { + TheJoyStick->setDPadState(dpadstate); + } + else if (configuredkeyvertical) + { + _asciicodekeytoreleasevertical = asciicodevertical; + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = (SDLKey) asciicodevertical; + SDL_PushEvent(&ed); + } + +} + +- (int)dpadstatetojoypadkey:(TouchStickDPadState)dpadstate direction:(NSString *)direction { + + if(dpadstate == DPadUp) + { + if([direction isEqual:@"vertical"]) + return BTN_UP; + else + return NULL; + } + else if(dpadstate == DPadUpLeft) + { + if([direction isEqual:@"vertical"]) + return BTN_UP; + else + return BTN_LEFT; + } + else if(dpadstate == DPadUpRight) + { + if([direction isEqual:@"horizontal"]) + return BTN_UP; + else + return BTN_RIGHT; + } + else if(dpadstate == DPadDown) + { + if([direction isEqual:@"vertical"]) + return BTN_DOWN; + else + return NULL; + } + else if (dpadstate == DPadDownLeft) + { + if([direction isEqual:@"vertical"]) + return BTN_DOWN; + else + return BTN_LEFT; + } + else if (dpadstate == DPadDownRight) + { + if([direction isEqual:@"vertical"]) + return BTN_DOWN; + else + return BTN_RIGHT; + } + else if (dpadstate == DPadLeft) + { + if([direction isEqual:@"vertical"]) + return NULL; + else + return BTN_LEFT; + } + else if (dpadstate == DPadRight) + { + if([direction isEqual:@"vertical"]) + return NULL; + else + return BTN_RIGHT; + } + return NULL; +} + +@end \ No newline at end of file diff --git a/Classes/OnscreenControllerView.h b/Classes/OnscreenControllerView.h new file mode 100644 index 0000000..d0d8e39 --- /dev/null +++ b/Classes/OnscreenControllerView.h @@ -0,0 +1,44 @@ +/* + Frodo, Commodore 64 emulator for the iPhone + Copyright (C) 2007, 2008 Stuart Carnie + See gpl.txt for license information. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#import +#import "CGVector.h" +#import "touchstick.h" +#import "Settings.h" +#import "InputControllProtocol.h" + +@class FireButtonView; + +@interface OnScreenControllerView : UIView { + FireButtonView *button; + CGPoint _stickCenter; + CGPoint _stickLocation; + CGVector2D *_stickVector; + BOOL _trackingStick; + CJoyStick *TheJoyStick; + + float _deadZone; // represents the deadzone radius, where the DPad state will be considered DPadCenter +} + +@property (nonatomic, assign) id delegate; +@property (nonatomic, readwrite) BOOL clickedscreen; +- (void)reloadJoypadSettings; +- (void)onJoypadActivated; + +@end diff --git a/Classes/ScrollToRowHandler.h b/Classes/ScrollToRowHandler.h new file mode 100644 index 0000000..0d01f74 --- /dev/null +++ b/Classes/ScrollToRowHandler.h @@ -0,0 +1,56 @@ +// Created by Simon Toens on 06.08.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +/** + * Handles scrolling to a previously specified UITableView row. + */ +@interface ScrollToRowHandler : NSObject + +- (instancetype)init __unavailable; + +/** + * The given identity is used to uniquely identify the specified tableView. + */ +- (instancetype)initWithTableView:(UITableView *)tableView identity:(NSString *)identity; + +/** + * Sets a row to scroll to. + * + * The row set here is associated with the identity specified in the init method; the given indexPath is persisted + * across instances of this class. + */ +- (void)setRow:(NSIndexPath *)indexPath; + +/** + * Returns the row that was previously set. + */ +- (NSIndexPath *)getRow; + +/** + * Clears the row that was previously set. + */ +- (void)clearRow; + +/** + * Scrolls to the previously set row. If no row has been set, calling this method is a noop. + * + * Returns the row scrolled to, or nil if no row has been set. + */ +- (NSIndexPath *)scrollToRow; + +@end diff --git a/Classes/ScrollToRowHandler.m b/Classes/ScrollToRowHandler.m new file mode 100644 index 0000000..1287853 --- /dev/null +++ b/Classes/ScrollToRowHandler.m @@ -0,0 +1,70 @@ +// Created by Simon Toens on 06.08.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "ScrollToRowHandler.h" + +@implementation ScrollToRowHandler { + @private + UITableView *_tableView; + NSString *_identity; +} + +- (instancetype)initWithTableView:(UITableView *)tableView identity:(NSString *)identity { + if (self = [super init]) { + _tableView = [tableView retain]; + _identity = [identity retain]; + } + return self; +} + +- (void)setRow:(NSIndexPath *)indexPath { + [[ScrollToRowHandler dict] setObject:indexPath forKey:_identity]; +} + +- (NSIndexPath *)getRow { + return [[ScrollToRowHandler dict] objectForKey:_identity]; +} + +- (void)clearRow { + [[ScrollToRowHandler dict] removeObjectForKey:_identity]; +} + +- (NSIndexPath *)scrollToRow { + NSIndexPath *row = [self getRow]; + if (row) { + [_tableView scrollToRowAtIndexPath:row + atScrollPosition:UITableViewScrollPositionTop + animated:NO]; + } + return row; +} + +- (void)dealloc { + [_tableView release]; + [_identity release]; + [super dealloc]; +} + ++ (NSMutableDictionary *)dict { + static NSMutableDictionary *dict = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + dict = [[NSMutableDictionary alloc] init]; + }); + return dict; +} + +@end diff --git a/Classes/SelectEffectController.h b/Classes/SelectEffectController.h index b8fdee9..04dfb0e 100644 --- a/Classes/SelectEffectController.h +++ b/Classes/SelectEffectController.h @@ -8,17 +8,11 @@ #import -@protocol SelectEffectDelegate -- (void)didSelectEffect:(int)effect name:(NSString*)name; -@end +@interface SelectEffectController : UIViewController -@interface SelectEffectController : UIViewController { - NSArray *effects; - id delegate; - NSInteger lastSelectedRow; -} +@property (nonatomic, strong) NSArray *effectNames; +@property (nonatomic, assign) NSUInteger selectedEffectIndex; +@property (nonatomic, strong) NSString *selectedEffectName; +@property (nonatomic, strong) IBOutlet UIPickerView *effectsPicker; -- (void)setDelegate:(id)delegate; -- (IBAction)done:(id)sender; - -@end +@end \ No newline at end of file diff --git a/Classes/SelectEffectController.m b/Classes/SelectEffectController.m deleted file mode 100644 index a64e7d0..0000000 --- a/Classes/SelectEffectController.m +++ /dev/null @@ -1,65 +0,0 @@ -// -// SelectEffectController.m -// iAmiga -// -// Created by Stuart Carnie on 1/19/11. -// Copyright 2011 Manomio LLC. All rights reserved. -// - -#import "SelectEffectController.h" - - -@implementation SelectEffectController - -- (void)viewDidLoad { - [super viewDidLoad]; - - effects = [[NSMutableArray alloc] initWithObjects: - @"None", - @"Scanline (50%)", - @"Scanline (100%)", - @"Aperture 1x2 RB", - @"Aperture 1x3 RB", - @"Aperture 2x4 RB", - @"Aperture 2x4 BG", - nil]; - lastSelectedRow = 0; -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { - return 1; -} - -- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { - return [effects count]; -} - -- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { - return [effects objectAtIndex:row]; -} - -- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { - lastSelectedRow = row; -} - -- (IBAction)done:(id)sender { - [delegate didSelectEffect:lastSelectedRow name:[effects objectAtIndex:lastSelectedRow]]; - [self dismissModalViewControllerAnimated:YES]; -} - -- (void)setDelegate:(id)aDelegate { - delegate = aDelegate; -} - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/Classes/SelectEffectController.mm b/Classes/SelectEffectController.mm new file mode 100644 index 0000000..79abaa9 --- /dev/null +++ b/Classes/SelectEffectController.mm @@ -0,0 +1,43 @@ +// +// SelectEffectController.m +// iAmiga +// +// Created by Stuart Carnie on 1/19/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// + +#import "SelectEffectController.h" +#import "SDL.h" +#import "UIKitDisplayView.h" + +@implementation SelectEffectController + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [_effectsPicker selectRow:_selectedEffectIndex inComponent:0 animated:YES]; + [self pickerView:_effectsPicker didSelectRow:_selectedEffectIndex inComponent:0]; +} + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { + return 1; +} + +- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { + return [_effectNames count]; +} + +- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { + return [_effectNames objectAtIndex:row]; +} + +- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { + _selectedEffectIndex = row; +} + +- (void)dealloc { + [_effectNames release]; + [_effectsPicker release]; + [super dealloc]; +} + +@end \ No newline at end of file diff --git a/Classes/SelectEffectController.xib b/Classes/SelectEffectController.xib deleted file mode 100644 index ff943d1..0000000 --- a/Classes/SelectEffectController.xib +++ /dev/null @@ -1,481 +0,0 @@ - - - - 1056 - 10J567 - 823 - 1038.35 - 462.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 290 - {320, 216} - - IBCocoaTouchFramework - YES - - - - 292 - {{228, 224}, {72, 37}} - - NO - IBCocoaTouchFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Done - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - - {320, 300} - - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - dataSource - - - - 5 - - - - delegate - - - - 6 - - - - done: - - - 7 - - 8 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - 7 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 4.IBPluginDependency - 7.IBPluginDependency - - - YES - SelectEffectController - UIResponder - {{1211, 425}, {320, 300}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 8 - - - - YES - - SelectEffectController - UIViewController - - done: - id - - - done: - - done: - id - - - - delegate - id - - - delegate - - delegate - id - - - - IBProjectSource - Classes/SelectEffectController.h - - - - UIButton - - IBProjectSource - Classes/CocoaUtility.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIPickerView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPickerView.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../iAmiga.xcodeproj - 3 - 132 - - diff --git a/Classes/SelectHardware.h b/Classes/SelectHardware.h deleted file mode 100644 index 60a8ba1..0000000 --- a/Classes/SelectHardware.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// SelectHardware.h -// iAmiga -// -// Created by Stuart Carnie on 6/19/11. -// Copyright 2011 Manomio LLC. All rights reserved. -// - -#import - -@protocol SelectHardwareDelegate -- (void)didSelectHardware:(int)joystick name:(NSString*)name; -@end - -@interface SelectHardware : UIViewController { - NSArray *controllers; - id delegate; - NSInteger lastSelectedRow; -} - -- (void)setDelegate:(id)delegate; -- (IBAction)done:(id)sender; - -@end diff --git a/Classes/SelectHardware.m b/Classes/SelectHardware.m deleted file mode 100644 index d450c8c..0000000 --- a/Classes/SelectHardware.m +++ /dev/null @@ -1,60 +0,0 @@ -// -// SelectHardware.m -// iAmiga -// -// Created by Stuart Carnie on 6/19/11. -// Copyright 2011 Manomio LLC. All rights reserved. -// - -#import "SelectHardware.h" - - -@implementation SelectHardware - -- (void)viewDidLoad { - [super viewDidLoad]; - - controllers = [[NSMutableArray alloc] initWithObjects: - @"iCADE", - @"iControlPad", - nil]; - lastSelectedRow = 0; -} - -- (void)viewDidUnload { - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { - return 1; -} - -- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { - return [controllers count]; -} - -- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { - return [controllers objectAtIndex:row]; -} - -- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { - lastSelectedRow = row; -} - -- (IBAction)done:(id)sender { - int joystick = lastSelectedRow == 0 ? 3 : 2; - [delegate didSelectHardware:joystick name:[controllers objectAtIndex:lastSelectedRow]]; - [self dismissModalViewControllerAnimated:YES]; -} - -- (void)setDelegate:(id)aDelegate { - delegate = aDelegate; -} - -- (void)dealloc { - [super dealloc]; -} - -@end diff --git a/Classes/SelectHardware.xib b/Classes/SelectHardware.xib deleted file mode 100644 index 54ae518..0000000 --- a/Classes/SelectHardware.xib +++ /dev/null @@ -1,250 +0,0 @@ - - - - 1056 - 10J869 - 1306 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 - - - YES - IBUIPickerView - IBUIButton - IBUIView - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 290 - {320, 216} - - - - IBCocoaTouchFramework - YES - - - - 292 - {{228, 224}, {72, 37}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - 1 - Done - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - - {320, 300} - - - - - 3 - MQA - - 2 - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - dataSource - - - - 6 - - - - delegate - - - - 7 - - - - done: - - - 7 - - 8 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - 5 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 4.IBPluginDependency - 5.IBPluginDependency - - - YES - SelectHardware - UIResponder - {{556, 412}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 8 - - - - YES - - SelectHardware - UIViewController - - done: - id - - - done: - - done: - id - - - - IBProjectSource - ./Classes/SelectHardware.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 301 - - diff --git a/Classes/SettingHardwareController.h b/Classes/SettingHardwareController.h new file mode 100644 index 0000000..99dc1b7 --- /dev/null +++ b/Classes/SettingHardwareController.h @@ -0,0 +1,21 @@ +// +// SettingHardwareController.h +// iUAE +// +// Created by Urs on 03.04.17. +// +// + +#import + +@interface SettingHardwareController : UITableViewController + +@property (retain, nonatomic) IBOutlet UISlider *cmemslider; +@property (retain, nonatomic) IBOutlet UISlider *fmemslider; +@property (retain, nonatomic) IBOutlet UILabel *cmemlabel; +@property (retain, nonatomic) IBOutlet UILabel *fmemlabel; + +- (IBAction)cMemChanged:(id)sender; +- (IBAction)fMemChanged:(id)sender; + +@end diff --git a/Classes/SettingHardwareController.m b/Classes/SettingHardwareController.m new file mode 100644 index 0000000..5142543 --- /dev/null +++ b/Classes/SettingHardwareController.m @@ -0,0 +1,107 @@ +// +// SettingHardwareController.m +// iUAE +// +// Created by Urs on 03.04.17. +// +// + +#import "SettingHardwareController.h" +#import "CoreSetting.h" +#import "Settings.h" +#import "UnappliedSettingLabelHandler.h" + +@interface SettingHardwareController () + +@end + +@implementation SettingHardwareController { + Settings *_settings; + CMemCoreSetting *_cmem; + FMemCoreSetting *_fmem; + UnappliedSettingLabelHandler *_settingLabelHandler; +} + +- (IBAction)cMemChanged:(id)sender { + _cmemslider.value = (int) (_cmemslider.value + (float) 0.5); + + [_cmem setValue:[NSNumber numberWithFloat:_cmemslider.value*512]]; + _cmemlabel.text = [NSString stringWithFormat:@"%i KB", (int) _cmemslider.value*512]; + + [self setupWarningLabels]; +} + +- (IBAction)fMemChanged:(id)sender { + _fmemslider.value = (int) (_fmemslider.value + (float) 0.5); + + [_fmem setValue:[NSNumber numberWithFloat:_fmemslider.value]]; + _fmemlabel.text = [NSString stringWithFormat:@"%i MB", (int) _fmemslider.value]; + + [self setupWarningLabels]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + _settingLabelHandler = [[UnappliedSettingLabelHandler alloc] init]; + _cmem = [CMemCoreSetting getInstance]; + _fmem = [FMemCoreSetting getInstance]; +} + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + [_settingLabelHandler layoutLabels]; +} + +- (void)setupWarningLabels { + [_settingLabelHandler updateLabelStates]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + float memkb = [[_cmem getValue] floatValue]; + _cmemslider.value = memkb / 512; + _fmemslider.value = [[_fmem getValue] floatValue]; + + _fmemlabel.text = [NSString stringWithFormat:@"%i MB", (int) _fmemslider.value]; + _cmemlabel.text = [NSString stringWithFormat:@"%i KB", (int) _cmemslider.value*512]; + + [self setupWarningLabels]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [super tableView:self.tableView cellForRowAtIndexPath:indexPath]; + + if (indexPath.section == 0 && indexPath.row == 1) // fmem + { + [_settingLabelHandler addResetWarningLabelForCell:cell forSetting:_fmem]; + } + + if (indexPath.section == 0 && indexPath.row == 0) // cmem + { + [_settingLabelHandler addResetWarningLabelForCell:cell forSetting:_cmem]; + } + return cell; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (void)dealloc { + [_settings release]; + [_cmemslider release]; + [_fmemslider release]; + + [_cmemlabel release]; + [_fmemlabel release]; + [super dealloc]; +} + +@end diff --git a/Classes/SettingsController.xib b/Classes/SettingsController.xib deleted file mode 100644 index 24cd637..0000000 --- a/Classes/SettingsController.xib +++ /dev/null @@ -1,1077 +0,0 @@ - - - - 1280 - 11C74 - 1938 - 1138.23 - 567.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 - - - YES - IBUIButton - IBUISwitch - IBUIView - IBUILabel - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - - YES - - - 292 - {{79, 20}, {221, 37}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - 3 - MQA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MC41AA - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - {{20, 20}, {42, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - DF0 - - 1 - MCAwIDAAA - - - 1 - 10 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 292 - {{79, 65}, {221, 37}} - - - - NO - NO - 1 - IBCocoaTouchFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{20, 65}, {42, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - DF1 - - - 1 - 10 - - - - - - 292 - {{20, 110}, {101, 37}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Reset Amiga - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{129, 110}, {74, 37}} - - - - NO - NO - 1000 - IBCocoaTouchFramework - 0 - 0 - 1 - Save - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{211, 110}, {81, 37}} - - - - NO - NO - 1001 - IBCocoaTouchFramework - 0 - 0 - 1 - Restore - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{20, 155}, {101, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - Show Status: - - - 1 - 10 - - - - - - 292 - {{20, 184}, {94, 27}} - - - - NO - YES - YES - IBCocoaTouchFramework - 0 - 0 - YES - - - - 292 - {{20, 264}, {101, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - Full Screen: - - - 1 - 10 - - - - - - 292 - {{206, 264}, {94, 27}} - - - - NO - YES - YES - IBCocoaTouchFramework - 0 - 0 - YES - - - - 292 - {{206, 155}, {101, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - NTSC: - - - 1 - 10 - - - - - - 292 - {{206, 184}, {94, 27}} - - - - NO - YES - YES - IBCocoaTouchFramework - 0 - 0 - - - - -2147483356 - {{20, 379}, {82, 37}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Reset Log - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - -2147483356 - {{206, 384}, {94, 27}} - - - - NO - YES - YES - IBCocoaTouchFramework - 0 - 0 - YES - - - - -2147483356 - {{110, 384}, {101, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - Logging: - - - 1 - 10 - - - - - - 292 - {{20, 226}, {49, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Effect: - - - 1 - 10 - - - - - - 292 - {{79, 219}, {221, 37}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - - - 292 - {{20, 293}, {79, 21}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Controller: - - - 1 - 10 - - Helvetica - Helvetica - 0 - 17 - - - - - - 292 - {{20, 322}, {280, 37}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - - - - {320, 431} - - - - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - status - - - - 15 - - - - displayModeNTSC - - - - 27 - - - - resetLog - - - - 37 - - - - logging - - - - 44 - - - - loggingLabel - - - - 45 - - - - effect - - - - 49 - - - - controller - - - - 59 - - - - selectDrive: - - - 7 - - 8 - - - - selectDrive: - - - 7 - - 9 - - - - resetAmiga: - - - 7 - - 11 - - - - toggleStatus: - - - 13 - - 14 - - - - toggleNTSC: - - - 13 - - 26 - - - - resetLog: - - - 7 - - 36 - - - - toggleLogging: - - - 13 - - 43 - - - - selectEffect: - - - 7 - - 50 - - - - integralSize: - - - 7 - - 54 - - - - selectController: - - - 7 - - 58 - - - - otherAction: - - - 7 - - 64 - - - - otherAction: - - - 7 - - 65 - - - - - YES - - 0 - - YES - - - - - - 1 - - - YES - - - - - - - - - - - - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - DF0 Button - - - 5 - - - - - 6 - - - DF1 Button - - - 7 - - - - - 10 - - - Reset UAE - - - 12 - - - - - 13 - - - Status Switch - - - 23 - - - - - 24 - - - Status Switch - - - 28 - - - Reset UAE - - - 40 - - - Status Switch - - - 42 - - - - - 47 - - - - - 48 - - - - - 51 - - - - - 52 - - - Status Switch - - - 55 - - - - - 56 - - - - - 60 - - - Save - - - 62 - - - Restore - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 10.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 23.IBPluginDependency - 24.IBPluginDependency - 28.IBPluginDependency - 4.IBPluginDependency - 40.IBPluginDependency - 42.IBPluginDependency - 47.IBPluginDependency - 48.IBPluginDependency - 5.IBPluginDependency - 51.IBPluginDependency - 52.IBPluginDependency - 55.IBPluginDependency - 56.IBPluginDependency - 6.IBPluginDependency - 60.IBPluginDependency - 62.IBPluginDependency - 7.IBPluginDependency - - - YES - SettingsController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 65 - - - - YES - - SettingsController - UIViewController - - YES - - YES - integralSize: - otherAction: - resetAmiga: - resetLog: - selectController: - selectDrive: - selectEffect: - toggleLogging: - toggleNTSC: - toggleStatus: - - - YES - id - id - id - id - id - UIButton - id - id - id - id - - - - YES - - YES - integralSize: - otherAction: - resetAmiga: - resetLog: - selectController: - selectDrive: - selectEffect: - toggleLogging: - toggleNTSC: - toggleStatus: - - - YES - - integralSize: - id - - - otherAction: - id - - - resetAmiga: - id - - - resetLog: - id - - - selectController: - id - - - selectDrive: - UIButton - - - selectEffect: - id - - - toggleLogging: - id - - - toggleNTSC: - id - - - toggleStatus: - id - - - - - YES - - YES - controller - displayModeNTSC - effect - logging - loggingLabel - resetLog - status - - - YES - UIButton - UISwitch - UIButton - UISwitch - UILabel - UIButton - UISwitch - - - - YES - - YES - controller - displayModeNTSC - effect - logging - loggingLabel - resetLog - status - - - YES - - controller - UIButton - - - displayModeNTSC - UISwitch - - - effect - UIButton - - - logging - UISwitch - - - loggingLabel - UILabel - - - resetLog - UIButton - - - status - UISwitch - - - - - IBProjectSource - ./Classes/SettingsController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 933 - - diff --git a/Classes/SettingsController.h b/Classes/SettingsControllerOld.h similarity index 76% rename from Classes/SettingsController.h rename to Classes/SettingsControllerOld.h index bbccf01..743eec1 100644 --- a/Classes/SettingsController.h +++ b/Classes/SettingsControllerOld.h @@ -11,7 +11,7 @@ #import "SelectEffectController.h" #import "SelectHardware.h" -@interface SettingsController : UIViewController { +@interface SettingsController : UITableViewController { IBOutlet UISwitch *status; IBOutlet UISwitch *displayModeNTSC; IBOutlet UIButton *resetLog; @@ -19,6 +19,9 @@ IBOutlet UILabel *loggingLabel; IBOutlet UIButton *effect; IBOutlet UIButton *controller; + IBOutlet UIButton *df0; + IBOutlet UIButton *df1; + IBOutlet UISwitch *stretchscreen; } - (IBAction)selectDrive:(UIButton*)sender; @@ -31,5 +34,6 @@ - (IBAction)selectEffect:(id)sender; - (IBAction)integralSize:(id)sender; - (IBAction)selectController:(id)sender; +- (IBAction)toggleStretchScreen:(id)sender; @end diff --git a/Classes/SettingsController.mm b/Classes/SettingsControllerOld.mm similarity index 60% rename from Classes/SettingsController.mm rename to Classes/SettingsControllerOld.mm index 9f658ed..a17c5c9 100644 --- a/Classes/SettingsController.mm +++ b/Classes/SettingsControllerOld.mm @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 9/30/09. // Copyright 2009 __MyCompanyName__. All rights reserved. // +// Changed by Emufr3ak on 17.11.2014 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import "SettingsController.h" #import "EMUROMBrowserViewController.h" @@ -24,18 +39,48 @@ extern int mainMenu_showStatus; extern int mainMenu_ntsc; +extern int mainMenu_stretchscreen; +extern int joystickselected; @implementation SettingsController + +static NSMutableArray *Filename; extern int do_disa; // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; - + + if(!Filename) + { + Filename = [[NSMutableArray alloc] init]; + [Filename addObject:[NSMutableString new]]; + [Filename addObject:[NSMutableString new]]; + } + + stretchscreen.on = mainMenu_stretchscreen ? YES : NO; status.on = mainMenu_showStatus ? YES : NO; displayModeNTSC.on = mainMenu_ntsc ? YES : NO; - [controller setTitle:@"iCADE" forState:UIControlStateNormal]; + + + + NSString *controllername; + + switch(joystickselected) + { + case 4: + controllername = @"MFI"; + break; + case 3: + controllername = @"iCADE"; + break; + default: + controllername = @"iControlPAD"; + break; + } + + [controller setTitle:controllername forState:UIControlStateNormal]; #if DISASSEMBLER resetLog.hidden = NO; @@ -48,21 +93,32 @@ - (void)viewWillAppear:(BOOL)animated { #if DISASSEMBLER logging.on = do_disa == 0 ? NO : YES; #endif + + NSString *df0title = [[Filename objectAtIndex:0] length] == 0 ? @"Empty" : [Filename objectAtIndex:0]; + NSString *df1title = [[Filename objectAtIndex:1] length] == 0 ? @"Empty" : [Filename objectAtIndex:1]; + + [df0 setTitle:df0title forState:UIControlStateNormal]; + [df1 setTitle:df1title forState:UIControlStateNormal]; } - (IBAction)selectDrive:(UIButton*)sender { - EMUROMBrowserViewController *browser = [[EMUROMBrowserViewController alloc] initWithNibName:@"EMUROMBrowserView" bundle:nil]; + + NSString *xibfile = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ? @"EMUROMBrowserView-ipad" : @"EMUROMBrowserView"; + + EMUROMBrowserViewController *browser = [[EMUROMBrowserViewController alloc] initWithNibName:xibfile bundle:nil]; browser.delegate = self; browser.context = sender; - [self presentModalViewController:browser animated:YES]; - [browser release]; + //[self presentModalViewController:browser animated:YES]; + [self.navigationController pushViewController:browser animated:YES]; + [browser release]; } - (IBAction)selectEffect:(id)sender { SelectEffectController *ctl = [[SelectEffectController alloc] initWithNibName:@"SelectEffectController" bundle:nil]; [ctl setDelegate:self]; - [self presentModalViewController:ctl animated:YES]; - [ctl release]; + //[self presentModalViewController:ctl animated:YES]; + [self.navigationController pushViewController:ctl animated:YES]; + [ctl release]; } - (void)didSelectEffect:(int)aEffect name:(NSString*)name { @@ -75,7 +131,8 @@ - (void)didSelectEffect:(int)aEffect name:(NSString*)name { - (IBAction)selectController:(id)sender { SelectHardware *ctl = [[SelectHardware alloc] initWithNibName:@"SelectHardware" bundle:nil]; [ctl setDelegate:self]; - [self presentModalViewController:ctl animated:YES]; + //[self presentModalViewController:ctl animated:YES]; + [self.navigationController pushViewController:ctl animated:YES]; [ctl release]; } @@ -88,8 +145,11 @@ - (void)didSelectHardware:(int)joystick name:(NSString *)name { - (void)didSelectROM:(EMUFileInfo *)fileInfo withContext:(UIButton*)sender { NSString *path = [fileInfo path]; + NSString *tst = [fileInfo fileName]; int df = sender.tag; [sender setTitle:[fileInfo fileName] forState:UIControlStateNormal]; + [Filename replaceObjectAtIndex:df withObject:[NSMutableString stringWithString:[fileInfo fileName]]]; + [path getCString:changed_df[df] maxLength:256 encoding:[NSString defaultCStringEncoding]]; real_changed_df[df]=1; } @@ -108,6 +168,10 @@ - (IBAction)toggleStatus:(UISwitch*)sender { mainMenu_showStatus = sender.on ? 1 : 0; } +- (IBAction)toggleStretchScreen:(id)sender { + mainMenu_stretchscreen = stretchscreen.on ? 1 : 0; +} + - (IBAction)resetLog:(id)sender { #if DISASSEMBLER DisaCloseFile(); diff --git a/Classes/SettingsDisplayController.h b/Classes/SettingsDisplayController.h new file mode 100644 index 0000000..6c28d22 --- /dev/null +++ b/Classes/SettingsDisplayController.h @@ -0,0 +1,21 @@ +// +// SettingsDisplayController.h +// iUAE +// +// Created by Urs on 01.03.15. +// +// + +#import + +@interface SettingsDisplayController : UITableViewController + +@property (nonatomic, assign) IBOutlet UISwitch *ntsc; +@property (nonatomic, assign) IBOutlet UISwitch *stretchscreen; +@property (nonatomic, assign) IBOutlet UISwitch *showstatus; +@property (nonatomic, assign) IBOutlet UISwitch *showstatusbar; +@property (nonatomic, assign) IBOutlet UILabel *selectedEffectLabel; +@property (nonatomic, assign) IBOutlet UITextField *additionalVerticalStretchValue; +@property (nonatomic, assign) IBOutlet UISlider *volumeSlider; + +@end diff --git a/Classes/SettingsDisplayController.mm b/Classes/SettingsDisplayController.mm new file mode 100644 index 0000000..9a31284 --- /dev/null +++ b/Classes/SettingsDisplayController.mm @@ -0,0 +1,148 @@ +// +// SettingsDisplayController.m +// iUAE +// +// Created by Urs on 01.03.15. +// +// + +#import "AudioService.h" +#import "CoreSetting.h" +#import "SelectEffectController.h" +#import "SettingsDisplayController.h" +#import "Settings.h" +#import "UnappliedSettingLabelHandler.h" + +extern int mainMenu_showStatus; +extern int mainMenu_stretchscreen; +extern int mainMenu_AddVerticalStretchValue; + +@implementation SettingsDisplayController { + @private + AudioService *_audioService; + NSArray *_effectNames; + NTSCEnabledCoreSetting *_ntscEnabledSetting; + SelectEffectController *_selectEffectController; + Settings *_settings; + UnappliedSettingLabelHandler *_settingLabelHandler; +} + + + +- (void)viewDidLoad { + [super viewDidLoad]; + self.edgesForExtendedLayout = UIRectEdgeNone; + _audioService = [[AudioService alloc] init]; + _settings = [[Settings alloc] init]; + _effectNames = [@[@"None", + @"Scanline (50%)", @"Scanline (100%)", + @"Aperture 1x2 RB", @"Aperture 1x3 RB", + @"Aperture 2x4 RB", @"Aperture 2x4 BG"] retain]; + self.additionalVerticalStretchValue.delegate = self; + _settingLabelHandler = [[UnappliedSettingLabelHandler alloc] init]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + _ntscEnabledSetting = [[CoreSettings ntscEnabledCoreSetting] retain]; + + [_ntsc setOn:[[_ntscEnabledSetting getValue] boolValue]]; + [_showstatus setOn:_settings.showStatus]; + [_stretchscreen setOn:_settings.stretchScreen]; + [_showstatusbar setOn:_settings.showStatusBar]; + _volumeSlider.value = [_audioService getVolume]; + [self handleSelectedEffect]; + [self setupWarningLabels]; +} + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + [_settingLabelHandler layoutLabels]; +} + +- (void)setupWarningLabels { + [_settingLabelHandler updateLabelStates]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [super tableView:self.tableView cellForRowAtIndexPath:indexPath]; + if (indexPath.section == 0 && indexPath.row == 1) // ntsc + { + [_settingLabelHandler addResetWarningLabelForCell:cell forSetting:_ntscEnabledSetting]; + } + return cell; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + [_selectEffectController release]; + _selectEffectController = [segue.destinationViewController retain]; + _selectEffectController.effectNames = _effectNames; + _selectEffectController.selectedEffectIndex = _settings.selectedEffectIndex; +} + +- (IBAction)toggleNTSC:(id)sender { + [_ntscEnabledSetting setValue:[NSNumber numberWithBool:_ntsc.isOn]]; + [self setupWarningLabels]; +} + +- (IBAction)toggleShowstatus:(id)sender { + _settings.showStatus = _showstatus.isOn; + mainMenu_showStatus = _showstatus.isOn; + [[self view] endEditing:YES]; +} + +- (IBAction)toggleStretchscreen:(id)sender { + _settings.stretchScreen = _stretchscreen.isOn; + mainMenu_stretchscreen = _stretchscreen.isOn; +} + +- (IBAction)toggleShowStatusBar { + _settings.showStatusBar = !_settings.showStatusBar; +} + +- (void)populateEffectLabel:(int)selectedEffectIndex { + NSString *effectName = [_effectNames objectAtIndex:selectedEffectIndex]; + [_selectedEffectLabel setText:effectName]; +} + +- (void)handleSelectedEffect { + int effectIndex; + if (_selectEffectController) + { + effectIndex = _selectEffectController.selectedEffectIndex; + _settings.selectedEffectIndex = effectIndex; + } + else + { + effectIndex = _settings.selectedEffectIndex; + } + [self populateEffectLabel:effectIndex]; +} + +- (IBAction)setAdditionalVerticalStretch:(id)sender { + mainMenu_AddVerticalStretchValue = (int)[_additionalVerticalStretchValue.text doubleValue]; + _settings.addVerticalStretchValue = mainMenu_AddVerticalStretchValue; +} + +- (IBAction)onVolumeChanged { + [_audioService setVolume:_volumeSlider.value]; + _settings.volume = _volumeSlider.value; +} + +- (BOOL)textFieldShouldReturn: (UITextField *)textField { + [textField resignFirstResponder]; + return YES; +} + +- (void)dealloc { + [_audioService release]; + [_effectNames release]; + [_selectEffectController release]; + [_settings release]; + [_ntscEnabledSetting release]; + [_settingLabelHandler release]; + [super dealloc]; +} + +@end diff --git a/Classes/SettingsGeneralController.h b/Classes/SettingsGeneralController.h new file mode 100644 index 0000000..9b3d7ed --- /dev/null +++ b/Classes/SettingsGeneralController.h @@ -0,0 +1,50 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 29.12.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "EMUROMBrowserViewController.h" +#import "SelectConfigurationViewController.h" +#import "DriveState.h" + +@protocol ResetDelegate + +- (void)didSelectReset:(DriveState *)driveState; + +@end + +@interface SettingsGeneralController : UITableViewController + +@property (readwrite, assign) IBOutlet UILabel *romPathLabel; +@property (readwrite, assign) IBOutlet UILabel *df0PathLabel; +@property (readwrite, assign) IBOutlet UILabel *df1PathLabel; +@property (readwrite, assign) IBOutlet UISwitch *df1Switch; +@property (readwrite, assign) IBOutlet UILabel *df2PathLabel; +@property (readwrite, assign) IBOutlet UISwitch *df2Switch; +@property (readwrite, assign) IBOutlet UILabel *df3PathLabel; +@property (readwrite, assign) IBOutlet UISwitch *df3Switch; +@property (readwrite, assign) IBOutlet UILabel *hd0PathLabel; +@property (readwrite, assign) IBOutlet UISegmentedControl *hd0ReadOnlySegmentedControl; +@property (readwrite, assign) IBOutlet UISwitch *configAutoloadSwitch; +@property (readwrite, assign) IBOutlet UILabel *configNameLabel; + +@property (readwrite, retain) UIImage *emulatorScreenshot; +@property (readwrite, assign) id resetDelegate; + +@end \ No newline at end of file diff --git a/Classes/SettingsGeneralController.mm b/Classes/SettingsGeneralController.mm new file mode 100644 index 0000000..422109d --- /dev/null +++ b/Classes/SettingsGeneralController.mm @@ -0,0 +1,465 @@ +// +// SettingsGeneralController.m +// iUAE +// +// Created by Emufr3ak on 29.12.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "CoreSetting.h" +#import "DiskDriveService.h" +#import "SettingsGeneralController.h" +#import "Settings.h" +#import "StateManagementController.h" +#import "UnappliedSettingLabelHandler.h" +#import "AudioService.h" + +static NSString *const kNoDiskLabel = @"Empty"; +static NSString *const kNoDiskAdfPath = @""; + +static NSString *const kSelectFileSegue = @"SelectFile"; +static NSString *const kAssignDiskfilesSegue = @"AssignDiskfiles"; +static NSString *const kLoadConfigurationSegue = @"LoadConfiguration"; +static NSString *const kKeyButtonsSegue = @"KeyButtons"; +static NSString *const kStateManagementSegue = @"StateManagement"; + +static const NSUInteger kRomSection = 0; +static const NSUInteger kDiskDrivesSection = 1; +static const NSUInteger kConfigSection = 2; +static const NSUInteger kMiscSection = 3; +static const NSUInteger kHardDrivesSection = 4; + +@protocol FileSelectionContext +@property (nonatomic, readonly) NSArray *extensions; +@end + +@interface AdfSelectionContext : NSObject +@property (nonatomic, assign) int driveNumber; +@end +@implementation AdfSelectionContext : NSObject +- (NSArray *)extensions { + return @[@"ADF", @"adf"]; +} +@end + +@interface RomSelectionContext : NSObject +@end +@implementation RomSelectionContext : NSObject +- (NSArray *)extensions { + return @[@"rom", @"ROM"]; +} +@end + +@interface HdfSelectionContext : NSObject +@end +@implementation HdfSelectionContext : NSObject +- (NSArray *)extensions { + return @[@"hdf", @"HDF"]; +} +@end + +@implementation SettingsGeneralController { + @private + DiskDriveService *_diskDriveService; + Settings *_settings; + UnappliedSettingLabelHandler *_settingLabelHandler; + + DF1EnabledCoreSetting *_df1EnabledSetting; + DF2EnabledCoreSetting *_df2EnabledSetting; + DF3EnabledCoreSetting *_df3EnabledSetting; + HD0PathCoreSetting *_hd0PathSetting; + HD0ReadOnlyCoreSetting *_hd0ReadOnlySetting; + RomCoreSetting *_romSetting; + NTSCEnabledCoreSetting *_ntscEnabledSetting; + CMemCoreSetting *_cmemSetting; + FMemCoreSetting *_fmemSetting; + AudioService *_audioService; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + _diskDriveService = [[DiskDriveService alloc] init]; + _settings = [[Settings alloc] init]; + _settingLabelHandler = [[UnappliedSettingLabelHandler alloc] init]; + + _df1EnabledSetting = [[CoreSettings df1EnabledCoreSetting] retain]; + _df2EnabledSetting = [[CoreSettings df2EnabledCoreSetting] retain]; + _df3EnabledSetting = [[CoreSettings df3EnabledCoreSetting] retain]; + _hd0PathSetting = [HD0PathCoreSetting getInstance]; + _hd0ReadOnlySetting = [[CoreSettings hd0ReadOnlyCoreSetting] retain]; + _romSetting = [RomCoreSetting getInstance]; + _ntscEnabledSetting = [[CoreSettings ntscEnabledCoreSetting] retain]; + _audioService = [[AudioService alloc] init]; + _cmemSetting = [CMemCoreSetting getInstance]; + _fmemSetting = [FMemCoreSetting getInstance]; +} + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + [_settingLabelHandler layoutLabels]; +} + +- (void)viewWillAppear:(BOOL)animated { + [self setupUIState]; +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; +} + +- (void)setupUIState { + [self setupRomLabel]; + [self setupDriveLabels]; + [self setupAutoloadConfigSwitch]; + [self setupConfigurationName]; + [self setupDriveEnabledSwitches]; + [self setupDriveReadOnlySwitches]; + [self setupWarningLabels]; +} + +- (void)setupDriveEnabledSwitches { + [_df1Switch setOn:[[_df1EnabledSetting getValue] boolValue]]; + [_df2Switch setOn:[[_df2EnabledSetting getValue] boolValue]]; + [_df3Switch setOn:[[_df3EnabledSetting getValue] boolValue]]; +} + +- (void)setupDriveLabels { + NSString *adfPath = [_diskDriveService getInsertedDiskForDrive:0]; + [_df0PathLabel setText:adfPath ? [adfPath lastPathComponent] : kNoDiskLabel]; + + adfPath = [_diskDriveService getInsertedDiskForDrive:1]; + [_df1PathLabel setText:adfPath ? [adfPath lastPathComponent] : kNoDiskLabel]; + + adfPath = [_diskDriveService getInsertedDiskForDrive:2]; + [_df2PathLabel setText:adfPath ? [adfPath lastPathComponent] : kNoDiskLabel]; + + adfPath = [_diskDriveService getInsertedDiskForDrive:3]; + [_df3PathLabel setText:adfPath ? [adfPath lastPathComponent] : kNoDiskLabel]; + + NSString *hdfPath = [_hd0PathSetting getValue]; + [_hd0PathLabel setText:hdfPath ? [hdfPath lastPathComponent] : @""]; +} + +- (void)setupDriveReadOnlySwitches { + NSUInteger selectedSegment = [[_hd0ReadOnlySetting getValue] boolValue] ? 0 : 1; + [_hd0ReadOnlySegmentedControl setSelectedSegmentIndex:selectedSegment]; + _hd0ReadOnlySegmentedControl.userInteractionEnabled = [_hd0PathSetting getValue] != nil; +} + +- (void)setupWarningLabels { + [_settingLabelHandler updateLabelStates]; +} + +- (void)setupRomLabel { + NSString *romPath = [_romSetting getValue]; + [_romPathLabel setText:romPath ? [romPath lastPathComponent] : @""]; +} + +- (void)setupConfigurationName { + if(_settings.configurationName) + { + [_configNameLabel setText:_settings.configurationName]; + } +} + +- (void)setupAutoloadConfigSwitch { + [_configAutoloadSwitch setOn:_settings.autoloadConfig]; +} + +- (IBAction)toggleAutoloadconfig { + _settings.autoloadConfig = !_settings.autoloadConfig; +} + +- (IBAction)toggleDF1Enabled { + [_df1EnabledSetting setValue:[NSNumber numberWithBool:_df1Switch.on]]; + [self setupWarningLabels]; +} + +- (IBAction)toogleDF2Enabled { + [_df2EnabledSetting setValue:[NSNumber numberWithBool:_df2Switch.on]]; + [self setupWarningLabels]; +} + +- (IBAction)toggleDF3Enabled { + [_df3EnabledSetting setValue:[NSNumber numberWithBool:_df3Switch.on]]; + [self setupWarningLabels]; +} + +- (IBAction)toggleHD0ReadOnly { + [_hd0ReadOnlySetting setValue:[NSNumber numberWithBool:_hd0ReadOnlySegmentedControl.selectedSegmentIndex == 0 ? YES : NO]]; + [self setupWarningLabels]; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + if (indexPath.section == kDiskDrivesSection) + { + return [_diskDriveService diskInsertedIntoDrive:indexPath.row]; + } + else if (indexPath.section == kHardDrivesSection) + { + return [_hd0PathSetting getValue] != nil; + } + return NO; +} + +- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { + return indexPath.section == kDiskDrivesSection ? @"Eject" : @"Unmount"; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell *cell = [super tableView:self.tableView cellForRowAtIndexPath:indexPath]; + NSArray *settings = [self getSettingsForIndexPath:indexPath]; + [_settingLabelHandler addResetWarningLabelForCell:cell forSettings:settings]; + return cell; +} + +- (NSArray *)getSettingsForIndexPath:(NSIndexPath *)indexPath { + if (indexPath.section == kRomSection) + { + return @[_romSetting]; + } + else if (indexPath.section == kDiskDrivesSection) + { + int driveNumber = indexPath.row; + if (driveNumber == 1) + { + return @[_df1EnabledSetting]; + } + else if (driveNumber == 2) + { + return @[_df2EnabledSetting]; + } + else if (driveNumber == 3) + { + return @[_df3EnabledSetting]; + } + + } + else if (indexPath.section == kHardDrivesSection) + { + return @[_hd0PathSetting, _hd0ReadOnlySetting]; + } + return @[]; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) + { + if (indexPath.section == kDiskDrivesSection) + { + int driveNumber = indexPath.row; + [self onAdfChanged:kNoDiskAdfPath drive:driveNumber]; + [_diskDriveService ejectDiskFromDrive:driveNumber]; + } + else + { + [_hd0PathSetting setValue:nil]; + [_hd0ReadOnlySetting setValue:[NSNumber numberWithBool:YES]]; + [self setupDriveReadOnlySwitches]; + } + [self.tableView setEditing:NO animated:YES]; + [self setupDriveLabels]; + [self setupWarningLabels]; + } +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + if (indexPath.section == kRomSection || indexPath.section == kDiskDrivesSection || indexPath.section == kHardDrivesSection) + { + id ctx = nil; + if (indexPath.section == kDiskDrivesSection) + { + ctx = [[[AdfSelectionContext alloc] init] autorelease]; + ((AdfSelectionContext *)ctx).driveNumber = indexPath.row; + } + else if (indexPath.section == kHardDrivesSection) + { + ctx = [[[HdfSelectionContext alloc] init] autorelease]; + } + else + { + ctx = [[[RomSelectionContext alloc] init] autorelease]; + } + [self performSegueWithIdentifier:kSelectFileSegue sender:ctx]; + } + else if (indexPath.section == kConfigSection) + { + if (indexPath.row == 1) + { + [self performSegueWithIdentifier:kAssignDiskfilesSegue sender:nil]; + } + else if (indexPath.row == 2) + { + [self performSegueWithIdentifier:kLoadConfigurationSegue sender:nil]; + } + } + else if (indexPath.section == kMiscSection) + { + if (indexPath.row == 0) + { + [self performSegueWithIdentifier:kKeyButtonsSegue sender:nil]; + } + else if (indexPath.row == 1) + { + [self performSegueWithIdentifier:kStateManagementSegue sender:nil]; + } + else if (indexPath.row == 2) + { + [self showResetConfirmation]; + } + } +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if ([segue.identifier isEqualToString:kSelectFileSegue]) + { + EMUROMBrowserViewController *controller = segue.destinationViewController; + id ctx = sender; + controller.extensions = ctx.extensions; + controller.delegate = self; + controller.context = ctx; + } + else if ([segue.identifier isEqualToString:kLoadConfigurationSegue]) + { + SelectConfigurationViewController *controller = segue.destinationViewController; + controller.delegate = self; + } + else if ([segue.identifier isEqualToString:kStateManagementSegue]) + { + StateManagementController *stateController = segue.destinationViewController; + stateController.emulatorScreenshot = _emulatorScreenshot; + } +} + +// SelectRomDelegate - callback when selecting an adf/rom/hdf +- (void)didSelectROM:(EMUFileInfo *)fileInfo withContext:(id)ctx { + NSString *path = [fileInfo path]; + if ([ctx class] == [RomSelectionContext class]) + { + [self didReallySelectRom:path]; + } + else if ([ctx class] == [AdfSelectionContext class]) + { + [self didSelectAdf:path context:ctx]; + } + else + { + [self didSelectHdf:path]; + } +} + +- (void)didReallySelectRom:(NSString *)romPath { + [_romSetting setValue:romPath]; + [self setupRomLabel]; +} + +- (void)didSelectAdf:(NSString *)adfPath context:(AdfSelectionContext *)ctx { + [self onAdfChanged:adfPath drive:ctx.driveNumber]; + [_diskDriveService insertDisk:adfPath intoDrive:ctx.driveNumber]; +} + +- (void)didSelectHdf:(NSString *)hdfPath { + [_hd0PathSetting setValue:hdfPath]; + [self setupDriveLabels]; + [self setupWarningLabels]; +} + +- (void)onAdfChanged:(NSString *)adfPath drive:(NSUInteger)driveNumber { + NSArray *floppyPaths = _settings.insertedFloppies; + NSMutableArray *mutableFloppyPaths = floppyPaths ? + [[floppyPaths mutableCopy] autorelease] : [[[NSMutableArray alloc] init] autorelease]; + while ([mutableFloppyPaths count] <= driveNumber) + { + // pad the array if a disk is inserted into a drive with a higher number, and + // there's nothing in the lower number drive(s) yet + [mutableFloppyPaths addObject:kNoDiskAdfPath]; + } + [mutableFloppyPaths replaceObjectAtIndex:driveNumber withObject:adfPath]; + _settings.insertedFloppies = mutableFloppyPaths; + [_settings setFloppyConfiguration:adfPath]; +} + +- (NSString *)getFirstOption { + return @"General"; +} + +- (BOOL)isRecentConfig:(NSString *)configurationname { + return [_configNameLabel.text isEqualToString:configurationname]; +} + +- (void)didSelectConfiguration:(NSString *)configurationName { + [_configNameLabel setText:configurationName]; + _settings.configurationName = configurationName; + [_ntscEnabledSetting setValue:[NSNumber numberWithBool:_settings.ntsc]]; + [_romSetting setValue: [_romSetting getValue]]; + [_hd0PathSetting setValue:[_hd0PathSetting getValue]]; + [_hd0ReadOnlySetting setValue:[_hd0ReadOnlySetting getValue]]; + [_cmemSetting setValue:[NSNumber numberWithInteger:_settings.CMem]]; + [_fmemSetting setValue:[NSNumber numberWithInteger:_settings.FMem]]; + [self setupUIState]; + [_audioService setVolume:_settings.volume]; +} + +- (void)didDeleteConfiguration { + NSArray *configurations = _settings.configurations; + + if(![configurations indexOfObject:_configNameLabel.text]) + { + [_configNameLabel setText:@"General"]; + } +} + +- (void)showResetConfirmation { + [[[[UIAlertView alloc] initWithTitle:@"Reset" + message:@"Really reset the emulator?" + delegate:self + cancelButtonTitle:@"OK" + otherButtonTitles:@"Cancel", nil] autorelease] show]; +} + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + if (buttonIndex == 0) + { + [_resetDelegate didSelectReset:[self getDriveState]]; + [CoreSettings onReset]; + [self.navigationController popToRootViewControllerAnimated:YES]; + } +} + +- (DriveState *)getDriveState { + DriveState *driveState = [DriveState getAllEnabled]; + driveState.df1Enabled = [[_df1EnabledSetting getValue] boolValue]; + driveState.df2Enabled = [[_df2EnabledSetting getValue] boolValue]; + driveState.df3Enabled = [[_df3EnabledSetting getValue] boolValue]; + return driveState; +} + +- (void)dealloc { + [_diskDriveService release]; + [_settings release]; + [_emulatorScreenshot release]; + [_settingLabelHandler release]; + + [_df1EnabledSetting release]; + [_df2EnabledSetting release]; + [_df3EnabledSetting release]; + [_hd0ReadOnlySetting release]; + + [super dealloc]; +} + +@end diff --git a/Classes/SettingsJoypadMainController.h b/Classes/SettingsJoypadMainController.h new file mode 100644 index 0000000..b1b1bb2 --- /dev/null +++ b/Classes/SettingsJoypadMainController.h @@ -0,0 +1,23 @@ +// Created by Emufreak on 31.1.2016 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface SettingsJoypadMainController : UITableViewController + +@property (retain, nonatomic) IBOutlet UILabel *LabelDetection; + +@end diff --git a/Classes/SettingsJoypadMainController.mm b/Classes/SettingsJoypadMainController.mm new file mode 100644 index 0000000..9d0e047 --- /dev/null +++ b/Classes/SettingsJoypadMainController.mm @@ -0,0 +1,47 @@ +// Created by Emufreak on 31.1.2016 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "SettingsJoypadMainController.h" +#import +#import "MPCConnectionStates.h" + +extern MPCStateType mainMenu_servermode; + +@interface SettingsJoypadMainController () + +@end + +@implementation SettingsJoypadMainController + +- (void)viewDidLoad { + [super viewDidLoad]; + + _LabelDetection.text = [[GCController controllers] count] >=1 ? @"MFI Game Controller Detected" : @"No Controller or iCade connected"; +} +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)dealloc { + [_LabelDetection release]; + [super dealloc]; +} +@end diff --git a/Classes/SettingsJoypadStyle.h b/Classes/SettingsJoypadStyle.h new file mode 100644 index 0000000..ab6d558 --- /dev/null +++ b/Classes/SettingsJoypadStyle.h @@ -0,0 +1,24 @@ +// +// SettingsJoypadStyle.h +// iUAE +// +// Created by Urs on 18.09.15. +// +// + +#import + +@protocol SelectVPadStyleDelegate +- (void)didSelectVPadStyle:(NSString *)strStyle; +@end + +@interface SettingsJoypadStyle : UITableViewController + +- (IBAction)onebuttonselected:(id)sender; +- (IBAction)fourbuttonselected:(id)sender; + +@property (retain, nonatomic) IBOutlet UITableViewCell *CellOneButton; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellFourButton; +@property (nonatomic, assign) id delegate; + +@end diff --git a/Classes/SettingsJoypadStyle.mm b/Classes/SettingsJoypadStyle.mm new file mode 100644 index 0000000..68569cd --- /dev/null +++ b/Classes/SettingsJoypadStyle.mm @@ -0,0 +1,52 @@ +// +// SettingsJoypadStyle.m +// iUAE +// +// Created by Urs on 18.09.15. +// +// + +#import "SettingsJoypadStyle.h" +#import "Settings.h" + +@implementation SettingsJoypadStyle { + Settings *_settings; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + +} + +- (void)viewWillAppear:(BOOL)animated { + NSString *vpadstyle = [_settings stringForKey:@"_joypadstyle"]; + + _CellOneButton.accessoryType = [vpadstyle isEqualToString:@"OneButton"] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + _CellFourButton.accessoryType = [vpadstyle isEqualToString:@"FourButton"] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)onebuttonselected:(id)sender { + [self.delegate didSelectVPadStyle:@"OneButton"]; + [self.navigationController popViewControllerAnimated:YES]; +} + +- (IBAction)fourbuttonselected:(id)sender { + [self.delegate didSelectVPadStyle:@"FourButton"]; + [self.navigationController popViewControllerAnimated:YES]; +} + +@end diff --git a/Classes/SettingsJoypadVpadController.h b/Classes/SettingsJoypadVpadController.h new file mode 100644 index 0000000..b022920 --- /dev/null +++ b/Classes/SettingsJoypadVpadController.h @@ -0,0 +1,36 @@ +// +// SettingsJoypadVpadController.h +// iUAE +// +// Created by Urs on 05.09.15. +// +// + +#import +#import "VPadLeftOrRight.h" +#import "SettingsJoypadStyle.h" +#import "VPadTouchOrGyro.h" + +@interface SettingsJoypadVpadController : UITableViewController + +@property (retain, nonatomic) IBOutlet UITableViewCell *Joypadstyle; +@property (retain, nonatomic) IBOutlet UITableViewCell *LeftorRight; +@property (retain, nonatomic) IBOutlet UITableViewCell *DPadMode; + +@property (retain, nonatomic) IBOutlet UITableViewCell *GyroInfo; +@property (retain, nonatomic) IBOutlet UITableViewCell *GyroCalibration; +@property (retain, nonatomic) IBOutlet UITableViewCell *GyroToggleUpDown; +@property (retain, nonatomic) IBOutlet UITableViewCell *GyroSensitivity; + + +- (IBAction)toggleShowButtonTouch:(id)sender; +@property (retain, nonatomic) IBOutlet UISwitch *swShowButtonTouch; + +- (IBAction)toggleGyroUpDown:(id)sender; +@property (retain, nonatomic) IBOutlet UISwitch *swGyroUpDown; + +- (IBAction)gyroSensitivityChanged:(UISlider *)sender; +@property (retain, nonatomic) IBOutlet UISlider *sliderGyroSensitivity; + +@end + diff --git a/Classes/SettingsJoypadVpadController.mm b/Classes/SettingsJoypadVpadController.mm new file mode 100644 index 0000000..05960bd --- /dev/null +++ b/Classes/SettingsJoypadVpadController.mm @@ -0,0 +1,173 @@ +// +// SettingsJoypadVpadController.m +// iUAE +// +// Created by Emufr3ak on 05.09.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "SettingsJoypadVpadController.h" +#import "Settings.h" +#import "VPadMotionController.h" +#import + +@interface SettingsJoypadVpadController () + +@end + +@implementation SettingsJoypadVpadController { + Settings *_settings; + NSTimer *timer; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + + [_swShowButtonTouch setOn:_settings.joypadshowbuttontouch]; + [_swGyroUpDown setOn:_settings.gyroToggleUpDown]; + [_sliderGyroSensitivity setValue:_settings.gyroSensitivity]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +-(void)viewWillAppear:(BOOL)animated { + _Joypadstyle.detailTextLabel.text = [_settings stringForKey:@"_joypadstyle"]; + _LeftorRight.detailTextLabel.text = [_settings stringForKey:@"_joypadleftorright"]; + _DPadMode.detailTextLabel.text = _settings.dpadTouchOrMotion; + _GyroSensitivity.textLabel.text = [NSString stringWithFormat:@"Gyro Sensitivity: %.2f",_settings.gyroSensitivity]; + + [_GyroInfo setHidden: _settings.DPadModeIsTouch ? YES : NO]; + [_GyroCalibration setHidden: _settings.DPadModeIsTouch ? YES : NO]; + [_GyroToggleUpDown setHidden:_settings.DPadModeIsTouch ? YES : NO]; + [_GyroSensitivity setHidden:_settings.DPadModeIsTouch ? YES : NO]; + + + if ([_GyroInfo isHidden] == NO){ + + [VPadMotionController startUpdating]; + + timer = [NSTimer scheduledTimerWithTimeInterval:1.0/60.0 target:self selector:@selector(updateValues:) userInfo:nil repeats:YES]; + + } + + [self.tableView reloadData]; +} + +-(void)viewDidDisappear:(BOOL)animated { + + [VPadMotionController stopUpdating]; +} + +-(void) updateValues:(NSTimer *)timer{ + double refRoll = [VPadMotionController referenceAttitude].roll; + double refPitch = [VPadMotionController referenceAttitude].pitch; + + double roll = [VPadMotionController getMotion].roll; + double pitch = [VPadMotionController getMotion].pitch; + + _GyroInfo.detailTextLabel.text = [NSString stringWithFormat: @"Reference t/d %.2f, l/r %.2f - current t/d %.2f, l/r %.2f",refRoll, refPitch, roll, pitch]; + +} + + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.row == 4) + { + [VPadMotionController calibrate]; + } +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + UITableViewCell* cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; + + if((cell == _GyroInfo || cell == _GyroCalibration || cell == _GyroToggleUpDown || cell == _GyroSensitivity) && _settings.DPadModeIsTouch) + return 0; //set the hidden cell's height to 0 + + return [super tableView:tableView heightForRowAtIndexPath:indexPath]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)didSelectVPadPosition:(NSString *)strPosition { + [_settings setObject:strPosition forKey:@"_joypadleftorright"]; +} + +- (void)didSelectVPadStyle:(NSString *)strStyle { + [_settings setObject:strStyle forKey:@"_joypadstyle"]; +} + +- (void)didSelectVPadDirection:(NSString *)strType { + _settings.dpadTouchOrMotion = strType; +} + + +- (void)toggleShowButtonTouch:(id)sender { + _settings.joypadshowbuttontouch = !_settings.joypadshowbuttontouch; +} + +- (void)toggleGyroUpDown:(id)sender{ + _settings.gyroToggleUpDown = !_settings.gyroToggleUpDown; +} + +- (IBAction)gyroSensitivityChanged:(UISlider *)sender { + _settings.gyroSensitivity = sender.value; + _GyroSensitivity.textLabel.text = [NSString stringWithFormat:@"Gyro Sensitivity: %.2f",_settings.gyroSensitivity]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if([segue.identifier isEqualToString:@"SelectLeftOrRight"]) { + VPadLeftOrRight *controller = segue.destinationViewController; + controller.delegate = self; + } + else if([segue.identifier isEqualToString:@"SelectVpadStyle"]) + { + SettingsJoypadStyle *controller = segue.destinationViewController; + controller.delegate = self; + } + else if([segue.identifier isEqualToString:@"SelectDPadMode"]) + { + VPadTouchOrGyro *controller = segue.destinationViewController; + controller.delegate = self; + } +} + +- (void)dealloc { + + [timer release]; + [_swShowButtonTouch release]; + [_settings release]; + [_Joypadstyle release]; + [_LeftorRight release]; + [_DPadMode release]; + [_GyroInfo release]; + [_GyroCalibration release]; + [_swGyroUpDown release]; + [_GyroToggleUpDown release]; + [_GyroSensitivity release]; + [_sliderGyroSensitivity release]; + [super dealloc]; +} + +@end diff --git a/Classes/SettingsMouseController.h b/Classes/SettingsMouseController.h new file mode 100644 index 0000000..adb47a3 --- /dev/null +++ b/Classes/SettingsMouseController.h @@ -0,0 +1,25 @@ +// +// SettingsMouseController.h +// iUAE +// +// Created by Urs on 08.08.16. +// +// + +#import + +@interface SettingsMouseController : UITableViewController + +@property (retain, nonatomic) IBOutlet UISwitch *rstickSwitch; +@property (retain, nonatomic) IBOutlet UISwitch *lstickSwitch; +@property (retain, nonatomic) IBOutlet UISwitch *butSwitch; +@property (retain, nonatomic) IBOutlet UISwitch *rbutSwitch; +@property (retain, nonatomic) IBOutlet UISwitch *speedSwitch; + +- (IBAction)togglerStick:(id)sender; +- (IBAction)togglelStick:(id)sender; +- (IBAction)togglebutSwitch:(id)sender; +- (IBAction)togglerbutSwitch:(id)sender; +- (IBAction)togglespeedSwitch:(id)sender; + +@end diff --git a/Classes/SettingsMouseController.m b/Classes/SettingsMouseController.m new file mode 100644 index 0000000..6447270 --- /dev/null +++ b/Classes/SettingsMouseController.m @@ -0,0 +1,57 @@ +// +// SettingsMouseController.m +// iUAE +// +// Created by Urs on 08.08.16. +// +// + +#import "SettingsMouseController.h" +#import "Settings.h" + +@implementation SettingsMouseController { + Settings *_settings; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + + [_lstickSwitch setOn:_settings.LStickAnalogIsMouse]; + [_rstickSwitch setOn:_settings.RStickAnalogIsMouse]; + [_butSwitch setOn:_settings.useL2forMouseButton]; + [_rbutSwitch setOn:_settings.useR2forRightMouseButton]; + [_rstickSwitch setOn:_settings.RStickAnalogIsMouse]; + +} +- (void)dealloc { + + [_lstickSwitch release]; + [_rstickSwitch release]; + [super dealloc]; + +} +- (IBAction)togglerStick:(id)sender { + _settings.RStickAnalogIsMouse = !_settings.RStickAnalogIsMouse; +} + +- (IBAction)togglelStick:(id)sender { + _settings.LStickAnalogIsMouse = !_settings.LStickAnalogIsMouse; +} + +- (IBAction)togglebutSwitch:(id)sender { + _settings.useL2forMouseButton = !_settings.useL2forMouseButton; +} + +- (IBAction)togglerbutSwitch:(id)sender { + _settings.useR2forRightMouseButton = !_settings.useR2forRightMouseButton; +} + +@end diff --git a/Classes/SettingsSelectKeyViewController.h b/Classes/SettingsSelectKeyViewController.h new file mode 100644 index 0000000..edb90fb --- /dev/null +++ b/Classes/SettingsSelectKeyViewController.h @@ -0,0 +1,45 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 24.05.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "IOSKeyboard.h" + +@protocol SelectKeyDelegate +- (void)didSelectKey:(int)asciicode keyName:(NSString *)keyName; +- (void)didSelectJoypad; +@end + +@interface SettingsSelectKeyViewController : UITableViewController + +- (IBAction)associateKey:(id)sender; +- (IBAction)associateJoypad:(id)sender; + +@property (readwrite, retain) IBOutlet UITextField *dummy_textfield; // dummy text field used to display the keyboard +@property (readwrite, retain) IBOutlet UITextField *dummy_textfield_f; //dummy textfield used to display the keyboard with function keys +@property (readwrite, retain) IBOutlet UITextField *dummy_textfield_s; //dummy textfield for special key like right shift numlock etc ..... +@property (nonatomic, assign) id delegate; +@property (retain, nonatomic) IBOutlet UILabel *KeyDetailLabel; +@property (retain, nonatomic) IBOutlet UILabel *JoypadDetailLabel; +@property (readwrite,retain, nonatomic) IBOutlet UITableViewCell *CellJoypad; +@property (readwrite, retain, nonatomic) IBOutlet UITableViewCell *CellKey; +@property (readwrite, retain) NSString *joypaddetailtext; +@property (readwrite, retain) NSString *keydetailtext; + +@end diff --git a/Classes/SettingsSelectKeyViewController.mm b/Classes/SettingsSelectKeyViewController.mm new file mode 100644 index 0000000..38c4856 --- /dev/null +++ b/Classes/SettingsSelectKeyViewController.mm @@ -0,0 +1,93 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 24.5.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "SettingsSelectKeyViewController.h" +#import "IOSKeyboard.h" +#import "Settings.h" + +@interface SettingsSelectKeyViewController () + +@end + +@implementation SettingsSelectKeyViewController { + IOSKeyboard *ioskeyboard; + Settings *settings; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + ioskeyboard = [[IOSKeyboard alloc] initWithDummyFields:_dummy_textfield fieldf:_dummy_textfield_f fieldspecial:_dummy_textfield_s]; + ioskeyboard.delegate = self; + + settings = [[Settings alloc] init]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + +} + +- (void)viewWillAppear:(BOOL)animated { + _KeyDetailLabel.text = _keydetailtext; + _JoypadDetailLabel.text = _joypaddetailtext; + + _CellJoypad.accessoryType = [_joypaddetailtext isEqualToString:@"Joypad"] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + _CellKey.accessoryType = [_joypaddetailtext isEqualToString:@"Joypad"] ? UITableViewCellAccessoryNone : UITableViewCellAccessoryCheckmark; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)associateKey:(id)sender { + + [ioskeyboard toggleKeyboard]; +} + +- (IBAction)associateJoypad:(id)sender { + + [self.delegate didSelectJoypad]; + [self.navigationController popViewControllerAnimated:YES]; + +} + +- (void)keyPressed:(int)asciicode keyName:(NSString *)keyName { + [self.delegate didSelectKey:asciicode keyName:keyName]; + [ioskeyboard toggleKeyboard]; + [self.navigationController popViewControllerAnimated:YES]; +} + +- (void)dealloc +{ + [_CellKey release]; + [_CellJoypad release]; + [_JoypadDetailLabel release]; + [_KeyDetailLabel release]; + [settings release]; + [ioskeyboard release]; + + [super dealloc]; +} + +@end diff --git a/Classes/SettingsSelectPortViewController.h b/Classes/SettingsSelectPortViewController.h new file mode 100644 index 0000000..9318529 --- /dev/null +++ b/Classes/SettingsSelectPortViewController.h @@ -0,0 +1,37 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 24.05.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + + +@protocol SelectPortDelegate +- (void)didSelectPort:(int)pNumber; +@end + +@interface SettingsSelectPortViewController : UITableViewController + +@property (nonatomic, assign) id delegate; +@property (retain, nonatomic) IBOutlet UITableViewCell *P0Cell; +@property (retain, nonatomic) IBOutlet UITableViewCell *P1Cell; + +- (IBAction)SelectPort0:(id)sender; +- (IBAction)SelectPort1:(id)sender; + +@end diff --git a/Classes/SettingsSelectPortViewController.mm b/Classes/SettingsSelectPortViewController.mm new file mode 100644 index 0000000..2b06d7a --- /dev/null +++ b/Classes/SettingsSelectPortViewController.mm @@ -0,0 +1,81 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 24.5.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "SettingsSelectPortViewController.h" +#import "Settings.h" +#import "JoypadKey.h" + +@interface SettingsSelectPortViewController () + +@end + +@implementation SettingsSelectPortViewController { + Settings *_settings; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + +} + +- (void)viewWillAppear:(BOOL)animated { + + _P0Cell.accessoryType = [[_settings keyConfigurationforButton:PORT] isEqualToString:@"0"] ? UITableViewCellAccessoryCheckmark :UITableViewCellAccessoryNone; + + _P1Cell.accessoryType = [[_settings keyConfigurationforButton:PORT] isEqualToString:@"1"] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)SelectPort0:(id)sender +{ + [_settings setKeyconfiguration:@"0" Button:PORT]; + [self.delegate didSelectPort:0]; + [self.navigationController popViewControllerAnimated:YES]; +} + +-(IBAction)SelectPort1:(id)sender +{ + [_settings setKeyconfiguration:@"1" Button:PORT]; + [self.delegate didSelectPort:1]; + [self.navigationController popViewControllerAnimated:YES]; +} + +- (void)dealloc +{ + + [_settings release]; + [_P0Cell release]; + [_P1Cell release]; + [super dealloc]; +} + +@end diff --git a/Classes/State.h b/Classes/State.h new file mode 100644 index 0000000..cac0968 --- /dev/null +++ b/Classes/State.h @@ -0,0 +1,29 @@ +// Created by Simon Toens on 08.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface State : NSObject + +- (instancetype)initWithName:(NSString *)name path:(NSString *)path modificationDate:(NSDate *)modificationDate imagePath:(NSString *)imagePath; + +@property (nonatomic, readonly) NSString *name; +@property (nonatomic, readonly) NSString *path; +@property (nonatomic, readonly) NSString *modificationDate; + +@property (nonatomic, readwrite, strong) UIImage *image; + +@end \ No newline at end of file diff --git a/Classes/State.mm b/Classes/State.mm new file mode 100644 index 0000000..2e5b62f --- /dev/null +++ b/Classes/State.mm @@ -0,0 +1,91 @@ +// Created by Simon Toens on 08.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "State.h" + +@implementation State { + NSString *_imagePath; + UIImage *_image; + NSDate *_modificationDate; + NSString *_formattedModificationDate; +} + +@dynamic modificationDate, image; + +- (instancetype)initWithName:(NSString *)name path:(NSString *)path modificationDate:(NSDate *)modificationDate imagePath:(NSString *)imagePath { + if (self = [super init]) { + _name = [name retain]; + _path = [path retain]; + _modificationDate = [modificationDate retain]; + _imagePath = [imagePath retain]; + } + return self; +} + +- (void)dealloc { + [_name release]; + [_path release]; + [_modificationDate release]; + [_imagePath release]; + [_formattedModificationDate release]; + [_image release]; + [super dealloc]; +} + +- (UIImage *)image { + if (!_image && _imagePath) { + NSData *imageBytes = [NSData dataWithContentsOfFile:_imagePath]; + _image = [[UIImage imageWithData:imageBytes] retain]; + } + return _image; +} + +- (void)setImage:(UIImage *)image { + if (image != _image) { + [_image release]; + _image = [image retain]; + } +} + +- (BOOL)isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[self class]]) { + return NO; + } + return [_name isEqualToString:((State *)other)->_name]; +} + +- (NSUInteger)hash { + return [_name hash]; +} + +- (NSString *)modificationDate { + if (!_formattedModificationDate) { + NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; + [dateFormatter setDateStyle:NSDateFormatterShortStyle]; + [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; + _formattedModificationDate = [[dateFormatter stringFromDate:_modificationDate] retain]; + } + return _formattedModificationDate; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"%@: %@", _name, _path]; +} + +@end \ No newline at end of file diff --git a/Classes/StateFileManager.h b/Classes/StateFileManager.h new file mode 100644 index 0000000..b37a4a2 --- /dev/null +++ b/Classes/StateFileManager.h @@ -0,0 +1,61 @@ +// Created by Simon Toens on 07.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +/** + * Handles the details of where and how states are stored. + */ +@interface StateFileManager : NSObject + +- (instancetype)init; + +/** + * Returns YES if a state file exists for the given state name, NO otherwise. + */ +- (BOOL)stateFileExistsForStateName:(NSString *)stateName; + +/** + * Returns YES if the given state name does not contain any problematic characters, NO otherwise. + */ +- (BOOL)isValidStateName:(NSString *)stateName; + +/** + * Returns an array of all persisted State instances. + */ +- (NSArray *)loadStates; + +/** + * Returns a State instance for the specified stateName, nil if it does not exist. + */ +- (State *)loadState:(NSString *)stateName; + +/** + * Returns a new State instance with only path set, intended to be populated and saved. + */ +- (State *)newState:(NSString *)stateName; + +/** + * Saves meta information about the specified state (but not the state itself, that's handled by the core emulator). + */ +- (void)saveState:(State *)state; + +/** + * Deletes the specified state. + */ +- (void)deleteState:(State *)state; + +@end \ No newline at end of file diff --git a/Classes/StateFileManager.mm b/Classes/StateFileManager.mm new file mode 100644 index 0000000..d069341 --- /dev/null +++ b/Classes/StateFileManager.mm @@ -0,0 +1,153 @@ +// Created by Simon Toens on 07.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "State.h" +#import "StateFileManager.h" + +static NSString *const kStatesDirectoryName = @"states"; // top level directory under Documents where all state information goes +static NSString *const kStateImagesDirectoryName = @"images"; // sub directory that stores the screenshot associated with a saved state +static NSString *const kStateFileExtension = @".asf"; +static NSString *const kStateFileImageExtension = @".jpg"; + +@implementation StateFileManager { + @private + NSFileManager *_fileManager; + NSString *_documentsDirectoryPath; + NSString *_statesDirectoryPath; + NSString *_imagesDirectoryPath; +} + +# pragma mark - init/dealloc + +- (instancetype)init { + if (self = [super init]) { + _fileManager = [[NSFileManager defaultManager] retain]; + _documentsDirectoryPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] retain]; + _statesDirectoryPath = [[StateFileManager createAndGetDirectory:_fileManager rootDirectory:_documentsDirectoryPath directoryName:kStatesDirectoryName] retain]; + _imagesDirectoryPath = [[StateFileManager createAndGetDirectory:_fileManager rootDirectory:_statesDirectoryPath directoryName:kStateImagesDirectoryName] retain]; + } + return self; +} + +- (void)dealloc { + [_fileManager release]; + [_documentsDirectoryPath release]; + [_statesDirectoryPath release]; + [_imagesDirectoryPath release]; + [super dealloc]; +} + +# pragma mark - Public methods + +- (BOOL)stateFileExistsForStateName:(NSString *)stateName { + NSString *stateFilePath = [self getStateFilePathForStateName:stateName]; + return [_fileManager fileExistsAtPath:stateFilePath]; +} + +- (BOOL)isValidStateName:(NSString *)stateName { + stateName = [self trimNilIfEmpty:stateName]; + return stateName != nil; +} + +- (NSArray *)loadStates { + NSArray *fileNames = [_fileManager contentsOfDirectoryAtPath:_statesDirectoryPath error:NULL]; + NSMutableArray *states = [NSMutableArray arrayWithCapacity:[fileNames count]]; + for (NSString *fileName in fileNames) { + if ([self isStateFile:fileName]) { + NSString *stateName = [self getStateNameFromStateFileNameOrPath:fileName]; + State *state = [self loadState:stateName]; + [states addObject:state]; + } + } + return states; +} + +- (State *)loadState:(NSString *)stateName { + if (![self stateFileExistsForStateName:stateName]) { + return nil; + } + NSString *stateFilePath = [self getStateFilePathForStateName:stateName]; + NSDate *modificationDate = [self getFileModificationDate:stateFilePath]; + NSString *imagePath = [self getStateImagePathForStateName:stateName]; + imagePath = [_fileManager fileExistsAtPath:imagePath] ? imagePath : nil; + return [[[State alloc] initWithName:stateName path:stateFilePath modificationDate:modificationDate imagePath:imagePath] autorelease]; +} + +- (void)deleteState:(State *)state { + [_fileManager removeItemAtPath:state.path error:NULL]; + + NSString *stateImagePath = [self getStateImagePathForStateName:state.name]; + [_fileManager removeItemAtPath:stateImagePath error:NULL]; +} + +- (State *)newState:(NSString *)stateName { + return [[[State alloc] initWithName:stateName path:[self getStateFilePathForStateName:stateName] modificationDate:nil imagePath:nil] autorelease]; +} + +- (void)saveState:(State *)state { + [self writeImageFileForState:state]; +} + +- (NSString *)getStateFilePathForStateName:(NSString *)stateName { + stateName = [self trimNilIfEmpty:stateName]; + return stateName ? [[_statesDirectoryPath stringByAppendingPathComponent:stateName] stringByAppendingString:kStateFileExtension] : nil; +} + +#pragma mark - Private methods + +- (void)writeImageFileForState:(State *)state { + if (state.image) { + NSData *imageBytes = UIImageJPEGRepresentation(state.image, 0.3f); + NSString *imageFilePath = [self getStateImagePathForStateName:state.name]; + [imageBytes writeToFile:imageFilePath atomically:YES]; + } +} + +- (NSDate *)getFileModificationDate:(NSString *)filePath { + NSDictionary *attributes = [_fileManager attributesOfItemAtPath:filePath error:NULL]; + return [attributes objectForKey:NSFileModificationDate]; +} + +- (BOOL)isStateFile:(NSString *)fileName { + return [fileName hasSuffix:kStateFileExtension]; +} + +- (NSString *)getStateImagePathForStateName:(NSString *)stateName { + return [[_imagesDirectoryPath stringByAppendingPathComponent:stateName] stringByAppendingString:kStateFileImageExtension]; +} + +- (NSString *)trimNilIfEmpty:(NSString *)string { + if (!string) { + return nil; + } + string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + return string.length == 0 ? nil : string; +} + +- (NSString *)getStateNameFromStateFileNameOrPath:(NSString *)stateFilePath { + NSString *stateFileName = [[stateFilePath pathComponents] lastObject]; + return [stateFileName substringToIndex:[stateFileName length] - [kStateFileExtension length]]; +} + ++ (NSString *)createAndGetDirectory:(NSFileManager *)fileManager rootDirectory:(NSString *)rootDirectory directoryName:(NSString *)directoryName { + NSString *directoryPath = [rootDirectory stringByAppendingPathComponent:directoryName]; + if (![fileManager fileExistsAtPath:directoryPath]) { + [fileManager createDirectoryAtPath:directoryPath withIntermediateDirectories:YES attributes:nil error:NULL]; + } + return directoryPath; +} + +@end \ No newline at end of file diff --git a/Classes/StateManagementController.h b/Classes/StateManagementController.h new file mode 100644 index 0000000..4df79c6 --- /dev/null +++ b/Classes/StateManagementController.h @@ -0,0 +1,33 @@ +// Created by Simon Toens on 12.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface StateManagementController : UIViewController + +@property (nonatomic, assign) IBOutlet UILabel *titleLabel; + +@property (nonatomic, assign) IBOutlet UITextField *stateNameTextField; +@property (nonatomic, assign) IBOutlet NSLayoutConstraint *stateNameTextFieldRightConstraint; + +@property (nonatomic, assign) IBOutlet UITableView *statesTableView; +@property (nonatomic, assign) IBOutlet NSLayoutConstraint *statesTableViewRightConstraint; + +@property (nonatomic, assign) IBOutlet UIImageView *selectedStateScreenshot; + +@property (nonatomic, strong) UIImage *emulatorScreenshot; + +@end \ No newline at end of file diff --git a/Classes/StateManagementController.mm b/Classes/StateManagementController.mm new file mode 100644 index 0000000..bea46a8 --- /dev/null +++ b/Classes/StateManagementController.mm @@ -0,0 +1,291 @@ +// Created by Simon Toens on 12.03.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#include "sysconfig.h" +#include "sysdeps.h" +#include "options.h" +#include "savestate.h" + +#import "CoreSetting.h" +#import "ScrollToRowHandler.h" +#import "State.h" +#import "StateManagementController.h" +#import "StateFileManager.h" +#import "SVProgressHUD.h" + +static NSString *const kSaveStateAlertTitle = @"Save"; + +@implementation StateManagementController { + @private + ScrollToRowHandler *_scrollToRowHandler; + StateFileManager *_stateFileManager; + NSArray *_states; + UIBarButtonItem *_saveButton; + UIBarButtonItem *_restoreButton; +} + +# pragma mark - init/dealloc + +- (void)dealloc { + [_scrollToRowHandler release]; + [_stateFileManager release]; + [_states release]; + [_saveButton release]; + [_restoreButton release]; + self.emulatorScreenshot = nil; + [super dealloc]; +} + +#pragma mark - Overridden UIViewController methods + +- (void)viewDidLoad { + [super viewDidLoad]; + [self initNavigationBarButtons]; + _scrollToRowHandler = [[ScrollToRowHandler alloc] initWithTableView:self.statesTableView identity:@"states"]; + _stateFileManager = [[StateFileManager alloc] init]; + [_stateNameTextField addTarget:self action:@selector(onStateNameTextFieldChanged) forControlEvents:UIControlEventEditingChanged]; + [self reloadStates]; + [self configureForDevice]; + [self setStateNameTextFieldForSelectedState]; + [self updateUIState]; + [_scrollToRowHandler scrollToRow]; +} + +#pragma mark - UITableViewDelegate methods + +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { + // hack to get rid of empty rows in table view (also see heightForFooterInSection) + return [[UIView alloc] init]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { + return 1; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + State *selectedState = [_states objectAtIndex:indexPath.row]; + [self updateStateNameAndImage:selectedState]; + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + [self updateUIState]; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + return YES; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + State *state = [_states objectAtIndex:indexPath.row]; + [_stateFileManager deleteState:state]; + [self reloadStates]; + [tableView beginUpdates]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [tableView endUpdates]; + [self clearSelectedStateScreenshotImage]; + [_scrollToRowHandler clearRow]; + [self updateUIState]; + } +} + +#pragma mark - UITableViewDataSource protocol + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [_states count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *cellReuseIdentifier = @"asfcell"; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellReuseIdentifier]; + if (!cell) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellReuseIdentifier]; + } + State *state = [_states objectAtIndex:indexPath.row]; + cell.textLabel.text = state.name; + cell.imageView.image = state.image; + cell.detailTextLabel.text = state.modificationDate; + return cell; +} + +#pragma mark - Target-action methods + +- (IBAction)onSave { + NSString *stateName = _stateNameTextField.text; + if (![_stateFileManager isValidStateName:stateName]) { + [self showAlertWithTitle:kSaveStateAlertTitle message:[NSString stringWithFormat:@"The state name '%@' is invalid", stateName] hasCancelButton:NO hasDelegate:NO]; + } else if ([_stateFileManager stateFileExistsForStateName:stateName]) { + [self showAlertWithTitle:kSaveStateAlertTitle message:[NSString stringWithFormat:@"State '%@' exists, overwrite?", stateName] hasCancelButton:YES hasDelegate:YES]; + } else { + [self saveState]; + } +} + +- (IBAction)onRestore { + NSString *stateName = _stateNameTextField.text; + State *stateToRestore = [_stateFileManager loadState:stateName]; + if (stateToRestore) { + [self dismissKeyboard]; + [self showAlertWithTitle:@"Restore" message:[NSString stringWithFormat:@"Really restore state '%@'?", stateToRestore.name] hasCancelButton:YES hasDelegate:YES]; + } else { + [self showAlertWithTitle:@"Restore" message:[NSString stringWithFormat:@"State '%@' does not exist", stateName] hasCancelButton:NO hasDelegate:NO]; + } +} + +#pragma mark - AlertView delegate method + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + if ([alertView.title isEqualToString:kSaveStateAlertTitle]) { + if (buttonIndex == 0) { // Overwrite existing state confirmation + [self saveState]; + } + } else { // restore + if (buttonIndex == 0) { // Restore state confirmation + [self restoreState]; + } + } +} + +#pragma mark - Private methods + +- (void)dismissKeyboard { + [self.view endEditing:YES]; +} + +- (void)showStatusHUD:(NSString *)message { + [SVProgressHUD setBackgroundColor:[UIColor lightGrayColor]]; + [SVProgressHUD showSuccessWithStatus:message]; +} + +- (void)restoreState { + NSString *stateName = _stateNameTextField.text; + State *stateToRestore = [_stateFileManager loadState:stateName]; + static char path[1024]; + [stateToRestore.path getCString:path maxLength:sizeof(path) encoding:[NSString defaultCStringEncoding]]; + savestate_filename = path; + savestate_state = STATE_DORESTORE; + [CoreSettings onReset]; // restoring a state resets the emulator + + // set the selected state to the one that is being restored + NSUInteger index = [_states indexOfObject:stateToRestore]; + [_scrollToRowHandler setRow:[NSIndexPath indexPathForRow:index inSection:0]]; + + // the state restore logic, including inserting the floppy(ies) associated with the state, + // only runs after exiting settings - in order to reduce confusion about what floppies are + // inserted after a state has been selected to be restored, exit settings now + [self.navigationController popToRootViewControllerAnimated:YES]; +} + +- (void)saveState { + NSString *stateName = _stateNameTextField.text; + State *state = [_stateFileManager newState:stateName]; + if (_emulatorScreenshot) { + state.image = _emulatorScreenshot; + _selectedStateScreenshot.image = state.image; + } + [_stateFileManager saveState:state]; + static char path[1024]; + [state.path getCString:path maxLength:sizeof(path) encoding:[NSString defaultCStringEncoding]]; + static char description[] = "no description provided"; + save_state(path, description); + [self reloadStates]; + [_statesTableView reloadData]; + _stateNameTextField.text = @""; + [self dismissKeyboard]; + [self updateUIState]; + [self showStatusHUD:[NSString stringWithFormat:@"Saved state %@", stateName]]; + + // set the selected state to the one that was just saved, and scroll to it + NSUInteger index = [_states indexOfObject:state]; + [_scrollToRowHandler setRow:[NSIndexPath indexPathForRow:index inSection:0]]; + [_scrollToRowHandler scrollToRow]; +} + +- (void)clearSelectedStateScreenshotImage { + _selectedStateScreenshot.image = nil; +} + +- (void)onStateNameTextFieldChanged { + [self clearSelectedStateScreenshotImage]; + [self updateUIState]; +} + +- (void)updateUIState { + [self updateButtonState]; + [self updateNavigationBarTitle]; + [_statesTableView setNeedsDisplay]; +} + +- (void)updateNavigationBarTitle { + self.navigationItem.title = [_states count] == 0 ? @"No saved states" : [NSString stringWithFormat:@"Saved states: %i", [_states count]]; +} + +- (void)setStateNameTextFieldForSelectedState { + NSIndexPath *indexPath = [_scrollToRowHandler getRow]; + if (indexPath) { + State *state = [_states objectAtIndex:indexPath.row]; + [self updateStateNameAndImage:state]; + } +} + +- (void)updateStateNameAndImage:(State *)state { + _stateNameTextField.text = state.name; + _selectedStateScreenshot.image = state.image; +} + +- (void)initNavigationBarButtons { + _saveButton = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonSystemItemSave target:self action:@selector(onSave)]; + _restoreButton = [[UIBarButtonItem alloc] initWithTitle:@"Restore" style:UIBarButtonSystemItemRewind target:self action:@selector(onRestore)]; + self.navigationItem.rightBarButtonItems = @[_saveButton, _restoreButton]; +} + +- (void)updateButtonState { + BOOL buttonsEnabled = [_stateNameTextField.text length] > 0; + _saveButton.enabled = buttonsEnabled; + _restoreButton.enabled = buttonsEnabled && [_states count] > 0; +} + +- (void)reloadStates { + if (_states) { + [_states release]; + } + _states = [[_stateFileManager loadStates] retain]; +} + +- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message hasCancelButton:(BOOL)hasCancelButton hasDelegate:(BOOL)hasDelegate { + [[[[UIAlertView alloc] initWithTitle:title + message:message + delegate:hasDelegate ? self : nil + cancelButtonTitle:@"OK" + otherButtonTitles:(hasCancelButton ? @"Cancel" : nil), nil] autorelease] show]; +} + +- (void)configureForDevice { + if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + int distanceFromRightViewEdge = self.view.frame.size.width - _titleLabel.frame.size.width - 30; + _stateNameTextFieldRightConstraint.constant = distanceFromRightViewEdge; + _statesTableViewRightConstraint.constant = distanceFromRightViewEdge; + [_stateNameTextField layoutIfNeeded]; + [_statesTableView layoutIfNeeded]; + } else { + // no state screenshot preview on iPhone - disconnect the ui image view to make sure it doesn't render + _selectedStateScreenshot = nil; + } +} + +@end \ No newline at end of file diff --git a/Classes/TouchHandlerView.h b/Classes/TouchHandlerView.h index 5fa0439..a0c4d55 100644 --- a/Classes/TouchHandlerView.h +++ b/Classes/TouchHandlerView.h @@ -10,10 +10,10 @@ @interface TouchHandlerView : UIView { UITouch *leadTouch; - UITouch *rightTouch; + UITouch *rightTouch; CGPoint previousMouseLocation; BOOL didMove; - CGFloat x_ratio, y_ratio; + CGFloat x_ratio, y_ratio; } @end diff --git a/Classes/TouchHandlerView.m b/Classes/TouchHandlerView.m index 536be19..4bd4f72 100644 --- a/Classes/TouchHandlerView.m +++ b/Classes/TouchHandlerView.m @@ -33,97 +33,96 @@ - (void)layoutSubviews { y_ratio = self.frame.size.height / 240.0f / 2.0f; /* King of Chicago */ } -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - for(UITouch *touch in touches) + for (UITouch *touch in touches) { - if(touch.phase == UITouchPhaseBegan) + if (touch.phase == UITouchPhaseBegan) { - if(!leadTouch) - { + if (!leadTouch) + { leadTouch = touch; previousMouseLocation = [touch locationInView: self]; - //didMove = NO; - printf("Move begin\n"); + didMove = NO; + //printf("Move begin\n"); } else if(!rightTouch) { rightTouch = touch; SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_RIGHT); - printf("Right press\n"); + //printf("Right press\n"); } } - } + } } -- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event -{ +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ if (leadTouch) { CGPoint locationInView = [leadTouch locationInView:self]; CGFloat relx = (locationInView.x - previousMouseLocation.x) / x_ratio; CGFloat rely = (locationInView.y - previousMouseLocation.y) / y_ratio; - + if (fabsf(relx) < 1.0f) relx = 0.f; if (fabsf(rely) < 1.0f) rely = 0.f; - + if (relx != 0.0f || rely != 0.0f) { SDL_SendMouseMotion(NULL, SDL_MOTIONRELATIVE, relx, rely); - + if (relx != 0.0f) previousMouseLocation.x = locationInView.x; - - if (rely != 0.0f) + + if (rely != 0.0f) previousMouseLocation.y = locationInView.y; - - //didMove = YES; + + didMove = YES; } } } -- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [self touchesEnded:touches withEvent:event]; } -- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - for(UITouch *touch in touches) + for (UITouch *touch in touches) { - if(touch.phase == UITouchPhaseEnded) + if (touch.phase == UITouchPhaseEnded) { - if(touch == leadTouch) + if (touch == leadTouch) { leadTouch = Nil; - printf("Move End\n"); - - /*if (didMove == NO) + //printf("Move End\n"); + + if (didMove == NO) { SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT); - printf("Left press\n"); - + //printf("Left press\n"); + // 50ms after, push up - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 200 * 1000000), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 50 * 1000000), dispatch_get_main_queue(), ^{ SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT); - printf("Left release\n"); - - }); - } */ + //printf("Left release\n"); + }); + } } else if (touch == rightTouch) { rightTouch = Nil; SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_RIGHT); - printf("Right release\n"); + //printf("Right release\n"); } } } } -- (void)dealloc +- (void)dealloc { [super dealloc]; } diff --git a/Classes/UIKeyboardController-iPhone.xib b/Classes/UIKeyboardController-iPhone.xib deleted file mode 100644 index e7d55a1..0000000 --- a/Classes/UIKeyboardController-iPhone.xib +++ /dev/null @@ -1,1254 +0,0 @@ - - - - 1056 - 11C74 - 1617 - 1138.23 - 567.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 534 - - - YES - IBProxyObject - IBUIView - IBUIButton - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - - YES - - - 274 - - YES - - - 292 - {{4, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - {1, 1} - Q - - 3 - MQA - - - 3 - MAA - - 2 - - - - 3 - MC41Njg4NjM0MDczAA - - - NSImage - amiga-beige-light.png - - - - - 292 - {{52, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - W - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{100, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - E - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{148, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - R - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{196, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - T - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{244, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - Y - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{292, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - U - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{340, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - I - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{388, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - O - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{76, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - S - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{124, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - D - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{172, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - F - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{220, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - G - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{268, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - H - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{316, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - J - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{124, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - X - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{172, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - C - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{220, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - V - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{268, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - B - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{316, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - N - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{364, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - M - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{364, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - K - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{412, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - L - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{436, 0}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - P - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{28, 40}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - A - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{76, 80}, {40, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - Z - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{4, 80}, {64, 40}} - - - - _NS:237 - NO - IBCocoaTouchFramework - 0 - - 0.0 - 0.0 - 14 - 0.0 - {1, 1} - ⇧ - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - NSImage - amiga-beige-dark.png - - - - - 292 - {{412, 80}, {64, 40}} - - - - _NS:237 - NO - 8 - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - ⌫ - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{381, 120}, {95, 40}} - - - - _NS:237 - NO - 8 - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - ↵ - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{146, 120}, {188, 40}} - - - - _NS:237 - NO - 32 - IBCocoaTouchFramework - 0 - 0 - - {1, 1} - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - {480, 160} - - - - - 2 - MC43Mjk0MTE3ODA4IDAuNzA5ODAzOTM4OSAwLjYzNTI5NDEzOTQAA - - - 3 - 3 - - IBCocoaTouchFramework - - - {480, 160} - - - - _NS:180 - - 3 - MQA - - - NO - - 3 - 3 - - IBCocoaTouchFramework - - - - - YES - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 33 - - - YES - - - - - - 1 - - - YES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 32 - - - - - 31 - - - - - 20 - - - - - 30 - - - - - 6 - - - - - 4 - - - - - 23 - - - - - 22 - - - - - 21 - - - - - 19 - - - - - 18 - - - - - 17 - - - - - 16 - - - - - 3 - - - - - 29 - - - - - 28 - - - - - 27 - - - - - 26 - - - - - 25 - - - - - 24 - - - - - 15 - - - - - 14 - - - - - 13 - - - - - 12 - - - - - 11 - - - - - 10 - - - - - 9 - - - - - 8 - - - - - 7 - - - - - 5 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 10.IBPluginDependency - 11.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 18.IBPluginDependency - 19.IBPluginDependency - 20.IBPluginDependency - 21.IBPluginDependency - 22.IBPluginDependency - 23.IBPluginDependency - 24.IBPluginDependency - 25.IBPluginDependency - 26.IBPluginDependency - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBPluginDependency - 3.IBPluginDependency - 30.IBPluginDependency - 31.IBPluginDependency - 32.IBPluginDependency - 33.IBPluginDependency - 4.IBPluginDependency - 5.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 33 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - amiga-beige-dark.png - amiga-beige-light.png - - - YES - {88, 109} - {88, 109} - - - 534 - - diff --git a/Classes/UIKeyboardController.xib b/Classes/UIKeyboardController.xib deleted file mode 100644 index fa80dfb..0000000 --- a/Classes/UIKeyboardController.xib +++ /dev/null @@ -1,2045 +0,0 @@ - - - - 1056 - 11C74 - 1617 - 1138.23 - 567.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 534 - - - YES - IBProxyObject - IBUIView - IBUIButton - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - - 292 - - YES - - - 292 - {{102, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - {1, 1} - Q - - 3 - MQA - - - 3 - MAA - - 2 - - - - 3 - MC41Njg4NjM0MDczAA - - - NSImage - amiga-beige-light.png - - - - - 292 - {{159, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - W - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{216, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - E - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{273, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - R - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{184, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - Z - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{139, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - A - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{196, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - S - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{253, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - D - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{310, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - F - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{367, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - G - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{424, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - H - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{481, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - J - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{538, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - K - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{595, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - L - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{652, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - ; - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{709, 119}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - # - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{330, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - T - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{387, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - Y - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{444, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - U - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{501, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - I - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{558, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - O - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{615, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - P - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{672, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - [ - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{729, 60}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - ] - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{89, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 1 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{25, 0}, {56, 48}} - - - - _NS:237 - NO - 27 - IBIPadFramework - 0 - 0 - - {1, 1} - ESC - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - NSImage - amiga-beige-dark.png - - - - - 292 - {{146, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 2 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{203, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 3 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{260, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 4 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{317, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 5 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{374, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 6 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{431, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 7 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{488, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 8 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{545, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 9 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{602, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - 0 - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{659, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - - - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{716, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - = - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{773, 0}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - \ - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{830, 0}, {49, 48}} - - - - _NS:237 - NO - 8 - IBIPadFramework - 0 - 0 - - {1, 1} - BS - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{766, 119}, {96, 48}} - - - - _NS:237 - NO - 13 - IBIPadFramework - 0 - 0 - - {1, 1} - ENTER - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{80, 180}, {96, 48}} - - - - _NS:237 - NO - 304 - IBIPadFramework - 0 - 0 - - {1, 1} - SHIFT - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{241, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - X - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{298, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - C - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{355, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - V - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{412, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - B - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{469, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - N - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{526, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - M - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{583, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - , - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{640, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - . - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{697, 180}, {49, 48}} - - - - _NS:237 - NO - IBIPadFramework - 0 - 0 - - {1, 1} - / - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - - 292 - {{241, 240}, {448, 48}} - - - - _NS:237 - NO - 32 - IBIPadFramework - 0 - 0 - - {1, 1} - IA - - - 3 - MAA - - - - 3 - MC41Njg4NjM0MDczAA - - - - - {1024, 300} - - - - - 2 - MC43Mjk0MTE3ODA4IDAuNzA5ODAzOTM4OSAwLjYzNTI5NDEzOTQAA - - NO - - 3 - 3 - - IBIPadFramework - - - - - YES - - - view - - - - 3 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4 - - - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - 9 - - - - - 10 - - - - - 11 - - - - - 12 - - - - - 13 - - - - - 14 - - - - - 15 - - - - - 16 - - - - - 17 - - - - - 18 - - - - - 19 - - - - - 20 - - - - - 21 - - - - - 22 - - - - - 23 - - - - - 24 - - - - - 25 - - - - - 26 - - - - - 27 - - - - - 28 - - - - - 29 - - - - - 30 - - - - - 31 - - - - - 32 - - - - - 33 - - - - - 34 - - - - - 35 - - - - - 36 - - - - - 37 - - - - - 38 - - - - - 39 - - - - - 40 - - - - - 41 - - - - - 42 - - - - - 43 - - - - - 44 - - - - - 45 - - - - - 46 - - - - - 47 - - - - - 48 - - - - - 49 - - - - - 50 - - - - - 51 - - - - - 52 - - - - - 53 - - - - - 54 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 10.IBPluginDependency - 11.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 18.IBPluginDependency - 19.IBPluginDependency - 2.IBPluginDependency - 2.IBUserGuides - 20.IBPluginDependency - 21.IBPluginDependency - 22.IBPluginDependency - 23.IBPluginDependency - 24.IBPluginDependency - 25.IBPluginDependency - 26.IBPluginDependency - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBPluginDependency - 30.IBPluginDependency - 31.IBPluginDependency - 31.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 32.IBPluginDependency - 33.IBPluginDependency - 34.IBPluginDependency - 35.IBPluginDependency - 36.IBPluginDependency - 37.IBPluginDependency - 38.IBPluginDependency - 39.IBPluginDependency - 4.IBPluginDependency - 40.IBPluginDependency - 41.IBPluginDependency - 42.IBPluginDependency - 43.IBPluginDependency - 43.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 44.IBPluginDependency - 45.IBPluginDependency - 46.IBPluginDependency - 47.IBPluginDependency - 48.IBPluginDependency - 49.IBPluginDependency - 5.IBPluginDependency - 5.IBUIButtonInspectorSelectedEdgeInsetMetadataKey - 50.IBPluginDependency - 51.IBPluginDependency - 52.IBPluginDependency - 53.IBPluginDependency - 54.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - UIKeyboardController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 240 - 1 - - - - 512 - 0 - - - - 180 - 1 - - - - 119 - 1 - - - - 60 - 1 - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 55 - - - - YES - - UIKeyboardController - UIViewController - - YES - - YES - keyDown: - keyUp: - - - YES - UIButton - UIButton - - - - YES - - YES - keyDown: - keyUp: - - - YES - - keyDown: - UIButton - - - keyUp: - UIButton - - - - - IBProjectSource - ./Classes/UIKeyboardController.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - amiga-beige-dark.png - amiga-beige-light.png - - - YES - {88, 109} - {88, 109} - - - 534 - - diff --git a/Classes/UnappliedSettingLabelHandler.h b/Classes/UnappliedSettingLabelHandler.h new file mode 100644 index 0000000..6fb4b85 --- /dev/null +++ b/Classes/UnappliedSettingLabelHandler.h @@ -0,0 +1,44 @@ +// Created by Simon Toens on 22.05.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "CoreSetting.h" + +@interface UnappliedSettingLabelHandler : NSObject + +/** + * Adds a label to the specified cell; the label is associated with the given setting and shows a "requires emulator reset" type + * message when the setting has an unapplied value. + */ +- (void)addResetWarningLabelForCell:(UITableViewCell *)cell forSetting:(CoreSetting *)setting; + +/** + * Adds a label to the specified cell; the label is associated with the given settings and shows a "requires emulator reset" type + * message when the first setting found in the array has an unapplied value. + */ +- (void)addResetWarningLabelForCell:(UITableViewCell *)cell forSettings:(NSArray *)settings; + +/** + * Required to be called before the final view renders. + */ +- (void)layoutLabels; + +/** + * Enables/disables labels based on the state of their associated setting. + */ +- (void)updateLabelStates; + +@end diff --git a/Classes/UnappliedSettingLabelHandler.m b/Classes/UnappliedSettingLabelHandler.m new file mode 100644 index 0000000..260cba8 --- /dev/null +++ b/Classes/UnappliedSettingLabelHandler.m @@ -0,0 +1,149 @@ +// Created by Simon Toens on 22.05.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "UnappliedSettingLabelHandler.h" + +/** + * So that UILabel can be used as key. + */ +@interface LabelWrapper : NSObject + +- (instancetype)initWithLabel:(UILabel *)label; + +@property (nonatomic, retain) UILabel *label; + +@end + +@implementation UnappliedSettingLabelHandler { + @private + NSMutableDictionary *_labelToSettingsArray; +} + +- (instancetype)init { + if (self = [super init]) { + _labelToSettingsArray = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)addResetWarningLabelForCell:(UITableViewCell *)cell forSetting:(CoreSetting *)setting { + [self addResetWarningLabelForCell:cell forSettings:@[setting]]; +} + +- (void)addResetWarningLabelForCell:(UITableViewCell *)cell forSettings:(NSArray *)settings { + if ([settings count] == 0) { + return; + } + UILabel *label = [self newWarningLabel]; + [self updateLabelState:label forSettings:settings]; + [cell addSubview:label]; + [cell bringSubviewToFront:label]; + LabelWrapper *labelWrapper = [[[LabelWrapper alloc] initWithLabel:label] autorelease]; + [_labelToSettingsArray setObject:settings forKey:labelWrapper]; +} + +- (void)layoutLabels { + for (LabelWrapper *labelWrapper in [_labelToSettingsArray keyEnumerator]) { + [self addConstraintsTo:labelWrapper.label]; + } +} + +- (void)addConstraintsTo:(UILabel *)label { + + [NSLayoutConstraint constraintWithItem:label + attribute:NSLayoutAttributeLeading + relatedBy:NSLayoutRelationEqual + toItem:label.superview + attribute:NSLayoutAttributeLeading + multiplier:1 + constant:13].active = true; + + [NSLayoutConstraint constraintWithItem:label + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:label.superview + attribute:NSLayoutAttributeTop + multiplier:1 + constant:28].active = true; + +} + +- (void)updateLabelStates { + for (LabelWrapper *labelWrapper in [_labelToSettingsArray allKeys]) { + NSArray *settings = [_labelToSettingsArray objectForKey:labelWrapper]; + [self updateLabelState:labelWrapper.label forSettings:settings]; + } +} + +- (void)updateLabelState:(UILabel *)label forSettings:(NSArray *)settings { + CoreSetting *setting = [self getFistSettingWithUnappliedValue:settings]; + if (!setting) { + setting = [settings objectAtIndex:0]; + } + [self updateLabelState:label forSetting:setting]; +} + +- (CoreSetting *)getFistSettingWithUnappliedValue:(NSArray *)settings { + for (CoreSetting *setting in settings) { + if ([setting hasUnappliedValue]) { + return setting; + } + } + return nil; +} + +- (void)updateLabelState:(UILabel *)label forSetting:(CoreSetting *)setting { + [label setHidden:![setting hasUnappliedValue]]; + label.text = [setting getModificationDescription]; +} + +- (UILabel *)newWarningLabel { + UILabel *label = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease]; + [label setTranslatesAutoresizingMaskIntoConstraints:NO]; + label.textColor = [UIColor redColor]; + label.font = [UIFont boldSystemFontOfSize:13]; + return label; +} + +- (void)dealloc { + [_labelToSettingsArray release]; + [super dealloc]; +} + +@end + +@implementation LabelWrapper { + @private + UILabel *_label; +} + +- (instancetype)initWithLabel:(UILabel *)label { + if (self = [super init]) { + self.label = label; + } + return self; +} + +- (id)copyWithZone:(NSZone *)zone { + return [self retain]; +} + +- (void)dealloc { + self.label = nil; + [super dealloc]; +} + +@end diff --git a/Classes/VPadLeftOrRight.h b/Classes/VPadLeftOrRight.h new file mode 100644 index 0000000..57d1c75 --- /dev/null +++ b/Classes/VPadLeftOrRight.h @@ -0,0 +1,26 @@ +// +// VPadLeftOrRight.h +// iUAE +// +// Created by Urs on 18.09.15. +// +// + +#import + +@protocol SelectVpadPosDelegate +- (void)didSelectVPadPosition:(NSString *)strPosition; +@end + +@interface VPadLeftOrRight : UITableViewController + +- (IBAction)leftcheckmarkselected:(id)sender; +- (IBAction)rightcheckmarkselected:(id)sender; + +@property (retain, nonatomic) IBOutlet UITableViewCell *CellLeft; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellRight; +@property (nonatomic, assign) id delegate; + + +@end + diff --git a/Classes/VPadLeftOrRight.mm b/Classes/VPadLeftOrRight.mm new file mode 100644 index 0000000..e5a213c --- /dev/null +++ b/Classes/VPadLeftOrRight.mm @@ -0,0 +1,61 @@ +// +// VPadLeftOrRight.m +// iUAE +// +// Created by Urs on 18.09.15. +// +// + +#import "VPadLeftOrRight.h" +#import "Settings.h" + +@implementation VPadLeftOrRight { + Settings *_settings; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; + +} + +- (void)viewWillAppear:(BOOL)animated { + NSString *leftorright = [_settings stringForKey:@"_joypadleftorright"]; + + _CellRight.accessoryType = [leftorright isEqualToString:@"Right"] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + _CellLeft.accessoryType = [leftorright isEqualToString:@"Left"] ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (IBAction)leftcheckmarkselected:(id)sender { + [self.delegate didSelectVPadPosition:@"Left"]; + [self.navigationController popViewControllerAnimated:YES]; +} + +- (IBAction)rightcheckmarkselected:(id)sender { + [self.delegate didSelectVPadPosition:@"Right"]; + [self.navigationController popViewControllerAnimated:YES]; +} + +- (void)dealloc +{ + [_CellLeft release]; + [_CellRight release]; + [_settings release]; + + [super dealloc]; +} + +@end diff --git a/Classes/VPadTouchOrGyro.h b/Classes/VPadTouchOrGyro.h new file mode 100644 index 0000000..b9acc90 --- /dev/null +++ b/Classes/VPadTouchOrGyro.h @@ -0,0 +1,37 @@ +// +// VPadTouchOrGyro.h +// iUAE +// +// Created by MrStargazer on 02.03.16. +// +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import + + +@protocol SelectVpadDirectionDelegate +- (void)didSelectVPadDirection:(NSString *)strType; +@end + +@interface VPadTouchOrGyro : UITableViewController + +@property (retain, nonatomic) IBOutlet UITableViewCell *cellTouch; +@property (retain, nonatomic) IBOutlet UITableViewCell *cellGyro; + + + +@property (nonatomic, assign) id delegate; + +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; + +@end diff --git a/Classes/VPadTouchOrGyro.mm b/Classes/VPadTouchOrGyro.mm new file mode 100644 index 0000000..1e36d18 --- /dev/null +++ b/Classes/VPadTouchOrGyro.mm @@ -0,0 +1,73 @@ +// +// VPadTouchOrGyro.mm +// iUAE +// +// Created by MrStargazer on 02.03.16. +// +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + + +#import "VPadTouchOrGyro.h" +#import "Settings.h" + + +@implementation VPadTouchOrGyro { + Settings *_settings; +} + +static NSString *const kDPadModeTouch = @"Touch"; +static NSString *const kDPadModeMotion = @"Motion"; + +- (void)viewDidLoad { + [super viewDidLoad]; + + _settings = [[Settings alloc] init]; + +} + +- (void)viewWillAppear:(BOOL)animated { + + _cellTouch.accessoryType = _settings.DPadModeIsTouch ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + _cellGyro.accessoryType = _settings.DPadModeIsMotion ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; + +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + + if (indexPath.row == 0) { + [self.delegate didSelectVPadDirection: kDPadModeTouch]; + } + else if (indexPath.row == 1){ + [self.delegate didSelectVPadDirection: kDPadModeMotion]; + } + else { + // there should be only two rows. + } + + [self.navigationController popViewControllerAnimated:YES]; +} + + +- (void)dealloc +{ + [_cellGyro release]; + [_cellTouch release]; + [_settings release]; + [super dealloc]; +} + +@end diff --git a/Classes/VirtualKeyboard.m b/Classes/VirtualKeyboard.mm similarity index 100% rename from Classes/VirtualKeyboard.m rename to Classes/VirtualKeyboard.mm diff --git a/Classes/ZipArchive.h b/Classes/ZipArchive.h new file mode 100644 index 0000000..9ace9b2 --- /dev/null +++ b/Classes/ZipArchive.h @@ -0,0 +1,48 @@ +// +// ZipArchive.h +// +// +// Created by aish on 08-9-11. +// acsolu@gmail.com +// Copyright 2008 Inc. All rights reserved. +// +// History: +// 09-11-2008 version 1.0 release +// 10-18-2009 version 1.1 support password protected zip files +// 10-21-2009 version 1.2 fix date bug + +#import + +#include "minizip/zip.h" +#include "minizip/unzip.h" + + +@protocol ZipArchiveDelegate +@optional +-(void) ErrorMessage:(NSString*) msg; +-(BOOL) OverWriteOperation:(NSString*) file; + +@end + + +@interface ZipArchive : NSObject { +@private + zipFile _zipFile; + unzFile _unzFile; + + NSString* _password; + id _delegate; +} + +@property (nonatomic, retain) id delegate; + +-(BOOL) CreateZipFile2:(NSString*) zipFile; +-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password; +-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname; +-(BOOL) CloseZipFile2; + +-(BOOL) UnzipOpenFile:(NSString*) zipFile; +-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password; +-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite; +-(BOOL) UnzipCloseFile; +@end diff --git a/Classes/ZipArchive.mm b/Classes/ZipArchive.mm new file mode 100644 index 0000000..c86d547 --- /dev/null +++ b/Classes/ZipArchive.mm @@ -0,0 +1,341 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wformat" + +// +// ZipArchive.mm +// +// +// Created by aish on 08-9-11. +// acsolu@gmail.com +// Copyright 2008 Inc. All rights reserved. +// + +#import "ZipArchive.h" +#import "zlib.h" +#import "zconf.h" + + + +@interface ZipArchive (Private) + +-(void) OutputErrorMessage:(NSString*) msg; +-(BOOL) OverWrite:(NSString*) file; +-(NSDate*) Date1980; +@end + + + +@implementation ZipArchive +@synthesize delegate = _delegate; + +-(id) init +{ + if( self=[super init] ) + { + _zipFile = NULL ; + } + return self; +} + +-(void) dealloc +{ + [self CloseZipFile2]; + [super dealloc]; +} + +-(BOOL) CreateZipFile2:(NSString*) zipFile +{ + _zipFile = zipOpen( (const char*)[zipFile UTF8String], 0 ); + if( !_zipFile ) + return NO; + return YES; +} + +-(BOOL) CreateZipFile2:(NSString*) zipFile Password:(NSString*) password +{ + _password = password; + return [self CreateZipFile2:zipFile]; +} + +-(BOOL) addFileToZip:(NSString*) file newname:(NSString*) newname; +{ + if( !_zipFile ) + return NO; +// tm_zip filetime; + time_t current; + time( ¤t ); + + zip_fileinfo zipInfo = {0}; +// zipInfo.dosDate = (unsigned long) current; + + NSDictionary* attr = [[NSFileManager defaultManager] fileAttributesAtPath:file traverseLink:YES]; + if( attr ) + { + NSDate* fileDate = (NSDate*)[attr objectForKey:NSFileModificationDate]; + if( fileDate ) + { + // some application does use dosDate, but tmz_date instead + // zipInfo.dosDate = [fileDate timeIntervalSinceDate:[self Date1980] ]; + NSCalendar* currCalendar = [NSCalendar currentCalendar]; + uint flags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | + NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit ; + NSDateComponents* dc = [currCalendar components:flags fromDate:fileDate]; + zipInfo.tmz_date.tm_sec = [dc second]; + zipInfo.tmz_date.tm_min = [dc minute]; + zipInfo.tmz_date.tm_hour = [dc hour]; + zipInfo.tmz_date.tm_mday = [dc day]; + zipInfo.tmz_date.tm_mon = [dc month] - 1; + zipInfo.tmz_date.tm_year = [dc year]; + } + } + + int ret ; + NSData* data = nil; + if( [_password length] == 0 ) + { + ret = zipOpenNewFileInZip( _zipFile, + (const char*) [newname UTF8String], + &zipInfo, + NULL,0, + NULL,0, + NULL,//comment + Z_DEFLATED, + Z_DEFAULT_COMPRESSION ); + } + else + { + data = [ NSData dataWithContentsOfFile:file]; + uLong crcValue = crc32( 0L,NULL, 0L ); + crcValue = crc32( crcValue, (const Bytef*)[data bytes], [data length] ); + ret = zipOpenNewFileInZip3( _zipFile, + (const char*) [newname UTF8String], + &zipInfo, + NULL,0, + NULL,0, + NULL,//comment + Z_DEFLATED, + Z_DEFAULT_COMPRESSION, + 0, + 15, + 8, + Z_DEFAULT_STRATEGY, + [_password cStringUsingEncoding:NSASCIIStringEncoding], + crcValue ); + } + if( ret!=Z_OK ) + { + return NO; + } + if( data==nil ) + { + data = [ NSData dataWithContentsOfFile:file]; + } + unsigned int dataLen = [data length]; + ret = zipWriteInFileInZip( _zipFile, (const void*)[data bytes], dataLen); + if( ret!=Z_OK ) + { + return NO; + } + ret = zipCloseFileInZip( _zipFile ); + if( ret!=Z_OK ) + return NO; + return YES; +} + +-(BOOL) CloseZipFile2 +{ + _password = nil; + if( _zipFile==NULL ) + return NO; + BOOL ret = zipClose( _zipFile,NULL )==Z_OK?YES:NO; + _zipFile = NULL; + return ret; +} + +-(BOOL) UnzipOpenFile:(NSString*) zipFile +{ + _unzFile = unzOpen( (const char*)[zipFile UTF8String] ); + if( _unzFile ) + { + unz_global_info globalInfo = {0}; + if( unzGetGlobalInfo(_unzFile, &globalInfo )==UNZ_OK ) + { + NSLog([NSString stringWithFormat:@"%d entries in the zip file",globalInfo.number_entry] ); + } + } + return _unzFile!=NULL; +} + +-(BOOL) UnzipOpenFile:(NSString*) zipFile Password:(NSString*) password +{ + _password = password; + return [self UnzipOpenFile:zipFile]; +} + +-(BOOL) UnzipFileTo:(NSString*) path overWrite:(BOOL) overwrite +{ + BOOL success = YES; + int ret = unzGoToFirstFile( _unzFile ); + unsigned char buffer[4096] = {0}; + NSFileManager* fman = [NSFileManager defaultManager]; + if( ret!=UNZ_OK ) + { + [self OutputErrorMessage:@"Failed"]; + } + + do{ + if( [_password length]==0 ) + ret = unzOpenCurrentFile( _unzFile ); + else + ret = unzOpenCurrentFilePassword( _unzFile, [_password cStringUsingEncoding:NSASCIIStringEncoding] ); + if( ret!=UNZ_OK ) + { + [self OutputErrorMessage:@"Error occurs"]; + success = NO; + break; + } + // reading data and write to file + int read ; + unz_file_info fileInfo ={0}; + ret = unzGetCurrentFileInfo(_unzFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0); + if( ret!=UNZ_OK ) + { + [self OutputErrorMessage:@"Error occurs while getting file info"]; + success = NO; + unzCloseCurrentFile( _unzFile ); + break; + } + char* filename = (char*) malloc( fileInfo.size_filename +1 ); + unzGetCurrentFileInfo(_unzFile, &fileInfo, filename, fileInfo.size_filename + 1, NULL, 0, NULL, 0); + filename[fileInfo.size_filename] = '\0'; + + // check if it contains directory + NSString * strPath = [NSString stringWithCString:filename]; + BOOL isDirectory = NO; + if( filename[fileInfo.size_filename-1]=='/' || filename[fileInfo.size_filename-1]=='\\') + isDirectory = YES; + free( filename ); + if( [strPath rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"/\\"]].location!=NSNotFound ) + {// contains a path + strPath = [strPath stringByReplacingOccurrencesOfString:@"\\" withString:@"/"]; + } + NSString* fullPath = [path stringByAppendingPathComponent:strPath]; + + if( isDirectory ) + [fman createDirectoryAtPath:fullPath withIntermediateDirectories:YES attributes:nil error:nil]; + else + [fman createDirectoryAtPath:[fullPath stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil]; + if( [fman fileExistsAtPath:fullPath] && !isDirectory && !overwrite ) + { + if( ![self OverWrite:fullPath] ) + { + unzCloseCurrentFile( _unzFile ); + ret = unzGoToNextFile( _unzFile ); + continue; + } + } + FILE* fp = fopen( (const char*)[fullPath UTF8String], "wb"); + while( fp ) + { + read=unzReadCurrentFile(_unzFile, buffer, 4096); + if( read > 0 ) + { + fwrite(buffer, read, 1, fp ); + } + else if( read<0 ) + { + [self OutputErrorMessage:@"Failed to reading zip file"]; + break; + } + else + break; + } + if( fp ) + { + fclose( fp ); + // set the orignal datetime property + NSDate* orgDate = nil; + + //{{ thanks to brad.eaton for the solution + NSDateComponents *dc = [[NSDateComponents alloc] init]; + + dc.second = fileInfo.tmu_date.tm_sec; + dc.minute = fileInfo.tmu_date.tm_min; + dc.hour = fileInfo.tmu_date.tm_hour; + dc.day = fileInfo.tmu_date.tm_mday; + dc.month = fileInfo.tmu_date.tm_mon+1; + dc.year = fileInfo.tmu_date.tm_year; + + NSCalendar *gregorian = [[NSCalendar alloc] + initWithCalendarIdentifier:NSGregorianCalendar]; + + orgDate = [gregorian dateFromComponents:dc] ; + [dc release]; + [gregorian release]; + //}} + + + NSDictionary* attr = [NSDictionary dictionaryWithObject:orgDate forKey:NSFileModificationDate]; //[[NSFileManager defaultManager] fileAttributesAtPath:fullPath traverseLink:YES]; + if( attr ) + { + // [attr setValue:orgDate forKey:NSFileCreationDate]; + if( ![[NSFileManager defaultManager] setAttributes:attr ofItemAtPath:fullPath error:nil] ) + { + // cann't set attributes + NSLog(@"Failed to set attributes"); + } + + } + + + + } + unzCloseCurrentFile( _unzFile ); + ret = unzGoToNextFile( _unzFile ); + }while( ret==UNZ_OK && UNZ_OK!=UNZ_END_OF_LIST_OF_FILE ); + return success; +} + +-(BOOL) UnzipCloseFile +{ + _password = nil; + if( _unzFile ) + return unzClose( _unzFile )==UNZ_OK; + return YES; +} + +#pragma mark wrapper for delegate +-(void) OutputErrorMessage:(NSString*) msg +{ + if( _delegate && [_delegate respondsToSelector:@selector(ErrorMessage)] ) + [_delegate ErrorMessage:msg]; +} + +-(BOOL) OverWrite:(NSString*) file +{ + if( _delegate && [_delegate respondsToSelector:@selector(OverWriteOperation)] ) + return [_delegate OverWriteOperation:file]; + return YES; +} + +#pragma mark get NSDate object for 1980-01-01 +-(NSDate*) Date1980 +{ + NSDateComponents *comps = [[NSDateComponents alloc] init]; + [comps setDay:1]; + [comps setMonth:1]; + [comps setYear:1980]; + NSCalendar *gregorian = [[NSCalendar alloc] + initWithCalendarIdentifier:NSGregorianCalendar]; + NSDate *date = [gregorian dateFromComponents:comps]; + + [comps release]; + [gregorian release]; + return date; +} + + +@end + +#pragma clang diagnostic pop diff --git a/Classes/adfresolver.h b/Classes/adfresolver.h new file mode 100644 index 0000000..cb77deb --- /dev/null +++ b/Classes/adfresolver.h @@ -0,0 +1,20 @@ +// Created by Simon Toens on 11.11.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** + * Given a path to an adf that doesn't exist anymore, tries to look for the adf by filename and returns the new path. + */ +extern "C" const char* get_updated_adf_path(const char *adf_path); \ No newline at end of file diff --git a/Classes/adfresolver.mm b/Classes/adfresolver.mm new file mode 100644 index 0000000..80a73e9 --- /dev/null +++ b/Classes/adfresolver.mm @@ -0,0 +1,36 @@ +// Created by Simon Toens on 11.11.15 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "adfresolver.h" +#import "EMUBrowser.h" +#import "EMUFileInfo.h" + +// wrapper around EMUBrowser +const char* get_updated_adf_path(const char *adf_path) { + NSString *adfPath = [NSString stringWithCString:adf_path encoding:[NSString defaultCStringEncoding]]; + NSString *updatedAdfPath = @""; + if ([adfPath length] > 0) { + NSString *adfFileName = [adfPath lastPathComponent]; + EMUBrowser *browser = [[[EMUBrowser alloc] init] autorelease]; + EMUFileInfo *fileInfo = [browser getFileInfoForFileName:adfFileName]; + if (fileInfo) { + updatedAdfPath = fileInfo.path; + } + } + static char adf[256]; + [updatedAdfPath getCString:adf maxLength:sizeof(adf) encoding:[NSString defaultCStringEncoding]]; + return adf; +} \ No newline at end of file diff --git a/Classes/constSettings.h b/Classes/constSettings.h new file mode 100644 index 0000000..6ed9043 --- /dev/null +++ b/Classes/constSettings.h @@ -0,0 +1,53 @@ +// +// constSettings.h +// iUAE +// +// Created by Urs on 29.09.16. +// +// + +#ifndef constSettings_h +#define constSettings_h + +static NSString *const kAppSettingsInitializedKey = @"appvariableinitialized"; +static NSString *const kInitializeKey = @"_initialize"; +static NSString *const kConfigurationNameKey = @"configurationname"; +static NSString *const kConfigurationsKey = @"configurations"; +static NSString *const kAutoloadConfigKey = @"autoloadconfig"; +static NSString *const kInsertedFloppiesKey = @"insertedfloppies"; +static NSString *const kKeyButtonsEnabledKey = @"_keyButtonsEnabled"; +static NSString *const kKeyButtonConfigurationsKey = @"_keyButtonConfigurations"; + +static NSString *const kNtscKey = @"_ntsc"; +static NSString *const kStretchScreenKey = @"_stretchscreen"; +static NSString *const kAddVerticalStretchKey = @"_addverticalstretchvalue"; +static NSString *const kShowStatusKey = @"_showstatus"; +static NSString *const kShowStatusBarKey = @"_showstatusbar"; +static NSString *const kSelectedEffectIndexKey = @"_selectedeffectindex"; + +static NSString *const kControllersKey = @"_controllers"; +static NSString *const kControllersNextIDKey = @"_controllersnextidkey"; +static NSString *const kJoypadStyleKey = @"_joypadstyle"; +static NSString *const kJoypadLeftOrRightKey = @"_joypadleftorright"; +static NSString *const kJoypadShowButtonTouchKey = @"_joypadshowbuttontouch"; +static NSString *const kDPadTouchOrMotion = @"_dpadTouchOrMotion"; + +static NSString *const kGyroToggleUpDown = @"_gyroToggleUpDown"; +static NSString *const kGyroSensitivity = @"_gyroSensitivity"; + +static NSString *const kRstickmouseFlag = @"_rstickmouseflag"; +static NSString *const kLstickmouseFlag = @"_lstickmouseflag"; +static NSString *const kL2mouseFlag = @"_L2mouseFlag"; +static NSString *const kR2mouseFlag = @"_R2mouseFlag"; + +static NSString *const kRomPath = @"_romPath"; +static NSString *const kDf1EnabledKey = @"df1Enabled"; +static NSString *const kDf2EnabledKey = @"df2Enabled"; +static NSString *const kDf3EnabledKey = @"df3Enabled"; +static NSString *const kHardfilePath = @"_hardfilePath"; +static NSString *const kHardfileReadOnly = @"_hardfileReadOnly"; +static NSString *const kVolume = @"_volume"; +static NSString *const kCmem = @"_cmem"; +static NSString *const kFmem = @"_fmem"; + +#endif /* constSettings_h */ diff --git a/Classes/iAmigaAppDelegate.h b/Classes/iAmigaAppDelegate.h index d9c75e9..2b7a35f 100644 --- a/Classes/iAmigaAppDelegate.h +++ b/Classes/iAmigaAppDelegate.h @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 2/7/09. // Copyright __MyCompanyName__ 2009. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import @@ -21,5 +36,7 @@ @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *mainController; +- (void)configureScreens; + @end diff --git a/Classes/iAmigaAppDelegate.mm b/Classes/iAmigaAppDelegate.mm index 1fedf66..cceab00 100644 --- a/Classes/iAmigaAppDelegate.mm +++ b/Classes/iAmigaAppDelegate.mm @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 2/7/09. // Copyright __MyCompanyName__ 2009. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import "iAmigaAppDelegate.h" #import "EmulationViewController.h" @@ -25,35 +40,6 @@ @implementation iAmigaAppDelegate @synthesize window, mainController=_mainController; -static UaeDebugger *debugger; - -- (void)applicationDidFinishLaunching:(UIApplication *)application { - //_emulationView = [EmulationViewController new]; - [window addSubview:self.mainController.view]; - - // Override point for customization after application launch - [window makeKeyAndVisible]; - - SDL_Init(0); - SDL_Surface *surface = SDL_SetVideoMode(320, 240, 16, 0); - id surfaceView = (id)surface->userdata; - surfaceView.paused = YES; - - OSStatus res = AudioSessionInitialize(NULL, NULL, NULL, NULL); - UInt32 sessionCategory = kAudioSessionCategory_AmbientSound; - res = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory); - res = AudioSessionSetActive(true); - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidDisconnect:) name:UIScreenDidDisconnectNotification object:nil]; - [self configureScreens]; - - self.mainController.selectedIndex = 1; - - //debugger = [[UaeDebugger alloc] init]; - //[debugger startOnPort:2000]; -} - - (void)screenDidConnect:(NSNotification*)aNotification { [self configureScreens]; } @@ -63,6 +49,14 @@ - (void)screenDidDisconnect:(NSNotification*)aNotification { } +- (void)applicationWillResignActive:(UIApplication *)application { + SDL_PauseOpenGL(1); +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + SDL_PauseOpenGL(0); +} + - (void)configureScreens { if ([[UIScreen screens] count] == 1) { NSLog(@"Device display"); @@ -97,11 +91,6 @@ - (void)configureScreens { } } -- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window -{ - NSUInteger orientations = UIInterfaceOrientationMaskLandscape; -} - - (void)dealloc { [window release]; [super dealloc]; diff --git a/Classes/iUAEApplication.h b/Classes/iUAEApplication.h new file mode 100644 index 0000000..c92829d --- /dev/null +++ b/Classes/iUAEApplication.h @@ -0,0 +1,21 @@ +// Created by Emufr3ak on 17.07.16. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface iUAEApplication : UIApplication + +@end diff --git a/Classes/iUAEApplication.mm b/Classes/iUAEApplication.mm new file mode 100644 index 0000000..672c40f --- /dev/null +++ b/Classes/iUAEApplication.mm @@ -0,0 +1,53 @@ +// Created by Emufr3ak on 17.07.16. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#define MENUBAR 123 + +#import "iUAEApplication.h" +#import "MultiPeerConnectivityController.h" + +@implementation iUAEApplication { + int _firstClick; +} + +-(id)init { + _firstClick = 1; + + [super init]; + + return self; +} + +- (void)sendEvent:(UIEvent*)event { + + [super sendEvent:event]; + + if(_firstClick && event.type == UIEventTypeTouches) { + + UITouch *touch = event.allTouches.anyObject; + UIView *touchedview = [touch view]; + + MultiPeerConnectivityController *mpcController = [MultiPeerConnectivityController getinstance]; + + if(mpcController && ![touchedview isMemberOfClass:[UIButton class]]) { + [mpcController enableControllerMode]; + } + + _firstClick = 0; + } +} + +@end diff --git a/Classes/minizip/crypt.h b/Classes/minizip/crypt.h new file mode 100644 index 0000000..f14a628 --- /dev/null +++ b/Classes/minizip/crypt.h @@ -0,0 +1,132 @@ +/* crypt.h -- base code for crypt/uncrypt ZIPfile + + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This code is a modified version of crypting code in Infozip distribution + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + If you don't need crypting in your application, just define symbols + NOCRYPT and NOUNCRYPT. + + This code support the "Traditional PKWARE Encryption". + + The new AES encryption added on Zip format by Winzip (see the page + http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong + Encryption is not supported. +*/ + +#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) + +/*********************************************************************** + * Return the next byte in the pseudo-random sequence + */ +static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) +{ + unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an + * unpredictable manner on 16-bit systems; not a problem + * with any known compiler so far, though */ + + temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; + return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); +} + +/*********************************************************************** + * Update the encryption keys with the next byte of plain text + */ +static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) +{ + (*(pkeys+0)) = CRC32((*(pkeys+0)), c); + (*(pkeys+1)) += (*(pkeys+0)) & 0xff; + (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; + { + register int keyshift = (int)((*(pkeys+1)) >> 24); + (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); + } + return c; +} + + +/*********************************************************************** + * Initialize the encryption keys and the random header according to + * the given password. + */ +static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) +{ + *(pkeys+0) = 305419896L; + *(pkeys+1) = 591751049L; + *(pkeys+2) = 878082192L; + while (*passwd != '\0') { + update_keys(pkeys,pcrc_32_tab,(int)*passwd); + passwd++; + } +} + +#define zdecode(pkeys,pcrc_32_tab,c) \ + (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) + +#define zencode(pkeys,pcrc_32_tab,c,t) \ + (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) + +#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED + +#define RAND_HEAD_LEN 12 + /* "last resort" source for second part of crypt seed pattern */ +# ifndef ZCR_SEED2 +# define ZCR_SEED2 3141592654UL /* use PI as default pattern */ +# endif + +static int crypthead(passwd, buf, bufSize, pkeys, pcrc_32_tab, crcForCrypting) + const char *passwd; /* password string */ + unsigned char *buf; /* where to write header */ + int bufSize; + unsigned long* pkeys; + const unsigned long* pcrc_32_tab; + unsigned long crcForCrypting; +{ + int n; /* index in random header */ + int t; /* temporary */ + int c; /* random byte */ + unsigned char header[RAND_HEAD_LEN-2]; /* random header */ + static unsigned calls = 0; /* ensure different random header each time */ + + if (bufSize> 7) & 0xff; + header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); + } + /* Encrypt random header (last two bytes is high word of crc) */ + init_keys(passwd, pkeys, pcrc_32_tab); + for (n = 0; n < RAND_HEAD_LEN-2; n++) + { + buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); + } + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); + buf[n++] = zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); + return n; +} + +#endif diff --git a/Classes/minizip/ioapi.c b/Classes/minizip/ioapi.c new file mode 100644 index 0000000..7f20c18 --- /dev/null +++ b/Classes/minizip/ioapi.c @@ -0,0 +1,177 @@ +/* ioapi.c -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#include +#include +#include + +#include "zlib.h" +#include "ioapi.h" + + + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +voidpf ZCALLBACK fopen_file_func OF(( + voidpf opaque, + const char* filename, + int mode)); + +uLong ZCALLBACK fread_file_func OF(( + voidpf opaque, + voidpf stream, + void* buf, + uLong size)); + +uLong ZCALLBACK fwrite_file_func OF(( + voidpf opaque, + voidpf stream, + const void* buf, + uLong size)); + +long ZCALLBACK ftell_file_func OF(( + voidpf opaque, + voidpf stream)); + +long ZCALLBACK fseek_file_func OF(( + voidpf opaque, + voidpf stream, + uLong offset, + int origin)); + +int ZCALLBACK fclose_file_func OF(( + voidpf opaque, + voidpf stream)); + +int ZCALLBACK ferror_file_func OF(( + voidpf opaque, + voidpf stream)); + + +voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) + voidpf opaque; + const char* filename; + int mode; +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + + +uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) + voidpf opaque; + voidpf stream; + void* buf; + uLong size; +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + + +uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) + voidpf opaque; + voidpf stream; + const void* buf; + uLong size; +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +long ZCALLBACK ftell_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + +long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) + voidpf opaque; + voidpf stream; + uLong offset; + int origin; +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + fseek((FILE *)stream, offset, fseek_origin); + return ret; +} + +int ZCALLBACK fclose_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +int ZCALLBACK ferror_file_func (opaque, stream) + voidpf opaque; + voidpf stream; +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/Classes/minizip/ioapi.h b/Classes/minizip/ioapi.h new file mode 100644 index 0000000..e73a3b2 --- /dev/null +++ b/Classes/minizip/ioapi.h @@ -0,0 +1,75 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + files using zlib + zip or unzip API + + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant +*/ + +#ifndef _ZLIBIOAPI_H +#define _ZLIBIOAPI_H + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + +#if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) +#define ZCALLBACK CALLBACK +#else +#define ZCALLBACK +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + + + +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +#define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) +#define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) +#define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) +#define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) +#define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) + + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/Classes/minizip/mztools.c b/Classes/minizip/mztools.c new file mode 100644 index 0000000..bc5c798 --- /dev/null +++ b/Classes/minizip/mztools.c @@ -0,0 +1,281 @@ +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +/* Code */ +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#define READ_8(adr) ((unsigned char)*(adr)) +#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) ) +#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) ) + +#define WRITE_8(buff, n) do { \ + *((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \ +} while(0) +#define WRITE_16(buff, n) do { \ + WRITE_8((unsigned char*)(buff), n); \ + WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \ +} while(0) +#define WRITE_32(buff, n) do { \ + WRITE_16((unsigned char*)(buff), (n) & 0xffff); \ + WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ +} while(0) + +extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) +const char* file; +const char* fileOut; +const char* fileOutTmp; +uLong* nRecovered; +uLong* bytesRecovered; +{ + int err = Z_OK; + FILE* fpZip = fopen(file, "rb"); + FILE* fpOut = fopen(fileOut, "wb"); + FILE* fpOutCD = fopen(fileOutTmp, "wb"); + if (fpZip != NULL && fpOut != NULL) { + int entries = 0; + uLong totalBytes = 0; + char header[30]; + char filename[256]; + char extra[1024]; + int offset = 0; + int offsetCD = 0; + while ( fread(header, 1, 30, fpZip) == 30 ) { + int currentOffset = offset; + + /* File entry */ + if (READ_32(header) == 0x04034b50) { + unsigned int version = READ_16(header + 4); + unsigned int gpflag = READ_16(header + 6); + unsigned int method = READ_16(header + 8); + unsigned int filetime = READ_16(header + 10); + unsigned int filedate = READ_16(header + 12); + unsigned int crc = READ_32(header + 14); /* crc */ + unsigned int cpsize = READ_32(header + 18); /* compressed size */ + unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */ + unsigned int fnsize = READ_16(header + 26); /* file name length */ + unsigned int extsize = READ_16(header + 28); /* extra field length */ + filename[0] = extra[0] = '\0'; + + /* Header */ + if (fwrite(header, 1, 30, fpOut) == 30) { + offset += 30; + } else { + err = Z_ERRNO; + break; + } + + /* Filename */ + if (fnsize > 0) { + if (fread(filename, 1, fnsize, fpZip) == fnsize) { + if (fwrite(filename, 1, fnsize, fpOut) == fnsize) { + offset += fnsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_STREAM_ERROR; + break; + } + + /* Extra field */ + if (extsize > 0) { + if (fread(extra, 1, extsize, fpZip) == extsize) { + if (fwrite(extra, 1, extsize, fpOut) == extsize) { + offset += extsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_ERRNO; + break; + } + } + + /* Data */ + { + int dataSize = cpsize; + if (dataSize == 0) { + dataSize = uncpsize; + } + if (dataSize > 0) { + char* data = malloc(dataSize); + if (data != NULL) { + if ((int)fread(data, 1, dataSize, fpZip) == dataSize) { + if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) { + offset += dataSize; + totalBytes += dataSize; + } else { + err = Z_ERRNO; + } + } else { + err = Z_ERRNO; + } + free(data); + if (err != Z_OK) { + break; + } + } else { + err = Z_MEM_ERROR; + break; + } + } + } + + /* Central directory entry */ + { + char header[46]; + char* comment = ""; + int comsize = (int) strlen(comment); + WRITE_32(header, 0x02014b50); + WRITE_16(header + 4, version); + WRITE_16(header + 6, version); + WRITE_16(header + 8, gpflag); + WRITE_16(header + 10, method); + WRITE_16(header + 12, filetime); + WRITE_16(header + 14, filedate); + WRITE_32(header + 16, crc); + WRITE_32(header + 20, cpsize); + WRITE_32(header + 24, uncpsize); + WRITE_16(header + 28, fnsize); + WRITE_16(header + 30, extsize); + WRITE_16(header + 32, comsize); + WRITE_16(header + 34, 0); /* disk # */ + WRITE_16(header + 36, 0); /* int attrb */ + WRITE_32(header + 38, 0); /* ext attrb */ + WRITE_32(header + 42, currentOffset); + /* Header */ + if (fwrite(header, 1, 46, fpOutCD) == 46) { + offsetCD += 46; + + /* Filename */ + if (fnsize > 0) { + if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) { + offsetCD += fnsize; + } else { + err = Z_ERRNO; + break; + } + } else { + err = Z_STREAM_ERROR; + break; + } + + /* Extra field */ + if (extsize > 0) { + if (fwrite(extra, 1, extsize, fpOutCD) == extsize) { + offsetCD += extsize; + } else { + err = Z_ERRNO; + break; + } + } + + /* Comment field */ + if (comsize > 0) { + if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) { + offsetCD += comsize; + } else { + err = Z_ERRNO; + break; + } + } + + + } else { + err = Z_ERRNO; + break; + } + } + + /* Success */ + entries++; + + } else { + break; + } + } + + /* Final central directory */ + { + int entriesZip = entries; + char header[22]; + char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools"; + int comsize = (int) strlen(comment); + if (entriesZip > 0xffff) { + entriesZip = 0xffff; + } + WRITE_32(header, 0x06054b50); + WRITE_16(header + 4, 0); /* disk # */ + WRITE_16(header + 6, 0); /* disk # */ + WRITE_16(header + 8, entriesZip); /* hack */ + WRITE_16(header + 10, entriesZip); /* hack */ + WRITE_32(header + 12, offsetCD); /* size of CD */ + WRITE_32(header + 16, offset); /* offset to CD */ + WRITE_16(header + 20, comsize); /* comment */ + + /* Header */ + if (fwrite(header, 1, 22, fpOutCD) == 22) { + + /* Comment field */ + if (comsize > 0) { + if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) { + err = Z_ERRNO; + } + } + + } else { + err = Z_ERRNO; + } + } + + /* Final merge (file + central directory) */ + fclose(fpOutCD); + if (err == Z_OK) { + fpOutCD = fopen(fileOutTmp, "rb"); + if (fpOutCD != NULL) { + int nRead; + char buffer[8192]; + while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { + if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { + err = Z_ERRNO; + break; + } + } + fclose(fpOutCD); + } + } + + /* Close */ + fclose(fpZip); + fclose(fpOut); + + /* Wipe temporary file */ + (void)remove(fileOutTmp); + + /* Number of recovered entries */ + if (err == Z_OK) { + if (nRecovered != NULL) { + *nRecovered = entries; + } + if (bytesRecovered != NULL) { + *bytesRecovered = totalBytes; + } + } + } else { + err = Z_STREAM_ERROR; + } + return err; +} diff --git a/Classes/minizip/mztools.h b/Classes/minizip/mztools.h new file mode 100644 index 0000000..82d1597 --- /dev/null +++ b/Classes/minizip/mztools.h @@ -0,0 +1,31 @@ +/* + Additional tools for Minizip + Code: Xavier Roche '2004 + License: Same as ZLIB (www.gzip.org) +*/ + +#ifndef _zip_tools_H +#define _zip_tools_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#include "unzip.h" + +/* Repair a ZIP file (missing central directory) + file: file to recover + fileOut: output file after recovery + fileOutTmp: temporary file name used for recovery +*/ +extern int ZEXPORT unzRepair(const char* file, + const char* fileOut, + const char* fileOutTmp, + uLong* nRecovered, + uLong* bytesRecovered); + +#endif diff --git a/Classes/minizip/unzip.c b/Classes/minizip/unzip.c new file mode 100644 index 0000000..7a14c9e --- /dev/null +++ b/Classes/minizip/unzip.c @@ -0,0 +1,1605 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wdangling-else" +#pragma clang diagnostic ignored "-Wparentheses-equality" + +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + Read unzip.h for more info +*/ + +/* Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of +compatibility with older software. The following is from the original crypt.c. Code +woven in by Terry Thorsen 1/2003. +*/ +/* + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html +*/ +/* + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + */ + +/* + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + */ + + +#include +#include +#include +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info_internal_s +{ + uLong offset_curfile;/* relative offset of local header 4 bytes */ +} unz_file_info_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + + uLong pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + uLong offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + uLong pos_local_extrafield; /* position in the local extra field in read*/ + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + uLong rest_read_compressed; /* number of byte to be decompressed */ + uLong rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip_read_info_s; + + +/* unz_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + unz_global_info gi; /* public global information */ + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + uLong num_file; /* number of the current file in the zipfile*/ + uLong pos_in_central_dir; /* pos of the current file in the central dir*/ + uLong current_file_ok; /* flag about the usability of the current file*/ + uLong central_pos; /* position of the beginning of the central dir*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info cur_file_info; /* public info about the current file in zip*/ + unz_file_info_internal cur_file_info_internal; /* private info about it*/ + file_in_zip_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unzlocal_getByte OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unzlocal_getByte(pzlib_filefunc_def,filestream,pi) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + int *pi; +{ + unsigned char c; + int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unzlocal_getShort OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unzlocal_getShort (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unzlocal_getLong OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unzlocal_getLong (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unzlocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (fileName1,fileName2) + const char* fileName1; + const char* fileName2; +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity) + const char* fileName1; + const char* fileName2; + int iCaseSensitivity; +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong unzlocal_SearchCentralDir OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream)); + +local uLong unzlocal_SearchCentralDir(pzlib_filefunc_def,filestream) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +extern unzFile ZEXPORT unzOpen2 (path, pzlib_filefunc_def) + const char *path; + zlib_filefunc_def* pzlib_filefunc_def; +{ + unz_s us; + unz_s *s; + uLong central_pos,uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + if (pzlib_filefunc_def==NULL) + fill_fopen_filefunc(&us.z_filefunc); + else + us.z_filefunc = *pzlib_filefunc_def; + + us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque, + path, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + if (ZSEEK(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* zipfile comment length */ + if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info) + unzFile file; + unz_global_info *pglobal_info; +{ + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + + +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unzlocal_DosDateToTmuDate (ulDosDate, ptm) + uLong ulDosDate; + tm_unz* ptm; +{ + uLong uDate; + uDate = (uLong)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info *pfile_info, + unz_file_info_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unzlocal_GetCurrentFileInfoInternal (file, + pfile_info, + pfile_info_internal, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + unz_file_info_internal *pfile_info_internal; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + unz_s* s; + unz_file_info file_info; + unz_file_info_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (ZSEEK(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + + if ((err==UNZ_OK) && (extraField!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,extraField,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek += file_info.size_file_extra - uSizeRead; + } + else + lSeek+=file_info.size_file_extra; + + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo (file, + pfile_info, + szFileName, fileNameBufferSize, + extraField, extraFieldBufferSize, + szComment, commentBufferSize) + unzFile file; + unz_file_info *pfile_info; + char *szFileName; + uLong fileNameBufferSize; + void *extraField; + uLong extraFieldBufferSize; + char *szComment; + uLong commentBufferSize; +{ + return unzlocal_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (file) + unzFile file; +{ + int err=UNZ_OK; + unz_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (file) + unzFile file; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity) + unzFile file; + const char *szFileName; + int iCaseSensitivity; +{ + unz_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info cur_file_infoSaved; + unz_file_info_internal cur_file_info_internalSaved; + uLong num_fileSaved; + uLong pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; // offset in file + uLong num_of_file; // # of file +} unz_file_pos; +*/ + +extern int ZEXPORT unzGetFilePos(file, file_pos) + unzFile file; + unz_file_pos* file_pos; +{ + unz_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +extern int ZEXPORT unzGoToFilePos(file, file_pos) + unzFile file; + unz_file_pos* file_pos; +{ + unz_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, + poffset_local_extrafield, + psize_local_extrafield) + unz_s* s; + uInt* piSizeVar; + uLong *poffset_local_extrafield; + uInt *psize_local_extrafield; +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unzlocal_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unzlocal_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile3 (file, method, level, raw, password) + unzFile file; + int* method; + int* level; + int raw; + const char* password; +{ + int err=UNZ_OK; + uInt iSizeVar; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uLong offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unzlocal_CheckCurrentFileCoherencyHeader(s,&iSizeVar, + &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip_read_info_s*) + ALLOC(sizeof(file_in_zip_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->compression_method = + s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_DEFLATED) && + (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=1; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +extern int ZEXPORT unzOpenCurrentFile (file) + unzFile file; +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +extern int ZEXPORT unzOpenCurrentFilePassword (file, password) + unzFile file; + const char* password; +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +extern int ZEXPORT unzOpenCurrentFile2 (file,method,level,raw) + unzFile file; + int* method; + int* level; + int raw; +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (file, buf, len) + unzFile file; + voidp buf; + unsigned len; +{ + int err=UNZ_OK; + uInt iRead = 0; + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else + { + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (file) + unzFile file; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) + unzFile file; + voidp buf; + unsigned len; +{ + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + uInt read_now; + uLong size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (file) + unzFile file; +{ + int err=UNZ_OK; + + unz_s* s; + file_in_zip_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised) + inflateEnd(&pfile_in_zip_read_info->stream); + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf) + unzFile file; + char *szComment; + uLong uSizeBuf; +{ + int err=UNZ_OK; + unz_s* s; + uLong uReadThis ; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +extern uLong ZEXPORT unzGetOffset (file) + unzFile file; +{ + unz_s* s; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +extern int ZEXPORT unzSetOffset (file, pos) + unzFile file; + uLong pos; +{ + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +#pragma clang diagnostic pop diff --git a/Classes/minizip/unzip.h b/Classes/minizip/unzip.h new file mode 100644 index 0000000..c3206a0 --- /dev/null +++ b/Classes/minizip/unzip.h @@ -0,0 +1,354 @@ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _unz_H +#define _unz_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ + +extern unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz_H */ diff --git a/Classes/minizip/zip.c b/Classes/minizip/zip.c new file mode 100644 index 0000000..f9edf2d --- /dev/null +++ b/Classes/minizip/zip.c @@ -0,0 +1,1224 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wparentheses-equality" + +/* zip.c -- IO on .zip files using zlib + Version 1.01e, February 12th, 2005 + + 27 Dec 2004 Rolf Kalbermatter + Modification to zipOpen2 to support globalComment retrieval. + + Copyright (C) 1998-2005 Gilles Vollant + + Read zip.h for more info +*/ + + +#include +#include +#include +#include +#include "zlib.h" +#include "zip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + +#ifndef VERSIONMADEBY +# define VERSIONMADEBY (0x0) /* platform depedent */ +#endif + +#ifndef Z_BUFSIZE +#define Z_BUFSIZE (16384) +#endif + +#ifndef Z_MAXFILENAMEINZIP +#define Z_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +/* +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) +*/ + +/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ + +#ifndef SEEK_CUR +#define SEEK_CUR 1 +#endif + +#ifndef SEEK_END +#define SEEK_END 2 +#endif + +#ifndef SEEK_SET +#define SEEK_SET 0 +#endif + +#ifndef DEF_MEM_LEVEL +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif +#endif +const char zip_copyright[] = + " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + + +#define SIZEDATA_INDATABLOCK (4096-(4*4)) + +#define LOCALHEADERMAGIC (0x04034b50) +#define CENTRALHEADERMAGIC (0x02014b50) +#define ENDHEADERMAGIC (0x06054b50) + +#define FLAG_LOCALHEADER_OFFSET (0x06) +#define CRC_LOCALHEADER_OFFSET (0x0e) + +#define SIZECENTRALHEADER (0x2e) /* 46 */ + +typedef struct linkedlist_datablock_internal_s +{ + struct linkedlist_datablock_internal_s* next_datablock; + uLong avail_in_this_block; + uLong filled_in_this_block; + uLong unused; /* for future use and alignement */ + unsigned char data[SIZEDATA_INDATABLOCK]; +} linkedlist_datablock_internal; + +typedef struct linkedlist_data_s +{ + linkedlist_datablock_internal* first_block; + linkedlist_datablock_internal* last_block; +} linkedlist_data; + + +typedef struct +{ + z_stream stream; /* zLib stream structure for inflate */ + int stream_initialised; /* 1 is stream is initialised */ + uInt pos_in_buffered_data; /* last written byte in buffered_data */ + + uLong pos_local_header; /* offset of the local header of the file + currenty writing */ + char* central_header; /* central header data for the current file */ + uLong size_centralheader; /* size of the central header for cur file */ + uLong flag; /* flag of the file currently writing */ + + int method; /* compression method of file currenty wr.*/ + int raw; /* 1 for directly writing raw data */ + Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ + uLong dosDate; + uLong crc32; + int encrypt; +#ifndef NOCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; + int crypt_header_size; +#endif +} curfile_info; + +typedef struct +{ + zlib_filefunc_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + linkedlist_data central_dir;/* datablock with central dir in construction*/ + int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ + curfile_info ci; /* info on the file curretly writing */ + + uLong begin_pos; /* position of the beginning of the zipfile */ + uLong add_position_when_writting_offset; + uLong number_entry; +#ifndef NO_ADDFILEINEXISTINGZIP + char *globalcomment; +#endif +} zip_internal; + + + +#ifndef NOCRYPT +#define INCLUDECRYPTINGCODE_IFCRYPTALLOWED +#include "crypt.h" +#endif + +local linkedlist_datablock_internal* allocate_new_datablock() +{ + linkedlist_datablock_internal* ldi; + ldi = (linkedlist_datablock_internal*) + ALLOC(sizeof(linkedlist_datablock_internal)); + if (ldi!=NULL) + { + ldi->next_datablock = NULL ; + ldi->filled_in_this_block = 0 ; + ldi->avail_in_this_block = SIZEDATA_INDATABLOCK ; + } + return ldi; +} + +local void free_datablock(ldi) + linkedlist_datablock_internal* ldi; +{ + while (ldi!=NULL) + { + linkedlist_datablock_internal* ldinext = ldi->next_datablock; + TRYFREE(ldi); + ldi = ldinext; + } +} + +local void init_linkedlist(ll) + linkedlist_data* ll; +{ + ll->first_block = ll->last_block = NULL; +} + +local void free_linkedlist(ll) + linkedlist_data* ll; +{ + free_datablock(ll->first_block); + ll->first_block = ll->last_block = NULL; +} + + +local int add_data_in_datablock(ll,buf,len) + linkedlist_data* ll; + const void* buf; + uLong len; +{ + linkedlist_datablock_internal* ldi; + const unsigned char* from_copy; + + if (ll==NULL) + return ZIP_INTERNALERROR; + + if (ll->last_block == NULL) + { + ll->first_block = ll->last_block = allocate_new_datablock(); + if (ll->first_block == NULL) + return ZIP_INTERNALERROR; + } + + ldi = ll->last_block; + from_copy = (unsigned char*)buf; + + while (len>0) + { + uInt copy_this; + uInt i; + unsigned char* to_copy; + + if (ldi->avail_in_this_block==0) + { + ldi->next_datablock = allocate_new_datablock(); + if (ldi->next_datablock == NULL) + return ZIP_INTERNALERROR; + ldi = ldi->next_datablock ; + ll->last_block = ldi; + } + + if (ldi->avail_in_this_block < len) + copy_this = (uInt)ldi->avail_in_this_block; + else + copy_this = (uInt)len; + + to_copy = &(ldi->data[ldi->filled_in_this_block]); + + for (i=0;ifilled_in_this_block += copy_this; + ldi->avail_in_this_block -= copy_this; + from_copy += copy_this ; + len -= copy_this; + } + return ZIP_OK; +} + + + +/****************************************************************************/ + +#ifndef NO_ADDFILEINEXISTINGZIP +/* =========================================================================== + Inputs a long in LSB order to the given file + nbByte == 1, 2 or 4 (byte, short or long) +*/ + +local int ziplocal_putValue OF((const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, uLong x, int nbByte)); +local int ziplocal_putValue (pzlib_filefunc_def, filestream, x, nbByte) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong x; + int nbByte; +{ + unsigned char buf[4]; + int n; + for (n = 0; n < nbByte; n++) + { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + + if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) + return ZIP_ERRNO; + else + return ZIP_OK; +} + +local void ziplocal_putValue_inmemory OF((void* dest, uLong x, int nbByte)); +local void ziplocal_putValue_inmemory (dest, x, nbByte) + void* dest; + uLong x; + int nbByte; +{ + unsigned char* buf=(unsigned char*)dest; + int n; + for (n = 0; n < nbByte; n++) { + buf[n] = (unsigned char)(x & 0xff); + x >>= 8; + } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } +} + +/****************************************************************************/ + + +local uLong ziplocal_TmzDateToDosDate(ptm,dosDate) + const tm_zip* ptm; + uLong dosDate; +{ + uLong year = (uLong)ptm->tm_year; + if (year>1980) + year-=1980; + else if (year>80) + year-=80; + return + (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) | + ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour)); +} + + +/****************************************************************************/ + +local int ziplocal_getByte OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int ziplocal_getByte(pzlib_filefunc_def,filestream,pi) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + int *pi; +{ + unsigned char c; + int err = (int)ZREAD(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return ZIP_OK; + } + else + { + if (ZERROR(*pzlib_filefunc_def,filestream)) + return ZIP_ERRNO; + else + return ZIP_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int ziplocal_getShort OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int ziplocal_getShort (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int ziplocal_getLong OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int ziplocal_getLong (pzlib_filefunc_def,filestream,pX) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; + uLong *pX; +{ + uLong x ; + int i; + int err; + + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<8; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<16; + + if (err==ZIP_OK) + err = ziplocal_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==ZIP_OK) + *pX = x; + else + *pX = 0; + return err; +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local uLong ziplocal_SearchCentralDir OF(( + const zlib_filefunc_def* pzlib_filefunc_def, + voidpf filestream)); + +local uLong ziplocal_SearchCentralDir(pzlib_filefunc_def,filestream) + const zlib_filefunc_def* pzlib_filefunc_def; + voidpf filestream; +{ + unsigned char* buf; + uLong uSizeFile; + uLong uBackRead; + uLong uMaxBack=0xffff; /* maximum size of global comment */ + uLong uPosFound=0; + + if (ZSEEK(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); + if (ZSEEK(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} +#endif /* !NO_ADDFILEINEXISTINGZIP*/ + +/************************************************************/ +extern zipFile ZEXPORT zipOpen2 (pathname, append, globalcomment, pzlib_filefunc_def) + const char *pathname; + int append; + zipcharpc* globalcomment; + zlib_filefunc_def* pzlib_filefunc_def; +{ + zip_internal ziinit; + zip_internal* zi; + int err=ZIP_OK; + + + if (pzlib_filefunc_def==NULL) + fill_fopen_filefunc(&ziinit.z_filefunc); + else + ziinit.z_filefunc = *pzlib_filefunc_def; + + ziinit.filestream = (*(ziinit.z_filefunc.zopen_file)) + (ziinit.z_filefunc.opaque, + pathname, + (append == APPEND_STATUS_CREATE) ? + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_CREATE) : + (ZLIB_FILEFUNC_MODE_READ | ZLIB_FILEFUNC_MODE_WRITE | ZLIB_FILEFUNC_MODE_EXISTING)); + + if (ziinit.filestream == NULL) + return NULL; + ziinit.begin_pos = ZTELL(ziinit.z_filefunc,ziinit.filestream); + ziinit.in_opened_file_inzip = 0; + ziinit.ci.stream_initialised = 0; + ziinit.number_entry = 0; + ziinit.add_position_when_writting_offset = 0; + init_linkedlist(&(ziinit.central_dir)); + + + zi = (zip_internal*)ALLOC(sizeof(zip_internal)); + if (zi==NULL) + { + ZCLOSE(ziinit.z_filefunc,ziinit.filestream); + return NULL; + } + + /* now we add file in a zipfile */ +# ifndef NO_ADDFILEINEXISTINGZIP + ziinit.globalcomment = NULL; + if (append == APPEND_STATUS_ADDINZIP) + { + uLong byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + + uLong size_central_dir; /* size of the central directory */ + uLong offset_central_dir; /* offset of start of central directory */ + uLong central_pos,uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + uLong number_entry; + uLong number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + uLong size_comment; + + central_pos = ziplocal_SearchCentralDir(&ziinit.z_filefunc,ziinit.filestream); + if (central_pos==0) + err=ZIP_ERRNO; + + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + + /* the signature, already checked */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&uL)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of this disk */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk)!=ZIP_OK) + err=ZIP_ERRNO; + + /* number of the disk with the start of the central directory */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_disk_with_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry)!=ZIP_OK) + err=ZIP_ERRNO; + + /* total number of entries in the central dir */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&number_entry_CD)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((number_entry_CD!=number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=ZIP_BADZIPFILE; + + /* size of the central directory */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&size_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (ziplocal_getLong(&ziinit.z_filefunc, ziinit.filestream,&offset_central_dir)!=ZIP_OK) + err=ZIP_ERRNO; + + /* zipfile global comment length */ + if (ziplocal_getShort(&ziinit.z_filefunc, ziinit.filestream,&size_comment)!=ZIP_OK) + err=ZIP_ERRNO; + + if ((central_pos0) + { + ziinit.globalcomment = ALLOC(size_comment+1); + if (ziinit.globalcomment) + { + size_comment = ZREAD(ziinit.z_filefunc, ziinit.filestream,ziinit.globalcomment,size_comment); + ziinit.globalcomment[size_comment]=0; + } + } + + byte_before_the_zipfile = central_pos - + (offset_central_dir+size_central_dir); + ziinit.add_position_when_writting_offset = byte_before_the_zipfile; + + { + uLong size_central_dir_to_read = size_central_dir; + size_t buf_size = SIZEDATA_INDATABLOCK; + void* buf_read = (void*)ALLOC(buf_size); + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + offset_central_dir + byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET) != 0) + err=ZIP_ERRNO; + + while ((size_central_dir_to_read>0) && (err==ZIP_OK)) + { + uLong read_this = SIZEDATA_INDATABLOCK; + if (read_this > size_central_dir_to_read) + read_this = size_central_dir_to_read; + if (ZREAD(ziinit.z_filefunc, ziinit.filestream,buf_read,read_this) != read_this) + err=ZIP_ERRNO; + + if (err==ZIP_OK) + err = add_data_in_datablock(&ziinit.central_dir,buf_read, + (uLong)read_this); + size_central_dir_to_read-=read_this; + } + TRYFREE(buf_read); + } + ziinit.begin_pos = byte_before_the_zipfile; + ziinit.number_entry = number_entry_CD; + + if (ZSEEK(ziinit.z_filefunc, ziinit.filestream, + offset_central_dir+byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=ZIP_ERRNO; + } + + if (globalcomment) + { + *globalcomment = ziinit.globalcomment; + } +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + + if (err != ZIP_OK) + { +# ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(ziinit.globalcomment); +# endif /* !NO_ADDFILEINEXISTINGZIP*/ + TRYFREE(zi); + return NULL; + } + else + { + *zi = ziinit; + return (zipFile)zi; + } +} + +extern zipFile ZEXPORT zipOpen (pathname, append) + const char *pathname; + int append; +{ + return zipOpen2(pathname,append,NULL,NULL); +} + +extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + windowBits, memLevel, strategy, + password, crcForCrypting) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; + int raw; + int windowBits; + int memLevel; + int strategy; + const char* password; + uLong crcForCrypting; +{ + zip_internal* zi; + uInt size_filename; + uInt size_comment; + uInt i; + int err = ZIP_OK; + +# ifdef NOCRYPT + if (password != NULL) + return ZIP_PARAMERROR; +# endif + + if (file == NULL) + return ZIP_PARAMERROR; + if ((method!=0) && (method!=Z_DEFLATED)) + return ZIP_PARAMERROR; + + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + if (err != ZIP_OK) + return err; + } + + + if (filename==NULL) + filename="-"; + + if (comment==NULL) + size_comment = 0; + else + size_comment = (uInt)strlen(comment); + + size_filename = (uInt)strlen(filename); + + if (zipfi == NULL) + zi->ci.dosDate = 0; + else + { + if (zipfi->dosDate != 0) + zi->ci.dosDate = zipfi->dosDate; + else zi->ci.dosDate = ziplocal_TmzDateToDosDate(&zipfi->tmz_date,zipfi->dosDate); + } + + zi->ci.flag = 0; + if ((level==8) || (level==9)) + zi->ci.flag |= 2; + if ((level==2)) + zi->ci.flag |= 4; + if ((level==1)) + zi->ci.flag |= 6; + if (password != NULL) + zi->ci.flag |= 1; + + zi->ci.crc32 = 0; + zi->ci.method = method; + zi->ci.encrypt = 0; + zi->ci.stream_initialised = 0; + zi->ci.pos_in_buffered_data = 0; + zi->ci.raw = raw; + zi->ci.pos_local_header = ZTELL(zi->z_filefunc,zi->filestream) ; + zi->ci.size_centralheader = SIZECENTRALHEADER + size_filename + + size_extrafield_global + size_comment; + zi->ci.central_header = (char*)ALLOC((uInt)zi->ci.size_centralheader); + + ziplocal_putValue_inmemory(zi->ci.central_header,(uLong)CENTRALHEADERMAGIC,4); + /* version info */ + ziplocal_putValue_inmemory(zi->ci.central_header+4,(uLong)VERSIONMADEBY,2); + ziplocal_putValue_inmemory(zi->ci.central_header+6,(uLong)20,2); + ziplocal_putValue_inmemory(zi->ci.central_header+8,(uLong)zi->ci.flag,2); + ziplocal_putValue_inmemory(zi->ci.central_header+10,(uLong)zi->ci.method,2); + ziplocal_putValue_inmemory(zi->ci.central_header+12,(uLong)zi->ci.dosDate,4); + ziplocal_putValue_inmemory(zi->ci.central_header+16,(uLong)0,4); /*crc*/ + ziplocal_putValue_inmemory(zi->ci.central_header+20,(uLong)0,4); /*compr size*/ + ziplocal_putValue_inmemory(zi->ci.central_header+24,(uLong)0,4); /*uncompr size*/ + ziplocal_putValue_inmemory(zi->ci.central_header+28,(uLong)size_filename,2); + ziplocal_putValue_inmemory(zi->ci.central_header+30,(uLong)size_extrafield_global,2); + ziplocal_putValue_inmemory(zi->ci.central_header+32,(uLong)size_comment,2); + ziplocal_putValue_inmemory(zi->ci.central_header+34,(uLong)0,2); /*disk nm start*/ + + if (zipfi==NULL) + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)0,2); + else + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)zipfi->internal_fa,2); + + if (zipfi==NULL) + ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)0,4); + else + ziplocal_putValue_inmemory(zi->ci.central_header+38,(uLong)zipfi->external_fa,4); + + ziplocal_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header- zi->add_position_when_writting_offset,4); + + for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+i) = + *(((const char*)extrafield_global)+i); + + for (i=0;ici.central_header+SIZECENTRALHEADER+size_filename+ + size_extrafield_global+i) = *(comment+i); + if (zi->ci.central_header == NULL) + return ZIP_INTERNALERROR; + + /* write the local header */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)LOCALHEADERMAGIC,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)20,2);/* version needed to extract */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.flag,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.method,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->ci.dosDate,4); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* crc 32, unknown */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* compressed size, unknown */ + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,4); /* uncompressed size, unknown */ + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_filename,2); + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_extrafield_local,2); + + if ((err==ZIP_OK) && (size_filename>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream,filename,size_filename)!=size_filename) + err = ZIP_ERRNO; + + if ((err==ZIP_OK) && (size_extrafield_local>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream,extrafield_local,size_extrafield_local) + !=size_extrafield_local) + err = ZIP_ERRNO; + + zi->ci.stream.avail_in = (uInt)0; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + zi->ci.stream.total_in = 0; + zi->ci.stream.total_out = 0; + + if ((err==ZIP_OK) && (zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + zi->ci.stream.zalloc = (alloc_func)0; + zi->ci.stream.zfree = (free_func)0; + zi->ci.stream.opaque = (voidpf)0; + + if (windowBits>0) + windowBits = -windowBits; + + err = deflateInit2(&zi->ci.stream, level, + Z_DEFLATED, windowBits, memLevel, strategy); + + if (err==Z_OK) + zi->ci.stream_initialised = 1; + } +# ifndef NOCRYPT + zi->ci.crypt_header_size = 0; + if ((err==Z_OK) && (password != NULL)) + { + unsigned char bufHead[RAND_HEAD_LEN]; + unsigned int sizeHead; + zi->ci.encrypt = 1; + zi->ci.pcrc_32_tab = get_crc_table(); + /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/ + + sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting); + zi->ci.crypt_header_size = sizeHead; + + if (ZWRITE(zi->z_filefunc,zi->filestream,bufHead,sizeHead) != sizeHead) + err = ZIP_ERRNO; + } +# endif + + if (err==Z_OK) + zi->in_opened_file_inzip = 1; + return err; +} + +extern int ZEXPORT zipOpenNewFileInZip2(file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; + int raw; +{ + return zipOpenNewFileInZip3 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, raw, + -MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY, + NULL, 0); +} + +extern int ZEXPORT zipOpenNewFileInZip (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level) + zipFile file; + const char* filename; + const zip_fileinfo* zipfi; + const void* extrafield_local; + uInt size_extrafield_local; + const void* extrafield_global; + uInt size_extrafield_global; + const char* comment; + int method; + int level; +{ + return zipOpenNewFileInZip2 (file, filename, zipfi, + extrafield_local, size_extrafield_local, + extrafield_global, size_extrafield_global, + comment, method, level, 0); +} + +local int zipFlushWriteBuffer(zi) + zip_internal* zi; +{ + int err=ZIP_OK; + + if (zi->ci.encrypt != 0) + { +#ifndef NOCRYPT + uInt i; + int t; + for (i=0;ici.pos_in_buffered_data;i++) + zi->ci.buffered_data[i] = zencode(zi->ci.keys, zi->ci.pcrc_32_tab, + zi->ci.buffered_data[i],t); +#endif + } + if (ZWRITE(zi->z_filefunc,zi->filestream,zi->ci.buffered_data,zi->ci.pos_in_buffered_data) + !=zi->ci.pos_in_buffered_data) + err = ZIP_ERRNO; + zi->ci.pos_in_buffered_data = 0; + return err; +} + +extern int ZEXPORT zipWriteInFileInZip (file, buf, len) + zipFile file; + const void* buf; + unsigned len; +{ + zip_internal* zi; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + + zi->ci.stream.next_in = (void*)buf; + zi->ci.stream.avail_in = len; + zi->ci.crc32 = crc32(zi->ci.crc32,buf,len); + + while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0)) + { + if (zi->ci.stream.avail_out == 0) + { + if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + + + if(err != ZIP_OK) + break; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + uLong uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_NO_FLUSH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + + } + else + { + uInt copy_this,i; + if (zi->ci.stream.avail_in < zi->ci.stream.avail_out) + copy_this = zi->ci.stream.avail_in; + else + copy_this = zi->ci.stream.avail_out; + for (i=0;ici.stream.next_out)+i) = + *(((const char*)zi->ci.stream.next_in)+i); + { + zi->ci.stream.avail_in -= copy_this; + zi->ci.stream.avail_out-= copy_this; + zi->ci.stream.next_in+= copy_this; + zi->ci.stream.next_out+= copy_this; + zi->ci.stream.total_in+= copy_this; + zi->ci.stream.total_out+= copy_this; + zi->ci.pos_in_buffered_data += copy_this; + } + } + } + + return err; +} + +extern int ZEXPORT zipCloseFileInZipRaw (file, uncompressed_size, crc32) + zipFile file; + uLong uncompressed_size; + uLong crc32; +{ + zip_internal* zi; + uLong compressed_size; + int err=ZIP_OK; + + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 0) + return ZIP_PARAMERROR; + zi->ci.stream.avail_in = 0; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + while (err==ZIP_OK) + { + uLong uTotalOutBefore; + if (zi->ci.stream.avail_out == 0) + { + if (zipFlushWriteBuffer(zi) == ZIP_ERRNO) + err = ZIP_ERRNO; + zi->ci.stream.avail_out = (uInt)Z_BUFSIZE; + zi->ci.stream.next_out = zi->ci.buffered_data; + } + uTotalOutBefore = zi->ci.stream.total_out; + err=deflate(&zi->ci.stream, Z_FINISH); + zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; + } + + if (err==Z_STREAM_END) + err=ZIP_OK; /* this is normal */ + + if ((zi->ci.pos_in_buffered_data>0) && (err==ZIP_OK)) + if (zipFlushWriteBuffer(zi)==ZIP_ERRNO) + err = ZIP_ERRNO; + + if ((zi->ci.method == Z_DEFLATED) && (!zi->ci.raw)) + { + err=deflateEnd(&zi->ci.stream); + zi->ci.stream_initialised = 0; + } + + if (!zi->ci.raw) + { + crc32 = (uLong)zi->ci.crc32; + uncompressed_size = (uLong)zi->ci.stream.total_in; + } + compressed_size = (uLong)zi->ci.stream.total_out; +# ifndef NOCRYPT + compressed_size += zi->ci.crypt_header_size; +# endif + + ziplocal_putValue_inmemory(zi->ci.central_header+16,crc32,4); /*crc*/ + ziplocal_putValue_inmemory(zi->ci.central_header+20, + compressed_size,4); /*compr size*/ + if (zi->ci.stream.data_type == Z_ASCII) + ziplocal_putValue_inmemory(zi->ci.central_header+36,(uLong)Z_ASCII,2); + ziplocal_putValue_inmemory(zi->ci.central_header+24, + uncompressed_size,4); /*uncompr size*/ + + if (err==ZIP_OK) + err = add_data_in_datablock(&zi->central_dir,zi->ci.central_header, + (uLong)zi->ci.size_centralheader); + free(zi->ci.central_header); + + if (err==ZIP_OK) + { + long cur_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); + if (ZSEEK(zi->z_filefunc,zi->filestream, + zi->ci.pos_local_header + 14,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + + if (err==ZIP_OK) + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,crc32,4); /* crc 32, unknown */ + + if (err==ZIP_OK) /* compressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,compressed_size,4); + + if (err==ZIP_OK) /* uncompressed size, unknown */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,uncompressed_size,4); + + if (ZSEEK(zi->z_filefunc,zi->filestream, + cur_pos_inzip,ZLIB_FILEFUNC_SEEK_SET)!=0) + err = ZIP_ERRNO; + } + + zi->number_entry ++; + zi->in_opened_file_inzip = 0; + + return err; +} + +extern int ZEXPORT zipCloseFileInZip (file) + zipFile file; +{ + return zipCloseFileInZipRaw (file,0,0); +} + +extern int ZEXPORT zipClose (file, global_comment) + zipFile file; + const char* global_comment; +{ + zip_internal* zi; + int err = 0; + uLong size_centraldir = 0; + uLong centraldir_pos_inzip; + uInt size_global_comment; + if (file == NULL) + return ZIP_PARAMERROR; + zi = (zip_internal*)file; + + if (zi->in_opened_file_inzip == 1) + { + err = zipCloseFileInZip (file); + } + +#ifndef NO_ADDFILEINEXISTINGZIP + if (global_comment==NULL) + global_comment = zi->globalcomment; +#endif + if (global_comment==NULL) + size_global_comment = 0; + else + size_global_comment = (uInt)strlen(global_comment); + + centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); + if (err==ZIP_OK) + { + linkedlist_datablock_internal* ldi = zi->central_dir.first_block ; + while (ldi!=NULL) + { + if ((err==ZIP_OK) && (ldi->filled_in_this_block>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream, + ldi->data,ldi->filled_in_this_block) + !=ldi->filled_in_this_block ) + err = ZIP_ERRNO; + + size_centraldir += ldi->filled_in_this_block; + ldi = ldi->next_datablock; + } + } + free_datablock(zi->central_dir.first_block); + + if (err==ZIP_OK) /* Magic End */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4); + + if (err==ZIP_OK) /* number of this disk */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* number of the disk with the start of the central directory */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)0,2); + + if (err==ZIP_OK) /* total number of entries in the central dir on this disk */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + + if (err==ZIP_OK) /* total number of entries in the central dir */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)zi->number_entry,2); + + if (err==ZIP_OK) /* size of the central directory */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_centraldir,4); + + if (err==ZIP_OK) /* offset of start of central directory with respect to the + starting disk number */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream, + (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + + if (err==ZIP_OK) /* zipfile comment length */ + err = ziplocal_putValue(&zi->z_filefunc,zi->filestream,(uLong)size_global_comment,2); + + if ((err==ZIP_OK) && (size_global_comment>0)) + if (ZWRITE(zi->z_filefunc,zi->filestream, + global_comment,size_global_comment) != size_global_comment) + err = ZIP_ERRNO; + + if (ZCLOSE(zi->z_filefunc,zi->filestream) != 0) + if (err == ZIP_OK) + err = ZIP_ERRNO; + +#ifndef NO_ADDFILEINEXISTINGZIP + TRYFREE(zi->globalcomment); +#endif + TRYFREE(zi); + + return err; +} + +#pragma clang diagnostic pop diff --git a/Classes/minizip/zip.h b/Classes/minizip/zip.h new file mode 100644 index 0000000..cd38b67 --- /dev/null +++ b/Classes/minizip/zip.h @@ -0,0 +1,235 @@ +/* zip.h -- IO for compress .zip files using zlib + Version 1.01e, February 12th, 2005 + + Copyright (C) 1998-2005 Gilles Vollant + + This unzip package allow creates .ZIP file, compatible with PKZip 2.04g + WinZip, InfoZip tools and compatible. + Multi volume ZipFile (span) are not supported. + Encryption compatible with pkzip 2.04g only supported + Old compressions used by old PKZip 1.x are not supported + + For uncompress .zip file, look at unzip.h + + + I WAIT FEEDBACK at mail info@winimage.com + Visit also http://www.winimage.com/zLibDll/unzip.html for evolution + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + +*/ + +/* for more info about .ZIP format, see + http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip + http://www.info-zip.org/pub/infozip/doc/ + PkWare has also a specification at : + ftp://ftp.pkware.com/probdesc.zip +*/ + +#ifndef _zip_H +#define _zip_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#if defined(STRICTZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagzipFile__ { int unused; } zipFile__; +typedef zipFile__ *zipFile; +#else +typedef voidp zipFile; +#endif + +#define ZIP_OK (0) +#define ZIP_EOF (0) +#define ZIP_ERRNO (Z_ERRNO) +#define ZIP_PARAMERROR (-102) +#define ZIP_BADZIPFILE (-103) +#define ZIP_INTERNALERROR (-104) + +#ifndef DEF_MEM_LEVEL +# if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +# else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +# endif +#endif +/* default memLevel */ + +/* tm_zip contain date/time info */ +typedef struct tm_zip_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_zip; + +typedef struct +{ + tm_zip tmz_date; /* date in understandable format */ + uLong dosDate; /* if dos_date == 0, tmu_date is used */ +/* uLong flag; */ /* general purpose bit flag 2 bytes */ + + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ +} zip_fileinfo; + +typedef const char* zipcharpc; + + +#define APPEND_STATUS_CREATE (0) +#define APPEND_STATUS_CREATEAFTER (1) +#define APPEND_STATUS_ADDINZIP (2) + +extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +/* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on + an Unix computer "zlib/zlib113.zip". + if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip + will be created at the end of the file. + (useful if the file contain a self extractor code) + if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will + add files in existing zip (be sure you don't add file that doesn't exist) + If the zipfile cannot be opened, the return value is NULL. + Else, the return value is a zipFile Handle, usable with other function + of this zip package. +*/ + +/* Note : there is no delete function into a zipfile. + If you want delete file into a zipfile, you must open a zipfile, and create another + Of couse, you can use RAW reading and writing to copy the file you did not want delte +*/ + +extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level)); +/* + Open a file in the ZIP for writing. + filename : the filename in zip (if NULL, '-' without quote will be used + *zipfi contain supplemental information + if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local + contains the extrafield data the the local header + if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global + contains the extrafield data the the local header + if comment != NULL, comment contain the comment string + method contain the compression method (0 for store, Z_DEFLATED for deflate) + level contain the level of compression (can be Z_DEFAULT_COMPRESSION) +*/ + + +extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw)); + +/* + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, + uInt size_extrafield_local, + const void* extrafield_global, + uInt size_extrafield_global, + const char* comment, + int method, + int level, + int raw, + int windowBits, + int memLevel, + int strategy, + const char* password, + uLong crcForCtypting)); + +/* + Same than zipOpenNewFileInZip2, except + windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 + password : crypting password (NULL for no crypting) + crcForCtypting : crc of file to compress (needed for crypting) + */ + + +extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); +/* + Write data in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); +/* + Close the current file in the zipfile +*/ + +extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); +/* + Close the current file in the zipfile, for fiel opened with + parameter raw=1 in zipOpenNewFileInZip2 + uncompressed_size and crc32 are value for the uncompressed size +*/ + +extern int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); +/* + Close the zipfile +*/ + +#ifdef __cplusplus +} +#endif + +#endif /* _zip_H */ diff --git a/Default-568h@2x.png b/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/Default-568h@2x.png differ diff --git a/Info.plist b/Info.plist index 8d9de34..f10b0b5 100644 --- a/Info.plist +++ b/Info.plist @@ -6,17 +6,53 @@ English CFBundleDisplayName ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFiles + CFBundleDocumentTypes - Icon - Icon.png - Icon@2x.png - Icon-72.png + + CFBundleTypeName + Amiga ROM File + LSHandlerRank + Owner + LSItemContentTypes + + iUAE.rom + + + + CFBundleTypeName + Zipped Amiga Disk File(s) + LSHandlerRank + Owner + LSItemContentTypes + + iUAE.zip + + + + CFBundleTypeName + Amiga Disk File + LSHandlerRank + Owner + LSItemContentTypes + + iUAE.adf + + + + CFBundleTypeName + Amiga Hard Drive File + LSHandlerRank + Owner + LSItemContentTypes + + iUAE.hdf + + + CFBundleExecutable + ${EXECUTABLE_NAME} CFBundleIdentifier - com.manomio.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -28,15 +64,17 @@ CFBundleSignature ???? CFBundleVersion - 1.0.06 + 1.1.0.0 + Initial Interface Orientation + Landscape (left home button) LSRequiresIPhoneOS - NSMainNibFile - MainWindow - NSMainNibFile~ipad - MainWindow-iPad UIFileSharingEnabled + UIMainStoryboardFile + Storyboard + UIMainStoryboardFile~ipad + Storyboard UIPrerenderedIcon UIRequiredDeviceCapabilities @@ -44,11 +82,72 @@ armv7 - UIStatusBarHidden + UIRequiresFullScreen + UIStatusBarHidden + + UIStatusBarStyle + UIStatusBarStyleBlackOpaque UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeLeft + UIViewControllerBasedStatusBarAppearance + + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.data + + UTTypeIdentifier + iUAE.rom + UTTypeTagSpecification + + public.filename-extension + rom + + + + UTTypeConformsTo + + public.data + + UTTypeIdentifier + iUAE.zip + UTTypeTagSpecification + + public.filename-extension + zip + + + + UTTypeConformsTo + + public.data + + UTTypeIdentifier + iUAE.adf + UTTypeTagSpecification + + public.filename-extension + adf + + + + UTTypeConformsTo + + public.data + + UTTypeIdentifier + iUAE.hdf + UTTypeTagSpecification + + public.filename-extension + hdf + + + diff --git a/JoypadKey.h b/JoypadKey.h new file mode 100644 index 0000000..8c0c505 --- /dev/null +++ b/JoypadKey.h @@ -0,0 +1,34 @@ +// Created by Emufr3ak on 28.05.2015 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#define BTN_A 0 +#define BTN_B 1 +#define BTN_X 2 +#define BTN_Y 3 +#define BTN_L1 5 +#define BTN_L2 7 +#define BTN_R1 4 +#define BTN_R2 6 +#define BTN_UP 9 +#define BTN_DOWN 10 +#define BTN_LEFT 11 +#define BTN_RIGHT 12 + +#define PORT 20 + +#define VSWITCH 30 + +#define BTN_INVALID 99 diff --git a/LatestBuild b/LatestBuild new file mode 120000 index 0000000..aa13733 --- /dev/null +++ b/LatestBuild @@ -0,0 +1 @@ +/Users/urs/Library/Developer/Xcode/DerivedData/iUAE-gobbfgtweyjhjdfzhemtuaxsuusj/Build/Products/Debug-iphoneos \ No newline at end of file diff --git a/MainWindow.xib b/MainWindow.xib deleted file mode 100644 index 4052de0..0000000 --- a/MainWindow.xib +++ /dev/null @@ -1,254 +0,0 @@ - - - - 800 - 10J869 - 1306 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 - - - IBProxyObject - IBUITabBarItem - IBUIViewController - IBUICustomObject - IBUITabBarController - IBUIWindow - IBUITabBar - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - 1316 - - {320, 480} - - - 1 - MCAwIDAAA - - NO - NO - IBCocoaTouchFramework - YES - - - - - 1 - 1 - - YES - IBCocoaTouchFramework - NO - - - Amiga - IBCocoaTouchFramework - - - - 1 - 1 - - YES - IBCocoaTouchFramework - NO - - - - - Games - IBCocoaTouchFramework - - - SettingsController - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - - - 266 - {{0, 431}, {320, 49}} - - - 3 - MCAwAA - - NO - IBCocoaTouchFramework - - - - - - - - delegate - - - - 4 - - - - window - - - - 5 - - - - mainController - - - - 16 - - - - _emulationView - - - - 17 - - - - - - 0 - - - - - - 2 - - - - - - -1 - - - File's Owner - - - 3 - - - - - -2 - - - - - 10 - - - - - - - - - - 11 - - - - - 12 - - - - - - - - 13 - - - - - - - - 14 - - - - - 15 - - - - - - - UIApplication - UIResponder - {{0, 665}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - SettingsController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - EmulationViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - {{438, 320}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - iAmigaAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 17 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - YES - 3 - 301 - - diff --git a/OtherSources/CustomIOSKeyboard/iPad/Images/Specialkeyboard.png b/OtherSources/CustomIOSKeyboard/iPad/Images/Specialkeyboard.png new file mode 100644 index 0000000..264107e Binary files /dev/null and b/OtherSources/CustomIOSKeyboard/iPad/Images/Specialkeyboard.png differ diff --git a/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.h b/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.h new file mode 100644 index 0000000..e20e1bf --- /dev/null +++ b/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.h @@ -0,0 +1,20 @@ +// +// PKCustomKeyboard.h +// PunjabiKeyboard +// +// Created by Kulpreet Chilana on 7/19/12. +// Copyright (c) 2012 Kulpreet Chilana. All rights reserved. +// + +#import +#import +#import "SDL.h" + +@interface PKCustomKeyboard : UIViewController + +@property (strong) id textView; + +- (IBAction)keyDown:(id)sender; +- (IBAction)keyUp:(id)sender; + +@end diff --git a/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.mm b/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.mm new file mode 100644 index 0000000..7cca8f8 --- /dev/null +++ b/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.mm @@ -0,0 +1,151 @@ +// +// PKCustomKeyboard.m +// PunjabiKeyboard +// +// Created by Kulpreet Chilana on 7/19/12. +// Copyright (c) 2012 Kulpreet Chilana. All rights reserved. +// + +#import "PKCustomKeyboard.h" + +@interface PKCustomKeyboard () + +@property (nonatomic, assign, getter=isShifted) BOOL shifted; + +@end + +@implementation PKCustomKeyboard { + IBOutlet UIButton *bDown; + IBOutlet UIButton *bUp; + IBOutlet UIButton *bLeft; + IBOutlet UIButton *bRight; + IBOutlet UIButton *b0; + IBOutlet UIButton *b1; + IBOutlet UIButton *b2; + IBOutlet UIButton *b3; + IBOutlet UIButton *b4; + IBOutlet UIButton *b5; + IBOutlet UIButton *b6; + IBOutlet UIButton *b7; + IBOutlet UIButton *b8; + IBOutlet UIButton *b9; + IBOutlet UIButton *bBracketleft; + IBOutlet UIButton *bBracketright; + IBOutlet UIButton *bDivide; + IBOutlet UIButton *bMultiply; + IBOutlet UIButton *bMinus; + IBOutlet UIButton *bPlus; + IBOutlet UIButton *bShiftfleft; + IBOutlet UIButton *bShiftright; + IBOutlet UIButton *bAltLeft; + IBOutlet UIButton *bAltRight; + IBOutlet UIButton *bCtrl; + IBOutlet UIButton *bEnter; + IBOutlet UIButton *bAright; + IBOutlet UIButton *bAleft; + IBOutlet UIButton *bPeriod; + IBOutlet UIButton *bSpace; +} + +@synthesize textView = _textView; + +-(void)viewDidLoad { + bLeft.tag = SDLK_LEFT; + bRight.tag = SDLK_RIGHT; + bDown.tag = SDLK_DOWN; + bUp.tag = SDLK_UP; + b0.tag = SDLK_KP0; + b1.tag = SDLK_KP1; + b2.tag = SDLK_KP2; + b3.tag = SDLK_KP3; + b4.tag = SDLK_KP4; + b5.tag = SDLK_KP5; + b6.tag = SDLK_KP6; + b7.tag = SDLK_KP7; + b8.tag = SDLK_KP8; + b9.tag = SDLK_KP9; + bBracketleft.tag = SDLK_HOME; //Pseudo Maping SDL Library doesn't know Key with Bracket on Number Block. But Amiga does not have Home Key + bBracketright.tag = SDLK_END; //Pseudo Maping SDL Library doesn't know Key with Bracket on Number Block. But Amiga does not have END Key + bDivide.tag = SDLK_KP_DIVIDE; + bMultiply.tag = SDLK_KP_MULTIPLY; + bMinus.tag = SDLK_KP_MINUS; + bPlus.tag = SDLK_KP_PLUS; + bShiftfleft.tag = SDLK_LSHIFT; + bShiftright.tag = SDLK_RSHIFT; + bAltLeft.tag = SDLK_LALT; + bAltRight.tag = SDLK_RALT; + bCtrl.tag = SDLK_LCTRL; + bEnter.tag = SDLK_KP_ENTER; + bAright.tag = SDLK_RMETA; //Pseudo Maping SDL Library doesn't know Amiga Left. But Amiga does not have RMETA Key + bAleft.tag = SDLK_LMETA; //Pseudo Maping SDL Library doesn't know Key Amiga Right. But Amiga does not have LMETA Key + bPeriod.tag = SDLK_KP_PERIOD; + bSpace.tag = SDLK_SPACE; +} + +-(void)setTextView:(id)textView { + + if ([textView isKindOfClass:[UITextView class]]) + [(UITextView *)textView setInputView:self.view]; + else if ([textView isKindOfClass:[UITextField class]]) + [(UITextField *)textView setInputView:self.view]; + + _textView = textView; +} + +-(id)textView { + return _textView; +} + +- (IBAction)keyDown:(id)sender { + [[UIDevice currentDevice] playInputClick]; + UIButton *button = (UIButton *)sender; + + + NSString *character = [NSString stringWithFormat:@"D%d", button.tag]; + [self.textView insertText:character]; +} + +- (IBAction)keyUp:(id)sender { + [[UIDevice currentDevice] playInputClick]; + UIButton *button = (UIButton *)sender; + + + NSString *character = [NSString stringWithFormat:@"U%d", button.tag]; + [self.textView insertText:character]; +} + +- (void) dealloc { + [super dealloc]; + + [bDown dealloc]; + [bUp dealloc]; + [bLeft dealloc]; + [bRight dealloc]; + [b0 dealloc]; + [b1 dealloc]; + [b2 dealloc]; + [b3 dealloc]; + [b4 dealloc]; + [b5 dealloc]; + [b6 dealloc]; + [b7 dealloc]; + [b8 dealloc]; + [b9 dealloc]; + [bBracketleft dealloc]; + [bBracketright dealloc]; + [bDivide dealloc]; + [bMultiply dealloc]; + [bMinus dealloc]; + [bPlus dealloc]; + [bShiftfleft dealloc]; + [bShiftright dealloc]; + [bAltLeft dealloc]; + [bAltRight dealloc]; + [bCtrl dealloc]; + [bSpace dealloc]; + [bAright dealloc]; + [bAleft dealloc]; + [bEnter dealloc]; +} + +@end diff --git a/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.xib b/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.xib new file mode 100644 index 0000000..f0eb606 --- /dev/null +++ b/OtherSources/CustomIOSKeyboard/iPad/PKCustomKeyboard.xib @@ -0,0 +1,599 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OtherSources/CustomIOSKeyboard/iPhone:iPod/Images/iOSKeyboard.png b/OtherSources/CustomIOSKeyboard/iPhone:iPod/Images/iOSKeyboard.png new file mode 100644 index 0000000..cacbe20 Binary files /dev/null and b/OtherSources/CustomIOSKeyboard/iPhone:iPod/Images/iOSKeyboard.png differ diff --git a/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.h b/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.h new file mode 100644 index 0000000..6ad9f0e --- /dev/null +++ b/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.h @@ -0,0 +1,20 @@ +// +// PKCustomKeyboard.h +// PunjabiKeyboard +// +// Created by Kulpreet Chilana on 7/19/12. +// Copyright (c) 2012 Kulpreet Chilana. All rights reserved. +// + +#import +#import +#import "SDL.h" + +@interface PMCustomKeyboard : UIViewController + +@property (strong) id textView; + +- (IBAction)keyDown:(id)sender; +- (IBAction)keyUp:(id)sender; + +@end diff --git a/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.mm b/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.mm new file mode 100644 index 0000000..4e2008f --- /dev/null +++ b/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.mm @@ -0,0 +1,149 @@ +// +// PKCustomKeyboard.m +// PunjabiKeyboard +// +// Created by Kulpreet Chilana on 7/19/12. +// Copyright (c) 2012 Kulpreet Chilana. All rights reserved. +// + +#import "PMCustomKeyboard.h" + +@interface PMCustomKeyboard () + +@end + +@implementation PMCustomKeyboard { + IBOutlet UIButton *bDown; + IBOutlet UIButton *bUp; + IBOutlet UIButton *bLeft; + IBOutlet UIButton *bRight; + IBOutlet UIButton *b0; + IBOutlet UIButton *b1; + IBOutlet UIButton *b2; + IBOutlet UIButton *b3; + IBOutlet UIButton *b4; + IBOutlet UIButton *b5; + IBOutlet UIButton *b6; + IBOutlet UIButton *b7; + IBOutlet UIButton *b8; + IBOutlet UIButton *b9; + IBOutlet UIButton *bBracketleft; + IBOutlet UIButton *bBracketright; + IBOutlet UIButton *bDivide; + IBOutlet UIButton *bMultiply; + IBOutlet UIButton *bMinus; + IBOutlet UIButton *bPlus; + IBOutlet UIButton *bShiftfleft; + IBOutlet UIButton *bShiftright; + IBOutlet UIButton *bAltLeft; + IBOutlet UIButton *bAltRight; + IBOutlet UIButton *bCtrl; + IBOutlet UIButton *bEnter; + IBOutlet UIButton *bAright; + IBOutlet UIButton *bAleft; + IBOutlet UIButton *bPeriod; + IBOutlet UIButton *bSpace; +} + +@synthesize textView = _textView; + +-(void)viewDidLoad { + bLeft.tag = SDLK_LEFT; + bRight.tag = SDLK_RIGHT; + bDown.tag = SDLK_DOWN; + bUp.tag = SDLK_UP; + b0.tag = SDLK_KP0; + b1.tag = SDLK_KP1; + b2.tag = SDLK_KP2; + b3.tag = SDLK_KP3; + b4.tag = SDLK_KP4; + b5.tag = SDLK_KP5; + b6.tag = SDLK_KP6; + b7.tag = SDLK_KP7; + b8.tag = SDLK_KP8; + b9.tag = SDLK_KP9; + bBracketleft.tag = SDLK_HOME; //Pseudo Maping SDL Library doesn't know Key with Bracket on Number Block. But Amiga does not have Home Key + bBracketright.tag = SDLK_END; //Pseudo Maping SDL Library doesn't know Key with Bracket on Number Block. But Amiga does not have END Key + bDivide.tag = SDLK_KP_DIVIDE; + bMultiply.tag = SDLK_KP_MULTIPLY; + bMinus.tag = SDLK_KP_MINUS; + bPlus.tag = SDLK_KP_PLUS; + bShiftfleft.tag = SDLK_LSHIFT; + bShiftright.tag = SDLK_RSHIFT; + bAltLeft.tag = SDLK_LALT; + bAltRight.tag = SDLK_RALT; + bCtrl.tag = SDLK_LCTRL; + bEnter.tag = SDLK_KP_ENTER; + bAright.tag = SDLK_RMETA; //Pseudo Maping SDL Library doesn't know Amiga Left. But Amiga does not have RMETA Key + bAleft.tag = SDLK_LMETA; //Pseudo Maping SDL Library doesn't know Key Amiga Right. But Amiga does not have LMETA Key + bPeriod.tag = SDLK_KP_PERIOD; + bSpace.tag = SDLK_SPACE; +} + +-(void)setTextView:(id)textView { + + if ([textView isKindOfClass:[UITextView class]]) + [(UITextView *)textView setInputView:self.view]; + else if ([textView isKindOfClass:[UITextField class]]) + [(UITextField *)textView setInputView:self.view]; + + _textView = textView; +} + +-(id)textView { + return _textView; +} + +- (IBAction)keyDown:(id)sender { + [[UIDevice currentDevice] playInputClick]; + UIButton *button = (UIButton *)sender; + + + NSString *character = [NSString stringWithFormat:@"D%d", button.tag]; + [self.textView insertText:character]; +} + +- (IBAction)keyUp:(id)sender { + [[UIDevice currentDevice] playInputClick]; + UIButton *button = (UIButton *)sender; + + + NSString *character = [NSString stringWithFormat:@"U%d", button.tag]; + [self.textView insertText:character]; +} + +- (void) dealloc { + [super dealloc]; + + [bDown dealloc]; + [bUp dealloc]; + [bLeft dealloc]; + [bRight dealloc]; + [b0 dealloc]; + [b1 dealloc]; + [b2 dealloc]; + [b3 dealloc]; + [b4 dealloc]; + [b5 dealloc]; + [b6 dealloc]; + [b7 dealloc]; + [b8 dealloc]; + [b9 dealloc]; + [bBracketleft dealloc]; + [bBracketright dealloc]; + [bDivide dealloc]; + [bMultiply dealloc]; + [bMinus dealloc]; + [bPlus dealloc]; + [bShiftfleft dealloc]; + [bShiftright dealloc]; + [bAltLeft dealloc]; + [bAltRight dealloc]; + [bCtrl dealloc]; + [bSpace dealloc]; + [bAright dealloc]; + [bAleft dealloc]; + [bEnter dealloc]; +} + +@end diff --git a/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.xib b/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.xib new file mode 100644 index 0000000..c0d5c9b --- /dev/null +++ b/OtherSources/CustomIOSKeyboard/iPhone:iPod/PMCustomKeyboard.xib @@ -0,0 +1,637 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d6059bd --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +#####Project setup + +This project uses git submodules. Before building for the first time, and if building fails because of missing files, you must run: + +``` +git submodule init +git submodule update +``` + +#####ROMs +Use iTunes to copy rom file(s) to your device, or add the roms to the Xcode project when building iUAE. When the emulator starts up for the first time, it will look for a rom called "kick.rom" or "kick13.rom". If your rom file has a differnet name or if you want to switch roms, you can use the rom selector in settings. + +You can use Cloanto Amiga Forever Roms. For them to work you need to copy Cloanto Amiga Forever file (rom.key) using iTunes or iFile. This file is required to decrypt the roms. + +#####Disk drives + +df[0]-3 are supported. Drives read .adf files - the easiest way to get them onto your device is to use iTunes to copy them. Alternatively you can also add adf files to the Xcode project when building iUAE, however they will be read-only. Swipe on a drive row to eject an inserted adf. + +#####Hard drives + +Hard drive support is currently limited: only a single hard drive file (.hdf) can be mounted. Swipe on the HD0 row to unmount. +To create a hard drive file, you can use xdftool from the excellent [amitools](https://github.com/cnvogelg/amitools), for example: + +``` +xdftool new.hdf create size=10Mi +``` + +Use iTunes to copy the .hdf file to your device. Alternatively you can also add the hdf file to the Xcode project when building iUAE, however it will be read-only. +Note that you need to have kickstart 1.3 or higher for hard drives to work correctly. + +#####CPU load optimization + +To optimize emulation performance and to reduce CPU load make sure that the build you install on your device was compiled with *-O3* or *-Os* setting. +You find this in the project's Xcode build settings, specifically in the *Apple LLVM - Code Generation*->*Optimization Level* section. + +See this link for more information: [Issue39](https://github.com/emufreak/iAmiga/issues/39) diff --git a/Resources-iPad/MainWindow-iPad.xib b/Resources-iPad/MainWindow-iPad.xib deleted file mode 100644 index 25ba513..0000000 --- a/Resources-iPad/MainWindow-iPad.xib +++ /dev/null @@ -1,620 +0,0 @@ - - - - 800 - 10J567 - 823 - 1038.35 - 462.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - IBIPadFramework - - - - 1316 - - {768, 1024} - - 1 - MCAwIDAAA - - NO - NO - IBIPadFramework - YES - - - - - 1 - - YES - IBIPadFramework - NO - - - Amiga - IBIPadFramework - - - - 1 - - YES - IBIPadFramework - NO - - - - - Games - IBIPadFramework - - - SettingsController - - 1 - - IBIPadFramework - NO - - - - - - 266 - {{129, 330}, {163, 49}} - - 3 - MCAwAA - - NO - IBIPadFramework - - - - - - - - delegate - - - - 4 - - - - window - - - - 5 - - - - mainController - - - - 16 - - - - _emulationView - - - - 17 - - - - - - 0 - - - - - - 2 - - - - - - -1 - - - File's Owner - - - 3 - - - - - -2 - - - - - 10 - - - - - - - - - - 11 - - - - - 12 - - - - - - - - 13 - - - - - - - - 14 - - - - - 15 - - - - - - - UIApplication - UIResponder - {{0, 665}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - SettingsController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - EmulationViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - {{438, 320}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - iAmigaAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 17 - - - - - EmulationViewController - UIViewController - - IBProjectSource - Classes/EmulationViewController.h - - - - SettingsController - UIViewController - - id - id - id - UIButton - id - id - id - - - - otherAction: - id - - - resetAmiga: - id - - - resetLog: - id - - - selectDrive: - UIButton - - - toggleLogging: - id - - - toggleNTSC: - id - - - toggleStatus: - id - - - - UISwitch - UISwitch - UILabel - UIButton - UISwitch - - - - displayModeNTSC - UISwitch - - - logging - UISwitch - - - loggingLabel - UILabel - - - resetLog - UIButton - - - status - UISwitch - - - - IBProjectSource - Classes/SettingsController.h - - - - UIButton - - IBProjectSource - Classes/CocoaUtility.h - - - - iAmigaAppDelegate - NSObject - - EmulationViewController - UITabBarController - UIWindow - - - - _emulationView - EmulationViewController - - - mainController - UITabBarController - - - window - UIWindow - - - - IBProjectSource - Classes/iAmigaAppDelegate.h - - - - iAmigaAppDelegate - NSObject - - IBUserSource - - - - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIBarItem - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIBarItem.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UISwitch - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UISwitch.h - - - - UITabBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITabBar.h - - - - UITabBarController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UITabBarItem - UIBarItem - - IBFrameworkSource - UIKit.framework/Headers/UITabBarItem.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - YES - ../iAmiga.xcodeproj - 3 - 132 - - diff --git a/SelectConfigurationViewController.h b/SelectConfigurationViewController.h new file mode 100644 index 0000000..9d6d274 --- /dev/null +++ b/SelectConfigurationViewController.h @@ -0,0 +1,23 @@ +// +// SelectConfigurationViewController.h +// iUAE +// +// Created by Urs on 25.01.15. +// +// + +#import +#import "AddConfigurationViewController.h" + +@protocol SelectConfigurationDelegate +- (void)didSelectConfiguration:(NSString *)configurationname; +- (BOOL)isRecentConfig:(NSString *)configurationname; +- (void)didDeleteConfiguration; +- (NSString *)getFirstOption; +@end + +@interface SelectConfigurationViewController : UITableViewController + +@property (nonatomic, assign) id delegate; + +@end diff --git a/SelectConfigurationViewController.mm b/SelectConfigurationViewController.mm new file mode 100644 index 0000000..d4f2e19 --- /dev/null +++ b/SelectConfigurationViewController.mm @@ -0,0 +1,210 @@ +// +// SelectConfigurationViewController.m +// iUAE +// +// Created by Urs on 25.01.15. +// +// + +#import "SelectConfigurationViewController.h" +#import "EMUBrowser.h" +#import "EMUFileInfo.h" +#import "Settings.h" + +@interface SelectConfigurationViewController () + +@end + +@implementation SelectConfigurationViewController { + NSMutableArray *configurations; + Settings *settings; + NSString *firstoption; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + settings = [[Settings alloc] init]; + configurations = [settings arrayForKey:@"configurations"] ? [[settings arrayForKey:@"configurations"] mutableCopy] : [[NSMutableArray alloc] init]; + + if(_delegate) + { + if ([_delegate respondsToSelector:@selector(getFirstOption)]) { + firstoption = [[_delegate getFirstOption] retain]; + } + } + if(!firstoption) { firstoption = [[NSString alloc] initWithFormat:@"None"]; } + + [configurations insertObject:firstoption atIndex:0]; + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +- (void)viewDidAppear:(BOOL)animated { + configurations = [[settings arrayForKey:@"configurations"] mutableCopy]; + [configurations insertObject:firstoption atIndex:0]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table view data source + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [configurations count]; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell; + + if (configurations) + { + cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" + forIndexPath:indexPath]; + [self configureCell:cell atIndexPath:indexPath]; + + } + else + { + cell = [tableView dequeueReusableCellWithIdentifier:@"EmptyCell" forIndexPath:indexPath]; + } + + return cell; +} + +- (UITableViewCell *)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { + NSString *configurationname = [configurations objectAtIndex:indexPath.row]; + cell.textLabel.text = configurationname; + + if(self.delegate) + { + if([self.delegate isRecentConfig:configurationname]) + { + [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; + } + } + return cell; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + if(self.delegate) + { + NSString *configurationname = [configurations objectAtIndex:indexPath.row]; + + [self.navigationController popViewControllerAnimated:YES]; + [self.delegate didSelectConfiguration:configurationname]; + } +} + +- (void)configurationAdded:(NSString *)configurationname { + if(!configurations) + { + configurations = [NSMutableArray arrayWithObjects: firstoption, configurationname, nil]; + } + else + { + [configurations addObject:configurationname]; + } + + //Initialize default value for new configuration before loading + [settings initializespecificsettings]; + + [self.navigationController popViewControllerAnimated:NO]; + [self.delegate didSelectConfiguration:configurationname]; + //[self dismissViewControllerAnimated:NO completion:nil]; +} + + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + // Delete the row from the data source + + [self deleteConfiguration:indexPath]; + [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; + + } else if (editingStyle == UITableViewCellEditingStyleInsert) { + // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view + } +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + bool returnvalue = indexPath.row == 0 ? FALSE : TRUE; + return returnvalue; +} + +- (void)deleteConfiguration:(NSIndexPath *)indexPath { + EMUBrowser *browser = [[EMUBrowser alloc] init]; + NSArray *files = [browser getAdfFileInfos]; + NSString *configdeleted = [configurations objectAtIndex:indexPath.row]; + + [configurations removeObjectAtIndex:indexPath.row]; + + NSMutableArray *configurationsforsave = [configurations mutableCopy]; + [configurationsforsave removeObjectAtIndex:0]; //General or None is no real Configuration just a placeholder + + settings.configurations = configurationsforsave; + + for (EMUFileInfo* f in files) { + + /*Associated Configuration File*/ + NSString *settingstring = [NSString stringWithFormat:@"cnf%@", [f fileName]]; + NSString *configurationfile = [settings stringForKey:settingstring] ? [settings stringForKey:settingstring] : [NSString stringWithFormat:@""]; + if([configurationfile isEqualToString:configdeleted]) + { + if(self.delegate) + { + [self.delegate didDeleteConfiguration]; + } + [settings removeObjectForKey:settingstring]; + } + } +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if([segue.identifier isEqualToString:@"addconfiguration"]) { + AddConfigurationViewController *controller = (AddConfigurationViewController *)segue.destinationViewController; + controller.delegate = self; + } +} + +- (void) dealloc { + [configurations release]; + [firstoption release]; + [super dealloc]; +} + +/* +// Override to support rearranging the table view. +- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { +} +*/ + +/* +// Override to support conditional rearranging of the table view. +- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { + // Return NO if you do not want the item to be re-orderable. + return YES; +} +*/ + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end + + diff --git a/SettingsJoypadController.h b/SettingsJoypadController.h new file mode 100644 index 0000000..6e75cd0 --- /dev/null +++ b/SettingsJoypadController.h @@ -0,0 +1,46 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 24.05.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "SettingsSelectKeyViewController.h" +#import "SettingsSelectPortViewController.h" + +@interface SettingsJoypadController : UITableViewController + +@property (retain, nonatomic) IBOutlet UITableViewCell *CellA; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellB; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellX; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellY; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellL1; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellL2; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellR1; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellR2; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellUp; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellDown; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellLeft; +@property (retain, nonatomic) IBOutlet UITableViewCell *CellRight; +@property (retain, nonatomic) IBOutlet UITableViewCell *Port; + +@property (retain, nonatomic) IBOutlet UISwitch *vSWitch; + +- (IBAction)togglevSwitch:(id)sender; + + +@end diff --git a/SettingsJoypadController.mm b/SettingsJoypadController.mm new file mode 100644 index 0000000..8ec0c9f --- /dev/null +++ b/SettingsJoypadController.mm @@ -0,0 +1,137 @@ +// +// SettingsGeneralController.h +// iUAE +// +// Created by Emufr3ak on 24.05.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "SettingsJoypadController.h" +#import "Settings.h" +#import "JoypadKey.h" + +@interface SettingsJoypadController () + +@end + +@implementation SettingsJoypadController { + Settings *settings; + UITableViewCell *context; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + settings = [[Settings alloc] init]; + + // Uncomment the following line to preserve selection between presentations. + // self.clearsSelectionOnViewWillAppear = NO; + + // Uncomment the following line to display an Edit button in the navigation bar for this view controller. + // self.navigationItem.rightBarButtonItem = self.editButtonItem; +} + +-(void)viewWillAppear:(BOOL)animated { + _CellA.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_A]; + _CellB.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_B]; + _CellX.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_X]; + _CellY.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_Y]; + _CellL1.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_L1]; + _CellL2.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_L2]; + _CellR1.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_R1]; + _CellR2.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_R2]; + _CellUp.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_UP]; + _CellDown.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_DOWN]; + _CellLeft.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_LEFT]; + _CellRight.detailTextLabel.text = [settings keyConfigurationNameforButton:BTN_RIGHT]; + _Port.detailTextLabel.text = [settings keyConfigurationforButton:PORT]; + + BOOL vsFlag = [[settings keyConfigurationforButton:VSWITCH] isEqualToString:@"YES"] ? 1 : 0; + [_vSWitch setOn:vsFlag]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if([segue.identifier isEqualToString:@"SelectKey"]) { + UITableViewCell *cellsender = (UITableViewCell *) sender; + SettingsSelectKeyViewController *controller = segue.destinationViewController; + controller.delegate = self; + context = cellsender; + + NSString *strbuttonconnected = [settings keyConfigurationNameforButton:context.tag]; + + NSString *joypaddetailtext = [strbuttonconnected isEqualToString:@"Joypad"] ? @"Joypad" : @""; + NSString *keydetailtext = [strbuttonconnected isEqualToString:@"Joypad"] ? @"" : strbuttonconnected; + + controller.joypaddetailtext = joypaddetailtext; + controller.keydetailtext = keydetailtext; + + } +} + +- (void)didSelectJoypad { + [settings setKeyconfiguration:@"Joypad" Button:context.tag]; + [settings setKeyconfigurationname:@"Joypad" Button:context.tag]; +} + +- (void)didSelectKey:(int)asciicode keyName:(NSString *)keyName { + + + NSString *strConfigValue = [NSString stringWithFormat: @"KEY_%d", asciicode]; + [settings setKeyconfiguration:strConfigValue Button:context.tag]; + [settings setKeyconfigurationname:keyName Button:context.tag]; +} + +- (void)didSelectPort:(int)pNumber { + + [settings setKeyconfiguration:[NSString stringWithFormat:@"%d", pNumber] Button:PORT]; + +} + +- (IBAction)togglevSwitch:(id)sender { + + NSString *vsFlag = _vSWitch.on == YES ? @"YES" : @"NO"; + [settings setKeyconfiguration:vsFlag Button:VSWITCH]; + +} + +- (void)dealloc { + [settings release]; + + [_CellA release]; + [_CellB release]; + [_CellX release]; + [_CellY release]; + [_CellL1 release]; + [_CellL2 release]; + [_CellR1 release]; + [_CellR2 release]; + + [_CellUp release]; + [_CellDown release]; + [_CellLeft release]; + [_CellRight release]; + [_Port release]; + [_vSWitch release]; + [super dealloc]; +} + +- (IBAction)togglevsWitch:(id)sender { +} +@end diff --git a/Storyboard.storyboard b/Storyboard.storyboard new file mode 100644 index 0000000..ab10bb3 --- /dev/null +++ b/Storyboard.storyboard @@ -0,0 +1,3075 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Submodules/STObjCToolbelt b/Submodules/STObjCToolbelt new file mode 160000 index 0000000..57bfe0a --- /dev/null +++ b/Submodules/STObjCToolbelt @@ -0,0 +1 @@ +Subproject commit 57bfe0a0e00f4d4680921c7000c5f1b9ad7f829e diff --git a/Submodules/SVProgressHUD b/Submodules/SVProgressHUD new file mode 160000 index 0000000..835d582 --- /dev/null +++ b/Submodules/SVProgressHUD @@ -0,0 +1 @@ +Subproject commit 835d5821098ea30e2835837818cbdc792238a1b9 diff --git a/TargetSpecific/DotC/DOTCEmulationViewController.m b/TargetSpecific/DotC/DOTCEmulationViewController.m index 8a3b158..29bd9dd 100644 --- a/TargetSpecific/DotC/DOTCEmulationViewController.m +++ b/TargetSpecific/DotC/DOTCEmulationViewController.m @@ -7,7 +7,6 @@ // #import "DOTCEmulationViewController.h" -#import "LambdaAlert.h" @interface DOTCEmulationViewController() @@ -28,14 +27,14 @@ - (void)viewWillAppear:(BOOL)animated { extern void uae_reset(); - (IBAction)restart:(id)sender { - LambdaAlert *alert = [[LambdaAlert alloc] initWithTitle:@"RESTART?" message:@"Are you sure you wish to restart?"]; + /*LambdaAlert *alert = [[LambdaAlert alloc] initWithTitle:@"RESTART?" message:@"Are you sure you wish to restart?"]; [alert addButtonWithTitle:@"No" block:nil]; - [alert addButtonWithTitle:@"YES" block:^(void) { + [alert addButtonWithTitle:@"YES" block:^(void) {*/ uae_reset(); [self startIntroSequence]; - }]; + /*}]; [alert show]; - [alert release]; + [alert release];*/ } - (void)startIntroSequence { diff --git a/TargetSpecific/DotC/EmulationView-iPad.xib b/TargetSpecific/DotC/EmulationView-iPad.xib index 9fbb4f9..42b8cd1 100644 --- a/TargetSpecific/DotC/EmulationView-iPad.xib +++ b/TargetSpecific/DotC/EmulationView-iPad.xib @@ -1,660 +1,108 @@ - - - - 1280 - 11A511 - 1891 - 1138 - 566.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 884 - - - YES - IBUIWebView - IBUIButton - IBUIImageView - IBUIView - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - - 292 - - YES - - - 274 - {1024, 768} - - - - - 3 - MCAwAA - - NO - NO - IBIPadFramework - - - - -2147483355 - - YES - - - 256 - {989, 580} - - - - NO - YES - 4 - YES - IBIPadFramework - - NSImage - bg_web~ipad.png - - - - - 292 - {{24, 0}, {940, 540}} - - - - - NO - NO - IBIPadFramework - - - {{18, -580}, {989, 580}} - - - - - NO - IBIPadFramework - - - - 256 - {1024, 75} - - - - - NO - YES - 4 - YES - IBIPadFramework - - NSImage - chrome-top~ipad.png - - - - - 292 - {{20, 6}, {45, 47}} - - - - NO - IBIPadFramework - 0 - 0 - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - NSImage - btn_restart~ipad.png - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - {{959, 6}, {45, 47}} - - - - NO - IBIPadFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - btn_close~ipad.png - - - - - - - 292 - {{959, 6}, {45, 47}} - - - - NO - IBIPadFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - btn_menu~ipad.png - - - - - - - 266 - {{0, 684}, {1024, 84}} - - - NO - YES - 4 - YES - IBIPadFramework - - NSImage - chrome-bottom~ipad.png - - - - {1024, 768} - - - - - 3 - MQA - - 2 - - - NO - - 3 - 3 - - IBIPadFramework - - - - - YES - - - view - - - - 3 - - - - menuButton - - - - 10 - - - - showMenu: - - - 7 - - 11 - - - - closeButton - - - - 14 - - - - hideMenu: - - - 7 - - 15 - - - - menuView - - - - 18 - - - - mouseHandler - - - - 19 - - - - webView - - - - 21 - - - - restart: - - - 7 - - 22 - - - - restartButton - - - - 23 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - - - - - - 4 - - - YES - - - Mouse handler - - - 6 - - - - - 7 - - - - - 8 - - - Reset button - - - 9 - - - Menu button - - - 12 - - - Close button - - - 16 - - - YES - - - - - Web handler - - - 17 - - - - - 20 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 12.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 2.IBPluginDependency - 2.IBUserGuides - 20.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPad - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 60 - 1 - - - - 700 - 1 - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 23 - - - - YES - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DOTCEmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/DOTCEmulationViewController.h - - - - EmulationViewiPad - DOTCEmulationViewController - - YES - - YES - hideMenu: - showMenu: - - - YES - id - id - - - - YES - - YES - hideMenu: - showMenu: - - - YES - - hideMenu: - id - - - showMenu: - id - - - - - YES - - YES - closeButton - menuButton - menuView - mouseHandler - webView - - - YES - UIButton - UIButton - UIView - UIView - UIWebView - - - - YES - - YES - closeButton - menuButton - menuView - mouseHandler - webView - - - YES - - closeButton - UIButton - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPad.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - bg_web~ipad.png - btn_close~ipad.png - btn_menu~ipad.png - btn_restart~ipad.png - chrome-bottom~ipad.png - chrome-top~ipad.png - - - YES - {989, 580} - {46, 47} - {45, 47} - {45, 47} - {1024, 84} - {1024, 75} - - - 884 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TargetSpecific/DotC/EmulationView-iPhone.xib b/TargetSpecific/DotC/EmulationView-iPhone.xib index 0329e71..68252a1 100644 --- a/TargetSpecific/DotC/EmulationView-iPhone.xib +++ b/TargetSpecific/DotC/EmulationView-iPhone.xib @@ -1,705 +1,131 @@ - - - - 1280 - 11A511 - 1891 - 1138 - 566.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 884 - - - YES - IBUIWebView - IBUIButton - IBUIImageView - IBUIView - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 256 - {480, 18} - - - - NO - YES - 4 - YES - IBCocoaTouchFramework - - NSImage - chrome-top.png - - - - - -2147483356 - - YES - - - 290 - {480, 320} - - - - YES - 4 - YES - IBCocoaTouchFramework - - NSImage - bg_web.png - - - - - 274 - {480, 320} - - - - 3 - MCAwAA - - NO - NO - IBCocoaTouchFramework - - - {{0, 275}, {480, 320}} - - - - - 3 - MQA - - 2 - - - - 3 - 3 - - IBCocoaTouchFramework - - - - 274 - {480, 320} - - - - - NO - NO - IBCocoaTouchFramework - - - - 290 - - YES - - - 256 - {480, 53} - - - - NO - YES - 4 - YES - - - - IBCocoaTouchFramework - - NSImage - chrome-bottom.png - - - - - 292 - {{10, 17}, {27, 28}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - NSImage - btn_restart.png - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - -2147483356 - {{441, 17}, {27, 28}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - btn_close.png - - - - - - - 292 - {{441, 17}, {27, 28}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - btn_menu.png - - - - - - {{0, 267}, {480, 53}} - - - - - NO - NO - IBCocoaTouchFramework - - - {480, 320} - - - - - NO - - 3 - 3 - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 7 - - - - showMenu: - - - 7 - - 10 - - - - menuView - - - - 16 - - - - webView - - - - 17 - - - - bottomBar - - - - 19 - - - - mouseHandler - - - - 20 - - - - hideMenu: - - - 7 - - 23 - - - - closeButton - - - - 24 - - - - menuButton - - - - 25 - - - - restart: - - - 7 - - 26 - - - - restartButton - - - - 27 - - - - - YES - - 0 - - YES - - - - - - 1 - - - YES - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - Top chrome - - - 11 - - - Mouse handler - - - 13 - - - YES - - - - - Web handler - - - 14 - - - - - 15 - - - - - 18 - - - YES - - - - - - - Bottom Bar - - - 3 - - - Bottom chrome - - - 8 - - - Restart - - - 9 - - - Menu - - - 21 - - - Close - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 1.IBUserGuides - 11.CustomClassName - 11.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 18.IBPluginDependency - 21.IBPluginDependency - 3.IBPluginDependency - 4.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPhone - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 284 - 1 - - - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 27 - - - - YES - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DOTCEmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/DOTCEmulationViewController.h - - - - EmulationViewiPhone - DOTCEmulationViewController - - YES - - YES - hideMenu: - showMenu: - - - YES - id - id - - - - YES - - YES - hideMenu: - showMenu: - - - YES - - hideMenu: - id - - - showMenu: - id - - - - - YES - - YES - bottomBar - closeButton - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - UIView - UIButton - UIButton - UIView - UIView - UIButton - UIWebView - - - - YES - - YES - bottomBar - closeButton - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - - bottomBar - UIView - - - closeButton - UIButton - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - restartButton - UIButton - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPhone.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - bg_web.png - btn_close.png - btn_menu.png - btn_restart.png - chrome-bottom.png - chrome-top.png - - - YES - {480, 320} - {27, 28} - {27, 28} - {27, 28} - {480, 53} - {480, 18} - - - 884 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TargetSpecific/DotC/info.plist b/TargetSpecific/DotC/info.plist index c850dfa..e9d3405 100644 --- a/TargetSpecific/DotC/info.plist +++ b/TargetSpecific/DotC/info.plist @@ -16,7 +16,7 @@ icon-72.png CFBundleIdentifier - com.manomio.iAmiga.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TargetSpecific/SingleView/AnimatedImageSequenceView.h b/TargetSpecific/SingleView/AnimatedImageSequenceView.h index 347c21f..e6c7929 100644 --- a/TargetSpecific/SingleView/AnimatedImageSequenceView.h +++ b/TargetSpecific/SingleView/AnimatedImageSequenceView.h @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 6/23/11. // Copyright 2011 Manomio LLC. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import diff --git a/TargetSpecific/SingleView/AnimatedImageSequenceView.m b/TargetSpecific/SingleView/AnimatedImageSequenceView.mm similarity index 83% rename from TargetSpecific/SingleView/AnimatedImageSequenceView.m rename to TargetSpecific/SingleView/AnimatedImageSequenceView.mm index 3f9faef..021f66a 100644 --- a/TargetSpecific/SingleView/AnimatedImageSequenceView.m +++ b/TargetSpecific/SingleView/AnimatedImageSequenceView.mm @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 6/23/11. // Copyright 2011 Manomio LLC. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import "AnimatedImageSequenceView.h" diff --git a/TargetSpecific/SingleView/BaseEmulationViewController.h b/TargetSpecific/SingleView/BaseEmulationViewController.h index 13a7c9b..09d78d1 100644 --- a/TargetSpecific/SingleView/BaseEmulationViewController.h +++ b/TargetSpecific/SingleView/BaseEmulationViewController.h @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 6/22/11. // Copyright 2011 Manomio LLC. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import #import "SDL.h" @@ -31,7 +46,6 @@ enum tagEmulatorState { } @property (nonatomic) BOOL integralSize; -@property (nonatomic, readonly) CGFloat displayTop; @property (nonatomic, readonly) NSString *bundleVersion; - (void)startEmulator; diff --git a/TargetSpecific/SingleView/BaseEmulationViewController.mm b/TargetSpecific/SingleView/BaseEmulationViewController.mm index 5c754eb..1f2b5c3 100644 --- a/TargetSpecific/SingleView/BaseEmulationViewController.mm +++ b/TargetSpecific/SingleView/BaseEmulationViewController.mm @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 6/22/11. // Copyright 2011 Manomio LLC. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import "BaseEmulationViewController.h" #import "uae.h" @@ -12,17 +27,20 @@ #import "UIKitDisplayView.h" #import "TouchHandlerView.h" #import "NSObject+Blocks.h" +#import "iAmigaAppDelegate.h" +#import "Settings.h" -#define kDisplayWidth 320.0f -#define kDisplayHeight 240.0f -#define kDisplayTopOffset 7.0f - +#define kDisplayWidth 640.0f //mithrendal hires fix before was 320.0f +#define kDisplayHeight 258.0f +extern int mainMenu_stretchscreen; +extern int mainMenu_AddVerticalStretchValue; @interface BaseEmulationViewController() @property (nonatomic, retain) UIView *displayView; @property (nonatomic,retain) UIWindow *displayViewWindow; @property (nonatomic, readonly) CGRect currentDisplayFrame; +@property (nonatomic, retain) Settings *settings; @end @@ -44,15 +62,18 @@ - (void)viewDidLoad { SDL_Init(0); SDL_Surface *surface = SDL_SetVideoMode(kDisplayWidth, kDisplayHeight, 16, 0); UIView *surfaceView = (UIView*)surface->userdata; + surfaceView.contentMode = UIViewContentModeScaleToFill; surfaceView.paused = YES; - surfaceView.frame = self.currentDisplayFrame; - + //[surfaceView setBackgroundColor:[UIColor redColor]]; + self.displayView = surfaceView; if (displayViewWindow != nil) { [displayViewWindow addSubview:self.displayView]; } else { [view addSubview:self.displayView]; - } + } + + _settings = [[Settings alloc] init]; } - (void)sendKeys:(SDLKey*)keys count:(size_t)count keyState:(SDL_EventType)keyState afterDelay:(NSTimeInterval)delayInSeconds { @@ -75,11 +96,22 @@ - (NSString *)bundleVersion { return version; } +- (void) viewWillAppear:(BOOL)animated { + [self.navigationController setNavigationBarHidden:YES animated:animated]; + [super viewWillAppear:animated]; +} + - (void)viewDidAppear:(BOOL)animated { [self startEmulator]; + iAmigaAppDelegate *appDelegate = (iAmigaAppDelegate *)[[UIApplication sharedApplication] delegate]; + [appDelegate configureScreens]; + } - (void)viewWillDisappear:(BOOL)animated { + [self.navigationController setNavigationBarHidden:NO animated:animated]; + [super viewWillDisappear:animated]; + [self pauseEmulator]; } @@ -97,11 +129,16 @@ static CGRect CreateIntegralScaledView(CGRect aFrame, BOOL top) { } - (CGFloat)displayTop { - return kDisplayTopOffset; + return _settings.showStatusBar ? [self getStatusBarHeight] : 0; } -- (CGRect)currentDisplayFrame { - if (_isExternal) { +- (CGFloat)getStatusBarHeight { + CGSize statusBarSize = [[UIApplication sharedApplication] statusBarFrame].size; + return MIN(statusBarSize.width, statusBarSize.height); +} + +- (CGRect)currentDisplayFrame { + if (_isExternal) { if (_integralSize) { return CreateIntegralScaledView(displayViewWindow.bounds, NO); } @@ -126,8 +163,18 @@ - (CGRect)currentDisplayFrame { // full-screen, landscape mode if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) { - // assuming landscape width > height - return CGRectMake(0, self.displayTop, frameSize.width, frameSize.height); + + + int height = self.view.frame.size.height - self.displayTop; + + //Stretch or keep 3/4 aspect radio for width + int width = mainMenu_stretchscreen ? self.view.frame.size.width : height / 3 * 4; + + //Center if aspect radio is not stretched + int xpos = mainMenu_stretchscreen ? 0 : (self.view.frame.size.width - width) / 2; + + return CGRectMake(xpos, self.displayTop, width, height); + } // aspect fill (portrait mode) @@ -138,12 +185,12 @@ - (CGRect)currentDisplayFrame { return CGRectMake(0, 0, kDisplayWidth * ratio, kDisplayHeight * ratio); } + - (void)setDisplayViewWindow:(UIWindow*)window isExternal:(BOOL)isExternal { _isExternal = isExternal; self.displayViewWindow = window; if (displayView == nil) return; - if (window) { [window addSubview:displayView]; } else { @@ -198,9 +245,16 @@ - (void)resumeEmulator { displayView.paused = NO; } --(NSInteger)supportedInterfaceOrientations{ - +-(NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskLandscape; } +- (UIStatusBarStyle) preferredStatusBarStyle { + return UIBarStyleBlackOpaque; +} + +- (BOOL)prefersStatusBarHidden { + return !_settings.showStatusBar; +} + @end diff --git a/TargetSpecific/SingleView/BaseNavigationController.h b/TargetSpecific/SingleView/BaseNavigationController.h new file mode 100644 index 0000000..bc2bf8f --- /dev/null +++ b/TargetSpecific/SingleView/BaseNavigationController.h @@ -0,0 +1,28 @@ +// +// BaseNavigationController.h +// iAmiga +// +// Created by Urs on 11.02.14. +// +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface BaseNavigationController : UINavigationController + +@end diff --git a/TargetSpecific/SingleView/BaseNavigationController.mm b/TargetSpecific/SingleView/BaseNavigationController.mm new file mode 100644 index 0000000..10a9c79 --- /dev/null +++ b/TargetSpecific/SingleView/BaseNavigationController.mm @@ -0,0 +1,73 @@ +// +// BaseNavigationController.m +// iAmiga +// +// Created by Urs on 11.02.14. +// +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "BaseNavigationController.h" +#import "VPadMotionController.h" + +@interface BaseNavigationController () + +@end + +@implementation BaseNavigationController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) { + [self prefersStatusBarHidden]; + [self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)]; + } +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +-(NSUInteger)supportedInterfaceOrientations{ + return [self.topViewController supportedInterfaceOrientations]; +} + +- (BOOL)shouldAutorotate { + return [VPadMotionController isActive]? NO : YES; +} + +@end diff --git a/TargetSpecific/SingleView/MainWindow-Single-iPad.xib b/TargetSpecific/SingleView/MainWindow-Single-iPad.xib deleted file mode 100644 index 532a8d4..0000000 --- a/TargetSpecific/SingleView/MainWindow-Single-iPad.xib +++ /dev/null @@ -1,244 +0,0 @@ - - - - 1056 - 10J869 - 1306 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 - - - YES - IBUICustomObject - IBUIWindow - IBUIViewController - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - IBIPadFramework - - - - 292 - {768, 1024} - - - 3 - MAA - - NO - NO - IBIPadFramework - YES - - - Emulation View - EmulationView-iPad - - 3 - 3 - - YES - IBIPadFramework - YES - - - - - YES - - - window - - - - 4 - - - - delegate - - - - 5 - - - - mainController - - - - 7 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - - - 3 - - - - - 6 - - - Emulation View - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 2.CustomClassName - 2.IBPluginDependency - 3.IBPluginDependency - 6.CustomClassName - 6.IBPluginDependency - - - YES - UIApplication - UIResponder - SingleWindowAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - EmulationViewiPad - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 7 - - - - YES - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - EmulationViewiPad - BaseEmulationViewController - - IBProjectSource - ./Classes/EmulationViewiPad.h - - - - SingleWindowAppDelegate - NSObject - - YES - - YES - mainController - window - - - YES - BaseEmulationViewController - UIWindow - - - - YES - - YES - mainController - window - - - YES - - mainController - BaseEmulationViewController - - - window - UIWindow - - - - - IBProjectSource - ./Classes/SingleWindowAppDelegate.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 301 - - diff --git a/TargetSpecific/SingleView/MainWindow-Single.xib b/TargetSpecific/SingleView/MainWindow-Single.xib deleted file mode 100644 index edcea05..0000000 --- a/TargetSpecific/SingleView/MainWindow-Single.xib +++ /dev/null @@ -1,255 +0,0 @@ - - - - 1056 - 10J869 - 1306 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 301 - - - YES - IBUICustomObject - IBUIWindow - IBUIViewController - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - 292 - {320, 480} - - - - 3 - MAA - - NO - NO - IBCocoaTouchFramework - YES - - - Emulator View - EmulationView-iPhone - - 3 - 3 - - YES - IBCocoaTouchFramework - YES - - - - - YES - - - delegate - - - - 3 - - - - window - - - - 5 - - - - mainController - - - - 7 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - - - 4 - - - - - 6 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 2.CustomClassName - 2.IBPluginDependency - 4.IBPluginDependency - 6.CustomClassName - 6.IBPluginDependency - - - YES - UIApplication - UIResponder - SingleWindowAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - EmulationViewiPhone - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 7 - - - - YES - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - EmulationViewiPhone - BaseEmulationViewController - - showMenu: - id - - - showMenu: - - showMenu: - id - - - - IBProjectSource - ./Classes/EmulationViewiPhone.h - - - - SingleWindowAppDelegate - NSObject - - YES - - YES - mainController - window - - - YES - BaseEmulationViewController - UIWindow - - - - YES - - YES - mainController - window - - - YES - - mainController - BaseEmulationViewController - - - window - UIWindow - - - - - IBProjectSource - ./Classes/SingleWindowAppDelegate.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 301 - - diff --git a/TargetSpecific/SingleView/SingleWindowAppDelegate.h b/TargetSpecific/SingleView/SingleWindowAppDelegate.h index 0392294..8885297 100644 --- a/TargetSpecific/SingleView/SingleWindowAppDelegate.h +++ b/TargetSpecific/SingleView/SingleWindowAppDelegate.h @@ -5,6 +5,21 @@ // Created by Stuart Carnie on 6/21/11. // Copyright 2011 Manomio LLC. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import @@ -15,6 +30,7 @@ UIWindow *externalWindow; } +@property (nonatomic, retain) NSMutableArray *Filename; @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet BaseEmulationViewController *mainController; diff --git a/TargetSpecific/SingleView/SingleWindowAppDelegate.mm b/TargetSpecific/SingleView/SingleWindowAppDelegate.mm index 8937725..89415aa 100644 --- a/TargetSpecific/SingleView/SingleWindowAppDelegate.mm +++ b/TargetSpecific/SingleView/SingleWindowAppDelegate.mm @@ -5,12 +5,30 @@ // Created by Stuart Carnie on 6/21/11. // Copyright 2011 Manomio LLC. All rights reserved. // +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#import "AdfImporter.h" #import "SingleWindowAppDelegate.h" #import "BaseEmulationViewController.h" -#import +#import #import "SDL.h" #import "UIKitDisplayView.h" +#import "SVProgressHUD.h" +#import "EMUROMBrowserViewController.h" #import "sysconfig.h" #import "sysdeps.h" @@ -24,33 +42,38 @@ - (void)configureScreens; @end -@implementation SingleWindowAppDelegate +@implementation SingleWindowAppDelegate { + int _firstClick; +} @synthesize window, mainController; - (void)applicationDidFinishLaunching:(UIApplication *)application { - // load disks into df0: and df1: - NSString *path = [[NSBundle mainBundle] pathForResource:@"DISK1" ofType:@"ADF"]; - [path getCString:prefs_df[0] maxLength:256 encoding:[NSString defaultCStringEncoding]]; - fprintf(stdout, ">>>>>>> %s\n", prefs_df[0]); - path = [[NSBundle mainBundle] pathForResource:@"DISK2" ofType:@"ADF"]; - [path getCString:prefs_df[1] maxLength:256 encoding:[NSString defaultCStringEncoding]]; - - [window setRootViewController:self.mainController]; - //[window addSubview:self.mainController.view]; - - // Override point for customization after application launch + _firstClick = 1; + + UINavigationController *navigationcontroller = (UINavigationController *)self.window.rootViewController; + self.mainController = (BaseEmulationViewController *)navigationcontroller.topViewController; [window makeKeyAndVisible]; - - OSStatus res = AudioSessionInitialize(NULL, NULL, NULL, NULL); - UInt32 sessionCategory = kAudioSessionCategory_AmbientSound; - res = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory); - res = AudioSessionSetActive(true); - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidDisconnect:) name:UIScreenDidDisconnectNotification object:nil]; - [self configureScreens]; + window.frame = [[UIScreen mainScreen] bounds]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnect:) name:UIScreenDidConnectNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidDisconnect:) name:UIScreenDidDisconnectNotification object:nil]; + [self configureScreens]; + + // set sound as ambient so that iAmiga does not monopolize the sound output + NSError *error; + if (![[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&error]) { + NSLog(@"Failed to set ambient audio session: %@", error); + } +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + SDL_PauseOpenGL(1); +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + SDL_PauseOpenGL(0); } - (void)screenDidConnect:(NSNotification*)aNotification { @@ -59,17 +82,19 @@ - (void)screenDidConnect:(NSNotification*)aNotification { - (void)screenDidDisconnect:(NSNotification*)aNotification { [self configureScreens]; - } - (void)configureScreens { + + [window.rootViewController setNeedsStatusBarAppearanceUpdate]; + if ([[UIScreen screens] count] == 1) { NSLog(@"Device display"); // disable extras if (externalWindow) { externalWindow.hidden = YES; } - [self.mainController setDisplayViewWindow:nil isExternal:NO]; + [mainController setDisplayViewWindow:nil isExternal:NO]; } else { NSLog(@"External display"); UIScreen *secondary = [[UIScreen screens] objectAtIndex:1]; @@ -96,11 +121,34 @@ - (void)configureScreens { } } -- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window -{ +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { + BOOL imported = NO; + if ([self isAdf:url]) { + AdfImporter *importer = [[[AdfImporter alloc] init] autorelease]; + imported = [importer import:url.path]; + } else { + // for anything else (rom, hdf, ...?) we don't do anything special - files will be in the "Inbox" folder + imported = YES; + } + [SVProgressHUD setBackgroundColor:[UIColor lightGrayColor]]; + if (imported) { + [[NSNotificationCenter defaultCenter] postNotificationName:[EMUROMBrowserViewController getFileImportedNotificationName] object:nil]; + [SVProgressHUD showSuccessWithStatus:[NSString stringWithFormat:@"Imported %@", [url.path lastPathComponent]]]; + } else { + [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"Failed to import %@", [url.path lastPathComponent]]]; + } + return imported; +} + +- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskLandscape; } +- (BOOL)isAdf:(NSURL *)url { + NSString *extension = url.path.pathExtension.lowercaseString; + return [@"adf" isEqualToString:extension] || [@"zip" isEqualToString:extension]; +} + - (void)dealloc { [window release]; [super dealloc]; diff --git a/TargetSpecific/Stooges/EmulationView-iPad.xib b/TargetSpecific/Stooges/EmulationView-iPad.xib index 4278bd1..838aae2 100644 --- a/TargetSpecific/Stooges/EmulationView-iPad.xib +++ b/TargetSpecific/Stooges/EmulationView-iPad.xib @@ -1,33 +1,30 @@ - + - 1296 - 11D50 - 2182 - 1138.32 - 568.00 + 1792 + 14B25 + 6254 + 1343.16 + 755.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 + 6247 - - YES - IBUIWebView + + IBProxyObject IBUIButton IBUIImageView IBUIView - IBProxyObject - - - YES + IBUIWebView + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + PluginDependencyRecalculationVersion - - YES + IBFilesOwner IBIPadFramework @@ -37,16 +34,14 @@ IBIPadFramework - + 292 - - YES + 274 {1024, 768} - 3 @@ -61,7 +56,6 @@ 292 {1024, 768} - _NS:9 @@ -72,14 +66,12 @@ -2147483355 - - YES + 256 {989, 580} - NO YES @@ -88,7 +80,7 @@ IBIPadFramework NSImage - bg_web~ipad.png + bg_web.png @@ -96,17 +88,15 @@ 292 {{24, 0}, {940, 540}} - NO NO IBIPadFramework - + {{18, -580}, {989, 580}} - NO @@ -117,7 +107,6 @@ 256 {1024, 75} - NO @@ -127,7 +116,7 @@ IBIPadFramework NSImage - chrome-top~ipad.png + chrome-top.png @@ -135,27 +124,26 @@ 292 {{20, 6}, {45, 47}} - NO IBIPadFramework 0 0 - - 3 - MQA - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + 3 + MQA + 3 MC41AA NSImage - btn_restart~ipad.png + btn_restart.png Helvetica-Bold @@ -174,22 +162,21 @@ 292 {{959, 6}, {45, 47}} - NO IBIPadFramework 0 0 1 - - + 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + NSImage - btn_close~ipad.png + btn_close.png @@ -199,22 +186,18 @@ 292 {{959, 6}, {45, 47}} - NO IBIPadFramework 0 0 1 + - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - NSImage - btn_menu~ipad.png + btn_menu.png @@ -224,7 +207,6 @@ 266 {{0, 684}, {1024, 84}} - NO YES 4 @@ -232,13 +214,11 @@ IBIPadFramework NSImage - chrome-bottom~ipad.png + chrome-bottom.png - + {1024, 768} - - 3 @@ -252,12 +232,28 @@ 3 3 + + IBUIScreenMetrics + IBIPadFramework + iPad Full Screen + + YES + + + + + + {768, 1024} + {1024, 768} + + + 1 + IBIPadFramework - + - - YES + view @@ -349,15 +345,12 @@ 15 - + - - YES + 0 - - YES - + @@ -375,8 +368,7 @@ 2 - - YES + @@ -385,15 +377,13 @@ - + 4 - - YES - + Mouse handler @@ -428,11 +418,10 @@ 16 - - YES + - + Web handler @@ -451,282 +440,62 @@ - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 12.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 2.IBPluginDependency - 2.IBUserGuides - 20.IBPluginDependency - 25.CustomClassName - 25.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPad - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 60 - 1 - - - - 700 - 1 - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - DynamicLandscapeControls - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - + + + EmulationViewiPad + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + 60 + 1 + + + + 700 + 1 + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + DynamicLandscapeControls + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + TouchHandlerView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + 26 - - - YES - - BaseControlsView - UIView - - IBProjectSource - ./Classes/BaseControlsView.h - - - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DOTCEmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/DOTCEmulationViewController.h - - - - DynamicLandscapeControls - BaseControlsView - - IBProjectSource - ./Classes/DynamicLandscapeControls.h - - - - EmulationViewiPad - DOTCEmulationViewController - - YES - - YES - hideMenu: - loadState: - showMenu: - - - YES - id - id - id - - - - YES - - YES - hideMenu: - loadState: - showMenu: - - - YES - - hideMenu: - id - - - loadState: - id - - - showMenu: - id - - - - - YES - - YES - closeButton - inputController - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - UIButton - DynamicLandscapeControls - UIButton - UIView - UIView - UIButton - UIWebView - - - - YES - - YES - closeButton - inputController - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - - closeButton - UIButton - - - inputController - DynamicLandscapeControls - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - restartButton - UIButton - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPad.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - - + 0 IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES 3 - - YES - - YES - bg_web~ipad.png - btn_close~ipad.png - btn_menu~ipad.png - btn_restart~ipad.png - chrome-bottom~ipad.png - chrome-top~ipad.png - - - YES - {989, 580} - {46, 47} - {45, 47} - {45, 47} - {1024, 84} - {1024, 75} - - - 1181 + + {989, 580} + {46, 47} + {45, 47} + {45, 47} + {1024, 84} + {1024, 75} + diff --git a/TargetSpecific/Stooges/EmulationView-iPhone.m b/TargetSpecific/Stooges/EmulationView-iPhone.m index 574daff..64624b0 100644 --- a/TargetSpecific/Stooges/EmulationView-iPhone.m +++ b/TargetSpecific/Stooges/EmulationView-iPhone.m @@ -56,6 +56,7 @@ - (void)dealloc { [menuButton release]; [restartButton release]; [inputController release]; + [joyControllerView release]; [super dealloc]; } diff --git a/TargetSpecific/Stooges/EmulationView-iPhone.xib b/TargetSpecific/Stooges/EmulationView-iPhone.xib index a8bc0ab..06f5bd9 100644 --- a/TargetSpecific/Stooges/EmulationView-iPhone.xib +++ b/TargetSpecific/Stooges/EmulationView-iPhone.xib @@ -1,33 +1,30 @@ - + - 1296 - 11D50 - 2182 - 1138.32 - 568.00 + 1792 + 14B25 + 6254 + 1343.16 + 755.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 + 6247 - - YES - IBUIWebView + + IBProxyObject IBUIButton IBUIImageView IBUIView - IBProxyObject - - - YES + IBUIWebView + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + PluginDependencyRecalculationVersion - - YES + IBFilesOwner IBCocoaTouchFramework @@ -37,16 +34,14 @@ IBCocoaTouchFramework - + 274 - - YES + 256 {480, 18} - NO YES @@ -63,7 +58,6 @@ 292 {480, 320} - _NS:9 @@ -77,14 +71,12 @@ -2147483356 - - YES + 290 {480, 320} - YES 4 @@ -100,16 +92,14 @@ 274 {480, 320} - NO NO IBCocoaTouchFramework - + {{0, 275}, {480, 320}} - 3 @@ -118,10 +108,6 @@ 2 - - 3 - 3 - IBCocoaTouchFramework @@ -129,7 +115,6 @@ 274 {480, 320} - NO @@ -139,14 +124,12 @@ 290 - - YES + 256 {480, 53} - NO YES @@ -166,20 +149,19 @@ 292 {{10, 17}, {27, 28}} - NO IBCocoaTouchFramework 0 0 - - 3 - MQA - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + 3 + MQA + 3 MC41AA @@ -205,17 +187,16 @@ -2147483356 {{441, 17}, {27, 28}} - NO IBCocoaTouchFramework 0 0 - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage @@ -229,17 +210,16 @@ 292 {{441, 17}, {27, 28}} - NO IBCocoaTouchFramework 0 0 - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage @@ -248,20 +228,17 @@ - + {{0, 267}, {480, 53}} - NO NO IBCocoaTouchFramework - + {480, 320} - - NO @@ -269,12 +246,15 @@ 3 3 + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + IBCocoaTouchFramework - + - - YES + view @@ -374,29 +354,25 @@ 23 - + - - YES + 0 - - YES - + 1 - - YES + - + @@ -419,20 +395,17 @@ 11 - - YES - + Mouse handler 13 - - YES + - + Web handler @@ -449,13 +422,12 @@ 18 - - YES + - + Bottom Bar @@ -488,272 +460,58 @@ - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 1.IBUserGuides - 11.CustomClassName - 11.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 18.IBPluginDependency - 21.IBPluginDependency - 3.IBPluginDependency - 33.CustomClassName - 33.IBPluginDependency - 4.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPhone - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 285 - 1 - - - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - DynamicLandscapeControls - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - + + + EmulationViewiPhone + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + 285 + 1 + + + TouchHandlerView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + DynamicLandscapeControls + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + 34 - - - YES - - BaseControlsView - UIView - - IBProjectSource - ./Classes/BaseControlsView.h - - - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DOTCEmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/DOTCEmulationViewController.h - - - - DynamicLandscapeControls - BaseControlsView - - IBProjectSource - ./Classes/DynamicLandscapeControls.h - - - - EmulationViewiPhone - DOTCEmulationViewController - - YES - - YES - hideMenu: - showMenu: - - - YES - id - id - - - - YES - - YES - hideMenu: - showMenu: - - - YES - - hideMenu: - id - - - showMenu: - id - - - - - YES - - YES - bottomBar - closeButton - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - UIView - UIButton - UIButton - UIView - UIView - UIButton - UIWebView - - - - YES - - YES - bottomBar - closeButton - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - - bottomBar - UIView - - - closeButton - UIButton - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - restartButton - UIButton - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPhone.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - - + 0 IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES 3 - - YES - - YES - bg_web.png - btn_close.png - btn_menu.png - btn_restart.png - chrome-bottom.png - chrome-top.png - - - YES - {480, 320} - {27, 28} - {27, 28} - {27, 28} - {480, 53} - {480, 18} - - - 1181 + + {480, 320} + {27, 28} + {27, 28} + {27, 28} + {480, 53} + {480, 18} + diff --git a/TargetSpecific/Stooges/info.plist b/TargetSpecific/Stooges/info.plist index 46e72ce..d86a52b 100644 --- a/TargetSpecific/Stooges/info.plist +++ b/TargetSpecific/Stooges/info.plist @@ -16,7 +16,7 @@ icon-72.png CFBundleIdentifier - com.cinemaware.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TargetSpecific/koc/EmulationView-iPad.h b/TargetSpecific/koc/EmulationView-iPad.h index 5e707d7..cc2614d 100644 --- a/TargetSpecific/koc/EmulationView-iPad.h +++ b/TargetSpecific/koc/EmulationView-iPad.h @@ -9,9 +9,7 @@ #import #import "EmulationViewController.h" -@class DynamicLandscapeControls; - -@interface EmulationViewiPad : EmulationViewController { +@interface EmulationViewiPad : EmulationViewController { UIButton *menuButton; UIButton *closeButton; @@ -19,7 +17,6 @@ UIButton *restartButton; UIView *menuView; UIWebView *webView; - DynamicLandscapeControls *inputController; } - (IBAction)hideMenu:(id)sender; - (IBAction)showMenu:(id)sender; @@ -30,6 +27,5 @@ @property (nonatomic, retain) IBOutlet UIButton *closeButton; @property (nonatomic, retain) IBOutlet UIView *mouseHandler; @property (nonatomic, retain) IBOutlet UIButton *restartButton; -@property (nonatomic, retain) IBOutlet DynamicLandscapeControls *inputController; @end diff --git a/TargetSpecific/koc/EmulationView-iPad.m b/TargetSpecific/koc/EmulationView-iPad.m index 182dd33..0816121 100644 --- a/TargetSpecific/koc/EmulationView-iPad.m +++ b/TargetSpecific/koc/EmulationView-iPad.m @@ -7,8 +7,6 @@ // #import "EmulationView-iPad.h" -#import "DynamicLandscapeControls.h" -#import "JSON.h" @implementation EmulationViewiPad @synthesize menuView; @@ -17,7 +15,6 @@ @implementation EmulationViewiPad @synthesize closeButton; @synthesize mouseHandler; @synthesize restartButton; -@synthesize inputController; #pragma mark - View lifecycle @@ -26,11 +23,6 @@ - (void)viewDidLoad { [webView setBackgroundColor:[UIColor clearColor]]; [webView setOpaque:NO]; webView.delegate = self; - - //mouseHandler.hidden = YES; - NSString *controlLayout = [[NSBundle mainBundle] pathForResource:@"control-layout" ofType:@"json"]; - inputController.layoutName = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? @"iphone" : @"ipad"; - [inputController updateLayout:[[NSString stringWithContentsOfFile:controlLayout usedEncoding:NULL error:NULL] JSONValue]]; } - (void)dealloc { @@ -40,7 +32,6 @@ - (void)dealloc { [mouseHandler release]; [webView release]; [restartButton release]; - [inputController release]; [super dealloc]; } @@ -51,7 +42,6 @@ - (void)viewDidUnload { [self setMouseHandler:nil]; [self setWebView:nil]; [self setRestartButton:nil]; - [self inputController:nil]; [super viewDidUnload]; } diff --git a/TargetSpecific/koc/EmulationView-iPad.xib b/TargetSpecific/koc/EmulationView-iPad.xib index 0811db6..ff3605c 100644 --- a/TargetSpecific/koc/EmulationView-iPad.xib +++ b/TargetSpecific/koc/EmulationView-iPad.xib @@ -1,33 +1,30 @@ - + - 1296 - 11D50d - 2182 - 1138.32 - 568.00 + 1792 + 14B25 + 6254 + 1343.16 + 755.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 + 6247 - - YES - IBUIWebView + + IBProxyObject IBUIButton IBUIImageView IBUIView - IBProxyObject - - - YES + IBUIWebView + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + PluginDependencyRecalculationVersion - - YES + IBFilesOwner IBIPadFramework @@ -37,16 +34,14 @@ IBIPadFramework - + 292 - - YES + 274 {1024, 768} - 3 @@ -56,30 +51,15 @@ NO IBIPadFramework - - - 292 - {{898, 567}, {100, 100}} - - - - _NS:9 - - NO - NO - IBIPadFramework - -2147483355 - - YES + 256 {989, 580} - NO YES @@ -88,7 +68,7 @@ IBIPadFramework NSImage - bg_web~ipad.png + bg_web.png @@ -96,17 +76,15 @@ 292 {{24, 0}, {940, 540}} - NO NO IBIPadFramework - + {{18, -580}, {989, 580}} - NO @@ -117,7 +95,6 @@ 256 {1024, 75} - NO @@ -127,7 +104,7 @@ IBIPadFramework NSImage - chrome-top~ipad.png + chrome-top.png @@ -135,27 +112,26 @@ 292 {{20, 6}, {45, 47}} - NO IBIPadFramework 0 0 - - 3 - MQA - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + 3 + MQA + 3 MC41AA NSImage - btn_restart~ipad.png + btn_restart.png Helvetica-Bold @@ -174,22 +150,21 @@ 292 {{959, 6}, {45, 47}} - NO IBIPadFramework 0 0 1 - - + 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + NSImage - btn_close~ipad.png + btn_close.png @@ -199,22 +174,18 @@ 292 {{959, 6}, {45, 47}} - - + NO IBIPadFramework 0 0 1 + - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - NSImage - btn_menu~ipad.png + btn_menu.png @@ -224,7 +195,6 @@ 266 {{0, 684}, {1024, 84}} - NO YES 4 @@ -232,13 +202,11 @@ IBIPadFramework NSImage - chrome-bottom~ipad.png + chrome-bottom.png - + {1024, 768} - - 3 @@ -252,12 +220,28 @@ 3 3 + + IBUIScreenMetrics + IBIPadFramework + iPad Full Screen + + YES + + + + + + {768, 1024} + {1024, 768} + + + 1 + IBIPadFramework - + - - YES + view @@ -314,14 +298,6 @@ 23 - - - inputController - - - - 25 - restart: @@ -349,15 +325,12 @@ 15 - + - - YES + 0 - - YES - + @@ -375,8 +348,7 @@ 2 - - YES + @@ -384,16 +356,13 @@ - - + 4 - - YES - + Mouse handler @@ -428,11 +397,10 @@ 16 - - YES + - + Web handler @@ -446,280 +414,60 @@ - - 24 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 12.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 2.IBPluginDependency - 2.IBUserGuides - 20.IBPluginDependency - 24.CustomClassName - 24.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPad - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 60 - 1 - - - - 700 - 1 - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - DynamicLandscapeControls - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - + + + EmulationViewiPad + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + 60 + 1 + + + + 700 + 1 + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + TouchHandlerView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + - 25 - - - - YES - - BaseControlsView - UIView - - IBProjectSource - ./Classes/BaseControlsView.h - - - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DynamicLandscapeControls - BaseControlsView - - IBProjectSource - ./Classes/DynamicLandscapeControls.h - - - - EmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/EmulationViewController.h - - - - EmulationViewiPad - EmulationViewController - - YES - - YES - hideMenu: - showMenu: - - - YES - id - id - - - - YES - - YES - hideMenu: - showMenu: - - - YES - - hideMenu: - id - - - showMenu: - id - - - - - YES - - YES - closeButton - inputController - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - UIButton - DynamicLandscapeControls - UIButton - UIView - UIView - UIButton - UIWebView - - - - YES - - YES - closeButton - inputController - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - - closeButton - UIButton - - - inputController - DynamicLandscapeControls - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - restartButton - UIButton - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPad.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - + 23 + 0 IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES 3 - - YES - - YES - bg_web~ipad.png - btn_close~ipad.png - btn_menu~ipad.png - btn_restart~ipad.png - chrome-bottom~ipad.png - chrome-top~ipad.png - - - YES - {989, 580} - {46, 47} - {45, 47} - {45, 47} - {1024, 84} - {1024, 75} - - - 1181 + + {989, 580} + {46, 47} + {45, 47} + {45, 47} + {1024, 84} + {1024, 75} + diff --git a/TargetSpecific/koc/EmulationView-iPhone.h b/TargetSpecific/koc/EmulationView-iPhone.h index a32f8fc..a03a9bb 100644 --- a/TargetSpecific/koc/EmulationView-iPhone.h +++ b/TargetSpecific/koc/EmulationView-iPhone.h @@ -22,7 +22,6 @@ UIButton *restartButton; CGFloat _menuViewStartY; CGFloat _bottomBarStartY; - DynamicLandscapeControls *inputController; } - (IBAction)hideMenu:(id)sender; - (IBAction)showMenu:(id)sender; @@ -34,6 +33,5 @@ @property (nonatomic, retain) IBOutlet UIButton *closeButton; @property (nonatomic, retain) IBOutlet UIButton *menuButton; @property (nonatomic, retain) IBOutlet UIButton *restartButton; -@property (nonatomic, retain) IBOutlet DynamicLandscapeControls *inputController; @end diff --git a/TargetSpecific/koc/EmulationView-iPhone.m b/TargetSpecific/koc/EmulationView-iPhone.m index 410eb83..edd37da 100644 --- a/TargetSpecific/koc/EmulationView-iPhone.m +++ b/TargetSpecific/koc/EmulationView-iPhone.m @@ -7,8 +7,6 @@ // #import "EmulationView-iPhone.h" -#import "DynamicLandscapeControls.h" -#import "JSON.h" @implementation EmulationViewiPhone @synthesize menuView; @@ -18,7 +16,6 @@ @implementation EmulationViewiPhone @synthesize closeButton; @synthesize menuButton; @synthesize restartButton; -@synthesize inputController; #pragma mark - View lifecycle @@ -27,11 +24,6 @@ - (void)viewDidLoad { [webView setBackgroundColor:[UIColor clearColor]]; [webView setOpaque:NO]; webView.delegate = self; - - //mouseHandler.hidden = YES; - NSString *controlLayout = [[NSBundle mainBundle] pathForResource:@"control-layout" ofType:@"json"]; - inputController.layoutName = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? @"iphone" : @"ipad"; - [inputController updateLayout:[[NSString stringWithContentsOfFile:controlLayout usedEncoding:NULL error:NULL] JSONValue]]; } - (void)dealloc { @@ -42,7 +34,6 @@ - (void)dealloc { [closeButton release]; [menuButton release]; [restartButton release]; - [inputController release]; [super dealloc]; } @@ -54,7 +45,6 @@ - (void)viewDidUnload { [self setCloseButton:nil]; [self setMenuButton:nil]; [self setRestartButton:nil]; - [self setInputController:nil]; [super viewDidUnload]; } diff --git a/TargetSpecific/koc/EmulationView-iPhone.xib b/TargetSpecific/koc/EmulationView-iPhone.xib index ee9b1fd..8807d30 100644 --- a/TargetSpecific/koc/EmulationView-iPhone.xib +++ b/TargetSpecific/koc/EmulationView-iPhone.xib @@ -1,11 +1,19 @@ +<<<<<<< HEAD 1552 11G63b 3084 1138.51 569.00 +======= + 1296 + 11D50 + 2182 + 1138.32 + 568.00 +>>>>>>> parent of fa960e3... Configurable onscreen mouse buttons com.apple.InterfaceBuilder.IBCocoaTouchPlugin 2083 @@ -46,6 +54,7 @@ -2147483392 {480, 18} + NO YES @@ -93,6 +102,7 @@ 290 {480, 320} + YES 4 @@ -108,7 +118,15 @@ 274 {480, 320} +<<<<<<< HEAD +======= + + + 3 + MCAwAA + +>>>>>>> parent of fa960e3... Configurable onscreen mouse buttons NO NO IBCocoaTouchFramework @@ -116,6 +134,7 @@ {{0, 275}, {480, 320}} + 3 @@ -130,6 +149,21 @@ IBCocoaTouchFramework +<<<<<<< HEAD +======= + + + 274 + {480, 320} + + + + + NO + NO + IBCocoaTouchFramework + +>>>>>>> parent of fa960e3... Configurable onscreen mouse buttons 290 @@ -140,6 +174,7 @@ 256 {480, 53} + NO YES @@ -159,6 +194,7 @@ 292 {{10, 17}, {27, 28}} + NO IBCocoaTouchFramework @@ -197,6 +233,7 @@ -2147483356 {{441, 17}, {27, 28}} + NO IBCocoaTouchFramework @@ -220,6 +257,7 @@ 292 {{441, 17}, {27, 28}} + NO IBCocoaTouchFramework @@ -241,6 +279,7 @@ {{0, 267}, {480, 53}} + NO @@ -250,6 +289,7 @@ {480, 320} + NO @@ -327,14 +367,6 @@ 27 - - - inputController - - - - 29 - restart: @@ -382,8 +414,11 @@ +<<<<<<< HEAD +======= +>>>>>>> parent of fa960e3... Configurable onscreen mouse buttons @@ -401,9 +436,6 @@ 11 - - YES - Mouse handler @@ -471,11 +503,6 @@ Top chrome - - 28 - - - @@ -495,8 +522,6 @@ 15.IBPluginDependency 18.IBPluginDependency 21.IBPluginDependency - 28.CustomClassName - 28.IBPluginDependency 3.IBPluginDependency 4.IBPluginDependency 8.IBPluginDependency @@ -524,8 +549,6 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - DynamicLandscapeControls - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -544,9 +567,144 @@ - 29 + 27 + + + + YES + + BaseEmulationViewController + UIViewController + + IBProjectSource + ./Classes/BaseEmulationViewController.h + + + + EmulationViewController + UIViewController + + IBProjectSource + ./Classes/EmulationViewController.h + + + + EmulationViewiPhone + EmulationViewController + + YES + + YES + hideMenu: + showMenu: + + + YES + id + id + + + + YES + + YES + hideMenu: + showMenu: + + + YES + + hideMenu: + id + + + showMenu: + id + + + + + YES + + YES + bottomBar + closeButton + menuButton + menuView + mouseHandler + restartButton + webView + + + YES + UIView + UIButton + UIButton + UIView + UIView + UIButton + UIWebView + + + + YES + + YES + bottomBar + closeButton + menuButton + menuView + mouseHandler + restartButton + webView + + + YES + + bottomBar + UIView + + + closeButton + UIButton + + + menuButton + UIButton + + + menuView + UIView + + + mouseHandler + UIView + + + restartButton + UIButton + + + webView + UIWebView + + + + + IBProjectSource + ./Classes/EmulationViewiPhone.h + + + + TouchHandlerView + UIView + + IBProjectSource + ./Classes/TouchHandlerView.h + + + - 0 IBCocoaTouchFramework diff --git a/TargetSpecific/koc/Resources/html/UserGuide.html b/TargetSpecific/koc/Resources/html/UserGuide.html index 24dd28f..299970c 100755 --- a/TargetSpecific/koc/Resources/html/UserGuide.html +++ b/TargetSpecific/koc/Resources/html/UserGuide.html @@ -15,7 +15,7 @@ -King of Chicago - iAmiga +DefenderOfTheCrown - iAmiga diff --git a/TargetSpecific/koc/Resources/html/UserGuide~ipad.html b/TargetSpecific/koc/Resources/html/UserGuide~ipad.html index 402d1c6..74a268c 100644 --- a/TargetSpecific/koc/Resources/html/UserGuide~ipad.html +++ b/TargetSpecific/koc/Resources/html/UserGuide~ipad.html @@ -15,7 +15,7 @@ -King of Chicago - iAmiga +DefenderOfTheCrown - iAmiga diff --git a/TargetSpecific/koc/Resources/html/about.html b/TargetSpecific/koc/Resources/html/about.html index 3885b51..cd35b30 100644 --- a/TargetSpecific/koc/Resources/html/about.html +++ b/TargetSpecific/koc/Resources/html/about.html @@ -23,6 +23,16 @@

CINEMAWARE

Go to http://www.cinemaware.com for more information.

+<<<<<<< HEAD +======= +

MANOMIO

+ Manomio, makers of Commodore 64 for iPhone and Flashback, is a dedicated group of individuals, + committed to bringing classic retro titles to iOS.

+ For updates on what we're working on and future retro releases, + follow us on Twitter at http://twitter.com/manomio +

+ +>>>>>>> parent of 8d622d9... User guide update, input update.

UAE4all

More information on UAE4all can be found at http://wiki.gp2x.org/wiki/UAE4all. UAE4all is licensed under the GPL, a copy of which is included in the Licenses section. diff --git a/TargetSpecific/koc/Resources/html/help.html b/TargetSpecific/koc/Resources/html/help.html index 1828e69..9dd8a24 100644 --- a/TargetSpecific/koc/Resources/html/help.html +++ b/TargetSpecific/koc/Resources/html/help.html @@ -1,91 +1,89 @@
-

Playing the Game

+<<<<<<< HEAD    As you move your finger across the screen you'll notice a small fly buzzing around. When Pinky can't decide what to do next, move the fly to one of his "thought balloons" and press the red button. Choose quickly or he will make up his own mind. And remember, every decision you make will affect the characters in that episode! Sometimes Pinky will think about drawing his gun. When the gun appears, move the fly to aim and press the red button if you decide to fire. Don't move the fly too quickly and be sure to stay on your toes, you never know what the other characters will do. If you want to pause or skip a scene, you can bring down the menu by touching the screen with a second finger, while using the first touch to move the fly around. +======= +    As you move the mouse you'll notice a small fly buzzing around. When Pinky can't decide what to do next, move the fly to one of his "thought balloons" and double tap the screen. Choose quickly or he will make up his own mind. And remember, every decision you make will affect the characters in that episode! Sometimes Pinky will think about drawing his gun. When the gun appears, move the mouse to aim and press the button if you decide to fire. Don't move the cursor too quickly and be sure to stay on your toes, you never know what the other characters will do. +>>>>>>> parent of 8d622d9... User guide update, input update.

Drive-by Bombings

-    Successful demolition requires a steady hand and careful timing. As the car drives by the front of the building, press the button to lob the bomb. The longer you hold your finger on the button the higher the bomb travels. Your aim is based entirely on when you throw the bomb, and not on the position of your cursor. +    Successful demolition requires a steady hand and careful timing. As the car drives by the front of the building, press the Ieft mouse button to Iob the bomb. The Ionger you hold your finger on the button the higher the bomb travels. Your aim is based entirely on when you throw the bomb, and not on the position of your cursor.

-

Decisions

-    Some of your decisions will cause branches in the game while others affect the personalities of the characters involved in that particular scene. For example, making a caustic remark to Lola will boost Pinky's toughness but decrease Lola's happiness. (And if she gets too unhappy-well, watch out! Conversely, the boys are more likely to mutiny with a weak leader; it's a very delicate balance.) +    Some of your decisions will cause branches in the game while others affect the personalities of the characters involved in that particular scene. For example, making a caustic remark to Lola will boost Pinky's toughness but decrease Lola's happiness. (And if she gets too unhappy-well, watch out! Conversely, the boys are more Iikely to mutiny with a weak Ieader; it's a very delicate balance.)

-

Questions and Answers

Why did my losses go down when I adjusted the salaries?

-

   Losses are based on the monthly income minus the salaries you are about to pay out. Whenever you open the ledger, think of it as payday!

+

   Losses are based on the monthly income minus the salaries you are about to pay out. Whenever you open the Iedger, think of it as payday!

Do I ever want my monthly income to be less?

-

   Yes. Your income producing ventures can only yield so much. If you push them too hard they might become unproductive. Also, the more effort you put into one area the less energy and resources you'll have for another.

+

   Yes. Your income producing ventures can only yield so much. If you push them too hard they might become unproductive. Also, the more effort you put into one area the Iess energy and resources you�ll have for another.

How many ways are there to win the game?

-

   There are at least three completely different ways to win The King of Chicago. So keep playing!

-

Why did I lose men after a shootout with Santucci?

-

   Whenever you get into a gun battle with the Southside gang you risk losing a few men. Every time you allow them to get a shot off, you lose a valuable gang member. If there are no more men left in the gang, the next shot will kill Pinky.

+

   There are at Ieast three completely different ways to win The King of Chicago. So keep playing!

+

Why did I Iose men after a shootout with Santucci?

+

   Whenever you get into a gun battle with the Southside gang you risk Iosing a few men. Every time you allow them to get a shot off, you Iose a valuable gang member. If there are no more men Ieft in the gang, the next shot will kill Pinky.

Is there a secret to blowing away the Old Man in his car?

   Yes.

Will the game play by itself?

-

   Yes. Unless you pull down the intermission option the game will take off by itself, (until you do something) making random decisions along the way. So if you pause too long, you may find that the computer takes you off to see Lola, or it might even open the ledger. So keep on your toes and keep moving!

+

   Yes. Unless you pull down the intermission option the game will take off by itself, (until you do something) making random decisions along the way. So if you pause too Iong, you may find that the computer takes you off to see Lola, or it might even open the Iedger. So keep on your toes and keep moving!

Why do l keep getting attacked as I head off on a raid?

-

   When Pinky Ieaves in his car he runs the risk of being followed and attacked by one of Santucci's hoodlum pals. Your odds of being ambushed increase immediately following a successful raid, so it's sometimes helpful to lay low for a turn or two.

+

   When Pinky Ieaves in his car he runs the risk of being followed and attacked by one of Santucci's hoodlum pals. Your odds of being ambushed increase immediately following a successful raid, so it's sometimes helpful to Iay Iow for a turn or two.

What happens if I pull my gun on someone but don't shoot?

-

   There's only one way to find out. The best part about The King of Chicago is that it's full of surprises. So turn down the lights, pop up some popcorn, grab a soda and enjoy!

+

   There's only one way to find out. The best part about The King of Chicago is that it's full of surprises. So turn down the Iights, pop up some popcorn grab a soda and enjoy!

Real Gangsters

-

   Let's go back in time to 12:01 a.m. on January 17, 1920. A nation victorious in war and steeped in idealism embarked on what must be one of history's dumbest effort ever to outlaw sin. It was popularly called the Volstead Act, after a well-intentioned Congressman of the day, and its purpose was to prohibit the manufacture, importation, sale and consumption of booze.

+

   Let's go back in time to 12:01 a.m. on January 17, 1920. A nation victorious in war and steeped in idealism embarked on what must be one of history's dumbest effort ever to outlaw sin. It was popularly called the Volstead Act, after a well-intentioned Congressman of the day, and its purpose was to pro-hibit the manufacture, importation, sale and consumption of booze.

   The King of Chicago back in 1920 was Big Jim Colosimo, a crafty old rascal who owned the cops, the courts, the politicians, and a one-stop shopping center of vice called Colisimo's Cafe on South Wabash Avenue. Despite excited talk of Prohibition opportunities, Big Jim was happy the way things were. He'd fallen madly in love with a 19 year old aspiring opera singer named Dale, who could think of worse fates than wealth. For her, he left his frumpy wife, started polishing his speech and his manners, and eventually brought in his punk nephew from New York, Johnny Torrio, to tend shop while he devoted all his efforts to sex and self-improvement.

-

   Fine, except that Torrio was a man of youth, energy and vision who recognized the wonderful opportunities presented by National Prohibition. That Big Jim couldn't care less presented a problem, but not one lacking a solution. Torrio brought in his own right-hand man, Alphonse Capone, another Brooklyn transplant, who had been policing the Colosimo chain of brothels and otherwise making himself useful. For months the two tried to reason with the old man, but he remained adamantly opposed to any added responsibilities that might cut into his love life. Too bad.

+

   Fine, except that Torrio was a man of youth, energy and vision who recognized the wonderful opportunities presented by National Prohibition. That Big Jim couldn't care less presented a problem, but not one lacking a solution. Torrio brought in his own right-hand man, Alphonse Capone, another Brooklyn transplant, who had been policikng the Colosimo chain of brothels and other-wise making himself useful. For months the two tried to reason with the old man, but he remained adamantly opposed to any added responsibilities that might cut intohis love life. Too bad.

   On the night of March 20, 1920, an unidentified gunman in the vestibule of Colosimo's nightclub fired a pistol shot that sent the King up to that big pleasure palace in the sky.

-

   THE KING IS DEAD! LONG LIVE THE KING! The NEW King that is, Johnny Torrio, ably assisted by brothel bouncer Al, whose paycheck began a meteoric rise from a measly $75 to $2,000 a week by 1922. Torrio was not alone, of course, in recognizing the bountiful rewards that could be reaped from the illegal sale of alcohol. All over the city, street gangs and "social clubs" were discovering that the very fact of being organized permitted a certain amount of profitable mischief--everything from terrorizing unsympathetic voters on behalf of crooked aldermen to shaking down shopkeepers. What better base on which to build a criminal business enterprise?

-

   At first, the demand for illegal booze so outstripped the supply that the various gangs were able to operate in their respective territories without stepping on one another's toes. But the farsighted Torrio knew this couldn't last and (such was his authority as the reigning King of Chicago) he convened a summit meeting that formally carved up Chicago into independent fiefdoms. He and Capone kept the near South Side; the classy North Side went to ward-politician and erstwhile florist Dion O'Banion. A number of smaller gangs subordinated their ethnic rivalries to respect each other's turfs and even cooperated, one handling, say, the alcohol distilling (in which immigrant Sicilian families specialized, whether they wanted to or not) and another the beer-running, with trade agreements between them.

-

   Peace and plenty thus prevailed until 1923 when a former South-Sider, Spike O'Donnell, came home from prison to learn that his faint-hearted siblings had gotten a sliver instead of a slice when the Chicago cake was cut. Led by Spike, the O'Donnells moved in on South Side territory allocated to Frank McErlane and Polack Joe Saltis, and the gangland detante began to crumble. Other transgressions soon occurred, and O'Banion didn't help matters by calling some of Torrio's friends greaseballs. When Torrio discovered that O'Banion not only had swindled him in a brewery deal but had set him up for a bust--and was bragging about it!--- the South Side's patience ran out.

+

   THE KING IS DEAD! LONG LIVE THE KING! The NEW King that is, Johnny Torrio, ably assisted by brothel bouncer Al, whose paycheck began a meteoric rise from a measly $75 to $2,000 a week by 1922. Torrio was not alone, of course, in recognizing the bountiful rewards that could be reaped from the illegl sale of alchohol. All over the city, street gangs and "social clubs" were discovering that the very fact of being organized permitted a certain amount of profitable mischief--everything from terrorizing unsympathetic voters on behalf of crooked aldermen to shaking down shopkeepers. What better base on which to build a criminal business enterprise?

+

   At first, the demand for illegal booze so outstripped the supply that the various gangs were able to operate in their respective territories without stepping on one another's toes. But the farsighted Torrio knew this couldn't last and (such was his authority as the reigning King of Chicago) he convened a summit meeting that formally carved up Chicago into independent fiefdoms. He and Capone kept the near South Side; the classy North Side went to ward-politician and erstwhile florist Dion O'Banion. A number of smaller gangs subordinated their ethnic rivalries to respect each other's turfs and even cooperated, one handling, say, the alchohol distillng (in which immigrant Sicilian families specialized, whether they wanted to or not) and another the beer-running, with trade agreements between them.

   On November 10, 1924, Torrio sent three men to O'Banion's flower shop, ostensibly to buy a floral tribute to a fallen comrade. One took the Irishman's hand in a clasp of friendship (preventing him from reaching a gun) and the other two blasted him six times in what became known as the infamous "handshake murder."

   Assuming control of the North Siders was one irate and vengeful Hymie Weiss whose gunmen, two months later, pumped several bullets into Torrio but failed to kill him. It was enough, however, that Johnny got religion. He took his money and abdicated to New York, leaving the throne to Al Capone.

-

   By the middle of 1925 the fighting had become routine. This was the beginning of the "Battle of Chicago," and in searching for ways to increase their offensive capabilities gang tacticians discovered the Thompson submachine gun. It was a weapon that would alter beer-war combat the way football was revolutionized by the forward pass. There was also a bonus feature: While Chicago and other cities were clamping down on the sale of concealable weapons--namely handguns--the Thompson did not legally fit that definition. And since machine guns before that time were large contraptions of no interest to criminals, no one had thought to prohibit them. Thus, you might not be able to buy a pistol without a lot of trouble and red tape, but you could walk into a well-stocked sporting goods store, plunk down $175 and walk out with a Thompson submachine gun.

-

   The Saltis-McErlane gang introduced the Thompson to modern criminal warfare but proved embarassingly inept with it. Capone, meanwhile, had acquired some of his own and quickly demonstrated that he had the touch. Unfortunately for Capone, submachine guns aren't too specific and one of his victims turned out to be William McSwiggin, a well-known assistant state's attorney newspapers called "the hanging prosecutor". Why McSwiggen was consorting with bootleggers was never to be explained, but the resulting uproar forced the police to raid Capone's new headquarters at Cicero's Hawthorne Hotel where they seized ledgers that would one day contribute to his undoing.

-

   Tommyguns and Chicago gangsters were just about synonymous and the gun had acquired such nicknames as the "Chicago Piano" and the "Chicago Typewriter". Even when called just plain "chopper" it was still considered a Chicago gangster weapon, and if there was any doubt on that point, it vanished on February 14, 1929. St. Valentines Day!

+

   By the middle of 1925 the fighting had become routine. This was the beginning of the "Battle of Chicago," and in searching for ways to increase their offensive capabilities gang tacticians discovered the Thompson submachine gun. It was a weapon that would alter beer-war combat the way football was revolutionized by the forward pass. There was also a bonus feature: While Chicago and other cities were clamping down on the sale of concealable weapons--namely handguns--the Thompson did not legally fit that definition. And since machine guns before that time were large contraptions of no interest to criminals, no one had thought to prohibit them. Thus, you might not be able to buy a pistol without a lot of trouble and red tape, but you could walk into a well-stocked sporting goods store, plunk down $175 and walk out with a Thompson submachine gun.

+

   The Saltis-McErlane gang introduced the Thompson to modern criminal warfare but proved embarassingly inept with it. Capone, meanwhile, had acquired some of his own and quickly demonstrated that he had the touch. Unfortunately for Capone, submachine guns aren't too specific and one of his victims turned out to be William McSwiggin, a well-known assistant state's attorney newspapers called "the hanging prosecutor". Why McSwiggen was consorting with bootleg-gers was never to be explained, but the resulting uproar forced the police to raid Capone's new headquarters at Cicero's Hawthorne Hotel where they seized ledgers that would one day contribute to his undoing.

+

   Tommyguns and Chicago gangsters were just about synonymous and the gun had acquired such nicknames as the "Chicago Piano" and the "Chicago Typewriter". Even when called just plain "chopper" it was still considered a Chicago gangster weapon, and if there was any doublt on that point, it vanished on February 14, 1929. St. Valentines Day!

   If Capone had performed some artful machine-gunnings in the past, the project he had in mind now would be a mural by comparison. It was a sting, of sorts. A truckload of Old Log Cabin whiskey, supposedly hijacked from Capone, was sold to the North Side at an irresistible price and a second truckload was to be delivered to a booze depot called the S.M.C. Cartage Company at 2122 North Clark Street. About 10:30 on that fateful Thursday morning two men dressed in Chicago cop uniforms, followed by two in overcoats, walked into the building and hosed down the seven North Siders inside with a pair of Thompsons. Then they walked back out to a waiting car, of the type used by Chicago police, and drove off.

   Chicago was mortified. The police, who had yet to solve a gangland murder, went into fits of futile investigation. Even citizens who had come to view the back-and-forth warfare between Capone and the North Siders like an underworld series were wondering if mass murder wasn't a bit much. The publisher of the "Chicago Daily News" personally led a mission to the White House in Washington to demand federal intervention.

   As these problems mounted, and with the North Siders apoplectic for revenge, Capone decided the safest place to be was a jail cell in a distant city and deliberately got himself arrested in Philadelphia on a gun-carrying charge.

-

   Then the real disaster struck. On Octover 24, 1931, Capone suffered the everlasting humiliation of being convicted for a non-violent crime... failure to pay his taxes. In shame, he was sentenced to 11 years and shipped off to the Federal Penitentiary in Atlanta, then transferred to Alcatraz just to make the Government look good.

-

   The City of Broad Shoulders was left in desperate need of a stylish, charismatic, and resolute man of Mr. Capone's... ah... caliber.

+

   Then the real disaster struck. On Octover 24, 1931, Capone suffered the everlasting humiliation of being convicted for a non-violent crime....failure to pay his taxes. In shame, he was sentenced to 11 years and shipped off to the Federal Penitentiary in Atlanta, then transferred to Alcatraz just to make the Government look good.

+

   The City of Broad Shoulders was left in desperate need of a stylish, charismatic, and resolute man of Mr. Capone's...ah...caliber.

   There's no denying that Scarface Al Capone is a tough act to follow. But here's your chance to give it a try...

The Scenario

-

   The King of Chicago is an interactive movie that takes you back in time, allowing you to re-write history. The story begins with the fall of Chicago Kingpin, Al Capone, who has just left for an eleven year Alcatraz vacation package, leaving his Southside gane in the grip of devious and dangerous Tony Santucci.

-

-

   You star in the role of Pinky Callahan, a rising mug in the opposing Northside organization. Pinky's tired of the bloody civil war. He wants to force those Southside S.O.B.s out of business and gain total control of the Windy City. Pinky wants to be The King of Chicago...and he'll stop at nothing to get it!

-

   Unfortunately, Pinky is two heads down on the shaky Northside totem pole. First, he'll have to get rid of the Old Man, a crusty old hood who led the gang to defeat during the Capone wars. Ben is the Old Man's chief advisor and stands next in line to fill the vacancy, but Pinky figures he'll step aside... with a little persuasion.

+

   The King of Chicaog is an interactive movie that takes you back in time, allowing you tore-write history. The story begins with the fall of Chicago Kingpin, Al Capone, who has just left for an eleven year Alcatraz vacation package, leaving his Southside gane in the grip of devious and dangerous Tony Santucci.

+

   You star in the role of PINKY CALLAHAN, a rising mug in the opposing Northside organization. Pinky's tired of the bloody civil war. He wants to force those Southside S.O.B.s out of business and gain total control of the Windy City. Pinky wants to be THE KING OF CHICAGO...and he'll stop at nothing to get it!

+

   Unfortunately, Pinky is two heads down on the shaky Northside totem pole. First, he'll have to get rid of the OLD MAN, a crusty old hood who led the gang to defeat during the Capone wars. BEN is the Old Man's chief advisor and stands next in line to fill the vacancy, but Pinky figures he'll step aside...with a little persuasion.

The Movie

-

   The action begins in 1931 and ends in 1934, the year leaders of organized crime held a meeting in New York City to form the national Syndicate. Murder Inc. was established to centralize violence and keep it out of the hands of individual gangs.

+

   The action begins in 1931 and ends in 1934, the year leaders of organize crime held a meeting in New York City to form the national Syndicate. Murder Inc. was established to centralize violence and keep it out of the hands of individual gangs.

   Chicago was considered too barbaric to be admitted as a voting member of the Syndicate.

-

   Here's your chance to re-write history. You have three years to establish such a commanding position in Chicago that gang wars are a thing of the past. If you succeed, an invitation to join the syndicate will be forwarded from New York. The full weight of organized crime will secure your position as the reigning King of Chicago!

-

   THE KING OF CHICAGO is primarily a contest of strategy, both on a territorial and a social level. The personality of your character, and the characters you interact with, will change slightly every time you make a decision. Playing it cool with Lola, for example, will raise your toughness. Threats will become more effective. Gang loyalty will usually go up.

+

   Here's your chance to re-write history. You have three years to establish such a commanding position in Chicago that gang wars are a thing ofthe past. If you succeed, an invitation to join the syndicate will be forwarded from New York. The full weight of organized crime will secure your position as the reigning KING OF CHICAGO!

+

   THE KING OF CHICAGO is primarily a contest of strategy, both on a territorial and a social level. The personality of your character, and the characters you interact with, will change slightly EVERY time you make a decision. Playing it cool with Lola, for example, will raise your toughness. Threats will become more effective. Gang loyalty will usually go up.

   But Lola's happiness will plummet, and that may leave her open to the advances of your archrival Tony Santucci. Your image will be tarnished. The gang may lose respect.

   Remember, you have no friends. and even your allies can turn on you like mad dogs. Learn to use the tools of your trade: violence, threats, bribery, influence, leadership, betrayal, and above all savvy-the knowledge of when to use each tool to its best effect.

   Money can buy loyalty, sometimes. But once you open the well you'd better make sure there's a steady flow.

   Where do you stand with the other gang members? Is Ben with you or against you? You'd better find out.

The Players

-

You play the part of Pinky Callahan

-

   Pinky is smart, good looking, very ambitious... a high roller. He hates the name "Pinky". Begins some contests with a reputation for toughness. Sometimes he is a wimp. He's mixed up with a fiery little hellcat named Lola. Not the kind of girl you want to take home to mother. Loves his Monna but she can't accept the life her boy has chosen to lead. Has a soft spot for his childhood friend, Tom Malone, who is now a cop. Pinky will lie, kill, and double-cross to get to the top. Plans to take control of Chicago by 1934. Figures he'll join the Syndicate to secure his empire.

-

+

You play the part of PINKY CALLAHAN

+

   Pinky is smart, good looking, very ambitious... a high roller. He hates the name "Pinky". Begins some contests with a reputation for toughness. Sometimes he is a wimp. He's mixed up with a fiery little hellcat names Lola. Not the kind of girl you want to take home to mother. Loves his Monna but she can't accept the life her boy has chosen to lead. Has a soft spot for his childhood friend, Tom Malone, who is now a cop. Pinky will lie, kill, and double-cross to get to the top. Plans to take control of Chicago by 1934. Figures he'll join the Syndicate to secure his empire.

BEN

-

   Crafty, devious. More intelligent than ambitious. Has been with the Northside for years. Can be a good advisor if he's treated well. Treat him badly and he can arrange to have your throat cut. Doesn't really like violence and is a coward in action. Looks tough though, and won't hesitate to make threats.

+

   Crafty, devious. More intelligent than ambitious. Has been with the Northside for years. CAN be a good advisor if he's treated well. Treat him badly and he can arrange to have your throat cut. Doesn't really like violence and is a coward in action. LOOKS tough though, and won't hesitate to make threats.

OLD MAN

-

   Never much of a leader. Capone ground him into the dirt like an old cigar butt. He's weak and cautious from a career of watching the Southside gang roll over his Northside. Too old to take advantage of the temporary turmoil created by Capone's departure. Sometimes he can be talked into retirement. Sometimes he'll fight your attempted coup like the plague. Considers Ben his rightful heir.

+

   Never much of a leader. Capone ground him into the dirt like an old cigar butt. He's weak and cautious from a career of watching the Southside gang roll over his Northside. Too old to take advantage of the termporary turmoil created by Capone's departure. Sometimes he can be talked into retirement. Sometimes he'll fight your attempted coup like the plague. Considers Ben his rightful heir.

LOLA

-

   Bitchy, flashy...typical gangster moll. Wants to be a singer. Has big ambitions for Pinky but she fights with him constantly. Claims he doesn't spend enough time with her...or money on her. Can be dangerous if mistreated. On the other hand, if Pinky lays down for her the gang may decide to elect a leader with more backbone. And they vote with their bullets.

+

   Bitchy, flashy...typical gangster moll. Wants to be a singer. Has big ambitions for Pinky but she fights with him constantly. Claims he doesn't spend enough time with her...or money ON her. Can be dangerous if mistreated. On the other hand, if Pinky lays down for her the gang may decide to elect a leader with more backbone. Aney they vote with their bullets.

BULL

-

   A thickheaded thug with a heart of, if not solid gold, at least plated gold. He's loyal to whoever is in power. Loves following orders but doesn't enjoy killing. Apologizes to anyone he has to bump off.

+

   A thickheaded thug with a heart of, if not solid gold, at least PLATED gold. He's loyal to whoever is in power. Loves following orders but doesn't enjoy killing. Apologizes to anyone he has to bump off.

TOM MALONE

   A Boy Scout with a badge. Rests his cap on a golden halo. Grew up with Pinky but won't bend the law for him. Likes to think of himself as a human vacuum cleaner, sucking up the dirt of humanity.

PEEPERS

   One of the Northside boys. Likes to complain. May have to be watched. He likees to hang around with Bull and may have some influence on him. Sometimes he will back the Old Man at the beginning of the game. Sometimes he won't.

TONY SANTUCCI

-

   Tony is Capone's heir. He's devious. Despicable. And one mean SOB. He isn't as generous as Capone, nor is he as good at PR. Tries to centralize power in his own hands and this leaves openings for expanding the Northside turf. He's tricky in business dealings but this can be used against him.

+

   Tony is Capone's heir. He's devious. Despicable. And one mean S.O.B. He isn't as generous as Capone, nor is he as good at PR. Tries to centralize power in his own hands and this leaves openings for expanding the Northside turf. He's tricky in business dealings but this can be used against him.

GUIDO

-

   Tony's sidekick. Nervous, trigger-happy, a clod. He's the Southside yes man. Unfortunately, it's about the only word in his vocabulary. Could play a major role in Tony's fall from power.

+

   Tony's sidekick. Nervous, trigger-happy, a clod. He's the Southside YES man. Unfortunately, it's about the only word in his vocabulary. COULD play a major role in Tony's fall from power.

JAKE

   A mystery man. Plays many different roles. Sometimes he's a hired gun. Sometimes he only has a minor part. No political ties to North or South.

MOMMA

diff --git a/TargetSpecific/koc/Resources/html/images/picture1.png b/TargetSpecific/koc/Resources/html/images/picture1.png deleted file mode 100644 index 353e6bf..0000000 Binary files a/TargetSpecific/koc/Resources/html/images/picture1.png and /dev/null differ diff --git a/TargetSpecific/koc/Resources/html/images/picture2.png b/TargetSpecific/koc/Resources/html/images/picture2.png deleted file mode 100644 index 186e675..0000000 Binary files a/TargetSpecific/koc/Resources/html/images/picture2.png and /dev/null differ diff --git a/TargetSpecific/koc/Resources/html/images/picture3.png b/TargetSpecific/koc/Resources/html/images/picture3.png deleted file mode 100644 index 8219f45..0000000 Binary files a/TargetSpecific/koc/Resources/html/images/picture3.png and /dev/null differ diff --git a/TargetSpecific/koc/Resources/html/images/picture4.png b/TargetSpecific/koc/Resources/html/images/picture4.png deleted file mode 100644 index 159b671..0000000 Binary files a/TargetSpecific/koc/Resources/html/images/picture4.png and /dev/null differ diff --git a/TargetSpecific/koc/Resources/html/images/picture5.png b/TargetSpecific/koc/Resources/html/images/picture5.png deleted file mode 100644 index 4398f72..0000000 Binary files a/TargetSpecific/koc/Resources/html/images/picture5.png and /dev/null differ diff --git a/TargetSpecific/koc/control-layout.json b/TargetSpecific/koc/control-layout.json index ee59e06..c79c27e 100644 --- a/TargetSpecific/koc/control-layout.json +++ b/TargetSpecific/koc/control-layout.json @@ -1,25 +1,25 @@ { "iphone" : { "options" : { - "preferredStick": "disabled" + "preferredStick": "fixed" }, "actions" : [ { "action": "clear" }, { - "action": "add", "type": "MouseButtonLeft", - "options": { "image": "firebutton-red", "center": "{30, 30}", "alpha": 0.50 } + "action": "add", "type": "JoyButton", + "options": { "image": "firebutton-red", "center": "{35, 240}", "alpha": 0.50 } } ] }, "ipad" : { "options" : { - "preferredStick": "disabled" + "preferredStick": "fixed" }, "actions" : [ { "action": "clear" }, { - "action": "add", "type": "MouseButtonLeft", - "options": { "image": "firebutton-red", "center": "{50, 50}", "alpha": 0.50 } + "action": "add", "type": "JoyButton", + "options": { "image": "firebutton-red", "center": "{60, 630}", "alpha": 0.50 } } ] } diff --git a/TargetSpecific/koc/icon-72@2x.png b/TargetSpecific/koc/icon-72@2x.png deleted file mode 100644 index 98b6921..0000000 Binary files a/TargetSpecific/koc/icon-72@2x.png and /dev/null differ diff --git a/TargetSpecific/koc/info.plist b/TargetSpecific/koc/info.plist index 913ae79..089aa32 100644 --- a/TargetSpecific/koc/info.plist +++ b/TargetSpecific/koc/info.plist @@ -14,26 +14,9 @@ icon.png icon@2x.png icon-72.png - icon-72@2x.png - CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - icon - icon.png - icon@2x.png - icon-72.png - icon-72@2x.png - - UIPrerenderedIcon - - - CFBundleIdentifier - com.cinemaware.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TargetSpecific/lrs/info.plist b/TargetSpecific/lrs/info.plist index 8675f5c..0e03301 100644 --- a/TargetSpecific/lrs/info.plist +++ b/TargetSpecific/lrs/info.plist @@ -16,7 +16,7 @@ icon-72.png CFBundleIdentifier - com.cinemaware.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TargetSpecific/sdi/EmulationView-iPad.m b/TargetSpecific/sdi/EmulationView-iPad.m index 4b48c97..bfc4b57 100644 --- a/TargetSpecific/sdi/EmulationView-iPad.m +++ b/TargetSpecific/sdi/EmulationView-iPad.m @@ -32,6 +32,7 @@ - (void)dealloc { [mouseHandler release]; [webView release]; [restartButton release]; + [_btnSettings release]; [super dealloc]; } diff --git a/TargetSpecific/sdi/EmulationView-iPhone.m b/TargetSpecific/sdi/EmulationView-iPhone.m index 080d051..af4fd9b 100644 --- a/TargetSpecific/sdi/EmulationView-iPhone.m +++ b/TargetSpecific/sdi/EmulationView-iPhone.m @@ -34,6 +34,7 @@ - (void)dealloc { [closeButton release]; [menuButton release]; [restartButton release]; + [_joyController release]; [super dealloc]; } diff --git a/TargetSpecific/sdi/info.plist b/TargetSpecific/sdi/info.plist index 5fc5c41..0151f38 100644 --- a/TargetSpecific/sdi/info.plist +++ b/TargetSpecific/sdi/info.plist @@ -16,7 +16,7 @@ icon-72.png CFBundleIdentifier - com.cinemaware.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/TargetSpecific/sinbad/EmulationView-iPad.xib b/TargetSpecific/sinbad/EmulationView-iPad.xib index 9fbb4f9..42b8cd1 100644 --- a/TargetSpecific/sinbad/EmulationView-iPad.xib +++ b/TargetSpecific/sinbad/EmulationView-iPad.xib @@ -1,660 +1,108 @@ - - - - 1280 - 11A511 - 1891 - 1138 - 566.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 884 - - - YES - IBUIWebView - IBUIButton - IBUIImageView - IBUIView - IBProxyObject - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - - 292 - - YES - - - 274 - {1024, 768} - - - - - 3 - MCAwAA - - NO - NO - IBIPadFramework - - - - -2147483355 - - YES - - - 256 - {989, 580} - - - - NO - YES - 4 - YES - IBIPadFramework - - NSImage - bg_web~ipad.png - - - - - 292 - {{24, 0}, {940, 540}} - - - - - NO - NO - IBIPadFramework - - - {{18, -580}, {989, 580}} - - - - - NO - IBIPadFramework - - - - 256 - {1024, 75} - - - - - NO - YES - 4 - YES - IBIPadFramework - - NSImage - chrome-top~ipad.png - - - - - 292 - {{20, 6}, {45, 47}} - - - - NO - IBIPadFramework - 0 - 0 - - 3 - MQA - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - 3 - MC41AA - - - NSImage - btn_restart~ipad.png - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 292 - {{959, 6}, {45, 47}} - - - - NO - IBIPadFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - btn_close~ipad.png - - - - - - - 292 - {{959, 6}, {45, 47}} - - - - NO - IBIPadFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - - NSImage - btn_menu~ipad.png - - - - - - - 266 - {{0, 684}, {1024, 84}} - - - NO - YES - 4 - YES - IBIPadFramework - - NSImage - chrome-bottom~ipad.png - - - - {1024, 768} - - - - - 3 - MQA - - 2 - - - NO - - 3 - 3 - - IBIPadFramework - - - - - YES - - - view - - - - 3 - - - - menuButton - - - - 10 - - - - showMenu: - - - 7 - - 11 - - - - closeButton - - - - 14 - - - - hideMenu: - - - 7 - - 15 - - - - menuView - - - - 18 - - - - mouseHandler - - - - 19 - - - - webView - - - - 21 - - - - restart: - - - 7 - - 22 - - - - restartButton - - - - 23 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - - - - - - 4 - - - YES - - - Mouse handler - - - 6 - - - - - 7 - - - - - 8 - - - Reset button - - - 9 - - - Menu button - - - 12 - - - Close button - - - 16 - - - YES - - - - - Web handler - - - 17 - - - - - 20 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 12.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 2.IBPluginDependency - 2.IBUserGuides - 20.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPad - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 60 - 1 - - - - 700 - 1 - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 23 - - - - YES - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DOTCEmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/DOTCEmulationViewController.h - - - - EmulationViewiPad - DOTCEmulationViewController - - YES - - YES - hideMenu: - showMenu: - - - YES - id - id - - - - YES - - YES - hideMenu: - showMenu: - - - YES - - hideMenu: - id - - - showMenu: - id - - - - - YES - - YES - closeButton - menuButton - menuView - mouseHandler - webView - - - YES - UIButton - UIButton - UIView - UIView - UIWebView - - - - YES - - YES - closeButton - menuButton - menuView - mouseHandler - webView - - - YES - - closeButton - UIButton - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPad.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - bg_web~ipad.png - btn_close~ipad.png - btn_menu~ipad.png - btn_restart~ipad.png - chrome-bottom~ipad.png - chrome-top~ipad.png - - - YES - {989, 580} - {46, 47} - {45, 47} - {45, 47} - {1024, 84} - {1024, 75} - - - 884 - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TargetSpecific/sinbad/EmulationView-iPhone.xib b/TargetSpecific/sinbad/EmulationView-iPhone.xib index 0329e71..932b29e 100644 --- a/TargetSpecific/sinbad/EmulationView-iPhone.xib +++ b/TargetSpecific/sinbad/EmulationView-iPhone.xib @@ -1,33 +1,30 @@ - + - 1280 - 11A511 - 1891 - 1138 - 566.00 + 1792 + 14A389 + 6250 + 1343.14 + 755.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 884 + 6244 - - YES - IBUIWebView + + IBProxyObject IBUIButton IBUIImageView IBUIView - IBProxyObject - - - YES + IBUIWebView + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + PluginDependencyRecalculationVersion - - YES + IBFilesOwner IBCocoaTouchFramework @@ -37,16 +34,14 @@ IBCocoaTouchFramework - + 274 - - YES + 256 {480, 18} - NO YES @@ -61,14 +56,12 @@ -2147483356 - - YES + 290 {480, 320} - YES 4 @@ -84,7 +77,6 @@ 274 {480, 320} - 3 MCAwAA @@ -93,10 +85,9 @@ NO IBCocoaTouchFramework - + {{0, 275}, {480, 320}} - 3 @@ -105,10 +96,6 @@ 2 - - 3 - 3 - IBCocoaTouchFramework @@ -116,7 +103,6 @@ 274 {480, 320} - NO @@ -126,14 +112,12 @@ 290 - - YES + 256 {480, 53} - NO YES @@ -153,20 +137,19 @@ 292 {{10, 17}, {27, 28}} - NO IBCocoaTouchFramework 0 0 - - 3 - MQA - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + 3 + MQA + 3 MC41AA @@ -192,17 +175,16 @@ -2147483356 {{441, 17}, {27, 28}} - NO IBCocoaTouchFramework 0 0 - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage @@ -216,17 +198,16 @@ 292 {{441, 17}, {27, 28}} - NO IBCocoaTouchFramework 0 0 - 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + NSImage @@ -235,20 +216,17 @@ - + {{0, 267}, {480, 53}} - NO NO IBCocoaTouchFramework - + {480, 320} - - NO @@ -256,12 +234,15 @@ 3 3 + + IBUISimulatedFreeformSizeMetricsSentinel + Freeform + IBCocoaTouchFramework - + - - YES + view @@ -270,15 +251,6 @@ 7 - - - showMenu: - - - 7 - - 10 - menuView @@ -311,15 +283,6 @@ 20 - - - hideMenu: - - - 7 - - 23 - closeButton @@ -336,6 +299,14 @@ 25 + + + restartButton + + + + 27 + restart: @@ -346,35 +317,41 @@ 26 - - restartButton - - + + showMenu: + + + 7 - 27 + 10 - + + + hideMenu: + + + 7 + + 23 + + - - YES + 0 - - YES - + 1 - - YES + - + @@ -403,11 +380,10 @@ 13 - - YES + - + Web handler @@ -424,13 +400,12 @@ 18 - - YES + - + Bottom Bar @@ -458,248 +433,56 @@ Close - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 1.IBPluginDependency - 1.IBUserGuides - 11.CustomClassName - 11.IBPluginDependency - 13.IBPluginDependency - 14.IBPluginDependency - 15.IBPluginDependency - 18.IBPluginDependency - 21.IBPluginDependency - 3.IBPluginDependency - 4.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - EmulationViewiPhone - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 284 - 1 - - - TouchHandlerView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - + + + EmulationViewiPhone + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + 284 + 1 + + + TouchHandlerView + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + - - YES - - - + 27 - - - YES - - BaseEmulationViewController - UIViewController - - IBProjectSource - ./Classes/BaseEmulationViewController.h - - - - DOTCEmulationViewController - BaseEmulationViewController - - restart: - id - - - restart: - - restart: - id - - - - IBProjectSource - ./Classes/DOTCEmulationViewController.h - - - - EmulationViewiPhone - DOTCEmulationViewController - - YES - - YES - hideMenu: - showMenu: - - - YES - id - id - - - - YES - - YES - hideMenu: - showMenu: - - - YES - - hideMenu: - id - - - showMenu: - id - - - - - YES - - YES - bottomBar - closeButton - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - UIView - UIButton - UIButton - UIView - UIView - UIButton - UIWebView - - - - YES - - YES - bottomBar - closeButton - menuButton - menuView - mouseHandler - restartButton - webView - - - YES - - bottomBar - UIView - - - closeButton - UIButton - - - menuButton - UIButton - - - menuView - UIView - - - mouseHandler - UIView - - - restartButton - UIButton - - - webView - UIWebView - - - - - IBProjectSource - ./Classes/EmulationViewiPhone.h - - - - TouchHandlerView - UIView - - IBProjectSource - ./Classes/TouchHandlerView.h - - - - + 0 IBCocoaTouchFramework + NO com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - + YES 3 - - YES - - YES - bg_web.png - btn_close.png - btn_menu.png - btn_restart.png - chrome-bottom.png - chrome-top.png - - - YES - {480, 320} - {27, 28} - {27, 28} - {27, 28} - {480, 53} - {480, 18} - - - 884 + + {480, 320} + {27, 28} + {27, 28} + {27, 28} + {480, 53} + {480, 18} + diff --git a/TargetSpecific/sinbad/info.plist b/TargetSpecific/sinbad/info.plist index 3b6ff78..a55c859 100644 --- a/TargetSpecific/sinbad/info.plist +++ b/TargetSpecific/sinbad/info.plist @@ -16,7 +16,7 @@ icon-72.png CFBundleIdentifier - com.cinemaware.${PRODUCT_NAME:identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/iAmiga.xcodeproj/project.pbxproj b/iUAE.xcodeproj/project.pbxproj old mode 100755 new mode 100644 similarity index 80% rename from iAmiga.xcodeproj/project.pbxproj rename to iUAE.xcodeproj/project.pbxproj index e4af5a4..b3a8352 --- a/iAmiga.xcodeproj/project.pbxproj +++ b/iUAE.xcodeproj/project.pbxproj @@ -9,21 +9,16 @@ /* Begin PBXBuildFile section */ 0504155C0FCB46F000F46828 /* EmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504155B0FCB46F000F46828 /* EmulationViewController.mm */; }; 050415610FCB475C00F46828 /* InputControllerView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504155E0FCB475C00F46828 /* InputControllerView.mm */; }; - 050415620FCB475C00F46828 /* JoystickViewLandscape.mm in Sources */ = {isa = PBXBuildFile; fileRef = 050415600FCB475C00F46828 /* JoystickViewLandscape.mm */; }; - 0504156B0FCB4BD400F46828 /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 0504156B0FCB4BD400F46828 /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 0506D73913CA7BF700559637 /* OldLondon.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0506D73713CA7BF700559637 /* OldLondon.ttf */; }; 0506D73A13CA7BF700559637 /* gpl.html in Resources */ = {isa = PBXBuildFile; fileRef = 0506D73813CA7BF700559637 /* gpl.html */; }; - 05084E4A13D7FE7B0004617A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; 050C393D12C31B24000CE512 /* Disa.c in Sources */ = {isa = PBXBuildFile; fileRef = 050C393B12C31B24000CE512 /* Disa.c */; }; 050C3A9412C33D94000CE512 /* disassembler.m in Sources */ = {isa = PBXBuildFile; fileRef = 050C3A9312C33D94000CE512 /* disassembler.m */; }; 051B23B012C994BB000C2800 /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; - 053368C513B1DEE90012D55A /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 053368C613B1DEE90012D55A /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 053368EC13B1DEE90012D55A /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 0533690113B1DEE90012D55A /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; 0533690513B1DEE90012D55A /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 0533690613B1DEE90012D55A /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 0533690713B1DEE90012D55A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 0533690713B1DEE90012D55A /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 0533690913B1DEE90012D55A /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 0533690A13B1DEE90012D55A /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 0533690B13B1DEE90012D55A /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -32,13 +27,11 @@ 0533690E13B1DEE90012D55A /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 0533690F13B1DEE90012D55A /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 0533691013B1DEE90012D55A /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 0533691113B1DEE90012D55A /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 0533691213B1DEE90012D55A /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 0533691313B1DEE90012D55A /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 0533691413B1DEE90012D55A /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 0533691513B1DEE90012D55A /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 0533691613B1DEE90012D55A /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 0533691713B1DEE90012D55A /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 0533691813B1DEE90012D55A /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 0533691913B1DEE90012D55A /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 0533691A13B1DEE90012D55A /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -46,9 +39,9 @@ 0533691C13B1DEE90012D55A /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 0533691D13B1DEE90012D55A /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 0533691E13B1DEE90012D55A /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 0533692213B1DEE90012D55A /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 0533692213B1DEE90012D55A /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 0533692313B1DEE90012D55A /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; - 0533692413B1DEE90012D55A /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; + 0533692413B1DEE90012D55A /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 0533692513B1DEE90012D55A /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; 0533692613B1DEE90012D55A /* Events2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0545257D106EBB590032FC41 /* Events2.c */; }; 0533692713B1DEE90012D55A /* combined_modules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 054525AF106EC5550032FC41 /* combined_modules.cpp */; }; @@ -61,15 +54,12 @@ 0533694A13B1DEE90012D55A /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C0E412DED4DF0040B77D /* CFNetwork.framework */; }; 0533694B13B1DEE90012D55A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C1C412DFF3610040B77D /* OpenGLES.framework */; }; 0533694C13B1DEE90012D55A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C1D712DFF3910040B77D /* QuartzCore.framework */; }; - 0533695313B1DF500012D55A /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 0533695413B1DF580012D55A /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 0533695513B1DF5C0012D55A /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 0533695613B1DF5F0012D55A /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; 0533695713B1DF650012D55A /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 053D8B3213B1B9E20002802F /* icon-72.png */; }; 0533695813B1DF650012D55A /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 053D8B3313B1B9E20002802F /* icon.png */; }; 0533695913B1DF650012D55A /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 053D8B3413B1B9E20002802F /* icon@2x.png */; }; 0545257E106EBB590032FC41 /* Events2.c in Sources */ = {isa = PBXBuildFile; fileRef = 0545257D106EBB590032FC41 /* Events2.c */; }; - 054525B0106EC5550032FC41 /* combined_modules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 054525AF106EC5550032FC41 /* combined_modules.cpp */; }; 0552BD240F3D797C005B30DF /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 0552BD250F3D797C005B30DF /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 0552BD260F3D797C005B30DF /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -78,13 +68,11 @@ 0552BD2D0F3D797C005B30DF /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 0552BD2E0F3D797C005B30DF /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 0552BD410F3D797C005B30DF /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 0552BD450F3D797C005B30DF /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 0552BD470F3D797C005B30DF /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 0552BD490F3D797C005B30DF /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 0552BD4B0F3D797C005B30DF /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 0552BD4C0F3D797C005B30DF /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 0552BD4E0F3D797C005B30DF /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 0552BD4F0F3D797C005B30DF /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 0552BD500F3D797C005B30DF /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 0552BD510F3D797C005B30DF /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 0552BD540F3D797C005B30DF /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -108,33 +96,22 @@ 055FD7F013B3FB0900BB3F8B /* EmulationView-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 055FD7EE13B3FB0900BB3F8B /* EmulationView-iPad.xib */; }; 055FD7F313B4029900BB3F8B /* bg_web.png in Resources */ = {isa = PBXBuildFile; fileRef = 055FD7F113B4029900BB3F8B /* bg_web.png */; }; 055FD7F413B4029900BB3F8B /* bg_web@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 055FD7F213B4029900BB3F8B /* bg_web@2x.png */; }; - 055FD7F913B45AAA00BB3F8B /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; + 055FD7F913B45AAA00BB3F8B /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 056089BE13C2366000677A6C /* iscroll4.js in Resources */ = {isa = PBXBuildFile; fileRef = 056089BA13C235F200677A6C /* iscroll4.js */; }; - 05619EDB13ADE1AA00341DB0 /* SelectHardware.m in Sources */ = {isa = PBXBuildFile; fileRef = 05619ED913ADE1AA00341DB0 /* SelectHardware.m */; }; - 05619EDC13ADE1AA00341DB0 /* SelectHardware.xib in Resources */ = {isa = PBXBuildFile; fileRef = 05619EDA13ADE1AA00341DB0 /* SelectHardware.xib */; }; 05743FC50FC293FD003BE251 /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; - 057440D60FC2A4A7003BE251 /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 0574432A0FC3C94F003BE251 /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; 0577C0DB12DED4A60040B77D /* AsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = 0577C0DA12DED4A60040B77D /* AsyncSocket.m */; }; 0577C0E512DED4DF0040B77D /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C0E412DED4DF0040B77D /* CFNetwork.framework */; }; 0577C0F912DED4FD0040B77D /* UaeDebugger.m in Sources */ = {isa = PBXBuildFile; fileRef = 0577C0F812DED4FD0040B77D /* UaeDebugger.m */; }; 0577C1C512DFF3610040B77D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C1C412DFF3610040B77D /* OpenGLES.framework */; }; 0577C1D812DFF3910040B77D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C1D712DFF3910040B77D /* QuartzCore.framework */; }; - 0577C34E12E1723F0040B77D /* Scanlines (50%).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34712E1723F0040B77D /* Scanlines (50%).png */; }; - 0577C34F12E1723F0040B77D /* Scanlines (100%).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34812E1723F0040B77D /* Scanlines (100%).png */; }; - 0577C35012E1723F0040B77D /* Aperture (1x2 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34912E1723F0040B77D /* Aperture (1x2 RB).png */; }; - 0577C35112E1723F0040B77D /* Aperture (1x3 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34A12E1723F0040B77D /* Aperture (1x3 RB).png */; }; - 0577C35212E1723F0040B77D /* Aperture (2x4 BG).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34B12E1723F0040B77D /* Aperture (2x4 BG).png */; }; - 0577C35312E1723F0040B77D /* Aperture (2x4 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34C12E1723F0040B77D /* Aperture (2x4 RB).png */; }; - 0577C35412E1723F0040B77D /* Aperture (4x6).png in Resources */ = {isa = PBXBuildFile; fileRef = 0577C34D12E1723F0040B77D /* Aperture (4x6).png */; }; 05789FB913B1436200A72F5F /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; 057B0D4C0FD0D0ED00D549AD /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 057B26A513B30CB4006BB230 /* chrome-bottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B26A113B30CB4006BB230 /* chrome-bottom.png */; }; 057B26A613B30CB4006BB230 /* chrome-bottom@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B26A213B30CB4006BB230 /* chrome-bottom@2x.png */; }; 057B26A713B30CB4006BB230 /* chrome-top.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B26A313B30CB4006BB230 /* chrome-top.png */; }; 057B26A813B30CB4006BB230 /* chrome-top@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B26A413B30CB4006BB230 /* chrome-top@2x.png */; }; - 057B26B513B325AB006BB230 /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 057B26B613B326A0006BB230 /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; + 057B26B513B325AB006BB230 /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 057B26B613B326A0006BB230 /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; 057B977113CEC7D60065278D /* intro_1~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B976B13CEC7D60065278D /* intro_1~ipad.png */; }; 057B977213CEC7D60065278D /* intro_2~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B976C13CEC7D60065278D /* intro_2~ipad.png */; }; 057B977313CEC7D60065278D /* intro_3~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B976D13CEC7D60065278D /* intro_3~ipad.png */; }; @@ -142,18 +119,14 @@ 057B977513CEC7D60065278D /* intro_4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B976F13CEC7D60065278D /* intro_4@2x.png */; }; 057B977613CEC7D60065278D /* intro_4~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 057B977013CEC7D60065278D /* intro_4~ipad.png */; }; 058063D013B06DD800E00B04 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 058063CF13B06DD800E00B04 /* Icon-72.png */; }; - 0583DE5812D1A3AC000E97CE /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; - 0585D55F1091640900C1E4C1 /* VirtualKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 0585D55E1091640900C1E4C1 /* VirtualKeyboard.m */; }; 0585D5621091653E00C1E4C1 /* KeyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0585D5611091653E00C1E4C1 /* KeyView.m */; }; - 059A411D12697B33003B23C7 /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 059A411C12697B33003B23C7 /* MainWindow-iPad.xib */; }; 059C0E2913B99DEE00E89B35 /* bg_web~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 059C0E2313B99DEE00E89B35 /* bg_web~ipad.png */; }; 059C0E2A13B99DEE00E89B35 /* btn_close~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 059C0E2413B99DEE00E89B35 /* btn_close~ipad.png */; }; 059C0E2B13B99DEE00E89B35 /* btn_menu~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 059C0E2513B99DEE00E89B35 /* btn_menu~ipad.png */; }; 059C0E2C13B99DEE00E89B35 /* btn_restart~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 059C0E2613B99DEE00E89B35 /* btn_restart~ipad.png */; }; 059C0E2D13B99DEE00E89B35 /* chrome-bottom~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 059C0E2713B99DEE00E89B35 /* chrome-bottom~ipad.png */; }; 059C0E2E13B99DEE00E89B35 /* chrome-top~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 059C0E2813B99DEE00E89B35 /* chrome-top~ipad.png */; }; - 059E3A2710636CBA0056A577 /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; - 059E3A2810636CBA0056A577 /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; + 059E3A2710636CBA0056A577 /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 05A1502913BDA852009A12B2 /* about.html in Resources */ = {isa = PBXBuildFile; fileRef = 05A1501E13BDA852009A12B2 /* about.html */; }; 05A1502B13BDA852009A12B2 /* css in Resources */ = {isa = PBXBuildFile; fileRef = 05A1502013BDA852009A12B2 /* css */; }; 05A1502D13BDA852009A12B2 /* help.html in Resources */ = {isa = PBXBuildFile; fileRef = 05A1502213BDA852009A12B2 /* help.html */; }; @@ -174,32 +147,118 @@ 05BC1AF51073448200EABC6E /* EMUBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 05BC1AED1073448200EABC6E /* EMUBrowser.m */; }; 05BC1AF61073448200EABC6E /* EMUFileGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 05BC1AEF1073448200EABC6E /* EMUFileGroup.m */; }; 05BC1AF71073448200EABC6E /* EMUFileInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 05BC1AF11073448200EABC6E /* EMUFileInfo.m */; }; - 05BC1AF81073448200EABC6E /* EMUROMBrowserView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 05BC1AF21073448200EABC6E /* EMUROMBrowserView.xib */; }; 05BC1AF91073448200EABC6E /* EMUROMBrowserViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05BC1AF41073448200EABC6E /* EMUROMBrowserViewController.mm */; }; 05BC1B17107348E500EABC6E /* keys.png in Resources */ = {isa = PBXBuildFile; fileRef = 05BC1B15107348E500EABC6E /* keys.png */; }; 05BC1B18107348E500EABC6E /* VKBD.PNG in Resources */ = {isa = PBXBuildFile; fileRef = 05BC1B16107348E500EABC6E /* VKBD.PNG */; }; - 05BC1B1D10734C3B00EABC6E /* SettingsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05BC1B1B10734C3B00EABC6E /* SettingsController.mm */; }; - 05BC1B1E10734C3B00EABC6E /* SettingsController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 05BC1B1C10734C3B00EABC6E /* SettingsController.xib */; }; - 05D5233712E8030E007912AE /* SelectEffectController.m in Sources */ = {isa = PBXBuildFile; fileRef = 05D5233512E8030E007912AE /* SelectEffectController.m */; }; - 05D5233812E8030E007912AE /* SelectEffectController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 05D5233612E8030E007912AE /* SelectEffectController.xib */; }; - 05D5D74C0FD5E38400B91C98 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; + 05D5233712E8030E007912AE /* SelectEffectController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05D5233512E8030E007912AE /* SelectEffectController.mm */; }; 05D6044B12AF2D620048E478 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 05D6044912AF2D620048E478 /* Icon.png */; }; 05D6044C12AF2D620048E478 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 05D6044A12AF2D620048E478 /* Icon@2x.png */; }; 05E8A04612B2C884005532AF /* amiga-beige-dark-center.png in Resources */ = {isa = PBXBuildFile; fileRef = 05E8A04312B2C884005532AF /* amiga-beige-dark-center.png */; }; 05E8A04712B2C884005532AF /* amiga-beige-dark-left.png in Resources */ = {isa = PBXBuildFile; fileRef = 05E8A04412B2C884005532AF /* amiga-beige-dark-left.png */; }; 05E8A04812B2C884005532AF /* amiga-beige-dark-right.png in Resources */ = {isa = PBXBuildFile; fileRef = 05E8A04512B2C884005532AF /* amiga-beige-dark-right.png */; }; 05E8A04A12B2C8E9005532AF /* amiga-beige-dark.png in Resources */ = {isa = PBXBuildFile; fileRef = 05E8A04912B2C8E9005532AF /* amiga-beige-dark.png */; }; - 05F5F218112A54F1001530EC /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 05FE7F280FC3EDBF00DBFECF /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; 1D3623260D0F684500981E51 /* iAmigaAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* iAmigaAppDelegate.mm */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589B0D05DD56006BFB54 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; - 9706D6541561817500073678 /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 9706D6551561817500073678 /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 9706D6561561817500073678 /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; + 7E079CC11A81594B00EC0DE4 /* AddConfigurationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E079CC01A81594B00EC0DE4 /* AddConfigurationViewController.mm */; }; + 7E0E9594198ACF4C0082F80F /* iOSKeyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E0E9593198ACF4C0082F80F /* iOSKeyboard.png */; }; + 7E10738B1A34E85E000D7269 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7E10738A1A34E85E000D7269 /* Storyboard.storyboard */; }; + 7E1B8C3D19FADFD400B6136B /* modejoy.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1B8C3319FADFD400B6136B /* modejoy.png */; }; + 7E1B8C3F19FADFD400B6136B /* modejoypressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1B8C3519FADFD400B6136B /* modejoypressed.png */; }; + 7E1B8C4119FADFD400B6136B /* modekeyoff.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1B8C3719FADFD400B6136B /* modekeyoff.png */; }; + 7E1B8C4319FADFD400B6136B /* modekeyon.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1B8C3919FADFD400B6136B /* modekeyon.png */; }; + 7E1B8C4519FADFD400B6136B /* options.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1B8C3B19FADFD400B6136B /* options.png */; }; + 7E1B8C4D19FAE04700B6136B /* unsticky.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E1B8C4919FAE04700B6136B /* unsticky.png */; }; + 7E21F5C41A3F784E000D9AD2 /* gamepad_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E21F5C31A3F784E000D9AD2 /* gamepad_selected.png */; }; + 7E2665531C483AEB004250D1 /* monitor_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E2665501C483AEB004250D1 /* monitor_unselected.png */; }; + 7E2665541C483AEB004250D1 /* monitor_selected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E2665511C483AEB004250D1 /* monitor_selected_svg.svg */; }; + 7E2665551C483AEB004250D1 /* monitor_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E2665521C483AEB004250D1 /* monitor_selected.png */; }; + 7E27C39C1AA3A61900C00584 /* display.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E27C39B1AA3A61900C00584 /* display.png */; }; + 7E27C39F1AA3A6D300C00584 /* SettingsDisplayController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E27C39E1AA3A6D300C00584 /* SettingsDisplayController.mm */; }; + 7E2A59B11B052C3300C802E0 /* SettingsJoypadController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E2A59B01B052C3300C802E0 /* SettingsJoypadController.mm */; }; + 7E2EF0DD1D004B9500CDD9B9 /* iUAEApplication.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E2EF0DC1D004B9500CDD9B9 /* iUAEApplication.mm */; }; + 7E3C13E51A51F16600534164 /* SettingsGeneralController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E3C13E41A51F16600534164 /* SettingsGeneralController.mm */; }; + 7E43484F1A3B7C6100C60BF1 /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E43484E1A3B7C6100C60BF1 /* keyboard.png */; }; + 7E4B18D5188B1C720019E82B /* chrome-bottom.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18D4188B1C720019E82B /* chrome-bottom.png */; }; + 7E4B18D8188B1CAB0019E82B /* chrome-top@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18D6188B1CAB0019E82B /* chrome-top@2x.png */; }; + 7E4B18D9188B1CAB0019E82B /* chrome-top~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18D7188B1CAB0019E82B /* chrome-top~ipad.png */; }; + 7E4B18DB188B1CBE0019E82B /* chrome-bottom@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18DA188B1CBE0019E82B /* chrome-bottom@2x.png */; }; + 7E4B18DF188B1CD70019E82B /* btn_restart.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18DC188B1CD70019E82B /* btn_restart.png */; }; + 7E4B18E0188B1CD70019E82B /* btn_restart@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18DD188B1CD70019E82B /* btn_restart@2x.png */; }; + 7E4B18E1188B1CD70019E82B /* btn_restart~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18DE188B1CD70019E82B /* btn_restart~ipad.png */; }; + 7E4B18EB188B1E8D0019E82B /* chrome-bottom~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E4B18EA188B1E8D0019E82B /* chrome-bottom~ipad.png */; }; + 7E4C6AF719DB0F7100D337D0 /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C6AF519DB0F7100D337D0 /* famec.cpp */; }; + 7E4D0FBF1CF4E8F600758750 /* VirtualKeyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E4D0FBE1CF4E8F600758750 /* VirtualKeyboard.mm */; }; + 7E54BB201AA3362E0054F6B2 /* MFIControllerReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E54BB1E1AA3362E0054F6B2 /* MFIControllerReaderView.mm */; }; + 7E5A77021D00370E009BF491 /* ExternalAccessory.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E5A77011D00370E009BF491 /* ExternalAccessory.framework */; }; + 7E5AF60B1C444854000BF5CB /* sticky_unselected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF5FB1C444854000BF5CB /* sticky_unselected_svg.svg */; }; + 7E5AF60C1C444854000BF5CB /* sticky_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF5FC1C444854000BF5CB /* sticky_unselected.png */; }; + 7E5AF60D1C444854000BF5CB /* sticky_selected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF5FD1C444854000BF5CB /* sticky_selected_svg.svg */; }; + 7E5AF60E1C444854000BF5CB /* sticky_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF5FE1C444854000BF5CB /* sticky_selected.png */; }; + 7E5AF60F1C444854000BF5CB /* keyboard_unselected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF5FF1C444854000BF5CB /* keyboard_unselected_svg.svg */; }; + 7E5AF6111C444854000BF5CB /* keyboard_selected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6011C444854000BF5CB /* keyboard_selected_svg.svg */; }; + 7E5AF6121C444854000BF5CB /* keyboard_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6021C444854000BF5CB /* keyboard_selected.png */; }; + 7E5AF6131C444854000BF5CB /* gear_unselected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6031C444854000BF5CB /* gear_unselected_svg.svg */; }; + 7E5AF6151C444854000BF5CB /* gear_selected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6051C444854000BF5CB /* gear_selected_svg.svg */; }; + 7E5AF6161C444854000BF5CB /* gear_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6061C444854000BF5CB /* gear_selected.png */; }; + 7E5AF6171C444854000BF5CB /* controller_unselected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6071C444854000BF5CB /* controller_unselected_svg.svg */; }; + 7E5AF6181C444854000BF5CB /* controller_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6081C444854000BF5CB /* controller_unselected.png */; }; + 7E5AF6191C444854000BF5CB /* controller_selected_svg.svg in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF6091C444854000BF5CB /* controller_selected_svg.svg */; }; + 7E5AF61A1C444854000BF5CB /* controller_selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF60A1C444854000BF5CB /* controller_selected.png */; }; + 7E5AF61E1C444C65000BF5CB /* keyboard_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF61D1C444C65000BF5CB /* keyboard_unselected.png */; }; + 7E5AF6201C444C83000BF5CB /* gear_unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7E5AF61F1C444C83000BF5CB /* gear_unselected.png */; }; + 7E66C1C21C5E1E89008B34D0 /* SettingsJoypadMainController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E66C1C11C5E1E89008B34D0 /* SettingsJoypadMainController.mm */; }; + 7E6BCCDB1D591DA900826CBD /* SettingsMouseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E6BCCDA1D591DA900826CBD /* SettingsMouseController.m */; }; + 7E6F37791CDB4E58005BA173 /* SettingsSelectPortViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E6F37781CDB4E58005BA173 /* SettingsSelectPortViewController.mm */; }; + 7E770D791D109BF4000E5E1A /* UnappliedSettingLabelHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E770D781D109BF4000E5E1A /* UnappliedSettingLabelHandler.m */; }; + 7E770D7C1D109DEC000E5E1A /* CoreSetting.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E770D7B1D109DEC000E5E1A /* CoreSetting.m */; }; + 7E82CBF319E1C0A70014AC6D /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; + 7E82CBF419E1C0BA0014AC6D /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; + 7E82CBF719E1CFE10014AC6D /* combined_modules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 054525AF106EC5550032FC41 /* combined_modules.cpp */; }; + 7E8C24F21EA0E31300673701 /* rom.key in Resources */ = {isa = PBXBuildFile; fileRef = 7E8C24F11EA0E31300673701 /* rom.key */; }; + 7E922A801CF0AD6000D8006F /* touchstick.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E922A7F1CF0AD6000D8006F /* touchstick.mm */; }; + 7E98D5751D4E1241002EFBE0 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; + 7EA2BCA1188B0EF6003DCE10 /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; + 7EA2BCA2188B0EFF003DCE10 /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; + 7EA2BCA3188B0F02003DCE10 /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; + 7EA4D64B1923EC9700C58BB9 /* BaseWebviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4D64A1923EC9700C58BB9 /* BaseWebviewController.m */; }; + 7EA4D6501923ECB400C58BB9 /* IOSKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4D64F1923ECB400C58BB9 /* IOSKeyboard.m */; }; + 7EA4D6571923ECC100C58BB9 /* EmulationView-iPad.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4D6511923ECC100C58BB9 /* EmulationView-iPad.mm */; }; + 7EA4D6581923ECC100C58BB9 /* EmulationView-iPhone.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4D6531923ECC100C58BB9 /* EmulationView-iPhone.mm */; }; + 7EA4D6591923ECC100C58BB9 /* MainEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4D6541923ECC100C58BB9 /* MainEmulationViewController.mm */; }; + 7EA4D65A1923ECC100C58BB9 /* TouchHandlerViewClassic.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4D6561923ECC100C58BB9 /* TouchHandlerViewClassic.m */; }; + 7EA5AC5C18AAC5920072820E /* BaseNavigationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EA5AC5B18AAC5920072820E /* BaseNavigationController.mm */; }; + 7EA5E7891AED732500FCE311 /* sticky.png in Resources */ = {isa = PBXBuildFile; fileRef = 7EA5E7881AED732500FCE311 /* sticky.png */; }; + 7EA7D6F1187B480C0092FC2F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; + 7EAA9DB7192541D400541BE1 /* Specialkeyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 7EAA9D9C192541D400541BE1 /* Specialkeyboard.png */; }; + 7EAA9DBF192541D400541BE1 /* PKCustomKeyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EAA9DA5192541D400541BE1 /* PKCustomKeyboard.mm */; }; + 7EAA9DCC192541D400541BE1 /* PMCustomKeyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EAA9DB5192541D400541BE1 /* PMCustomKeyboard.mm */; }; + 7EADD3161CB2FAA100136978 /* JoypadSelectionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EADD3151CB2FAA100136978 /* JoypadSelectionController.mm */; }; + 7EB017651B09115900C74B9D /* StateManagementController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EB017631B09115900C74B9D /* StateManagementController.mm */; }; + 7EB017711B09143000C74B9D /* SVProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EB0176B1B09143000C74B9D /* SVProgressHUD.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 7EB017721B09143000C74B9D /* SVProgressHUD.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 7EB0176D1B09143000C74B9D /* SVProgressHUD.bundle */; }; + 7EB017731B09143000C74B9D /* SVIndefiniteAnimatedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EB0176F1B09143000C74B9D /* SVIndefiniteAnimatedView.m */; }; + 7EB017781B09164900C74B9D /* StateFileManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EB017741B09164900C74B9D /* StateFileManager.mm */; }; + 7EB017791B09164900C74B9D /* State.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EB017761B09164900C74B9D /* State.mm */; }; + 7EB017801B0921B000C74B9D /* SettingsSelectKeyViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EB0177F1B0921B000C74B9D /* SettingsSelectKeyViewController.mm */; }; + 7EB372EA1A0FC8DE001B460A /* GameController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7EB372E91A0FC8DE001B460A /* GameController.framework */; }; + 7EC59ED21BAC52390097B87A /* SettingsJoypadStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EC59ED11BAC52390097B87A /* SettingsJoypadStyle.mm */; }; + 7ED40F1E1A3E1C9300E0E1F8 /* gamepad.png in Resources */ = {isa = PBXBuildFile; fileRef = 7ED40F1D1A3E1C9300E0E1F8 /* gamepad.png */; }; + 7ED69CFC1A6D9DAF00059F7D /* DiskAssociationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7ED69CFB1A6D9DAF00059F7D /* DiskAssociationViewController.mm */; }; + 7ED7ACAC1E92C9760041C2A4 /* SettingHardwareController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED7ACAB1E92C9760041C2A4 /* SettingHardwareController.m */; }; + 7EDCD04F1C3C59420006EB50 /* JoypadMainSettingsController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EDCD04E1C3C59420006EB50 /* JoypadMainSettingsController.mm */; }; + 7EE0D0451AACF2090081DAA5 /* Settings.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EE0D0441AACF2090081DAA5 /* Settings.mm */; }; + 7EF076641B9B2C7A00224DF0 /* SettingsJoypadVpadController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EF076631B9B2C7A00224DF0 /* SettingsJoypadVpadController.mm */; }; + 7EF0C8D31E89ADBD00531AE3 /* Ram_Unselected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7EF0C8D11E89ADBD00531AE3 /* Ram_Unselected.png */; }; + 7EF0C8D41E89ADBD00531AE3 /* Ram-Selected.png in Resources */ = {isa = PBXBuildFile; fileRef = 7EF0C8D21E89ADBD00531AE3 /* Ram-Selected.png */; }; + 7EF1681719030597001C8C8F /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; + 7EF2F7BB1D2807600019A579 /* od-joy.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EF2F7BA1D2807600019A579 /* od-joy.mm */; }; + 7EF97ABD1A7586E7002CC332 /* SelectConfigurationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EF97ABC1A7586E7002CC332 /* SelectConfigurationViewController.mm */; }; + 9064AD551C7D09FA004CAE28 /* MultipeerConnectivity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9064AD541C7D09FA004CAE28 /* MultipeerConnectivity.framework */; }; + 9064AD631C7F7982004CAE28 /* MultiPeerConnectivityController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9064AD611C7F7982004CAE28 /* MultiPeerConnectivityController.mm */; }; 9706D6571561817500073678 /* Aperture (1x2 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B3153A3F2E00580B91 /* Aperture (1x2 RB).png */; }; 9706D6581561817500073678 /* Aperture (1x3 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B4153A3F2E00580B91 /* Aperture (1x3 RB).png */; }; 9706D6591561817500073678 /* Aperture (2x4 BG).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B5153A3F2E00580B91 /* Aperture (2x4 BG).png */; }; @@ -211,8 +270,6 @@ 9706D65F1561817500073678 /* Simple.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 9706D6601561817500073678 /* Simple.vert in Resources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 9706D6611561817500073678 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; - 9706D6621561817500073678 /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 9706D6631561817500073678 /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 9706D6641561817500073678 /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; 9706D6651561817500073678 /* firebutton-red-active@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD015489E6600BF66CF /* firebutton-red-active@2x.png */; }; 9706D6661561817500073678 /* firebutton-red-active~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD115489E6600BF66CF /* firebutton-red-active~ipad.png */; }; @@ -220,7 +277,6 @@ 9706D6681561817500073678 /* firebutton-red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD315489E6600BF66CF /* firebutton-red@2x.png */; }; 9706D6691561817500073678 /* firebutton-red~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD415489E6600BF66CF /* firebutton-red~ipad.png */; }; 9706D66A1561817500073678 /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; - 9706D66B1561817500073678 /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; 9706D66C1561817500073678 /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 9706D66D1561817500073678 /* ls-fullscreen_bottomBtn.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADA15489E6600BF66CF /* ls-fullscreen_bottomBtn.png */; }; 9706D66E1561817500073678 /* ls-instructions_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADB15489E6600BF66CF /* ls-instructions_overlay.png */; }; @@ -231,7 +287,7 @@ 9706D6731561817500073678 /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 9706D6BB1561817500073678 /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 9706D6BC1561817500073678 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 9706D6BD1561817500073678 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 9706D6BD1561817500073678 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 9706D6BE1561817500073678 /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 9706D6BF1561817500073678 /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 9706D6C01561817500073678 /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -240,13 +296,11 @@ 9706D6C31561817500073678 /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 9706D6C41561817500073678 /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 9706D6C51561817500073678 /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 9706D6C61561817500073678 /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 9706D6C71561817500073678 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 9706D6C81561817500073678 /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 9706D6C91561817500073678 /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 9706D6CA1561817500073678 /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 9706D6CB1561817500073678 /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 9706D6CC1561817500073678 /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 9706D6CD1561817500073678 /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 9706D6CE1561817500073678 /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 9706D6CF1561817500073678 /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -254,7 +308,7 @@ 9706D6D11561817500073678 /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 9706D6D21561817500073678 /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 9706D6D31561817500073678 /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 9706D6D41561817500073678 /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 9706D6D41561817500073678 /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 9706D6D51561817500073678 /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 9706D6D61561817500073678 /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; 9706D6D71561817500073678 /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; @@ -265,16 +319,13 @@ 9706D6DC1561817500073678 /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; 9706D6DD1561817500073678 /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 9706D6DE1561817500073678 /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; - 9706D6DF1561817500073678 /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 9706D6E01561817500073678 /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; + 9706D6DF1561817500073678 /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 9706D6E01561817500073678 /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 9706D6E11561817500073678 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 9706D6E21561817500073678 /* SDL_mouse_c.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507F153A3F2E00580B91 /* SDL_mouse_c.c */; }; 9706D6E31561817500073678 /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; - 9706D6E41561817500073678 /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 9706D6E51561817500073678 /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 9706D6E61561817500073678 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; + 9706D6E41561817500073678 /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; 9706D6E71561817500073678 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; - 9706D6E81561817500073678 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; 9706D6E91561817500073678 /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 9706D6EA1561817500073678 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; 9706D6EB1561817500073678 /* SDL_NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855095153A3F2E00580B91 /* SDL_NSObject+Blocks.m */; }; @@ -295,8 +346,6 @@ 9706D6FA1561817500073678 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 9706D6FB1561817500073678 /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 9706D6FC1561817500073678 /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; - 9706D6FD1561817500073678 /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; - 9706D7021561817500073678 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; 9706D7031561817500073678 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; 9706D7041561817500073678 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 9706D7051561817500073678 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -322,9 +371,6 @@ 9706D7741561827300073678 /* chrome-top.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7201561827300073678 /* chrome-top.png */; }; 9706D7751561827300073678 /* chrome-top@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7211561827300073678 /* chrome-top@2x.png */; }; 9706D7761561827300073678 /* chrome-top~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7221561827300073678 /* chrome-top~ipad.png */; }; - 9706D7771561827300073678 /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7231561827300073678 /* Default-Landscape~ipad.png */; }; - 9706D7781561827300073678 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7241561827300073678 /* Default.png */; }; - 9706D7791561827300073678 /* DISK1.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7251561827300073678 /* DISK1.ADF */; }; 9706D77A1561827300073678 /* EmulationView-iPad.m in Sources */ = {isa = PBXBuildFile; fileRef = 9706D7271561827300073678 /* EmulationView-iPad.m */; }; 9706D77B1561827300073678 /* EmulationView-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7281561827300073678 /* EmulationView-iPad.xib */; }; 9706D77C1561827300073678 /* EmulationView-iPhone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9706D72A1561827300073678 /* EmulationView-iPhone.m */; }; @@ -375,9 +421,6 @@ 9706D7AF1561827300073678 /* intro_4.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7621561827300073678 /* intro_4.png */; }; 9706D7B01561827300073678 /* intro_4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7631561827300073678 /* intro_4@2x.png */; }; 9706D7B11561827300073678 /* intro_4~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 9706D7641561827300073678 /* intro_4~ipad.png */; }; - 97242C2A156177EC00B6D03C /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 97242C2B156177EC00B6D03C /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 97242C2C156177EC00B6D03C /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 97242C2D156177EC00B6D03C /* Aperture (1x2 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B3153A3F2E00580B91 /* Aperture (1x2 RB).png */; }; 97242C2E156177EC00B6D03C /* Aperture (1x3 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B4153A3F2E00580B91 /* Aperture (1x3 RB).png */; }; 97242C2F156177EC00B6D03C /* Aperture (2x4 BG).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B5153A3F2E00580B91 /* Aperture (2x4 BG).png */; }; @@ -389,8 +432,6 @@ 97242C35156177EC00B6D03C /* Simple.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 97242C36156177EC00B6D03C /* Simple.vert in Resources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 97242C37156177EC00B6D03C /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; - 97242C38156177EC00B6D03C /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 97242C39156177EC00B6D03C /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 97242C6F156177EC00B6D03C /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; 97242C70156177EC00B6D03C /* firebutton-red-active@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD015489E6600BF66CF /* firebutton-red-active@2x.png */; }; 97242C71156177EC00B6D03C /* firebutton-red-active~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD115489E6600BF66CF /* firebutton-red-active~ipad.png */; }; @@ -398,7 +439,6 @@ 97242C73156177EC00B6D03C /* firebutton-red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD315489E6600BF66CF /* firebutton-red@2x.png */; }; 97242C74156177EC00B6D03C /* firebutton-red~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD415489E6600BF66CF /* firebutton-red~ipad.png */; }; 97242C75156177EC00B6D03C /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; - 97242C76156177EC00B6D03C /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; 97242C77156177EC00B6D03C /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 97242C78156177EC00B6D03C /* ls-fullscreen_bottomBtn.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADA15489E6600BF66CF /* ls-fullscreen_bottomBtn.png */; }; 97242C79156177EC00B6D03C /* ls-instructions_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADB15489E6600BF66CF /* ls-instructions_overlay.png */; }; @@ -409,7 +449,7 @@ 97242C7E156177EC00B6D03C /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 97242C80156177EC00B6D03C /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 97242C81156177EC00B6D03C /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 97242C82156177EC00B6D03C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 97242C82156177EC00B6D03C /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 97242C83156177EC00B6D03C /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 97242C84156177EC00B6D03C /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 97242C85156177EC00B6D03C /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -418,13 +458,11 @@ 97242C88156177EC00B6D03C /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 97242C89156177EC00B6D03C /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 97242C8A156177EC00B6D03C /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 97242C8B156177EC00B6D03C /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 97242C8C156177EC00B6D03C /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 97242C8D156177EC00B6D03C /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 97242C8E156177EC00B6D03C /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 97242C8F156177EC00B6D03C /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 97242C90156177EC00B6D03C /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 97242C91156177EC00B6D03C /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 97242C92156177EC00B6D03C /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 97242C93156177EC00B6D03C /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 97242C94156177EC00B6D03C /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -432,7 +470,7 @@ 97242C96156177EC00B6D03C /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 97242C97156177EC00B6D03C /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 97242C98156177EC00B6D03C /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 97242C99156177EC00B6D03C /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 97242C99156177EC00B6D03C /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 97242C9A156177EC00B6D03C /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 97242C9B156177EC00B6D03C /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; 97242C9C156177EC00B6D03C /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; @@ -443,16 +481,13 @@ 97242CA1156177EC00B6D03C /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; 97242CA2156177EC00B6D03C /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 97242CA3156177EC00B6D03C /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; - 97242CA4156177EC00B6D03C /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 97242CA7156177EC00B6D03C /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; + 97242CA4156177EC00B6D03C /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 97242CA7156177EC00B6D03C /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 97242CA9156177EC00B6D03C /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 97242CAA156177EC00B6D03C /* SDL_mouse_c.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507F153A3F2E00580B91 /* SDL_mouse_c.c */; }; 97242CAB156177EC00B6D03C /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; - 97242CAC156177EC00B6D03C /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 97242CAD156177EC00B6D03C /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 97242CAE156177EC00B6D03C /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; + 97242CAC156177EC00B6D03C /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; 97242CAF156177EC00B6D03C /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; - 97242CB0156177EC00B6D03C /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; 97242CB1156177EC00B6D03C /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 97242CB2156177EC00B6D03C /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; 97242CB3156177EC00B6D03C /* SDL_NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855095153A3F2E00580B91 /* SDL_NSObject+Blocks.m */; }; @@ -473,8 +508,6 @@ 97242CC5156177EC00B6D03C /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 97242CC6156177EC00B6D03C /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 97242CC7156177EC00B6D03C /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; - 97242CC8156177EC00B6D03C /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; - 97242CCA156177EC00B6D03C /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; 97242CCB156177EC00B6D03C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; 97242CCC156177EC00B6D03C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 97242CCD156177EC00B6D03C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -500,8 +533,6 @@ 97242D3E156178CC00B6D03C /* chrome-top.png in Resources */ = {isa = PBXBuildFile; fileRef = 97242CE9156178CB00B6D03C /* chrome-top.png */; }; 97242D3F156178CC00B6D03C /* chrome-top@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97242CEA156178CB00B6D03C /* chrome-top@2x.png */; }; 97242D40156178CC00B6D03C /* chrome-top~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97242CEB156178CB00B6D03C /* chrome-top~ipad.png */; }; - 97242D43156178CC00B6D03C /* DISK1.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 97242CEE156178CB00B6D03C /* DISK1.ADF */; }; - 97242D44156178CC00B6D03C /* DISK2.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 97242CEF156178CB00B6D03C /* DISK2.ADF */; }; 97242D45156178CC00B6D03C /* EmulationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97242CF1156178CB00B6D03C /* EmulationViewController.m */; }; 97242D46156178CC00B6D03C /* EmulationView-iPad.m in Sources */ = {isa = PBXBuildFile; fileRef = 97242CF3156178CB00B6D03C /* EmulationView-iPad.m */; }; 97242D47156178CC00B6D03C /* EmulationView-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 97242CF4156178CB00B6D03C /* EmulationView-iPad.xib */; }; @@ -553,7 +584,6 @@ 97242D7B156178CC00B6D03C /* intro_4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97242D2D156178CC00B6D03C /* intro_4@2x.png */; }; 97242D7C156178CC00B6D03C /* intro_4~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97242D2E156178CC00B6D03C /* intro_4~ipad.png */; }; 976877761534B2D20077B654 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; - 978550C4153A3F2E00580B91 /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 97855061153A3F2E00580B91 /* .gitignore */; }; 978550C7153A3F2E00580B91 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 978550C8153A3F2E00580B91 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 978550C9153A3F2E00580B91 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; @@ -563,21 +593,12 @@ 978550CD153A3F2E00580B91 /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; 978550CE153A3F2E00580B91 /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; 978550CF153A3F2E00580B91 /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; - 978550D0153A3F2E00580B91 /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 978550D1153A3F2E00580B91 /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 978550D2153A3F2E00580B91 /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 978550D3153A3F2E00580B91 /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 978550D4153A3F2E00580B91 /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 978550D5153A3F2E00580B91 /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 978550D6153A3F2E00580B91 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; - 978550D7153A3F2E00580B91 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; - 978550D8153A3F2E00580B91 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; + 978550D0153A3F2E00580B91 /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; + 978550D1153A3F2E00580B91 /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; + 978550D2153A3F2E00580B91 /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; 978550D9153A3F2E00580B91 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; 978550DA153A3F2E00580B91 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; 978550DB153A3F2E00580B91 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; - 978550DC153A3F2E00580B91 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; - 978550DD153A3F2E00580B91 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; - 978550DE153A3F2E00580B91 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; 978550DF153A3F2E00580B91 /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 978550E0153A3F2E00580B91 /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 978550E2153A3F2E00580B91 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; @@ -632,7 +653,6 @@ 97855115153A3F2E00580B91 /* Aperture (4x6).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B7153A3F2E00580B91 /* Aperture (4x6).png */; }; 97855116153A3F2E00580B91 /* Aperture (4x6).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B7153A3F2E00580B91 /* Aperture (4x6).png */; }; 97855117153A3F2E00580B91 /* Aperture (4x6).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B7153A3F2E00580B91 /* Aperture (4x6).png */; }; - 97855118153A3F2E00580B91 /* CRT.frag in Sources */ = {isa = PBXBuildFile; fileRef = 978550B8153A3F2E00580B91 /* CRT.frag */; }; 97855119153A3F2E00580B91 /* CRT.frag in Sources */ = {isa = PBXBuildFile; fileRef = 978550B8153A3F2E00580B91 /* CRT.frag */; }; 9785511A153A3F2E00580B91 /* CRT.frag in Sources */ = {isa = PBXBuildFile; fileRef = 978550B8153A3F2E00580B91 /* CRT.frag */; }; 9785511B153A3F2E00580B91 /* Scanlines (100%).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B9153A3F2E00580B91 /* Scanlines (100%).png */; }; @@ -641,10 +661,8 @@ 9785511E153A3F2E00580B91 /* Scanlines (50%).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550BA153A3F2E00580B91 /* Scanlines (50%).png */; }; 9785511F153A3F2E00580B91 /* Scanlines (50%).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550BA153A3F2E00580B91 /* Scanlines (50%).png */; }; 97855120153A3F2E00580B91 /* Scanlines (50%).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550BA153A3F2E00580B91 /* Scanlines (50%).png */; }; - 97855121153A3F2E00580B91 /* Simple.frag in Sources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 97855122153A3F2E00580B91 /* Simple.frag in Sources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 97855123153A3F2E00580B91 /* Simple.frag in Sources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; - 97855124153A3F2E00580B91 /* Simple.vert in Sources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 97855125153A3F2E00580B91 /* Simple.vert in Sources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 97855126153A3F2E00580B91 /* Simple.vert in Sources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 97855127153A3F2E00580B91 /* TexturedCRTEffect.m in Sources */ = {isa = PBXBuildFile; fileRef = 978550BE153A3F2E00580B91 /* TexturedCRTEffect.m */; }; @@ -662,21 +680,15 @@ 97855134153A3FBE00580B91 /* CRT.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550B8153A3F2E00580B91 /* CRT.frag */; }; 97855135153A3FBE00580B91 /* Simple.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 97855136153A3FBE00580B91 /* Simple.vert in Resources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; - 97855140153A402A00580B91 /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; 97855146153A454100580B91 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 97855149153A455C00580B91 /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 9785514A153A455C00580B91 /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; - 9785514B153A469A00580B91 /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; - 9785514C153A46D400580B91 /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; 9785514F153A471000580B91 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 97855150153A472C00580B91 /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 97855151153A472C00580B91 /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; 97855152153A478D00580B91 /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 97855153153A479800580B91 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; 97855154153A479C00580B91 /* SDL_NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855095153A3F2E00580B91 /* SDL_NSObject+Blocks.m */; }; - 9787FA011561882D00458A4A /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 9787FA021561882D00458A4A /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 9787FA031561882D00458A4A /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 9787FA041561882D00458A4A /* Aperture (1x2 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B3153A3F2E00580B91 /* Aperture (1x2 RB).png */; }; 9787FA051561882D00458A4A /* Aperture (1x3 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B4153A3F2E00580B91 /* Aperture (1x3 RB).png */; }; 9787FA061561882D00458A4A /* Aperture (2x4 BG).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B5153A3F2E00580B91 /* Aperture (2x4 BG).png */; }; @@ -688,8 +700,6 @@ 9787FA0C1561882D00458A4A /* Simple.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 9787FA0D1561882D00458A4A /* Simple.vert in Resources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 9787FA0E1561882D00458A4A /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; - 9787FA0F1561882D00458A4A /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 9787FA101561882D00458A4A /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 9787FA111561882D00458A4A /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; 9787FA121561882D00458A4A /* firebutton-red-active@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD015489E6600BF66CF /* firebutton-red-active@2x.png */; }; 9787FA131561882D00458A4A /* firebutton-red-active~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD115489E6600BF66CF /* firebutton-red-active~ipad.png */; }; @@ -697,7 +707,6 @@ 9787FA151561882D00458A4A /* firebutton-red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD315489E6600BF66CF /* firebutton-red@2x.png */; }; 9787FA161561882D00458A4A /* firebutton-red~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD415489E6600BF66CF /* firebutton-red~ipad.png */; }; 9787FA171561882D00458A4A /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; - 9787FA181561882D00458A4A /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; 9787FA191561882D00458A4A /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 9787FA1A1561882D00458A4A /* ls-fullscreen_bottomBtn.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADA15489E6600BF66CF /* ls-fullscreen_bottomBtn.png */; }; 9787FA1B1561882D00458A4A /* ls-instructions_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADB15489E6600BF66CF /* ls-instructions_overlay.png */; }; @@ -708,7 +717,7 @@ 9787FA201561882D00458A4A /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 9787FA671561882D00458A4A /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 9787FA681561882D00458A4A /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 9787FA691561882D00458A4A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 9787FA691561882D00458A4A /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 9787FA6A1561882D00458A4A /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 9787FA6B1561882D00458A4A /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 9787FA6C1561882D00458A4A /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -717,13 +726,11 @@ 9787FA6F1561882D00458A4A /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 9787FA701561882D00458A4A /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 9787FA711561882D00458A4A /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 9787FA721561882D00458A4A /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 9787FA731561882D00458A4A /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 9787FA741561882D00458A4A /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 9787FA751561882D00458A4A /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 9787FA761561882D00458A4A /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 9787FA771561882D00458A4A /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 9787FA781561882D00458A4A /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 9787FA791561882D00458A4A /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 9787FA7A1561882D00458A4A /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 9787FA7B1561882D00458A4A /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -731,7 +738,7 @@ 9787FA7D1561882D00458A4A /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 9787FA7E1561882D00458A4A /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 9787FA7F1561882D00458A4A /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 9787FA801561882D00458A4A /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 9787FA801561882D00458A4A /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 9787FA811561882D00458A4A /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 9787FA821561882D00458A4A /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; 9787FA831561882D00458A4A /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; @@ -742,16 +749,13 @@ 9787FA881561882D00458A4A /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; 9787FA891561882D00458A4A /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 9787FA8A1561882D00458A4A /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; - 9787FA8B1561882D00458A4A /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 9787FA8C1561882D00458A4A /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; + 9787FA8B1561882D00458A4A /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 9787FA8C1561882D00458A4A /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 9787FA8D1561882D00458A4A /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 9787FA8E1561882D00458A4A /* SDL_mouse_c.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507F153A3F2E00580B91 /* SDL_mouse_c.c */; }; 9787FA8F1561882D00458A4A /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; - 9787FA901561882D00458A4A /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 9787FA911561882D00458A4A /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 9787FA921561882D00458A4A /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; + 9787FA901561882D00458A4A /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; 9787FA931561882D00458A4A /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; - 9787FA941561882D00458A4A /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; 9787FA951561882D00458A4A /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 9787FA961561882D00458A4A /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; 9787FA971561882D00458A4A /* SDL_NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855095153A3F2E00580B91 /* SDL_NSObject+Blocks.m */; }; @@ -772,8 +776,6 @@ 9787FAA61561882D00458A4A /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 9787FAA71561882D00458A4A /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 9787FAA81561882D00458A4A /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; - 9787FAA91561882D00458A4A /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; - 9787FAAE1561882D00458A4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; 9787FAAF1561882D00458A4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; 9787FAB01561882D00458A4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 9787FAB11561882D00458A4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -790,9 +792,6 @@ 9787FB49156188EE00458A4A /* icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FAFA156188ED00458A4A /* icon-72.png */; }; 9787FB4A156188EE00458A4A /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FAFB156188ED00458A4A /* icon.png */; }; 9787FB4B156188EE00458A4A /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FAFC156188ED00458A4A /* icon@2x.png */; }; - 9787FB6315618A5E00458A4A /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 9787FB6415618A5E00458A4A /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 9787FB6515618A5E00458A4A /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 9787FB6615618A5E00458A4A /* Aperture (1x2 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B3153A3F2E00580B91 /* Aperture (1x2 RB).png */; }; 9787FB6715618A5E00458A4A /* Aperture (1x3 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B4153A3F2E00580B91 /* Aperture (1x3 RB).png */; }; 9787FB6815618A5E00458A4A /* Aperture (2x4 BG).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B5153A3F2E00580B91 /* Aperture (2x4 BG).png */; }; @@ -804,8 +803,6 @@ 9787FB6E15618A5E00458A4A /* Simple.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 9787FB6F15618A5E00458A4A /* Simple.vert in Resources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 9787FB7015618A5E00458A4A /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; - 9787FB7115618A5E00458A4A /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 9787FB7215618A5E00458A4A /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 9787FB7315618A5E00458A4A /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; 9787FB7415618A5E00458A4A /* firebutton-red-active@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD015489E6600BF66CF /* firebutton-red-active@2x.png */; }; 9787FB7515618A5E00458A4A /* firebutton-red-active~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD115489E6600BF66CF /* firebutton-red-active~ipad.png */; }; @@ -813,7 +810,6 @@ 9787FB7715618A5E00458A4A /* firebutton-red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD315489E6600BF66CF /* firebutton-red@2x.png */; }; 9787FB7815618A5E00458A4A /* firebutton-red~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD415489E6600BF66CF /* firebutton-red~ipad.png */; }; 9787FB7915618A5E00458A4A /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; - 9787FB7A15618A5E00458A4A /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; 9787FB7B15618A5E00458A4A /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 9787FB7C15618A5E00458A4A /* ls-fullscreen_bottomBtn.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADA15489E6600BF66CF /* ls-fullscreen_bottomBtn.png */; }; 9787FB7D15618A5E00458A4A /* ls-instructions_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADB15489E6600BF66CF /* ls-instructions_overlay.png */; }; @@ -824,7 +820,7 @@ 9787FB8215618A5E00458A4A /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 9787FBCA15618A5E00458A4A /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 9787FBCB15618A5E00458A4A /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 9787FBCC15618A5E00458A4A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 9787FBCC15618A5E00458A4A /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 9787FBCD15618A5E00458A4A /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 9787FBCE15618A5E00458A4A /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 9787FBCF15618A5E00458A4A /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -833,13 +829,11 @@ 9787FBD215618A5E00458A4A /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 9787FBD315618A5E00458A4A /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 9787FBD415618A5E00458A4A /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 9787FBD515618A5E00458A4A /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 9787FBD615618A5E00458A4A /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 9787FBD715618A5E00458A4A /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 9787FBD815618A5E00458A4A /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 9787FBD915618A5E00458A4A /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 9787FBDA15618A5E00458A4A /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 9787FBDB15618A5E00458A4A /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 9787FBDC15618A5E00458A4A /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 9787FBDD15618A5E00458A4A /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 9787FBDE15618A5E00458A4A /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -847,7 +841,7 @@ 9787FBE015618A5E00458A4A /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 9787FBE115618A5E00458A4A /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 9787FBE215618A5E00458A4A /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 9787FBE315618A5E00458A4A /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 9787FBE315618A5E00458A4A /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 9787FBE415618A5E00458A4A /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 9787FBE515618A5E00458A4A /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; 9787FBE615618A5E00458A4A /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; @@ -858,16 +852,13 @@ 9787FBEB15618A5E00458A4A /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; 9787FBEC15618A5E00458A4A /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 9787FBED15618A5E00458A4A /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; - 9787FBEE15618A5E00458A4A /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 9787FBEF15618A5E00458A4A /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; + 9787FBEE15618A5E00458A4A /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 9787FBEF15618A5E00458A4A /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 9787FBF015618A5E00458A4A /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 9787FBF115618A5E00458A4A /* SDL_mouse_c.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507F153A3F2E00580B91 /* SDL_mouse_c.c */; }; 9787FBF215618A5E00458A4A /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; - 9787FBF315618A5E00458A4A /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 9787FBF415618A5E00458A4A /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 9787FBF515618A5E00458A4A /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; + 9787FBF315618A5E00458A4A /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; 9787FBF615618A5E00458A4A /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; - 9787FBF715618A5E00458A4A /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; 9787FBF815618A5E00458A4A /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 9787FBF915618A5E00458A4A /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; 9787FBFA15618A5E00458A4A /* SDL_NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855095153A3F2E00580B91 /* SDL_NSObject+Blocks.m */; }; @@ -888,8 +879,6 @@ 9787FC0915618A5E00458A4A /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 9787FC0A15618A5E00458A4A /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 9787FC0B15618A5E00458A4A /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; - 9787FC0C15618A5E00458A4A /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; - 9787FC1615618A5E00458A4A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; 9787FC1715618A5E00458A4A /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; 9787FC1815618A5E00458A4A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 9787FC1915618A5E00458A4A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -915,8 +904,6 @@ 9787FC8915618ADB00458A4A /* chrome-top.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC3415618ADB00458A4A /* chrome-top.png */; }; 9787FC8A15618ADB00458A4A /* chrome-top@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC3515618ADB00458A4A /* chrome-top@2x.png */; }; 9787FC8B15618ADB00458A4A /* chrome-top~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC3615618ADB00458A4A /* chrome-top~ipad.png */; }; - 9787FC8E15618ADB00458A4A /* DISK1.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC3915618ADB00458A4A /* DISK1.ADF */; }; - 9787FC8F15618ADB00458A4A /* DISK2.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC3A15618ADB00458A4A /* DISK2.ADF */; }; 9787FC9015618ADB00458A4A /* EmulationView-iPad.m in Sources */ = {isa = PBXBuildFile; fileRef = 9787FC3C15618ADB00458A4A /* EmulationView-iPad.m */; }; 9787FC9115618ADB00458A4A /* EmulationView-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC3D15618ADB00458A4A /* EmulationView-iPad.xib */; }; 9787FC9215618ADB00458A4A /* EmulationView-iPhone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9787FC3F15618ADB00458A4A /* EmulationView-iPhone.m */; }; @@ -972,22 +959,6 @@ 9787FCC515618ADB00458A4A /* intro_4.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC7715618ADB00458A4A /* intro_4.png */; }; 9787FCC615618ADB00458A4A /* intro_4@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC7815618ADB00458A4A /* intro_4@2x.png */; }; 9787FCC715618ADB00458A4A /* intro_4~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 9787FC7915618ADB00458A4A /* intro_4~ipad.png */; }; - 97A641D915754C0800AD7B87 /* functions.js in Sources */ = {isa = PBXBuildFile; fileRef = 97A641CC15754C0700AD7B87 /* functions.js */; }; - 97A641DD15754C0800AD7B87 /* iscroll.js in Sources */ = {isa = PBXBuildFile; fileRef = 97A641D015754C0700AD7B87 /* iscroll.js */; }; - 97A641DE15754C0800AD7B87 /* iscroll4.js in Sources */ = {isa = PBXBuildFile; fileRef = 97A641D115754C0800AD7B87 /* iscroll4.js */; }; - 97A641DF15754C0800AD7B87 /* jquery-1.4.4.min.js in Sources */ = {isa = PBXBuildFile; fileRef = 97A641D215754C0800AD7B87 /* jquery-1.4.4.min.js */; }; - 97A641E015754C0800AD7B87 /* jquery-1.5.2.min.js in Sources */ = {isa = PBXBuildFile; fileRef = 97A641D315754C0800AD7B87 /* jquery-1.5.2.min.js */; }; - 97A641E115754C0800AD7B87 /* Limelight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 97A641D415754C0800AD7B87 /* Limelight.ttf */; }; - 97A641E215754C0800AD7B87 /* UserGuide.html in Resources */ = {isa = PBXBuildFile; fileRef = 97A641D515754C0800AD7B87 /* UserGuide.html */; }; - 97A641E315754C0800AD7B87 /* UserGuide~ipad.html in Resources */ = {isa = PBXBuildFile; fileRef = 97A641D615754C0800AD7B87 /* UserGuide~ipad.html */; }; - 97A641ED15754C2500AD7B87 /* instruction-dotc-cursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641E515754C2400AD7B87 /* instruction-dotc-cursor.png */; }; - 97A641EE15754C2500AD7B87 /* instruction-dotc-cursor@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641E615754C2400AD7B87 /* instruction-dotc-cursor@2x.png */; }; - 97A641EF15754C2500AD7B87 /* instruction-handclick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641E715754C2400AD7B87 /* instruction-handclick.png */; }; - 97A641F015754C2500AD7B87 /* instruction-handclick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641E815754C2500AD7B87 /* instruction-handclick@2x.png */; }; - 97A641F115754C2500AD7B87 /* instruction-handdrag.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641E915754C2500AD7B87 /* instruction-handdrag.png */; }; - 97A641F215754C2500AD7B87 /* instruction-handdrag@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641EA15754C2500AD7B87 /* instruction-handdrag@2x.png */; }; - 97A641F315754C2500AD7B87 /* instruction-menuclick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641EB15754C2500AD7B87 /* instruction-menuclick.png */; }; - 97A641F415754C2500AD7B87 /* instruction-menuclick@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A641EC15754C2500AD7B87 /* instruction-menuclick@2x.png */; }; 97A931581538AD1B001064D7 /* bg_web.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A931391538AD1B001064D7 /* bg_web.png */; }; 97A931591538AD1B001064D7 /* bg_web@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A9313A1538AD1B001064D7 /* bg_web@2x.png */; }; 97A9315A1538AD1B001064D7 /* bg_web~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97A9313B1538AD1B001064D7 /* bg_web~ipad.png */; }; @@ -1036,15 +1007,13 @@ 97A932021538B14B001064D7 /* functions.js in Resources */ = {isa = PBXBuildFile; fileRef = 97A931FD1538B14B001064D7 /* functions.js */; }; 97A932041538B14B001064D7 /* iscroll4.js in Resources */ = {isa = PBXBuildFile; fileRef = 97A931FF1538B14B001064D7 /* iscroll4.js */; }; 97A932051538B14B001064D7 /* jquery-1.4.4.min.js in Resources */ = {isa = PBXBuildFile; fileRef = 97A932001538B14B001064D7 /* jquery-1.4.4.min.js */; }; - 97A932091538B207001064D7 /* DISK1.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 97A932071538B207001064D7 /* DISK1.ADF */; }; - 97A9320A1538B207001064D7 /* DISK2.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 97A932081538B207001064D7 /* DISK2.ADF */; }; 97BE2AA115486FE600BF66CF /* NSObject+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9615486FE600BF66CF /* NSObject+SBJSON.m */; }; 97BE2AA215486FE600BF66CF /* NSString+SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9815486FE600BF66CF /* NSString+SBJSON.m */; }; 97BE2AA315486FE600BF66CF /* SBJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9A15486FE600BF66CF /* SBJSON.m */; }; 97BE2AA415486FE600BF66CF /* SBJsonBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9C15486FE600BF66CF /* SBJsonBase.m */; }; 97BE2AA515486FE600BF66CF /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9E15486FE600BF66CF /* SBJsonParser.m */; }; 97BE2AA615486FE600BF66CF /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AA015486FE600BF66CF /* SBJsonWriter.m */; }; - 97BE2AC21548702100BF66CF /* BaseControlsView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AA91548702100BF66CF /* BaseControlsView.m */; }; + 97BE2AC21548702100BF66CF /* BaseControlsView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AA91548702100BF66CF /* BaseControlsView.mm */; }; 97BE2AC31548702100BF66CF /* BaseLeftRightAwareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AAB1548702100BF66CF /* BaseLeftRightAwareView.m */; }; 97BE2AC41548702100BF66CF /* ButtonJoyButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AAD1548702100BF66CF /* ButtonJoyButton.mm */; }; 97BE2AC51548702100BF66CF /* ControlDefaultConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AAF1548702100BF66CF /* ControlDefaultConstants.m */; }; @@ -1053,7 +1022,7 @@ 97BE2AC81548702100BF66CF /* DynamicLandscapeControls.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AB71548702100BF66CF /* DynamicLandscapeControls.mm */; }; 97BE2AC91548702100BF66CF /* LandscapeJoystick.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AB91548702100BF66CF /* LandscapeJoystick.mm */; }; 97BE2ACA1548702100BF66CF /* MMFixedStickController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABB1548702100BF66CF /* MMFixedStickController.mm */; }; - 97BE2ACB1548702100BF66CF /* StaticImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABD1548702100BF66CF /* StaticImage.m */; }; + 97BE2ACB1548702100BF66CF /* StaticImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABD1548702100BF66CF /* StaticImage.mm */; }; 97BE2ACC1548702100BF66CF /* StickControllerBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABF1548702100BF66CF /* StickControllerBase.mm */; }; 97BE2AE115489E6600BF66CF /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; 97BE2AE215489E6600BF66CF /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; @@ -1076,9 +1045,6 @@ 97BE2AF315489E6600BF66CF /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; 97BE2AF415489E6600BF66CF /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; 97BE2AF515489E6600BF66CF /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; - 97BE2AF615489E6600BF66CF /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; - 97BE2AF715489E6600BF66CF /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; - 97BE2AF815489E6600BF66CF /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; 97BE2AF915489E6600BF66CF /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 97BE2AFA15489E6600BF66CF /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 97BE2AFB15489E6600BF66CF /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; @@ -1103,9 +1069,6 @@ 97BE2B0E15489E6600BF66CF /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 97BE2B0F15489E6600BF66CF /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 97BE2B1015489E6600BF66CF /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; - 97C87506156E834100197738 /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 97C87507156E834100197738 /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 97C87508156E834100197738 /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 97C87509156E834100197738 /* Aperture (1x2 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B3153A3F2E00580B91 /* Aperture (1x2 RB).png */; }; 97C8750A156E834100197738 /* Aperture (1x3 RB).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B4153A3F2E00580B91 /* Aperture (1x3 RB).png */; }; 97C8750B156E834100197738 /* Aperture (2x4 BG).png in Resources */ = {isa = PBXBuildFile; fileRef = 978550B5153A3F2E00580B91 /* Aperture (2x4 BG).png */; }; @@ -1117,8 +1080,6 @@ 97C87511156E834100197738 /* Simple.frag in Resources */ = {isa = PBXBuildFile; fileRef = 978550BB153A3F2E00580B91 /* Simple.frag */; }; 97C87512156E834100197738 /* Simple.vert in Resources */ = {isa = PBXBuildFile; fileRef = 978550BC153A3F2E00580B91 /* Simple.vert */; }; 97C87513156E834100197738 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; - 97C87514156E834100197738 /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 97C87515156E834100197738 /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 97C8754A156E834100197738 /* firebutton-red-active.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */; }; 97C8754B156E834100197738 /* firebutton-red-active@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD015489E6600BF66CF /* firebutton-red-active@2x.png */; }; 97C8754C156E834100197738 /* firebutton-red-active~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD115489E6600BF66CF /* firebutton-red-active~ipad.png */; }; @@ -1126,7 +1087,6 @@ 97C8754E156E834100197738 /* firebutton-red@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD315489E6600BF66CF /* firebutton-red@2x.png */; }; 97C8754F156E834100197738 /* firebutton-red~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD415489E6600BF66CF /* firebutton-red~ipad.png */; }; 97C87550156E834100197738 /* joystick.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD615489E6600BF66CF /* joystick.png */; }; - 97C87551156E834100197738 /* keyboard.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD715489E6600BF66CF /* keyboard.png */; }; 97C87552156E834100197738 /* mouse.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AD815489E6600BF66CF /* mouse.png */; }; 97C87553156E834100197738 /* ls-fullscreen_bottomBtn.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADA15489E6600BF66CF /* ls-fullscreen_bottomBtn.png */; }; 97C87554156E834100197738 /* ls-instructions_overlay.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2ADB15489E6600BF66CF /* ls-instructions_overlay.png */; }; @@ -1137,7 +1097,7 @@ 97C87559156E834100197738 /* ls-joystick_rest.png in Resources */ = {isa = PBXBuildFile; fileRef = 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */; }; 97C8755F156E834100197738 /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 97C87560156E834100197738 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 97C87561156E834100197738 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 97C87561156E834100197738 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 97C87562156E834100197738 /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 97C87563156E834100197738 /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 97C87564156E834100197738 /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -1146,13 +1106,11 @@ 97C87567156E834100197738 /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 97C87568156E834100197738 /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 97C87569156E834100197738 /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 97C8756A156E834100197738 /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 97C8756B156E834100197738 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 97C8756C156E834100197738 /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 97C8756D156E834100197738 /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 97C8756E156E834100197738 /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 97C8756F156E834100197738 /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 97C87570156E834100197738 /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 97C87571156E834100197738 /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 97C87572156E834100197738 /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 97C87573156E834100197738 /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -1160,7 +1118,7 @@ 97C87575156E834100197738 /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 97C87576156E834100197738 /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 97C87577156E834100197738 /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 97C87578156E834100197738 /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 97C87578156E834100197738 /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 97C87579156E834100197738 /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 97C8757A156E834100197738 /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; 97C8757B156E834100197738 /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; @@ -1171,16 +1129,13 @@ 97C87580156E834100197738 /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; 97C87581156E834100197738 /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 97C87582156E834100197738 /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; - 97C87583156E834100197738 /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 97C87584156E834100197738 /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; + 97C87583156E834100197738 /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 97C87584156E834100197738 /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 97C87588156E834100197738 /* SDL_events.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507D153A3F2E00580B91 /* SDL_events.c */; }; 97C87589156E834100197738 /* SDL_mouse_c.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785507F153A3F2E00580B91 /* SDL_mouse_c.c */; }; 97C8758A156E834100197738 /* ButtonStates.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855085153A3F2E00580B91 /* ButtonStates.m */; }; - 97C8758B156E834100197738 /* iCadeReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.m */; }; - 97C8758C156E834100197738 /* iControlPadReaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */; }; - 97C8758D156E834100197738 /* SDL_sysjoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */; }; + 97C8758B156E834100197738 /* iCadeReaderView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855087153A3F2E00580B91 /* iCadeReaderView.mm */; }; 97C8758E156E834100197738 /* SDLUIAccelerationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */; }; - 97C8758F156E834100197738 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = 9785508E153A3F2E00580B91 /* SDL_joystick.c */; }; 97C87590156E834100197738 /* SDL.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97855091153A3F2E00580B91 /* SDL.mm */; }; 97C87591156E834100197738 /* SDL_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 97855092153A3F2E00580B91 /* SDL_error.c */; }; 97C87592156E834100197738 /* SDL_NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 97855095153A3F2E00580B91 /* SDL_NSObject+Blocks.m */; }; @@ -1201,7 +1156,6 @@ 97C875A1156E834100197738 /* TexturedCRTEffect.m in Sources */ = {isa = PBXBuildFile; fileRef = 978550BE153A3F2E00580B91 /* TexturedCRTEffect.m */; }; 97C875A2156E834100197738 /* SDL_UIKitEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = 978550C0153A3F2E00580B91 /* SDL_UIKitEvents.m */; }; 97C875A3156E834100197738 /* SDL_UIKitVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = 978550C2153A3F2E00580B91 /* SDL_UIKitVideo.m */; }; - 97C875A4156E834100197738 /* LambdaAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 9785513F153A402A00580B91 /* LambdaAlert.m */; }; 97C875A5156E834100197738 /* savestate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97855145153A454100580B91 /* savestate.cpp */; }; 97C875A6156E834100197738 /* cyclone.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855147153A455C00580B91 /* cyclone.s */; }; 97C875A7156E834100197738 /* memhandlers.s in Sources */ = {isa = PBXBuildFile; fileRef = 97855148153A455C00580B91 /* memhandlers.s */; }; @@ -1211,7 +1165,7 @@ 97C875AB156E834100197738 /* SBJsonBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9C15486FE600BF66CF /* SBJsonBase.m */; }; 97C875AC156E834100197738 /* SBJsonParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2A9E15486FE600BF66CF /* SBJsonParser.m */; }; 97C875AD156E834100197738 /* SBJsonWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AA015486FE600BF66CF /* SBJsonWriter.m */; }; - 97C875AE156E834100197738 /* BaseControlsView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AA91548702100BF66CF /* BaseControlsView.m */; }; + 97C875AE156E834100197738 /* BaseControlsView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AA91548702100BF66CF /* BaseControlsView.mm */; }; 97C875AF156E834100197738 /* BaseLeftRightAwareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AAB1548702100BF66CF /* BaseLeftRightAwareView.m */; }; 97C875B0156E834100197738 /* ButtonJoyButton.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AAD1548702100BF66CF /* ButtonJoyButton.mm */; }; 97C875B1156E834100197738 /* ControlDefaultConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AAF1548702100BF66CF /* ControlDefaultConstants.m */; }; @@ -1220,9 +1174,8 @@ 97C875B4156E834100197738 /* DynamicLandscapeControls.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AB71548702100BF66CF /* DynamicLandscapeControls.mm */; }; 97C875B5156E834100197738 /* LandscapeJoystick.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2AB91548702100BF66CF /* LandscapeJoystick.mm */; }; 97C875B6156E834100197738 /* MMFixedStickController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABB1548702100BF66CF /* MMFixedStickController.mm */; }; - 97C875B7156E834100197738 /* StaticImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABD1548702100BF66CF /* StaticImage.m */; }; + 97C875B7156E834100197738 /* StaticImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABD1548702100BF66CF /* StaticImage.mm */; }; 97C875B8156E834100197738 /* StickControllerBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 97BE2ABF1548702100BF66CF /* StickControllerBase.mm */; }; - 97C875BA156E834100197738 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; 97C875BB156E834100197738 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; 97C875BC156E834100197738 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 97C875BD156E834100197738 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -1231,17 +1184,10 @@ 97C875C0156E834100197738 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C1C412DFF3610040B77D /* OpenGLES.framework */; }; 97C875C1156E834100197738 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0577C1D712DFF3910040B77D /* QuartzCore.framework */; }; 97DC9BBA1549CDAD003CDFFF /* control-layout.json in Resources */ = {isa = PBXBuildFile; fileRef = 97DC9BB91549CDAD003CDFFF /* control-layout.json */; }; - 97EE41621538A83B0072514D /* DISK1.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 97EE415B1538A83B0072514D /* DISK1.ADF */; }; - 97EE41631538A83B0072514D /* DISK2.ADF in Resources */ = {isa = PBXBuildFile; fileRef = 97EE415C1538A83B0072514D /* DISK2.ADF */; }; - 97EF9576153876CA001C01E6 /* kick.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057440D50FC2A4A7003BE251 /* kick.rom */; }; - 97EF9577153876CA001C01E6 /* kick13.rom in Resources */ = {isa = PBXBuildFile; fileRef = 057443290FC3C94F003BE251 /* kick13.rom */; }; - 97EF9578153876CA001C01E6 /* kick31.rom in Resources */ = {isa = PBXBuildFile; fileRef = 05F5F217112A54F1001530EC /* kick31.rom */; }; 97EF9580153876CA001C01E6 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 05789FB813B1436200A72F5F /* Entitlements.plist */; }; - 97EF9581153876CA001C01E6 /* MainWindow-Single.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */; }; - 97EF9582153876CA001C01E6 /* MainWindow-Single-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */; }; 97EF95BB153876CA001C01E6 /* DisaSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 051B238112C98EC8000C2800 /* DisaSupport.cpp */; }; 97EF95BC153876CA001C01E6 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD010F3D797C005B30DF /* m68k_intrf.cpp */; }; - 97EF95BD153876CA001C01E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 97EF95BD153876CA001C01E6 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.mm */; }; 97EF95BE153876CA001C01E6 /* autoconf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9D0F3D797C005B30DF /* autoconf.cpp */; }; 97EF95BF153876CA001C01E6 /* blitfunc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9E0F3D797C005B30DF /* blitfunc.cpp */; }; 97EF95C0153876CA001C01E6 /* blittable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BC9F0F3D797C005B30DF /* blittable.cpp */; }; @@ -1250,13 +1196,11 @@ 97EF95C3153876CA001C01E6 /* ersatz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA70F3D797C005B30DF /* ersatz.cpp */; }; 97EF95C4153876CA001C01E6 /* gfxutil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCA80F3D797C005B30DF /* gfxutil.cpp */; }; 97EF95C5153876CA001C01E6 /* keybuf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BCFA0F3D797C005B30DF /* keybuf.cpp */; }; - 97EF95C6153876CA001C01E6 /* famec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD060F3D797C005B30DF /* famec.cpp */; settings = {COMPILER_FLAGS = "-Wno-unused"; }; }; 97EF95C7153876CA001C01E6 /* m68k_intrf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */; }; 97EF95C8153876CA001C01E6 /* uae.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0C0F3D797C005B30DF /* uae.cpp */; }; 97EF95C9153876CA001C01E6 /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD0E0F3D797C005B30DF /* memory.cpp */; }; 97EF95CA153876CA001C01E6 /* fade.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD100F3D797C005B30DF /* fade.cpp */; }; 97EF95CB153876CA001C01E6 /* missing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD140F3D797C005B30DF /* missing.cpp */; }; - 97EF95CC153876CA001C01E6 /* od-joy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD150F3D797C005B30DF /* od-joy.cpp */; }; 97EF95CD153876CA001C01E6 /* savedisk.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD170F3D797C005B30DF /* savedisk.cpp */; }; 97EF95CE153876CA001C01E6 /* sdlgfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD190F3D797C005B30DF /* sdlgfx.cpp */; }; 97EF95CF153876CA001C01E6 /* vkbd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD1F0F3D797C005B30DF /* vkbd.cpp */; }; @@ -1264,7 +1208,7 @@ 97EF95D1153876CA001C01E6 /* zfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0552BD220F3D797C005B30DF /* zfile.cpp */; }; 97EF95D2153876CA001C01E6 /* iphone_main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 05743FC40FC293FD003BE251 /* iphone_main.mm */; }; 97EF95D3153876CA001C01E6 /* AudioQueueManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */; }; - 97EF95D4153876CA001C01E6 /* CocoaUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.m */; }; + 97EF95D4153876CA001C01E6 /* CocoaUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */; }; 97EF95D5153876CA001C01E6 /* MMStopWatch.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */; }; 97EF95D6153876CA001C01E6 /* fame_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2410636CBA0056A577 /* fame_arm.cpp */; settings = {COMPILER_FLAGS = "-frename-registers -Wno-unused"; }; }; 97EF95D7153876CA001C01E6 /* m68k_interface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 059E3A2610636CBA0056A577 /* m68k_interface.cpp */; }; @@ -1275,9 +1219,8 @@ 97EF95DE153876CA001C01E6 /* TouchHandlerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */; }; 97EF95EB153876CA001C01E6 /* SingleWindowAppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */; }; 97EF95EC153876CA001C01E6 /* BaseEmulationViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */; }; - 97EF95ED153876CA001C01E6 /* NSObject+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.m */; }; - 97EF95F0153876CA001C01E6 /* AnimatedImageSequenceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */; }; - 97EF95F4153876CA001C01E6 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 05084E4913D7FE7B0004617A /* libz.dylib */; }; + 97EF95ED153876CA001C01E6 /* NSObject+Blocks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */; }; + 97EF95F0153876CA001C01E6 /* AnimatedImageSequenceView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */; }; 97EF95F5153876CA001C01E6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 976877751534B2D20077B654 /* AudioToolbox.framework */; }; 97EF95F6153876CA001C01E6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 97EF95F7153876CA001C01E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; @@ -1293,46 +1236,70 @@ 97EF968C1538771F001C01E6 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 97EF963E1538771F001C01E6 /* icon.png */; }; 97EF968D1538771F001C01E6 /* icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 97EF963F1538771F001C01E6 /* icon@2x.png */; }; 97EF96A31538771F001C01E6 /* StoogesEmulationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 97EF96571538771F001C01E6 /* StoogesEmulationViewController.m */; }; + BE0921FF1B343D810058D9F2 /* DiskDriveService.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE0921FE1B343D810058D9F2 /* DiskDriveService.mm */; }; + BE17E1221D6C2E9A00221E7F /* CoreSettingGroupTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE17E1201D6C2E9A00221E7F /* CoreSettingGroupTests.m */; }; + BE17E1231D6C2E9A00221E7F /* CoreSettingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BE17E1211D6C2E9A00221E7F /* CoreSettingTests.m */; }; + BE2CA1E21C42219000B84C2C /* KeyButtonViewHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = BE2CA1E11C42219000B84C2C /* KeyButtonViewHandler.m */; }; + BE52EFAB1B4FC9B8008E15E6 /* DriveState.m in Sources */ = {isa = PBXBuildFile; fileRef = BE52EFA81B4FC9B8008E15E6 /* DriveState.m */; }; + BE5DE31E1C5CCD1400FF5D1D /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE5DE31D1C5CCD1400FF5D1D /* Default-568h@2x.png */; }; + BE6086D91C2CF5AC008E668B /* adfresolver.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE6086D81C2CF5AC008E668B /* adfresolver.mm */; }; + BE6537DA1C5F7E41007AD097 /* PKCustomKeyboard.xib in Resources */ = {isa = PBXBuildFile; fileRef = BE6537D91C5F7E41007AD097 /* PKCustomKeyboard.xib */; }; + BE6537DC1C5F7E59007AD097 /* PMCustomKeyboard.xib in Resources */ = {isa = PBXBuildFile; fileRef = BE6537DB1C5F7E59007AD097 /* PMCustomKeyboard.xib */; }; + BE66229A1C328442009C2809 /* KeyButtonManagementController.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE6622991C328442009C2809 /* KeyButtonManagementController.mm */; }; + BE66229D1C3285B3009C2809 /* KeyButtonConfigurationController.m in Sources */ = {isa = PBXBuildFile; fileRef = BE66229C1C3285B3009C2809 /* KeyButtonConfigurationController.m */; }; + BE6622A01C32861C009C2809 /* KeyButtonConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = BE66229F1C32861C009C2809 /* KeyButtonConfiguration.m */; }; + BE6F9F621C4E2C420061B98C /* VPadLeftOrRight.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE6F9F611C4E2C420061B98C /* VPadLeftOrRight.mm */; }; + BE951AF21CA93EC0008DD94B /* fsusage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE951AF11CA93EC0008DD94B /* fsusage.cpp */; }; + BE951AF41CA93F27008DD94B /* native2amiga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE951AF31CA93F27008DD94B /* native2amiga.cpp */; }; + BE951AF71CA93F86008DD94B /* scsi-none.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE951AF61CA93F86008DD94B /* scsi-none.cpp */; }; + BE951AFA1CA93FB7008DD94B /* fsdb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE951AF91CA93FB7008DD94B /* fsdb.cpp */; }; + BE951AFD1CA942B1008DD94B /* expansion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE951AFC1CA942B1008DD94B /* expansion.cpp */; }; + BE951B001CA9442A008DD94B /* fsdb_unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE951AFF1CA9442A008DD94B /* fsdb_unix.cpp */; }; + BEC5372C1DA144C9002C3793 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEC5372B1DA144C9002C3793 /* AVFoundation.framework */; }; + BECB5E221DA393B6000E5C2C /* AudioService.mm in Sources */ = {isa = PBXBuildFile; fileRef = BECB5E211DA393B6000E5C2C /* AudioService.mm */; }; + BECE7E0C1CB3E12600EBFB40 /* hardfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BECE7E0B1CB3E12600EBFB40 /* hardfile.cpp */; }; + BEE4172E1D6AA35E00E3ED45 /* ScrollToRowHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = BEE4172D1D6AA35E00E3ED45 /* ScrollToRowHandler.m */; }; + BEE41BC31B4782D200CE487D /* AdfImporter.mm in Sources */ = {isa = PBXBuildFile; fileRef = BEE41BC11B4782D200CE487D /* AdfImporter.mm */; }; + BEE41BC61B47836D00CE487D /* ZipArchive.mm in Sources */ = {isa = PBXBuildFile; fileRef = BEE41BC41B47836D00CE487D /* ZipArchive.mm */; }; + BEE41BD31B4784AC00CE487D /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = BEE41BCB1B4784AC00CE487D /* zip.c */; }; + BEE41BD41B4784AC00CE487D /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = BEE41BCD1B4784AC00CE487D /* unzip.c */; }; + BEE41BD51B4784AC00CE487D /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = BEE41BCF1B4784AC00CE487D /* mztools.c */; }; + BEE41BD61B4784AC00CE487D /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = BEE41BD11B4784AC00CE487D /* ioapi.c */; }; + BEEFB2DE1D72C6A00056CC8E /* MultiDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = BEEFB2DD1D72C6A00056CC8E /* MultiDictionary.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + BEF413D21CA411CF00CCC1F5 /* HardDriveService.mm in Sources */ = {isa = PBXBuildFile; fileRef = BEF413D11CA411CF00CCC1F5 /* HardDriveService.mm */; }; + BEF413D41CA414E700CCC1F5 /* filesys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEF413D31CA414E700CCC1F5 /* filesys.cpp */; }; + BEF413D61CA414F600CCC1F5 /* cfgfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEF413D51CA414F600CCC1F5 /* cfgfile.cpp */; }; E18F65E7154CAD470073642F /* Bazooka.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E18F65E6154CAD470073642F /* Bazooka.ttf */; }; E18F65EB154CB6960073642F /* intro_5.png in Resources */ = {isa = PBXBuildFile; fileRef = E18F65E8154CB6950073642F /* intro_5.png */; }; E18F65EC154CB6960073642F /* intro_5@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E18F65E9154CB6950073642F /* intro_5@2x.png */; }; E18F65ED154CB6960073642F /* intro_5~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = E18F65EA154CB6950073642F /* intro_5~ipad.png */; }; + E937D8A71CB58BC9008DCC27 /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E937D8A61CB58BC9008DCC27 /* CoreMotion.framework */; }; + E937D8AA1CB58C50008DCC27 /* VPadMotionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = E937D8A91CB58C50008DCC27 /* VPadMotionController.mm */; }; + E937D8B01CB58CE3008DCC27 /* VPadTouchOrGyro.mm in Sources */ = {isa = PBXBuildFile; fileRef = E937D8AF1CB58CE3008DCC27 /* VPadTouchOrGyro.mm */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + BE17E11A1D6C2E8200221E7F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1D6058900D05DD3D006BFB54; + remoteInfo = iUAE; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 0504155A0FCB46F000F46828 /* EmulationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulationViewController.h; sourceTree = ""; }; 0504155B0FCB46F000F46828 /* EmulationViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EmulationViewController.mm; sourceTree = ""; }; - 0504155D0FCB475C00F46828 /* InputControllerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputControllerView.h; sourceTree = ""; }; - 0504155E0FCB475C00F46828 /* InputControllerView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InputControllerView.mm; sourceTree = ""; }; - 0504155F0FCB475C00F46828 /* JoystickViewLandscape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JoystickViewLandscape.h; sourceTree = ""; }; - 050415600FCB475C00F46828 /* JoystickViewLandscape.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JoystickViewLandscape.mm; sourceTree = ""; }; + 0504155D0FCB475C00F46828 /* InputControllerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputControllerView.h; path = ../InputControllerView.h; sourceTree = ""; }; + 0504155E0FCB475C00F46828 /* InputControllerView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InputControllerView.mm; path = ../InputControllerView.mm; sourceTree = ""; }; 050415630FCB47B200F46828 /* CGVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGVector.h; sourceTree = ""; }; 050415640FCB47B200F46828 /* touchstick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = touchstick.h; sourceTree = ""; }; 050415690FCB4BD400F46828 /* CocoaUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CocoaUtility.h; sourceTree = ""; }; - 0504156A0FCB4BD400F46828 /* CocoaUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CocoaUtility.m; sourceTree = ""; }; + 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CocoaUtility.mm; sourceTree = ""; }; 0504156C0FCB4BE600F46828 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; 0506D73713CA7BF700559637 /* OldLondon.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = OldLondon.ttf; path = html/OldLondon.ttf; sourceTree = ""; }; 0506D73813CA7BF700559637 /* gpl.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = gpl.html; path = html/gpl.html; sourceTree = ""; }; - 05084E4913D7FE7B0004617A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; - 050B1742139C7A5D005C7736 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = ""; }; - 050B1744139C7D1E005C7736 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = ""; }; - 050B1745139C7D1E005C7736 /* SDL_joystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick_c.h; sourceTree = ""; }; - 050B1747139C7DF1005C7736 /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = ""; }; - 050B1748139C83A8005C7736 /* SDL_sysjoystick.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_sysjoystick.m; sourceTree = ""; }; - 050B174B139C849A005C7736 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = ""; }; - 050B174C139C84F2005C7736 /* SDL_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_error.c; sourceTree = ""; }; - 050B174D139C84F3005C7736 /* SDL_error_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error_c.h; sourceTree = ""; }; - 050B174F139C8F2E005C7736 /* SDL_events_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events_c.h; sourceTree = ""; }; - 050B1750139CACBB005C7736 /* SDLUIAccelerationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLUIAccelerationDelegate.h; sourceTree = ""; }; - 050B1751139CACBB005C7736 /* SDLUIAccelerationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLUIAccelerationDelegate.m; sourceTree = ""; }; - 050B1753139CACE9005C7736 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config_iphoneos.h; sourceTree = ""; }; - 050B1754139CAD0D005C7736 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_platform.h; sourceTree = ""; }; - 050B1755139CAD34005C7736 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = ""; }; - 050B1756139CAD35005C7736 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = ""; }; - 050B1757139CB443005C7736 /* ButtonStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonStates.h; sourceTree = ""; }; - 050B1758139CB444005C7736 /* ButtonStates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ButtonStates.m; sourceTree = ""; }; - 050B1759139CB444005C7736 /* iControlPadReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iControlPadReaderView.h; sourceTree = ""; }; - 050B175A139CB444005C7736 /* iControlPadReaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iControlPadReaderView.m; sourceTree = ""; }; 050C393B12C31B24000CE512 /* Disa.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Disa.c; sourceTree = ""; }; 050C393C12C31B24000CE512 /* Disa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Disa.h; sourceTree = ""; }; 050C3A9212C33D94000CE512 /* disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disassembler.h; sourceTree = ""; }; @@ -1340,14 +1307,10 @@ 051B237012C98B3B000C2800 /* DisaSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisaSupport.h; sourceTree = ""; }; 051B238112C98EC8000C2800 /* DisaSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisaSupport.cpp; sourceTree = ""; }; 051B266012CB0A14000C2800 /* DisaLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisaLogging.h; sourceTree = ""; }; - 052DE54A13DA909600CCCB01 /* SDL_NSObject+Blocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SDL_NSObject+Blocks.h"; sourceTree = ""; }; - 052DE54B13DA909600CCCB01 /* SDL_NSObject+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SDL_NSObject+Blocks.m"; sourceTree = ""; }; 053368B013B1BDD60012D55A /* SingleWindowAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SingleWindowAppDelegate.h; sourceTree = ""; }; 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SingleWindowAppDelegate.mm; sourceTree = ""; }; - 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "MainWindow-Single-iPad.xib"; sourceTree = ""; }; 053368B513B1CC980012D55A /* BaseEmulationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseEmulationViewController.h; sourceTree = ""; }; 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BaseEmulationViewController.mm; sourceTree = ""; }; - 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "MainWindow-Single.xib"; sourceTree = ""; }; 0533695113B1DEE90012D55A /* DotC.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DotC.app; sourceTree = BUILT_PRODUCTS_DIR; }; 0533695A13B1DFC00012D55A /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = ""; }; 0533695B13B1DFC00012D55A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; @@ -1405,7 +1368,6 @@ 0552BCDC0F3D797C005B30DF /* gensound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gensound.h; sourceTree = ""; }; 0552BCDD0F3D797C005B30DF /* gui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gui.h; sourceTree = ""; }; 0552BCDF0F3D797C005B30DF /* imask_tab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = imask_tab.h; sourceTree = ""; }; - 0552BCE00F3D797C005B30DF /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = ""; }; 0552BCE10F3D797C005B30DF /* keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyboard.h; sourceTree = ""; }; 0552BCE20F3D797C005B30DF /* keybuf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keybuf.h; sourceTree = ""; }; 0552BCE30F3D797C005B30DF /* maccess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = maccess.h; sourceTree = ""; }; @@ -1428,8 +1390,6 @@ 0552BD020F3D797C005B30DF /* memhandlers.s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = memhandlers.s; sourceTree = ""; }; 0552BD030F3D797C005B30DF /* debug_m68k.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug_m68k.h; sourceTree = ""; }; 0552BD050F3D797C005B30DF /* fame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fame.h; sourceTree = ""; }; - 0552BD060F3D797C005B30DF /* famec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = famec.cpp; sourceTree = ""; }; - 0552BD070F3D797C005B30DF /* famec_debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = famec_debug.cpp; sourceTree = ""; }; 0552BD080F3D797C005B30DF /* famec_opcodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = famec_opcodes.h; sourceTree = ""; }; 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = m68k_intrf.cpp; sourceTree = ""; }; 0552BD0A0F3D797C005B30DF /* m68k_cmn_intrf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = m68k_cmn_intrf.cpp; sourceTree = ""; }; @@ -1441,7 +1401,6 @@ 0552BD120F3D797C005B30DF /* menu_load.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menu_load.cpp; sourceTree = ""; }; 0552BD130F3D797C005B30DF /* msg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msg.h; sourceTree = ""; }; 0552BD140F3D797C005B30DF /* missing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = missing.cpp; sourceTree = ""; }; - 0552BD150F3D797C005B30DF /* od-joy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "od-joy.cpp"; sourceTree = ""; }; 0552BD160F3D797C005B30DF /* save_icon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = save_icon.h; sourceTree = ""; }; 0552BD170F3D797C005B30DF /* savedisk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = savedisk.cpp; sourceTree = ""; }; 0552BD180F3D797C005B30DF /* savedisk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = savedisk.h; sourceTree = ""; }; @@ -1454,11 +1413,6 @@ 0552BD200F3D797C005B30DF /* vkbd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vkbd.h; sourceTree = ""; }; 0552BD210F3D797C005B30DF /* writelog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = writelog.cpp; sourceTree = ""; }; 0552BD220F3D797C005B30DF /* zfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = zfile.cpp; sourceTree = ""; }; - 055E446412E56235003119A8 /* OGLShaderProgram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OGLShaderProgram.h; sourceTree = ""; }; - 055E446512E56235003119A8 /* OGLShaderProgram.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OGLShaderProgram.m; sourceTree = ""; }; - 055E44AB12E56BF7003119A8 /* Simple.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Simple.frag; sourceTree = ""; }; - 055E44AF12E56DA5003119A8 /* NoEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoEffect.h; sourceTree = ""; }; - 055E44B012E56DA5003119A8 /* NoEffect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoEffect.m; sourceTree = ""; }; 055FD7CE13B3E86E00BB3F8B /* EmulationView-iPhone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "EmulationView-iPhone.xib"; sourceTree = ""; }; 055FD7D013B3E8D200BB3F8B /* btn_close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_close.png; sourceTree = ""; }; 055FD7D113B3E8D200BB3F8B /* btn_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_close@2x.png"; sourceTree = ""; }; @@ -1480,18 +1434,10 @@ 055FD7F113B4029900BB3F8B /* bg_web.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg_web.png; sourceTree = ""; }; 055FD7F213B4029900BB3F8B /* bg_web@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web@2x.png"; sourceTree = ""; }; 055FD7F713B45AAA00BB3F8B /* AnimatedImageSequenceView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimatedImageSequenceView.h; sourceTree = ""; }; - 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnimatedImageSequenceView.m; sourceTree = ""; }; + 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AnimatedImageSequenceView.mm; sourceTree = ""; }; 056089BA13C235F200677A6C /* iscroll4.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = iscroll4.js; path = html/iscroll4.js; sourceTree = ""; }; - 05619ED813ADE1AA00341DB0 /* SelectHardware.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectHardware.h; sourceTree = ""; }; - 05619ED913ADE1AA00341DB0 /* SelectHardware.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectHardware.m; sourceTree = ""; }; - 05619EDA13ADE1AA00341DB0 /* SelectHardware.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SelectHardware.xib; sourceTree = ""; }; - 05650B1713AC8799003CC181 /* iCadeReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iCadeReaderView.h; sourceTree = ""; }; - 05650B1813AC8799003CC181 /* iCadeReaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iCadeReaderView.m; sourceTree = ""; }; - 05650B1913AC8799003CC181 /* iCadeState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iCadeState.h; sourceTree = ""; }; 05743FC30FC293FD003BE251 /* iphone_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iphone_main.h; sourceTree = ""; }; 05743FC40FC293FD003BE251 /* iphone_main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iphone_main.mm; sourceTree = ""; }; - 057440D50FC2A4A7003BE251 /* kick.rom */ = {isa = PBXFileReference; lastKnownFileType = file; path = kick.rom; sourceTree = ""; }; - 057443290FC3C94F003BE251 /* kick13.rom */ = {isa = PBXFileReference; lastKnownFileType = file; path = kick13.rom; sourceTree = ""; }; 0577C0D912DED4A60040B77D /* AsyncSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncSocket.h; sourceTree = ""; }; 0577C0DA12DED4A60040B77D /* AsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AsyncSocket.m; sourceTree = ""; }; 0577C0E412DED4DF0040B77D /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; @@ -1499,22 +1445,7 @@ 0577C0F812DED4FD0040B77D /* UaeDebugger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UaeDebugger.m; sourceTree = ""; }; 0577C1C412DFF3610040B77D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 0577C1D712DFF3910040B77D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 0577C28A12E15AB30040B77D /* esUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = esUtil.h; sourceTree = ""; }; - 0577C28B12E15AB30040B77D /* ImageUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImageUtils.m; sourceTree = ""; }; - 0577C28C12E15AB30040B77D /* OGLDisplay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OGLDisplay.h; sourceTree = ""; }; - 0577C28D12E15AB30040B77D /* OGLDisplay.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OGLDisplay.m; sourceTree = ""; }; - 0577C29012E15AE10040B77D /* Simple.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = Simple.vert; sourceTree = ""; }; - 0577C29412E15B590040B77D /* DisplayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisplayView.h; sourceTree = ""; }; - 0577C29512E15B590040B77D /* DisplayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DisplayView.m; sourceTree = ""; }; - 0577C29712E15B930040B77D /* UIKitDisplayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitDisplayView.h; sourceTree = ""; }; - 0577C34712E1723F0040B77D /* Scanlines (50%).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Scanlines (50%).png"; sourceTree = ""; }; - 0577C34812E1723F0040B77D /* Scanlines (100%).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Scanlines (100%).png"; sourceTree = ""; }; - 0577C34912E1723F0040B77D /* Aperture (1x2 RB).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Aperture (1x2 RB).png"; sourceTree = ""; }; - 0577C34A12E1723F0040B77D /* Aperture (1x3 RB).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Aperture (1x3 RB).png"; sourceTree = ""; }; - 0577C34B12E1723F0040B77D /* Aperture (2x4 BG).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Aperture (2x4 BG).png"; sourceTree = ""; }; - 0577C34C12E1723F0040B77D /* Aperture (2x4 RB).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Aperture (2x4 RB).png"; sourceTree = ""; }; - 0577C34D12E1723F0040B77D /* Aperture (4x6).png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Aperture (4x6).png"; sourceTree = ""; }; - 05789FB813B1436200A72F5F /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Entitlements.plist; sourceTree = ""; }; + 05789FB813B1436200A72F5F /* Entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Entitlements.plist; path = iUAEParents/Entitlements.plist; sourceTree = ""; }; 057B0D4A0FD0D0ED00D549AD /* MMStopWatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMStopWatch.h; sourceTree = ""; }; 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMStopWatch.m; sourceTree = ""; }; 057B26A113B30CB4006BB230 /* chrome-bottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-bottom.png"; sourceTree = ""; }; @@ -1522,36 +1453,19 @@ 057B26A313B30CB4006BB230 /* chrome-top.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top.png"; sourceTree = ""; }; 057B26A413B30CB4006BB230 /* chrome-top@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top@2x.png"; sourceTree = ""; }; 057B26B313B325AB006BB230 /* NSObject+Blocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+Blocks.h"; sourceTree = ""; }; - 057B26B413B325AB006BB230 /* NSObject+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+Blocks.m"; sourceTree = ""; }; + 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSObject+Blocks.mm"; sourceTree = ""; }; 057B976B13CEC7D60065278D /* intro_1~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_1~ipad.png"; sourceTree = ""; }; 057B976C13CEC7D60065278D /* intro_2~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_2~ipad.png"; sourceTree = ""; }; 057B976D13CEC7D60065278D /* intro_3~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_3~ipad.png"; sourceTree = ""; }; 057B976E13CEC7D60065278D /* intro_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_4.png; sourceTree = ""; }; 057B976F13CEC7D60065278D /* intro_4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4@2x.png"; sourceTree = ""; }; 057B977013CEC7D60065278D /* intro_4~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4~ipad.png"; sourceTree = ""; }; - 058063CF13B06DD800E00B04 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = ""; }; - 0583DCFB12D18BB1000E97CE /* SDL.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SDL.mm; sourceTree = ""; }; - 0583DCFE12D18BBB000E97CE /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_endian.h; sourceTree = ""; }; - 0583DCFF12D18BBB000E97CE /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = ""; }; - 0583DD0012D18BBB000E97CE /* sdl_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdl_internal.h; sourceTree = ""; }; - 0583DD0112D18BBB000E97CE /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = ""; }; - 0583DD2512D18FD9000E97CE /* SDL_events.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SDL_events.mm; sourceTree = ""; }; + 058063CF13B06DD800E00B04 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon-72.png"; path = "iUAEParents/Icon-72.png"; sourceTree = ""; }; 0583DE5612D1A3AC000E97CE /* TouchHandlerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TouchHandlerView.h; sourceTree = ""; }; 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TouchHandlerView.m; sourceTree = ""; }; - 0583DE5A12D1A433000E97CE /* SDL_mouse_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse_c.h; sourceTree = ""; }; - 0583DE5B12D1A433000E97CE /* SDL_mouse_c.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_mouse_c.c; sourceTree = ""; }; - 0583DE6B12D1A510000E97CE /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_config.h; sourceTree = ""; }; - 0583DE6D12D1A533000E97CE /* SDL_sysvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysvideo.h; sourceTree = ""; }; - 0583DE9112D1A825000E97CE /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keysym.h; sourceTree = ""; }; - 0583DE9712D1A850000E97CE /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = ""; }; - 0583DEB112D1A95D000E97CE /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_stdinc.h; sourceTree = ""; }; - 0583DF0112D1AB75000E97CE /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_video.h; sourceTree = ""; }; - 0583DF6412D1AFB4000E97CE /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = ""; }; 0585D55D1091640900C1E4C1 /* VirtualKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualKeyboard.h; sourceTree = ""; }; - 0585D55E1091640900C1E4C1 /* VirtualKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VirtualKeyboard.m; sourceTree = ""; }; 0585D5601091653E00C1E4C1 /* KeyView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyView.h; sourceTree = ""; }; 0585D5611091653E00C1E4C1 /* KeyView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyView.m; sourceTree = ""; }; - 059A411C12697B33003B23C7 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = ""; }; 059C0E2313B99DEE00E89B35 /* bg_web~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web~ipad.png"; sourceTree = ""; }; 059C0E2413B99DEE00E89B35 /* btn_close~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_close~ipad.png"; sourceTree = ""; }; 059C0E2513B99DEE00E89B35 /* btn_menu~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_menu~ipad.png"; sourceTree = ""; }; @@ -1603,43 +1517,165 @@ 05BC1AEF1073448200EABC6E /* EMUFileGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EMUFileGroup.m; sourceTree = ""; }; 05BC1AF01073448200EABC6E /* EMUFileInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EMUFileInfo.h; sourceTree = ""; }; 05BC1AF11073448200EABC6E /* EMUFileInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EMUFileInfo.m; sourceTree = ""; }; - 05BC1AF21073448200EABC6E /* EMUROMBrowserView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EMUROMBrowserView.xib; sourceTree = ""; }; 05BC1AF31073448200EABC6E /* EMUROMBrowserViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EMUROMBrowserViewController.h; sourceTree = ""; }; 05BC1AF41073448200EABC6E /* EMUROMBrowserViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EMUROMBrowserViewController.mm; sourceTree = ""; }; 05BC1B15107348E500EABC6E /* keys.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keys.png; sourceTree = ""; }; 05BC1B16107348E500EABC6E /* VKBD.PNG */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = VKBD.PNG; sourceTree = ""; }; - 05BC1B1A10734C3B00EABC6E /* SettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsController.h; sourceTree = ""; }; - 05BC1B1B10734C3B00EABC6E /* SettingsController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsController.mm; sourceTree = ""; }; - 05BC1B1C10734C3B00EABC6E /* SettingsController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingsController.xib; sourceTree = ""; }; - 05D51FB012E7DA4E007912AE /* CRT.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = CRT.frag; sourceTree = ""; }; - 05D51FB212E7DA86007912AE /* TexturedCRTEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TexturedCRTEffect.h; sourceTree = ""; }; - 05D51FB312E7DA86007912AE /* TexturedCRTEffect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TexturedCRTEffect.m; sourceTree = ""; }; - 05D5205112E7E03C007912AE /* OGLTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OGLTypes.h; sourceTree = ""; }; 05D5233412E8030E007912AE /* SelectEffectController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectEffectController.h; sourceTree = ""; }; - 05D5233512E8030E007912AE /* SelectEffectController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectEffectController.m; sourceTree = ""; }; - 05D5233612E8030E007912AE /* SelectEffectController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SelectEffectController.xib; sourceTree = ""; }; - 05D6044912AF2D620048E478 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; - 05D6044A12AF2D620048E478 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = ""; }; + 05D5233512E8030E007912AE /* SelectEffectController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SelectEffectController.mm; sourceTree = ""; }; + 05D6044912AF2D620048E478 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = iUAEParents/Icon.png; sourceTree = ""; }; + 05D6044A12AF2D620048E478 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "iUAEParents/Icon@2x.png"; sourceTree = ""; }; 05E6A3250FC3DAA90086151B /* sound_iphone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sound_iphone.cpp; sourceTree = ""; }; 05E8A04312B2C884005532AF /* amiga-beige-dark-center.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "amiga-beige-dark-center.png"; sourceTree = ""; }; 05E8A04412B2C884005532AF /* amiga-beige-dark-left.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "amiga-beige-dark-left.png"; sourceTree = ""; }; 05E8A04512B2C884005532AF /* amiga-beige-dark-right.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "amiga-beige-dark-right.png"; sourceTree = ""; }; 05E8A04912B2C8E9005532AF /* amiga-beige-dark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "amiga-beige-dark.png"; sourceTree = ""; }; 05ECEA061091A85B001A71D0 /* CNSRecursiveLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNSRecursiveLock.h; sourceTree = ""; }; - 05F5F217112A54F1001530EC /* kick31.rom */ = {isa = PBXFileReference; lastKnownFileType = file; path = kick31.rom; sourceTree = ""; }; 05FE7F260FC3EDBF00DBFECF /* AudioQueueManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioQueueManager.h; sourceTree = ""; }; 05FE7F270FC3EDBF00DBFECF /* AudioQueueManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioQueueManager.cpp; sourceTree = ""; }; 05FE7F290FC3EDC800DBFECF /* RingQ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RingQ.h; sourceTree = ""; }; 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 1D3623240D0F684500981E51 /* iAmigaAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iAmigaAppDelegate.h; sourceTree = ""; }; 1D3623250D0F684500981E51 /* iAmigaAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iAmigaAppDelegate.mm; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* iAmiga.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iAmiga.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1D6058910D05DD3D006BFB54 /* iUAE.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iUAE.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* iAmiga_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iAmiga_Prefix.pch; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = main.mm; path = iUAEParents/main.mm; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* iUAE_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iUAE_Prefix.pch; sourceTree = ""; }; + 7E079CBF1A81594B00EC0DE4 /* AddConfigurationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddConfigurationViewController.h; path = Classes/AddConfigurationViewController.h; sourceTree = SOURCE_ROOT; }; + 7E079CC01A81594B00EC0DE4 /* AddConfigurationViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AddConfigurationViewController.mm; path = Classes/AddConfigurationViewController.mm; sourceTree = SOURCE_ROOT; }; + 7E0E9593198ACF4C0082F80F /* iOSKeyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = iOSKeyboard.png; sourceTree = ""; }; + 7E10738A1A34E85E000D7269 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Storyboard.storyboard; path = ../../Storyboard.storyboard; sourceTree = ""; }; + 7E1A15901B171D7E00F0EA17 /* JoypadKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JoypadKey.h; sourceTree = ""; }; + 7E1B8C3319FADFD400B6136B /* modejoy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modejoy.png; sourceTree = ""; }; + 7E1B8C3519FADFD400B6136B /* modejoypressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modejoypressed.png; sourceTree = ""; }; + 7E1B8C3719FADFD400B6136B /* modekeyoff.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modekeyoff.png; sourceTree = ""; }; + 7E1B8C3919FADFD400B6136B /* modekeyon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = modekeyon.png; sourceTree = ""; }; + 7E1B8C3B19FADFD400B6136B /* options.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = options.png; sourceTree = ""; }; + 7E1B8C4919FAE04700B6136B /* unsticky.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unsticky.png; sourceTree = ""; }; + 7E21F5C31A3F784E000D9AD2 /* gamepad_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gamepad_selected.png; sourceTree = ""; }; + 7E2665501C483AEB004250D1 /* monitor_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = monitor_unselected.png; sourceTree = ""; }; + 7E2665511C483AEB004250D1 /* monitor_selected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = monitor_selected_svg.svg; sourceTree = ""; }; + 7E2665521C483AEB004250D1 /* monitor_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = monitor_selected.png; sourceTree = ""; }; + 7E27C39B1AA3A61900C00584 /* display.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = display.png; sourceTree = ""; }; + 7E27C39D1AA3A6D300C00584 /* SettingsDisplayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsDisplayController.h; sourceTree = ""; }; + 7E27C39E1AA3A6D300C00584 /* SettingsDisplayController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsDisplayController.mm; sourceTree = ""; }; + 7E2A59AF1B052C3300C802E0 /* SettingsJoypadController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsJoypadController.h; sourceTree = SOURCE_ROOT; }; + 7E2A59B01B052C3300C802E0 /* SettingsJoypadController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsJoypadController.mm; sourceTree = SOURCE_ROOT; }; + 7E2EF0DB1D004B9500CDD9B9 /* iUAEApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iUAEApplication.h; sourceTree = ""; }; + 7E2EF0DC1D004B9500CDD9B9 /* iUAEApplication.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iUAEApplication.mm; sourceTree = ""; }; + 7E3C13E31A51F16600534164 /* SettingsGeneralController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsGeneralController.h; sourceTree = ""; }; + 7E3C13E41A51F16600534164 /* SettingsGeneralController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsGeneralController.mm; sourceTree = ""; }; + 7E43484E1A3B7C6100C60BF1 /* keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard.png; sourceTree = ""; }; + 7E48A5941D10899200198C28 /* od-joy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "od-joy.h"; sourceTree = ""; }; + 7E4B18D4188B1C720019E82B /* chrome-bottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "chrome-bottom.png"; path = "TargetSpecific/DotC/chrome-bottom.png"; sourceTree = SOURCE_ROOT; }; + 7E4B18D6188B1CAB0019E82B /* chrome-top@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "chrome-top@2x.png"; path = "TargetSpecific/DotC/chrome-top@2x.png"; sourceTree = SOURCE_ROOT; }; + 7E4B18D7188B1CAB0019E82B /* chrome-top~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "chrome-top~ipad.png"; path = "TargetSpecific/DotC/chrome-top~ipad.png"; sourceTree = SOURCE_ROOT; }; + 7E4B18DA188B1CBE0019E82B /* chrome-bottom@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "chrome-bottom@2x.png"; path = "TargetSpecific/DotC/chrome-bottom@2x.png"; sourceTree = SOURCE_ROOT; }; + 7E4B18DC188B1CD70019E82B /* btn_restart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = btn_restart.png; path = TargetSpecific/DotC/btn_restart.png; sourceTree = SOURCE_ROOT; }; + 7E4B18DD188B1CD70019E82B /* btn_restart@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "btn_restart@2x.png"; path = "TargetSpecific/DotC/btn_restart@2x.png"; sourceTree = SOURCE_ROOT; }; + 7E4B18DE188B1CD70019E82B /* btn_restart~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "btn_restart~ipad.png"; path = "TargetSpecific/DotC/btn_restart~ipad.png"; sourceTree = SOURCE_ROOT; }; + 7E4B18EA188B1E8D0019E82B /* chrome-bottom~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "chrome-bottom~ipad.png"; path = "TargetSpecific/DotC/chrome-bottom~ipad.png"; sourceTree = SOURCE_ROOT; }; + 7E4C6AF519DB0F7100D337D0 /* famec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = famec.cpp; sourceTree = ""; }; + 7E4C6AF619DB0F7100D337D0 /* famec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = famec.h; sourceTree = ""; }; + 7E4C6AF819DB116B00D337D0 /* memory-uae.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "memory-uae.h"; sourceTree = ""; }; + 7E4D0FBE1CF4E8F600758750 /* VirtualKeyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VirtualKeyboard.mm; sourceTree = ""; }; + 7E54BB1E1AA3362E0054F6B2 /* MFIControllerReaderView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MFIControllerReaderView.mm; path = "../../libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.mm"; sourceTree = ""; }; + 7E54BB1F1AA3362E0054F6B2 /* MFIControllerReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MFIControllerReaderView.h; path = "../../libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.h"; sourceTree = ""; }; + 7E5A77011D00370E009BF491 /* ExternalAccessory.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExternalAccessory.framework; path = System/Library/Frameworks/ExternalAccessory.framework; sourceTree = SDKROOT; }; + 7E5AF5FB1C444854000BF5CB /* sticky_unselected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sticky_unselected_svg.svg; sourceTree = ""; }; + 7E5AF5FC1C444854000BF5CB /* sticky_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sticky_unselected.png; sourceTree = ""; }; + 7E5AF5FD1C444854000BF5CB /* sticky_selected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = sticky_selected_svg.svg; sourceTree = ""; }; + 7E5AF5FE1C444854000BF5CB /* sticky_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sticky_selected.png; sourceTree = ""; }; + 7E5AF5FF1C444854000BF5CB /* keyboard_unselected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = keyboard_unselected_svg.svg; sourceTree = ""; }; + 7E5AF6011C444854000BF5CB /* keyboard_selected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = keyboard_selected_svg.svg; sourceTree = ""; }; + 7E5AF6021C444854000BF5CB /* keyboard_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard_selected.png; sourceTree = ""; }; + 7E5AF6031C444854000BF5CB /* gear_unselected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gear_unselected_svg.svg; sourceTree = ""; }; + 7E5AF6051C444854000BF5CB /* gear_selected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gear_selected_svg.svg; sourceTree = ""; }; + 7E5AF6061C444854000BF5CB /* gear_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gear_selected.png; sourceTree = ""; }; + 7E5AF6071C444854000BF5CB /* controller_unselected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = controller_unselected_svg.svg; sourceTree = ""; }; + 7E5AF6081C444854000BF5CB /* controller_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = controller_unselected.png; sourceTree = ""; }; + 7E5AF6091C444854000BF5CB /* controller_selected_svg.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = controller_selected_svg.svg; sourceTree = ""; }; + 7E5AF60A1C444854000BF5CB /* controller_selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = controller_selected.png; sourceTree = ""; }; + 7E5AF61D1C444C65000BF5CB /* keyboard_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard_unselected.png; sourceTree = ""; }; + 7E5AF61F1C444C83000BF5CB /* gear_unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gear_unselected.png; sourceTree = ""; }; + 7E66C1C01C5E1E89008B34D0 /* SettingsJoypadMainController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsJoypadMainController.h; sourceTree = ""; }; + 7E66C1C11C5E1E89008B34D0 /* SettingsJoypadMainController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsJoypadMainController.mm; sourceTree = ""; }; + 7E6BCCD91D591DA900826CBD /* SettingsMouseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsMouseController.h; sourceTree = ""; }; + 7E6BCCDA1D591DA900826CBD /* SettingsMouseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsMouseController.m; sourceTree = ""; }; + 7E6F37771CDB4E58005BA173 /* SettingsSelectPortViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsSelectPortViewController.h; sourceTree = ""; }; + 7E6F37781CDB4E58005BA173 /* SettingsSelectPortViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsSelectPortViewController.mm; sourceTree = ""; }; + 7E770D771D109BF4000E5E1A /* UnappliedSettingLabelHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnappliedSettingLabelHandler.h; sourceTree = ""; }; + 7E770D781D109BF4000E5E1A /* UnappliedSettingLabelHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UnappliedSettingLabelHandler.m; sourceTree = ""; }; + 7E770D7A1D109DEC000E5E1A /* CoreSetting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreSetting.h; sourceTree = ""; }; + 7E770D7B1D109DEC000E5E1A /* CoreSetting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreSetting.m; sourceTree = ""; }; + 7E7936981D9D5FC5003274B4 /* constSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = constSettings.h; sourceTree = ""; }; + 7E8C24F11EA0E31300673701 /* rom.key */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rom.key; path = ../../../Desktop/rom.key; sourceTree = ""; }; + 7E922A7F1CF0AD6000D8006F /* touchstick.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = touchstick.mm; sourceTree = ""; }; + 7EA4D6491923EC9700C58BB9 /* BaseWebviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseWebviewController.h; path = iUAEParents/BaseWebviewController.h; sourceTree = ""; }; + 7EA4D64A1923EC9700C58BB9 /* BaseWebviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BaseWebviewController.m; path = iUAEParents/BaseWebviewController.m; sourceTree = ""; }; + 7EA4D64E1923ECB400C58BB9 /* IOSKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOSKeyboard.h; path = iUAEParents/IOSKeyboard.h; sourceTree = ""; }; + 7EA4D64F1923ECB400C58BB9 /* IOSKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IOSKeyboard.m; path = iUAEParents/IOSKeyboard.m; sourceTree = ""; }; + 7EA4D6511923ECC100C58BB9 /* EmulationView-iPad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "EmulationView-iPad.mm"; path = "iUAEParents/EmulationView-iPad.mm"; sourceTree = ""; }; + 7EA4D6521923ECC100C58BB9 /* EmulationView-iPhone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "EmulationView-iPhone.h"; path = "iUAEParents/EmulationView-iPhone.h"; sourceTree = ""; }; + 7EA4D6531923ECC100C58BB9 /* EmulationView-iPhone.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "EmulationView-iPhone.mm"; path = "iUAEParents/EmulationView-iPhone.mm"; sourceTree = ""; }; + 7EA4D6541923ECC100C58BB9 /* MainEmulationViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MainEmulationViewController.mm; path = iUAEParents/MainEmulationViewController.mm; sourceTree = ""; }; + 7EA4D6561923ECC100C58BB9 /* TouchHandlerViewClassic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TouchHandlerViewClassic.m; path = iUAEParents/TouchHandlerViewClassic.m; sourceTree = ""; }; + 7EA4D65F1923ED0800C58BB9 /* EmulationView-iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "EmulationView-iPad.h"; path = "iUAEParents/EmulationView-iPad.h"; sourceTree = ""; }; + 7EA4D6621923EDA100C58BB9 /* TouchHandlerViewClassic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TouchHandlerViewClassic.h; path = iUAEParents/TouchHandlerViewClassic.h; sourceTree = ""; }; + 7EA4D6651923EDBE00C58BB9 /* MainEmulationViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MainEmulationViewController.h; path = iUAEParents/MainEmulationViewController.h; sourceTree = ""; }; + 7EA5AC5A18AAC5920072820E /* BaseNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = ""; }; + 7EA5AC5B18AAC5920072820E /* BaseNavigationController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BaseNavigationController.mm; sourceTree = ""; }; + 7EA5E7881AED732500FCE311 /* sticky.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sticky.png; sourceTree = ""; }; + 7EAA9D9C192541D400541BE1 /* Specialkeyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Specialkeyboard.png; sourceTree = ""; }; + 7EAA9DA4192541D400541BE1 /* PKCustomKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PKCustomKeyboard.h; sourceTree = ""; }; + 7EAA9DA5192541D400541BE1 /* PKCustomKeyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PKCustomKeyboard.mm; sourceTree = ""; }; + 7EAA9DB4192541D400541BE1 /* PMCustomKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PMCustomKeyboard.h; sourceTree = ""; }; + 7EAA9DB5192541D400541BE1 /* PMCustomKeyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PMCustomKeyboard.mm; sourceTree = ""; }; + 7EADD3141CB2FAA100136978 /* JoypadSelectionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JoypadSelectionController.h; sourceTree = ""; }; + 7EADD3151CB2FAA100136978 /* JoypadSelectionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JoypadSelectionController.mm; sourceTree = ""; }; + 7EB017631B09115900C74B9D /* StateManagementController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StateManagementController.mm; sourceTree = ""; }; + 7EB017641B09115900C74B9D /* StateManagementController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StateManagementController.h; sourceTree = ""; }; + 7EB0176B1B09143000C74B9D /* SVProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVProgressHUD.m; path = Submodules/SVProgressHUD/SVProgressHUD/SVProgressHUD.m; sourceTree = ""; }; + 7EB0176C1B09143000C74B9D /* SVProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVProgressHUD.h; path = Submodules/SVProgressHUD/SVProgressHUD/SVProgressHUD.h; sourceTree = ""; }; + 7EB0176D1B09143000C74B9D /* SVProgressHUD.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = SVProgressHUD.bundle; path = Submodules/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle; sourceTree = ""; }; + 7EB0176E1B09143000C74B9D /* SVProgressHUD-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SVProgressHUD-Prefix.pch"; path = "Submodules/SVProgressHUD/SVProgressHUD/SVProgressHUD-Prefix.pch"; sourceTree = ""; }; + 7EB0176F1B09143000C74B9D /* SVIndefiniteAnimatedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SVIndefiniteAnimatedView.m; path = Submodules/SVProgressHUD/SVProgressHUD/SVIndefiniteAnimatedView.m; sourceTree = ""; }; + 7EB017701B09143000C74B9D /* SVIndefiniteAnimatedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVIndefiniteAnimatedView.h; path = Submodules/SVProgressHUD/SVProgressHUD/SVIndefiniteAnimatedView.h; sourceTree = ""; }; + 7EB017741B09164900C74B9D /* StateFileManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StateFileManager.mm; sourceTree = ""; }; + 7EB017751B09164900C74B9D /* StateFileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StateFileManager.h; sourceTree = ""; }; + 7EB017761B09164900C74B9D /* State.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = State.mm; sourceTree = ""; }; + 7EB017771B09164900C74B9D /* State.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = State.h; sourceTree = ""; }; + 7EB0177F1B0921B000C74B9D /* SettingsSelectKeyViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsSelectKeyViewController.mm; sourceTree = ""; }; + 7EB372E91A0FC8DE001B460A /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = System/Library/Frameworks/GameController.framework; sourceTree = SDKROOT; }; + 7EC59ED01BAC52390097B87A /* SettingsJoypadStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsJoypadStyle.h; sourceTree = ""; }; + 7EC59ED11BAC52390097B87A /* SettingsJoypadStyle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsJoypadStyle.mm; sourceTree = ""; }; + 7ECAB5CB19DB20D000B05FF3 /* famec_jumptable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = famec_jumptable.h; sourceTree = ""; }; + 7ED40F1D1A3E1C9300E0E1F8 /* gamepad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = gamepad.png; sourceTree = ""; }; + 7ED69CFA1A6D9D9B00059F7D /* DiskAssociationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskAssociationViewController.h; sourceTree = ""; }; + 7ED69CFB1A6D9DAF00059F7D /* DiskAssociationViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskAssociationViewController.mm; sourceTree = ""; }; + 7ED7ACAA1E92C9760041C2A4 /* SettingHardwareController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingHardwareController.h; sourceTree = ""; }; + 7ED7ACAB1E92C9760041C2A4 /* SettingHardwareController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingHardwareController.m; sourceTree = ""; }; + 7EDA12161CDB39640002B670 /* SettingsSelectKeyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsSelectKeyViewController.h; sourceTree = ""; }; + 7EDCD04D1C3C59420006EB50 /* JoypadMainSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JoypadMainSettingsController.h; sourceTree = ""; }; + 7EDCD04E1C3C59420006EB50 /* JoypadMainSettingsController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JoypadMainSettingsController.mm; sourceTree = ""; }; + 7EE0D0431AACF2090081DAA5 /* Settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Settings.h; path = ../iUAEParents/Settings.h; sourceTree = ""; }; + 7EE0D0441AACF2090081DAA5 /* Settings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Settings.mm; path = ../iUAEParents/Settings.mm; sourceTree = ""; }; + 7EEFD2901BAC3DE300C7F247 /* VPadLeftOrRight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPadLeftOrRight.h; sourceTree = ""; }; + 7EF076621B9B2C7A00224DF0 /* SettingsJoypadVpadController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsJoypadVpadController.h; sourceTree = ""; }; + 7EF076631B9B2C7A00224DF0 /* SettingsJoypadVpadController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsJoypadVpadController.mm; sourceTree = ""; }; + 7EF0C8D11E89ADBD00531AE3 /* Ram_Unselected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Ram_Unselected.png; sourceTree = ""; }; + 7EF0C8D21E89ADBD00531AE3 /* Ram-Selected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Ram-Selected.png"; sourceTree = ""; }; + 7EF2F7B91D2805D50019A579 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = ""; }; + 7EF2F7BA1D2807600019A579 /* od-joy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "od-joy.mm"; sourceTree = ""; }; + 7EF2F7BC1D2807B00019A579 /* joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = joystick.h; sourceTree = ""; }; + 7EF97ABB1A7586E7002CC332 /* SelectConfigurationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectConfigurationViewController.h; path = ../SelectConfigurationViewController.h; sourceTree = ""; }; + 7EF97ABC1A7586E7002CC332 /* SelectConfigurationViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectConfigurationViewController.mm; path = ../SelectConfigurationViewController.mm; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9064AD541C7D09FA004CAE28 /* MultipeerConnectivity.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MultipeerConnectivity.framework; path = System/Library/Frameworks/MultipeerConnectivity.framework; sourceTree = SDKROOT; }; + 9064AD601C7F7982004CAE28 /* MultiPeerConnectivityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiPeerConnectivityController.h; path = iUAEParents/MultiPeerConnectivityController.h; sourceTree = ""; }; + 9064AD611C7F7982004CAE28 /* MultiPeerConnectivityController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MultiPeerConnectivityController.mm; path = iUAEParents/MultiPeerConnectivityController.mm; sourceTree = ""; }; + 9064AD621C7F7982004CAE28 /* MPCConnectionStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPCConnectionStates.h; path = iUAEParents/MPCConnectionStates.h; sourceTree = ""; }; 9706D70E1561817500073678 /* sdi.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sdi.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9706D7111561827300073678 /* bg_web.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg_web.png; sourceTree = ""; }; 9706D7121561827300073678 /* bg_web@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web@2x.png"; sourceTree = ""; }; @@ -1659,9 +1695,6 @@ 9706D7201561827300073678 /* chrome-top.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top.png"; sourceTree = ""; }; 9706D7211561827300073678 /* chrome-top@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top@2x.png"; sourceTree = ""; }; 9706D7221561827300073678 /* chrome-top~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top~ipad.png"; sourceTree = ""; }; - 9706D7231561827300073678 /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = ""; }; - 9706D7241561827300073678 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 9706D7251561827300073678 /* DISK1.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK1.ADF; sourceTree = ""; }; 9706D7261561827300073678 /* EmulationView-iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EmulationView-iPad.h"; sourceTree = ""; }; 9706D7271561827300073678 /* EmulationView-iPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EmulationView-iPad.m"; sourceTree = ""; }; 9706D7281561827300073678 /* EmulationView-iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "EmulationView-iPad.xib"; sourceTree = ""; }; @@ -1740,10 +1773,6 @@ 97242CE9156178CB00B6D03C /* chrome-top.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top.png"; sourceTree = ""; }; 97242CEA156178CB00B6D03C /* chrome-top@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top@2x.png"; sourceTree = ""; }; 97242CEB156178CB00B6D03C /* chrome-top~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top~ipad.png"; sourceTree = ""; }; - 97242CEC156178CB00B6D03C /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = ""; }; - 97242CED156178CB00B6D03C /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 97242CEE156178CB00B6D03C /* DISK1.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK1.ADF; sourceTree = ""; }; - 97242CEF156178CB00B6D03C /* DISK2.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK2.ADF; sourceTree = ""; }; 97242CF0156178CB00B6D03C /* EmulationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulationViewController.h; sourceTree = ""; }; 97242CF1156178CB00B6D03C /* EmulationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EmulationViewController.m; sourceTree = ""; }; 97242CF2156178CB00B6D03C /* EmulationView-iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EmulationView-iPad.h"; sourceTree = ""; }; @@ -1804,7 +1833,6 @@ 97242D2D156178CC00B6D03C /* intro_4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4@2x.png"; sourceTree = ""; }; 97242D2E156178CC00B6D03C /* intro_4~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4~ipad.png"; sourceTree = ""; }; 976877751534B2D20077B654 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 97855061153A3F2E00580B91 /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; 97855063153A3F2E00580B91 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = begin_code.h; sourceTree = ""; }; 97855064153A3F2E00580B91 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_code.h; sourceTree = ""; }; 97855065153A3F2E00580B91 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL.h; sourceTree = ""; }; @@ -1816,7 +1844,6 @@ 9785506B153A3F2E00580B91 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_error.h; sourceTree = ""; }; 9785506C153A3F2E00580B91 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_events.h; sourceTree = ""; }; 9785506D153A3F2E00580B91 /* sdl_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sdl_internal.h; sourceTree = ""; }; - 9785506E153A3F2E00580B91 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = ""; }; 9785506F153A3F2E00580B91 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keyboard.h; sourceTree = ""; }; 97855070153A3F2E00580B91 /* SDL_keysym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keysym.h; sourceTree = ""; }; 97855071153A3F2E00580B91 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_mouse.h; sourceTree = ""; }; @@ -1837,14 +1864,10 @@ 97855084153A3F2E00580B91 /* ButtonStates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonStates.h; sourceTree = ""; }; 97855085153A3F2E00580B91 /* ButtonStates.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ButtonStates.m; sourceTree = ""; }; 97855086153A3F2E00580B91 /* iCadeReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iCadeReaderView.h; sourceTree = ""; }; - 97855087153A3F2E00580B91 /* iCadeReaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iCadeReaderView.m; sourceTree = ""; }; + 97855087153A3F2E00580B91 /* iCadeReaderView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iCadeReaderView.mm; sourceTree = ""; }; 97855088153A3F2E00580B91 /* iCadeState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iCadeState.h; sourceTree = ""; }; - 97855089153A3F2E00580B91 /* iControlPadReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iControlPadReaderView.h; sourceTree = ""; }; - 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iControlPadReaderView.m; sourceTree = ""; }; - 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_sysjoystick.m; sourceTree = ""; }; 9785508C153A3F2E00580B91 /* SDLUIAccelerationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLUIAccelerationDelegate.h; sourceTree = ""; }; 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDLUIAccelerationDelegate.m; sourceTree = ""; }; - 9785508E153A3F2E00580B91 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = ""; }; 9785508F153A3F2E00580B91 /* SDL_joystick_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_joystick_c.h; sourceTree = ""; }; 97855090153A3F2E00580B91 /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = ""; }; 97855091153A3F2E00580B91 /* SDL.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SDL.mm; sourceTree = ""; }; @@ -1891,32 +1914,11 @@ 978550C1153A3F2E00580B91 /* SDL_UIKitVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_UIKitVideo.h; sourceTree = ""; }; 978550C2153A3F2E00580B91 /* SDL_UIKitVideo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDL_UIKitVideo.m; sourceTree = ""; }; 978550C3153A3F2E00580B91 /* UIKitDisplayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitDisplayView.h; sourceTree = ""; }; - 9785513E153A402A00580B91 /* LambdaAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LambdaAlert.h; path = "lambda-alert/Sources/LambdaAlert.h"; sourceTree = ""; }; - 9785513F153A402A00580B91 /* LambdaAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LambdaAlert.m; path = "lambda-alert/Sources/LambdaAlert.m"; sourceTree = ""; }; 97855145153A454100580B91 /* savestate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = savestate.cpp; sourceTree = ""; }; 97855147153A455C00580B91 /* cyclone.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = cyclone.s; sourceTree = ""; }; 97855148153A455C00580B91 /* memhandlers.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = memhandlers.s; sourceTree = ""; }; 9787FABA1561882D00458A4A /* koc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = koc.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 9787FABE156188ED00458A4A /* bg_web.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg_web.png; sourceTree = ""; }; - 9787FABF156188ED00458A4A /* bg_web@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web@2x.png"; sourceTree = ""; }; - 9787FAC0156188ED00458A4A /* bg_web~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web~ipad.png"; sourceTree = ""; }; - 9787FAC1156188ED00458A4A /* btn_close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_close.png; sourceTree = ""; }; 9787FAC2156188ED00458A4A /* btn_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_close@2x.png"; sourceTree = ""; }; - 9787FAC3156188ED00458A4A /* btn_close~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_close~ipad.png"; sourceTree = ""; }; - 9787FAC4156188ED00458A4A /* btn_menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_menu.png; sourceTree = ""; }; - 9787FAC5156188ED00458A4A /* btn_menu@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_menu@2x.png"; sourceTree = ""; }; - 9787FAC6156188ED00458A4A /* btn_menu~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_menu~ipad.png"; sourceTree = ""; }; - 9787FAC7156188ED00458A4A /* btn_restart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = btn_restart.png; sourceTree = ""; }; - 9787FAC8156188ED00458A4A /* btn_restart@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_restart@2x.png"; sourceTree = ""; }; - 9787FAC9156188ED00458A4A /* btn_restart~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "btn_restart~ipad.png"; sourceTree = ""; }; - 9787FACA156188ED00458A4A /* chrome-bottom.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-bottom.png"; sourceTree = ""; }; - 9787FACB156188ED00458A4A /* chrome-bottom@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-bottom@2x.png"; sourceTree = ""; }; - 9787FACC156188ED00458A4A /* chrome-bottom~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-bottom~ipad.png"; sourceTree = ""; }; - 9787FACD156188ED00458A4A /* chrome-top.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top.png"; sourceTree = ""; }; - 9787FACE156188ED00458A4A /* chrome-top@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top@2x.png"; sourceTree = ""; }; - 9787FACF156188ED00458A4A /* chrome-top~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top~ipad.png"; sourceTree = ""; }; - 9787FAD2156188ED00458A4A /* DISK1.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK1.ADF; sourceTree = ""; }; - 9787FAD3156188ED00458A4A /* DISK2.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK2.ADF; sourceTree = ""; }; 9787FAD4156188ED00458A4A /* EmulationView-iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EmulationView-iPad.h"; sourceTree = ""; }; 9787FAD5156188ED00458A4A /* EmulationView-iPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EmulationView-iPad.m"; sourceTree = ""; }; 9787FAD6156188ED00458A4A /* EmulationView-iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "EmulationView-iPad.xib"; sourceTree = ""; }; @@ -1929,18 +1931,6 @@ 9787FAFB156188ED00458A4A /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; 9787FAFC156188ED00458A4A /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon@2x.png"; sourceTree = ""; }; 9787FAFD156188ED00458A4A /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; }; - 9787FB07156188ED00458A4A /* intro_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_1.png; sourceTree = ""; }; - 9787FB08156188ED00458A4A /* intro_1@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_1@2x.png"; sourceTree = ""; }; - 9787FB09156188ED00458A4A /* intro_1~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_1~ipad.png"; sourceTree = ""; }; - 9787FB0A156188ED00458A4A /* intro_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_2.png; sourceTree = ""; }; - 9787FB0B156188ED00458A4A /* intro_2@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_2@2x.png"; sourceTree = ""; }; - 9787FB0C156188ED00458A4A /* intro_2~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_2~ipad.png"; sourceTree = ""; }; - 9787FB0D156188ED00458A4A /* intro_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_3.png; sourceTree = ""; }; - 9787FB0E156188ED00458A4A /* intro_3@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_3@2x.png"; sourceTree = ""; }; - 9787FB0F156188ED00458A4A /* intro_3~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_3~ipad.png"; sourceTree = ""; }; - 9787FB10156188ED00458A4A /* intro_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_4.png; sourceTree = ""; }; - 9787FB11156188ED00458A4A /* intro_4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4@2x.png"; sourceTree = ""; }; - 9787FB12156188ED00458A4A /* intro_4~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4~ipad.png"; sourceTree = ""; }; 9787FC2215618A5E00458A4A /* sinbad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = sinbad.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9787FC2515618ADB00458A4A /* bg_web.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg_web.png; sourceTree = ""; }; 9787FC2615618ADB00458A4A /* bg_web@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web@2x.png"; sourceTree = ""; }; @@ -1960,10 +1950,6 @@ 9787FC3415618ADB00458A4A /* chrome-top.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top.png"; sourceTree = ""; }; 9787FC3515618ADB00458A4A /* chrome-top@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top@2x.png"; sourceTree = ""; }; 9787FC3615618ADB00458A4A /* chrome-top~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "chrome-top~ipad.png"; sourceTree = ""; }; - 9787FC3715618ADB00458A4A /* Default-Landscape~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape~ipad.png"; sourceTree = ""; }; - 9787FC3815618ADB00458A4A /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; - 9787FC3915618ADB00458A4A /* DISK1.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK1.ADF; sourceTree = ""; }; - 9787FC3A15618ADB00458A4A /* DISK2.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK2.ADF; sourceTree = ""; }; 9787FC3B15618ADB00458A4A /* EmulationView-iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EmulationView-iPad.h"; sourceTree = ""; }; 9787FC3C15618ADB00458A4A /* EmulationView-iPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EmulationView-iPad.m"; sourceTree = ""; }; 9787FC3D15618ADB00458A4A /* EmulationView-iPad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "EmulationView-iPad.xib"; sourceTree = ""; }; @@ -2023,27 +2009,6 @@ 9787FC7715618ADB00458A4A /* intro_4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_4.png; sourceTree = ""; }; 9787FC7815618ADB00458A4A /* intro_4@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4@2x.png"; sourceTree = ""; }; 9787FC7915618ADB00458A4A /* intro_4~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_4~ipad.png"; sourceTree = ""; }; - 97A641CA15754C0700AD7B87 /* about.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = about.html; path = html/about.html; sourceTree = ""; }; - 97A641CB15754C0700AD7B87 /* css */ = {isa = PBXFileReference; lastKnownFileType = folder; name = css; path = html/css; sourceTree = ""; }; - 97A641CC15754C0700AD7B87 /* functions.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = functions.js; path = html/functions.js; sourceTree = ""; }; - 97A641CD15754C0700AD7B87 /* gpl.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = gpl.html; path = html/gpl.html; sourceTree = ""; }; - 97A641CE15754C0700AD7B87 /* help.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = help.html; path = html/help.html; sourceTree = ""; }; - 97A641CF15754C0700AD7B87 /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; name = images; path = html/images; sourceTree = ""; }; - 97A641D015754C0700AD7B87 /* iscroll.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = iscroll.js; path = html/iscroll.js; sourceTree = ""; }; - 97A641D115754C0800AD7B87 /* iscroll4.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = iscroll4.js; path = html/iscroll4.js; sourceTree = ""; }; - 97A641D215754C0800AD7B87 /* jquery-1.4.4.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "jquery-1.4.4.min.js"; path = "html/jquery-1.4.4.min.js"; sourceTree = ""; }; - 97A641D315754C0800AD7B87 /* jquery-1.5.2.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "jquery-1.5.2.min.js"; path = "html/jquery-1.5.2.min.js"; sourceTree = ""; }; - 97A641D415754C0800AD7B87 /* Limelight.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Limelight.ttf; path = html/Limelight.ttf; sourceTree = ""; }; - 97A641D515754C0800AD7B87 /* UserGuide.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = UserGuide.html; path = html/UserGuide.html; sourceTree = ""; }; - 97A641D615754C0800AD7B87 /* UserGuide~ipad.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = "UserGuide~ipad.html"; path = "html/UserGuide~ipad.html"; sourceTree = ""; }; - 97A641E515754C2400AD7B87 /* instruction-dotc-cursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-dotc-cursor.png"; path = "instructions/instruction-dotc-cursor.png"; sourceTree = ""; }; - 97A641E615754C2400AD7B87 /* instruction-dotc-cursor@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-dotc-cursor@2x.png"; path = "instructions/instruction-dotc-cursor@2x.png"; sourceTree = ""; }; - 97A641E715754C2400AD7B87 /* instruction-handclick.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-handclick.png"; path = "instructions/instruction-handclick.png"; sourceTree = ""; }; - 97A641E815754C2500AD7B87 /* instruction-handclick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-handclick@2x.png"; path = "instructions/instruction-handclick@2x.png"; sourceTree = ""; }; - 97A641E915754C2500AD7B87 /* instruction-handdrag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-handdrag.png"; path = "instructions/instruction-handdrag.png"; sourceTree = ""; }; - 97A641EA15754C2500AD7B87 /* instruction-handdrag@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-handdrag@2x.png"; path = "instructions/instruction-handdrag@2x.png"; sourceTree = ""; }; - 97A641EB15754C2500AD7B87 /* instruction-menuclick.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-menuclick.png"; path = "instructions/instruction-menuclick.png"; sourceTree = ""; }; - 97A641EC15754C2500AD7B87 /* instruction-menuclick@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "instruction-menuclick@2x.png"; path = "instructions/instruction-menuclick@2x.png"; sourceTree = ""; }; 97A931391538AD1B001064D7 /* bg_web.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bg_web.png; sourceTree = ""; }; 97A9313A1538AD1B001064D7 /* bg_web@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web@2x.png"; sourceTree = ""; }; 97A9313B1538AD1B001064D7 /* bg_web~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bg_web~ipad.png"; sourceTree = ""; }; @@ -2099,8 +2064,6 @@ 97A931FF1538B14B001064D7 /* iscroll4.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = iscroll4.js; sourceTree = ""; }; 97A932001538B14B001064D7 /* jquery-1.4.4.min.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = "jquery-1.4.4.min.js"; sourceTree = ""; }; 97A932011538B14B001064D7 /* jquery-1.5.2.min.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = "jquery-1.5.2.min.js"; sourceTree = ""; }; - 97A932071538B207001064D7 /* DISK1.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK1.ADF; sourceTree = ""; }; - 97A932081538B207001064D7 /* DISK2.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK2.ADF; sourceTree = ""; }; 97AFC8521538A4CB00227317 /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; }; 97BE2A9415486FE600BF66CF /* JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSON.h; sourceTree = ""; }; 97BE2A9515486FE600BF66CF /* NSObject+SBJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+SBJSON.h"; sourceTree = ""; }; @@ -2116,7 +2079,7 @@ 97BE2A9F15486FE600BF66CF /* SBJsonWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SBJsonWriter.h; sourceTree = ""; }; 97BE2AA015486FE600BF66CF /* SBJsonWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBJsonWriter.m; sourceTree = ""; }; 97BE2AA81548702100BF66CF /* BaseControlsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseControlsView.h; sourceTree = ""; }; - 97BE2AA91548702100BF66CF /* BaseControlsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseControlsView.m; sourceTree = ""; }; + 97BE2AA91548702100BF66CF /* BaseControlsView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BaseControlsView.mm; sourceTree = ""; }; 97BE2AAA1548702100BF66CF /* BaseLeftRightAwareView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseLeftRightAwareView.h; sourceTree = ""; }; 97BE2AAB1548702100BF66CF /* BaseLeftRightAwareView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseLeftRightAwareView.m; sourceTree = ""; }; 97BE2AAC1548702100BF66CF /* ButtonJoyButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ButtonJoyButton.h; sourceTree = ""; }; @@ -2135,7 +2098,7 @@ 97BE2ABA1548702100BF66CF /* MMFixedStickController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFixedStickController.h; sourceTree = ""; }; 97BE2ABB1548702100BF66CF /* MMFixedStickController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MMFixedStickController.mm; sourceTree = ""; }; 97BE2ABC1548702100BF66CF /* StaticImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticImage.h; sourceTree = ""; }; - 97BE2ABD1548702100BF66CF /* StaticImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StaticImage.m; sourceTree = ""; }; + 97BE2ABD1548702100BF66CF /* StaticImage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StaticImage.mm; sourceTree = ""; }; 97BE2ABE1548702100BF66CF /* StickControllerBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StickControllerBase.h; sourceTree = ""; }; 97BE2ABF1548702100BF66CF /* StickControllerBase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StickControllerBase.mm; sourceTree = ""; }; 97BE2AC01548702100BF66CF /* StickControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StickControllerDelegate.h; sourceTree = ""; }; @@ -2148,7 +2111,6 @@ 97BE2AD315489E6600BF66CF /* firebutton-red@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "firebutton-red@2x.png"; sourceTree = ""; }; 97BE2AD415489E6600BF66CF /* firebutton-red~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "firebutton-red~ipad.png"; sourceTree = ""; }; 97BE2AD615489E6600BF66CF /* joystick.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = joystick.png; sourceTree = ""; }; - 97BE2AD715489E6600BF66CF /* keyboard.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = keyboard.png; sourceTree = ""; }; 97BE2AD815489E6600BF66CF /* mouse.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mouse.png; sourceTree = ""; }; 97BE2ADA15489E6600BF66CF /* ls-fullscreen_bottomBtn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ls-fullscreen_bottomBtn.png"; sourceTree = ""; }; 97BE2ADB15489E6600BF66CF /* ls-instructions_overlay.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ls-instructions_overlay.png"; sourceTree = ""; }; @@ -2159,8 +2121,6 @@ 97BE2AE015489E6600BF66CF /* ls-joystick_rest.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ls-joystick_rest.png"; sourceTree = ""; }; 97C875C6156E834100197738 /* p1.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = p1.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97DC9BB91549CDAD003CDFFF /* control-layout.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = "control-layout.json"; path = "../control-layout.json"; sourceTree = ""; }; - 97EE415B1538A83B0072514D /* DISK1.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK1.ADF; sourceTree = ""; }; - 97EE415C1538A83B0072514D /* DISK2.ADF */ = {isa = PBXFileReference; lastKnownFileType = file; path = DISK2.ADF; sourceTree = ""; }; 97EF9600153876CA001C01E6 /* stooges.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = stooges.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97EF96191538771F001C01E6 /* EmulationView-iPad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "EmulationView-iPad.h"; sourceTree = ""; }; 97EF961A1538771F001C01E6 /* EmulationView-iPad.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "EmulationView-iPad.m"; sourceTree = ""; }; @@ -2173,10 +2133,75 @@ 97EF963F1538771F001C01E6 /* icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon@2x.png"; sourceTree = ""; }; 97EF96561538771F001C01E6 /* StoogesEmulationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StoogesEmulationViewController.h; sourceTree = ""; }; 97EF96571538771F001C01E6 /* StoogesEmulationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoogesEmulationViewController.m; sourceTree = ""; }; + BE0921FD1B343D810058D9F2 /* DiskDriveService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskDriveService.h; sourceTree = ""; }; + BE0921FE1B343D810058D9F2 /* DiskDriveService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskDriveService.mm; sourceTree = ""; }; + BE17E1101D6C2E2800221E7F /* CoreSettingGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreSettingGroup.h; sourceTree = ""; }; + BE17E1151D6C2E8200221E7F /* iUAETests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iUAETests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + BE17E1191D6C2E8200221E7F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BE17E1201D6C2E9A00221E7F /* CoreSettingGroupTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreSettingGroupTests.m; sourceTree = ""; }; + BE17E1211D6C2E9A00221E7F /* CoreSettingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreSettingTests.m; sourceTree = ""; }; + BE2CA1E01C42219000B84C2C /* KeyButtonViewHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyButtonViewHandler.h; sourceTree = ""; }; + BE2CA1E11C42219000B84C2C /* KeyButtonViewHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyButtonViewHandler.m; sourceTree = ""; }; + BE52EFA81B4FC9B8008E15E6 /* DriveState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DriveState.m; sourceTree = ""; }; + BE52EFA91B4FC9B8008E15E6 /* DriveState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DriveState.h; sourceTree = ""; }; + BE5DE31D1C5CCD1400FF5D1D /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; + BE6086D71C2CF5AC008E668B /* adfresolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = adfresolver.h; sourceTree = ""; }; + BE6086D81C2CF5AC008E668B /* adfresolver.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = adfresolver.mm; sourceTree = ""; }; + BE6537D91C5F7E41007AD097 /* PKCustomKeyboard.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PKCustomKeyboard.xib; sourceTree = ""; }; + BE6537DB1C5F7E59007AD097 /* PMCustomKeyboard.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PMCustomKeyboard.xib; sourceTree = ""; }; + BE6622981C328442009C2809 /* KeyButtonManagementController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyButtonManagementController.h; sourceTree = ""; }; + BE6622991C328442009C2809 /* KeyButtonManagementController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyButtonManagementController.mm; sourceTree = ""; }; + BE66229B1C3285B3009C2809 /* KeyButtonConfigurationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyButtonConfigurationController.h; sourceTree = ""; }; + BE66229C1C3285B3009C2809 /* KeyButtonConfigurationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyButtonConfigurationController.m; sourceTree = ""; }; + BE66229E1C32861C009C2809 /* KeyButtonConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyButtonConfiguration.h; sourceTree = ""; }; + BE66229F1C32861C009C2809 /* KeyButtonConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KeyButtonConfiguration.m; sourceTree = ""; }; + BE6F9F611C4E2C420061B98C /* VPadLeftOrRight.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VPadLeftOrRight.mm; sourceTree = ""; }; + BE951AF01CA93EB2008DD94B /* fsusage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fsusage.h; path = include/fsusage.h; sourceTree = ""; }; + BE951AF11CA93EC0008DD94B /* fsusage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fsusage.cpp; sourceTree = ""; }; + BE951AF31CA93F27008DD94B /* native2amiga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = native2amiga.cpp; sourceTree = ""; }; + BE951AF51CA93F33008DD94B /* native2amiga.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = native2amiga.h; path = include/native2amiga.h; sourceTree = ""; }; + BE951AF61CA93F86008DD94B /* scsi-none.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "scsi-none.cpp"; sourceTree = ""; }; + BE951AF81CA93F93008DD94B /* scsidev.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scsidev.h; path = include/scsidev.h; sourceTree = ""; }; + BE951AF91CA93FB7008DD94B /* fsdb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fsdb.cpp; sourceTree = ""; }; + BE951AFB1CA93FBF008DD94B /* fsdb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fsdb.h; path = include/fsdb.h; sourceTree = ""; }; + BE951AFC1CA942B1008DD94B /* expansion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = expansion.cpp; sourceTree = ""; }; + BE951AFE1CA942E5008DD94B /* picasso96.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = picasso96.h; path = include/picasso96.h; sourceTree = ""; }; + BE951AFF1CA9442A008DD94B /* fsdb_unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fsdb_unix.cpp; sourceTree = ""; }; + BEC5372B1DA144C9002C3793 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + BECB5E201DA393B6000E5C2C /* AudioService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioService.h; sourceTree = ""; }; + BECB5E211DA393B6000E5C2C /* AudioService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioService.mm; sourceTree = ""; }; + BECE7E0B1CB3E12600EBFB40 /* hardfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = hardfile.cpp; sourceTree = ""; }; + BEE4172C1D6AA35E00E3ED45 /* ScrollToRowHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToRowHandler.h; sourceTree = ""; }; + BEE4172D1D6AA35E00E3ED45 /* ScrollToRowHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScrollToRowHandler.m; sourceTree = ""; }; + BEE41BC11B4782D200CE487D /* AdfImporter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AdfImporter.mm; sourceTree = ""; }; + BEE41BC21B4782D200CE487D /* AdfImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdfImporter.h; sourceTree = ""; }; + BEE41BC41B47836D00CE487D /* ZipArchive.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ZipArchive.mm; sourceTree = ""; }; + BEE41BC51B47836D00CE487D /* ZipArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZipArchive.h; sourceTree = ""; }; + BEE41BCA1B4784AC00CE487D /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = minizip/zip.h; sourceTree = ""; }; + BEE41BCB1B4784AC00CE487D /* zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip.c; path = minizip/zip.c; sourceTree = ""; }; + BEE41BCC1B4784AC00CE487D /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = unzip.h; path = minizip/unzip.h; sourceTree = ""; }; + BEE41BCD1B4784AC00CE487D /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = unzip.c; path = minizip/unzip.c; sourceTree = ""; }; + BEE41BCE1B4784AC00CE487D /* mztools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mztools.h; path = minizip/mztools.h; sourceTree = ""; }; + BEE41BCF1B4784AC00CE487D /* mztools.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mztools.c; path = minizip/mztools.c; sourceTree = ""; }; + BEE41BD01B4784AC00CE487D /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ioapi.h; path = minizip/ioapi.h; sourceTree = ""; }; + BEE41BD11B4784AC00CE487D /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ioapi.c; path = minizip/ioapi.c; sourceTree = ""; }; + BEE41BD21B4784AC00CE487D /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = minizip/crypt.h; sourceTree = ""; }; + BEEFB2DC1D72C6A00056CC8E /* MultiDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiDictionary.h; path = Submodules/STObjCToolbelt/Source/MultiDictionary.h; sourceTree = ""; }; + BEEFB2DD1D72C6A00056CC8E /* MultiDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MultiDictionary.m; path = Submodules/STObjCToolbelt/Source/MultiDictionary.m; sourceTree = ""; }; + BEF413D01CA411CF00CCC1F5 /* HardDriveService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HardDriveService.h; sourceTree = ""; }; + BEF413D11CA411CF00CCC1F5 /* HardDriveService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HardDriveService.mm; sourceTree = ""; }; + BEF413D31CA414E700CCC1F5 /* filesys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = filesys.cpp; sourceTree = ""; }; + BEF413D51CA414F600CCC1F5 /* cfgfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cfgfile.cpp; sourceTree = ""; }; + BEF413D71CA4150500CCC1F5 /* cfgfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cfgfile.h; path = include/cfgfile.h; sourceTree = ""; }; E18F65E6154CAD470073642F /* Bazooka.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = Bazooka.ttf; sourceTree = ""; }; E18F65E8154CB6950073642F /* intro_5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = intro_5.png; sourceTree = ""; }; E18F65E9154CB6950073642F /* intro_5@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_5@2x.png"; sourceTree = ""; }; E18F65EA154CB6950073642F /* intro_5~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "intro_5~ipad.png"; sourceTree = ""; }; + E937D8A61CB58BC9008DCC27 /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = System/Library/Frameworks/CoreMotion.framework; sourceTree = SDKROOT; }; + E937D8A81CB58C4F008DCC27 /* VPadMotionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VPadMotionController.h; path = iUAEParents/VPadMotionController.h; sourceTree = ""; }; + E937D8A91CB58C50008DCC27 /* VPadMotionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VPadMotionController.mm; path = iUAEParents/VPadMotionController.mm; sourceTree = ""; }; + E937D8AE1CB58CE3008DCC27 /* VPadTouchOrGyro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPadTouchOrGyro.h; sourceTree = ""; }; + E937D8AF1CB58CE3008DCC27 /* VPadTouchOrGyro.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = VPadTouchOrGyro.mm; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2184,7 +2209,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 05084E4A13D7FE7B0004617A /* libz.dylib in Frameworks */, 976877761534B2D20077B654 /* AudioToolbox.framework in Frameworks */, 0533694513B1DEE90012D55A /* Foundation.framework in Frameworks */, 0533694613B1DEE90012D55A /* UIKit.framework in Frameworks */, @@ -2199,6 +2223,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + BEC5372C1DA144C9002C3793 /* AVFoundation.framework in Frameworks */, + 7E5A77021D00370E009BF491 /* ExternalAccessory.framework in Frameworks */, + E937D8A71CB58BC9008DCC27 /* CoreMotion.framework in Frameworks */, + 9064AD551C7D09FA004CAE28 /* MultipeerConnectivity.framework in Frameworks */, + 7EB372EA1A0FC8DE001B460A /* GameController.framework in Frameworks */, + 7EA7D6F1187B480C0092FC2F /* AudioToolbox.framework in Frameworks */, 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */, @@ -2212,7 +2242,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9706D7021561817500073678 /* libz.dylib in Frameworks */, 9706D7031561817500073678 /* AudioToolbox.framework in Frameworks */, 9706D7041561817500073678 /* Foundation.framework in Frameworks */, 9706D7051561817500073678 /* UIKit.framework in Frameworks */, @@ -2227,7 +2256,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 97242CCA156177EC00B6D03C /* libz.dylib in Frameworks */, 97242CCB156177EC00B6D03C /* AudioToolbox.framework in Frameworks */, 97242CCC156177EC00B6D03C /* Foundation.framework in Frameworks */, 97242CCD156177EC00B6D03C /* UIKit.framework in Frameworks */, @@ -2242,7 +2270,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9787FAAE1561882D00458A4A /* libz.dylib in Frameworks */, 9787FAAF1561882D00458A4A /* AudioToolbox.framework in Frameworks */, 9787FAB01561882D00458A4A /* Foundation.framework in Frameworks */, 9787FAB11561882D00458A4A /* UIKit.framework in Frameworks */, @@ -2257,7 +2284,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9787FC1615618A5E00458A4A /* libz.dylib in Frameworks */, 9787FC1715618A5E00458A4A /* AudioToolbox.framework in Frameworks */, 9787FC1815618A5E00458A4A /* Foundation.framework in Frameworks */, 9787FC1915618A5E00458A4A /* UIKit.framework in Frameworks */, @@ -2272,7 +2298,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 97C875BA156E834100197738 /* libz.dylib in Frameworks */, 97C875BB156E834100197738 /* AudioToolbox.framework in Frameworks */, 97C875BC156E834100197738 /* Foundation.framework in Frameworks */, 97C875BD156E834100197738 /* UIKit.framework in Frameworks */, @@ -2287,7 +2312,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 97EF95F4153876CA001C01E6 /* libz.dylib in Frameworks */, 97EF95F5153876CA001C01E6 /* AudioToolbox.framework in Frameworks */, 97EF95F6153876CA001C01E6 /* Foundation.framework in Frameworks */, 97EF95F7153876CA001C01E6 /* UIKit.framework in Frameworks */, @@ -2298,6 +2322,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BE17E1121D6C2E8200221E7F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -2307,16 +2338,14 @@ 0577C0D812DED3290040B77D /* debugger */, 0504155A0FCB46F000F46828 /* EmulationViewController.h */, 0504155B0FCB46F000F46828 /* EmulationViewController.mm */, - 0504155D0FCB475C00F46828 /* InputControllerView.h */, - 0504155E0FCB475C00F46828 /* InputControllerView.mm */, + BE2CA1E01C42219000B84C2C /* KeyButtonViewHandler.h */, + BE2CA1E11C42219000B84C2C /* KeyButtonViewHandler.m */, + 0585D5601091653E00C1E4C1 /* KeyView.h */, + 0585D5611091653E00C1E4C1 /* KeyView.m */, 0583DE5612D1A3AC000E97CE /* TouchHandlerView.h */, 0583DE5712D1A3AC000E97CE /* TouchHandlerView.m */, - 0504155F0FCB475C00F46828 /* JoystickViewLandscape.h */, - 050415600FCB475C00F46828 /* JoystickViewLandscape.mm */, 0585D55D1091640900C1E4C1 /* VirtualKeyboard.h */, - 0585D55E1091640900C1E4C1 /* VirtualKeyboard.m */, - 0585D5601091653E00C1E4C1 /* KeyView.h */, - 0585D5611091653E00C1E4C1 /* KeyView.m */, + 7E4D0FBE1CF4E8F600758750 /* VirtualKeyboard.mm */, ); name = Emulator; sourceTree = ""; @@ -2324,11 +2353,16 @@ 050415680FCB4BC300F46828 /* Utility */ = { isa = PBXGroup; children = ( + BEE41BC91B47849F00CE487D /* minizip */, + BEE41BC11B4782D200CE487D /* AdfImporter.mm */, + BEE41BC21B4782D200CE487D /* AdfImporter.h */, 050415690FCB4BD400F46828 /* CocoaUtility.h */, - 0504156A0FCB4BD400F46828 /* CocoaUtility.m */, + 0504156A0FCB4BD400F46828 /* CocoaUtility.mm */, 0504156C0FCB4BE600F46828 /* debug.h */, 057B26B313B325AB006BB230 /* NSObject+Blocks.h */, - 057B26B413B325AB006BB230 /* NSObject+Blocks.m */, + 057B26B413B325AB006BB230 /* NSObject+Blocks.mm */, + BEE41BC41B47836D00CE487D /* ZipArchive.mm */, + BEE41BC51B47836D00CE487D /* ZipArchive.h */, ); name = Utility; sourceTree = ""; @@ -2341,34 +2375,6 @@ path = images; sourceTree = ""; }; - 050B1741139C79E8005C7736 /* joystick */ = { - isa = PBXGroup; - children = ( - 050B1743139C7CD7005C7736 /* iOS */, - 050B1744139C7D1E005C7736 /* SDL_joystick.c */, - 050B1745139C7D1E005C7736 /* SDL_joystick_c.h */, - 050B1747139C7DF1005C7736 /* SDL_sysjoystick.h */, - ); - path = joystick; - sourceTree = ""; - }; - 050B1743139C7CD7005C7736 /* iOS */ = { - isa = PBXGroup; - children = ( - 050B1748139C83A8005C7736 /* SDL_sysjoystick.m */, - 050B1750139CACBB005C7736 /* SDLUIAccelerationDelegate.h */, - 050B1751139CACBB005C7736 /* SDLUIAccelerationDelegate.m */, - 050B1757139CB443005C7736 /* ButtonStates.h */, - 050B1758139CB444005C7736 /* ButtonStates.m */, - 050B1759139CB444005C7736 /* iControlPadReaderView.h */, - 050B175A139CB444005C7736 /* iControlPadReaderView.m */, - 05650B1713AC8799003CC181 /* iCadeReaderView.h */, - 05650B1813AC8799003CC181 /* iCadeReaderView.m */, - 05650B1913AC8799003CC181 /* iCadeState.h */, - ); - path = iOS; - sourceTree = ""; - }; 050C392712C31B0C000CE512 /* disassembler */ = { isa = PBXGroup; children = ( @@ -2384,8 +2390,6 @@ 053368AA13B1BD120012D55A /* Resources */ = { isa = PBXGroup; children = ( - 97A932071538B207001064D7 /* DISK1.ADF */, - 97A932081538B207001064D7 /* DISK2.ADF */, 05A435D013CAC54C00E5024F /* instructions */, 05A1501D13BDA843009A12B2 /* html */, 055FD7E813B3E8E600BB3F8B /* Chrome */, @@ -2398,42 +2402,19 @@ 053368AD13B1BD740012D55A /* SingleView */ = { isa = PBXGroup; children = ( - 053368B913B1D7400012D55A /* Resources-iPhone */, - 053368AF13B1BDA40012D55A /* Resources-iPad */, - 053368AE13B1BD950012D55A /* Resources */, + 7E10738A1A34E85E000D7269 /* Storyboard.storyboard */, 053368B013B1BDD60012D55A /* SingleWindowAppDelegate.h */, + 7EA5AC5A18AAC5920072820E /* BaseNavigationController.h */, + 7EA5AC5B18AAC5920072820E /* BaseNavigationController.mm */, 053368B113B1BDD60012D55A /* SingleWindowAppDelegate.mm */, 053368B513B1CC980012D55A /* BaseEmulationViewController.h */, 053368B613B1CC980012D55A /* BaseEmulationViewController.mm */, 055FD7F713B45AAA00BB3F8B /* AnimatedImageSequenceView.h */, - 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.m */, + 055FD7F813B45AAA00BB3F8B /* AnimatedImageSequenceView.mm */, ); path = SingleView; sourceTree = ""; }; - 053368AE13B1BD950012D55A /* Resources */ = { - isa = PBXGroup; - children = ( - ); - name = Resources; - sourceTree = ""; - }; - 053368AF13B1BDA40012D55A /* Resources-iPad */ = { - isa = PBXGroup; - children = ( - 053368B313B1BF910012D55A /* MainWindow-Single-iPad.xib */, - ); - name = "Resources-iPad"; - sourceTree = ""; - }; - 053368B913B1D7400012D55A /* Resources-iPhone */ = { - isa = PBXGroup; - children = ( - 053368BA13B1D75E0012D55A /* MainWindow-Single.xib */, - ); - name = "Resources-iPhone"; - sourceTree = ""; - }; 053D8B2E13B1B2C30002802F /* TargetSpecific */ = { isa = PBXGroup; children = ( @@ -2459,8 +2440,8 @@ 05BB085F13CC18FC00278699 /* DOTCEmulationViewController.h */, 05BB086013CC18FC00278699 /* DOTCEmulationViewController.m */, 055FD7E913B3F39800BB3F8B /* EmulationView-iPhone.h */, - 055FD7EA13B3F39800BB3F8B /* EmulationView-iPhone.m */, 055FD7CE13B3E86E00BB3F8B /* EmulationView-iPhone.xib */, + 055FD7EA13B3F39800BB3F8B /* EmulationView-iPhone.m */, 055FD7EC13B3FB0900BB3F8B /* EmulationView-iPad.h */, 055FD7ED13B3FB0900BB3F8B /* EmulationView-iPad.m */, 055FD7EE13B3FB0900BB3F8B /* EmulationView-iPad.xib */, @@ -2471,6 +2452,21 @@ 0542F2610FC8852A00126562 /* uae-src */ = { isa = PBXGroup; children = ( + BECE7E0B1CB3E12600EBFB40 /* hardfile.cpp */, + BE951AFE1CA942E5008DD94B /* picasso96.h */, + BE951AFC1CA942B1008DD94B /* expansion.cpp */, + BE951AFB1CA93FBF008DD94B /* fsdb.h */, + BE951AF91CA93FB7008DD94B /* fsdb.cpp */, + BE951AFF1CA9442A008DD94B /* fsdb_unix.cpp */, + BE951AF81CA93F93008DD94B /* scsidev.h */, + BE951AF61CA93F86008DD94B /* scsi-none.cpp */, + BE951AF51CA93F33008DD94B /* native2amiga.h */, + BE951AF31CA93F27008DD94B /* native2amiga.cpp */, + BE951AF11CA93EC0008DD94B /* fsusage.cpp */, + BE951AF01CA93EB2008DD94B /* fsusage.h */, + BEF413D71CA4150500CCC1F5 /* cfgfile.h */, + BEF413D51CA414F600CCC1F5 /* cfgfile.cpp */, + BEF413D31CA414E700CCC1F5 /* filesys.cpp */, 97855145153A454100580B91 /* savestate.cpp */, 0552BD1C0F3D797C005B30DF /* sysconfig.h */, 054525AF106EC5550032FC41 /* combined_modules.cpp */, @@ -2492,7 +2488,6 @@ 0552BCFB0F3D797C005B30DF /* linetoscr.h */, 0552BD0E0F3D797C005B30DF /* memory.cpp */, 0552BD140F3D797C005B30DF /* missing.cpp */, - 0552BD150F3D797C005B30DF /* od-joy.cpp */, 0552BD160F3D797C005B30DF /* save_icon.h */, 0552BD180F3D797C005B30DF /* savedisk.h */, 0552BD170F3D797C005B30DF /* savedisk.cpp */, @@ -2584,7 +2579,6 @@ 0552BCDC0F3D797C005B30DF /* gensound.h */, 0552BCDD0F3D797C005B30DF /* gui.h */, 0552BCDF0F3D797C005B30DF /* imask_tab.h */, - 0552BCE00F3D797C005B30DF /* joystick.h */, 0552BCE10F3D797C005B30DF /* keyboard.h */, 0552BCE20F3D797C005B30DF /* keybuf.h */, 0552BCE30F3D797C005B30DF /* maccess.h */, @@ -2598,6 +2592,7 @@ 0552BCF60F3D797C005B30DF /* uae.h */, 0552BCF80F3D797C005B30DF /* xwin.h */, 0552BCF90F3D797C005B30DF /* zfile.h */, + 7E4C6AF819DB116B00D337D0 /* memory-uae.h */, ); path = include; sourceTree = ""; @@ -2636,10 +2631,11 @@ isa = PBXGroup; children = ( 0552BD050F3D797C005B30DF /* fame.h */, - 0552BD060F3D797C005B30DF /* famec.cpp */, - 0552BD070F3D797C005B30DF /* famec_debug.cpp */, 0552BD080F3D797C005B30DF /* famec_opcodes.h */, 0552BD090F3D797C005B30DF /* m68k_intrf.cpp */, + 7E4C6AF519DB0F7100D337D0 /* famec.cpp */, + 7E4C6AF619DB0F7100D337D0 /* famec.h */, + 7ECAB5CB19DB20D000B05FF3 /* famec_jumptable.h */, ); path = fame; sourceTree = ""; @@ -2695,13 +2691,13 @@ 05743F6C0FC28C5C003BE251 /* iphone */ = { isa = PBXGroup; children = ( - 0583DCD312D11E1E000E97CE /* SDL-mini */, 05E6A30D0FC3D8EA0086151B /* audio */, 05ECEA061091A85B001A71D0 /* CNSRecursiveLock.h */, 05743FC30FC293FD003BE251 /* iphone_main.h */, 05743FC40FC293FD003BE251 /* iphone_main.mm */, 050415630FCB47B200F46828 /* CGVector.h */, 050415640FCB47B200F46828 /* touchstick.h */, + 7E922A7F1CF0AD6000D8006F /* touchstick.mm */, 057B0D4A0FD0D0ED00D549AD /* MMStopWatch.h */, 057B0D4B0FD0D0ED00D549AD /* MMStopWatch.m */, ); @@ -2711,9 +2707,7 @@ 057440D40FC2A4A7003BE251 /* roms */ = { isa = PBXGroup; children = ( - 057440D50FC2A4A7003BE251 /* kick.rom */, - 057443290FC3C94F003BE251 /* kick13.rom */, - 05F5F217112A54F1001530EC /* kick31.rom */, + 7E8C24F11EA0E31300673701 /* rom.key */, ); path = roms; sourceTree = ""; @@ -2725,16 +2719,6 @@ path = disks; sourceTree = ""; }; - 0577BD0512D840A30040B77D /* uikit */ = { - isa = PBXGroup; - children = ( - 0577C29312E15B590040B77D /* coregraphics */, - 0577C27312E15A590040B77D /* opengl */, - 0577C29712E15B930040B77D /* UIKitDisplayView.h */, - ); - path = uikit; - sourceTree = ""; - }; 0577C0D812DED3290040B77D /* debugger */ = { isa = PBXGroup; children = ( @@ -2746,51 +2730,6 @@ path = debugger; sourceTree = ""; }; - 0577C27312E15A590040B77D /* opengl */ = { - isa = PBXGroup; - children = ( - 0577C28E12E15AE10040B77D /* Shaders */, - 0577C28A12E15AB30040B77D /* esUtil.h */, - 0577C28B12E15AB30040B77D /* ImageUtils.m */, - 0577C28C12E15AB30040B77D /* OGLDisplay.h */, - 0577C28D12E15AB30040B77D /* OGLDisplay.m */, - 055E446412E56235003119A8 /* OGLShaderProgram.h */, - 055E446512E56235003119A8 /* OGLShaderProgram.m */, - 05D5205112E7E03C007912AE /* OGLTypes.h */, - 05D51FB212E7DA86007912AE /* TexturedCRTEffect.h */, - 05D51FB312E7DA86007912AE /* TexturedCRTEffect.m */, - 055E44AF12E56DA5003119A8 /* NoEffect.h */, - 055E44B012E56DA5003119A8 /* NoEffect.m */, - ); - path = opengl; - sourceTree = ""; - }; - 0577C28E12E15AE10040B77D /* Shaders */ = { - isa = PBXGroup; - children = ( - 05D51FB012E7DA4E007912AE /* CRT.frag */, - 055E44AB12E56BF7003119A8 /* Simple.frag */, - 0577C29012E15AE10040B77D /* Simple.vert */, - 0577C34712E1723F0040B77D /* Scanlines (50%).png */, - 0577C34812E1723F0040B77D /* Scanlines (100%).png */, - 0577C34912E1723F0040B77D /* Aperture (1x2 RB).png */, - 0577C34A12E1723F0040B77D /* Aperture (1x3 RB).png */, - 0577C34B12E1723F0040B77D /* Aperture (2x4 BG).png */, - 0577C34C12E1723F0040B77D /* Aperture (2x4 RB).png */, - 0577C34D12E1723F0040B77D /* Aperture (4x6).png */, - ); - path = Shaders; - sourceTree = ""; - }; - 0577C29312E15B590040B77D /* coregraphics */ = { - isa = PBXGroup; - children = ( - 0577C29412E15B590040B77D /* DisplayView.h */, - 0577C29512E15B590040B77D /* DisplayView.m */, - ); - path = coregraphics; - sourceTree = ""; - }; 057B976A13CEC7B30065278D /* intro */ = { isa = PBXGroup; children = ( @@ -2810,79 +2749,11 @@ name = intro; sourceTree = ""; }; - 0583DCD312D11E1E000E97CE /* SDL-mini */ = { - isa = PBXGroup; - children = ( - 0583DCEC12D18B19000E97CE /* include */, - 0583DCF612D18B24000E97CE /* src */, - ); - path = "SDL-mini"; - sourceTree = ""; - }; - 0583DCEC12D18B19000E97CE /* include */ = { - isa = PBXGroup; - children = ( - 050B1755139CAD34005C7736 /* begin_code.h */, - 050B1756139CAD35005C7736 /* close_code.h */, - 0583DD0112D18BBB000E97CE /* SDL.h */, - 0583DCFE12D18BBB000E97CE /* SDL_endian.h */, - 0583DCFF12D18BBB000E97CE /* SDL_events.h */, - 050B174B139C849A005C7736 /* SDL_error.h */, - 0583DD0012D18BBB000E97CE /* sdl_internal.h */, - 050B1742139C7A5D005C7736 /* SDL_joystick.h */, - 0583DE6B12D1A510000E97CE /* SDL_config.h */, - 050B1753139CACE9005C7736 /* SDL_config_iphoneos.h */, - 0583DE9712D1A850000E97CE /* SDL_keyboard.h */, - 0583DE9112D1A825000E97CE /* SDL_keysym.h */, - 0583DF6412D1AFB4000E97CE /* SDL_mouse.h */, - 050B1754139CAD0D005C7736 /* SDL_platform.h */, - 0583DEB112D1A95D000E97CE /* SDL_stdinc.h */, - 0583DF0112D1AB75000E97CE /* SDL_video.h */, - ); - path = include; - sourceTree = ""; - }; - 0583DCF612D18B24000E97CE /* src */ = { - isa = PBXGroup; - children = ( - 050B1741139C79E8005C7736 /* joystick */, - 0583DE5D12D1A4D4000E97CE /* video */, - 0583DD2012D18FAF000E97CE /* events */, - 0583DCFB12D18BB1000E97CE /* SDL.mm */, - 050B174C139C84F2005C7736 /* SDL_error.c */, - 050B174D139C84F3005C7736 /* SDL_error_c.h */, - 052DE54A13DA909600CCCB01 /* SDL_NSObject+Blocks.h */, - 052DE54B13DA909600CCCB01 /* SDL_NSObject+Blocks.m */, - ); - path = src; - sourceTree = ""; - }; - 0583DD2012D18FAF000E97CE /* events */ = { - isa = PBXGroup; - children = ( - 050B174F139C8F2E005C7736 /* SDL_events_c.h */, - 0583DD2512D18FD9000E97CE /* SDL_events.mm */, - 0583DE5A12D1A433000E97CE /* SDL_mouse_c.h */, - 0583DE5B12D1A433000E97CE /* SDL_mouse_c.c */, - ); - path = events; - sourceTree = ""; - }; - 0583DE5D12D1A4D4000E97CE /* video */ = { - isa = PBXGroup; - children = ( - 0577BD0512D840A30040B77D /* uikit */, - 0583DE6D12D1A533000E97CE /* SDL_sysvideo.h */, - ); - path = video; - sourceTree = ""; - }; 059A411B12697B33003B23C7 /* Resources-iPad */ = { isa = PBXGroup; children = ( 05E8A03112B2C850005532AF /* keyboard */, 058063CF13B06DD800E00B04 /* Icon-72.png */, - 059A411C12697B33003B23C7 /* MainWindow-iPad.xib */, ); name = "Resources-iPad"; sourceTree = ""; @@ -2956,15 +2827,6 @@ path = instructions; sourceTree = ""; }; - 05BB086213CC233F00278699 /* lambda-alert */ = { - isa = PBXGroup; - children = ( - 9785513E153A402A00580B91 /* LambdaAlert.h */, - 9785513F153A402A00580B91 /* LambdaAlert.m */, - ); - name = "lambda-alert"; - sourceTree = ""; - }; 05BC1AEB1073448200EABC6E /* File Browser */ = { isa = PBXGroup; children = ( @@ -2974,9 +2836,10 @@ 05BC1AEF1073448200EABC6E /* EMUFileGroup.m */, 05BC1AF01073448200EABC6E /* EMUFileInfo.h */, 05BC1AF11073448200EABC6E /* EMUFileInfo.m */, - 05BC1AF21073448200EABC6E /* EMUROMBrowserView.xib */, 05BC1AF31073448200EABC6E /* EMUROMBrowserViewController.h */, + 7ED69CFA1A6D9D9B00059F7D /* DiskAssociationViewController.h */, 05BC1AF41073448200EABC6E /* EMUROMBrowserViewController.mm */, + 7ED69CFB1A6D9DAF00059F7D /* DiskAssociationViewController.mm */, ); path = "File Browser"; sourceTree = ""; @@ -2984,15 +2847,72 @@ 05BC1B1910734C0700EABC6E /* Settings */ = { isa = PBXGroup; children = ( - 05BC1B1A10734C3B00EABC6E /* SettingsController.h */, - 05BC1B1B10734C3B00EABC6E /* SettingsController.mm */, - 05BC1B1C10734C3B00EABC6E /* SettingsController.xib */, + 7E079CBF1A81594B00EC0DE4 /* AddConfigurationViewController.h */, + 7E079CC01A81594B00EC0DE4 /* AddConfigurationViewController.mm */, + BE6086D71C2CF5AC008E668B /* adfresolver.h */, + BE6086D81C2CF5AC008E668B /* adfresolver.mm */, + BECB5E201DA393B6000E5C2C /* AudioService.h */, + BECB5E211DA393B6000E5C2C /* AudioService.mm */, + 7E770D7A1D109DEC000E5E1A /* CoreSetting.h */, + 7E770D7B1D109DEC000E5E1A /* CoreSetting.m */, + BE17E1101D6C2E2800221E7F /* CoreSettingGroup.h */, + BE0921FD1B343D810058D9F2 /* DiskDriveService.h */, + BE0921FE1B343D810058D9F2 /* DiskDriveService.mm */, + BE52EFA91B4FC9B8008E15E6 /* DriveState.h */, + BE52EFA81B4FC9B8008E15E6 /* DriveState.m */, + BEF413D01CA411CF00CCC1F5 /* HardDriveService.h */, + BEF413D11CA411CF00CCC1F5 /* HardDriveService.mm */, + 7EDCD04D1C3C59420006EB50 /* JoypadMainSettingsController.h */, + 7EDCD04E1C3C59420006EB50 /* JoypadMainSettingsController.mm */, + 7EADD3141CB2FAA100136978 /* JoypadSelectionController.h */, + 7EADD3151CB2FAA100136978 /* JoypadSelectionController.mm */, + BE66229E1C32861C009C2809 /* KeyButtonConfiguration.h */, + BE66229F1C32861C009C2809 /* KeyButtonConfiguration.m */, + BE66229B1C3285B3009C2809 /* KeyButtonConfigurationController.h */, + BE66229C1C3285B3009C2809 /* KeyButtonConfigurationController.m */, + BE6622981C328442009C2809 /* KeyButtonManagementController.h */, + BE6622991C328442009C2809 /* KeyButtonManagementController.mm */, + BEE4172C1D6AA35E00E3ED45 /* ScrollToRowHandler.h */, + BEE4172D1D6AA35E00E3ED45 /* ScrollToRowHandler.m */, + 7EF97ABB1A7586E7002CC332 /* SelectConfigurationViewController.h */, + 7EF97ABC1A7586E7002CC332 /* SelectConfigurationViewController.mm */, 05D5233412E8030E007912AE /* SelectEffectController.h */, - 05D5233512E8030E007912AE /* SelectEffectController.m */, - 05D5233612E8030E007912AE /* SelectEffectController.xib */, - 05619ED813ADE1AA00341DB0 /* SelectHardware.h */, - 05619ED913ADE1AA00341DB0 /* SelectHardware.m */, - 05619EDA13ADE1AA00341DB0 /* SelectHardware.xib */, + 05D5233512E8030E007912AE /* SelectEffectController.mm */, + 7EE0D0431AACF2090081DAA5 /* Settings.h */, + 7EE0D0441AACF2090081DAA5 /* Settings.mm */, + 7E27C39D1AA3A6D300C00584 /* SettingsDisplayController.h */, + 7E27C39E1AA3A6D300C00584 /* SettingsDisplayController.mm */, + 7ED7ACAA1E92C9760041C2A4 /* SettingHardwareController.h */, + 7ED7ACAB1E92C9760041C2A4 /* SettingHardwareController.m */, + 7E3C13E31A51F16600534164 /* SettingsGeneralController.h */, + 7E3C13E41A51F16600534164 /* SettingsGeneralController.mm */, + 7E2A59AF1B052C3300C802E0 /* SettingsJoypadController.h */, + 7E2A59B01B052C3300C802E0 /* SettingsJoypadController.mm */, + 7E66C1C01C5E1E89008B34D0 /* SettingsJoypadMainController.h */, + 7E66C1C11C5E1E89008B34D0 /* SettingsJoypadMainController.mm */, + 7EC59ED01BAC52390097B87A /* SettingsJoypadStyle.h */, + 7EC59ED11BAC52390097B87A /* SettingsJoypadStyle.mm */, + 7EF076621B9B2C7A00224DF0 /* SettingsJoypadVpadController.h */, + 7EF076631B9B2C7A00224DF0 /* SettingsJoypadVpadController.mm */, + 7E6BCCD91D591DA900826CBD /* SettingsMouseController.h */, + 7E6BCCDA1D591DA900826CBD /* SettingsMouseController.m */, + 7EDA12161CDB39640002B670 /* SettingsSelectKeyViewController.h */, + 7EB0177F1B0921B000C74B9D /* SettingsSelectKeyViewController.mm */, + 7E6F37771CDB4E58005BA173 /* SettingsSelectPortViewController.h */, + 7E6F37781CDB4E58005BA173 /* SettingsSelectPortViewController.mm */, + 7EB017771B09164900C74B9D /* State.h */, + 7EB017761B09164900C74B9D /* State.mm */, + 7EB017741B09164900C74B9D /* StateFileManager.mm */, + 7EB017751B09164900C74B9D /* StateFileManager.h */, + 7EB017641B09115900C74B9D /* StateManagementController.h */, + 7EB017631B09115900C74B9D /* StateManagementController.mm */, + 7E770D771D109BF4000E5E1A /* UnappliedSettingLabelHandler.h */, + 7E770D781D109BF4000E5E1A /* UnappliedSettingLabelHandler.m */, + 7EEFD2901BAC3DE300C7F247 /* VPadLeftOrRight.h */, + BE6F9F611C4E2C420061B98C /* VPadLeftOrRight.mm */, + E937D8AE1CB58CE3008DCC27 /* VPadTouchOrGyro.h */, + E937D8AF1CB58CE3008DCC27 /* VPadTouchOrGyro.mm */, + 7E7936981D9D5FC5003274B4 /* constSettings.h */, ); name = Settings; sourceTree = ""; @@ -3024,13 +2944,14 @@ children = ( 97BE2AA71548702100BF66CF /* Controls */, 97BE2A9315486FE600BF66CF /* json */, - 05BB086213CC233F00278699 /* lambda-alert */, 05BC1AEB1073448200EABC6E /* File Browser */, 050414C40FCB455500F46828 /* Emulator */, 05BC1B1910734C0700EABC6E /* Settings */, 050415680FCB4BC300F46828 /* Utility */, 1D3623240D0F684500981E51 /* iAmigaAppDelegate.h */, 1D3623250D0F684500981E51 /* iAmigaAppDelegate.mm */, + 7E2EF0DB1D004B9500CDD9B9 /* iUAEApplication.h */, + 7E2EF0DC1D004B9500CDD9B9 /* iUAEApplication.mm */, ); path = Classes; sourceTree = ""; @@ -3038,7 +2959,7 @@ 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 1D6058910D05DD3D006BFB54 /* iAmiga.app */, + 1D6058910D05DD3D006BFB54 /* iUAE.app */, 0533695113B1DEE90012D55A /* DotC.app */, 97EF9600153876CA001C01E6 /* stooges.app */, 97242CD6156177EC00B6D03C /* lrs.app */, @@ -3046,6 +2967,7 @@ 9787FABA1561882D00458A4A /* koc.app */, 9787FC2215618A5E00458A4A /* sinbad.app */, 97C875C6156E834100197738 /* p1.app */, + BE17E1151D6C2E8200221E7F /* iUAETests.xctest */, ); name = Products; sourceTree = ""; @@ -3053,11 +2975,31 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + E937D8A81CB58C4F008DCC27 /* VPadMotionController.h */, + E937D8A91CB58C50008DCC27 /* VPadMotionController.mm */, + 9064AD601C7F7982004CAE28 /* MultiPeerConnectivityController.h */, + 9064AD611C7F7982004CAE28 /* MultiPeerConnectivityController.mm */, + 9064AD621C7F7982004CAE28 /* MPCConnectionStates.h */, + BE5DE31D1C5CCD1400FF5D1D /* Default-568h@2x.png */, + 7E1A15901B171D7E00F0EA17 /* JoypadKey.h */, + 7EA4D6651923EDBE00C58BB9 /* MainEmulationViewController.h */, + 7EA4D6621923EDA100C58BB9 /* TouchHandlerViewClassic.h */, + 7EA4D65F1923ED0800C58BB9 /* EmulationView-iPad.h */, + 7EA4D6511923ECC100C58BB9 /* EmulationView-iPad.mm */, + 7EA4D6521923ECC100C58BB9 /* EmulationView-iPhone.h */, + 7EA4D6531923ECC100C58BB9 /* EmulationView-iPhone.mm */, + 7EA4D6541923ECC100C58BB9 /* MainEmulationViewController.mm */, + 7EA4D6561923ECC100C58BB9 /* TouchHandlerViewClassic.m */, + 7EA4D64E1923ECB400C58BB9 /* IOSKeyboard.h */, + 7EA4D64F1923ECB400C58BB9 /* IOSKeyboard.m */, + 7EA4D6491923EC9700C58BB9 /* BaseWebviewController.h */, + 7EA4D64A1923EC9700C58BB9 /* BaseWebviewController.m */, 053D8B2E13B1B2C30002802F /* TargetSpecific */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, 059A411B12697B33003B23C7 /* Resources-iPad */, + BE17E1161D6C2E8200221E7F /* iUAETests */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); @@ -3067,10 +3009,13 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( + BEEFB2DF1D72C6A50056CC8E /* STObjCToolbelt */, + 7EB0176A1B09140D00C74B9D /* SVProgressHUD */, + 7EAA9D99192541D400541BE1 /* CustomIOSKeyboard */, 9785505F153A3F2E00580B91 /* libraries */, 0552BC9A0F3D7968005B30DF /* uae */, - 32CA4F630368D1EE00C91783 /* iAmiga_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, + 32CA4F630368D1EE00C91783 /* iUAE_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.mm */, ); name = "Other Sources"; sourceTree = ""; @@ -3083,7 +3028,6 @@ 057443530FC3CA04003BE251 /* disks */, 057440D40FC2A4A7003BE251 /* roms */, 0504161C0FCB566500F46828 /* images */, - 28AD733E0D9D9553002E5188 /* MainWindow.xib */, 8D1107310486CEB800E47090 /* Info.plist */, 05789FB813B1436200A72F5F /* Entitlements.plist */, ); @@ -3093,7 +3037,11 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( - 05084E4913D7FE7B0004617A /* libz.dylib */, + BEC5372B1DA144C9002C3793 /* AVFoundation.framework */, + 7E5A77011D00370E009BF491 /* ExternalAccessory.framework */, + E937D8A61CB58BC9008DCC27 /* CoreMotion.framework */, + 9064AD541C7D09FA004CAE28 /* MultipeerConnectivity.framework */, + 7EB372E91A0FC8DE001B460A /* GameController.framework */, 976877751534B2D20077B654 /* AudioToolbox.framework */, 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, 1D30AB110D05D00D00671497 /* Foundation.framework */, @@ -3105,6 +3053,106 @@ name = Frameworks; sourceTree = ""; }; + 7EAA9D99192541D400541BE1 /* CustomIOSKeyboard */ = { + isa = PBXGroup; + children = ( + 7EAA9D9A192541D400541BE1 /* iPad */, + 7EAA9DA7192541D400541BE1 /* iPhone:iPod */, + ); + name = CustomIOSKeyboard; + path = OtherSources/CustomIOSKeyboard; + sourceTree = ""; + }; + 7EAA9D9A192541D400541BE1 /* iPad */ = { + isa = PBXGroup; + children = ( + 7EAA9D9B192541D400541BE1 /* Images */, + 7EAA9DA4192541D400541BE1 /* PKCustomKeyboard.h */, + 7EAA9DA5192541D400541BE1 /* PKCustomKeyboard.mm */, + BE6537D91C5F7E41007AD097 /* PKCustomKeyboard.xib */, + ); + path = iPad; + sourceTree = ""; + }; + 7EAA9D9B192541D400541BE1 /* Images */ = { + isa = PBXGroup; + children = ( + 7EAA9D9C192541D400541BE1 /* Specialkeyboard.png */, + ); + path = Images; + sourceTree = ""; + }; + 7EAA9DA7192541D400541BE1 /* iPhone:iPod */ = { + isa = PBXGroup; + children = ( + 7EAA9DA8192541D400541BE1 /* Images */, + 7EAA9DB4192541D400541BE1 /* PMCustomKeyboard.h */, + 7EAA9DB5192541D400541BE1 /* PMCustomKeyboard.mm */, + BE6537DB1C5F7E59007AD097 /* PMCustomKeyboard.xib */, + ); + path = "iPhone:iPod"; + sourceTree = ""; + }; + 7EAA9DA8192541D400541BE1 /* Images */ = { + isa = PBXGroup; + children = ( + 7E0E9593198ACF4C0082F80F /* iOSKeyboard.png */, + ); + path = Images; + sourceTree = ""; + }; + 7EB0176A1B09140D00C74B9D /* SVProgressHUD */ = { + isa = PBXGroup; + children = ( + 7EB0176B1B09143000C74B9D /* SVProgressHUD.m */, + 7EB0176C1B09143000C74B9D /* SVProgressHUD.h */, + 7EB0176D1B09143000C74B9D /* SVProgressHUD.bundle */, + 7EB0176E1B09143000C74B9D /* SVProgressHUD-Prefix.pch */, + 7EB0176F1B09143000C74B9D /* SVIndefiniteAnimatedView.m */, + 7EB017701B09143000C74B9D /* SVIndefiniteAnimatedView.h */, + ); + name = SVProgressHUD; + sourceTree = ""; + }; + 7EB5FBBC19F942AA0030920E /* Images */ = { + isa = PBXGroup; + children = ( + 7EF0C8D11E89ADBD00531AE3 /* Ram_Unselected.png */, + 7EF0C8D21E89ADBD00531AE3 /* Ram-Selected.png */, + 7E2665501C483AEB004250D1 /* monitor_unselected.png */, + 7E2665511C483AEB004250D1 /* monitor_selected_svg.svg */, + 7E2665521C483AEB004250D1 /* monitor_selected.png */, + 7E5AF61F1C444C83000BF5CB /* gear_unselected.png */, + 7E5AF61D1C444C65000BF5CB /* keyboard_unselected.png */, + 7E5AF5FB1C444854000BF5CB /* sticky_unselected_svg.svg */, + 7E5AF5FC1C444854000BF5CB /* sticky_unselected.png */, + 7E5AF5FD1C444854000BF5CB /* sticky_selected_svg.svg */, + 7E5AF5FE1C444854000BF5CB /* sticky_selected.png */, + 7E5AF5FF1C444854000BF5CB /* keyboard_unselected_svg.svg */, + 7E5AF6011C444854000BF5CB /* keyboard_selected_svg.svg */, + 7E5AF6021C444854000BF5CB /* keyboard_selected.png */, + 7E5AF6031C444854000BF5CB /* gear_unselected_svg.svg */, + 7E5AF6051C444854000BF5CB /* gear_selected_svg.svg */, + 7E5AF6061C444854000BF5CB /* gear_selected.png */, + 7E5AF6071C444854000BF5CB /* controller_unselected_svg.svg */, + 7E5AF6081C444854000BF5CB /* controller_unselected.png */, + 7E5AF6091C444854000BF5CB /* controller_selected_svg.svg */, + 7E5AF60A1C444854000BF5CB /* controller_selected.png */, + 7EA5E7881AED732500FCE311 /* sticky.png */, + 7E27C39B1AA3A61900C00584 /* display.png */, + 7E21F5C31A3F784E000D9AD2 /* gamepad_selected.png */, + 7E43484E1A3B7C6100C60BF1 /* keyboard.png */, + 7ED40F1D1A3E1C9300E0E1F8 /* gamepad.png */, + 7E1B8C4919FAE04700B6136B /* unsticky.png */, + 7E1B8C3319FADFD400B6136B /* modejoy.png */, + 7E1B8C3519FADFD400B6136B /* modejoypressed.png */, + 7E1B8C3719FADFD400B6136B /* modekeyoff.png */, + 7E1B8C3919FADFD400B6136B /* modekeyon.png */, + 7E1B8C3B19FADFD400B6136B /* options.png */, + ); + name = Images; + sourceTree = ""; + }; 9706D7101561827300073678 /* sdi */ = { isa = PBXGroup; children = ( @@ -3126,9 +3174,6 @@ 9706D7201561827300073678 /* chrome-top.png */, 9706D7211561827300073678 /* chrome-top@2x.png */, 9706D7221561827300073678 /* chrome-top~ipad.png */, - 9706D7231561827300073678 /* Default-Landscape~ipad.png */, - 9706D7241561827300073678 /* Default.png */, - 9706D7251561827300073678 /* DISK1.ADF */, 9706D7261561827300073678 /* EmulationView-iPad.h */, 9706D7271561827300073678 /* EmulationView-iPad.m */, 9706D7281561827300073678 /* EmulationView-iPad.xib */, @@ -3245,10 +3290,6 @@ 97242CE9156178CB00B6D03C /* chrome-top.png */, 97242CEA156178CB00B6D03C /* chrome-top@2x.png */, 97242CEB156178CB00B6D03C /* chrome-top~ipad.png */, - 97242CEC156178CB00B6D03C /* Default-Landscape~ipad.png */, - 97242CED156178CB00B6D03C /* Default.png */, - 97242CEE156178CB00B6D03C /* DISK1.ADF */, - 97242CEF156178CB00B6D03C /* DISK2.ADF */, 97242CF0156178CB00B6D03C /* EmulationViewController.h */, 97242CF1156178CB00B6D03C /* EmulationViewController.m */, 97242CF2156178CB00B6D03C /* EmulationView-iPad.h */, @@ -3348,39 +3389,7 @@ isa = PBXGroup; children = ( 97A641E415754C1900AD7B87 /* instructions */, - 97A641C915754BFD00AD7B87 /* html */, - 9787FB12156188ED00458A4A /* intro_4~ipad.png */, - 9787FB07156188ED00458A4A /* intro_1.png */, - 9787FB08156188ED00458A4A /* intro_1@2x.png */, - 9787FB09156188ED00458A4A /* intro_1~ipad.png */, - 9787FB0A156188ED00458A4A /* intro_2.png */, - 9787FB0B156188ED00458A4A /* intro_2@2x.png */, - 9787FB0C156188ED00458A4A /* intro_2~ipad.png */, - 9787FB0D156188ED00458A4A /* intro_3.png */, - 9787FB0E156188ED00458A4A /* intro_3@2x.png */, - 9787FB0F156188ED00458A4A /* intro_3~ipad.png */, - 9787FB10156188ED00458A4A /* intro_4.png */, - 9787FB11156188ED00458A4A /* intro_4@2x.png */, - 9787FABE156188ED00458A4A /* bg_web.png */, - 9787FABF156188ED00458A4A /* bg_web@2x.png */, - 9787FAC0156188ED00458A4A /* bg_web~ipad.png */, - 9787FAC1156188ED00458A4A /* btn_close.png */, 9787FAC2156188ED00458A4A /* btn_close@2x.png */, - 9787FAC3156188ED00458A4A /* btn_close~ipad.png */, - 9787FAC4156188ED00458A4A /* btn_menu.png */, - 9787FAC5156188ED00458A4A /* btn_menu@2x.png */, - 9787FAC6156188ED00458A4A /* btn_menu~ipad.png */, - 9787FAC7156188ED00458A4A /* btn_restart.png */, - 9787FAC8156188ED00458A4A /* btn_restart@2x.png */, - 9787FAC9156188ED00458A4A /* btn_restart~ipad.png */, - 9787FACA156188ED00458A4A /* chrome-bottom.png */, - 9787FACB156188ED00458A4A /* chrome-bottom@2x.png */, - 9787FACC156188ED00458A4A /* chrome-bottom~ipad.png */, - 9787FACD156188ED00458A4A /* chrome-top.png */, - 9787FACE156188ED00458A4A /* chrome-top@2x.png */, - 9787FACF156188ED00458A4A /* chrome-top~ipad.png */, - 9787FAD2156188ED00458A4A /* DISK1.ADF */, - 9787FAD3156188ED00458A4A /* DISK2.ADF */, ); name = Resources; sourceTree = ""; @@ -3396,7 +3405,6 @@ 97855060153A3F2E00580B91 /* sdl-mini */ = { isa = PBXGroup; children = ( - 97855061153A3F2E00580B91 /* .gitignore */, 97855062153A3F2E00580B91 /* include */, 9785507B153A3F2E00580B91 /* src */, ); @@ -3406,6 +3414,9 @@ 97855062153A3F2E00580B91 /* include */ = { isa = PBXGroup; children = ( + 7EF2F7BC1D2807B00019A579 /* joystick.h */, + 7EF2F7B91D2805D50019A579 /* SDL_joystick.h */, + 7E48A5941D10899200198C28 /* od-joy.h */, 97855063153A3F2E00580B91 /* begin_code.h */, 97855064153A3F2E00580B91 /* close_code.h */, 97855065153A3F2E00580B91 /* SDL.h */, @@ -3417,7 +3428,6 @@ 9785506B153A3F2E00580B91 /* SDL_error.h */, 9785506C153A3F2E00580B91 /* SDL_events.h */, 9785506D153A3F2E00580B91 /* sdl_internal.h */, - 9785506E153A3F2E00580B91 /* SDL_joystick.h */, 9785506F153A3F2E00580B91 /* SDL_keyboard.h */, 97855070153A3F2E00580B91 /* SDL_keysym.h */, 97855071153A3F2E00580B91 /* SDL_mouse.h */, @@ -3465,8 +3475,8 @@ 97855082153A3F2E00580B91 /* joystick */ = { isa = PBXGroup; children = ( + 7EF2F7BA1D2807600019A579 /* od-joy.mm */, 97855083153A3F2E00580B91 /* iOS */, - 9785508E153A3F2E00580B91 /* SDL_joystick.c */, 9785508F153A3F2E00580B91 /* SDL_joystick_c.h */, 97855090153A3F2E00580B91 /* SDL_sysjoystick.h */, ); @@ -3479,11 +3489,8 @@ 97855084153A3F2E00580B91 /* ButtonStates.h */, 97855085153A3F2E00580B91 /* ButtonStates.m */, 97855086153A3F2E00580B91 /* iCadeReaderView.h */, - 97855087153A3F2E00580B91 /* iCadeReaderView.m */, + 97855087153A3F2E00580B91 /* iCadeReaderView.mm */, 97855088153A3F2E00580B91 /* iCadeState.h */, - 97855089153A3F2E00580B91 /* iControlPadReaderView.h */, - 9785508A153A3F2E00580B91 /* iControlPadReaderView.m */, - 9785508B153A3F2E00580B91 /* SDL_sysjoystick.m */, 9785508C153A3F2E00580B91 /* SDLUIAccelerationDelegate.h */, 9785508D153A3F2E00580B91 /* SDLUIAccelerationDelegate.m */, ); @@ -3624,10 +3631,6 @@ 9787FC3415618ADB00458A4A /* chrome-top.png */, 9787FC3515618ADB00458A4A /* chrome-top@2x.png */, 9787FC3615618ADB00458A4A /* chrome-top~ipad.png */, - 9787FC3715618ADB00458A4A /* Default-Landscape~ipad.png */, - 9787FC3815618ADB00458A4A /* Default.png */, - 9787FC3915618ADB00458A4A /* DISK1.ADF */, - 9787FC3A15618ADB00458A4A /* DISK2.ADF */, 9787FC3B15618ADB00458A4A /* EmulationView-iPad.h */, 9787FC3C15618ADB00458A4A /* EmulationView-iPad.m */, 9787FC3D15618ADB00458A4A /* EmulationView-iPad.xib */, @@ -3723,37 +3726,9 @@ path = instructions; sourceTree = ""; }; - 97A641C915754BFD00AD7B87 /* html */ = { - isa = PBXGroup; - children = ( - 97A641CA15754C0700AD7B87 /* about.html */, - 97A641CB15754C0700AD7B87 /* css */, - 97A641CC15754C0700AD7B87 /* functions.js */, - 97A641CD15754C0700AD7B87 /* gpl.html */, - 97A641CE15754C0700AD7B87 /* help.html */, - 97A641CF15754C0700AD7B87 /* images */, - 97A641D015754C0700AD7B87 /* iscroll.js */, - 97A641D115754C0800AD7B87 /* iscroll4.js */, - 97A641D215754C0800AD7B87 /* jquery-1.4.4.min.js */, - 97A641D315754C0800AD7B87 /* jquery-1.5.2.min.js */, - 97A641D415754C0800AD7B87 /* Limelight.ttf */, - 97A641D515754C0800AD7B87 /* UserGuide.html */, - 97A641D615754C0800AD7B87 /* UserGuide~ipad.html */, - ); - name = html; - sourceTree = ""; - }; 97A641E415754C1900AD7B87 /* instructions */ = { isa = PBXGroup; children = ( - 97A641E515754C2400AD7B87 /* instruction-dotc-cursor.png */, - 97A641E615754C2400AD7B87 /* instruction-dotc-cursor@2x.png */, - 97A641E715754C2400AD7B87 /* instruction-handclick.png */, - 97A641E815754C2500AD7B87 /* instruction-handclick@2x.png */, - 97A641E915754C2500AD7B87 /* instruction-handdrag.png */, - 97A641EA15754C2500AD7B87 /* instruction-handdrag@2x.png */, - 97A641EB15754C2500AD7B87 /* instruction-menuclick.png */, - 97A641EC15754C2500AD7B87 /* instruction-menuclick@2x.png */, ); name = instructions; sourceTree = ""; @@ -3854,8 +3829,6 @@ 97A931C01538AFDC001064D7 /* html */, 97A931761538AD8A001064D7 /* instructions */, 97A931381538AD1B001064D7 /* Chrome */, - 97EE415B1538A83B0072514D /* DISK1.ADF */, - 97EE415C1538A83B0072514D /* DISK2.ADF */, ); path = Resources; sourceTree = ""; @@ -3883,12 +3856,17 @@ 97BE2AA71548702100BF66CF /* Controls */ = { isa = PBXGroup; children = ( + 7EB5FBBC19F942AA0030920E /* Images */, 97BE2AB51548702100BF66CF /* Landscape */, 97BE2AA81548702100BF66CF /* BaseControlsView.h */, - 97BE2AA91548702100BF66CF /* BaseControlsView.m */, + 97BE2AA91548702100BF66CF /* BaseControlsView.mm */, + 7E54BB1E1AA3362E0054F6B2 /* MFIControllerReaderView.mm */, + 7E54BB1F1AA3362E0054F6B2 /* MFIControllerReaderView.h */, 97BE2AAA1548702100BF66CF /* BaseLeftRightAwareView.h */, 97BE2AAB1548702100BF66CF /* BaseLeftRightAwareView.m */, 97BE2AAC1548702100BF66CF /* ButtonJoyButton.h */, + 0504155D0FCB475C00F46828 /* InputControllerView.h */, + 0504155E0FCB475C00F46828 /* InputControllerView.mm */, 97BE2AAD1548702100BF66CF /* ButtonJoyButton.mm */, 97BE2AAE1548702100BF66CF /* ControlDefaultConstants.h */, 97BE2AAF1548702100BF66CF /* ControlDefaultConstants.m */, @@ -3900,7 +3878,7 @@ 97BE2ABA1548702100BF66CF /* MMFixedStickController.h */, 97BE2ABB1548702100BF66CF /* MMFixedStickController.mm */, 97BE2ABC1548702100BF66CF /* StaticImage.h */, - 97BE2ABD1548702100BF66CF /* StaticImage.m */, + 97BE2ABD1548702100BF66CF /* StaticImage.mm */, 97BE2ABE1548702100BF66CF /* StickControllerBase.h */, 97BE2ABF1548702100BF66CF /* StickControllerBase.mm */, 97BE2AC01548702100BF66CF /* StickControllerDelegate.h */, @@ -3923,6 +3901,14 @@ 97BE2ACE15489E6600BF66CF /* emulator */ = { isa = PBXGroup; children = ( + 7E4B18EA188B1E8D0019E82B /* chrome-bottom~ipad.png */, + 7E4B18DC188B1CD70019E82B /* btn_restart.png */, + 7E4B18DD188B1CD70019E82B /* btn_restart@2x.png */, + 7E4B18DE188B1CD70019E82B /* btn_restart~ipad.png */, + 7E4B18DA188B1CBE0019E82B /* chrome-bottom@2x.png */, + 7E4B18D6188B1CAB0019E82B /* chrome-top@2x.png */, + 7E4B18D7188B1CAB0019E82B /* chrome-top~ipad.png */, + 7E4B18D4188B1C720019E82B /* chrome-bottom.png */, 97BE2ACF15489E6600BF66CF /* firebutton-red-active.png */, 97BE2AD015489E6600BF66CF /* firebutton-red-active@2x.png */, 97BE2AD115489E6600BF66CF /* firebutton-red-active~ipad.png */, @@ -3943,7 +3929,6 @@ isa = PBXGroup; children = ( 97BE2AD615489E6600BF66CF /* joystick.png */, - 97BE2AD715489E6600BF66CF /* keyboard.png */, 97BE2AD815489E6600BF66CF /* mouse.png */, ); path = "input-mode"; @@ -3979,6 +3964,41 @@ path = Stooges; sourceTree = ""; }; + BE17E1161D6C2E8200221E7F /* iUAETests */ = { + isa = PBXGroup; + children = ( + BE17E1201D6C2E9A00221E7F /* CoreSettingGroupTests.m */, + BE17E1211D6C2E9A00221E7F /* CoreSettingTests.m */, + BE17E1191D6C2E8200221E7F /* Info.plist */, + ); + path = iUAETests; + sourceTree = ""; + }; + BEE41BC91B47849F00CE487D /* minizip */ = { + isa = PBXGroup; + children = ( + BEE41BCA1B4784AC00CE487D /* zip.h */, + BEE41BCB1B4784AC00CE487D /* zip.c */, + BEE41BCC1B4784AC00CE487D /* unzip.h */, + BEE41BCD1B4784AC00CE487D /* unzip.c */, + BEE41BCE1B4784AC00CE487D /* mztools.h */, + BEE41BCF1B4784AC00CE487D /* mztools.c */, + BEE41BD01B4784AC00CE487D /* ioapi.h */, + BEE41BD11B4784AC00CE487D /* ioapi.c */, + BEE41BD21B4784AC00CE487D /* crypt.h */, + ); + name = minizip; + sourceTree = ""; + }; + BEEFB2DF1D72C6A50056CC8E /* STObjCToolbelt */ = { + isa = PBXGroup; + children = ( + BEEFB2DC1D72C6A00056CC8E /* MultiDictionary.h */, + BEEFB2DD1D72C6A00056CC8E /* MultiDictionary.m */, + ); + name = STObjCToolbelt; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -3989,6 +4009,7 @@ 053368C113B1DEE90012D55A /* Resources */, 0533690213B1DEE90012D55A /* Sources */, 0533694413B1DEE90012D55A /* Frameworks */, + 50524F424C454D533F /* ShellScript */, ); buildRules = ( ); @@ -3999,21 +4020,22 @@ productReference = 0533695113B1DEE90012D55A /* DotC.app */; productType = "com.apple.product-type.application"; }; - 1D6058900D05DD3D006BFB54 /* iAmiga */ = { + 1D6058900D05DD3D006BFB54 /* iUAE */ = { isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iAmiga" */; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iUAE" */; buildPhases = ( 1D60588D0D05DD3D006BFB54 /* Resources */, 1D60588E0D05DD3D006BFB54 /* Sources */, 1D60588F0D05DD3D006BFB54 /* Frameworks */, + 7E57D8A219119D9500648935 /* ShellScript */, ); buildRules = ( ); dependencies = ( ); - name = iAmiga; + name = iUAE; productName = iAmiga; - productReference = 1D6058910D05DD3D006BFB54 /* iAmiga.app */; + productReference = 1D6058910D05DD3D006BFB54 /* iUAE.app */; productType = "com.apple.product-type.application"; }; 9706D6521561817500073678 /* sdi */ = { @@ -4118,15 +4140,42 @@ productReference = 97EF9600153876CA001C01E6 /* stooges.app */; productType = "com.apple.product-type.application"; }; + BE17E1141D6C2E8200221E7F /* iUAETests */ = { + isa = PBXNativeTarget; + buildConfigurationList = BE17E11C1D6C2E8200221E7F /* Build configuration list for PBXNativeTarget "iUAETests" */; + buildPhases = ( + BE17E1111D6C2E8200221E7F /* Sources */, + BE17E1121D6C2E8200221E7F /* Frameworks */, + BE17E1131D6C2E8200221E7F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + BE17E11B1D6C2E8200221E7F /* PBXTargetDependency */, + ); + name = iUAETests; + productName = iUAETests; + productReference = BE17E1151D6C2E8200221E7F /* iUAETests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0730; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = 6854WVMAT3; + }; + BE17E1141D6C2E8200221E7F = { + CreatedOnToolsVersion = 7.3; + TestTargetID = 1D6058900D05DD3D006BFB54; + }; + }; }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iAmiga" */; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iUAE" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; @@ -4137,7 +4186,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - 1D6058900D05DD3D006BFB54 /* iAmiga */, + 1D6058900D05DD3D006BFB54 /* iUAE */, 053368C013B1DEE90012D55A /* DotC */, 97EF9571153876CA001C01E6 /* stooges */, 97242C25156177EC00B6D03C /* lrs */, @@ -4145,6 +4194,7 @@ 9787F9FF1561882D00458A4A /* koc */, 9787FB6115618A5E00458A4A /* sinbad */, 97C87500156E834100197738 /* 3s2 */, + BE17E1141D6C2E8200221E7F /* iUAETests */, ); }; /* End PBXProject section */ @@ -4157,9 +4207,6 @@ 056089BE13C2366000677A6C /* iscroll4.js in Resources */, 05A1503413BDAA1A009A12B2 /* functions.js in Resources */, 05A1503613BDAA1A009A12B2 /* jquery-1.4.4.min.js in Resources */, - 053368C513B1DEE90012D55A /* kick.rom in Resources */, - 053368C613B1DEE90012D55A /* kick13.rom in Resources */, - 053368EC13B1DEE90012D55A /* kick31.rom in Resources */, 9785510A153A3F2E00580B91 /* Aperture (1x2 RB).png in Resources */, 9785510D153A3F2E00580B91 /* Aperture (1x3 RB).png in Resources */, 97855110153A3F2E00580B91 /* Aperture (2x4 BG).png in Resources */, @@ -4171,8 +4218,6 @@ 97855132153A3FB200580B91 /* Simple.frag in Resources */, 97855133153A3FB200580B91 /* Simple.vert in Resources */, 0533690113B1DEE90012D55A /* Entitlements.plist in Resources */, - 0533695313B1DF500012D55A /* MainWindow-Single.xib in Resources */, - 0533695413B1DF580012D55A /* MainWindow-Single-iPad.xib in Resources */, 0533695713B1DF650012D55A /* icon-72.png in Resources */, 0533695813B1DF650012D55A /* icon.png in Resources */, 0533695913B1DF650012D55A /* icon@2x.png in Resources */, @@ -4224,8 +4269,6 @@ 057B977413CEC7D60065278D /* intro_4.png in Resources */, 057B977513CEC7D60065278D /* intro_4@2x.png in Resources */, 057B977613CEC7D60065278D /* intro_4~ipad.png in Resources */, - 97A932091538B207001064D7 /* DISK1.ADF in Resources */, - 97A9320A1538B207001064D7 /* DISK2.ADF in Resources */, 97BE2AE215489E6600BF66CF /* firebutton-red-active.png in Resources */, 97BE2AE515489E6600BF66CF /* firebutton-red-active@2x.png in Resources */, 97BE2AE815489E6600BF66CF /* firebutton-red-active~ipad.png in Resources */, @@ -4233,7 +4276,6 @@ 97BE2AEE15489E6600BF66CF /* firebutton-red@2x.png in Resources */, 97BE2AF115489E6600BF66CF /* firebutton-red~ipad.png in Resources */, 97BE2AF415489E6600BF66CF /* joystick.png in Resources */, - 97BE2AF715489E6600BF66CF /* keyboard.png in Resources */, 97BE2AFA15489E6600BF66CF /* mouse.png in Resources */, 97BE2AFD15489E6600BF66CF /* ls-fullscreen_bottomBtn.png in Resources */, 97BE2B0015489E6600BF66CF /* ls-instructions_overlay.png in Resources */, @@ -4249,55 +4291,85 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, - 057440D60FC2A4A7003BE251 /* kick.rom in Resources */, - 0574432A0FC3C94F003BE251 /* kick13.rom in Resources */, - 05BC1AF81073448200EABC6E /* EMUROMBrowserView.xib in Resources */, + 7E2665541C483AEB004250D1 /* monitor_selected_svg.svg in Resources */, + 7E1B8C4519FADFD400B6136B /* options.png in Resources */, + 7E4B18DF188B1CD70019E82B /* btn_restart.png in Resources */, + 7E5AF6161C444854000BF5CB /* gear_selected.png in Resources */, 05BC1B17107348E500EABC6E /* keys.png in Resources */, + 7E5AF60F1C444854000BF5CB /* keyboard_unselected_svg.svg in Resources */, 05BC1B18107348E500EABC6E /* VKBD.PNG in Resources */, - 05BC1B1E10734C3B00EABC6E /* SettingsController.xib in Resources */, - 05F5F218112A54F1001530EC /* kick31.rom in Resources */, - 059A411D12697B33003B23C7 /* MainWindow-iPad.xib in Resources */, + 7E4B18D5188B1C720019E82B /* chrome-bottom.png in Resources */, + BE6537DA1C5F7E41007AD097 /* PKCustomKeyboard.xib in Resources */, + 7E1B8C4119FADFD400B6136B /* modekeyoff.png in Resources */, + 7E21F5C41A3F784E000D9AD2 /* gamepad_selected.png in Resources */, 05D6044B12AF2D620048E478 /* Icon.png in Resources */, + 7E5AF6171C444854000BF5CB /* controller_unselected_svg.svg in Resources */, + BE5DE31E1C5CCD1400FF5D1D /* Default-568h@2x.png in Resources */, 05D6044C12AF2D620048E478 /* Icon@2x.png in Resources */, 05E8A04612B2C884005532AF /* amiga-beige-dark-center.png in Resources */, + 7E43484F1A3B7C6100C60BF1 /* keyboard.png in Resources */, 05E8A04712B2C884005532AF /* amiga-beige-dark-left.png in Resources */, 05E8A04812B2C884005532AF /* amiga-beige-dark-right.png in Resources */, + 7E5AF6151C444854000BF5CB /* gear_selected_svg.svg in Resources */, + 7E1B8C4319FADFD400B6136B /* modekeyon.png in Resources */, 05E8A04A12B2C8E9005532AF /* amiga-beige-dark.png in Resources */, - 0577C34E12E1723F0040B77D /* Scanlines (50%).png in Resources */, - 0577C34F12E1723F0040B77D /* Scanlines (100%).png in Resources */, - 0577C35012E1723F0040B77D /* Aperture (1x2 RB).png in Resources */, - 0577C35112E1723F0040B77D /* Aperture (1x3 RB).png in Resources */, - 0577C35212E1723F0040B77D /* Aperture (2x4 BG).png in Resources */, - 0577C35312E1723F0040B77D /* Aperture (2x4 RB).png in Resources */, - 0577C35412E1723F0040B77D /* Aperture (4x6).png in Resources */, - 05D5233812E8030E007912AE /* SelectEffectController.xib in Resources */, - 05619EDC13ADE1AA00341DB0 /* SelectHardware.xib in Resources */, + 7EF0C8D31E89ADBD00531AE3 /* Ram_Unselected.png in Resources */, + 7E5AF61E1C444C65000BF5CB /* keyboard_unselected.png in Resources */, + 7E10738B1A34E85E000D7269 /* Storyboard.storyboard in Resources */, + 7ED40F1E1A3E1C9300E0E1F8 /* gamepad.png in Resources */, + 7E2665531C483AEB004250D1 /* monitor_unselected.png in Resources */, + 7E4B18E1188B1CD70019E82B /* btn_restart~ipad.png in Resources */, + 7E5AF6121C444854000BF5CB /* keyboard_selected.png in Resources */, + 7E5AF6181C444854000BF5CB /* controller_unselected.png in Resources */, 058063D013B06DD800E00B04 /* Icon-72.png in Resources */, 05789FB913B1436200A72F5F /* Entitlements.plist in Resources */, - 978550C4153A3F2E00580B91 /* .gitignore in Resources */, + 7EF0C8D41E89ADBD00531AE3 /* Ram-Selected.png in Resources */, + 7E4B18E0188B1CD70019E82B /* btn_restart@2x.png in Resources */, + 7EA5E7891AED732500FCE311 /* sticky.png in Resources */, 97855109153A3F2E00580B91 /* Aperture (1x2 RB).png in Resources */, + 7E4B18DB188B1CBE0019E82B /* chrome-bottom@2x.png in Resources */, 9785510C153A3F2E00580B91 /* Aperture (1x3 RB).png in Resources */, 9785510F153A3F2E00580B91 /* Aperture (2x4 BG).png in Resources */, + 7E2665551C483AEB004250D1 /* monitor_selected.png in Resources */, + 7EAA9DB7192541D400541BE1 /* Specialkeyboard.png in Resources */, + 7E1B8C4D19FAE04700B6136B /* unsticky.png in Resources */, + 7E5AF6111C444854000BF5CB /* keyboard_selected_svg.svg in Resources */, 97855112153A3F2E00580B91 /* Aperture (2x4 RB).png in Resources */, + 7E8C24F21EA0E31300673701 /* rom.key in Resources */, + 7E5AF61A1C444854000BF5CB /* controller_selected.png in Resources */, 97855115153A3F2E00580B91 /* Aperture (4x6).png in Resources */, 9785511B153A3F2E00580B91 /* Scanlines (100%).png in Resources */, + 7E4B18D8188B1CAB0019E82B /* chrome-top@2x.png in Resources */, 9785511E153A3F2E00580B91 /* Scanlines (50%).png in Resources */, 97BE2AE115489E6600BF66CF /* firebutton-red-active.png in Resources */, + 7E27C39C1AA3A61900C00584 /* display.png in Resources */, + 7E4B18EB188B1E8D0019E82B /* chrome-bottom~ipad.png in Resources */, 97BE2AE415489E6600BF66CF /* firebutton-red-active@2x.png in Resources */, + 7E5AF6191C444854000BF5CB /* controller_selected_svg.svg in Resources */, 97BE2AE715489E6600BF66CF /* firebutton-red-active~ipad.png in Resources */, 97BE2AEA15489E6600BF66CF /* firebutton-red.png in Resources */, + 7E0E9594198ACF4C0082F80F /* iOSKeyboard.png in Resources */, 97BE2AED15489E6600BF66CF /* firebutton-red@2x.png in Resources */, + 7E1B8C3D19FADFD400B6136B /* modejoy.png in Resources */, 97BE2AF015489E6600BF66CF /* firebutton-red~ipad.png in Resources */, + BE6537DC1C5F7E59007AD097 /* PMCustomKeyboard.xib in Resources */, + 7E1B8C3F19FADFD400B6136B /* modejoypressed.png in Resources */, 97BE2AF315489E6600BF66CF /* joystick.png in Resources */, - 97BE2AF615489E6600BF66CF /* keyboard.png in Resources */, + 7E5AF60B1C444854000BF5CB /* sticky_unselected_svg.svg in Resources */, + 7E5AF60D1C444854000BF5CB /* sticky_selected_svg.svg in Resources */, + 7E5AF6201C444C83000BF5CB /* gear_unselected.png in Resources */, + 7E5AF6131C444854000BF5CB /* gear_unselected_svg.svg in Resources */, 97BE2AF915489E6600BF66CF /* mouse.png in Resources */, 97BE2AFC15489E6600BF66CF /* ls-fullscreen_bottomBtn.png in Resources */, 97BE2AFF15489E6600BF66CF /* ls-instructions_overlay.png in Resources */, 97BE2B0215489E6600BF66CF /* ls-overlay-skin.png in Resources */, 97BE2B0515489E6600BF66CF /* ls-bgimage.png in Resources */, + 7EB017721B09143000C74B9D /* SVProgressHUD.bundle in Resources */, 97BE2B0815489E6600BF66CF /* ls-fire.png in Resources */, 97BE2B0B15489E6600BF66CF /* ls-joystick_active.png in Resources */, + 7E5AF60E1C444854000BF5CB /* sticky_selected.png in Resources */, + 7E4B18D9188B1CAB0019E82B /* chrome-top~ipad.png in Resources */, + 7E5AF60C1C444854000BF5CB /* sticky_unselected.png in Resources */, 97BE2B0E15489E6600BF66CF /* ls-joystick_rest.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -4306,9 +4378,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9706D6541561817500073678 /* kick.rom in Resources */, - 9706D6551561817500073678 /* kick13.rom in Resources */, - 9706D6561561817500073678 /* kick31.rom in Resources */, 9706D6571561817500073678 /* Aperture (1x2 RB).png in Resources */, 9706D6581561817500073678 /* Aperture (1x3 RB).png in Resources */, 9706D6591561817500073678 /* Aperture (2x4 BG).png in Resources */, @@ -4320,8 +4389,6 @@ 9706D65F1561817500073678 /* Simple.frag in Resources */, 9706D6601561817500073678 /* Simple.vert in Resources */, 9706D6611561817500073678 /* Entitlements.plist in Resources */, - 9706D6621561817500073678 /* MainWindow-Single.xib in Resources */, - 9706D6631561817500073678 /* MainWindow-Single-iPad.xib in Resources */, 9706D6641561817500073678 /* firebutton-red-active.png in Resources */, 9706D6651561817500073678 /* firebutton-red-active@2x.png in Resources */, 9706D6661561817500073678 /* firebutton-red-active~ipad.png in Resources */, @@ -4329,7 +4396,6 @@ 9706D6681561817500073678 /* firebutton-red@2x.png in Resources */, 9706D6691561817500073678 /* firebutton-red~ipad.png in Resources */, 9706D66A1561817500073678 /* joystick.png in Resources */, - 9706D66B1561817500073678 /* keyboard.png in Resources */, 9706D66C1561817500073678 /* mouse.png in Resources */, 9706D66D1561817500073678 /* ls-fullscreen_bottomBtn.png in Resources */, 9706D66E1561817500073678 /* ls-instructions_overlay.png in Resources */, @@ -4356,9 +4422,6 @@ 9706D7741561827300073678 /* chrome-top.png in Resources */, 9706D7751561827300073678 /* chrome-top@2x.png in Resources */, 9706D7761561827300073678 /* chrome-top~ipad.png in Resources */, - 9706D7771561827300073678 /* Default-Landscape~ipad.png in Resources */, - 9706D7781561827300073678 /* Default.png in Resources */, - 9706D7791561827300073678 /* DISK1.ADF in Resources */, 9706D77B1561827300073678 /* EmulationView-iPad.xib in Resources */, 9706D77D1561827300073678 /* EmulationView-iPhone.xib in Resources */, 9706D77F1561827300073678 /* about.html in Resources */, @@ -4413,9 +4476,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 97242C2A156177EC00B6D03C /* kick.rom in Resources */, - 97242C2B156177EC00B6D03C /* kick13.rom in Resources */, - 97242C2C156177EC00B6D03C /* kick31.rom in Resources */, 97242C2D156177EC00B6D03C /* Aperture (1x2 RB).png in Resources */, 97242C2E156177EC00B6D03C /* Aperture (1x3 RB).png in Resources */, 97242C2F156177EC00B6D03C /* Aperture (2x4 BG).png in Resources */, @@ -4427,8 +4487,6 @@ 97242C35156177EC00B6D03C /* Simple.frag in Resources */, 97242C36156177EC00B6D03C /* Simple.vert in Resources */, 97242C37156177EC00B6D03C /* Entitlements.plist in Resources */, - 97242C38156177EC00B6D03C /* MainWindow-Single.xib in Resources */, - 97242C39156177EC00B6D03C /* MainWindow-Single-iPad.xib in Resources */, 97242C6F156177EC00B6D03C /* firebutton-red-active.png in Resources */, 97242C70156177EC00B6D03C /* firebutton-red-active@2x.png in Resources */, 97242C71156177EC00B6D03C /* firebutton-red-active~ipad.png in Resources */, @@ -4436,7 +4494,6 @@ 97242C73156177EC00B6D03C /* firebutton-red@2x.png in Resources */, 97242C74156177EC00B6D03C /* firebutton-red~ipad.png in Resources */, 97242C75156177EC00B6D03C /* joystick.png in Resources */, - 97242C76156177EC00B6D03C /* keyboard.png in Resources */, 97242C77156177EC00B6D03C /* mouse.png in Resources */, 97242C78156177EC00B6D03C /* ls-fullscreen_bottomBtn.png in Resources */, 97242C79156177EC00B6D03C /* ls-instructions_overlay.png in Resources */, @@ -4463,8 +4520,6 @@ 97242D3E156178CC00B6D03C /* chrome-top.png in Resources */, 97242D3F156178CC00B6D03C /* chrome-top@2x.png in Resources */, 97242D40156178CC00B6D03C /* chrome-top~ipad.png in Resources */, - 97242D43156178CC00B6D03C /* DISK1.ADF in Resources */, - 97242D44156178CC00B6D03C /* DISK2.ADF in Resources */, 97242D47156178CC00B6D03C /* EmulationView-iPad.xib in Resources */, 97242D49156178CC00B6D03C /* EmulationView-iPhone.xib in Resources */, 97242D4A156178CC00B6D03C /* about.html in Resources */, @@ -4519,9 +4574,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9787FA011561882D00458A4A /* kick.rom in Resources */, - 9787FA021561882D00458A4A /* kick13.rom in Resources */, - 9787FA031561882D00458A4A /* kick31.rom in Resources */, 9787FA041561882D00458A4A /* Aperture (1x2 RB).png in Resources */, 9787FA051561882D00458A4A /* Aperture (1x3 RB).png in Resources */, 9787FA061561882D00458A4A /* Aperture (2x4 BG).png in Resources */, @@ -4533,8 +4585,6 @@ 9787FA0C1561882D00458A4A /* Simple.frag in Resources */, 9787FA0D1561882D00458A4A /* Simple.vert in Resources */, 9787FA0E1561882D00458A4A /* Entitlements.plist in Resources */, - 9787FA0F1561882D00458A4A /* MainWindow-Single.xib in Resources */, - 9787FA101561882D00458A4A /* MainWindow-Single-iPad.xib in Resources */, 9787FA111561882D00458A4A /* firebutton-red-active.png in Resources */, 9787FA121561882D00458A4A /* firebutton-red-active@2x.png in Resources */, 9787FA131561882D00458A4A /* firebutton-red-active~ipad.png in Resources */, @@ -4542,7 +4592,6 @@ 9787FA151561882D00458A4A /* firebutton-red@2x.png in Resources */, 9787FA161561882D00458A4A /* firebutton-red~ipad.png in Resources */, 9787FA171561882D00458A4A /* joystick.png in Resources */, - 9787FA181561882D00458A4A /* keyboard.png in Resources */, 9787FA191561882D00458A4A /* mouse.png in Resources */, 9787FA1A1561882D00458A4A /* ls-fullscreen_bottomBtn.png in Resources */, 9787FA1B1561882D00458A4A /* ls-instructions_overlay.png in Resources */, @@ -4557,17 +4606,6 @@ 9787FB49156188EE00458A4A /* icon-72.png in Resources */, 9787FB4A156188EE00458A4A /* icon.png in Resources */, 9787FB4B156188EE00458A4A /* icon@2x.png in Resources */, - 97A641E115754C0800AD7B87 /* Limelight.ttf in Resources */, - 97A641E215754C0800AD7B87 /* UserGuide.html in Resources */, - 97A641E315754C0800AD7B87 /* UserGuide~ipad.html in Resources */, - 97A641ED15754C2500AD7B87 /* instruction-dotc-cursor.png in Resources */, - 97A641EE15754C2500AD7B87 /* instruction-dotc-cursor@2x.png in Resources */, - 97A641EF15754C2500AD7B87 /* instruction-handclick.png in Resources */, - 97A641F015754C2500AD7B87 /* instruction-handclick@2x.png in Resources */, - 97A641F115754C2500AD7B87 /* instruction-handdrag.png in Resources */, - 97A641F215754C2500AD7B87 /* instruction-handdrag@2x.png in Resources */, - 97A641F315754C2500AD7B87 /* instruction-menuclick.png in Resources */, - 97A641F415754C2500AD7B87 /* instruction-menuclick@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4575,9 +4613,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9787FB6315618A5E00458A4A /* kick.rom in Resources */, - 9787FB6415618A5E00458A4A /* kick13.rom in Resources */, - 9787FB6515618A5E00458A4A /* kick31.rom in Resources */, 9787FB6615618A5E00458A4A /* Aperture (1x2 RB).png in Resources */, 9787FB6715618A5E00458A4A /* Aperture (1x3 RB).png in Resources */, 9787FB6815618A5E00458A4A /* Aperture (2x4 BG).png in Resources */, @@ -4589,8 +4624,6 @@ 9787FB6E15618A5E00458A4A /* Simple.frag in Resources */, 9787FB6F15618A5E00458A4A /* Simple.vert in Resources */, 9787FB7015618A5E00458A4A /* Entitlements.plist in Resources */, - 9787FB7115618A5E00458A4A /* MainWindow-Single.xib in Resources */, - 9787FB7215618A5E00458A4A /* MainWindow-Single-iPad.xib in Resources */, 9787FB7315618A5E00458A4A /* firebutton-red-active.png in Resources */, 9787FB7415618A5E00458A4A /* firebutton-red-active@2x.png in Resources */, 9787FB7515618A5E00458A4A /* firebutton-red-active~ipad.png in Resources */, @@ -4598,7 +4631,6 @@ 9787FB7715618A5E00458A4A /* firebutton-red@2x.png in Resources */, 9787FB7815618A5E00458A4A /* firebutton-red~ipad.png in Resources */, 9787FB7915618A5E00458A4A /* joystick.png in Resources */, - 9787FB7A15618A5E00458A4A /* keyboard.png in Resources */, 9787FB7B15618A5E00458A4A /* mouse.png in Resources */, 9787FB7C15618A5E00458A4A /* ls-fullscreen_bottomBtn.png in Resources */, 9787FB7D15618A5E00458A4A /* ls-instructions_overlay.png in Resources */, @@ -4625,8 +4657,6 @@ 9787FC8915618ADB00458A4A /* chrome-top.png in Resources */, 9787FC8A15618ADB00458A4A /* chrome-top@2x.png in Resources */, 9787FC8B15618ADB00458A4A /* chrome-top~ipad.png in Resources */, - 9787FC8E15618ADB00458A4A /* DISK1.ADF in Resources */, - 9787FC8F15618ADB00458A4A /* DISK2.ADF in Resources */, 9787FC9115618ADB00458A4A /* EmulationView-iPad.xib in Resources */, 9787FC9315618ADB00458A4A /* EmulationView-iPhone.xib in Resources */, 9787FC9515618ADB00458A4A /* about.html in Resources */, @@ -4681,9 +4711,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 97C87506156E834100197738 /* kick.rom in Resources */, - 97C87507156E834100197738 /* kick13.rom in Resources */, - 97C87508156E834100197738 /* kick31.rom in Resources */, 97C87509156E834100197738 /* Aperture (1x2 RB).png in Resources */, 97C8750A156E834100197738 /* Aperture (1x3 RB).png in Resources */, 97C8750B156E834100197738 /* Aperture (2x4 BG).png in Resources */, @@ -4695,8 +4722,6 @@ 97C87511156E834100197738 /* Simple.frag in Resources */, 97C87512156E834100197738 /* Simple.vert in Resources */, 97C87513156E834100197738 /* Entitlements.plist in Resources */, - 97C87514156E834100197738 /* MainWindow-Single.xib in Resources */, - 97C87515156E834100197738 /* MainWindow-Single-iPad.xib in Resources */, 97C8754A156E834100197738 /* firebutton-red-active.png in Resources */, 97C8754B156E834100197738 /* firebutton-red-active@2x.png in Resources */, 97C8754C156E834100197738 /* firebutton-red-active~ipad.png in Resources */, @@ -4704,7 +4729,6 @@ 97C8754E156E834100197738 /* firebutton-red@2x.png in Resources */, 97C8754F156E834100197738 /* firebutton-red~ipad.png in Resources */, 97C87550156E834100197738 /* joystick.png in Resources */, - 97C87551156E834100197738 /* keyboard.png in Resources */, 97C87552156E834100197738 /* mouse.png in Resources */, 97C87553156E834100197738 /* ls-fullscreen_bottomBtn.png in Resources */, 97C87554156E834100197738 /* ls-instructions_overlay.png in Resources */, @@ -4724,9 +4748,6 @@ 97A932041538B14B001064D7 /* iscroll4.js in Resources */, 97A932021538B14B001064D7 /* functions.js in Resources */, 97A932051538B14B001064D7 /* jquery-1.4.4.min.js in Resources */, - 97EF9576153876CA001C01E6 /* kick.rom in Resources */, - 97EF9577153876CA001C01E6 /* kick13.rom in Resources */, - 97EF9578153876CA001C01E6 /* kick31.rom in Resources */, 9785510B153A3F2E00580B91 /* Aperture (1x2 RB).png in Resources */, 9785510E153A3F2E00580B91 /* Aperture (1x3 RB).png in Resources */, 97855111153A3F2E00580B91 /* Aperture (2x4 BG).png in Resources */, @@ -4738,15 +4759,11 @@ 97855135153A3FBE00580B91 /* Simple.frag in Resources */, 97855136153A3FBE00580B91 /* Simple.vert in Resources */, 97EF9580153876CA001C01E6 /* Entitlements.plist in Resources */, - 97EF9581153876CA001C01E6 /* MainWindow-Single.xib in Resources */, - 97EF9582153876CA001C01E6 /* MainWindow-Single-iPad.xib in Resources */, 97EF966D1538771F001C01E6 /* EmulationView-iPad.xib in Resources */, 97EF966F1538771F001C01E6 /* EmulationView-iPhone.xib in Resources */, 97EF968B1538771F001C01E6 /* icon-72.png in Resources */, 97EF968C1538771F001C01E6 /* icon.png in Resources */, 97EF968D1538771F001C01E6 /* icon@2x.png in Resources */, - 97EE41621538A83B0072514D /* DISK1.ADF in Resources */, - 97EE41631538A83B0072514D /* DISK2.ADF in Resources */, 97A931581538AD1B001064D7 /* bg_web.png in Resources */, 97A931591538AD1B001064D7 /* bg_web@2x.png in Resources */, 97A9315A1538AD1B001064D7 /* bg_web~ipad.png in Resources */, @@ -4799,7 +4816,6 @@ 97BE2AEF15489E6600BF66CF /* firebutton-red@2x.png in Resources */, 97BE2AF215489E6600BF66CF /* firebutton-red~ipad.png in Resources */, 97BE2AF515489E6600BF66CF /* joystick.png in Resources */, - 97BE2AF815489E6600BF66CF /* keyboard.png in Resources */, 97BE2AFB15489E6600BF66CF /* mouse.png in Resources */, 97BE2AFE15489E6600BF66CF /* ls-fullscreen_bottomBtn.png in Resources */, 97BE2B0115489E6600BF66CF /* ls-instructions_overlay.png in Resources */, @@ -4815,8 +4831,44 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + BE17E1131D6C2E8200221E7F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 50524F424C454D533F /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export CODESIGN_ALLOCATE=/Library/JailCoder/codesign_allocate\nif [ \"${PLATFORM_NAME}\" == \"iphoneos\" ]; then\n/Library/JailCoder/Entitlements/Entitlements.py \"my.company.${PROJECT_NAME}\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent\";\ncodesign -f -s \"iPhone Developer\" --entitlements \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent\" \"${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/\"\nfi"; + }; + 7E57D8A219119D9500648935 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 8; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 1; + shellPath = /bin/sh; + shellScript = "/opt/iOSOpenDev/bin/iosod --xcbp"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 0533690213B1DEE90012D55A /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -4824,7 +4876,7 @@ files = ( 0533690513B1DEE90012D55A /* DisaSupport.cpp in Sources */, 0533690613B1DEE90012D55A /* m68k_intrf.cpp in Sources */, - 0533690713B1DEE90012D55A /* main.m in Sources */, + 0533690713B1DEE90012D55A /* main.mm in Sources */, 0533690913B1DEE90012D55A /* autoconf.cpp in Sources */, 0533690A13B1DEE90012D55A /* blitfunc.cpp in Sources */, 0533690B13B1DEE90012D55A /* blittable.cpp in Sources */, @@ -4833,13 +4885,11 @@ 0533690E13B1DEE90012D55A /* ersatz.cpp in Sources */, 0533690F13B1DEE90012D55A /* gfxutil.cpp in Sources */, 0533691013B1DEE90012D55A /* keybuf.cpp in Sources */, - 0533691113B1DEE90012D55A /* famec.cpp in Sources */, 0533691213B1DEE90012D55A /* m68k_intrf.cpp in Sources */, 0533691313B1DEE90012D55A /* uae.cpp in Sources */, 0533691413B1DEE90012D55A /* memory.cpp in Sources */, 0533691513B1DEE90012D55A /* fade.cpp in Sources */, 0533691613B1DEE90012D55A /* missing.cpp in Sources */, - 0533691713B1DEE90012D55A /* od-joy.cpp in Sources */, 0533691813B1DEE90012D55A /* savedisk.cpp in Sources */, 0533691913B1DEE90012D55A /* sdlgfx.cpp in Sources */, 0533691A13B1DEE90012D55A /* vkbd.cpp in Sources */, @@ -4847,7 +4897,7 @@ 0533691C13B1DEE90012D55A /* zfile.cpp in Sources */, 0533691D13B1DEE90012D55A /* iphone_main.mm in Sources */, 0533691E13B1DEE90012D55A /* AudioQueueManager.cpp in Sources */, - 0533692213B1DEE90012D55A /* CocoaUtility.m in Sources */, + 0533692213B1DEE90012D55A /* CocoaUtility.mm in Sources */, 0533692313B1DEE90012D55A /* MMStopWatch.m in Sources */, 0533692413B1DEE90012D55A /* fame_arm.cpp in Sources */, 0533692513B1DEE90012D55A /* m68k_interface.cpp in Sources */, @@ -4858,19 +4908,16 @@ 0533693313B1DEE90012D55A /* TouchHandlerView.m in Sources */, 0533695513B1DF5C0012D55A /* SingleWindowAppDelegate.mm in Sources */, 0533695613B1DF5F0012D55A /* BaseEmulationViewController.mm in Sources */, - 057B26B613B326A0006BB230 /* NSObject+Blocks.m in Sources */, + 057B26B613B326A0006BB230 /* NSObject+Blocks.mm in Sources */, 055FD7EB13B3F39800BB3F8B /* EmulationView-iPhone.m in Sources */, 055FD7EF13B3FB0900BB3F8B /* EmulationView-iPad.m in Sources */, - 055FD7F913B45AAA00BB3F8B /* AnimatedImageSequenceView.m in Sources */, + 055FD7F913B45AAA00BB3F8B /* AnimatedImageSequenceView.mm in Sources */, 05BB086113CC18FC00278699 /* DOTCEmulationViewController.m in Sources */, 978550C8153A3F2E00580B91 /* SDL_events.c in Sources */, 978550CB153A3F2E00580B91 /* SDL_mouse_c.c in Sources */, 978550CE153A3F2E00580B91 /* ButtonStates.m in Sources */, - 978550D1153A3F2E00580B91 /* iCadeReaderView.m in Sources */, - 978550D4153A3F2E00580B91 /* iControlPadReaderView.m in Sources */, - 978550D7153A3F2E00580B91 /* SDL_sysjoystick.m in Sources */, + 978550D1153A3F2E00580B91 /* iCadeReaderView.mm in Sources */, 978550DA153A3F2E00580B91 /* SDLUIAccelerationDelegate.m in Sources */, - 978550DD153A3F2E00580B91 /* SDL_joystick.c in Sources */, 978550E0153A3F2E00580B91 /* SDL.mm in Sources */, 978550E3153A3F2E00580B91 /* SDL_error.c in Sources */, 978550E6153A3F2E00580B91 /* SDL_NSObject+Blocks.m in Sources */, @@ -4894,7 +4941,6 @@ 97855146153A454100580B91 /* savestate.cpp in Sources */, 97855149153A455C00580B91 /* cyclone.s in Sources */, 9785514A153A455C00580B91 /* memhandlers.s in Sources */, - 9785514B153A469A00580B91 /* LambdaAlert.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4902,85 +4948,144 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7E98D5751D4E1241002EFBE0 /* savestate.cpp in Sources */, + 7E4D0FBF1CF4E8F600758750 /* VirtualKeyboard.mm in Sources */, + 7E82CBF719E1CFE10014AC6D /* combined_modules.cpp in Sources */, + 7E82CBF419E1C0BA0014AC6D /* m68k_intrf.cpp in Sources */, + 7E82CBF319E1C0A70014AC6D /* m68k_interface.cpp in Sources */, + 7EC59ED21BAC52390097B87A /* SettingsJoypadStyle.mm in Sources */, + 7EA2BCA2188B0EFF003DCE10 /* BaseEmulationViewController.mm in Sources */, + 7EB017711B09143000C74B9D /* SVProgressHUD.m in Sources */, 051B23B012C994BB000C2800 /* DisaSupport.cpp in Sources */, - 05D5D74C0FD5E38400B91C98 /* m68k_intrf.cpp in Sources */, - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 7EA5AC5C18AAC5920072820E /* BaseNavigationController.mm in Sources */, + 1D60589B0D05DD56006BFB54 /* main.mm in Sources */, 1D3623260D0F684500981E51 /* iAmigaAppDelegate.mm in Sources */, 0552BD240F3D797C005B30DF /* autoconf.cpp in Sources */, + 7EA4D6581923ECC100C58BB9 /* EmulationView-iPhone.mm in Sources */, 0552BD250F3D797C005B30DF /* blitfunc.cpp in Sources */, 0552BD260F3D797C005B30DF /* blittable.cpp in Sources */, 0552BD270F3D797C005B30DF /* blitter.cpp in Sources */, + 7EA4D6571923ECC100C58BB9 /* EmulationView-iPad.mm in Sources */, 0552BD280F3D797C005B30DF /* cia.cpp in Sources */, 0552BD2D0F3D797C005B30DF /* ersatz.cpp in Sources */, + BEE41BD51B4784AC00CE487D /* mztools.c in Sources */, 0552BD2E0F3D797C005B30DF /* gfxutil.cpp in Sources */, + BE6086D91C2CF5AC008E668B /* adfresolver.mm in Sources */, + BE951AFD1CA942B1008DD94B /* expansion.cpp in Sources */, 0552BD410F3D797C005B30DF /* keybuf.cpp in Sources */, - 0552BD450F3D797C005B30DF /* famec.cpp in Sources */, 0552BD470F3D797C005B30DF /* m68k_intrf.cpp in Sources */, 0552BD490F3D797C005B30DF /* uae.cpp in Sources */, 0552BD4B0F3D797C005B30DF /* memory.cpp in Sources */, 0552BD4C0F3D797C005B30DF /* fade.cpp in Sources */, 0552BD4E0F3D797C005B30DF /* missing.cpp in Sources */, - 0552BD4F0F3D797C005B30DF /* od-joy.cpp in Sources */, + 7EA4D64B1923EC9700C58BB9 /* BaseWebviewController.m in Sources */, + 7E770D791D109BF4000E5E1A /* UnappliedSettingLabelHandler.m in Sources */, 0552BD500F3D797C005B30DF /* savedisk.cpp in Sources */, + 7EF1681719030597001C8C8F /* TouchHandlerView.m in Sources */, + 7EB017801B0921B000C74B9D /* SettingsSelectKeyViewController.mm in Sources */, + BE0921FF1B343D810058D9F2 /* DiskDriveService.mm in Sources */, 0552BD510F3D797C005B30DF /* sdlgfx.cpp in Sources */, 0552BD540F3D797C005B30DF /* vkbd.cpp in Sources */, + BEE41BD61B4784AC00CE487D /* ioapi.c in Sources */, + BEE41BD31B4784AC00CE487D /* zip.c in Sources */, + 7E770D7C1D109DEC000E5E1A /* CoreSetting.m in Sources */, + E937D8B01CB58CE3008DCC27 /* VPadTouchOrGyro.mm in Sources */, 0552BD550F3D797C005B30DF /* writelog.cpp in Sources */, + 7E54BB201AA3362E0054F6B2 /* MFIControllerReaderView.mm in Sources */, + 7EA2BCA1188B0EF6003DCE10 /* SingleWindowAppDelegate.mm in Sources */, 0552BD560F3D797C005B30DF /* zfile.cpp in Sources */, + 7ED7ACAC1E92C9760041C2A4 /* SettingHardwareController.m in Sources */, 05743FC50FC293FD003BE251 /* iphone_main.mm in Sources */, 05FE7F280FC3EDBF00DBFECF /* AudioQueueManager.cpp in Sources */, + BEF413D41CA414E700CCC1F5 /* filesys.cpp in Sources */, 0504155C0FCB46F000F46828 /* EmulationViewController.mm in Sources */, 050415610FCB475C00F46828 /* InputControllerView.mm in Sources */, - 050415620FCB475C00F46828 /* JoystickViewLandscape.mm in Sources */, - 0504156B0FCB4BD400F46828 /* CocoaUtility.m in Sources */, + 7EAA9DBF192541D400541BE1 /* PKCustomKeyboard.mm in Sources */, + 0504156B0FCB4BD400F46828 /* CocoaUtility.mm in Sources */, + 7EB017731B09143000C74B9D /* SVIndefiniteAnimatedView.m in Sources */, 057B0D4C0FD0D0ED00D549AD /* MMStopWatch.m in Sources */, + 7EA2BCA3188B0F02003DCE10 /* AnimatedImageSequenceView.mm in Sources */, + BEEFB2DE1D72C6A00056CC8E /* MultiDictionary.m in Sources */, 059E3A2710636CBA0056A577 /* fame_arm.cpp in Sources */, - 059E3A2810636CBA0056A577 /* m68k_interface.cpp in Sources */, + 7EA4D65A1923ECC100C58BB9 /* TouchHandlerViewClassic.m in Sources */, 0545257E106EBB590032FC41 /* Events2.c in Sources */, - 054525B0106EC5550032FC41 /* combined_modules.cpp in Sources */, 05BC1AF51073448200EABC6E /* EMUBrowser.m in Sources */, + 7EE0D0451AACF2090081DAA5 /* Settings.mm in Sources */, 05BC1AF61073448200EABC6E /* EMUFileGroup.m in Sources */, 05BC1AF71073448200EABC6E /* EMUFileInfo.m in Sources */, 05BC1AF91073448200EABC6E /* EMUROMBrowserViewController.mm in Sources */, - 05BC1B1D10734C3B00EABC6E /* SettingsController.mm in Sources */, - 0585D55F1091640900C1E4C1 /* VirtualKeyboard.m in Sources */, + BE52EFAB1B4FC9B8008E15E6 /* DriveState.m in Sources */, 0585D5621091653E00C1E4C1 /* KeyView.m in Sources */, + BE951B001CA9442A008DD94B /* fsdb_unix.cpp in Sources */, 050C393D12C31B24000CE512 /* Disa.c in Sources */, + 7E4C6AF719DB0F7100D337D0 /* famec.cpp in Sources */, 050C3A9412C33D94000CE512 /* disassembler.m in Sources */, - 0583DE5812D1A3AC000E97CE /* TouchHandlerView.m in Sources */, + 7EA4D6591923ECC100C58BB9 /* MainEmulationViewController.mm in Sources */, 0577C0DB12DED4A60040B77D /* AsyncSocket.m in Sources */, 0577C0F912DED4FD0040B77D /* UaeDebugger.m in Sources */, - 05D5233712E8030E007912AE /* SelectEffectController.m in Sources */, - 05619EDB13ADE1AA00341DB0 /* SelectHardware.m in Sources */, - 057B26B513B325AB006BB230 /* NSObject+Blocks.m in Sources */, + 05D5233712E8030E007912AE /* SelectEffectController.mm in Sources */, + 7E66C1C21C5E1E89008B34D0 /* SettingsJoypadMainController.mm in Sources */, + 7EF2F7BB1D2807600019A579 /* od-joy.mm in Sources */, + 7EA4D6501923ECB400C58BB9 /* IOSKeyboard.m in Sources */, + BEF413D61CA414F600CCC1F5 /* cfgfile.cpp in Sources */, + BEE41BC61B47836D00CE487D /* ZipArchive.mm in Sources */, + BE951AFA1CA93FB7008DD94B /* fsdb.cpp in Sources */, + 057B26B513B325AB006BB230 /* NSObject+Blocks.mm in Sources */, + 7EF97ABD1A7586E7002CC332 /* SelectConfigurationViewController.mm in Sources */, 978550C7153A3F2E00580B91 /* SDL_events.c in Sources */, + 7EB017651B09115900C74B9D /* StateManagementController.mm in Sources */, + E937D8AA1CB58C50008DCC27 /* VPadMotionController.mm in Sources */, + 7E2A59B11B052C3300C802E0 /* SettingsJoypadController.mm in Sources */, 978550CA153A3F2E00580B91 /* SDL_mouse_c.c in Sources */, 978550CD153A3F2E00580B91 /* ButtonStates.m in Sources */, - 978550D0153A3F2E00580B91 /* iCadeReaderView.m in Sources */, - 978550D3153A3F2E00580B91 /* iControlPadReaderView.m in Sources */, - 978550D6153A3F2E00580B91 /* SDL_sysjoystick.m in Sources */, + BEF413D21CA411CF00CCC1F5 /* HardDriveService.mm in Sources */, + BEE41BC31B4782D200CE487D /* AdfImporter.mm in Sources */, + 978550D0153A3F2E00580B91 /* iCadeReaderView.mm in Sources */, + BE66229A1C328442009C2809 /* KeyButtonManagementController.mm in Sources */, + 7EF076641B9B2C7A00224DF0 /* SettingsJoypadVpadController.mm in Sources */, + 7EADD3161CB2FAA100136978 /* JoypadSelectionController.mm in Sources */, 978550D9153A3F2E00580B91 /* SDLUIAccelerationDelegate.m in Sources */, - 978550DC153A3F2E00580B91 /* SDL_joystick.c in Sources */, 978550DF153A3F2E00580B91 /* SDL.mm in Sources */, 978550E2153A3F2E00580B91 /* SDL_error.c in Sources */, + 7E2EF0DD1D004B9500CDD9B9 /* iUAEApplication.mm in Sources */, + 7E6BCCDB1D591DA900826CBD /* SettingsMouseController.m in Sources */, + BE2CA1E21C42219000B84C2C /* KeyButtonViewHandler.m in Sources */, + BECE7E0C1CB3E12600EBFB40 /* hardfile.cpp in Sources */, + BE951AF71CA93F86008DD94B /* scsi-none.cpp in Sources */, 978550E5153A3F2E00580B91 /* SDL_NSObject+Blocks.m in Sources */, + 7ED69CFC1A6D9DAF00059F7D /* DiskAssociationViewController.mm in Sources */, 978550E8153A3F2E00580B91 /* SDL_syscond.c in Sources */, + 7E922A801CF0AD6000D8006F /* touchstick.mm in Sources */, + 7EB017791B09164900C74B9D /* State.mm in Sources */, + BE951AF41CA93F27008DD94B /* native2amiga.cpp in Sources */, + BE66229D1C3285B3009C2809 /* KeyButtonConfigurationController.m in Sources */, + 9064AD631C7F7982004CAE28 /* MultiPeerConnectivityController.mm in Sources */, 978550EB153A3F2E00580B91 /* SDL_sysmutex.c in Sources */, + 7E079CC11A81594B00EC0DE4 /* AddConfigurationViewController.mm in Sources */, + 7E27C39F1AA3A6D300C00584 /* SettingsDisplayController.mm in Sources */, 978550EE153A3F2E00580B91 /* SDL_syssem.c in Sources */, 978550F1153A3F2E00580B91 /* SDL_systhread.c in Sources */, + BEE41BD41B4784AC00CE487D /* unzip.c in Sources */, + BE6622A01C32861C009C2809 /* KeyButtonConfiguration.m in Sources */, 978550F4153A3F2E00580B91 /* SDL_thread.c in Sources */, + BEE4172E1D6AA35E00E3ED45 /* ScrollToRowHandler.m in Sources */, 978550F7153A3F2E00580B91 /* SDL_video.c in Sources */, 978550FA153A3F2E00580B91 /* DisplayView.m in Sources */, 978550FD153A3F2E00580B91 /* ImageUtils.m in Sources */, + 7EAA9DCC192541D400541BE1 /* PMCustomKeyboard.mm in Sources */, + BE6F9F621C4E2C420061B98C /* VPadLeftOrRight.mm in Sources */, 97855100153A3F2E00580B91 /* NoEffect.m in Sources */, 97855103153A3F2E00580B91 /* OGLDisplay.m in Sources */, + 7EDCD04F1C3C59420006EB50 /* JoypadMainSettingsController.mm in Sources */, 97855106153A3F2E00580B91 /* OGLShaderProgram.m in Sources */, - 97855118153A3F2E00580B91 /* CRT.frag in Sources */, - 97855121153A3F2E00580B91 /* Simple.frag in Sources */, - 97855124153A3F2E00580B91 /* Simple.vert in Sources */, + 7EB017781B09164900C74B9D /* StateFileManager.mm in Sources */, + 7E6F37791CDB4E58005BA173 /* SettingsSelectPortViewController.mm in Sources */, + BECB5E221DA393B6000E5C2C /* AudioService.mm in Sources */, + 7E3C13E51A51F16600534164 /* SettingsGeneralController.mm in Sources */, 97855127153A3F2E00580B91 /* TexturedCRTEffect.m in Sources */, 9785512A153A3F2E00580B91 /* SDL_UIKitEvents.m in Sources */, 9785512D153A3F2E00580B91 /* SDL_UIKitVideo.m in Sources */, - 97855140153A402A00580B91 /* LambdaAlert.m in Sources */, + BE951AF21CA93EC0008DD94B /* fsusage.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4990,7 +5095,7 @@ files = ( 9706D6BB1561817500073678 /* DisaSupport.cpp in Sources */, 9706D6BC1561817500073678 /* m68k_intrf.cpp in Sources */, - 9706D6BD1561817500073678 /* main.m in Sources */, + 9706D6BD1561817500073678 /* main.mm in Sources */, 9706D6BE1561817500073678 /* autoconf.cpp in Sources */, 9706D6BF1561817500073678 /* blitfunc.cpp in Sources */, 9706D6C01561817500073678 /* blittable.cpp in Sources */, @@ -4999,13 +5104,11 @@ 9706D6C31561817500073678 /* ersatz.cpp in Sources */, 9706D6C41561817500073678 /* gfxutil.cpp in Sources */, 9706D6C51561817500073678 /* keybuf.cpp in Sources */, - 9706D6C61561817500073678 /* famec.cpp in Sources */, 9706D6C71561817500073678 /* m68k_intrf.cpp in Sources */, 9706D6C81561817500073678 /* uae.cpp in Sources */, 9706D6C91561817500073678 /* memory.cpp in Sources */, 9706D6CA1561817500073678 /* fade.cpp in Sources */, 9706D6CB1561817500073678 /* missing.cpp in Sources */, - 9706D6CC1561817500073678 /* od-joy.cpp in Sources */, 9706D6CD1561817500073678 /* savedisk.cpp in Sources */, 9706D6CE1561817500073678 /* sdlgfx.cpp in Sources */, 9706D6CF1561817500073678 /* vkbd.cpp in Sources */, @@ -5013,7 +5116,7 @@ 9706D6D11561817500073678 /* zfile.cpp in Sources */, 9706D6D21561817500073678 /* iphone_main.mm in Sources */, 9706D6D31561817500073678 /* AudioQueueManager.cpp in Sources */, - 9706D6D41561817500073678 /* CocoaUtility.m in Sources */, + 9706D6D41561817500073678 /* CocoaUtility.mm in Sources */, 9706D6D51561817500073678 /* MMStopWatch.m in Sources */, 9706D6D61561817500073678 /* fame_arm.cpp in Sources */, 9706D6D71561817500073678 /* m68k_interface.cpp in Sources */, @@ -5024,16 +5127,13 @@ 9706D6DC1561817500073678 /* TouchHandlerView.m in Sources */, 9706D6DD1561817500073678 /* SingleWindowAppDelegate.mm in Sources */, 9706D6DE1561817500073678 /* BaseEmulationViewController.mm in Sources */, - 9706D6DF1561817500073678 /* NSObject+Blocks.m in Sources */, - 9706D6E01561817500073678 /* AnimatedImageSequenceView.m in Sources */, + 9706D6DF1561817500073678 /* NSObject+Blocks.mm in Sources */, + 9706D6E01561817500073678 /* AnimatedImageSequenceView.mm in Sources */, 9706D6E11561817500073678 /* SDL_events.c in Sources */, 9706D6E21561817500073678 /* SDL_mouse_c.c in Sources */, 9706D6E31561817500073678 /* ButtonStates.m in Sources */, - 9706D6E41561817500073678 /* iCadeReaderView.m in Sources */, - 9706D6E51561817500073678 /* iControlPadReaderView.m in Sources */, - 9706D6E61561817500073678 /* SDL_sysjoystick.m in Sources */, + 9706D6E41561817500073678 /* iCadeReaderView.mm in Sources */, 9706D6E71561817500073678 /* SDLUIAccelerationDelegate.m in Sources */, - 9706D6E81561817500073678 /* SDL_joystick.c in Sources */, 9706D6E91561817500073678 /* SDL.mm in Sources */, 9706D6EA1561817500073678 /* SDL_error.c in Sources */, 9706D6EB1561817500073678 /* SDL_NSObject+Blocks.m in Sources */, @@ -5054,7 +5154,6 @@ 9706D6FA1561817500073678 /* savestate.cpp in Sources */, 9706D6FB1561817500073678 /* cyclone.s in Sources */, 9706D6FC1561817500073678 /* memhandlers.s in Sources */, - 9706D6FD1561817500073678 /* LambdaAlert.m in Sources */, 9706D77A1561827300073678 /* EmulationView-iPad.m in Sources */, 9706D77C1561827300073678 /* EmulationView-iPhone.m in Sources */, 9706D77E1561827300073678 /* EmulationViewController.m in Sources */, @@ -5067,7 +5166,7 @@ files = ( 97242C80156177EC00B6D03C /* DisaSupport.cpp in Sources */, 97242C81156177EC00B6D03C /* m68k_intrf.cpp in Sources */, - 97242C82156177EC00B6D03C /* main.m in Sources */, + 97242C82156177EC00B6D03C /* main.mm in Sources */, 97242C83156177EC00B6D03C /* autoconf.cpp in Sources */, 97242C84156177EC00B6D03C /* blitfunc.cpp in Sources */, 97242C85156177EC00B6D03C /* blittable.cpp in Sources */, @@ -5076,13 +5175,11 @@ 97242C88156177EC00B6D03C /* ersatz.cpp in Sources */, 97242C89156177EC00B6D03C /* gfxutil.cpp in Sources */, 97242C8A156177EC00B6D03C /* keybuf.cpp in Sources */, - 97242C8B156177EC00B6D03C /* famec.cpp in Sources */, 97242C8C156177EC00B6D03C /* m68k_intrf.cpp in Sources */, 97242C8D156177EC00B6D03C /* uae.cpp in Sources */, 97242C8E156177EC00B6D03C /* memory.cpp in Sources */, 97242C8F156177EC00B6D03C /* fade.cpp in Sources */, 97242C90156177EC00B6D03C /* missing.cpp in Sources */, - 97242C91156177EC00B6D03C /* od-joy.cpp in Sources */, 97242C92156177EC00B6D03C /* savedisk.cpp in Sources */, 97242C93156177EC00B6D03C /* sdlgfx.cpp in Sources */, 97242C94156177EC00B6D03C /* vkbd.cpp in Sources */, @@ -5090,7 +5187,7 @@ 97242C96156177EC00B6D03C /* zfile.cpp in Sources */, 97242C97156177EC00B6D03C /* iphone_main.mm in Sources */, 97242C98156177EC00B6D03C /* AudioQueueManager.cpp in Sources */, - 97242C99156177EC00B6D03C /* CocoaUtility.m in Sources */, + 97242C99156177EC00B6D03C /* CocoaUtility.mm in Sources */, 97242C9A156177EC00B6D03C /* MMStopWatch.m in Sources */, 97242C9B156177EC00B6D03C /* fame_arm.cpp in Sources */, 97242C9C156177EC00B6D03C /* m68k_interface.cpp in Sources */, @@ -5101,16 +5198,13 @@ 97242CA1156177EC00B6D03C /* TouchHandlerView.m in Sources */, 97242CA2156177EC00B6D03C /* SingleWindowAppDelegate.mm in Sources */, 97242CA3156177EC00B6D03C /* BaseEmulationViewController.mm in Sources */, - 97242CA4156177EC00B6D03C /* NSObject+Blocks.m in Sources */, - 97242CA7156177EC00B6D03C /* AnimatedImageSequenceView.m in Sources */, + 97242CA4156177EC00B6D03C /* NSObject+Blocks.mm in Sources */, + 97242CA7156177EC00B6D03C /* AnimatedImageSequenceView.mm in Sources */, 97242CA9156177EC00B6D03C /* SDL_events.c in Sources */, 97242CAA156177EC00B6D03C /* SDL_mouse_c.c in Sources */, 97242CAB156177EC00B6D03C /* ButtonStates.m in Sources */, - 97242CAC156177EC00B6D03C /* iCadeReaderView.m in Sources */, - 97242CAD156177EC00B6D03C /* iControlPadReaderView.m in Sources */, - 97242CAE156177EC00B6D03C /* SDL_sysjoystick.m in Sources */, + 97242CAC156177EC00B6D03C /* iCadeReaderView.mm in Sources */, 97242CAF156177EC00B6D03C /* SDLUIAccelerationDelegate.m in Sources */, - 97242CB0156177EC00B6D03C /* SDL_joystick.c in Sources */, 97242CB1156177EC00B6D03C /* SDL.mm in Sources */, 97242CB2156177EC00B6D03C /* SDL_error.c in Sources */, 97242CB3156177EC00B6D03C /* SDL_NSObject+Blocks.m in Sources */, @@ -5131,7 +5225,6 @@ 97242CC5156177EC00B6D03C /* savestate.cpp in Sources */, 97242CC6156177EC00B6D03C /* cyclone.s in Sources */, 97242CC7156177EC00B6D03C /* memhandlers.s in Sources */, - 97242CC8156177EC00B6D03C /* LambdaAlert.m in Sources */, 97242D45156178CC00B6D03C /* EmulationViewController.m in Sources */, 97242D46156178CC00B6D03C /* EmulationView-iPad.m in Sources */, 97242D48156178CC00B6D03C /* EmulationView-iPhone.m in Sources */, @@ -5144,7 +5237,7 @@ files = ( 9787FA671561882D00458A4A /* DisaSupport.cpp in Sources */, 9787FA681561882D00458A4A /* m68k_intrf.cpp in Sources */, - 9787FA691561882D00458A4A /* main.m in Sources */, + 9787FA691561882D00458A4A /* main.mm in Sources */, 9787FA6A1561882D00458A4A /* autoconf.cpp in Sources */, 9787FA6B1561882D00458A4A /* blitfunc.cpp in Sources */, 9787FA6C1561882D00458A4A /* blittable.cpp in Sources */, @@ -5153,13 +5246,11 @@ 9787FA6F1561882D00458A4A /* ersatz.cpp in Sources */, 9787FA701561882D00458A4A /* gfxutil.cpp in Sources */, 9787FA711561882D00458A4A /* keybuf.cpp in Sources */, - 9787FA721561882D00458A4A /* famec.cpp in Sources */, 9787FA731561882D00458A4A /* m68k_intrf.cpp in Sources */, 9787FA741561882D00458A4A /* uae.cpp in Sources */, 9787FA751561882D00458A4A /* memory.cpp in Sources */, 9787FA761561882D00458A4A /* fade.cpp in Sources */, 9787FA771561882D00458A4A /* missing.cpp in Sources */, - 9787FA781561882D00458A4A /* od-joy.cpp in Sources */, 9787FA791561882D00458A4A /* savedisk.cpp in Sources */, 9787FA7A1561882D00458A4A /* sdlgfx.cpp in Sources */, 9787FA7B1561882D00458A4A /* vkbd.cpp in Sources */, @@ -5167,7 +5258,7 @@ 9787FA7D1561882D00458A4A /* zfile.cpp in Sources */, 9787FA7E1561882D00458A4A /* iphone_main.mm in Sources */, 9787FA7F1561882D00458A4A /* AudioQueueManager.cpp in Sources */, - 9787FA801561882D00458A4A /* CocoaUtility.m in Sources */, + 9787FA801561882D00458A4A /* CocoaUtility.mm in Sources */, 9787FA811561882D00458A4A /* MMStopWatch.m in Sources */, 9787FA821561882D00458A4A /* fame_arm.cpp in Sources */, 9787FA831561882D00458A4A /* m68k_interface.cpp in Sources */, @@ -5178,16 +5269,13 @@ 9787FA881561882D00458A4A /* TouchHandlerView.m in Sources */, 9787FA891561882D00458A4A /* SingleWindowAppDelegate.mm in Sources */, 9787FA8A1561882D00458A4A /* BaseEmulationViewController.mm in Sources */, - 9787FA8B1561882D00458A4A /* NSObject+Blocks.m in Sources */, - 9787FA8C1561882D00458A4A /* AnimatedImageSequenceView.m in Sources */, + 9787FA8B1561882D00458A4A /* NSObject+Blocks.mm in Sources */, + 9787FA8C1561882D00458A4A /* AnimatedImageSequenceView.mm in Sources */, 9787FA8D1561882D00458A4A /* SDL_events.c in Sources */, 9787FA8E1561882D00458A4A /* SDL_mouse_c.c in Sources */, 9787FA8F1561882D00458A4A /* ButtonStates.m in Sources */, - 9787FA901561882D00458A4A /* iCadeReaderView.m in Sources */, - 9787FA911561882D00458A4A /* iControlPadReaderView.m in Sources */, - 9787FA921561882D00458A4A /* SDL_sysjoystick.m in Sources */, + 9787FA901561882D00458A4A /* iCadeReaderView.mm in Sources */, 9787FA931561882D00458A4A /* SDLUIAccelerationDelegate.m in Sources */, - 9787FA941561882D00458A4A /* SDL_joystick.c in Sources */, 9787FA951561882D00458A4A /* SDL.mm in Sources */, 9787FA961561882D00458A4A /* SDL_error.c in Sources */, 9787FA971561882D00458A4A /* SDL_NSObject+Blocks.m in Sources */, @@ -5208,15 +5296,9 @@ 9787FAA61561882D00458A4A /* savestate.cpp in Sources */, 9787FAA71561882D00458A4A /* cyclone.s in Sources */, 9787FAA81561882D00458A4A /* memhandlers.s in Sources */, - 9787FAA91561882D00458A4A /* LambdaAlert.m in Sources */, 9787FB29156188EE00458A4A /* EmulationView-iPad.m in Sources */, 9787FB2B156188EE00458A4A /* EmulationView-iPhone.m in Sources */, 9787FB2D156188EE00458A4A /* EmulationViewController.m in Sources */, - 97A641D915754C0800AD7B87 /* functions.js in Sources */, - 97A641DD15754C0800AD7B87 /* iscroll.js in Sources */, - 97A641DE15754C0800AD7B87 /* iscroll4.js in Sources */, - 97A641DF15754C0800AD7B87 /* jquery-1.4.4.min.js in Sources */, - 97A641E015754C0800AD7B87 /* jquery-1.5.2.min.js in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5226,7 +5308,7 @@ files = ( 9787FBCA15618A5E00458A4A /* DisaSupport.cpp in Sources */, 9787FBCB15618A5E00458A4A /* m68k_intrf.cpp in Sources */, - 9787FBCC15618A5E00458A4A /* main.m in Sources */, + 9787FBCC15618A5E00458A4A /* main.mm in Sources */, 9787FBCD15618A5E00458A4A /* autoconf.cpp in Sources */, 9787FBCE15618A5E00458A4A /* blitfunc.cpp in Sources */, 9787FBCF15618A5E00458A4A /* blittable.cpp in Sources */, @@ -5235,13 +5317,11 @@ 9787FBD215618A5E00458A4A /* ersatz.cpp in Sources */, 9787FBD315618A5E00458A4A /* gfxutil.cpp in Sources */, 9787FBD415618A5E00458A4A /* keybuf.cpp in Sources */, - 9787FBD515618A5E00458A4A /* famec.cpp in Sources */, 9787FBD615618A5E00458A4A /* m68k_intrf.cpp in Sources */, 9787FBD715618A5E00458A4A /* uae.cpp in Sources */, 9787FBD815618A5E00458A4A /* memory.cpp in Sources */, 9787FBD915618A5E00458A4A /* fade.cpp in Sources */, 9787FBDA15618A5E00458A4A /* missing.cpp in Sources */, - 9787FBDB15618A5E00458A4A /* od-joy.cpp in Sources */, 9787FBDC15618A5E00458A4A /* savedisk.cpp in Sources */, 9787FBDD15618A5E00458A4A /* sdlgfx.cpp in Sources */, 9787FBDE15618A5E00458A4A /* vkbd.cpp in Sources */, @@ -5249,7 +5329,7 @@ 9787FBE015618A5E00458A4A /* zfile.cpp in Sources */, 9787FBE115618A5E00458A4A /* iphone_main.mm in Sources */, 9787FBE215618A5E00458A4A /* AudioQueueManager.cpp in Sources */, - 9787FBE315618A5E00458A4A /* CocoaUtility.m in Sources */, + 9787FBE315618A5E00458A4A /* CocoaUtility.mm in Sources */, 9787FBE415618A5E00458A4A /* MMStopWatch.m in Sources */, 9787FBE515618A5E00458A4A /* fame_arm.cpp in Sources */, 9787FBE615618A5E00458A4A /* m68k_interface.cpp in Sources */, @@ -5260,16 +5340,13 @@ 9787FBEB15618A5E00458A4A /* TouchHandlerView.m in Sources */, 9787FBEC15618A5E00458A4A /* SingleWindowAppDelegate.mm in Sources */, 9787FBED15618A5E00458A4A /* BaseEmulationViewController.mm in Sources */, - 9787FBEE15618A5E00458A4A /* NSObject+Blocks.m in Sources */, - 9787FBEF15618A5E00458A4A /* AnimatedImageSequenceView.m in Sources */, + 9787FBEE15618A5E00458A4A /* NSObject+Blocks.mm in Sources */, + 9787FBEF15618A5E00458A4A /* AnimatedImageSequenceView.mm in Sources */, 9787FBF015618A5E00458A4A /* SDL_events.c in Sources */, 9787FBF115618A5E00458A4A /* SDL_mouse_c.c in Sources */, 9787FBF215618A5E00458A4A /* ButtonStates.m in Sources */, - 9787FBF315618A5E00458A4A /* iCadeReaderView.m in Sources */, - 9787FBF415618A5E00458A4A /* iControlPadReaderView.m in Sources */, - 9787FBF515618A5E00458A4A /* SDL_sysjoystick.m in Sources */, + 9787FBF315618A5E00458A4A /* iCadeReaderView.mm in Sources */, 9787FBF615618A5E00458A4A /* SDLUIAccelerationDelegate.m in Sources */, - 9787FBF715618A5E00458A4A /* SDL_joystick.c in Sources */, 9787FBF815618A5E00458A4A /* SDL.mm in Sources */, 9787FBF915618A5E00458A4A /* SDL_error.c in Sources */, 9787FBFA15618A5E00458A4A /* SDL_NSObject+Blocks.m in Sources */, @@ -5290,7 +5367,6 @@ 9787FC0915618A5E00458A4A /* savestate.cpp in Sources */, 9787FC0A15618A5E00458A4A /* cyclone.s in Sources */, 9787FC0B15618A5E00458A4A /* memhandlers.s in Sources */, - 9787FC0C15618A5E00458A4A /* LambdaAlert.m in Sources */, 9787FC9015618ADB00458A4A /* EmulationView-iPad.m in Sources */, 9787FC9215618ADB00458A4A /* EmulationView-iPhone.m in Sources */, 9787FC9415618ADB00458A4A /* EmulationViewController.m in Sources */, @@ -5308,7 +5384,7 @@ files = ( 97C8755F156E834100197738 /* DisaSupport.cpp in Sources */, 97C87560156E834100197738 /* m68k_intrf.cpp in Sources */, - 97C87561156E834100197738 /* main.m in Sources */, + 97C87561156E834100197738 /* main.mm in Sources */, 97C87562156E834100197738 /* autoconf.cpp in Sources */, 97C87563156E834100197738 /* blitfunc.cpp in Sources */, 97C87564156E834100197738 /* blittable.cpp in Sources */, @@ -5317,13 +5393,11 @@ 97C87567156E834100197738 /* ersatz.cpp in Sources */, 97C87568156E834100197738 /* gfxutil.cpp in Sources */, 97C87569156E834100197738 /* keybuf.cpp in Sources */, - 97C8756A156E834100197738 /* famec.cpp in Sources */, 97C8756B156E834100197738 /* m68k_intrf.cpp in Sources */, 97C8756C156E834100197738 /* uae.cpp in Sources */, 97C8756D156E834100197738 /* memory.cpp in Sources */, 97C8756E156E834100197738 /* fade.cpp in Sources */, 97C8756F156E834100197738 /* missing.cpp in Sources */, - 97C87570156E834100197738 /* od-joy.cpp in Sources */, 97C87571156E834100197738 /* savedisk.cpp in Sources */, 97C87572156E834100197738 /* sdlgfx.cpp in Sources */, 97C87573156E834100197738 /* vkbd.cpp in Sources */, @@ -5331,7 +5405,7 @@ 97C87575156E834100197738 /* zfile.cpp in Sources */, 97C87576156E834100197738 /* iphone_main.mm in Sources */, 97C87577156E834100197738 /* AudioQueueManager.cpp in Sources */, - 97C87578156E834100197738 /* CocoaUtility.m in Sources */, + 97C87578156E834100197738 /* CocoaUtility.mm in Sources */, 97C87579156E834100197738 /* MMStopWatch.m in Sources */, 97C8757A156E834100197738 /* fame_arm.cpp in Sources */, 97C8757B156E834100197738 /* m68k_interface.cpp in Sources */, @@ -5342,16 +5416,13 @@ 97C87580156E834100197738 /* TouchHandlerView.m in Sources */, 97C87581156E834100197738 /* SingleWindowAppDelegate.mm in Sources */, 97C87582156E834100197738 /* BaseEmulationViewController.mm in Sources */, - 97C87583156E834100197738 /* NSObject+Blocks.m in Sources */, - 97C87584156E834100197738 /* AnimatedImageSequenceView.m in Sources */, + 97C87583156E834100197738 /* NSObject+Blocks.mm in Sources */, + 97C87584156E834100197738 /* AnimatedImageSequenceView.mm in Sources */, 97C87588156E834100197738 /* SDL_events.c in Sources */, 97C87589156E834100197738 /* SDL_mouse_c.c in Sources */, 97C8758A156E834100197738 /* ButtonStates.m in Sources */, - 97C8758B156E834100197738 /* iCadeReaderView.m in Sources */, - 97C8758C156E834100197738 /* iControlPadReaderView.m in Sources */, - 97C8758D156E834100197738 /* SDL_sysjoystick.m in Sources */, + 97C8758B156E834100197738 /* iCadeReaderView.mm in Sources */, 97C8758E156E834100197738 /* SDLUIAccelerationDelegate.m in Sources */, - 97C8758F156E834100197738 /* SDL_joystick.c in Sources */, 97C87590156E834100197738 /* SDL.mm in Sources */, 97C87591156E834100197738 /* SDL_error.c in Sources */, 97C87592156E834100197738 /* SDL_NSObject+Blocks.m in Sources */, @@ -5372,7 +5443,6 @@ 97C875A1156E834100197738 /* TexturedCRTEffect.m in Sources */, 97C875A2156E834100197738 /* SDL_UIKitEvents.m in Sources */, 97C875A3156E834100197738 /* SDL_UIKitVideo.m in Sources */, - 97C875A4156E834100197738 /* LambdaAlert.m in Sources */, 97C875A5156E834100197738 /* savestate.cpp in Sources */, 97C875A6156E834100197738 /* cyclone.s in Sources */, 97C875A7156E834100197738 /* memhandlers.s in Sources */, @@ -5382,7 +5452,7 @@ 97C875AB156E834100197738 /* SBJsonBase.m in Sources */, 97C875AC156E834100197738 /* SBJsonParser.m in Sources */, 97C875AD156E834100197738 /* SBJsonWriter.m in Sources */, - 97C875AE156E834100197738 /* BaseControlsView.m in Sources */, + 97C875AE156E834100197738 /* BaseControlsView.mm in Sources */, 97C875AF156E834100197738 /* BaseLeftRightAwareView.m in Sources */, 97C875B0156E834100197738 /* ButtonJoyButton.mm in Sources */, 97C875B1156E834100197738 /* ControlDefaultConstants.m in Sources */, @@ -5391,7 +5461,7 @@ 97C875B4156E834100197738 /* DynamicLandscapeControls.mm in Sources */, 97C875B5156E834100197738 /* LandscapeJoystick.mm in Sources */, 97C875B6156E834100197738 /* MMFixedStickController.mm in Sources */, - 97C875B7156E834100197738 /* StaticImage.m in Sources */, + 97C875B7156E834100197738 /* StaticImage.mm in Sources */, 97C875B8156E834100197738 /* StickControllerBase.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -5402,7 +5472,7 @@ files = ( 97EF95BB153876CA001C01E6 /* DisaSupport.cpp in Sources */, 97EF95BC153876CA001C01E6 /* m68k_intrf.cpp in Sources */, - 97EF95BD153876CA001C01E6 /* main.m in Sources */, + 97EF95BD153876CA001C01E6 /* main.mm in Sources */, 97EF95BE153876CA001C01E6 /* autoconf.cpp in Sources */, 97EF95BF153876CA001C01E6 /* blitfunc.cpp in Sources */, 97EF95C0153876CA001C01E6 /* blittable.cpp in Sources */, @@ -5411,13 +5481,11 @@ 97EF95C3153876CA001C01E6 /* ersatz.cpp in Sources */, 97EF95C4153876CA001C01E6 /* gfxutil.cpp in Sources */, 97EF95C5153876CA001C01E6 /* keybuf.cpp in Sources */, - 97EF95C6153876CA001C01E6 /* famec.cpp in Sources */, 97EF95C7153876CA001C01E6 /* m68k_intrf.cpp in Sources */, 97EF95C8153876CA001C01E6 /* uae.cpp in Sources */, 97EF95C9153876CA001C01E6 /* memory.cpp in Sources */, 97EF95CA153876CA001C01E6 /* fade.cpp in Sources */, 97EF95CB153876CA001C01E6 /* missing.cpp in Sources */, - 97EF95CC153876CA001C01E6 /* od-joy.cpp in Sources */, 97EF95CD153876CA001C01E6 /* savedisk.cpp in Sources */, 97EF95CE153876CA001C01E6 /* sdlgfx.cpp in Sources */, 97EF95CF153876CA001C01E6 /* vkbd.cpp in Sources */, @@ -5425,7 +5493,7 @@ 97EF95D1153876CA001C01E6 /* zfile.cpp in Sources */, 97EF95D2153876CA001C01E6 /* iphone_main.mm in Sources */, 97EF95D3153876CA001C01E6 /* AudioQueueManager.cpp in Sources */, - 97EF95D4153876CA001C01E6 /* CocoaUtility.m in Sources */, + 97EF95D4153876CA001C01E6 /* CocoaUtility.mm in Sources */, 97EF95D5153876CA001C01E6 /* MMStopWatch.m in Sources */, 97EF95D6153876CA001C01E6 /* fame_arm.cpp in Sources */, 97EF95D7153876CA001C01E6 /* m68k_interface.cpp in Sources */, @@ -5436,19 +5504,16 @@ 97EF95DE153876CA001C01E6 /* TouchHandlerView.m in Sources */, 97EF95EB153876CA001C01E6 /* SingleWindowAppDelegate.mm in Sources */, 97EF95EC153876CA001C01E6 /* BaseEmulationViewController.mm in Sources */, - 97EF95ED153876CA001C01E6 /* NSObject+Blocks.m in Sources */, - 97EF95F0153876CA001C01E6 /* AnimatedImageSequenceView.m in Sources */, + 97EF95ED153876CA001C01E6 /* NSObject+Blocks.mm in Sources */, + 97EF95F0153876CA001C01E6 /* AnimatedImageSequenceView.mm in Sources */, 97EF966C1538771F001C01E6 /* EmulationView-iPad.m in Sources */, 97EF966E1538771F001C01E6 /* EmulationView-iPhone.m in Sources */, 97EF96A31538771F001C01E6 /* StoogesEmulationViewController.m in Sources */, 978550C9153A3F2E00580B91 /* SDL_events.c in Sources */, 978550CC153A3F2E00580B91 /* SDL_mouse_c.c in Sources */, 978550CF153A3F2E00580B91 /* ButtonStates.m in Sources */, - 978550D2153A3F2E00580B91 /* iCadeReaderView.m in Sources */, - 978550D5153A3F2E00580B91 /* iControlPadReaderView.m in Sources */, - 978550D8153A3F2E00580B91 /* SDL_sysjoystick.m in Sources */, + 978550D2153A3F2E00580B91 /* iCadeReaderView.mm in Sources */, 978550DB153A3F2E00580B91 /* SDLUIAccelerationDelegate.m in Sources */, - 978550DE153A3F2E00580B91 /* SDL_joystick.c in Sources */, 97855152153A478D00580B91 /* SDL.mm in Sources */, 97855153153A479800580B91 /* SDL_error.c in Sources */, 97855154153A479C00580B91 /* SDL_NSObject+Blocks.m in Sources */, @@ -5469,7 +5534,6 @@ 97855129153A3F2E00580B91 /* TexturedCRTEffect.m in Sources */, 9785512C153A3F2E00580B91 /* SDL_UIKitEvents.m in Sources */, 9785512F153A3F2E00580B91 /* SDL_UIKitVideo.m in Sources */, - 9785514C153A46D400580B91 /* LambdaAlert.m in Sources */, 9785514F153A471000580B91 /* savestate.cpp in Sources */, 97855150153A472C00580B91 /* cyclone.s in Sources */, 97855151153A472C00580B91 /* memhandlers.s in Sources */, @@ -5479,7 +5543,7 @@ 97BE2AA415486FE600BF66CF /* SBJsonBase.m in Sources */, 97BE2AA515486FE600BF66CF /* SBJsonParser.m in Sources */, 97BE2AA615486FE600BF66CF /* SBJsonWriter.m in Sources */, - 97BE2AC21548702100BF66CF /* BaseControlsView.m in Sources */, + 97BE2AC21548702100BF66CF /* BaseControlsView.mm in Sources */, 97BE2AC31548702100BF66CF /* BaseLeftRightAwareView.m in Sources */, 97BE2AC41548702100BF66CF /* ButtonJoyButton.mm in Sources */, 97BE2AC51548702100BF66CF /* ControlDefaultConstants.m in Sources */, @@ -5488,13 +5552,30 @@ 97BE2AC81548702100BF66CF /* DynamicLandscapeControls.mm in Sources */, 97BE2AC91548702100BF66CF /* LandscapeJoystick.mm in Sources */, 97BE2ACA1548702100BF66CF /* MMFixedStickController.mm in Sources */, - 97BE2ACB1548702100BF66CF /* StaticImage.m in Sources */, + 97BE2ACB1548702100BF66CF /* StaticImage.mm in Sources */, 97BE2ACC1548702100BF66CF /* StickControllerBase.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; + BE17E1111D6C2E8200221E7F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BE17E1221D6C2E9A00221E7F /* CoreSettingGroupTests.m in Sources */, + BE17E1231D6C2E9A00221E7F /* CoreSettingTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + BE17E11B1D6C2E8200221E7F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1D6058900D05DD3D006BFB54 /* iUAE */; + targetProxy = BE17E11A1D6C2E8200221E7F /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 0533694E13B1DEE90012D55A /* Debug */ = { isa = XCBuildConfiguration; @@ -5505,6 +5586,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "o.anoAmiga.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DotC; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5517,6 +5599,7 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "o.anoAmiga.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DotC; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5526,12 +5609,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Manomio LLC"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "o.anoAmiga.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DotC; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "10A5AE46-6887-4FCD-9F60-1E8933A66B0E"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; @@ -5540,9 +5624,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Manomio LLC"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_CHAR_IS_UNSIGNED_CHAR = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_DYNAMIC_NO_PIC = YES; @@ -5571,17 +5655,22 @@ ); INFOPLIST_FILE = "TargetSpecific/$(PRODUCT_NAME)/info.plist"; INSTALL_PATH = /Applications; - IPHONEOS_DEPLOYMENT_TARGET = 4.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MACH_O_TYPE = mh_execute; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-mno-thumb"; OTHER_CPLUSPLUSFLAGS = "-mno-thumb"; + OTHER_LDFLAGS = "-lz"; PREBINDING = NO; PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "96DEEFFC-9773-4209-B075-9DB6CB86828B"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = NO; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s"; + iOSOpenDevDevice = 192.168.0.11; + iOSOpenDevInstallOnAnyBuild = NO; + iOSOpenDevPath = "iOSOpenDevPath: /opt/iOSOpenDev"; }; name = "Ad Hoc"; }; @@ -5589,12 +5678,39 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + GCC_PREFIX_HEADER = iUAE_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + IPHONE, + NDEBUG, + SAFE_MEMORY_ACCESS, + USE_AUTOCONFIG, + ); + HEADER_SEARCH_PATHS = ( + "libraries/sdl-mini/include/", + uae4all_gp2x_0.7.2a/src, + uae4all_gp2x_0.7.2a/src/iphone, + ); INFOPLIST_FILE = Info.plist; - PRODUCT_NAME = iAmiga; + LIBRARY_SEARCH_PATHS = ( + "$(PROJECT_DIR)", + "/**", + ); + ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.ursschhmid.iUAE; + PRODUCT_NAME = iUAE; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s arm64"; + iOSOpenDevBuildPackageOnAnyBuild = NO; + iOSOpenDevCopyOnBuild = NO; + iOSOpenDevDevice = 192.168.0.11; + iOSOpenDevInstallOnAnyBuild = NO; + iOSOpenDevInstallOnProfiling = NO; + iOSOpenDevRespringOnInstall = YES; + iOSOpenDevUsePackageVersionPList = NO; }; name = "Ad Hoc"; }; @@ -5602,14 +5718,45 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); GCC_DYNAMIC_NO_PIC = NO; + GCC_INPUT_FILETYPE = automatic; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + GCC_PREFIX_HEADER = iUAE_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + IPHONE, + DEBUG, + SAFE_MEMORY_ACCESS, + USE_AUTOCONFIG, + ); + HEADER_SEARCH_PATHS = ( + "libraries/sdl-mini/include/", + uae4all_gp2x_0.7.2a/src, + uae4all_gp2x_0.7.2a/src/iphone, + ); INFOPLIST_FILE = Info.plist; - PRODUCT_NAME = iAmiga; + LIBRARY_SEARCH_PATHS = ( + "$(PROJECT_DIR)", + "/**", + ); + ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.ursschhmid.iUAE; + PRODUCT_NAME = iUAE; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s arm64"; + iOSOpenDevBuildPackageOnAnyBuild = NO; + iOSOpenDevCopyOnBuild = NO; + iOSOpenDevDevice = 192.168.0.11; + iOSOpenDevInstallOnAnyBuild = NO; + iOSOpenDevInstallOnProfiling = NO; + iOSOpenDevRespringOnInstall = YES; + iOSOpenDevUsePackageVersionPList = NO; }; name = Debug; }; @@ -5617,12 +5764,43 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + GCC_INPUT_FILETYPE = automatic; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + GCC_PREFIX_HEADER = iUAE_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + IPHONE, + NDEBUG, + SAFE_MEMORY_ACCESS, + USE_AUTOCONFIG, + ); + HEADER_SEARCH_PATHS = ( + "libraries/sdl-mini/include/", + uae4all_gp2x_0.7.2a/src, + uae4all_gp2x_0.7.2a/src/iphone, + ); INFOPLIST_FILE = Info.plist; - PRODUCT_NAME = iAmiga; + LIBRARY_SEARCH_PATHS = ( + "$(PROJECT_DIR)", + "/**", + ); + ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.ursschhmid.iUAE; + PRODUCT_NAME = iUAE; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s arm64"; + iOSOpenDevBuildPackageOnAnyBuild = NO; + iOSOpenDevCopyOnBuild = NO; + iOSOpenDevDevice = 192.168.0.11; + iOSOpenDevInstallOnAnyBuild = NO; + iOSOpenDevInstallOnProfiling = NO; + iOSOpenDevRespringOnInstall = YES; + iOSOpenDevUsePackageVersionPList = NO; }; name = Release; }; @@ -5635,6 +5813,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = sdi; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5647,6 +5826,7 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = sdi; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5656,12 +5836,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: fungos bauux (9HTJRE2XX5)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = sdi; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "00DC73DB-FB57-47B5-B382-2B6CC3367226"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; @@ -5675,6 +5856,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = lrs; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5687,6 +5869,7 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = lrs; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5696,12 +5879,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: fungos bauux (9HTJRE2XX5)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = lrs; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "00DC73DB-FB57-47B5-B382-2B6CC3367226"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; @@ -5715,6 +5899,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = koc; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5727,6 +5912,7 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = koc; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5736,12 +5922,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: fungos bauux (9HTJRE2XX5)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = koc; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "00DC73DB-FB57-47B5-B382-2B6CC3367226"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; @@ -5755,6 +5942,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = sinbad; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5767,6 +5955,7 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = sinbad; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5776,12 +5965,13 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: fungos bauux (9HTJRE2XX5)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = sinbad; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "00DC73DB-FB57-47B5-B382-2B6CC3367226"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; @@ -5826,7 +6016,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: fungos bauux (9HTJRE2XX5)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; @@ -5836,7 +6026,7 @@ AMIGA_OPTIONS, ); PRODUCT_NAME = p1; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "5A85F81E-D268-4418-8FE8-7CDDB7FBCA73"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; @@ -5855,6 +6045,7 @@ DEBUG, AMIGA_OPTIONS, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = stooges; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5872,6 +6063,7 @@ NDEBUG, AMIGA_OPTIONS, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = stooges; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5881,7 +6073,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: fungos bauux (9HTJRE2XX5)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = iAmiga_Prefix.pch; @@ -5890,20 +6082,158 @@ NDEBUG, AMIGA_OPTIONS, ); + PRODUCT_BUNDLE_IDENTIFIER = "com.cinemaware.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = stooges; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "5A85F81E-D268-4418-8FE8-7CDDB7FBCA73"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = "Ad Hoc"; }; + BE17E11D1D6C2E8200221E7F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = iUAETests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ( + "-lz", + "-bundle", + ); + PRODUCT_BUNDLE_IDENTIFIER = ursschhmid.iUAETests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iUAE.app/iUAE"; + }; + name = Debug; + }; + BE17E11E1D6C2E8200221E7F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = iUAETests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ( + "-lz", + "-bundle", + ); + PRODUCT_BUNDLE_IDENTIFIER = ursschhmid.iUAETests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iUAE.app/iUAE"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + BE17E11F1D6C2E8200221E7F /* Ad Hoc */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = iUAETests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ( + "-lz", + "-bundle", + ); + PRODUCT_BUNDLE_IDENTIFIER = ursschhmid.iUAETests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iUAE.app/iUAE"; + VALIDATE_PRODUCT = YES; + }; + name = "Ad Hoc"; + }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; + ARCHS = "$(ARCHS_STANDARD)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_CHAR_IS_UNSIGNED_CHAR = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_DYNAMIC_NO_PIC = NO; @@ -5931,15 +6261,20 @@ ); INFOPLIST_FILE = "TargetSpecific/$(PRODUCT_NAME)/info.plist"; INSTALL_PATH = /Applications; - IPHONEOS_DEPLOYMENT_TARGET = 4.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MACH_O_TYPE = mh_execute; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ""; + OTHER_LDFLAGS = "-lz"; PREBINDING = NO; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = NO; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s"; + iOSOpenDevDevice = 192.168.0.11; + iOSOpenDevInstallOnAnyBuild = NO; + iOSOpenDevPath = "iOSOpenDevPath: /opt/iOSOpenDev"; }; name = Debug; }; @@ -5947,9 +6282,8 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; GCC_CHAR_IS_UNSIGNED_CHAR = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_DYNAMIC_NO_PIC = YES; @@ -5978,16 +6312,21 @@ ); INFOPLIST_FILE = "TargetSpecific/$(PRODUCT_NAME)/info.plist"; INSTALL_PATH = /Applications; - IPHONEOS_DEPLOYMENT_TARGET = 4.1; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; MACH_O_TYPE = mh_execute; ONLY_ACTIVE_ARCH = YES; OTHER_CPLUSPLUSFLAGS = "-mno-thumb"; + OTHER_LDFLAGS = "-lz"; PREBINDING = NO; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; STRIP_INSTALLED_PRODUCT = NO; TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = "armv7 armv7s"; + iOSOpenDevDevice = 192.168.0.11; + iOSOpenDevInstallOnAnyBuild = NO; + iOSOpenDevPath = "iOSOpenDevPath: /opt/iOSOpenDev"; }; name = Release; }; @@ -6004,7 +6343,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iAmiga" */ = { + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "iUAE" */ = { isa = XCConfigurationList; buildConfigurations = ( 1D6058940D05DD3E006BFB54 /* Debug */, @@ -6074,7 +6413,17 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iAmiga" */ = { + BE17E11C1D6C2E8200221E7F /* Build configuration list for PBXNativeTarget "iUAETests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BE17E11D1D6C2E8200221E7F /* Debug */, + BE17E11E1D6C2E8200221E7F /* Release */, + BE17E11F1D6C2E8200221E7F /* Ad Hoc */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "iUAE" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4F08A954540054247B /* Debug */, diff --git a/iAmigaKOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iUAE.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 52% rename from iAmigaKOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to iUAE.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 6e980f7..9b2b91c 100644 --- a/iAmigaKOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/iUAE.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -1,6 +1,7 @@ - + + location = "self:iUAE.xcodeproj"> diff --git a/iUAE.xcodeproj/project.xcworkspace/xcshareddata/iAmiga.xccheckout b/iUAE.xcodeproj/project.xcworkspace/xcshareddata/iAmiga.xccheckout new file mode 100644 index 0000000..0b8a02f --- /dev/null +++ b/iUAE.xcodeproj/project.xcworkspace/xcshareddata/iAmiga.xccheckout @@ -0,0 +1,41 @@ + + + + + IDESourceControlProjectFavoriteDictionaryKey + + IDESourceControlProjectIdentifier + AC3ECF47-07D3-4B70-BACB-C285F024715D + IDESourceControlProjectName + iAmiga + IDESourceControlProjectOriginsDictionary + + F5876368-8964-4502-952F-9FBD6813D50C + https://github.com/emufreak/iAmiga.git + + IDESourceControlProjectPath + iAmiga.xcodeproj/project.xcworkspace + IDESourceControlProjectRelativeInstallPathDictionary + + F5876368-8964-4502-952F-9FBD6813D50C + ../.. + + IDESourceControlProjectURL + https://github.com/emufreak/iAmiga.git + IDESourceControlProjectVersion + 110 + IDESourceControlProjectWCCIdentifier + F5876368-8964-4502-952F-9FBD6813D50C + IDESourceControlProjectWCConfigurations + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + F5876368-8964-4502-952F-9FBD6813D50C + IDESourceControlWCCName + iamiga-emufreak + + + + diff --git a/iUAEParents/BaseWebviewController.h b/iUAEParents/BaseWebviewController.h new file mode 100644 index 0000000..beac105 --- /dev/null +++ b/iUAEParents/BaseWebviewController.h @@ -0,0 +1,21 @@ +// Created by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface BaseWebviewController : UINavigationController + +@end diff --git a/iUAEParents/BaseWebviewController.m b/iUAEParents/BaseWebviewController.m new file mode 100644 index 0000000..b15cea6 --- /dev/null +++ b/iUAEParents/BaseWebviewController.m @@ -0,0 +1,46 @@ +// Created by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "BaseWebviewController.h" + +@interface BaseWebviewController () + +@end + +@implementation BaseWebviewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/iUAEParents/Default-568h@2x.png b/iUAEParents/Default-568h@2x.png new file mode 100644 index 0000000..0891b7a Binary files /dev/null and b/iUAEParents/Default-568h@2x.png differ diff --git a/iUAEParents/EmulationView-iPad.h b/iUAEParents/EmulationView-iPad.h new file mode 100644 index 0000000..98a0fa9 --- /dev/null +++ b/iUAEParents/EmulationView-iPad.h @@ -0,0 +1,54 @@ +// +// EmulationViewiPad.h +// iAmiga +// +// Created by Stuart Carnie on 6/23/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import +#import "MainEmulationViewController.h" +#import "IOSKeyboard.h" +#import "InputControllerView.h" + +@interface EmulationViewiPad : MainEmulationViewController { + + UIButton *closeButton; + UIButton *restartButton; + UIWebView *webView; + IBOutlet UITextField *dummy_textfield; // dummy text field used to display the keyboard + IBOutlet UITextField *dummy_textfield_f; //dummy textfield used to display the keyboard with function keys + IBOutlet UITextField *dummy_textfield_s; //dummy textfield for special key like right shift numlock etc ..... +} + +-(IBAction)toggleControls:(id)sender; +-(IBAction)togglePinstatus:(id)sender; +-(IBAction)enableMenuBar:(id)sender; + +@property (readwrite, retain) IBOutlet UIButton *btnKeyboard; +@property (readwrite, retain) IBOutlet UIButton *btnJoypad; +@property (readwrite, retain) IBOutlet UIButton *btnPin; +@property (nonatomic, retain) IBOutlet UIWebView *webView; +@property (nonatomic, retain) IBOutlet UIButton *closeButton; +@property (nonatomic, retain) IBOutlet TouchHandlerViewClassic *mouseHandler; +@property (nonatomic, retain) IBOutlet UIButton *restartButton; +@property (nonatomic, retain) IBOutlet InputControllerView *joyController; +@property (readwrite, retain) IBOutlet UIToolbar *menuBar; +@property (readwrite, retain) IBOutlet UIButton *menuBarEnabler; +@property (retain, nonatomic) IBOutlet UILabel *lblDebug; +@property (retain, nonatomic) IBOutlet UIButton *btnSettings; + + +@end diff --git a/iUAEParents/EmulationView-iPad.mm b/iUAEParents/EmulationView-iPad.mm new file mode 100644 index 0000000..be5ece2 --- /dev/null +++ b/iUAEParents/EmulationView-iPad.mm @@ -0,0 +1,113 @@ +// +// EmulationViewiPad.m +// iAmiga +// +// Created by Stuart Carnie on 6/23/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import "EmulationView-iPad.h" +#import "SettingsGeneralController.h" + +@implementation EmulationViewiPad +//@synthesize menuView; +@synthesize webView; +//@synthesize menuButton; +@synthesize closeButton; +@synthesize restartButton; + +@dynamic btnKeyboard, btnJoypad, btnPin, mouseHandler, joyController, menuBar, menuBarEnabler, btnSettings; + +#pragma mark - View lifecycle + +bool keyboardactive; + +- (void)viewDidLoad { + [super viewDidLoad]; + + [webView setBackgroundColor:[UIColor clearColor]]; + [webView setOpaque:NO]; + webView.delegate = self; + + [super initializeKeyboard:dummy_textfield dummytextf:dummy_textfield_f dummytexts: dummy_textfield_s]; + + //Uncomment for debug mode + //[_lblDebug setHidden:true]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + [super prepareForSegue:segue sender:sender]; + if ([segue.identifier isEqualToString:@"OpenSettings"]) { + UITabBarController *tabBar = segue.destinationViewController; + SettingsGeneralController *settingsController = [tabBar.viewControllers objectAtIndex:0]; + settingsController.emulatorScreenshot = [self captureScreenshot]; + } +} + +-(IBAction)toggleControls:(id)sender { + [super toggleControls:sender]; +} + +-(IBAction)togglePinstatus:(id)sender { + [super togglePinstatus:sender]; +} + +-(IBAction)enableMenuBar:(id)sender { + [super enableMenuBar:sender]; +} + +-(void)checkForPaused:(NSTimer*)timer { + [super checkForPaused:timer]; + //[_lblDebug setText:[NSString stringWithFormat:@"%i", paused]]; +} + +- (UIImage *)captureScreenshot { + UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, 0.0f); + [displayView drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:NO]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; +} + +- (void)dealloc { + [closeButton release]; + [webView release]; + [restartButton release]; + [super dealloc]; +} + +- (void)viewDidUnload { + [self setCloseButton:nil]; + [self setMouseHandler:nil]; + [self setWebView:nil]; + [self setRestartButton:nil]; + [super viewDidUnload]; +} + +- (IBAction)keyboardDidHide:(id)sender +//Keyboards dismissed by other Means than Fullscreenpanel +{ + //Simulate Button press in Fullscreenpanel if Keyboard was closed by Keyboardclosebutton in Keyboard + if(keyboardactive == TRUE //Keyboard was closed by regular button in Fullscreenpanel + && dummy_textfield.isFirstResponder == FALSE //Fkeypanel was deactivated this triggered the event + && dummy_textfield_f.isFirstResponder == FALSE //Fkeypanel was activated this triggered the event + && dummy_textfield_s.isFirstResponder == FALSE //Special Keyboard view was activated this triggered the event + ) + { + [self.btnKeyboard sendActionsForControlEvents:UIControlEventTouchUpInside]; + } +} + +@end diff --git a/iUAEParents/EmulationView-iPhone.h b/iUAEParents/EmulationView-iPhone.h new file mode 100644 index 0000000..cc4c74e --- /dev/null +++ b/iUAEParents/EmulationView-iPhone.h @@ -0,0 +1,48 @@ +// +// EmulationViewiPhone.h +// iAmiga +// +// Created by Stuart Carnie on 6/23/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import +#import "MainEmulationViewController.h" +#import "IOSKeyboard.h" +#import "InputControllerView.h" +#import "TouchHandlerViewClassic.h" + +@interface EmulationViewiPhone : MainEmulationViewController { + + UIButton *closeButton; + TouchHandlerViewClassic *mouseHandler; + UIButton *restartButton; + UIWebView *webView; + IBOutlet UITextField *dummy_textfield; // dummy text field used to display the keyboard + IBOutlet UITextField *dummy_textfield_f; //dummy textfield used to display the keyboard with + IBOutlet UITextField *dummy_textfield_s; //dummy textfield for special key like right shift numlock etc ..... + InputControllerView *joyController; +} + +@property (readwrite, retain) IBOutlet UIButton *btnKeyboard; +@property (nonatomic, retain) IBOutlet UIWebView *webView; +@property (nonatomic, retain) IBOutlet UIButton *closeButton; +@property (nonatomic, retain) IBOutlet TouchHandlerViewClassic *mouseHandler; +@property (nonatomic, retain) IBOutlet UIButton *restartButton; +@property (retain, nonatomic) IBOutlet InputControllerView *joyController; + + + +@end diff --git a/iUAEParents/EmulationView-iPhone.mm b/iUAEParents/EmulationView-iPhone.mm new file mode 100644 index 0000000..b57af8c --- /dev/null +++ b/iUAEParents/EmulationView-iPhone.mm @@ -0,0 +1,94 @@ +// +// EmulationViewiPad.m +// iAmiga +// +// Created by Stuart Carnie on 6/23/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import "EmulationView-iPhone.h" + +@implementation EmulationViewiPhone +//@synthesize menuView; +@synthesize webView; +//@synthesize menuButton; +@synthesize closeButton; +@synthesize mouseHandler; +@synthesize restartButton; +@synthesize joyController; + +@dynamic btnKeyboard; + +#pragma mark - View lifecycle + +- (CGFloat) XposFloatPanel { + + CGRect screenRect = CGRectZero; + screenRect = [[UIScreen mainScreen] bounds]; + //CGFloat screenHeight = screenRect.size.height; + + CGFloat result = (self.screenHeight / 2) - 240; + + return result; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self initializeJoypad:joyController]; + + [webView setBackgroundColor:[UIColor clearColor]]; + [webView setOpaque:NO]; + webView.delegate = self; + + [super initializeKeyboard:dummy_textfield dummytextf:dummy_textfield_f dummytexts:dummy_textfield_s]; +} + +- (void)dealloc { + //[menuButton release]; + [closeButton release]; + //[menuView release]; + [mouseHandler release]; + [webView release]; + [restartButton release]; + [super dealloc]; +} + +- (void)viewDidUnload { + //[self setMenuButton:nil]; + [self setCloseButton:nil]; + //[self setMenuView:nil]; + [self setMouseHandler:nil]; + [self setWebView:nil]; + [self setRestartButton:nil]; + [super viewDidUnload]; +} + +- (IBAction)keyboardDidHide:(id)sender +//Keyboards dismissed by other Means than Fullscreenpanel +{ + //Simulate Button press in Fullscreenpanel if Keyboard was closed by Keyboardclosebutton in Keyboard + if(keyboardactive == TRUE //Keyboard was closed by regular button in Fullscreenpanel + && dummy_textfield.isFirstResponder == FALSE //Fkeypanel was deactivated this triggered the event + && dummy_textfield_f.isFirstResponder == FALSE //Fkeypanel was activated this triggered the event + && dummy_textfield_s.isFirstResponder == FALSE //Special Keyboard view was activated this triggered the event + ) + { + [self.btnKeyboard sendActionsForControlEvents:UIControlEventTouchUpInside]; + } +} + + +@end diff --git a/Entitlements.plist b/iUAEParents/Entitlements.plist similarity index 100% rename from Entitlements.plist rename to iUAEParents/Entitlements.plist diff --git a/iUAEParents/IOSKeyboard.h b/iUAEParents/IOSKeyboard.h new file mode 100644 index 0000000..3cd0f9d --- /dev/null +++ b/iUAEParents/IOSKeyboard.h @@ -0,0 +1,29 @@ +// Created by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@protocol IOSKeyboardDelegate +- (void)keyPressed:(int)asciicode keyName:(NSString *)keyName; +@end + +@interface IOSKeyboard : NSObject +- (id)init __unavailable; +- (id)initWithDummyFields:(UITextField *)dummyfield fieldf:(UITextField *)fieldf fieldspecial:(UITextField *)fieldspecial; +- (void)toggleKeyboard; +@property (nonatomic, assign) id delegate; + +@end diff --git a/iUAEParents/IOSKeyboard.m b/iUAEParents/IOSKeyboard.m new file mode 100644 index 0000000..937be89 --- /dev/null +++ b/iUAEParents/IOSKeyboard.m @@ -0,0 +1,862 @@ +// Created by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "IOSKeyboard.h" +#import "SDL.h" +#import "PKCustomKeyboard.h" +#import "PMCustomKeyboard.h" + +#define KEYDOWN 1 +#define KEYUP 2 +#define KEYPRESS 3 + +#define SDLK_PERCENT 37 +#define SDLK_LEFTBRACES 123 +#define SDLK_PIPE 124 +#define SDLK_RIGHTBRACES 125 +#define SDLK_TILDE 126 + + +#define SDLK_POUND 163 +#define SDLK_DOPPELS 223 +#define SDLK_AUMLAUT 228 +#define SDLK_OUMLAUT 246 +#define SDLK_UUMLAUT 252 + +#define SDLK_LAMIGA 257 +#define SDLK_RAMIGA 258 + +#define BFKEY 1 +#define BSKEY 2 +#define EXKEY 3 + +#define TAGUP 1 +#define TAGDOWN 2 +#define TAGLEFT 3 +#define TAGRIGHT 4 + + +@implementation IOSKeyboard { + + bool keyboardactive; + bool shiftselected; + bool altselected; + bool ctrlselected; + bool lAselected; + bool rAselected; + bool fkeyselected; + bool skeyselected; + + UIButton *btnKeyboard; + UIButton *btnSettings; + + UIButton *arrowleft_btnd; + UIButton *arrowup_btnd; + UIButton *arrowdown_btnd; + UIButton *arrowright_btnd; + + UIButton *fKey_btnd; + UIButton *sKey_btnd; + UIButton *exit_btnd; + + UITextField *dummy_textfield; // dummy text field used to display the keyboard + UITextField *dummy_textfield_f; //dummy textfield used to display the keyboard with function keys + + UITextField *dummy_textfield_s; + + PKCustomKeyboard *specialkeyboardipad; + PMCustomKeyboard *specialckeyboardiphone; +} + +-(void) toggleKeyboard { + /* Turn Keyboard visibility on and off */ + + keyboardactive = !keyboardactive; + + if (keyboardactive) { + [dummy_textfield becomeFirstResponder]; + } + else + { + [dummy_textfield resignFirstResponder]; + [dummy_textfield_f resignFirstResponder]; + [dummy_textfield_s resignFirstResponder]; + fkeyselected = FALSE; + skeyselected = FALSE; + } + +} + +- (IBAction)toggleKeyboardmode:(id)sender { + + UIButton *button = sender; + + [dummy_textfield resignFirstResponder]; + [dummy_textfield_f resignFirstResponder]; + [dummy_textfield_s resignFirstResponder]; + + fkeyselected = (button.tag == BFKEY) ? !fkeyselected : FALSE; + skeyselected = (button.tag == BSKEY) ? !skeyselected : FALSE; + + + if (fkeyselected) + { + [dummy_textfield_f becomeFirstResponder]; + } + else if (skeyselected) + { + [dummy_textfield_s becomeFirstResponder]; + } + else if(button.tag == EXKEY) + { + [dummy_textfield becomeFirstResponder]; + [dummy_textfield resignFirstResponder]; + } + else + { + [dummy_textfield becomeFirstResponder]; + } +} + +- (IBAction)toggleCtrlKey:(id)sender { + + /* Presse / Release Ctrl Key */ + + if (!ctrlselected) + { + ctrlselected = TRUE; + [self setButtonSelected:sender]; + [self sendkey:SDLK_LCTRL keyName:@"LCTRL" direction:KEYDOWN]; + } + else + { + ctrlselected = FALSE; + [self setButtonUnselected:sender]; + [self sendkey:SDLK_LCTRL keyName:@"LCTRL" direction:KEYUP]; + } +} + +- (IBAction)toggleShiftKey:(id)sender { + + /* Presse / Release Shift Key */ + + if (!shiftselected) + { + shiftselected = TRUE; + [self setButtonSelected:sender]; + [self sendkey:SDLK_LSHIFT keyName:@"LSHIFT" direction:KEYDOWN]; + } + else + { + shiftselected = FALSE; + [self setButtonUnselected:sender]; + [self sendkey:SDLK_LSHIFT keyName:@"LSHIFT" direction:KEYUP]; + } +} + +- (IBAction)toggleAltKey:(id)sender { + + /* Presse / Release Alt Key */ + + if (!altselected) + { + altselected = TRUE; + [self setButtonSelected:sender]; + [self sendkey:SDLK_LALT keyName:@"LALT" direction:KEYDOWN]; + } + else + { + altselected = FALSE; + [self setButtonUnselected:sender]; + [self sendkey:SDLK_LALT keyName:@"LALT" direction:KEYUP]; + } +} + +- (IBAction)togglelAKey:(id)sender { + if (!lAselected) + { + lAselected = TRUE; + [self setButtonSelected:sender]; + [self sendkey:SDLK_PAGEDOWN keyName:@"LAMIGA" direction:KEYDOWN]; + } + else + { + lAselected = FALSE; + [self setButtonUnselected:sender]; + [self sendkey:SDLK_PAGEDOWN keyName:@"LAMIGA" direction:KEYUP]; + } +} + +- (IBAction)togglerAKey:(id)sender { + if (!rAselected) + { + rAselected = TRUE; + [self setButtonSelected:sender]; + [self sendkey:SDLK_PAGEUP keyName:@"RAMIGA" direction:KEYDOWN]; + } + else + { + rAselected = FALSE; + [self setButtonUnselected:sender]; + [self sendkey:SDLK_PAGEUP keyName:@"RAMIGA" direction:KEYUP]; + } +} + +- (IBAction)toggleEscKey:(id)sender { + [self sendkey:SDLK_ESCAPE keyName:@"ESC"]; +} + +//Catches Enter +- (BOOL)textFieldShouldReturn:(UITextField *)textField { + [self sendkey:SDLK_RETURN keyName:@"RETURN"]; + return NO; +} + +- (IBAction)F1Key:(id)sender { + [self sendkey:SDLK_F1 keyName:@"F1"]; +} + +- (IBAction)F2Key:(id)sender { + [self sendkey:SDLK_F2 keyName:@"F2"]; +} + +- (IBAction)F3Key:(id)sender { + [self sendkey:SDLK_F3 keyName:@"F3"]; +} + +- (IBAction)F4Key:(id)sender { + [self sendkey:SDLK_F4 keyName:@"F4"]; +} + +- (IBAction)F5Key:(id)sender { + [self sendkey:SDLK_F5 keyName:@"F5"]; +} + +- (IBAction)F6Key:(id)sender { + [self sendkey:SDLK_F6 keyName:@"F6"]; +} + +- (IBAction)F7Key:(id)sender { + [self sendkey:SDLK_F7 keyName:@"F7"]; +} + +- (IBAction)F8Key:(id)sender { + [self sendkey:SDLK_F8 keyName:@"F8"]; +} + +- (IBAction)F9Key:(id)sender { + [self sendkey:SDLK_F9 keyName:@"F9"]; +} + +- (IBAction)F10Key:(id)sender { + [self sendkey:SDLK_F10 keyName:@"F10"]; +} + +- (IBAction)CursorKeyPressed:(id)sender { + + UIButton *button = sender; + + int keypressed = (button.tag == TAGUP) ? SDLK_UP : + (button.tag == TAGDOWN) ? SDLK_DOWN : + (button.tag == TAGLEFT) ? SDLK_LEFT : + SDLK_RIGHT; + + NSString *keyName = (button.tag == TAGUP) ? @"UP" : + (button.tag == TAGDOWN) ? @"DOWN": + (button.tag == TAGLEFT) ? @"LEFT" : + @"RIGHT"; + + [self sendkey:keypressed keyName:keyName]; + +} + +- (IBAction)specialkeypressed:(id)sender +{ + + UITextField *textfield = [sender object]; + + NSString *keyflag = [textfield.text substringToIndex:1]; + int asciicode = [[textfield.text substringFromIndex:1] intValue]; + + if([keyflag isEqual: @"D"]) + { + [self sendkey:asciicode direction:KEYDOWN]; + } + else + { + [self sendkey:asciicode direction:KEYUP]; + } + + [textfield setText:@""]; +} + +- (IBAction)keypressed:(id)sender +{ + /* Get String */ + UITextField *textfield = [sender object]; + NSMutableString *inputstring = [[textfield text] mutableCopy]; + NSUInteger length = inputstring.length; + + //Backspace Pressed: Little Hack: Length is always 1 because one character is autoplaced there (expect when deleted by backspace) + if(length == 0) + { + [self sendkey:SDLK_BACKSPACE keyName:@"BACKSPACE"]; + [textfield setText:@"0"]; + return; + } + + //Send Asciicode for each pressed key + for(int i=1;i" action:@selector(CursorKeyPressed:)]; + arrowright_btnd.tag = TAGRIGHT; + + fKey_btnd = [self createKeyboardButton:@"F" action:@selector(toggleKeyboardmode:)]; + [fKey_btnd setTag:BFKEY]; + + sKey_btnd = [self createKeyboardButton:lastoptionname action:@selector(toggleKeyboardmode:)]; + [sKey_btnd setTag:BSKEY]; + + exit_btnd = [self createKeyboardButton:@"Exit" action:@selector(toggleKeyboardmode:)]; + [exit_btnd setTag:EXKEY]; + + UIBarButtonItem* esc_btn = [[[UIBarButtonItem alloc] initWithCustomView:esc_btnd] autorelease]; + UIBarButtonItem* ctrl_btn = [[[UIBarButtonItem alloc] initWithCustomView:ctrl_btnd] autorelease]; + UIBarButtonItem* alt_btn = [[[UIBarButtonItem alloc] initWithCustomView:alt_btnd] autorelease]; + UIBarButtonItem* lA_btn = [[[UIBarButtonItem alloc] initWithCustomView:lA_btnd] autorelease]; + UIBarButtonItem* rA_btn = [[[UIBarButtonItem alloc] initWithCustomView:rA_btnd] autorelease]; + + UIBarButtonItem* arrowleft_btn = [[[UIBarButtonItem alloc] initWithCustomView:arrowleft_btnd] autorelease]; + UIBarButtonItem* arrowup_btn = [[[UIBarButtonItem alloc] initWithCustomView:arrowup_btnd] autorelease]; + UIBarButtonItem* arrowdown_btn = [[[UIBarButtonItem alloc] initWithCustomView:arrowdown_btnd] autorelease]; + UIBarButtonItem* arrowright_btn = [[[UIBarButtonItem alloc] initWithCustomView:arrowright_btnd] autorelease]; + + UIBarButtonItem* F_btn = [[[UIBarButtonItem alloc] initWithCustomView:fKey_btnd] autorelease]; + UIBarButtonItem* flex_spacer = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease]; + + UIBarButtonItem* shift_btn = [[[UIBarButtonItem alloc] initWithCustomView:shift_btnd] autorelease]; + + UIBarButtonItem* special_btn = [[[UIBarButtonItem alloc] initWithCustomView:sKey_btnd] autorelease]; + + UIBarButtonItem* exit_btn = [[[UIBarButtonItem alloc] initWithCustomView:exit_btnd] autorelease]; + + NSArray* items; + + if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) + { + items = [NSArray arrayWithObjects:esc_btn, flex_spacer, + shift_btn, flex_spacer, + ctrl_btn, flex_spacer, + alt_btn, flex_spacer, + lA_btn, flex_spacer, + rA_btn, flex_spacer, + arrowleft_btn, arrowup_btn, + arrowdown_btn, arrowright_btn, flex_spacer, + F_btn, flex_spacer, + special_btn, flex_spacer, + exit_btn, flex_spacer, nil]; + } + else + { + items = [NSArray arrayWithObjects:esc_btn, flex_spacer, + shift_btn, flex_spacer, + ctrl_btn, flex_spacer, + alt_btn, flex_spacer, + lA_btn, flex_spacer, + rA_btn, flex_spacer, + arrowleft_btn, arrowup_btn, + arrowdown_btn, arrowright_btn, flex_spacer, + F_btn, flex_spacer, + special_btn, flex_spacer, nil]; + } + + [keyboard_toolbar setItems:items]; + [keyboard_toolbar sizeToFit]; + return keyboard_toolbar; + +} + +-(UIButton *)createKeyboardButton:(NSString *)Name action:(SEL) selector { + + UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; + [button setTitle:Name forState:UIControlStateNormal ]; + [button sizeToFit]; + button.frame = CGRectMake(0, 0, button.frame.size.width, button.frame.size.height); + [button addTarget:self action:selector forControlEvents:UIControlEventTouchUpInside]; + + /*[[button layer] setBorderWidth: 1]; + [[button layer] setCornerRadius: 10]; + [[button layer] setMasksToBounds:YES]; + [button setBackgroundColor: [UIColor whiteColor]]; + [button setAlpha:1.0f]; + [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];*/ + + return button; +} + +@end diff --git a/Icon-72.png b/iUAEParents/Icon-72.png similarity index 100% rename from Icon-72.png rename to iUAEParents/Icon-72.png diff --git a/Icon.png b/iUAEParents/Icon.png similarity index 100% rename from Icon.png rename to iUAEParents/Icon.png diff --git a/Icon@2x.png b/iUAEParents/Icon@2x.png similarity index 100% rename from Icon@2x.png rename to iUAEParents/Icon@2x.png diff --git a/iUAEParents/MPCConnectionStates.h b/iUAEParents/MPCConnectionStates.h new file mode 100644 index 0000000..1528bf7 --- /dev/null +++ b/iUAEParents/MPCConnectionStates.h @@ -0,0 +1,17 @@ +// +// MPCConnectionStates.h +// iUAE +// +// Created by mithrendil on 25.02.16. +// +// + +#ifndef MPCConnectionStates_h +#define MPCConnectionStates_h + +typedef NS_ENUM(int, MPCStateType) { + kConnectionIsOff = 0, + kServeAsHostForIncomingJoypadSignals= 1, + kServeAsController = 2, +} ; +#endif /* MPCConnectionStates_h */ diff --git a/iUAEParents/MainEmulationViewController.h b/iUAEParents/MainEmulationViewController.h new file mode 100644 index 0000000..cbd6b79 --- /dev/null +++ b/iUAEParents/MainEmulationViewController.h @@ -0,0 +1,57 @@ +// +// DOTCEmulationViewController.h +// iAmiga +// +// Created by Stuart Carnie on 7/11/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import "BaseEmulationViewController.h" +#import "AnimatedImageSequenceView.h" +#import "DynamicLandscapeControls.h" +#import "TouchHandlerViewClassic.h" +#import "InputControllerView.h" +#import "SettingsGeneralController.h" + +#import + +@class VirtualKeyboard; + +@interface MainEmulationViewController : BaseEmulationViewController { + VirtualKeyboard *vKeyboard; + bool keyboardactive; + bool joyactive; + int paused; +} + +@property (readonly) CGFloat screenHeight; +@property (readonly) CGFloat screenWidth; +@property (readwrite, retain) UIButton *btnKeyboard; +@property (readwrite, retain) UIButton *menuBarEnabler; +@property (readwrite, retain) UIButton *btnJoypad; +@property (readwrite, retain) UIButton *btnPin; +@property (readwrite, retain) UIToolbar *menuBar; +@property (nonatomic, retain) InputControllerView *joyController; +@property (nonatomic, retain) IBOutlet TouchHandlerViewClassic *mouseHandler; +@property (retain, nonatomic) IBOutlet UIButton *btnSettings; + +-(IBAction)toggleControls:(id)sender; +-(IBAction)enableMenuBar:(id)sender; +-(IBAction)togglePinstatus:(id)sender; +- (IBAction)restart:(id)sender; +- (void)initializeKeyboard:(UITextField *)p_dummy_textfield dummytextf:(UITextField *)p_dummy_textfield_f dummytexts:(UITextField *)p_dummy_textfield_s; +- (void)initializeJoypad:(InputControllerView *)joyController; +- (void)checkForPaused:(NSTimer*)timer; +@end diff --git a/iUAEParents/MainEmulationViewController.mm b/iUAEParents/MainEmulationViewController.mm new file mode 100644 index 0000000..0524aaa --- /dev/null +++ b/iUAEParents/MainEmulationViewController.mm @@ -0,0 +1,398 @@ +// +// DOTCEmulationViewController.m +// iAmiga +// +// Created by Stuart Carnie on 7/11/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "MainEmulationViewController.h" +#import "VirtualKeyboard.h" +#import "IOSKeyboard.h" +#import "uae.h" +#import "sysconfig.h" +#import "sysdeps.h" +#import "options.h" +#import "SDL.h" +#import "UIKitDisplayView.h" +#import "savestate.h" +#import "AudioService.h" +#import "Settings.h" +#import "SettingsGeneralController.h" +#import "CoreSetting.h" +#import "DiskDriveService.h" +#import "HardDriveService.h" +#import +#import "MultiPeerConnectivityController.h" +#import "VPadMotionController.h" +#import "cfgfile.h" +#import "MFIControllerReaderView.h" +#import "MPCConnectionStates.h" +#import "Icadereaderview.h" +#import "NSObject+Blocks.h" + +extern int mainMenu_ntsc; +extern MPCStateType mainMenu_servermode; +extern void init_joystick(); + +@interface MainEmulationViewController() +@end + +@implementation MainEmulationViewController { + AudioService *_audioService; + DiskDriveService *_diskDriveService; + HardDriveService *_hardDriveService; + NSTimer *_menuHidingTimer; + Settings *_settings; + NSTimer *_checkForPausedTimer; + NSTimer *_checkForGControllerTimer; + MFIControllerReaderView *_mfiController; + iCadeReaderView *_icadeController; + } + +MultiPeerConnectivityController *mpcController = [[MultiPeerConnectivityController alloc] init]; //Needs to be called this early and out of class context to ensure it loads first +RomCoreSetting *romSetting = [[RomCoreSetting alloc] initWithName:@"ROM"]; +HD0PathCoreSetting *hdpathSetting = [[HD0PathCoreSetting alloc] initWithName:@"HD0Path"]; +CMemCoreSetting *cmemsetting = [[CMemCoreSetting alloc] initWithName:@"Chipmem"]; +FMemCoreSetting *fmemsetting = [[FMemCoreSetting alloc] initWithName:@"Fastmem"]; + +UIButton *btnSettings; +IOSKeyboard *ioskeyboard; + +extern void uae_reset(); + +- (IBAction)restart:(id)sender { + uae_reset(); +} + +- (void)webViewDidFinishLoad:(UIWebView *)webView { + NSString *fn = [NSString stringWithFormat:@"setVersion('%@');", self.bundleVersion]; + [webView stringByEvaluatingJavaScriptFromString:fn]; +} + +- (CGFloat)screenHeight { + CGRect screenRect = CGRectZero; + screenRect = [[UIScreen mainScreen] bounds]; + return screenRect.size.height; +} + +- (CGFloat)screenWidth { + CGRect screenRect = CGRectZero; + screenRect = [[UIScreen mainScreen] bounds]; + return screenRect.size.width; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + _audioService = [[AudioService alloc] init]; + _diskDriveService = [[DiskDriveService alloc] init]; + _hardDriveService = [[HardDriveService alloc] init]; + _settings = [[Settings alloc] init]; + + [self.view setMultipleTouchEnabled:TRUE]; + + [_btnJoypad setImage:[UIImage imageNamed:@"controller_selected.png"] forState:UIControlStateSelected]; + [_btnSettings setImage:[UIImage imageNamed:@"gear_selected.png"] forState: UIControlStateHighlighted]; + [_btnKeyboard setImage:[UIImage imageNamed:@"keyboard_selected.png"] forState:UIControlStateHighlighted]; + [_btnPin setImage:[UIImage imageNamed:@"sticky_selected.png"] forState:UIControlStateSelected]; + + mainMenu_ntsc = _settings.ntsc; + + [self initMenuBarHidingTimer]; + [self initCheckForPausedTimer]; + + [self initVolumeTimer:_settings.volume]; + + [self initHardDriveMountInfo]; // Initialized early so that a hard file can be mounted below if autoload is enabled + + if (_settings.autoloadConfig) + { + // enabling things here uses timers because the the emulator isn't initialized yet right here; + // we need to delay some tasks by a little bit + [self initDriveSetupTimer:_settings.driveState]; + [self initDiskInsertTimer:_settings.insertedFloppies]; + [self mountHardfile:_settings.hardfilePath asReadOnly:_settings.hardfileReadOnly]; + } + + [self initializeControls]; + paused = 0; + + _mfiController = [[MFIControllerReaderView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; + [self initIcade]; + + [_mouseHandler onMouseActivated]; + +} + +- (void)initIcade { + + _icadeController = [[iCadeReaderView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; + + SDL_Surface *surface = SDL_GetVideoSurface(); + UIView *display = (UIView *)surface->userdata; + + [display performBlock:^(void) { + // main thread + [display addSubview:_icadeController]; + [_icadeController becomeFirstResponder]; + + } afterDelay:0.0f]; + + +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [self applyConfiguredEffect]; + + [_mouseHandler reloadMouseSettings]; + [_joyController reloadJoypadSettings]; + + + _icadeController.active = YES; + [_icadeController becomeFirstResponder]; + + if (joyactive && _settings.DPadModeIsMotion){ + [VPadMotionController setActive]; + } + + [mpcController configure: self]; +} + +- (void)viewDidDisappear:(BOOL)animated { + [VPadMotionController disable]; +} + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + [super prepareForSegue:segue sender:sender]; + UITabBarController *tabBarController = segue.destinationViewController; + SettingsGeneralController *settingsController = [tabBarController.viewControllers objectAtIndex:0]; + settingsController.resetDelegate = self; +} + +- (void)didSelectReset:(DriveState *)driveState { + uae_reset(); + [self initDriveSetupTimer:driveState]; +} + +- (void)applyConfiguredEffect { + SDL_Surface *video = SDL_GetVideoSurface(); + id display = (id)video->userdata; + display.displayEffect = (DisplayEffect)_settings.selectedEffectIndex; +} + +- (void)initializeJoypad:(InputControllerView *)joyController { + /* Check if function is still needed */ + _joyController.hidden = TRUE; + joyactive = FALSE; + [VPadMotionController disable]; +} + +- (void)initializeControls { + joyactive = FALSE; + _mouseHandler.hidden = FALSE; + _joyController.hidden = TRUE; + [VPadMotionController disable]; +} + +extern void mousehack_setdontcare_iuae (); +extern void mousehack_setfollow_iuae (); +extern void togglemouse (void); +- (IBAction)toggleControls:(UIButton *)button { + + bool keyboardactiveonstart = keyboardactive; + + keyboardactive = (button == _btnKeyboard) ? !keyboardactive : FALSE; + joyactive = (button == _btnJoypad) ? !joyactive : FALSE; + + _btnKeyboard.selected = (button == _btnKeyboard) ? !_btnKeyboard.selected : FALSE; + _btnJoypad.selected = (button == _btnJoypad) ? !_btnJoypad.selected : FALSE; + + //_btnJoypad.tintColor = _btnJoypad.selected ? [UIColor blueColor] : [UIColor blackColor]; + + _joyController.hidden = !joyactive; + + + if (joyactive && _settings.DPadModeIsMotion){ + [VPadMotionController setActive]; + } + else{ + [VPadMotionController disable]; + } + + _mouseHandler.hidden = joyactive; + + if (joyactive) + { + [_joyController onJoypadActivated]; + mousehack_setdontcare_iuae(); + } + else + { + [_mouseHandler onMouseActivated]; + mousehack_setfollow_iuae(); + } + + if (keyboardactive != keyboardactiveonstart) + { + [ioskeyboard toggleKeyboard]; + } + + if(!keyboardactive) + { + [_icadeController setActive:YES]; + [_icadeController becomeFirstResponder]; + } +} + +- (IBAction)togglePinstatus:(id)sender { + + _btnPin.selected = !_btnPin.selected; + //_btnPin.tintColor = _btnPin.selected ? [UIColor blueColor] : [UIColor blackColor]; + + _mouseHandler.clickedscreen = false; + _joyController.clickedscreen = false; +} + +- (void)initializeKeyboard:(UITextField *)p_dummy_textfield dummytextf:(UITextField *)p_dummy_textfield_f dummytexts:(UITextField *)p_dummy_textfield_s { + + keyboardactive = FALSE; + + ioskeyboard = [[IOSKeyboard alloc] initWithDummyFields:p_dummy_textfield fieldf:p_dummy_textfield_f fieldspecial:p_dummy_textfield_s]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardDidHide:) + name:UIKeyboardDidHideNotification + object:nil]; +} + +-(IBAction)enableMenuBar:(id)sender { + _menuBar.hidden = false; + _menuBarEnabler.hidden = true; + _mouseHandler.clickedscreen = false; + _joyController.clickedscreen = false; + [self initMenuBarHidingTimer]; +} + +-(void)checkForMenuBarHiding:(NSTimer*)timer { + if((_mouseHandler || _joyController) && !_btnPin.selected && _menuBar.hidden == false) + { + if(_mouseHandler.clickedscreen || _joyController.clickedscreen) + { + _mouseHandler.clickedscreen = false; + _joyController.clickedscreen = false; + _menuBar.hidden = true; + _menuBarEnabler.hidden = false; + + [_menuHidingTimer invalidate]; + [_menuHidingTimer release]; + _menuHidingTimer = nil; + } + } +} + +-(void)checkForPaused:(NSTimer *)timer { + + if(mainMenu_servermode == kServeAsController) + { + uae_reset(); + [self pauseEmulator]; + } +} + +- (void)initDriveSetupTimer:(DriveState *)driveState { + [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(setupDrives:) userInfo:driveState repeats:NO]; +} + +- (void)initDiskInsertTimer:(NSArray *)insertedFloppies { + [NSTimer scheduledTimerWithTimeInterval:.5 target:self selector:@selector(insertConfiguredDisks:) userInfo:insertedFloppies repeats:NO]; +} + +- (void)initMenuBarHidingTimer { + if (_menuHidingTimer) { + [_menuHidingTimer release]; + } + _menuHidingTimer = [[NSTimer scheduledTimerWithTimeInterval:0.020 target:self + selector:@selector(checkForMenuBarHiding:) userInfo:nil repeats:YES] retain]; + _menuHidingTimer.tolerance = 0.0020; +} + +- (void)initCheckForPausedTimer { + if (_checkForPausedTimer) { + [_checkForPausedTimer release]; + } + + _checkForPausedTimer = [[NSTimer scheduledTimerWithTimeInterval:0.020 target:self + selector:@selector(checkForPaused:) userInfo:nil repeats:YES] retain]; + + _checkForPausedTimer.tolerance = 0.0020; +} + +- (void)initHardDriveMountInfo { + init_mountinfo(); +} + +- (void)insertConfiguredDisks:(NSTimer *)timer { + NSArray *insertedFloppies = timer.userInfo; + if ([insertedFloppies count] > 0) + { + [_diskDriveService insertDisks:insertedFloppies]; + [_settings setFloppyConfigurations:insertedFloppies]; + } +} + +- (void)setupDrives:(NSTimer *)timer { + DriveState *driveState = timer.userInfo; + [_diskDriveService setDriveState:driveState]; +} + +- (void)mountHardfile:(NSString *)hardfilePath asReadOnly:(BOOL)readOnly { + if (hardfilePath) + { + [_hardDriveService mountHardfile:hardfilePath asReadOnly:readOnly]; + } +} + +- (void)initVolumeTimer:(float)volume { + [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(initVolume:) userInfo:[NSNumber numberWithFloat:volume] repeats:NO]; +} + +- (void)initVolume:(NSTimer *)timer { + NSNumber *volume = timer.userInfo; + [_audioService setVolume:[volume floatValue]]; +} + +- (void)dealloc +{ + [_audioService release]; + [_btnJoypad release]; + [_btnKeyboard release]; + [_btnPin release]; + [_diskDriveService release]; + [_hardDriveService release]; + [_mouseHandler release]; + [_menuBar release]; + [_menuBarEnabler release]; + [_menuHidingTimer invalidate]; + [_menuHidingTimer release]; + [_settings release]; + [super dealloc]; +} + +@end diff --git a/iUAEParents/MultiPeerConnectivityController.h b/iUAEParents/MultiPeerConnectivityController.h new file mode 100644 index 0000000..d3ed1aa --- /dev/null +++ b/iUAEParents/MultiPeerConnectivityController.h @@ -0,0 +1,43 @@ +// +// MultiPeerConnectivityController.h +// iUAE +// Created by mithendral on 24.02.16. +// +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#ifndef MultiPeerConnectivityController_h +#define MultiPeerConnectivityController_h + +#import +#import "MainEmulationViewController.h" + +static NSString *const kVirtualPad = @"VirtualPad"; +static NSString *const kiCadePad = @"iCadePad"; + + +@interface MultiPeerConnectivityController : NSObject { + } + @property (readwrite, retain) MainEmulationViewController *mainEmuViewController; + +- (void)configure: (MainEmulationViewController *) mainEmuViewCtrl ; ++ (MultiPeerConnectivityController *)getinstance; +- (void)handleinputdirections:(TouchStickDPadState)hat_state buttontoreleasevertical:(int)buttontoreleasevertical buttontoreleasehorizontal: (int)buttontoreleasehorizontal deviceid:(NSString *)dID; +- (int)handleinputbuttons:(int)buttonid buttonstate:(int)buttonstate deviceid:(NSString *)dID; +- (void)handleinputdirections:(TouchStickDPadState)hat_state buttontoreleasevertical:(int)buttontoreleasevertical buttontoreleasehorizontal: (int)buttontoreleasehorizontal deviceid: (NSString *)dID; +- (int) dpadstatetojoypadkey:(NSString *)direction hatstate:(TouchStickDPadState)hat_state; +- (void)enableControllerMode; +- (void)controllerDisconnected:(NSString *)dID; + +@end + +#endif /* MultiPeerConnectivityController_h */ diff --git a/iUAEParents/MultiPeerConnectivityController.mm b/iUAEParents/MultiPeerConnectivityController.mm new file mode 100644 index 0000000..5096017 --- /dev/null +++ b/iUAEParents/MultiPeerConnectivityController.mm @@ -0,0 +1,634 @@ + // +// MultiPeerConnectivityController.m +// iUAE +// +// Created by mithrendil on 24.02.2016. +// +// + +#import "MultiPeerConnectivityController.h" +#import "MPCConnectionStates.h" +#import "SVProgressHUD.h" +#import "JoypadKey.h" +#import "Settings.h" + +static MultiPeerConnectivityController *_instance; +extern CJoyStick g_touchStick; +@implementation MultiPeerConnectivityController { + Settings *_settings; + double _lasttime; + NSMutableArray *_dMap; +} + +extern MPCStateType mainMenu_servermode; +extern unsigned int mainMenu_joy0dir; +extern int mainMenu_joy0button; +extern unsigned int mainMenu_joy1dir; +extern int mainMenu_joy1button; +static NSString * const XXServiceType = @"svc-iuae"; +CJoyStick *theJoystick = &g_touchStick; +MCPeerID *localPeerID = nil; +MCSession *session = nil; +MCNearbyServiceBrowser *browser = nil; +MCBrowserViewController *browserViewController = nil; +MPCStateType lastServerMode=kConnectionIsOff; +bool bConnectionToServerJustEstablished = false; + ++ (MultiPeerConnectivityController *)getinstance +{ + return _instance; +} + +- (id) init +{ + [super init]; + + _instance = self; + + _dMap = [[NSMutableArray alloc] initWithObjects:[NSNull null],[NSNull null],[NSNull null],[NSNull null], [NSNull null], [NSNull null],[NSNull null],[NSNull null],[NSNull null],[NSNull null], nil]; + + return self; +} + +- (void)enableControllerMode { + + if(mainMenu_servermode == kConnectionIsOff) + { + mainMenu_servermode = kServeAsController; + } +} + +- (void)configure: (MainEmulationViewController *) mainEmuViewCtrl { + + _mainEmuViewController = mainEmuViewCtrl; + _instance = self; + _settings = [[Settings alloc] init]; + + + if(mainMenu_servermode == kConnectionIsOff) + { + [self showMessage:@"Use device as Remote Controller" withMessage:@"Tab screen to use device as remote controller"]; + + dispatch_time_t waittime = dispatch_time(DISPATCH_TIME_NOW, 2.00 * NSEC_PER_SEC); + + dispatch_after(waittime, dispatch_get_main_queue(), + ^void{ + [self configureContinue:mainEmuViewCtrl]; + }); + } +} + + +-(void)configureContinue:(MainEmulationViewController *) mainEmuViewCtrl { +/*Continue Configuration after Waiting time */ + + mainMenu_servermode = mainMenu_servermode == kConnectionIsOff ? kServeAsHostForIncomingJoypadSignals : mainMenu_servermode; + + if(mainMenu_servermode == kServeAsHostForIncomingJoypadSignals) + { + + if(lastServerMode == kServeAsController) + { + [session disconnect]; // close client session + session = nil; + } + + if(advertiser == nil) + { + [self startServer]; + + //the device should NOT go to sleep after some idle time + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; + } + } + else if(mainMenu_servermode == kServeAsController) + { + if(lastServerMode == kServeAsHostForIncomingJoypadSignals) + { + if(advertiser!=nil) + { + [self stopServer]; + } + } + + if(session == nil|| session.connectedPeers.count == 0) + { + bConnectionToServerJustEstablished = true; + [self startClient]; + + //the device should go to sleep after some idle time + [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; + } + else + { + if(!bConnectionToServerJustEstablished) + { + if( mainMenu_servermode == kServeAsController) + [self showMessage: @"use existing connection" withMessage: @"use existing connection for device controller"]; + } + bConnectionToServerJustEstablished = false; + [self activateJoyPad]; + } + } + + lastServerMode = mainMenu_servermode; +} + +- (void)activateJoyPad { + if(_mainEmuViewController.btnJoypad.selected == FALSE) + { + dispatch_async(dispatch_get_main_queue(), ^{ + [_mainEmuViewController toggleControls:_mainEmuViewController.btnJoypad]; + + }); + } +} + +/* CLIENT part */ +- (void)startClient { + if(localPeerID == nil) + { + localPeerID = [[MCPeerID alloc] initWithDisplayName:[[UIDevice currentDevice] name]]; + } + session = [[MCSession alloc] initWithPeer:localPeerID + securityIdentity:nil + encryptionPreference:MCEncryptionNone]; + + browser = [[MCNearbyServiceBrowser alloc] initWithPeer:localPeerID serviceType:XXServiceType]; + browser.delegate = self; + browserViewController = [[MCBrowserViewController alloc] initWithBrowser:browser + session:session]; + browserViewController.delegate = self; + [_mainEmuViewController presentViewController:browserViewController + animated:YES + completion: + ^{ + [browser startBrowsingForPeers]; + }]; +} + +- (void)browser:(MCNearbyServiceBrowser *)browser + foundPeer:(MCPeerID *)peerID +withDiscoveryInfo:(NSDictionary *)info +{ + NSLog(@"found peer"); + if(![peerID isEqual:localPeerID]) + [browser invitePeer:peerID toSession:session withContext:nil timeout:30]; + +} +- (void)browser:(MCNearbyServiceBrowser *)browser + lostPeer:(MCPeerID *)peerID +{} + +- (void)controllerDisconnected:(NSString *)dID { + NSInteger index = -1; + index = [_dMap indexOfObject:dID]; + + if(index>=0) { + [[_dMap objectAtIndex:index] release]; + _dMap[index] = [NSNull null]; + } +} + +- (void)setkeymapfordeviceID:(NSString *)dID { + + NSUInteger kmNumber = [_dMap indexOfObject:dID]; + + if([dID isEqualToString:kVirtualPad]) + { + for(kmNumber = 1;kmNumber <= [_dMap count];kmNumber++) + { + if([[_settings keyConfigurationforButton:VSWITCH forController:kmNumber] isEqualToString:@"YES"]) + { + //Mapping reserved for OnScreenJoypad found load this setting an return + [_settings setCNumber:kmNumber]; + return; + } + + //No Mapping found for OnScreenJoypad. Use first Keymap + [_settings setCNumber:1]; + return; + } + + } + + if + (kmNumber == NSNotFound) + { + + for(kmNumber= 0;kmNumber <= [_dMap count] -1; kmNumber++) + { + if(_dMap[kmNumber] == [NSNull null]) + { + _dMap[kmNumber] = [[NSString stringWithString:dID] retain]; + [self showMessage:@"New Controller Mapped" withMessage:[NSString stringWithFormat:@"Using Keymap %d for this device", kmNumber+1]]; + break; + } + } + } + + kmNumber++; + [_settings setCNumber:kmNumber]; +} + +- (void)browserViewControllerDidFinish:(MCBrowserViewController *)browserViewController +{ + [_mainEmuViewController dismissViewControllerAnimated:YES completion:nil]; + + dispatch_async(dispatch_get_main_queue(), ^{ + if( mainMenu_servermode == kServeAsController) + [self showMessage: @"new connection established" withMessage: @"use idevice as controller"]; + + [self activateJoyPad]; + }); +} + +- (void)browserViewControllerWasCancelled:(MCBrowserViewController *)browserViewController +{ + [_mainEmuViewController dismissViewControllerAnimated:YES completion:nil]; + mainMenu_servermode=kServeAsHostForIncomingJoypadSignals; //disable client mode + [self showMessage: @"Controller Mode Cancelled" withMessage: @"Controller Mode Cancelled. Device will not be used as remote controller"]; +} + +- (void)sendJoystickDataForDirection:(int)direction buttontoreleasehorizontal:(int)buttontoreleasehorizontal buttontoreleasevertical:(int)buttontoreleasevertical +{ + if(session == nil || session.connectedPeers.count == 0) + { + } + else + { + + int aints[6]= { (unsigned int)direction, (unsigned int)0, BTN_INVALID, buttontoreleasehorizontal, buttontoreleasevertical}; + + NSData *data = [NSData dataWithBytes: &aints length: sizeof(aints)]; + + + NSError *error = nil; + if (![session sendData:data + toPeers:session.connectedPeers + withMode:MCSessionSendDataReliable + error:&error]) { + NSLog(@"[Error] %@", error); + } + } +} + +- (void)sendJoystickDataForButtonID:(int)buttonid buttonstate:(int)buttonstate { + + if(session == nil || session.connectedPeers.count == 0) + { + } + else + { + + int aints[5]= { (unsigned int) 0, (unsigned int)buttonstate, (unsigned int) buttonid, (unsigned int) 0, (unsigned int) 0}; + + NSData *data = [NSData dataWithBytes: &aints length: sizeof(aints)]; + + NSError *error = nil; + if (![session sendData:data + toPeers:session.connectedPeers + withMode:MCSessionSendDataReliable + error:&error]) { + NSLog(@"[Error] %@", error); + } + } + +} +- (void)showMessage: (NSString *)sTitel withMessage:(NSString *)sMessage +{ + dispatch_async(dispatch_get_main_queue(), ^{ + [SVProgressHUD setInfoImage:nil]; + [SVProgressHUD setBackgroundColor:[UIColor colorWithRed:220.0/255.0 green:220.0/255.0 blue:220.0/255.0 alpha:1]]; + [SVProgressHUD showInfoWithStatus:[NSString stringWithFormat:@"%@\n\n%@", sTitel, sMessage]]; + }); + +} + +- (void)session:(MCSession *)session peer:(MCPeerID *)peerID didChangeState:(MCSessionState)state +{ + + if(state == MCSessionStateNotConnected) { + [self showMessage: peerID.displayName withMessage: @"not connected"]; + [self controllerDisconnected:peerID.displayName]; + } + +} + +/* server part */ +MCNearbyServiceAdvertiser *advertiser=nil; + +- (void)session:(MCSession *)session didReceiveData:(NSData *)data fromPeer:(MCPeerID *)peerID +{ + + unsigned int aJoyData[5]; + [data getBytes: &aJoyData length: sizeof(aJoyData)]; + + TouchStickDPadState joydir = (TouchStickDPadState)aJoyData[0]; + int joybtnstat = (int) aJoyData[1]; + int joybtn = (int) aJoyData[2]; + int btntoreleasehor = (int) aJoyData[3]; + int btntoreleasever = (int) aJoyData[4]; + + if(joybtn != BTN_INVALID) + { + + if(CACurrentMediaTime() - _lasttime < (double) 0.02) + { + dispatch_time_t waittime = dispatch_time(DISPATCH_TIME_NOW, 0.02 * NSEC_PER_SEC); + + dispatch_after(waittime, dispatch_get_main_queue(), + ^void{ + [self handleinputbuttons:joybtn buttonstate:joybtnstat deviceid:[peerID displayName]]; + }); + } + else + { + [self handleinputbuttons:joybtn buttonstate:joybtnstat deviceid:[peerID displayName]]; + } + + _lasttime = CACurrentMediaTime(); + } + else + { + [self handleinputdirections:joydir buttontoreleasevertical:btntoreleasever buttontoreleasehorizontal:btntoreleasehor deviceid:[peerID displayName]]; + } +} + + +- (void) startServer { + if(localPeerID == nil) + { + localPeerID = [[MCPeerID alloc] initWithDisplayName:[[UIDevice currentDevice] name]]; + } + advertiser = [[MCNearbyServiceAdvertiser alloc] initWithPeer:localPeerID + discoveryInfo:nil + serviceType:XXServiceType]; + advertiser.delegate = self; + [advertiser startAdvertisingPeer]; + //[self showMessage: @"server" withMessage: @"started on this device"]; +} + + +- (void) stopServer { + + [advertiser stopAdvertisingPeer]; + [session disconnect]; + session = nil; + advertiser = nil; + //[self showMessage: @"server" withMessage: @"stopped on this device"]; + +} + +- (void)advertiser:(MCNearbyServiceAdvertiser *)advertiser +didReceiveInvitationFromPeer:(MCPeerID *)peerID + withContext:(NSData *)context + invitationHandler:(void(^)(BOOL accept, MCSession *session))invitationHandler +{ + session = [[MCSession alloc] initWithPeer:localPeerID + securityIdentity:nil + encryptionPreference:MCEncryptionNone]; + session.delegate = self; + + invitationHandler(YES, session); +} + +- (void)session:(MCSession *)session didReceiveStream:(NSInputStream *)stream withName:(NSString *)streamName + fromPeer:(MCPeerID *)peerID +{ + NSLog(@"Received data over stream with name %@ from peer %@", streamName, peerID.displayName); +} + +- (void)handleinputdirections:(TouchStickDPadState)hat_state buttontoreleasevertical:(int)buttontoreleasevertical buttontoreleasehorizontal: (int)buttontoreleasehorizontal deviceid:(NSString *)dID +{ + + if(mainMenu_servermode == kServeAsController) + { + [self sendJoystickDataForDirection:hat_state buttontoreleasehorizontal: buttontoreleasehorizontal buttontoreleasevertical:buttontoreleasevertical]; + + return; + } + + [self setkeymapfordeviceID:dID]; + NSInteger pNumber = [[_settings keyConfigurationforButton:PORT] integerValue]; + + NSString *configuredkeyhorizontal = NULL; + NSString *configuredkeyvertical = NULL; + int asciicodehorizontal = NULL; + int asciicodevertical = NULL; + NSString *configuredkeytoreleasehorizontal = NULL; + int asciicodekeytoreleasehorizontal = NULL; + NSString *configuredkeytoreleasevertical = NULL; + int asciicodekeytoreleasevertical = NULL; + + int horButton = [self dpadstatetojoypadkey: @"horizontal" hatstate:hat_state]; + if(horButton) + { + configuredkeyhorizontal = [_settings keyConfigurationforButton:horButton]; + asciicodehorizontal = [[configuredkeyhorizontal stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + } + + int vertButton = [self dpadstatetojoypadkey: @"vertical" hatstate:hat_state]; + if(vertButton) + { + configuredkeyvertical = [_settings keyConfigurationforButton:vertButton]; + asciicodevertical = [[configuredkeyvertical stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + } + + if(buttontoreleasehorizontal) + { + configuredkeytoreleasehorizontal = [_settings keyConfigurationforButton:buttontoreleasehorizontal]; + asciicodekeytoreleasehorizontal = [[configuredkeytoreleasehorizontal stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + } + + if(buttontoreleasevertical) + { + + configuredkeytoreleasevertical = [_settings keyConfigurationforButton:buttontoreleasevertical]; + asciicodekeytoreleasevertical = [[configuredkeytoreleasevertical stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + } + + if(asciicodekeytoreleasehorizontal) + { + SDL_Event ed = { SDL_KEYUP }; + ed.key.keysym.sym = (SDLKey) asciicodekeytoreleasehorizontal; + SDL_PushEvent(&ed); + } + + if(asciicodekeytoreleasevertical) + { + SDL_Event ed = { SDL_KEYUP }; + ed.key.keysym.sym = (SDLKey) asciicodekeytoreleasevertical; + SDL_PushEvent(&ed); + } + + if(hat_state == DPadCenter) + { + if(pNumber == 0) theJoystick->setDPadStateP0(hat_state); + else theJoystick->setDPadStateP1(hat_state); + return; + } + + if([configuredkeyhorizontal isEqual: @"Joypad"] && [configuredkeyvertical isEqual:@"joypad"]) + { + if(pNumber == 0) theJoystick->setDPadStateP0(hat_state); + else theJoystick->setDPadStateP1(hat_state); + return; + } + + if([configuredkeyhorizontal isEqual: @"Joypad"]) + { + if(pNumber == 0) theJoystick->setDPadStateP0(hat_state); + else theJoystick->setDPadStateP1(hat_state); + } + else if(configuredkeyhorizontal) + { + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = (SDLKey) asciicodehorizontal; + SDL_PushEvent(&ed); + } + + + if([configuredkeyvertical isEqual: @"Joypad"]) + { + if(pNumber == 0) theJoystick->setDPadStateP0(hat_state); + else theJoystick->setDPadStateP1(hat_state); + } + else if (configuredkeyvertical) + { + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = (SDLKey) asciicodevertical; + SDL_PushEvent(&ed); + } +} + + +- (int)handleinputbuttons:(int)buttonid buttonstate:(int)buttonstate deviceid:(NSString *)dID { + + if(mainMenu_servermode == kServeAsController) + { + [self sendJoystickDataForButtonID:buttonid buttonstate:buttonstate]; + return !buttonstate; + } + buttonstate = !buttonstate; + + [self setkeymapfordeviceID:dID]; + NSInteger pNumber = [[_settings keyConfigurationforButton:PORT] integerValue]; + + NSString *configuredkey = [_settings keyConfigurationforButton:buttonid]; + if([configuredkey isEqual: @"Joypad"]) + { + if(buttonstate) { + if(pNumber == 0) theJoystick->setButtonOneStateP0(FireButtonDown); + else theJoystick->setButtonOneStateP1(FireButtonDown); + } + else { + if(pNumber == 0) theJoystick->setButtonOneStateP0(FireButtonUp); + else theJoystick->setButtonOneStateP1(FireButtonUp); + } + } + else + { + int asciicode = [[configuredkey stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"KEY_"]] intValue]; + + if(buttonstate) + { + SDL_Event ed = { SDL_KEYDOWN }; + ed.key.keysym.sym = (SDLKey) asciicode; + SDL_PushEvent(&ed); + } + else + { + SDL_Event eu = { SDL_KEYUP }; + eu.key.keysym.sym = (SDLKey) asciicode; + SDL_PushEvent(&eu); + } + } + + return buttonstate; + +} + + +- (int) dpadstatetojoypadkey:(NSString *)direction hatstate:(TouchStickDPadState)hat_state +{ + if(hat_state == DPadUp) + { + if([direction isEqual:@"vertical"]) + return BTN_UP; + else + return NULL; + } + else if(hat_state == DPadUpLeft) + { + if([direction isEqual:@"vertical"]) + return BTN_UP; + else + return BTN_LEFT; + } + else if(hat_state == DPadUpRight) + { + if([direction isEqual:@"vertical"]) + return BTN_UP; + else + return BTN_RIGHT; + } + else if(hat_state == DPadDown) + { + if([direction isEqual:@"vertical"]) + return BTN_DOWN; + else + return NULL; + } + else if (hat_state == DPadDownLeft) + { + if([direction isEqual:@"vertical"]) + return BTN_DOWN; + else + return BTN_LEFT; + } + else if (hat_state == DPadDownRight) + { + if([direction isEqual:@"vertical"]) + return BTN_DOWN; + else + return BTN_RIGHT; + } + else if (hat_state == DPadLeft) + { + if([direction isEqual:@"vertical"]) + return NULL; + else + return BTN_LEFT; + } + else if (hat_state == DPadRight) + { + if([direction isEqual:@"vertical"]) + return NULL; + else + return BTN_RIGHT; + } + return NULL; +} + + +// Start receiving a resource from remote peer. +- (void) session:(MCSession *)session + didStartReceivingResourceWithName:(NSString *)resourceName + fromPeer:(MCPeerID *)peerID + withProgress:(NSProgress *)progress +{} + +// Finished receiving a resource from remote peer and saved the content +// in a temporary location - the app is responsible for moving the file +// to a permanent location within its sandbox. +- (void) session:(MCSession *)session + didFinishReceivingResourceWithName:(NSString *)resourceName + fromPeer:(MCPeerID *)peerID + atURL:(NSURL *)localURL + withError:(nullable NSError *)error +{} + + +@end diff --git a/iUAEParents/Settings.h b/iUAEParents/Settings.h new file mode 100644 index 0000000..5ec0f6e --- /dev/null +++ b/iUAEParents/Settings.h @@ -0,0 +1,86 @@ +// +// Settings.h +// iUAE +// +// Created by Urs on 08.03.15. +// +// + +#import +#import "DriveState.h" + +@protocol protReloadSettings +- (void)settingsChanged; +@end + +static NSString *const kJoyStyleOneButton = @"OneButton"; +static NSString *const kJoyStyleFourButton = @"FourButton"; + +@interface Settings : NSObject + +/** + * Properties for common settings. + */ +@property (nonatomic, readwrite, assign) BOOL autoloadConfig; +@property (nonatomic, readwrite, assign) NSArray *insertedFloppies; +@property (nonatomic, readwrite, assign) NSString *configurationName; +@property (nonatomic, readwrite, assign) NSArray *configurations; + +@property (nonatomic, readwrite, assign) BOOL ntsc; +@property (nonatomic, readwrite, assign) BOOL stretchScreen; +@property (nonatomic, readwrite, assign) NSUInteger addVerticalStretchValue; +@property (nonatomic, readwrite, assign) BOOL showStatus; +@property (nonatomic, readwrite, assign) BOOL showStatusBar; +@property (nonatomic, readwrite, assign) NSUInteger selectedEffectIndex; +@property (nonatomic, readwrite, assign) float volume; +@property (nonatomic, readwrite, assign) DriveState *driveState; +@property (nonatomic, readwrite, assign) NSString *romPath; +@property (nonatomic, readwrite, assign) NSString *hardfilePath; +@property (nonatomic, readwrite, assign) BOOL hardfileReadOnly; +@property (nonatomic, readwrite, assign) NSString *joypadstyle; +@property (nonatomic, readwrite, assign) NSString *joypadleftorright; +@property (nonatomic, readwrite, assign) BOOL joypadshowbuttontouch; +@property (nonatomic, readwrite, assign) BOOL keyButtonsEnabled; +@property (nonatomic, readwrite, assign) NSArray *keyButtonConfigurations; +@property (nonatomic, readwrite, assign) NSString *dpadTouchOrMotion; +@property (nonatomic, readonly, assign) BOOL DPadModeIsTouch; +@property (nonatomic, readonly, assign) BOOL DPadModeIsMotion; +@property (nonatomic, readwrite, assign) BOOL gyroToggleUpDown; +@property (nonatomic, readwrite, assign) float gyroSensitivity; +@property (nonatomic, readwrite, assign) BOOL LStickAnalogIsMouse; +@property (nonatomic, readwrite, assign) BOOL RStickAnalogIsMouse; +@property (nonatomic, readwrite, assign) BOOL useL2forMouseButton; +@property (nonatomic, readwrite, assign) BOOL useR2forRightMouseButton; +@property (nonatomic, readwrite, assign) NSUInteger controllersnextid; +@property (nonatomic, readwrite, assign) NSArray *controllers; +@property (nonatomic, readwrite, assign) NSInteger keyConfigurationCount; +@property (nonatomic, readwrite, assign) NSInteger CMem; +@property (nonatomic, readwrite, assign) NSInteger FMem; + +- (void)initializespecificsettings; +- (void)setFloppyConfigurations:(NSArray *)adfPaths; +- (void)setFloppyConfiguration:(NSString *)adfPath; +- (void)setKeyconfiguration:(NSString *)configuredkey forController:(int)cNumber Button:(int)button; +- (void)setKeyconfiguration:(NSString *)configuredkey Button:(int)button; +- (void)setKeyconfigurationname:(NSString *)configuredkey forController:(int)cNumber Button:(int)button; +- (void)setKeyconfigurationname:(NSString *)configuredkey Button:(int)button; + +- (void)setCNumber:(int)cNumber; + +- (void)setBool:(BOOL)value forKey:(NSString *)settingitemname; +- (void)setObject:(id)value forKey:(NSString *)settingitemname; +- (bool)boolForKey:(NSString *)settingitemname; +- (NSString *)stringForKey:(NSString *)settingitemname; +- (NSArray *)arrayForKey:(NSString *)settingitemname; +- (void)removeObjectForKey:(NSString *) settingitemname; +- (NSString *)configForDisk:(NSString *)diskName; +- (void)setConfig:(NSString *)configName forDisk:(NSString *)diskName; +- (NSArray *)controllers; +- (void)setControllers:(NSArray *)controllers; +- (NSString *)keyConfigurationNameforButton:(int)bID forController:(int)cNumber; +- (NSString *)keyConfigurationNameforButton:(int)bID; +- (NSString *)keyConfigurationforButton:(int)bID forController:(int)cNumber; +- (NSString *)keyConfigurationforButton:(int)bID; + + +@end diff --git a/iUAEParents/Settings.mm b/iUAEParents/Settings.mm new file mode 100644 index 0000000..49a2977 --- /dev/null +++ b/iUAEParents/Settings.mm @@ -0,0 +1,602 @@ +// +// Settings.m +// iUAE +// +// Created by Emufr3ak on 08.03.15. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "uae.h" +#import "sysconfig.h" +#import "sysdeps.h" +#import "options.h" +#import "SDL.h" +#import "UIKitDisplayView.h" +#import "savestate.h" +#import "JoypadKey.h" + +#import "Settings.h" +#import "KeyButtonConfiguration.h" +#import "constSettings.h" + +extern int mainMenu_showStatus; +extern int mainMenu_stretchscreen; +extern int mainMenu_AddVerticalStretchValue; +extern int joystickselected; + +static NSString *_configurationname; +static int _cNumber = 1; + +@implementation Settings { + NSUserDefaults *defaults; +} + +- (id)init { + if (self = [super init]) { + defaults = [[NSUserDefaults standardUserDefaults] retain]; + [self initializeCommonSettings]; + [self initializespecificsettings]; + } + return self; +} + +- (void)initializeCommonSettings { + + _configurationname = [[defaults stringForKey:kConfigurationNameKey] retain]; + + BOOL isFirstInitialization = ![defaults boolForKey:kAppSettingsInitializedKey]; + + if(isFirstInitialization) + { + [defaults setBool:TRUE forKey:kAppSettingsInitializedKey]; + self.autoloadConfig = TRUE; + self.driveState = [DriveState getAllEnabled]; + [defaults setObject:@"General" forKey:kConfigurationNameKey]; + } +} + +- (void)setFloppyConfigurations:(NSArray *)adfPaths { + for (NSString *adfPath : adfPaths) + { + [self setFloppyConfiguration:adfPath]; + } +} + +- (void)setFloppyConfiguration:(NSString *)adfPath { + NSString *settingstring = [NSString stringWithFormat:@"cnf%@", [adfPath lastPathComponent]]; + if ([defaults stringForKey:settingstring] && self.autoloadConfig ) + { + [_configurationname release]; + _configurationname = [[defaults stringForKey:settingstring] retain]; + [defaults setObject:_configurationname forKey:kConfigurationNameKey]; + } +} + +- (void)initializespecificsettings { + if(![self boolForKey:kInitializeKey]) + { + self.stretchScreen = mainMenu_stretchscreen; + self.addVerticalStretchValue = mainMenu_AddVerticalStretchValue; + self.showStatus = mainMenu_showStatus; + [self setBool:TRUE forKey:kInitializeKey]; + } + else + { + mainMenu_stretchscreen = self.stretchScreen; + mainMenu_AddVerticalStretchValue = self.addVerticalStretchValue; + mainMenu_showStatus = self.showStatus; + } + + //Set Default values for settings if key does not exist + + self.showStatusBar = [self keyExists:kShowStatusBarKey] ? self.showStatusBar : YES; + self.selectedEffectIndex = [self keyExists:kSelectedEffectIndexKey] ? self.selectedEffectIndex : 0; + self.joypadstyle = [self keyExists:kJoypadStyleKey] ? self.joypadstyle : @"FourButton"; + self.joypadleftorright = [self keyExists:kJoypadLeftOrRightKey] ? self.joypadleftorright : @"Right"; + self.joypadshowbuttontouch = [self keyExists:kJoypadShowButtonTouchKey] ? self.joypadshowbuttontouch : YES; + self.dpadTouchOrMotion = [self keyExists:kDPadTouchOrMotion] ? self.dpadTouchOrMotion : @"Touch"; + self.gyroToggleUpDown = [self keyExists:kGyroToggleUpDown] ? self.gyroToggleUpDown : NO; + self.gyroSensitivity = [self keyExists:kGyroSensitivity] ? self.gyroSensitivity : 0.1; + self.controllersnextid = [self keyExists:kControllersNextIDKey] ? self.controllersnextid : 1; + self.controllers = [self keyExists:kControllersKey] ? self.controllers : [NSArray arrayWithObjects:@1, nil]; + self.LStickAnalogIsMouse = [self keyExists:kLstickmouseFlag] ? self.LStickAnalogIsMouse : NO; + self.RStickAnalogIsMouse = [self keyExists:kRstickmouseFlag] ? self.RStickAnalogIsMouse : NO; + self.useL2forMouseButton = [self keyExists:kL2mouseFlag] ? self.useL2forMouseButton : NO; + self.useR2forRightMouseButton = [self keyExists:kR2mouseFlag] ? self.useR2forRightMouseButton : NO; + self.CMem = [self keyExists:kCmem] ? self.CMem : 1024; + self.FMem = [self keyExists:kFmem] ? self.FMem : 0; + + for(int i=1;i<=8;i++) + { + if(![self keyConfigurationforButton:BTN_A forController:i]) + { + [self initializekeysforController:i]; + } + + if(![self keyConfigurationforButton:PORT forController:i]) + { + [self setKeyconfiguration:@"1" forController:i Button:PORT]; + } + + if(![self keyConfigurationforButton:VSWITCH forController:i]) + { + [self setKeyconfiguration:@"NO" forController:i Button:VSWITCH]; + } + } + _keyConfigurationCount = 8; +} + +- (void)initializekeysforController:(int)cNumber { + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_A]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_B]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_X]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_Y]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_L1]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_L2]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_R1]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_R2]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_UP]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_DOWN]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_LEFT]; + [self setKeyconfiguration:@"Joypad" forController:cNumber Button:BTN_RIGHT]; + + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_A]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_B]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_X]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_Y]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_L1]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_L2]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_R1]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_R2]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_UP]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_DOWN]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_LEFT]; + [self setKeyconfigurationname:@"Joypad" forController:cNumber Button:BTN_RIGHT]; +} + +- (BOOL)keyExists: (NSString *) key { + return [[[defaults dictionaryRepresentation] allKeys] containsObject:[self getInternalSettingKey: key]]; +} + +- (BOOL)autoloadConfig { + return [self boolForKey:kAutoloadConfigKey]; +} + +- (void)setAutoloadConfig:(BOOL)autoloadConfig { + [self setBool:autoloadConfig forKey:kAutoloadConfigKey]; +} + +- (NSArray *)insertedFloppies { + return [self arrayForKey:kInsertedFloppiesKey]; +} + +- (void)setInsertedFloppies:(NSArray *)insertedFloppies { + [self setObject:insertedFloppies forKey:kInsertedFloppiesKey]; +} + +- (BOOL)ntsc { + return [self boolForKey:kNtscKey]; +} + +- (void)setNtsc:(BOOL)ntsc { + [self setBool:ntsc forKey:kNtscKey]; +} + +- (BOOL)stretchScreen { + return [self boolForKey:kStretchScreenKey]; +} + +- (void)setStretchScreen:(BOOL)stretchScreen { + [self setBool:stretchScreen forKey:kStretchScreenKey]; +} + +- (NSUInteger)addVerticalStretchValue { + return [self integerForKey:kAddVerticalStretchKey]; +} + +- (NSInteger)CMem { + return [self integerForKey:kCmem]; +} + +- (void)setCMem:(NSInteger)cmem { + [self setInteger:cmem forKey:kCmem]; +} + +- (NSInteger)FMem { + return [self integerForKey:kFmem]; +} + +- (void)setFMem:(NSInteger)cmem { + [self setInteger:cmem forKey:kFmem]; +} + +- (void)setAddVerticalStretchValue:(NSUInteger)addVerticalStretchVal { + [self setInteger: addVerticalStretchVal forKey:kAddVerticalStretchKey]; +} + +- (BOOL)showStatus { + return [self boolForKey:kShowStatusKey]; +} + +- (void)setShowStatus:(BOOL)showStatus { + [self setBool:showStatus forKey:kShowStatusKey]; +} + +- (void)setVolume:(float)volume { + [self setObject:[NSNumber numberWithFloat:volume] forKey:kVolume]; +} + +- (float)volume { + NSNumber *volume = [self objectForKey:kVolume]; + return volume ? [volume floatValue] : /* was never saved, default to max: */ 1; +} + +- (NSString *)joypadstyle { + return [self stringForKey:kJoypadStyleKey]; +} + +- (void)setJoypadstyle:(NSString *)joypadstyle { + [self setObject:joypadstyle forKey:kJoypadStyleKey]; +} + +- (NSString *)joypadleftorright { + return [self stringForKey:kJoypadLeftOrRightKey]; +} + +- (void)setJoypadleftorright:(NSString *)joypadleftorright { + [self setObject:joypadleftorright forKey:kJoypadLeftOrRightKey]; +} + +- (BOOL)joypadshowbuttontouch { + return [self boolForKey:kJoypadShowButtonTouchKey]; +} + +- (void)setJoypadshowbuttontouch:(BOOL)joypadshowbuttontouch { + [self setBool:joypadshowbuttontouch forKey:kJoypadShowButtonTouchKey]; +} + +- (NSString *)dpadTouchOrMotion { + return [self stringForKey:kDPadTouchOrMotion]; +} + +- (void)setDpadTouchOrMotion:(NSString *)dpadTouchOrMotion { + [self setObject:dpadTouchOrMotion forKey:kDPadTouchOrMotion]; +} + +- (BOOL)DPadModeIsTouch { + return [[self stringForKey:kDPadTouchOrMotion] isEqualToString: @"Touch"]; +} + +- (BOOL)DPadModeIsMotion { + return [[self stringForKey:kDPadTouchOrMotion] isEqualToString: @"Motion"]; +} + +- (BOOL)gyroToggleUpDown { + return [self boolForKey:kGyroToggleUpDown]; +} + +- (void)setGyroToggleUpDown:(BOOL)gyroToggleUpDown { + [self setBool:gyroToggleUpDown forKey:kGyroToggleUpDown]; +} + +- (float)gyroSensitivity { + return [self floatForKey:kGyroSensitivity]; +} + +- (void)setGyroSensitivity:(float)gyroSensitivity { + [self setFloat:gyroSensitivity forKey:kGyroSensitivity]; +} + +- (BOOL)RStickAnalogIsMouse { + return [self boolForKey:kRstickmouseFlag]; +} + +- (BOOL)LStickAnalogIsMouse { + return [self boolForKey:kLstickmouseFlag]; +} + +- (BOOL) useL2forMouseButton { + return [self boolForKey:kL2mouseFlag]; +} + +- (BOOL) useR2forRightMouseButton { + return [self boolForKey:kR2mouseFlag]; +} + +- (void) setUseL2forMouseButton:(BOOL)L2mouseFlag { + [self setBool:L2mouseFlag forKey:kL2mouseFlag]; +} + +- (void) setUseR2forRightMouseButton:(BOOL)R2mouseFlag { + [self setBool:R2mouseFlag forKey:kR2mouseFlag]; +} + + +- (void)setRStickAnalogIsMouse:(BOOL)rstickmouseFlag +{ + [self setBool:rstickmouseFlag forKey:kRstickmouseFlag]; +} + +- (void)setLStickAnalogIsMouse:(BOOL)lstickmouseFlag +{ + [self setBool:lstickmouseFlag forKey:kLstickmouseFlag]; +} + +-(NSString *)keyConfigurationforButton:(int)bID forController:(int)cNumber +{ + if(cNumber == 1) + return [self stringForKey:[NSString stringWithFormat:@"_BTN_%d", bID]]; + else + return [self stringForKey:[NSString stringWithFormat:@"_BTN_%d_%d", cNumber, bID]]; +} + +-(NSString *)keyConfigurationforButton:(int)bID +{ + return [self keyConfigurationforButton:bID forController:_cNumber]; +} + +-(void)setKeyconfiguration:(NSString *)configuredkey forController:(int)cNumber Button:(int)button { + + NSString *sKey = (cNumber == 1) ? [NSString stringWithFormat:@"_BTN_%d", button] : [NSString stringWithFormat:@"_BTN_%d_%d", cNumber, button]; + + if(![self keyExists:sKey]) _keyConfigurationCount = cNumber; + [self setObject:configuredkey forKey:sKey]; + +} + +-(void)setKeyconfiguration:(NSString *)configuredkey Button:(int)button { + [self setKeyconfiguration:configuredkey forController:_cNumber Button:button]; +} + +-(void)setCNumber:(int)cNumber { + _cNumber = cNumber; +} + +-(NSString *)keyConfigurationNameforButton:(int)bID { + return [self keyConfigurationNameforButton:bID forController:_cNumber]; +} + +- (NSString *)keyConfigurationNameforButton:(int)bID forController:(int)cNumber { + if(cNumber == 1) + return [self stringForKey:[NSString stringWithFormat:@"_BTNN_%d", bID]]; + else + return [self stringForKey:[NSString stringWithFormat:@"_BTNN_%d_%d", cNumber, bID]]; +} + +-(void)setKeyconfigurationname:(NSString *)configuredkey forController:(int)cNumber Button:(int)button { + + if(cNumber == 1) + [self setObject:configuredkey forKey:[NSString stringWithFormat:@"_BTNN_%d", button]]; + else + [self setObject:configuredkey forKey:[NSString stringWithFormat:@"_BTNN_%d_%d", cNumber, button]]; +} + +-(void)setKeyconfigurationname:(NSString *)configuredkey Button:(int)button { + [self setKeyconfigurationname:configuredkey forController:_cNumber Button:button]; +} + +- (BOOL)showStatusBar { + return [self boolForKey:kShowStatusBarKey]; +} + +- (void)setShowStatusBar:(BOOL)showStatusBar { + [self setBool:showStatusBar forKey:kShowStatusBarKey]; +} + +- (NSUInteger)selectedEffectIndex { + return [self integerForKey:kSelectedEffectIndexKey]; +} + +- (void)setSelectedEffectIndex:(NSUInteger)selectedEffectIndex { + return [self setInteger:selectedEffectIndex forKey:kSelectedEffectIndexKey]; +} + +- (NSString *)configurationName { + return [self stringForKey:kConfigurationNameKey]; +} + +- (void)setConfigurationName:(NSString *)configurationName { + [self setObject:configurationName forKey:kConfigurationNameKey]; + [self initializeCommonSettings]; + [self initializespecificsettings]; +} + +- (NSArray *)configurations { + return [self arrayForKey:kConfigurationsKey]; +} + +- (void)setConfigurations:(NSArray *)configurations { + [self setObject:configurations forKey:kConfigurationsKey]; +} + +- (NSArray *)controllers { + return [self arrayForKey:kControllersKey]; +} + +- (void)setControllers:(NSArray *)controllers { + [self setObject:controllers forKey:kControllersKey]; +} + +- (NSString *)romPath { + return [self stringForKey:kRomPath]; +} + +- (void)setRomPath:(NSString *)romPath { + [self setObject:romPath forKey:kRomPath]; +} + +- (DriveState *)driveState { + DriveState *driveState = [[[DriveState alloc] init] autorelease]; + driveState.df1Enabled = [self boolForKey:kDf1EnabledKey]; + driveState.df2Enabled = [self boolForKey:kDf2EnabledKey]; + driveState.df3Enabled = [self boolForKey:kDf3EnabledKey]; + return driveState; +} + +- (void)setDriveState:(DriveState *)driveState { + [self setBool:driveState.df1Enabled forKey:kDf1EnabledKey]; + [self setBool:driveState.df2Enabled forKey:kDf2EnabledKey]; + [self setBool:driveState.df3Enabled forKey:kDf3EnabledKey]; +} + +- (NSString *)hardfilePath { + return [self stringForKey:kHardfilePath]; +} + +- (void)setHardfilePath:(NSString *)hardfilePath { + [self setObject:hardfilePath forKey:kHardfilePath]; +} + +- (BOOL)hardfileReadOnly { + return [self boolForKey:kHardfileReadOnly]; +} + +- (void)setHardfileReadOnly:(BOOL)hardfileReadOnly { + [self setBool:hardfileReadOnly forKey:kHardfileReadOnly]; +} + +- (BOOL)keyButtonsEnabled { + return [self boolForKey:kKeyButtonsEnabledKey]; +} + +- (void)setKeyButtonsEnabled:(BOOL)keyButtonsEnabled { + [self setBool:keyButtonsEnabled forKey:kKeyButtonsEnabledKey]; +} + +NSString *const kPositionAttrName = @"position"; +NSString *const kSizeAttrName = @"size"; +NSString *const kKeyAttrName = @"key"; +NSString *const kKeyNameAttrName = @"keyname"; +NSString *const kGroupNameAttrName = @"groupname"; +NSString *const kShowOutlineAttrName = @"showoutline"; +NSString *const kEnabledAttrName = @"enabled"; + +- (NSArray *)keyButtonConfigurations { + NSString *json = [self stringForKey:kKeyButtonConfigurationsKey]; + if (!json) { + return @[]; + } + NSData *jsonData = [json dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO]; + NSArray *dicts = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil]; + NSMutableArray *keyButtonConfigurations = [[[NSMutableArray alloc] initWithCapacity:[dicts count]] autorelease]; + for (NSDictionary *dict : dicts) { + KeyButtonConfiguration *button = [[[KeyButtonConfiguration alloc] init] autorelease]; + button.position = CGPointFromString([dict objectForKey:kPositionAttrName]); + button.size = CGSizeFromString([dict objectForKey:kSizeAttrName]); + button.key = (SDLKey)[[dict objectForKey:kKeyAttrName] intValue]; + button.keyName = [dict objectForKey:kKeyNameAttrName]; + button.groupName = [dict objectForKey:kGroupNameAttrName]; + button.showOutline = [[dict objectForKey:kShowOutlineAttrName] boolValue]; + button.enabled = [[dict objectForKey:kEnabledAttrName] boolValue]; + [keyButtonConfigurations addObject:button]; + } + return keyButtonConfigurations; +} + +- (void)setKeyButtonConfigurations:(NSArray *)keyButtonConfigurations { + NSMutableArray *dicts = [NSMutableArray arrayWithCapacity:[keyButtonConfigurations count]]; + for (KeyButtonConfiguration *button in keyButtonConfigurations) { + NSDictionary *dict = @{kPositionAttrName : NSStringFromCGPoint(button.position), + kSizeAttrName : NSStringFromCGSize(button.size), + kKeyAttrName : @(button.key), + kKeyNameAttrName : button.keyName, + kGroupNameAttrName : button.groupName, + kShowOutlineAttrName : @(button.showOutline), + kEnabledAttrName : @(button.enabled)}; + [dicts addObject:dict]; + } + NSData *data = [NSJSONSerialization dataWithJSONObject:dicts options:0 error:nil]; + NSString *json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [self setObject:json forKey:kKeyButtonConfigurationsKey]; +} + +- (void)setBool:(BOOL)value forKey:(NSString *)settingitemname { + [defaults setBool:value forKey:[self getInternalSettingKey:settingitemname]]; +} + +- (void)setObject:(id)value forKey:(NSString *)settingitemname { + [defaults setObject:value forKey:[self getInternalSettingKey:settingitemname]]; +} + +- (bool)boolForKey:(NSString *)settingitemname { + return [defaults boolForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (NSString *)stringForKey:(NSString *)settingitemname { + return [defaults stringForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (void)setInteger:(NSInteger)value forKey:(NSString *)settingitemname { + [defaults setInteger:value forKey:[self getInternalSettingKey:settingitemname]]; +} + +- (NSInteger)integerForKey:(NSString *)settingitemname { + return [defaults integerForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (float)floatForKey:(NSString *)settingitemname { + return [defaults floatForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (void)setFloat:(float)value forKey:(NSString *)settingitemname { + [defaults setFloat:value forKey:[self getInternalSettingKey:settingitemname]]; +} + +- (NSArray *)arrayForKey:(NSString *)settingitemname { + return [defaults arrayForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (id)objectForKey:(NSString *)settingitemname { + return [defaults objectForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (void)removeObjectForKey:(NSString *) settingitemname { + [defaults removeObjectForKey:[self getInternalSettingKey:settingitemname]]; +} + +- (NSString *)getInternalSettingKey:(NSString *)name { + // if name starts with '_', the setting is stored in its own configuration + return [name hasPrefix:@"_"] ? [NSString stringWithFormat:@"%@%@", _configurationname, name] : name; +} + +- (NSString *)configForDisk:(NSString *)diskName { + NSString *settingstring = [NSString stringWithFormat:@"cnf%@", diskName]; + return [defaults stringForKey:settingstring]; +} + +- (void)setConfig:(NSString *)configName forDisk:(NSString *)diskName { + + NSString *configstring = [NSString stringWithFormat:@"cnf%@", diskName]; + + if([configName isEqual:@"None"]) + { + if([self configForDisk:diskName]) + { + [defaults setObject:nil forKey:configstring]; + } + } + else + { + [defaults setObject:configName forKey:configstring]; + } +} + +- (void)dealloc { + [defaults release]; + defaults = nil; + [super dealloc]; +} + +@end diff --git a/iUAEParents/TouchHandlerViewClassic.h b/iUAEParents/TouchHandlerViewClassic.h new file mode 100644 index 0000000..02ff9ce --- /dev/null +++ b/iUAEParents/TouchHandlerViewClassic.h @@ -0,0 +1,52 @@ +// +// TouchHandlerViewClassic.h +// iAmiga +// +// Created by Emufreak on 23.04.14. +// +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import + +@interface TouchHandlerViewClassic : UIView { + UITouch *leadTouch; + UITouch *rightTouch; + CGPoint previousMouseLocation; + BOOL didMove; + CGFloat x_ratio, y_ratio; + NSDate *starttimetouch; +} + +- (void)onMouseActivated; +- (void)reloadMouseSettings; + +@property (nonatomic, assign) BOOL clickedscreen; + +@end diff --git a/iUAEParents/TouchHandlerViewClassic.m b/iUAEParents/TouchHandlerViewClassic.m new file mode 100644 index 0000000..f938845 --- /dev/null +++ b/iUAEParents/TouchHandlerViewClassic.m @@ -0,0 +1,236 @@ +// +// TouchHandlerView.m +// iAmiga +// +// Created by Stuart Carnie on 1/2/11. +// Copyright 2011 Manomio LLC. All rights reserved. +// +// +// TouchHandlerViewClassic.m +// iAmiga +// +// Changed by Emufr3ak on 23.04.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + + + +#import "TouchHandlerViewClassic.h" +#import "SDL.h" +#import "SDL_events.h" +#import "SDL_mouse_c.h" +#import "KeyButtonViewHandler.h" + +@implementation TouchHandlerViewClassic { + NSTimer *timer; + NSTimeInterval durationtouch; + bool draggingon; + NSDate *now; + UILabel *ldraggingon; + UILabel *ldurationtouch; + KeyButtonViewHandler *keyButtonViewHandler; +} + +@synthesize clickedscreen = _clickedscreen; + +-(id)initWithCoder:(NSCoder *)aDecoder +{ + self = [super initWithCoder:aDecoder]; + if (self) { + // Initialization code. + self.multipleTouchEnabled = YES; + } + + timer = [[NSTimer scheduledTimerWithTimeInterval:0.020 target:self + selector:@selector(timerEvent:) userInfo:nil repeats:YES ] retain]; + + draggingon = FALSE; + + ldraggingon = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 10)]; + ldurationtouch = [[UILabel alloc] initWithFrame:CGRectMake(0, 20, 100, 10)]; + + /*[self addSubview:ldraggingon]; + [self addSubview:ldurationtouch];*/ + + keyButtonViewHandler = [[KeyButtonViewHandler alloc] initWithSuperview:self]; + + return self; +} + +-(void)timerEvent:(NSTimer*)timer +{ + //Press Left Mouse Button down and keep down if tab is pressed for more than one second without moving + + /*[ldraggingon setText: (draggingon ? @"YES" : @"NO")]; + [ldurationtouch setText:[NSString stringWithFormat:@"%f", durationtouch]];*/ + + if(starttimetouch && !didMove && !draggingon) + { + now = [NSDate date]; + durationtouch = [now timeIntervalSinceDate:starttimetouch]; + } + + if(durationtouch > 1) + { + SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT); + draggingon = YES; + } +} + +- (void)awakeFromNib +{ + self.multipleTouchEnabled = YES; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + x_ratio = self.frame.size.width / 320.0f / 2.0f; /* King of Chicago */ + y_ratio = self.frame.size.height / 240.0f / 2.0f; /* King of Chicago */ +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + NSSet *touchtype = [event allTouches]; + int touchCounts = [touchtype count]; + + UITouch *touch = [touches anyObject]; + + if (touch.phase == UITouchPhaseBegan) + { + if (touchCounts == 2) + { + rightTouch = touch; + SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_RIGHT); + } + else + { + leadTouch = touch; + previousMouseLocation = [touch locationInView: self]; + didMove = NO; + starttimetouch = [[NSDate alloc] init]; //Neccessary for dragging (long touch and then Move = Drag) + } + } +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + if (leadTouch) + { + CGPoint locationInView = [leadTouch locationInView:self]; + CGFloat relx = (locationInView.x - previousMouseLocation.x) / x_ratio; + CGFloat rely = (locationInView.y - previousMouseLocation.y) / y_ratio; + + if (fabsf(relx) < 1.0f) + relx = 0.f; + if (fabsf(rely) < 1.0f) + rely = 0.f; + + if (relx != 0.0f || rely != 0.0f) + { + SDL_SendMouseMotion(NULL, SDL_MOTIONRELATIVE, relx, rely); + + if (relx != 0.0f) + previousMouseLocation.x = locationInView.x; + + if (rely != 0.0f) + previousMouseLocation.y = locationInView.y; + + didMove = YES; + } + } +} + +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + [self touchesEnded:touches withEvent:event]; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + _clickedscreen = true; + + for (UITouch *touch in touches) + { + if (touch.phase == UITouchPhaseEnded) + { + if (touch == leadTouch) + { + leadTouch = nil; + //printf("Move End\n"); + + if(draggingon == NO) + { + if (didMove == NO) + { + SDL_SendMouseButton(NULL, SDL_PRESSED, SDL_BUTTON_LEFT); + //printf("Left press\n"); + + // 50ms after, push up + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 50 * 1000000), dispatch_get_main_queue(), ^{ + SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT); + //printf("Left release\n"); + }); + } + } + else + //Left Mousebutton Down while Moving Mouse on (Allows Drag and Drop among others) + { + SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_LEFT); + } + + draggingon = NO; + [starttimetouch release]; + starttimetouch = nil; + durationtouch = 0; + } + else if (touch == rightTouch) + { + rightTouch = Nil; + SDL_SendMouseButton(NULL, SDL_RELEASED, SDL_BUTTON_RIGHT); + //printf("Right release\n"); + } + } + } +} + +- (void)reloadMouseSettings +{ + [self onMouseActivated]; +} + +- (void)onMouseActivated +{ + [keyButtonViewHandler addConfiguredKeyButtonViews]; +} + +- (BOOL)clickedscreen { + // did the user move the mouse or use key buttons? + return _clickedscreen || keyButtonViewHandler.anyButtonWasTouched; +} + +- (void)setClickedscreen:(BOOL)clickedscreen { + _clickedscreen = clickedscreen; + keyButtonViewHandler.anyButtonWasTouched = clickedscreen; +} + +- (void)dealloc +{ + [starttimetouch release]; + [ldraggingon release]; + [ldurationtouch release]; + [timer release]; + [keyButtonViewHandler release]; + [super dealloc]; +} + +@end diff --git a/iUAEParents/VPadMotionController.h b/iUAEParents/VPadMotionController.h new file mode 100644 index 0000000..3d1ea76 --- /dev/null +++ b/iUAEParents/VPadMotionController.h @@ -0,0 +1,44 @@ +// +// VPadMotionController.h +// iUAE +// +// Created by MrStargazer on 27.03.16. +// +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + + + +#ifndef VPadMotionController_h +#define VPadMotionController_h + +#import + +@interface VPadMotionController : NSObject { +} + + +//+ (VPadMotionController*)motionController; + ++ (void) startUpdating; ++ (void) stopUpdating; ++ (void) calibrate; ++ (CMAttitude*) getMotion; ++ (CMAttitude*) referenceAttitude; ++ (BOOL) isActive; ++ (void) setActive; ++ (void) disable; + + +@end + +#endif /* VPadMotionController_h */ diff --git a/iUAEParents/VPadMotionController.mm b/iUAEParents/VPadMotionController.mm new file mode 100644 index 0000000..3b6e3a5 --- /dev/null +++ b/iUAEParents/VPadMotionController.mm @@ -0,0 +1,182 @@ +// +// VPadMotionController.mm +// iUAE +// +// Created by MrStargazer on 27.03.16. +// +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// + +#import "VPadMotionController.h" +#import "touchstick.h" +#import "CGVector.h" +#import "CocoaUtility.h" +#import "SDL_events.h" +#import "JoypadKey.h" +#import "Settings.h" +#import "MultiPeerConnectivityController.h" + +extern CJoyStick g_touchStick; + +@implementation VPadMotionController { +} + +static CMAttitude *refAttitude = nil; +static CMMotionManager *motionController = nil; +static Settings *settings; +static BOOL active = NO; +const float motionUpdateInterval = 1.0/30.0; +static CJoyStick *TheJoyStick; +static MultiPeerConnectivityController *mpcController; +static int buttontoreleasehorizontal; +static int buttontoreleasevertical; + ++ (BOOL) isActive{ + return active; +} + +// activates motion controlling ++ (void) setActive{ + active = YES; + TheJoyStick = &g_touchStick; + [self stopUpdating]; + motionController.deviceMotionUpdateInterval = motionUpdateInterval; + + // register for motion updates + [motionController startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion *motionData, NSError *error){ + [self receiveMotionData:motionData.attitude]; + if(error){ + + NSLog(@"%@", error); + } + }]; + + mpcController = [MultiPeerConnectivityController getinstance]; +} + +// receivces frequently motion data and translate it into joystick directions ++ (void) receiveMotionData : (CMAttitude*)currentAttitude{ + // process data + + TouchStickDPadState dpadState; + float deadZone = settings.gyroSensitivity; + BOOL toggleUpDown = settings.gyroToggleUpDown; + + if (refAttitude != nil){ + [currentAttitude multiplyByInverseOfAttitude: refAttitude]; + } + + if (currentAttitude.pitch < -deadZone && currentAttitude.roll < -deadZone){ + dpadState = toggleUpDown ? DPadUpRight : DPadDownRight; + } + else if (currentAttitude.pitch < -deadZone && currentAttitude.roll > deadZone){ + dpadState = toggleUpDown ? DPadDownRight : DPadUpRight; + } + else if (currentAttitude.pitch > deadZone && currentAttitude.roll < -deadZone){ + dpadState = toggleUpDown ? DPadUpLeft : DPadDownLeft; + } + else if (currentAttitude.pitch > deadZone && currentAttitude.roll > deadZone){ + dpadState = toggleUpDown ? DPadDownLeft : DPadUpLeft; + } + else if (currentAttitude.roll > deadZone && ABS(currentAttitude.pitch) < deadZone) + { + + dpadState = toggleUpDown ? DPadDown : DPadUp; + } + else if (currentAttitude.roll < -deadZone && ABS(currentAttitude.pitch) < deadZone){ + dpadState = toggleUpDown ? DPadUp : DPadDown; + } + else if (currentAttitude.pitch > deadZone && ABS(currentAttitude.roll) < deadZone){ + dpadState = DPadLeft; + } + else if (currentAttitude.pitch < -deadZone && ABS(currentAttitude.roll) < deadZone){ + dpadState = DPadRight; + } + else { + dpadState = DPadCenter; + } + + int buttonvertical = [mpcController dpadstatetojoypadkey:@"vertical" hatstate:dpadState]; + int buttonhorizontal = [mpcController dpadstatetojoypadkey:@"horizontal" hatstate:dpadState]; + + [mpcController handleinputdirections:dpadState buttontoreleasevertical:buttontoreleasevertical buttontoreleasehorizontal: buttontoreleasehorizontal deviceid:kVirtualPad]; + + buttontoreleasevertical = buttonvertical; + buttontoreleasehorizontal = buttonhorizontal; + +} + +// disables motion controlling ++ (void) disable{ + [self stopUpdating]; + active = NO; +} + +// interface to apples motion api (CoreMotion) ++ (CMMotionManager*)motionManager { + + if (motionController != nil){ + return motionController; + } + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + motionController = [[CMMotionManager alloc] init]; + settings = [[Settings alloc] init]; + motionController.deviceMotionUpdateInterval = 1.0/60.0; + [motionController startDeviceMotionUpdates]; + + }); + + return motionController; +} + +// returns the reference position set with method calibrate ++ (CMAttitude*)referenceAttitude{ + return refAttitude; +} + +// starts receiving motion updates ++ (void)startUpdating { + if (!self.motionManager.isDeviceMotionActive){ + [self.motionManager startDeviceMotionUpdates]; + } +} + +// stops motion controller receiving motion updates ++ (void)stopUpdating { + if ([self motionManager].isDeviceMotionActive){ + [[self motionManager] stopDeviceMotionUpdates]; + } +} + +// sets der current position of the device as reference for movement ++ (void)calibrate { + refAttitude = self.motionManager.deviceMotion.attitude.copy; +} + ++ (CMAttitude*)getMotion { + CMAttitude *currentAttitude = self.motionManager.deviceMotion.attitude; + + if (refAttitude != nil){ + [currentAttitude multiplyByInverseOfAttitude: refAttitude]; + } + + return currentAttitude; +} + +- (void)dealloc { + // Should never be called, but just here for clarity really. + [super dealloc]; +} + +@end \ No newline at end of file diff --git a/iUAEParents/bg_web.png b/iUAEParents/bg_web.png new file mode 100644 index 0000000..18bfcba Binary files /dev/null and b/iUAEParents/bg_web.png differ diff --git a/iUAEParents/bg_web@2x.png b/iUAEParents/bg_web@2x.png new file mode 100644 index 0000000..6da8b9c Binary files /dev/null and b/iUAEParents/bg_web@2x.png differ diff --git a/iAmigaKOC.xcodeproj/project.pbxproj b/iUAEParents/iAmigaKOC.xcodeproj/project.pbxproj similarity index 100% rename from iAmigaKOC.xcodeproj/project.pbxproj rename to iUAEParents/iAmigaKOC.xcodeproj/project.pbxproj diff --git a/iAmiga.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iUAEParents/iAmigaKOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from iAmiga.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to iUAEParents/iAmigaKOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/iAmiga.xcscheme b/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/iAmiga.xcscheme new file mode 100644 index 0000000..d3ddda3 --- /dev/null +++ b/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/iAmiga.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/koc.xcscheme b/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/koc.xcscheme new file mode 100644 index 0000000..6e9fd79 --- /dev/null +++ b/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/koc.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/xcschememanagement.plist b/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..4073a3d --- /dev/null +++ b/iUAEParents/iAmigaKOC.xcodeproj/xcuserdata/urs.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + iAmiga.xcscheme + + orderHint + 8 + + koc.xcscheme + + orderHint + 9 + + + SuppressBuildableAutocreation + + 1D6058900D05DD3D006BFB54 + + primary + + + 97EF9571153876CA001C01E6 + + primary + + + + + diff --git a/main.m b/iUAEParents/main.mm similarity index 58% rename from main.m rename to iUAEParents/main.mm index f28866c..76d5608 100644 --- a/main.m +++ b/iUAEParents/main.mm @@ -1,4 +1,3 @@ -// // main.m // iAmiga // @@ -7,11 +6,13 @@ // #import +#import "SingleWindowAppDelegate.h" +#import "iUAEApplication.h" int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); + int retVal = UIApplicationMain(argc, argv, NSStringFromClass([iUAEApplication class]), NSStringFromClass([SingleWindowAppDelegate class])); [pool release]; return retVal; } diff --git a/iUAETests/CoreSettingGroupTests.m b/iUAETests/CoreSettingGroupTests.m new file mode 100644 index 0000000..85b14a7 --- /dev/null +++ b/iUAETests/CoreSettingGroupTests.m @@ -0,0 +1,139 @@ +// Created by Simon Toens on 22.08.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "CoreSetting.h" +#import "CoreSettingGroup.h" + +@interface TestGroup : NSObject @end +@interface TestGroupMember : CoreSetting @end + +@implementation TestGroupMember { + @public + NSString *persistValueArgument; + NSString *onResetArgument; + NSString *emulatorValue; +} + +- (void)hook_persistValue:(NSString *)arg { + persistValueArgument = arg; +} + +- (void)hook_onReset:(NSString *)arg { + onResetArgument = arg; +} + +- (NSString *)hook_getEmulatorValue { + return emulatorValue; +} + +- (Class)getGroup { + return TestGroup.self; +} + +@end + +NSMutableDictionary *groupMemberToValue; +NSUInteger onResetAfterMembersNumCalls; + +@implementation TestGroup + +- (void)onResetAfterMembers:(NSSet *)groupMembers { + for (CoreSetting *setting in groupMembers) { + [groupMemberToValue setObject:[setting getValue] forKey:setting]; + } + onResetAfterMembersNumCalls++; +} + +- (id)copyWithZone:(nullable NSZone *)zone { + return self; +} + +@end + + +@interface CoreSettingGroupTests : XCTestCase + +@end + +@implementation CoreSettingGroupTests { + @private + TestGroupMember *_setting1; + TestGroupMember *_setting2; + TestGroupMember *_setting3; +} + +- (void)setUp { + [super setUp]; + _setting1 = [[TestGroupMember alloc] initWithName:@"m1"]; + _setting2 = [[TestGroupMember alloc] initWithName:@"m2"]; + _setting3 = [[TestGroupMember alloc] initWithName:@"m3"]; + groupMemberToValue = [[NSMutableDictionary alloc] init]; + onResetAfterMembersNumCalls = 0; +} + +- (void)testSingleSettingModified { + [_setting1 setValue:@"v"]; + + [CoreSettings onReset]; + + XCTAssertEqual(onResetAfterMembersNumCalls, 1); + XCTAssertEqual([groupMemberToValue count], 1); + XCTAssertEqualObjects([[groupMemberToValue keyEnumerator] nextObject], _setting1); +} + +- (void)testTwoSettingsModified { + [_setting1 setValue:@"v1"]; + [_setting3 setValue:@"v2"]; + + [CoreSettings onReset]; + + XCTAssertEqual(onResetAfterMembersNumCalls, 1); + XCTAssertEqual([groupMemberToValue count], 2); + NSSet *expected = [NSSet setWithObjects:_setting1, _setting3, nil]; + XCTAssertEqualObjects([NSSet setWithArray:[groupMemberToValue allKeys]], expected); +} + +- (void)testSettingsModifiedAndReset { + [_setting1 setValue:@"v1"]; + [_setting2 setValue:@"v2"]; + [_setting3 setValue:@"v3"]; + [_setting3 setValue:nil]; // reset value back to original value + + [CoreSettings onReset]; + + XCTAssertEqual(onResetAfterMembersNumCalls, 1); + XCTAssertEqual([groupMemberToValue count], 2); + NSSet *expected = [NSSet setWithObjects:_setting1, _setting2, nil]; + XCTAssertEqualObjects([NSSet setWithArray:[groupMemberToValue allKeys]], expected); +} + +- (void)testNoGroupCallbackWhenNoSettingModification { + [CoreSettings onReset]; + + XCTAssertEqual(onResetAfterMembersNumCalls, 0); +} + +- (void)testSettingValueOnCallback { + [_setting1 setValue:@"v1"]; + + [CoreSettings onReset]; + + XCTAssertEqual([groupMemberToValue count], 1); + XCTAssertEqualObjects([[groupMemberToValue objectEnumerator] nextObject], @"v1"); +} + +@end diff --git a/iUAETests/CoreSettingTests.m b/iUAETests/CoreSettingTests.m new file mode 100644 index 0000000..12332a7 --- /dev/null +++ b/iUAETests/CoreSettingTests.m @@ -0,0 +1,213 @@ +// Created by Simon Toens on 11.05.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import +#import "CoreSetting.h" + +@interface TestSetting : CoreSetting + +@end + +@implementation TestSetting { + @public + NSString *persistValueArgument; + NSString *onResetArgument; + NSString *emulatorValue; +} + +- (void)hook_persistValue:(NSString *)arg { + persistValueArgument = arg; +} + +- (void)hook_onReset:(NSString *)arg { + onResetArgument = arg; +} + +- (NSString *)hook_getEmulatorValue { + return emulatorValue; +} + +@end + +@interface CoreSettingTests : XCTestCase + +@end + +@implementation CoreSettingTests { + @private + TestSetting *_setting; +} + +- (void)setUp { + [super setUp]; + _setting = [[TestSetting alloc] initWithName:@"TestSetting"]; +} + +- (void)tearDown { + [CoreSettings onReset]; + [super tearDown]; +} + +- (void)testRomSettingSingleton { + RomCoreSetting *rom1 = [CoreSettings romCoreSetting]; + RomCoreSetting *rom2 = [CoreSettings romCoreSetting]; + + XCTAssertNotNil(rom1); + XCTAssertTrue(rom1 == rom2); +} + +- (void)testHasUnappliedValue { + XCTAssertFalse([_setting hasUnappliedValue]); + + [_setting setValue:@"v1"]; + + XCTAssertTrue([_setting hasUnappliedValue]); +} + +- (void)testSetValue_backToOriginalValue { + _setting->emulatorValue = @"e1"; + XCTAssertFalse([_setting hasUnappliedValue]); + + [_setting setValue:@"v1"]; + XCTAssertTrue([_setting hasUnappliedValue]); + + [_setting setValue:@"v2"]; + XCTAssertTrue([_setting hasUnappliedValue]); + + [_setting setValue:@"e1"]; + XCTAssertFalse([_setting hasUnappliedValue]); +} + +- (void)testSetValue_SameAsEmulatorValue { + _setting->emulatorValue = @"e1"; + + [_setting setValue:@"e1"]; + + XCTAssertFalse([_setting hasUnappliedValue]); +} + +- (void)testSetValue_AllNil { + _setting->emulatorValue = nil; + + [_setting setValue:nil]; + + XCTAssertFalse([_setting hasUnappliedValue]); +} + +- (void)testSetValue_Nil { + _setting->emulatorValue = @"e22"; + + [_setting setValue:nil]; + XCTAssertTrue([_setting hasUnappliedValue]); + + [_setting setValue:@"e22"]; + XCTAssertFalse([_setting hasUnappliedValue]); +} + +- (void)testPersistValue_CalledAfterChangingValue { + XCTAssertNil(_setting->persistValueArgument); + + [_setting setValue:@"new"]; + XCTAssertEqualObjects(_setting->persistValueArgument, @"new"); + + [_setting setValue:@"newer"]; + XCTAssertEqualObjects(_setting->persistValueArgument, @"newer"); +} + +- (void)testPersistValue_SameAsEmulatorValue_NotCalled { + _setting->emulatorValue = @"e23"; + XCTAssertNil(_setting->persistValueArgument); + + [_setting setValue:@"e23"]; + + XCTAssertNil(_setting->persistValueArgument); +} + +- (void)testPersistValue_SameValue_NotCalled { + _setting->emulatorValue = @"e23"; + XCTAssertNil(_setting->persistValueArgument); + + [_setting setValue:@"e24"]; + XCTAssertEqualObjects(_setting->persistValueArgument, @"e24"); + + _setting->persistValueArgument = nil; + [_setting setValue:@"e24"]; + XCTAssertNil(_setting->persistValueArgument); +} + + +- (void)testOnReset_CalledAfterChangingValues { + XCTAssertNil(_setting->onResetArgument); + [_setting setValue:@"new"]; + [_setting setValue:@"newer"]; + + [CoreSettings onReset]; + + XCTAssertEqualObjects(_setting->onResetArgument, @"newer"); +} + +- (void)testOnReset_NotCalledWhenValueChangedBack { + XCTAssertNil(_setting->onResetArgument); + [_setting setValue:@"new"]; + [_setting setValue:nil]; // default emulator setting + + [CoreSettings onReset]; + + XCTAssertNil(_setting->onResetArgument); +} + +- (void)testOnReset_NotCalledWhenValueDidNotChange { + XCTAssertNil(_setting->onResetArgument); + + [CoreSettings onReset]; + + XCTAssertNil(_setting->onResetArgument); +} + +- (void)testOnReset_CalledWithNil { + _setting->onResetArgument = @"empty"; + _setting->emulatorValue = @"foo"; + [_setting setValue:nil]; + + [CoreSettings onReset]; + + XCTAssertNil(_setting->onResetArgument); +} + +- (void)testGetValue_WithUnappliedValue { + _setting->emulatorValue = @"foo"; + + [_setting setValue:@"blah"]; + + XCTAssertEqualObjects([_setting getValue], @"blah"); +} + +- (void)testGetValue_WithoutUnappliedValue { + _setting->emulatorValue = @"foo"; + + XCTAssertEqualObjects([_setting getValue], @"foo"); +} + +- (void)testGetGetValue_UnappliedValueIsNil { + _setting->emulatorValue = @"foo"; + + [_setting setValue:nil]; + + XCTAssertNil([_setting getValue]); + +} + +@end diff --git a/iUAETests/Info.plist b/iUAETests/Info.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/iUAETests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/iAmiga_Prefix.pch b/iUAE_Prefix.pch similarity index 100% rename from iAmiga_Prefix.pch rename to iUAE_Prefix.pch diff --git a/icon-72@2x.png b/icon-72@2x.png deleted file mode 100644 index 2197e21..0000000 Binary files a/icon-72@2x.png and /dev/null differ diff --git a/images/emulator/input-mode/keyboard.png b/images/emulator/input-mode/keyboard.png deleted file mode 100644 index 2c485ab..0000000 Binary files a/images/emulator/input-mode/keyboard.png and /dev/null differ diff --git a/libraries/sdl-mini/include/SDL.h b/libraries/sdl-mini/include/SDL.h index 1eaf56b..4fad90c 100644 --- a/libraries/sdl-mini/include/SDL.h +++ b/libraries/sdl-mini/include/SDL.h @@ -41,6 +41,7 @@ extern void SDL_FillRect(SDL_Surface*, void*, int); extern long int SDL_MapRGB(tagFormat*, int, int, int); extern int SDL_PollEvent(SDL_Event*); extern void SDL_VideoQuit(); +extern void SDL_PauseOpenGL(int); extern int SDL_Init(int); extern char* SDL_GetError(); diff --git a/libraries/sdl-mini/include/SDL_events.h b/libraries/sdl-mini/include/SDL_events.h index d5ac7fa..db01ed1 100644 --- a/libraries/sdl-mini/include/SDL_events.h +++ b/libraries/sdl-mini/include/SDL_events.h @@ -13,7 +13,6 @@ #include "SDL_video.h" #include "SDL_keyboard.h" #include "SDL_mouse.h" -#include "SDL_joystick.h" #ifdef __cplusplus /* *INDENT-OFF* */ diff --git a/libraries/sdl-mini/include/SDL_joystick.h b/libraries/sdl-mini/include/SDL_joystick.h index 0ef6690..ccfe537 100644 --- a/libraries/sdl-mini/include/SDL_joystick.h +++ b/libraries/sdl-mini/include/SDL_joystick.h @@ -31,6 +31,7 @@ extern const char * SDL_JoystickName(int device_index); extern SDL_Joystick* SDL_JoystickOpen(int); extern int SDL_JoystickNumButtons(SDL_Joystick*); extern void SDL_JoystickUpdate(); +extern void SDL_JoystickSetActive(SDL_Joystick * joystick); /** * Enable/disable joystick event polling. @@ -56,6 +57,7 @@ extern Sint16 SDL_JoystickGetAxis(SDL_Joystick*, int); * Get the current state of a POV hat on a joystick * The return value is one of the following positions: */ + #define SDL_HAT_CENTERED 0x00 #define SDL_HAT_UP 0x01 #define SDL_HAT_RIGHT 0x02 @@ -69,6 +71,7 @@ extern Sint16 SDL_JoystickGetAxis(SDL_Joystick*, int); extern Uint8 SDL_JoystickGetHat(SDL_Joystick * joystick, int hat); extern Uint8 SDL_JoystickGetButton(SDL_Joystick*, int); extern void SDL_JoystickClose(SDL_Joystick*); +extern int SDL_JoystickGetPaused(SDL_Joystick*); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/libraries/sdl-mini/include/joystick.h b/libraries/sdl-mini/include/joystick.h new file mode 100644 index 0000000..44b4e32 --- /dev/null +++ b/libraries/sdl-mini/include/joystick.h @@ -0,0 +1,13 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Joystick emulation prototypes + * + * Copyright 1995 Bernd Schmidt + */ + +extern void read_joystick (int nr, unsigned int *dir, int *button); +extern void close_joystick (void); +extern void set_joystickactive(void); + +extern int nr_joysticks; diff --git a/libraries/sdl-mini/include/od-joy.h b/libraries/sdl-mini/include/od-joy.h new file mode 100644 index 0000000..c98ca59 --- /dev/null +++ b/libraries/sdl-mini/include/od-joy.h @@ -0,0 +1,14 @@ +// +// od-joy.h +// iUAE +// +// Created by mithrendal on 16.02.16. +// +// +#ifndef __MYOBJECT_C_INTERFACE_H__ +#define __MYOBJECT_C_INTERFACE_H__ + +// This is the C "trampoline" function that will be used +// to invoke a specific Objective-C method FROM C++ +void sendJoystickDataToServer (void *myObjectInstance); +#endif \ No newline at end of file diff --git a/libraries/sdl-mini/src/SDL.mm b/libraries/sdl-mini/src/SDL.mm index 8a66bf2..5ed88fe 100644 --- a/libraries/sdl-mini/src/SDL.mm +++ b/libraries/sdl-mini/src/SDL.mm @@ -6,6 +6,21 @@ * Copyright 2009 __MyCompanyName__. All rights reserved. * */ +// Changed by Emufr3ak on 29.05.14. +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // #import #import "unistd.h" @@ -72,7 +87,7 @@ int SDL_Init(int initFlags) { SDL_VideoInit(NULL, initFlags); - SDL_JoystickInit(); + //SDL_JoystickInit(); return 0; } @@ -111,7 +126,8 @@ int SDL_Init(int initFlags) { s->pitch = width * fmt->BytesPerPixel; s->pixels = view.pixels; s->userdata = view; - + + return s; } @@ -148,9 +164,19 @@ int SDL_ShowCursor(int a) { return 0; } -#pragma mark - +#pragma mark #pragma mark Audio Handlers +void SDL_PauseOpenGL(int paused) +{ + if(paused) { + [view setPaused:true]; + } else { + [view setPaused:false]; + } + +} + #if 0 static CAudioQueueManager *g_audioQueue; @@ -175,5 +201,4 @@ void SDL_PauseAudio(int paused) { g_audioQueue->resume(); } } - #endif \ No newline at end of file diff --git a/libraries/sdl-mini/src/events/SDL_events.c b/libraries/sdl-mini/src/events/SDL_events.c index 7a99197..9459a44 100644 --- a/libraries/sdl-mini/src/events/SDL_events.c +++ b/libraries/sdl-mini/src/events/SDL_events.c @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + // // sdl_event.m // A2600 @@ -56,20 +59,6 @@ void SDL_Lock_EventThread(void) { void SDL_Unlock_EventThread(void) { } -static __inline__ SDL_bool -SDL_ShouldPollJoystick() -{ -#if !SDL_JOYSTICK_DISABLED - if (SDL_numjoysticks && - (!SDL_disabled_events[SDL_JOYAXISMOTION >> 8] || - SDL_JoystickEventState(SDL_QUERY))) { - return SDL_TRUE; - } -#endif - return SDL_FALSE; - -} - static int SDL_StartEventThread(Uint32 flags) { @@ -303,14 +292,6 @@ void SDL_PumpEvents(void) { if (_this) { _this->PumpEvents(_this); } -#if !SDL_JOYSTICK_DISABLED - /* Check for joystick state change */ - if (SDL_ShouldPollJoystick()) { - SDL_JoystickUpdate(); - } -#endif - //} - } /* Public functions */ @@ -421,3 +402,6 @@ int SDL_PushEvent(SDL_Event *e) { eventQueue->push(*e); return 1; } */ + +#pragma clang diagnostic pop + diff --git a/libraries/sdl-mini/src/events/SDL_mouse_c.h b/libraries/sdl-mini/src/events/SDL_mouse_c.h index 506b43b..e70f1d3 100644 --- a/libraries/sdl-mini/src/events/SDL_mouse_c.h +++ b/libraries/sdl-mini/src/events/SDL_mouse_c.h @@ -13,10 +13,12 @@ #define SDL_MOTIONABSOLUTE 0 #define SDL_MOTIONRELATIVE 1 + + /* Send a mouse motion event */ extern int SDL_SendMouseMotion(SDL_Window * window, int relative, int x, int y); /* Send a mouse button event */ extern int SDL_SendMouseButton(SDL_Window * window, Uint8 state, Uint8 button); -#endif \ No newline at end of file +#endif diff --git a/libraries/sdl-mini/src/joystick/SDL_joystick.c b/libraries/sdl-mini/src/joystick/SDL_joystick.c deleted file mode 100644 index 1727aab..0000000 --- a/libraries/sdl-mini/src/joystick/SDL_joystick.c +++ /dev/null @@ -1,525 +0,0 @@ -// -// SDL_joystick_c.c -// iAmiga -// -// Created by Stuart Carnie on 6/5/11. -// Copyright 2011 Manomio LLC. All rights reserved. -// -#include "SDL_config.h" - -#include "SDL_events.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" -#if !SDL_EVENTS_DISABLED -#include "../events/SDL_events_c.h" -#endif - -Uint8 SDL_numjoysticks = 0; -SDL_Joystick **SDL_joysticks = NULL; -static SDL_Joystick *default_joystick = NULL; - -int -SDL_JoystickInit(void) -{ - int arraylen; - int status; - - SDL_numjoysticks = 0; - status = SDL_SYS_JoystickInit(); - if (status >= 0) { - arraylen = (status + 1) * sizeof(*SDL_joysticks); - SDL_joysticks = (SDL_Joystick **) SDL_malloc(arraylen); - if (SDL_joysticks == NULL) { - SDL_numjoysticks = 0; - } else { - SDL_memset(SDL_joysticks, 0, arraylen); - SDL_numjoysticks = status; - } - status = 0; - } - default_joystick = NULL; - return (status); -} - -/* - * Count the number of joysticks attached to the system - */ -int -SDL_NumJoysticks(void) -{ - return SDL_numjoysticks; -} - -/* - * Get the implementation dependent name of a joystick - */ -const char * -SDL_JoystickName(int device_index) -{ - if ((device_index < 0) || (device_index >= SDL_numjoysticks)) { - SDL_SetError("There are %d joysticks available", SDL_numjoysticks); - return (NULL); - } - return (SDL_SYS_JoystickName(device_index)); -} - -/* - * Open a joystick for use - the index passed as an argument refers to - * the N'th joystick on the system. This index is the value which will - * identify this joystick in future joystick events. - * - * This function returns a joystick identifier, or NULL if an error occurred. - */ -SDL_Joystick * -SDL_JoystickOpen(int device_index) -{ - int i; - SDL_Joystick *joystick; - - if ((device_index < 0) || (device_index >= SDL_numjoysticks)) { - SDL_SetError("There are %d joysticks available", SDL_numjoysticks); - return (NULL); - } - - /* If the joystick is already open, return it */ - for (i = 0; SDL_joysticks[i]; ++i) { - if (device_index == SDL_joysticks[i]->index) { - joystick = SDL_joysticks[i]; - ++joystick->ref_count; - return (joystick); - } - } - - /* Create and initialize the joystick */ - joystick = (SDL_Joystick *) SDL_malloc((sizeof *joystick)); - if (joystick == NULL) { - SDL_OutOfMemory(); - return NULL; - } - - SDL_memset(joystick, 0, (sizeof *joystick)); - joystick->index = device_index; - if (SDL_SYS_JoystickOpen(joystick) < 0) { - SDL_free(joystick); - return NULL; - } - - if (joystick->naxes > 0) { - joystick->axes = (Sint16 *) SDL_malloc(joystick->naxes * sizeof(Sint16)); - } - if (joystick->nhats > 0) { - joystick->hats = (Uint8 *) SDL_malloc(joystick->nhats * sizeof(Uint8)); - } - if (joystick->nballs > 0) { - joystick->balls = (struct balldelta *) SDL_malloc(joystick->nballs * sizeof(*joystick->balls)); - } - if (joystick->nbuttons > 0) { - joystick->buttons = (Uint8 *) SDL_malloc(joystick->nbuttons * sizeof(Uint8)); - } - if (((joystick->naxes > 0) && !joystick->axes) - || ((joystick->nhats > 0) && !joystick->hats) - || ((joystick->nballs > 0) && !joystick->balls) - || ((joystick->nbuttons > 0) && !joystick->buttons)) { - SDL_OutOfMemory(); - SDL_JoystickClose(joystick); - return NULL; - } - if (joystick->axes) { - SDL_memset(joystick->axes, 0, joystick->naxes * sizeof(Sint16)); - } - if (joystick->hats) { - SDL_memset(joystick->hats, 0, joystick->nhats * sizeof(Uint8)); - } - if (joystick->balls) { - SDL_memset(joystick->balls, 0, - joystick->nballs * sizeof(*joystick->balls)); - } - if (joystick->buttons) { - SDL_memset(joystick->buttons, 0, joystick->nbuttons * sizeof(Uint8)); - } - - /* Add joystick to list */ - ++joystick->ref_count; - SDL_Lock_EventThread(); - for (i = 0; SDL_joysticks[i]; ++i) - /* Skip to next joystick */ ; - SDL_joysticks[i] = joystick; - SDL_Unlock_EventThread(); - - return (joystick); -} - -/* - * Checks to make sure the joystick is valid. - */ -int -SDL_PrivateJoystickValid(SDL_Joystick ** joystick) -{ - int valid; - - if (*joystick == NULL) { - *joystick = default_joystick; - } - if (*joystick == NULL) { - SDL_SetError("Joystick hasn't been opened yet"); - valid = 0; - } else { - valid = 1; - } - return valid; -} - -/* - * Get the device index of an opened joystick. - */ -int -SDL_JoystickIndex(SDL_Joystick * joystick) -{ - if (!SDL_PrivateJoystickValid(&joystick)) { - return (-1); - } - return (joystick->index); -} - -/* - * Get the number of multi-dimensional axis controls on a joystick - */ -int -SDL_JoystickNumAxes(SDL_Joystick * joystick) -{ - if (!SDL_PrivateJoystickValid(&joystick)) { - return (-1); - } - return (joystick->naxes); -} - -/* - * Get the number of hats on a joystick - */ -int -SDL_JoystickNumHats(SDL_Joystick * joystick) -{ - if (!SDL_PrivateJoystickValid(&joystick)) { - return (-1); - } - return (joystick->nhats); -} - -/* - * Get the number of trackballs on a joystick - */ -int -SDL_JoystickNumBalls(SDL_Joystick * joystick) -{ - if (!SDL_PrivateJoystickValid(&joystick)) { - return (-1); - } - return (joystick->nballs); -} - -/* - * Get the number of buttons on a joystick - */ -int -SDL_JoystickNumButtons(SDL_Joystick * joystick) -{ - if (!SDL_PrivateJoystickValid(&joystick)) { - return (-1); - } - return (joystick->nbuttons); -} - -/* - * Get the current state of an axis control on a joystick - */ -Sint16 -SDL_JoystickGetAxis(SDL_Joystick * joystick, int axis) -{ - Sint16 state; - - if (!SDL_PrivateJoystickValid(&joystick)) { - return (0); - } - if (axis < joystick->naxes) { - state = joystick->axes[axis]; - } else { - SDL_SetError("Joystick only has %d axes", joystick->naxes); - state = 0; - } - return (state); -} - -/* - * Get the current state of a hat on a joystick - */ -Uint8 -SDL_JoystickGetHat(SDL_Joystick * joystick, int hat) -{ - Uint8 state; - - if (!SDL_PrivateJoystickValid(&joystick)) { - return (0); - } - if (hat < joystick->nhats) { - state = joystick->hats[hat]; - } else { - SDL_SetError("Joystick only has %d hats", joystick->nhats); - state = 0; - } - return (state); -} - -/* - * Get the current state of a button on a joystick - */ -Uint8 -SDL_JoystickGetButton(SDL_Joystick * joystick, int button) -{ - Uint8 state; - - if (!SDL_PrivateJoystickValid(&joystick)) { - return (0); - } - if (button < joystick->nbuttons) { - state = joystick->buttons[button]; - } else { - SDL_SetError("Joystick only has %d buttons", joystick->nbuttons); - state = 0; - } - return (state); -} - -/* - * Close a joystick previously opened with SDL_JoystickOpen() - */ -void -SDL_JoystickClose(SDL_Joystick * joystick) -{ - int i; - - if (!SDL_PrivateJoystickValid(&joystick)) { - return; - } - - /* First decrement ref count */ - if (--joystick->ref_count > 0) { - return; - } - - /* Lock the event queue - prevent joystick polling */ - SDL_Lock_EventThread(); - - if (joystick == default_joystick) { - default_joystick = NULL; - } - SDL_SYS_JoystickClose(joystick); - - /* Remove joystick from list */ - for (i = 0; SDL_joysticks[i]; ++i) { - if (joystick == SDL_joysticks[i]) { - SDL_memmove(&SDL_joysticks[i], &SDL_joysticks[i + 1], - (SDL_numjoysticks - i) * sizeof(joystick)); - break; - } - } - - /* Let the event thread keep running */ - SDL_Unlock_EventThread(); - - /* Free the data associated with this joystick */ - if (joystick->axes) { - SDL_free(joystick->axes); - } - if (joystick->hats) { - SDL_free(joystick->hats); - } - if (joystick->balls) { - SDL_free(joystick->balls); - } - if (joystick->buttons) { - SDL_free(joystick->buttons); - } - SDL_free(joystick); -} - -void SDL_JoystickQuit(void) { - /* Stop the event polling */ - SDL_Lock_EventThread(); - SDL_numjoysticks = 0; - SDL_Unlock_EventThread(); - - /* Quit the joystick setup */ - SDL_SYS_JoystickQuit(); - if (SDL_joysticks) { - SDL_free(SDL_joysticks); - SDL_joysticks = NULL; - } -} - -/* These are global for SDL_sysjoystick.c and SDL_events.c */ - -int -SDL_PrivateJoystickAxis(SDL_Joystick * joystick, Uint8 axis, Sint16 value) -{ - int posted; - - /* Update internal joystick state */ - joystick->axes[axis] = value; - - /* Post the event, if desired */ - posted = 0; -#if !SDL_EVENTS_DISABLED - if (SDL_GetEventState(SDL_JOYAXISMOTION) == SDL_ENABLE) { - SDL_Event event; - event.type = SDL_JOYAXISMOTION; - event.jaxis.which = joystick->index; - event.jaxis.axis = axis; - event.jaxis.value = value; - //if ((SDL_EventOK == NULL) - // || (*SDL_EventOK) (SDL_EventOKParam, &event)) { - posted = 1; - SDL_PushEvent(&event); - //} - } -#endif /* !SDL_EVENTS_DISABLED */ - return (posted); -} - -int -SDL_PrivateJoystickHat(SDL_Joystick * joystick, Uint8 hat, Uint8 value) -{ - int posted; - - /* Update internal joystick state */ - joystick->hats[hat] = value; - - /* Post the event, if desired */ - posted = 0; -#if !SDL_EVENTS_DISABLED - if (SDL_GetEventState(SDL_JOYHATMOTION) == SDL_ENABLE) { - SDL_Event event; - event.jhat.type = SDL_JOYHATMOTION; - event.jhat.which = joystick->index; - event.jhat.hat = hat; - event.jhat.value = value; - //if ((SDL_EventOK == NULL) - // || (*SDL_EventOK) (SDL_EventOKParam, &event)) { - posted = 1; - SDL_PushEvent(&event); - //} - } -#endif /* !SDL_EVENTS_DISABLED */ - return (posted); -} - -int -SDL_PrivateJoystickBall(SDL_Joystick * joystick, Uint8 ball, - Sint16 xrel, Sint16 yrel) -{ - int posted; - - /* Update internal mouse state */ - joystick->balls[ball].dx += xrel; - joystick->balls[ball].dy += yrel; - - /* Post the event, if desired */ - posted = 0; -#if !SDL_EVENTS_DISABLED - if (SDL_GetEventState(SDL_JOYBALLMOTION) == SDL_ENABLE) { - SDL_Event event; - event.jball.type = SDL_JOYBALLMOTION; - event.jball.which = joystick->index; - event.jball.ball = ball; - event.jball.xrel = xrel; - event.jball.yrel = yrel; - //if ((SDL_EventOK == NULL) - // || (*SDL_EventOK) (SDL_EventOKParam, &event)) { - posted = 1; - SDL_PushEvent(&event); - //} - } -#endif /* !SDL_EVENTS_DISABLED */ - return (posted); -} - -int -SDL_PrivateJoystickButton(SDL_Joystick * joystick, Uint8 button, Uint8 state) -{ - int posted; -#if !SDL_EVENTS_DISABLED - SDL_Event event; - - switch (state) { - case SDL_PRESSED: - event.type = SDL_JOYBUTTONDOWN; - break; - case SDL_RELEASED: - event.type = SDL_JOYBUTTONUP; - break; - default: - /* Invalid state -- bail */ - return (0); - } -#endif /* !SDL_EVENTS_DISABLED */ - - /* Update internal joystick state */ - joystick->buttons[button] = state; - - /* Post the event, if desired */ - posted = 0; -#if !SDL_EVENTS_DISABLED - if (SDL_GetEventState(event.type) == SDL_ENABLE) { - event.jbutton.which = joystick->index; - event.jbutton.button = button; - event.jbutton.state = state; - //if ((SDL_EventOK == NULL) - // || (*SDL_EventOK) (SDL_EventOKParam, &event)) { - posted = 1; - SDL_PushEvent(&event); - //} - } -#endif /* !SDL_EVENTS_DISABLED */ - return (posted); -} - -void -SDL_JoystickUpdate(void) -{ - int i; - - for (i = 0; SDL_joysticks[i]; ++i) { - SDL_SYS_JoystickUpdate(SDL_joysticks[i]); - } -} - -int -SDL_JoystickEventState(int state) -{ -#if SDL_EVENTS_DISABLED - return SDL_IGNORE; -#else - const Uint32 event_list[] = { - SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION, - SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP, - }; - unsigned int i; - - switch (state) { - case SDL_QUERY: - state = SDL_IGNORE; - for (i = 0; i < SDL_arraysize(event_list); ++i) { - state = SDL_EventState(event_list[i], SDL_QUERY); - if (state == SDL_ENABLE) { - break; - } - } - break; - default: - for (i = 0; i < SDL_arraysize(event_list); ++i) { - SDL_EventState(event_list[i], state); - } - break; - } - return (state); -#endif /* SDL_EVENTS_DISABLED */ -} diff --git a/libraries/sdl-mini/src/joystick/SDL_sysjoystick.h b/libraries/sdl-mini/src/joystick/SDL_sysjoystick.h index e9e97bf..ddcde2a 100644 --- a/libraries/sdl-mini/src/joystick/SDL_sysjoystick.h +++ b/libraries/sdl-mini/src/joystick/SDL_sysjoystick.h @@ -37,6 +37,8 @@ struct _SDL_Joystick struct joystick_hwdata *hwdata; /* Driver dependent information */ int ref_count; + + int paused; }; /* Function to scan the system for joysticks. @@ -67,4 +69,6 @@ extern void SDL_SYS_JoystickUpdate(SDL_Joystick * joystick); extern void SDL_SYS_JoystickClose(SDL_Joystick * joystick); /* Function to perform any system-specific joystick related cleanup */ -extern void SDL_SYS_JoystickQuit(void); \ No newline at end of file +extern void SDL_SYS_JoystickQuit(void); + +extern void SDL_SYS_JoystickSetActive(SDL_Joystick * joystick); \ No newline at end of file diff --git a/libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.h b/libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.h new file mode 100644 index 0000000..b775816 --- /dev/null +++ b/libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.h @@ -0,0 +1,38 @@ +// Created by Emufr3ak on 17.11.2014. +// +// Changed by Emufr3ak on +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Sofftware Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +#import +#import + +@interface MFIControllerReaderView : UIView + @property (readonly) BOOL buttonapressed; + @property (readonly) BOOL buttonbpressed; + @property (readonly) BOOL buttonxpressed; + @property (readonly) BOOL buttonypressed; + + @property (readonly) BOOL buttonl1pressed; + @property (readonly) BOOL buttonl2pressed; + @property (readonly) BOOL buttonr1pressed; + @property (readonly) BOOL buttonr2pressed; + + @property (readonly) int paused; + +-(void)moveMouse:(NSTimer *)timer; + +@end diff --git a/libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.mm b/libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.mm new file mode 100644 index 0000000..a0f2ce6 --- /dev/null +++ b/libraries/sdl-mini/src/joystick/iOS/MFIControllerReaderView.mm @@ -0,0 +1,268 @@ +// Created by Emufr3ak on 29.05.14. +// Changed By Emufr3ak on 21.08.16 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +//along with this program; if not, write to the Free Software +//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +#import "MFIControllerReaderView.h" +#import +#import "debug.h" +#import "touchstick.h" +#import "JoypadKey.h" +#import "Settings.h" +#import "SDL_events.h" +#import "MultiPeerConnectivityController.h" +extern "C" { + #import "SDL_events.h" + #import "SDL_mouse_c.h" +} + +#import + +#define MOUSESPEED 3.00 + +#define DIGSTICK 1 +#define LANSTICK 2 +#define RANSTICK 3 + +static NSString *const kdigStick = @"digStick"; +static NSString *const klanalogStick = @"lanalogStick"; +static NSString *const kranalogStick = @"ranalogStick"; + + +@implementation MFIControllerReaderView { + int _button[9]; + TouchStickDPadState _hat_statelast; + TouchStickDPadState _hat_state; + TouchStickDPadState _mlastHatstate; + TouchStickDPadState _mHatstate; + + MultiPeerConnectivityController *mpcController; + int _buttontoreleasehorizontal; + int _buttontoreleasevertical; + int _mrelvertButton; + int _mrelhorButton; + int _devCount; + Settings *_settings; + int _mouseX; + int _mouseY; + NSTimer *_mouseTimer; +} + + + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + _devCount = 0; + _hat_state = DPadCenter; + _buttonapressed = false; + _hat_statelast = DPadCenter; + mpcController = [MultiPeerConnectivityController getinstance]; + + for(int i=0;i<=7;i++) + _button[i] = 0; + + [self initNotifications]; + //[self initControllers]; + + _settings = [[Settings alloc] init]; + + if(_settings.LStickAnalogIsMouse || _settings.RStickAnalogIsMouse) { + if (_mouseTimer) { + [_mouseTimer release]; + } + _mouseTimer = [[NSTimer scheduledTimerWithTimeInterval:0.020 target:self + selector:@selector(moveMouse:) userInfo:nil repeats:YES] retain]; + _mouseTimer.tolerance = 0.0020; + } + + return self; + +} + +- (void)initNotifications { + + [[EAAccessoryManager sharedAccessoryManager] registerForLocalNotifications]; + [GCController startWirelessControllerDiscoveryWithCompletionHandler:nil]; + + /*[[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(deviceDisconnected:) + name:EAAccessoryDidDisconnectNotification + object:nil];*/ + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(controllerDiscovered:) + name:GCControllerDidConnectNotification + object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(controllerDisconnected:) + name:GCControllerDidDisconnectNotification + object:nil]; +} + +-(void)moveMouse:(NSTimer *)timer { + SDL_SendMouseMotion(NULL, SDL_MOTIONRELATIVE, _mouseX, _mouseY); +} + +- (void)handleinputbuttons:(int)buttonid forDeviceid:(NSString *)devID +{ + if((buttonid == BTN_L2 && _settings.useL2forMouseButton == true) || + (buttonid == BTN_R2 && _settings.useR2forRightMouseButton == true)) + [self handleminputbuttons:(int)buttonid]; + else + _button[buttonid] = [mpcController handleinputbuttons:buttonid buttonstate:_button[buttonid] deviceid:devID]; +} + +- (void)handleminputbuttons:(int)buttonid { + _button[buttonid] = !_button[buttonid]; + + int mbtnID = buttonid == BTN_L2 ? SDL_BUTTON_LEFT : SDL_BUTTON_RIGHT; + + if(_button[buttonid]) SDL_SendMouseButton(NULL, SDL_PRESSED, mbtnID); + else SDL_SendMouseButton(NULL, SDL_RELEASED, mbtnID); +} + +- (void) handlehatstate:(float)xAxis yAxis:(float)yAxis forDeviceid:(NSString *)devID forStick:(int)stickType; { + + + + if((stickType == LANSTICK && _settings.LStickAnalogIsMouse) || + (stickType == RANSTICK && _settings.RStickAnalogIsMouse)) { + [self handlemhatstate:xAxis yAxis:yAxis]; + } + else { + if(xAxis < 0) { + if(yAxis > 0) [self handlejhatstate:DPadUpLeft forDeviceid:devID]; + else if(yAxis < 0) [self handlejhatstate:DPadDownLeft forDeviceid:devID]; + else [self handlejhatstate:DPadLeft forDeviceid:devID ]; + } + else if(xAxis > 0) + { + if(yAxis > 0) [self handlejhatstate:DPadUpRight forDeviceid:devID]; + else if(yAxis < 0) [self handlejhatstate:DPadDownRight forDeviceid:devID]; + else [self handlejhatstate:DPadRight forDeviceid:devID]; + } + else if(yAxis > 0) [self handlejhatstate:DPadUp forDeviceid:devID]; + else if(yAxis < 0) [self handlejhatstate:DPadDown forDeviceid:devID]; + } +} + +- (void) handlejhatstate:(TouchStickDPadState)hatState forDeviceid:(NSString *)devID { + + _hat_state = hatState; + + if (_hat_state != _hat_statelast) { + _hat_statelast = _hat_state; + + int buttonvertical = [mpcController dpadstatetojoypadkey:@"vertical" hatstate:_hat_state]; + int buttonhorizontal = [mpcController dpadstatetojoypadkey:@"horizontal" hatstate: _hat_state]; + + [mpcController handleinputdirections:_hat_state buttontoreleasevertical:_buttontoreleasevertical buttontoreleasehorizontal: _buttontoreleasehorizontal deviceid:devID]; + + _buttontoreleasehorizontal = buttonhorizontal; + _buttontoreleasevertical = buttonvertical; + } + +} + +- (void) handlemhatstate:(float)xAxis yAxis:(float)yAxis { + + _mouseX = (int) (xAxis * MOUSESPEED); + _mouseY = (int) (yAxis * MOUSESPEED) * -1; + +} + +- (void)controllerDisconnected:(NSNotification *) btDevice { + + int devCount = [[GCController controllers] count]; + if(devCount >= _devCount) return; + + NSString *devID = [NSString stringWithFormat:@"%p", btDevice]; + [mpcController controllerDisconnected:devID]; +} + +- (void)controllerDiscovered:(NSNotification *)connectedNotification { + + int devCount = [[GCController controllers] count]; + _devCount = devCount; + + GCController *controller = GCController.controllers[_devCount-1]; + NSString *devID = [NSString stringWithFormat:@"%p", controller]; + //NSString *devID = @"test"; + + controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement + *element) + { + + if(gamepad.buttonA.isPressed != _button[BTN_A]) + [self handleinputbuttons: BTN_A forDeviceid:devID]; + else if(gamepad.buttonB.isPressed != _button[BTN_B]) + [self handleinputbuttons: BTN_B forDeviceid:devID]; + else if(gamepad.buttonX.isPressed!= _button[BTN_X]) + [self handleinputbuttons: BTN_X forDeviceid:devID]; + else if(gamepad.buttonY.isPressed != _button[BTN_Y]) + [self handleinputbuttons: BTN_Y forDeviceid:devID]; + else if(gamepad.rightShoulder.isPressed != _button[BTN_R1]) + [self handleinputbuttons: BTN_R1 forDeviceid:devID]; + else if(gamepad.leftShoulder.isPressed != _button[BTN_L1]) + [self handleinputbuttons: BTN_L1 forDeviceid:devID]; + else if(gamepad.controller.extendedGamepad.rightTrigger.isPressed != _button[BTN_R2]) + [self handleinputbuttons: BTN_R2 forDeviceid:devID]; + else if(gamepad.controller.extendedGamepad.leftTrigger.isPressed != _button[BTN_L2]) + [self handleinputbuttons: BTN_L2 forDeviceid:devID]; + + float dxValue = gamepad.dpad.xAxis.value; + float dyValue = gamepad.dpad.yAxis.value; + float alxValue = gamepad.controller.extendedGamepad.leftThumbstick.xAxis.value; + float alyValue = gamepad.controller.extendedGamepad.leftThumbstick.yAxis.value; + float arxValue = gamepad.controller.extendedGamepad.rightThumbstick.xAxis.value; + float aryValue = gamepad.controller.extendedGamepad.rightThumbstick.yAxis.value; + + if(dxValue != 0 || dyValue != 0) + [self handlehatstate:dxValue yAxis:dyValue forDeviceid:devID forStick:DIGSTICK]; + else if(alxValue != 0 || alyValue != 0) + [self handlehatstate:alxValue yAxis:alyValue forDeviceid:devID forStick:LANSTICK]; + else if(arxValue != 0 || aryValue != 0) + [self handlehatstate:arxValue yAxis:aryValue forDeviceid:devID forStick:RANSTICK]; + else { + [self handlejhatstate:DPadCenter forDeviceid:devID]; + [self handlemhatstate:0.00 yAxis:0.00]; + } + }; + + GCControllerDirectionPad *dpad = controller.gamepad.dpad; + dpad.valueChangedHandler = ^ (GCControllerDirectionPad *directionpad, + float xValue, float yValue) { + NSLog(@"Changed xValue on dPad = %f yValue = %f" ,xValue, yValue); + }; + + dpad.xAxis.valueChangedHandler = ^(GCControllerAxisInput *xAxis,float value) { + NSLog(@"X Axis changed value %f",value); + }; + +} + +-(void)dealloc +{ + if (_mouseTimer) { + [_mouseTimer release]; + } + + [super dealloc]; +} + +@end + diff --git a/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.h b/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.h index 26529fc..01f19c9 100644 --- a/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.h +++ b/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.h @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2010 Sam Lantinga @@ -43,3 +46,5 @@ @end /* *INDENT-ON* */ + +#pragma clang diagnostic pop diff --git a/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.m b/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.m index 2b221db..7d6a458 100644 --- a/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.m +++ b/libraries/sdl-mini/src/joystick/iOS/SDLUIAccelerationDelegate.m @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2009 Sam Lantinga @@ -140,3 +143,5 @@ -(void)setHasNewData:(BOOL)value { } @end + +#pragma clang diagnostic pop diff --git a/libraries/sdl-mini/src/joystick/iOS/SDL_sysjoystick.m b/libraries/sdl-mini/src/joystick/iOS/SDL_sysjoystick.m deleted file mode 100644 index 6cc25f8..0000000 --- a/libraries/sdl-mini/src/joystick/iOS/SDL_sysjoystick.m +++ /dev/null @@ -1,257 +0,0 @@ -// -// SDL_sysjoystick.m -// iAmiga -// -// Created by Stuart Carnie on 6/5/11. -// Copyright 2011 Manomio LLC. All rights reserved. -// - -#include "SDL_events.h" -#include "SDL_joystick.h" -#include "SDL_sysjoystick.h" -#include "SDL_joystick_c.h" -#include "SDL_compat.h" -#import "SDLUIAccelerationDelegate.h" -#import "iControlPadReaderView.h" -#import "iCadeReaderView.h" -#import "ButtonStates.h" -#import "SDL_NSObject+Blocks.h" - -extern UIView *GetSharedOGLDisplayView(); - -#define kTouchStick 0 -#define kAccelerometer 1 -#define kiControlPad 2 -#define kiCade 3 - -const char *accelerometerName = "iPhone accelerometer"; -const char *iControlPadName = "iControlPad"; -const char *iCadeName = "iCADE"; - -typedef struct joystick_hwdata { - UIView *view; -} joystick_hwdata; - -inline -static int icp_getState(int button); - -int SDL_SYS_JoystickInit(void) { - return 4; -} - -/* Function to get the device-dependent name of a joystick */ -const char *SDL_SYS_JoystickName(int index) { - switch (index) { - case kTouchStick: - return "iPhone touch"; - - case kAccelerometer: - return accelerometerName; - - case kiControlPad: - return iControlPadName; - - case kiCade: - return iCadeName; - - default: - SDL_SetError("No joystick available with that index"); - return NULL; - } -} - -/* Function to open a joystick for use. - The joystick to open is specified by the index field of the joystick. - This should fill the nbuttons and naxes fields of the joystick structure. - It returns 0, or -1 if there is an error. - */ -int -SDL_SYS_JoystickOpen(SDL_Joystick * joystick) -{ - if (joystick->index == kiControlPad) { - joystick->naxes = 0; - joystick->nhats = 1; - joystick->nballs = 0; - joystick->nbuttons = 8; - joystick->name = iControlPadName; - joystick->hwdata = (joystick_hwdata *)SDL_malloc(sizeof(joystick_hwdata)); - UIView *view = [[iControlPadReaderView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; - SDL_Surface *surface = SDL_GetVideoSurface(); - UIView *display = (UIView *)surface->userdata; - [display performBlock:^(void) { - // main thread - [display addSubview:view]; - [view becomeFirstResponder]; - - } afterDelay:0.0f]; - joystick->hwdata->view = view; - } else if (joystick->index == kiCade) { - joystick->naxes = 0; - joystick->nhats = 1; - joystick->nballs = 0; - joystick->nbuttons = 8; - joystick->name = iCadeName; - joystick->hwdata = (joystick_hwdata *)SDL_malloc(sizeof(joystick_hwdata)); - iCadeReaderView *view = [[iCadeReaderView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; - SDL_Surface *surface = SDL_GetVideoSurface(); - UIView *display = (UIView *)surface->userdata; - [display performBlock:^(void) { - // main thread - [display addSubview:view]; - view.active = YES; - } afterDelay:0.0f]; - joystick->hwdata->view = view; - } else if (joystick->index == kAccelerometer) { - joystick->naxes = 3; - joystick->nhats = 0; - joystick->nballs = 0; - joystick->nbuttons = 0; - joystick->name = accelerometerName; - [[SDLUIAccelerationDelegate sharedDelegate] startup]; - } - else { - SDL_SetError("No joystick available with that index"); - return (-1); - } - - return 0; -} - -/* Function to update the state of a joystick - called as a device poll. - * This function shouldn't update the joystick structure directly, - * but instead should call SDL_PrivateJoystick*() to deliver events - * and update joystick device state. - */ -void -SDL_SYS_JoystickUpdate(SDL_Joystick * joystick) -{ - if (joystick->index == kAccelerometer) { - Sint16 orientation[3]; - - if ([[SDLUIAccelerationDelegate sharedDelegate] hasNewData]) { - - [[SDLUIAccelerationDelegate sharedDelegate] getLastOrientation: orientation]; - [[SDLUIAccelerationDelegate sharedDelegate] setHasNewData: NO]; - - SDL_PrivateJoystickAxis(joystick, 0, orientation[0]); - SDL_PrivateJoystickAxis(joystick, 1, orientation[1]); - SDL_PrivateJoystickAxis(joystick, 2, orientation[2]); - - } - } else if (joystick->index == kiControlPad) { - - // buttons - for(int i = ICP_BUTTON_BEGIN; i <= ICP_BUTTON_END; i++) { - SDL_PrivateJoystickButton(joystick, i-ICP_BUTTON_BEGIN, icp_getState(i)); - } - - // hat - int hat_value = SDL_HAT_CENTERED; - hat_value |= icp_getState(ICP_BUTTON_UP) ? SDL_HAT_UP : 0; - hat_value |= icp_getState(ICP_BUTTON_RIGHT) ? SDL_HAT_RIGHT : 0; - hat_value |= icp_getState(ICP_BUTTON_LEFT) ? SDL_HAT_LEFT : 0; - hat_value |= icp_getState(ICP_BUTTON_DOWN) ? SDL_HAT_DOWN : 0; - SDL_PrivateJoystickHat(joystick, 0, hat_value); - } else if (joystick->index == kiCade) { - - // buttons - iCadeReaderView *view = (iCadeReaderView *)joystick->hwdata->view; - iCadeState state = view.iCadeState; - - for(int i=iCadeButtonFirst, btn=0; i <= iCadeButtonLast; i <<= 1, btn++) { - Uint8 pr = ((i & state) != 0) ? SDL_PRESSED : SDL_RELEASED; - - if (joystick->buttons[btn] == pr) continue; // hasn't changed state, so don't pump and event - SDL_PrivateJoystickButton(joystick, btn, pr); - } - - Uint8 hat_state = (state & 0x0f); - if (joystick->hats[0] != hat_state) { - SDL_PrivateJoystickHat(joystick, 0, hat_state); - } - } -} - -/* Function to close a joystick after use */ -void -SDL_SYS_JoystickClose(SDL_Joystick * joystick) -{ - if (joystick->index == kAccelerometer && [[SDLUIAccelerationDelegate sharedDelegate] isRunning]) { - [[SDLUIAccelerationDelegate sharedDelegate] shutdown]; - } else if (joystick->index == kiControlPad) { - [joystick->hwdata->view removeFromSuperview]; - [joystick->hwdata->view release]; - SDL_free(joystick->hwdata); - } else if (joystick->index == kiCade) { - [joystick->hwdata->view removeFromSuperview]; - [joystick->hwdata->view release]; - SDL_free(joystick->hwdata); - } else { - SDL_SetError("No joystick open with that index"); - } - - return; -} - -/* Function to perform any system-specific joystick related cleanup */ -void -SDL_SYS_JoystickQuit(void) { - return; -} - -// iControlPad -static int LEFT_BYTE[] = {ICP_BUTTON_UP, ICP_BUTTON_RIGHT, ICP_BUTTON_LEFT, ICP_BUTTON_DOWN, ICP_BUTTON_L, ICP_BUTTON_SELECT}; -static int RIGHT_BYTE[] = {ICP_BUTTON_START, ICP_BUTTON_Y, ICP_BUTTON_A, ICP_BUTTON_X, ICP_BUTTON_B, ICP_BUTTON_R}; - -static char buttons[ICP_MAX_BUTTON]; -static char buffer[256]; -static int pos = 0; - -inline -static int icp_getState(int button) { - return buttons[button]; -} - -inline -static void setState(int button, int value) { - buttons[button] = value; -} - -void icp_handle(char c) { - char left; - char right; - - buffer[pos++] = c; - - while(pos > 2 && buffer[0] != 'm') - { - for(int i=1; i 2 && buffer[0] == 'm') - { - left = buffer[1] - 32; - right = buffer[2] - 32; - - for(int i=0; i<6; i++) - { - setState(LEFT_BYTE[i], (left & 0x01)); - left >>= 1; - } - - for(int i=0; i<6; i++) - { - setState(RIGHT_BYTE[i], (right & 0x01)); - right >>= 1; - } - - for(int i=3; i 10) NSLog(@"Possible error - %i characters queued!", pos); - if(pos >= 256) pos = 0; -} diff --git a/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.h b/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.h index 2f39a3d..a97535b 100644 --- a/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.h +++ b/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.h @@ -22,6 +22,7 @@ #import #import "iCadeState.h" +#import /* UP ON,OFF = w,e diff --git a/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.m b/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.m deleted file mode 100644 index 4b6f276..0000000 --- a/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.m +++ /dev/null @@ -1,149 +0,0 @@ -/* - Copyright (C) 2011 by Stuart Carnie - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - -#import "iCadeReaderView.h" - -static const char *ON_STATES = "wdxayhujikol"; -static const char *OFF_STATES = "eczqtrfnmpgv"; - -@interface iCadeReaderView() - -- (void)didEnterBackground; -- (void)didBecomeActive; - -@end - -@implementation iCadeReaderView - -@synthesize iCadeState=_iCadeState, delegate=_delegate, active; - -- (id)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - inputView = [[UIView alloc] initWithFrame:CGRectZero]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; - - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; - [super dealloc]; -} - -- (void)didEnterBackground { - if (self.active) - [self resignFirstResponder]; -} - -- (void)didBecomeActive { - if (self.active) - [self becomeFirstResponder]; -} - -- (BOOL)canBecomeFirstResponder { - return YES; -} - -- (void)setActive:(BOOL)value { - if (active == value) return; - - active = value; - if (active) { - [self becomeFirstResponder]; - } else { - [self resignFirstResponder]; - } -} - -//- (void) drawRect:(CGRect)rect -//{ -// This space intentionally left blank. Woot. -//} - -- (UIView*) inputView { - return inputView; -} - -- (void)setDelegate:(id)delegate { - _delegate = delegate; - if (!_delegate) return; - - _delegateFlags.stateChanged = [_delegate respondsToSelector:@selector(stateChanged:)]; - _delegateFlags.buttonDown = [_delegate respondsToSelector:@selector(buttonDown:)]; - _delegateFlags.buttonUp = [_delegate respondsToSelector:@selector(buttonUp:)]; -} - -#pragma mark - -#pragma mark UIKeyInput Protocol Methods - -- (BOOL)hasText { - return NO; -} - -- (void)insertText:(NSString *)text { - - char ch = [text characterAtIndex:0]; - if (ch >= 65 && ch < 91) - ch+=32; // lowercase - - char *p = strchr(ON_STATES, ch); - bool stateChanged = false; - if (p) { - int index = p-ON_STATES; - _iCadeState |= (1 << index); - stateChanged = true; - if (_delegateFlags.buttonDown) { - [_delegate buttonDown:(1 << index)]; - } - } else { - p = strchr(OFF_STATES, ch); - if (p) { - int index = p-OFF_STATES; - _iCadeState &= ~(1 << index); - stateChanged = true; - if (_delegateFlags.buttonUp) { - [_delegate buttonUp:(1 << index)]; - } - } - } - - if (stateChanged && _delegateFlags.stateChanged) { - [_delegate stateChanged:_iCadeState]; - } - - static int cycleResponder = 0; - if (++cycleResponder > 20) { - // necessary to clear a buffer that accumulates internally - cycleResponder = 0; - [self resignFirstResponder]; - [self becomeFirstResponder]; - } -} - -- (void)deleteBackward { - // This space intentionally left blank to complete protocol. Woot. -} - -@end diff --git a/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.mm b/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.mm new file mode 100644 index 0000000..01fad4f --- /dev/null +++ b/libraries/sdl-mini/src/joystick/iOS/iCadeReaderView.mm @@ -0,0 +1,277 @@ +/* + Copyright (C) 2011 by Stuart Carnie + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + */ + +#import "iCadeReaderView.h" +#import "JoypadKey.h" +#import "MultiPeerConnectivityController.h" + +static const char *ON_STATES = "wdxayhujikol"; +static const char *OFF_STATES = "eczqtrfnmpgv"; + +@interface iCadeReaderView() + +- (void)didEnterBackground; +- (void)didBecomeActive; + +@end + +@implementation iCadeReaderView { + int _button[9]; + MultiPeerConnectivityController *_mpcController; + Uint8 _controllerhatstate; + int _buttontoreleasehorizontal; + int _buttontoreleasevertical; +} + +@synthesize iCadeState=_iCadeState, delegate=_delegate, active; + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + inputView = [[UIView alloc] initWithFrame:CGRectZero]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; + + for(int i=0;i<=8;i++) + _button[i] = 0; + + _mpcController = [MultiPeerConnectivityController getinstance]; + + return self; +} + +- (void)disconnectController:(NSNotification *)cNotification { +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil]; + [super dealloc]; +} + +- (void)didEnterBackground { + if (self.active) + [self resignFirstResponder]; +} + +- (void)didBecomeActive { + if (self.active) + [self becomeFirstResponder]; +} + +- (BOOL)canBecomeFirstResponder { + return YES; +} + +- (void)setActive:(BOOL)value { + if (active == value) return; + + active = value; + if (active) { + [self becomeFirstResponder]; + } else { + [self resignFirstResponder]; + } +} + +//- (void) drawRect:(CGRect)rect +//{ +// This space intentionally left blank. Woot. +//} + +- (UIView*) inputView { + return inputView; +} + +- (void)setDelegate:(id)delegate { + _delegate = delegate; + if (!_delegate) return; + + _delegateFlags.stateChanged = [_delegate respondsToSelector:@selector(stateChanged:)]; + _delegateFlags.buttonDown = [_delegate respondsToSelector:@selector(buttonDown:)]; + _delegateFlags.buttonUp = [_delegate respondsToSelector:@selector(buttonUp:)]; +} + +#pragma mark - +#pragma mark UIKeyInput Protocol Methods + +- (BOOL)hasText { + return NO; +} + +- (void)handleinputbuttons { + + for(int i=iCadeButtonFirst, btn=0; i <= iCadeButtonLast; i <<= 1, btn++) { + + int pr = ((i & _iCadeState) != 0) ? TRUE : FALSE; + + if (_button[btn] != pr) + { + int btn_pressed; + + switch (btn) { + case 0: + btn_pressed = BTN_X; + break; + + case 1: + btn_pressed = BTN_A; + break; + + case 2: + btn_pressed = BTN_Y; + break; + + case 3: + btn_pressed = BTN_B; + break; + + case 4: + btn_pressed = BTN_L1; + break; + + case 5: + btn_pressed = BTN_R1; + break; + + case 6: + btn_pressed = BTN_L2; + break; + + case 7: + btn_pressed = BTN_R2; + break; + + default: + break; + } + + _button[btn] = [_mpcController handleinputbuttons:btn_pressed buttonstate:_button[btn] deviceid:kiCadePad]; + _button[btn] = pr; + + } + + Uint8 hat_state = (_iCadeState & 0x0f); + if (_controllerhatstate != hat_state) { + + TouchStickDPadState tState = [self getDpadStateFromHatState:hat_state]; + + int buttonvertical = [_mpcController dpadstatetojoypadkey:@"vertical" hatstate:tState]; + int buttonhorizontal = [_mpcController dpadstatetojoypadkey:@"horizontal" hatstate: tState]; + + [_mpcController handleinputdirections:tState buttontoreleasevertical:_buttontoreleasevertical buttontoreleasehorizontal:_buttontoreleasehorizontal deviceid:kiCadePad]; + + _controllerhatstate = hat_state; + _buttontoreleasevertical = buttonvertical; + _buttontoreleasehorizontal = buttonhorizontal; + } + + } +} + +- (TouchStickDPadState)getDpadStateFromHatState:(int)hat_state +{ + bool uFlag = !(hat_state & 0x01) == false ? true : false; + bool rFlag = !(hat_state & 0x02) == false ? true : false; + bool dFlag = !(hat_state & 0x04) == false ? true : false; + bool lFlag = !(hat_state & 0x08) == false ? true : false; + + if(uFlag) + { + if(rFlag) return DPadUpRight; + else if(lFlag) return DPadUpLeft; + else return DPadUp; + } + else if(dFlag) + { + if(rFlag) return DPadDownRight; + else if(lFlag) return DPadDownLeft; + else return DPadDown; + } + else if(rFlag) return DPadRight; + else if(lFlag) return DPadLeft; + + return DPadCenter; +} + +- (void)insertText:(NSString *)text { + + char ch = [text characterAtIndex:0]; + if (ch >= 65 && ch < 91) + ch+=32; // lowercase + + int tiState = (int) _iCadeState; + + char *p = strchr(ON_STATES, ch); + bool stateChanged = false; + if (p) { + int index = p-ON_STATES; + tiState |= (1 << index); + _iCadeState = (iCadeState)tiState; + stateChanged = true; + if (_delegateFlags.buttonDown) { + [_delegate buttonDown:_iCadeState]; + } + + [self handleinputbuttons]; + } else { + p = strchr(OFF_STATES, ch); + if (p) { + int index = p-OFF_STATES; + tiState &= ~(1 << index); + _iCadeState = (iCadeState)tiState; + stateChanged = true; + if (_delegateFlags.buttonUp) { + [_delegate buttonUp:_iCadeState]; + } + + [self handleinputbuttons]; + } + } + + if (stateChanged && _delegateFlags.stateChanged) { + [_delegate stateChanged:_iCadeState]; + } + + static int cycleResponder = 0; + if (++cycleResponder > 20) { + // necessary to clear a buffer that accumulates internally + cycleResponder = 0; + [self resignFirstResponder]; + [self becomeFirstResponder]; + } +} + +- (void)deleteBackward { + // This space intentionally left blank to complete protocol. Woot. +} + +static void HardwareKeyboardStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) +{ + NSLog(@"Darwin notification NAME = %@",name); + + NSNotificationCenter *notCenter = [NSNotificationCenter defaultCenter]; + + [notCenter postNotificationName:@"HardwareKeyboardStatusChanged" object:(__bridge id)object userInfo:(__bridge id)userInfo]; +} +@end diff --git a/libraries/sdl-mini/src/joystick/iOS/iControlPadReaderView.h b/libraries/sdl-mini/src/joystick/iOS/iControlPadReaderView.h deleted file mode 100644 index e51d7a5..0000000 --- a/libraries/sdl-mini/src/joystick/iOS/iControlPadReaderView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ButtonStates.m -// TextEditing -// -// Created by Infinite Sands on 3/25/11. -// - -#import - -@interface iControlPadReaderView : UIView -{ - UIView *inputView; -} - -@end \ No newline at end of file diff --git a/libraries/sdl-mini/src/joystick/iOS/iControlPadReaderView.m b/libraries/sdl-mini/src/joystick/iOS/iControlPadReaderView.m deleted file mode 100644 index 2fb49ad..0000000 --- a/libraries/sdl-mini/src/joystick/iOS/iControlPadReaderView.m +++ /dev/null @@ -1,101 +0,0 @@ -// -// ButtonStates.m -// TextEditing -// -// Created by Infinite Sands on 3/25/11. -// - -#import "iControlPadReaderView.h" -#import "ButtonStates.h" - -@implementation iControlPadReaderView - -- (id)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - inputView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; - - return self; -} - -- (BOOL)canBecomeFirstResponder -{ - return YES; -} - -// FIX ME: Is this necessary? --(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event -{ - [self becomeFirstResponder]; -} - -//- (void) drawRect:(CGRect)rect -//{ - // This space intentionally left blank. Woot. -//} - -- (UIView*) inputView -{ - return inputView; -} - -#pragma mark - Keyboard stuff - -- (UITextAutocorrectionType)autocorrectionType { - return UITextAutocorrectionTypeNo; -} - -- (UITextAutocapitalizationType)autocapitalizationType { - return UITextAutocapitalizationTypeNone; -} - -- (UIKeyboardType)keyboardType { - return UIKeyboardTypeDefault; -} - -- (UIKeyboardAppearance)keyboardAppearance { - return UIKeyboardAppearanceDefault; -} - -- (UIReturnKeyType)returnKeyType { - return UIReturnKeyDone; -} - -- (BOOL)isContinuousSpellCheckingEnabled { - return NO; -} - -#pragma mark - -#pragma mark UIKeyInput Protocol Methods - -- (BOOL)hasText { - return NO; -} - -extern void icp_handle(char c); - -- (void)insertText:(NSString *)text { - for(int i=0; i<[text length]; i++) - { - icp_handle([text characterAtIndex:i]); - } - - static int cycleResponder = 0; - if (++cycleResponder > 20) { - // necessary to clear a buffer that accumulates internally - cycleResponder = 0; - [self resignFirstResponder]; - [self becomeFirstResponder]; - } -} - -- (void)deleteBackward { - // This space intentionally left blank to complete protocol. Woot. -} - -/* -- (BOOL)respondsToSelector:(SEL)aSelector { - return [super respondsToSelector:aSelector]; -} */ - -@end \ No newline at end of file diff --git a/libraries/sdl-mini/src/joystick/od-joy.mm b/libraries/sdl-mini/src/joystick/od-joy.mm new file mode 100644 index 0000000..2b21c77 --- /dev/null +++ b/libraries/sdl-mini/src/joystick/od-joy.mm @@ -0,0 +1,105 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch" + +/* + * UAE - The Un*x Amiga Emulator + * + * Joystick emulation for Linux and BSD. They share too much code to + * split this file. + * + * Copyright 1997 Bernd Schmidt + * Copyright 1998 Krister Walfridsson + */ +// Changed by Emufr3ak on 17.11.2014 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + + +#include "sysconfig.h" +#include "sysdeps.h" + +#include "uae.h" +#include "joystick.h" +#include "touchstick.h" + +#include "vkbd.h" + +#import + +int nr_joysticks; +int joystickselected; + +CJoyStick g_touchStick; + +void read_joystick(int nr, unsigned int *dir, int *button) +{ +#ifndef MAX_AUTOEVENTS + int left = 0, right = 0, top = 0, bot = 0; + + nr = !nr; + + *dir = 0; + *button = 0; + + TouchStickDPadState dpadstate = nr == 0 ? g_touchStick.dPadStateP0() : g_touchStick.dPadStateP1(); + + switch (dpadstate) { + case DPadUp: + top = 1; bot = 0; right = 0; left = 0; + break; + case DPadUpRight: + top = 1; right = 1; bot = 0; left = 0; + break; + case DPadRight: + right = 1; left = 0; top = 0; bot = 0; + break; + case DPadDownRight: + bot = 1; right = 1; top = 0; left = 0; + break; + case DPadDown: + bot = 1; top = 0; left = 0; right = 0; + break; + case DPadDownLeft: + bot = 1; left = 1; top = 0; right = 0; + break; + case DPadLeft: + left = 1; right = 0; bot = 0; top = 0; + break; + case DPadUpLeft: + top = 1; left = 1; right = 0; bot = 0; + break; + case DPadCenter: + top = 0; left = 0; bot = 0; right = 0; + } + + if (left) top = !top; + if (right) bot = !bot; + *dir = bot | (right << 1) | (top << 8) | (left << 9); + + if(nr==0) + { + *button = g_touchStick.buttonOneStateP0(); + } + else + { + *button = g_touchStick.buttonOneStateP1(); + } + +#endif +} + +#pragma clang diagnostic pop + diff --git a/libraries/sdl-mini/src/thread/pthread/SDL_syssem.c b/libraries/sdl-mini/src/thread/pthread/SDL_syssem.c index bba4072..8bcf571 100644 --- a/libraries/sdl-mini/src/thread/pthread/SDL_syssem.c +++ b/libraries/sdl-mini/src/thread/pthread/SDL_syssem.c @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + /* SDL - Simple DirectMedia Layer Copyright (C) 1997-2010 Sam Lantinga @@ -162,3 +165,5 @@ SDL_SemPost(SDL_sem * sem) //#endif /* __MACOSX__ */ /* vi: set ts=4 sw=4 expandtab: */ + +#pragma clang diagnostic pop diff --git a/libraries/sdl-mini/src/video/uikit/coregraphics/DisplayView.h b/libraries/sdl-mini/src/video/uikit/coregraphics/DisplayView.h index acc17b9..dee8238 100644 --- a/libraries/sdl-mini/src/video/uikit/coregraphics/DisplayView.h +++ b/libraries/sdl-mini/src/video/uikit/coregraphics/DisplayView.h @@ -28,6 +28,8 @@ CADisplayLink *_displayLink; } +- (void)setPaused:(BOOL)value; + - (id)initWithFrame:(CGRect)frame displaySize:(CGSize)displaySize; #ifdef __cplusplus diff --git a/libraries/sdl-mini/src/video/uikit/opengl/OGLDisplay.m b/libraries/sdl-mini/src/video/uikit/opengl/OGLDisplay.m index 6c05464..ce39c15 100755 --- a/libraries/sdl-mini/src/video/uikit/opengl/OGLDisplay.m +++ b/libraries/sdl-mini/src/video/uikit/opengl/OGLDisplay.m @@ -13,7 +13,7 @@ static BOOL newFrame = NO; UIView* CreateOGLDisplayView(int width, int height) { - return [[OGLDisplay alloc] initWithFrame:CGRectMake(0, 0, width, height) displaySize:CGSizeMake(width, height)]; + return [[OGLDisplay alloc] initWithFrame:CGRectMake(0, 0, width, height) displaySize:CGSizeMake(width, height)]; } UIView* GetSharedOGLDisplayView() { @@ -74,7 +74,14 @@ - (id)initWithFrame:(CGRect)frame displaySize:(CGSize)displaySize { _displaySize[0] = displaySize.width; _displaySize[1] = displaySize.height; + effectiveHeightUsedByAmiga=displaySize.height; + mainScreenSize =[UIScreen mainScreen].nativeBounds.size; + mainScreenSize = CGSizeMake( + mainScreenSize.width>mainScreenSize.height? mainScreenSize.width: mainScreenSize.height, + mainScreenSize.height= 258 - 12) + bottom_border_start += 12; //add the height of the STATUS_LEDs + } + if(top_border_end > 40) + { + top_border_end = 40; //some limits is always safer. Everything that starts over 50 ypos treat it as if it starts at 50 . + } + if(mainMenu_stretchscreen) + { //iPad cosmetics: + //never let vertical scaling be higher than horizonal scaling. It is not good looking. Keep aspect ratio instead. + //(the other way around e.g. higher horizontal than vertical scaling is quite acceptable) + float vertScaling = mainScreenSize.height / (float)(bottom_border_start-top_border_end); + float horiScaling = mainScreenSize.width / _displaySize[0] * 2.0; + if(vertScaling>horiScaling) + {//this should be only the case on iPads because it has an 4:3 display, all other ios devices are much wider 16:9, ... + bottom_border_start = mainScreenSize.height / horiScaling; + } + } + if(bottom_border_start >0 && bottom_border_start<200) + { + bottom_border_start = 200; //some limits is always safer. Everything under 200 height scale as if it is a 200 NTSC height screen. + } + + if (last_frame_bottom_border_start>0 && + (bottom_border_start != last_frame_bottom_border_start || top_border_end != last_frame_top_border_end )) + {//when last frames border not like this border then reset count + sameheight_frame_count=-1; + } + if(sameheight_frame_count<50) + {//when more than 50 frames with same border counted then dont count anymore it's enough + sameheight_frame_count++; + } + last_frame_bottom_border_start = bottom_border_start; + last_frame_top_border_end = top_border_end; + + if(bottom_border_start>0 && + (bottom_border_start != last_scaled_bottom_border_start || top_border_end != last_scaled_top_border_end) + && sameheight_frame_count>5) + {//we need to change the scaling here because the amiga changed its viewports + CGSize size = CGSizeMake(_displaySize[0], bottom_border_start -top_border_end); + + effectiveHeightUsedByAmiga = size.height; + [self glOrthoLeft:0 right:size.width bottom:0 top:size.height near:-1 far:1]; + + [self setModelView]; + last_scaled_top_border_end = top_border_end; + last_scaled_bottom_border_start = bottom_border_start; + } + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, _displaySize[0], _displaySize[1], GL_RGB, GL_UNSIGNED_SHORT_5_6_5, _pixels); newFrame = NO; } @@ -282,23 +360,24 @@ - (void)drawView:(CADisplayLink*)displayLink; { [self drawView]; } + - (void)glOrthoLeft:(float)left right:(float)right bottom:(float)bottom top:(float)top near:(float)near far:(float)far { - float a = 2.0f / (right - left); - float b = 2.0f / (top - bottom); + float a = 2.0f / (right - left); + float b = 2.0f / (top - bottom); float c = -2.0f / (far - near); float tx = -(right + left) / (right - left); - float ty = -(top + bottom) / (top - bottom); + float ty = -(_displaySize[1] + bottom + (_displaySize[1]-top -top_border_end*2)) / (top - bottom); //do center vertical. mithrendal float tz = -(far + near) / (far - near); - float ortho[16] = { - a, 0, 0, 0, - 0, b, 0, 0, - 0, 0, c, 0, - tx, ty,tz, 1 - }; - - glUniformMatrix4fv(_shaderEffect.projection, 1, GL_FALSE, &ortho[0]); + float ortho[16] = { + a, 0, 0, 0, + 0, b, 0, 0, + 0, 0, c, 0, + tx, ty,tz, 1 + }; + + glUniformMatrix4fv(_shaderEffect.projection, 1, GL_FALSE, &ortho[0]); } - (void)setModelView { diff --git a/roms/kick.rom b/roms/kick.rom deleted file mode 100755 index cfc0663..0000000 Binary files a/roms/kick.rom and /dev/null differ diff --git a/roms/kick13.rom b/roms/kick13.rom deleted file mode 100644 index 67242cd..0000000 Binary files a/roms/kick13.rom and /dev/null differ diff --git a/roms/kick31.rom b/roms/kick31.rom deleted file mode 100755 index cfc0663..0000000 Binary files a/roms/kick31.rom and /dev/null differ diff --git a/uae4all_gp2x_0.7.2a/src/audio.cpp b/uae4all_gp2x_0.7.2a/src/audio.cpp index f4248dc..566baf1 100755 --- a/uae4all_gp2x_0.7.2a/src/audio.cpp +++ b/uae4all_gp2x_0.7.2a/src/audio.cpp @@ -1,4 +1,7 @@ - /* +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + +/* * UAE - The Un*x Amiga Emulator * * OS specific functions @@ -91,7 +94,7 @@ typedef uae_s8 sample8_t; #define CHECK_SOUND_BUFFERS() \ { \ - if ((unsigned)sndbufpt - (unsigned)render_sndbuff >= SNDBUFFER_LEN) { \ + if ((uintptr_t)sndbufpt - (uintptr_t)render_sndbuff >= SNDBUFFER_LEN) { \ finish_sound_buffer (); \ } \ } @@ -644,6 +647,8 @@ void audio_reset (void) #endif next_sample_evtime = scaled_sample_evtime; + last_cycles = 0; + schedule_audio (); } @@ -1049,6 +1054,16 @@ int init_audio (void) return retval; } +void set_audio_volume(float volume) +{ + set_sound_volume(volume); +} + +float get_audio_volume(void) +{ + return get_sound_volume(); +} + #define CHECK_DMA_AUDIO(AUDIOCH); \ cdp = &audio_channel[AUDIOCH]; \ chan_ena = (dmacon & 0x200) && (dmacon & (1<> 8; - rtarea[rt_addr++] = data; + do_put_mem_word ((uae_u16 *)(rtarea + rt_addr), data); + rt_addr += 2; } void dl (uae_u32 data) { - rtarea[rt_addr++] = data >> 24; - rtarea[rt_addr++] = data >> 16; - rtarea[rt_addr++] = data >> 8; - rtarea[rt_addr++] = data; + do_put_mem_long ((uae_u32 *)(rtarea + rt_addr), data); + rt_addr += 4; } /* store strings starting at the end of the rt area and working * backward. store pointer at current address */ -uae_u32 ds (char *str) +uae_u32 ds (const char *str) { int len = strlen (str) + 1; - + rt_straddr -= len; - strcpy ((char *)rtarea + rt_straddr, str); - + + int i; + for (i = 0; i < len; i++) + do_put_mem_byte (rtarea + rt_straddr + i, str[i]); + return addr (rt_straddr); } @@ -474,47 +439,57 @@ static void rtarea_init_mem (void) { rtarea = mapped_malloc (0x10000, "rtarea"); if (!rtarea) { - write_log ("virtual memory exhausted (rtarea)!\n"); - return; + write_log ("virtual memory exhausted (rtarea)!\n"); + return; } - // rtarea_bank.baseaddr = rtarea; + + /* TODO: *** reinitializing rtarea with filesys/expansion code *** + * Moved here from memory_reset(), so we don't lose all the extension/filesys + * traps that will be set up later + */ + rtarea_cleanup(); + + /* FAMEC fast (direct) memory access instead of functions */ + rtarea_bank.baseaddr = rtarea; } void rtarea_init (void) { rtarea_init_mem (); - + #ifdef USE_AUTOCONFIG uae_u32 a; - char uaever[100]; - sprintf (uaever, "uae-%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); - + char uaever[32]; + snprintf (uaever, 32, "uae-%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); + EXPANSION_uaeversion = ds (uaever); EXPANSION_explibname = ds ("expansion.library"); EXPANSION_doslibname = ds ("dos.library"); EXPANSION_uaedevname = ds ("uae.device"); - + deftrap (NULL); /* Generic emulator trap */ lasttrap = 0; - + EXPANSION_nullfunc = here (); calltrap (deftrap (nullfunc)); dw (RTS); - + a = here(); /* Standard "return from 68k mode" trap */ org (RTAREA_BASE + 0xFF00); calltrap (deftrap2 (m68k_mode_return, TRAPFLAG_NO_RETVAL, "")); - + org (RTAREA_BASE + 0xFF80); calltrap (deftrap2 (getchipmemsize, TRAPFLAG_DORET, "")); - + org (RTAREA_BASE + 0xFF10); calltrap (deftrap2 (uae_puts, TRAPFLAG_NO_RETVAL, "")); dw (RTS); - + org (a); #endif + + filesys_install_code (); } volatile int uae_int_requested = 0; @@ -532,3 +507,5 @@ void rtarea_cleanup(void) { memset(rtarea,0,0x10000); } + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/blitfunc.cpp b/uae4all_gp2x_0.7.2a/src/blitfunc.cpp index e4defc1..d5da745 100644 --- a/uae4all_gp2x_0.7.2a/src/blitfunc.cpp +++ b/uae4all_gp2x_0.7.2a/src/blitfunc.cpp @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + #include "sysconfig.h" #include "sysdeps.h" #include "config.h" @@ -1406,3 +1409,6 @@ void blitdofast_desc_fc (uaecptr pta, uaecptr ptb, uaecptr ptc, uaecptr ptd, str b->bltbhold = srcb; if ((totald<<16) != 0) b->blitzero = 0; } + +#pragma clang diagnostic pop + diff --git a/uae4all_gp2x_0.7.2a/src/blitter.cpp b/uae4all_gp2x_0.7.2a/src/blitter.cpp index 030f6e5..0d28a9a 100644 --- a/uae4all_gp2x_0.7.2a/src/blitter.cpp +++ b/uae4all_gp2x_0.7.2a/src/blitter.cpp @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + /* * UAE - The Un*x Amiga Emulator * @@ -684,3 +687,5 @@ int blitnasty (void) uae4all_prof_end(6); return ccnt; } + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/cfgfile.cpp b/uae4all_gp2x_0.7.2a/src/cfgfile.cpp new file mode 100755 index 0000000..95de91e --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/cfgfile.cpp @@ -0,0 +1,127 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Config file handling + * This still needs some thought before it's complete... + * + * Copyright 1998 Brian King, Bernd Schmidt + */ + +#include "sysconfig.h" +#include "sysdeps.h" + +#include + +#include "config.h" +#include "options.h" +#include "thread.h" +#include "uae.h" +#include "autoconf.h" +#include "gui.h" +#include "filesys.h" + +uaedev_mount_info *currprefs_mountinfo; + +char uae4all_hard_dir[256]; +char uae4all_hard_file[256]; + +char * make_hard_dir_cfg_line (char *dst) { + char buffer[256]; + int i; + + if (uae4all_hard_dir[0] != '\0') { + for (i = strlen(uae4all_hard_dir); i > 0; i--) + if ((uae4all_hard_dir[i] == '/')||(uae4all_hard_dir[i] == '\\')) + break; + if (i > 0) { + strncpy(buffer, &uae4all_hard_dir[i+1], 256); + strcat(buffer, ":"); + strncat(buffer, uae4all_hard_dir, 256 - strlen(buffer)); + strcpy(dst, buffer); + } else + return NULL; + } + + return dst; +} + +char * make_hard_file_cfg_line (char *dst) { + char buffer[256]; + + if (uae4all_hard_file[0] != 0) { + strcpy(buffer, "32:1:2:512:"); + strncat(buffer, uae4all_hard_file, 256 - strlen(buffer)); + strcpy(dst, buffer); + } + + return dst; +} + +/*static*/ void parse_filesys_spec (int readonly, char *spec) +{ + /* spec example (:): + * rw,AmigaHD:AmigaHD + */ + char buf[256]; + char *s2; + + strncpy (buf, spec, 255); buf[255] = 0; + s2 = strchr (buf, ':'); + if (s2) { + *s2++ = '\0'; +#ifdef __DOS__ + { + char *tmp; + + while ((tmp = strchr (s2, '\\'))) + *tmp = '/'; + } +#endif + s2 = add_filesys_unit (currprefs_mountinfo, buf, s2, readonly, 0, 0, 0, 0); + if (s2) + fprintf (stderr, "%s\n", s2); + } else { + fprintf (stderr, "Usage: [-m | -M] VOLNAME:mount_point\n"); + } +} + +/*static*/ void parse_hardfile_spec (char *spec) +{ + /* spec example: + * rw,32:1:2:512:hdd/AmigaHD.hdf + */ + char *x0 = my_strdup (spec); + char *x1, *x2, *x3, *x4; + + x1 = strchr (x0, ':'); + if (x1 == NULL) + goto argh; + *x1++ = '\0'; + x2 = strchr (x1 + 1, ':'); + if (x2 == NULL) + goto argh; + *x2++ = '\0'; + x3 = strchr (x2 + 1, ':'); + if (x3 == NULL) + goto argh; + *x3++ = '\0'; + x4 = strchr (x3 + 1, ':'); + if (x4 == NULL) + goto argh; + *x4++ = '\0'; + x4 = add_filesys_unit (currprefs_mountinfo, 0, x4, 0, atoi (x0), atoi (x1), atoi (x2), atoi (x3)); + if (x4) + fprintf (stderr, "%s\n", x4); + + free (x0); + return; + + argh: + free (x0); + fprintf (stderr, "Bad hardfile parameter specified - type \"uae -h\" for help.\n"); + return; +} + +void init_mountinfo() { + currprefs_mountinfo = alloc_mountinfo(); +} diff --git a/uae4all_gp2x_0.7.2a/src/custom.cpp b/uae4all_gp2x_0.7.2a/src/custom.cpp index c852275..c96857c 100755 --- a/uae4all_gp2x_0.7.2a/src/custom.cpp +++ b/uae4all_gp2x_0.7.2a/src/custom.cpp @@ -1,4 +1,7 @@ - /* +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + +/* * UAE - The Un*x Amiga Emulator * * Custom chip emulation @@ -8,7 +11,6 @@ * Copyright 2000-2002 Toni Wilen */ - // #define USE_CUSTOM_EXTRA_INLINE #define USE_IMASK_TABLE #define UNROLL_LONG_FETCH @@ -111,7 +113,7 @@ unsigned long int currcycle, nextevent; struct ev eventtab[ev_max]; static int vpos; -extern int next_vpos[512]; +//extern int next_vpos[512]; static uae_u16 lof; static int next_lineno; static int lof_changed = 0; @@ -1088,6 +1090,7 @@ static __inline__ void decide_fetch (int hpos) /* This function is responsible for turning on datafetch if necessary. */ static __inline__ void decide_line (int hpos) { + if (hpos <= last_decide_line_hpos) return; if (fetch_state != fetch_not_started) @@ -1165,6 +1168,128 @@ static _INLINE_ void record_color_change (int hpos, int regno, unsigned long val typedef int sprbuf_res_t, cclockres_t, hwres_t, bplres_t; +//newer code starts here mithrendal +/* handle very rarely needed playfield collision (CLXDAT bit 0) */ +static void do_playfield_collisions (void) +{ + int bplres = GET_RES (bplcon0); //bplcon0_res;; + hwres_t ddf_left = thisline_decision.plfleft * 2 << bplres; + hwres_t hw_diwlast = coord_window_to_diw_x (thisline_decision.diwlastword); + hwres_t hw_diwfirst = coord_window_to_diw_x (thisline_decision.diwfirstword); + int i, collided, minpos, maxpos; + int planes = /*(currprefs.chipset_mask & CSMASK_AGA) ? 8 :*/ 6; + + collided = 0; + minpos = thisline_decision.plfleft * 2; + if (minpos < hw_diwfirst) + minpos = hw_diwfirst; + maxpos = thisline_decision.plfright * 2; + if (maxpos > hw_diwlast) + maxpos = hw_diwlast; + for (i = minpos; i < maxpos && !collided; i+= 32) { + int offs = ((i << bplres) - ddf_left) >> 3; + int j; + uae_u32 total = 0xffffffff; + for (j = 0; j < planes; j++) { + int ena = (clxcon_bpl_enable >> j) & 1; + int match = (clxcon_bpl_match >> j) & 1; + uae_u32 t = 0xffffffff; + if (ena) { + if (j < thisline_decision.nr_planes) { + t = *(uae_u32 *)(line_data[next_lineno] + offs + 2 * j * MAX_WORDS_PER_LINE); + t ^= (match & 1) - 1; + } else { + t = (match & 1) - 1; + } + } + total &= t; + } + if (total) { + collided = 1; + } + } + if (collided) + clxdat |= 1; +} + + +/* Sprite-to-sprite collisions are taken care of in record_sprite. This one does + playfield/sprite collisions. + That's the theory. In practice this doesn't work yet. I also suspect this code + is way too slow. */ +static void do_sprite_collisions (void) +{ + int nr_sprites = curr_drawinfo[next_lineno].nr_sprites; + int first = curr_drawinfo[next_lineno].first_sprite_entry; + int i; + unsigned int collision_mask = clxmask[clxcon >> 12]; + int bplres = GET_RES (bplcon0); //bplcon0_res; + hwres_t ddf_left = thisline_decision.plfleft * 2 << bplres; + hwres_t hw_diwlast = coord_window_to_diw_x (thisline_decision.diwlastword); + hwres_t hw_diwfirst = coord_window_to_diw_x (thisline_decision.diwfirstword); + + for (i = 0; i < nr_sprites; i++) { + struct sprite_entry *e = curr_sprite_entries + first + i; + sprbuf_res_t j; + sprbuf_res_t minpos = e->pos; + sprbuf_res_t maxpos = e->max; + hwres_t minp1 = minpos >> sprite_buffer_res; + hwres_t maxp1 = maxpos >> sprite_buffer_res; + + if (maxp1 > hw_diwlast) + maxpos = hw_diwlast << sprite_buffer_res; + if (maxp1 > thisline_decision.plfright * 2) + maxpos = thisline_decision.plfright * 2 << sprite_buffer_res; + if (minp1 < hw_diwfirst) + minpos = hw_diwfirst << sprite_buffer_res; + if (minp1 < thisline_decision.plfleft * 2) + minpos = thisline_decision.plfleft * 2 << sprite_buffer_res; + + for (j = minpos; j < maxpos; j++) { + int sprpix = spixels[e->first_pixel + j - e->pos] & collision_mask; + int k; + int offs; + int match = 1; + + if (sprpix == 0) + continue; + + offs = ((j << bplres) >> sprite_buffer_res) - ddf_left; + sprpix = sprite_ab_merge[sprpix & 255] | (sprite_ab_merge[sprpix >> 8] << 2); + sprpix <<= 1; + + /* Loop over number of playfields. */ + for (k = 1; k >= 0; k--) { + int l; + int planes = /*(currprefs.chipset_mask & CSMASK_AGA) ? 8 : */6; + + if (bplcon0 & 0x400) + match = 1; + for (l = k; match && l < planes; l += 2) { + int t = 0; + if (l < thisline_decision.nr_planes) { + uae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE); + uae_u32 word = ldata[offs >> 5]; + t = (word >> (31 - (offs & 31))) & 1; + } + if (clxcon_bpl_enable & (1 << l)) { + if (t != ((clxcon_bpl_match >> l) & 1)) + match = 0; + } + } + if (match) { + clxdat |= sprpix << (k * 4); + } + } + } + } +} + + +//newer code ends here mithrendal + + + static _INLINE_ void expand_sprres (void) { switch ((bplcon3 >> 6) & 3) { @@ -1253,7 +1378,8 @@ static _INLINE_ void record_sprite (int line, int num, int sprxp, uae_u16 *_GCCR | (sprtabb[db & 0xFF] << 16) | sprtabb[db >> 8]); buf = spixels + word_offs + (i << dbl); - record_sprite_1 (buf, datab, num, dbl, mask, 0, collision_mask); + //record_sprite_1 (buf, datab, num, dbl, mask, 0, collision_mask); + record_sprite_1 (buf, datab, num, dbl, mask, 1, collision_mask); //mithrendal sprite collision 1=enabled data++; datb++; } @@ -1878,7 +2004,7 @@ static _INLINE_ void SET_INTERRUPT(void) else if (new_irqs == 0) { M68KCONTEXT.interrupts[0] = 0; // uae4all_go_interrupt = 0; - m68k_irq_update(0); + m68k_irq_update(); } else { @@ -1888,7 +2014,7 @@ static _INLINE_ void SET_INTERRUPT(void) end_timeslice = new_level > old_level && new_level > _68k_intmask; M68KCONTEXT.interrupts[0] = new_irqs; - m68k_irq_update(end_timeslice); + m68k_irq_update(); /* if (new_level > old_level && new_level > _68k_intmask) { @@ -2092,6 +2218,7 @@ static __inline__ void INTENA (uae_u16 v) #ifdef DEBUG_CUSTOM dbgf("INTENA 0x%X\n",v); #endif + setclr (&intena,v); /* There's stupid code out there that does [some INTREQ bits at level 3 are set] @@ -2103,7 +2230,7 @@ static __inline__ void INTENA (uae_u16 v) we'll have SPCFLAG_DOINT set, and the interrupt happens immediately, but it needs to happen one insn later, when the new L3 handler has been installed. */ - + #if !defined(USE_FAME_CORE) && !defined(DEBUG_M68K) if (v & 0x8000) #endif @@ -2509,9 +2636,23 @@ static _INLINE_ uae_u16 POT0DAT (void) return cnt; } +bool bDontCareMouseIUAE=false; +void mousehack_setdontcare_iuae () +{ + bDontCareMouseIUAE = true; +} +void mousehack_setfollow_iuae () +{ + bDontCareMouseIUAE = false; +} + static _INLINE_ uae_u16 JOY0DAT (void) { do_mouse_hack (); + + if(bDontCareMouseIUAE) //mithrendil + return joy0dir; + return ((uae_u8)mouse_x) + ((uae_u16)mouse_y << 8) + joy0dir; } @@ -2705,6 +2846,7 @@ static _INLINE_ void predict_copper (void) c_hpos = maxhpos; } else if (vp > vcmp || hcmp <= c_hpos) { state = COP_read1; + /* minimum wakeup time */ c_hpos += 2; } else { @@ -2924,7 +3066,8 @@ static _INLINE_ void update_copper (int until_hpos) at 0/0). This can be seen in the Superfrog copper list. Things get monstrously complicated if we try to handle this "properly" by incrementing vpos and setting c_hpos to 0. Especially the various speedup - hacks really assume that vpos remains constant during one line. Hence, + hacks really assume that vpos remains constant during one line. + Hence, this hack: defer the entire decision until the next line if necessary. */ if (c_hpos >= (maxhpos & ~1)) break; @@ -3253,7 +3396,7 @@ static void vsync_handler (void) if (joy0button!=back_joy0button) back_joy0button= buttonstate[0]= joy0button; } - + INTREQ (0x8020); if (bplcon0 & 4) @@ -3311,7 +3454,11 @@ void hsync_handler (void) sync_copper_with_cpu (maxhpos, 0, 0x8A); finish_decisions (); - + + do_sprite_collisions (); + // do_playfield_collisions (); //only used in game "rotor" + + hsync_record_line_state (next_lineno, thisline_changed); eventtab[ev_hsync].evtime += get_cycles () - eventtab[ev_hsync].oldcycles; @@ -3331,7 +3478,9 @@ void hsync_handler (void) #ifdef DEBUG_CUSTOM dbgf("vpos=%i, maxvpos=%i, lof=%i\n",vpos,maxvpos,lof); #endif - vpos=next_vpos[vpos]; + //printf("Vpos: %d Intreq: %x\n", vpos, intreq); + vpos++; + //vpos=next_vpos[vpos]; if (vpos >= (maxvpos + (lof != 0))) { vpos=0; @@ -3479,6 +3628,10 @@ void customreset (void) n_frames = 0; vsync_handler_cnt_disk_change = 0; +#ifdef USE_AUTOCONFIG + expamem_reset (); +#endif + DISK_reset (); CIA_reset (); if (! savestate_state) @@ -3701,7 +3854,19 @@ static __inline__ uae_u32 REGPARAM2 custom_wget_1 (uaecptr addr) case 0x018: v = 0; break; case 0x01A: v = DSKBYTR (current_hpos ()); break; case 0x01C: v = INTENAR (); break; - case 0x01E: v = INTREQR (); break; + case 0x01E: v = INTREQR (); + + if(m68kcontext.pc == 0x31082) + { + int vblank = (intreq & ( 1 << 5 )) >> 5; + + if(vblank == 1) + { + + } + } + break; + case 0x07C: v = DENISEID (); break; case 0x180: case 0x182: case 0x184: case 0x186: case 0x188: case 0x18A: @@ -3990,8 +4155,8 @@ extern SDLKey vkbd_button4; uae_u8 *restore_custom (uae_u8 *src) { - uae_u16 dsklen, dskbytr, dskdatr, u16; - uae_u32 u32; + uae_u16 dsklen, dskbytr, dskdatr, ru16; + //uae_u32 u32; int dskpt; int i; @@ -4020,19 +4185,19 @@ uae_u8 *restore_custom (uae_u8 *src) RW; /* 028 REFPTR */ lof = RW; /* 02A VPOSW */ RW; /* 02C VHPOSW */ - u16=RW; COPCON(u16); /* 02E COPCON */ + ru16=RW; COPCON(ru16); /* 02E COPCON */ RW; /* 030 SERDAT* */ RW; /* 032 SERPER* */ - u16=RW; POTGO(u16); /* 034 POTGO */ + ru16=RW; POTGO(ru16); /* 034 POTGO */ RW; /* 036 JOYTEST* */ RW; /* 038 STREQU */ RW; /* 03A STRVHBL */ RW; /* 03C STRHOR */ RW; /* 03E STRLONG */ - u16=RW; BLTCON0(u16); /* 040 BLTCON0 */ - u16=RW; BLTCON1(u16); /* 042 BLTCON1 */ - u16=RW; BLTAFWM(u16); /* 044 BLTAFWM */ - u16=RW; BLTALWM(u16); /* 046 BLTALWM */ + ru16=RW; BLTCON0(ru16); /* 040 BLTCON0 */ + ru16=RW; BLTCON1(ru16); /* 042 BLTCON1 */ + ru16=RW; BLTAFWM(ru16); /* 044 BLTAFWM */ + ru16=RW; BLTALWM(ru16); /* 046 BLTALWM */ bltcpt=RL; // u32=RL; BLTCPTH(u32); /* 048-04B BLTCPT */ bltbpt=RL; // u32=RL; BLTBPTH(u32); /* 04C-04F BLTBPT */ bltapt=RL; // u32=RL; BLTAPTH(u32); /* 050-053 BLTAPT */ @@ -4041,22 +4206,22 @@ uae_u8 *restore_custom (uae_u8 *src) RW; /* 05A BLTCON0L */ oldvblts = RW; /* 05C BLTSIZV */ RW; /* 05E BLTSIZH */ - u16=RW; BLTCMOD(u16); /* 060 BLTCMOD */ - u16=RW; BLTBMOD(u16); /* 062 BLTBMOD */ - u16=RW; BLTAMOD(u16); /* 064 BLTAMOD */ - u16=RW; BLTDMOD(u16); /* 066 BLTDMOD */ + ru16=RW; BLTCMOD(ru16); /* 060 BLTCMOD */ + ru16=RW; BLTBMOD(ru16); /* 062 BLTBMOD */ + ru16=RW; BLTAMOD(ru16); /* 064 BLTAMOD */ + ru16=RW; BLTDMOD(ru16); /* 066 BLTDMOD */ RW; /* 068 ? */ RW; /* 06A ? */ RW; /* 06C ? */ RW; /* 06E ? */ - u16=RW; BLTCDAT(u16); /* 070 BLTCDAT */ - u16=RW; BLTBDAT(u16); /* 072 BLTBDAT */ - u16=RW; BLTADAT(u16); /* 074 BLTADAT */ + ru16=RW; BLTCDAT(ru16); /* 070 BLTCDAT */ + ru16=RW; BLTBDAT(ru16); /* 072 BLTBDAT */ + ru16=RW; BLTADAT(ru16); /* 074 BLTADAT */ RW; /* 076 ? */ RW; /* 078 ? */ RW; /* 07A ? */ RW; /* 07C LISAID */ - u16=RW; DSKSYNC(u16); /* 07E DSKSYNC */ + ru16=RW; DSKSYNC(ru16); /* 07E DSKSYNC */ cop1lc = RL; /* 080/082 COP1LC */ cop2lc = RL; /* 084/086 COP2LC */ RW; /* 088 ? */ @@ -4067,7 +4232,7 @@ uae_u8 *restore_custom (uae_u8 *src) ddfstrt = RW; /* 092 DDFSTRT */ ddfstop = RW; /* 094 DDFSTOP */ dmacon = RW & ~(0x2000|0x4000); /* 096 DMACON */ - u16=RW; CLXCON(u16); /* 098 CLXCON */ + ru16=RW; CLXCON(ru16); /* 098 CLXCON */ intena = RW; /* 09A INTENA */ intreq = RW; /* 09C INTREQ */ adkcon = RW; /* 09E ADKCON */ @@ -4333,3 +4498,5 @@ uae_u8 *save_custom_sprite(int *len, int num) *len = dst - dstbak; return dstbak; } + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/disk.cpp b/uae4all_gp2x_0.7.2a/src/disk.cpp index 01613fd..cdf11b1 100755 --- a/uae4all_gp2x_0.7.2a/src/disk.cpp +++ b/uae4all_gp2x_0.7.2a/src/disk.cpp @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + /* * UAE - The Un*x Amiga Emulator * @@ -33,11 +36,13 @@ #include "xwin.h" #include "execlib.h" #include "savestate.h" +#include "adfresolver.h" char prefs_df[NUM_DRIVES][256]; char changed_df[NUM_DRIVES][256]; char romfile[256]; +char romkeyfile[256]; int real_changed_df[NUM_DRIVES]={0}; /* writable track length with normal 2us bitcell/300RPM motor */ @@ -71,7 +76,8 @@ static int floppy_speed = NORMAL_FLOPPY_SPEED; */ static int side, direction, writing; -static uae_u8 selected = 15, disabled=0; +static uae_u8 selected = 15; +uae_u8 disabled=0; static uae_u8 *writebuffer[544 * 22]; @@ -1346,7 +1352,7 @@ void DSKLEN (uae_u16 v, int hpos) return; { int dr; - uaecptr pc = _68k_getpc (); + uaecptr pc = m68k_get_pc (); if ((pc & 0xF80000) != 0xF80000) return; for (dr = 0; dr < NUM_DRIVES; dr++) { @@ -1588,28 +1594,41 @@ uae_u8 *restore_disk(int num,uae_u8 *src) drv->dskready = dskready; drv->drive_id_scnt = drive_id_scnt; drv->mfmpos = mfmpos; - strncpy(changed_df[num],(char *)src,127); - changed_df[num][127] = 0; + + char adf[256]; + strncpy(adf,(char *)src,255); + adf[255] = 0; + FILE *f=fopen(adf,"rb"); + + if (!f) + { + // the path to the adf may have changed since the state was saved + strcpy(adf, get_updated_adf_path(adf)); + f = fopen(adf,"rb"); + } + + if (f) { - FILE *f=fopen(changed_df[num],"rb"); - if (f) + fclose(f); + if (strcmp(prefs_df[num],adf)) { - fclose(f); - if (strcmp(prefs_df[num],changed_df[num])) - { - strcpy(prefs_df[num],changed_df[num]); - real_changed_df[num] = 1; - } + strncpy(changed_df[num],adf,255); + real_changed_df[num] = 1; } } + else + { + changed_df[num][0] = 0; + real_changed_df[num] = 1; + } } else { m68k_speed=mfmpos; - check_prefs_changed_cpu(); + //check_prefs_changed_cpu(); } - src = (uae_u8 *)(((unsigned)src)+strlen((char *)src) + 1); + src = (uae_u8 *)(((uintptr_t)src)+strlen((char *)src) + 1); return src; } @@ -1639,12 +1658,13 @@ uae_u8 *save_disk(int num,int *len) save_u8 (0); /* cylinder */ save_u8 (0); /* dskready */ save_u8 (0); /* id mode position */ - save_u32 (m68k_speed); /* disk position */ + save_u32(0); /* disk position */ + //save_u32 (m68k_speed); /* disk position */ save_u32 (0); /* CRC of disk image */ dst[0]=dst[1]=0; } - dst = (uae_u8 *)(((unsigned)dst)+strlen((char *)dst) + 1); + dst = (uae_u8 *)(((uintptr_t)dst)+strlen((char *)dst) + 1); *len = dst - dstbak; return dstbak; } @@ -1681,3 +1701,5 @@ uae_u8 *save_floppy(int *len) *len = dst - dstbak; return dstbak; } + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/drawing.cpp b/uae4all_gp2x_0.7.2a/src/drawing.cpp old mode 100755 new mode 100644 index e162a49..772e51b --- a/uae4all_gp2x_0.7.2a/src/drawing.cpp +++ b/uae4all_gp2x_0.7.2a/src/drawing.cpp @@ -1,3 +1,8 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wcomment" +#pragma clang diagnostic ignored "-Wc++11-compat-deprecated-writable-strings" + /* * UAE - The Un*x Amiga Emulator * @@ -63,11 +68,11 @@ static int fps_counter = 0, fps_counter_changed = 0; #define GFXVIDINFO_PIXBYTES 2 -#define GFXVIDINFO_WIDTH 320 -#define GFXVIDINFO_HEIGHT 240 -#define MAXBLOCKLINES 240 +#define GFXVIDINFO_WIDTH 640 //mithrendal hires fix. before was 320 +#define GFXVIDINFO_HEIGHT 258 //258 for PAL +#define MAXBLOCKLINES 258 //258 for PAL #define VISIBLE_LEFT_BORDER 72 -#define VISIBLE_RIGHT_BORDER 392 +#define VISIBLE_RIGHT_BORDER 640+72 ////mithrendal hires fix. before was 392 #define LINETOSCR_X_ADJUST_BYTES 144 /* #define VISIBLE_LEFT_BORDER 64 @@ -392,37 +397,41 @@ static int src_pixel; static int unpainted; #define LNAME linetoscr_16 -#define SRC_INC 1 #include "linetoscr.h" -#undef SRC_INC #undef LNAME -#define LNAME linetoscr_16_shrink1 -#define SRC_INC 2 +#define LNAME linetoscr_16_double +#define HDOUBLE 1 #include "linetoscr.h" -#undef SRC_INC #undef LNAME static void pfiled_do_linetoscr_1(int start, int stop) { - src_pixel = linetoscr_16_shrink1 (src_pixel, start, stop); + src_pixel = linetoscr_16 (src_pixel, start, VISIBLE_LEFT_BORDER+(stop-VISIBLE_LEFT_BORDER)*2); //mithrendal hires fix. } static void pfiled_do_linetoscr_0(int start, int stop) { - src_pixel = linetoscr_16 (src_pixel, start, stop); + src_pixel = linetoscr_16_double(src_pixel, start, stop); //mithrendal stretching of lores fix } static line_draw_func *pfield_do_linetoscr=(line_draw_func *)pfiled_do_linetoscr_0; + static void pfield_do_fill_line(int start, int stop) { - register uae_u16 *b = &(((uae_u16 *)xlinebuffer)[start]); + //with center fix for 640pixel output. mithrendal + register uae_u16 *b = &(((uae_u16 *)xlinebuffer)[VISIBLE_LEFT_BORDER+(start-VISIBLE_LEFT_BORDER)*2]); register xcolnr col = colors_for_drawing.acolors[0]; register int i; register int max=(stop-start); - for (i = 0; i < max; i++,b++) - *b = col; + for (i = 0; i < max; i++) + { + *b = col; + b++; + *b = col; + b++; + } } /* Initialize the variables necessary for drawing a line. @@ -1709,7 +1718,7 @@ static __inline__ void pfield_doline (int lineno) static _INLINE_ void init_row_map (void) { int i; - for (i = 0; i < GFXVIDINFO_HEIGHT + 1; i++) + for (i = 0; i < GFXVIDINFO_HEIGHT; i++) row_map[i] = gfx_mem + gfx_rowbytes * i; } @@ -1735,14 +1744,17 @@ static _INLINE_ void init_aspect_maps (void) for (i = 0; i < maxl; i++) { //int v = (int) ((i - min_ypos_for_screen) * native_lines_per_amiga_line); int v = (int) (i - min_ypos_for_screen); - if (v >= GFXVIDINFO_HEIGHT && max_drawn_amiga_line == -1) - max_drawn_amiga_line = i - min_ypos_for_screen; + if (v >= GFXVIDINFO_HEIGHT && max_drawn_amiga_line < 0) + max_drawn_amiga_line = v; if (i < min_ypos_for_screen || v >= GFXVIDINFO_HEIGHT) v = -1; amiga2aspect_line_map[i] = v; } - for (i = GFXVIDINFO_HEIGHT; i--;) + if (max_drawn_amiga_line < 0) + max_drawn_amiga_line = maxl - min_ypos_for_screen; + + for (i = 0; i < GFXVIDINFO_HEIGHT; i++) native2amiga_line_map[i] = -1; /* if (native_lines_per_amiga_line < 1) { @@ -1767,12 +1779,8 @@ static _INLINE_ void init_aspect_maps (void) * A raster line has been built in the graphics buffer. Tell the graphics code * to do anything necessary to display it. */ -static _INLINE_ void do_flush_line (int lineno) +static _INLINE_ void do_flush_line_base (int lineno) { - if (lineno < first_drawn_line) - first_drawn_line = lineno; - if (lineno > last_drawn_line) - last_drawn_line = lineno; if ((last_block_line+1) != lineno) { if (first_block_line != -2) @@ -1785,6 +1793,19 @@ static _INLINE_ void do_flush_line (int lineno) first_block_line = last_block_line = -2; } } +static _INLINE_ void do_flush_line (int lineno) +{ + if (lineno < first_drawn_line) + first_drawn_line = lineno; + if (lineno > last_drawn_line) + last_drawn_line = lineno; + do_flush_line_base(lineno); +} + +static _INLINE_ void do_flush_line_border (int lineno) +{ + do_flush_line_base(lineno); +} /* * One drawing frame has been finished. Tell the graphics code about it. @@ -1885,6 +1906,7 @@ static __inline__ void pfield_expand_dp_bplcon (void) sbasecol[1] = ((dp_for_drawing->bplcon4 >> 0) & 15) << 4; } + static __inline__ void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) { int border = 0; @@ -1915,12 +1937,13 @@ static __inline__ void pfield_draw_line (int lineno, int gfx_ypos, int follow_yp } do_color_changes (pfield_do_fill_line, (void (*)(int, int))pfield_do_linetoscr); do_flush_line (gfx_ypos); - } else { + + } else { adjust_drawing_colors (dp_for_drawing->ctable); if (dip_for_drawing->nr_color_changes == 0) { fill_line (); - do_flush_line (gfx_ypos); + do_flush_line_border (gfx_ypos); return; } @@ -1928,10 +1951,11 @@ static __inline__ void pfield_draw_line (int lineno, int gfx_ypos, int follow_yp playfield_end = VISIBLE_RIGHT_BORDER; do_color_changes (pfield_do_fill_line, pfield_do_fill_line); - do_flush_line (gfx_ypos); + do_flush_line_border (gfx_ypos); } } +int top_border_end=0, bottom_border_start=-1; //remember the min. top and max. bottom drawn line of the screen for adaptive vertical stretching. (mithrendal) static _INLINE_ void init_drawing_frame (void) { init_hardware_for_drawing_frame (); @@ -1944,6 +1968,10 @@ static _INLINE_ void init_drawing_frame (void) *ptr=0x01010101; } + //remember the vertical border positions of last frame, because the positions of current frame are not determined yet. (mithrendal) + top_border_end=first_drawn_line-1; + bottom_border_start= last_drawn_line+1; + last_drawn_line = 0; first_drawn_line = 32767; @@ -2044,52 +2072,81 @@ static _INLINE_ void draw_status_line (int line) uae_u8 *buf; if (td_pos & TD_RIGHT) - x = GFXVIDINFO_WIDTH - TD_PADX - 5*TD_WIDTH; + x = GFXVIDINFO_WIDTH - TD_PADX - 6 *TD_WIDTH; else x = TD_PADX; y = line - (GFXVIDINFO_HEIGHT - TD_TOTAL_HEIGHT); xlinebuffer = row_map[line]; - - uae4all_memclr(xlinebuffer, GFXVIDINFO_WIDTH * GFXVIDINFO_PIXBYTES); - + x+=100 - (TD_WIDTH*(NUM_DRIVES-1)); - - for (led = 0; led < (NUM_DRIVES+1); led++) { - int track; - if (led > 0) { - track = gui_data.drive_track[led-1]; - on = gui_data.drive_motor[led-1]; - on_rgb = 0x0f0; - off_rgb = 0x040; - } else { - track = -1; - on = gui_data.powerled; - on_rgb = 0xf00; - off_rgb = 0x400; - } - c = xcolors[on ? on_rgb : off_rgb]; - - for (j = 0; j < TD_LED_WIDTH; j++) - putpixel (x + j, c); - - if (y >= TD_PADY && y - TD_PADY < TD_NUM_HEIGHT) { - if (track >= 0) { - int offs = (TD_WIDTH - 2 * TD_NUM_WIDTH) / 2; - write_tdnumber (x + offs, y - TD_PADY, track / 10); - write_tdnumber (x + offs + TD_NUM_WIDTH, y - TD_PADY, track % 10); - } - } - x += TD_WIDTH; + + uae4all_memclr(xlinebuffer, GFXVIDINFO_WIDTH * GFXVIDINFO_PIXBYTES); + + for (led = -1; led < (NUM_DRIVES+1); led++) { + int track; + if (led > 0) { + /* Floppy */ + track = gui_data.drive_track[led-1]; + on = gui_data.drive_motor[led-1]; + on_rgb = 0x0f0; + off_rgb = 0x040; + } else if (led < 0) { + /* Power */ + track = gui_data.fps; + on = gui_data.powerled; + on_rgb = 0xf00; + off_rgb = 0x400; + } else { + /* Hard disk */ + track = -2; + + switch (gui_data.hdled) { + case HDLED_OFF: + on = 0; + off_rgb = 0x004; + + break; + case HDLED_READ: + on = 1; + on_rgb = 0x00f; + off_rgb = 0x004; + + break; + case HDLED_WRITE: + on = 1; + on_rgb = 0xf00; + off_rgb = 0x400; + + break; + } + } + c = xcolors[on ? on_rgb : off_rgb]; + + for (j = 0; j < TD_LED_WIDTH; j++) + putpixel (x + j, c); + + if (y >= TD_PADY && y - TD_PADY < TD_NUM_HEIGHT) { + if (track >= 0) { + int tn = track >= 100 ? 3 : 2; + int offs = (TD_LED_WIDTH - tn * TD_NUM_WIDTH) / 2; + if(track >= 100) + { + write_tdnumber (x + offs, y - TD_PADY, track / 100); + offs += TD_NUM_WIDTH; + } + write_tdnumber (x + offs, y - TD_PADY, (track / 10) % 10); + write_tdnumber (x + offs + TD_NUM_WIDTH, y - TD_PADY, track % 10); + } + /*else if (nr_units(currprefs.mountinfo) > 0) { + int offs = (TD_LED_WIDTH - 2 * TD_NUM_WIDTH) / 2; + write_tdletter(x + offs, y - TD_PADY, 'H'); + write_tdletter(x + offs + TD_NUM_WIDTH, y - TD_PADY, 'D'); + }* Emufreak: Currently only one HD Supported */ + } + x += TD_WIDTH; } - - x = GFXVIDINFO_WIDTH - TD_PADX - 5*TD_WIDTH; - x+=100 - (TD_WIDTH*(NUM_DRIVES-1)); - if (y >= TD_PADY && y - TD_PADY < TD_NUM_HEIGHT) { - int offs = (TD_WIDTH - 2 * TD_NUM_WIDTH) / 2; - write_tdnumber (x + offs, y - TD_PADY, fps_counter / 10); - write_tdnumber (x + offs + TD_NUM_WIDTH, y - TD_PADY, fps_counter % 10); - } + } void check_all_prefs(void) @@ -2097,7 +2154,7 @@ void check_all_prefs(void) check_prefs_changed_audio (); check_prefs_changed_custom (); - check_prefs_changed_cpu (); + //check_prefs_changed_cpu (); if (check_prefs_changed_gfx ()) { init_row_map (); init_aspect_maps (); @@ -2162,29 +2219,31 @@ static _INLINE_ void finish_drawing_frame (void) #if defined (GP2X) || defined (PSP) || defined (GIZMONDO) || defined (IPHONE) if (mainMenu_showStatus) { + /* HD LED off delay */ + static int countdown = HDLED_TIMEOUT; + if (gui_data.hdled != HDLED_OFF) + { + if (countdown-- <= 0) { + gui_data.hdled = HDLED_OFF; + countdown = HDLED_TIMEOUT; + } + } else { + countdown = HDLED_TIMEOUT; + } + + for (i = 0; i < TD_TOTAL_HEIGHT; i++) { + int line = GFXVIDINFO_HEIGHT - TD_TOTAL_HEIGHT + i; + draw_status_line (line); + } #endif - if ( (frame_redraw_necessary) || fps_counter_changed - || (back_drive_track0!=gui_data.drive_track[0]) - || (back_drive_motor0!=gui_data.drive_motor[0]) + #if NUM_DRIVES > 1 - || (back_drive_track1!=gui_data.drive_track[1]) - || (back_drive_motor1!=gui_data.drive_motor[1]) + #endif - || (back_powerled!=gui_data.powerled) ) - { - back_drive_track0=gui_data.drive_track[0]; - back_drive_motor0=gui_data.drive_motor[0]; + #if NUM_DRIVES > 1 - back_drive_track1=gui_data.drive_track[1]; - back_drive_motor1=gui_data.drive_motor[1]; -#endif - back_powerled=gui_data.powerled; - for (i = 0; i < TD_TOTAL_HEIGHT; i++) { - int line = GFXVIDINFO_HEIGHT - TD_TOTAL_HEIGHT + i; - draw_status_line (line); - do_flush_line (line); - } - } + #endif + #if defined (GP2X) || defined (PSP) || defined (GIZMONDO) || defined (IPHONE) } #endif @@ -2243,6 +2302,7 @@ void vsync_handle_redraw (int long_frame, int lof_changed) #ifdef USE_FAME_CORE m68k_release_timeslice(); #endif + filesys_prepare_reset(); return; } @@ -2281,6 +2341,8 @@ void reset_drawing (void) for (i = 0; i < sizeof linestate / sizeof *linestate; i++) linestate[i] = LINE_UNDECIDED; + + uae4all_memclr(gfx_mem, GFXVIDINFO_HEIGHT * GFXVIDINFO_WIDTH * GFXVIDINFO_PIXBYTES); //clear complete gfx_mem on reset to clear potential left overs (56 lines ) when switching from PAL 256 to NTSC 200. mithrendal xlinebuffer = gfx_mem; init_aspect_maps (); @@ -2306,3 +2368,5 @@ void drawing_init () gen_pfield_tables(); } + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/expansion.cpp b/uae4all_gp2x_0.7.2a/src/expansion.cpp new file mode 100755 index 0000000..e37d05c --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/expansion.cpp @@ -0,0 +1,1026 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * AutoConfig (tm) Expansions (ZorroII/III) + * + * Copyright 1996,1997 Stefan Reinauer + * Copyright 1997 Brian King + * - added gfxcard code + * + */ + +#include "sysconfig.h" +#include "sysdeps.h" + +#include "config.h" +#include "options.h" +#include "uae.h" +#include "memory-uae.h" +#include "autoconf.h" +#include "picasso96.h" +#include "savestate.h" +#include "filesys.h" +#include "cfgfile.h" + +#define MAX_EXPANSION_BOARDS 8 + +/* ********************************************************** */ +/* 00 / 02 */ +/* er_Type */ + +#define Z2_MEM_8MB 0x00 /* Size of Memory Block */ +#define Z2_MEM_4MB 0x07 +#define Z2_MEM_2MB 0x06 +#define Z2_MEM_1MB 0x05 +#define Z2_MEM_512KB 0x04 +#define Z2_MEM_256KB 0x03 +#define Z2_MEM_128KB 0x02 +#define Z2_MEM_64KB 0x01 +/* extended definitions */ +#define Z2_MEM_16MB 0x00 +#define Z2_MEM_32MB 0x01 +#define Z2_MEM_64MB 0x02 +#define Z2_MEM_128MB 0x03 +#define Z2_MEM_256MB 0x04 +#define Z2_MEM_512MB 0x05 +#define Z2_MEM_1GB 0x06 + +#define chainedconfig 0x08 /* Next config is part of the same card */ +#define rom_card 0x10 /* ROM vector is valid */ +#define add_memory 0x20 /* Link RAM into free memory list */ + +#define zorroII 0xc0 /* Type of Expansion Card */ +#define zorroIII 0x80 + +/* ********************************************************** */ +/* 04 - 06 & 10-16 */ + +/* Manufacturer */ +#define commodore_g 513 /* Commodore Braunschweig (Germany) */ +#define commodore 514 /* Commodore West Chester */ +#define gvp 2017 /* GVP */ +#define ass 2102 /* Advanced Systems & Software */ +#define hackers_id 2011 /* Special ID for test cards */ + +/* Card Type */ +#define commodore_a2091 3 /* A2091 / A590 Card from C= */ +#define commodore_a2091_ram 10 /* A2091 / A590 Ram on HD-Card */ +#define commodore_a2232 70 /* A2232 Multiport Expansion */ +#define ass_nexus_scsi 1 /* Nexus SCSI Controller */ + +#define gvp_series_2_scsi 11 +#define gvp_iv_24_gfx 32 + +/* ********************************************************** */ +/* 08 - 0A */ +/* er_Flags */ +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +#define Z3_MEM_64KB 0x02 +#define Z3_MEM_128KB 0x03 +#define Z3_MEM_256KB 0x04 +#define Z3_MEM_512KB 0x05 +#define Z3_MEM_1MB 0x06 /* Zorro III card subsize */ +#define Z3_MEM_2MB 0x07 +#define Z3_MEM_4MB 0x08 +#define Z3_MEM_6MB 0x09 +#define Z3_MEM_8MB 0x0a +#define Z3_MEM_10MB 0x0b +#define Z3_MEM_12MB 0x0c +#define Z3_MEM_14MB 0x0d +#define Z3_MEM_16MB 0x00 +#define Z3_MEM_AUTO 0x01 +#define Z3_MEM_defunct1 0x0e +#define Z3_MEM_defunct2 0x0f +#endif + +#define force_z3 0x10 /* *MUST* be set if card is Z3 */ +#define ext_size 0x20 /* Use extended size table for bits 0-2 of er_Type */ +#define no_shutup 0x40 /* Card cannot receive Shut_up_forever */ +#define care_addr 0x80 /* Adress HAS to be $200000-$9fffff */ + +/* ********************************************************** */ +/* 40-42 */ +/* ec_interrupt (unused) */ + +#define enable_irq 0x01 /* enable Interrupt */ +#define reset_card 0x04 /* Reset of Expansion Card - must be 0 */ +#define card_int2 0x10 /* READ ONLY: IRQ 2 active */ +#define card_irq6 0x20 /* READ ONLY: IRQ 6 active */ +#define card_irq7 0x40 /* READ ONLY: IRQ 7 active */ +#define does_irq 0x80 /* READ ONLY: Card currently throws IRQ */ + +/* ********************************************************** */ + +/* ROM defines (DiagVec) */ + +#define rom_4bit (0x00<<14) /* ROM width */ +#define rom_8bit (0x01<<14) +#define rom_16bit (0x02<<14) + +#define rom_never (0x00<<12) /* Never run Boot Code */ +#define rom_install (0x01<<12) /* run code at install time */ +#define rom_binddrv (0x02<<12) /* run code with binddrivers */ + +uaecptr ROM_filesys_resname = 0, ROM_filesys_resid = 0; +uaecptr ROM_filesys_diagentry = 0; +uaecptr ROM_hardfile_resname = 0, ROM_hardfile_resid = 0; +uaecptr ROM_hardfile_init = 0; + +/* ********************************************************** */ + +static void (*card_init[MAX_EXPANSION_BOARDS]) (void); +static void (*card_map[MAX_EXPANSION_BOARDS]) (void); + +static int ecard = 0; + +/* ********************************************************** */ + +/* Please note: ZorroIII implementation seems to work different + * than described in the HRM. This claims that ZorroIII config + * address is 0xff000000 while the ZorroII config space starts + * at 0x00e80000. In reality, both, Z2 and Z3 cards are + * configured in the ZorroII config space. Kickstart 3.1 doesn't + * even do a single read or write access to the ZorroIII space. + * The original Amiga include files tell the same as the HRM. + * ZorroIII: If you set ext_size in er_Flags and give a Z2-size + * in er_Type you can very likely add some ZorroII address space + * to a ZorroIII card on a real Amiga. This is not implemented + * yet. + * -- Stefan + * + * Surprising that 0xFF000000 isn't used. Maybe it depends on the + * ROM. Anyway, the HRM says that Z3 cards may appear in Z2 config + * space, so what we are doing here is correct. + * -- Bernd + */ + +/* Autoconfig address space at 0xE80000 */ +static uae_u8 expamem[65536]; + +static uae_u8 expamem_lo; +static uae_u16 expamem_hi; + +/* + * Dummy entries to show that there's no card in a slot + */ + +static void expamem_map_clear (void) +{ + write_log ("expamem_map_clear() got called. Shouldn't happen.\n"); +} + +static void expamem_init_clear (void) +{ + memset (expamem, 0xff, sizeof expamem); +} +static void expamem_init_clear2 (void) +{ + expamem_init_clear(); + ecard = MAX_EXPANSION_BOARDS - 1; +} + +static uae_u32 expamem_lget (uaecptr) REGPARAM; +static uae_u32 expamem_wget (uaecptr) REGPARAM; +static uae_u32 expamem_bget (uaecptr) REGPARAM; +static void expamem_lput (uaecptr, uae_u32) REGPARAM; +static void expamem_wput (uaecptr, uae_u32) REGPARAM; +static void expamem_bput (uaecptr, uae_u32) REGPARAM; + +addrbank expamem_bank = { + expamem_lget, expamem_wget, expamem_bget, + expamem_lput, expamem_wput, expamem_bput, + default_xlate, default_check, NULL +}; + +static uae_u32 REGPARAM2 expamem_lget (uaecptr addr) +{ + write_log ("warning: READ.L from address $%lx \n", addr); + return 0xfffffffful; +} + +static uae_u32 REGPARAM2 expamem_wget (uaecptr addr) +{ + write_log ("warning: READ.W from address $%lx \n", addr); + return 0xffff; +} + +static uae_u32 REGPARAM2 expamem_bget (uaecptr addr) +{ + addr &= 0xFFFF; + return do_get_mem_byte (expamem + addr); +} + +static void REGPARAM2 expamem_write (uaecptr addr, uae_u32 value) +{ + addr &= 0xffff; + if (addr == 00 || addr == 02 || addr == 0x40 || addr == 0x42) { + do_put_mem_byte ((uae_u8 *)(expamem + addr), (value & 0xf0)); + do_put_mem_byte ((uae_u8 *)(expamem + addr + 2), (value & 0x0f) << 4); + } else { + do_put_mem_byte ((uae_u8 *)(expamem + addr), ~(value & 0xf0)); + do_put_mem_byte ((uae_u8 *)(expamem + addr + 2), ~(value & 0x0f) << 4); + } +} + +static int REGPARAM2 expamem_type (void) +{ + return ((do_get_mem_byte(expamem + 0) | do_get_mem_byte(expamem + 2) >> 4) & 0xc0); +} + +static void REGPARAM2 expamem_lput (uaecptr addr, uae_u32 value) +{ + write_log ("warning: WRITE.L to address $%lx : value $%lx\n", addr, value); +} + +static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) +{ + if (expamem_type() != zorroIII) + write_log ("warning: WRITE.W to address $%lx : value $%x\n", addr, value); + else { + switch (addr & 0xff) { + case 0x44: + if (expamem_type() == zorroIII) { + expamem_hi = value; + (*card_map[ecard]) (); + write_log (" Card %d (Zorro%s) done.\n", ecard + 1, expamem_type() == 0xc0 ? "II" : "III"); + ++ecard; + if (ecard < MAX_EXPANSION_BOARDS) + (*card_init[ecard]) (); + else + expamem_init_clear2 (); + } + break; + } + } +} + +static void REGPARAM2 expamem_bput (uaecptr addr, uae_u32 value) +{ + switch (addr & 0xff) { + case 0x30: + case 0x32: + expamem_hi = 0; + expamem_lo = 0; + expamem_write (0x48, 0x00); + break; + + case 0x48: + if (expamem_type () == zorroII) { + expamem_hi = value & 0xFF; + (*card_map[ecard]) (); + write_log (" Card %d (Zorro%s) done.\n", ecard + 1, expamem_type() == 0xc0 ? "II" : "III"); + ++ecard; + if (ecard < MAX_EXPANSION_BOARDS) + (*card_init[ecard]) (); + else + expamem_init_clear2 (); + } else if (expamem_type() == zorroIII) + expamem_lo = value; + break; + + case 0x4a: + if (expamem_type () == zorroII) + expamem_lo = value; + break; + + case 0x4c: + write_log (" Card %d (Zorro %s) had no success.\n", ecard + 1, expamem_type() == 0xc0 ? "II" : "III"); + ++ecard; + if (ecard < MAX_EXPANSION_BOARDS) + (*card_init[ecard]) (); + else + expamem_init_clear2 (); + break; + } +} + +/* ********************************************************** */ + +/* + * Fast Memory + */ + +static uae_u32 fastmem_mask; + +static uae_u32 fastmem_lget (uaecptr) REGPARAM; +static uae_u32 fastmem_wget (uaecptr) REGPARAM; +static uae_u32 fastmem_bget (uaecptr) REGPARAM; +static void fastmem_lput (uaecptr, uae_u32) REGPARAM; +static void fastmem_wput (uaecptr, uae_u32) REGPARAM; +static void fastmem_bput (uaecptr, uae_u32) REGPARAM; +static int fastmem_check (uaecptr addr, uae_u32 size) REGPARAM; +static uae_u8 *fastmem_xlate (uaecptr addr) REGPARAM; + +static uae_u32 fastmem_start; /* Determined by the OS */ +static uae_u8 *fastmemory = NULL; + +uae_u32 REGPARAM2 fastmem_lget (uaecptr addr) +{ + uae_u32 *m; + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + m = (uae_u32 *)(fastmemory + addr); + return do_get_mem_long (m); +} + +uae_u32 REGPARAM2 fastmem_wget (uaecptr addr) +{ + uae_u16 *m; + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + m = (uae_u16 *)(fastmemory + addr); + return do_get_mem_word (m); +} + +uae_u32 REGPARAM2 fastmem_bget (uaecptr addr) +{ + uae_u8 *m; + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + m = (uae_u8 *)(fastmemory + addr); + return do_get_mem_byte(m); +} + +void REGPARAM2 fastmem_lput (uaecptr addr, uae_u32 l) +{ + uae_u32 *m; + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + m = (uae_u32 *)(fastmemory + addr); + do_put_mem_long (m, l); +} + +void REGPARAM2 fastmem_wput (uaecptr addr, uae_u32 w) +{ + uae_u16 *m; + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + m = (uae_u16 *)(fastmemory + addr); + do_put_mem_word (m, w); +} + +void REGPARAM2 fastmem_bput (uaecptr addr, uae_u32 b) +{ + uae_u8 *m; + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + m = (uae_u8 *)(fastmemory + addr); + do_put_mem_byte(m, b); +} + +static int REGPARAM2 fastmem_check (uaecptr addr, uae_u32 size) +{ + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + return (addr + size) <= allocated_fastmem; +} + +static uae_u8 REGPARAM2 *fastmem_xlate (uaecptr addr) +{ + addr -= fastmem_start /*& fastmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= fastmem_mask; +#endif + return fastmemory + addr; +} + +addrbank fastmem_bank = { + fastmem_lget, fastmem_wget, fastmem_bget, + fastmem_lput, fastmem_wput, fastmem_bput, + fastmem_xlate, fastmem_check, NULL +}; + + +/* + * Filesystem device ROM + * This is very simple, the Amiga shouldn't be doing things with it. + */ + +static uae_u32 filesys_lget (uaecptr) REGPARAM; +static uae_u32 filesys_wget (uaecptr) REGPARAM; +static uae_u32 filesys_bget (uaecptr) REGPARAM; +static void filesys_lput (uaecptr, uae_u32) REGPARAM; +static void filesys_wput (uaecptr, uae_u32) REGPARAM; +static void filesys_bput (uaecptr, uae_u32) REGPARAM; + +static uae_u32 filesys_start; /* Determined by the OS */ +uae_u8 *filesysory; + +uae_u32 REGPARAM2 filesys_lget (uaecptr addr) +{ + uae_u8 *m; + addr -= filesys_start & 65535; + addr &= 65535; + m = filesysory + addr; + return do_get_mem_long ((uae_u32 *)m); +} + +uae_u32 REGPARAM2 filesys_wget (uaecptr addr) +{ + uae_u8 *m; + addr -= filesys_start & 65535; + addr &= 65535; + m = filesysory + addr; + return do_get_mem_word ((uae_u16 *)m); +} + +uae_u32 REGPARAM2 filesys_bget (uaecptr addr) +{ + addr -= filesys_start & 65535; + addr &= 65535; +#ifdef USE_FAME_CORE + return filesysory[addr ^ 1]; +#else + return filesysory[addr]; +#endif +} + +static void REGPARAM2 filesys_lput (uaecptr addr, uae_u32 l) +{ + write_log ("filesys_lput called\n"); +} + +static void REGPARAM2 filesys_wput (uaecptr addr, uae_u32 w) +{ + write_log ("filesys_wput called\n"); +} + +static void REGPARAM2 filesys_bput (uaecptr addr, uae_u32 b) +{ + write_log ("filesys_bput called. This usually means that you are using\n"); + write_log ("Kickstart 1.2. Please give UAE the \"-a\" option next time\n"); + write_log ("you start it. If you are _not_ using Kickstart 1.2, then\n"); + write_log ("there's a bug somewhere.\n"); + write_log ("Exiting...\n"); + g_emulator.uae_quit (); +} + +addrbank filesys_bank = { + filesys_lget, filesys_wget, filesys_bget, + filesys_lput, filesys_wput, filesys_bput, + default_xlate, default_check, NULL +}; + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +/* + * Z3fastmem Memory + */ + + +static uae_u32 z3fastmem_mask; + +static uae_u32 z3fastmem_lget (uaecptr) REGPARAM; +static uae_u32 z3fastmem_wget (uaecptr) REGPARAM; +static uae_u32 z3fastmem_bget (uaecptr) REGPARAM; +static void z3fastmem_lput (uaecptr, uae_u32) REGPARAM; +static void z3fastmem_wput (uaecptr, uae_u32) REGPARAM; +static void z3fastmem_bput (uaecptr, uae_u32) REGPARAM; +static int z3fastmem_check (uaecptr addr, uae_u32 size) REGPARAM; +static uae_u8 *z3fastmem_xlate (uaecptr addr) REGPARAM; + +static uae_u32 z3fastmem_start; /* Determined by the OS */ +static uae_u8 *z3fastmem = NULL; + +uae_u32 REGPARAM2 z3fastmem_lget (uaecptr addr) +{ + uae_u8 *m; + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; + m = z3fastmem + addr; + return do_get_mem_long ((uae_u32 *)m); +} + +uae_u32 REGPARAM2 z3fastmem_wget (uaecptr addr) +{ + uae_u8 *m; + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; + m = z3fastmem + addr; + return do_get_mem_word ((uae_u16 *)m); +} + +uae_u32 REGPARAM2 z3fastmem_bget (uaecptr addr) +{ + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; +#ifdef USE_FAME_CORE /* swabbed memory */ + return z3fastmem[addr ^ 1]; +#else + return z3fastmem[addr]; +#endif +} + +void REGPARAM2 z3fastmem_lput (uaecptr addr, uae_u32 l) +{ + uae_u8 *m; + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; + m = z3fastmem + addr; + do_put_mem_long ((uae_u32 *)m, l); +} + +void REGPARAM2 z3fastmem_wput (uaecptr addr, uae_u32 w) +{ + uae_u8 *m; + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; + m = z3fastmem + addr; + do_put_mem_word ((uae_u16 *)m, w); +} + +void REGPARAM2 z3fastmem_bput (uaecptr addr, uae_u32 b) +{ + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; +#ifdef USE_FAME_CORE /* swabbed memory */ + z3fastmem[addr ^ 1] = b; +#else + z3fastmem[addr] = b; +#endif +} + +static int REGPARAM2 z3fastmem_check (uaecptr addr, uae_u32 size) +{ + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; + return (addr + size) <= allocated_z3fastmem; +} + +static uae_u8 REGPARAM2 *z3fastmem_xlate (uaecptr addr) +{ + addr -= z3fastmem_start & z3fastmem_mask; + addr &= z3fastmem_mask; + return z3fastmem + addr; +} + +addrbank z3fastmem_bank = { + z3fastmem_lget, z3fastmem_wget, z3fastmem_bget, + z3fastmem_lput, z3fastmem_wput, z3fastmem_bput, + z3fastmem_xlate, z3fastmem_check, NULL/*, // WinUAE structure members + "z3fastmem", NULL, NULL, 0*/ +}; + +/* Z3-based UAEGFX-card */ +uae_u32 gfxmem_mask; /* for memory.c */ +uae_u8 *gfxmemory; +uae_u32 gfxmem_start; +#endif + +/* ********************************************************** */ + +/* + * Expansion Card (ZORRO II) for 1/2/4/8 MB of Fast Memory + */ + +static void expamem_map_fastcard (void) +{ + fastmem_start = ((expamem_hi | (expamem_lo >> 4)) << 16); + map_banks (&fastmem_bank, fastmem_start >> 16, allocated_fastmem >> 16, allocated_fastmem); + write_log ("Fastcard: mapped @$%lx: %dMB fast memory\n", fastmem_start, allocated_fastmem >> 20); +} + +static void expamem_init_fastcard (void) +{ + expamem_init_clear(); + if (allocated_fastmem == 0x100000) + expamem_write (0x00, Z2_MEM_1MB + add_memory + zorroII); + else if (allocated_fastmem == 0x200000) + expamem_write (0x00, Z2_MEM_2MB + add_memory + zorroII); + else if (allocated_fastmem == 0x400000) + expamem_write (0x00, Z2_MEM_4MB + add_memory + zorroII); + else if (allocated_fastmem == 0x800000) + expamem_write (0x00, Z2_MEM_8MB + add_memory + zorroII); + + expamem_write (0x08, care_addr); + + expamem_write (0x04, 1); + + expamem_write (0x10, hackers_id >> 8); + expamem_write (0x14, hackers_id & 0xff); + + expamem_write (0x18, 0x00); /* ser.no. Byte 0 */ + expamem_write (0x1c, 0x00); /* ser.no. Byte 1 */ + expamem_write (0x20, 0x00); /* ser.no. Byte 2 */ + expamem_write (0x24, 0x01); /* ser.no. Byte 3 */ + + expamem_write (0x28, 0x00); /* Rom-Offset hi */ + expamem_write (0x2c, 0x00); /* ROM-Offset lo */ + + expamem_write (0x40, 0x00); /* Ctrl/Statusreg.*/ +} + +/* ********************************************************** */ + +/* + * Filesystem device + */ + +static void expamem_map_filesys (void) +{ + uaecptr a; + + filesys_start = ((expamem_hi | (expamem_lo >> 4)) << 16); + map_banks (&filesys_bank, filesys_start >> 16, 1, 0); + write_log ("Filesystem: mapped memory @$%lx.\n", filesys_start); + /* 68k code needs to know this. */ + a = here (); + org (RTAREA_BASE+0xFFFC); + dl (filesys_start + 0x2000); + org (a); +} + +static void expamem_init_filesys (void) +{ + /* struct DiagArea - the size has to be large enough to store several device ROMTags */ + uae_u8 diagarea[] = { 0x90, 0x00, /* da_Config, da_Flags */ + 0x02, 0x00, /* da_Size */ + 0x01, 0x00, /* da_DiagPoint */ + 0x01, 0x06 /* da_BootPoint */ + }; + +#ifdef USE_FAME_CORE + /* swabbed data */ + swab_memory (diagarea, 8); +#endif + + expamem_init_clear(); + expamem_write (0x00, Z2_MEM_64KB | rom_card | zorroII); + + expamem_write (0x08, no_shutup); + + expamem_write (0x04, 2); + expamem_write (0x10, hackers_id >> 8); + expamem_write (0x14, hackers_id & 0xff); + + expamem_write (0x18, 0x00); /* ser.no. Byte 0 */ + expamem_write (0x1c, 0x00); /* ser.no. Byte 1 */ + expamem_write (0x20, 0x00); /* ser.no. Byte 2 */ + expamem_write (0x24, 0x01); /* ser.no. Byte 3 */ + + /* er_InitDiagVec */ + expamem_write (0x28, 0x10); /* Rom-Offset hi */ + expamem_write (0x2c, 0x00); /* ROM-Offset lo */ + + expamem_write (0x40, 0x00); /* Ctrl/Statusreg.*/ + + /* Build a DiagArea */ + memcpy (expamem + 0x1000, diagarea, sizeof diagarea); + + /* Call DiagEntry */ + do_put_mem_word ((uae_u16 *)(expamem + 0x1100), (0x4EF9)); /* JMP */ + do_put_mem_long ((uae_u32 *)(expamem + 0x1102), (ROM_filesys_diagentry)); + + /* What comes next is a plain bootblock */ + do_put_mem_word ((uae_u16 *)(expamem + 0x1106), (0x4EF9)); /* JMP */ + do_put_mem_long ((uae_u32 *)(expamem + 0x1108), (EXPANSION_bootcode)); + + memcpy (filesysory, expamem, 0x3000); +} + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +/* + * Zorro III expansion memory + */ + +static void expamem_map_z3fastmem (void) +{ + z3fastmem_start = ((expamem_hi | (expamem_lo >> 4)) << 16); + map_banks (&z3fastmem_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16, + allocated_z3fastmem); + + write_log ("Fastmem (32bit): mapped @$%lx: %d MB Zorro III fast memory \n", + z3fastmem_start, allocated_z3fastmem / 0x100000); +} + +static void expamem_init_z3fastmem (void) +{ + int code = (allocated_z3fastmem == 0x100000 ? Z2_MEM_1MB + : allocated_z3fastmem == 0x200000 ? Z2_MEM_2MB + : allocated_z3fastmem == 0x400000 ? Z2_MEM_4MB + : allocated_z3fastmem == 0x800000 ? Z2_MEM_8MB + : allocated_z3fastmem == 0x1000000 ? Z2_MEM_16MB + : allocated_z3fastmem == 0x2000000 ? Z2_MEM_32MB + : allocated_z3fastmem == 0x4000000 ? Z2_MEM_64MB + : allocated_z3fastmem == 0x8000000 ? Z2_MEM_128MB + : allocated_z3fastmem == 0x10000000 ? Z2_MEM_256MB + : allocated_z3fastmem == 0x20000000 ? Z2_MEM_512MB + : Z2_MEM_1GB); + expamem_init_clear(); + expamem_write (0x00, add_memory | zorroIII | code); + + expamem_write (0x08, no_shutup | force_z3 | (allocated_z3fastmem > 0x800000 ? ext_size : Z3_MEM_AUTO)); + + expamem_write (0x04, 3); + + expamem_write (0x10, hackers_id >> 8); + expamem_write (0x14, hackers_id & 0xff); + + expamem_write (0x18, 0x00); /* ser.no. Byte 0 */ + expamem_write (0x1c, 0x00); /* ser.no. Byte 1 */ + expamem_write (0x20, 0x00); /* ser.no. Byte 2 */ + expamem_write (0x24, 0x01); /* ser.no. Byte 3 */ + + expamem_write (0x28, 0x00); /* Rom-Offset hi */ + expamem_write (0x2c, 0x00); /* ROM-Offset lo */ + + expamem_write (0x40, 0x00); /* Ctrl/Statusreg.*/ +} + +#ifdef PICASSO96 +/* + * Fake Graphics Card (ZORRO III) - BDK + */ + +static void expamem_map_gfxcard (void) +{ + gfxmem_start = ((expamem_hi | (expamem_lo >> 4)) << 16); + map_banks (&gfxmem_bank, gfxmem_start >> 16, allocated_gfxmem >> 16, allocated_gfxmem); + write_log ("UAEGFX-card: mapped @$%lx \n", gfxmem_start); +} + +static void expamem_init_gfxcard (void) +{ + expamem_init_clear(); + expamem_write (0x00, zorroIII); + + switch (allocated_gfxmem) { + case 0x00100000: + expamem_write (0x08, no_shutup | force_z3 | Z3_MEM_1MB); + break; + case 0x00200000: + expamem_write (0x08, no_shutup | force_z3 | Z3_MEM_2MB); + break; + case 0x00400000: + expamem_write (0x08, no_shutup | force_z3 | Z3_MEM_4MB); + break; + case 0x00800000: + expamem_write (0x08, no_shutup | force_z3 | Z3_MEM_8MB); + break; + } + + expamem_write (0x04, 96); + + expamem_write (0x10, hackers_id >> 8); + expamem_write (0x14, hackers_id & 0xff); + + expamem_write (0x18, 0x00); /* ser.no. Byte 0 */ + expamem_write (0x1c, 0x00); /* ser.no. Byte 1 */ + expamem_write (0x20, 0x00); /* ser.no. Byte 2 */ + expamem_write (0x24, 0x01); /* ser.no. Byte 3 */ + + expamem_write (0x28, 0x00); /* Rom-Offset hi */ + expamem_write (0x2c, 0x00); /* ROM-Offset lo */ + + expamem_write (0x40, 0x00); /* Ctrl/Statusreg.*/ +} +#endif + +static long fast_filepos, z3_filepos; +#else +static long fast_filepos; +#endif + +static void allocate_expamem (void) +{ + //currprefs.fastmem_size = changed_prefs.fastmem_size; stoens: commented out when adding hd support + int fastmem_size = prefs_fastmem_size; // currprefs.fastmem_size stoens: commented out when adding hd support +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + currprefs.z3fastmem_size = changed_prefs.z3fastmem_size; + currprefs.gfxmem_size = changed_prefs.gfxmem_size; +#endif + + if (allocated_fastmem != fastmem_size) { + if (fastmemory) + mapped_free (fastmemory); + fastmemory = 0; + allocated_fastmem = fastmem_size; + fastmem_mask = allocated_fastmem - 1; + + if (allocated_fastmem) { + fastmemory = mapped_malloc (allocated_fastmem, "fast"); + if (fastmemory == 0) { + write_log ("Out of memory for fastmem card.\n"); + allocated_fastmem = 0; + } + } + } +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + if (allocated_z3fastmem != currprefs.z3fastmem_size) { + if (z3fastmem) + mapped_free (z3fastmem); + z3fastmem = 0; + + allocated_z3fastmem = currprefs.z3fastmem_size; + z3fastmem_mask = allocated_z3fastmem - 1; + + if (allocated_z3fastmem) { + z3fastmem = mapped_malloc (allocated_z3fastmem, "z3"); + if (z3fastmem == 0) { + write_log ("Out of memory for 32 bit fast memory.\n"); + allocated_z3fastmem = 0; + } + } + } + if (allocated_gfxmem != currprefs.gfxmem_size) { + if (gfxmemory) + mapped_free (gfxmemory); + gfxmemory = 0; + + allocated_gfxmem = currprefs.gfxmem_size; + gfxmem_mask = allocated_gfxmem - 1; + + if (allocated_gfxmem) { + gfxmemory = mapped_malloc (allocated_gfxmem, "gfx"); + if (gfxmemory == 0) { + write_log ("Out of memory for graphics card memory\n"); + allocated_gfxmem = 0; + } + } + } + + z3fastmem_bank.baseaddr = z3fastmem; +#endif + fastmem_bank.baseaddr = fastmemory; + + if (savestate_state == STATE_RESTORE) { + if (allocated_fastmem > 0) { + fseek ((FILE *) savestate_file, fast_filepos, SEEK_SET); + fread (fastmemory, 1, allocated_fastmem, (FILE *) savestate_file); + map_banks (&fastmem_bank, fastmem_start >> 16, fastmem_size >> 16, + allocated_fastmem); + } +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + if (allocated_z3fastmem > 0) { + fseek ((FILE *) savestate_file, z3_filepos, SEEK_SET); + fread (z3fastmem, 1, allocated_z3fastmem, (FILE *) savestate_file); + map_banks (&z3fastmem_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16, + allocated_z3fastmem); + } +#endif + } +} + +void expamem_reset (void) +{ + int do_mount = 1; + int cardno = 0; + ecard = 0; + + allocate_expamem (); + + /* check if Kickstart version is below 1.3 */ + if (! ersatzkickfile + && (/* Kickstart 1.0 & 1.1! */ + get_word (0xF8000C) == 0xFFFF + /* Kickstart < 1.3 */ + || get_word (0xF8000C) < 34)) + { + /* warn user */ + write_log ("Kickstart version is below 1.3! Disabling autoconfig devices.\n"); + do_mount = 0; + } + /* No need for filesystem stuff if there aren't any mounted. */ + if (nr_units (currprefs_mountinfo) == 0) { + do_mount = 0; + } + + if (fastmemory != NULL) { + card_init[cardno] = expamem_init_fastcard; + card_map[cardno++] = expamem_map_fastcard; + } +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + if (z3fastmem != NULL) { + card_init[cardno] = expamem_init_z3fastmem; + card_map[cardno++] = expamem_map_z3fastmem; + } +#endif +#ifdef PICASSO96 + if (gfxmemory != NULL) { + card_init[cardno] = expamem_init_gfxcard; + card_map[cardno++] = expamem_map_gfxcard; + } +#endif + if (do_mount && ! ersatzkickfile) { + card_init[cardno] = expamem_init_filesys; + card_map[cardno++] = expamem_map_filesys; + } + while (cardno < MAX_EXPANSION_BOARDS) { + card_init[cardno] = expamem_init_clear; + card_map[cardno++] = expamem_map_clear; + } + + (*card_init[0]) (); +} + +void expansion_init (void) +{ +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IHPONE) ) + //z3fastmem = 0; // stoens: commented out when adding hd support + //gfxmemory = 0; +#endif + fastmemory = 0; +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + allocated_z3fastmem = 0; + allocated_gfxmem = 0; +#endif + allocated_fastmem = 0; + + allocate_expamem (); + + filesysory = (uae_u8 *) mapped_malloc (0x10000, "filesys"); + if (!filesysory) { + write_log ("virtual memory exhausted (filesysory)!\n"); + exit (0); + } + + filesys_bank.baseaddr = (uae_u8*)filesysory; +} + +void expansion_cleanup (void) +{ + if (fastmemory) + mapped_free (fastmemory); +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + if (z3fastmem) + mapped_free (z3fastmem); + if (gfxmemory) + mapped_free (gfxmemory); +#endif + if (filesysory) + mapped_free (filesysory); + fastmemory = 0; +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + z3fastmem = 0; + gfxmemory = 0; +#endif + filesysory = 0; +} + +/* State save/restore code. */ + +uae_u8 *save_fram (int *len) +{ + *len = allocated_fastmem; + return fastmemory; +} + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +uae_u8 *save_zram (int *len) +{ + *len = allocated_z3fastmem; + return z3fastmem; +} +#endif + +void restore_fram (uae_u32 len, size_t filepos) +{ + fast_filepos = filepos; + //changed_prefs.fastmem_size = len; // stoens: commented out when adding hd support +} + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +void restore_zram (uae_u32 len, size_t filepos) +{ + z3_filepos = filepos; + changed_prefs.z3fastmem_size = len; +} +#endif + +uae_u8 *save_expansion (int *len) +{ + uae_u8 *dstbak,*dst; + dstbak = dst = (uae_u8 *)malloc (16); + save_u32 (fastmem_start); +#if defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) + save_u32 (0); +#else + save_u32 (z3fastmem_start); +#endif + *len = dst - dstbak; + return dstbak; +} + +uae_u8 *restore_expansion (uae_u8 *src) +{ + fastmem_start = restore_u32 (); +#if defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) + restore_u32 (); +#else + z3fastmem_start = restore_u32 (); +#endif + return (uae_u8 *) src; +} diff --git a/uae4all_gp2x_0.7.2a/src/filesys.cpp b/uae4all_gp2x_0.7.2a/src/filesys.cpp new file mode 100755 index 0000000..3803ed7 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/filesys.cpp @@ -0,0 +1,3466 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wparentheses" +#pragma clang diagnostic ignored "-Wformat" +#pragma clang diagnostic ignored "-Wc++11-compat-deprecated-writable-strings" + + +/* + * UAE - The Un*x Amiga Emulator + * + * Unix file system handler for AmigaDOS + * + * Copyright 1996 Ed Hanway + * Copyright 1996, 1997 Bernd Schmidt + * + * Version 0.4: 970308 + * + * Based on example code (c) 1988 The Software Distillery + * and published in Transactor for the Amiga, Volume 2, Issues 2-5. + * (May - August 1989) + * + * Known limitations: + * Does not support ACTION_INHIBIT (big deal). + * Does not support several 2.0+ packet types. + * Does not support removable volumes. + * May not return the correct error code in some cases. + * Does not check for sane values passed by AmigaDOS. May crash the emulation + * if passed garbage values. + * Could do tighter checks on malloc return values. + * Will probably fail spectacularly in some cases if the filesystem is + * modified at the same time by another process while UAE is running. + */ + +#include "sysconfig.h" +#include "sysdeps.h" + +#include "config.h" +#include "thread.h" +#include "options.h" +#include "uae.h" +#include "memory-uae.h" +#include "custom.h" +#include "events.h" +//#include "newcpu.h" +#include "m68k/m68k_intrf.h" +#include "filesys.h" +#include "autoconf.h" +#include "fsusage.h" +#include "native2amiga.h" +#include "scsidev.h" +#include "fsdb.h" +#include "gui.h" +#include "cfgfile.h" + +#define TRACING_ENABLED 0 +#if TRACING_ENABLED +#define TRACE(x) do { write_log x; } while(0) +#define DUMPLOCK(u,x) dumplock(u,x) +#else +#define TRACE(x) +#define DUMPLOCK(u,x) +#endif + +static long dos_errno(void) +{ + int e = errno; + + switch (e) { + case ENOMEM: return ERROR_NO_FREE_STORE; + case EEXIST: return ERROR_OBJECT_EXISTS; + case EACCES: return ERROR_WRITE_PROTECTED; + case ENOENT: return ERROR_OBJECT_NOT_AROUND; + case ENOTDIR: return ERROR_OBJECT_WRONG_TYPE; + case ENOSPC: return ERROR_DISK_IS_FULL; + case EBUSY: return ERROR_OBJECT_IN_USE; + case EISDIR: return ERROR_OBJECT_WRONG_TYPE; +#if defined(ETXTBSY) + case ETXTBSY: return ERROR_OBJECT_IN_USE; +#endif +#if defined(EROFS) + case EROFS: return ERROR_DISK_WRITE_PROTECTED; +#endif +#if defined(ENOTEMPTY) +#if ENOTEMPTY != EEXIST + case ENOTEMPTY: return ERROR_DIRECTORY_NOT_EMPTY; +#endif +#endif + + default: + TRACE(("Unimplemented error %s\n", strerror(e))); + return ERROR_NOT_IMPLEMENTED; + } +} + +/* + * This _should_ be no issue for us, but let's rather use a guaranteed + * thread safe function if we have one. + * This used to be broken in glibc versions <= 2.0.1 (I think). I hope + * no one is using this these days. + * Michael Krause says it's also broken in libc5. ARRRGHHHHHH!!!! + */ +#if 0 && defined HAVE_READDIR_R + +static struct dirent *my_readdir (DIR *dirstream, struct dirent *space) +{ + struct dirent *loc; + if (readdir_r (dirstream, space, &loc) == 0) { + /* Success */ + return loc; + } + return 0; +} + +#else +#define my_readdir(dirstream, space) readdir(dirstream) +#endif + +uaecptr filesys_initcode; +static uae_u32 fsdevname, filesys_configdev; + +#define FS_STARTUP 0 +#define FS_GO_DOWN 1 + +typedef struct { + char *devname; /* device name, e.g. UAE0: */ + uaecptr devname_amiga; + uaecptr startup; + char *volname; /* volume name, e.g. CDROM, WORK, etc. */ + char *rootdir; /* root unix directory */ + int readonly; /* disallow write access? */ + int devno; + + struct hardfiledata hf; + + /* Threading stuff */ + smp_comm_pipe *unit_pipe, *back_pipe; + uae_thread_id tid; + struct _unit *volatile self; + /* Reset handling */ + uae_sem_t reset_sync_sem; + int reset_state; +} UnitInfo; + +#define MAX_UNITS 20 + +struct uaedev_mount_info { + int num_units; + UnitInfo ui[MAX_UNITS]; +}; + +static struct uaedev_mount_info *current_mountinfo; + +int nr_units (struct uaedev_mount_info *mountinfo) +{ + return mountinfo->num_units; +} + +int is_hardfile (struct uaedev_mount_info *mountinfo, int unit_no) +{ + return mountinfo->ui[unit_no].volname == 0; +} + +static void close_filesys_unit (UnitInfo *uip) +{ + if (uip->hf.fd != 0) + fclose (uip->hf.fd); + if (uip->volname != 0) + free (uip->volname); + if (uip->devname != 0) + free (uip->devname); + if (uip->rootdir != 0) + free (uip->rootdir); + if (uip->unit_pipe) + free (uip->unit_pipe); + if (uip->back_pipe) + free (uip->back_pipe); + + uip->unit_pipe = 0; + uip->back_pipe = 0; + + uip->hf.fd = 0; + uip->volname = 0; + uip->devname = 0; + uip->rootdir = 0; +} + +char *get_filesys_unit (struct uaedev_mount_info *mountinfo, int nr, + char **volname, char **rootdir, int *readonly, + int *secspertrack, int *surfaces, int *reserved, + int *cylinders, int *size, int *blocksize) +{ + UnitInfo *uip = mountinfo->ui + nr; + + if (nr >= mountinfo->num_units) + return "No slot allocated for this unit"; + + *volname = uip->volname ? my_strdup (uip->volname) : 0; + *rootdir = uip->rootdir ? my_strdup (uip->rootdir) : 0; + *readonly = uip->readonly; + *secspertrack = uip->hf.secspertrack; + *surfaces = uip->hf.surfaces; + *reserved = uip->hf.reservedblocks; + *size = uip->hf.size; + *cylinders = uip->hf.nrcyls; + *blocksize = uip->hf.blocksize; + return 0; +} + +static char *set_filesys_unit_1 (struct uaedev_mount_info *mountinfo, int nr, + char *volname, char *rootdir, int readonly, + int secspertrack, int surfaces, int reserved, + int blocksize) +{ + UnitInfo *ui = mountinfo->ui + nr; + + if (nr >= mountinfo->num_units) + return "No slot allocated for this unit"; + + ui->hf.fd = 0; + + ui->hf.size = 0; + ui->hf.nrcyls = 0; + ui->hf.secspertrack = 0; + ui->hf.surfaces = 0; + ui->hf.reservedblocks = 0; + ui->hf.blocksize = 0; + + ui->devname = 0; + ui->volname = 0; + ui->rootdir = 0; + ui->unit_pipe = 0; + ui->back_pipe = 0; + + if (volname != 0) { + ui->volname = my_strdup (volname); + ui->hf.fd = 0; + } else { + ui->volname = 0; + ui->hf.fd = fopen (rootdir, "r+b"); + if (ui->hf.fd == 0) { + readonly = 1; + ui->hf.fd = fopen (rootdir, "rb"); + } + if (ui->hf.fd == 0) + return "Hardfile not found"; + + if (secspertrack < 1 || secspertrack > 32767 + || surfaces < 1 || surfaces > 1023 + || reserved < 0 || reserved > 1023 + || (blocksize & (blocksize - 1)) != 0) + { + return "Bad hardfile geometry"; + } + fseek (ui->hf.fd, 0, SEEK_END); + ui->hf.size = ftell (ui->hf.fd); + ui->hf.secspertrack = secspertrack; + ui->hf.surfaces = surfaces; + ui->hf.reservedblocks = reserved; + ui->hf.nrcyls = (secspertrack * surfaces + ? (ui->hf.size / blocksize) / (secspertrack * surfaces) + : 0); + ui->hf.blocksize = blocksize; + } + ui->self = 0; + ui->reset_state = FS_STARTUP; + ui->rootdir = my_strdup (rootdir); + ui->readonly = readonly; + + ui->devno = 0; + ui->tid = NULL; + ui->reset_sync_sem = NULL; + + return 0; +} + +char *set_filesys_unit (struct uaedev_mount_info *mountinfo, int nr, + char *volname, char *rootdir, int readonly, + int secspertrack, int surfaces, int reserved, + int blocksize) +{ + UnitInfo ui = mountinfo->ui[nr]; + char *result = set_filesys_unit_1 (mountinfo, nr, volname, rootdir, readonly, + secspertrack, surfaces, reserved, blocksize); + if (result) + mountinfo->ui[nr] = ui; + else + close_filesys_unit (&ui); + + return result; +} + +char *add_filesys_unit (struct uaedev_mount_info *mountinfo, + char *volname, char *rootdir, int readonly, + int secspertrack, int surfaces, int reserved, + int blocksize) +{ + char *retval; + int nr = mountinfo->num_units; + UnitInfo *uip = mountinfo->ui + nr; + + if (nr >= MAX_UNITS) + return "Maximum number of file systems mounted"; + + mountinfo->num_units++; + retval = set_filesys_unit_1 (mountinfo, nr, volname, rootdir, readonly, + secspertrack, surfaces, reserved, blocksize); + if (retval) + mountinfo->num_units--; + return retval; +} + +int kill_filesys_unit (struct uaedev_mount_info *mountinfo, int nr) +{ + UnitInfo *uip = mountinfo->ui; + if (nr >= mountinfo->num_units || nr < 0) + return -1; + + close_filesys_unit (mountinfo->ui + nr); + + mountinfo->num_units--; + for (; nr < mountinfo->num_units; nr++) { + uip[nr] = uip[nr+1]; + } + return 0; +} + +int move_filesys_unit (struct uaedev_mount_info *mountinfo, int nr, int to) +{ + UnitInfo tmpui; + UnitInfo *uip = mountinfo->ui; + + if (nr >= mountinfo->num_units || nr < 0 + || to >= mountinfo->num_units || to < 0 + || to == nr) + return -1; + tmpui = uip[nr]; + if (to > nr) { + int i; + for (i = nr; i < to; i++) + uip[i] = uip[i + 1]; + } else { + int i; + for (i = nr; i > to; i--) + uip[i] = uip[i - 1]; + } + uip[to] = tmpui; + return 0; +} + +int sprintf_filesys_unit (struct uaedev_mount_info *mountinfo, char *buffer, int num) +{ + UnitInfo *uip = mountinfo->ui; + if (num >= mountinfo->num_units) + return -1; + + if (uip[num].volname != 0) + sprintf (buffer, "(DH%d:) Filesystem, %s: %s %s", num, uip[num].volname, + uip[num].rootdir, uip[num].readonly ? "ro" : ""); + else + sprintf (buffer, "(DH%d:) Hardfile, \"%s\", size %d bytes", num, + uip[num].rootdir, uip[num].hf.size); + return 0; +} + +struct uaedev_mount_info *alloc_mountinfo (void) +{ + UnitInfo *ui; + struct uaedev_mount_info *info; + info = (struct uaedev_mount_info *)xmalloc (sizeof *info); + /* memset (info, 0xaa, sizeof *info);*/ + info->num_units = 0; + + ui = info->ui; + + ui->hf.fd = 0; + ui->hf.size = 0; + ui->hf.nrcyls = 0; + ui->hf.secspertrack = 0; + ui->hf.surfaces = 0; + ui->hf.reservedblocks = 0; + ui->hf.blocksize = 0; + + ui->devname = 0; + ui->volname = 0; + ui->rootdir = 0; + ui->unit_pipe = 0; + ui->back_pipe = 0; + + ui->volname = 0; + ui->hf.size = 0; + ui->hf.secspertrack = 0; + ui->hf.surfaces = 0; + ui->hf.reservedblocks = 0; + ui->hf.nrcyls = 0; + ui->hf.blocksize = 0; + ui->self = 0; + ui->reset_state = 0; + ui->rootdir = 0; + ui->readonly = 0; + + ui->devno = 0; + ui->tid = NULL; + ui->reset_sync_sem = NULL; + + return info; +} + +struct uaedev_mount_info *dup_mountinfo (struct uaedev_mount_info *mip) +{ + int i; + struct uaedev_mount_info *i2 = alloc_mountinfo (); + + memcpy (i2, mip, sizeof *i2); + + for (i = 0; i < i2->num_units; i++) { + UnitInfo *uip = i2->ui + i; + if (uip->volname) + uip->volname = my_strdup (uip->volname); + if (uip->rootdir) + uip->rootdir = my_strdup (uip->rootdir); + if (uip->hf.fd) + uip->hf.fd = fdopen ( dup (fileno (uip->hf.fd)), uip->readonly ? "rb" : "r+b"); + } + return i2; +} + +void free_mountinfo (struct uaedev_mount_info *mip) +{ + int i; + for (i = 0; i < mip->num_units; i++) + close_filesys_unit (mip->ui + i); + free (mip); +} + +struct hardfiledata *get_hardfile_data (int nr) +{ + UnitInfo *uip = current_mountinfo->ui; + if (nr < 0 || nr >= current_mountinfo->num_units || uip[nr].volname != 0) + return 0; + return &uip[nr].hf; +} + +/* minimal AmigaDOS definitions */ + +/* field offsets in DosPacket */ +#define dp_Type 8 +#define dp_Res1 12 +#define dp_Res2 16 +#define dp_Arg1 20 +#define dp_Arg2 24 +#define dp_Arg3 28 +#define dp_Arg4 32 + +/* result codes */ +#define DOS_TRUE ((unsigned long)-1L) +#define DOS_FALSE (0L) + +/* Passed as type to Lock() */ +#define SHARED_LOCK -2 /* File is readable by others */ +#define ACCESS_READ -2 /* Synonym */ +#define EXCLUSIVE_LOCK -1 /* No other access allowed */ +#define ACCESS_WRITE -1 /* Synonym */ + +/* packet types */ +#define ACTION_CURRENT_VOLUME 7 +#define ACTION_LOCATE_OBJECT 8 +#define ACTION_RENAME_DISK 9 +#define ACTION_FREE_LOCK 15 +#define ACTION_DELETE_OBJECT 16 +#define ACTION_RENAME_OBJECT 17 +#define ACTION_MORE_CACHE 18 +#define ACTION_COPY_DIR 19 +#define ACTION_SET_PROTECT 21 +#define ACTION_CREATE_DIR 22 +#define ACTION_EXAMINE_OBJECT 23 +#define ACTION_EXAMINE_NEXT 24 +#define ACTION_DISK_INFO 25 +#define ACTION_INFO 26 +#define ACTION_FLUSH 27 +#define ACTION_SET_COMMENT 28 +#define ACTION_PARENT 29 +#define ACTION_SET_DATE 34 +#define ACTION_FIND_WRITE 1004 +#define ACTION_FIND_INPUT 1005 +#define ACTION_FIND_OUTPUT 1006 +#define ACTION_END 1007 +#define ACTION_SEEK 1008 +#define ACTION_WRITE_PROTECT 1023 +#define ACTION_IS_FILESYSTEM 1027 +#define ACTION_READ 'R' +#define ACTION_WRITE 'W' + +/* 2.0+ packet types */ +#define ACTION_INHIBIT 31 +#define ACTION_SET_FILE_SIZE 1022 +#define ACTION_LOCK_RECORD 2008 +#define ACTION_FREE_RECORD 2009 +#define ACTION_SAME_LOCK 40 +#define ACTION_CHANGE_MODE 1028 +#define ACTION_FH_FROM_LOCK 1026 +#define ACTION_COPY_DIR_FH 1030 +#define ACTION_PARENT_FH 1031 +#define ACTION_EXAMINE_ALL 1033 +#define ACTION_EXAMINE_FH 1034 +#define ACTION_EXAMINE_ALL_END 1035 +#define ACTION_MAKE_LINK 1021 +#define ACTION_READ_LINK 1024 +#define ACTION_FORMAT 1020 +#define ACTION_IS_FILESYSTEM 1027 +#define ACTION_ADD_NOTIFY 4097 +#define ACTION_REMOVE_NOTIFY 4098 + +#define DISK_TYPE 0x444f5301 /* DOS\1 */ + +typedef struct { + uae_u32 uniq; + /* The directory we're going through. */ + a_inode *aino; + /* The file we're going to look up next. */ + a_inode *curr_file; +} ExamineKey; + +typedef struct key { + struct key *next; + a_inode *aino; + uae_u32 uniq; + int fd; + off_t file_pos; +} Key; + +/* Since ACTION_EXAMINE_NEXT is so braindamaged, we have to keep + * some of these around + */ + +#define EXKEYS 100 +#define MAX_AINO_HASH 128 + +/* handler state info */ + +typedef struct _unit { + struct _unit *next; + + /* Amiga stuff */ + uaecptr dosbase; + uaecptr volume; + uaecptr port; /* Our port */ + uaecptr locklist; + + /* Native stuff */ + uae_s32 unit; /* unit number */ + UnitInfo ui; /* unit startup info */ + char tmpbuf3[256]; + + /* Dummy message processing */ + uaecptr dummy_message; + volatile unsigned int cmds_sent; + volatile unsigned int cmds_complete; + volatile unsigned int cmds_acked; + + /* ExKeys */ + ExamineKey examine_keys[EXKEYS]; + int next_exkey; + unsigned long total_locked_ainos; + + /* Keys */ + struct key *keys; + uae_u32 key_uniq; + uae_u32 a_uniq; + + a_inode rootnode; + unsigned long aino_cache_size; + a_inode *aino_hash[MAX_AINO_HASH]; + unsigned long nr_cache_hits; + unsigned long nr_cache_lookups; +} Unit; + +typedef uae_u8 *dpacket; +#define PUT_PCK_RES1(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp_Res1), (v)); } while (0) +#define PUT_PCK_RES2(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp_Res2), (v)); } while (0) +#define GET_PCK_TYPE(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Type)))) +#define GET_PCK_RES1(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Res1)))) +#define GET_PCK_RES2(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Res2)))) +#define GET_PCK_ARG1(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg1)))) +#define GET_PCK_ARG2(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg2)))) +#define GET_PCK_ARG3(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg3)))) +#define GET_PCK_ARG4(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg4)))) + +static char *bstr1 (uaecptr addr) +{ + static char buf[256]; + int i; + int n = get_byte(addr); + addr++; + + for (i = 0; i < n; i++, addr++) + buf[i] = get_byte(addr); + buf[i] = 0; + return buf; +} + +static char *bstr (Unit *unit, uaecptr addr) +{ + int i; + int n = get_byte(addr); + + addr++; + for (i = 0; i < n; i++, addr++) + unit->tmpbuf3[i] = get_byte(addr); + unit->tmpbuf3[i] = 0; + return unit->tmpbuf3; +} + +static char *bstr_cut (Unit *unit, uaecptr addr) +{ + char *p = unit->tmpbuf3; + int i, colon_seen = 0; + int n = get_byte (addr); + + addr++; + for (i = 0; i < n; i++, addr++) { + uae_u8 c = get_byte(addr); + unit->tmpbuf3[i] = c; + if (c == '/' || (c == ':' && colon_seen++ == 0)) + p = unit->tmpbuf3 + i + 1; + } + unit->tmpbuf3[i] = 0; + return p; +} + +static Unit *units = 0; +static int unit_num = 0; + +static Unit* +find_unit (uaecptr port) +{ + Unit* u; + for (u = units; u; u = u->next) + if (u->port == port) + break; + + return u; +} + +static void prepare_for_open (char *name) +{ +} + +static void de_recycle_aino (Unit *unit, a_inode *aino) +{ + if (aino->next == 0 || aino == &unit->rootnode) + return; + aino->next->prev = aino->prev; + aino->prev->next = aino->next; + aino->next = aino->prev = 0; + unit->aino_cache_size--; +} + +static void dispose_aino (Unit *unit, a_inode **aip, a_inode *aino) +{ + int hash = aino->uniq % MAX_AINO_HASH; + if (unit->aino_hash[hash] == aino) + unit->aino_hash[hash] = 0; + + if (aino->dirty && aino->parent) + fsdb_dir_writeback (aino->parent); + + *aip = aino->sibling; + if (aino->comment) + free (aino->comment); + free (aino->nname); + free (aino->aname); + free (aino); +} + +static void recycle_aino (Unit *unit, a_inode *new_aino) +{ + if (new_aino->dir || new_aino->shlock > 0 + || new_aino->elock || new_aino == &unit->rootnode) + /* Still in use */ + return; + + TRACE (("Recycling; cache size %d, total_locked %d\n", + unit->aino_cache_size, unit->total_locked_ainos)); + if (unit->aino_cache_size > 500 + unit->total_locked_ainos) { + /* Reap a few. */ + int i = 0; + while (i < 50) { + a_inode *parent = unit->rootnode.prev->parent; + a_inode **aip, *old_prev; + aip = &parent->child; + + if (! parent->locked_children) + for (;;) { + a_inode *aino = *aip; + if (aino == 0) + break; + + /* Not recyclable if next == 0 (i.e., not chained into + recyclable list), or if parent directory is being + ExNext()ed. */ + if (aino->next == 0) + aip = &aino->sibling; + else { + if (aino->shlock > 0 || aino->elock) + write_log ("panic: freeing locked a_inode!\n"); + + de_recycle_aino (unit, aino); + dispose_aino (unit, aip, aino); + i++; + } + } + /* In the previous loop, we went through all children of one + parent. Re-arrange the recycled list so that we'll find a + different parent the next time around. */ + old_prev = unit->rootnode.prev; + do { + unit->rootnode.next->prev = unit->rootnode.prev; + unit->rootnode.prev->next = unit->rootnode.next; + unit->rootnode.next = unit->rootnode.prev; + unit->rootnode.prev = unit->rootnode.prev->prev; + unit->rootnode.prev->next = unit->rootnode.next->prev = &unit->rootnode; + } while (unit->rootnode.prev != old_prev + && unit->rootnode.prev->parent == parent); + } + } + + /* Chain it into circular list. */ + new_aino->next = unit->rootnode.next; + new_aino->prev = &unit->rootnode; + new_aino->prev->next = new_aino; + new_aino->next->prev = new_aino; + unit->aino_cache_size++; +} + +static void update_child_names (Unit *unit, a_inode *a, a_inode *parent) +{ + int l0 = strlen (parent->nname) + 2; + + while (a != 0) { + char *name_start; + char *new_name; + char dirsep[2] = { FSDB_DIR_SEPARATOR, '\0' }; + + a->parent = parent; + name_start = strrchr (a->nname, FSDB_DIR_SEPARATOR); + if (name_start == 0) { + write_log ("malformed file name"); + } + name_start++; + new_name = (char *)xmalloc (strlen (name_start) + l0); + strcpy (new_name, parent->nname); + strcat (new_name, dirsep); + strcat (new_name, name_start); + free (a->nname); + a->nname = new_name; + if (a->child) + update_child_names (unit, a->child, a); + a = a->sibling; + } +} + +static void move_aino_children (Unit *unit, a_inode *from, a_inode *to) +{ + to->child = from->child; + from->child = 0; + update_child_names (unit, to->child, to); +} + +static void delete_aino (Unit *unit, a_inode *aino) +{ + a_inode **aip; + + TRACE(("deleting aino %x\n", aino->uniq)); + + aino->dirty = 1; + aino->deleted = 1; + de_recycle_aino (unit, aino); + + /* If any ExKeys are currently pointing at us, advance them. */ + if (aino->parent->exnext_count > 0) { + int i; + TRACE(("entering exkey validation\n")); + for (i = 0; i < EXKEYS; i++) { + ExamineKey *k = unit->examine_keys + i; + if (k->uniq == 0) + continue; + if (k->aino == aino->parent) { + TRACE(("Same parent found for %d\n", i)); + if (k->curr_file == aino) { + k->curr_file = aino->sibling; + TRACE(("Advancing curr_file\n")); + } + } + } + } + + aip = &aino->parent->child; + while (*aip != aino && *aip != 0) + aip = &(*aip)->sibling; + if (*aip != aino) { + write_log ("Couldn't delete aino.\n"); + return; + } + dispose_aino (unit, aip, aino); +} + +static a_inode *lookup_sub (a_inode *dir, uae_u32 uniq) +{ + a_inode **cp = &dir->child; + a_inode *c, *retval; + + for (;;) { + c = *cp; + if (c == 0) + return 0; + + if (c->uniq == uniq) { + retval = c; + break; + } + if (c->dir) { + a_inode *a = lookup_sub (c, uniq); + if (a != 0) { + retval = a; + break; + } + } + cp = &c->sibling; + } + if (! dir->locked_children) { + /* Move to the front to speed up repeated lookups. Don't do this if + an ExNext is going on in this directory, or we'll terminally + confuse it. */ + *cp = c->sibling; + c->sibling = dir->child; + dir->child = c; + } + return retval; +} + +static a_inode *lookup_aino (Unit *unit, uae_u32 uniq) +{ + a_inode *a; + int hash = uniq % MAX_AINO_HASH; + + if (uniq == 0) + return &unit->rootnode; + a = unit->aino_hash[hash]; + if (a == 0 || a->uniq != uniq) + a = lookup_sub (&unit->rootnode, uniq); + else + unit->nr_cache_hits++; + unit->nr_cache_lookups++; + unit->aino_hash[hash] = a; + return a; +} + +char *build_nname (const char *d, const char *n) +{ + char dsep[2] = { FSDB_DIR_SEPARATOR, '\0' }; + char *p = (char *) xmalloc (strlen (d) + strlen (n) + 2); + strcpy (p, d); + strcat (p, dsep); + strcat (p, n); + return p; +} + +char *build_aname (const char *d, const char *n) +{ + char *p = (char *) xmalloc (strlen (d) + strlen (n) + 2); + strcpy (p, d); + strcat (p, "/"); + strcat (p, n); + return p; +} + +/* This gets called to translate an Amiga name that some program used to + * a name that we can use on the native filesystem. */ +static char *get_nname (Unit *unit, a_inode *base, char *rel, + char **modified_rel) +{ + char *found; + char *p = 0; + + *modified_rel = 0; + + /* If we have a mapping of some other aname to "rel", we must pretend + * it does not exist. + * This can happen for example if an Amiga program creates a + * file called ".". We can't represent this in our filesystem, + * so we create a special file "uae_xxx" and record the mapping + * aname "." -> nname "uae_xxx" in the database. Then, the Amiga + * program looks up "uae_xxx" (yes, it's contrived). The filesystem + * should not make the uae_xxx file visible to the Amiga side. */ + if (fsdb_used_as_nname (base, rel)) + return 0; + /* A file called "." (or whatever else is invalid on this filesystem) + * does not exist, as far as the Amiga side is concerned. */ + if (fsdb_name_invalid (rel)) + return 0; + + /* See if we have a file that has the same name as the aname we are + * looking for. */ + found = fsdb_search_dir (base->nname, rel); + if (found == 0) + return found; + if (found == rel) + return build_nname (base->nname, rel); + + *modified_rel = found; + return build_nname (base->nname, found); +} + +static char *create_nname (Unit *unit, a_inode *base, char *rel) +{ + char *p; + + /* We are trying to create a file called REL. */ + + /* If the name is used otherwise in the directory (or globally), we + * need a new unique nname. */ + if (fsdb_name_invalid (rel) || fsdb_used_as_nname (base, rel)) { + oh_dear: + p = fsdb_create_unique_nname (base, rel); + return p; + } + p = build_nname (base->nname, rel); + + /* Delete this code once we know everything works. */ + if (access (p, R_OK) >= 0 || errno != ENOENT) { + write_log ("Filesystem in trouble... please report.\n"); + free (p); + goto oh_dear; + } + return p; +} + +/* + * This gets called if an ACTION_EXAMINE_NEXT happens and we hit an object + * for which we know the name on the native filesystem, but no corresponding + * Amiga filesystem name. + * @@@ For DOS filesystems, it might make sense to declare the new name + * "weak", so that it can get overriden by a subsequent call to get_nname(). + * That way, if someone does "dir :" and there is a file "foobar.inf", and + * someone else tries to open "foobar.info", get_nname() could maybe made to + * figure out that this is supposed to be the file "foobar.inf". + * DOS sucks... + */ +static char *get_aname (Unit *unit, a_inode *base, char *rel) +{ + return my_strdup (rel); +} + +static void init_child_aino (Unit *unit, a_inode *base, a_inode *aino) +{ + aino->uniq = ++unit->a_uniq; + if (unit->a_uniq == 0xFFFFFFFF) { + write_log ("Running out of a_inodes (prepare for big trouble)!\n"); + } + aino->shlock = 0; + aino->elock = 0; + + aino->dirty = 0; + aino->deleted = 0; + + /* For directories - this one isn't being ExNext()ed yet. */ + aino->locked_children = 0; + aino->exnext_count = 0; + /* But the parent might be. */ + if (base->exnext_count) { + unit->total_locked_ainos++; + base->locked_children++; + } + /* Update tree structure */ + aino->parent = base; + aino->child = 0; + aino->sibling = base->child; + base->child = aino; + aino->next = aino->prev = 0; +} + +static a_inode *new_child_aino (Unit *unit, a_inode *base, char *rel) +{ + char *modified_rel; + char *nn; + a_inode *aino; + + TRACE(("new_child_aino %s, %s\n", base->aname, rel)); + + aino = fsdb_lookup_aino_aname (base, rel); + if (aino == 0) { + nn = get_nname (unit, base, rel, &modified_rel); + if (nn == 0) + return 0; + + aino = (a_inode *) xcalloc (sizeof (a_inode), 1); + if (aino == 0) + return 0; + aino->aname = modified_rel ? modified_rel : my_strdup (rel); + aino->nname = nn; + + aino->comment = 0; + aino->has_dbentry = 0; + + fsdb_fill_file_attrs (aino); + if (aino->dir) + fsdb_clean_dir (aino); + } + init_child_aino (unit, base, aino); + + recycle_aino (unit, aino); + TRACE(("created aino %x, lookup, amigaos_mode %d\n", aino->uniq, aino->amigaos_mode)); + return aino; +} + +static a_inode *create_child_aino (Unit *unit, a_inode *base, char *rel, int isdir) +{ + a_inode *aino = (a_inode *) xcalloc (sizeof (a_inode), 1); + if (aino == 0) + return 0; + + aino->aname = my_strdup (rel); + aino->nname = create_nname (unit, base, rel); + + init_child_aino (unit, base, aino); + aino->amigaos_mode = 0; + aino->dir = isdir; + + aino->comment = 0; + aino->has_dbentry = 0; + aino->dirty = 1; + + recycle_aino (unit, aino); + TRACE(("created aino %x, create\n", aino->uniq)); + return aino; +} + +static a_inode *lookup_child_aino (Unit *unit, a_inode *base, char *rel, uae_u32 *err) +{ + a_inode *c = base->child; + int l0 = strlen (rel); + + if (base->dir == 0) { + *err = ERROR_OBJECT_WRONG_TYPE; + return 0; + } + + while (c != 0) { + int l1 = strlen (c->aname); + if (l0 <= l1 && same_aname (rel, c->aname + l1 - l0) + && (l0 == l1 || c->aname[l1-l0-1] == '/')) + break; + c = c->sibling; + } + if (c != 0) + return c; + c = new_child_aino (unit, base, rel); + if (c == 0) + *err = ERROR_OBJECT_NOT_AROUND; + return c; +} + +/* Different version because for this one, REL is an nname. */ +static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, char *rel, uae_u32 *err) +{ + a_inode *c = base->child; + int l0 = strlen (rel); + + *err = 0; + while (c != 0) { + int l1 = strlen (c->nname); + /* Note: using strcmp here. */ + if (l0 <= l1 && strcmp (rel, c->nname + l1 - l0) == 0 + && (l0 == l1 || c->nname[l1-l0-1] == FSDB_DIR_SEPARATOR)) + break; + c = c->sibling; + } + if (c != 0) + return c; + c = fsdb_lookup_aino_nname (base, rel); + if (c == 0) { + c = (a_inode *)xmalloc (sizeof (a_inode)); + if (c == 0) { + *err = ERROR_NO_FREE_STORE; + return 0; + } + + c->nname = build_nname (base->nname, rel); + c->aname = get_aname (unit, base, rel); + c->comment = 0; + c->has_dbentry = 0; + fsdb_fill_file_attrs (c); + if (c->dir) + fsdb_clean_dir (c); + } + init_child_aino (unit, base, c); + + recycle_aino (unit, c); + TRACE(("created aino %x, exnext\n", c->uniq)); + + return c; +} + +static a_inode *get_aino (Unit *unit, a_inode *base, const char *rel, uae_u32 *err) +{ + char *tmp; + char *p; + a_inode *curr; + int i; + + *err = 0; + TRACE(("get_path(%s,%s)\n", base->aname, rel)); + + /* root-relative path? */ + for (i = 0; rel[i] && rel[i] != '/' && rel[i] != ':'; i++) + ; + if (':' == rel[i]) + rel += i+1; + + tmp = my_strdup (rel); + p = tmp; + curr = base; + + while (*p > 0) { + /* start with a slash? go up a level. */ + if (*p == '/') { + if (curr->parent != 0) + curr = curr->parent; + p++; + } else { + a_inode *next; + + char *component_end; + component_end = strchr (p, '/'); + if (component_end != 0) + *component_end = '\0'; + next = lookup_child_aino (unit, curr, p, err); + if (next == 0) { + /* if only last component not found, return parent dir. */ + if (*err != ERROR_OBJECT_NOT_AROUND || component_end != 0) + curr = 0; + /* ? what error is appropriate? */ + break; + } + curr = next; + if (component_end) + p = component_end+1; + else + break; + + } + } + free (tmp); + return curr; +} + +static uae_u32 startup_handler (void) +{ + /* Just got the startup packet. It's in A4. DosBase is in A2, + * our allocated volume structure is in D6, A5 is a pointer to + * our port. */ + uaecptr rootnode = get_long (m68k_areg (regs, 2) + 34); + uaecptr dos_info = get_long (rootnode + 24) << 2; + uaecptr pkt = m68k_dreg (regs, 3); + uaecptr arg2 = get_long (pkt + dp_Arg2); + int i, namelen; + char* devname = bstr1 (get_long (pkt + dp_Arg1) << 2); + char* s; + Unit *unit; + UnitInfo *uinfo; + + /* find UnitInfo with correct device name */ + s = strchr (devname, ':'); + if (s) + *s = '\0'; + + for (i = 0; i < current_mountinfo->num_units; i++) { + /* Hardfile volume name? */ + if (current_mountinfo->ui[i].volname == 0) + continue; + + if (current_mountinfo->ui[i].startup == arg2) + break; + } + + if (i == current_mountinfo->num_units + || access (current_mountinfo->ui[i].rootdir, R_OK) != 0) + { + write_log ("Failed attempt to mount device\n", devname); + put_long (pkt + dp_Res1, DOS_FALSE); + put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED); + return 1; + } + uinfo = current_mountinfo->ui + i; + + unit = (Unit *) xcalloc (sizeof (Unit), 1); + unit->next = units; + units = unit; + uinfo->self = unit; + + unit->volume = 0; + unit->port = m68k_areg (regs, 5); + unit->unit = unit_num++; + + unit->ui.devname = uinfo->devname; + unit->ui.volname = my_strdup (uinfo->volname); /* might free later for rename */ + unit->ui.rootdir = uinfo->rootdir; + unit->ui.readonly = uinfo->readonly; + unit->ui.unit_pipe = uinfo->unit_pipe; + unit->ui.back_pipe = uinfo->back_pipe; + unit->cmds_complete = 0; + unit->cmds_sent = 0; + unit->cmds_acked = 0; + for (i = 0; i < EXKEYS; i++) { + unit->examine_keys[i].aino = 0; + unit->examine_keys[i].curr_file = 0; + unit->examine_keys[i].uniq = 0; + } + unit->total_locked_ainos = 0; + unit->next_exkey = 1; + unit->keys = 0; + unit->a_uniq = unit->key_uniq = 0; + + unit->rootnode.aname = uinfo->volname; + unit->rootnode.nname = uinfo->rootdir; + unit->rootnode.sibling = 0; + unit->rootnode.next = unit->rootnode.prev = &unit->rootnode; + unit->rootnode.uniq = 0; + unit->rootnode.parent = 0; + unit->rootnode.child = 0; + unit->rootnode.dir = 1; + unit->rootnode.amigaos_mode = 0; + unit->rootnode.shlock = 0; + unit->rootnode.elock = 0; + unit->rootnode.comment = 0; + unit->rootnode.has_dbentry = 0; + unit->aino_cache_size = 0; + for (i = 0; i < MAX_AINO_HASH; i++) + unit->aino_hash[i] = 0; + +/* write_comm_pipe_int (unit->ui.unit_pipe, -1, 1);*/ + + TRACE(("**** STARTUP volume %s\n", unit->ui.volname)); + + /* fill in our process in the device node */ + put_long ((get_long (pkt + dp_Arg3) << 2) + 8, unit->port); + unit->dosbase = m68k_areg (regs, 2); + + /* make new volume */ + unit->volume = m68k_areg (regs, 3) + 32; +#ifdef UAE_FILESYS_THREADS + unit->locklist = m68k_areg (regs, 3) + 8; +#else + unit->locklist = m68k_areg (regs, 3); +#endif + unit->dummy_message = m68k_areg (regs, 3) + 12; + + put_long (unit->dummy_message + 10, 0); + + put_long (unit->volume + 4, 2); /* Type = dt_volume */ + put_long (unit->volume + 12, 0); /* Lock */ + put_long (unit->volume + 16, 3800); /* Creation Date */ + put_long (unit->volume + 20, 0); + put_long (unit->volume + 24, 0); + put_long (unit->volume + 28, 0); /* lock list */ + put_long (unit->volume + 40, (unit->volume + 44) >> 2); /* Name */ + namelen = strlen (unit->ui.volname); + put_byte (unit->volume + 44, namelen); + for (i = 0; i < namelen; i++) + put_byte (unit->volume + 45 + i, unit->ui.volname[i]); + + /* link into DOS list */ + put_long (unit->volume, get_long (dos_info + 4)); + put_long (dos_info + 4, unit->volume >> 2); + + put_long (unit->volume + 8, unit->port); + put_long (unit->volume + 32, DISK_TYPE); + + put_long (pkt + dp_Res1, DOS_TRUE); + + fsdb_clean_dir (&unit->rootnode); + + return 0; +} + +static void +do_info (Unit *unit, dpacket packet, uaecptr info) +{ + struct fs_usage fsu; + + if (get_fs_usage (unit->ui.rootdir, 0, &fsu) != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno ()); + return; + } + + fsu.fsu_blocks >>= 1; + fsu.fsu_bavail >>= 1; + put_long (info, 0); /* errors */ + put_long (info + 4, unit->unit); /* unit number */ + put_long (info + 8, unit->ui.readonly ? 80 : 82); /* state */ + put_long (info + 12, fsu.fsu_blocks ); /* numblocks */ + put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */ + put_long (info + 20, 1024); /* bytesperblock */ + put_long (info + 24, DISK_TYPE); /* disk type */ + put_long (info + 28, unit->volume >> 2); /* volume node */ + put_long (info + 32, 0); /* inuse */ + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_disk_info (Unit *unit, dpacket packet) +{ + TRACE(("ACTION_DISK_INFO\n")); + do_info(unit, packet, GET_PCK_ARG1 (packet) << 2); +} + +static void +action_info (Unit *unit, dpacket packet) +{ + TRACE(("ACTION_INFO\n")); + do_info(unit, packet, GET_PCK_ARG2 (packet) << 2); +} + +static void free_key (Unit *unit, Key *k) +{ + Key *k1; + Key *prev = 0; + for (k1 = unit->keys; k1; k1 = k1->next) { + if (k == k1) { + if (prev) + prev->next = k->next; + else + unit->keys = k->next; + break; + } + prev = k1; + } + + if (k->fd >= 0) + close (k->fd); + + free(k); +} + +static Key *lookup_key (Unit *unit, uae_u32 uniq) +{ + Key *k; + /* It's hardly worthwhile to optimize this - most of the time there are + * only one or zero keys. */ + for (k = unit->keys; k; k = k->next) { + if (uniq == k->uniq) + return k; + } + write_log ("Error: couldn't find key!\n"); + + /* There isn't much hope we will recover. Unix would kill the process, + * AmigaOS gets killed by it. */ + write_log ("Better reset that Amiga - the system is messed up.\n"); + return 0; +} + +static Key *new_key (Unit *unit) +{ + Key *k = (Key *) xmalloc(sizeof(Key)); + k->uniq = ++unit->key_uniq; + k->fd = -1; + k->file_pos = 0; + k->next = unit->keys; + unit->keys = k; + + return k; +} + +static void +dumplock (Unit *unit, uaecptr lock) +{ + a_inode *a; + TRACE(("LOCK: 0x%lx", lock)); + if (!lock) { + TRACE(("\n")); + return; + } + TRACE(("{ next=0x%lx, mode=%ld, handler=0x%lx, volume=0x%lx, aino %lx ", + get_long (lock) << 2, get_long (lock+8), + get_long (lock+12), get_long (lock+16), + get_long (lock + 4))); + a = lookup_aino (unit, get_long (lock + 4)); + if (a == 0) { + TRACE(("not found!")); + } else { + TRACE(("%s", a->nname)); + } + TRACE((" }\n")); +} + +static a_inode *find_aino (Unit *unit, uaecptr lock, const char *name, uae_u32 *err) +{ + a_inode *a; + + if (lock) { + a_inode *olda = lookup_aino (unit, get_long (lock + 4)); + if (olda == 0) { + /* That's the best we can hope to do. */ + a = get_aino (unit, &unit->rootnode, name, err); + } else { + TRACE(("aino: 0x%08lx", (unsigned long int)olda->uniq)); + TRACE((" \"%s\"\n", olda->nname)); + a = get_aino (unit, olda, name, err); + } + } else { + a = get_aino (unit, &unit->rootnode, name, err); + } + if (a) { + TRACE(("aino=\"%s\"\n", a->nname)); + } + return a; +} + +static uaecptr make_lock (Unit *unit, uae_u32 uniq, long mode) +{ + /* allocate lock from the list kept by the assembly code */ + uaecptr lock; + + lock = get_long (unit->locklist); + put_long (unit->locklist, get_long (lock)); + lock += 4; + + put_long (lock + 4, uniq); + put_long (lock + 8, mode); + put_long (lock + 12, unit->port); + put_long (lock + 16, unit->volume >> 2); + + /* prepend to lock chain */ + put_long (lock, get_long (unit->volume + 28)); + put_long (unit->volume + 28, lock >> 2); + + DUMPLOCK(unit, lock); + return lock; +} + +static void free_lock (Unit *unit, uaecptr lock) +{ + if (! lock) + return; + + if (lock == get_long (unit->volume + 28) << 2) { + put_long (unit->volume + 28, get_long (lock)); + } else { + uaecptr current = get_long (unit->volume + 28); + uaecptr next = 0; + while (current) { + next = get_long (current << 2); + if (lock == next << 2) + break; + current = next; + } + put_long (current << 2, get_long (lock)); + } + lock -= 4; + put_long (lock, get_long (unit->locklist)); + put_long (unit->locklist, lock); +} + +static void +action_lock (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + uaecptr name = GET_PCK_ARG2 (packet) << 2; + long mode = GET_PCK_ARG3 (packet); + a_inode *a; + uae_u32 err; + + if (mode != SHARED_LOCK && mode != EXCLUSIVE_LOCK) { + TRACE(("Bad mode.\n")); + mode = SHARED_LOCK; + } + + TRACE(("ACTION_LOCK(0x%lx, \"%s\", %d)\n", lock, bstr (unit, name), mode)); + DUMPLOCK(unit, lock); + + a = find_aino (unit, lock, bstr (unit, name), &err); + if (err == 0 && (a->elock || (mode != SHARED_LOCK && a->shlock > 0))) { + err = ERROR_OBJECT_IN_USE; + } + /* Lock() doesn't do access checks. */ + if (err != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } + if (mode == SHARED_LOCK) + a->shlock++; + else + a->elock = 1; + de_recycle_aino (unit, a); + PUT_PCK_RES1 (packet, make_lock (unit, a->uniq, mode) >> 2); +} + +static void action_free_lock (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + a_inode *a; + TRACE(("ACTION_FREE_LOCK(0x%lx)\n", lock)); + DUMPLOCK(unit, lock); + + a = lookup_aino (unit, get_long (lock + 4)); + if (a == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND); + return; + } + if (a->elock) + a->elock = 0; + else + a->shlock--; + recycle_aino (unit, a); + free_lock(unit, lock); + + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_dup_lock (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + a_inode *a; + TRACE(("ACTION_DUP_LOCK(0x%lx)\n", lock)); + DUMPLOCK(unit, lock); + + if (!lock) { + PUT_PCK_RES1 (packet, 0); + return; + } + a = lookup_aino (unit, get_long (lock + 4)); + if (a == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND); + return; + } + /* DupLock()ing exclusive locks isn't possible, says the Autodoc, but + * at least the RAM-Handler seems to allow it. Let's see what happens + * if we don't. */ + if (a->elock) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_IN_USE); + return; + } + a->shlock++; + de_recycle_aino (unit, a); + PUT_PCK_RES1 (packet, make_lock (unit, a->uniq, -2) >> 2); +} + +/* convert time_t to/from AmigaDOS time */ +const int secs_per_day = 24 * 60 * 60; +const int diff = (8 * 365 + 2) * (24 * 60 * 60); + +static void +get_time (time_t t, long* days, long* mins, long* ticks) +{ + /* time_t is secs since 1-1-1970 */ + /* days since 1-1-1978 */ + /* mins since midnight */ + /* ticks past minute @ 50Hz */ + + t -= diff; + *days = t / secs_per_day; + t -= *days * secs_per_day; + *mins = t / 60; + t -= *mins * 60; + *ticks = t * 50; +} + +static time_t +put_time (long days, long mins, long ticks) +{ + time_t t; + t = ticks / 50; + t += mins * 60; + t += days * secs_per_day; + t += diff; + + return t; +} + +static void free_exkey (Unit *unit, ExamineKey *ek) +{ + if (--ek->aino->exnext_count == 0) { + TRACE (("Freeing ExKey and reducing total_locked from %d by %d\n", + unit->total_locked_ainos, ek->aino->locked_children)); + unit->total_locked_ainos -= ek->aino->locked_children; + ek->aino->locked_children = 0; + } + ek->aino = 0; + ek->uniq = 0; +} + +static ExamineKey *lookup_exkey (Unit *unit, uae_u32 uniq) +{ + ExamineKey *ek; + int i; + + ek = unit->examine_keys; + for (i = 0; i < EXKEYS; i++, ek++) { + /* Did we find a free one? */ + if (ek->uniq == uniq) + return ek; + } + write_log ("Houston, we have a BIG problem.\n"); + return 0; +} + +/* This is so sick... who invented ACTION_EXAMINE_NEXT? What did he THINK??? */ +static ExamineKey *new_exkey (Unit *unit, a_inode *aino) +{ + uae_u32 uniq; + uae_u32 oldest = 0xFFFFFFFE; + ExamineKey *ek, *oldest_ek = 0; + int i; + + ek = unit->examine_keys; + for (i = 0; i < EXKEYS; i++, ek++) { + /* Did we find a free one? */ + if (ek->aino == 0) + continue; + if (ek->uniq < oldest) + oldest = (oldest_ek = ek)->uniq; + } + ek = unit->examine_keys; + for (i = 0; i < EXKEYS; i++, ek++) { + /* Did we find a free one? */ + if (ek->aino == 0) + goto found; + } + /* This message should usually be harmless. */ + write_log ("Houston, we have a problem.\n"); + free_exkey (unit, oldest_ek); + ek = oldest_ek; + found: + + uniq = unit->next_exkey; + if (uniq >= 0xFFFFFFFE) { + /* Things will probably go wrong, but most likely the Amiga will crash + * before this happens because of something else. */ + uniq = 1; + } + unit->next_exkey = uniq+1; + ek->aino = aino; + ek->curr_file = 0; + ek->uniq = uniq; + return ek; +} + +static void move_exkeys (Unit *unit, a_inode *from, a_inode *to) +{ + int i; + unsigned long tmp = 0; + for (i = 0; i < EXKEYS; i++) { + ExamineKey *k = unit->examine_keys + i; + if (k->uniq == 0) + continue; + if (k->aino == from) { + k->aino = to; + tmp++; + } + } + if (tmp != from->exnext_count) + write_log ("filesys.c: Bug in ExNext bookkeeping. BAD.\n"); + to->exnext_count = from->exnext_count; + to->locked_children = from->locked_children; + from->exnext_count = 0; + from->locked_children = 0; +} + +static void +get_fileinfo (Unit *unit, dpacket packet, uaecptr info, a_inode *aino) +{ + struct stat statbuf; + long days, mins, ticks; + int i, n; + char *x; + + /* No error checks - this had better work. */ + stat (aino->nname, &statbuf); + + if (aino->parent == 0) { + x = unit->ui.volname; + put_long (info + 4, 1); + put_long (info + 120, 1); + } else { + /* AmigaOS docs say these have to contain the same value. */ + put_long (info + 4, aino->dir ? 2 : -3); + put_long (info + 120, aino->dir ? 2 : -3); + x = aino->aname; + } + TRACE(("name=\"%s\"\n", x)); + n = strlen (x); + if (n > 106) + n = 106; + i = 8; + put_byte (info + i, n); i++; + while (n--) + put_byte (info + i, *x), i++, x++; + while (i < 108) + put_byte (info + i, 0), i++; + + put_long (info + 116, aino->amigaos_mode); + put_long (info + 124, statbuf.st_size); +#ifdef HAVE_ST_BLOCKS + put_long (info + 128, statbuf.st_blocks); +#else + put_long (info + 128, statbuf.st_size / 512 + 1); +#endif + get_time (statbuf.st_mtime, &days, &mins, &ticks); + put_long (info + 132, days); + put_long (info + 136, mins); + put_long (info + 140, ticks); + if (aino->comment == 0) + put_long (info + 144, 0); + else { + TRACE(("comment=\"%s\"\n", aino->comment)); + i = 144; + x = aino->comment; + if (! x) + x = ""; + n = strlen (x); + if (n > 78) + n = 78; + put_byte (info + i, n); i++; + while (n--) + put_byte (info + i, *x), i++, x++; + while (i < 224) + put_byte (info + i, 0), i++; + } + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void action_examine_object (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + uaecptr info = GET_PCK_ARG2 (packet) << 2; + a_inode *aino = 0; + + TRACE(("ACTION_EXAMINE_OBJECT(0x%lx,0x%lx)\n", lock, info)); + DUMPLOCK(unit, lock); + + if (lock != 0) + aino = lookup_aino (unit, get_long (lock + 4)); + if (aino == 0) + aino = &unit->rootnode; + + get_fileinfo (unit, packet, info, aino); + if (aino->dir) { + put_long (info, 0xFFFFFFFF); + } else + put_long (info, 0); +} + +/* Read a directory's contents, create a_inodes for each file, and + mark them as locked in memory so that recycle_aino will not reap + them. + We do this to avoid problems with the host OS: we don't want to + leave the directory open on the host side until all ExNext()s have + finished - they may never finish! */ + +static void populate_directory (Unit *unit, a_inode *base) +{ + DIR *d = opendir (base->nname); + a_inode *aino; + + for (aino = base->child; aino; aino = aino->sibling) { + base->locked_children++; + unit->total_locked_ainos++; + } + TRACE(("Populating directory, child %p, locked_children %d\n", + base->child, base->locked_children)); + for (;;) { + struct dirent de_space; + struct dirent *de; + uae_u32 err; + + /* Find next file that belongs to the Amiga fs (skipping things + like "..", "." etc. */ + do { + de = my_readdir (d, &de_space); + } while (de && fsdb_name_invalid (de->d_name)); + if (! de) + break; + /* This calls init_child_aino, which will notice that the parent is + being ExNext()ed, and it will increment the locked counts. */ + aino = lookup_child_aino_for_exnext (unit, base, de->d_name, &err); + } + closedir (d); +} + +static int my_rmdir (Unit *unit, a_inode *root) { + return rmdir (root->nname); +} + +static void do_examine (Unit *unit, dpacket packet, ExamineKey *ek, uaecptr info) +{ + if (ek->curr_file == 0) + goto no_more_entries; + + get_fileinfo (unit, packet, info, ek->curr_file); + ek->curr_file = ek->curr_file->sibling; + TRACE (("curr_file set to %p %s\n", ek->curr_file, + ek->curr_file ? ek->curr_file->aname : "NULL")); + return; + + no_more_entries: + TRACE(("no more entries\n")); + free_exkey (unit, ek); + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_NO_MORE_ENTRIES); +} + +static void action_examine_next (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + uaecptr info = GET_PCK_ARG2 (packet) << 2; + a_inode *aino = 0; + ExamineKey *ek; + uae_u32 uniq; + + TRACE(("ACTION_EXAMINE_NEXT(0x%lx,0x%lx)\n", lock, info)); + DUMPLOCK(unit, lock); + + if (lock != 0) + aino = lookup_aino (unit, get_long (lock + 4)); + if (aino == 0) + aino = &unit->rootnode; + + uniq = get_long (info); + if (uniq == 0) { + write_log ("ExNext called for a file! (Houston?)\n"); + goto no_more_entries; + } else if (uniq == 0xFFFFFFFE) + goto no_more_entries; + else if (uniq == 0xFFFFFFFF) { + TRACE(("Creating new ExKey\n")); + ek = new_exkey (unit, aino); + if (ek) { + if (aino->exnext_count++ == 0) + populate_directory (unit, aino); + } + ek->curr_file = aino->child; + TRACE(("Initial curr_file: %p %s\n", ek->curr_file, + ek->curr_file ? ek->curr_file->aname : "NULL")); + } else { + TRACE(("Looking up ExKey\n")); + ek = lookup_exkey (unit, get_long (info)); + } + if (ek == 0) { + write_log ("Couldn't find a matching ExKey. Prepare for trouble.\n"); + goto no_more_entries; + } + put_long (info, ek->uniq); + do_examine (unit, packet, ek, info); + return; + + no_more_entries: + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_NO_MORE_ENTRIES); +} + +static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallback) +{ + uaecptr fh = GET_PCK_ARG1 (packet) << 2; + uaecptr lock = GET_PCK_ARG2 (packet) << 2; + uaecptr name = GET_PCK_ARG3 (packet) << 2; + a_inode *aino; + Key *k; + int fd; + uae_u32 err; + mode_t openmode; + int aino_created = 0; + + TRACE(("ACTION_FIND_*(0x%lx,0x%lx,\"%s\",%d)\n", fh, lock, bstr (unit, name), mode)); + DUMPLOCK(unit, lock); + + aino = find_aino (unit, lock, bstr (unit, name), &err); + + if (aino == 0 || (err != 0 && err != ERROR_OBJECT_NOT_AROUND)) { + /* Whatever it is, we can't handle it. */ + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } + if (err == 0) { + /* Object exists. */ + if (aino->dir) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_WRONG_TYPE); + return; + } + if (aino->elock || (create == 2 && aino->shlock > 0)) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_IN_USE); + return; + } + if (create == 2 && (aino->amigaos_mode & A_FIBF_DELETE) != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DELETE_PROTECTED); + return; + } + if (create != 2) { + if ((((mode & aino->amigaos_mode) & A_FIBF_WRITE) != 0 || unit->ui.readonly) + && fallback) + { + mode &= ~A_FIBF_WRITE; + } + /* Kick 1.3 doesn't check read and write access bits - maybe it would be + * simpler just not to do that either. */ + if ((mode & A_FIBF_WRITE) != 0 && unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + if ((((mode & aino->amigaos_mode) & A_FIBF_WRITE) != 0) + || (mode == 0)) + { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_WRITE_PROTECTED); + return; + } + if (((mode & aino->amigaos_mode) & A_FIBF_READ) != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_READ_PROTECTED); + return; + } + } + } else if (create == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } else { + /* Object does not exist. aino points to containing directory. */ + aino = create_child_aino (unit, aino, my_strdup (bstr_cut (unit, name)), 0); + if (aino == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_IS_FULL); /* best we can do */ + return; + } + aino_created = 1; + } + + prepare_for_open (aino->nname); + + openmode = (((mode & A_FIBF_READ) == 0 ? O_WRONLY + : (mode & A_FIBF_WRITE) == 0 ? O_RDONLY + : O_RDWR) + | (create ? O_CREAT : 0) + | (create == 2 ? O_TRUNC : 0)); + + fd = open (aino->nname, openmode | O_BINARY, 0777); + + if (fd < 0) { + if (aino_created) + delete_aino (unit, aino); + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno ()); + return; + } + k = new_key (unit); + k->fd = fd; + k->aino = aino; + + put_long (fh+36, k->uniq); + if (create == 2) + aino->elock = 1; + else + aino->shlock++; + de_recycle_aino (unit, aino); + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_fh_from_lock (Unit *unit, dpacket packet) +{ + uaecptr fh = GET_PCK_ARG1 (packet) << 2; + uaecptr lock = GET_PCK_ARG2 (packet) << 2; + a_inode *aino; + Key *k; + int fd; + mode_t openmode; + int mode; + + TRACE(("ACTION_FH_FROM_LOCK(0x%lx,0x%lx)\n",fh,lock)); + DUMPLOCK(unit,lock); + + if (!lock) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, 0); + return; + } + + aino = lookup_aino (unit, get_long (lock + 4)); + if (aino == 0) + aino = &unit->rootnode; + mode = aino->amigaos_mode; /* Use same mode for opened filehandle as existing Lock() */ + + prepare_for_open (aino->nname); + TRACE ((" mode is %d\n", mode)); + openmode = (((mode & A_FIBF_READ) ? O_WRONLY + : (mode & A_FIBF_WRITE) ? O_RDONLY + : O_RDWR)); + + /* the files on CD really can have the write-bit set. */ + if (unit->ui.readonly) + openmode = O_RDONLY; + + fd = open (aino->nname, openmode | O_BINARY, 0777); + + if (fd < 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno()); + return; + } + k = new_key (unit); + k->fd = fd; + k->aino = aino; + + put_long (fh+36, k->uniq); + /* I don't think I need to play with shlock count here, because I'm + opening from an existing lock ??? */ + + /* Is this right? I don't completely understand how this works. Do I + also need to free_lock() my lock, since nobody else is going to? */ + de_recycle_aino (unit, aino); + PUT_PCK_RES1 (packet, DOS_TRUE); + /* PUT_PCK_RES2 (packet, k->uniq); - this shouldn't be necessary, try without it */ +} + +static void +action_find_input (Unit *unit, dpacket packet) +{ + do_find(unit, packet, A_FIBF_READ|A_FIBF_WRITE, 0, 1); +} + +static void +action_find_output (Unit *unit, dpacket packet) +{ + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + do_find(unit, packet, A_FIBF_READ|A_FIBF_WRITE, 2, 0); +} + +static void +action_find_write (Unit *unit, dpacket packet) +{ + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + do_find(unit, packet, A_FIBF_READ|A_FIBF_WRITE, 1, 0); +} + +static void +action_end (Unit *unit, dpacket packet) +{ + Key *k; + TRACE(("ACTION_END(0x%lx)\n", GET_PCK_ARG1 (packet))); + + k = lookup_key (unit, GET_PCK_ARG1 (packet)); + if (k != 0) { + if (k->aino->elock) + k->aino->elock = 0; + else + k->aino->shlock--; + recycle_aino (unit, k->aino); + free_key (unit, k); + } + PUT_PCK_RES1 (packet, DOS_TRUE); + PUT_PCK_RES2 (packet, 0); +} + +static void +action_read (Unit *unit, dpacket packet) +{ + Key *k = lookup_key (unit, GET_PCK_ARG1 (packet)); + uaecptr addr = GET_PCK_ARG2 (packet); + long size = (uae_s32)GET_PCK_ARG3 (packet); + int actual; + + if (k == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + /* PUT_PCK_RES2 (packet, EINVAL); */ + return; + } + TRACE(("ACTION_READ(%s,0x%lx,%ld)\n",k->aino->nname,addr,size)); +#ifdef RELY_ON_LOADSEG_DETECTION + /* HACK HACK HACK HACK + * Try to detect a LoadSeg() */ + if (k->file_pos == 0 && size >= 4) { + unsigned char buf[4]; + off_t currpos = lseek(k->fd, 0, SEEK_CUR); + read(k->fd, buf, 4); + lseek(k->fd, currpos, SEEK_SET); + if (buf[0] == 0 && buf[1] == 0 && buf[2] == 3 && buf[3] == 0xF3) + possible_loadseg(); + } +#endif + if (valid_address (addr, size)) { + uae_u8 *realpt; + realpt = get_real_address (addr); + +#ifdef USE_FAME_CORE + /* FAMEC requires swabbed memory, word-padded. + * If realpt is at odd address, we have to swab the first word. + * That word will be re-swabbed after data has been read. + */ + if (((uintptr_t)realpt & 1) > 0) + swab_memory ((unsigned char *)((uintptr_t)realpt & ~1), 2); + + actual = read(k->fd, (char *)realpt, size); + + /* If realpt is at odd address, we also have to swab the + * word in which the last byte has been written. + */ + swab_memory((unsigned char *)((uintptr_t)realpt & ~1), (((actual + 1) & ~1) + ((uintptr_t)realpt & 1)) & ~1); +#else + actual = read(k->fd, (char *) realpt, size); +#endif + + if (actual == 0) { + PUT_PCK_RES1 (packet, 0); + PUT_PCK_RES2 (packet, 0); + } else if (actual < 0) { + PUT_PCK_RES1 (packet, 0); + PUT_PCK_RES2 (packet, dos_errno()); + } else { + PUT_PCK_RES1 (packet, actual); + k->file_pos += actual; + } + } else { + char *buf; + write_log ("unixfs warning: Bad pointer passed for read: %08x\n", addr); + /* ugh this is inefficient but easy */ + buf = (char *)xmalloc(size); + if (!buf) { + PUT_PCK_RES1 (packet, -1); + PUT_PCK_RES2 (packet, ERROR_NO_FREE_STORE); + return; + } + actual = read(k->fd, buf, size); + + if (actual < 0) { + PUT_PCK_RES1 (packet, 0); + PUT_PCK_RES2 (packet, dos_errno()); + } else { + int i; + PUT_PCK_RES1 (packet, actual); + for (i = 0; i < actual; i++) + put_byte(addr + i, buf[i]); + k->file_pos += actual; + } + free (buf); + } +} + +static void +action_write (Unit *unit, dpacket packet) +{ + Key *k = lookup_key (unit, GET_PCK_ARG1 (packet)); + uaecptr addr = GET_PCK_ARG2 (packet); + long size = GET_PCK_ARG3 (packet); + char *buf; + int i; + + if (k == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + /* PUT_PCK_RES2 (packet, EINVAL); */ + return; + } + + TRACE(("ACTION_WRITE(%s,0x%lx,%ld)\n",k->aino->nname,addr,size)); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + /* ugh this is inefficient but easy */ + buf = (char *)xmalloc(size); + if (!buf) { + PUT_PCK_RES1 (packet, -1); + PUT_PCK_RES2 (packet, ERROR_NO_FREE_STORE); + return; + } + + for (i = 0; i < size; i++) + buf[i] = get_byte(addr + i); + + PUT_PCK_RES1 (packet, write(k->fd, buf, size)); + if (GET_PCK_RES1 (packet) != size) + PUT_PCK_RES2 (packet, dos_errno ()); + if (GET_PCK_RES1 (packet) >= 0) + k->file_pos += GET_PCK_RES1 (packet); + + free (buf); +} + +static void +action_seek (Unit *unit, dpacket packet) +{ + Key *k = lookup_key (unit, GET_PCK_ARG1 (packet)); + long pos = (uae_s32)GET_PCK_ARG2 (packet); + long mode = (uae_s32)GET_PCK_ARG3 (packet); + off_t res; + long old; + int whence = SEEK_CUR; + + if (k == 0) { + PUT_PCK_RES1 (packet, -1); + PUT_PCK_RES2 (packet, ERROR_INVALID_LOCK); + return; + } + + if (mode > 0) whence = SEEK_END; + if (mode < 0) whence = SEEK_SET; + + TRACE(("ACTION_SEEK(%s,%d,%d)\n", k->aino->nname, pos, mode)); + + old = lseek (k->fd, 0, SEEK_CUR); + { + uae_s32 temppos; + long filesize = lseek (k->fd, 0, SEEK_END); + lseek (k->fd, old, SEEK_SET); + + if (whence == SEEK_CUR) temppos = old + pos; + if (whence == SEEK_SET) temppos = pos; + if (whence == SEEK_END) temppos = filesize + pos; + if (filesize < temppos) { + res = -1; + PUT_PCK_RES1 (packet,res); + PUT_PCK_RES2 (packet, ERROR_SEEK_ERROR); + return; + } + } + + res = lseek (k->fd, pos, whence); + + if (-1 == res) { + PUT_PCK_RES1 (packet, res); + PUT_PCK_RES2 (packet, ERROR_SEEK_ERROR); + } else + PUT_PCK_RES1 (packet, old); + k->file_pos = res; +} + +static void +action_set_protect (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG2 (packet) << 2; + uaecptr name = GET_PCK_ARG3 (packet) << 2; + uae_u32 mask = GET_PCK_ARG4 (packet); + a_inode *a; + uae_u32 err; + + TRACE(("ACTION_SET_PROTECT(0x%lx,\"%s\",0x%lx)\n", lock, bstr (unit, name), mask)); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + a = find_aino (unit, lock, bstr (unit, name), &err); + if (err != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } + + err = fsdb_set_file_attrs (a, mask); + if (err != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + } else { + PUT_PCK_RES1 (packet, DOS_TRUE); + } +} + +static void action_set_comment (Unit * unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG2 (packet) << 2; + uaecptr name = GET_PCK_ARG3 (packet) << 2; + uaecptr comment = GET_PCK_ARG4 (packet) << 2; + char *commented; + a_inode *a; + uae_u32 err; + long res1, res2; + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + commented = bstr (unit, comment); + commented = strlen (commented) > 0 ? my_strdup (commented) : 0; + TRACE (("ACTION_SET_COMMENT(0x%lx,\"%s\")\n", lock, commented)); + + a = find_aino (unit, lock, bstr (unit, name), &err); + if (err != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + + maybe_free_and_out: + if (commented) + free (commented); + return; + } + PUT_PCK_RES1 (packet, DOS_TRUE); + PUT_PCK_RES2 (packet, 0); + if (a->comment == 0 && commented == 0) + goto maybe_free_and_out; + if (a->comment != 0 && commented != 0 && strcmp (a->comment, commented) == 0) + goto maybe_free_and_out; + if (a->comment) + free (a->comment); + a->comment = commented; + a->dirty = 1; +} + +static void +action_same_lock (Unit *unit, dpacket packet) +{ + uaecptr lock1 = GET_PCK_ARG1 (packet) << 2; + uaecptr lock2 = GET_PCK_ARG2 (packet) << 2; + + TRACE(("ACTION_SAME_LOCK(0x%lx,0x%lx)\n",lock1,lock2)); + DUMPLOCK(unit, lock1); DUMPLOCK(unit, lock2); + + if (!lock1 || !lock2) { + PUT_PCK_RES1 (packet, lock1 == lock2 ? DOS_TRUE : DOS_FALSE); + } else { + PUT_PCK_RES1 (packet, get_long (lock1 + 4) == get_long (lock2 + 4) ? DOS_TRUE : DOS_FALSE); + } +} + +static void +action_change_mode (Unit *unit, dpacket packet) +{ +#define CHANGE_LOCK 0 +#define CHANGE_FH 1 + /* will be CHANGE_FH or CHANGE_LOCK value */ + long type = GET_PCK_ARG1 (packet); + /* either a file-handle or lock */ + uaecptr object = GET_PCK_ARG2 (packet) << 2; + /* will be EXCLUSIVE_LOCK/SHARED_LOCK if CHANGE_LOCK, + * or MODE_OLDFILE/MODE_NEWFILE/MODE_READWRITE if CHANGE_FH */ + long mode = GET_PCK_ARG3 (packet); + unsigned long uniq; + a_inode *a = NULL, *olda = NULL; + uae_u32 err = 0; + TRACE(("ACTION_CHANGE_MODE(0x%lx,%d,%d)\n",object,type,mode)); + + if (! object + || (type != CHANGE_FH && type != CHANGE_LOCK)) + { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_INVALID_LOCK); + return; + } + + /* @@@ Brian: shouldn't this be good enough to support + CHANGE_FH? */ + if (type == CHANGE_FH) + mode = (mode == 1006 ? -1 : -2); + + if (type == CHANGE_LOCK) + uniq = get_long (object + 4); + else { + Key *k = lookup_key (unit, object); + if (!k) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND); + return; + } + uniq = k->aino->uniq; + } + a = lookup_aino (unit, uniq); + + if (! a) + err = ERROR_INVALID_LOCK; + else { + if (mode == -1) { + if (a->shlock > 1) + err = ERROR_OBJECT_IN_USE; + else { + a->shlock = 0; + a->elock = 1; + } + } else { /* Must be SHARED_LOCK == -2 */ + a->elock = 0; + a->shlock++; + } + } + + if (err) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } else { + de_recycle_aino (unit, a); + PUT_PCK_RES1 (packet, DOS_TRUE); + } +} + +static void +action_parent_common (Unit *unit, dpacket packet, unsigned long uniq) +{ + a_inode *olda = lookup_aino (unit, uniq); + if (olda == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_INVALID_LOCK); + return; + } + + if (olda->parent == 0) { + PUT_PCK_RES1 (packet, 0); + PUT_PCK_RES2 (packet, 0); + return; + } + if (olda->parent->elock) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_IN_USE); + return; + } + olda->parent->shlock++; + de_recycle_aino (unit, olda->parent); + PUT_PCK_RES1 (packet, make_lock (unit, olda->parent->uniq, -2) >> 2); +} + +static void +action_parent_fh (Unit *unit, dpacket packet) +{ + Key *k = lookup_key (unit, GET_PCK_ARG1 (packet)); + if (!k) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND); + return; + } + action_parent_common (unit, packet, k->aino->uniq); +} + +static void +action_parent (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + + TRACE(("ACTION_PARENT(0x%lx)\n",lock)); + + if (!lock) { + PUT_PCK_RES1 (packet, 0); + PUT_PCK_RES2 (packet, 0); + return; + } + action_parent_common (unit, packet, get_long (lock + 4)); +} + +static void +action_create_dir (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + uaecptr name = GET_PCK_ARG2 (packet) << 2; + a_inode *aino; + uae_u32 err; + + TRACE(("ACTION_CREATE_DIR(0x%lx,\"%s\")\n", lock, bstr (unit, name))); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + aino = find_aino (unit, lock, bstr (unit, name), &err); + if (aino == 0 || (err != 0 && err != ERROR_OBJECT_NOT_AROUND)) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } + if (err == 0) { + /* Object exists. */ + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_EXISTS); + return; + } + /* Object does not exist. aino points to containing directory. */ + aino = create_child_aino (unit, aino, my_strdup (bstr_cut (unit, name)), 1); + if (aino == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_IS_FULL); /* best we can do */ + return; + } + + if (mkdir (aino->nname, 0777) == -1) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno()); + return; + } + aino->shlock = 1; + de_recycle_aino (unit, aino); + PUT_PCK_RES1 (packet, make_lock (unit, aino->uniq, -2) >> 2); +} + +static void +action_examine_fh (Unit *unit, dpacket packet) +{ + Key *k; + a_inode *aino = 0; + uaecptr info = GET_PCK_ARG2 (packet) << 2; + + TRACE(("ACTION_EXAMINE_FH(0x%lx,0x%lx)\n", + GET_PCK_ARG1 (packet), GET_PCK_ARG2 (packet) )); + + k = lookup_key (unit, GET_PCK_ARG1 (packet)); + if (k != 0) + aino = k->aino; + if (aino == 0) + aino = &unit->rootnode; + + get_fileinfo (unit, packet, info, aino); + if (aino->dir) + put_long (info, 0xFFFFFFFF); + else + put_long (info, 0); +} + +/* For a nice example of just how contradictory documentation can be, see the + * Autodoc for DOS:SetFileSize and the Packets.txt description of this packet... + * This implementation tries to mimic the behaviour of the Kick 3.1 ramdisk + * (which seems to match the Autodoc description). */ +static void +action_set_file_size (Unit *unit, dpacket packet) +{ + Key *k, *k1; + off_t offset = GET_PCK_ARG2 (packet); + long mode = (uae_s32)GET_PCK_ARG3 (packet); + int whence = SEEK_CUR; + + if (mode > 0) whence = SEEK_END; + if (mode < 0) whence = SEEK_SET; + + TRACE(("ACTION_SET_FILE_SIZE(0x%lx, %d, 0x%x)\n", GET_PCK_ARG1 (packet), offset, mode)); + + k = lookup_key (unit, GET_PCK_ARG1 (packet)); + if (k == 0) { + PUT_PCK_RES1 (packet, DOS_TRUE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND); + return; + } + + /* If any open files have file pointers beyond this size, truncate only + * so far that these pointers do not become invalid. */ + for (k1 = unit->keys; k1; k1 = k1->next) { + if (k != k1 && k->aino == k1->aino) { + if (k1->file_pos > offset) + offset = k1->file_pos; + } + } + + /* Write one then truncate: that should give the right size in all cases. */ + offset = lseek (k->fd, offset, whence); + write (k->fd, /* whatever */(char *)&k1, 1); + if (k->file_pos > offset) + k->file_pos = offset; + lseek (k->fd, k->file_pos, SEEK_SET); + + /* Brian: no bug here; the file _must_ be one byte too large after writing + The write is supposed to guarantee that the file can't be smaller than + the requested size, the truncate guarantees that it can't be larger. + If we were to write one byte earlier we'd clobber file data. */ + if (truncate (k->aino->nname, offset) == -1) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno ()); + return; + } + + PUT_PCK_RES1 (packet, offset); + PUT_PCK_RES2 (packet, 0); +} + +static void +action_delete_object (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG1 (packet) << 2; + uaecptr name = GET_PCK_ARG2 (packet) << 2; + a_inode *a; + uae_u32 err; + + TRACE(("ACTION_DELETE_OBJECT(0x%lx,\"%s\")\n", lock, bstr (unit, name))); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + a = find_aino (unit, lock, bstr (unit, name), &err); + + if (err != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + return; + } + if (a->amigaos_mode & A_FIBF_DELETE) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DELETE_PROTECTED); + return; + } + if (a->shlock > 0 || a->elock) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_OBJECT_IN_USE); + return; + } + if (a->dir) { + /* This should take care of removing the fsdb if no files remain. */ + fsdb_dir_writeback (a); + if (my_rmdir (unit, a) == -1) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno()); + return; + } + } else { + if (unlink (a->nname) == -1) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno()); + return; + } + } + if (a->child != 0) { + write_log ("Serious error in action_delete_object.\n"); + } else { + delete_aino (unit, a); + } + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_set_date (Unit *unit, dpacket packet) +{ + uaecptr lock = GET_PCK_ARG2 (packet) << 2; + uaecptr name = GET_PCK_ARG3 (packet) << 2; + uaecptr date = GET_PCK_ARG4 (packet); + a_inode *a; + struct utimbuf ut; + uae_u32 err; + + TRACE(("ACTION_SET_DATE(0x%lx,\"%s\")\n", lock, bstr (unit, name))); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + ut.actime = ut.modtime = put_time(get_long (date), get_long (date + 4), + get_long (date + 8)); + a = find_aino (unit, lock, bstr (unit, name), &err); + if (err == 0 && utime (a->nname, &ut) == -1) + err = dos_errno (); + if (err != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err); + } else + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_rename_object (Unit *unit, dpacket packet) +{ + uaecptr lock1 = GET_PCK_ARG1 (packet) << 2; + uaecptr name1 = GET_PCK_ARG2 (packet) << 2; + uaecptr lock2 = GET_PCK_ARG3 (packet) << 2; + uaecptr name2 = GET_PCK_ARG4 (packet) << 2; + a_inode *a1, *a2; + uae_u32 err1, err2; + + TRACE(("ACTION_RENAME_OBJECT(0x%lx,\"%s\",", lock1, bstr (unit, name1))); + TRACE(("0x%lx,\"%s\")\n", lock2, bstr (unit, name2))); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + a1 = find_aino (unit, lock1, bstr (unit, name1), &err1); + if (err1 != 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err1); + return; + } + /* See whether the other name already exists in the filesystem. */ + a2 = find_aino (unit, lock2, bstr (unit, name2), &err2); + if (a2 == a1) { + /* Renaming to the same name, but possibly different case. */ + if (strcmp (a1->aname, bstr_cut (unit, name2)) == 0) { + /* Exact match -> do nothing. */ + PUT_PCK_RES1 (packet, DOS_TRUE); + return; + } + a2 = a2->parent; + } else if (a2 == 0 || err2 != ERROR_OBJECT_NOT_AROUND) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, err2 == 0 ? ERROR_OBJECT_EXISTS : err2); + return; + } + + a2 = create_child_aino (unit, a2, bstr_cut (unit, name2), a1->dir); + if (a2 == 0) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_IS_FULL); /* best we can do */ + return; + } + + /* @@@ what should we do if there are locks on a1? */ + if (-1 == rename (a1->nname, a2->nname)) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, dos_errno ()); + return; + } + a2->comment = a1->comment; + a1->comment = 0; + a2->amigaos_mode = a1->amigaos_mode; + a2->uniq = a1->uniq; + move_exkeys (unit, a1, a2); + move_aino_children (unit, a1, a2); + delete_aino (unit, a1); + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_current_volume (Unit *unit, dpacket packet) +{ + PUT_PCK_RES1 (packet, unit->volume >> 2); +} + +static void +action_rename_disk (Unit *unit, dpacket packet) +{ + uaecptr name = GET_PCK_ARG1 (packet) << 2; + int i; + int namelen; + + TRACE(("ACTION_RENAME_DISK(\"%s\")\n", bstr (unit, name))); + + if (unit->ui.readonly) { + PUT_PCK_RES1 (packet, DOS_FALSE); + PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED); + return; + } + + /* get volume name */ + namelen = get_byte (name); name++; + free (unit->ui.volname); + unit->ui.volname = (char *) xmalloc (namelen + 1); + for (i = 0; i < namelen; i++, name++) + unit->ui.volname[i] = get_byte (name); + unit->ui.volname[i] = 0; + + put_byte (unit->volume + 44, namelen); + for (i = 0; i < namelen; i++) + put_byte (unit->volume + 45 + i, unit->ui.volname[i]); + + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_is_filesystem (Unit *unit, dpacket packet) +{ + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +static void +action_flush (Unit *unit, dpacket packet) +{ + /* sync(); */ /* pretty drastic, eh */ + PUT_PCK_RES1 (packet, DOS_TRUE); +} + +/* We don't want multiple interrupts to be active at the same time. I don't + * know whether AmigaOS takes care of that, but this does. */ +static uae_sem_t singlethread_int_sem; + +static uae_u32 exter_int_helper (void) +{ + UnitInfo *uip = current_mountinfo->ui; + uaecptr port; + static int unit_no; + + switch (m68k_dreg (regs, 0)) { + case 0: + /* Determine whether a given EXTER interrupt is for us. */ + if (uae_int_requested) { + if (uae_sem_trywait (&singlethread_int_sem) != 0) + /* Pretend it isn't for us. We might get it again later. */ + return 0; + /* Clear the interrupt flag _before_ we do any processing. + * That way, we can get too many interrupts, but never not + * enough. */ + uae_int_requested = 0; + unit_no = 0; + return 1; + } + return 0; + case 1: + /* Release a message_lock. This is called as soon as the message is + * received by the assembly code. We use the opportunity to check + * whether we have some locks that we can give back to the assembler + * code. + * Note that this is called from the main loop, unlike the other cases + * in this switch statement which are called from the interrupt handler. + */ +#ifdef UAE_FILESYS_THREADS + { + Unit *unit = find_unit (m68k_areg (regs, 5)); + unit->cmds_complete = unit->cmds_acked; + while (comm_pipe_has_data (unit->ui.back_pipe)) { + uaecptr locks, lockend; + locks = read_comm_pipe_int_blocking (unit->ui.back_pipe); + lockend = locks; + while (get_long (lockend) != 0) + lockend = get_long (lockend); + put_long (lockend, get_long (m68k_areg (regs, 3))); + put_long (m68k_areg (regs, 3), locks); + } + } +#else + write_log ("exter_int_helper should not be called with arg 1!\n"); +#endif + break; + case 2: + /* Find work that needs to be done: + * return d0 = 0: none + * d0 = 1: PutMsg(), port in a0, message in a1 + * d0 = 2: Signal(), task in a1, signal set in d1 + * d0 = 3: ReplyMsg(), message in a1 */ + +#ifdef SUPPORT_THREADS + /* First, check signals/messages */ + while (comm_pipe_has_data (&native2amiga_pending)) { + switch (read_comm_pipe_int_blocking (&native2amiga_pending)) { + case 0: /* Signal() */ + m68k_areg (regs, 1) = read_comm_pipe_u32_blocking (&native2amiga_pending); + m68k_dreg (regs, 1) = read_comm_pipe_u32_blocking (&native2amiga_pending); + return 2; + + case 1: /* PutMsg() */ + m68k_areg (regs, 0) = read_comm_pipe_u32_blocking (&native2amiga_pending); + m68k_areg (regs, 1) = read_comm_pipe_u32_blocking (&native2amiga_pending); + return 1; + + case 2: /* ReplyMsg() */ + m68k_areg (regs, 1) = read_comm_pipe_u32_blocking (&native2amiga_pending); + return 3; + + default: + write_log ("exter_int_helper: unknown native action\n"); + break; + } + } +#endif + + /* Find some unit that needs a message sent, and return its port, + * or zero if all are done. + * Take care not to dereference self for units that didn't have their + * startup packet sent. */ + for (;;) { + if (unit_no >= current_mountinfo->num_units) + return 0; + + if (uip[unit_no].self != 0 + && uip[unit_no].self->cmds_acked == uip[unit_no].self->cmds_complete + && uip[unit_no].self->cmds_acked != uip[unit_no].self->cmds_sent) + break; + unit_no++; + } + uip[unit_no].self->cmds_acked = uip[unit_no].self->cmds_sent; + port = uip[unit_no].self->port; + if (port) { + m68k_areg (regs, 0) = port; + m68k_areg (regs, 1) = find_unit (port)->dummy_message; + unit_no++; + return 1; + } + break; + case 4: + /* Exit the interrupt, and release the single-threading lock. */ + uae_sem_post (&singlethread_int_sem); + break; + + default: + write_log ("Shouldn't happen in exter_int_helper.\n"); + break; + } + return 0; +} + +static int handle_packet (Unit *unit, dpacket pck) +{ + uae_s32 type = GET_PCK_TYPE (pck); + PUT_PCK_RES2 (pck, 0); + + switch (type) { + case ACTION_LOCATE_OBJECT: action_lock (unit, pck); break; + case ACTION_FREE_LOCK: action_free_lock (unit, pck); break; + case ACTION_COPY_DIR: action_dup_lock (unit, pck); break; + case ACTION_DISK_INFO: action_disk_info (unit, pck); break; + case ACTION_INFO: action_info (unit, pck); break; + case ACTION_EXAMINE_OBJECT: action_examine_object (unit, pck); break; + case ACTION_EXAMINE_NEXT: action_examine_next (unit, pck); break; + case ACTION_FIND_INPUT: action_find_input (unit, pck); break; + case ACTION_FIND_WRITE: action_find_write (unit, pck); break; + case ACTION_FIND_OUTPUT: action_find_output (unit, pck); break; + case ACTION_END: action_end (unit, pck); break; + case ACTION_READ: action_read (unit, pck); gui_data.hdled = HDLED_READ; break; + case ACTION_WRITE: action_write (unit, pck); gui_data.hdled = HDLED_WRITE; break; + case ACTION_SEEK: action_seek (unit, pck); break; + case ACTION_SET_PROTECT: action_set_protect (unit, pck); break; + case ACTION_SET_COMMENT: action_set_comment (unit, pck); break; + case ACTION_SAME_LOCK: action_same_lock (unit, pck); break; + case ACTION_PARENT: action_parent (unit, pck); break; + case ACTION_CREATE_DIR: action_create_dir (unit, pck); break; + case ACTION_DELETE_OBJECT: action_delete_object (unit, pck); break; + case ACTION_RENAME_OBJECT: action_rename_object (unit, pck); break; + case ACTION_SET_DATE: action_set_date (unit, pck); break; + case ACTION_CURRENT_VOLUME: action_current_volume (unit, pck); break; + case ACTION_RENAME_DISK: action_rename_disk (unit, pck); break; + case ACTION_IS_FILESYSTEM: action_is_filesystem (unit, pck); break; + case ACTION_FLUSH: action_flush (unit, pck); break; + + /* 2.0+ packet types */ + case ACTION_SET_FILE_SIZE: action_set_file_size (unit, pck); break; + case ACTION_EXAMINE_FH: action_examine_fh (unit, pck); break; + case ACTION_FH_FROM_LOCK: action_fh_from_lock (unit, pck); break; + case ACTION_CHANGE_MODE: action_change_mode (unit, pck); break; + case ACTION_PARENT_FH: action_parent_fh (unit, pck); break; + + /* unsupported packets */ + case ACTION_LOCK_RECORD: + case ACTION_FREE_RECORD: + case ACTION_COPY_DIR_FH: + case ACTION_MAKE_LINK: + case ACTION_READ_LINK: + case ACTION_FORMAT: + case ACTION_EXAMINE_ALL: + case ACTION_ADD_NOTIFY: + case ACTION_REMOVE_NOTIFY: + default: + TRACE(("*** UNSUPPORTED PACKET %ld\n", type)); + return 0; + } + return 1; +} + +#ifdef UAE_FILESYS_THREADS +static void *filesys_thread (void *unit_v) +{ + UnitInfo *ui = (UnitInfo *)unit_v; + for (;;) { + uae_u8 *pck; + uae_u8 *msg; + uae_u32 morelocks; + int i; + + pck = (uae_u8 *)read_comm_pipe_pvoid_blocking (ui->unit_pipe); + msg = (uae_u8 *)read_comm_pipe_pvoid_blocking (ui->unit_pipe); + morelocks = (uae_u32)read_comm_pipe_int_blocking (ui->unit_pipe); + + if (ui->reset_state == FS_GO_DOWN) { + if (pck != 0) + continue; + /* Death message received. */ + uae_sem_post (&ui->reset_sync_sem); + /* Die. */ + return 0; + } + + put_long (get_long (morelocks), get_long (ui->self->locklist)); + put_long (ui->self->locklist, morelocks); + if (! handle_packet (ui->self, pck)) { + PUT_PCK_RES1 (pck, DOS_FALSE); + PUT_PCK_RES2 (pck, ERROR_ACTION_NOT_KNOWN); + } + /* Mark the packet as processed for the list scan in the assembly code. */ + do_put_mem_long ((uae_u32 *)(msg + 4), -1); + /* Acquire the message lock, so that we know we can safely send the + * message. */ + ui->self->cmds_sent++; + /* The message is sent by our interrupt handler, so make sure an interrupt + * happens. */ + uae_int_requested = 1; + /* Send back the locks. */ + if (get_long (ui->self->locklist) != 0) + write_comm_pipe_int (ui->back_pipe, (int)(get_long (ui->self->locklist)), 0); + put_long (ui->self->locklist, 0); + } + return 0; +} +#endif + +/* Talk about spaghetti code... */ +static uae_u32 filesys_handler (void) +{ + Unit *unit = find_unit (m68k_areg (regs, 5)); + uaecptr packet_addr = m68k_dreg (regs, 3); + uaecptr message_addr = m68k_areg (regs, 4); + uae_u8 *pck; + uae_u8 *msg; + if (! valid_address (packet_addr, 36) || ! valid_address (message_addr, 14)) { + write_log ("Bad address passed for packet.\n"); + goto error2; + } + pck = get_real_address (packet_addr); + msg = get_real_address (message_addr); + + do_put_mem_long ((uae_u32 *)(msg + 4), -1); + if (!unit || !unit->volume) { + write_log ("Filesystem was not initialized.\n"); + goto error; + } +#ifdef UAE_FILESYS_THREADS + { + /* Get two more locks and hand them over to the other thread. */ + uae_u32 morelocks; + morelocks = get_long (m68k_areg (regs, 3)); + put_long (m68k_areg (regs, 3), get_long (get_long (morelocks))); + put_long (get_long (morelocks), 0); + + /* The packet wasn't processed yet. */ + do_put_mem_long ((uae_u32 *)(msg + 4), 0); + write_comm_pipe_pvoid (unit->ui.unit_pipe, (void *)pck, 0); + write_comm_pipe_pvoid (unit->ui.unit_pipe, (void *)msg, 0); + write_comm_pipe_int (unit->ui.unit_pipe, (int)morelocks, 1); + /* Don't reply yet. */ + return 1; + } +#endif + + if (! handle_packet (unit, pck)) { + error: + PUT_PCK_RES1 (pck, DOS_FALSE); + PUT_PCK_RES2 (pck, ERROR_ACTION_NOT_KNOWN); + } + TRACE(("reply: %8lx, %ld\n", GET_PCK_RES1 (pck), GET_PCK_RES2 (pck))); + + error2: + + return 0; +} + +static int current_deviceno = 0; +static int current_cdrom = 0; + +static void reset_uaedevices (void) +{ + current_deviceno = 0; + current_cdrom = 0; +} + +static int get_new_device (char **devname, uaecptr *devname_amiga, int cdrom) +{ + int result; + char buffer[80]; + + if (cdrom) { + snprintf (buffer, 80, "CD%d", current_cdrom); + result = current_cdrom++; + } else { + snprintf (buffer, 80, "DH%d", current_deviceno); + result = current_deviceno++; + } + + *devname_amiga = ds (*devname = my_strdup (buffer)); + return result; +} + +void filesys_start_threads (void) +{ + UnitInfo *uip; + int i; + + current_mountinfo = dup_mountinfo (currprefs_mountinfo); + + reset_uaedevices (); + + uip = current_mountinfo->ui; + + for (i = 0; i < current_mountinfo->num_units; i++) { + uip[i].unit_pipe = 0; + uip[i].devno = get_new_device (&uip[i].devname, &uip[i].devname_amiga, 0); + +#ifdef UAE_FILESYS_THREADS + if (! is_hardfile (current_mountinfo, i)) { + uip[i].unit_pipe = (smp_comm_pipe *)xmalloc (sizeof (smp_comm_pipe)); + uip[i].back_pipe = (smp_comm_pipe *)xmalloc (sizeof (smp_comm_pipe)); + init_comm_pipe (uip[i].unit_pipe, 50, 3); + init_comm_pipe (uip[i].back_pipe, 50, 1); + uae_start_thread (filesys_thread, (void *)(uip + i), &uip[i].tid); + } +#endif + } +} + +void filesys_reset (void) +{ + Unit *u, *u1; + + /* We get called once from customreset at the beginning of the program + * before filesys_start_threads has been called. Survive that. */ + if (current_mountinfo == 0) + return; + + for (u = units; u; u = u1) { + u1 = u->next; + free (u); + } + unit_num = 0; + units = 0; + + free_mountinfo (current_mountinfo); + current_mountinfo = 0; +} + +static void free_all_ainos (Unit *u, a_inode *parent) +{ + a_inode *a; + while (a = parent->child) + { + free_all_ainos (u, a); + dispose_aino (u, &parent->child, a); + } +} + + +void filesys_prepare_reset (void) +{ + UnitInfo *uip = current_mountinfo->ui; + Unit *u; + int i; + +#ifdef UAE_FILESYS_THREADS + for (i = 0; i < current_mountinfo->num_units; i++) { + if (uip[i].unit_pipe != 0) { + uae_sem_init (&uip[i].reset_sync_sem, 0, 0); + uip[i].reset_state = FS_GO_DOWN; + /* send death message */ + write_comm_pipe_int (uip[i].unit_pipe, 0, 0); + write_comm_pipe_int (uip[i].unit_pipe, 0, 0); + write_comm_pipe_int (uip[i].unit_pipe, 0, 1); + uae_sem_wait (&uip[i].reset_sync_sem); + } + } +#endif + u = units; + while (u != 0) { + free_all_ainos (u, &u->rootnode); + u->rootnode.next = u->rootnode.prev = &u->rootnode; + u->aino_cache_size = 0; + u = u->next; + } +} + +static uae_u32 filesys_diagentry (void) +{ + uaecptr resaddr = m68k_areg (regs, 2) + 0x10; + uaecptr start = resaddr; + uaecptr residents, tmp; + + TRACE (("filesystem: diagentry called\n")); + + filesys_configdev = m68k_areg (regs, 3); + + do_put_mem_long ((uae_u32 *)(filesysory + 0x2100), EXPANSION_explibname); + do_put_mem_long ((uae_u32 *)(filesysory + 0x2104), filesys_configdev); + do_put_mem_long ((uae_u32 *)(filesysory + 0x2108), EXPANSION_doslibname); + do_put_mem_long ((uae_u32 *)(filesysory + 0x210c), current_mountinfo->num_units); + + uae_sem_init (&singlethread_int_sem, 0, 1); + if (ROM_hardfile_resid != 0) { + /* Build a struct Resident. This will set up and initialize + * the uae.device */ + put_word (resaddr + 0x0, 0x4AFC); + put_long (resaddr + 0x2, resaddr); + put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ + put_word (resaddr + 0xA, 0x8101); /* RTF_AUTOINIT|RTF_COLDSTART; Version 1 */ + put_word (resaddr + 0xC, 0x0305); /* NT_DEVICE; pri 05 */ + put_long (resaddr + 0xE, ROM_hardfile_resname); + put_long (resaddr + 0x12, ROM_hardfile_resid); + put_long (resaddr + 0x16, ROM_hardfile_init); /* calls filesys_init */ + } + resaddr += 0x1A; + tmp = resaddr; + + /* The good thing about this function is that it always gets called + * when we boot. So we could put all sorts of stuff that wants to be done + * here. + * We can simply add more Resident structures here. Although the Amiga OS + * only knows about the one at address DiagArea + 0x10, we scan for other + * Resident structures and call InitResident() for them at the end of the + * diag entry. */ + + resaddr = scsidev_startup(resaddr); + native2amiga_startup(); + + /* scan for Residents and return pointer to array of them */ + residents = resaddr; + while (tmp < residents && tmp > start) { + if (get_word (tmp) == 0x4AFC && + get_long (tmp + 0x2) == tmp) { + put_word (resaddr, 0x227C); /* movea.l #tmp,a1 */ + put_long (resaddr + 2, tmp); + put_word (resaddr + 6, 0x7200); /* moveq.l #0,d1 */ + put_long (resaddr + 8, 0x4EAEFF9A); /* jsr -$66(a6) ; InitResident */ + resaddr += 12; + tmp = get_long (tmp + 0x6); + } else { + tmp++; + } + } + /* call setup_exter */ + put_word (resaddr + 0, 0x2079); + put_long (resaddr + 2, RTAREA_BASE + 28 + 4); /* move.l RTAREA_BASE+32,a0 */ + put_word (resaddr + 6, 0xd1fc); + put_long (resaddr + 8, RTAREA_BASE + 8 + 4); /* add.l #RTAREA_BASE+12,a0 */ + put_word (resaddr + 12, 0x4e90); /* jsr (a0) */ + + put_word (resaddr + 14, 0x7001); /* moveq.l #1,d0 */ + put_word (resaddr + 16, RTS); + + m68k_areg (regs, 0) = residents; + return 1; +} + +/******************* + * WinUAE code + *******************/ +/* don't forget filesys.asm! */ +#define PP_MAXSIZE 4 * 96 +#define PP_FSSIZE 400 +#define PP_FSPTR 404 +#define PP_FSRES 408 +#define PP_EXPLIB 412 +#define PP_FSHDSTART 416 + +static uae_u32 filesys_dev_bootfilesys (void) //TrapContext *context) +{ + uaecptr devicenode = m68k_areg (/*&context->*/regs, 3); + uaecptr parmpacket = m68k_areg (/*&context->*/regs, 1); + uaecptr fsres = get_long (parmpacket + PP_FSRES); + uaecptr fsnode; + uae_u32 dostype, dostype2; + int no = m68k_dreg (/*&context->*/regs, 6); + int unit_no = no & 65535; + int type = is_hardfile (currprefs_mountinfo, unit_no); + + if (type == FILESYS_VIRTUAL) + return 0; + dostype = get_long (parmpacket + 80); + fsnode = get_long (fsres + 18); + while (get_long (fsnode)) { + dostype2 = get_long (fsnode + 14); + if (dostype2 == dostype) { + if (get_long (fsnode + 22) & (1 << 7)) { + put_long (devicenode + 32, get_long (fsnode + 54)); /* dn_SegList */ + put_long (devicenode + 36, -1); /* dn_GlobalVec */ + } + return 1; + } + fsnode = get_long (fsnode); + } + return 0; +} + +//extern void picasso96_alloc (TrapContext*); +static uae_u32 REGPARAM2 filesys_init_storeinfo (void) //TrapContext *context) +{ + int ret = -1; +// switch (m68k_dreg (/*&context->*/regs, 1)) +// { +// case 1: +// mountertask = m68k_areg (/*&context->regs*/, 1); +// // picasso96_alloc (context); +// break; +// case 2: +// ret = automountunit; +// automountunit = -1; +// break; +// case 3: +// return 0; +// } + return ret; +} +/*******************/ + +/* Remember a pointer AmigaOS gave us so we can later use it to identify + * which unit a given startup message belongs to. */ +static uae_u32 filesys_dev_remember (void) +{ + int unit_no = m68k_dreg (regs, 6); + uaecptr devicenode = m68k_areg (regs, 3); + + current_mountinfo->ui[unit_no].startup = get_long (devicenode + 28); + return devicenode; +} + +/* Fill in per-unit fields of a parampacket */ +static uae_u32 filesys_dev_storeinfo (void) +{ + UnitInfo *uip = current_mountinfo->ui; + int unit_no = m68k_dreg (regs, 6); + uaecptr parmpacket = m68k_areg (regs, 0); + + /* WinUAE code */ + int sub_no = unit_no >> 16; + unit_no = unit_no & 0xFFFF; + if (sub_no) + return -2; + /***************/ + + put_long (parmpacket, current_mountinfo->ui[unit_no].devname_amiga); + put_long (parmpacket + 4, is_hardfile (current_mountinfo, unit_no) ? ROM_hardfile_resname : fsdevname); + put_long (parmpacket + 8, uip[unit_no].devno); + put_long (parmpacket + 12, 0); /* Device flags */ + put_long (parmpacket + 16, 16); /* Env. size */ + put_long (parmpacket + 20, uip[unit_no].hf.blocksize >> 2); /* longwords per block */ + put_long (parmpacket + 24, 0); /* unused */ + put_long (parmpacket + 28, uip[unit_no].hf.surfaces); /* heads */ + put_long (parmpacket + 32, 0); /* unused */ + put_long (parmpacket + 36, uip[unit_no].hf.secspertrack); /* sectors per track */ + put_long (parmpacket + 40, uip[unit_no].hf.reservedblocks); /* reserved blocks */ + put_long (parmpacket + 44, 0); /* unused */ + put_long (parmpacket + 48, 0); /* interleave */ + put_long (parmpacket + 52, 0); /* lowCyl */ +// put_long (parmpacket + 56, uip[unit_no].hf.nrcyls - 1); /* hiCyl */ + /* WinUAE code */ + put_long (parmpacket + 56, uip[unit_no].hf.nrcyls <= 0 ? 0 : uip[unit_no].hf.nrcyls - 1); /* hiCyl */ + /***************/ + put_long (parmpacket + 60, 50); /* Number of buffers */ + put_long (parmpacket + 64, 0); /* Buffer mem type */ + put_long (parmpacket + 68, 0x7FFFFFFF); /* largest transfer */ + put_long (parmpacket + 72, ~1); /* addMask (?) */ +// put_long (parmpacket + 76, (uae_u32)-1); /* bootPri */ + /* WinUAE code */ + put_long (parmpacket + 76, 0/*uip[unit_no].bootpri*/); /* bootPri */ + /***************/ + put_long (parmpacket + 80, 0x444f5300); /* DOS\0 */ + put_long (parmpacket + 84, 0); /* pad */ + + return is_hardfile (current_mountinfo, unit_no); +} + +void filesys_install (void) +{ + int i; + uaecptr loop; + + TRACE (("Installing filesystem\n")); + + ROM_filesys_resname = ds("UAEunixfs.resource"); + ROM_filesys_resid = ds("UAE unixfs 0.4"); + + fsdevname = ds ("uae.device"); /* does not really exist */ + + ROM_filesys_diagentry = here(); + calltrap (deftrap2 (filesys_diagentry, 0, "filesys_diagentry")); + dw(0x4ED0); /* JMP (a0) - jump to code that inits Residents */ + + loop = here (); + + /*** WinUAE code ***/ + org (RTAREA_BASE + 0xFF18); + calltrap (deftrap2 (filesys_dev_bootfilesys, 0, "filesys_dev_bootfilesys")); + dw (RTS); + /*******************/ + + /* Special trap for the assembly make_dev routine */ + org (RTAREA_BASE + 0xFF20); + calltrap (deftrap2 (filesys_dev_remember, 0, "filesys_dev_remember")); + dw (RTS); + + org (RTAREA_BASE + 0xFF28); + calltrap (deftrap2 (filesys_dev_storeinfo, 0, "filesys_dev_storeinfo")); + dw (RTS); + + org (RTAREA_BASE + 0xFF30); + calltrap (deftrap2 (filesys_handler, 0, "filesys_handler")); + dw (RTS); + + org (RTAREA_BASE + 0xFF40); + calltrap (deftrap2 (startup_handler, 0, "startup_handler")); + dw (RTS); + + /*** WinUAE code ***/ + org (RTAREA_BASE + 0xFF48); + calltrap (deftrap2 (filesys_init_storeinfo, 0/*TRAPFLAG_EXTRA_STACK*/, "filesys_init_storeinfo")); + dw (RTS); + /*******************/ + + org (RTAREA_BASE + 0xFF50); + calltrap (deftrap2 (exter_int_helper, 0, "exter_int_helper")); + dw (RTS); + + org (loop); +} + +void filesys_install_code (void) +{ + align(4); + + /******************************** + * WinUAE boot code + ********************************/ + /* The last offset comes from the code itself, look for it near the top. */ + EXPANSION_bootcode = here () + 8 + 0x1c + 4; + /* Ouch. Make sure this is _always_ a multiple of two bytes. */ + filesys_initcode = here() + 8 + 0x30 + 4; + + #include "filesys_bootrom.cpp" + /********************************/ + + +} + +#ifdef WIN32 +#include +#include + +static DWORD lasterror; + +int truncate (const char *name, long int len) +{ + HANDLE hFile; + BOOL bResult = FALSE; + int result = -1; + + if ((hFile = CreateFile (name, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) { + if (SetFilePointer (hFile, len, NULL, FILE_BEGIN) == (DWORD)len) { + if (SetEndOfFile (hFile) == TRUE) + result = 0; + } else { + write_log ("SetFilePointer() failure for %s to posn %d\n", name, len); + } + CloseHandle (hFile); + } else { + write_log( "CreateFile() failed to open %s\n", name ); + } + + if (result == -1) + lasterror = GetLastError (); + return result; +} +#endif + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/filesys_bootrom.cpp b/uae4all_gp2x_0.7.2a/src/filesys_bootrom.cpp new file mode 100755 index 0000000..142343c --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/filesys_bootrom.cpp @@ -0,0 +1,497 @@ + db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); + db(0x60); db(0x00); db(0x09); db(0x6c); db(0x00); db(0x00); db(0x07); db(0x36); + db(0x00); db(0x00); db(0x00); db(0x34); db(0x00); db(0x00); db(0x01); db(0x78); + db(0x00); db(0x00); db(0x00); db(0x20); db(0x00); db(0x00); db(0x02); db(0x34); + db(0x00); db(0x00); db(0x0b); db(0xa0); db(0x00); db(0x00); db(0x0d); db(0x38); + db(0x43); db(0xfa); db(0x0f); db(0x0e); db(0x4e); db(0xae); db(0xff); db(0xa0); + db(0x20); db(0x40); db(0x20); db(0x28); db(0x00); db(0x16); db(0x20); db(0x40); + db(0x4e); db(0x90); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xff); db(0xfe); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0xfc); + db(0x61); db(0x00); db(0x0b); db(0x4e); db(0x2a); db(0x50); db(0x43); db(0xfa); + db(0x0f); db(0x06); db(0x70); db(0x24); db(0x7a); db(0x01); db(0x4e); db(0xae); + db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x66); db(0x0c); db(0x43); db(0xfa); + db(0x0e); db(0xf6); db(0x70); db(0x00); db(0x7a); db(0x00); db(0x4e); db(0xae); + db(0xfd); db(0xd8); db(0x28); db(0x40); db(0x4a); db(0xad); db(0x01); db(0x0c); + db(0x67); db(0x5a); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); + db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); + db(0xff); db(0x3a); db(0x26); db(0x40); db(0x27); db(0x4c); db(0x01); db(0x9c); + db(0x7c); db(0x00); db(0xbc); db(0xad); db(0x01); db(0x0c); db(0x64); db(0x2c); + db(0x2f); db(0x06); db(0x7e); db(0x01); db(0x4a); db(0x45); db(0x67); db(0x04); + db(0x08); db(0xc7); db(0x00); db(0x02); db(0x2f); db(0x0b); db(0x20); db(0x4b); + db(0x61); db(0x00); db(0x06); db(0x9c); db(0x26); db(0x5f); db(0x0c); db(0x80); + db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); + db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xdc); db(0x2c); db(0x1f); + db(0x52); db(0x46); db(0x60); db(0xce); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x22); db(0x4b); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); + db(0x4e); db(0xae); db(0xff); db(0x2e); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x30); db(0x3c); + db(0xff); db(0x80); db(0x61); db(0x00); db(0x0a); db(0xbc); db(0x4e); db(0x90); + db(0x72); db(0x03); db(0x74); db(0xf6); db(0x20); db(0x7c); db(0x00); db(0x20); + db(0x00); db(0x00); db(0x90); db(0x88); db(0x65); db(0x0a); db(0x67); db(0x08); + db(0x78); db(0x00); db(0x22); db(0x44); db(0x4e); db(0xae); db(0xfd); db(0x96); + db(0x41); db(0xfa); db(0x0e); db(0x12); db(0x43); db(0xfa); db(0x00); db(0x1c); + db(0x70); db(0x0a); db(0x61); db(0x00); db(0x0b); db(0xdc); db(0x22); db(0x40); + db(0x72); db(0x01); db(0x30); db(0x3c); db(0xff); db(0x48); db(0x61); db(0x00); + db(0x0a); db(0x88); db(0x4e); db(0x90); db(0x4c); db(0xdf); db(0x7f); db(0xff); + db(0x4e); db(0x75); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x00); + db(0x08); db(0xc0); db(0x00); db(0x11); db(0x4e); db(0xae); db(0xfe); db(0xc2); + db(0x43); db(0xfa); db(0x0e); db(0x0e); db(0x70); db(0x00); db(0x4e); db(0xae); + db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x67); db(0xe4); db(0x2c); db(0x40); + db(0x41); db(0xfa); db(0x0d); db(0xe5); db(0x22); db(0x08); db(0x74); db(0x0f); + db(0x41); db(0xfa); db(0x00); db(0x22); db(0x26); db(0x08); db(0xe4); db(0x8b); + db(0x28); db(0x3c); db(0x00); db(0x00); db(0x1f); db(0x40); db(0x4e); db(0xae); + db(0xff); db(0x76); db(0x22); db(0x4e); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x4e); db(0xae); db(0xfe); db(0x62); db(0x60); db(0xbc); db(0x00); db(0x00); + db(0x00); db(0x00); db(0x00); db(0x10); db(0x00); db(0x00); db(0x00); db(0x00); + db(0x72); db(0x02); db(0x30); db(0x3c); db(0xff); db(0x48); db(0x61); db(0x00); + db(0x0a); db(0x28); db(0x4e); db(0x90); db(0x22); db(0x00); db(0x6b); db(0x04); + db(0x61); db(0x00); db(0x07); db(0x84); db(0x70); db(0x00); db(0x4e); db(0x75); + db(0x48); db(0xe7); db(0x00); db(0x20); db(0x30); db(0x3c); db(0xff); db(0x50); + db(0x61); db(0x00); db(0x0a); db(0x0e); db(0x70); db(0x00); db(0x4e); db(0x90); + db(0x4a); db(0x80); db(0x67); db(0x00); db(0x00); db(0xa2); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); + db(0x09); db(0xf8); db(0x70); db(0x02); db(0x4e); db(0x90); db(0x0c); db(0x40); + db(0x00); db(0x01); db(0x6d); db(0x00); db(0x00); db(0x7c); db(0x6e); db(0x06); + db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0xe4); db(0x0c); db(0x40); + db(0x00); db(0x02); db(0x6e); db(0x08); db(0x20); db(0x01); db(0x4e); db(0xae); + db(0xfe); db(0xbc); db(0x60); db(0xd6); db(0x0c); db(0x40); db(0x00); db(0x03); + db(0x6e); db(0x06); db(0x4e); db(0xae); db(0xfe); db(0x86); db(0x60); db(0xca); + db(0x0c); db(0x40); db(0x00); db(0x04); db(0x6e); db(0x06); db(0x4e); db(0xae); + db(0xff); db(0x4c); db(0x60); db(0xbe); db(0x0c); db(0x40); db(0x00); db(0x05); + db(0x6e); db(0x46); db(0x48); db(0xe7); db(0x00); db(0xc0); db(0x70); db(0x26); + db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); + db(0xff); db(0x3a); db(0x4c); db(0xdf); db(0x03); db(0x00); db(0x24); db(0x40); + db(0x15); db(0x7c); db(0x00); db(0x08); db(0x00); db(0x08); db(0x25); db(0x48); + db(0x00); db(0x0e); db(0x35); db(0x7c); db(0x00); db(0x26); db(0x00); db(0x12); + db(0x25); db(0x7c); db(0x40); db(0x00); db(0x00); db(0x00); db(0x00); db(0x14); + db(0x35); db(0x7c); db(0x12); db(0x34); db(0x00); db(0x18); db(0x25); db(0x49); + db(0x00); db(0x1a); db(0x20); db(0x69); db(0x00); db(0x10); db(0x22); db(0x4a); + db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x00); db(0xff); db(0x74); + db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); db(0x09); db(0x6a); + db(0x70); db(0x04); db(0x4e); db(0x90); db(0x70); db(0x01); db(0x4c); db(0xdf); + db(0x04); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0xc0); db(0xc0); + db(0x70); db(0x1a); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x22); db(0x40); db(0x41); db(0xfa); + db(0x0c); db(0xad); db(0x23); db(0x48); db(0x00); db(0x0a); db(0x41); db(0xfa); + db(0xff); db(0x28); db(0x23); db(0x48); db(0x00); db(0x0e); db(0x41); db(0xfa); + db(0xff); db(0x20); db(0x23); db(0x48); db(0x00); db(0x12); db(0x33); db(0x7c); + db(0x02); db(0x14); db(0x00); db(0x08); db(0x70); db(0x03); db(0x4e); db(0xae); + db(0xff); db(0x58); db(0x4c); db(0xdf); db(0x03); db(0x03); db(0x4e); db(0x75); + db(0x48); db(0xe7); db(0xc0); db(0xf2); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x24); db(0x48); db(0x26); db(0x49); db(0x20); db(0x3c); db(0x00); db(0x00); + db(0x00); db(0xbe); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x20); db(0x40); db(0x70); db(0x00); + db(0x43); db(0xeb); db(0x01); db(0xa0); db(0x11); db(0xb1); db(0x00); db(0x00); + db(0x00); db(0x0e); db(0x52); db(0x40); db(0x0c); db(0x40); db(0x00); db(0x8c); + db(0x66); db(0xf2); db(0x20); db(0x0a); db(0xe4); db(0x88); db(0x21); db(0x40); + db(0x00); db(0x36); db(0x22); db(0x48); db(0x41); db(0xfa); db(0x0c); db(0x47); + db(0x23); db(0x48); db(0x00); db(0x0a); db(0x20); db(0x6b); db(0x01); db(0x98); + db(0x41); db(0xe8); db(0x00); db(0x12); db(0x4e); db(0xae); db(0xff); db(0x10); + db(0x4c); db(0xdf); db(0x4f); db(0x03); db(0x4e); db(0x75); db(0x48); db(0xe7); + db(0x7f); db(0x7e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x24); db(0x48); + db(0x0c); db(0x9a); db(0x00); db(0x00); db(0x03); db(0xf3); db(0x66); db(0x00); + db(0x00); db(0xe4); db(0x50); db(0x8a); db(0x2e); db(0x2a); db(0x00); db(0x04); + db(0x9e); db(0x92); db(0x50); db(0x8a); db(0x52); db(0x87); db(0x26); db(0x4a); + db(0x20); db(0x07); db(0xd0); db(0x80); db(0xd0); db(0x80); db(0xd7); db(0xc0); + db(0x28); db(0x4a); db(0x9b); db(0xcd); db(0x7c); db(0x00); db(0x24); db(0x12); + db(0x72); db(0x01); db(0x08); db(0x02); db(0x00); db(0x1e); db(0x67); db(0x04); + db(0x08); db(0xc1); db(0x00); db(0x01); db(0x08); db(0xc1); db(0x00); db(0x10); + db(0xe5); db(0x8a); db(0x20); db(0x02); db(0x66); db(0x04); db(0x42); db(0x9a); + db(0x60); db(0x1e); db(0x50); db(0x80); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x4a); db(0x80); db(0x67); db(0x00); db(0x00); db(0xa0); db(0x20); db(0x40); + db(0x20); db(0xc2); db(0x24); db(0xc8); db(0x22); db(0x0d); db(0x67); db(0x06); + db(0x20); db(0x08); db(0xe4); db(0x88); db(0x2a); db(0x80); db(0x2a); db(0x48); + db(0x52); db(0x86); db(0xbe); db(0x86); db(0x66); db(0xc0); db(0x7c); db(0x00); + db(0x22); db(0x06); db(0xd2); db(0x81); db(0xd2); db(0x81); db(0x20); db(0x74); + db(0x18); db(0x00); db(0x58); db(0x88); db(0x26); db(0x1b); db(0x28); db(0x1b); + db(0xe5); db(0x8c); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xe9); + db(0x67); db(0x08); db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xea); + db(0x66); db(0x0c); db(0x20); db(0x04); db(0x4a); db(0x80); db(0x67); db(0x0e); + db(0x10); db(0xdb); db(0x53); db(0x80); db(0x60); db(0xf6); db(0x0c); db(0x83); + db(0x00); db(0x00); db(0x03); db(0xeb); db(0x66); db(0x4e); db(0x26); db(0x1b); + db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xec); db(0x66); db(0x28); + db(0x22); db(0x06); db(0xd2); db(0x81); db(0xd2); db(0x81); db(0x20); db(0x74); + db(0x18); db(0x00); db(0x58); db(0x88); db(0x20); db(0x1b); db(0x67); db(0xe6); + db(0x22); db(0x1b); db(0xd2); db(0x81); db(0xd2); db(0x81); db(0x26); db(0x34); + db(0x18); db(0x00); db(0x58); db(0x83); db(0x24); db(0x1b); db(0xd7); db(0xb0); + db(0x28); db(0x00); db(0x53); db(0x80); db(0x66); db(0xf6); db(0x60); db(0xe4); + db(0x0c); db(0x83); db(0x00); db(0x00); db(0x03); db(0xf2); db(0x66); db(0x14); + db(0x52); db(0x86); db(0xbe); db(0x86); db(0x66); db(0x00); db(0xff); db(0x8a); + db(0x7e); db(0x01); db(0x20); db(0x54); db(0x20); db(0x07); db(0x4c); db(0xdf); + db(0x7e); db(0xfe); db(0x4e); db(0x75); db(0x7e); db(0x00); db(0x60); db(0xf4); + db(0x48); db(0xe7); db(0x40); db(0xe2); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x41); db(0xee); db(0x01); db(0x50); db(0x20); db(0x50); db(0x4a); db(0x90); + db(0x67); db(0x1a); db(0x22); db(0x68); db(0x00); db(0x0a); db(0x45); db(0xfa); + db(0x0b); db(0x88); db(0x10); db(0x19); db(0x12); db(0x1a); db(0xb0); db(0x01); + db(0x66); db(0x06); db(0x4a); db(0x00); db(0x67); db(0x42); db(0x60); db(0xf2); + db(0x20); db(0x50); db(0x60); db(0xe2); db(0x70); db(0x20); db(0x22); db(0x3c); + db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x24); db(0x40); db(0x15); db(0x7c); db(0x00); db(0x08); db(0x00); db(0x08); + db(0x41); db(0xfa); db(0x0b); db(0x5e); db(0x25); db(0x48); db(0x00); db(0x0a); + db(0x41); db(0xfa); db(0x0a); db(0xeb); db(0x25); db(0x48); db(0x00); db(0x0e); + db(0x41); db(0xea); db(0x00); db(0x12); db(0x20); db(0x88); db(0x58); db(0x90); + db(0x21); db(0x48); db(0x00); db(0x08); db(0x41); db(0xee); db(0x01); db(0x50); + db(0x22); db(0x4a); db(0x4e); db(0xae); db(0xff); db(0x0a); db(0x20); db(0x4a); + db(0x20); db(0x08); db(0x4c); db(0xdf); db(0x47); db(0x02); db(0x4e); db(0x75); + db(0x48); db(0xe7); db(0x01); db(0x02); db(0x2e); db(0x00); db(0x4a); db(0x2b); + db(0x00); db(0x4c); db(0x67); db(0x7c); db(0x2c); db(0x6b); db(0x00); db(0xa0); + db(0x0c); db(0x6e); db(0x00); db(0x25); db(0x00); db(0x14); db(0x65); db(0x3e); + db(0x72); db(0x0e); db(0x4e); db(0xae); db(0xfd); db(0x66); db(0x02); db(0x80); + db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x62); db(0x08); db(0x07); + db(0x00); db(0x00); db(0x67); db(0x0a); db(0x41); db(0xeb); db(0x00); db(0x20); + db(0x22); db(0x08); db(0x4e); db(0xae); db(0xfd); db(0x5a); db(0x08); db(0x07); + db(0x00); db(0x01); db(0x67); db(0x12); db(0x4a); db(0x2b); db(0x00); db(0x9e); + db(0x66); db(0x0c); db(0x50); db(0xeb); db(0x00); db(0x9e); db(0x22); db(0x2b); + db(0x00); db(0xb4); db(0x4e); db(0xae); db(0xfd); db(0x5a); db(0x72); db(0x0e); + db(0x4e); db(0xae); db(0xfd); db(0x6c); db(0x60); db(0x32); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x7c); db(0x08); db(0x07); + db(0x00); db(0x00); db(0x67); db(0x08); db(0x41); db(0xeb); db(0x00); db(0x20); + db(0x61); db(0x00); db(0x00); db(0xac); db(0x08); db(0x07); db(0x00); db(0x01); + db(0x67); db(0x12); db(0x4a); db(0x2b); db(0x00); db(0x9e); db(0x66); db(0x0c); + db(0x50); db(0xeb); db(0x00); db(0x9e); db(0x20); db(0x6b); db(0x00); db(0xb4); + db(0x61); db(0x00); db(0x00); db(0x94); db(0x4e); db(0xae); db(0xff); db(0x76); + db(0x4c); db(0xdf); db(0x40); db(0x80); db(0x4e); db(0x75); db(0x48); db(0xe7); + db(0x01); db(0x22); db(0x2e); db(0x00); db(0x2c); db(0x6b); db(0x00); db(0xa0); + db(0x0c); db(0x6e); db(0x00); db(0x25); db(0x00); db(0x14); db(0x65); db(0x3e); + db(0x72); db(0x0e); db(0x4e); db(0xae); db(0xfd); db(0x66); db(0x02); db(0x80); + db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x62); db(0x08); db(0x07); + db(0x00); db(0x00); db(0x67); db(0x0a); db(0x41); db(0xeb); db(0x00); db(0x20); + db(0x22); db(0x08); db(0x4e); db(0xae); db(0xfd); db(0x60); db(0x08); db(0x07); + db(0x00); db(0x01); db(0x67); db(0x12); db(0x4a); db(0x2b); db(0x00); db(0x9e); + db(0x67); db(0x0c); db(0x42); db(0x2b); db(0x00); db(0x9e); db(0x22); db(0x2b); + db(0x00); db(0xb4); db(0x4e); db(0xae); db(0xfd); db(0x60); db(0x72); db(0x0e); + db(0x4e); db(0xae); db(0xfd); db(0x6c); db(0x60); db(0x32); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x4e); db(0xae); db(0xff); db(0x7c); db(0x08); db(0x07); + db(0x00); db(0x00); db(0x67); db(0x08); db(0x41); db(0xeb); db(0x00); db(0x20); + db(0x61); db(0x00); db(0x00); db(0x44); db(0x08); db(0x07); db(0x00); db(0x01); + db(0x67); db(0x12); db(0x4a); db(0x2b); db(0x00); db(0x9e); db(0x67); db(0x0c); + db(0x42); db(0x2b); db(0x00); db(0x9e); db(0x20); db(0x6b); db(0x00); db(0xb4); + db(0x61); db(0x00); db(0x00); db(0x2c); db(0x4e); db(0xae); db(0xff); db(0x76); + db(0x4c); db(0xdf); db(0x44); db(0x80); db(0x4e); db(0x75); db(0x22); db(0x48); + db(0x20); db(0x6b); db(0x00); db(0xa0); db(0x20); db(0x68); db(0x00); db(0x22); + db(0x20); db(0x68); db(0x00); db(0x18); db(0xd1); db(0xc8); db(0xd1); db(0xc8); + db(0x22); db(0xa8); db(0x00); db(0x04); db(0x20); db(0x09); db(0xe4); db(0x88); + db(0x21); db(0x40); db(0x00); db(0x04); db(0x4e); db(0x75); db(0x24); db(0x48); + db(0x20); db(0x6b); db(0x00); db(0xa0); db(0x20); db(0x68); db(0x00); db(0x22); + db(0x20); db(0x68); db(0x00); db(0x18); db(0xd1); db(0xc8); db(0xd1); db(0xc8); + db(0x22); db(0x68); db(0x00); db(0x04); db(0xd3); db(0xc9); db(0xd3); db(0xc9); + db(0xb3); db(0xca); db(0x66); db(0x06); db(0x21); db(0x52); db(0x00); db(0x04); + db(0x60); db(0x18); db(0x20); db(0x09); db(0x67); db(0x0e); db(0x20); db(0x11); + db(0xd0); db(0x80); db(0xd0); db(0x80); db(0xb5); db(0xc0); db(0x67); db(0x04); + db(0x22); db(0x40); db(0x60); db(0xee); db(0x20); db(0x09); db(0x67); db(0x02); + db(0x22); db(0x92); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x20); db(0x22); + db(0x74); db(0x16); db(0x9f); db(0xc2); db(0x24); db(0x4f); db(0x32); db(0x02); + db(0x42); db(0x32); db(0x10); db(0xff); db(0x53); db(0x41); db(0x66); db(0xf8); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x72); db(0x0f); db(0x4a); db(0x80); + db(0x67); db(0x02); db(0x72); db(0x10); db(0x15); db(0x41); db(0x00); db(0x04); + db(0x35); db(0x7c); db(0x08); db(0x00); db(0x00); db(0x08); db(0x22); db(0x6b); + db(0x00); db(0xa4); db(0x33); db(0x7c); db(0x00); db(0x0b); db(0x00); db(0x1c); + db(0x23); db(0x7c); db(0x00); db(0x00); db(0x00); db(0x16); db(0x00); db(0x24); + db(0x23); db(0x4a); db(0x00); db(0x28); db(0x13); db(0x7c); db(0x00); db(0x01); + db(0x00); db(0x1e); db(0x22); db(0x6b); db(0x00); db(0xa8); db(0x33); db(0x7c); + db(0x00); db(0x0a); db(0x00); db(0x1c); db(0x13); db(0x7c); db(0x00); db(0x01); + db(0x00); db(0x1e); db(0x4e); db(0xae); db(0xfe); db(0x38); db(0x22); db(0x6b); + db(0x00); db(0xa8); db(0x25); db(0x69); db(0x00); db(0x20); db(0x00); db(0x0e); + db(0x25); db(0x69); db(0x00); db(0x24); db(0x00); db(0x12); db(0x22); db(0x6b); + db(0x00); db(0xa4); db(0x4e); db(0xae); db(0xfe); db(0x38); db(0xdf); db(0xc2); + db(0x4c); db(0xdf); db(0x44); db(0x04); db(0x4e); db(0x75); db(0x4a); db(0x00); + db(0x67); db(0x26); db(0x4a); db(0x2b); db(0x00); db(0x4c); db(0x66); db(0x36); + db(0x70); db(0x00); db(0x4a); db(0x33); db(0x00); db(0x4d); db(0x67); db(0x04); + db(0x52); db(0x00); db(0x60); db(0xf6); db(0x17); db(0x40); db(0x00); db(0x4c); + db(0x67); db(0x24); db(0x20); db(0x01); db(0x61); db(0x00); db(0xfd); db(0xf2); + db(0x70); db(0x01); db(0x61); db(0x00); db(0xff); db(0x60); db(0x60); db(0x16); + db(0x4a); db(0x2b); db(0x00); db(0x4c); db(0x67); db(0x10); db(0x42); db(0x2b); + db(0x00); db(0x4c); db(0x20); db(0x01); db(0x61); db(0x00); db(0xfe); db(0x68); + db(0x70); db(0x00); db(0x61); db(0x00); db(0xff); db(0x48); db(0x4e); db(0x75); + db(0x4a); db(0xac); db(0x00); db(0x14); db(0x67); db(0x0a); db(0x70); db(0x00); + db(0x72); db(0x01); db(0x61); db(0x00); db(0xff); db(0xb2); db(0x4e); db(0x75); + db(0x70); db(0x01); db(0x72); db(0x03); db(0x61); db(0x00); db(0xff); db(0xa8); + db(0x4e); db(0x75); db(0x10); db(0x2b); db(0x00); db(0xac); db(0x6b); db(0x0a); + db(0x70); db(0x01); db(0x72); db(0x03); db(0x61); db(0x00); db(0xff); db(0x98); + db(0x4e); db(0x75); db(0x72); db(0x01); db(0x0c); db(0x00); db(0x00); db(0xfe); + db(0x66); db(0x02); db(0x72); db(0x03); db(0x70); db(0x00); db(0x61); db(0x00); + db(0xff); db(0x86); db(0x4e); db(0x75); db(0x20); db(0x6c); db(0x00); db(0x24); + db(0x4a); db(0xa8); db(0x00); db(0x08); db(0x66); db(0x08); db(0x4a); db(0xa8); + db(0x00); db(0x0c); db(0x66); db(0x02); db(0x4e); db(0x75); db(0x48); db(0xe7); + db(0x3f); db(0x3e); db(0x2a); db(0x48); db(0x24); db(0x6c); db(0x00); db(0x18); + db(0x2e); db(0x15); db(0x7a); db(0x00); db(0x4a); db(0x87); db(0x67); db(0x70); + db(0x20); db(0x0a); db(0x67); db(0x6c); db(0x7c); db(0x00); db(0x22); db(0x2d); + db(0x00); db(0x08); db(0x67); db(0x12); db(0x24); db(0x2a); db(0x00); db(0x04); + db(0x2c); db(0x6b); db(0x00); db(0xa0); db(0x4e); db(0xae); db(0xfc); db(0x34); + db(0x4a); db(0x80); db(0x66); db(0x02); db(0x50); db(0xc6); db(0x22); db(0x2d); + db(0x00); db(0x0c); db(0x67); db(0x1c); db(0x20); db(0x41); db(0x22); db(0x4a); + db(0x2f); db(0x0a); db(0x45); db(0xec); db(0x00); db(0x20); db(0x48); db(0x7a); + db(0x00); db(0x08); db(0x2f); db(0x28); db(0x00); db(0x08); db(0x4e); db(0x75); + db(0x24); db(0x5f); db(0x4a); db(0x80); db(0x66); db(0x02); db(0x50); db(0xc6); + db(0x4a); db(0x06); db(0x67); db(0x24); db(0x20); db(0x2a); db(0x00); db(0x04); + db(0x90); db(0x8a); db(0x4a); db(0x92); db(0x66); db(0x0a); db(0x20); db(0x05); + db(0x67); db(0x10); db(0x20); db(0x40); db(0x42); db(0x90); db(0x60); db(0x0a); + db(0x20); db(0x52); db(0x22); db(0x4a); db(0x22); db(0xd8); db(0x59); db(0x80); + db(0x6a); db(0xfa); db(0x53); db(0x95); db(0x53); db(0x87); db(0x60); db(0x94); + db(0x2a); db(0x0a); db(0x24); db(0x52); db(0x53); db(0x87); db(0x60); db(0x8c); + db(0x4c); db(0xdf); db(0x7c); db(0xfc); db(0x4e); db(0x75); db(0x61); db(0x00); + db(0xfc); db(0x88); db(0x21); db(0x40); db(0x01); db(0x98); db(0x2f); db(0x08); + db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x04); db(0x4a); + db(0x2a); db(0x50); db(0x30); db(0x3c); db(0xff); db(0x28); db(0x61); db(0x00); + db(0x04); db(0x40); db(0x22); db(0x48); db(0x20); db(0x5f); db(0x42); db(0xa8); + db(0x01); db(0x90); db(0x42); db(0xa8); db(0x01); db(0x94); db(0x4e); db(0x91); + db(0x26); db(0x00); db(0x0c); db(0x43); db(0xff); db(0xfe); db(0x67); db(0x00); + db(0xf9); db(0xa8); db(0x0c); db(0x43); db(0x00); db(0x01); db(0x66); db(0x0e); + db(0x08); db(0x07); db(0x00); db(0x02); db(0x66); db(0x08); db(0x08); db(0x07); + db(0x00); db(0x01); db(0x66); db(0x00); db(0x00); db(0x02); db(0x20); db(0x28); + db(0x01); db(0x90); db(0x67); db(0x14); db(0x6b); db(0x12); db(0x2f); db(0x08); + db(0x72); db(0x01); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); + db(0xff); db(0x3a); db(0x20); db(0x5f); db(0x21); db(0x40); db(0x01); db(0x94); + db(0x4a); db(0x83); db(0x6a); db(0x0e); db(0x22); db(0x48); db(0x30); db(0x3c); + db(0xff); db(0x20); db(0x61); db(0x00); db(0x03); db(0xec); db(0x4e); db(0x90); + db(0x60); db(0x26); db(0x2c); db(0x4c); db(0x2f); db(0x08); db(0x4e); db(0xae); + db(0xff); db(0x70); db(0x20); db(0x5f); db(0x22); db(0x48); db(0x26); db(0x40); + db(0x30); db(0x3c); db(0xff); db(0x20); db(0x61); db(0x00); db(0x03); db(0xd2); + db(0x4e); db(0x90); db(0x70); db(0x00); db(0x27); db(0x40); db(0x00); db(0x08); + db(0x27); db(0x40); db(0x00); db(0x10); db(0x27); db(0x40); db(0x00); db(0x20); + db(0x4a); db(0xa9); db(0x01); db(0x94); db(0x67); db(0x28); db(0x20); db(0x69); + db(0x01); db(0x94); db(0x61); db(0x00); db(0xfa); db(0xea); db(0x48); db(0xe7); + db(0x80); db(0xc0); db(0x20); db(0x29); db(0x01); db(0x90); db(0x22); db(0x69); + db(0x01); db(0x94); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); + db(0xff); db(0x2e); db(0x4c); db(0xdf); db(0x03); db(0x01); db(0x4a); db(0x80); + db(0x67); db(0x04); db(0x61); db(0x00); db(0xfa); db(0x74); db(0x4a); db(0x83); + db(0x6b); db(0x00); db(0xf9); db(0x0e); db(0x30); db(0x3c); db(0xff); db(0x18); + db(0x61); db(0x00); db(0x03); db(0x86); db(0x4e); db(0x90); db(0x20); db(0x03); + db(0x16); db(0x29); db(0x00); db(0x4f); db(0x4a); db(0x80); db(0x66); db(0x1a); + db(0x27); db(0x7c); db(0x00); db(0x00); db(0x17); db(0x70); db(0x00); db(0x14); + db(0x41); db(0xfa); db(0xf7); db(0xda); db(0x20); db(0x08); db(0xe4); db(0x88); + db(0x27); db(0x40); db(0x00); db(0x20); db(0x70); db(0xff); db(0x27); db(0x40); + db(0x00); db(0x24); db(0x08); db(0x07); db(0x00); db(0x00); db(0x67); db(0x3a); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x70); db(0x14); db(0x72); db(0x00); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x22); db(0x40); db(0x70); db(0x00); + db(0x22); db(0x80); db(0x23); db(0x40); db(0x00); db(0x04); db(0x33); db(0x40); + db(0x00); db(0x0e); db(0x30); db(0x3c); db(0x10); db(0x00); db(0x80); db(0x03); + db(0x33); db(0x40); db(0x00); db(0x08); db(0x23); db(0x6d); db(0x01); db(0x04); + db(0x00); db(0x0a); db(0x23); db(0x4b); db(0x00); db(0x10); db(0x41); db(0xec); + db(0x00); db(0x4a); db(0x4e); db(0xae); db(0xfe); db(0xf2); db(0x70); db(0x00); + db(0x4e); db(0x75); db(0x24); db(0x49); db(0x20); db(0x4b); db(0x72); db(0x00); + db(0x22); db(0x41); db(0x08); db(0x07); db(0x00); db(0x01); db(0x67); db(0x08); + db(0x08); db(0x07); db(0x00); db(0x02); db(0x67); db(0x02); db(0x72); db(0x01); + db(0x70); db(0xec); db(0x2c); db(0x4c); db(0x4e); db(0xae); db(0xff); db(0x6a); + db(0x08); db(0x07); db(0x00); db(0x01); db(0x67); db(0x5c); db(0x08); db(0x07); + db(0x00); db(0x02); db(0x66); db(0x56); db(0x20); db(0x52); db(0x74); db(0x02); + db(0x52); db(0x82); db(0x4a); db(0x30); db(0x28); db(0xfd); db(0x66); db(0xf8); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x20); db(0x02); db(0x72); db(0x01); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x4a); db(0x80); db(0x67); db(0x3a); + db(0x20); db(0x52); db(0x24); db(0x40); db(0x22); db(0x4a); db(0x12); db(0xd8); + db(0x66); db(0xfc); db(0x13); db(0x7c); db(0x00); db(0x3a); db(0xff); db(0xff); + db(0x42); db(0x11); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x43); db(0xfa); + db(0x06); db(0x60); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); + db(0x2c); db(0x40); db(0x22); db(0x0a); db(0x4e); db(0xae); db(0xff); db(0x52); + db(0x22); db(0x4e); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); + db(0xfe); db(0x62); db(0x22); db(0x4a); db(0x20); db(0x02); db(0x4e); db(0xae); + db(0xff); db(0x2e); db(0x70); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); + db(0x3f); db(0x3e); db(0x2c); db(0x01); db(0x7e); db(0x06); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x43); db(0xfa); db(0x06); db(0x4a); db(0x70); db(0x24); + db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x4a); db(0x80); db(0x66); db(0x0e); + db(0x08); db(0x87); db(0x00); db(0x02); db(0x43); db(0xfa); db(0x06); db(0x38); + db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); db(0x28); db(0x40); + db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); db(0x22); db(0x3c); + db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x20); db(0x40); db(0x4a); db(0x80); db(0x67); db(0x2c); db(0x21); db(0x4c); + db(0x01); db(0x9c); db(0x48); db(0xe7); db(0x00); db(0x8a); db(0x61); db(0x00); + db(0xfd); db(0xf6); db(0x4c); db(0xdf); db(0x51); db(0x00); db(0x0c); db(0x80); + db(0xff); db(0xff); db(0xff); db(0xfe); db(0x67); db(0x08); db(0x48); db(0x46); + db(0x52); db(0x46); db(0x48); db(0x46); db(0x60); db(0xe4); db(0x22); db(0x48); + db(0x20); db(0x3c); db(0x00); db(0x00); db(0x02); db(0x2c); db(0x4e); db(0xae); + db(0xff); db(0x2e); db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0x62); + db(0x4c); db(0xdf); db(0x7c); db(0xfc); db(0x4e); db(0x75); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfe); db(0xda); + db(0x20); db(0x40); db(0x4b); db(0xe8); db(0x00); db(0x5c); db(0x43); db(0xfa); + db(0x05); db(0xb0); db(0x70); db(0x00); db(0x4e); db(0xae); db(0xfd); db(0xd8); + db(0x24); db(0x40); db(0x20); db(0x3c); db(0x00); db(0x00); db(0x00); db(0xb9); + db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); + db(0xff); db(0x3a); db(0x26); db(0x40); db(0x7c); db(0x00); db(0x26); db(0x86); + db(0x27); db(0x46); db(0x00); db(0x04); db(0x27); db(0x46); db(0x00); db(0x08); + db(0x27); db(0x4a); db(0x00); db(0xa0); db(0x50); db(0xeb); db(0x00); db(0x9e); + db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x27); db(0x40); + db(0x00); db(0xb0); db(0x61); db(0x00); db(0x02); db(0xb4); db(0x27); db(0x40); + db(0x00); db(0xa4); db(0x61); db(0x00); db(0x02); db(0xe0); db(0x27); db(0x40); + db(0x00); db(0xa8); db(0x7a); db(0x00); db(0x20); db(0x4d); db(0x4e); db(0xae); + db(0xfe); db(0x80); db(0x20); db(0x4d); db(0x4e); db(0xae); db(0xfe); db(0x8c); + db(0x28); db(0x40); db(0x26); db(0x2c); db(0x00); db(0x0a); db(0x30); db(0x3c); + db(0xff); db(0x40); db(0x61); db(0x00); db(0x01); db(0xac); db(0x70); db(0x00); + db(0x4e); db(0x90); db(0x24); db(0x00); db(0x70); db(0x01); db(0x61); db(0x00); + db(0xfa); db(0x40); db(0x08); db(0x02); db(0x00); db(0x01); db(0x67); db(0x06); + db(0x70); db(0x01); db(0x61); db(0x00); db(0xfb); db(0xa8); db(0x61); db(0x00); + db(0x03); db(0x3c); db(0x60); db(0x00); db(0x00); db(0xfc); db(0x61); db(0x00); + db(0x03); db(0x34); db(0x20); db(0x4d); db(0x4e); db(0xae); db(0xfe); db(0x8c); + db(0x28); db(0x40); db(0x4a); db(0x80); db(0x66); db(0x10); db(0x70); db(0x00); + db(0x12); db(0x2d); db(0x00); db(0x0f); db(0x03); db(0xc0); db(0x08); db(0xc0); + db(0x00); db(0x11); db(0x4e); db(0xae); db(0xfe); db(0xc2); db(0x4a); db(0x2b); + db(0x00); db(0xac); db(0x67); db(0x08); db(0x61); db(0x00); db(0xfc); db(0x4c); + db(0x42); db(0x2b); db(0x00); db(0xac); db(0x20); db(0x0c); db(0x67); db(0xce); + db(0x0c); db(0x6c); db(0x00); db(0x26); db(0x00); db(0x12); db(0x66); db(0x4c); + db(0x0c); db(0xac); db(0x40); db(0x00); db(0x00); db(0x00); db(0x00); db(0x14); + db(0x66); db(0x42); db(0x0c); db(0x6c); db(0x12); db(0x34); db(0x00); db(0x18); + db(0x66); db(0x3a); db(0x20); db(0x6c); db(0x00); db(0x1a); db(0x20); db(0x28); + db(0x00); db(0x0c); db(0x02); db(0x80); db(0x80); db(0x00); db(0x00); db(0x08); + db(0x0c); db(0x80); db(0x80); db(0x00); db(0x00); db(0x08); db(0x66); db(0x18); + db(0x02); db(0xa8); db(0x7f); db(0xff); db(0xff); db(0xff); db(0x00); db(0x0c); + db(0x20); db(0x68); db(0x00); db(0x10); db(0x22); db(0x4c); db(0x12); db(0xbc); + db(0x00); db(0x08); db(0x4e); db(0xae); db(0xfe); db(0x92); db(0x60); db(0x86); + db(0x22); db(0x4c); db(0x70); db(0x26); db(0x4e); db(0xae); db(0xff); db(0x2e); + db(0x60); db(0x00); db(0xff); db(0x7c); db(0x26); db(0x2c); db(0x00); db(0x0a); + db(0x66); db(0x3e); db(0x30); db(0x3c); db(0xff); db(0x50); db(0x61); db(0x00); + db(0x00); db(0xf8); db(0x70); db(0x01); db(0x4e); db(0x90); db(0x45); db(0xeb); + db(0x00); db(0x04); db(0x20); db(0x52); db(0x20); db(0x08); db(0x67); db(0x00); + db(0xff); db(0x5e); db(0x22); db(0x50); db(0x20); db(0x40); db(0x20); db(0x28); + db(0x00); db(0x04); db(0x6a); db(0x16); db(0x48); db(0xe7); db(0x00); db(0xc0); + db(0x28); db(0x68); db(0x00); db(0x0a); db(0x61); db(0x4a); db(0x53); db(0x85); + db(0x4c); db(0xdf); db(0x03); db(0x00); db(0x24); db(0x89); db(0x20); db(0x49); + db(0x60); db(0xda); db(0x24); db(0x48); db(0x20); db(0x49); db(0x60); db(0xd4); + db(0x0c); db(0x85); db(0x00); db(0x00); db(0x00); db(0x14); db(0x65); db(0x00); + db(0x00); db(0x0a); db(0x70); db(0x01); db(0x29); db(0x40); db(0x00); db(0x04); + db(0x60); db(0x12); db(0x61); db(0x4e); db(0x30); db(0x3c); db(0xff); db(0x30); + db(0x61); db(0x00); db(0x00); db(0xa6); db(0x4e); db(0x90); db(0x4a); db(0x80); + db(0x67); db(0x0e); db(0x52); db(0x85); db(0x28); db(0xab); db(0x00); db(0x04); + db(0x27); db(0x4c); db(0x00); db(0x04); db(0x60); db(0x00); db(0xff); db(0x08); + db(0x28); db(0x43); db(0x61); db(0x04); db(0x60); db(0x00); db(0xff); db(0x00); + db(0x0c); db(0xac); db(0x00); db(0x00); db(0x00); db(0x1f); db(0x00); db(0x08); + db(0x66); db(0x04); db(0x61); db(0x00); db(0xfb); db(0x4c); db(0x0c); db(0xac); + db(0x00); db(0x00); db(0x04); db(0x09); db(0x00); db(0x08); db(0x66); db(0x04); + db(0x61); db(0x00); db(0xfb); db(0x7a); db(0x22); db(0x54); db(0x20); db(0x6c); + db(0x00); db(0x04); db(0x29); db(0x4d); db(0x00); db(0x04); db(0x4e); db(0xee); + db(0xfe); db(0x92); db(0x2f); db(0x05); db(0x7a); db(0xfc); db(0x24); db(0x53); + db(0x2e); db(0x0a); db(0x22); db(0x0a); db(0x67); db(0x00); db(0x00); db(0x0c); + db(0x52); db(0x85); db(0x67); db(0x1e); db(0x22); db(0x4a); db(0x24); db(0x52); + db(0x60); db(0xf0); db(0x52); db(0x85); db(0x67); db(0x3c); db(0x24); db(0x47); + db(0x70); db(0x18); db(0x72); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x52); db(0x46); db(0x24); db(0x40); db(0x24); db(0x87); db(0x2e); db(0x0a); + db(0x60); db(0xe8); db(0x20); db(0x12); db(0x67); db(0x24); db(0x20); db(0x40); + db(0x20); db(0x10); db(0x67); db(0x1e); db(0x20); db(0x40); db(0x20); db(0x10); + db(0x67); db(0x18); db(0x70); db(0x00); db(0x22); db(0x80); db(0x22); db(0x4a); + db(0x24); db(0x51); db(0x70); db(0x18); db(0x4e); db(0xae); db(0xff); db(0x2e); + db(0x06); db(0x86); db(0x00); db(0x01); db(0x00); db(0x00); db(0x20); db(0x0a); + db(0x66); db(0xec); db(0x26); db(0x87); db(0x2a); db(0x1f); db(0x4e); db(0x75); + db(0x41); db(0xfa); db(0xf4); db(0x62); db(0x02); db(0x80); db(0x00); db(0x00); + db(0xff); db(0xff); db(0xd1); db(0xc0); db(0x4e); db(0x75); db(0x00); db(0x00); + db(0x0c); db(0xaf); db(0x00); db(0x00); db(0x00); db(0x22); db(0x00); db(0x08); + db(0x66); db(0x30); db(0x48); db(0xe7); db(0xc0); db(0xe2); db(0x2c); db(0x78); + db(0x00); db(0x04); db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfe); db(0xda); + db(0x24); db(0x40); db(0x22); db(0x4a); db(0x70); db(0xec); db(0x4e); db(0xae); + db(0xfe); db(0xd4); db(0x41); db(0xfa); db(0xff); db(0xda); db(0x32); db(0x10); + db(0xb2); db(0x50); db(0x67); db(0xfc); db(0x22); db(0x4a); db(0x4e); db(0xae); + db(0xfe); db(0xd4); db(0x72); db(0x01); db(0x4c); db(0xdf); db(0x47); db(0x03); + db(0x58); db(0x8f); db(0x4e); db(0x75); db(0x20); db(0x88); db(0x58); db(0x90); + db(0x42); db(0xa8); db(0x00); db(0x04); db(0x21); db(0x48); db(0x00); db(0x08); + db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x20); db(0x22); db(0x2c); db(0x79); + db(0x00); db(0x00); db(0x00); db(0x04); db(0x70); db(0xff); db(0x4e); db(0xae); + db(0xfe); db(0xb6); db(0x91); db(0xc8); db(0x24); db(0x00); db(0x6b); db(0x32); + db(0x70); db(0x22); db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); + db(0x4e); db(0xae); db(0xff); db(0x3a); db(0x91); db(0xc8); db(0x24); db(0x40); + db(0x4a); db(0x80); db(0x67); db(0x1e); db(0x15); db(0x7c); db(0x00); db(0x04); + db(0x00); db(0x08); db(0x15); db(0x42); db(0x00); db(0x0f); db(0x93); db(0xc9); + db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x25); db(0x40); db(0x00); db(0x10); + db(0x41); db(0xea); db(0x00); db(0x14); db(0x61); db(0x00); db(0xff); db(0xae); + db(0x20); db(0x4a); db(0x20); db(0x08); db(0x4c); db(0xdf); db(0x44); db(0x04); + db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x20); db(0x22); db(0x2c); db(0x79); + db(0x00); db(0x00); db(0x00); db(0x04); db(0x4a); db(0x80); db(0x67); db(0x20); + db(0x24); db(0x40); db(0x74); db(0x30); db(0x20); db(0x02); db(0x22); db(0x3c); + db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x20); db(0x40); db(0x11); db(0x7c); db(0x00); db(0x0a); db(0x00); db(0x08); + db(0x21); db(0x42); db(0x00); db(0x12); db(0x21); db(0x4a); db(0x00); db(0x0e); + db(0x4a); db(0x80); db(0x4c); db(0xdf); db(0x44); db(0x04); db(0x4e); db(0x75); + db(0x48); db(0xe7); db(0x00); db(0x22); db(0x2c); db(0x78); db(0x00); db(0x04); + db(0x61); db(0x00); db(0xff); db(0x70); db(0x61); db(0x00); db(0xff); db(0xbc); + db(0x67); db(0x1a); db(0x22); db(0x40); db(0x24); db(0x40); db(0x41); db(0xfa); + db(0x02); db(0x44); db(0x70); db(0x00); db(0x72); db(0x00); db(0x4e); db(0xae); + db(0xfe); db(0x44); db(0x22); db(0x00); db(0x70); db(0x00); db(0x4a); db(0x81); + db(0x66); db(0x02); db(0x20); db(0x0a); db(0x4a); db(0x80); db(0x4c); db(0xdf); + db(0x44); db(0x00); db(0x4e); db(0x75); db(0x48); db(0xe7); db(0x00); db(0x22); + db(0x2c); db(0x78); db(0x00); db(0x04); db(0x61); db(0x00); db(0xff); db(0x3c); + db(0x61); db(0x00); db(0xff); db(0x88); db(0x67); db(0x1a); db(0x24); db(0x40); + db(0x22); db(0x40); db(0x41); db(0xfa); db(0x02); db(0x1d); db(0x70); db(0x00); + db(0x72); db(0x00); db(0x4e); db(0xae); db(0xfe); db(0x44); db(0x22); db(0x00); + db(0x70); db(0x00); db(0x4a); db(0x81); db(0x66); db(0x02); db(0x20); db(0x0a); + db(0x4a); db(0x80); db(0x4c); db(0xdf); db(0x44); db(0x00); db(0x4e); db(0x75); + db(0x48); db(0xe7); db(0x38); db(0x32); db(0x2c); db(0x79); db(0x00); db(0x00); + db(0x00); db(0x04); db(0x28); db(0x00); db(0x24); db(0x08); db(0x26); db(0x09); + db(0x20); db(0x3c); db(0x00); db(0x00); db(0x08); db(0x5c); db(0x22); db(0x3c); + db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); db(0xff); db(0x3a); + db(0x4a); db(0x80); db(0x67); db(0x00); db(0x00); db(0x34); db(0x24); db(0x40); + db(0x15); db(0x7c); db(0x00); db(0x01); db(0x00); db(0x08); db(0x15); db(0x44); + db(0x00); db(0x09); db(0x25); db(0x42); db(0x00); db(0x0a); db(0x47); db(0xea); + db(0x00); db(0x5c); db(0x25); db(0x4b); db(0x00); db(0x3a); db(0x47); db(0xeb); + db(0x08); db(0x00); db(0x25); db(0x4b); db(0x00); db(0x3e); db(0x25); db(0x4b); + db(0x00); db(0x36); db(0x22); db(0x4a); db(0x24); db(0x43); db(0x97); db(0xcb); + db(0x24); db(0x09); db(0x4e); db(0xae); db(0xfe); db(0xe6); db(0x20); db(0x02); + db(0x4c); db(0xdf); db(0x4c); db(0x1c); db(0x4e); db(0x75); db(0x00); db(0x00); + db(0x00); db(0x00); db(0x00); db(0x00); db(0x2f); db(0x08); db(0x4a); db(0x2b); + db(0x00); db(0x9d); db(0x66); db(0x26); db(0x41); db(0xfa); db(0xff); db(0xf0); + db(0x0c); db(0x10); db(0x00); db(0x01); db(0x66); db(0x1c); db(0x41); db(0xfa); + db(0x01); db(0x96); db(0x43); db(0xfa); db(0x00); db(0x1a); db(0x70); db(0x05); + db(0x61); db(0x00); db(0xff); db(0x7e); db(0x50); db(0xeb); db(0x00); db(0x9d); + db(0x30); db(0x3c); db(0xff); db(0x38); db(0x61); db(0x00); db(0xfe); db(0x2a); + db(0x4e); db(0x90); db(0x20); db(0x5f); db(0x4e); db(0x75); db(0x2c); db(0x79); + db(0x00); db(0x00); db(0x00); db(0x04); db(0x70); db(0xff); db(0x4e); db(0xae); + db(0xfe); db(0xb6); db(0x74); db(0x00); db(0x01); db(0xc2); db(0x93); db(0xc9); + db(0x4e); db(0xae); db(0xfe); db(0xda); db(0x28); db(0x40); db(0x70); db(0x14); + db(0x22); db(0x4c); db(0x4e); db(0xae); db(0xfe); db(0xd4); db(0x70); db(0x00); + db(0x43); db(0xfa); db(0x01); db(0xaa); db(0x4e); db(0xae); db(0xfd); db(0xd8); + db(0x2e); db(0x00); db(0x70); db(0x00); db(0x30); db(0x3c); db(0x00); db(0x44); + db(0x22); db(0x3c); db(0x00); db(0x01); db(0x00); db(0x01); db(0x4e); db(0xae); + db(0xff); db(0x3a); db(0x2a); db(0x40); db(0x61); db(0x00); db(0xfe); db(0xc2); + db(0x2b); db(0x40); db(0x00); db(0x3c); db(0x67); db(0x00); db(0x00); db(0x4e); + db(0x61); db(0x00); db(0xfe); db(0xea); db(0x2b); db(0x40); db(0x00); db(0x40); + db(0x67); db(0x00); db(0x00); db(0x42); db(0x47); db(0xed); db(0x00); db(0x16); + db(0x27); db(0x4c); db(0x00); db(0x0c); db(0x27); db(0x42); db(0x00); db(0x08); + db(0x70); db(0xff); db(0x26); db(0x80); db(0x27); db(0x40); db(0x00); db(0x04); + db(0x43); db(0xed); db(0x00); db(0x00); db(0x13); db(0x7c); db(0x00); db(0x02); + db(0x00); db(0x08); db(0x13); db(0x7c); db(0x00); db(0x05); db(0x00); db(0x09); + db(0x41); db(0xfa); db(0x00); db(0xfc); db(0x23); db(0x48); db(0x00); db(0x0a); + db(0x41); db(0xfa); db(0x00); db(0xa0); db(0x23); db(0x48); db(0x00); db(0x12); + db(0x23); db(0x4b); db(0x00); db(0x0e); db(0x70); db(0x05); db(0x4e); db(0xae); + db(0xff); db(0x58); db(0x60); db(0x02); db(0x4e); db(0x75); db(0x20); db(0x02); + db(0x4e); db(0xae); db(0xfe); db(0xc2); db(0x22); db(0x6d); db(0x00); db(0x3c); + db(0x45); db(0xed); db(0x00); db(0x26); db(0x33); db(0x7c); db(0x00); db(0x0b); + db(0x00); db(0x1c); db(0x23); db(0x7c); db(0x00); db(0x00); db(0x00); db(0x16); + db(0x00); db(0x24); db(0x23); db(0x4a); db(0x00); db(0x28); db(0x13); db(0x7c); + db(0x00); db(0x01); db(0x00); db(0x1e); db(0x15); db(0x7c); db(0x00); db(0x04); + db(0x00); db(0x04); db(0x42); db(0x2a); db(0x00); db(0x05); db(0x42); db(0x6a); + db(0x00); db(0x06); db(0x42); db(0x6a); db(0x00); db(0x08); db(0x20); db(0x47); + db(0x20); db(0x2d); db(0x00); db(0x16); db(0x32); db(0x28); db(0x00); db(0x30); + db(0xd2); db(0x41); db(0x90); db(0x41); db(0x35); db(0x40); db(0x00); db(0x0a); + db(0x20); db(0x2d); db(0x00); db(0x1a); db(0x32); db(0x28); db(0x00); db(0x2e); + db(0xd2); db(0x41); db(0x90); db(0x41); db(0x48); db(0xc0); db(0x35); db(0x40); + db(0x00); db(0x0c); db(0x22); db(0x6d); db(0x00); db(0x40); db(0x33); db(0x7c); + db(0x00); db(0x0a); db(0x00); db(0x1c); db(0x13); db(0x7c); db(0x00); db(0x01); + db(0x00); db(0x1e); db(0x4e); db(0xae); db(0xfe); db(0x38); db(0x22); db(0x6d); + db(0x00); db(0x40); db(0x25); db(0x69); db(0x00); db(0x20); db(0x00); db(0x0e); + db(0x25); db(0x69); db(0x00); db(0x24); db(0x00); db(0x12); db(0x22); db(0x6d); + db(0x00); db(0x3c); db(0x4e); db(0xae); db(0xfe); db(0x38); db(0x60); db(0x00); + db(0xff); db(0x76); db(0x30); db(0x3a); db(0xfe); db(0xa4); db(0x48); db(0xc0); + db(0x32); db(0x3a); db(0xfe); db(0xa0); db(0x48); db(0xc1); db(0xb0); db(0x91); + db(0x66); db(0x00); db(0x00); db(0x0a); db(0xb2); db(0xa9); db(0x00); db(0x04); + db(0x67); db(0x00); db(0x00); db(0x18); db(0x23); db(0x41); db(0x00); db(0x04); + db(0x22); db(0x80); db(0x20); db(0x29); db(0x00); db(0x08); db(0x22); db(0x69); + db(0x00); db(0x0c); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x4e); db(0xae); + db(0xfe); db(0xbc); db(0x41); db(0xf9); db(0x00); db(0xdf); db(0xf0); db(0x00); + db(0x70); db(0x00); db(0x4e); db(0x75); db(0x69); db(0x6e); db(0x70); db(0x75); + db(0x74); db(0x2e); db(0x64); db(0x65); db(0x76); db(0x69); db(0x63); db(0x65); + db(0x00); db(0x74); db(0x69); db(0x6d); db(0x65); db(0x72); db(0x2e); db(0x64); + db(0x65); db(0x76); db(0x69); db(0x63); db(0x65); db(0x00); db(0x55); db(0x41); + db(0x45); db(0x20); db(0x6d); db(0x6f); db(0x75); db(0x73); db(0x65); db(0x20); + db(0x68); db(0x61); db(0x63); db(0x6b); db(0x00); db(0x55); db(0x41); db(0x45); + db(0x20); db(0x66); db(0x69); db(0x6c); db(0x65); db(0x73); db(0x79); db(0x73); + db(0x74); db(0x65); db(0x6d); db(0x00); db(0x55); db(0x41); db(0x45); db(0x20); + db(0x66); db(0x73); db(0x20); db(0x61); db(0x75); db(0x74); db(0x6f); db(0x6d); + db(0x6f); db(0x75); db(0x6e); db(0x74); db(0x65); db(0x72); db(0x00); db(0x55); + db(0x41); db(0x45); db(0x20); db(0x66); db(0x73); db(0x20); db(0x61); db(0x75); + db(0x74); db(0x6f); db(0x6d); db(0x6f); db(0x75); db(0x6e); db(0x74); db(0x20); + db(0x70); db(0x72); db(0x6f); db(0x63); db(0x65); db(0x73); db(0x73); db(0x00); + db(0x64); db(0x6f); db(0x73); db(0x2e); db(0x6c); db(0x69); db(0x62); db(0x72); + db(0x61); db(0x72); db(0x79); db(0x00); db(0x69); db(0x6e); db(0x74); db(0x75); + db(0x69); db(0x74); db(0x69); db(0x6f); db(0x6e); db(0x2e); db(0x6c); db(0x69); + db(0x62); db(0x72); db(0x61); db(0x72); db(0x79); db(0x00); db(0x65); db(0x78); + db(0x70); db(0x61); db(0x6e); db(0x73); db(0x69); db(0x6f); db(0x6e); db(0x2e); + db(0x6c); db(0x69); db(0x62); db(0x72); db(0x61); db(0x72); db(0x79); db(0x00); + db(0x46); db(0x69); db(0x6c); db(0x65); db(0x53); db(0x79); db(0x73); db(0x74); + db(0x65); db(0x6d); db(0x2e); db(0x72); db(0x65); db(0x73); db(0x6f); db(0x75); + db(0x72); db(0x63); db(0x65); db(0x00); db(0x00); db(0x00); db(0x03); db(0xf2); + diff --git a/uae4all_gp2x_0.7.2a/src/fsdb.cpp b/uae4all_gp2x_0.7.2a/src/fsdb.cpp new file mode 100755 index 0000000..ea8121e --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/fsdb.cpp @@ -0,0 +1,282 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + +/* + * UAE - The Un*x Amiga Emulator + * + * Library of functions to make emulated filesystem as independent as + * possible of the host filesystem's capabilities. + * + * Copyright 1999 Bernd Schmidt + */ + +#include "sysconfig.h" +#include "sysdeps.h" +#include "config.h" + +#include "thread.h" +#include "options.h" +#include "uae.h" +#include "memory-uae.h" +#include "custom.h" +#include "m68k/m68k_intrf.h" +#include "filesys.h" +#include "autoconf.h" +#include "fsusage.h" +//#include "scsidev.h" +#include "fsdb.h" + +/* The on-disk format is as follows: + * Offset 0, 1 byte, valid + * Offset 1, 4 bytes, mode + * Offset 5, 257 bytes, aname + * Offset 263, 257 bytes, nname + * Offset 518, 81 bytes, comment + */ + +char *nname_begin (char *nname) +{ + char *p = strrchr (nname, FSDB_DIR_SEPARATOR); + if (p) + return p + 1; + return nname; +} + +/* Find the name REL in directory DIRNAME. If we find a file that + * has exactly the same name, return REL. If we find a file that + * has the same name when compared case-insensitively, return a + * malloced string that contains the name we found. If no file + * exists that compares equal to REL, return 0. */ +char *fsdb_search_dir (const char *dirname, char *rel) +{ + char *p = 0; + struct dirent *de; + DIR *dir = opendir (dirname); + + /* This really shouldn't happen... */ + if (! dir) + return 0; + + while (p == 0 && (de = readdir (dir)) != 0) { + if (strcmp (de->d_name, rel) == 0) + p = rel; + else if (strcasecmp (de->d_name, rel) == 0) + p = my_strdup (de->d_name); + } + closedir (dir); + return p; +} + +static FILE *get_fsdb (a_inode *dir, const char *mode) +{ + char *n = build_nname (dir->nname, FSDB_FILE); + FILE *f = fopen (n, mode); + free (n); + return f; +} + +static void kill_fsdb (a_inode *dir) +{ + char *n = build_nname (dir->nname, FSDB_FILE); + unlink (n); + free (n); +} + +/* Prune the db file the first time this directory is opened in a session. */ +void fsdb_clean_dir (a_inode *dir) +{ + char buf[1 + 4 + 257 + 257 + 81]; + char *n = build_nname (dir->nname, FSDB_FILE); + FILE *f = fopen (n, "r+b"); + off_t pos1 = 0, pos2 = 0; + + if (f == 0) + return; + for (;; pos2 += sizeof buf) { + if (fread (buf, 1, sizeof buf, f) < sizeof buf) + break; + if (buf[0] == 0) + continue; + if (pos1 != pos2) { + fseek (f, pos1, SEEK_SET); + fwrite (buf, 1, sizeof buf, f); + fseek (f, pos2 + sizeof buf, SEEK_SET); + } + pos1 += sizeof buf; + } + fclose (f); + truncate (n, pos1); + free (n); +} + +static a_inode *aino_from_buf (a_inode *base, char *buf, long off) +{ + uae_u32 mode; + a_inode *aino = (a_inode *) xmalloc (sizeof (a_inode)); + + mode = do_get_mem_long ((uae_u32 *)(buf + 1)); + buf += 5; + aino->aname = my_strdup (buf); + buf += 257; + aino->nname = build_nname (base->nname, buf); + buf += 257; + aino->comment = *buf != '\0' ? my_strdup (buf) : 0; + fsdb_fill_file_attrs (aino); + aino->amigaos_mode = mode; + aino->has_dbentry = 1; + aino->dirty = 0; + aino->db_offset = off; + return aino; +} + +a_inode *fsdb_lookup_aino_aname (a_inode *base, const char *aname) +{ + FILE *f = get_fsdb (base, "rb"); + long off = 0; + + if (f == 0) + return 0; + + for (;;) { + char buf[1 + 4 + 257 + 257 + 81]; + if (fread (buf, 1, sizeof buf, f) < sizeof buf) + break; + if (buf[0] != 0 && same_aname (buf + 5, aname)) { + fclose (f); + return aino_from_buf (base, buf, off); + } + off += sizeof buf; + } + fclose (f); + return 0; +} + +a_inode *fsdb_lookup_aino_nname (a_inode *base, const char *nname) +{ + FILE *f = get_fsdb (base, "rb"); + long off = 0; + + if (f == 0) + return 0; + + for (;;) { + char buf[1 + 4 + 257 + 257 + 81]; + if (fread (buf, 1, sizeof buf, f) < sizeof buf) + break; + if (buf[0] != 0 && strcmp (buf + 5 + 257, nname) == 0) { + fclose (f); + return aino_from_buf (base, buf, off); + } + off += sizeof buf; + } + fclose (f); + return 0; +} + +int fsdb_used_as_nname (a_inode *base, const char *nname) +{ + FILE *f = get_fsdb (base, "rb"); + if (f == 0) + return 0; + for (;;) { + char buf[1 + 4 + 257 + 257 + 81]; + if (fread (buf, 1, sizeof buf, f) < sizeof buf) + break; + if (buf[0] == 0) + continue; + if (strcmp (buf + 5 + 257, nname) == 0) { + fclose (f); + return 1; + } + } + fclose (f); + return 0; +} + +static int needs_dbentry (a_inode *aino) +{ + const char *an_begin, *nn_begin; + + if (aino->deleted) + return 0; + + if (! fsdb_mode_representable_p (aino) || aino->comment != 0) + return 1; + + nn_begin = nname_begin (aino->nname); + return strcmp (nn_begin, aino->aname) != 0; +} + +static void write_aino (FILE *f, a_inode *aino) +{ + char buf[1 + 4 + 257 + 257 + 81]; + buf[0] = aino->needs_dbentry; + do_put_mem_long ((uae_u32 *)(buf + 1), aino->amigaos_mode); + strncpy (buf + 5, aino->aname, 256); + buf[5 + 256] = '\0'; + strncpy (buf + 5 + 257, nname_begin (aino->nname), 256); + buf[5 + 257 + 256] = '\0'; + strncpy (buf + 5 + 2*257, aino->comment ? aino->comment : "", 80); + buf[5 + 2 * 257 + 80] = '\0'; + fwrite (buf, 1, sizeof buf, f); + aino->has_dbentry = aino->needs_dbentry; +} + +/* Write back the db file for a directory. */ + +void fsdb_dir_writeback (a_inode *dir) +{ + FILE *f; + int changes_needed = 0; + int entries_needed = 0; + a_inode *aino; + + /* First pass: clear dirty bits where unnecessary, and see if any work + * needs to be done. */ + for (aino = dir->child; aino; aino = aino->sibling) { + int old_needs_dbentry = aino->needs_dbentry; + aino->needs_dbentry = old_needs_dbentry; + if (! aino->dirty) + continue; + aino->needs_dbentry = needs_dbentry (aino); + entries_needed |= aino->needs_dbentry; + if (! aino->needs_dbentry && ! old_needs_dbentry) + aino->dirty = 0; + else + changes_needed = 1; + } + if (! entries_needed) { + kill_fsdb (dir); + return; + } + + if (! changes_needed) + return; + + f = get_fsdb (dir, "r+b"); + if (f == 0) { + f = get_fsdb (dir, "w+b"); + if (f == 0) + /* This shouldn't happen... */ + return; + } + + for (aino = dir->child; aino; aino = aino->sibling) { + off_t pos; + + if (! aino->dirty) + continue; + aino->dirty = 0; + + if (! aino->has_dbentry) { + aino->db_offset = fseek (f, 0, SEEK_END); + aino->has_dbentry = 1; + } else + fseek (f, aino->db_offset, SEEK_SET); + + write_aino (f, aino); + } + fclose (f); +} + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/fsdb_unix.cpp b/uae4all_gp2x_0.7.2a/src/fsdb_unix.cpp new file mode 100755 index 0000000..bc1f408 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/fsdb_unix.cpp @@ -0,0 +1,116 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Library of functions to make emulated filesystem as independent as + * possible of the host filesystem's capabilities. + * This is the Unix version. + * + * Copyright 1999 Bernd Schmidt + */ + +#include "sysconfig.h" +#include "sysdeps.h" +#include "config.h" + +#include "fsdb.h" + +/* Return nonzero for any name we can't create on the native filesystem. */ +int fsdb_name_invalid (const char *n) +{ + if (strcmp (n, FSDB_FILE) == 0) + return 1; + if (n[0] != '.') + return 0; + if (n[1] == '\0') + return 1; + return n[1] == '.' && n[2] == '\0'; +} + +/* For an a_inode we have newly created based on a filename we found on the + * native fs, fill in information about this file/directory. */ +void fsdb_fill_file_attrs (a_inode *aino) +{ + struct stat statbuf; + /* This really shouldn't happen... */ + if (stat (aino->nname, &statbuf) == -1) + return; + aino->dir = S_ISDIR (statbuf.st_mode) ? 1 : 0; + + aino->amigaos_mode = ((S_IXUSR & statbuf.st_mode ? 0 : A_FIBF_EXECUTE) + | (S_IWUSR & statbuf.st_mode ? 0 : A_FIBF_WRITE) + | (S_IRUSR & statbuf.st_mode ? 0 : A_FIBF_READ)); + +#if defined(WIN32) || defined(ANDROIDSDL) || defined (IPHONE) + // Always give execute & read permission + aino->amigaos_mode &= ~A_FIBF_EXECUTE; + aino->amigaos_mode &= ~A_FIBF_READ; +#endif +} + +int fsdb_set_file_attrs (a_inode *aino, int mask) +{ + struct stat statbuf; + int mode; + + if (stat (aino->nname, &statbuf) == -1) + return ERROR_OBJECT_NOT_AROUND; + + mode = statbuf.st_mode; + /* Unix dirs behave differently than AmigaOS ones. */ + if (! aino->dir) { + if (mask & A_FIBF_READ) + mode &= ~S_IRUSR; + else + mode |= S_IRUSR; + + if (mask & A_FIBF_WRITE) + mode &= ~S_IWUSR; + else + mode |= S_IWUSR; + + if (mask & A_FIBF_EXECUTE) + mode &= ~S_IXUSR; + else + mode |= S_IXUSR; + + chmod (aino->nname, mode); + } + + aino->amigaos_mode = mask; + aino->dirty = 1; + return 0; +} + +/* Return nonzero if we can represent the amigaos_mode of AINO within the + * native FS. Return zero if that is not possible. */ +int fsdb_mode_representable_p (const a_inode *aino) +{ + if (aino->dir) + return aino->amigaos_mode == 0; + return (aino->amigaos_mode & (A_FIBF_DELETE | A_FIBF_SCRIPT | A_FIBF_PURE)) == 0; +} + +char *fsdb_create_unique_nname (a_inode *base, const char *suggestion) +{ + char tmp[256] = "__uae___"; + strncat (tmp, suggestion, 240); + for (;;) { + int i; + char *p = build_nname (base->nname, tmp); + if (access (p, R_OK) < 0 && errno == ENOENT) { + printf ("unique name: %s\n", p); + return p; + } + free (p); + + /* tmpnam isn't reentrant and I don't really want to hack configure + * right now to see whether tmpnam_r is available... */ + for (i = 0; i < 8; i++) { +#ifdef WIN32 + tmp[i] = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[rand () % 63]; +#else + tmp[i] = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[random () % 63]; +#endif + } + } +} diff --git a/uae4all_gp2x_0.7.2a/src/fsusage.cpp b/uae4all_gp2x_0.7.2a/src/fsusage.cpp new file mode 100755 index 0000000..6e7ab40 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/fsusage.cpp @@ -0,0 +1,293 @@ +/* fsusage.c -- return space usage of mounted filesystems + Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "sysconfig.h" +#include "sysdeps.h" +#include "config.h" + +#include +#include + +#ifdef HAVE_SYS_STAT_H +#include +#endif + +#include "fsusage.h" + +/* Return the number of TOSIZE-byte blocks used by + BLOCKS FROMSIZE-byte blocks, rounding away from zero. + TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */ + +static long +adjust_blocks + (long blocks, + int fromsize, int tosize) +{ + if (tosize <= 0) + abort (); + if (fromsize <= 0) + return -1; + + if (fromsize == tosize) /* e.g., from 512 to 512 */ + return blocks; + else if (fromsize > tosize) /* e.g., from 2048 to 512 */ + return blocks * (fromsize / tosize); + else /* e.g., from 256 to 512 */ + return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize); +} + + +int statfs (); + +#if HAVE_UNISTD_H +# include +#endif + +#if HAVE_SYS_PARAM_H +# include +#endif + +#if HAVE_SYS_MOUNT_H +# include +#endif + +#if HAVE_SYS_VFS_H +#ifndef AROS +//# include +#endif +#endif + +#if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */ +# include +#endif + +#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY) +# include /* SVR2 */ +#endif + +#if HAVE_FCNTL_H +# include +#endif + +#if HAVE_SYS_STATFS_H +#ifndef AROS +//# include +#endif +#endif + +#if HAVE_DUSTAT_H /* AIX PS/2 */ +# include +#endif + +#if HAVE_SYS_STATVFS_H /* SVR4 */ +# include +int statvfs (); +#endif + +/* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted. + Return the actual number of bytes read, zero for EOF, or negative + for an error. */ + +int +safe_read + (int desc, + char *ptr, + int len) +{ + int n_chars; + + if (len <= 0) + return len; + +#ifdef EINTR + do + { + n_chars = read (desc, ptr, len); + } + while (n_chars < 0 && errno == EINTR); +#else + n_chars = read (desc, ptr, len); +#endif + + return n_chars; +} + +/* Fill in the fields of FSP with information about space usage for + the filesystem on which PATH resides. + DISK is the device on which PATH is mounted, for space-getting + methods that need to know it. + Return 0 if successful, -1 if not. When returning -1, ensure that + ERRNO is either a system error value, or zero if DISK is NULL + on a system that requires a non-NULL value. */ +int +get_fs_usage + (const char *path, + const char *disk, + struct fs_usage *fsp) +{ + /* TODO: *** use RFs:Volume() to get free space *** */ + /* Just a hack */ + fsp->fsu_blocks = 507289; + fsp->fsu_bfree = 3435973; + fsp->fsu_bavail = 507289 / 2; + fsp->fsu_files = 3435973; + fsp->fsu_ffree = 3435973; + +#ifdef STAT_STATFS3_OSF1 +# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512) + + struct statfs fsd; + + if (statfs (path, &fsd, sizeof (struct statfs)) != 0) + return -1; + +#endif /* STAT_STATFS3_OSF1 */ + +#ifdef STAT_STATFS2_FS_DATA /* Ultrix */ +# define CONVERT_BLOCKS(B) adjust_blocks ((B), 1024, 512) + + struct fs_data fsd; + + if (statfs (path, &fsd) != 1) + return -1; + fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot); + fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree); + fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen); + fsp->fsu_files = fsd.fd_req.gtot; + fsp->fsu_ffree = fsd.fd_req.gfree; + +#endif /* STAT_STATFS2_FS_DATA */ + +#ifdef STAT_READ_FILSYS /* SVR2 */ +# ifndef SUPERBOFF +# define SUPERBOFF (SUPERB * 512) +# endif +# define CONVERT_BLOCKS(B) \ + adjust_blocks ((B), (fsd.s_type == Fs2b ? 1024 : 512), 512) + + struct filsys fsd; + int fd; + + if (! disk) + { + errno = 0; + return -1; + } + + fd = open (disk, O_RDONLY); + if (fd < 0) + return -1; + lseek (fd, (long) SUPERBOFF, 0); + if (safe_read (fd, (char *) &fsd, sizeof fsd) != sizeof fsd) + { + close (fd); + return -1; + } + close (fd); + fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize); + fsp->fsu_bfree = CONVERT_BLOCKS (fsd.s_tfree); + fsp->fsu_bavail = CONVERT_BLOCKS (fsd.s_tfree); + fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1); + fsp->fsu_ffree = fsd.s_tinode; + +#endif /* STAT_READ_FILSYS */ + +#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */ +# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512) + + struct statfs fsd; + + if (statfs (path, &fsd) < 0) + return -1; + +# ifdef STATFS_TRUNCATES_BLOCK_COUNTS + + /* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the + struct statfs are truncated to 2GB. These conditions detect that + truncation, presumably without botching the 4.1.1 case, in which + the values are not truncated. The correct counts are stored in + undocumented spare fields. */ + if (fsd.f_blocks == 0x1fffff && fsd.f_spare[0] > 0) + { + fsd.f_blocks = fsd.f_spare[0]; + fsd.f_bfree = fsd.f_spare[1]; + fsd.f_bavail = fsd.f_spare[2]; + } +# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */ + +#endif /* STAT_STATFS2_BSIZE */ + +#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */ +# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512) + + struct statfs fsd; + + if (statfs (path, &fsd) < 0) + return -1; + +#endif /* STAT_STATFS2_FSIZE */ + +#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */ +# if _AIX || defined(_CRAY) +# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512) +# ifdef _CRAY +# define f_bavail f_bfree +# endif +# else +# define CONVERT_BLOCKS(B) (B) +# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx */ +# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */ +# define f_bavail f_bfree +# endif +# endif +# endif + + struct statfs fsd; + + if (statfs (path, &fsd, sizeof fsd, 0) < 0) + return -1; + /* Empirically, the block counts on most SVR3 and SVR3-derived + systems seem to always be in terms of 512-byte blocks, + no matter what value f_bsize has. */ + +#endif /* STAT_STATFS4 */ + +#ifdef STAT_STATVFS /* SVR4 */ +# define CONVERT_BLOCKS(B) \ + adjust_blocks ((B), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512) + + struct statvfs fsd; + + if (statvfs (path, &fsd) < 0) + return -1; + /* f_frsize isn't guaranteed to be supported. */ + +#endif /* STAT_STATVFS */ + +#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS) && !defined(__SYMBIAN32__) + /* !Ultrix && !SVR2 */ + + fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks); + fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree); + fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail); + fsp->fsu_files = fsd.f_files; + fsp->fsu_ffree = fsd.f_ffree; + +#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */ + + return 0; +} diff --git a/uae4all_gp2x_0.7.2a/src/gp2x/menu/menu.cpp b/uae4all_gp2x_0.7.2a/src/gp2x/menu/menu.cpp index 70ce1cf..28f95b6 100644 --- a/uae4all_gp2x_0.7.2a/src/gp2x/menu/menu.cpp +++ b/uae4all_gp2x_0.7.2a/src/gp2x/menu/menu.cpp @@ -208,8 +208,8 @@ void init_text(int splash) SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK); prSDLScreen=SDL_SetVideoMode(320,240,16,VIDEO_FLAGS); SDL_ShowCursor(SDL_DISABLE); - SDL_JoystickEventState(SDL_ENABLE); - SDL_JoystickOpen(0); + //SDL_JoystickEventState(SDL_ENABLE); + //SDL_JoystickOpen(0); } #ifdef DREAMCAST __sdl_dc_emulate_keyboard=1; diff --git a/uae4all_gp2x_0.7.2a/src/gui.cpp b/uae4all_gp2x_0.7.2a/src/gui.cpp index 4c7a285..91e8902 100644 --- a/uae4all_gp2x_0.7.2a/src/gui.cpp +++ b/uae4all_gp2x_0.7.2a/src/gui.cpp @@ -132,7 +132,7 @@ int gui_init (void) #endif SDL_ShowCursor(SDL_DISABLE); SDL_JoystickEventState(SDL_ENABLE); - SDL_JoystickOpen(0); + //SDL_JoystickOpen(0); if (prSDLScreen!=NULL) { emulating=0; diff --git a/uae4all_gp2x_0.7.2a/src/hardfile.cpp b/uae4all_gp2x_0.7.2a/src/hardfile.cpp new file mode 100755 index 0000000..2349064 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/hardfile.cpp @@ -0,0 +1,248 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Hardfile emulation + * + * Copyright 1995 Bernd Schmidt + */ + +#include "sysconfig.h" +#include "sysdeps.h" + +#include "config.h" +#include "options.h" +#include "memory-uae.h" +#include "custom.h" +#include "m68k/m68k_intrf.h" +#include "disk.h" +#include "autoconf.h" +#include "filesys.h" +#include "execlib.h" +#include "gui.h" + +static int opencount = 0; + +static uae_u32 hardfile_open (void) +{ + uaecptr tmp1 = m68k_areg(regs, 1); /* IOReq */ + + /* Check unit number */ + if (get_hardfile_data (m68k_dreg (regs, 0))) { + opencount++; + put_word (m68k_areg(regs, 6)+32, get_word (m68k_areg(regs, 6)+32) + 1); + put_long (tmp1 + 24, m68k_dreg (regs, 0)); /* io_Unit */ + put_byte (tmp1 + 31, 0); /* io_Error */ + put_byte (tmp1 + 8, 7); /* ln_type = NT_REPLYMSG */ + return 0; + } + + put_long (tmp1 + 20, (uae_u32)-1); + put_byte (tmp1 + 31, (uae_u8)-1); + return (uae_u32)-1; +} + +static uae_u32 hardfile_close (void) +{ + opencount--; + put_word (m68k_areg(regs, 6) + 32, get_word (m68k_areg(regs, 6) + 32) - 1); + + return 0; +} + +static uae_u32 hardfile_expunge (void) +{ + return 0; /* Simply ignore this one... */ +} + +static uae_u32 hardfile_beginio (void) +{ + uae_u32 tmp1, tmp2, dataptr, offset; + uae_u32 retval = m68k_dreg(regs, 0); + int unit; + struct hardfiledata *hfd; + + tmp1 = m68k_areg(regs, 1); + unit = get_long (tmp1 + 24); + + hfd = get_hardfile_data (unit); + + put_byte (tmp1+8, NT_MESSAGE); + put_byte (tmp1+31, 0); /* no error yet */ + tmp2 = get_word (tmp1+28); /* io_Command */ + /* put_byte (tmp1 + 30, get_byte (tmp1 + 30) & ~1);*/ + switch (tmp2) { + case CMD_READ: + gui_data.hdled = HDLED_READ; + + dataptr = get_long (tmp1 + 40); + if (dataptr & 1) + goto bad_command; + offset = get_long (tmp1 + 44); + if (offset & 511) + goto bad_command; + tmp2 = get_long (tmp1 + 36); /* io_Length */ + if (tmp2 & 511) + goto bad_command; + if (tmp2 + offset > (uae_u32)hfd->size) + goto bad_command; + + put_long (tmp1 + 32, tmp2); /* set io_Actual */ + fseek (hfd->fd, offset, SEEK_SET); + while (tmp2) { + int i; + char buffer[512]; + /* See the comment in CMD_WRITE */ + fread (buffer, 1, 512, hfd->fd); + for (i = 0; i < 512; i++, dataptr++) + put_byte(dataptr, buffer[i]); + tmp2 -= 512; + } + break; + + case CMD_WRITE: + case 11: /* Format */ + gui_data.hdled = HDLED_WRITE; + + dataptr = get_long (tmp1 + 40); + if (dataptr & 1) + goto bad_command; + offset = get_long (tmp1 + 44); + if (offset & 511) + goto bad_command; + tmp2 = get_long (tmp1 + 36); /* io_Length */ + if (tmp2 & 511) + goto bad_command; + if (tmp2 + offset > (uae_u32)hfd->size) + goto bad_command; + + put_long (tmp1 + 32, tmp2); /* set io_Actual */ + fseek (hfd->fd, offset, SEEK_SET); + while (tmp2) { + char buffer[512]; + int i; + for (i=0; i < 512; i++, dataptr++) + buffer[i] = get_byte(dataptr); + fwrite (buffer, 1, 512, hfd->fd); + tmp2 -= 512; + } + break; + + bad_command: + break; + + case 18: /* GetDriveType */ + printf ("Shouldn't happen\n"); + put_long (tmp1 + 32, 1); /* not exactly a 3.5" drive, but... */ + break; + + case 19: /* GetNumTracks */ + printf ("Shouldn't happen 2\n"); + put_long (tmp1 + 32, 0); + break; + + /* Some commands that just do nothing and return zero */ + case CMD_UPDATE: + case CMD_CLEAR: + case 9: /* Motor */ + case 10: /* Seek */ + case 12: /* Remove */ + case 13: /* ChangeNum */ + case 14: /* ChangeStatus */ + case 15: /* ProtStatus */ + case 20: /* AddChangeInt */ + case 21: /* RemChangeInt */ + put_long (tmp1+32, 0); /* io_Actual */ + retval = 0; + break; + + default: + /* Command not understood. */ + put_byte (tmp1+31, (uae_u8)-3); /* io_Error */ + retval = 0; + break; + } + return retval; +} + +static uae_u32 hardfile_abortio (void) +{ + return (uae_u32)-3; +} + +void hardfile_install (void) +{ + uae_u32 functable, datatable; + uae_u32 initcode, openfunc, closefunc, expungefunc; + uae_u32 beginiofunc, abortiofunc; + + ROM_hardfile_resname = ds ("uaehf.device"); + ROM_hardfile_resid = ds ("UAE hardfile.device 0.2"); + + /* initcode */ + initcode = filesys_initcode; + + /* Open */ + openfunc = here (); + calltrap (deftrap (hardfile_open)); dw (RTS); + + /* Close */ + closefunc = here (); + calltrap (deftrap (hardfile_close)); dw (RTS); + + /* Expunge */ + expungefunc = here (); + calltrap (deftrap (hardfile_expunge)); dw (RTS); + + /* BeginIO */ + beginiofunc = here (); + calltrap (deftrap (hardfile_beginio)); + dw (0x48E7); dw (0x8002); /* movem.l d0/a6,-(a7) */ + dw (0x0829); dw (0); dw (30); /* btst #0,30(a1) */ + dw (0x6608); /* bne.b +8 */ + dw (0x2C78); dw (0x0004); /* move.l 4,a6 */ + dw (0x4EAE); dw (-378); /* jsr ReplyMsg(a6) */ + dw (0x4CDF); dw (0x4001); /* movem.l (a7)+,d0/a6 */ + dw (RTS); + + /* AbortIO */ + abortiofunc = here (); + calltrap (deftrap (hardfile_abortio)); dw (RTS); + + /* FuncTable */ + functable = here (); + dl (openfunc); /* Open */ + dl (closefunc); /* Close */ + dl (expungefunc); /* Expunge */ + dl (EXPANSION_nullfunc); /* Null */ + dl (beginiofunc); /* BeginIO */ + dl (abortiofunc); /* AbortIO */ + dl (0xFFFFFFFFul); /* end of table */ + + /* DataTable */ + datatable = here (); + dw (0xE000); /* INITBYTE */ + dw (0x0008); /* LN_TYPE */ + dw (0x0300); /* NT_DEVICE */ + dw (0xC000); /* INITLONG */ + dw (0x000A); /* LN_NAME */ + dl (ROM_hardfile_resname); + dw (0xE000); /* INITBYTE */ + dw (0x000E); /* LIB_FLAGS */ + dw (0x0600); /* LIBF_SUMUSED | LIBF_CHANGED */ + dw (0xD000); /* INITWORD */ + dw (0x0014); /* LIB_VERSION */ + dw (0x0004); /* 0.4 */ + dw (0xD000); + dw (0x0016); /* LIB_REVISION */ + dw (0x0000); + dw (0xC000); + dw (0x0018); /* LIB_IDSTRING */ + dl (ROM_hardfile_resid); + dw (0x0000); /* end of table */ + + ROM_hardfile_init = here (); + dl (0x00000100); /* ??? */ + dl (functable); + dl (datatable); + dl (initcode); +} diff --git a/uae4all_gp2x_0.7.2a/src/include/audio.h b/uae4all_gp2x_0.7.2a/src/include/audio.h index da90e2a..743f67a 100755 --- a/uae4all_gp2x_0.7.2a/src/include/audio.h +++ b/uae4all_gp2x_0.7.2a/src/include/audio.h @@ -13,7 +13,7 @@ #endif #ifdef NO_THREADS -#define PRE_SNDBUFFER_LEN (960) +#define PRE_SNDBUFFER_LEN (256) #else #define PRE_SNDBUFFER_LEN (1024) #endif @@ -69,5 +69,5 @@ extern void audio_channel_disable_dma (int n_channel); extern void check_dma_audio(void); extern void fetch_audio(void); extern void update_adkmasks (void); - - +extern void set_audio_volume(float volume); +extern float get_audio_volume(void); diff --git a/uae4all_gp2x_0.7.2a/src/include/autoconf.h b/uae4all_gp2x_0.7.2a/src/include/autoconf.h index de4ed2e..1bac208 100644 --- a/uae4all_gp2x_0.7.2a/src/include/autoconf.h +++ b/uae4all_gp2x_0.7.2a/src/include/autoconf.h @@ -16,7 +16,7 @@ extern uae_u32 addr (int); extern void db (uae_u8); extern void dw (uae_u16); extern void dl (uae_u32); -extern uae_u32 ds (char *); +extern uae_u32 ds (const char *); extern void calltrap (uae_u32); extern void org (uae_u32); extern uae_u32 here (void); @@ -42,6 +42,31 @@ extern uaecptr ROM_hardfile_resname, ROM_hardfile_resid; extern uaecptr ROM_hardfile_init; extern uaecptr filesys_initcode; +extern int nr_units (struct uaedev_mount_info *mountinfo); + +extern void hardfile_install (void); + +extern char *add_filesys_unit (struct uaedev_mount_info *mountinfo, + char *volname, char *rootdir, int readonly, + int secs, int surfaces, int reserved, + int blocksize); + +extern struct uaedev_mount_info *alloc_mountinfo (void); +extern struct uaedev_mount_info *dup_mountinfo (struct uaedev_mount_info *); +extern void free_mountinfo (struct uaedev_mount_info *); + +extern void filesys_reset (void); +extern void filesys_prepare_reset (void); +extern void filesys_start_threads (void); + +extern void filesys_install (void); +extern void filesys_install_code (void); +extern void filesys_store_devinfo (uae_u8 *); +extern void hardfile_install (void); +extern void emulib_install (void); +extern void expansion_init (void); +extern void expansion_cleanup (void); + #define TRAPFLAG_NO_REGSAVE 1 #define TRAPFLAG_NO_RETVAL 2 #define TRAPFLAG_EXTRA_STACK 4 diff --git a/uae4all_gp2x_0.7.2a/src/include/cfgfile.h b/uae4all_gp2x_0.7.2a/src/include/cfgfile.h new file mode 100755 index 0000000..b877021 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/cfgfile.h @@ -0,0 +1,18 @@ +#ifndef CFGFILE_H_ +#define CFGFILE_H_ + +#include "filesys.h" + +extern char * make_hard_dir_cfg_line (char *dst); +extern char * make_hard_file_cfg_line (char *dst); +extern void parse_filesys_spec (int readonly, char *spec); +extern void parse_hardfile_spec (char *spec); + +extern char uae4all_hard_dir[256]; +extern char uae4all_hard_file[256]; + +extern uaedev_mount_info *currprefs_mountinfo; + +void init_mountinfo(); + +#endif diff --git a/uae4all_gp2x_0.7.2a/src/include/custom.h b/uae4all_gp2x_0.7.2a/src/include/custom.h index 0693a60..68911db 100644 --- a/uae4all_gp2x_0.7.2a/src/include/custom.h +++ b/uae4all_gp2x_0.7.2a/src/include/custom.h @@ -9,6 +9,8 @@ /* These are the masks that are ORed together in the chipset_mask option. * If CSMASK_AJA is set, the ECS bits are guaranteed to be set as well. */ +//#include "m68k_intrf.h" + #ifndef UAE_CUSTOM_H #define UAE_CUSTOM_H @@ -68,6 +70,7 @@ extern void INTREQ (uae_u16); extern void INTREQ_0 (uae_u16); //extern uae_u16 INTREQR (void); uae_u16 __inline__ INTREQR (void) { + return intreq; } @@ -92,10 +95,10 @@ uae_u16 __inline__ INTREQR (void) { #define MAXVPOS_NTSC 262 //#define MINFIRSTLINE_PAL 21 #define MINFIRSTLINE_PAL 42 -#define MINFIRSTLINE_NTSC 34//18 +#define MINFIRSTLINE_NTSC 42 //18 //#define VBLANK_ENDLINE_PAL 29 -#define VBLANK_ENDLINE_PAL 32 -#define VBLANK_ENDLINE_NTSC 24 +#define VBLANK_ENDLINE_PAL 26 //26 on newer core +#define VBLANK_ENDLINE_NTSC 21 //21 on newer core #define VBLANK_HZ_PAL 50 #define VBLANK_HZ_NTSC 60 @@ -120,8 +123,7 @@ extern unsigned long frametime, timeframes; /* 100 words give you 1600 horizontal pixels. Should be more than enough for * superhires. Don't forget to update the definition in genp2c.c as well. * needs to be larger for superhires support */ -//#define MAX_WORDS_PER_LINE 100 -#define MAX_WORDS_PER_LINE 40 +#define MAX_WORDS_PER_LINE 100 extern uae_u32 hirestab_h[256][2]; extern uae_u32 lorestab_h[256][4]; diff --git a/uae4all_gp2x_0.7.2a/src/include/filesys.h b/uae4all_gp2x_0.7.2a/src/include/filesys.h index 4ac66a9..39b2ab3 100644 --- a/uae4all_gp2x_0.7.2a/src/include/filesys.h +++ b/uae4all_gp2x_0.7.2a/src/include/filesys.h @@ -1,4 +1,45 @@ - /* - * No Unix file system handler for AmigaDOS +#ifndef FILESYS_H_ +#define FILESYS_H_ + + +/* + * UAE - The Un*x Amiga Emulator + * + * Unix file system handler for AmigaDOS + * + * Copyright 1997 Bernd Schmidt */ +#define FILESYS_VIRTUAL 0 +#define FILESYS_HARDFILE 1 +#define FILESYS_HARDFILE_RDB 2 +#define FILESYS_HARDDRIVE 3 + +struct hardfiledata { + unsigned long size; + int nrcyls; + int secspertrack; + int surfaces; + int reservedblocks; + int blocksize; + FILE *fd; +}; +#ifdef WIN32 +int truncate (const char *name, long int len); +#endif + +struct uaedev_mount_info; + +extern struct hardfiledata *get_hardfile_data (int nr); +extern int kill_filesys_unit (struct uaedev_mount_info *mountinfo, int nr); +extern int nr_units (struct uaedev_mount_info *mountinfo); +extern char *get_filesys_unit (struct uaedev_mount_info *mountinfo, int nr, + char **volname, char **rootdir, int *readonly, + int *secspertrack, int *surfaces, int *reserved, + int *cylinders, int *size, int *blocksize); +extern char *add_filesys_unit (struct uaedev_mount_info *mountinfo, + char *volname, char *rootdir, int readonly, + int secspertrack, int surfaces, int reserved, + int blocksize); + +#endif \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/include/fsdb.h b/uae4all_gp2x_0.7.2a/src/include/fsdb.h new file mode 100755 index 0000000..aa9661c --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/fsdb.h @@ -0,0 +1,107 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Library of functions to make emulated filesystem as independent as + * possible of the host filesystem's capabilities. + * + * Copyright 1999 Bernd Schmidt + */ + +#ifndef FSDB_FILE +#define FSDB_FILE "_UAEFSDB.___" +#endif + +#ifndef FSDB_DIR_SEPARATOR +#define FSDB_DIR_SEPARATOR '/' +#endif + +/* AmigaOS errors */ +#define ERROR_NO_FREE_STORE 103 +#define ERROR_OBJECT_IN_USE 202 +#define ERROR_OBJECT_EXISTS 203 +#define ERROR_DIR_NOT_FOUND 204 +#define ERROR_OBJECT_NOT_AROUND 205 +#define ERROR_ACTION_NOT_KNOWN 209 +#define ERROR_INVALID_LOCK 211 +#define ERROR_OBJECT_WRONG_TYPE 212 +#define ERROR_DISK_WRITE_PROTECTED 214 +#define ERROR_DIRECTORY_NOT_EMPTY 216 +#define ERROR_DEVICE_NOT_MOUNTED 218 +#define ERROR_SEEK_ERROR 219 +#define ERROR_DISK_IS_FULL 221 +#define ERROR_DELETE_PROTECTED 222 +#define ERROR_WRITE_PROTECTED 223 +#define ERROR_READ_PROTECTED 224 +#define ERROR_NO_MORE_ENTRIES 232 +#define ERROR_NOT_IMPLEMENTED 236 + +#define A_FIBF_SCRIPT (1<<6) +#define A_FIBF_PURE (1<<5) +#define A_FIBF_ARCHIVE (1<<4) +#define A_FIBF_READ (1<<3) +#define A_FIBF_WRITE (1<<2) +#define A_FIBF_EXECUTE (1<<1) +#define A_FIBF_DELETE (1<<0) + +/* AmigaOS "keys" */ +typedef struct a_inode_struct { + /* Circular list of recycleable a_inodes. */ + struct a_inode_struct *next, *prev; + /* This a_inode's relatives in the directory structure. */ + struct a_inode_struct *parent; + struct a_inode_struct *child, *sibling; + /* AmigaOS name, and host OS name. The host OS name is a full path, the + * AmigaOS name is relative to the parent. */ + char *aname; + char *nname; + /* AmigaOS file comment, or NULL if file has none. */ + char *comment; + /* AmigaOS protection bits. */ + int amigaos_mode; + /* Unique number for identification. */ + uae_u32 uniq; + /* For a directory that is being ExNext()ed, the number of child ainos + which must be kept locked in core. */ + unsigned long locked_children; + /* How many ExNext()s are going on in this directory? */ + unsigned long exnext_count; + /* AmigaOS locking bits. */ + int shlock; + long db_offset; + unsigned int dir:1; + unsigned int elock:1; + /* Nonzero if this came from an entry in our database. */ + unsigned int has_dbentry:1; + /* Nonzero if this will need an entry in our database. */ + unsigned int needs_dbentry:1; + /* This a_inode possibly needs writing back to the database. */ + unsigned int dirty:1; + /* If nonzero, this represents a deleted file; the corresponding + * entry in the database must be cleared. */ + unsigned int deleted:1; +} a_inode; + +extern char *nname_begin (char *); + +extern char *build_nname (const char *d, const char *n); +extern char *build_aname (const char *d, const char *n); + +/* Filesystem-independent functions. */ +extern void fsdb_clean_dir (a_inode *); +extern char *fsdb_search_dir (const char *dirname, char *rel); +extern void fsdb_dir_writeback (a_inode *); +extern int fsdb_used_as_nname (a_inode *base, const char *); +extern a_inode *fsdb_lookup_aino_aname (a_inode *base, const char *); +extern a_inode *fsdb_lookup_aino_nname (a_inode *base, const char *); + +static inline int same_aname (const char *an1, const char *an2) +{ + return strcasecmp (an1, an2) == 0; +} + +/* Filesystem-dependent functions. */ +extern int fsdb_name_invalid (const char *n); +extern void fsdb_fill_file_attrs (a_inode *); +extern int fsdb_set_file_attrs (a_inode *, int); +extern int fsdb_mode_representable_p (const a_inode *); +extern char *fsdb_create_unique_nname (a_inode *base, const char *); diff --git a/uae4all_gp2x_0.7.2a/src/include/fsusage.h b/uae4all_gp2x_0.7.2a/src/include/fsusage.h new file mode 100755 index 0000000..227c5b4 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/fsusage.h @@ -0,0 +1,37 @@ +/* fsusage.h -- declarations for filesystem space usage info + Copyright (C) 1991, 1992 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Space usage statistics for a filesystem. Blocks are 512-byte. */ +struct fs_usage +{ + long fsu_blocks; /* Total blocks. */ + long fsu_bfree; /* Free blocks available to superuser. */ + long fsu_bavail; /* Free blocks available to non-superuser. */ + long fsu_files; /* Total file nodes. */ + long fsu_ffree; /* Free file nodes. */ +}; + +#ifndef __P +#if defined (__GNUC__) || (defined (__STDC__) && __STDC__) +#define __P(args) args +#else +#define __P(args) () +#endif /* GCC. */ +#endif /* Not __P. */ + +int get_fs_usage __P ((const char *path, const char *disk, + struct fs_usage *fsp)); diff --git a/uae4all_gp2x_0.7.2a/src/include/gui.h b/uae4all_gp2x_0.7.2a/src/include/gui.h index 9e50b8c..682233d 100755 --- a/uae4all_gp2x_0.7.2a/src/include/gui.h +++ b/uae4all_gp2x_0.7.2a/src/include/gui.h @@ -5,44 +5,62 @@ extern "C" { #endif - /* - * UAE - The Un*x Amiga Emulator - * - * Interface to the Tcl/Tk GUI - * - * Copyright 1996 Bernd Schmidt - */ - -extern int gui_init (void); -extern int gui_update (void); -extern void gui_exit (void); -extern void gui_led (int, int); -extern void gui_handle_events (void); -extern void gui_purge_events (void); -extern void gui_filename (int, const char *); -extern void gui_fps (int fps); -extern void gui_changesettings (void); -extern void gui_lock (void); -extern void gui_unlock (void); -extern void gui_set_message(const char *msg, int t); -extern void gui_show_window_bar(int per, int max, int case_title); - -extern unsigned int gui_ledstate; - -struct gui_info -{ - uae_u8 drive_motor[4]; /* motor on off */ - uae_u8 drive_track[4]; /* rw-head track */ - uae_u8 drive_writing[4]; /* drive is writing */ - uae_u8 powerled; /* state of power led */ -}; - -extern struct gui_info gui_data; - -/* Functions to be called when prefs are changed by non-gui code. */ -extern void gui_update_gfx (void); -extern void uae4all_update_time(void); -extern void uae4all_show_time(void); + /* + * UAE - The Un*x Amiga Emulator + * + * Interface to the Tcl/Tk GUI + * + * Copyright 1996 Bernd Schmidt + */ + + extern int gui_init (void); + extern int gui_update (void); + extern void gui_exit (void); + extern void gui_led (int, int); + extern void gui_handle_events (void); + extern void gui_purge_events (void); + extern void gui_filename (int, const char *); + extern void gui_fps (int fps); + extern void gui_lock (void); + extern void gui_unlock (void); + extern void gui_set_message(const char *msg, int t); + extern void gui_show_window_bar(int per, int max, int case_title); + + extern unsigned int gui_ledstate; + extern int show_message; + extern int no_gui; + extern char *show_message_str; +#define HDLED_OFF 0 +#define HDLED_READ 1 +#define HDLED_WRITE 2 +#define HDLED_TIMEOUT 3 /* HD LED off delay [frames] */ + + struct gui_info + { + uae_u8 drive_motor[4]; /* motor on off */ + uae_u8 drive_track[4]; /* rw-head track */ + uae_u8 drive_writing[4]; /* drive is writing */ + uae_u8 powerled; /* state of power led */ + uae_u8 hdled; /* state of hard disk access */ + uae_u16 fps; + }; + +#ifndef _GUI_CPP + extern struct gui_info gui_data; + + extern char uae4all_image_file0[256]; + extern char uae4all_image_file1[256]; + extern char uae4all_image_file2[256]; + extern char uae4all_image_file3[256]; + + extern char uae4all_hard_dir[256]; + extern char uae4all_hard_file[256]; + +#endif + + /* Functions to be called when prefs are changed by non-gui code. */ + extern void uae4all_update_time(void); + extern void uae4all_show_time(void); #ifdef __cplusplus } diff --git a/uae4all_gp2x_0.7.2a/src/include/joystick.h b/uae4all_gp2x_0.7.2a/src/include/joystick.h index 6e9921c..1073b2a 100644 --- a/uae4all_gp2x_0.7.2a/src/include/joystick.h +++ b/uae4all_gp2x_0.7.2a/src/include/joystick.h @@ -9,5 +9,6 @@ extern void read_joystick (int nr, unsigned int *dir, int *button); extern void init_joystick (void); extern void close_joystick (void); +extern void set_joystickactive(void); extern int nr_joysticks; diff --git a/uae4all_gp2x_0.7.2a/src/include/maccess.h b/uae4all_gp2x_0.7.2a/src/include/maccess.h index 081f9d6..3db72f4 100644 --- a/uae4all_gp2x_0.7.2a/src/include/maccess.h +++ b/uae4all_gp2x_0.7.2a/src/include/maccess.h @@ -9,21 +9,23 @@ #ifndef MACCESS_UAE_H #define MACCESS_UAE_H +static uae_u16 do_get_mem_word(uae_u16 *_GCCRES_ a); +static void do_put_mem_word(uae_u16 *_GCCRES_ a, uae_u16 v); + static __inline__ uae_u32 do_get_mem_long(uae_u32 *_GCCRES_ a) { #ifdef USE_FAME_CORE - -//#ifdef __arm__ && 0 -// uae_u32 d = *a; -// ROL16(d); -// return d; -//#else - register uae_u16 *b=(uae_u16 *)a; - register uae_u32 b1=b[0]; - b1<<=16; - return (b1|b[1]); -//#endif - + register uae_u32 b; + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + /* Example: + * - memory loc. 0x00000000 : 0xeeff0011 0x22334455... (word-swabbed data) + * - read long from 0x00000001 : 0xee110033 (unswabbed data, eg. Amiga register) + */ + + b = do_get_mem_word((uae_u16 *)a) << 16; + b |= do_get_mem_word((uae_u16 *)((uintptr_t)a + 2)); + //b |= do_get_mem_word((uae_u16 *)((uae_u32)a + 2)); + return b; #else uae_u8 *b = (uae_u8 *)a; @@ -34,7 +36,22 @@ static __inline__ uae_u32 do_get_mem_long(uae_u32 *_GCCRES_ a) static __inline__ uae_u16 do_get_mem_word(uae_u16 *_GCCRES_ a) { #ifdef USE_FAME_CORE - return (*a); + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if((uintptr_t)a & 1) { + //if ((uae_u32)a & 1) { + /* Example: + * - memory loc. 0x00000000 : 0xeeff0011 (word-swabbed data) + * - read word from 0x00000001 : 0xee11 (unswabbed data) + */ + register uae_u32 b; + b = *((uae_u32 *)((uintptr_t)a ^ 1)); + //b = *((uae_u32 *)((uae_u32)a ^ 1)); + b = (b << 8) | (b >> 24); + return (uae_u16)b; + } + else { + return (*a); + } #else uae_u8 *b = (uae_u8 *)a; @@ -42,29 +59,27 @@ static __inline__ uae_u16 do_get_mem_word(uae_u16 *_GCCRES_ a) #endif } + static __inline__ uae_u8 do_get_mem_byte(uae_u8 *_GCCRES_ a) { -/* #ifdef USE_FAME_CORE - a= (uae_u8 *)(((unsigned)a)^1); + a= (uae_u8 *)(((uintptr_t)a)^1); #endif -*/ + return *a; } static __inline__ void do_put_mem_long(uae_u32 *_GCCRES_ a, uae_u32 v) { #ifdef USE_FAME_CORE - -//#ifdef __arm__ && 0 -// ROL16(v); - *a = v; -//#else - register uae_u16 *b=(uae_u16 *)a; - b[0]=(v>>16)&0xffff; - b[1]=v&0xffff; -//#endif - + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + /* Example: + * - memory loc. 0x00000000 : 0xeeff0011 (word-swabbed data) + * - write 0x22334455 to 0x00000001 : 0x22ff4433 0xnn55... + */ + do_put_mem_word((uae_u16 *)a, v >> 16); + do_put_mem_word((uae_u16 *)((uintptr_t)a + 2), v); + //do_put_mem_word((uae_u16 *)((uae_u32)a + 2), v); #else uae_u8 *b = (uae_u8 *)a; @@ -78,7 +93,19 @@ static __inline__ void do_put_mem_long(uae_u32 *_GCCRES_ a, uae_u32 v) static __inline__ void do_put_mem_word(uae_u16 *_GCCRES_ a, uae_u16 v) { #ifdef USE_FAME_CORE - (*a)=v; + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if ((uintptr_t)a & 1) { + //if ((uae_u32)a & 1) { + /* Example: + * - memory loc. 0x00000000 : 0xeeff0011 (word-swabbed data) + * - write 0x2233 to 0x00000001 : 0x22ff0033 + */ + *((uae_u8 *)a - 1) = v >> 8; + *((uae_u8 *)a + 2) = v; + } + else { + (*a)=v; + } #else uae_u8 *b = (uae_u8 *)a; @@ -89,18 +116,16 @@ static __inline__ void do_put_mem_word(uae_u16 *_GCCRES_ a, uae_u16 v) static __inline__ void do_put_mem_byte(uae_u8 *_GCCRES_ a, uae_u8 v) { -/* #ifdef USE_FAME_CORE - a= (uae_u8 *)(((unsigned)a)^1); + a= (uae_u8 *)(((uintptr_t)a)^1); #endif -*/ + *a = v; } #define call_mem_get_func(func, addr) ((*func)(addr)) #define call_mem_put_func(func, addr, v) ((*func)(addr, v)) -#undef NO_INLINE_MEMORY_ACCESS #undef MD_HAVE_MEM_1_FUNCS #endif diff --git a/uae4all_gp2x_0.7.2a/src/include/memory-uae.h b/uae4all_gp2x_0.7.2a/src/include/memory-uae.h new file mode 100644 index 0000000..017c066 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/memory-uae.h @@ -0,0 +1,253 @@ +/* + * UAE - The Un*x Amiga Emulator + * + * memory management + * + * Copyright 1995 Bernd Schmidt + */ + +#ifndef UAE_MEMORY_H +#define UAE_MEMORY_H + +void swab_memory (uae_u8 *apMemory, uae_u32 aSize); + +extern void memory_reset (void); +extern unsigned chipmem_checksum(void); + +typedef uae_u32 (*mem_get_func)(uaecptr) REGPARAM; +typedef void (*mem_put_func)(uaecptr, uae_u32) REGPARAM; +typedef uae_u8 *(*xlate_func)(uaecptr) REGPARAM; +typedef int (*check_func)(uaecptr, uae_u32) REGPARAM; + +extern char *address_space, *good_address_map; +extern uae_u8 *chipmemory; +extern uae_u16 *chipmemory_word; + +extern uae_u32 allocated_chipmem; +extern uae_u32 allocated_fastmem; +extern uae_u32 allocated_bogomem; +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +extern uae_u32 allocated_gfxmem; +extern uae_u32 allocated_z3fastmem; +extern uae_u32 allocated_a3000mem; +#endif + +#undef DIRECT_MEMFUNCS_SUCCESSFUL +#include "maccess.h" + +#define kickmem_size 0x080000 + +#define chipmem_start 0x00000000 +#define bogomem_start 0x00C00000 +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +#define a3000mem_start 0x07000000 +#endif +#define kickmem_start 0x00F80000 + +extern int ersatzkickfile; +extern int cloanto_rom; + +typedef struct { + /* These ones should be self-explanatory... */ + mem_get_func lget, wget, bget; + mem_put_func lput, wput, bput; + /* Use xlateaddr to translate an Amiga address to a uae_u8 * that can + * be used to address memory without calling the wget/wput functions. + * This doesn't work for all memory banks, so this function may call + * abort(). */ + xlate_func xlateaddr; + /* To prevent calls to abort(), use check before calling xlateaddr. + * It checks not only that the memory bank can do xlateaddr, but also + * that the pointer points to an area of at least the specified size. + * This is used for example to translate bitplane pointers in custom.c */ + check_func check; + /* For those banks that refer to real memory, we can save the whole trouble + of going through function calls, and instead simply grab the memory + ourselves. This holds the memory address where the start of memory is + for this particular bank. */ + uae_u8 *baseaddr; + char *name; + /* for instruction opcode/operand fetches */ + mem_get_func lgeti, wgeti; + int flags; +} addrbank; + +extern uae_u8 *filesysory; +extern uae_u8 *rtarea; + +extern addrbank chipmem_bank; +extern addrbank kickmem_bank; +extern addrbank custom_bank; +extern addrbank clock_bank; +extern addrbank cia_bank; +extern addrbank rtarea_bank; +extern addrbank expamem_bank; +extern addrbank fastmem_bank; +extern addrbank gfxmem_bank; + +extern void rtarea_init (void); +extern void rtarea_setup (void); +extern void expamem_init (void); +extern void expamem_reset (void); +extern void rtarea_cleanup (void); + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +extern uae_u32 gfxmem_start; +extern uae_u8 *gfxmemory; +extern uae_u32 gfxmem_mask; +#endif + +/* Default memory access functions */ + +extern int default_check(uaecptr addr, uae_u32 size) REGPARAM; +extern uae_u8 *default_xlate(uaecptr addr) REGPARAM; + +#define bankindex(addr) (((uaecptr)(addr)) >> 16) + +extern addrbank *mem_banks[65536]; +#define get_mem_bank(addr) (*mem_banks[bankindex(addr)]) +#define put_mem_bank(addr, b) \ +(mem_banks[bankindex(addr)] = (b)); + +extern void memory_init (void); +extern void memory_cleanup (void); +extern void map_banks (addrbank *bank, int first, int count, int realsize); + +#define NONEXISTINGDATA 0 + +#define longget(addr) (call_mem_get_func(get_mem_bank(addr).lget, addr)) +#define wordget(addr) (call_mem_get_func(get_mem_bank(addr).wget, addr)) +#define byteget(addr) (call_mem_get_func(get_mem_bank(addr).bget, addr)) +#define longput(addr,l) (call_mem_put_func(get_mem_bank(addr).lput, addr, l)) +#define wordput(addr,w) (call_mem_put_func(get_mem_bank(addr).wput, addr, w)) +#define byteput(addr,b) (call_mem_put_func(get_mem_bank(addr).bput, addr, b)) + +#ifndef MD_HAVE_MEM_1_FUNCS + +#define longget_1 longget +#define wordget_1 wordget +#define byteget_1 byteget +#define longput_1 longput +#define wordput_1 wordput +#define byteput_1 byteput + +#endif + +static __inline__ uae_u32 get_long(uaecptr addr) +{ + return longget_1(addr); +} +static __inline__ uae_u32 get_word(uaecptr addr) +{ + return wordget_1(addr); +} +static __inline__ uae_u32 get_byte(uaecptr addr) +{ + return byteget_1(addr); +} +static __inline__ void put_long(uaecptr addr, uintptr_t l) +{ + longput_1(addr, l); +} +static __inline__ void put_word(uaecptr addr, uae_u32 w) +{ + wordput_1(addr, w); +} +static __inline__ void put_byte(uaecptr addr, uae_u32 b) +{ + byteput_1(addr, b); +} + +static __inline__ uae_u8 * get_real_address(uaecptr addr) +{ + return get_mem_bank(addr).xlateaddr(addr); +} + +static __inline__ int valid_address(uaecptr addr, uae_u32 size) +{ + return get_mem_bank(addr).check(addr, size); +} + +/* For faster access in custom chip emulation. */ +extern uae_u32 chipmem_lget (uaecptr) REGPARAM; +extern uae_u32 chipmem_wget (uaecptr) REGPARAM; +extern uae_u32 chipmem_bget (uaecptr) REGPARAM; +extern void chipmem_lput (uaecptr, uae_u32) REGPARAM; +extern void chipmem_wput (uaecptr, uae_u32) REGPARAM; +extern void chipmem_bput (uaecptr, uae_u32) REGPARAM; + +/* IMPORTANT: Mask was hard-coded to ~0xfff00000 => 1MB chip memory MAX. + * Mask is now set to chipmem_mask => 8MB chip memory MAX. + */ +extern uae_u32 chipmem_mask; + +static __inline__ uae_u16 CHIPMEM_WGET (uae_u32 PT) { + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if (PT & 1) { + return (*((uae_u8 *)&chipmemory[(PT - 1) & chipmem_mask]) << 8) | + *((uae_u8 *)&chipmemory[(PT + 2) & chipmem_mask]); + } + else { + return *((uae_u16 *)&chipmemory[PT & chipmem_mask]); + } +} +static __inline void CHIPMEM_WPUT (uae_u32 PT, uae_u16 DA) { + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if (PT & 1) { + *((uae_u8 *)&chipmemory[(PT - 1) & chipmem_mask]) = DA >> 8; + *((uae_u8 *)&chipmemory[(PT + 2) & chipmem_mask]) = DA; + } + else { + *((uae_u16 *)&chipmemory[PT & chipmem_mask]) = DA; + } +} +static __inline__ uae_u32 CHIPMEM_LGET(uae_u32 PT) { + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if (PT & 1) { + return (CHIPMEM_WGET(PT) << 16) | CHIPMEM_WGET(PT + 2); + } + else { + return ((uae_u32)(*((uae_u16 *)&chipmemory[PT & chipmem_mask])) << 16) | + (*((uae_u16 *)&chipmemory[(PT + 2) & chipmem_mask])); + } +} + +// Custom chips use always even addresses -> no check required +static __inline__ uae_u16 CHIPMEM_WGET_CUSTOM (uae_u32 PT) { + return *((uae_u16 *)&chipmemory[PT & chipmem_mask]); +} +static __inline void CHIPMEM_WPUT_CUSTOM (uae_u32 PT, uae_u16 DA) { + *((uae_u16 *)&chipmemory[PT & chipmem_mask]) = DA; +} +static __inline__ uae_u32 CHIPMEM_LGET_CUSTOM(uae_u32 PT) { + return ((uae_u32)(*((uae_u16 *)&chipmemory[PT & chipmem_mask])) << 16) | + (*((uae_u16 *)&chipmemory[(PT + 2) & chipmem_mask])); +} + + +extern uae_u8 *mapped_malloc (size_t, const char *); +extern void mapped_free (uae_u8 *); + +#if defined(USE_ARMV7) + +extern "C" { + void *arm_memset(void *s, int c, size_t n); + void *arm_memcpy(void *dest, const void *src, size_t n); +} + +/* 4-byte alignment */ +//#define UAE4ALL_ALIGN __attribute__ ((__aligned__ (4))) +#define UAE4ALL_ALIGN __attribute__ ((__aligned__ (16))) +#define uae4all_memclr(p,l) arm_memset(p,0,l) +#define uae4all_memcpy arm_memcpy + +#else + +/* 4-byte alignment */ +#define UAE4ALL_ALIGN __attribute__ ((__aligned__ (4))) +#define uae4all_memcpy memcpy +#define uae4all_memclr(p,l) memset(p, 0, l) + +#endif + +#endif diff --git a/uae4all_gp2x_0.7.2a/src/include/memory.h b/uae4all_gp2x_0.7.2a/src/include/memory.h index d030173..ec05e8f 100644 --- a/uae4all_gp2x_0.7.2a/src/include/memory.h +++ b/uae4all_gp2x_0.7.2a/src/include/memory.h @@ -68,6 +68,9 @@ extern uae_u32 allocated_a3000mem; extern int ersatzkickfile; extern int cloanto_rom; +extern int bReloadKickstart; + + extern uae_u8* baseaddr[]; typedef struct { @@ -182,7 +185,7 @@ static __inline__ uae_u32 get_byte(uaecptr addr) { return byteget_1(addr); } -static __inline__ void put_long(uaecptr addr, uae_u32 l) +static __inline__ void put_long(uaecptr addr, uintptr_t l) { longput_1(addr, l); } diff --git a/uae4all_gp2x_0.7.2a/src/include/native2amiga.h b/uae4all_gp2x_0.7.2a/src/include/native2amiga.h new file mode 100755 index 0000000..01d1b0c --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/native2amiga.h @@ -0,0 +1,53 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Call (some) Amiga Exec functions outside the main UAE thread + * and without stack magic. + * + * Copyright 1999 Patrick Ohly + * + * Uses the EXTER interrupt that is setup in filesys.c + * and some of it needs thread support. + */ + +/* + * The following functions do exactly the same thing as their + * Amiga counterpart, but can be called in situation where calling + * the exec.library functions is impossible. + */ +#ifdef SUPPORT_THREADS +void uae_ReplyMsg(uaecptr msg); +void uae_PutMsg(uaecptr port, uaecptr msg); +void uae_Signal(uaecptr task, uae_u32 mask); +#endif +void uae_NewList(uaecptr list); + +/* + * The following functions are shortcuts for calling + * the exec.library function with CallLib(), so they + * are only available in a trap function. This trap + * function has to be setup with deftrap2() and + * TRAPFLAG_EXTRA_STACK and stack magic is required. + */ +uaecptr uae_AllocMem (uae_u32 size, uae_u32 flags); + + +/* + * to be called when setting up the hardware + */ +void native2amiga_install (void); + +/* + * to be called when the Amiga boots, i.e. by filesys_diagentry() + */ +void native2amiga_startup (void); + +/**** internal stuff ****/ +#ifdef SUPPORT_THREADS +/* This pipe is filled by Signal() with pairs of + * (uae_u32)0/(uaecptr)task/(uae_u32)signal_set, + * by PutMsg() with (uae_u32)1/(uaecptr)port/(uaecptr)msg and by + * ReplyMsg() with (uae_u32)2/(uaecptr)msg. + * It's emptied via exter_int_helper by the EXTER interrupt. */ +extern smp_comm_pipe native2amiga_pending; +#endif diff --git a/uae4all_gp2x_0.7.2a/src/include/options.h b/uae4all_gp2x_0.7.2a/src/include/options.h index 920bb19..ca4806c 100644 --- a/uae4all_gp2x_0.7.2a/src/include/options.h +++ b/uae4all_gp2x_0.7.2a/src/include/options.h @@ -19,7 +19,7 @@ #define UAESUBREV 22 #ifndef NUM_DRIVES -#define NUM_DRIVES 2 +#define NUM_DRIVES 4 #endif typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang; @@ -33,13 +33,17 @@ extern char prefs_df[NUM_DRIVES][256]; extern char changed_df[NUM_DRIVES][256]; extern int real_changed_df[NUM_DRIVES]; extern char romfile[256]; +extern char romkeyfile[256]; extern unsigned prefs_chipmem_size; +extern unsigned prefs_fastmem_size; extern int prefs_gfx_framerate, changed_gfx_framerate; extern int m68k_speed; +extern uae_u8 disabled; -#define PREFS_GFX_WIDTH 320 -#define PREFS_GFX_HEIGHT 240 + +#define PREFS_GFX_WIDTH 640 // mithrendal hires patch +#define PREFS_GFX_HEIGHT 258 extern void check_prefs_changed_custom (void); extern void check_prefs_changed_cpu (void); @@ -135,4 +139,4 @@ static __inline__ void fuzzy_memset_le32_1 (void *p, uae_u32 c, int offset, int #include "od-amiga/amiga-kludges.h" #endif -#endif \ No newline at end of file +#endif diff --git a/uae4all_gp2x_0.7.2a/src/include/picasso96.h b/uae4all_gp2x_0.7.2a/src/include/picasso96.h new file mode 100755 index 0000000..f04a0b5 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/picasso96.h @@ -0,0 +1,4 @@ +/* + * No Picasso96 Support + */ + diff --git a/uae4all_gp2x_0.7.2a/src/include/savestate.h b/uae4all_gp2x_0.7.2a/src/include/savestate.h index 862c941..7416ad1 100644 --- a/uae4all_gp2x_0.7.2a/src/include/savestate.h +++ b/uae4all_gp2x_0.7.2a/src/include/savestate.h @@ -1,10 +1,10 @@ - /* - * UAE - The Un*x Amiga Emulator - * - * Save/restore emulator state - * - * (c) 1999-2001 Toni Wilen - */ +/* + * UAE - The Un*x Amiga Emulator + * + * Save/restore emulator state + * + * (c) 1999-2001 Toni Wilen + */ /* functions to save byte,word or long word @@ -15,14 +15,14 @@ extern "C" { #endif extern void save_u16_func (uae_u8 **, uae_u16); -extern void save_u32_func (uae_u8 **, uae_u32); +extern void save_u32_func (uae_u8 **, uintptr_t); extern void save_u8_func (uae_u8 **, uae_u8); extern uae_u16 restore_u16_func (uae_u8 **); extern uae_u32 restore_u32_func (uae_u8 **); extern uae_u8 restore_u8_func (uae_u8 **); -extern void save_string_func (uae_u8 **, char*); +extern void save_string_func (uae_u8 **, const char*); extern char *restore_string_func (uae_u8 **); #define save_u16(x) save_u16_func (&dst, (x)) @@ -40,10 +40,8 @@ void savestate_restore_finish (void); /* save, restore and initialize routines for Amiga's subsystems */ -#ifndef CYCLONE -extern uae_u8 *restore_cpu (uae_u8 *); -extern uae_u8 *save_cpu (int *); -#endif +uae_u8 *restore_cpu (uae_u8 *); +uae_u8 *save_cpu (int *); extern uae_u8 *restore_fpu (uae_u8 *); extern uae_u8 *save_fpu (int *); @@ -78,8 +76,8 @@ extern uae_u8 *save_expansion (int *); extern void restore_cram (int, long); extern void restore_bram (int, long); -extern void restore_fram (int, long); -extern void restore_zram (int, long); +extern void restore_fram (uae_u32, size_t); +extern void restore_zram (uae_u32, size_t); extern uae_u8 *save_cram (int *); extern uae_u8 *save_bram (int *); extern uae_u8 *save_fram (int *); @@ -88,7 +86,7 @@ extern uae_u8 *save_zram (int *); extern uae_u8 *restore_rom (uae_u8 *); extern uae_u8 *save_rom (int, int *); -extern void save_state (char *filename, char *description); +extern void save_state (char *filename, const char *description); extern void restore_state (char *filename); extern void custom_save_state (void); diff --git a/uae4all_gp2x_0.7.2a/src/include/scsidev.h b/uae4all_gp2x_0.7.2a/src/include/scsidev.h new file mode 100755 index 0000000..8a7b980 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/include/scsidev.h @@ -0,0 +1,13 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * a SCSI device + * + * (c) 1995 Bernd Schmidt (hardfile.c) + * (c) 1999 Patrick Ohly + */ + +uaecptr scsidev_startup (uaecptr resaddr); +void scsidev_install (void); +void scsidev_reset (void); +void scsidev_start_threads (void); diff --git a/uae4all_gp2x_0.7.2a/src/include/sysdeps.h b/uae4all_gp2x_0.7.2a/src/include/sysdeps.h index e2b112a..cec9e54 100644 --- a/uae4all_gp2x_0.7.2a/src/include/sysdeps.h +++ b/uae4all_gp2x_0.7.2a/src/include/sysdeps.h @@ -210,7 +210,7 @@ typedef long uae_s32; #error No 4 byte type, you lose. #endif -typedef uae_u32 uaecptr; +typedef uintptr_t uaecptr; #undef uae_s64 #undef uae_u64 @@ -451,4 +451,4 @@ extern int console_get (char *, int); #define PRELOAD(ADDR) #endif -#endif \ No newline at end of file +#endif diff --git a/uae4all_gp2x_0.7.2a/src/include/uae.h b/uae4all_gp2x_0.7.2a/src/include/uae.h index a2fd27f..c018f5a 100644 --- a/uae4all_gp2x_0.7.2a/src/include/uae.h +++ b/uae4all_gp2x_0.7.2a/src/include/uae.h @@ -27,7 +27,8 @@ class uae { void reset_all_systems (void); void uae_pause(void); void uae_resume(void); - + void set_joystickactive(void); + public: // state tagUAERunState quit_program; @@ -46,5 +47,6 @@ class uae { extern uae g_emulator; extern "C" void uae_reset(); +extern "C" void set_joystickactive(); #endif \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.cpp b/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.cpp index a7e4e69..86eaf21 100644 --- a/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.cpp +++ b/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.cpp @@ -109,6 +109,16 @@ void CAudioQueueManager::setupQueue() { _isInitialized = true; } +void CAudioQueueManager::setVolume(float volume) { + AudioQueueSetParameter(_queue, kAudioQueueParam_Volume, volume); +} + +float CAudioQueueManager::getVolume() { + float volume; + AudioQueueGetParameter(_queue, kAudioQueueParam_Volume, &volume); + return volume; +} + void CAudioQueueManager::shutdownQueue() { if (_isRunning) { _isRunning = false; diff --git a/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.h b/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.h index 9b10ad4..a1a9bb3 100644 --- a/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.h +++ b/uae4all_gp2x_0.7.2a/src/iphone/AudioQueueManager.h @@ -50,6 +50,9 @@ class CAudioQueueManager { short* getNextBuffer(); void queueBuffer(short* buffer); + float getVolume(); + void setVolume(float volume); + private: static void HandleOutputBuffer (void *aqData, AudioQueueRef inAQ, AudioQueueBufferRef outBuffer); diff --git a/uae4all_gp2x_0.7.2a/src/iphone/CGVector.h b/uae4all_gp2x_0.7.2a/src/iphone/CGVector.h index 97122fb..ef926c0 100755 --- a/uae4all_gp2x_0.7.2a/src/iphone/CGVector.h +++ b/uae4all_gp2x_0.7.2a/src/iphone/CGVector.h @@ -25,7 +25,7 @@ struct CGVector2D { CGFloat x; CGFloat y; - CGVector2D():x(0), y(0) + CGVector2D():x(0), y(0) {} CGVector2D(CGFloat x, CGFloat y):x(x), y(y) diff --git a/uae4all_gp2x_0.7.2a/src/iphone/MMStopWatch.h b/uae4all_gp2x_0.7.2a/src/iphone/MMStopWatch.h index 750aa55..e69de29 100644 --- a/uae4all_gp2x_0.7.2a/src/iphone/MMStopWatch.h +++ b/uae4all_gp2x_0.7.2a/src/iphone/MMStopWatch.h @@ -1,12 +0,0 @@ -/* - * MMStopWatch.h - * iAmiga - * - * Created by Stuart Carnie on 5/29/09. - * Copyright 2009 __MyCompanyName__. All rights reserved. - * - */ - -extern unsigned int SDL_GetTicks(); - -unsigned int GetTicks() { return SDL_GetTicks(); } \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.h b/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.h index 24e657b..8a2c3a5 100644 --- a/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.h +++ b/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.h @@ -10,9 +10,12 @@ #define ROM_PATH_PREFIX extern "C" char* get_rom_path(); +extern "C" char* get_key_path(); +extern "C" unsigned get_chipmem_size(); +extern "C" unsigned get_fastmem_size(); extern "C" char* get_df_path(int drive); extern "C" int getDisplayIsNTSC(); extern "C" void setDisplayIsNTSC(int isNTSC); #import "sysdeps.h" -#import "gui.h" \ No newline at end of file +#import "gui.h" diff --git a/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.mm b/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.mm index b44f1b9..c2791d3 100644 --- a/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.mm +++ b/uae4all_gp2x_0.7.2a/src/iphone/iphone_main.mm @@ -11,6 +11,9 @@ #import "sysconfig.h" #include "iphone_main.h" #include "debug_uae4all.h" +#import "MPCConnectionStates.h" +#import "Settings.h" +#import "EMUBrowser.h" char launchDir[300]; @@ -21,6 +24,13 @@ int mainMenu_autosave=1; int mainMenu_ntsc=0; int drawfinished=0; +int mainMenu_stretchscreen = 0; +int mainMenu_AddVerticalStretchValue=0; +MPCStateType mainMenu_servermode=kConnectionIsOff; +unsigned int mainMenu_joy0dir=0; +int mainMenu_joy0button=0; +unsigned int mainMenu_joy1dir=0; +int mainMenu_joy1button=0; extern int vkbd_mode; @@ -58,7 +68,6 @@ int gui_init() { NSString *documents = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; [documents getCString:launchDir maxLength:sizeof(launchDir) encoding:[NSString defaultCStringEncoding]]; - [[NSFileManager defaultManager] createDirectoryAtPath:[documents stringByAppendingPathComponent:@"saves"] withIntermediateDirectories:YES attributes:nil error:NULL]; return 0; } @@ -78,15 +87,52 @@ void sound_default_evtime(void) { } #endif +unsigned get_chipmem_size() { + Settings *settings = [[[Settings alloc] init] autorelease]; + return settings.CMem * 1024; +} + +unsigned get_fastmem_size() { + Settings *settings = [[[Settings alloc] init] autorelease]; + return settings.FMem * 1024 * 1024; +} + char* get_rom_path() { - NSString *bp = [[NSBundle mainBundle] bundlePath]; - bp = [bp stringByAppendingPathComponent:@"kick13.rom"]; - - static char bundlePath[500]; - - [bp getCString:bundlePath maxLength:sizeof(bundlePath) encoding:[NSString defaultCStringEncoding]]; - - return bundlePath; + + + Settings *settings = [[[Settings alloc] init] autorelease]; + EMUBrowser *browser = [[[EMUBrowser alloc] init] autorelease]; + NSString *romPath = settings.romPath; + + + static char romPathC[500]; + [romPath getCString:romPathC maxLength:sizeof(romPathC) encoding:[NSString defaultCStringEncoding]]; + return romPathC; +} + +NSString* get_key_path(NSString * directory, NSArray *keyNameFilters) { + NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:directory]; + NSArray *relativeFilePaths = [[direnum allObjects] pathsMatchingExtensions:@[@"key"]]; + for (NSString *relativeFilePath in relativeFilePaths) { + if ([keyNameFilters containsObject:[relativeFilePath lastPathComponent]]) { + return [directory stringByAppendingPathComponent:relativeFilePath]; + } + } + return nil; +} + +char* get_key_path() { + NSArray *keynameFilters = @[@"rom.key"]; + NSString *mainBundleDirectory = [[NSBundle mainBundle] bundlePath]; + NSString *keyPath = get_key_path(mainBundleDirectory, keynameFilters); + if (!keyPath) { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *documentsDirectory = [paths objectAtIndex:0]; + keyPath = get_key_path(documentsDirectory, keynameFilters); + } + static char keyPathC[500]; + [keyPath getCString:keyPathC maxLength:sizeof(keyPathC) encoding:[NSString defaultCStringEncoding]]; + return keyPathC; } extern "C" char changed_df[1][256];; @@ -181,4 +227,4 @@ void setDisplayIsNTSC(int isNTSC) { mainMenu_ntsc = isNTSC; } -#endif \ No newline at end of file +#endif diff --git a/uae4all_gp2x_0.7.2a/src/iphone/touchstick.h b/uae4all_gp2x_0.7.2a/src/iphone/touchstick.h index 0c3b7db..f03abb8 100644 --- a/uae4all_gp2x_0.7.2a/src/iphone/touchstick.h +++ b/uae4all_gp2x_0.7.2a/src/iphone/touchstick.h @@ -6,7 +6,7 @@ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + (at your option) asdfasdny later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -19,16 +19,25 @@ #include "touchstick-types.h" -class CJoyStick { +class CJoyStick { + public: - TouchStickDPadState dPadState() { return _dPadState; } - FireButtonState buttonOneState() { return _buttonOneState; } - - void setDPadState(TouchStickDPadState value) { _dPadState = value; } - void setButtonOneState(FireButtonState value) { _buttonOneState = value; } + TouchStickDPadState dPadStateP0(); + FireButtonState buttonOneStateP0(); + void setDPadStateP0(TouchStickDPadState value); + void setButtonOneStateP0(FireButtonState value); + + TouchStickDPadState dPadStateP1(); + FireButtonState buttonOneStateP1(); + + void setDPadStateP1(TouchStickDPadState value); + void setButtonOneStateP1(FireButtonState value); private: - TouchStickDPadState _dPadState; - FireButtonState _buttonOneState; + TouchStickDPadState _dPadStateP0; + FireButtonState _buttonOneStateP0; + TouchStickDPadState _dPadStateP1; + FireButtonState _buttonOneStateP1; + +}; -}; \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/iphone/touchstick.mm b/uae4all_gp2x_0.7.2a/src/iphone/touchstick.mm new file mode 100644 index 0000000..6caf664 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/iphone/touchstick.mm @@ -0,0 +1,21 @@ +// +// touchstick.m +// iUAE +// +// Created by Urs on 21.05.16. +// +// + +#include "touchstick.h" + +TouchStickDPadState CJoyStick::dPadStateP0() { return _dPadStateP0; } +FireButtonState CJoyStick::buttonOneStateP0() { return _buttonOneStateP0; } + +void CJoyStick::setDPadStateP0(TouchStickDPadState value) { _dPadStateP0 = value; } +void CJoyStick::setButtonOneStateP0(FireButtonState value) { _buttonOneStateP0 = value; } + +TouchStickDPadState CJoyStick::dPadStateP1() { return _dPadStateP1; } +FireButtonState CJoyStick::buttonOneStateP1() { return _buttonOneStateP1; } + +void CJoyStick::setDPadStateP1(TouchStickDPadState value) { _dPadStateP1 = value; } +void CJoyStick::setButtonOneStateP1(FireButtonState value) { _buttonOneStateP1 = value; } diff --git a/uae4all_gp2x_0.7.2a/src/keybuf.cpp b/uae4all_gp2x_0.7.2a/src/keybuf.cpp index abb7293..3056012 100644 --- a/uae4all_gp2x_0.7.2a/src/keybuf.cpp +++ b/uae4all_gp2x_0.7.2a/src/keybuf.cpp @@ -21,7 +21,6 @@ #include "options.h" #include "keybuf.h" #include "keyboard.h" -#include "joystick.h" #include "custom.h" static int kpb_first, kpb_last; diff --git a/uae4all_gp2x_0.7.2a/src/linetoscr.h b/uae4all_gp2x_0.7.2a/src/linetoscr.h index b32c614..5bff0e3 100644 --- a/uae4all_gp2x_0.7.2a/src/linetoscr.h +++ b/uae4all_gp2x_0.7.2a/src/linetoscr.h @@ -2,36 +2,49 @@ static __inline__ int LNAME (int spix, int dpix, int stoppos) { /* CASO DUAL */ - unsigned short * __restrict__ buf = ((unsigned short *)xlinebuffer); if (bpldualpf) { - // OCS/ECS Dual playfield + long int * __restrict__ acolors = (long int *)&colors_for_drawing.acolors; + uae_u8* __restrict__ apixels = (uae_u8 *)&pixdata.apixels; + + // OCS/ECS Dual playfield int *lookup = bpldualpfpri ? dblpf_ind2 : dblpf_ind1; - - while (dpix < stoppos) { - register unsigned short d = colors_for_drawing.acolors[lookup[pixdata.apixels[spix]]]; + int n = (stoppos-dpix); + + //center fix mithrendal + dpix = (dpix-VISIBLE_LEFT_BORDER)*2 + VISIBLE_LEFT_BORDER; + while (n--) { + register unsigned short d = acolors[lookup[apixels[spix]]]; buf[dpix++] = d; - spix += SRC_INC; + buf[dpix++] = d; + spix ++; } } else { -#if SRC_INC == 1 -#define COPY_TYPE 1 -#else +#ifdef HDOUBLE #define COPY_TYPE 0 +#else +#define COPY_TYPE 1 #endif #if COPY_TYPE == 0 + + // SGC: optimizations using the __restrict__ keyword long int * __restrict__ acolors = (long int *)&colors_for_drawing.acolors; - uae_u8 * __restrict__ apixels = (uae_u8 *)&pixdata.apixels; + uae_u8* __restrict__ apixels = (uae_u8 *)&pixdata.apixels; int n = (stoppos-dpix); + + //center fix mithrendal + dpix = (dpix-VISIBLE_LEFT_BORDER)*2 + VISIBLE_LEFT_BORDER; while (n--) { - buf[dpix++] = (acolors[apixels[spix]]); - spix += SRC_INC; + register unsigned short val = (acolors[apixels[spix]]); + buf[dpix++] = val; + buf[dpix++] = val; + spix ++; } #elif COPY_TYPE == 1 @@ -41,7 +54,6 @@ static __inline__ int LNAME (int spix, int dpix, int stoppos) // load up 64 pixels into the data cache (we hope) asm volatile("pld [%0]" : : "r" (lpixels)); #endif - int n = (stoppos-dpix); int m = n & 0x3; n >>= 2; @@ -75,4 +87,4 @@ static __inline__ int LNAME (int spix, int dpix, int stoppos) #undef LNAME #undef HDOUBLE #undef SRC_INC -#undef COPY_TYPE \ No newline at end of file +#undef COPY_TYPE diff --git a/uae4all_gp2x_0.7.2a/src/m68k/fame/fame.h b/uae4all_gp2x_0.7.2a/src/m68k/fame/fame.h index 12f3d6c..8db0e52 100644 --- a/uae4all_gp2x_0.7.2a/src/m68k/fame/fame.h +++ b/uae4all_gp2x_0.7.2a/src/m68k/fame/fame.h @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmacro-redefined" + /*****************************************************************************/ /* FAME Fast and Accurate Motorola 68000 Emulation Core */ /* (c) 2005 Oscar Orallo Pelaez */ @@ -9,184 +12,206 @@ #ifndef __FAME_H__ #define __FAME_H__ -#ifdef __cplusplus -extern "C" { -#endif - +#define likely(x) __builtin_expect((x),1) +#define unlikely(x) __builtin_expect((x),0) +#define UAE4ALL_ALIGN __attribute__ ((__aligned__ (16))) /************************************/ /* General library defines */ /************************************/ #ifndef M68K_OK - #define M68K_OK 0 +#define M68K_OK 0 #endif #ifndef M68K_RUNNING - #define M68K_RUNNING 1 +#define M68K_RUNNING 1 #endif #ifndef M68K_NO_SUP_ADDR_SPACE - #define M68K_NO_SUP_ADDR_SPACE 2 +#define M68K_NO_SUP_ADDR_SPACE 2 #endif #ifndef M68K_DOUBLE_BUS_FAULT - #define M68K_DOUBLE_BUS_FAULT -1 +#define M68K_DOUBLE_BUS_FAULT -1 #endif #ifndef M68K_INV_REG - #define M68K_INV_REG -1 +#define M68K_INV_REG -1 #endif /* Hardware interrupt state */ #ifndef M68K_IRQ_LEVEL_ERROR - #define M68K_IRQ_LEVEL_ERROR -1 +#define M68K_IRQ_LEVEL_ERROR -1 #endif #ifndef M68K_IRQ_INV_PARAMS - #define M68K_IRQ_INV_PARAMS -2 +#define M68K_IRQ_INV_PARAMS -2 #endif /* Defines to specify hardware interrupt type */ #ifndef M68K_AUTOVECTORED_IRQ - #define M68K_AUTOVECTORED_IRQ -1 +#define M68K_AUTOVECTORED_IRQ -1 #endif #ifndef M68K_SPURIOUS_IRQ - #define M68K_SPURIOUS_IRQ -2 +#define M68K_SPURIOUS_IRQ -2 #endif #ifndef M68K_AUTO_LOWER_IRQ - #define M68K_AUTO_LOWER_IRQ 1 +#define M68K_AUTO_LOWER_IRQ 1 #endif #ifndef M68K_MANUAL_LOWER_IRQ - #define M68K_MANUAL_LOWER_IRQ 0 +#define M68K_MANUAL_LOWER_IRQ 0 #endif /* Defines to specify address space */ #ifndef M68K_SUP_ADDR_SPACE - #define M68K_SUP_ADDR_SPACE 0 +#define M68K_SUP_ADDR_SPACE 0 #endif #ifndef M68K_USER_ADDR_SPACE - #define M68K_USER_ADDR_SPACE 2 +#define M68K_USER_ADDR_SPACE 2 #endif #ifndef M68K_PROG_ADDR_SPACE - #define M68K_PROG_ADDR_SPACE 0 +#define M68K_PROG_ADDR_SPACE 0 #endif #ifndef M68K_DATA_ADDR_SPACE - #define M68K_DATA_ADDR_SPACE 1 +#define M68K_DATA_ADDR_SPACE 1 #endif /*******************/ /* Data definition */ /*******************/ +#ifdef u8 +#undef u8 +#endif + +#ifdef s8 +#undef s8 +#endif + +#ifdef u16 +#undef u16 +#endif + +#ifdef s16 +#undef s16 +#endif + +#ifdef u32 +#undef u32 +#endif + +#ifdef s32 +#undef s32 +#endif + +#define u8 unsigned char +#define s8 signed char +#define u16 unsigned short +#define s16 signed short +#define u32 unsigned int +#define s32 signed int + +#define u64 unsigned long long +#define s64 long long + /* M68K registers */ typedef enum { - M68K_REG_D0=0, - M68K_REG_D1, - M68K_REG_D2, - M68K_REG_D3, - M68K_REG_D4, - M68K_REG_D5, - M68K_REG_D6, - M68K_REG_D7, - M68K_REG_A0, - M68K_REG_A1, - M68K_REG_A2, - M68K_REG_A3, - M68K_REG_A4, - M68K_REG_A5, - M68K_REG_A6, - M68K_REG_A7, - M68K_REG_ASP, - M68K_REG_PC, - M68K_REG_SR + M68K_REG_D0=0, + M68K_REG_D1, + M68K_REG_D2, + M68K_REG_D3, + M68K_REG_D4, + M68K_REG_D5, + M68K_REG_D6, + M68K_REG_D7, + M68K_REG_A0, + M68K_REG_A1, + M68K_REG_A2, + M68K_REG_A3, + M68K_REG_A4, + M68K_REG_A5, + M68K_REG_A6, + M68K_REG_A7, + M68K_REG_USP, + M68K_REG_PC, + M68K_REG_SR } m68k_register; -/* The memory blocks must be in native (Motorola) format */ -struct M68K_PROGRAM { - unsigned low_addr; - unsigned high_addr; - unsigned offset; -}; - -/* The memory blocks must be in native (Motorola) format */ -struct M68K_DATA { - unsigned low_addr; - unsigned high_addr; - void *mem_handler; - void *data; -}; +typedef union +{ + u8 B; + s8 SB; + u16 W; + s16 SW; + u32 D; + s32 SD; +} famec_union32; + /* M68K CPU CONTEXT */ -struct M68K_CONTEXT { - struct M68K_PROGRAM *fetch; - struct M68K_DATA *read_byte; - struct M68K_DATA *read_word; - struct M68K_DATA *write_byte; - struct M68K_DATA *write_word; - struct M68K_PROGRAM *sv_fetch; - struct M68K_DATA *sv_read_byte; - - struct M68K_DATA *sv_read_word; - struct M68K_DATA *sv_write_byte; - struct M68K_DATA *sv_write_word; - struct M68K_PROGRAM *user_fetch; - struct M68K_DATA *user_read_byte; - struct M68K_DATA *user_read_word; - struct M68K_DATA *user_write_byte; - struct M68K_DATA *user_write_word; - void (*reset_handler)(void); - void (*iack_handler)(unsigned level); - unsigned * icust_handler; - unsigned dreg[8]; - unsigned areg[8]; - unsigned asp; - unsigned pc; - unsigned cycles_counter; - unsigned char interrupts[8]; - unsigned short sr; - unsigned short execinfo; -}; +typedef struct +{ + famec_union32 dreg[8]; + famec_union32 areg[8]; + uintptr_t *icust_handler; + u32 usp; + uintptr_t pc; + u32 cycles_counter; + u8 interrupts[8]; + u16 sr; + u16 execinfo; + u32 vbr, sfc, dfc; /* Control Registers, 68010+ */ + u32 cacr, caar; /* Control Registers, 68020+ */ + u32 msp, isp; /* Master/Interrupt Stack Pointer */ + // We put everything what is needed for m68k_emulate and the opcodes in this + // struct, so there is only one base register in generated assembly code. + // This reduces the number of used and backed up register and we have better performance. + u32 flag_c; + u32 flag_v; + u32 flag_notz; + u32 flag_n; + u32 flag_x; + u32 flag_s; + u32 flag_i; + u32 flag_m; + u32 flag_t; + u16 *_pc; + uintptr_t basepc; + uintptr_t fetch[256]; + s32 more_cycles_to_do; + s32 cycles_not_done; + s32 io_cycle_counter; +} M68K_CONTEXT; /************************/ /* Function definition */ /************************/ - -/* General purpose functions */ -void m68k_init(void); -unsigned m68k_reset(void); -unsigned m68k_emulate(int n); -unsigned m68k_get_pc(void); -unsigned m68k_get_cpu_state(void); -int m68k_fetch(unsigned address, unsigned memory_space); - -/* Interrupt handling functions */ -int m68k_raise_irq(int level, int vector); -int m68k_lower_irq(int level); -void m68k_burst_irq(int mask, int vector); -void m68k_set_irq_type(void *context, int type); -int m68k_get_irq_vector(int level); -int m68k_change_irq_vector(int level, int vector); - -/* CPU context handling functions */ -int m68k_get_context_size(void); -void m68k_get_context(void *context); -void m68k_set_context(void *context); -int m68k_get_register(m68k_register reg); -int m68k_set_register(m68k_register reg, unsigned value); - -/* Timing functions */ -unsigned m68k_get_cycles_counter(void); -unsigned m68k_trip_cycles_counter(void); -unsigned m68k_control_cycles_counter(int n); -void m68k_release_timeslice(void); -void m68k_add_cycles(int cycles); -void m68k_release_cycles(int cycles); - - +#ifdef __cplusplus +extern "C" { +#endif + + /* General purpose functions */ + void m68k_init(int force_table); + unsigned m68k_reset(void); + unsigned m68k_emulate(int n); + uintptr_t m68k_get_pc(void); + int m68k_fetch(unsigned address); + + /* CPU context handling functions */ + M68K_CONTEXT *m68k_get_context(void); + void famec_SetBank(u32 low_addr, u32 high_addr, uintptr_t fetch, void *rb, void *rw, void *wb, void *ww, void *data); + int m68k_set_register(m68k_register reg, unsigned value); + + /* Timing functions */ + void m68k_release_timeslice(void); + + #ifdef __cplusplus } #endif #endif + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.cpp b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.cpp index 97fee2f..5dc8a09 100644 --- a/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.cpp +++ b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.cpp @@ -10,73 +10,21 @@ #include #include #include -#include "sysconfig.h" +#include "fame.h" +#include "config.h" +/* Just 0x0 and not 680x0, so that constants can fit in ARM instructions */ +#define M68000 000 +#define M68020 020 -#ifdef USE_FAME_CORE_C - -#pragma mark - -#pragma mark debug routines - -#define NO_BREAKPOINTS 1 - -#if DISASSEMBLER || defined(DEBUG_CPU) - -int do_disa = 0; -int do_debug = 0; -int disa_step = 0; -int instruction_cycles; - -#if NO_BREAKPOINTS -#define CHECK_BREAKPOINTS -#else -#define CHECK_BREAKPOINTS check_breakpoints(); -#endif - -#define STORE_COUNTER instruction_cycles = io_cycle_counter; -#define INSTRUCTION_CYCLES (instruction_cycles - (io_cycle_counter+cycles_needed)) - -#else - -#define CHECK_BREAKPOINTS -#define STORE_COUNTER - -#endif - -#ifdef DEBUG_CPU - - -#define insdebug(CYC) \ -if (do_debug) \ - printf("%05i|%03i: %06x: OP_%04x (%02i) r=%08x|irq=%02i %s: \n",m68kcontext.cycles_counter,io_cycle_counter+cycles_needed,(u32)PC - BasePC,Opcode,io_cycles_before - io_cycle_counter,res, ((m68kcontext.sr>>8) & 7), __FUNCTION__) - -#else -#define insdebug(CYC) -#endif - - -#pragma mark - -#pragma mark options // Options // -#define FAMEC_ROLL_INLINE -#define FAMEC_EMULATE_TRACE -#define FAMEC_IRQ_CYCLES -#define FAMEC_CHECK_BRANCHES -#define FAMEC_USE_DATA_BANKS //#define FAMEC_EXTRA_INLINE // #define FAMEC_DEBUG -#define FAMEC_NO_GOTOS #define FAMEC_ADR_BITS 24 #define FAMEC_FETCHBITS 8 #define FAMEC_DATABITS 8 -// -O0 -fdefer-pop -fguess-branch-probability -fcprop-registers -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-ter -ftree-lrs -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time -fmerge-constants -fstrict-aliasing -falign-jumps -fif-conversion2 -fif-conversion - -// #define USE_CYCLONE_TIMING -// #define USE_CYCLONE_TIMING_DIV -// Options // - #undef INLINE #ifndef INLINE @@ -84,117 +32,24 @@ if (do_debug) \ #endif #ifndef FAMEC_EXTRA_INLINE -#define FAMEC_EXTRA_INLINE +#define FAMEC_EXTRA_INLINE /*__inline__*/ #else +#undef FAMEC_EXTRA_INLINE #define FAMEC_EXTRA_INLINE INLINE #endif -#ifdef u8 -#undef u8 -#endif - -#ifdef s8 -#undef s8 -#endif - -#ifdef u16 -#undef u16 -#endif - -#ifdef s16 -#undef s16 -#endif - -#ifdef u32 -#undef u32 -#endif - -#ifdef s32 -#undef s32 -#endif - -#define u8 unsigned char -#define s8 signed char -#define u16 unsigned short -#define s16 signed short -#define u32 unsigned int -#define s32 signed int - -/* -typedef unsigned char u8; -typedef signed char s8; -typedef unsigned short u16; -typedef signed short s16; -typedef unsigned int u32; -typedef signed int s32; -*/ - -#ifdef FAMEC_EMULATE_TRACE -static u32 flag_T; -#endif -static u32 flag_C; -static u32 flag_V; -static u32 flag_NotZ; -static u32 flag_N; -static u32 flag_X; // 16 bytes aligned -static u32 flag_S; -static u32 flag_I; - -#ifndef M68K_OK - #define M68K_OK 0 -#endif - -#ifndef M68K_RUNNING - #define M68K_RUNNING 1 -#endif - -#ifndef M68K_NO_SUP_ADDR_SPACE - #define M68K_NO_SUP_ADDR_SPACE 2 -#endif - -#ifndef M68K_INV_REG - #define M68K_INV_REG -1 -#endif - -/* Hardware interrupt state */ - -#ifndef M68K_IRQ_LEVEL_ERROR - #define M68K_IRQ_LEVEL_ERROR -1 -#endif - -#ifndef M68K_IRQ_INV_PARAMS - #define M68K_IRQ_INV_PARAMS -2 -#endif - -/* Defines to specify hardware interrupt type */ - -#ifndef M68K_AUTOVECTORED_IRQ - #define M68K_AUTOVECTORED_IRQ -1 -#endif - -#ifndef M68K_SPURIOUS_IRQ - #define M68K_SPURIOUS_IRQ -2 -#endif -/* Defines to specify address space */ +#define UVAL64(a) (a ## uLL) -#ifndef M68K_SUP_ADDR_SPACE - #define M68K_SUP_ADDR_SPACE 0 -#endif - -#ifndef M68K_USER_ADDR_SPACE - #define M68K_USER_ADDR_SPACE 2 -#endif - -#ifndef M68K_PROG_ADDR_SPACE - #define M68K_PROG_ADDR_SPACE 0 -#endif - -#ifndef M68K_DATA_ADDR_SPACE - #define M68K_DATA_ADDR_SPACE 1 -#endif +// Return codes +#define M68K_OK 0 +#define M68K_RUNNING 1 +#define M68K_NO_SUP_ADDR_SPACE 2 +#define M68K_INV_REG -1 +extern int prefs_cpu_model; +extern int mainMenu_CPU_speed; /******************************/ /* 68K core types definitions */ @@ -219,6 +74,7 @@ static u32 flag_I; #define M68K_SR_N_SFT 7 #define M68K_SR_X_SFT 8 +#define M68K_SR_M_SFT 12 #define M68K_SR_S_SFT 13 #define M68K_SR_T_SFT 15 @@ -228,16 +84,13 @@ static u32 flag_I; #define M68K_SR_N (1 << M68K_SR_N_SFT) #define M68K_SR_X (1 << M68K_SR_X_SFT) +#define M68K_SR_M (1 << M68K_SR_M_SFT) #define M68K_SR_S (1 << M68K_SR_S_SFT) #define M68K_SR_T (1 << M68K_SR_T_SFT) #define M68K_CCR_MASK 0x1F -#ifdef FAMEC_EMULATE_TRACE -#define M68K_SR_MASK (M68K_SR_T | M68K_SR_S | 0x0700 | M68K_CCR_MASK) -#else -#define M68K_SR_MASK (M68K_SR_S | 0x0700 | M68K_CCR_MASK) -#endif +#define M68K_SR_MASK (M68K_SR_T | M68K_SR_S | M68K_SR_M | 0x0700 | M68K_CCR_MASK) // exception defines taken from musashi core #define M68K_RESET_EX 1 @@ -264,106 +117,6 @@ static u32 flag_I; #define M68K_WAITING 0x04 #define M68K_DISABLE 0x20 #define M68K_FAULTED 0x40 -#define M68K_EMULATE_GROUP_0 0x02 -#define M68K_EMULATE_TRACE 0x08 -#define M68K_DO_TRACE 0x10 - -typedef union -{ - u8 B; - s8 SB; -} famec_union8; - -typedef union -{ - u8 B; - s8 SB; - u16 W; - s16 SW; -} famec_union16; - -typedef union -{ - u8 B; - s8 SB; - u16 W; - s16 SW; - u32 D; - s32 SD; -} famec_union32; - - -/* M68K registers */ -typedef enum -{ - M68K_REG_D0=0, - M68K_REG_D1, - M68K_REG_D2, - M68K_REG_D3, - M68K_REG_D4, - M68K_REG_D5, - M68K_REG_D6, - M68K_REG_D7, - M68K_REG_A0, - M68K_REG_A1, - M68K_REG_A2, - M68K_REG_A3, - M68K_REG_A4, - M68K_REG_A5, - M68K_REG_A6, - M68K_REG_A7, - M68K_REG_ASP, - M68K_REG_PC, - M68K_REG_SR -} m68k_register; - - -/* The memory blocks must be in native (Motorola) format */ -typedef struct -{ - u32 low_addr; - u32 high_addr; - u32 offset; -} M68K_PROGRAM; - -/* The memory blocks must be in native (Motorola) format */ -typedef struct -{ - u32 low_addr; - u32 high_addr; - void *mem_handler; - void *data; -} M68K_DATA; - -/* M68K CPU CONTEXT */ -typedef struct { - M68K_PROGRAM *fetch; - M68K_DATA *read_byte; - M68K_DATA *read_word; - M68K_DATA *write_byte; - M68K_DATA *write_word; - M68K_PROGRAM *sv_fetch; - M68K_DATA *sv_read_byte; - M68K_DATA *sv_read_word; - M68K_DATA *sv_write_byte; - M68K_DATA *sv_write_word; - M68K_PROGRAM *user_fetch; - M68K_DATA *user_read_byte; - M68K_DATA *user_read_word; - M68K_DATA *user_write_byte; - M68K_DATA *user_write_word; - void (*reset_handler)(void); - void (*iack_handler)(u32 level); - u32 *icust_handler; - famec_union32 dreg[8]; - famec_union32 areg[8]; - u32 asp; - u32 pc; - u32 cycles_counter; - u8 interrupts[8]; - u16 sr; - u16 execinfo; -} M68K_CONTEXT; // internals core macros @@ -383,7 +136,66 @@ typedef struct { #define AREGu16(X) (m68kcontext.areg[(X)].W) #define AREGs16(X) (m68kcontext.areg[(X)].SW) -#define ASP (m68kcontext.asp) +#define USP (m68kcontext.usp) +#define MSP (m68kcontext.msp) +#define ISP (m68kcontext.isp) + + +/* Main CPU context */ +M68K_CONTEXT m68kcontext; + +#define flag_C m68kcontext.flag_c +#define flag_V m68kcontext.flag_v +#define flag_NotZ m68kcontext.flag_notz +#define flag_N m68kcontext.flag_n +#define flag_X m68kcontext.flag_x +#define flag_S m68kcontext.flag_s +#define flag_I m68kcontext.flag_i +#define flag_M m68kcontext.flag_m +#define flag_T m68kcontext.flag_t +#define PC m68kcontext._pc +#define BasePC m68kcontext.basepc +#define Fetch m68kcontext.fetch + + +#define UPDATE_SP_000 \ +{ \ +if (oldS != flag_S) { \ +if (oldS) { \ +ISP = AREG(7); \ +AREG(7) = USP; \ +} else { \ +USP = AREG(7); \ +AREG(7) = ISP; \ +} \ +} \ +} + + +#define UPDATE_SP_020 \ +{ \ +if (oldS != flag_S) { \ +if (oldS) { \ +if (oldM) \ +MSP = AREG(7); \ +else \ +ISP = AREG(7); \ +AREG(7) = USP; \ +} else { \ +USP = AREG(7); \ +AREG(7) = flag_M ? MSP : ISP; \ +} \ +} else if ((oldS && oldM) != flag_M) { \ +if (oldM) { \ +MSP = AREG(7); \ +AREG(7) = ISP; \ +} else { \ +ISP = AREG(7); \ +AREG(7) = MSP; \ +} \ +} \ +} + #define LSL(A, C) ((A) << (C)) #define LSR(A, C) ((A) >> (C)) @@ -405,344 +217,129 @@ typedef struct { #define ROR_32(A, C) (LSR_32(A, C) | LSL_32(A, 32-(C))) #define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C))) -#ifndef FAMEC_NO_GOTOS -#define NEXT \ - FETCH_WORD(Opcode); \ - goto *JumpTable[Opcode]; - -#ifdef FAMEC_ROLL_INLINE -#define RET(A) \ - io_cycle_counter -= (A); \ - if (io_cycle_counter <= 0) goto famec_Exec_End; \ - NEXT -#else -#define RET(A) \ - io_cycle_counter -= (A); \ - if (io_cycle_counter <= 0) goto famec_Exec_End; \ - goto famec_Exec; -#endif - -#else - -#define NEXT \ - do{ \ - CHECK_BREAKPOINTS; \ - DISA_STEP(); \ - FETCH_WORD(Opcode); \ - STORE_COUNTER; \ - JumpTable[Opcode](); \ - DISA_POST_STEP(); \ - }while(io_cycle_counter>0); #define RET(A) \ - io_cycle_counter -= (A); \ - insdebug(A); \ - return; - -#endif +return (A); #define M68K_PPL (m68kcontext.sr >> 8) & 7 #define GET_PC \ - (u32)PC - BasePC; +(uintptr_t) PC - (uintptr_t) BasePC; #define SET_PC(A) \ - BasePC = Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \ - /* BasePC -= (A) & 0xFF000000; */ \ - PC = (u16*)(((A) & M68K_ADR_MASK) + BasePC); - -#define SET_PC_BASE(P,B,A) \ - (B) = Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \ - /* (B) -= (A) & 0xFF000000; */ \ - (P) = (u16*)(((A) & M68K_ADR_MASK) + (B)); - - -#define PRE_IO \ -// io_cycle_counter = CCnt; +BasePC = Fetch[((A) >> M68K_FETCHSFT) & M68K_FETCHMASK]; \ +PC = (u16*)(((A) & M68K_ADR_MASK) + BasePC); -#define POST_IO \ -// CCnt = io_cycle_counter; +#define READ_BYTE_F(A, D) \ +D = Read_Byte(A) /*& 0xFF*/; -#ifndef FAME_BIG_ENDIAN +#define READ_WORD_F(A, D) \ +D = Read_Word(A) /*& 0xFFFF*/; - #define READ_BYTE_F(A, D) \ - D = Read_Byte(A) & 0xFF; +#define READ_LONG_F(A, D) \ +D = Read_Long((A)); - #define READ_WORD_F(A, D) \ - D = Read_Word(A) & 0xFFFF; +#define READ_LONG_DEC_F(A, D) \ +D = Read_Long((A)); - #define READ_LONG_F(A, D) \ - D = Read_Word((A)) << 16; \ - D |= Read_Word((A) + 2) & 0xFFFF; +#define READSX_LONG_F(A, D) \ +D = Read_Long((A)); - #define READ_LONG_DEC_F(A, D) \ - D = Read_Word((A) + 2) & 0xFFFF; \ - D |= Read_Word((A)) << 16; +#define READSX_LONG_DEC_F(A, D) \ +D = Read_Long((A)); - #define READSX_LONG_F(A, D) \ - D = Read_Word((A)) << 16; \ - D |= Read_Word((A) + 2) & 0xFFFF; +#define POP_32_F(D) \ +D = Read_Long(AREG(7)); \ +AREG(7) += 4; - #define READSX_LONG_DEC_F(A, D) \ - D |= Read_Word((A)) << 16; \ - D = Read_Word((A) + 2) & 0xFFFF; +#define WRITE_LONG_F(A, D) \ +Write_Long((A), (D)); - #define WRITE_LONG_F(A, D) \ - Write_Word((A), (D) >> 16); \ - Write_Word((A) + 2, (D) & 0xFFFF); +#define WRITE_LONG_DEC_F(A, D) \ +Write_Long((A), (D)); - #define WRITE_LONG_DEC_F(A, D) \ - Write_Word((A), (D) >> 16); \ - Write_Word((A) + 2, (D) & 0xFFFF); +#define PUSH_32_F(D) \ +AREG(7) -= 4; \ +Write_Long(AREG(7), (D)); - #define FETCH_LONG(A) \ - (A) = PC[1] | (PC[0] << 16); \ - PC += 2; - #define PUSH_32_F(D) \ - AREG(7) -= 4; \ - Write_Word(AREG(7), (D) >> 16); \ - Write_Word(AREG(7) + 2, (D) & 0xFFFF); +#define GET_SWORD \ +(s32)(s16)(*PC) - #define POP_32_F(D) \ - D = Read_Word(AREG(7)) << 16; \ - D |= Read_Word(AREG(7) + 2) & 0xFFFF; \ - AREG(7) += 4; - - #define GET_SWORD \ - (s16)(*PC) - - #define FETCH_BYTE(A) \ - (A) = (*PC++) & 0xFF; - - #define FETCH_SBYTE(A) \ - (A) = (s8)((*PC++) & 0xFF); - - #define FETCH_WORD(A) \ - (A) = *PC++; - - #define FETCH_SWORD(A) \ - (A) = (s16)(*PC++); - - #define DECODE_EXT_WORD \ - { \ - u32 ext; \ - \ - ext = *PC++; \ - \ - adr += (s8)(ext); \ - if (ext & 0x0800) adr += DREGs32(ext >> 12); \ - else adr += DREGs16(ext >> 12); \ - } +#define GET_SLONG \ +(s32)(((u32)(*PC) << 16) | (*(PC + 1) /*& 0xFFFF*/)); +#ifndef USE_ARMV7 +#define FETCH_LONG(A) \ +(A) = PC[1] | (PC[0] << 16); \ +PC += 2; #else +#define FETCH_LONG(A) \ +asm volatile ("ldr %[erg], [%[adr]], #4 \n\t" \ +"ror %[erg], %[erg], #16 \n\t" \ +: [erg] "=r" (A), [adr] "+r" (PC) ); +#endif - #define READ_BYTE_F(A, D) \ - D = Read_Byte(A) & 0xFF; - - #define READ_WORD_F(A, D) \ - D = Read_Word(A) & 0xFFFF; - - #define READ_LONG_F(A, D) \ - D = Read_Word((A)) & 0xFFFF; \ - D |= Read_Word((A) + 2) << 16; - - #define READ_LONG_DEC_F(A, D) \ - D = Read_Word((A)) & 0xFFFF; \ - D |= Read_Word((A) + 2) << 16; - - #define READSX_LONG_F(A, D) \ - D = Read_Word((A)) & 0xFFFF; \ - D |= Read_Word((A) + 2) << 16; - - #define READSX_LONG_DEC_F(A, D) \ - D = Read_Word((A) + 2) << 16; \ - D |= Read_Word((A)) & 0xFFFF; - - #define WRITE_LONG_F(A, D) \ - Write_Word((A), (D) & 0xFFFF); \ - Write_Word((A) + 2, (D) >> 16); - - #define WRITE_LONG_DEC_F(A, D) \ - Write_Word((A) + 2, (D) >> 16); \ - Write_Word((A), (D) & 0xFFFF); - - #define FETCH_LONG(A) \ - (A) = PC[0] | (PC[1] << 16); \ - PC += 2; - - #define PUSH_32_F(D) \ - AREG(7) -= 4; \ - Write_Word(AREG(7), (D) & 0xFFFF); \ - Write_Word(AREG(7) + 2, (D) >> 16); - - #define POP_32_F(D) \ - D = Read_Word(AREG(7)) & 0xFFFF; \ - D |= Read_Word(AREG(7) + 2) << 16; \ - AREG(7) += 4; - - #define GET_SWORD \ - ((s16)(((*PC & 0xFF) << 8) | (*PC >> 8))) - - #define FETCH_BYTE(A) \ - (A) = (*PC++) >> 8; - - #define FETCH_SBYTE(A) \ - (A) = (s8)((*PC++) >> 8); - - #define FETCH_WORD(A) \ - (A) = ((*PC & 0xFF) << 8) | (*PC >> 8); \ - PC++; - - #define FETCH_SWORD(A) \ - (A) = (s16)(((*PC & 0xFF) << 8) | (*PC >> 8)); \ - PC++; +#define FETCH_BYTE(A) \ +(A) = (*PC++) & 0xFF; - #define DECODE_EXT_WORD \ - { \ - u32 ext; \ - \ - ext = *PC++; \ - \ - adr += (s8)(ext >> 8); \ - if (ext & 0x0008) adr += DREGs32((ext >> 4) & 0x000F); \ - else adr += DREGs16((ext >> 4) & 0x000F); \ - } +#define FETCH_WORD(A) \ +(A) = *PC++; -#endif +#define FETCH_SWORD(A) \ +(A) = (s32)(s16)(*PC++); -#define READSX_BYTE_F(A, D) \ - D = (s8)Read_Byte(A); #define READSX_WORD_F(A, D) \ - D = (s16)Read_Word(A); - +D = (s16)Read_Word(A); + #define WRITE_BYTE_F(A, D) \ - Write_Byte(A, D); +Write_Byte(A, D); #define WRITE_WORD_F(A, D) \ - Write_Word(A, D); +Write_Word(A, D); #define PUSH_16_F(D) \ - Write_Word(AREG(7) -= 2, D); \ +Write_Word(AREG(7) -= 2, D); \ #define POP_16_F(D) \ - D = (u16)Read_Word(AREG(7)); \ - AREG(7) += 2; +D = (u16)Read_Word(AREG(7)); \ +AREG(7) += 2; #define GET_CCR \ - (((flag_C >> (M68K_SR_C_SFT - 0)) & 1) | \ - ((flag_V >> (M68K_SR_V_SFT - 1)) & 2) | \ - (((!flag_NotZ) & 1) << 2) | \ - ((flag_N >> (M68K_SR_N_SFT - 3)) & 8) | \ - ((flag_X >> (M68K_SR_X_SFT - 4)) & 0x10)) +(((flag_C >> (M68K_SR_C_SFT - 0)) & 1) | \ +((flag_V >> (M68K_SR_V_SFT - 1)) & 2) | \ +(((!flag_NotZ) & 1) << 2) | \ +((flag_N >> (M68K_SR_N_SFT - 3)) & 8) | \ +((flag_X >> (M68K_SR_X_SFT - 4)) & 0x10)) -#ifdef FAMEC_EMULATE_TRACE -#define GET_SR \ - ((flag_S << 0) | \ - (flag_I << 8) | \ - (flag_T ) | \ - GET_CCR) -#else #define GET_SR \ - ((flag_S << 0) | \ - (flag_I << 8) | \ - GET_CCR) -#endif +((flag_S << 0) | \ +(flag_I << 8) | \ +(prefs_cpu_model >= M68020 ? (flag_M << 12) : 0) | \ +(flag_T ) | \ +GET_CCR) #define SET_CCR(A) \ - flag_C = (A) << (M68K_SR_C_SFT - 0); \ - flag_V = (A) << (M68K_SR_V_SFT - 1); \ - flag_NotZ = ~(A) & 4; \ - flag_N = (A) << (M68K_SR_N_SFT - 3); \ - flag_X = (A) << (M68K_SR_X_SFT - 4); - - -#ifdef FAMEC_EMULATE_TRACE -#define SET_SR(A) \ - SET_CCR(A) \ - flag_T = (A) & M68K_SR_T; \ - flag_S = (A) & M68K_SR_S; \ - flag_I = ((A) >> 8) & 7; -#else -#define SET_SR(A) \ - SET_CCR(A) \ - flag_S = (A) & M68K_SR_S; \ - flag_I = ((A) >> 8) & 7; -#endif +flag_C = (A) << (M68K_SR_C_SFT - 0); \ +flag_V = (A) << (M68K_SR_V_SFT - 1); \ +flag_NotZ = ~(A) & 4; \ +flag_N = (A) << (M68K_SR_N_SFT - 3); \ +flag_X = (A) << (M68K_SR_X_SFT - 4); -#define CHECK_INT_TO_JUMP(CLK) \ - if (interrupt_chk__()) \ - { \ - cycles_needed=io_cycle_counter-(CLK); \ - io_cycle_counter= (CLK); \ - } - - -#ifdef FAMEC_CHECK_BRANCHES - -#ifdef FAMEC_NO_GOTOS -#define CHECK_BRANCH_EXCEPTION_GOTO_END io_cycle_counter=0; return; -#else -#define CHECK_BRANCH_EXCEPTION_GOTO_END goto famec_Exec_End; -#endif - -#define CHECK_BRANCH_EXCEPTION(_PC_) \ - if ((_PC_)&1) \ - { \ - u32 pr_PC=GET_PC; \ - m68kcontext.execinfo |= M68K_EMULATE_GROUP_0; \ - execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \ - CHECK_BRANCH_EXCEPTION_GOTO_END \ - } -#else -#define CHECK_BRANCH_EXCEPTION(_PC_) -#endif +#define SET_SR(A) \ +SET_CCR(A) \ +flag_T = (A) & M68K_SR_T; \ +flag_S = (A) & M68K_SR_S; \ +flag_I = ((A) >> 8) & 7; \ +flag_M = (prefs_cpu_model >= M68020 ? (A) & M68K_SR_M : 0); -#ifdef __cplusplus -extern "C" { -#endif - -/* General purpose functions */ -void m68k_init(void); -u32 m68k_reset(void); -u32 m68k_emulate(s32 n); -u32 m68k_get_pc(void); -u32 m68k_get_cpu_state(void); -s32 m68k_fetch(u32 address, u32 memory_space); - -/* Interrupt handling functions */ -s32 m68k_raise_irq(s32 level, s32 vector); -s32 m68k_lower_irq(s32 level); -void m68k_burst_irq(s32 mask, s32 vector); -void m68k_set_irq_type(void *context, s32 type); -s32 m68k_get_irq_vector(s32 level); -s32 m68k_change_irq_vector(s32 level, s32 vector); - -/* CPU context handling functions */ -s32 m68k_get_context_size(void); -void m68k_get_context(void *context); -void m68k_set_context(void *context); -s32 m68k_get_register(m68k_register reg); -s32 m68k_set_register(m68k_register reg, u32 value); - -/* Timing functions */ -u32 m68k_get_cycles_counter(void); -u32 m68k_trip_cycles_counter(void); -u32 m68k_control_cycles_counter(s32 n); -void m68k_release_timeslice(void); -void m68k_add_cycles(s32 cycles); -void m68k_release_cycles(s32 cycles); - - -#ifdef __cplusplus -} -#endif +#define CHECK_INT_TO_JUMP(CLK) m68kcontext.more_cycles_to_do=m68kcontext.io_cycle_counter; m68kcontext.io_cycle_counter=0; +#define BANKEND_TAG ((u32)-1) -static void init_jump_table(void); /* Custom function handler */ typedef void (*icust_handler_func)(u32 vector); @@ -750,121 +347,94 @@ typedef void (*icust_handler_func)(u32 vector); // global variable /////////////////// -/* Main CPU context */ - -/* static */ M68K_CONTEXT m68kcontext __attribute__((aligned(32))); -/* static */ s32 io_cycle_counter; -u32 Opcode;// asm("r8"); +void *mem_handlerRB[M68K_DATABANK]; +void *mem_handlerRW[M68K_DATABANK]; +void *mem_handlerWB[M68K_DATABANK]; +void *mem_handlerWW[M68K_DATABANK]; +void *mem_data[M68K_DATABANK]; -static s32 cycles_needed=0; -static u16 *PC;// asm("r8"); -static u32 BasePC; -static u32 Fetch[M68K_FETCHBANK]; - -#ifdef FAMEC_USE_DATA_BANKS -typedef struct -{ - void *mem_handler; - void *data; -} M68K_INTERNAL_DATA; - -static M68K_INTERNAL_DATA DataRB[M68K_DATABANK]; -static M68K_INTERNAL_DATA DataRW[M68K_DATABANK]; -static M68K_INTERNAL_DATA DataWB[M68K_DATABANK]; -static M68K_INTERNAL_DATA DataWW[M68K_DATABANK]; -#else -#define DataRB m68kcontext.read_byte -#define DataRW m68kcontext.read_word -#define DataWB m68kcontext.write_byte -#define DataWW m68kcontext.write_word -#endif /* Custom function handler */ -#ifdef FAMEC_NO_GOTOS -typedef void (*opcode_func)(void); -#else -typedef const void* opcode_func; -#endif - -static opcode_func JumpTable[0x10000]; +typedef int (*opcode_func)(const u32 opcode, M68K_CONTEXT &m68kcontext); +static opcode_func JumpTable[0x10000] UAE4ALL_ALIGN; static u32 initialised = 0; // exception cycle table (taken from musashi core) static const s32 exception_cycle_table[256] = { - 4, // 0: Reset - Initial Stack Pointer - 4, // 1: Reset - Initial Program Counter - 50, // 2: Bus Error - 50, // 3: Address Error - 34, // 4: Illegal Instruction - 38, // 5: Divide by Zero - 40, // 6: CHK - 34, // 7: TRAPV - 34, // 8: Privilege Violation - 34, // 9: Trace - 4, // 10: - 4, // 11: - 4, // 12: RESERVED - 4, // 13: Coprocessor Protocol Violation - 4, // 14: Format Error - 44, // 15: Uninitialized Interrupt - 4, // 16: RESERVED - 4, // 17: RESERVED - 4, // 18: RESERVED - 4, // 19: RESERVED - 4, // 20: RESERVED - 4, // 21: RESERVED - 4, // 22: RESERVED - 4, // 23: RESERVED - 44, // 24: Spurious Interrupt - 44, // 25: Level 1 Interrupt Autovector - 44, // 26: Level 2 Interrupt Autovector - 44, // 27: Level 3 Interrupt Autovector - 44, // 28: Level 4 Interrupt Autovector - 44, // 29: Level 5 Interrupt Autovector - 44, // 30: Level 6 Interrupt Autovector - 44, // 31: Level 7 Interrupt Autovector - 34, // 32: TRAP #0 - 34, // 33: TRAP #1 - 34, // 34: TRAP #2 - 34, // 35: TRAP #3 - 34, // 36: TRAP #4 - 34, // 37: TRAP #5 - 34, // 38: TRAP #6 - 34, // 39: TRAP #7 - 34, // 40: TRAP #8 - 34, // 41: TRAP #9 - 34, // 42: TRAP #10 - 34, // 43: TRAP #11 - 34, // 44: TRAP #12 - 34, // 45: TRAP #13 - 34, // 46: TRAP #14 - 34, // 47: TRAP #15 - 4, // 48: FP Branch or Set on Unknown Condition - 4, // 49: FP Inexact Result - 4, // 50: FP Divide by Zero - 4, // 51: FP Underflow - 4, // 52: FP Operand Error - 4, // 53: FP Overflow - 4, // 54: FP Signaling NAN - 4, // 55: FP Unimplemented Data Type - 4, // 56: MMU Configuration Error - 4, // 57: MMU Illegal Operation Error - 4, // 58: MMU Access Level Violation Error - 4, // 59: RESERVED - 4, // 60: RESERVED - 4, // 61: RESERVED - 4, // 62: RESERVED - 4, // 63: RESERVED - // 64-255: User Defined - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 + 4, // 0: Reset - Initial Stack Pointer + 4, // 1: Reset - Initial Program Counter + 50, // 2: Bus Error + 50, // 3: Address Error + 34, // 4: Illegal Instruction + 38, // 5: Divide by Zero + 40, // 6: CHK + 34, // 7: TRAPV + 34, // 8: Privilege Violation + 34, // 9: Trace + 4, // 10: + 4, // 11: + 4, // 12: RESERVED + 4, // 13: Coprocessor Protocol Violation + 4, // 14: Format Error + 44, // 15: Uninitialized Interrupt + 4, // 16: RESERVED + 4, // 17: RESERVED + 4, // 18: RESERVED + 4, // 19: RESERVED + 4, // 20: RESERVED + 4, // 21: RESERVED + 4, // 22: RESERVED + 4, // 23: RESERVED + 44, // 24: Spurious Interrupt + 44, // 25: Level 1 Interrupt Autovector + 44, // 26: Level 2 Interrupt Autovector + 44, // 27: Level 3 Interrupt Autovector + 44, // 28: Level 4 Interrupt Autovector + 44, // 29: Level 5 Interrupt Autovector + 44, // 30: Level 6 Interrupt Autovector + 44, // 31: Level 7 Interrupt Autovector + 34, // 32: TRAP #0 + 34, // 33: TRAP #1 + 34, // 34: TRAP #2 + 34, // 35: TRAP #3 + 34, // 36: TRAP #4 + 34, // 37: TRAP #5 + 34, // 38: TRAP #6 + 34, // 39: TRAP #7 + 34, // 40: TRAP #8 + 34, // 41: TRAP #9 + 34, // 42: TRAP #10 + 34, // 43: TRAP #11 + 34, // 44: TRAP #12 + 34, // 45: TRAP #13 + 34, // 46: TRAP #14 + 34, // 47: TRAP #15 + 4, // 48: FP Branch or Set on Unknown Condition + 4, // 49: FP Inexact Result + 4, // 50: FP Divide by Zero + 4, // 51: FP Underflow + 4, // 52: FP Operand Error + 4, // 53: FP Overflow + 4, // 54: FP Signaling NAN + 4, // 55: FP Unimplemented Data Type + 4, // 56: MMU Configuration Error + 4, // 57: MMU Illegal Operation Error + 4, // 58: MMU Access Level Violation Error + 4, // 59: RESERVED + 4, // 60: RESERVED + 4, // 61: RESERVED + 4, // 62: RESERVED + 4, // 63: RESERVED + // 64-255: User Defined + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4 }; @@ -872,443 +442,192 @@ static const s32 exception_cycle_table[256] = /* helper functions */ /********************/ +static void execute_exception_group_0(s32 vect, u16 inst_reg, s32 addr, u16 spec_info); -static void famec_SetFetch(u32 low_adr, u32 high_adr, u32 fetch_adr) -{ - u32 i, j; - - i = (low_adr >> M68K_FETCHSFT) & M68K_FETCHMASK; - j = (high_adr >> M68K_FETCHSFT) & M68K_FETCHMASK; - - while (i <= j) - Fetch[i++] = fetch_adr; +#define CHECK_BRANCH_EXCEPTION(_PC_,CYCLES) \ +if (unlikely((_PC_)&1)) \ +{ \ +u32 pr_PC = GET_PC; \ +execute_exception_group_0(M68K_ADDRESS_ERROR_EX, 0, pr_PC, 0x12 ); \ +RET(CYCLES) \ } -#ifdef FAMEC_USE_DATA_BANKS -static void famec_SetDataRB(u32 low_adr, u32 high_adr, void *mh, void *dt) +void famec_SetBank(u32 low_addr, u32 high_addr, uintptr_t fetch, void *rb, void *rw, void *wb, void *ww, void *data) { u32 i, j; - - i = (low_adr >> M68K_DATASFT) & M68K_DATAMASK; - j = (high_adr >> M68K_DATASFT) & M68K_DATAMASK; - + + i = (low_addr >> M68K_DATASFT) & M68K_DATAMASK; + j = (high_addr >> M68K_DATASFT) & M68K_DATAMASK; + while (i <= j) - { - DataRB[i].mem_handler = mh; - DataRB[i++].data = dt; + { + Fetch[i] = fetch; + mem_handlerRB[i] = rb; + mem_handlerRW[i] = rw; + mem_handlerWB[i] = wb; + mem_handlerWW[i] = ww; + mem_data[i++] = data; } } -static void famec_SetDataRW(u32 low_adr, u32 high_adr, void *mh, void *dt) -{ - u32 i, j; - - i = (low_adr >> M68K_DATASFT) & M68K_DATAMASK; - j = (high_adr >> M68K_DATASFT) & M68K_DATAMASK; - while (i <= j) - { - DataRW[i].mem_handler = mh; - DataRW[i++].data = dt; - } -} +// Read / Write functions +//////////////////////////////// -static void famec_SetDataWB(u32 low_adr, u32 high_adr, void *mh, void *dt) -{ - u32 i, j; +#ifdef USE_ARMNEON - i = (low_adr >> M68K_DATASFT) & M68K_DATAMASK; - j = (high_adr >> M68K_DATASFT) & M68K_DATAMASK; +extern "C" u8 ARM_Read_Byte(u32 addr); +#define Read_Byte ARM_Read_Byte - while (i <= j) - { - DataWB[i].mem_handler = mh; - DataWB[i++].data = dt; - } -} +extern "C" u16 ARM_Read_Word(u32 addr); +#define Read_Word ARM_Read_Word -static void famec_SetDataWW(u32 low_adr, u32 high_adr, void *mh, void *dt) -{ - u32 i, j; +extern "C" u32 ARM_Read_Long(u32 addr); +#define Read_Long ARM_Read_Long - i = (low_adr >> M68K_DATASFT) & M68K_DATAMASK; - j = (high_adr >> M68K_DATASFT) & M68K_DATAMASK; +extern "C" void ARM_Write_Byte(u32 addr, u8 data); +#define Write_Byte ARM_Write_Byte - while (i <= j) - { - DataWW[i].mem_handler = mh; - DataWW[i++].data = dt; - } -} -#endif +extern "C" void ARM_Write_Word(u32 addr, u16 data); +#define Write_Word ARM_Write_Word -static void famec_SetBanks(void) -{ - u32 i=0; - while(m68kcontext.fetch[i].low_addr != (u32)-1) - { - famec_SetFetch(m68kcontext.fetch[i].low_addr,m68kcontext.fetch[i].high_addr,m68kcontext.fetch[i].offset); - i++; - } -#ifdef FAMEC_USE_DATA_BANKS - i=0; - while(m68kcontext.read_byte[i].low_addr != (u32)-1) - { - famec_SetDataRB(m68kcontext.read_byte[i].low_addr,m68kcontext.read_byte[i].high_addr,m68kcontext.read_byte[i].mem_handler,m68kcontext.read_byte[i].data); - i++; - } - i=0; - while(m68kcontext.read_word[i].low_addr != (u32)-1) - { - famec_SetDataRW(m68kcontext.read_word[i].low_addr,m68kcontext.read_word[i].high_addr,m68kcontext.read_word[i].mem_handler,m68kcontext.read_word[i].data); - i++; - } - i=0; - while(m68kcontext.write_byte[i].low_addr != (u32)-1) - { - famec_SetDataWB(m68kcontext.write_byte[i].low_addr,m68kcontext.write_byte[i].high_addr,m68kcontext.write_byte[i].mem_handler,m68kcontext.write_byte[i].data); - i++; - } - i=0; - while(m68kcontext.write_word[i].low_addr != (u32)-1) - { - famec_SetDataWW(m68kcontext.write_word[i].low_addr,m68kcontext.write_word[i].high_addr,m68kcontext.write_word[i].mem_handler,m68kcontext.write_word[i].data); - i++; - } -#endif -} +extern "C" void ARM_Write_Long(u32 addr, u32 data); +#define Write_Long ARM_Write_Long -// Read / Write functions -//////////////////////////////// +#else -static FAMEC_EXTRA_INLINE u32 Read_Byte(u32 addr) +static __attribute__ ((noinline)) u8 Read_Byte(u32 addr) { - u32 i=0; - s32 val; - + u32 i; + u8 val; + addr&=M68K_ADR_MASK; -#ifdef FAMEC_DEBUG - printf("Reading byte from addr = 0x%08X\n",addr); -#endif - -#ifndef FAMEC_USE_DATA_BANKS - while ( ((m68kcontext.read_byte[i].low_addr > addr) || (m68kcontext.read_byte[i].high_addr < addr)) && (m68kcontext.read_byte[i].low_addr != -1) ) - i++; - if (m68kcontext.read_byte[i].low_addr == -1) - return (u32)-1; -#else i=addr>>M68K_DATASFT; -#endif - - if (DataRB[i].mem_handler) - val = ((u8 (*)(s32))DataRB[i].mem_handler)(addr); - else - val = *((u8 *)(((u32)DataRB[i].data) + (addr^1))); - -#ifdef FAMEC_DEBUG - printf("Reading 0x%08X = 0x%04X...\n",addr,val); -#endif - + + if (mem_handlerRB[i]) + val = ((u8 (*)(s32))mem_handlerRB[i])(addr); + else { + val = *((u8 *)(((uintptr_t)mem_data[i]) + (addr^1))); + } + return val; } -static FAMEC_EXTRA_INLINE u32 Read_Word(u32 addr) +static __attribute__ ((noinline)) u16 Read_Word(u32 addr) { - u32 i=0; - s32 val; - + u32 i; + u32 val; + addr&=M68K_ADR_MASK; -#ifdef FAMEC_DEBUG - printf("Reading from addr = 0x%08X\n",addr); -#endif - -#ifndef FAMEC_USE_DATA_BANKS - while ( ((m68kcontext.read_word[i].low_addr > addr) || (m68kcontext.read_word[i].high_addr < addr)) && (m68kcontext.read_word[i].low_addr != -1) ) - i++; - if (m68kcontext.read_word[i].low_addr == -1) - return (u32)-1; -#else i=addr>>M68K_DATASFT; -#endif - - if (DataRW[i].mem_handler) - val = ((u16 (*)(s32))DataRW[i].mem_handler)(addr); - else - val = *((u16 *)(((u32)DataRW[i].data) + addr)); - -#ifdef FAMEC_DEBUG - printf("Reading 0x%08X = 0x%04X...\n",addr,val); -#endif - + + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if (mem_handlerRW[i]) { + val = ((u16 (*)(s32))mem_handlerRW[i])(addr); + } + else { + if (unlikely(addr & 1)) { + /* Example: + * - memory loc. 0x00000000 : 0xeeff0011 (word-swabbed data) + * - read word from 0x00000001 : 0xee11 (unswabbed data) + */ + register u32 b; + b = *((u32 *)(((uintptr_t)mem_data[i]) + (addr ^ 1))); + val = (b << 8) | (b >> 24); + // u8 *pdata = (u8 *)((u32)DataWW[i].data + addr); + // val = *(pdata - 1) << 8; + // val |= *(pdata + 2); + } + else { + val = *((u16 *)(((uintptr_t)mem_data[i]) + addr)); + } + } + return val; } -static FAMEC_EXTRA_INLINE u32 Read_Long(const u32 addr) +static INLINE u32 Read_Long(u32 addr) { -#ifdef FAME_BIG_ENDIAN - return (Read_Word(addr) & 0xFFFF) | (Read_Word(addr + 2) << 16); -#else - return (Read_Word(addr) << 16) | (Read_Word(addr + 2) & 0xFFFF); -#endif + return (Read_Word(addr) << 16) | (Read_Word(addr + 2) /*& 0xFFFF*/); } -static FAMEC_EXTRA_INLINE void Write_Byte(u32 addr, u32 data) +static __attribute__ ((noinline)) void Write_Byte(u32 addr, u8 data) { - u32 i=0; - + u32 i; + addr&=M68K_ADR_MASK; -#ifdef FAMEC_DEBUG - printf("Writing byte 0x%08X = 0x%04X...\n",addr,data); -#endif -#ifndef FAMEC_USE_DATA_BANKS - while ( ((m68kcontext.write_byte[i].low_addr > addr) || (m68kcontext.write_byte[i].high_addr < addr)) && (m68kcontext.write_byte[i].low_addr != -1) ) - i++; - if (m68kcontext.write_byte[i].low_addr == -1) - return; -#else i=addr>>M68K_DATASFT; -#endif - - if (DataWB[i].mem_handler != NULL) - ((void (*)(s32, s32))DataWB[i].mem_handler)(addr,data); - else - *((u8 *)(((u32)DataWB[i].data)+ (addr^1))) = data; + + if (mem_handlerWB[i] != NULL) + ((void (*)(s32, s32))mem_handlerWB[i])(addr,data); + else { + *((u8 *)(((uintptr_t)mem_data[i]) + (addr^1))) = data; + } } - -static FAMEC_EXTRA_INLINE void Write_Word(u32 addr, u32 data) +static __attribute__ ((noinline)) void Write_Word(u32 addr, u16 data) { - u32 i=0; - + u32 i; + addr&=M68K_ADR_MASK; -#ifdef FAMEC_DEBUG - printf("Writing 0x%08X = 0x%04X...\n",addr,data); -#endif -#ifndef FAMEC_USE_DATA_BANKS - while ( ((m68kcontext.write_word[i].low_addr > addr) || (m68kcontext.write_word[i].high_addr < addr)) && (m68kcontext.write_word[i].low_addr != -1) ) - i++; - if (m68kcontext.write_word[i].low_addr == -1) - return; -#else i=addr>>M68K_DATASFT; -#endif - - if (DataWW[i].mem_handler != NULL) - ((void (*)(s32, s32))DataWW[i].mem_handler)(addr,data); - else - *((u16 *)(((u32)DataWW[i].data) + addr)) = data; + + /* ! 68020+ CPUs can read/write words and longs at odd addresses ! */ + if (mem_handlerWW[i]) { + ((void (*)(s32, s32))mem_handlerWW[i])(addr,data); + } + else { + if (unlikely(addr & 1)) { + u8 *pdata = (u8 *)((uintptr_t)mem_data[i] + addr); + + /* Example: + * - memory loc. 0x00000000 : 0xeeff0011 (word-swabbed data) + * - write 0x2233 to 0x00000001 : 0x22ff0033 + */ + *(pdata - 1) = data >> 8; + *(pdata + 2) = data; + } + else { + *((u16 *)(((uintptr_t)mem_data[i]) + addr)) = data; + } + } } -static FAMEC_EXTRA_INLINE void Write_Long(const u32 addr, u32 data) +static INLINE void Write_Long(u32 addr, u32 data) { -#ifdef FAME_BIG_ENDIAN - Write_Word(addr, data & 0xFFFF); - Write_Word(addr + 2, data >> 16); -#else - Write_Word(addr, data >> 16); - Write_Word(addr + 2, data & 0xFFFF); -#endif + Write_Word(addr, data >> 16); + Write_Word(addr + 2, data /*& 0xFFFF*/); } -/***********************/ -/* disassembler code */ -/***********************/ -#if DISASSEMBLER - -# include "Disa.h" -# include "disassembler.h" -# include "DisaLogging.h" - -FILE *g_logOutput = stdout; - -#define flag_x (flag_X & 0x100) -#define flag_n (flag_N & 0x80) -#define flag_z (!flag_NotZ) -#define flag_v (flag_V & 0x80) -#define flag_c (flag_C & 0x80) - -#define flag_Xx (flag_x ? 'X' : 'x') -#define flag_Nn (flag_n ? 'N' : 'n') -#define flag_Zz (flag_z ? 'Z' : 'z') -#define flag_Vv (flag_v ? 'V' : 'v') -#define flag_Cc (flag_c ? 'C' : 'c') - -#define _68k_areg(X) AREG(X) -#define _68k_dreg(X) DREGu32(X) - -#pragma mark - -#pragma mark BREAKPOINTS - -void check_breakpoints() { - u32 cPC = GET_PC; - - static int count = 0; - - switch (cPC) { - case 0x53d0: - count++; - if (count == 1) { - do_disa = 1; - } - break; - } -} - -unsigned short DisaGetWord(unsigned int a) { - return Read_Word(a); -} - -#define MODE_BINARY 1 -#define MODE_TEXT_TABS 2 -#define MODE_TEXT_SPACES 3 - -#define DISASSEMBLER_OUTPUT MODE_BINARY - -#define DISASSEMBLER_LIMIT 1000000 - -#define INSTRUCTION_LOGLEVEL 3 - -u16 *DPC; - -static void DisaStep() { - DisaPc = GET_PC; -#if DISASSEMBLER_OUTPUT != MODE_BINARY - DisaGet(); - DisaPc = GET_PC; -#else - DPC = PC; -#endif -} - -static void DisaPostStep() { -#if DISASSEMBLER_LIMIT - disa_step++; -#endif - -#if DISASSEMBLER_OUTPUT == MODE_BINARY - -#if INSTRUCTION_LOGLEVEL == 0 - const uint8_t rType = EntryTypeInstructionL0; -#elif INSTRUCTION_LOGLEVEL == 1 - const uint8_t rType = EntryTypeInstructionL1; -#else - const uint8_t rType = EntryTypeInstructionL2; -#endif - fwrite(&rType, sizeof(rType), 1, g_logOutput); - - fwrite(&DisaPc, 4, 1, g_logOutput); - fwrite(DPC, 4, 3, g_logOutput); - uint8_t ccr = GET_CCR; - fwrite(&ccr, 1, 1, g_logOutput); - -#if INSTRUCTION_LOGLEVEL > 0 - u8 inscycles = INSTRUCTION_CYCLES; - fwrite(&inscycles, 1, 1, g_logOutput); -#endif - -#if INSTRUCTION_LOGLEVEL > 1 - fwrite(&DREG(0), 4, 16, g_logOutput); -#endif - -#elif DISASSEMBLER_OUTPUT == MODE_TEXT_TABS - fprintf(g_logOutput, "%06x:\t%s\t%c%c%c%c%c", DisaPc, DisaText, - flag_Xx, flag_Nn, flag_Zz, flag_Vv, flag_Cc); - - fprintf(g_logOutput, "\tA0=%.8X\tA1=%.8X\tA2=%.8X\tA3=%.8X",_68k_areg(0),_68k_areg(1),_68k_areg(2),_68k_areg(3)); - fprintf(g_logOutput, "\tA4=%.8X\tA5=%.8X\tA6=%.8X\tA7=%.8X",_68k_areg(4),_68k_areg(5),_68k_areg(6),_68k_areg(7)); - fprintf(g_logOutput, "\tD0=%.8X\tD1=%.8X\tD2=%.8X\tD3=%.8X",_68k_dreg(0),_68k_dreg(1),_68k_dreg(2),_68k_dreg(3)); - fprintf(g_logOutput, "\tD4=%.8X\tD5=%.8X\tD6=%.8X\tD7=%.8X",_68k_dreg(4),_68k_dreg(5),_68k_dreg(6),_68k_dreg(7)); - - fprintf(g_logOutput, "\n"); - -#else - fprintf(g_logOutput, "%06x %06x: %-35s %c%c%c%c%c\n", disa_step, DisaPc, DisaText, - flag_Xx, flag_Nn, flag_Zz, flag_Vv, flag_Cc); -#endif -#if DISASSEMBLER_LIMIT - // limit - if (disa_step > DISASSEMBLER_LIMIT) { - do_disa = 0; - disa_step = 0; - DisaCloseFile(); - } #endif -} - -static void DisaLogException(s32 vect, u32 oldPC, u32 newPC) { - uint8_t rType = EntryTypeException; - fwrite(&rType, sizeof(rType), 1, g_logOutput); - - tagExceptionRecord rec = { - vect, oldPC, newPC - }; - fwrite(&rec, sizeof(rec), 1, g_logOutput); -} - -void DisaInitialize() { - static char buffer[512]; - DisaWord = &DisaGetWord; - DisaText = buffer; - - DisaCreateFile(1); -} - -void DisaLogEmulateStart(s32 cycles, u32 total_cycles) { - uint8_t rType = EntryTypeEmulateStart; - fwrite(&rType, sizeof(rType), 1, g_logOutput); - - tagEmulateStart rec = { - cycles, total_cycles - }; - fwrite(&rec, sizeof(rec), 1, g_logOutput); -} - -#define DISA_STEP() if (do_disa) DisaStep(); -#define DISA_POST_STEP() if (do_disa) DisaPostStep(); -#define DISA_LOGEXCEPTION() if (do_disa) DisaLogException(vect, oldPC, newPC); -#define DISA_EMULATE_START(cycles, total_cycles) if (do_disa) DisaLogEmulateStart(cycles, total_cycles); - -#else - -#define DISA_STEP() -#define DISA_POST_STEP() -#define DISA_LOGEXCEPTION() -#define DISA_EMULATE_START(cycles, total_cycles) -#endif /***********************/ /* core main functions */ /***********************/ +static void m68k_jumptable000(int force_table); +static void m68k_jumptable020(int force_table); /***************************************************************************/ /* m68k_init() */ /* Debe ser llamado para inicializar la tabla de saltos de instruccion */ /* No recibe parametros y no devuelve nada */ /***************************************************************************/ -void m68k_init(void) +void m68k_init(int force_table) { -#ifdef FAMEC_DEBUG - puts("Initializing FAME..."); -#endif - - if (!initialised) { - m68k_emulate(0); - -#if DISASSEMBLER - DisaInitialize(); -#endif - - } -#ifdef FAMEC_DEBUG - puts("FAME initialized."); -#endif + if (!initialised || force_table) + { + if(prefs_cpu_model >= M68020) + m68k_jumptable020(force_table); + else + m68k_jumptable000(force_table); + } } /******************************************************************************/ @@ -1323,186 +642,52 @@ void m68k_init(void) u32 m68k_reset(void) { u32 i=0; - + if (!initialised) - m68k_emulate(0); - + { + if(prefs_cpu_model >= M68020) + m68k_jumptable020(0); + else + m68k_jumptable000(0); + } + // Si la CPU esta en ejecucion, salir con M68K_RUNNING if (m68kcontext.execinfo & M68K_RUNNING) return M68K_RUNNING; - - // Si no hay mapa de memoria supervisor, salir con M68K_NO_SUP_ADDR_SPACE - if (!m68kcontext.sv_fetch) - return M68K_NO_SUP_ADDR_SPACE; - - m68kcontext.fetch = m68kcontext.sv_fetch; - m68kcontext.read_byte = m68kcontext.sv_read_byte; - m68kcontext.read_word = m68kcontext.sv_read_word; - m68kcontext.write_byte = m68kcontext.sv_write_byte; - m68kcontext.write_word = m68kcontext.sv_write_word; - + // Resetear registros memset(&m68kcontext.dreg[0], 0, 16*4); - // Resetear interrupts, execinfo y ASP + // Resetear interrupts, execinfo y USP m68kcontext.interrupts[0] = 0; for(i=1;i<8;i++) m68kcontext.interrupts[i]=i+0x18; m68kcontext.execinfo = 0; - ASP = 0; - + USP = MSP = ISP = 0; + m68kcontext.vbr = m68kcontext.sfc = m68kcontext.dfc = 0; + m68kcontext.caar = m68kcontext.cacr = 0; + flag_S = 1; + flag_M = 0; + // Fijar registro de estado m68kcontext.sr = 0x2700; // Obtener puntero de pila inicial y PC - AREG(7) = Read_Long(0); - m68kcontext.pc = Read_Long(4); - -#if DISASSEMBLER - DisaCloseFile(); - DisaCreateFile(1); -#endif - -#ifdef FAMEC_DEBUG - puts("Reset 68k done!\n"); - printf("PC = 0x%08X\n",m68kcontext.pc); -#endif - - return M68K_OK; -} - - -/******************************************************************************/ -/* m68k_raise_irq(level,vector) */ -/* Parametros: level = nivel de interrupcion */ -/* vector = puntero a la direccion de la rutina de atencion */ -/* -1 auto, -2 interrupcion espuria */ -/* Retorno: Exito de la operacion */ -/* 0 La interrupcion se ha habilitado satisfactoriamente */ -/* -1 No se ha podido habilitar porque ya existe otra interrupcion */ -/* en ese nivel. */ -/* -2 No se ha podido habilitar porque el vector no es valido o */ -/* el nivel es igual a 0. */ -/******************************************************************************/ -s32 m68k_raise_irq(s32 level, s32 vector) -{ - /* Enmascarar nivel de interrupcion */ - level &=7; - - /* Nivel de interrupcion = 0 no es valido */ - if (!level) return M68K_IRQ_INV_PARAMS; - - /* Comprobar si existe una interrupcion activada en ese nivel */ - if (m68kcontext.interrupts[0] & (1 << level)) - return M68K_IRQ_LEVEL_ERROR; - - /* El vector de interrupcion no puede ser > 255 ni menor que -2 */ - if ((vector > 255) || (vector < M68K_SPURIOUS_IRQ)) - { - return M68K_IRQ_INV_PARAMS; - } - - /* Dar de alta la interrupcion en interrupts */ - m68kcontext.interrupts[0] |= (1 << level); - - switch(vector) - { - case M68K_SPURIOUS_IRQ: - m68kcontext.interrupts[level] = 0x18; - break; - case M68K_AUTOVECTORED_IRQ: - m68kcontext.interrupts[level] = level + 0x18; - break; - default: - m68kcontext.interrupts[level] = vector; - break; - } -#ifdef FAMEC_DEBUG - printf("RAISE interrupts[%i]=0x%X\n",level,m68kcontext.interrupts[level]); -#endif - - /* Testear si la CPU esta detenida (mediante STOP) */ - if (m68kcontext.execinfo & M68K_HALTED) - { - /* Si la IRQ es NMI o si supera la mascara de interrupcion, */ - /* salir de estado parado */ - if ((level == 7) || (level > ((m68kcontext.sr >> 8) & 0x7))) - { - m68kcontext.execinfo &= ~M68K_HALTED; - } - } + AREG(7) = Read_Long(/*0x00F8000*/0); + m68kcontext.pc = Read_Long(/*0x00F8000*/4); return M68K_OK; } -/******************************************************************************/ -/* m68k_lower_irq(level) */ -/* Parametros: Nivel de la interrupcion a retirar */ -/* Retorno: Exito de la operacion */ -/* 0 La interrupcion se ha retirado satisfactoriamente */ -/* -1 No se ha podido retirar porque esa interrupcion */ -/* no esta habilitada. */ -/* -2 No se ha podido retirar porque el nivel es 0 o mayor */ -/* o igual que 7 (no se puede retirar la NMI) */ -/******************************************************************************/ -s32 m68k_lower_irq(s32 level) -{ - /* Enmascarar nivel de interrupcion */ - level &=7; - - /* Nivel de interrupcion = 0 no es valido */ - if (!level) return M68K_IRQ_INV_PARAMS; - - /* La interrupcion de nivel 7 (NMI) no se puede bajar */ - if (level > 6) - { - return M68K_IRQ_INV_PARAMS; - } - - /* Comprobar que la interrupcion este activada */ - if (m68kcontext.interrupts[0] & (1 << level)) - { - /* Dar de baja la interrupcion */ - m68kcontext.interrupts[0] &= ~(1 << level); - } - else - { - return M68K_IRQ_LEVEL_ERROR; - } - - return M68K_OK; -} - -/******************************************************************************/ -/* m68k_get_context_size */ -/* No recibe parametros */ -/* Retorno: Tamano del contexto en bytes */ -/******************************************************************************/ -s32 m68k_get_context_size(void) -{ - return sizeof(M68K_CONTEXT); -} - -/***************************************************************************/ -/* m68k_get_context(address) */ -/* Parametro: Direccion del contexto */ -/* No retorna ningun valor */ /***************************************************************************/ -void m68k_get_context(void *context) -{ - memcpy(context,&m68kcontext,sizeof(M68K_CONTEXT)); -} - -/***************************************************************************/ -/* m68k_set_context(address) */ +/* address=m68k_get_context(address) */ /* Parametro: Direccion del contexto */ /* No retorna ningun valor */ /***************************************************************************/ -void m68k_set_context(void *context) +M68K_CONTEXT *m68k_get_context(void) { - memcpy(&m68kcontext,context,sizeof(M68K_CONTEXT)); - famec_SetBanks(); + return &m68kcontext; } /****************************************************************************/ @@ -1510,62 +695,17 @@ void m68k_set_context(void *context) /* No recibe parametros */ /* Retorna 68k PC */ /****************************************************************************/ -u32 m68k_get_pc(void) +uintptr_t m68k_get_pc(void) { - return (m68kcontext.execinfo & M68K_RUNNING)?(u32)PC-BasePC:m68kcontext.pc; -} - -/***************************************************************************/ -/* m68k_get_register(register) */ -/* Parametro: Registro a obtener valor (indice) */ -/* Retorno: Valor del registro requerido */ -/* Observacion: En caso de que el indice no sea correcto */ -/* la funcion devolvera -1 */ -/***************************************************************************/ -s32 m68k_get_register(m68k_register reg) -{ - switch(reg) - { - case M68K_REG_D0: - case M68K_REG_D1: - case M68K_REG_D2: - case M68K_REG_D3: - case M68K_REG_D4: - case M68K_REG_D5: - case M68K_REG_D6: - case M68K_REG_D7: - return DREG(reg - M68K_REG_D0); - - case M68K_REG_A0: - case M68K_REG_A1: - case M68K_REG_A2: - case M68K_REG_A3: - case M68K_REG_A4: - case M68K_REG_A5: - case M68K_REG_A6: - case M68K_REG_A7: - return AREG(reg - M68K_REG_A0); - - case M68K_REG_ASP: - return ASP; - - case M68K_REG_PC: - return m68k_get_pc(); - - case M68K_REG_SR: - return m68kcontext.sr; - - default: - return M68K_INV_REG; - } + return (m68kcontext.execinfo & M68K_RUNNING)?(uintptr_t)PC-BasePC:m68kcontext.pc; } /***********************************************************************/ /* m68k_set_register(register,value) */ -/* Parametros: Register (index) and value to assign */ -/* Retorno: Successful operation */ -/* 0 The operation has been successful */ -/* 1 The register index is invalid (out of bounds) */ +/* Parametros: Registro (indice) y valor a asignar */ +/* Retorno: Exito de la operacion */ +/* 0 La operacion se ha realizado satisfactoriamente */ +/* 1 El indice del registro no es valido (fuera de limites) */ /***********************************************************************/ s32 m68k_set_register(m68k_register reg, u32 value) { @@ -1581,7 +721,7 @@ s32 m68k_set_register(m68k_register reg, u32 value) case M68K_REG_D7: DREG(reg - M68K_REG_D0) = value; break; - + case M68K_REG_A0: case M68K_REG_A1: case M68K_REG_A2: @@ -1592,11 +732,11 @@ s32 m68k_set_register(m68k_register reg, u32 value) case M68K_REG_A7: AREG(reg - M68K_REG_A0) = value; break; - - case M68K_REG_ASP: - ASP = value; + + case M68K_REG_USP: + USP = value; break; - + case M68K_REG_PC: if (m68kcontext.execinfo & M68K_RUNNING) { @@ -1607,150 +747,44 @@ s32 m68k_set_register(m68k_register reg, u32 value) m68kcontext.pc = value; } break; - + case M68K_REG_SR: - m68kcontext.sr = value & 0xFFFF; + if (m68kcontext.execinfo & M68K_RUNNING) + { + SET_SR(value); + } + else + { + m68kcontext.sr = value & 0xFFFF; + } break; - + default: return M68K_INV_REG; } - + return M68K_OK; } /*********************************************************/ /* m68k_fetch(address,access_type) */ -/* Read a word of the memory space of 68k */ -/* Parametro: Address of the word and type of access */ -/* Retorno: The word or -1 if dir. not valid */ +/* Lee una palabra del espacio de memoria del 68k */ +/* Parametro: Direccion de la palabra y tipo de acceso */ +/* Retorno: La palabra o -1 en caso de dir. no valida */ /*********************************************************/ -s32 m68k_fetch(u32 addr, u32 memory_space) +s32 m68k_fetch(u32 addr) { - u32 i=0; s32 val; - M68K_DATA *ds = NULL; - M68K_PROGRAM *ps = NULL; - - switch(memory_space & 2) - { - case M68K_SUP_ADDR_SPACE: - if ((memory_space & 1) == M68K_PROG_ADDR_SPACE) - ps = m68kcontext.sv_fetch; - else - ds = m68kcontext.sv_read_word; - break; - - case M68K_USER_ADDR_SPACE: - if ((memory_space & 1) == M68K_PROG_ADDR_SPACE) - ps = m68kcontext.user_fetch; - else - ds = m68kcontext.user_read_word; - break; - } - - if (ps == NULL) - { - while ( ((ds[i].low_addr > addr) || (ds[i].high_addr < addr)) && (ds[i].low_addr != (u32)-1) ) - { - #ifdef FAMEC_DEBUG - printf("RW not found in %d region... 0x%08X - 0x%08X --> 0x%08X\n",i,ds[i].low_addr,ds[i].high_addr,addr); - #endif - - i++; - } - - if (ds[i].low_addr == (u32)-1) - { - /* Error de BUS */ - #ifdef FAMEC_DEBUG - printf("ERROR de BUS en region %d...\n",i); - #endif - return -1; - } - else - { - if (ds[i].mem_handler != NULL) - { - #ifdef FAMEC_DEBUG - puts("Handled...\n"); - #endif - val = ((u16 (*)(s32))ds[i].mem_handler)(addr); - } - else - { - #ifdef FAMEC_DEBUG - printf("Ptr en region %d... addr: %p\n",i,ds[i].data); - #endif - val = *((u16 *)(((u32)ds[i].data) + addr)); - #ifdef FAMEC_DEBUG - puts("read"); - #endif - } - } - - #ifdef FAMEC_DEBUG - printf("Reading 0x%08X = 0x%04X...\n",addr,val); - #endif - } - else - { - u16 *PC; - u32 BasePC; - - SET_PC_BASE(PC,BasePC,addr) - #ifdef FAMEC_DEBUG - printf("BasePC = %08X, PC = %08X, addr=%08X\n",BasePC,PC,addr); - #endif - val = *PC; - } - - return val; -} - -/******************************************************/ -/* m68k_get_cycles_counter() */ -/* Retorna el cycles_counter */ -/* Parametro: Ninguno */ -/* Retorno: cycles_counter */ -/******************************************************/ -u32 m68k_get_cycles_counter (void) -{ - return (m68kcontext.execinfo & M68K_RUNNING)?io_cycle_counter:m68kcontext.cycles_counter; -} - -/******************************************************/ -/* m68k_trip_cycles_counter() */ -/* Retorna el cycles_counter y lo reinicializa */ -/* Parametro: Ninguno */ -/* Retorno: cycles_counter */ -/******************************************************/ -u32 m68k_trip_cycles_counter(void) -{ - s32 aux; - - // TODO Cycles - if (m68kcontext.execinfo & M68K_RUNNING) - { - aux = io_cycle_counter; - return aux; - } - else - { - } + uintptr_t Base; + u16 *ptr; + + Base = Fetch[(addr >> M68K_FETCHSFT) & M68K_FETCHMASK]; + ptr = (u16*)((addr & M68K_ADR_MASK) + Base); + val = *ptr; + + return val; } -/**********************************************************/ -/* m68k_control_cycles_counter(n) */ -/* Retorna el cycles_counter y lo reinicializa si */ -/* cycles_counter = n */ -/* Parametro: ciclos = n */ -/* Retorno: cycles_counter */ -/**********************************************************/ -u32 m68k_control_cycles_counter(s32 cycles) -{ - return (cycles)?m68k_trip_cycles_counter():m68k_get_cycles_counter(); -} /******************************************************/ /* m68k_release_timeslice() */ @@ -1763,137 +797,151 @@ void m68k_release_timeslice(void) { if (m68kcontext.execinfo & M68K_RUNNING) { - io_cycle_counter = 0; - } - else - { - } -// m68kcontext.CycleToDo -= m68kcontext.CycleIO + m68kcontext.CycleSup; -// m68kcontext.CycleIO = m68kcontext.CycleSup = 0; -} - -/******************************************************/ -/* m68k_add_cycles() */ -/* Incrementa los ciclos de reloj a ejecutar por la */ -/* CPU en las llamadas a emulate */ -/* Parametro: Ninguno */ -/* Retorno: Ninguno */ -/******************************************************/ -void m68k_add_cycles(s32 cycles) -{ - if (m68kcontext.execinfo & M68K_RUNNING) - { - io_cycle_counter += cycles; - } - else - { - m68kcontext.cycles_counter += cycles; - } -} - - -/******************************************************/ -/* m68k_release_cycles() */ -/* Decrementa los ciclos de reloj a ejecutar por la */ -/* CPU en las llamadas a emulate */ -/* Parametro: Ninguno */ -/* Retorno: Ninguno */ -/******************************************************/ -void m68k_release_cycles(s32 cycles) -{ - if (m68kcontext.execinfo & M68K_RUNNING) - { - io_cycle_counter -= cycles; + m68kcontext.cycles_not_done = m68kcontext.io_cycle_counter >> mainMenu_CPU_speed; + m68kcontext.io_cycle_counter = 0; } - else - { - m68kcontext.cycles_counter -= cycles; - } -} - -/*****************************************************************************/ -/* m68k_get_cpu_state() */ -/* No recibe parametros */ -/* Retorna el estado de la CPU */ -/*****************************************************************************/ -u32 m68k_get_cpu_state (void) -{ - return m68kcontext.execinfo; } - - ////////////////////////// // Chequea las interrupciones y las inicia -static FAMEC_EXTRA_INLINE s32 interrupt_chk__(void) +static FAMEC_EXTRA_INLINE s32 interrupt_chk__(M68K_CONTEXT &m68kcontext) { if ((m68kcontext.interrupts[0]>>1)) { if (m68kcontext.interrupts[0]&0x80) return 7; else - if (m68kcontext.interrupts[0]&0x40) - { - if (6 > flag_I) - return 6; - } - else - if (m68kcontext.interrupts[0]&0x20) - { - if (5 > flag_I) - return 5; - } - else - if (m68kcontext.interrupts[0]&0x10) - { - if (4 > flag_I) - return 4; - } - else - if (m68kcontext.interrupts[0]&0x08) - { - if (3 > flag_I) - return 3; - } - else - if (m68kcontext.interrupts[0]&0x04) - { - if (2 > flag_I) - return 2; - } - else - if (m68kcontext.interrupts[0]&0x02) - { - if (1 > flag_I) - return 1; - } + if (m68kcontext.interrupts[0]&0x40) + { + if (6 > flag_I) + return 6; + } + else + if (m68kcontext.interrupts[0]&0x20) + { + if (5 > flag_I) + return 5; + } + else + if (m68kcontext.interrupts[0]&0x10) + { + if (4 > flag_I) + return 4; + } + else + if (m68kcontext.interrupts[0]&0x08) + { + if (3 > flag_I) + return 3; + } + else + if (m68kcontext.interrupts[0]&0x04) + { + if (2 > flag_I) + return 2; + } + else + if (m68kcontext.interrupts[0]&0x02) + { + if (1 > flag_I) + return 1; + } } - -#ifdef FAMEC_EMULATE_TRACE + if (flag_T) - { -/* - m68kcontext.execinfo |= M68K_EMULATE_TRACE; - cycles_needed= io_cycle_counter; - io_cycle_counter=0; -*/ return -1; - } -#endif + return 0; } +/* Called from execute_exception() *and* uae_chk_handler() to process stack and PC */ +void process_exception(unsigned int vect) +{ + u32 newPC; + u32 oldPC = (uintptr_t)(PC) - BasePC; + u32 oldSR = GET_SR; + + // TomB 02.12.2013: 68000 reference manual says, trace-flag is always cleared + flag_T = 0; + + if (!flag_S) + { + USP = AREG(7); + if (prefs_cpu_model >= M68020) + AREG(7) = flag_M ? MSP : ISP; + else + AREG(7) = ISP; + /* adjust SR */ + flag_S = M68K_SR_S; + } + + if (prefs_cpu_model > M68000) { + /* 68010, 68020 & 68030. 68040 code has not been ported from WinUAE */ + if ((vect == 2) || (vect == 3)) { + int i; + u16 ssw = (flag_S ? 4 : 0) | (0/*last_instructionaccess_for_exception_3*/ ? 2 : 1); + ssw |= 0/*last_writeaccess_for_exception_3*/ ? 0 : 0x40; + ssw |= 0x20; + for (i = 0 ; i < 36; i++) { + PUSH_16_F(0); + } + PUSH_32_F(0/*last_fault_for_exception_3*/); + PUSH_16_F(0); + PUSH_16_F(0); + PUSH_16_F(0); + PUSH_16_F(ssw); + PUSH_16_F(0xb000 + vect * 4); + } else if ((vect == 5) || (vect == 6) || (vect == 7) || (vect == 9)) { + PUSH_32_F(oldPC); + PUSH_16_F(0x2000 + vect * 4); + } else if (flag_M && vect >= 24 && vect < 32) { /* M + Interrupt */ + PUSH_16_F(vect * 4); + PUSH_32_F(oldPC); + PUSH_16_F(oldSR); + m68kcontext.sr |= (1 << 13); + MSP = AREG(7); + AREG(7) = ISP; + PUSH_16_F(0x1000 + vect * 4); + } else { + PUSH_16_F(vect * 4); + } + + PUSH_32_F(oldPC); + PUSH_16_F(oldSR); + + flag_M = 0; + } + // else if ((vect == 2) || (vect == 3)) { + // /* Bus / address error */ + // uae_u16 mode = (sv ? 4 : 0) | (last_instructionaccess_for_exception_3 ? 2 : 1); + // mode |= last_writeaccess_for_exception_3 ? 0 : 16; + // m68k_areg (regs, 7) -= 14; + // /* bit3=I/N */ + // put_word (m68k_areg (regs, 7) + 0, mode); + // put_long (m68k_areg (regs, 7) + 2, last_fault_for_exception_3); + // put_word (m68k_areg (regs, 7) + 6, last_op_for_exception_3); + // put_word (m68k_areg (regs, 7) + 8, regs->sr); + // put_long (m68k_areg (regs, 7) + 10, last_addr_for_exception_3); + // } + else { + /* 68000 */ + PUSH_32_F(oldPC) + PUSH_16_F(oldSR) + } + + READ_LONG_F(m68kcontext.vbr + vect * 4, newPC) + newPC &= M68K_ADR_MASK; + + SET_PC(newPC) +} static FAMEC_EXTRA_INLINE void execute_exception(s32 vect) { -extern u32 flag_S; -#ifndef FAMEC_IRQ_CYCLES - if ((vect<24)||(vect>31)) -#endif - io_cycle_counter -= exception_cycle_table[vect]; + m68kcontext.io_cycle_counter -= (exception_cycle_table[vect]); + /* comprobar si hay tabla funciones manejadoras */ - if (m68kcontext.icust_handler && m68kcontext.icust_handler[vect]) + if (m68kcontext.icust_handler[vect]) { m68kcontext.sr = GET_SR; m68kcontext.pc = GET_PC; @@ -1902,45 +950,29 @@ extern u32 flag_S; } else { - u32 newPC; - u32 oldPC; - u32 oldSR = GET_SR; - - PRE_IO - - READ_LONG_F(vect * 4, newPC) - - /* swap A7 and USP */ - if (!flag_S) - { - u32 tmpSP; - - tmpSP = ASP; - ASP = AREG(7); - AREG(7) = tmpSP; - } - - oldPC = (u32)(PC) - BasePC; - PUSH_32_F(oldPC) - PUSH_16_F(oldSR) - - /* adjust SR */ - flag_S = M68K_SR_S; - - newPC&=M68K_ADR_MASK; - - SET_PC(newPC) - - DISA_LOGEXCEPTION(); - - POST_IO + process_exception(vect); } } -static FAMEC_EXTRA_INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, s32 addr, u16 spec_info) + +static FAMEC_EXTRA_INLINE void interrupt_attend(s32 line) +{ + /* al atender la IRQ, la CPU sale del estado parado */ + m68kcontext.execinfo &= ~M68K_HALTED; + + /* Desactivar interrupcion */ + m68kcontext.interrupts[0] &= ~(1 << ((u32)line)); + + execute_exception(m68kcontext.interrupts[(u32)line]); + + flag_I = (u32)line; +} + + +static INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, s32 addr, u16 spec_info) { execute_exception(vect); - if (!(m68kcontext.icust_handler && m68kcontext.icust_handler[vect])) + if (!(m68kcontext.icust_handler[vect])) { PUSH_16_F(inst_reg); PUSH_32_F(addr); @@ -1948,12 +980,679 @@ static FAMEC_EXTRA_INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, } } -#ifdef FAMEC_NO_GOTOS -#define OPCODE(N_OP) static void OP_##N_OP(void) -#define CAST_OP(N_OP) (opcode_func)&OP_##N_OP +/* Performs the required actions to finish the emulate call */ +static INLINE void finish_emulate(const s32 cycles_to_add) +{ + m68kcontext.sr = GET_SR; + m68kcontext.pc = GET_PC; + + m68kcontext.execinfo &= ~M68K_RUNNING; + + /* Actualizar contador de ciclos */ + m68kcontext.cycles_counter += cycles_to_add; +} + + +#define EXECUTE_EXCEPTION(EX,CYCLES) \ +{ \ +u32 oldPC=GET_PC; \ +SET_PC(oldPC-2) \ +execute_exception(EX); \ +RET(CYCLES) \ +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wlogical-op-parentheses" + +static void TRAPCC_EXECUTE (u32 Opcode) +{ + u8 do_trap; + int c = (flag_C >> M68K_SR_C_SFT) & 1; + int z = (flag_NotZ == 0); + int n = (flag_N >> M68K_SR_N_SFT) & 1; + int v = (flag_V >> M68K_SR_V_SFT) & 1; + + switch((Opcode >> 8) & 0xF) { + case 0: do_trap = 1; break; + case 1: do_trap = 0; break; + case 2: do_trap = !c && !z; break; + case 3: do_trap = c || z; break; + case 4: do_trap = !c; break; + case 5: do_trap = c; break; + case 6: do_trap = !z; break; + case 7: do_trap = z; break; + case 8: do_trap = !v; break; + case 9: do_trap = v; break; + case 10: do_trap = !n; break; + case 11: do_trap = n; break; + case 12: do_trap = n && v || !n && !v; break; + case 13: do_trap = n && !v || !n && v; break; + case 14: do_trap = n && v && !z || !n && !v && !z; break; + case 15: do_trap = z || n && !v || !n && v; break; + } + if (do_trap) + execute_exception(M68K_TRAPV_EX); +} + +#pragma clang diagnostic pop + +/* Bit Field Instructions + * + * NOTE: Offset is from the most-significant bit, *not* from the least-significant one. + * http://www-scm.tees.ac.uk/users/a.clements/BF/BF.htm + */ +#define BF_MASK(MASK, OFFSET, WIDTH) \ +MASK = 0xFFFFFFFF; \ +if ((OFFSET + WIDTH) < 32) { \ +MASK <<= OFFSET; \ +MASK >>= 32 - WIDTH; \ +} + +#define BF_SHIFT_DOWN(DATA, OFFSET, WIDTH) \ +DATA <<= OFFSET; \ +DATA >>= 32 - WIDTH; + +#define BF_SHIFT_UP(DATA, OFFSET, WIDTH) \ +DATA <<= 32 - WIDTH; \ +DATA >>= OFFSET; + +#define BF_EXTS(DATA, WIDTH, MASK) \ +DATA |= (((DATA >> (WIDTH - 1)) - 1) & ~MASK) ^ ~MASK; + +#define BF_SET_FLAGS(DATA, WIDTH) \ +flag_N = (DATA << (32 - WIDTH)) >> 24; /*((DATA & (1 << (WIDTH - 1))) != 0);*/ \ +flag_NotZ = (DATA != 0); \ +flag_C = 0; \ +flag_V = 0; + +#define BF_GET_PARM(EXTRA, OFFSET, WIDTH) \ +OFFSET = EXTRA & 0x800 ? DREG((EXTRA >> 6) & 7) : (EXTRA >> 6) & 0x1F; \ +/* Width 0 -> 32 */ \ +WIDTH = (((EXTRA & 0x20 ? DREG(EXTRA & 7) : EXTRA) - 1) & 0x1F) + 1; \ + +#define BF_FFO(SRC, MASK, OFFSET, WIDTH) \ +{ \ +MASK = 1 << (WIDTH - 1); \ +while (MASK) { \ +if (SRC & MASK) \ +break; \ +OFFSET++; \ +MASK >>= 1; \ +} \ +DREGu32(Opcode >> 12) = OFFSET; \ +} + +#define BF_REG_GET(EXTRA, DATA, OFFSET, WIDTH) \ +DATA = DREG((Opcode /*>> 0*/) & 7); \ +BF_GET_PARM(EXTRA, OFFSET, WIDTH) \ +OFFSET &= 0x1F; \ +BF_SHIFT_DOWN(DATA, OFFSET, WIDTH) \ +BF_SET_FLAGS(DATA, WIDTH) + +static __inline__ void BF_MEM_GET(u32 *adr, u32 *dst, s32 *offset, u32 width, u32 *bf0, u32 *bf1) +{ + /* adr = base byte address + * dst = DATA (result) + * bf0 = lower long (starting with the first *affected* byte) + * bf1 = upper byte (bit field crosses into next byte) + */ + + /* Locate the first *affected* byte (*not* the base byte), and read 4(+1) bytes from there */ + if (*offset >= 0) { + *adr += *offset >> 3; + /* New offset from the first *affected* byte */ + *offset &= 7; + } else { + /* With negative offset, address of the first *affected* byte is one byte below */ + *adr += *offset / 8 - 1; + /* New offset from the first *affected* byte */ + *offset = 8 - (u32)(*offset & 7); + } + + READ_LONG_F(*adr, *bf0); + if ((*offset + width) > 32) + READ_BYTE_F((*adr+4), *bf1) + else + *bf1 = 0; + + *dst = (*bf0 << *offset) | (*bf1 >> (8 - *offset)); + *dst >>= (32 - width); +} + +static __inline__ void BF_MEM_PUT(u32 adr, u32 dst, u32 mask, u32 offset, u32 width, u32 bf0, u32 bf1) +{ + /* adr = address of the first *affected* byte + * dst = DATA (to be written) + * bf0 = lower long (starting with the first *affected* byte) + * bf1 = upper byte (bit field crosses into upper byte) + */ + /* Example: 00[F(FF0FF 0f][f)0]0fff => offset=12->4, width=32 + * bf0 bf1 + * + * DATA=FF0FF0ff, MASK=FFFFFFFF + */ + u32 dst_tmp = dst; + u32 mask_tmp = mask; + + /* WRITE long @A: xFF0FF0f */ + BF_SHIFT_UP(mask_tmp, offset, width) + BF_SHIFT_UP(dst_tmp, offset, width) + WRITE_LONG_F(adr, (bf0 & ~mask_tmp) | dst_tmp); + + /* WRITE byte @A+4: fx */ + if ((offset + width) > 32) { + offset = 8 - offset; + mask_tmp = mask << offset; + dst_tmp = dst << offset; + WRITE_BYTE_F(adr+4, (bf1 & ~mask_tmp) | dst_tmp); + } +} + +#define CAS_EXECUTE(SHIFT, WRITE_OP) \ +{ \ +/* s8 flgs, flgo, flgn;*/ \ +\ +src = DREG(res & 7); \ +\ +/* flgs = (src < 0);*/ \ +/* flgo = (tmp < 0);*/ \ +dst = tmp - src; \ +/* flgn = (dst < 0);*/ \ +\ +flag_V = ((src ^ tmp) & (dst ^ tmp)) >> SHIFT; /*((flgs != flgo) && (flgn != flgo));*/ \ +flag_C = dst; /*(src > tmp);*/ \ +flag_N = dst >> SHIFT; /*flgn << 7;*/ \ +flag_NotZ = (dst != 0); \ +\ +if (flag_NotZ) \ +DREGs32(res & 7) = tmp; \ +else { \ +WRITE_OP; \ +} \ +} + +#define CAS2_EXECUTE(SHIFT, WRITE_OP1, WRITE_OP2) \ +{ \ +/* s8 flgs, flgo, flgn;*/ \ +\ +/* 1st compare */ \ +src = DREG(res1 & 7); \ +/* flgs = (src < 0);*/ \ +/* flgo = (tmp1 < 0);*/ \ +dst = tmp1 - src; \ +/* flgn = (dst < 0);*/ \ +\ +flag_NotZ = (dst != 0); \ +\ +if (flag_NotZ) { \ +/* Difference */ \ +flag_V = ((src ^ tmp1) & (dst ^ tmp1)) >> SHIFT; /* ((flgs != flgo) && (flgn != flgo));*/ \ +flag_C = dst; /*(src > tmp1);*/ \ +flag_N = dst >> SHIFT; /*flgn;*/ \ +DREGs32(res1 & 7) = tmp1; \ +DREGs32(res2 & 7) = tmp2; \ +} \ +else { \ +/* 2nd compare */ \ +src = DREG(res2 & 7); \ +/* flgs = (src < 0);*/ \ +/* flgo = (tmp2 < 0);*/ \ +dst = tmp2 - src; \ +/* flgn = (dst < 0);*/ \ +\ +flag_V = ((src ^ tmp2) & (dst ^ tmp2)) >> SHIFT; /*((flgs != flgo) && (flgn != flgo));*/ \ +flag_C = dst; /*(src > tmp2);*/ \ +flag_N = dst >> SHIFT; /*flgn;*/ \ +flag_NotZ = (dst != 0); \ +\ +if (flag_NotZ) { \ +/* Difference */ \ +DREGs32(res1 & 7) = tmp1; \ +DREGs32(res2 & 7) = tmp2; \ +} else { \ +/* Both compares passed */ \ +WRITE_OP1; \ +WRITE_OP2; \ +} \ +} \ +} + +#define CMP2_CHK2_EXECUTE(SIZE, ROLLBACK) \ +{ \ +READ_BYTE_F(adr, src1) \ +READ_BYTE_F(adr + 1, src2) \ +\ +if (res & 0x8000) \ +dst = AREG((res >> 12) & 7); \ +else \ +dst = (s32)(SIZE)DREG(res >> 12); \ +flag_NotZ = ((dst != src1) && (dst != src2)); \ +if (src1 > src2) { \ +s32 tmp; \ +tmp = src1; \ +src1 = src2; \ +src2 = tmp; \ +} \ +if ((dst < src1) || (dst > src2)) \ +{ \ +flag_C = M68K_SR_C; \ +if (res & 0x0800) \ +execute_exception(M68K_CHK_EX); \ +} else \ +flag_C = 0; \ +} + +static void MULL(u32 src, u16 extra) +{ + if (extra & 0x800) + { + /* signed variant */ + s64 a; + + a = (s64)(s32)DREG((extra >> 12) & 7); + a *= (s64)(s32)src; + + flag_V = 0; + flag_C = 0; + flag_NotZ = (a != 0); + flag_N = (a < 0); + if (extra & 0x400) { + /* 32 x 32 -> 64 */ + DREG(extra & 7) = (u32)(a >> 32); + } + else if ((a & UVAL64 (0xffffffff80000000)) != 0 + && (a & UVAL64 (0xffffffff80000000)) != UVAL64 (0xffffffff80000000)) + flag_V = M68K_SR_V; + DREG((extra >> 12) & 7) = (u32)a; + } + else + { + /* unsigned */ + u64 a; + + a = (u64)(u32)src * (u64)(u32)DREG((extra >> 12) & 7); + flag_V = 0; + flag_C = 0; + flag_NotZ = (a != 0); + flag_N = (((s64)a) < 0); + if (extra & 0x400) + DREG(extra & 7) = (u32)(a >> 32); + else if ((a & UVAL64 (0xffffffff00000000)) != 0) + flag_V = M68K_SR_V; + DREG((extra >> 12) & 7) = (u32)a; + } +} + +// returns extra cycles if we have a signed DIV +static int DIVL(u32 src, u16 extra) +{ + /* NOTE: Valid result is *always* 32-bit */ + if (extra & 0x800) + { + /* signed variant */ + s64 a = (s64)(s32)DREG((extra >> 12) & 7); + s64 quot, rem; + + if (extra & 0x400) { + a &= 0xffffffffu; + a |= (s64)DREG(extra & 7) << 32; + } + rem = a % (s64)(s32)src; + quot = a / (s64)(s32)src; + if ((quot & UVAL64 (0xffffffff80000000)) != 0 + && (quot & UVAL64 (0xffffffff80000000)) != UVAL64 (0xffffffff80000000)) + { + flag_V = M68K_SR_V; + flag_N = M68K_SR_N; + flag_C = 0; + } else { + if (((s32)rem < 0) != ((s64)a < 0)) rem = -rem; + flag_V = 0; + flag_C = 0; + flag_NotZ = ((s32)quot != 0); + flag_N = (((s32)quot) < 0); + DREG(extra & 7) = (u32)rem; + DREG((extra >> 12) & 7) = (u32)quot; + } + return 12; + } + else + { + /* unsigned */ + u64 a = (u64)(u32)DREG((extra >> 12) & 7); + u64 quot, rem; + + if (extra & 0x400) { + a &= 0xffffffffu; + a |= (u64)DREG(extra & 7) << 32; + } + rem = a % (u64)src; + quot = a / (u64)src; + if (quot > 0xffffffffu) { + flag_V = M68K_SR_V; + flag_N = M68K_SR_N; + flag_C = 0; + } else { + flag_V = 0; + flag_C = 0; + flag_NotZ = ((s32)quot != 0); + flag_N = (((s32)quot) < 0); + DREG(extra & 7) = (u32)rem; + DREG((extra >> 12) & 7) = (u32)quot; + } + return 0; + } +} + +static __inline__ void MOVEC2(int XN, int RC) +{ + u32 *reg; + int xreg = RC & 0x0007; + + if (RC & 0x0008) + reg = &(AREGu32(xreg)); + else + reg = &(DREGu32(xreg)); + + switch(XN) { + case 0: *reg = m68kcontext.sfc; break; + case 1: *reg = m68kcontext.dfc; break; + case 2: + { + *reg = m68kcontext.cacr & 0x00000003; /* 68020 mask */ + break; + } + + case 0x800: *reg = USP; break; + case 0x801: *reg = m68kcontext.vbr; break; + case 0x802: *reg = m68kcontext.caar; break; + case 0x803: *reg = (flag_M == 1) ? AREGu32(7) : MSP; break; + case 0x804: *reg = (flag_M == 0) ? AREGu32(7) : ISP; break; + } +} + +static __inline__ void MOVE2C(int XN, int RC) +{ + u32 *reg; + int xreg = RC & 0x0007; + + if (RC & 0x0008) + reg = &(AREGu32(xreg)); + else + reg = &(DREGu32(xreg)); + + switch(XN) { + case 0: m68kcontext.sfc = *reg & 7; break; + case 1: m68kcontext.dfc = *reg & 7; break; + case 2: + { + m68kcontext.cacr = *reg & 0x0000000F; /* 68020 mask */ + break; + } + + case 0x800: USP = *reg; break; + case 0x801: m68kcontext.vbr = *reg; break; + case 0x802: m68kcontext.caar = *reg & 0xFC; break; + case 0x803: MSP = *reg; if (flag_M == 1) AREGu32(7) = MSP; break; + case 0x804: ISP = *reg; if (flag_M == 0) AREGu32(7) = ISP; break; + } +} + +static __attribute__ ((noinline)) void DECODE_EXT_WORD_020 (u32 *adr) +{ + u16 ext; + s32 index = 0; + + FETCH_WORD(ext); + + if (ext & 0x0100) { + /* 68020+ Full Extension Word */ + s32 disp = 0, outer = 0; + + /* Base Register Suppressed */ + if (ext & 0x80) + *adr = 0; + + /* Base Displacement */ + if ((ext & 0x0030) == 0x20) { + FETCH_SWORD(disp); + } + else if ((ext & 0x0030) == 0x30) { + FETCH_LONG(disp); + } + *adr += disp; + + /* Index Suppressed ? */ + if ((ext & 0x0040) == 0) { + /* Index not suppressed */ + if (ext & 0x8000) { + if (ext & 0x0800) + index = AREGs32((ext >> 12) & 7); + else + index = AREGs16((ext >> 12) & 7); + } else { + if (ext & 0x0800) + index = DREGs32(ext >> 12); + else + index = DREGs16(ext >> 12); + } + /* Index *= SCALE */ + index <<= (ext >> 9) & 3; + } + + /* Preindexed */ + if ((ext & 0x0004) == 0) + *adr += index; + /* Memory Indirect */ + if (ext & 0x0003) { + u32 res; + READ_LONG_F(*adr, res); + *adr = res; + } + /* Postindexed */ + if (ext & 0x0004) + *adr += index; + + /* Outer Displacement */ + if ((ext & 0x0003) == 0x0002) { + FETCH_SWORD(outer); + } + else if ((ext & 0x0003) == 0x0003) { + FETCH_LONG(outer); + } + + *adr += outer; + } else { + /* 68000+ Brief Extension Word */ + + /* Index */ + if (ext & 0x8000) { + if (ext & 0x0800) + index = AREGs32((ext >> 12) & 7); + else + index = AREGs16((ext >> 12) & 7); + } else { + if (ext & 0x0800) + index = DREGs32((ext >> 12)); + else + index = DREGs16((ext >> 12)); + } + /* Index *= SCALE (only M68020+) */ + index <<= (ext >> 9) & 3; + + *adr += (s8)(ext) + index; + } +} + + +static __inline__ void DECODE_EXT_WORD_000 (u32 *adr) +{ + u16 ext; + s32 index = 0; + + FETCH_WORD(ext); + + /* Index */ + if (ext & 0x8000) { + if (ext & 0x0800) + index = AREGs32((ext >> 12) & 7); + else + index = AREGs16((ext >> 12) & 7); + } else { + if (ext & 0x0800) + index = DREGs32((ext >> 12)); + else + index = DREGs16((ext >> 12)); + } + *adr += (s8)(ext) + index; +} + + +static FAMEC_EXTRA_INLINE u8 bitset_count(u32 data) +{ + unsigned int const MASK1 = 0x55555555; + unsigned int const MASK2 = 0x33333333; + unsigned int const MASK4 = 0x0f0f0f0f; + unsigned int const MASK6 = 0x0000003f; + + unsigned int const w = (data & MASK1) + ((data >> 1) & MASK1); + unsigned int const x = (w & MASK2) + ((w >> 2) & MASK2); + unsigned int const y = ((x + (x >> 4)) & MASK4); + unsigned int const z = (y + (y >> 8)); + unsigned int const c = (z + (z >> 16)) & MASK6; + + return c; +} + + +/* + DIVU + Unsigned division + */ +static u32 getDivu68kCycles(u32 dividend, u16 divisor) +{ + u32 mcycles; + u32 hdivisor; + int i; + + if ( (u16) divisor == 0) + return 0; + + /* Overflow */ + if ( (dividend >> 16) >= divisor) + return 10; + + mcycles = 38; + hdivisor = ((u32) divisor) << 16; + + for ( i = 0; i < 15; i++) + { + u32 temp; + temp = dividend; + + dividend <<= 1; + + /* If carry from shift */ + if ( (int) temp < 0) + { + dividend -= hdivisor; + } + + else + { + mcycles += 2; + if ( dividend >= hdivisor) + { + dividend -= hdivisor; + mcycles--; + } + } + } + + return mcycles * 2; +} + +/* + DIVS + Signed division + */ +static u32 getDivs68kCycles(s32 dividend, s16 divisor) +{ + u32 mcycles; + u32 aquot; + int i; + + if ( (s16) divisor == 0) + return 0; + + mcycles = 6; + + if ( dividend < 0) + mcycles++; + + /* Check for absolute overflow */ + if ( ((u32) abs( dividend) >> 16) >= (u16) abs( divisor)) + { + return (mcycles + 2) * 2; + } + + /* Absolute quotient */ + aquot = (u32) abs( dividend) / (u16) abs( divisor); + + mcycles += 55; + + if ( divisor >= 0) + { + if ( dividend >= 0) + mcycles--; + else + mcycles++; + } + + /* Count 15 msbits in absolute of quotient */ + + for ( i = 0; i < 15; i++) + { + if ( (s16) aquot >= 0) + mcycles++; + aquot <<= 1; + } + + return mcycles * 2; +} + + +#define OPCODES_M68000 +#undef OPCODES_M68020 + +#define DECODE_EXT_WORD DECODE_EXT_WORD_000 + +#define OPCODE(N_OP) static int OP_000_##N_OP(const u32 Opcode, M68K_CONTEXT &m68kcontext) +#define CAST_OP(N_OP) (opcode_func)&OP_000_##N_OP +#define JUMPTABLE m68k_jumptable000 #include "famec_opcodes.h" -#endif +#include "famec_jumptable.h" +#undef OPCODE +#undef CAST_OP +#undef JUMPTABLE +#undef DECODE_EXT_WORD + + +#define OPCODES_M68020 +#undef OPCODES_M68000 + +#define DECODE_EXT_WORD DECODE_EXT_WORD_020 + +#define OPCODE(N_OP) static int OP_020_##N_OP(const u32 Opcode, M68K_CONTEXT &m68kcontext) +#define CAST_OP(N_OP) (opcode_func)&OP_020_##N_OP +#define JUMPTABLE m68k_jumptable020 +#include "famec_opcodes.h" +#include "famec_jumptable.h" +#undef OPCODE +#undef CAST_OP +#undef JUMPTABLE +#undef DECODE_EXT_WORD // main exec function @@ -1969,4168 +1668,93 @@ static FAMEC_EXTRA_INLINE void execute_exception_group_0(s32 vect, u16 inst_reg, /***************************************************************************/ u32 m68k_emulate(s32 cycles) { - if (initialised) - { - - DISA_EMULATE_START(cycles, m68kcontext.cycles_counter); - + M68K_CONTEXT *pm68kcontext = &m68kcontext; + +#if 0 /* Comprobar si la CPU esta detenida debido a un doble error de bus */ if (m68kcontext.execinfo & M68K_FAULTED) return (u32)-1; - - if (m68kcontext.execinfo & M68K_HALTED) - { - if (interrupt_chk__() <= 0) - { - /* La CPU esta detenida mediante la instruccion STOP */ - /* Agregar ciclos de reloj requeridos */ - m68kcontext.cycles_counter += cycles; - return 0; - } - m68kcontext.execinfo &= ~M68K_HALTED; - } - - -#ifdef FAMEC_DEBUG - printf("Ciclos a ejecutar: %d\n",cycles); #endif - + /* Poner la CPU en estado de ejecucion */ - m68kcontext.execinfo |= M68K_RUNNING; - + pm68kcontext->execinfo |= M68K_RUNNING; + // Cache SR - SET_SR(m68kcontext.sr) - + SET_SR(pm68kcontext->sr) + // Cache PPL flag_I = M68K_PPL; - + // Fijar PC - SET_PC(m68kcontext.pc) - -#ifdef FAMEC_DEBUG - printf("PC: 0x%08X\n",PC); - printf("BasePC: 0x%08X\n",BasePC); -#endif - + SET_PC(pm68kcontext->pc) + /* guardar ciclos de ejecucion solicitados */ - io_cycle_counter = cycles; - cycles_needed = 0; - -#ifdef FAMEC_EMULATE_TRACE - if (!(m68kcontext.execinfo & M68K_EMULATE_TRACE)) -#endif - { - s32 line=interrupt_chk__(); - if (line>0) - { - /* Desactivar interrupcion */ - m68kcontext.interrupts[0] &= ~(1 << ((u32)line)); - - /* comprobar si hay rutina de acknowledge */ - if (m68kcontext.iack_handler != NULL) - m68kcontext.iack_handler(line); - - execute_exception(m68kcontext.interrupts[(u32)line]); - flag_I = (u32)line; - } -#ifdef FAMEC_EMULATE_TRACE - else - if (flag_T) - { - m68kcontext.execinfo |= M68K_EMULATE_TRACE; - cycles_needed= io_cycle_counter; - io_cycle_counter=0; - } -#endif - } - - -#ifndef FAMEC_NO_GOTOS -famec_Exec: -#endif - -#ifdef FAMEC_DEBUG - printf("Antes de NEXT... PC = 0x%08X\n",PC); -#endif - - NEXT - -#ifndef FAMEC_NO_GOTOS - -#define OPCODE(N_OP) OP_##N_OP: -#define CAST_OP(N_OP) (opcode_func)&&OP_##N_OP -#include "famec_opcodes.h" - -famec_Exec_End: -#endif - -#ifdef FAMEC_EMULATE_TRACE - if (m68kcontext.execinfo & M68K_EMULATE_TRACE) + pm68kcontext->io_cycle_counter = cycles << mainMenu_CPU_speed; + pm68kcontext->more_cycles_to_do = 0; + pm68kcontext->cycles_not_done = 0; + + // Check for new pending interrupts + s32 line = interrupt_chk__(*pm68kcontext); + + if (pm68kcontext->execinfo & M68K_HALTED && line <= 0) { - io_cycle_counter= cycles_needed; - m68kcontext.execinfo &= ~M68K_EMULATE_TRACE; - m68kcontext.execinfo |= M68K_DO_TRACE; - execute_exception(M68K_TRACE_EX); - flag_T=0; - if (io_cycle_counter > 0) - { - NEXT - } + // CPU is HALTED -> no cycles to emulate + finish_emulate(cycles); + return M68K_OK; } - else -#endif - if (cycles_needed>0) - { - s32 line=interrupt_chk__(); - io_cycle_counter= cycles_needed; - if (line>0) - { - /* Desactivar interrupcion */ - m68kcontext.interrupts[0] &= ~(1 << ((u32)line)); - - /* comprobar si hay rutina de acknowledge */ - if (m68kcontext.iack_handler != NULL) - m68kcontext.iack_handler(line); - - execute_exception(m68kcontext.interrupts[(u32)line]); - flag_I = (u32)line; - } -#ifdef FAMEC_EMULATE_TRACE - else - if (!(flag_T)) -#endif - if (io_cycle_counter > 0) - { - NEXT - } - } - - m68kcontext.sr = GET_SR; - m68kcontext.pc = GET_PC; - - m68kcontext.execinfo &= ~M68K_RUNNING; - - // Actualizar contador de ciclos - m68kcontext.cycles_counter += (cycles - io_cycle_counter); -#ifdef FAMEC_DEBUG - printf("En really end...\n"); - printf("PC: 0x%08X\n",PC); - printf("BasePC: 0x%08X\n",BasePC); - printf("pc: 0x%08X\n",m68kcontext.pc); -#endif - - } - else - { - u32 i, j; - - for(i = 0x0000; i <= 0xFFFF; i += 0x0001) - JumpTable[0x0000 + i] = CAST_OP(0x4AFC); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0000 + i] = CAST_OP(0x0000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0010 + i] = CAST_OP(0x0010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0018 + i] = CAST_OP(0x0018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0020 + i] = CAST_OP(0x0020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0028 + i] = CAST_OP(0x0028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0030 + i] = CAST_OP(0x0030); - JumpTable[0x0038] = CAST_OP(0x0038); - JumpTable[0x0039] = CAST_OP(0x0039); - JumpTable[0x001F] = CAST_OP(0x001F); - JumpTable[0x0027] = CAST_OP(0x0027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0040 + i] = CAST_OP(0x0040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0050 + i] = CAST_OP(0x0050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0058 + i] = CAST_OP(0x0058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0060 + i] = CAST_OP(0x0060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0068 + i] = CAST_OP(0x0068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0070 + i] = CAST_OP(0x0070); - JumpTable[0x0078] = CAST_OP(0x0078); - JumpTable[0x0079] = CAST_OP(0x0079); - JumpTable[0x005F] = CAST_OP(0x005F); - JumpTable[0x0067] = CAST_OP(0x0067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0080 + i] = CAST_OP(0x0080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0090 + i] = CAST_OP(0x0090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0098 + i] = CAST_OP(0x0098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x00A0 + i] = CAST_OP(0x00A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x00A8 + i] = CAST_OP(0x00A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x00B0 + i] = CAST_OP(0x00B0); - JumpTable[0x00B8] = CAST_OP(0x00B8); - JumpTable[0x00B9] = CAST_OP(0x00B9); - JumpTable[0x009F] = CAST_OP(0x009F); - JumpTable[0x00A7] = CAST_OP(0x00A7); - JumpTable[0x003C] = CAST_OP(0x003C); - JumpTable[0x007C] = CAST_OP(0x007C); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0200 + i] = CAST_OP(0x0200); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0210 + i] = CAST_OP(0x0210); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0218 + i] = CAST_OP(0x0218); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0220 + i] = CAST_OP(0x0220); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0228 + i] = CAST_OP(0x0228); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0230 + i] = CAST_OP(0x0230); - JumpTable[0x0238] = CAST_OP(0x0238); - JumpTable[0x0239] = CAST_OP(0x0239); - JumpTable[0x021F] = CAST_OP(0x021F); - JumpTable[0x0227] = CAST_OP(0x0227); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0240 + i] = CAST_OP(0x0240); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0250 + i] = CAST_OP(0x0250); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0258 + i] = CAST_OP(0x0258); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0260 + i] = CAST_OP(0x0260); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0268 + i] = CAST_OP(0x0268); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0270 + i] = CAST_OP(0x0270); - JumpTable[0x0278] = CAST_OP(0x0278); - JumpTable[0x0279] = CAST_OP(0x0279); - JumpTable[0x025F] = CAST_OP(0x025F); - JumpTable[0x0267] = CAST_OP(0x0267); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0280 + i] = CAST_OP(0x0280); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0290 + i] = CAST_OP(0x0290); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0298 + i] = CAST_OP(0x0298); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x02A0 + i] = CAST_OP(0x02A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x02A8 + i] = CAST_OP(0x02A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x02B0 + i] = CAST_OP(0x02B0); - JumpTable[0x02B8] = CAST_OP(0x02B8); - JumpTable[0x02B9] = CAST_OP(0x02B9); - JumpTable[0x029F] = CAST_OP(0x029F); - JumpTable[0x02A7] = CAST_OP(0x02A7); - JumpTable[0x023C] = CAST_OP(0x023C); - JumpTable[0x027C] = CAST_OP(0x027C); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A00 + i] = CAST_OP(0x0A00); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A10 + i] = CAST_OP(0x0A10); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0A18 + i] = CAST_OP(0x0A18); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0A20 + i] = CAST_OP(0x0A20); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A28 + i] = CAST_OP(0x0A28); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A30 + i] = CAST_OP(0x0A30); - JumpTable[0x0A38] = CAST_OP(0x0A38); - JumpTable[0x0A39] = CAST_OP(0x0A39); - JumpTable[0x0A1F] = CAST_OP(0x0A1F); - JumpTable[0x0A27] = CAST_OP(0x0A27); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A40 + i] = CAST_OP(0x0A40); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A50 + i] = CAST_OP(0x0A50); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0A58 + i] = CAST_OP(0x0A58); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0A60 + i] = CAST_OP(0x0A60); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A68 + i] = CAST_OP(0x0A68); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A70 + i] = CAST_OP(0x0A70); - JumpTable[0x0A78] = CAST_OP(0x0A78); - JumpTable[0x0A79] = CAST_OP(0x0A79); - JumpTable[0x0A5F] = CAST_OP(0x0A5F); - JumpTable[0x0A67] = CAST_OP(0x0A67); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A80 + i] = CAST_OP(0x0A80); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0A90 + i] = CAST_OP(0x0A90); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0A98 + i] = CAST_OP(0x0A98); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0AA0 + i] = CAST_OP(0x0AA0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0AA8 + i] = CAST_OP(0x0AA8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0AB0 + i] = CAST_OP(0x0AB0); - JumpTable[0x0AB8] = CAST_OP(0x0AB8); - JumpTable[0x0AB9] = CAST_OP(0x0AB9); - JumpTable[0x0A9F] = CAST_OP(0x0A9F); - JumpTable[0x0AA7] = CAST_OP(0x0AA7); - JumpTable[0x0A3C] = CAST_OP(0x0A3C); - JumpTable[0x0A7C] = CAST_OP(0x0A7C); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0400 + i] = CAST_OP(0x0400); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0410 + i] = CAST_OP(0x0410); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0418 + i] = CAST_OP(0x0418); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0420 + i] = CAST_OP(0x0420); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0428 + i] = CAST_OP(0x0428); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0430 + i] = CAST_OP(0x0430); - JumpTable[0x0438] = CAST_OP(0x0438); - JumpTable[0x0439] = CAST_OP(0x0439); - JumpTable[0x041F] = CAST_OP(0x041F); - JumpTable[0x0427] = CAST_OP(0x0427); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0440 + i] = CAST_OP(0x0440); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0450 + i] = CAST_OP(0x0450); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0458 + i] = CAST_OP(0x0458); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0460 + i] = CAST_OP(0x0460); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0468 + i] = CAST_OP(0x0468); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0470 + i] = CAST_OP(0x0470); - JumpTable[0x0478] = CAST_OP(0x0478); - JumpTable[0x0479] = CAST_OP(0x0479); - JumpTable[0x045F] = CAST_OP(0x045F); - JumpTable[0x0467] = CAST_OP(0x0467); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0480 + i] = CAST_OP(0x0480); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0490 + i] = CAST_OP(0x0490); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0498 + i] = CAST_OP(0x0498); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x04A0 + i] = CAST_OP(0x04A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x04A8 + i] = CAST_OP(0x04A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x04B0 + i] = CAST_OP(0x04B0); - JumpTable[0x04B8] = CAST_OP(0x04B8); - JumpTable[0x04B9] = CAST_OP(0x04B9); - JumpTable[0x049F] = CAST_OP(0x049F); - JumpTable[0x04A7] = CAST_OP(0x04A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0600 + i] = CAST_OP(0x0600); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0610 + i] = CAST_OP(0x0610); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0618 + i] = CAST_OP(0x0618); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0620 + i] = CAST_OP(0x0620); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0628 + i] = CAST_OP(0x0628); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0630 + i] = CAST_OP(0x0630); - JumpTable[0x0638] = CAST_OP(0x0638); - JumpTable[0x0639] = CAST_OP(0x0639); - JumpTable[0x061F] = CAST_OP(0x061F); - JumpTable[0x0627] = CAST_OP(0x0627); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0640 + i] = CAST_OP(0x0640); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0650 + i] = CAST_OP(0x0650); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0658 + i] = CAST_OP(0x0658); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0660 + i] = CAST_OP(0x0660); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0668 + i] = CAST_OP(0x0668); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0670 + i] = CAST_OP(0x0670); - JumpTable[0x0678] = CAST_OP(0x0678); - JumpTable[0x0679] = CAST_OP(0x0679); - JumpTable[0x065F] = CAST_OP(0x065F); - JumpTable[0x0667] = CAST_OP(0x0667); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0680 + i] = CAST_OP(0x0680); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0690 + i] = CAST_OP(0x0690); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0698 + i] = CAST_OP(0x0698); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x06A0 + i] = CAST_OP(0x06A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x06A8 + i] = CAST_OP(0x06A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x06B0 + i] = CAST_OP(0x06B0); - JumpTable[0x06B8] = CAST_OP(0x06B8); - JumpTable[0x06B9] = CAST_OP(0x06B9); - JumpTable[0x069F] = CAST_OP(0x069F); - JumpTable[0x06A7] = CAST_OP(0x06A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C00 + i] = CAST_OP(0x0C00); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C10 + i] = CAST_OP(0x0C10); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0C18 + i] = CAST_OP(0x0C18); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0C20 + i] = CAST_OP(0x0C20); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C28 + i] = CAST_OP(0x0C28); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C30 + i] = CAST_OP(0x0C30); - JumpTable[0x0C38] = CAST_OP(0x0C38); - JumpTable[0x0C39] = CAST_OP(0x0C39); - JumpTable[0x0C1F] = CAST_OP(0x0C1F); - JumpTable[0x0C27] = CAST_OP(0x0C27); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C40 + i] = CAST_OP(0x0C40); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C50 + i] = CAST_OP(0x0C50); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0C58 + i] = CAST_OP(0x0C58); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0C60 + i] = CAST_OP(0x0C60); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C68 + i] = CAST_OP(0x0C68); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C70 + i] = CAST_OP(0x0C70); - JumpTable[0x0C78] = CAST_OP(0x0C78); - JumpTable[0x0C79] = CAST_OP(0x0C79); - JumpTable[0x0C5F] = CAST_OP(0x0C5F); - JumpTable[0x0C67] = CAST_OP(0x0C67); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C80 + i] = CAST_OP(0x0C80); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0C90 + i] = CAST_OP(0x0C90); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0C98 + i] = CAST_OP(0x0C98); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0CA0 + i] = CAST_OP(0x0CA0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0CA8 + i] = CAST_OP(0x0CA8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0CB0 + i] = CAST_OP(0x0CB0); - JumpTable[0x0CB8] = CAST_OP(0x0CB8); - JumpTable[0x0CB9] = CAST_OP(0x0CB9); - JumpTable[0x0C9F] = CAST_OP(0x0C9F); - JumpTable[0x0CA7] = CAST_OP(0x0CA7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0800 + i] = CAST_OP(0x0800); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0810 + i] = CAST_OP(0x0810); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0818 + i] = CAST_OP(0x0818); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0820 + i] = CAST_OP(0x0820); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0828 + i] = CAST_OP(0x0828); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0830 + i] = CAST_OP(0x0830); - JumpTable[0x0838] = CAST_OP(0x0838); - JumpTable[0x0839] = CAST_OP(0x0839); - JumpTable[0x083A] = CAST_OP(0x083A); - JumpTable[0x083B] = CAST_OP(0x083B); - JumpTable[0x081F] = CAST_OP(0x081F); - JumpTable[0x0827] = CAST_OP(0x0827); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0840 + i] = CAST_OP(0x0840); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0850 + i] = CAST_OP(0x0850); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0858 + i] = CAST_OP(0x0858); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0860 + i] = CAST_OP(0x0860); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0868 + i] = CAST_OP(0x0868); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0870 + i] = CAST_OP(0x0870); - JumpTable[0x0878] = CAST_OP(0x0878); - JumpTable[0x0879] = CAST_OP(0x0879); - JumpTable[0x085F] = CAST_OP(0x085F); - JumpTable[0x0867] = CAST_OP(0x0867); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0880 + i] = CAST_OP(0x0880); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x0890 + i] = CAST_OP(0x0890); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x0898 + i] = CAST_OP(0x0898); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x08A0 + i] = CAST_OP(0x08A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x08A8 + i] = CAST_OP(0x08A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x08B0 + i] = CAST_OP(0x08B0); - JumpTable[0x08B8] = CAST_OP(0x08B8); - JumpTable[0x08B9] = CAST_OP(0x08B9); - JumpTable[0x089F] = CAST_OP(0x089F); - JumpTable[0x08A7] = CAST_OP(0x08A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x08C0 + i] = CAST_OP(0x08C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x08D0 + i] = CAST_OP(0x08D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x08D8 + i] = CAST_OP(0x08D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x08E0 + i] = CAST_OP(0x08E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x08E8 + i] = CAST_OP(0x08E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x08F0 + i] = CAST_OP(0x08F0); - JumpTable[0x08F8] = CAST_OP(0x08F8); - JumpTable[0x08F9] = CAST_OP(0x08F9); - JumpTable[0x08DF] = CAST_OP(0x08DF); - JumpTable[0x08E7] = CAST_OP(0x08E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0100 + i + j] = CAST_OP(0x0100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0110 + i + j] = CAST_OP(0x0110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0118 + i + j] = CAST_OP(0x0118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0120 + i + j] = CAST_OP(0x0120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0128 + i + j] = CAST_OP(0x0128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0130 + i + j] = CAST_OP(0x0130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x0138 + i] = CAST_OP(0x0138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x0139 + i] = CAST_OP(0x0139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x013A + i] = CAST_OP(0x013A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x013B + i] = CAST_OP(0x013B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x013C + i] = CAST_OP(0x013C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x011F + i] = CAST_OP(0x011F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x0127 + i] = CAST_OP(0x0127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0140 + i + j] = CAST_OP(0x0140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0150 + i + j] = CAST_OP(0x0150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0158 + i + j] = CAST_OP(0x0158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0160 + i + j] = CAST_OP(0x0160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0168 + i + j] = CAST_OP(0x0168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0170 + i + j] = CAST_OP(0x0170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x0178 + i] = CAST_OP(0x0178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x0179 + i] = CAST_OP(0x0179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x015F + i] = CAST_OP(0x015F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x0167 + i] = CAST_OP(0x0167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0180 + i + j] = CAST_OP(0x0180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0190 + i + j] = CAST_OP(0x0190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0198 + i + j] = CAST_OP(0x0198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01A0 + i + j] = CAST_OP(0x01A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01A8 + i + j] = CAST_OP(0x01A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01B0 + i + j] = CAST_OP(0x01B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01B8 + i] = CAST_OP(0x01B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01B9 + i] = CAST_OP(0x01B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x019F + i] = CAST_OP(0x019F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01A7 + i] = CAST_OP(0x01A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01C0 + i + j] = CAST_OP(0x01C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01D0 + i + j] = CAST_OP(0x01D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01D8 + i + j] = CAST_OP(0x01D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01E0 + i + j] = CAST_OP(0x01E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01E8 + i + j] = CAST_OP(0x01E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01F0 + i + j] = CAST_OP(0x01F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01F8 + i] = CAST_OP(0x01F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01F9 + i] = CAST_OP(0x01F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01DF + i] = CAST_OP(0x01DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x01E7 + i] = CAST_OP(0x01E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0108 + i + j] = CAST_OP(0x0108); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0148 + i + j] = CAST_OP(0x0148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x0188 + i + j] = CAST_OP(0x0188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x01C8 + i + j] = CAST_OP(0x01C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1000 + i + j] = CAST_OP(0x1000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1080 + i + j] = CAST_OP(0x1080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10C0 + i + j] = CAST_OP(0x10C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1100 + i + j] = CAST_OP(0x1100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1140 + i + j] = CAST_OP(0x1140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1180 + i + j] = CAST_OP(0x1180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x11C0 + i] = CAST_OP(0x11C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x13C0 + i] = CAST_OP(0x13C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1EC0 + i] = CAST_OP(0x1EC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1F00 + i] = CAST_OP(0x1F00); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1008 + i + j] = CAST_OP(0x1008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1088 + i + j] = CAST_OP(0x1088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10C8 + i + j] = CAST_OP(0x10C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1108 + i + j] = CAST_OP(0x1108); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1148 + i + j] = CAST_OP(0x1148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1188 + i + j] = CAST_OP(0x1188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x11C8 + i] = CAST_OP(0x11C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x13C8 + i] = CAST_OP(0x13C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1EC8 + i] = CAST_OP(0x1EC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1F08 + i] = CAST_OP(0x1F08); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1010 + i + j] = CAST_OP(0x1010); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1090 + i + j] = CAST_OP(0x1090); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10D0 + i + j] = CAST_OP(0x10D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1110 + i + j] = CAST_OP(0x1110); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1150 + i + j] = CAST_OP(0x1150); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1190 + i + j] = CAST_OP(0x1190); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x11D0 + i] = CAST_OP(0x11D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x13D0 + i] = CAST_OP(0x13D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1ED0 + i] = CAST_OP(0x1ED0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1F10 + i] = CAST_OP(0x1F10); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1018 + i + j] = CAST_OP(0x1018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1098 + i + j] = CAST_OP(0x1098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10D8 + i + j] = CAST_OP(0x10D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1118 + i + j] = CAST_OP(0x1118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1158 + i + j] = CAST_OP(0x1158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1198 + i + j] = CAST_OP(0x1198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x11D8 + i] = CAST_OP(0x11D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x13D8 + i] = CAST_OP(0x13D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x1ED8 + i] = CAST_OP(0x1ED8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x1F18 + i] = CAST_OP(0x1F18); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1020 + i + j] = CAST_OP(0x1020); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x10A0 + i + j] = CAST_OP(0x10A0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10E0 + i + j] = CAST_OP(0x10E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1120 + i + j] = CAST_OP(0x1120); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1160 + i + j] = CAST_OP(0x1160); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x11A0 + i + j] = CAST_OP(0x11A0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x11E0 + i] = CAST_OP(0x11E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x13E0 + i] = CAST_OP(0x13E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x1EE0 + i] = CAST_OP(0x1EE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x1F20 + i] = CAST_OP(0x1F20); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1028 + i + j] = CAST_OP(0x1028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x10A8 + i + j] = CAST_OP(0x10A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10E8 + i + j] = CAST_OP(0x10E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1128 + i + j] = CAST_OP(0x1128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1168 + i + j] = CAST_OP(0x1168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x11A8 + i + j] = CAST_OP(0x11A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x11E8 + i] = CAST_OP(0x11E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x13E8 + i] = CAST_OP(0x13E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1EE8 + i] = CAST_OP(0x1EE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1F28 + i] = CAST_OP(0x1F28); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1030 + i + j] = CAST_OP(0x1030); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x10B0 + i + j] = CAST_OP(0x10B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x10F0 + i + j] = CAST_OP(0x10F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x1130 + i + j] = CAST_OP(0x1130); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x1170 + i + j] = CAST_OP(0x1170); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x11B0 + i + j] = CAST_OP(0x11B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x11F0 + i] = CAST_OP(0x11F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x13F0 + i] = CAST_OP(0x13F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1EF0 + i] = CAST_OP(0x1EF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x1F30 + i] = CAST_OP(0x1F30); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x1038 + i] = CAST_OP(0x1038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x10B8 + i] = CAST_OP(0x10B8); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10F8 + i] = CAST_OP(0x10F8); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x1138 + i] = CAST_OP(0x1138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x1178 + i] = CAST_OP(0x1178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x11B8 + i] = CAST_OP(0x11B8); - JumpTable[0x11F8] = CAST_OP(0x11F8); - JumpTable[0x13F8] = CAST_OP(0x13F8); - JumpTable[0x1EF8] = CAST_OP(0x1EF8); - JumpTable[0x1F38] = CAST_OP(0x1F38); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x1039 + i] = CAST_OP(0x1039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x10B9 + i] = CAST_OP(0x10B9); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10F9 + i] = CAST_OP(0x10F9); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x1139 + i] = CAST_OP(0x1139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x1179 + i] = CAST_OP(0x1179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x11B9 + i] = CAST_OP(0x11B9); - JumpTable[0x11F9] = CAST_OP(0x11F9); - JumpTable[0x13F9] = CAST_OP(0x13F9); - JumpTable[0x1EF9] = CAST_OP(0x1EF9); - JumpTable[0x1F39] = CAST_OP(0x1F39); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x103A + i] = CAST_OP(0x103A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x10BA + i] = CAST_OP(0x10BA); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10FA + i] = CAST_OP(0x10FA); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x113A + i] = CAST_OP(0x113A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x117A + i] = CAST_OP(0x117A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x11BA + i] = CAST_OP(0x11BA); - JumpTable[0x11FA] = CAST_OP(0x11FA); - JumpTable[0x13FA] = CAST_OP(0x13FA); - JumpTable[0x1EFA] = CAST_OP(0x1EFA); - JumpTable[0x1F3A] = CAST_OP(0x1F3A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x103B + i] = CAST_OP(0x103B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x10BB + i] = CAST_OP(0x10BB); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10FB + i] = CAST_OP(0x10FB); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x113B + i] = CAST_OP(0x113B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x117B + i] = CAST_OP(0x117B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x11BB + i] = CAST_OP(0x11BB); - JumpTable[0x11FB] = CAST_OP(0x11FB); - JumpTable[0x13FB] = CAST_OP(0x13FB); - JumpTable[0x1EFB] = CAST_OP(0x1EFB); - JumpTable[0x1F3B] = CAST_OP(0x1F3B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x103C + i] = CAST_OP(0x103C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x10BC + i] = CAST_OP(0x10BC); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10FC + i] = CAST_OP(0x10FC); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x113C + i] = CAST_OP(0x113C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x117C + i] = CAST_OP(0x117C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x11BC + i] = CAST_OP(0x11BC); - JumpTable[0x11FC] = CAST_OP(0x11FC); - JumpTable[0x13FC] = CAST_OP(0x13FC); - JumpTable[0x1EFC] = CAST_OP(0x1EFC); - JumpTable[0x1F3C] = CAST_OP(0x1F3C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x101F + i] = CAST_OP(0x101F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x109F + i] = CAST_OP(0x109F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10DF + i] = CAST_OP(0x10DF); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x111F + i] = CAST_OP(0x111F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x115F + i] = CAST_OP(0x115F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x119F + i] = CAST_OP(0x119F); - JumpTable[0x11DF] = CAST_OP(0x11DF); - JumpTable[0x13DF] = CAST_OP(0x13DF); - JumpTable[0x1EDF] = CAST_OP(0x1EDF); - JumpTable[0x1F1F] = CAST_OP(0x1F1F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x1027 + i] = CAST_OP(0x1027); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x10A7 + i] = CAST_OP(0x10A7); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x10E7 + i] = CAST_OP(0x10E7); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x1127 + i] = CAST_OP(0x1127); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x1167 + i] = CAST_OP(0x1167); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x11A7 + i] = CAST_OP(0x11A7); - JumpTable[0x11E7] = CAST_OP(0x11E7); - JumpTable[0x13E7] = CAST_OP(0x13E7); - JumpTable[0x1EE7] = CAST_OP(0x1EE7); - JumpTable[0x1F27] = CAST_OP(0x1F27); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2000 + i + j] = CAST_OP(0x2000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2080 + i + j] = CAST_OP(0x2080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20C0 + i + j] = CAST_OP(0x20C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2100 + i + j] = CAST_OP(0x2100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2140 + i + j] = CAST_OP(0x2140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2180 + i + j] = CAST_OP(0x2180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x21C0 + i] = CAST_OP(0x21C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x23C0 + i] = CAST_OP(0x23C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2EC0 + i] = CAST_OP(0x2EC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2F00 + i] = CAST_OP(0x2F00); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2008 + i + j] = CAST_OP(0x2008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2088 + i + j] = CAST_OP(0x2088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20C8 + i + j] = CAST_OP(0x20C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2108 + i + j] = CAST_OP(0x2108); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2148 + i + j] = CAST_OP(0x2148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2188 + i + j] = CAST_OP(0x2188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x21C8 + i] = CAST_OP(0x21C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x23C8 + i] = CAST_OP(0x23C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2EC8 + i] = CAST_OP(0x2EC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2F08 + i] = CAST_OP(0x2F08); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2010 + i + j] = CAST_OP(0x2010); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2090 + i + j] = CAST_OP(0x2090); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20D0 + i + j] = CAST_OP(0x20D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2110 + i + j] = CAST_OP(0x2110); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2150 + i + j] = CAST_OP(0x2150); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2190 + i + j] = CAST_OP(0x2190); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x21D0 + i] = CAST_OP(0x21D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x23D0 + i] = CAST_OP(0x23D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2ED0 + i] = CAST_OP(0x2ED0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2F10 + i] = CAST_OP(0x2F10); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2018 + i + j] = CAST_OP(0x2018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2098 + i + j] = CAST_OP(0x2098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20D8 + i + j] = CAST_OP(0x20D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2118 + i + j] = CAST_OP(0x2118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2158 + i + j] = CAST_OP(0x2158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2198 + i + j] = CAST_OP(0x2198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x21D8 + i] = CAST_OP(0x21D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x23D8 + i] = CAST_OP(0x23D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x2ED8 + i] = CAST_OP(0x2ED8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x2F18 + i] = CAST_OP(0x2F18); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2020 + i + j] = CAST_OP(0x2020); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x20A0 + i + j] = CAST_OP(0x20A0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20E0 + i + j] = CAST_OP(0x20E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2120 + i + j] = CAST_OP(0x2120); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2160 + i + j] = CAST_OP(0x2160); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x21A0 + i + j] = CAST_OP(0x21A0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x21E0 + i] = CAST_OP(0x21E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x23E0 + i] = CAST_OP(0x23E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x2EE0 + i] = CAST_OP(0x2EE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x2F20 + i] = CAST_OP(0x2F20); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2028 + i + j] = CAST_OP(0x2028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x20A8 + i + j] = CAST_OP(0x20A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20E8 + i + j] = CAST_OP(0x20E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2128 + i + j] = CAST_OP(0x2128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2168 + i + j] = CAST_OP(0x2168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x21A8 + i + j] = CAST_OP(0x21A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x21E8 + i] = CAST_OP(0x21E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x23E8 + i] = CAST_OP(0x23E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2EE8 + i] = CAST_OP(0x2EE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2F28 + i] = CAST_OP(0x2F28); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2030 + i + j] = CAST_OP(0x2030); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x20B0 + i + j] = CAST_OP(0x20B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x20F0 + i + j] = CAST_OP(0x20F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x2130 + i + j] = CAST_OP(0x2130); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2170 + i + j] = CAST_OP(0x2170); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x21B0 + i + j] = CAST_OP(0x21B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x21F0 + i] = CAST_OP(0x21F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x23F0 + i] = CAST_OP(0x23F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2EF0 + i] = CAST_OP(0x2EF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x2F30 + i] = CAST_OP(0x2F30); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2038 + i] = CAST_OP(0x2038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x20B8 + i] = CAST_OP(0x20B8); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20F8 + i] = CAST_OP(0x20F8); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x2138 + i] = CAST_OP(0x2138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2178 + i] = CAST_OP(0x2178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x21B8 + i] = CAST_OP(0x21B8); - JumpTable[0x21F8] = CAST_OP(0x21F8); - JumpTable[0x23F8] = CAST_OP(0x23F8); - JumpTable[0x2EF8] = CAST_OP(0x2EF8); - JumpTable[0x2F38] = CAST_OP(0x2F38); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2039 + i] = CAST_OP(0x2039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x20B9 + i] = CAST_OP(0x20B9); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20F9 + i] = CAST_OP(0x20F9); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x2139 + i] = CAST_OP(0x2139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2179 + i] = CAST_OP(0x2179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x21B9 + i] = CAST_OP(0x21B9); - JumpTable[0x21F9] = CAST_OP(0x21F9); - JumpTable[0x23F9] = CAST_OP(0x23F9); - JumpTable[0x2EF9] = CAST_OP(0x2EF9); - JumpTable[0x2F39] = CAST_OP(0x2F39); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x203A + i] = CAST_OP(0x203A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x20BA + i] = CAST_OP(0x20BA); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20FA + i] = CAST_OP(0x20FA); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x213A + i] = CAST_OP(0x213A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x217A + i] = CAST_OP(0x217A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x21BA + i] = CAST_OP(0x21BA); - JumpTable[0x21FA] = CAST_OP(0x21FA); - JumpTable[0x23FA] = CAST_OP(0x23FA); - JumpTable[0x2EFA] = CAST_OP(0x2EFA); - JumpTable[0x2F3A] = CAST_OP(0x2F3A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x203B + i] = CAST_OP(0x203B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x20BB + i] = CAST_OP(0x20BB); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20FB + i] = CAST_OP(0x20FB); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x213B + i] = CAST_OP(0x213B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x217B + i] = CAST_OP(0x217B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x21BB + i] = CAST_OP(0x21BB); - JumpTable[0x21FB] = CAST_OP(0x21FB); - JumpTable[0x23FB] = CAST_OP(0x23FB); - JumpTable[0x2EFB] = CAST_OP(0x2EFB); - JumpTable[0x2F3B] = CAST_OP(0x2F3B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x203C + i] = CAST_OP(0x203C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x20BC + i] = CAST_OP(0x20BC); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20FC + i] = CAST_OP(0x20FC); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x213C + i] = CAST_OP(0x213C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x217C + i] = CAST_OP(0x217C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x21BC + i] = CAST_OP(0x21BC); - JumpTable[0x21FC] = CAST_OP(0x21FC); - JumpTable[0x23FC] = CAST_OP(0x23FC); - JumpTable[0x2EFC] = CAST_OP(0x2EFC); - JumpTable[0x2F3C] = CAST_OP(0x2F3C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x201F + i] = CAST_OP(0x201F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x209F + i] = CAST_OP(0x209F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20DF + i] = CAST_OP(0x20DF); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x211F + i] = CAST_OP(0x211F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x215F + i] = CAST_OP(0x215F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x219F + i] = CAST_OP(0x219F); - JumpTable[0x21DF] = CAST_OP(0x21DF); - JumpTable[0x23DF] = CAST_OP(0x23DF); - JumpTable[0x2EDF] = CAST_OP(0x2EDF); - JumpTable[0x2F1F] = CAST_OP(0x2F1F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2027 + i] = CAST_OP(0x2027); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x20A7 + i] = CAST_OP(0x20A7); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x20E7 + i] = CAST_OP(0x20E7); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x2127 + i] = CAST_OP(0x2127); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2167 + i] = CAST_OP(0x2167); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x21A7 + i] = CAST_OP(0x21A7); - JumpTable[0x21E7] = CAST_OP(0x21E7); - JumpTable[0x23E7] = CAST_OP(0x23E7); - JumpTable[0x2EE7] = CAST_OP(0x2EE7); - JumpTable[0x2F27] = CAST_OP(0x2F27); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3000 + i + j] = CAST_OP(0x3000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3080 + i + j] = CAST_OP(0x3080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30C0 + i + j] = CAST_OP(0x30C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3100 + i + j] = CAST_OP(0x3100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3140 + i + j] = CAST_OP(0x3140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3180 + i + j] = CAST_OP(0x3180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x31C0 + i] = CAST_OP(0x31C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x33C0 + i] = CAST_OP(0x33C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3EC0 + i] = CAST_OP(0x3EC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3F00 + i] = CAST_OP(0x3F00); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3008 + i + j] = CAST_OP(0x3008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3088 + i + j] = CAST_OP(0x3088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30C8 + i + j] = CAST_OP(0x30C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3108 + i + j] = CAST_OP(0x3108); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3148 + i + j] = CAST_OP(0x3148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3188 + i + j] = CAST_OP(0x3188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x31C8 + i] = CAST_OP(0x31C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x33C8 + i] = CAST_OP(0x33C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3EC8 + i] = CAST_OP(0x3EC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3F08 + i] = CAST_OP(0x3F08); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3010 + i + j] = CAST_OP(0x3010); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3090 + i + j] = CAST_OP(0x3090); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30D0 + i + j] = CAST_OP(0x30D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3110 + i + j] = CAST_OP(0x3110); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3150 + i + j] = CAST_OP(0x3150); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3190 + i + j] = CAST_OP(0x3190); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x31D0 + i] = CAST_OP(0x31D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x33D0 + i] = CAST_OP(0x33D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3ED0 + i] = CAST_OP(0x3ED0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3F10 + i] = CAST_OP(0x3F10); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3018 + i + j] = CAST_OP(0x3018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3098 + i + j] = CAST_OP(0x3098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30D8 + i + j] = CAST_OP(0x30D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3118 + i + j] = CAST_OP(0x3118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3158 + i + j] = CAST_OP(0x3158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3198 + i + j] = CAST_OP(0x3198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x31D8 + i] = CAST_OP(0x31D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x33D8 + i] = CAST_OP(0x33D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x3ED8 + i] = CAST_OP(0x3ED8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x3F18 + i] = CAST_OP(0x3F18); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3020 + i + j] = CAST_OP(0x3020); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x30A0 + i + j] = CAST_OP(0x30A0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30E0 + i + j] = CAST_OP(0x30E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3120 + i + j] = CAST_OP(0x3120); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3160 + i + j] = CAST_OP(0x3160); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x31A0 + i + j] = CAST_OP(0x31A0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x31E0 + i] = CAST_OP(0x31E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x33E0 + i] = CAST_OP(0x33E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x3EE0 + i] = CAST_OP(0x3EE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x3F20 + i] = CAST_OP(0x3F20); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3028 + i + j] = CAST_OP(0x3028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x30A8 + i + j] = CAST_OP(0x30A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30E8 + i + j] = CAST_OP(0x30E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3128 + i + j] = CAST_OP(0x3128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3168 + i + j] = CAST_OP(0x3168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x31A8 + i + j] = CAST_OP(0x31A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x31E8 + i] = CAST_OP(0x31E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x33E8 + i] = CAST_OP(0x33E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3EE8 + i] = CAST_OP(0x3EE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3F28 + i] = CAST_OP(0x3F28); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3030 + i + j] = CAST_OP(0x3030); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x30B0 + i + j] = CAST_OP(0x30B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x30F0 + i + j] = CAST_OP(0x30F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x3130 + i + j] = CAST_OP(0x3130); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3170 + i + j] = CAST_OP(0x3170); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x31B0 + i + j] = CAST_OP(0x31B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x31F0 + i] = CAST_OP(0x31F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x33F0 + i] = CAST_OP(0x33F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3EF0 + i] = CAST_OP(0x3EF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x3F30 + i] = CAST_OP(0x3F30); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3038 + i] = CAST_OP(0x3038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x30B8 + i] = CAST_OP(0x30B8); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30F8 + i] = CAST_OP(0x30F8); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x3138 + i] = CAST_OP(0x3138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3178 + i] = CAST_OP(0x3178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x31B8 + i] = CAST_OP(0x31B8); - JumpTable[0x31F8] = CAST_OP(0x31F8); - JumpTable[0x33F8] = CAST_OP(0x33F8); - JumpTable[0x3EF8] = CAST_OP(0x3EF8); - JumpTable[0x3F38] = CAST_OP(0x3F38); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3039 + i] = CAST_OP(0x3039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x30B9 + i] = CAST_OP(0x30B9); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30F9 + i] = CAST_OP(0x30F9); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x3139 + i] = CAST_OP(0x3139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3179 + i] = CAST_OP(0x3179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x31B9 + i] = CAST_OP(0x31B9); - JumpTable[0x31F9] = CAST_OP(0x31F9); - JumpTable[0x33F9] = CAST_OP(0x33F9); - JumpTable[0x3EF9] = CAST_OP(0x3EF9); - JumpTable[0x3F39] = CAST_OP(0x3F39); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x303A + i] = CAST_OP(0x303A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x30BA + i] = CAST_OP(0x30BA); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30FA + i] = CAST_OP(0x30FA); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x313A + i] = CAST_OP(0x313A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x317A + i] = CAST_OP(0x317A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x31BA + i] = CAST_OP(0x31BA); - JumpTable[0x31FA] = CAST_OP(0x31FA); - JumpTable[0x33FA] = CAST_OP(0x33FA); - JumpTable[0x3EFA] = CAST_OP(0x3EFA); - JumpTable[0x3F3A] = CAST_OP(0x3F3A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x303B + i] = CAST_OP(0x303B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x30BB + i] = CAST_OP(0x30BB); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30FB + i] = CAST_OP(0x30FB); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x313B + i] = CAST_OP(0x313B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x317B + i] = CAST_OP(0x317B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x31BB + i] = CAST_OP(0x31BB); - JumpTable[0x31FB] = CAST_OP(0x31FB); - JumpTable[0x33FB] = CAST_OP(0x33FB); - JumpTable[0x3EFB] = CAST_OP(0x3EFB); - JumpTable[0x3F3B] = CAST_OP(0x3F3B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x303C + i] = CAST_OP(0x303C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x30BC + i] = CAST_OP(0x30BC); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30FC + i] = CAST_OP(0x30FC); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x313C + i] = CAST_OP(0x313C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x317C + i] = CAST_OP(0x317C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x31BC + i] = CAST_OP(0x31BC); - JumpTable[0x31FC] = CAST_OP(0x31FC); - JumpTable[0x33FC] = CAST_OP(0x33FC); - JumpTable[0x3EFC] = CAST_OP(0x3EFC); - JumpTable[0x3F3C] = CAST_OP(0x3F3C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x301F + i] = CAST_OP(0x301F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x309F + i] = CAST_OP(0x309F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30DF + i] = CAST_OP(0x30DF); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x311F + i] = CAST_OP(0x311F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x315F + i] = CAST_OP(0x315F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x319F + i] = CAST_OP(0x319F); - JumpTable[0x31DF] = CAST_OP(0x31DF); - JumpTable[0x33DF] = CAST_OP(0x33DF); - JumpTable[0x3EDF] = CAST_OP(0x3EDF); - JumpTable[0x3F1F] = CAST_OP(0x3F1F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3027 + i] = CAST_OP(0x3027); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x30A7 + i] = CAST_OP(0x30A7); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x30E7 + i] = CAST_OP(0x30E7); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x3127 + i] = CAST_OP(0x3127); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3167 + i] = CAST_OP(0x3167); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x31A7 + i] = CAST_OP(0x31A7); - JumpTable[0x31E7] = CAST_OP(0x31E7); - JumpTable[0x33E7] = CAST_OP(0x33E7); - JumpTable[0x3EE7] = CAST_OP(0x3EE7); - JumpTable[0x3F27] = CAST_OP(0x3F27); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2040 + i + j] = CAST_OP(0x2040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2048 + i + j] = CAST_OP(0x2048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2050 + i + j] = CAST_OP(0x2050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2058 + i + j] = CAST_OP(0x2058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2060 + i + j] = CAST_OP(0x2060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2068 + i + j] = CAST_OP(0x2068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x2070 + i + j] = CAST_OP(0x2070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2078 + i] = CAST_OP(0x2078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2079 + i] = CAST_OP(0x2079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x207A + i] = CAST_OP(0x207A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x207B + i] = CAST_OP(0x207B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x207C + i] = CAST_OP(0x207C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x205F + i] = CAST_OP(0x205F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x2067 + i] = CAST_OP(0x2067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3040 + i + j] = CAST_OP(0x3040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3048 + i + j] = CAST_OP(0x3048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3050 + i + j] = CAST_OP(0x3050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3058 + i + j] = CAST_OP(0x3058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3060 + i + j] = CAST_OP(0x3060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3068 + i + j] = CAST_OP(0x3068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x3070 + i + j] = CAST_OP(0x3070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3078 + i] = CAST_OP(0x3078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3079 + i] = CAST_OP(0x3079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x307A + i] = CAST_OP(0x307A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x307B + i] = CAST_OP(0x307B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x307C + i] = CAST_OP(0x307C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x305F + i] = CAST_OP(0x305F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x3067 + i] = CAST_OP(0x3067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4000 + i] = CAST_OP(0x4000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4010 + i] = CAST_OP(0x4010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4018 + i] = CAST_OP(0x4018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4020 + i] = CAST_OP(0x4020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4028 + i] = CAST_OP(0x4028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4030 + i] = CAST_OP(0x4030); - JumpTable[0x4038] = CAST_OP(0x4038); - JumpTable[0x4039] = CAST_OP(0x4039); - JumpTable[0x401F] = CAST_OP(0x401F); - JumpTable[0x4027] = CAST_OP(0x4027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4040 + i] = CAST_OP(0x4040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4050 + i] = CAST_OP(0x4050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4058 + i] = CAST_OP(0x4058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4060 + i] = CAST_OP(0x4060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4068 + i] = CAST_OP(0x4068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4070 + i] = CAST_OP(0x4070); - JumpTable[0x4078] = CAST_OP(0x4078); - JumpTable[0x4079] = CAST_OP(0x4079); - JumpTable[0x405F] = CAST_OP(0x405F); - JumpTable[0x4067] = CAST_OP(0x4067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4080 + i] = CAST_OP(0x4080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4090 + i] = CAST_OP(0x4090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4098 + i] = CAST_OP(0x4098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x40A0 + i] = CAST_OP(0x40A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x40A8 + i] = CAST_OP(0x40A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x40B0 + i] = CAST_OP(0x40B0); - JumpTable[0x40B8] = CAST_OP(0x40B8); - JumpTable[0x40B9] = CAST_OP(0x40B9); - JumpTable[0x409F] = CAST_OP(0x409F); - JumpTable[0x40A7] = CAST_OP(0x40A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4200 + i] = CAST_OP(0x4200); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4210 + i] = CAST_OP(0x4210); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4218 + i] = CAST_OP(0x4218); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4220 + i] = CAST_OP(0x4220); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4228 + i] = CAST_OP(0x4228); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4230 + i] = CAST_OP(0x4230); - JumpTable[0x4238] = CAST_OP(0x4238); - JumpTable[0x4239] = CAST_OP(0x4239); - JumpTable[0x421F] = CAST_OP(0x421F); - JumpTable[0x4227] = CAST_OP(0x4227); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4240 + i] = CAST_OP(0x4240); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4250 + i] = CAST_OP(0x4250); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4258 + i] = CAST_OP(0x4258); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4260 + i] = CAST_OP(0x4260); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4268 + i] = CAST_OP(0x4268); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4270 + i] = CAST_OP(0x4270); - JumpTable[0x4278] = CAST_OP(0x4278); - JumpTable[0x4279] = CAST_OP(0x4279); - JumpTable[0x425F] = CAST_OP(0x425F); - JumpTable[0x4267] = CAST_OP(0x4267); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4280 + i] = CAST_OP(0x4280); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4290 + i] = CAST_OP(0x4290); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4298 + i] = CAST_OP(0x4298); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x42A0 + i] = CAST_OP(0x42A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x42A8 + i] = CAST_OP(0x42A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x42B0 + i] = CAST_OP(0x42B0); - JumpTable[0x42B8] = CAST_OP(0x42B8); - JumpTable[0x42B9] = CAST_OP(0x42B9); - JumpTable[0x429F] = CAST_OP(0x429F); - JumpTable[0x42A7] = CAST_OP(0x42A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4400 + i] = CAST_OP(0x4400); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4410 + i] = CAST_OP(0x4410); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4418 + i] = CAST_OP(0x4418); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4420 + i] = CAST_OP(0x4420); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4428 + i] = CAST_OP(0x4428); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4430 + i] = CAST_OP(0x4430); - JumpTable[0x4438] = CAST_OP(0x4438); - JumpTable[0x4439] = CAST_OP(0x4439); - JumpTable[0x441F] = CAST_OP(0x441F); - JumpTable[0x4427] = CAST_OP(0x4427); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4440 + i] = CAST_OP(0x4440); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4450 + i] = CAST_OP(0x4450); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4458 + i] = CAST_OP(0x4458); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4460 + i] = CAST_OP(0x4460); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4468 + i] = CAST_OP(0x4468); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4470 + i] = CAST_OP(0x4470); - JumpTable[0x4478] = CAST_OP(0x4478); - JumpTable[0x4479] = CAST_OP(0x4479); - JumpTable[0x445F] = CAST_OP(0x445F); - JumpTable[0x4467] = CAST_OP(0x4467); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4480 + i] = CAST_OP(0x4480); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4490 + i] = CAST_OP(0x4490); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4498 + i] = CAST_OP(0x4498); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x44A0 + i] = CAST_OP(0x44A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x44A8 + i] = CAST_OP(0x44A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x44B0 + i] = CAST_OP(0x44B0); - JumpTable[0x44B8] = CAST_OP(0x44B8); - JumpTable[0x44B9] = CAST_OP(0x44B9); - JumpTable[0x449F] = CAST_OP(0x449F); - JumpTable[0x44A7] = CAST_OP(0x44A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4600 + i] = CAST_OP(0x4600); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4610 + i] = CAST_OP(0x4610); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4618 + i] = CAST_OP(0x4618); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4620 + i] = CAST_OP(0x4620); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4628 + i] = CAST_OP(0x4628); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4630 + i] = CAST_OP(0x4630); - JumpTable[0x4638] = CAST_OP(0x4638); - JumpTable[0x4639] = CAST_OP(0x4639); - JumpTable[0x461F] = CAST_OP(0x461F); - JumpTable[0x4627] = CAST_OP(0x4627); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4640 + i] = CAST_OP(0x4640); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4650 + i] = CAST_OP(0x4650); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4658 + i] = CAST_OP(0x4658); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4660 + i] = CAST_OP(0x4660); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4668 + i] = CAST_OP(0x4668); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4670 + i] = CAST_OP(0x4670); - JumpTable[0x4678] = CAST_OP(0x4678); - JumpTable[0x4679] = CAST_OP(0x4679); - JumpTable[0x465F] = CAST_OP(0x465F); - JumpTable[0x4667] = CAST_OP(0x4667); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4680 + i] = CAST_OP(0x4680); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4690 + i] = CAST_OP(0x4690); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4698 + i] = CAST_OP(0x4698); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x46A0 + i] = CAST_OP(0x46A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x46A8 + i] = CAST_OP(0x46A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x46B0 + i] = CAST_OP(0x46B0); - JumpTable[0x46B8] = CAST_OP(0x46B8); - JumpTable[0x46B9] = CAST_OP(0x46B9); - JumpTable[0x469F] = CAST_OP(0x469F); - JumpTable[0x46A7] = CAST_OP(0x46A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x40C0 + i] = CAST_OP(0x40C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x40D0 + i] = CAST_OP(0x40D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x40D8 + i] = CAST_OP(0x40D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x40E0 + i] = CAST_OP(0x40E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x40E8 + i] = CAST_OP(0x40E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x40F0 + i] = CAST_OP(0x40F0); - JumpTable[0x40F8] = CAST_OP(0x40F8); - JumpTable[0x40F9] = CAST_OP(0x40F9); - JumpTable[0x40DF] = CAST_OP(0x40DF); - JumpTable[0x40E7] = CAST_OP(0x40E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x44C0 + i] = CAST_OP(0x44C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x44D0 + i] = CAST_OP(0x44D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x44D8 + i] = CAST_OP(0x44D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x44E0 + i] = CAST_OP(0x44E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x44E8 + i] = CAST_OP(0x44E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x44F0 + i] = CAST_OP(0x44F0); - JumpTable[0x44F8] = CAST_OP(0x44F8); - JumpTable[0x44F9] = CAST_OP(0x44F9); - JumpTable[0x44FA] = CAST_OP(0x44FA); - JumpTable[0x44FB] = CAST_OP(0x44FB); - JumpTable[0x44FC] = CAST_OP(0x44FC); - JumpTable[0x44DF] = CAST_OP(0x44DF); - JumpTable[0x44E7] = CAST_OP(0x44E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x46C0 + i] = CAST_OP(0x46C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x46D0 + i] = CAST_OP(0x46D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x46D8 + i] = CAST_OP(0x46D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x46E0 + i] = CAST_OP(0x46E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x46E8 + i] = CAST_OP(0x46E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x46F0 + i] = CAST_OP(0x46F0); - JumpTable[0x46F8] = CAST_OP(0x46F8); - JumpTable[0x46F9] = CAST_OP(0x46F9); - JumpTable[0x46FA] = CAST_OP(0x46FA); - JumpTable[0x46FB] = CAST_OP(0x46FB); - JumpTable[0x46FC] = CAST_OP(0x46FC); - JumpTable[0x46DF] = CAST_OP(0x46DF); - JumpTable[0x46E7] = CAST_OP(0x46E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4800 + i] = CAST_OP(0x4800); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4810 + i] = CAST_OP(0x4810); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4818 + i] = CAST_OP(0x4818); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4820 + i] = CAST_OP(0x4820); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4828 + i] = CAST_OP(0x4828); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4830 + i] = CAST_OP(0x4830); - JumpTable[0x4838] = CAST_OP(0x4838); - JumpTable[0x4839] = CAST_OP(0x4839); - JumpTable[0x481F] = CAST_OP(0x481F); - JumpTable[0x4827] = CAST_OP(0x4827); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4850 + i] = CAST_OP(0x4850); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4868 + i] = CAST_OP(0x4868); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4870 + i] = CAST_OP(0x4870); - JumpTable[0x4878] = CAST_OP(0x4878); - JumpTable[0x4879] = CAST_OP(0x4879); - JumpTable[0x487A] = CAST_OP(0x487A); - JumpTable[0x487B] = CAST_OP(0x487B); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4840 + i] = CAST_OP(0x4840); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4890 + i] = CAST_OP(0x4890); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x48A0 + i] = CAST_OP(0x48A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x48A8 + i] = CAST_OP(0x48A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x48B0 + i] = CAST_OP(0x48B0); - JumpTable[0x48B8] = CAST_OP(0x48B8); - JumpTable[0x48B9] = CAST_OP(0x48B9); - JumpTable[0x48A7] = CAST_OP(0x48A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x48D0 + i] = CAST_OP(0x48D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x48E0 + i] = CAST_OP(0x48E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x48E8 + i] = CAST_OP(0x48E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x48F0 + i] = CAST_OP(0x48F0); - JumpTable[0x48F8] = CAST_OP(0x48F8); - JumpTable[0x48F9] = CAST_OP(0x48F9); - JumpTable[0x48E7] = CAST_OP(0x48E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4880 + i] = CAST_OP(0x4880); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x48C0 + i] = CAST_OP(0x48C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A00 + i] = CAST_OP(0x4A00); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A10 + i] = CAST_OP(0x4A10); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4A18 + i] = CAST_OP(0x4A18); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4A20 + i] = CAST_OP(0x4A20); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A28 + i] = CAST_OP(0x4A28); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A30 + i] = CAST_OP(0x4A30); - JumpTable[0x4A38] = CAST_OP(0x4A38); - JumpTable[0x4A39] = CAST_OP(0x4A39); - JumpTable[0x4A1F] = CAST_OP(0x4A1F); - JumpTable[0x4A27] = CAST_OP(0x4A27); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A40 + i] = CAST_OP(0x4A40); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A50 + i] = CAST_OP(0x4A50); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4A58 + i] = CAST_OP(0x4A58); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4A60 + i] = CAST_OP(0x4A60); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A68 + i] = CAST_OP(0x4A68); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A70 + i] = CAST_OP(0x4A70); - JumpTable[0x4A78] = CAST_OP(0x4A78); - JumpTable[0x4A79] = CAST_OP(0x4A79); - JumpTable[0x4A5F] = CAST_OP(0x4A5F); - JumpTable[0x4A67] = CAST_OP(0x4A67); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A80 + i] = CAST_OP(0x4A80); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4A90 + i] = CAST_OP(0x4A90); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4A98 + i] = CAST_OP(0x4A98); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4AA0 + i] = CAST_OP(0x4AA0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4AA8 + i] = CAST_OP(0x4AA8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4AB0 + i] = CAST_OP(0x4AB0); - JumpTable[0x4AB8] = CAST_OP(0x4AB8); - JumpTable[0x4AB9] = CAST_OP(0x4AB9); - JumpTable[0x4A9F] = CAST_OP(0x4A9F); - JumpTable[0x4AA7] = CAST_OP(0x4AA7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4AC0 + i] = CAST_OP(0x4AC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4AD0 + i] = CAST_OP(0x4AD0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4AD8 + i] = CAST_OP(0x4AD8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4AE0 + i] = CAST_OP(0x4AE0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4AE8 + i] = CAST_OP(0x4AE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4AF0 + i] = CAST_OP(0x4AF0); - JumpTable[0x4AF8] = CAST_OP(0x4AF8); - JumpTable[0x4AF9] = CAST_OP(0x4AF9); - JumpTable[0x4ADF] = CAST_OP(0x4ADF); - JumpTable[0x4AE7] = CAST_OP(0x4AE7); - JumpTable[0x4AFC] = CAST_OP(0x4AFC); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4C90 + i] = CAST_OP(0x4C90); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4C98 + i] = CAST_OP(0x4C98); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4CA8 + i] = CAST_OP(0x4CA8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4CB0 + i] = CAST_OP(0x4CB0); - JumpTable[0x4CB8] = CAST_OP(0x4CB8); - JumpTable[0x4CB9] = CAST_OP(0x4CB9); - JumpTable[0x4CBA] = CAST_OP(0x4CBA); - JumpTable[0x4CBB] = CAST_OP(0x4CBB); - JumpTable[0x4C9F] = CAST_OP(0x4C9F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4CD0 + i] = CAST_OP(0x4CD0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x4CD8 + i] = CAST_OP(0x4CD8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4CE8 + i] = CAST_OP(0x4CE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4CF0 + i] = CAST_OP(0x4CF0); - JumpTable[0x4CF8] = CAST_OP(0x4CF8); - JumpTable[0x4CF9] = CAST_OP(0x4CF9); - JumpTable[0x4CFA] = CAST_OP(0x4CFA); - JumpTable[0x4CFB] = CAST_OP(0x4CFB); - JumpTable[0x4CDF] = CAST_OP(0x4CDF); - for(i = 0x0000; i <= 0x000F; i += 0x0001) - JumpTable[0x4E40 + i] = CAST_OP(0x4E40); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4E50 + i] = CAST_OP(0x4E50); - JumpTable[0x4E57] = CAST_OP(0x4E57); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4E58 + i] = CAST_OP(0x4E58); - JumpTable[0x4E5F] = CAST_OP(0x4E5F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4E60 + i] = CAST_OP(0x4E60); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4E68 + i] = CAST_OP(0x4E68); - JumpTable[0x4E70] = CAST_OP(0x4E70); - JumpTable[0x4E71] = CAST_OP(0x4E71); - JumpTable[0x4E72] = CAST_OP(0x4E72); - JumpTable[0x4E73] = CAST_OP(0x4E73); - JumpTable[0x4E75] = CAST_OP(0x4E75); - JumpTable[0x4E76] = CAST_OP(0x4E76); - JumpTable[0x4E77] = CAST_OP(0x4E77); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4E90 + i] = CAST_OP(0x4E90); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4EA8 + i] = CAST_OP(0x4EA8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4EB0 + i] = CAST_OP(0x4EB0); - JumpTable[0x4EB8] = CAST_OP(0x4EB8); - JumpTable[0x4EB9] = CAST_OP(0x4EB9); - JumpTable[0x4EBA] = CAST_OP(0x4EBA); - JumpTable[0x4EBB] = CAST_OP(0x4EBB); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4ED0 + i] = CAST_OP(0x4ED0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4EE8 + i] = CAST_OP(0x4EE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x4EF0 + i] = CAST_OP(0x4EF0); - JumpTable[0x4EF8] = CAST_OP(0x4EF8); - JumpTable[0x4EF9] = CAST_OP(0x4EF9); - JumpTable[0x4EFA] = CAST_OP(0x4EFA); - JumpTable[0x4EFB] = CAST_OP(0x4EFB); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x4180 + i + j] = CAST_OP(0x4180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x4190 + i + j] = CAST_OP(0x4190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x4198 + i + j] = CAST_OP(0x4198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x41A0 + i + j] = CAST_OP(0x41A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x41A8 + i + j] = CAST_OP(0x41A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x41B0 + i + j] = CAST_OP(0x41B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41B8 + i] = CAST_OP(0x41B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41B9 + i] = CAST_OP(0x41B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41BA + i] = CAST_OP(0x41BA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41BB + i] = CAST_OP(0x41BB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41BC + i] = CAST_OP(0x41BC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x419F + i] = CAST_OP(0x419F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41A7 + i] = CAST_OP(0x41A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x41D0 + i + j] = CAST_OP(0x41D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x41E8 + i + j] = CAST_OP(0x41E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x41F0 + i + j] = CAST_OP(0x41F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41F8 + i] = CAST_OP(0x41F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41F9 + i] = CAST_OP(0x41F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41FA + i] = CAST_OP(0x41FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x41FB + i] = CAST_OP(0x41FB); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x50C0 + i] = CAST_OP(0x50C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x51C0 + i] = CAST_OP(0x51C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x52C0 + i] = CAST_OP(0x52C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x53C0 + i] = CAST_OP(0x53C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x54C0 + i] = CAST_OP(0x54C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x55C0 + i] = CAST_OP(0x55C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x56C0 + i] = CAST_OP(0x56C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x57C0 + i] = CAST_OP(0x57C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x58C0 + i] = CAST_OP(0x58C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x59C0 + i] = CAST_OP(0x59C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5AC0 + i] = CAST_OP(0x5AC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5BC0 + i] = CAST_OP(0x5BC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5CC0 + i] = CAST_OP(0x5CC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5DC0 + i] = CAST_OP(0x5DC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5EC0 + i] = CAST_OP(0x5EC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5FC0 + i] = CAST_OP(0x5FC0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x50D0 + i] = CAST_OP(0x50D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x51D0 + i] = CAST_OP(0x51D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x52D0 + i] = CAST_OP(0x52D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x53D0 + i] = CAST_OP(0x53D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x54D0 + i] = CAST_OP(0x54D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x55D0 + i] = CAST_OP(0x55D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x56D0 + i] = CAST_OP(0x56D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x57D0 + i] = CAST_OP(0x57D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x58D0 + i] = CAST_OP(0x58D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x59D0 + i] = CAST_OP(0x59D0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5AD0 + i] = CAST_OP(0x5AD0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5BD0 + i] = CAST_OP(0x5BD0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5CD0 + i] = CAST_OP(0x5CD0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5DD0 + i] = CAST_OP(0x5DD0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5ED0 + i] = CAST_OP(0x5ED0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5FD0 + i] = CAST_OP(0x5FD0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x50D8 + i] = CAST_OP(0x50D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x51D8 + i] = CAST_OP(0x51D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x52D8 + i] = CAST_OP(0x52D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x53D8 + i] = CAST_OP(0x53D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x54D8 + i] = CAST_OP(0x54D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x55D8 + i] = CAST_OP(0x55D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x56D8 + i] = CAST_OP(0x56D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x57D8 + i] = CAST_OP(0x57D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x58D8 + i] = CAST_OP(0x58D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x59D8 + i] = CAST_OP(0x59D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5AD8 + i] = CAST_OP(0x5AD8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5BD8 + i] = CAST_OP(0x5BD8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5CD8 + i] = CAST_OP(0x5CD8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5DD8 + i] = CAST_OP(0x5DD8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5ED8 + i] = CAST_OP(0x5ED8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5FD8 + i] = CAST_OP(0x5FD8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x50E0 + i] = CAST_OP(0x50E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x51E0 + i] = CAST_OP(0x51E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x52E0 + i] = CAST_OP(0x52E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x53E0 + i] = CAST_OP(0x53E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x54E0 + i] = CAST_OP(0x54E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x55E0 + i] = CAST_OP(0x55E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x56E0 + i] = CAST_OP(0x56E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x57E0 + i] = CAST_OP(0x57E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x58E0 + i] = CAST_OP(0x58E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x59E0 + i] = CAST_OP(0x59E0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5AE0 + i] = CAST_OP(0x5AE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5BE0 + i] = CAST_OP(0x5BE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5CE0 + i] = CAST_OP(0x5CE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5DE0 + i] = CAST_OP(0x5DE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5EE0 + i] = CAST_OP(0x5EE0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x5FE0 + i] = CAST_OP(0x5FE0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x50E8 + i] = CAST_OP(0x50E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x51E8 + i] = CAST_OP(0x51E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x52E8 + i] = CAST_OP(0x52E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x53E8 + i] = CAST_OP(0x53E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x54E8 + i] = CAST_OP(0x54E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x55E8 + i] = CAST_OP(0x55E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x56E8 + i] = CAST_OP(0x56E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x57E8 + i] = CAST_OP(0x57E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x58E8 + i] = CAST_OP(0x58E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x59E8 + i] = CAST_OP(0x59E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5AE8 + i] = CAST_OP(0x5AE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5BE8 + i] = CAST_OP(0x5BE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5CE8 + i] = CAST_OP(0x5CE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5DE8 + i] = CAST_OP(0x5DE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5EE8 + i] = CAST_OP(0x5EE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5FE8 + i] = CAST_OP(0x5FE8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x50F0 + i] = CAST_OP(0x50F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x51F0 + i] = CAST_OP(0x51F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x52F0 + i] = CAST_OP(0x52F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x53F0 + i] = CAST_OP(0x53F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x54F0 + i] = CAST_OP(0x54F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x55F0 + i] = CAST_OP(0x55F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x56F0 + i] = CAST_OP(0x56F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x57F0 + i] = CAST_OP(0x57F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x58F0 + i] = CAST_OP(0x58F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x59F0 + i] = CAST_OP(0x59F0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5AF0 + i] = CAST_OP(0x5AF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5BF0 + i] = CAST_OP(0x5BF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5CF0 + i] = CAST_OP(0x5CF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5DF0 + i] = CAST_OP(0x5DF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5EF0 + i] = CAST_OP(0x5EF0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5FF0 + i] = CAST_OP(0x5FF0); - JumpTable[0x50F8] = CAST_OP(0x50F8); - JumpTable[0x51F8] = CAST_OP(0x51F8); - JumpTable[0x52F8] = CAST_OP(0x52F8); - JumpTable[0x53F8] = CAST_OP(0x53F8); - JumpTable[0x54F8] = CAST_OP(0x54F8); - JumpTable[0x55F8] = CAST_OP(0x55F8); - JumpTable[0x56F8] = CAST_OP(0x56F8); - JumpTable[0x57F8] = CAST_OP(0x57F8); - JumpTable[0x58F8] = CAST_OP(0x58F8); - JumpTable[0x59F8] = CAST_OP(0x59F8); - JumpTable[0x5AF8] = CAST_OP(0x5AF8); - JumpTable[0x5BF8] = CAST_OP(0x5BF8); - JumpTable[0x5CF8] = CAST_OP(0x5CF8); - JumpTable[0x5DF8] = CAST_OP(0x5DF8); - JumpTable[0x5EF8] = CAST_OP(0x5EF8); - JumpTable[0x5FF8] = CAST_OP(0x5FF8); - JumpTable[0x50F9] = CAST_OP(0x50F9); - JumpTable[0x51F9] = CAST_OP(0x51F9); - JumpTable[0x52F9] = CAST_OP(0x52F9); - JumpTable[0x53F9] = CAST_OP(0x53F9); - JumpTable[0x54F9] = CAST_OP(0x54F9); - JumpTable[0x55F9] = CAST_OP(0x55F9); - JumpTable[0x56F9] = CAST_OP(0x56F9); - JumpTable[0x57F9] = CAST_OP(0x57F9); - JumpTable[0x58F9] = CAST_OP(0x58F9); - JumpTable[0x59F9] = CAST_OP(0x59F9); - JumpTable[0x5AF9] = CAST_OP(0x5AF9); - JumpTable[0x5BF9] = CAST_OP(0x5BF9); - JumpTable[0x5CF9] = CAST_OP(0x5CF9); - JumpTable[0x5DF9] = CAST_OP(0x5DF9); - JumpTable[0x5EF9] = CAST_OP(0x5EF9); - JumpTable[0x5FF9] = CAST_OP(0x5FF9); - JumpTable[0x50DF] = CAST_OP(0x50DF); - JumpTable[0x51DF] = CAST_OP(0x51DF); - JumpTable[0x52DF] = CAST_OP(0x52DF); - JumpTable[0x53DF] = CAST_OP(0x53DF); - JumpTable[0x54DF] = CAST_OP(0x54DF); - JumpTable[0x55DF] = CAST_OP(0x55DF); - JumpTable[0x56DF] = CAST_OP(0x56DF); - JumpTable[0x57DF] = CAST_OP(0x57DF); - JumpTable[0x58DF] = CAST_OP(0x58DF); - JumpTable[0x59DF] = CAST_OP(0x59DF); - JumpTable[0x5ADF] = CAST_OP(0x5ADF); - JumpTable[0x5BDF] = CAST_OP(0x5BDF); - JumpTable[0x5CDF] = CAST_OP(0x5CDF); - JumpTable[0x5DDF] = CAST_OP(0x5DDF); - JumpTable[0x5EDF] = CAST_OP(0x5EDF); - JumpTable[0x5FDF] = CAST_OP(0x5FDF); - JumpTable[0x50E7] = CAST_OP(0x50E7); - JumpTable[0x51E7] = CAST_OP(0x51E7); - JumpTable[0x52E7] = CAST_OP(0x52E7); - JumpTable[0x53E7] = CAST_OP(0x53E7); - JumpTable[0x54E7] = CAST_OP(0x54E7); - JumpTable[0x55E7] = CAST_OP(0x55E7); - JumpTable[0x56E7] = CAST_OP(0x56E7); - JumpTable[0x57E7] = CAST_OP(0x57E7); - JumpTable[0x58E7] = CAST_OP(0x58E7); - JumpTable[0x59E7] = CAST_OP(0x59E7); - JumpTable[0x5AE7] = CAST_OP(0x5AE7); - JumpTable[0x5BE7] = CAST_OP(0x5BE7); - JumpTable[0x5CE7] = CAST_OP(0x5CE7); - JumpTable[0x5DE7] = CAST_OP(0x5DE7); - JumpTable[0x5EE7] = CAST_OP(0x5EE7); - JumpTable[0x5FE7] = CAST_OP(0x5FE7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x50C8 + i] = CAST_OP(0x50C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x51C8 + i] = CAST_OP(0x51C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x52C8 + i] = CAST_OP(0x52C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x53C8 + i] = CAST_OP(0x53C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x54C8 + i] = CAST_OP(0x54C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x55C8 + i] = CAST_OP(0x55C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x56C8 + i] = CAST_OP(0x56C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x57C8 + i] = CAST_OP(0x57C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x58C8 + i] = CAST_OP(0x58C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x59C8 + i] = CAST_OP(0x59C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5AC8 + i] = CAST_OP(0x5AC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5BC8 + i] = CAST_OP(0x5BC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5CC8 + i] = CAST_OP(0x5CC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5DC8 + i] = CAST_OP(0x5DC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5EC8 + i] = CAST_OP(0x5EC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0x5FC8 + i] = CAST_OP(0x5FC8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5000 + i + j] = CAST_OP(0x5000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5010 + i + j] = CAST_OP(0x5010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5018 + i + j] = CAST_OP(0x5018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5020 + i + j] = CAST_OP(0x5020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5028 + i + j] = CAST_OP(0x5028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5030 + i + j] = CAST_OP(0x5030); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5038 + i] = CAST_OP(0x5038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5039 + i] = CAST_OP(0x5039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x501F + i] = CAST_OP(0x501F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5027 + i] = CAST_OP(0x5027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5040 + i + j] = CAST_OP(0x5040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5048 + i + j] = CAST_OP(0x5048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5050 + i + j] = CAST_OP(0x5050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5058 + i + j] = CAST_OP(0x5058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5060 + i + j] = CAST_OP(0x5060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5068 + i + j] = CAST_OP(0x5068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5070 + i + j] = CAST_OP(0x5070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5078 + i] = CAST_OP(0x5078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5079 + i] = CAST_OP(0x5079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x505F + i] = CAST_OP(0x505F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5067 + i] = CAST_OP(0x5067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5080 + i + j] = CAST_OP(0x5080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5088 + i + j] = CAST_OP(0x5088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5090 + i + j] = CAST_OP(0x5090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5098 + i + j] = CAST_OP(0x5098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x50A0 + i + j] = CAST_OP(0x50A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x50A8 + i + j] = CAST_OP(0x50A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x50B0 + i + j] = CAST_OP(0x50B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x50B8 + i] = CAST_OP(0x50B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x50B9 + i] = CAST_OP(0x50B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x509F + i] = CAST_OP(0x509F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x50A7 + i] = CAST_OP(0x50A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5100 + i + j] = CAST_OP(0x5100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5110 + i + j] = CAST_OP(0x5110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5118 + i + j] = CAST_OP(0x5118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5120 + i + j] = CAST_OP(0x5120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5128 + i + j] = CAST_OP(0x5128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5130 + i + j] = CAST_OP(0x5130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5138 + i] = CAST_OP(0x5138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5139 + i] = CAST_OP(0x5139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x511F + i] = CAST_OP(0x511F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5127 + i] = CAST_OP(0x5127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5140 + i + j] = CAST_OP(0x5140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5148 + i + j] = CAST_OP(0x5148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5150 + i + j] = CAST_OP(0x5150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5158 + i + j] = CAST_OP(0x5158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5160 + i + j] = CAST_OP(0x5160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5168 + i + j] = CAST_OP(0x5168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5170 + i + j] = CAST_OP(0x5170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5178 + i] = CAST_OP(0x5178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5179 + i] = CAST_OP(0x5179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x515F + i] = CAST_OP(0x515F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x5167 + i] = CAST_OP(0x5167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5180 + i + j] = CAST_OP(0x5180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5188 + i + j] = CAST_OP(0x5188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5190 + i + j] = CAST_OP(0x5190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x5198 + i + j] = CAST_OP(0x5198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x51A0 + i + j] = CAST_OP(0x51A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x51A8 + i + j] = CAST_OP(0x51A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x51B0 + i + j] = CAST_OP(0x51B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x51B8 + i] = CAST_OP(0x51B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x51B9 + i] = CAST_OP(0x51B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x519F + i] = CAST_OP(0x519F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x51A7 + i] = CAST_OP(0x51A7); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6200 + i] = CAST_OP(0x6201); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6300 + i] = CAST_OP(0x6301); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6400 + i] = CAST_OP(0x6401); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6500 + i] = CAST_OP(0x6501); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6600 + i] = CAST_OP(0x6601); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6700 + i] = CAST_OP(0x6701); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6800 + i] = CAST_OP(0x6801); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6900 + i] = CAST_OP(0x6901); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6A00 + i] = CAST_OP(0x6A01); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6B00 + i] = CAST_OP(0x6B01); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6C00 + i] = CAST_OP(0x6C01); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6D00 + i] = CAST_OP(0x6D01); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6E00 + i] = CAST_OP(0x6E01); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6F00 + i] = CAST_OP(0x6F01); - JumpTable[0x6200] = CAST_OP(0x6200); - JumpTable[0x6300] = CAST_OP(0x6300); - JumpTable[0x6400] = CAST_OP(0x6400); - JumpTable[0x6500] = CAST_OP(0x6500); - JumpTable[0x6600] = CAST_OP(0x6600); - JumpTable[0x6700] = CAST_OP(0x6700); - JumpTable[0x6800] = CAST_OP(0x6800); - JumpTable[0x6900] = CAST_OP(0x6900); - JumpTable[0x6A00] = CAST_OP(0x6A00); - JumpTable[0x6B00] = CAST_OP(0x6B00); - JumpTable[0x6C00] = CAST_OP(0x6C00); - JumpTable[0x6D00] = CAST_OP(0x6D00); - JumpTable[0x6E00] = CAST_OP(0x6E00); - JumpTable[0x6F00] = CAST_OP(0x6F00); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6000 + i] = CAST_OP(0x6001); - JumpTable[0x6000] = CAST_OP(0x6000); - for(i = 0x0001; i <= 0x00FF; i += 0x0001) - JumpTable[0x6100 + i] = CAST_OP(0x6101); - JumpTable[0x6100] = CAST_OP(0x6100); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - for(j = 0x0000; j <= 0x00FF; j += 0x0001) - JumpTable[0x7000 + i + j] = CAST_OP(0x7000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8000 + i + j] = CAST_OP(0x8000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8010 + i + j] = CAST_OP(0x8010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8018 + i + j] = CAST_OP(0x8018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8020 + i + j] = CAST_OP(0x8020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8028 + i + j] = CAST_OP(0x8028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8030 + i + j] = CAST_OP(0x8030); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8038 + i] = CAST_OP(0x8038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8039 + i] = CAST_OP(0x8039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x803A + i] = CAST_OP(0x803A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x803B + i] = CAST_OP(0x803B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x803C + i] = CAST_OP(0x803C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x801F + i] = CAST_OP(0x801F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8027 + i] = CAST_OP(0x8027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8040 + i + j] = CAST_OP(0x8040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8050 + i + j] = CAST_OP(0x8050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8058 + i + j] = CAST_OP(0x8058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8060 + i + j] = CAST_OP(0x8060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8068 + i + j] = CAST_OP(0x8068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8070 + i + j] = CAST_OP(0x8070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8078 + i] = CAST_OP(0x8078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8079 + i] = CAST_OP(0x8079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x807A + i] = CAST_OP(0x807A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x807B + i] = CAST_OP(0x807B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x807C + i] = CAST_OP(0x807C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x805F + i] = CAST_OP(0x805F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8067 + i] = CAST_OP(0x8067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8080 + i + j] = CAST_OP(0x8080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8090 + i + j] = CAST_OP(0x8090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8098 + i + j] = CAST_OP(0x8098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80A0 + i + j] = CAST_OP(0x80A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80A8 + i + j] = CAST_OP(0x80A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80B0 + i + j] = CAST_OP(0x80B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80B8 + i] = CAST_OP(0x80B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80B9 + i] = CAST_OP(0x80B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80BA + i] = CAST_OP(0x80BA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80BB + i] = CAST_OP(0x80BB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80BC + i] = CAST_OP(0x80BC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x809F + i] = CAST_OP(0x809F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80A7 + i] = CAST_OP(0x80A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8110 + i + j] = CAST_OP(0x8110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8118 + i + j] = CAST_OP(0x8118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8120 + i + j] = CAST_OP(0x8120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8128 + i + j] = CAST_OP(0x8128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8130 + i + j] = CAST_OP(0x8130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8138 + i] = CAST_OP(0x8138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8139 + i] = CAST_OP(0x8139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x811F + i] = CAST_OP(0x811F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8127 + i] = CAST_OP(0x8127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8150 + i + j] = CAST_OP(0x8150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8158 + i + j] = CAST_OP(0x8158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8160 + i + j] = CAST_OP(0x8160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8168 + i + j] = CAST_OP(0x8168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8170 + i + j] = CAST_OP(0x8170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8178 + i] = CAST_OP(0x8178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8179 + i] = CAST_OP(0x8179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x815F + i] = CAST_OP(0x815F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x8167 + i] = CAST_OP(0x8167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8190 + i + j] = CAST_OP(0x8190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8198 + i + j] = CAST_OP(0x8198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81A0 + i + j] = CAST_OP(0x81A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81A8 + i + j] = CAST_OP(0x81A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81B0 + i + j] = CAST_OP(0x81B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81B8 + i] = CAST_OP(0x81B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81B9 + i] = CAST_OP(0x81B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x819F + i] = CAST_OP(0x819F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81A7 + i] = CAST_OP(0x81A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x8100 + i + j] = CAST_OP(0x8100); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x8108 + i + j] = CAST_OP(0x8108); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x810F + i] = CAST_OP(0x810F); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x8F08 + i] = CAST_OP(0x8F08); - JumpTable[0x8F0F] = CAST_OP(0x8F0F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80C0 + i + j] = CAST_OP(0x80C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80D0 + i + j] = CAST_OP(0x80D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80D8 + i + j] = CAST_OP(0x80D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80E0 + i + j] = CAST_OP(0x80E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80E8 + i + j] = CAST_OP(0x80E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x80F0 + i + j] = CAST_OP(0x80F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80F8 + i] = CAST_OP(0x80F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80F9 + i] = CAST_OP(0x80F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80FA + i] = CAST_OP(0x80FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80FB + i] = CAST_OP(0x80FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80FC + i] = CAST_OP(0x80FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80DF + i] = CAST_OP(0x80DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x80E7 + i] = CAST_OP(0x80E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81C0 + i + j] = CAST_OP(0x81C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81D0 + i + j] = CAST_OP(0x81D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81D8 + i + j] = CAST_OP(0x81D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81E0 + i + j] = CAST_OP(0x81E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81E8 + i + j] = CAST_OP(0x81E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x81F0 + i + j] = CAST_OP(0x81F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81F8 + i] = CAST_OP(0x81F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81F9 + i] = CAST_OP(0x81F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81FA + i] = CAST_OP(0x81FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81FB + i] = CAST_OP(0x81FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81FC + i] = CAST_OP(0x81FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81DF + i] = CAST_OP(0x81DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x81E7 + i] = CAST_OP(0x81E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9000 + i + j] = CAST_OP(0x9000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9008 + i + j] = CAST_OP(0x9008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9010 + i + j] = CAST_OP(0x9010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9018 + i + j] = CAST_OP(0x9018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9020 + i + j] = CAST_OP(0x9020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9028 + i + j] = CAST_OP(0x9028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9030 + i + j] = CAST_OP(0x9030); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9038 + i] = CAST_OP(0x9038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9039 + i] = CAST_OP(0x9039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x903A + i] = CAST_OP(0x903A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x903B + i] = CAST_OP(0x903B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x903C + i] = CAST_OP(0x903C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x901F + i] = CAST_OP(0x901F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9027 + i] = CAST_OP(0x9027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9040 + i + j] = CAST_OP(0x9040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9048 + i + j] = CAST_OP(0x9048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9050 + i + j] = CAST_OP(0x9050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9058 + i + j] = CAST_OP(0x9058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9060 + i + j] = CAST_OP(0x9060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9068 + i + j] = CAST_OP(0x9068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9070 + i + j] = CAST_OP(0x9070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9078 + i] = CAST_OP(0x9078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9079 + i] = CAST_OP(0x9079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x907A + i] = CAST_OP(0x907A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x907B + i] = CAST_OP(0x907B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x907C + i] = CAST_OP(0x907C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x905F + i] = CAST_OP(0x905F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9067 + i] = CAST_OP(0x9067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9080 + i + j] = CAST_OP(0x9080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9088 + i + j] = CAST_OP(0x9088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9090 + i + j] = CAST_OP(0x9090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9098 + i + j] = CAST_OP(0x9098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90A0 + i + j] = CAST_OP(0x90A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90A8 + i + j] = CAST_OP(0x90A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90B0 + i + j] = CAST_OP(0x90B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90B8 + i] = CAST_OP(0x90B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90B9 + i] = CAST_OP(0x90B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90BA + i] = CAST_OP(0x90BA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90BB + i] = CAST_OP(0x90BB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90BC + i] = CAST_OP(0x90BC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x909F + i] = CAST_OP(0x909F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90A7 + i] = CAST_OP(0x90A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9110 + i + j] = CAST_OP(0x9110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9118 + i + j] = CAST_OP(0x9118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9120 + i + j] = CAST_OP(0x9120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9128 + i + j] = CAST_OP(0x9128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9130 + i + j] = CAST_OP(0x9130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9138 + i] = CAST_OP(0x9138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9139 + i] = CAST_OP(0x9139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x911F + i] = CAST_OP(0x911F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9127 + i] = CAST_OP(0x9127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9150 + i + j] = CAST_OP(0x9150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9158 + i + j] = CAST_OP(0x9158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9160 + i + j] = CAST_OP(0x9160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9168 + i + j] = CAST_OP(0x9168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9170 + i + j] = CAST_OP(0x9170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9178 + i] = CAST_OP(0x9178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9179 + i] = CAST_OP(0x9179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x915F + i] = CAST_OP(0x915F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x9167 + i] = CAST_OP(0x9167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9190 + i + j] = CAST_OP(0x9190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9198 + i + j] = CAST_OP(0x9198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91A0 + i + j] = CAST_OP(0x91A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91A8 + i + j] = CAST_OP(0x91A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91B0 + i + j] = CAST_OP(0x91B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91B8 + i] = CAST_OP(0x91B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91B9 + i] = CAST_OP(0x91B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x919F + i] = CAST_OP(0x919F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91A7 + i] = CAST_OP(0x91A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9100 + i + j] = CAST_OP(0x9100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9140 + i + j] = CAST_OP(0x9140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x9180 + i + j] = CAST_OP(0x9180); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x9108 + i + j] = CAST_OP(0x9108); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x9148 + i + j] = CAST_OP(0x9148); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0x9188 + i + j] = CAST_OP(0x9188); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x910F + i] = CAST_OP(0x910F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x914F + i] = CAST_OP(0x914F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0x918F + i] = CAST_OP(0x918F); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x9F08 + i] = CAST_OP(0x9F08); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x9F48 + i] = CAST_OP(0x9F48); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0x9F88 + i] = CAST_OP(0x9F88); - JumpTable[0x9F0F] = CAST_OP(0x9F0F); - JumpTable[0x9F4F] = CAST_OP(0x9F4F); - JumpTable[0x9F8F] = CAST_OP(0x9F8F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90C0 + i + j] = CAST_OP(0x90C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90C8 + i + j] = CAST_OP(0x90C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90D0 + i + j] = CAST_OP(0x90D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90D8 + i + j] = CAST_OP(0x90D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90E0 + i + j] = CAST_OP(0x90E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90E8 + i + j] = CAST_OP(0x90E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x90F0 + i + j] = CAST_OP(0x90F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90F8 + i] = CAST_OP(0x90F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90F9 + i] = CAST_OP(0x90F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90FA + i] = CAST_OP(0x90FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90FB + i] = CAST_OP(0x90FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90FC + i] = CAST_OP(0x90FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90DF + i] = CAST_OP(0x90DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x90E7 + i] = CAST_OP(0x90E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91C0 + i + j] = CAST_OP(0x91C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91C8 + i + j] = CAST_OP(0x91C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91D0 + i + j] = CAST_OP(0x91D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91D8 + i + j] = CAST_OP(0x91D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91E0 + i + j] = CAST_OP(0x91E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91E8 + i + j] = CAST_OP(0x91E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0x91F0 + i + j] = CAST_OP(0x91F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91F8 + i] = CAST_OP(0x91F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91F9 + i] = CAST_OP(0x91F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91FA + i] = CAST_OP(0x91FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91FB + i] = CAST_OP(0x91FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91FC + i] = CAST_OP(0x91FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91DF + i] = CAST_OP(0x91DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0x91E7 + i] = CAST_OP(0x91E7); - for(i = 0x0000; i <= 0x0FFF; i += 0x0001) - JumpTable[0xA000 + i] = CAST_OP(0xA000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB000 + i + j] = CAST_OP(0xB000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB008 + i + j] = CAST_OP(0xB008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB010 + i + j] = CAST_OP(0xB010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB018 + i + j] = CAST_OP(0xB018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB020 + i + j] = CAST_OP(0xB020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB028 + i + j] = CAST_OP(0xB028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB030 + i + j] = CAST_OP(0xB030); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB038 + i] = CAST_OP(0xB038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB039 + i] = CAST_OP(0xB039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB03A + i] = CAST_OP(0xB03A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB03B + i] = CAST_OP(0xB03B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB03C + i] = CAST_OP(0xB03C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB01F + i] = CAST_OP(0xB01F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB027 + i] = CAST_OP(0xB027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB040 + i + j] = CAST_OP(0xB040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB048 + i + j] = CAST_OP(0xB048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB050 + i + j] = CAST_OP(0xB050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB058 + i + j] = CAST_OP(0xB058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB060 + i + j] = CAST_OP(0xB060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB068 + i + j] = CAST_OP(0xB068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB070 + i + j] = CAST_OP(0xB070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB078 + i] = CAST_OP(0xB078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB079 + i] = CAST_OP(0xB079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB07A + i] = CAST_OP(0xB07A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB07B + i] = CAST_OP(0xB07B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB07C + i] = CAST_OP(0xB07C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB05F + i] = CAST_OP(0xB05F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB067 + i] = CAST_OP(0xB067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB080 + i + j] = CAST_OP(0xB080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB088 + i + j] = CAST_OP(0xB088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB090 + i + j] = CAST_OP(0xB090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB098 + i + j] = CAST_OP(0xB098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0A0 + i + j] = CAST_OP(0xB0A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0A8 + i + j] = CAST_OP(0xB0A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0B0 + i + j] = CAST_OP(0xB0B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0B8 + i] = CAST_OP(0xB0B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0B9 + i] = CAST_OP(0xB0B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0BA + i] = CAST_OP(0xB0BA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0BB + i] = CAST_OP(0xB0BB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0BC + i] = CAST_OP(0xB0BC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB09F + i] = CAST_OP(0xB09F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0A7 + i] = CAST_OP(0xB0A7); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xB108 + i + j] = CAST_OP(0xB108); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xB148 + i + j] = CAST_OP(0xB148); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xB188 + i + j] = CAST_OP(0xB188); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xB10F + i] = CAST_OP(0xB10F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xB14F + i] = CAST_OP(0xB14F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xB18F + i] = CAST_OP(0xB18F); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xBF08 + i] = CAST_OP(0xBF08); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xBF48 + i] = CAST_OP(0xBF48); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xBF88 + i] = CAST_OP(0xBF88); - JumpTable[0xBF0F] = CAST_OP(0xBF0F); - JumpTable[0xBF4F] = CAST_OP(0xBF4F); - JumpTable[0xBF8F] = CAST_OP(0xBF8F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB100 + i + j] = CAST_OP(0xB100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB110 + i + j] = CAST_OP(0xB110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB118 + i + j] = CAST_OP(0xB118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB120 + i + j] = CAST_OP(0xB120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB128 + i + j] = CAST_OP(0xB128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB130 + i + j] = CAST_OP(0xB130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB138 + i] = CAST_OP(0xB138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB139 + i] = CAST_OP(0xB139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB11F + i] = CAST_OP(0xB11F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB127 + i] = CAST_OP(0xB127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB140 + i + j] = CAST_OP(0xB140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB150 + i + j] = CAST_OP(0xB150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB158 + i + j] = CAST_OP(0xB158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB160 + i + j] = CAST_OP(0xB160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB168 + i + j] = CAST_OP(0xB168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB170 + i + j] = CAST_OP(0xB170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB178 + i] = CAST_OP(0xB178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB179 + i] = CAST_OP(0xB179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB15F + i] = CAST_OP(0xB15F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB167 + i] = CAST_OP(0xB167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB180 + i + j] = CAST_OP(0xB180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB190 + i + j] = CAST_OP(0xB190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB198 + i + j] = CAST_OP(0xB198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1A0 + i + j] = CAST_OP(0xB1A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1A8 + i + j] = CAST_OP(0xB1A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1B0 + i + j] = CAST_OP(0xB1B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1B8 + i] = CAST_OP(0xB1B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1B9 + i] = CAST_OP(0xB1B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB19F + i] = CAST_OP(0xB19F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1A7 + i] = CAST_OP(0xB1A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0C0 + i + j] = CAST_OP(0xB0C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0C8 + i + j] = CAST_OP(0xB0C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0D0 + i + j] = CAST_OP(0xB0D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0D8 + i + j] = CAST_OP(0xB0D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0E0 + i + j] = CAST_OP(0xB0E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0E8 + i + j] = CAST_OP(0xB0E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB0F0 + i + j] = CAST_OP(0xB0F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0F8 + i] = CAST_OP(0xB0F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0F9 + i] = CAST_OP(0xB0F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0FA + i] = CAST_OP(0xB0FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0FB + i] = CAST_OP(0xB0FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0FC + i] = CAST_OP(0xB0FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0DF + i] = CAST_OP(0xB0DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB0E7 + i] = CAST_OP(0xB0E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1C0 + i + j] = CAST_OP(0xB1C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1C8 + i + j] = CAST_OP(0xB1C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1D0 + i + j] = CAST_OP(0xB1D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1D8 + i + j] = CAST_OP(0xB1D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1E0 + i + j] = CAST_OP(0xB1E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1E8 + i + j] = CAST_OP(0xB1E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xB1F0 + i + j] = CAST_OP(0xB1F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1F8 + i] = CAST_OP(0xB1F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1F9 + i] = CAST_OP(0xB1F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1FA + i] = CAST_OP(0xB1FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1FB + i] = CAST_OP(0xB1FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1FC + i] = CAST_OP(0xB1FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1DF + i] = CAST_OP(0xB1DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xB1E7 + i] = CAST_OP(0xB1E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC000 + i + j] = CAST_OP(0xC000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC010 + i + j] = CAST_OP(0xC010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC018 + i + j] = CAST_OP(0xC018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC020 + i + j] = CAST_OP(0xC020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC028 + i + j] = CAST_OP(0xC028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC030 + i + j] = CAST_OP(0xC030); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC038 + i] = CAST_OP(0xC038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC039 + i] = CAST_OP(0xC039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC03A + i] = CAST_OP(0xC03A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC03B + i] = CAST_OP(0xC03B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC03C + i] = CAST_OP(0xC03C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC01F + i] = CAST_OP(0xC01F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC027 + i] = CAST_OP(0xC027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC040 + i + j] = CAST_OP(0xC040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC050 + i + j] = CAST_OP(0xC050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC058 + i + j] = CAST_OP(0xC058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC060 + i + j] = CAST_OP(0xC060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC068 + i + j] = CAST_OP(0xC068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC070 + i + j] = CAST_OP(0xC070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC078 + i] = CAST_OP(0xC078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC079 + i] = CAST_OP(0xC079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC07A + i] = CAST_OP(0xC07A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC07B + i] = CAST_OP(0xC07B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC07C + i] = CAST_OP(0xC07C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC05F + i] = CAST_OP(0xC05F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC067 + i] = CAST_OP(0xC067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC080 + i + j] = CAST_OP(0xC080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC090 + i + j] = CAST_OP(0xC090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC098 + i + j] = CAST_OP(0xC098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0A0 + i + j] = CAST_OP(0xC0A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0A8 + i + j] = CAST_OP(0xC0A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0B0 + i + j] = CAST_OP(0xC0B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0B8 + i] = CAST_OP(0xC0B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0B9 + i] = CAST_OP(0xC0B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0BA + i] = CAST_OP(0xC0BA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0BB + i] = CAST_OP(0xC0BB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0BC + i] = CAST_OP(0xC0BC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC09F + i] = CAST_OP(0xC09F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0A7 + i] = CAST_OP(0xC0A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC110 + i + j] = CAST_OP(0xC110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC118 + i + j] = CAST_OP(0xC118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC120 + i + j] = CAST_OP(0xC120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC128 + i + j] = CAST_OP(0xC128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC130 + i + j] = CAST_OP(0xC130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC138 + i] = CAST_OP(0xC138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC139 + i] = CAST_OP(0xC139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC11F + i] = CAST_OP(0xC11F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC127 + i] = CAST_OP(0xC127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC150 + i + j] = CAST_OP(0xC150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC158 + i + j] = CAST_OP(0xC158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC160 + i + j] = CAST_OP(0xC160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC168 + i + j] = CAST_OP(0xC168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC170 + i + j] = CAST_OP(0xC170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC178 + i] = CAST_OP(0xC178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC179 + i] = CAST_OP(0xC179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC15F + i] = CAST_OP(0xC15F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC167 + i] = CAST_OP(0xC167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC190 + i + j] = CAST_OP(0xC190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC198 + i + j] = CAST_OP(0xC198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1A0 + i + j] = CAST_OP(0xC1A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1A8 + i + j] = CAST_OP(0xC1A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1B0 + i + j] = CAST_OP(0xC1B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1B8 + i] = CAST_OP(0xC1B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1B9 + i] = CAST_OP(0xC1B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC19F + i] = CAST_OP(0xC19F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1A7 + i] = CAST_OP(0xC1A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC100 + i + j] = CAST_OP(0xC100); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xC108 + i + j] = CAST_OP(0xC108); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xC10F + i] = CAST_OP(0xC10F); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xCF08 + i] = CAST_OP(0xCF08); - JumpTable[0xCF0F] = CAST_OP(0xCF0F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0C0 + i + j] = CAST_OP(0xC0C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0D0 + i + j] = CAST_OP(0xC0D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0D8 + i + j] = CAST_OP(0xC0D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0E0 + i + j] = CAST_OP(0xC0E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0E8 + i + j] = CAST_OP(0xC0E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC0F0 + i + j] = CAST_OP(0xC0F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0F8 + i] = CAST_OP(0xC0F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0F9 + i] = CAST_OP(0xC0F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0FA + i] = CAST_OP(0xC0FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0FB + i] = CAST_OP(0xC0FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0FC + i] = CAST_OP(0xC0FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0DF + i] = CAST_OP(0xC0DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC0E7 + i] = CAST_OP(0xC0E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1C0 + i + j] = CAST_OP(0xC1C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1D0 + i + j] = CAST_OP(0xC1D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1D8 + i + j] = CAST_OP(0xC1D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1E0 + i + j] = CAST_OP(0xC1E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1E8 + i + j] = CAST_OP(0xC1E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC1F0 + i + j] = CAST_OP(0xC1F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1F8 + i] = CAST_OP(0xC1F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1F9 + i] = CAST_OP(0xC1F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1FA + i] = CAST_OP(0xC1FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1FB + i] = CAST_OP(0xC1FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1FC + i] = CAST_OP(0xC1FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1DF + i] = CAST_OP(0xC1DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xC1E7 + i] = CAST_OP(0xC1E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC140 + i + j] = CAST_OP(0xC140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC148 + i + j] = CAST_OP(0xC148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xC188 + i + j] = CAST_OP(0xC188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD000 + i + j] = CAST_OP(0xD000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD008 + i + j] = CAST_OP(0xD008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD010 + i + j] = CAST_OP(0xD010); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD018 + i + j] = CAST_OP(0xD018); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD020 + i + j] = CAST_OP(0xD020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD028 + i + j] = CAST_OP(0xD028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD030 + i + j] = CAST_OP(0xD030); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD038 + i] = CAST_OP(0xD038); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD039 + i] = CAST_OP(0xD039); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD03A + i] = CAST_OP(0xD03A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD03B + i] = CAST_OP(0xD03B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD03C + i] = CAST_OP(0xD03C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD01F + i] = CAST_OP(0xD01F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD027 + i] = CAST_OP(0xD027); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD040 + i + j] = CAST_OP(0xD040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD048 + i + j] = CAST_OP(0xD048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD050 + i + j] = CAST_OP(0xD050); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD058 + i + j] = CAST_OP(0xD058); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD060 + i + j] = CAST_OP(0xD060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD068 + i + j] = CAST_OP(0xD068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD070 + i + j] = CAST_OP(0xD070); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD078 + i] = CAST_OP(0xD078); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD079 + i] = CAST_OP(0xD079); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD07A + i] = CAST_OP(0xD07A); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD07B + i] = CAST_OP(0xD07B); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD07C + i] = CAST_OP(0xD07C); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD05F + i] = CAST_OP(0xD05F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD067 + i] = CAST_OP(0xD067); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD080 + i + j] = CAST_OP(0xD080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD088 + i + j] = CAST_OP(0xD088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD090 + i + j] = CAST_OP(0xD090); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD098 + i + j] = CAST_OP(0xD098); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0A0 + i + j] = CAST_OP(0xD0A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0A8 + i + j] = CAST_OP(0xD0A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0B0 + i + j] = CAST_OP(0xD0B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0B8 + i] = CAST_OP(0xD0B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0B9 + i] = CAST_OP(0xD0B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0BA + i] = CAST_OP(0xD0BA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0BB + i] = CAST_OP(0xD0BB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0BC + i] = CAST_OP(0xD0BC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD09F + i] = CAST_OP(0xD09F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0A7 + i] = CAST_OP(0xD0A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD110 + i + j] = CAST_OP(0xD110); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD118 + i + j] = CAST_OP(0xD118); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD120 + i + j] = CAST_OP(0xD120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD128 + i + j] = CAST_OP(0xD128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD130 + i + j] = CAST_OP(0xD130); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD138 + i] = CAST_OP(0xD138); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD139 + i] = CAST_OP(0xD139); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD11F + i] = CAST_OP(0xD11F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD127 + i] = CAST_OP(0xD127); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD150 + i + j] = CAST_OP(0xD150); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD158 + i + j] = CAST_OP(0xD158); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD160 + i + j] = CAST_OP(0xD160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD168 + i + j] = CAST_OP(0xD168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD170 + i + j] = CAST_OP(0xD170); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD178 + i] = CAST_OP(0xD178); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD179 + i] = CAST_OP(0xD179); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD15F + i] = CAST_OP(0xD15F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD167 + i] = CAST_OP(0xD167); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD190 + i + j] = CAST_OP(0xD190); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD198 + i + j] = CAST_OP(0xD198); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1A0 + i + j] = CAST_OP(0xD1A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1A8 + i + j] = CAST_OP(0xD1A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1B0 + i + j] = CAST_OP(0xD1B0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1B8 + i] = CAST_OP(0xD1B8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1B9 + i] = CAST_OP(0xD1B9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD19F + i] = CAST_OP(0xD19F); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1A7 + i] = CAST_OP(0xD1A7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD100 + i + j] = CAST_OP(0xD100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD140 + i + j] = CAST_OP(0xD140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD180 + i + j] = CAST_OP(0xD180); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xD108 + i + j] = CAST_OP(0xD108); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xD148 + i + j] = CAST_OP(0xD148); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0C00; j += 0x0200) - JumpTable[0xD188 + i + j] = CAST_OP(0xD188); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xD10F + i] = CAST_OP(0xD10F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xD14F + i] = CAST_OP(0xD14F); - for(i = 0x0000; i <= 0x0C00; i += 0x0200) - JumpTable[0xD18F + i] = CAST_OP(0xD18F); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xDF08 + i] = CAST_OP(0xDF08); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xDF48 + i] = CAST_OP(0xDF48); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xDF88 + i] = CAST_OP(0xDF88); - JumpTable[0xDF0F] = CAST_OP(0xDF0F); - JumpTable[0xDF4F] = CAST_OP(0xDF4F); - JumpTable[0xDF8F] = CAST_OP(0xDF8F); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0C0 + i + j] = CAST_OP(0xD0C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0C8 + i + j] = CAST_OP(0xD0C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0D0 + i + j] = CAST_OP(0xD0D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0D8 + i + j] = CAST_OP(0xD0D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0E0 + i + j] = CAST_OP(0xD0E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0E8 + i + j] = CAST_OP(0xD0E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD0F0 + i + j] = CAST_OP(0xD0F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0F8 + i] = CAST_OP(0xD0F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0F9 + i] = CAST_OP(0xD0F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0FA + i] = CAST_OP(0xD0FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0FB + i] = CAST_OP(0xD0FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0FC + i] = CAST_OP(0xD0FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0DF + i] = CAST_OP(0xD0DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD0E7 + i] = CAST_OP(0xD0E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1C0 + i + j] = CAST_OP(0xD1C0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1C8 + i + j] = CAST_OP(0xD1C8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1D0 + i + j] = CAST_OP(0xD1D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1D8 + i + j] = CAST_OP(0xD1D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1E0 + i + j] = CAST_OP(0xD1E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1E8 + i + j] = CAST_OP(0xD1E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xD1F0 + i + j] = CAST_OP(0xD1F0); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1F8 + i] = CAST_OP(0xD1F8); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1F9 + i] = CAST_OP(0xD1F9); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1FA + i] = CAST_OP(0xD1FA); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1FB + i] = CAST_OP(0xD1FB); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1FC + i] = CAST_OP(0xD1FC); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1DF + i] = CAST_OP(0xD1DF); - for(i = 0x0000; i <= 0x0E00; i += 0x0200) - JumpTable[0xD1E7 + i] = CAST_OP(0xD1E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE000 + i + j] = CAST_OP(0xE000); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE040 + i + j] = CAST_OP(0xE040); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE080 + i + j] = CAST_OP(0xE080); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE008 + i + j] = CAST_OP(0xE008); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE048 + i + j] = CAST_OP(0xE048); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE088 + i + j] = CAST_OP(0xE088); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE010 + i + j] = CAST_OP(0xE010); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE050 + i + j] = CAST_OP(0xE050); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE090 + i + j] = CAST_OP(0xE090); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE018 + i + j] = CAST_OP(0xE018); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE058 + i + j] = CAST_OP(0xE058); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE098 + i + j] = CAST_OP(0xE098); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE100 + i + j] = CAST_OP(0xE100); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE140 + i + j] = CAST_OP(0xE140); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE180 + i + j] = CAST_OP(0xE180); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE108 + i + j] = CAST_OP(0xE108); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE148 + i + j] = CAST_OP(0xE148); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE188 + i + j] = CAST_OP(0xE188); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE110 + i + j] = CAST_OP(0xE110); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE150 + i + j] = CAST_OP(0xE150); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE190 + i + j] = CAST_OP(0xE190); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE118 + i + j] = CAST_OP(0xE118); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE158 + i + j] = CAST_OP(0xE158); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE198 + i + j] = CAST_OP(0xE198); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE020 + i + j] = CAST_OP(0xE020); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE060 + i + j] = CAST_OP(0xE060); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE0A0 + i + j] = CAST_OP(0xE0A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE028 + i + j] = CAST_OP(0xE028); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE068 + i + j] = CAST_OP(0xE068); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE0A8 + i + j] = CAST_OP(0xE0A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE030 + i + j] = CAST_OP(0xE030); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE070 + i + j] = CAST_OP(0xE070); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE0B0 + i + j] = CAST_OP(0xE0B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE038 + i + j] = CAST_OP(0xE038); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE078 + i + j] = CAST_OP(0xE078); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE0B8 + i + j] = CAST_OP(0xE0B8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE120 + i + j] = CAST_OP(0xE120); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE160 + i + j] = CAST_OP(0xE160); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE1A0 + i + j] = CAST_OP(0xE1A0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE128 + i + j] = CAST_OP(0xE128); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE168 + i + j] = CAST_OP(0xE168); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE1A8 + i + j] = CAST_OP(0xE1A8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE130 + i + j] = CAST_OP(0xE130); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE170 + i + j] = CAST_OP(0xE170); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE1B0 + i + j] = CAST_OP(0xE1B0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE138 + i + j] = CAST_OP(0xE138); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE178 + i + j] = CAST_OP(0xE178); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - for(j = 0x0000; j <= 0x0E00; j += 0x0200) - JumpTable[0xE1B8 + i + j] = CAST_OP(0xE1B8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE0D0 + i] = CAST_OP(0xE0D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE0D8 + i] = CAST_OP(0xE0D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE0E0 + i] =CAST_OP(0xE0E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE0E8 + i] = CAST_OP(0xE0E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE0F0 + i] = CAST_OP(0xE0F0); - JumpTable[0xE0F8] = CAST_OP(0xE0F8); - JumpTable[0xE0F9] = CAST_OP(0xE0F9); - JumpTable[0xE0DF] = CAST_OP(0xE0DF); - JumpTable[0xE0E7] = CAST_OP(0xE0E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE2D0 + i] = CAST_OP(0xE2D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE2D8 + i] = CAST_OP(0xE2D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE2E0 + i] = CAST_OP(0xE2E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE2E8 + i] = CAST_OP(0xE2E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE2F0 + i] = CAST_OP(0xE2F0); - JumpTable[0xE2F8] = CAST_OP(0xE2F8); - JumpTable[0xE2F9] = CAST_OP(0xE2F9); - JumpTable[0xE2DF] = CAST_OP(0xE2DF); - JumpTable[0xE2E7] = CAST_OP(0xE2E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE4D0 + i] = CAST_OP(0xE4D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE4D8 + i] = CAST_OP(0xE4D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE4E0 + i] = CAST_OP(0xE4E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE4E8 + i] = CAST_OP(0xE4E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE4F0 + i] = CAST_OP(0xE4F0); - JumpTable[0xE4F8] = CAST_OP(0xE4F8); - JumpTable[0xE4F9] = CAST_OP(0xE4F9); - JumpTable[0xE4DF] = CAST_OP(0xE4DF); - JumpTable[0xE4E7] = CAST_OP(0xE4E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE6D0 + i] = CAST_OP(0xE6D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE6D8 + i] = CAST_OP(0xE6D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE6E0 + i] = CAST_OP(0xE6E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE6E8 + i] = CAST_OP(0xE6E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE6F0 + i] = CAST_OP(0xE6F0); - JumpTable[0xE6F8] = CAST_OP(0xE6F8); - JumpTable[0xE6F9] = CAST_OP(0xE6F9); - JumpTable[0xE6DF] = CAST_OP(0xE6DF); - JumpTable[0xE6E7] = CAST_OP(0xE6E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE1D0 + i] = CAST_OP(0xE1D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE1D8 + i] = CAST_OP(0xE1D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE1E0 + i] = CAST_OP(0xE1E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE1E8 + i] = CAST_OP(0xE1E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE1F0 + i] = CAST_OP(0xE1F0); - JumpTable[0xE1F8] = CAST_OP(0xE1F8); - JumpTable[0xE1F9] = CAST_OP(0xE1F9); - JumpTable[0xE1DF] = CAST_OP(0xE1DF); - JumpTable[0xE1E7] = CAST_OP(0xE1E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE3D0 + i] = CAST_OP(0xE3D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE3D8 + i] = CAST_OP(0xE3D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE3E0 + i] = CAST_OP(0xE3E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE3E8 + i] = CAST_OP(0xE3E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE3F0 + i] = CAST_OP(0xE3F0); - JumpTable[0xE3F8] = CAST_OP(0xE3F8); - JumpTable[0xE3F9] = CAST_OP(0xE3F9); - JumpTable[0xE3DF] = CAST_OP(0xE3DF); - JumpTable[0xE3E7] = CAST_OP(0xE3E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE5D0 + i] = CAST_OP(0xE5D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE5D8 + i] = CAST_OP(0xE5D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE5E0 + i] = CAST_OP(0xE5E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE5E8 + i] = CAST_OP(0xE5E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE5F0 + i] = CAST_OP(0xE5F0); - JumpTable[0xE5F8] = CAST_OP(0xE5F8); - JumpTable[0xE5F9] = CAST_OP(0xE5F9); - JumpTable[0xE5DF] = CAST_OP(0xE5DF); - JumpTable[0xE5E7] = CAST_OP(0xE5E7); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE7D0 + i] = CAST_OP(0xE7D0); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE7D8 + i] = CAST_OP(0xE7D8); - for(i = 0x0000; i <= 0x0006; i += 0x0001) - JumpTable[0xE7E0 + i] = CAST_OP(0xE7E0); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE7E8 + i] = CAST_OP(0xE7E8); - for(i = 0x0000; i <= 0x0007; i += 0x0001) - JumpTable[0xE7F0 + i] = CAST_OP(0xE7F0); - JumpTable[0xE7F8] = CAST_OP(0xE7F8); - JumpTable[0xE7F9] = CAST_OP(0xE7F9); - JumpTable[0xE7DF] = CAST_OP(0xE7DF); - JumpTable[0xE7E7] = CAST_OP(0xE7E7); - for(i = 0x0000; i <= 0x0FFF; i += 0x0001) - JumpTable[0xF000 + i] = CAST_OP(0xF000); - - initialised = 1; - } - return 0; + if(line > 0) + { + /* Different behavior for 68000 and 68020. + * First requires interrupts to be handled after the first + * emulated instruction (Cruise for a Corpse, 68000), + * second requires handling them before (All New World of Lemmings, 68020). + * TomB (2014-01-10): All New World of Lemmings owrks also if IRQ is handled after first instruction... + * Alien Breed 3D requires IRQ handling after first emulated instruction. + */ + // if(prefs_cpu_model >= M68020) + // { + // interrupt_attend(line); + // } + // else + // { + pm68kcontext->more_cycles_to_do = pm68kcontext->io_cycle_counter; + pm68kcontext->io_cycle_counter = 0; + // } + } + + do + { + do + { + u32 Opcode; + FETCH_WORD(Opcode); + if(flag_T) // This flag may be changed in execution of opcode, so we have to check first + { + int op_cycles = JumpTable[Opcode](Opcode, *pm68kcontext); + pm68kcontext->io_cycle_counter = pm68kcontext->io_cycle_counter - op_cycles; + execute_exception(M68K_TRACE_EX); + } + else + { + int op_cycles = JumpTable[Opcode](Opcode, *pm68kcontext); + pm68kcontext->io_cycle_counter = pm68kcontext->io_cycle_counter - op_cycles; + } + } while (pm68kcontext->io_cycle_counter > 0); + + if(pm68kcontext->more_cycles_to_do > 0) + { + pm68kcontext->io_cycle_counter += pm68kcontext->more_cycles_to_do; + pm68kcontext->more_cycles_to_do = 0; + line = interrupt_chk__(*pm68kcontext); + if (line > 0) + { + // New IRQ with higher priority as current state + interrupt_attend(line); + } + } + } while (pm68kcontext->io_cycle_counter > 0); + + finish_emulate(cycles - pm68kcontext->cycles_not_done - (pm68kcontext->io_cycle_counter >> mainMenu_CPU_speed)); + + return M68K_OK; } - - -#endif \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.h b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.h new file mode 100644 index 0000000..b3317c5 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec.h @@ -0,0 +1,14 @@ +// +// famec.h +// iUAE +// +// Created by Urs on 30.09.14. +// +// + +#ifndef __iUAE__famec__ +#define __iUAE__famec__ + +#include + +#endif /* defined(__iUAE__famec__) */ diff --git a/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_jumptable.h b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_jumptable.h new file mode 100644 index 0000000..aafd433 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_jumptable.h @@ -0,0 +1,4401 @@ +static void JUMPTABLE(int force_table) +{ + if(!initialised || force_table) + { + if(!initialised) + m68kcontext.io_cycle_counter = 0; + + u32 i, j; + + for(i = 0x0000; i <= 0xFFFF; i += 0x0001) + JumpTable[0x0000 + i] = CAST_OP(0x4AFC); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0000 + i] = CAST_OP(0x0000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0010 + i] = CAST_OP(0x0010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0018 + i] = CAST_OP(0x0018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0020 + i] = CAST_OP(0x0020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0028 + i] = CAST_OP(0x0028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0030 + i] = CAST_OP(0x0030); + JumpTable[0x0038] = CAST_OP(0x0038); + JumpTable[0x0039] = CAST_OP(0x0039); + JumpTable[0x001F] = CAST_OP(0x001F); + JumpTable[0x0027] = CAST_OP(0x0027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0040 + i] = CAST_OP(0x0040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0050 + i] = CAST_OP(0x0050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0058 + i] = CAST_OP(0x0058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0060 + i] = CAST_OP(0x0060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0068 + i] = CAST_OP(0x0068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0070 + i] = CAST_OP(0x0070); + JumpTable[0x0078] = CAST_OP(0x0078); + JumpTable[0x0079] = CAST_OP(0x0079); + JumpTable[0x005F] = CAST_OP(0x005F); + JumpTable[0x0067] = CAST_OP(0x0067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0080 + i] = CAST_OP(0x0080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0090 + i] = CAST_OP(0x0090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0098 + i] = CAST_OP(0x0098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x00A0 + i] = CAST_OP(0x00A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00A8 + i] = CAST_OP(0x00A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00B0 + i] = CAST_OP(0x00B0); + JumpTable[0x00B8] = CAST_OP(0x00B8); + JumpTable[0x00B9] = CAST_OP(0x00B9); + JumpTable[0x009F] = CAST_OP(0x009F); + JumpTable[0x00A7] = CAST_OP(0x00A7); + JumpTable[0x003C] = CAST_OP(0x003C); + JumpTable[0x007C] = CAST_OP(0x007C); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0200 + i] = CAST_OP(0x0200); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0210 + i] = CAST_OP(0x0210); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0218 + i] = CAST_OP(0x0218); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0220 + i] = CAST_OP(0x0220); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0228 + i] = CAST_OP(0x0228); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0230 + i] = CAST_OP(0x0230); + JumpTable[0x0238] = CAST_OP(0x0238); + JumpTable[0x0239] = CAST_OP(0x0239); + JumpTable[0x021F] = CAST_OP(0x021F); + JumpTable[0x0227] = CAST_OP(0x0227); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0240 + i] = CAST_OP(0x0240); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0250 + i] = CAST_OP(0x0250); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0258 + i] = CAST_OP(0x0258); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0260 + i] = CAST_OP(0x0260); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0268 + i] = CAST_OP(0x0268); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0270 + i] = CAST_OP(0x0270); + JumpTable[0x0278] = CAST_OP(0x0278); + JumpTable[0x0279] = CAST_OP(0x0279); + JumpTable[0x025F] = CAST_OP(0x025F); + JumpTable[0x0267] = CAST_OP(0x0267); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0280 + i] = CAST_OP(0x0280); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0290 + i] = CAST_OP(0x0290); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0298 + i] = CAST_OP(0x0298); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x02A0 + i] = CAST_OP(0x02A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02A8 + i] = CAST_OP(0x02A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02B0 + i] = CAST_OP(0x02B0); + JumpTable[0x02B8] = CAST_OP(0x02B8); + JumpTable[0x02B9] = CAST_OP(0x02B9); + JumpTable[0x029F] = CAST_OP(0x029F); + JumpTable[0x02A7] = CAST_OP(0x02A7); + JumpTable[0x023C] = CAST_OP(0x023C); + JumpTable[0x027C] = CAST_OP(0x027C); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A00 + i] = CAST_OP(0x0A00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A10 + i] = CAST_OP(0x0A10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A18 + i] = CAST_OP(0x0A18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A20 + i] = CAST_OP(0x0A20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A28 + i] = CAST_OP(0x0A28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A30 + i] = CAST_OP(0x0A30); + JumpTable[0x0A38] = CAST_OP(0x0A38); + JumpTable[0x0A39] = CAST_OP(0x0A39); + JumpTable[0x0A1F] = CAST_OP(0x0A1F); + JumpTable[0x0A27] = CAST_OP(0x0A27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A40 + i] = CAST_OP(0x0A40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A50 + i] = CAST_OP(0x0A50); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A58 + i] = CAST_OP(0x0A58); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A60 + i] = CAST_OP(0x0A60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A68 + i] = CAST_OP(0x0A68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A70 + i] = CAST_OP(0x0A70); + JumpTable[0x0A78] = CAST_OP(0x0A78); + JumpTable[0x0A79] = CAST_OP(0x0A79); + JumpTable[0x0A5F] = CAST_OP(0x0A5F); + JumpTable[0x0A67] = CAST_OP(0x0A67); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A80 + i] = CAST_OP(0x0A80); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0A90 + i] = CAST_OP(0x0A90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0A98 + i] = CAST_OP(0x0A98); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0AA0 + i] = CAST_OP(0x0AA0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AA8 + i] = CAST_OP(0x0AA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AB0 + i] = CAST_OP(0x0AB0); + JumpTable[0x0AB8] = CAST_OP(0x0AB8); + JumpTable[0x0AB9] = CAST_OP(0x0AB9); + JumpTable[0x0A9F] = CAST_OP(0x0A9F); + JumpTable[0x0AA7] = CAST_OP(0x0AA7); + JumpTable[0x0A3C] = CAST_OP(0x0A3C); + JumpTable[0x0A7C] = CAST_OP(0x0A7C); +#ifdef OPCODES_M68020 + /* CAS - 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AD0 + i] = CAST_OP(0x0AD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0AD8 + i] = CAST_OP(0x0AD8); + JumpTable[0x0ADF] = CAST_OP(0x0ADF); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0AE0 + i] = CAST_OP(0x0AE0); + JumpTable[0x0AE7] = CAST_OP(0x0AE7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AE8 + i] = CAST_OP(0x0AE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0AF0 + i] = CAST_OP(0x0AF0); + JumpTable[0x0AF8] = CAST_OP(0x0AF8); + JumpTable[0x0AF9] = CAST_OP(0x0AF9); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CD0 + i] = CAST_OP(0x0CD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CD8 + i] = CAST_OP(0x0CD8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CE0 + i] = CAST_OP(0x0CE0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CE8 + i] = CAST_OP(0x0CE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CF0 + i] = CAST_OP(0x0CF0); + JumpTable[0x0CF8] = CAST_OP(0x0CF8); + JumpTable[0x0CF9] = CAST_OP(0x0CF9); + /* CAS2 - 68020+ */ + JumpTable[0x0CFC] = CAST_OP(0x0CFC); + JumpTable[0x0EFC] = CAST_OP(0x0EFC); + /* End of CAS2 */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0ED0 + i] = CAST_OP(0x0ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0ED8 + i] = CAST_OP(0x0ED8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0EE0 + i] = CAST_OP(0x0EE0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0EE8 + i] = CAST_OP(0x0EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0EF0 + i] = CAST_OP(0x0EF0); + JumpTable[0x0EF8] = CAST_OP(0x0EF8); + JumpTable[0x0EF9] = CAST_OP(0x0EF9); + /* End of CAS */ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0400 + i] = CAST_OP(0x0400); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0410 + i] = CAST_OP(0x0410); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0418 + i] = CAST_OP(0x0418); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0420 + i] = CAST_OP(0x0420); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0428 + i] = CAST_OP(0x0428); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0430 + i] = CAST_OP(0x0430); + JumpTable[0x0438] = CAST_OP(0x0438); + JumpTable[0x0439] = CAST_OP(0x0439); + JumpTable[0x041F] = CAST_OP(0x041F); + JumpTable[0x0427] = CAST_OP(0x0427); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0440 + i] = CAST_OP(0x0440); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0450 + i] = CAST_OP(0x0450); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0458 + i] = CAST_OP(0x0458); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0460 + i] = CAST_OP(0x0460); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0468 + i] = CAST_OP(0x0468); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0470 + i] = CAST_OP(0x0470); + JumpTable[0x0478] = CAST_OP(0x0478); + JumpTable[0x0479] = CAST_OP(0x0479); + JumpTable[0x045F] = CAST_OP(0x045F); + JumpTable[0x0467] = CAST_OP(0x0467); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0480 + i] = CAST_OP(0x0480); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0490 + i] = CAST_OP(0x0490); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0498 + i] = CAST_OP(0x0498); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x04A0 + i] = CAST_OP(0x04A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04A8 + i] = CAST_OP(0x04A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04B0 + i] = CAST_OP(0x04B0); + JumpTable[0x04B8] = CAST_OP(0x04B8); + JumpTable[0x04B9] = CAST_OP(0x04B9); + JumpTable[0x049F] = CAST_OP(0x049F); + JumpTable[0x04A7] = CAST_OP(0x04A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0600 + i] = CAST_OP(0x0600); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0610 + i] = CAST_OP(0x0610); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0618 + i] = CAST_OP(0x0618); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0620 + i] = CAST_OP(0x0620); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0628 + i] = CAST_OP(0x0628); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0630 + i] = CAST_OP(0x0630); + JumpTable[0x0638] = CAST_OP(0x0638); + JumpTable[0x0639] = CAST_OP(0x0639); + JumpTable[0x061F] = CAST_OP(0x061F); + JumpTable[0x0627] = CAST_OP(0x0627); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0640 + i] = CAST_OP(0x0640); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0650 + i] = CAST_OP(0x0650); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0658 + i] = CAST_OP(0x0658); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0660 + i] = CAST_OP(0x0660); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0668 + i] = CAST_OP(0x0668); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0670 + i] = CAST_OP(0x0670); + JumpTable[0x0678] = CAST_OP(0x0678); + JumpTable[0x0679] = CAST_OP(0x0679); + JumpTable[0x065F] = CAST_OP(0x065F); + JumpTable[0x0667] = CAST_OP(0x0667); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0680 + i] = CAST_OP(0x0680); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0690 + i] = CAST_OP(0x0690); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0698 + i] = CAST_OP(0x0698); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x06A0 + i] = CAST_OP(0x06A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x06A8 + i] = CAST_OP(0x06A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x06B0 + i] = CAST_OP(0x06B0); + JumpTable[0x06B8] = CAST_OP(0x06B8); + JumpTable[0x06B9] = CAST_OP(0x06B9); + JumpTable[0x069F] = CAST_OP(0x069F); + JumpTable[0x06A7] = CAST_OP(0x06A7); +#ifdef OPCODES_M68020 + /* RTM - 68020+ */ + JumpTable[0x06C0] = CAST_OP(0x06C0); + JumpTable[0x06C8] = CAST_OP(0x06C8); + /* End of RTM */ + /* CALLM - 68020+ */ + JumpTable[0x06D0] = CAST_OP(0x06D0); + JumpTable[0x06E8] = CAST_OP(0x06E8); + JumpTable[0x06F0] = CAST_OP(0x06F0); + JumpTable[0x06F8] = CAST_OP(0x06F8); + JumpTable[0x06F9] = CAST_OP(0x06F9); + JumpTable[0x06FA] = CAST_OP(0x06FA); + JumpTable[0x06FB] = CAST_OP(0x06FB); + /* End of CALLM */ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C00 + i] = CAST_OP(0x0C00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C10 + i] = CAST_OP(0x0C10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C18 + i] = CAST_OP(0x0C18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C20 + i] = CAST_OP(0x0C20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C28 + i] = CAST_OP(0x0C28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C30 + i] = CAST_OP(0x0C30); + JumpTable[0x0C38] = CAST_OP(0x0C38); + JumpTable[0x0C39] = CAST_OP(0x0C39); +#ifdef OPCODES_M68020 + JumpTable[0x0C3A] = CAST_OP(0x0C3A); // CMP - 68020+ + JumpTable[0x0C3B] = CAST_OP(0x0C3B); // CMP - 68020+ +#endif + JumpTable[0x0C1F] = CAST_OP(0x0C1F); + JumpTable[0x0C27] = CAST_OP(0x0C27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C40 + i] = CAST_OP(0x0C40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C50 + i] = CAST_OP(0x0C50); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C58 + i] = CAST_OP(0x0C58); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C60 + i] = CAST_OP(0x0C60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C68 + i] = CAST_OP(0x0C68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C70 + i] = CAST_OP(0x0C70); + JumpTable[0x0C78] = CAST_OP(0x0C78); + JumpTable[0x0C79] = CAST_OP(0x0C79); +#ifdef OPCODES_M68020 + JumpTable[0x0C7A] = CAST_OP(0x0C7A); // CMP - 68020+ + JumpTable[0x0C7B] = CAST_OP(0x0C7B); // CMP - 68020+ +#endif + JumpTable[0x0C5F] = CAST_OP(0x0C5F); + JumpTable[0x0C67] = CAST_OP(0x0C67); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C80 + i] = CAST_OP(0x0C80); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0C90 + i] = CAST_OP(0x0C90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0C98 + i] = CAST_OP(0x0C98); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0CA0 + i] = CAST_OP(0x0CA0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CA8 + i] = CAST_OP(0x0CA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0CB0 + i] = CAST_OP(0x0CB0); + JumpTable[0x0CB8] = CAST_OP(0x0CB8); + JumpTable[0x0CB9] = CAST_OP(0x0CB9); +#ifdef OPCODES_M68020 + JumpTable[0x0CBA] = CAST_OP(0x0CBA); // CMP - 68020+ + JumpTable[0x0CBB] = CAST_OP(0x0CBB); // CMP - 68020+ +#endif + JumpTable[0x0C9F] = CAST_OP(0x0C9F); + JumpTable[0x0CA7] = CAST_OP(0x0CA7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0800 + i] = CAST_OP(0x0800); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0810 + i] = CAST_OP(0x0810); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0818 + i] = CAST_OP(0x0818); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0820 + i] = CAST_OP(0x0820); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0828 + i] = CAST_OP(0x0828); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0830 + i] = CAST_OP(0x0830); + JumpTable[0x0838] = CAST_OP(0x0838); + JumpTable[0x0839] = CAST_OP(0x0839); + JumpTable[0x083A] = CAST_OP(0x083A); + JumpTable[0x083B] = CAST_OP(0x083B); + JumpTable[0x081F] = CAST_OP(0x081F); + JumpTable[0x0827] = CAST_OP(0x0827); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0840 + i] = CAST_OP(0x0840); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0850 + i] = CAST_OP(0x0850); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0858 + i] = CAST_OP(0x0858); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0860 + i] = CAST_OP(0x0860); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0868 + i] = CAST_OP(0x0868); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0870 + i] = CAST_OP(0x0870); + JumpTable[0x0878] = CAST_OP(0x0878); + JumpTable[0x0879] = CAST_OP(0x0879); + JumpTable[0x085F] = CAST_OP(0x085F); + JumpTable[0x0867] = CAST_OP(0x0867); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0880 + i] = CAST_OP(0x0880); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x0890 + i] = CAST_OP(0x0890); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x0898 + i] = CAST_OP(0x0898); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x08A0 + i] = CAST_OP(0x08A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08A8 + i] = CAST_OP(0x08A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08B0 + i] = CAST_OP(0x08B0); + JumpTable[0x08B8] = CAST_OP(0x08B8); + JumpTable[0x08B9] = CAST_OP(0x08B9); + JumpTable[0x089F] = CAST_OP(0x089F); + JumpTable[0x08A7] = CAST_OP(0x08A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08C0 + i] = CAST_OP(0x08C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08D0 + i] = CAST_OP(0x08D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x08D8 + i] = CAST_OP(0x08D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x08E0 + i] = CAST_OP(0x08E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08E8 + i] = CAST_OP(0x08E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x08F0 + i] = CAST_OP(0x08F0); + JumpTable[0x08F8] = CAST_OP(0x08F8); + JumpTable[0x08F9] = CAST_OP(0x08F9); + JumpTable[0x08DF] = CAST_OP(0x08DF); + JumpTable[0x08E7] = CAST_OP(0x08E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0100 + i + j] = CAST_OP(0x0100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0110 + i + j] = CAST_OP(0x0110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0118 + i + j] = CAST_OP(0x0118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0120 + i + j] = CAST_OP(0x0120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0128 + i + j] = CAST_OP(0x0128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0130 + i + j] = CAST_OP(0x0130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0138 + i] = CAST_OP(0x0138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0139 + i] = CAST_OP(0x0139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x013A + i] = CAST_OP(0x013A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x013B + i] = CAST_OP(0x013B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x013C + i] = CAST_OP(0x013C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x011F + i] = CAST_OP(0x011F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0127 + i] = CAST_OP(0x0127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0140 + i + j] = CAST_OP(0x0140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0150 + i + j] = CAST_OP(0x0150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0158 + i + j] = CAST_OP(0x0158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0160 + i + j] = CAST_OP(0x0160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0168 + i + j] = CAST_OP(0x0168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0170 + i + j] = CAST_OP(0x0170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0178 + i] = CAST_OP(0x0178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0179 + i] = CAST_OP(0x0179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x015F + i] = CAST_OP(0x015F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x0167 + i] = CAST_OP(0x0167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0180 + i + j] = CAST_OP(0x0180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0190 + i + j] = CAST_OP(0x0190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0198 + i + j] = CAST_OP(0x0198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01A0 + i + j] = CAST_OP(0x01A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01A8 + i + j] = CAST_OP(0x01A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01B0 + i + j] = CAST_OP(0x01B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01B8 + i] = CAST_OP(0x01B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01B9 + i] = CAST_OP(0x01B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x019F + i] = CAST_OP(0x019F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01A7 + i] = CAST_OP(0x01A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01C0 + i + j] = CAST_OP(0x01C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01D0 + i + j] = CAST_OP(0x01D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01D8 + i + j] = CAST_OP(0x01D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01E0 + i + j] = CAST_OP(0x01E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01E8 + i + j] = CAST_OP(0x01E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01F0 + i + j] = CAST_OP(0x01F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01F8 + i] = CAST_OP(0x01F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01F9 + i] = CAST_OP(0x01F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01DF + i] = CAST_OP(0x01DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x01E7 + i] = CAST_OP(0x01E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0108 + i + j] = CAST_OP(0x0108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0148 + i + j] = CAST_OP(0x0148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x0188 + i + j] = CAST_OP(0x0188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x01C8 + i + j] = CAST_OP(0x01C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1000 + i + j] = CAST_OP(0x1000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1080 + i + j] = CAST_OP(0x1080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10C0 + i + j] = CAST_OP(0x10C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1100 + i + j] = CAST_OP(0x1100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1140 + i + j] = CAST_OP(0x1140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1180 + i + j] = CAST_OP(0x1180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11C0 + i] = CAST_OP(0x11C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13C0 + i] = CAST_OP(0x13C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EC0 + i] = CAST_OP(0x1EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F00 + i] = CAST_OP(0x1F00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1008 + i + j] = CAST_OP(0x1008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1088 + i + j] = CAST_OP(0x1088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10C8 + i + j] = CAST_OP(0x10C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1108 + i + j] = CAST_OP(0x1108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1148 + i + j] = CAST_OP(0x1148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1188 + i + j] = CAST_OP(0x1188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11C8 + i] = CAST_OP(0x11C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13C8 + i] = CAST_OP(0x13C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EC8 + i] = CAST_OP(0x1EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F08 + i] = CAST_OP(0x1F08); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1010 + i + j] = CAST_OP(0x1010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1090 + i + j] = CAST_OP(0x1090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10D0 + i + j] = CAST_OP(0x10D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1110 + i + j] = CAST_OP(0x1110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1150 + i + j] = CAST_OP(0x1150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1190 + i + j] = CAST_OP(0x1190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11D0 + i] = CAST_OP(0x11D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13D0 + i] = CAST_OP(0x13D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1ED0 + i] = CAST_OP(0x1ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F10 + i] = CAST_OP(0x1F10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1018 + i + j] = CAST_OP(0x1018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1098 + i + j] = CAST_OP(0x1098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10D8 + i + j] = CAST_OP(0x10D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1118 + i + j] = CAST_OP(0x1118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1158 + i + j] = CAST_OP(0x1158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1198 + i + j] = CAST_OP(0x1198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x11D8 + i] = CAST_OP(0x11D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x13D8 + i] = CAST_OP(0x13D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1ED8 + i] = CAST_OP(0x1ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1F18 + i] = CAST_OP(0x1F18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1020 + i + j] = CAST_OP(0x1020); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x10A0 + i + j] = CAST_OP(0x10A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10E0 + i + j] = CAST_OP(0x10E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1120 + i + j] = CAST_OP(0x1120); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1160 + i + j] = CAST_OP(0x1160); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x11A0 + i + j] = CAST_OP(0x11A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x11E0 + i] = CAST_OP(0x11E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x13E0 + i] = CAST_OP(0x13E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1EE0 + i] = CAST_OP(0x1EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x1F20 + i] = CAST_OP(0x1F20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1028 + i + j] = CAST_OP(0x1028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x10A8 + i + j] = CAST_OP(0x10A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10E8 + i + j] = CAST_OP(0x10E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1128 + i + j] = CAST_OP(0x1128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1168 + i + j] = CAST_OP(0x1168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x11A8 + i + j] = CAST_OP(0x11A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11E8 + i] = CAST_OP(0x11E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13E8 + i] = CAST_OP(0x13E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EE8 + i] = CAST_OP(0x1EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F28 + i] = CAST_OP(0x1F28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1030 + i + j] = CAST_OP(0x1030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x10B0 + i + j] = CAST_OP(0x10B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x10F0 + i + j] = CAST_OP(0x10F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x1130 + i + j] = CAST_OP(0x1130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x1170 + i + j] = CAST_OP(0x1170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x11B0 + i + j] = CAST_OP(0x11B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x11F0 + i] = CAST_OP(0x11F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x13F0 + i] = CAST_OP(0x13F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1EF0 + i] = CAST_OP(0x1EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x1F30 + i] = CAST_OP(0x1F30); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1038 + i] = CAST_OP(0x1038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10B8 + i] = CAST_OP(0x10B8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10F8 + i] = CAST_OP(0x10F8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x1138 + i] = CAST_OP(0x1138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1178 + i] = CAST_OP(0x1178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11B8 + i] = CAST_OP(0x11B8); + JumpTable[0x11F8] = CAST_OP(0x11F8); + JumpTable[0x13F8] = CAST_OP(0x13F8); + JumpTable[0x1EF8] = CAST_OP(0x1EF8); + JumpTable[0x1F38] = CAST_OP(0x1F38); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1039 + i] = CAST_OP(0x1039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10B9 + i] = CAST_OP(0x10B9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10F9 + i] = CAST_OP(0x10F9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x1139 + i] = CAST_OP(0x1139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1179 + i] = CAST_OP(0x1179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11B9 + i] = CAST_OP(0x11B9); + JumpTable[0x11F9] = CAST_OP(0x11F9); + JumpTable[0x13F9] = CAST_OP(0x13F9); + JumpTable[0x1EF9] = CAST_OP(0x1EF9); + JumpTable[0x1F39] = CAST_OP(0x1F39); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x103A + i] = CAST_OP(0x103A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10BA + i] = CAST_OP(0x10BA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10FA + i] = CAST_OP(0x10FA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x113A + i] = CAST_OP(0x113A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x117A + i] = CAST_OP(0x117A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11BA + i] = CAST_OP(0x11BA); + JumpTable[0x11FA] = CAST_OP(0x11FA); + JumpTable[0x13FA] = CAST_OP(0x13FA); + JumpTable[0x1EFA] = CAST_OP(0x1EFA); + JumpTable[0x1F3A] = CAST_OP(0x1F3A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x103B + i] = CAST_OP(0x103B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10BB + i] = CAST_OP(0x10BB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10FB + i] = CAST_OP(0x10FB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x113B + i] = CAST_OP(0x113B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x117B + i] = CAST_OP(0x117B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11BB + i] = CAST_OP(0x11BB); + JumpTable[0x11FB] = CAST_OP(0x11FB); + JumpTable[0x13FB] = CAST_OP(0x13FB); + JumpTable[0x1EFB] = CAST_OP(0x1EFB); + JumpTable[0x1F3B] = CAST_OP(0x1F3B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x103C + i] = CAST_OP(0x103C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10BC + i] = CAST_OP(0x10BC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10FC + i] = CAST_OP(0x10FC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x113C + i] = CAST_OP(0x113C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x117C + i] = CAST_OP(0x117C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11BC + i] = CAST_OP(0x11BC); + JumpTable[0x11FC] = CAST_OP(0x11FC); + JumpTable[0x13FC] = CAST_OP(0x13FC); + JumpTable[0x1EFC] = CAST_OP(0x1EFC); + JumpTable[0x1F3C] = CAST_OP(0x1F3C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x101F + i] = CAST_OP(0x101F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x109F + i] = CAST_OP(0x109F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10DF + i] = CAST_OP(0x10DF); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x111F + i] = CAST_OP(0x111F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x115F + i] = CAST_OP(0x115F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x119F + i] = CAST_OP(0x119F); + JumpTable[0x11DF] = CAST_OP(0x11DF); + JumpTable[0x13DF] = CAST_OP(0x13DF); + JumpTable[0x1EDF] = CAST_OP(0x1EDF); + JumpTable[0x1F1F] = CAST_OP(0x1F1F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1027 + i] = CAST_OP(0x1027); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x10A7 + i] = CAST_OP(0x10A7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x10E7 + i] = CAST_OP(0x10E7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x1127 + i] = CAST_OP(0x1127); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x1167 + i] = CAST_OP(0x1167); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x11A7 + i] = CAST_OP(0x11A7); + JumpTable[0x11E7] = CAST_OP(0x11E7); + JumpTable[0x13E7] = CAST_OP(0x13E7); + JumpTable[0x1EE7] = CAST_OP(0x1EE7); + JumpTable[0x1F27] = CAST_OP(0x1F27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2000 + i + j] = CAST_OP(0x2000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2080 + i + j] = CAST_OP(0x2080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20C0 + i + j] = CAST_OP(0x20C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2100 + i + j] = CAST_OP(0x2100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2140 + i + j] = CAST_OP(0x2140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2180 + i + j] = CAST_OP(0x2180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21C0 + i] = CAST_OP(0x21C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23C0 + i] = CAST_OP(0x23C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EC0 + i] = CAST_OP(0x2EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F00 + i] = CAST_OP(0x2F00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2008 + i + j] = CAST_OP(0x2008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2088 + i + j] = CAST_OP(0x2088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20C8 + i + j] = CAST_OP(0x20C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2108 + i + j] = CAST_OP(0x2108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2148 + i + j] = CAST_OP(0x2148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2188 + i + j] = CAST_OP(0x2188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21C8 + i] = CAST_OP(0x21C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23C8 + i] = CAST_OP(0x23C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EC8 + i] = CAST_OP(0x2EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F08 + i] = CAST_OP(0x2F08); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2010 + i + j] = CAST_OP(0x2010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2090 + i + j] = CAST_OP(0x2090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20D0 + i + j] = CAST_OP(0x20D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2110 + i + j] = CAST_OP(0x2110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2150 + i + j] = CAST_OP(0x2150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2190 + i + j] = CAST_OP(0x2190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21D0 + i] = CAST_OP(0x21D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23D0 + i] = CAST_OP(0x23D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2ED0 + i] = CAST_OP(0x2ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F10 + i] = CAST_OP(0x2F10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2018 + i + j] = CAST_OP(0x2018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2098 + i + j] = CAST_OP(0x2098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20D8 + i + j] = CAST_OP(0x20D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2118 + i + j] = CAST_OP(0x2118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2158 + i + j] = CAST_OP(0x2158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2198 + i + j] = CAST_OP(0x2198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x21D8 + i] = CAST_OP(0x21D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x23D8 + i] = CAST_OP(0x23D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2ED8 + i] = CAST_OP(0x2ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2F18 + i] = CAST_OP(0x2F18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2020 + i + j] = CAST_OP(0x2020); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x20A0 + i + j] = CAST_OP(0x20A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20E0 + i + j] = CAST_OP(0x20E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2120 + i + j] = CAST_OP(0x2120); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2160 + i + j] = CAST_OP(0x2160); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x21A0 + i + j] = CAST_OP(0x21A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x21E0 + i] = CAST_OP(0x21E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x23E0 + i] = CAST_OP(0x23E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2EE0 + i] = CAST_OP(0x2EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x2F20 + i] = CAST_OP(0x2F20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2028 + i + j] = CAST_OP(0x2028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x20A8 + i + j] = CAST_OP(0x20A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20E8 + i + j] = CAST_OP(0x20E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2128 + i + j] = CAST_OP(0x2128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2168 + i + j] = CAST_OP(0x2168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x21A8 + i + j] = CAST_OP(0x21A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21E8 + i] = CAST_OP(0x21E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23E8 + i] = CAST_OP(0x23E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EE8 + i] = CAST_OP(0x2EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F28 + i] = CAST_OP(0x2F28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2030 + i + j] = CAST_OP(0x2030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x20B0 + i + j] = CAST_OP(0x20B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x20F0 + i + j] = CAST_OP(0x20F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x2130 + i + j] = CAST_OP(0x2130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2170 + i + j] = CAST_OP(0x2170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x21B0 + i + j] = CAST_OP(0x21B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x21F0 + i] = CAST_OP(0x21F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x23F0 + i] = CAST_OP(0x23F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2EF0 + i] = CAST_OP(0x2EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x2F30 + i] = CAST_OP(0x2F30); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2038 + i] = CAST_OP(0x2038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20B8 + i] = CAST_OP(0x20B8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20F8 + i] = CAST_OP(0x20F8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x2138 + i] = CAST_OP(0x2138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2178 + i] = CAST_OP(0x2178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21B8 + i] = CAST_OP(0x21B8); + JumpTable[0x21F8] = CAST_OP(0x21F8); + JumpTable[0x23F8] = CAST_OP(0x23F8); + JumpTable[0x2EF8] = CAST_OP(0x2EF8); + JumpTable[0x2F38] = CAST_OP(0x2F38); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2039 + i] = CAST_OP(0x2039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20B9 + i] = CAST_OP(0x20B9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20F9 + i] = CAST_OP(0x20F9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x2139 + i] = CAST_OP(0x2139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2179 + i] = CAST_OP(0x2179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21B9 + i] = CAST_OP(0x21B9); + JumpTable[0x21F9] = CAST_OP(0x21F9); + JumpTable[0x23F9] = CAST_OP(0x23F9); + JumpTable[0x2EF9] = CAST_OP(0x2EF9); + JumpTable[0x2F39] = CAST_OP(0x2F39); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x203A + i] = CAST_OP(0x203A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20BA + i] = CAST_OP(0x20BA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20FA + i] = CAST_OP(0x20FA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x213A + i] = CAST_OP(0x213A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x217A + i] = CAST_OP(0x217A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21BA + i] = CAST_OP(0x21BA); + JumpTable[0x21FA] = CAST_OP(0x21FA); + JumpTable[0x23FA] = CAST_OP(0x23FA); + JumpTable[0x2EFA] = CAST_OP(0x2EFA); + JumpTable[0x2F3A] = CAST_OP(0x2F3A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x203B + i] = CAST_OP(0x203B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20BB + i] = CAST_OP(0x20BB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20FB + i] = CAST_OP(0x20FB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x213B + i] = CAST_OP(0x213B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x217B + i] = CAST_OP(0x217B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21BB + i] = CAST_OP(0x21BB); + JumpTable[0x21FB] = CAST_OP(0x21FB); + JumpTable[0x23FB] = CAST_OP(0x23FB); + JumpTable[0x2EFB] = CAST_OP(0x2EFB); + JumpTable[0x2F3B] = CAST_OP(0x2F3B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x203C + i] = CAST_OP(0x203C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20BC + i] = CAST_OP(0x20BC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20FC + i] = CAST_OP(0x20FC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x213C + i] = CAST_OP(0x213C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x217C + i] = CAST_OP(0x217C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21BC + i] = CAST_OP(0x21BC); + JumpTable[0x21FC] = CAST_OP(0x21FC); + JumpTable[0x23FC] = CAST_OP(0x23FC); + JumpTable[0x2EFC] = CAST_OP(0x2EFC); + JumpTable[0x2F3C] = CAST_OP(0x2F3C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x201F + i] = CAST_OP(0x201F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x209F + i] = CAST_OP(0x209F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20DF + i] = CAST_OP(0x20DF); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x211F + i] = CAST_OP(0x211F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x215F + i] = CAST_OP(0x215F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x219F + i] = CAST_OP(0x219F); + JumpTable[0x21DF] = CAST_OP(0x21DF); + JumpTable[0x23DF] = CAST_OP(0x23DF); + JumpTable[0x2EDF] = CAST_OP(0x2EDF); + JumpTable[0x2F1F] = CAST_OP(0x2F1F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2027 + i] = CAST_OP(0x2027); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x20A7 + i] = CAST_OP(0x20A7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x20E7 + i] = CAST_OP(0x20E7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x2127 + i] = CAST_OP(0x2127); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2167 + i] = CAST_OP(0x2167); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x21A7 + i] = CAST_OP(0x21A7); + JumpTable[0x21E7] = CAST_OP(0x21E7); + JumpTable[0x23E7] = CAST_OP(0x23E7); + JumpTable[0x2EE7] = CAST_OP(0x2EE7); + JumpTable[0x2F27] = CAST_OP(0x2F27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3000 + i + j] = CAST_OP(0x3000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3080 + i + j] = CAST_OP(0x3080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30C0 + i + j] = CAST_OP(0x30C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3100 + i + j] = CAST_OP(0x3100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3140 + i + j] = CAST_OP(0x3140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3180 + i + j] = CAST_OP(0x3180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31C0 + i] = CAST_OP(0x31C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33C0 + i] = CAST_OP(0x33C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EC0 + i] = CAST_OP(0x3EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F00 + i] = CAST_OP(0x3F00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3008 + i + j] = CAST_OP(0x3008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3088 + i + j] = CAST_OP(0x3088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30C8 + i + j] = CAST_OP(0x30C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3108 + i + j] = CAST_OP(0x3108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3148 + i + j] = CAST_OP(0x3148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3188 + i + j] = CAST_OP(0x3188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31C8 + i] = CAST_OP(0x31C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33C8 + i] = CAST_OP(0x33C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EC8 + i] = CAST_OP(0x3EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F08 + i] = CAST_OP(0x3F08); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3010 + i + j] = CAST_OP(0x3010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3090 + i + j] = CAST_OP(0x3090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30D0 + i + j] = CAST_OP(0x30D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3110 + i + j] = CAST_OP(0x3110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3150 + i + j] = CAST_OP(0x3150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3190 + i + j] = CAST_OP(0x3190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31D0 + i] = CAST_OP(0x31D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33D0 + i] = CAST_OP(0x33D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3ED0 + i] = CAST_OP(0x3ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F10 + i] = CAST_OP(0x3F10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3018 + i + j] = CAST_OP(0x3018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3098 + i + j] = CAST_OP(0x3098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30D8 + i + j] = CAST_OP(0x30D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3118 + i + j] = CAST_OP(0x3118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3158 + i + j] = CAST_OP(0x3158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3198 + i + j] = CAST_OP(0x3198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x31D8 + i] = CAST_OP(0x31D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x33D8 + i] = CAST_OP(0x33D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3ED8 + i] = CAST_OP(0x3ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3F18 + i] = CAST_OP(0x3F18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3020 + i + j] = CAST_OP(0x3020); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x30A0 + i + j] = CAST_OP(0x30A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30E0 + i + j] = CAST_OP(0x30E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3120 + i + j] = CAST_OP(0x3120); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3160 + i + j] = CAST_OP(0x3160); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x31A0 + i + j] = CAST_OP(0x31A0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x31E0 + i] = CAST_OP(0x31E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x33E0 + i] = CAST_OP(0x33E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3EE0 + i] = CAST_OP(0x3EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x3F20 + i] = CAST_OP(0x3F20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3028 + i + j] = CAST_OP(0x3028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x30A8 + i + j] = CAST_OP(0x30A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30E8 + i + j] = CAST_OP(0x30E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3128 + i + j] = CAST_OP(0x3128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3168 + i + j] = CAST_OP(0x3168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x31A8 + i + j] = CAST_OP(0x31A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31E8 + i] = CAST_OP(0x31E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33E8 + i] = CAST_OP(0x33E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EE8 + i] = CAST_OP(0x3EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F28 + i] = CAST_OP(0x3F28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3030 + i + j] = CAST_OP(0x3030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x30B0 + i + j] = CAST_OP(0x30B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x30F0 + i + j] = CAST_OP(0x30F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x3130 + i + j] = CAST_OP(0x3130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3170 + i + j] = CAST_OP(0x3170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x31B0 + i + j] = CAST_OP(0x31B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x31F0 + i] = CAST_OP(0x31F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x33F0 + i] = CAST_OP(0x33F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3EF0 + i] = CAST_OP(0x3EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x3F30 + i] = CAST_OP(0x3F30); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3038 + i] = CAST_OP(0x3038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30B8 + i] = CAST_OP(0x30B8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30F8 + i] = CAST_OP(0x30F8); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x3138 + i] = CAST_OP(0x3138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3178 + i] = CAST_OP(0x3178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31B8 + i] = CAST_OP(0x31B8); + JumpTable[0x31F8] = CAST_OP(0x31F8); + JumpTable[0x33F8] = CAST_OP(0x33F8); + JumpTable[0x3EF8] = CAST_OP(0x3EF8); + JumpTable[0x3F38] = CAST_OP(0x3F38); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3039 + i] = CAST_OP(0x3039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30B9 + i] = CAST_OP(0x30B9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30F9 + i] = CAST_OP(0x30F9); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x3139 + i] = CAST_OP(0x3139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3179 + i] = CAST_OP(0x3179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31B9 + i] = CAST_OP(0x31B9); + JumpTable[0x31F9] = CAST_OP(0x31F9); + JumpTable[0x33F9] = CAST_OP(0x33F9); + JumpTable[0x3EF9] = CAST_OP(0x3EF9); + JumpTable[0x3F39] = CAST_OP(0x3F39); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x303A + i] = CAST_OP(0x303A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30BA + i] = CAST_OP(0x30BA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30FA + i] = CAST_OP(0x30FA); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x313A + i] = CAST_OP(0x313A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x317A + i] = CAST_OP(0x317A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31BA + i] = CAST_OP(0x31BA); + JumpTable[0x31FA] = CAST_OP(0x31FA); + JumpTable[0x33FA] = CAST_OP(0x33FA); + JumpTable[0x3EFA] = CAST_OP(0x3EFA); + JumpTable[0x3F3A] = CAST_OP(0x3F3A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x303B + i] = CAST_OP(0x303B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30BB + i] = CAST_OP(0x30BB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30FB + i] = CAST_OP(0x30FB); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x313B + i] = CAST_OP(0x313B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x317B + i] = CAST_OP(0x317B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31BB + i] = CAST_OP(0x31BB); + JumpTable[0x31FB] = CAST_OP(0x31FB); + JumpTable[0x33FB] = CAST_OP(0x33FB); + JumpTable[0x3EFB] = CAST_OP(0x3EFB); + JumpTable[0x3F3B] = CAST_OP(0x3F3B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x303C + i] = CAST_OP(0x303C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30BC + i] = CAST_OP(0x30BC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30FC + i] = CAST_OP(0x30FC); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x313C + i] = CAST_OP(0x313C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x317C + i] = CAST_OP(0x317C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31BC + i] = CAST_OP(0x31BC); + JumpTable[0x31FC] = CAST_OP(0x31FC); + JumpTable[0x33FC] = CAST_OP(0x33FC); + JumpTable[0x3EFC] = CAST_OP(0x3EFC); + JumpTable[0x3F3C] = CAST_OP(0x3F3C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x301F + i] = CAST_OP(0x301F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x309F + i] = CAST_OP(0x309F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30DF + i] = CAST_OP(0x30DF); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x311F + i] = CAST_OP(0x311F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x315F + i] = CAST_OP(0x315F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x319F + i] = CAST_OP(0x319F); + JumpTable[0x31DF] = CAST_OP(0x31DF); + JumpTable[0x33DF] = CAST_OP(0x33DF); + JumpTable[0x3EDF] = CAST_OP(0x3EDF); + JumpTable[0x3F1F] = CAST_OP(0x3F1F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3027 + i] = CAST_OP(0x3027); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x30A7 + i] = CAST_OP(0x30A7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x30E7 + i] = CAST_OP(0x30E7); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x3127 + i] = CAST_OP(0x3127); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3167 + i] = CAST_OP(0x3167); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x31A7 + i] = CAST_OP(0x31A7); + JumpTable[0x31E7] = CAST_OP(0x31E7); + JumpTable[0x33E7] = CAST_OP(0x33E7); + JumpTable[0x3EE7] = CAST_OP(0x3EE7); + JumpTable[0x3F27] = CAST_OP(0x3F27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2040 + i + j] = CAST_OP(0x2040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2048 + i + j] = CAST_OP(0x2048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2050 + i + j] = CAST_OP(0x2050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2058 + i + j] = CAST_OP(0x2058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2060 + i + j] = CAST_OP(0x2060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2068 + i + j] = CAST_OP(0x2068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x2070 + i + j] = CAST_OP(0x2070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2078 + i] = CAST_OP(0x2078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2079 + i] = CAST_OP(0x2079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x207A + i] = CAST_OP(0x207A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x207B + i] = CAST_OP(0x207B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x207C + i] = CAST_OP(0x207C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x205F + i] = CAST_OP(0x205F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x2067 + i] = CAST_OP(0x2067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3040 + i + j] = CAST_OP(0x3040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3048 + i + j] = CAST_OP(0x3048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3050 + i + j] = CAST_OP(0x3050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3058 + i + j] = CAST_OP(0x3058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3060 + i + j] = CAST_OP(0x3060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3068 + i + j] = CAST_OP(0x3068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x3070 + i + j] = CAST_OP(0x3070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3078 + i] = CAST_OP(0x3078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3079 + i] = CAST_OP(0x3079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x307A + i] = CAST_OP(0x307A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x307B + i] = CAST_OP(0x307B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x307C + i] = CAST_OP(0x307C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x305F + i] = CAST_OP(0x305F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x3067 + i] = CAST_OP(0x3067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4000 + i] = CAST_OP(0x4000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4010 + i] = CAST_OP(0x4010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4018 + i] = CAST_OP(0x4018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4020 + i] = CAST_OP(0x4020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4028 + i] = CAST_OP(0x4028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4030 + i] = CAST_OP(0x4030); + JumpTable[0x4038] = CAST_OP(0x4038); + JumpTable[0x4039] = CAST_OP(0x4039); + JumpTable[0x401F] = CAST_OP(0x401F); + JumpTable[0x4027] = CAST_OP(0x4027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4040 + i] = CAST_OP(0x4040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4050 + i] = CAST_OP(0x4050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4058 + i] = CAST_OP(0x4058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4060 + i] = CAST_OP(0x4060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4068 + i] = CAST_OP(0x4068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4070 + i] = CAST_OP(0x4070); + JumpTable[0x4078] = CAST_OP(0x4078); + JumpTable[0x4079] = CAST_OP(0x4079); + JumpTable[0x405F] = CAST_OP(0x405F); + JumpTable[0x4067] = CAST_OP(0x4067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4080 + i] = CAST_OP(0x4080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4090 + i] = CAST_OP(0x4090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4098 + i] = CAST_OP(0x4098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x40A0 + i] = CAST_OP(0x40A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40A8 + i] = CAST_OP(0x40A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40B0 + i] = CAST_OP(0x40B0); + JumpTable[0x40B8] = CAST_OP(0x40B8); + JumpTable[0x40B9] = CAST_OP(0x40B9); + JumpTable[0x409F] = CAST_OP(0x409F); + JumpTable[0x40A7] = CAST_OP(0x40A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4200 + i] = CAST_OP(0x4200); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4210 + i] = CAST_OP(0x4210); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4218 + i] = CAST_OP(0x4218); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4220 + i] = CAST_OP(0x4220); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4228 + i] = CAST_OP(0x4228); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4230 + i] = CAST_OP(0x4230); + JumpTable[0x4238] = CAST_OP(0x4238); + JumpTable[0x4239] = CAST_OP(0x4239); + JumpTable[0x421F] = CAST_OP(0x421F); + JumpTable[0x4227] = CAST_OP(0x4227); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4240 + i] = CAST_OP(0x4240); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4250 + i] = CAST_OP(0x4250); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4258 + i] = CAST_OP(0x4258); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4260 + i] = CAST_OP(0x4260); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4268 + i] = CAST_OP(0x4268); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4270 + i] = CAST_OP(0x4270); + JumpTable[0x4278] = CAST_OP(0x4278); + JumpTable[0x4279] = CAST_OP(0x4279); + JumpTable[0x425F] = CAST_OP(0x425F); + JumpTable[0x4267] = CAST_OP(0x4267); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4280 + i] = CAST_OP(0x4280); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4290 + i] = CAST_OP(0x4290); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4298 + i] = CAST_OP(0x4298); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x42A0 + i] = CAST_OP(0x42A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42A8 + i] = CAST_OP(0x42A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42B0 + i] = CAST_OP(0x42B0); + JumpTable[0x42B8] = CAST_OP(0x42B8); + JumpTable[0x42B9] = CAST_OP(0x42B9); + JumpTable[0x429F] = CAST_OP(0x429F); + JumpTable[0x42A7] = CAST_OP(0x42A7); +#ifdef OPCODES_M68020 + /* MOVE CCR */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42C0 + i] = CAST_OP(0x42C0); // MOVE CCR - 68020+ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42D0 + i] = CAST_OP(0x42D0); // MOVE CCR - 68020+ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42D8 + i] = CAST_OP(0x42D8); // MOVE CCR - 68020+ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42E0 + i] = CAST_OP(0x42E0); // MOVE CCR - 68020+ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42E8 + i] = CAST_OP(0x42E8); // MOVE CCR - 68020+ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x42F0 + i] = CAST_OP(0x42F0); // MOVE CCR - 68020+ + JumpTable[0x42F8] = CAST_OP(0x42F8); // MOVE CCR - 68020+ + JumpTable[0x42F9] = CAST_OP(0x42F9); // MOVE CCR - 68020+ + /* End of MOVE CCR */ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4400 + i] = CAST_OP(0x4400); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4410 + i] = CAST_OP(0x4410); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4418 + i] = CAST_OP(0x4418); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4420 + i] = CAST_OP(0x4420); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4428 + i] = CAST_OP(0x4428); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4430 + i] = CAST_OP(0x4430); + JumpTable[0x4438] = CAST_OP(0x4438); + JumpTable[0x4439] = CAST_OP(0x4439); + JumpTable[0x441F] = CAST_OP(0x441F); + JumpTable[0x4427] = CAST_OP(0x4427); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4440 + i] = CAST_OP(0x4440); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4450 + i] = CAST_OP(0x4450); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4458 + i] = CAST_OP(0x4458); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4460 + i] = CAST_OP(0x4460); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4468 + i] = CAST_OP(0x4468); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4470 + i] = CAST_OP(0x4470); + JumpTable[0x4478] = CAST_OP(0x4478); + JumpTable[0x4479] = CAST_OP(0x4479); + JumpTable[0x445F] = CAST_OP(0x445F); + JumpTable[0x4467] = CAST_OP(0x4467); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4480 + i] = CAST_OP(0x4480); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4490 + i] = CAST_OP(0x4490); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4498 + i] = CAST_OP(0x4498); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x44A0 + i] = CAST_OP(0x44A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44A8 + i] = CAST_OP(0x44A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44B0 + i] = CAST_OP(0x44B0); + JumpTable[0x44B8] = CAST_OP(0x44B8); + JumpTable[0x44B9] = CAST_OP(0x44B9); + JumpTable[0x449F] = CAST_OP(0x449F); + JumpTable[0x44A7] = CAST_OP(0x44A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4600 + i] = CAST_OP(0x4600); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4610 + i] = CAST_OP(0x4610); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4618 + i] = CAST_OP(0x4618); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4620 + i] = CAST_OP(0x4620); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4628 + i] = CAST_OP(0x4628); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4630 + i] = CAST_OP(0x4630); + JumpTable[0x4638] = CAST_OP(0x4638); + JumpTable[0x4639] = CAST_OP(0x4639); + JumpTable[0x461F] = CAST_OP(0x461F); + JumpTable[0x4627] = CAST_OP(0x4627); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4640 + i] = CAST_OP(0x4640); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4650 + i] = CAST_OP(0x4650); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4658 + i] = CAST_OP(0x4658); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4660 + i] = CAST_OP(0x4660); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4668 + i] = CAST_OP(0x4668); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4670 + i] = CAST_OP(0x4670); + JumpTable[0x4678] = CAST_OP(0x4678); + JumpTable[0x4679] = CAST_OP(0x4679); + JumpTable[0x465F] = CAST_OP(0x465F); + JumpTable[0x4667] = CAST_OP(0x4667); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4680 + i] = CAST_OP(0x4680); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4690 + i] = CAST_OP(0x4690); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4698 + i] = CAST_OP(0x4698); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x46A0 + i] = CAST_OP(0x46A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46A8 + i] = CAST_OP(0x46A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46B0 + i] = CAST_OP(0x46B0); + JumpTable[0x46B8] = CAST_OP(0x46B8); + JumpTable[0x46B9] = CAST_OP(0x46B9); + JumpTable[0x469F] = CAST_OP(0x469F); + JumpTable[0x46A7] = CAST_OP(0x46A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40C0 + i] = CAST_OP(0x40C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40D0 + i] = CAST_OP(0x40D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x40D8 + i] = CAST_OP(0x40D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x40E0 + i] = CAST_OP(0x40E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40E8 + i] = CAST_OP(0x40E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x40F0 + i] = CAST_OP(0x40F0); + JumpTable[0x40F8] = CAST_OP(0x40F8); + JumpTable[0x40F9] = CAST_OP(0x40F9); + JumpTable[0x40DF] = CAST_OP(0x40DF); + JumpTable[0x40E7] = CAST_OP(0x40E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44C0 + i] = CAST_OP(0x44C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44D0 + i] = CAST_OP(0x44D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x44D8 + i] = CAST_OP(0x44D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x44E0 + i] = CAST_OP(0x44E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44E8 + i] = CAST_OP(0x44E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x44F0 + i] = CAST_OP(0x44F0); + JumpTable[0x44F8] = CAST_OP(0x44F8); + JumpTable[0x44F9] = CAST_OP(0x44F9); + JumpTable[0x44FA] = CAST_OP(0x44FA); + JumpTable[0x44FB] = CAST_OP(0x44FB); + JumpTable[0x44FC] = CAST_OP(0x44FC); + JumpTable[0x44DF] = CAST_OP(0x44DF); + JumpTable[0x44E7] = CAST_OP(0x44E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46C0 + i] = CAST_OP(0x46C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46D0 + i] = CAST_OP(0x46D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x46D8 + i] = CAST_OP(0x46D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x46E0 + i] = CAST_OP(0x46E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46E8 + i] = CAST_OP(0x46E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x46F0 + i] = CAST_OP(0x46F0); + JumpTable[0x46F8] = CAST_OP(0x46F8); + JumpTable[0x46F9] = CAST_OP(0x46F9); + JumpTable[0x46FA] = CAST_OP(0x46FA); + JumpTable[0x46FB] = CAST_OP(0x46FB); + JumpTable[0x46FC] = CAST_OP(0x46FC); + JumpTable[0x46DF] = CAST_OP(0x46DF); + JumpTable[0x46E7] = CAST_OP(0x46E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4800 + i] = CAST_OP(0x4800); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4810 + i] = CAST_OP(0x4810); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4818 + i] = CAST_OP(0x4818); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4820 + i] = CAST_OP(0x4820); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4828 + i] = CAST_OP(0x4828); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4830 + i] = CAST_OP(0x4830); + JumpTable[0x4838] = CAST_OP(0x4838); + JumpTable[0x4839] = CAST_OP(0x4839); + JumpTable[0x481F] = CAST_OP(0x481F); + JumpTable[0x4827] = CAST_OP(0x4827); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4850 + i] = CAST_OP(0x4850); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4868 + i] = CAST_OP(0x4868); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4870 + i] = CAST_OP(0x4870); + JumpTable[0x4878] = CAST_OP(0x4878); + JumpTable[0x4879] = CAST_OP(0x4879); + JumpTable[0x487A] = CAST_OP(0x487A); + JumpTable[0x487B] = CAST_OP(0x487B); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4840 + i] = CAST_OP(0x4840); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4890 + i] = CAST_OP(0x4890); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x48A0 + i] = CAST_OP(0x48A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48A8 + i] = CAST_OP(0x48A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48B0 + i] = CAST_OP(0x48B0); + JumpTable[0x48B8] = CAST_OP(0x48B8); + JumpTable[0x48B9] = CAST_OP(0x48B9); + JumpTable[0x48A7] = CAST_OP(0x48A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48D0 + i] = CAST_OP(0x48D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x48E0 + i] = CAST_OP(0x48E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48E8 + i] = CAST_OP(0x48E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48F0 + i] = CAST_OP(0x48F0); + JumpTable[0x48F8] = CAST_OP(0x48F8); + JumpTable[0x48F9] = CAST_OP(0x48F9); + JumpTable[0x48E7] = CAST_OP(0x48E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4880 + i] = CAST_OP(0x4880); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x48C0 + i] = CAST_OP(0x48C0); +#ifdef OPCODES_M68020 + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x49C0 + i] = CAST_OP(0x49C0); // EXT.B - 68020+ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A00 + i] = CAST_OP(0x4A00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A10 + i] = CAST_OP(0x4A10); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A18 + i] = CAST_OP(0x4A18); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A20 + i] = CAST_OP(0x4A20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A28 + i] = CAST_OP(0x4A28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A30 + i] = CAST_OP(0x4A30); + JumpTable[0x4A38] = CAST_OP(0x4A38); + JumpTable[0x4A39] = CAST_OP(0x4A39); +#ifdef OPCODES_M68020 + JumpTable[0x4A3A] = CAST_OP(0x4A3A); // TST - 68020+ + JumpTable[0x4A3B] = CAST_OP(0x4A3B); // TST - 68020+ + JumpTable[0x4A3C] = CAST_OP(0x4A3C); // TST - 68020+ +#endif + JumpTable[0x4A1F] = CAST_OP(0x4A1F); + JumpTable[0x4A27] = CAST_OP(0x4A27); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A40 + i] = CAST_OP(0x4A40); +#ifdef OPCODES_M68020 + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A48 + i] = CAST_OP(0x4A48); // TST - 68020+ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A50 + i] = CAST_OP(0x4A50); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A58 + i] = CAST_OP(0x4A58); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A60 + i] = CAST_OP(0x4A60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A68 + i] = CAST_OP(0x4A68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A70 + i] = CAST_OP(0x4A70); + JumpTable[0x4A78] = CAST_OP(0x4A78); + JumpTable[0x4A79] = CAST_OP(0x4A79); +#ifdef OPCODES_M68020 + JumpTable[0x4A7A] = CAST_OP(0x4A7A); // TST - 68020+ + JumpTable[0x4A7B] = CAST_OP(0x4A7B); // TST - 68020+ + JumpTable[0x4A7C] = CAST_OP(0x4A7C); // TST - 68020+ +#endif + JumpTable[0x4A5F] = CAST_OP(0x4A5F); + JumpTable[0x4A67] = CAST_OP(0x4A67); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A80 + i] = CAST_OP(0x4A80); +#ifdef OPCODES_M68020 + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A88 + i] = CAST_OP(0x4A88); // TST - 68020+ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4A90 + i] = CAST_OP(0x4A90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4A98 + i] = CAST_OP(0x4A98); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4AA0 + i] = CAST_OP(0x4AA0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AA8 + i] = CAST_OP(0x4AA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AB0 + i] = CAST_OP(0x4AB0); + JumpTable[0x4AB8] = CAST_OP(0x4AB8); + JumpTable[0x4AB9] = CAST_OP(0x4AB9); +#ifdef OPCODES_M68020 + JumpTable[0x4ABA] = CAST_OP(0x4ABA); // TST - 68020+ + JumpTable[0x4ABB] = CAST_OP(0x4ABB); // TST - 68020+ + JumpTable[0x4ABC] = CAST_OP(0x4ABC); // TST - 68020+ +#endif + JumpTable[0x4A9F] = CAST_OP(0x4A9F); + JumpTable[0x4AA7] = CAST_OP(0x4AA7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AC0 + i] = CAST_OP(0x4AC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AD0 + i] = CAST_OP(0x4AD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4AD8 + i] = CAST_OP(0x4AD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4AE0 + i] = CAST_OP(0x4AE0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AE8 + i] = CAST_OP(0x4AE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4AF0 + i] = CAST_OP(0x4AF0); + JumpTable[0x4AF8] = CAST_OP(0x4AF8); + JumpTable[0x4AF9] = CAST_OP(0x4AF9); + JumpTable[0x4ADF] = CAST_OP(0x4ADF); + JumpTable[0x4AE7] = CAST_OP(0x4AE7); + JumpTable[0x4AFC] = CAST_OP(0x4AFC); +#ifdef OPCODES_M68020 + /* MULS/MULU.L, 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C00 + i] = CAST_OP(0x4C00); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C10 + i] = CAST_OP(0x4C10); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C18 + i] = CAST_OP(0x4C18); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C20 + i] = CAST_OP(0x4C20); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C28 + i] = CAST_OP(0x4C28); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C30 + i] = CAST_OP(0x4C30); + JumpTable[0x4C38] = CAST_OP(0x4C38); + JumpTable[0x4C39] = CAST_OP(0x4C39); + JumpTable[0x4C3A] = CAST_OP(0x4C3A); + JumpTable[0x4C3B] = CAST_OP(0x4C3B); + JumpTable[0x4C3C] = CAST_OP(0x4C3C); + /* End of MULS/MULU.L */ + /* DIVS/DIVL.L, 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C40 + i] = CAST_OP(0x4C40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C50 + i] = CAST_OP(0x4C50); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C58 + i] = CAST_OP(0x4C58); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C60 + i] = CAST_OP(0x4C60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C68 + i] = CAST_OP(0x4C68); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C70 + i] = CAST_OP(0x4C70); + JumpTable[0x4C78] = CAST_OP(0x4C78); + JumpTable[0x4C79] = CAST_OP(0x4C79); + JumpTable[0x4C7A] = CAST_OP(0x4C7A); + JumpTable[0x4C7B] = CAST_OP(0x4C7B); + JumpTable[0x4C7C] = CAST_OP(0x4C7C); + /* End of DIVS/DIVL.L */ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4C90 + i] = CAST_OP(0x4C90); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4C98 + i] = CAST_OP(0x4C98); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CA8 + i] = CAST_OP(0x4CA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CB0 + i] = CAST_OP(0x4CB0); + JumpTable[0x4CB8] = CAST_OP(0x4CB8); + JumpTable[0x4CB9] = CAST_OP(0x4CB9); + JumpTable[0x4CBA] = CAST_OP(0x4CBA); + JumpTable[0x4CBB] = CAST_OP(0x4CBB); + JumpTable[0x4C9F] = CAST_OP(0x4C9F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CD0 + i] = CAST_OP(0x4CD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4CD8 + i] = CAST_OP(0x4CD8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CE8 + i] = CAST_OP(0x4CE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4CF0 + i] = CAST_OP(0x4CF0); + JumpTable[0x4CF8] = CAST_OP(0x4CF8); + JumpTable[0x4CF9] = CAST_OP(0x4CF9); + JumpTable[0x4CFA] = CAST_OP(0x4CFA); + JumpTable[0x4CFB] = CAST_OP(0x4CFB); + JumpTable[0x4CDF] = CAST_OP(0x4CDF); + for(i = 0x0000; i <= 0x000F; i += 0x0001) + JumpTable[0x4E40 + i] = CAST_OP(0x4E40); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E50 + i] = CAST_OP(0x4E50); + JumpTable[0x4E57] = CAST_OP(0x4E57); +#ifdef OPCODES_M68020 + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x4808 + i] = CAST_OP(0x4808); // LINK32 - 68020+ + JumpTable[0x480F] = CAST_OP(0x480F); // LINK32 - 68020+ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E58 + i] = CAST_OP(0x4E58); + JumpTable[0x4E5F] = CAST_OP(0x4E5F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E60 + i] = CAST_OP(0x4E60); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E68 + i] = CAST_OP(0x4E68); + JumpTable[0x4E70] = CAST_OP(0x4E70); + JumpTable[0x4E71] = CAST_OP(0x4E71); + JumpTable[0x4E72] = CAST_OP(0x4E72); + JumpTable[0x4E73] = CAST_OP(0x4E73); // RTE - different for 68010+ +#ifdef OPCODES_M68020 + JumpTable[0x4E74] = CAST_OP(0x4E74); // RTD - 68010+ +#endif + JumpTable[0x4E75] = CAST_OP(0x4E75); + JumpTable[0x4E76] = CAST_OP(0x4E76); + JumpTable[0x4E77] = CAST_OP(0x4E77); +#ifdef OPCODES_M68020 + JumpTable[0x4E7A] = CAST_OP(0x4E7A); // MOVEC Rc, Xn - 68020+ + JumpTable[0x4E7B] = CAST_OP(0x4E7B); // MOVEC Xn, Rc - 68020+ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4E90 + i] = CAST_OP(0x4E90); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EA8 + i] = CAST_OP(0x4EA8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EB0 + i] = CAST_OP(0x4EB0); + JumpTable[0x4EB8] = CAST_OP(0x4EB8); + JumpTable[0x4EB9] = CAST_OP(0x4EB9); + JumpTable[0x4EBA] = CAST_OP(0x4EBA); + JumpTable[0x4EBB] = CAST_OP(0x4EBB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4ED0 + i] = CAST_OP(0x4ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EE8 + i] = CAST_OP(0x4EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x4EF0 + i] = CAST_OP(0x4EF0); + JumpTable[0x4EF8] = CAST_OP(0x4EF8); + JumpTable[0x4EF9] = CAST_OP(0x4EF9); + JumpTable[0x4EFA] = CAST_OP(0x4EFA); + JumpTable[0x4EFB] = CAST_OP(0x4EFB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4180 + i + j] = CAST_OP(0x4180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4190 + i + j] = CAST_OP(0x4190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4198 + i + j] = CAST_OP(0x4198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41A0 + i + j] = CAST_OP(0x41A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41A8 + i + j] = CAST_OP(0x41A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41B0 + i + j] = CAST_OP(0x41B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41B8 + i] = CAST_OP(0x41B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41B9 + i] = CAST_OP(0x41B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41BA + i] = CAST_OP(0x41BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41BB + i] = CAST_OP(0x41BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41BC + i] = CAST_OP(0x41BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x419F + i] = CAST_OP(0x419F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41A7 + i] = CAST_OP(0x41A7); +#ifdef OPCODES_M68020 + /* CHK.L - 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4100 + i + j] = CAST_OP(0x4100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4110 + i + j] = CAST_OP(0x4110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4118 + i + j] = CAST_OP(0x4118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4120 + i + j] = CAST_OP(0x4120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4128 + i + j] = CAST_OP(0x4128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x4130 + i + j] = CAST_OP(0x4130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x4138 + i] = CAST_OP(0x4138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x4139 + i] = CAST_OP(0x4139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x413A + i] = CAST_OP(0x413A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x413B + i] = CAST_OP(0x413B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x413C + i] = CAST_OP(0x413C); + /* End of CHK.L */ + /* CMP2/CHK2 - 68020 + */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00D0 + i] = CAST_OP(0x00D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00E8 + i] = CAST_OP(0x00E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x00F0 + i] = CAST_OP(0x00F0); + JumpTable[0x00F8] = CAST_OP(0x00F8); + JumpTable[0x00F9] = CAST_OP(0x00F9); + JumpTable[0x00FA] = CAST_OP(0x00FA); + JumpTable[0x00FB] = CAST_OP(0x00FB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02D0 + i] = CAST_OP(0x02D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02E8 + i] = CAST_OP(0x02E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x02F0 + i] = CAST_OP(0x02F0); + JumpTable[0x02F8] = CAST_OP(0x02F8); + JumpTable[0x02F9] = CAST_OP(0x02F9); + JumpTable[0x02FA] = CAST_OP(0x02FA); + JumpTable[0x02FB] = CAST_OP(0x02FB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04D0 + i] = CAST_OP(0x04D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04E8 + i] = CAST_OP(0x04E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x04F0 + i] = CAST_OP(0x04F0); + JumpTable[0x04F8] = CAST_OP(0x04F8); + JumpTable[0x04F9] = CAST_OP(0x04F9); + JumpTable[0x04FA] = CAST_OP(0x04FA); + JumpTable[0x04FB] = CAST_OP(0x04FB); + /* End of CMP2/CHK2 */ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41D0 + i + j] = CAST_OP(0x41D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41E8 + i + j] = CAST_OP(0x41E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x41F0 + i + j] = CAST_OP(0x41F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41F8 + i] = CAST_OP(0x41F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41F9 + i] = CAST_OP(0x41F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41FA + i] = CAST_OP(0x41FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x41FB + i] = CAST_OP(0x41FB); +#ifdef OPCODES_M68020 + for(i = 0x0000; i <= 0x0F00; i+= 0x0100) + JumpTable[0x50FA + i] = CAST_OP(0x50FA); // TRAPcc - 68020+ + for(i = 0x0000; i <= 0x0F00; i+= 0x0100) + JumpTable[0x50FB + i] = CAST_OP(0x50FB); // TRAPcc - 68020+ + for(i = 0x0000; i <= 0x0F00; i+= 0x0100) + JumpTable[0x50FC + i] = CAST_OP(0x50FC); // TRAPcc - 68020+ +#endif + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50C0 + i] = CAST_OP(0x50C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51C0 + i] = CAST_OP(0x51C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52C0 + i] = CAST_OP(0x52C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53C0 + i] = CAST_OP(0x53C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54C0 + i] = CAST_OP(0x54C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55C0 + i] = CAST_OP(0x55C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56C0 + i] = CAST_OP(0x56C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57C0 + i] = CAST_OP(0x57C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58C0 + i] = CAST_OP(0x58C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59C0 + i] = CAST_OP(0x59C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AC0 + i] = CAST_OP(0x5AC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BC0 + i] = CAST_OP(0x5BC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CC0 + i] = CAST_OP(0x5CC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DC0 + i] = CAST_OP(0x5DC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EC0 + i] = CAST_OP(0x5EC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FC0 + i] = CAST_OP(0x5FC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50D0 + i] = CAST_OP(0x50D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51D0 + i] = CAST_OP(0x51D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52D0 + i] = CAST_OP(0x52D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53D0 + i] = CAST_OP(0x53D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54D0 + i] = CAST_OP(0x54D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55D0 + i] = CAST_OP(0x55D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56D0 + i] = CAST_OP(0x56D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57D0 + i] = CAST_OP(0x57D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58D0 + i] = CAST_OP(0x58D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59D0 + i] = CAST_OP(0x59D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AD0 + i] = CAST_OP(0x5AD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BD0 + i] = CAST_OP(0x5BD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CD0 + i] = CAST_OP(0x5CD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DD0 + i] = CAST_OP(0x5DD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5ED0 + i] = CAST_OP(0x5ED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FD0 + i] = CAST_OP(0x5FD0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x50D8 + i] = CAST_OP(0x50D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x51D8 + i] = CAST_OP(0x51D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x52D8 + i] = CAST_OP(0x52D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x53D8 + i] = CAST_OP(0x53D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x54D8 + i] = CAST_OP(0x54D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x55D8 + i] = CAST_OP(0x55D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x56D8 + i] = CAST_OP(0x56D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x57D8 + i] = CAST_OP(0x57D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x58D8 + i] = CAST_OP(0x58D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x59D8 + i] = CAST_OP(0x59D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5AD8 + i] = CAST_OP(0x5AD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5BD8 + i] = CAST_OP(0x5BD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5CD8 + i] = CAST_OP(0x5CD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5DD8 + i] = CAST_OP(0x5DD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5ED8 + i] = CAST_OP(0x5ED8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5FD8 + i] = CAST_OP(0x5FD8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x50E0 + i] = CAST_OP(0x50E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x51E0 + i] = CAST_OP(0x51E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x52E0 + i] = CAST_OP(0x52E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x53E0 + i] = CAST_OP(0x53E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x54E0 + i] = CAST_OP(0x54E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x55E0 + i] = CAST_OP(0x55E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x56E0 + i] = CAST_OP(0x56E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x57E0 + i] = CAST_OP(0x57E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x58E0 + i] = CAST_OP(0x58E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x59E0 + i] = CAST_OP(0x59E0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5AE0 + i] = CAST_OP(0x5AE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5BE0 + i] = CAST_OP(0x5BE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5CE0 + i] = CAST_OP(0x5CE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5DE0 + i] = CAST_OP(0x5DE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5EE0 + i] = CAST_OP(0x5EE0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x5FE0 + i] = CAST_OP(0x5FE0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50E8 + i] = CAST_OP(0x50E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51E8 + i] = CAST_OP(0x51E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52E8 + i] = CAST_OP(0x52E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53E8 + i] = CAST_OP(0x53E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54E8 + i] = CAST_OP(0x54E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55E8 + i] = CAST_OP(0x55E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56E8 + i] = CAST_OP(0x56E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57E8 + i] = CAST_OP(0x57E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58E8 + i] = CAST_OP(0x58E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59E8 + i] = CAST_OP(0x59E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AE8 + i] = CAST_OP(0x5AE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BE8 + i] = CAST_OP(0x5BE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CE8 + i] = CAST_OP(0x5CE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DE8 + i] = CAST_OP(0x5DE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EE8 + i] = CAST_OP(0x5EE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FE8 + i] = CAST_OP(0x5FE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50F0 + i] = CAST_OP(0x50F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51F0 + i] = CAST_OP(0x51F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52F0 + i] = CAST_OP(0x52F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53F0 + i] = CAST_OP(0x53F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54F0 + i] = CAST_OP(0x54F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55F0 + i] = CAST_OP(0x55F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56F0 + i] = CAST_OP(0x56F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57F0 + i] = CAST_OP(0x57F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58F0 + i] = CAST_OP(0x58F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59F0 + i] = CAST_OP(0x59F0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AF0 + i] = CAST_OP(0x5AF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BF0 + i] = CAST_OP(0x5BF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CF0 + i] = CAST_OP(0x5CF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DF0 + i] = CAST_OP(0x5DF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EF0 + i] = CAST_OP(0x5EF0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FF0 + i] = CAST_OP(0x5FF0); + JumpTable[0x50F8] = CAST_OP(0x50F8); + JumpTable[0x51F8] = CAST_OP(0x51F8); + JumpTable[0x52F8] = CAST_OP(0x52F8); + JumpTable[0x53F8] = CAST_OP(0x53F8); + JumpTable[0x54F8] = CAST_OP(0x54F8); + JumpTable[0x55F8] = CAST_OP(0x55F8); + JumpTable[0x56F8] = CAST_OP(0x56F8); + JumpTable[0x57F8] = CAST_OP(0x57F8); + JumpTable[0x58F8] = CAST_OP(0x58F8); + JumpTable[0x59F8] = CAST_OP(0x59F8); + JumpTable[0x5AF8] = CAST_OP(0x5AF8); + JumpTable[0x5BF8] = CAST_OP(0x5BF8); + JumpTable[0x5CF8] = CAST_OP(0x5CF8); + JumpTable[0x5DF8] = CAST_OP(0x5DF8); + JumpTable[0x5EF8] = CAST_OP(0x5EF8); + JumpTable[0x5FF8] = CAST_OP(0x5FF8); + JumpTable[0x50F9] = CAST_OP(0x50F9); + JumpTable[0x51F9] = CAST_OP(0x51F9); + JumpTable[0x52F9] = CAST_OP(0x52F9); + JumpTable[0x53F9] = CAST_OP(0x53F9); + JumpTable[0x54F9] = CAST_OP(0x54F9); + JumpTable[0x55F9] = CAST_OP(0x55F9); + JumpTable[0x56F9] = CAST_OP(0x56F9); + JumpTable[0x57F9] = CAST_OP(0x57F9); + JumpTable[0x58F9] = CAST_OP(0x58F9); + JumpTable[0x59F9] = CAST_OP(0x59F9); + JumpTable[0x5AF9] = CAST_OP(0x5AF9); + JumpTable[0x5BF9] = CAST_OP(0x5BF9); + JumpTable[0x5CF9] = CAST_OP(0x5CF9); + JumpTable[0x5DF9] = CAST_OP(0x5DF9); + JumpTable[0x5EF9] = CAST_OP(0x5EF9); + JumpTable[0x5FF9] = CAST_OP(0x5FF9); + JumpTable[0x50DF] = CAST_OP(0x50DF); + JumpTable[0x51DF] = CAST_OP(0x51DF); + JumpTable[0x52DF] = CAST_OP(0x52DF); + JumpTable[0x53DF] = CAST_OP(0x53DF); + JumpTable[0x54DF] = CAST_OP(0x54DF); + JumpTable[0x55DF] = CAST_OP(0x55DF); + JumpTable[0x56DF] = CAST_OP(0x56DF); + JumpTable[0x57DF] = CAST_OP(0x57DF); + JumpTable[0x58DF] = CAST_OP(0x58DF); + JumpTable[0x59DF] = CAST_OP(0x59DF); + JumpTable[0x5ADF] = CAST_OP(0x5ADF); + JumpTable[0x5BDF] = CAST_OP(0x5BDF); + JumpTable[0x5CDF] = CAST_OP(0x5CDF); + JumpTable[0x5DDF] = CAST_OP(0x5DDF); + JumpTable[0x5EDF] = CAST_OP(0x5EDF); + JumpTable[0x5FDF] = CAST_OP(0x5FDF); + JumpTable[0x50E7] = CAST_OP(0x50E7); + JumpTable[0x51E7] = CAST_OP(0x51E7); + JumpTable[0x52E7] = CAST_OP(0x52E7); + JumpTable[0x53E7] = CAST_OP(0x53E7); + JumpTable[0x54E7] = CAST_OP(0x54E7); + JumpTable[0x55E7] = CAST_OP(0x55E7); + JumpTable[0x56E7] = CAST_OP(0x56E7); + JumpTable[0x57E7] = CAST_OP(0x57E7); + JumpTable[0x58E7] = CAST_OP(0x58E7); + JumpTable[0x59E7] = CAST_OP(0x59E7); + JumpTable[0x5AE7] = CAST_OP(0x5AE7); + JumpTable[0x5BE7] = CAST_OP(0x5BE7); + JumpTable[0x5CE7] = CAST_OP(0x5CE7); + JumpTable[0x5DE7] = CAST_OP(0x5DE7); + JumpTable[0x5EE7] = CAST_OP(0x5EE7); + JumpTable[0x5FE7] = CAST_OP(0x5FE7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x50C8 + i] = CAST_OP(0x50C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x51C8 + i] = CAST_OP(0x51C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x52C8 + i] = CAST_OP(0x52C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x53C8 + i] = CAST_OP(0x53C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x54C8 + i] = CAST_OP(0x54C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x55C8 + i] = CAST_OP(0x55C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x56C8 + i] = CAST_OP(0x56C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x57C8 + i] = CAST_OP(0x57C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x58C8 + i] = CAST_OP(0x58C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x59C8 + i] = CAST_OP(0x59C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5AC8 + i] = CAST_OP(0x5AC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5BC8 + i] = CAST_OP(0x5BC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5CC8 + i] = CAST_OP(0x5CC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5DC8 + i] = CAST_OP(0x5DC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5EC8 + i] = CAST_OP(0x5EC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0x5FC8 + i] = CAST_OP(0x5FC8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5000 + i + j] = CAST_OP(0x5000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5010 + i + j] = CAST_OP(0x5010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5018 + i + j] = CAST_OP(0x5018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5020 + i + j] = CAST_OP(0x5020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5028 + i + j] = CAST_OP(0x5028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5030 + i + j] = CAST_OP(0x5030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5038 + i] = CAST_OP(0x5038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5039 + i] = CAST_OP(0x5039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x501F + i] = CAST_OP(0x501F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5027 + i] = CAST_OP(0x5027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5040 + i + j] = CAST_OP(0x5040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5048 + i + j] = CAST_OP(0x5048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5050 + i + j] = CAST_OP(0x5050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5058 + i + j] = CAST_OP(0x5058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5060 + i + j] = CAST_OP(0x5060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5068 + i + j] = CAST_OP(0x5068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5070 + i + j] = CAST_OP(0x5070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5078 + i] = CAST_OP(0x5078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5079 + i] = CAST_OP(0x5079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x505F + i] = CAST_OP(0x505F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5067 + i] = CAST_OP(0x5067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5080 + i + j] = CAST_OP(0x5080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5088 + i + j] = CAST_OP(0x5088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5090 + i + j] = CAST_OP(0x5090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5098 + i + j] = CAST_OP(0x5098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x50A0 + i + j] = CAST_OP(0x50A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x50A8 + i + j] = CAST_OP(0x50A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x50B0 + i + j] = CAST_OP(0x50B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x50B8 + i] = CAST_OP(0x50B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x50B9 + i] = CAST_OP(0x50B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x509F + i] = CAST_OP(0x509F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x50A7 + i] = CAST_OP(0x50A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5100 + i + j] = CAST_OP(0x5100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5110 + i + j] = CAST_OP(0x5110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5118 + i + j] = CAST_OP(0x5118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5120 + i + j] = CAST_OP(0x5120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5128 + i + j] = CAST_OP(0x5128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5130 + i + j] = CAST_OP(0x5130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5138 + i] = CAST_OP(0x5138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5139 + i] = CAST_OP(0x5139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x511F + i] = CAST_OP(0x511F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5127 + i] = CAST_OP(0x5127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5140 + i + j] = CAST_OP(0x5140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5148 + i + j] = CAST_OP(0x5148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5150 + i + j] = CAST_OP(0x5150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5158 + i + j] = CAST_OP(0x5158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5160 + i + j] = CAST_OP(0x5160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5168 + i + j] = CAST_OP(0x5168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5170 + i + j] = CAST_OP(0x5170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5178 + i] = CAST_OP(0x5178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5179 + i] = CAST_OP(0x5179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x515F + i] = CAST_OP(0x515F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x5167 + i] = CAST_OP(0x5167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5180 + i + j] = CAST_OP(0x5180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5188 + i + j] = CAST_OP(0x5188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5190 + i + j] = CAST_OP(0x5190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x5198 + i + j] = CAST_OP(0x5198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x51A0 + i + j] = CAST_OP(0x51A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x51A8 + i + j] = CAST_OP(0x51A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x51B0 + i + j] = CAST_OP(0x51B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x51B8 + i] = CAST_OP(0x51B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x51B9 + i] = CAST_OP(0x51B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x519F + i] = CAST_OP(0x519F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x51A7 + i] = CAST_OP(0x51A7); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6200 + i] = CAST_OP(0x6201); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6300 + i] = CAST_OP(0x6301); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6400 + i] = CAST_OP(0x6401); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6500 + i] = CAST_OP(0x6501); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6600 + i] = CAST_OP(0x6601); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6700 + i] = CAST_OP(0x6701); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6800 + i] = CAST_OP(0x6801); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6900 + i] = CAST_OP(0x6901); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6A00 + i] = CAST_OP(0x6A01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6B00 + i] = CAST_OP(0x6B01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6C00 + i] = CAST_OP(0x6C01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6D00 + i] = CAST_OP(0x6D01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6E00 + i] = CAST_OP(0x6E01); + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6F00 + i] = CAST_OP(0x6F01); + JumpTable[0x6200] = CAST_OP(0x6200); + JumpTable[0x6300] = CAST_OP(0x6300); + JumpTable[0x6400] = CAST_OP(0x6400); + JumpTable[0x6500] = CAST_OP(0x6500); + JumpTable[0x6600] = CAST_OP(0x6600); + JumpTable[0x6700] = CAST_OP(0x6700); + JumpTable[0x6800] = CAST_OP(0x6800); + JumpTable[0x6900] = CAST_OP(0x6900); + JumpTable[0x6A00] = CAST_OP(0x6A00); + JumpTable[0x6B00] = CAST_OP(0x6B00); + JumpTable[0x6C00] = CAST_OP(0x6C00); + JumpTable[0x6D00] = CAST_OP(0x6D00); + JumpTable[0x6E00] = CAST_OP(0x6E00); + JumpTable[0x6F00] = CAST_OP(0x6F00); +#ifdef OPCODES_M68020 + /* BCC32 - 68020+ */ + JumpTable[0x62FF] = CAST_OP(0x62FF); + JumpTable[0x63FF] = CAST_OP(0x63FF); + JumpTable[0x64FF] = CAST_OP(0x64FF); + JumpTable[0x65FF] = CAST_OP(0x65FF); + JumpTable[0x66FF] = CAST_OP(0x66FF); + JumpTable[0x67FF] = CAST_OP(0x67FF); + JumpTable[0x68FF] = CAST_OP(0x68FF); + JumpTable[0x69FF] = CAST_OP(0x69FF); + JumpTable[0x6AFF] = CAST_OP(0x6AFF); + JumpTable[0x6BFF] = CAST_OP(0x6BFF); + JumpTable[0x6CFF] = CAST_OP(0x6CFF); + JumpTable[0x6DFF] = CAST_OP(0x6DFF); + JumpTable[0x6EFF] = CAST_OP(0x6EFF); + JumpTable[0x6FFF] = CAST_OP(0x6FFF); + /* End of BCC32 */ +#endif + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6000 + i] = CAST_OP(0x6001); + JumpTable[0x6000] = CAST_OP(0x6000); +#ifdef OPCODES_M68020 + JumpTable[0x60FF] = CAST_OP(0x60FF); // BRA32 - 68020+ +#endif + for(i = 0x0001; i <= 0x00FF; i += 0x0001) + JumpTable[0x6100 + i] = CAST_OP(0x6101); + JumpTable[0x6100] = CAST_OP(0x6100); +#ifdef OPCODES_M68020 + JumpTable[0x61FF] = CAST_OP(0x61FF); // BSR32 - 68020+ +#endif + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + for(j = 0x0000; j <= 0x00FF; j += 0x0001) + JumpTable[0x7000 + i + j] = CAST_OP(0x7000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8000 + i + j] = CAST_OP(0x8000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8010 + i + j] = CAST_OP(0x8010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8018 + i + j] = CAST_OP(0x8018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8020 + i + j] = CAST_OP(0x8020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8028 + i + j] = CAST_OP(0x8028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8030 + i + j] = CAST_OP(0x8030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8038 + i] = CAST_OP(0x8038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8039 + i] = CAST_OP(0x8039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x803A + i] = CAST_OP(0x803A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x803B + i] = CAST_OP(0x803B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x803C + i] = CAST_OP(0x803C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x801F + i] = CAST_OP(0x801F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8027 + i] = CAST_OP(0x8027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8040 + i + j] = CAST_OP(0x8040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8050 + i + j] = CAST_OP(0x8050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8058 + i + j] = CAST_OP(0x8058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8060 + i + j] = CAST_OP(0x8060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8068 + i + j] = CAST_OP(0x8068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8070 + i + j] = CAST_OP(0x8070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8078 + i] = CAST_OP(0x8078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8079 + i] = CAST_OP(0x8079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x807A + i] = CAST_OP(0x807A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x807B + i] = CAST_OP(0x807B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x807C + i] = CAST_OP(0x807C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x805F + i] = CAST_OP(0x805F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8067 + i] = CAST_OP(0x8067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8080 + i + j] = CAST_OP(0x8080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8090 + i + j] = CAST_OP(0x8090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8098 + i + j] = CAST_OP(0x8098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80A0 + i + j] = CAST_OP(0x80A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80A8 + i + j] = CAST_OP(0x80A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80B0 + i + j] = CAST_OP(0x80B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80B8 + i] = CAST_OP(0x80B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80B9 + i] = CAST_OP(0x80B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80BA + i] = CAST_OP(0x80BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80BB + i] = CAST_OP(0x80BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80BC + i] = CAST_OP(0x80BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x809F + i] = CAST_OP(0x809F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80A7 + i] = CAST_OP(0x80A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8110 + i + j] = CAST_OP(0x8110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8118 + i + j] = CAST_OP(0x8118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8120 + i + j] = CAST_OP(0x8120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8128 + i + j] = CAST_OP(0x8128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8130 + i + j] = CAST_OP(0x8130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8138 + i] = CAST_OP(0x8138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8139 + i] = CAST_OP(0x8139); +#ifdef OPCODES_M68020 + /* PACK - 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8140 + i + j] = CAST_OP(0x8140); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x8148 + i + j] = CAST_OP(0x8148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x8F48 + i] = CAST_OP(0x8F48); + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x814F + j] = CAST_OP(0x814F); + JumpTable[0x8F4F] = CAST_OP(0x8F4F); + /* End of PACK */ + /* UNPK - 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8180 + i + j] = CAST_OP(0x8180); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x8188 + i + j] = CAST_OP(0x8188); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x8F88 + i] = CAST_OP(0x8F88); + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x818F + j] = CAST_OP(0x818F); + JumpTable[0x8F8F] = CAST_OP(0x8F8F); + /* End of UNPK */ +#endif + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x811F + i] = CAST_OP(0x811F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8127 + i] = CAST_OP(0x8127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8150 + i + j] = CAST_OP(0x8150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8158 + i + j] = CAST_OP(0x8158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8160 + i + j] = CAST_OP(0x8160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8168 + i + j] = CAST_OP(0x8168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8170 + i + j] = CAST_OP(0x8170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8178 + i] = CAST_OP(0x8178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8179 + i] = CAST_OP(0x8179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x815F + i] = CAST_OP(0x815F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x8167 + i] = CAST_OP(0x8167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8190 + i + j] = CAST_OP(0x8190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8198 + i + j] = CAST_OP(0x8198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81A0 + i + j] = CAST_OP(0x81A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81A8 + i + j] = CAST_OP(0x81A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81B0 + i + j] = CAST_OP(0x81B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81B8 + i] = CAST_OP(0x81B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81B9 + i] = CAST_OP(0x81B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x819F + i] = CAST_OP(0x819F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81A7 + i] = CAST_OP(0x81A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x8100 + i + j] = CAST_OP(0x8100); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x8108 + i + j] = CAST_OP(0x8108); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x810F + i] = CAST_OP(0x810F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x8F08 + i] = CAST_OP(0x8F08); + JumpTable[0x8F0F] = CAST_OP(0x8F0F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80C0 + i + j] = CAST_OP(0x80C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80D0 + i + j] = CAST_OP(0x80D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80D8 + i + j] = CAST_OP(0x80D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80E0 + i + j] = CAST_OP(0x80E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80E8 + i + j] = CAST_OP(0x80E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x80F0 + i + j] = CAST_OP(0x80F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80F8 + i] = CAST_OP(0x80F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80F9 + i] = CAST_OP(0x80F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80FA + i] = CAST_OP(0x80FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80FB + i] = CAST_OP(0x80FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80FC + i] = CAST_OP(0x80FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80DF + i] = CAST_OP(0x80DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x80E7 + i] = CAST_OP(0x80E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81C0 + i + j] = CAST_OP(0x81C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81D0 + i + j] = CAST_OP(0x81D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81D8 + i + j] = CAST_OP(0x81D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81E0 + i + j] = CAST_OP(0x81E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81E8 + i + j] = CAST_OP(0x81E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x81F0 + i + j] = CAST_OP(0x81F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81F8 + i] = CAST_OP(0x81F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81F9 + i] = CAST_OP(0x81F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81FA + i] = CAST_OP(0x81FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81FB + i] = CAST_OP(0x81FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81FC + i] = CAST_OP(0x81FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81DF + i] = CAST_OP(0x81DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x81E7 + i] = CAST_OP(0x81E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9000 + i + j] = CAST_OP(0x9000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9008 + i + j] = CAST_OP(0x9008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9010 + i + j] = CAST_OP(0x9010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9018 + i + j] = CAST_OP(0x9018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9020 + i + j] = CAST_OP(0x9020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9028 + i + j] = CAST_OP(0x9028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9030 + i + j] = CAST_OP(0x9030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9038 + i] = CAST_OP(0x9038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9039 + i] = CAST_OP(0x9039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x903A + i] = CAST_OP(0x903A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x903B + i] = CAST_OP(0x903B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x903C + i] = CAST_OP(0x903C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x901F + i] = CAST_OP(0x901F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9027 + i] = CAST_OP(0x9027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9040 + i + j] = CAST_OP(0x9040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9048 + i + j] = CAST_OP(0x9048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9050 + i + j] = CAST_OP(0x9050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9058 + i + j] = CAST_OP(0x9058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9060 + i + j] = CAST_OP(0x9060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9068 + i + j] = CAST_OP(0x9068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9070 + i + j] = CAST_OP(0x9070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9078 + i] = CAST_OP(0x9078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9079 + i] = CAST_OP(0x9079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x907A + i] = CAST_OP(0x907A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x907B + i] = CAST_OP(0x907B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x907C + i] = CAST_OP(0x907C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x905F + i] = CAST_OP(0x905F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9067 + i] = CAST_OP(0x9067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9080 + i + j] = CAST_OP(0x9080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9088 + i + j] = CAST_OP(0x9088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9090 + i + j] = CAST_OP(0x9090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9098 + i + j] = CAST_OP(0x9098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90A0 + i + j] = CAST_OP(0x90A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90A8 + i + j] = CAST_OP(0x90A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90B0 + i + j] = CAST_OP(0x90B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90B8 + i] = CAST_OP(0x90B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90B9 + i] = CAST_OP(0x90B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90BA + i] = CAST_OP(0x90BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90BB + i] = CAST_OP(0x90BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90BC + i] = CAST_OP(0x90BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x909F + i] = CAST_OP(0x909F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90A7 + i] = CAST_OP(0x90A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9110 + i + j] = CAST_OP(0x9110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9118 + i + j] = CAST_OP(0x9118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9120 + i + j] = CAST_OP(0x9120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9128 + i + j] = CAST_OP(0x9128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9130 + i + j] = CAST_OP(0x9130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9138 + i] = CAST_OP(0x9138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9139 + i] = CAST_OP(0x9139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x911F + i] = CAST_OP(0x911F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9127 + i] = CAST_OP(0x9127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9150 + i + j] = CAST_OP(0x9150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9158 + i + j] = CAST_OP(0x9158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9160 + i + j] = CAST_OP(0x9160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9168 + i + j] = CAST_OP(0x9168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9170 + i + j] = CAST_OP(0x9170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9178 + i] = CAST_OP(0x9178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9179 + i] = CAST_OP(0x9179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x915F + i] = CAST_OP(0x915F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x9167 + i] = CAST_OP(0x9167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9190 + i + j] = CAST_OP(0x9190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9198 + i + j] = CAST_OP(0x9198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91A0 + i + j] = CAST_OP(0x91A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91A8 + i + j] = CAST_OP(0x91A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91B0 + i + j] = CAST_OP(0x91B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91B8 + i] = CAST_OP(0x91B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91B9 + i] = CAST_OP(0x91B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x919F + i] = CAST_OP(0x919F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91A7 + i] = CAST_OP(0x91A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9100 + i + j] = CAST_OP(0x9100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9140 + i + j] = CAST_OP(0x9140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x9180 + i + j] = CAST_OP(0x9180); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x9108 + i + j] = CAST_OP(0x9108); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x9148 + i + j] = CAST_OP(0x9148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0x9188 + i + j] = CAST_OP(0x9188); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x910F + i] = CAST_OP(0x910F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x914F + i] = CAST_OP(0x914F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0x918F + i] = CAST_OP(0x918F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x9F08 + i] = CAST_OP(0x9F08); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x9F48 + i] = CAST_OP(0x9F48); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0x9F88 + i] = CAST_OP(0x9F88); + JumpTable[0x9F0F] = CAST_OP(0x9F0F); + JumpTable[0x9F4F] = CAST_OP(0x9F4F); + JumpTable[0x9F8F] = CAST_OP(0x9F8F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90C0 + i + j] = CAST_OP(0x90C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90C8 + i + j] = CAST_OP(0x90C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90D0 + i + j] = CAST_OP(0x90D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90D8 + i + j] = CAST_OP(0x90D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90E0 + i + j] = CAST_OP(0x90E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90E8 + i + j] = CAST_OP(0x90E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x90F0 + i + j] = CAST_OP(0x90F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90F8 + i] = CAST_OP(0x90F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90F9 + i] = CAST_OP(0x90F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90FA + i] = CAST_OP(0x90FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90FB + i] = CAST_OP(0x90FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90FC + i] = CAST_OP(0x90FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90DF + i] = CAST_OP(0x90DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x90E7 + i] = CAST_OP(0x90E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91C0 + i + j] = CAST_OP(0x91C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91C8 + i + j] = CAST_OP(0x91C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91D0 + i + j] = CAST_OP(0x91D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91D8 + i + j] = CAST_OP(0x91D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91E0 + i + j] = CAST_OP(0x91E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91E8 + i + j] = CAST_OP(0x91E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0x91F0 + i + j] = CAST_OP(0x91F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91F8 + i] = CAST_OP(0x91F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91F9 + i] = CAST_OP(0x91F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91FA + i] = CAST_OP(0x91FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91FB + i] = CAST_OP(0x91FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91FC + i] = CAST_OP(0x91FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91DF + i] = CAST_OP(0x91DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0x91E7 + i] = CAST_OP(0x91E7); + for(i = 0x0000; i <= 0x0FFF; i += 0x0001) + JumpTable[0xA000 + i] = CAST_OP(0xA000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB000 + i + j] = CAST_OP(0xB000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB008 + i + j] = CAST_OP(0xB008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB010 + i + j] = CAST_OP(0xB010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB018 + i + j] = CAST_OP(0xB018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB020 + i + j] = CAST_OP(0xB020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB028 + i + j] = CAST_OP(0xB028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB030 + i + j] = CAST_OP(0xB030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB038 + i] = CAST_OP(0xB038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB039 + i] = CAST_OP(0xB039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB03A + i] = CAST_OP(0xB03A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB03B + i] = CAST_OP(0xB03B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB03C + i] = CAST_OP(0xB03C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB01F + i] = CAST_OP(0xB01F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB027 + i] = CAST_OP(0xB027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB040 + i + j] = CAST_OP(0xB040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB048 + i + j] = CAST_OP(0xB048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB050 + i + j] = CAST_OP(0xB050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB058 + i + j] = CAST_OP(0xB058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB060 + i + j] = CAST_OP(0xB060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB068 + i + j] = CAST_OP(0xB068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB070 + i + j] = CAST_OP(0xB070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB078 + i] = CAST_OP(0xB078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB079 + i] = CAST_OP(0xB079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB07A + i] = CAST_OP(0xB07A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB07B + i] = CAST_OP(0xB07B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB07C + i] = CAST_OP(0xB07C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB05F + i] = CAST_OP(0xB05F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB067 + i] = CAST_OP(0xB067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB080 + i + j] = CAST_OP(0xB080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB088 + i + j] = CAST_OP(0xB088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB090 + i + j] = CAST_OP(0xB090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB098 + i + j] = CAST_OP(0xB098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0A0 + i + j] = CAST_OP(0xB0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0A8 + i + j] = CAST_OP(0xB0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0B0 + i + j] = CAST_OP(0xB0B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0B8 + i] = CAST_OP(0xB0B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0B9 + i] = CAST_OP(0xB0B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0BA + i] = CAST_OP(0xB0BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0BB + i] = CAST_OP(0xB0BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0BC + i] = CAST_OP(0xB0BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB09F + i] = CAST_OP(0xB09F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0A7 + i] = CAST_OP(0xB0A7); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xB108 + i + j] = CAST_OP(0xB108); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xB148 + i + j] = CAST_OP(0xB148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xB188 + i + j] = CAST_OP(0xB188); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xB10F + i] = CAST_OP(0xB10F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xB14F + i] = CAST_OP(0xB14F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xB18F + i] = CAST_OP(0xB18F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xBF08 + i] = CAST_OP(0xBF08); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xBF48 + i] = CAST_OP(0xBF48); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xBF88 + i] = CAST_OP(0xBF88); + JumpTable[0xBF0F] = CAST_OP(0xBF0F); + JumpTable[0xBF4F] = CAST_OP(0xBF4F); + JumpTable[0xBF8F] = CAST_OP(0xBF8F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB100 + i + j] = CAST_OP(0xB100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB110 + i + j] = CAST_OP(0xB110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB118 + i + j] = CAST_OP(0xB118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB120 + i + j] = CAST_OP(0xB120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB128 + i + j] = CAST_OP(0xB128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB130 + i + j] = CAST_OP(0xB130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB138 + i] = CAST_OP(0xB138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB139 + i] = CAST_OP(0xB139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB11F + i] = CAST_OP(0xB11F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB127 + i] = CAST_OP(0xB127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB140 + i + j] = CAST_OP(0xB140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB150 + i + j] = CAST_OP(0xB150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB158 + i + j] = CAST_OP(0xB158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB160 + i + j] = CAST_OP(0xB160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB168 + i + j] = CAST_OP(0xB168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB170 + i + j] = CAST_OP(0xB170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB178 + i] = CAST_OP(0xB178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB179 + i] = CAST_OP(0xB179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB15F + i] = CAST_OP(0xB15F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB167 + i] = CAST_OP(0xB167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB180 + i + j] = CAST_OP(0xB180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB190 + i + j] = CAST_OP(0xB190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB198 + i + j] = CAST_OP(0xB198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1A0 + i + j] = CAST_OP(0xB1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1A8 + i + j] = CAST_OP(0xB1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1B0 + i + j] = CAST_OP(0xB1B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1B8 + i] = CAST_OP(0xB1B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1B9 + i] = CAST_OP(0xB1B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB19F + i] = CAST_OP(0xB19F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1A7 + i] = CAST_OP(0xB1A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0C0 + i + j] = CAST_OP(0xB0C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0C8 + i + j] = CAST_OP(0xB0C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0D0 + i + j] = CAST_OP(0xB0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0D8 + i + j] = CAST_OP(0xB0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0E0 + i + j] = CAST_OP(0xB0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0E8 + i + j] = CAST_OP(0xB0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB0F0 + i + j] = CAST_OP(0xB0F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0F8 + i] = CAST_OP(0xB0F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0F9 + i] = CAST_OP(0xB0F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0FA + i] = CAST_OP(0xB0FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0FB + i] = CAST_OP(0xB0FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0FC + i] = CAST_OP(0xB0FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0DF + i] = CAST_OP(0xB0DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB0E7 + i] = CAST_OP(0xB0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1C0 + i + j] = CAST_OP(0xB1C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1C8 + i + j] = CAST_OP(0xB1C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1D0 + i + j] = CAST_OP(0xB1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1D8 + i + j] = CAST_OP(0xB1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1E0 + i + j] = CAST_OP(0xB1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1E8 + i + j] = CAST_OP(0xB1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xB1F0 + i + j] = CAST_OP(0xB1F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1F8 + i] = CAST_OP(0xB1F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1F9 + i] = CAST_OP(0xB1F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1FA + i] = CAST_OP(0xB1FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1FB + i] = CAST_OP(0xB1FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1FC + i] = CAST_OP(0xB1FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1DF + i] = CAST_OP(0xB1DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xB1E7 + i] = CAST_OP(0xB1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC000 + i + j] = CAST_OP(0xC000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC010 + i + j] = CAST_OP(0xC010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC018 + i + j] = CAST_OP(0xC018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC020 + i + j] = CAST_OP(0xC020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC028 + i + j] = CAST_OP(0xC028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC030 + i + j] = CAST_OP(0xC030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC038 + i] = CAST_OP(0xC038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC039 + i] = CAST_OP(0xC039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC03A + i] = CAST_OP(0xC03A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC03B + i] = CAST_OP(0xC03B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC03C + i] = CAST_OP(0xC03C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC01F + i] = CAST_OP(0xC01F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC027 + i] = CAST_OP(0xC027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC040 + i + j] = CAST_OP(0xC040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC050 + i + j] = CAST_OP(0xC050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC058 + i + j] = CAST_OP(0xC058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC060 + i + j] = CAST_OP(0xC060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC068 + i + j] = CAST_OP(0xC068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC070 + i + j] = CAST_OP(0xC070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC078 + i] = CAST_OP(0xC078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC079 + i] = CAST_OP(0xC079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC07A + i] = CAST_OP(0xC07A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC07B + i] = CAST_OP(0xC07B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC07C + i] = CAST_OP(0xC07C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC05F + i] = CAST_OP(0xC05F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC067 + i] = CAST_OP(0xC067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC080 + i + j] = CAST_OP(0xC080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC090 + i + j] = CAST_OP(0xC090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC098 + i + j] = CAST_OP(0xC098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0A0 + i + j] = CAST_OP(0xC0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0A8 + i + j] = CAST_OP(0xC0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0B0 + i + j] = CAST_OP(0xC0B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0B8 + i] = CAST_OP(0xC0B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0B9 + i] = CAST_OP(0xC0B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0BA + i] = CAST_OP(0xC0BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0BB + i] = CAST_OP(0xC0BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0BC + i] = CAST_OP(0xC0BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC09F + i] = CAST_OP(0xC09F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0A7 + i] = CAST_OP(0xC0A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC110 + i + j] = CAST_OP(0xC110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC118 + i + j] = CAST_OP(0xC118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC120 + i + j] = CAST_OP(0xC120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC128 + i + j] = CAST_OP(0xC128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC130 + i + j] = CAST_OP(0xC130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC138 + i] = CAST_OP(0xC138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC139 + i] = CAST_OP(0xC139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC11F + i] = CAST_OP(0xC11F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC127 + i] = CAST_OP(0xC127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC150 + i + j] = CAST_OP(0xC150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC158 + i + j] = CAST_OP(0xC158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC160 + i + j] = CAST_OP(0xC160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC168 + i + j] = CAST_OP(0xC168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC170 + i + j] = CAST_OP(0xC170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC178 + i] = CAST_OP(0xC178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC179 + i] = CAST_OP(0xC179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC15F + i] = CAST_OP(0xC15F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC167 + i] = CAST_OP(0xC167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC190 + i + j] = CAST_OP(0xC190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC198 + i + j] = CAST_OP(0xC198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1A0 + i + j] = CAST_OP(0xC1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1A8 + i + j] = CAST_OP(0xC1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1B0 + i + j] = CAST_OP(0xC1B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1B8 + i] = CAST_OP(0xC1B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1B9 + i] = CAST_OP(0xC1B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC19F + i] = CAST_OP(0xC19F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1A7 + i] = CAST_OP(0xC1A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC100 + i + j] = CAST_OP(0xC100); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xC108 + i + j] = CAST_OP(0xC108); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xC10F + i] = CAST_OP(0xC10F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xCF08 + i] = CAST_OP(0xCF08); + JumpTable[0xCF0F] = CAST_OP(0xCF0F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0C0 + i + j] = CAST_OP(0xC0C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0D0 + i + j] = CAST_OP(0xC0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0D8 + i + j] = CAST_OP(0xC0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0E0 + i + j] = CAST_OP(0xC0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0E8 + i + j] = CAST_OP(0xC0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC0F0 + i + j] = CAST_OP(0xC0F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0F8 + i] = CAST_OP(0xC0F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0F9 + i] = CAST_OP(0xC0F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0FA + i] = CAST_OP(0xC0FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0FB + i] = CAST_OP(0xC0FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0FC + i] = CAST_OP(0xC0FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0DF + i] = CAST_OP(0xC0DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC0E7 + i] = CAST_OP(0xC0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1C0 + i + j] = CAST_OP(0xC1C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1D0 + i + j] = CAST_OP(0xC1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1D8 + i + j] = CAST_OP(0xC1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1E0 + i + j] = CAST_OP(0xC1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1E8 + i + j] = CAST_OP(0xC1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC1F0 + i + j] = CAST_OP(0xC1F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1F8 + i] = CAST_OP(0xC1F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1F9 + i] = CAST_OP(0xC1F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1FA + i] = CAST_OP(0xC1FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1FB + i] = CAST_OP(0xC1FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1FC + i] = CAST_OP(0xC1FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1DF + i] = CAST_OP(0xC1DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xC1E7 + i] = CAST_OP(0xC1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC140 + i + j] = CAST_OP(0xC140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC148 + i + j] = CAST_OP(0xC148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xC188 + i + j] = CAST_OP(0xC188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD000 + i + j] = CAST_OP(0xD000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD008 + i + j] = CAST_OP(0xD008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD010 + i + j] = CAST_OP(0xD010); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD018 + i + j] = CAST_OP(0xD018); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD020 + i + j] = CAST_OP(0xD020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD028 + i + j] = CAST_OP(0xD028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD030 + i + j] = CAST_OP(0xD030); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD038 + i] = CAST_OP(0xD038); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD039 + i] = CAST_OP(0xD039); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD03A + i] = CAST_OP(0xD03A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD03B + i] = CAST_OP(0xD03B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD03C + i] = CAST_OP(0xD03C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD01F + i] = CAST_OP(0xD01F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD027 + i] = CAST_OP(0xD027); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD040 + i + j] = CAST_OP(0xD040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD048 + i + j] = CAST_OP(0xD048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD050 + i + j] = CAST_OP(0xD050); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD058 + i + j] = CAST_OP(0xD058); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD060 + i + j] = CAST_OP(0xD060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD068 + i + j] = CAST_OP(0xD068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD070 + i + j] = CAST_OP(0xD070); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD078 + i] = CAST_OP(0xD078); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD079 + i] = CAST_OP(0xD079); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD07A + i] = CAST_OP(0xD07A); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD07B + i] = CAST_OP(0xD07B); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD07C + i] = CAST_OP(0xD07C); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD05F + i] = CAST_OP(0xD05F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD067 + i] = CAST_OP(0xD067); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD080 + i + j] = CAST_OP(0xD080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD088 + i + j] = CAST_OP(0xD088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD090 + i + j] = CAST_OP(0xD090); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD098 + i + j] = CAST_OP(0xD098); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0A0 + i + j] = CAST_OP(0xD0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0A8 + i + j] = CAST_OP(0xD0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0B0 + i + j] = CAST_OP(0xD0B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0B8 + i] = CAST_OP(0xD0B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0B9 + i] = CAST_OP(0xD0B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0BA + i] = CAST_OP(0xD0BA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0BB + i] = CAST_OP(0xD0BB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0BC + i] = CAST_OP(0xD0BC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD09F + i] = CAST_OP(0xD09F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0A7 + i] = CAST_OP(0xD0A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD110 + i + j] = CAST_OP(0xD110); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD118 + i + j] = CAST_OP(0xD118); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD120 + i + j] = CAST_OP(0xD120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD128 + i + j] = CAST_OP(0xD128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD130 + i + j] = CAST_OP(0xD130); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD138 + i] = CAST_OP(0xD138); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD139 + i] = CAST_OP(0xD139); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD11F + i] = CAST_OP(0xD11F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD127 + i] = CAST_OP(0xD127); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD150 + i + j] = CAST_OP(0xD150); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD158 + i + j] = CAST_OP(0xD158); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD160 + i + j] = CAST_OP(0xD160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD168 + i + j] = CAST_OP(0xD168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD170 + i + j] = CAST_OP(0xD170); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD178 + i] = CAST_OP(0xD178); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD179 + i] = CAST_OP(0xD179); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD15F + i] = CAST_OP(0xD15F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD167 + i] = CAST_OP(0xD167); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD190 + i + j] = CAST_OP(0xD190); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD198 + i + j] = CAST_OP(0xD198); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1A0 + i + j] = CAST_OP(0xD1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1A8 + i + j] = CAST_OP(0xD1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1B0 + i + j] = CAST_OP(0xD1B0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1B8 + i] = CAST_OP(0xD1B8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1B9 + i] = CAST_OP(0xD1B9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD19F + i] = CAST_OP(0xD19F); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1A7 + i] = CAST_OP(0xD1A7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD100 + i + j] = CAST_OP(0xD100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD140 + i + j] = CAST_OP(0xD140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD180 + i + j] = CAST_OP(0xD180); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xD108 + i + j] = CAST_OP(0xD108); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xD148 + i + j] = CAST_OP(0xD148); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0C00; j += 0x0200) + JumpTable[0xD188 + i + j] = CAST_OP(0xD188); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xD10F + i] = CAST_OP(0xD10F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xD14F + i] = CAST_OP(0xD14F); + for(i = 0x0000; i <= 0x0C00; i += 0x0200) + JumpTable[0xD18F + i] = CAST_OP(0xD18F); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xDF08 + i] = CAST_OP(0xDF08); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xDF48 + i] = CAST_OP(0xDF48); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xDF88 + i] = CAST_OP(0xDF88); + JumpTable[0xDF0F] = CAST_OP(0xDF0F); + JumpTable[0xDF4F] = CAST_OP(0xDF4F); + JumpTable[0xDF8F] = CAST_OP(0xDF8F); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0C0 + i + j] = CAST_OP(0xD0C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0C8 + i + j] = CAST_OP(0xD0C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0D0 + i + j] = CAST_OP(0xD0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0D8 + i + j] = CAST_OP(0xD0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0E0 + i + j] = CAST_OP(0xD0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0E8 + i + j] = CAST_OP(0xD0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD0F0 + i + j] = CAST_OP(0xD0F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0F8 + i] = CAST_OP(0xD0F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0F9 + i] = CAST_OP(0xD0F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0FA + i] = CAST_OP(0xD0FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0FB + i] = CAST_OP(0xD0FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0FC + i] = CAST_OP(0xD0FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0DF + i] = CAST_OP(0xD0DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD0E7 + i] = CAST_OP(0xD0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1C0 + i + j] = CAST_OP(0xD1C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1C8 + i + j] = CAST_OP(0xD1C8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1D0 + i + j] = CAST_OP(0xD1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1D8 + i + j] = CAST_OP(0xD1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1E0 + i + j] = CAST_OP(0xD1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1E8 + i + j] = CAST_OP(0xD1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xD1F0 + i + j] = CAST_OP(0xD1F0); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1F8 + i] = CAST_OP(0xD1F8); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1F9 + i] = CAST_OP(0xD1F9); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1FA + i] = CAST_OP(0xD1FA); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1FB + i] = CAST_OP(0xD1FB); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1FC + i] = CAST_OP(0xD1FC); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1DF + i] = CAST_OP(0xD1DF); + for(i = 0x0000; i <= 0x0E00; i += 0x0200) + JumpTable[0xD1E7 + i] = CAST_OP(0xD1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE000 + i + j] = CAST_OP(0xE000); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE040 + i + j] = CAST_OP(0xE040); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE080 + i + j] = CAST_OP(0xE080); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE008 + i + j] = CAST_OP(0xE008); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE048 + i + j] = CAST_OP(0xE048); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE088 + i + j] = CAST_OP(0xE088); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE010 + i + j] = CAST_OP(0xE010); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE050 + i + j] = CAST_OP(0xE050); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE090 + i + j] = CAST_OP(0xE090); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE018 + i + j] = CAST_OP(0xE018); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE058 + i + j] = CAST_OP(0xE058); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE098 + i + j] = CAST_OP(0xE098); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE100 + i + j] = CAST_OP(0xE100); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE140 + i + j] = CAST_OP(0xE140); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE180 + i + j] = CAST_OP(0xE180); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE108 + i + j] = CAST_OP(0xE108); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE148 + i + j] = CAST_OP(0xE148); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE188 + i + j] = CAST_OP(0xE188); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE110 + i + j] = CAST_OP(0xE110); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE150 + i + j] = CAST_OP(0xE150); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE190 + i + j] = CAST_OP(0xE190); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE118 + i + j] = CAST_OP(0xE118); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE158 + i + j] = CAST_OP(0xE158); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE198 + i + j] = CAST_OP(0xE198); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE020 + i + j] = CAST_OP(0xE020); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE060 + i + j] = CAST_OP(0xE060); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0A0 + i + j] = CAST_OP(0xE0A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE028 + i + j] = CAST_OP(0xE028); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE068 + i + j] = CAST_OP(0xE068); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0A8 + i + j] = CAST_OP(0xE0A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE030 + i + j] = CAST_OP(0xE030); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE070 + i + j] = CAST_OP(0xE070); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0B0 + i + j] = CAST_OP(0xE0B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE038 + i + j] = CAST_OP(0xE038); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE078 + i + j] = CAST_OP(0xE078); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE0B8 + i + j] = CAST_OP(0xE0B8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE120 + i + j] = CAST_OP(0xE120); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE160 + i + j] = CAST_OP(0xE160); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1A0 + i + j] = CAST_OP(0xE1A0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE128 + i + j] = CAST_OP(0xE128); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE168 + i + j] = CAST_OP(0xE168); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1A8 + i + j] = CAST_OP(0xE1A8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE130 + i + j] = CAST_OP(0xE130); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE170 + i + j] = CAST_OP(0xE170); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1B0 + i + j] = CAST_OP(0xE1B0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE138 + i + j] = CAST_OP(0xE138); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE178 + i + j] = CAST_OP(0xE178); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + for(j = 0x0000; j <= 0x0E00; j += 0x0200) + JumpTable[0xE1B8 + i + j] = CAST_OP(0xE1B8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE0D0 + i] = CAST_OP(0xE0D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE0D8 + i] = CAST_OP(0xE0D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE0E0 + i] =CAST_OP(0xE0E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE0E8 + i] = CAST_OP(0xE0E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE0F0 + i] = CAST_OP(0xE0F0); + JumpTable[0xE0F8] = CAST_OP(0xE0F8); + JumpTable[0xE0F9] = CAST_OP(0xE0F9); + JumpTable[0xE0DF] = CAST_OP(0xE0DF); + JumpTable[0xE0E7] = CAST_OP(0xE0E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE2D0 + i] = CAST_OP(0xE2D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE2D8 + i] = CAST_OP(0xE2D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE2E0 + i] = CAST_OP(0xE2E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE2E8 + i] = CAST_OP(0xE2E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE2F0 + i] = CAST_OP(0xE2F0); + JumpTable[0xE2F8] = CAST_OP(0xE2F8); + JumpTable[0xE2F9] = CAST_OP(0xE2F9); + JumpTable[0xE2DF] = CAST_OP(0xE2DF); + JumpTable[0xE2E7] = CAST_OP(0xE2E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE4D0 + i] = CAST_OP(0xE4D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE4D8 + i] = CAST_OP(0xE4D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE4E0 + i] = CAST_OP(0xE4E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE4E8 + i] = CAST_OP(0xE4E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE4F0 + i] = CAST_OP(0xE4F0); + JumpTable[0xE4F8] = CAST_OP(0xE4F8); + JumpTable[0xE4F9] = CAST_OP(0xE4F9); + JumpTable[0xE4DF] = CAST_OP(0xE4DF); + JumpTable[0xE4E7] = CAST_OP(0xE4E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE6D0 + i] = CAST_OP(0xE6D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE6D8 + i] = CAST_OP(0xE6D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE6E0 + i] = CAST_OP(0xE6E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE6E8 + i] = CAST_OP(0xE6E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE6F0 + i] = CAST_OP(0xE6F0); + JumpTable[0xE6F8] = CAST_OP(0xE6F8); + JumpTable[0xE6F9] = CAST_OP(0xE6F9); + JumpTable[0xE6DF] = CAST_OP(0xE6DF); + JumpTable[0xE6E7] = CAST_OP(0xE6E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE1D0 + i] = CAST_OP(0xE1D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE1D8 + i] = CAST_OP(0xE1D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE1E0 + i] = CAST_OP(0xE1E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE1E8 + i] = CAST_OP(0xE1E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE1F0 + i] = CAST_OP(0xE1F0); + JumpTable[0xE1F8] = CAST_OP(0xE1F8); + JumpTable[0xE1F9] = CAST_OP(0xE1F9); + JumpTable[0xE1DF] = CAST_OP(0xE1DF); + JumpTable[0xE1E7] = CAST_OP(0xE1E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE3D0 + i] = CAST_OP(0xE3D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE3D8 + i] = CAST_OP(0xE3D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE3E0 + i] = CAST_OP(0xE3E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE3E8 + i] = CAST_OP(0xE3E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE3F0 + i] = CAST_OP(0xE3F0); + JumpTable[0xE3F8] = CAST_OP(0xE3F8); + JumpTable[0xE3F9] = CAST_OP(0xE3F9); + JumpTable[0xE3DF] = CAST_OP(0xE3DF); + JumpTable[0xE3E7] = CAST_OP(0xE3E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE5D0 + i] = CAST_OP(0xE5D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE5D8 + i] = CAST_OP(0xE5D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE5E0 + i] = CAST_OP(0xE5E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE5E8 + i] = CAST_OP(0xE5E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE5F0 + i] = CAST_OP(0xE5F0); + JumpTable[0xE5F8] = CAST_OP(0xE5F8); + JumpTable[0xE5F9] = CAST_OP(0xE5F9); + JumpTable[0xE5DF] = CAST_OP(0xE5DF); + JumpTable[0xE5E7] = CAST_OP(0xE5E7); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE7D0 + i] = CAST_OP(0xE7D0); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE7D8 + i] = CAST_OP(0xE7D8); + for(i = 0x0000; i <= 0x0006; i += 0x0001) + JumpTable[0xE7E0 + i] = CAST_OP(0xE7E0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE7E8 + i] = CAST_OP(0xE7E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE7F0 + i] = CAST_OP(0xE7F0); + JumpTable[0xE7F8] = CAST_OP(0xE7F8); + JumpTable[0xE7F9] = CAST_OP(0xE7F9); + JumpTable[0xE7DF] = CAST_OP(0xE7DF); + JumpTable[0xE7E7] = CAST_OP(0xE7E7); +#ifdef OPCODES_M68020 + /* Bit Field Instructions - 68020+ */ + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE8C0 + i] = CAST_OP(0xE8C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE8D0 + i] = CAST_OP(0xE8D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE8E8 + i] = CAST_OP(0xE8E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE8F0 + i] = CAST_OP(0xE8F0); + JumpTable[0xE8F8] = CAST_OP(0xE8F8); + JumpTable[0xE8F9] = CAST_OP(0xE8F9); + JumpTable[0xE8FA] = CAST_OP(0xE8FA); + JumpTable[0xE8FB] = CAST_OP(0xE8FB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE9C0 + i] = CAST_OP(0xE9C0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE9D0 + i] = CAST_OP(0xE9D0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE9E8 + i] = CAST_OP(0xE9E8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xE9F0 + i] = CAST_OP(0xE9F0); + JumpTable[0xE9F8] = CAST_OP(0xE9F8); + JumpTable[0xE9F9] = CAST_OP(0xE9F9); + JumpTable[0xE9FA] = CAST_OP(0xE9FA); + JumpTable[0xE9FB] = CAST_OP(0xE9FB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEAC0 + i] = CAST_OP(0xEAC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEAD0 + i] = CAST_OP(0xEAD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEAE8 + i] = CAST_OP(0xEAE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEAF0 + i] = CAST_OP(0xEAF0); + JumpTable[0xEAF8] = CAST_OP(0xEAF8); + JumpTable[0xEAF9] = CAST_OP(0xEAF9); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEBC0 + i] = CAST_OP(0xEBC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEBD0 + i] = CAST_OP(0xEBD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEBE8 + i] = CAST_OP(0xEBE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEBF0 + i] = CAST_OP(0xEBF0); + JumpTable[0xEBF8] = CAST_OP(0xEBF8); + JumpTable[0xEBF9] = CAST_OP(0xEBF9); + JumpTable[0xEBFA] = CAST_OP(0xEBFA); + JumpTable[0xEBFB] = CAST_OP(0xEBFB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xECC0 + i] = CAST_OP(0xECC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xECD0 + i] = CAST_OP(0xECD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xECE8 + i] = CAST_OP(0xECE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xECF0 + i] = CAST_OP(0xECF0); + JumpTable[0xECF8] = CAST_OP(0xECF8); + JumpTable[0xECF9] = CAST_OP(0xECF9); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEDC0 + i] = CAST_OP(0xEDC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEDD0 + i] = CAST_OP(0xEDD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEDE8 + i] = CAST_OP(0xEDE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEDF0 + i] = CAST_OP(0xEDF0); + JumpTable[0xEDF8] = CAST_OP(0xEDF8); + JumpTable[0xEDF9] = CAST_OP(0xEDF9); + JumpTable[0xEDFA] = CAST_OP(0xEDFA); + JumpTable[0xEDFB] = CAST_OP(0xEDFB); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEEC0 + i] = CAST_OP(0xEEC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEED0 + i] = CAST_OP(0xEED0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEEE8 + i] = CAST_OP(0xEEE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEEF0 + i] = CAST_OP(0xEEF0); + JumpTable[0xEEF8] = CAST_OP(0xEEF8); + JumpTable[0xEEF9] = CAST_OP(0xEEF9); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEFC0 + i] = CAST_OP(0xEFC0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEFD0 + i] = CAST_OP(0xEFD0); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEFE8 + i] = CAST_OP(0xEFE8); + for(i = 0x0000; i <= 0x0007; i += 0x0001) + JumpTable[0xEFF0 + i] = CAST_OP(0xEFF0); + JumpTable[0xEFF8] = CAST_OP(0xEFF8); + JumpTable[0xEFF9] = CAST_OP(0xEFF9); + /* End of Bit Field Instructions */ +#endif + for(i = 0x0000; i <= 0x0FFF; i += 0x0001) + JumpTable[0xF000 + i] = CAST_OP(0xF000); + + initialised = 1; + } +} diff --git a/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_opcodes.h b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_opcodes.h index 83fcd6d..8899f2a 100644 --- a/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_opcodes.h +++ b/uae4all_gp2x_0.7.2a/src/m68k/fame/famec_opcodes.h @@ -1,30 +1,43 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + +#define EXECUTE_EXCEPTION(EX,CYCLES) \ +{ \ +u32 oldPC=GET_PC; \ +SET_PC(oldPC-2) \ +execute_exception(EX); \ +RET(CYCLES) \ +} // ORI OPCODE(0x0000) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); - res = DREGu8((Opcode >> 0) & 7); + res = DREGu8((Opcode /*>> 0*/) & 7); res |= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - DREGu8((Opcode >> 0) & 7) = res; -RET(8) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ORI OPCODE(0x0010) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -32,20 +45,22 @@ OPCODE(0x0010) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ORI OPCODE(0x0018) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -53,20 +68,22 @@ OPCODE(0x0018) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ORI OPCODE(0x0020) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -74,20 +91,22 @@ OPCODE(0x0020) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ORI OPCODE(0x0028) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -95,20 +114,22 @@ OPCODE(0x0028) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // ORI OPCODE(0x0030) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -116,19 +137,21 @@ OPCODE(0x0030) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // ORI OPCODE(0x0038) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -136,19 +159,21 @@ OPCODE(0x0038) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ORI OPCODE(0x0039) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -156,20 +181,22 @@ OPCODE(0x0039) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(11) +#endif } // ORI OPCODE(0x001F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -177,20 +204,22 @@ OPCODE(0x001F) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ORI OPCODE(0x0027) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -198,36 +227,42 @@ OPCODE(0x0027) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ORI OPCODE(0x0040) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); - res = DREGu16((Opcode >> 0) & 7); + res = DREGu16((Opcode /*>> 0*/) & 7); res |= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - DREGu16((Opcode >> 0) & 7) = res; -RET(8) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ORI OPCODE(0x0050) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -235,20 +270,22 @@ OPCODE(0x0050) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ORI OPCODE(0x0058) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -256,20 +293,22 @@ OPCODE(0x0058) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ORI OPCODE(0x0060) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -277,20 +316,22 @@ OPCODE(0x0060) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ORI OPCODE(0x0068) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -298,20 +339,22 @@ OPCODE(0x0068) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // ORI OPCODE(0x0070) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -319,19 +362,21 @@ OPCODE(0x0070) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // ORI OPCODE(0x0078) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -339,19 +384,21 @@ OPCODE(0x0078) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ORI OPCODE(0x0079) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -359,20 +406,22 @@ OPCODE(0x0079) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // ORI OPCODE(0x005F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -380,20 +429,22 @@ OPCODE(0x005F) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ORI OPCODE(0x0067) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -401,36 +452,42 @@ OPCODE(0x0067) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ORI OPCODE(0x0080) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_LONG(src); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); res |= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(16) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ORI OPCODE(0x0090) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -438,20 +495,22 @@ OPCODE(0x0090) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ORI OPCODE(0x0098) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -459,20 +518,22 @@ OPCODE(0x0098) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // ORI OPCODE(0x00A0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -480,20 +541,22 @@ OPCODE(0x00A0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // ORI OPCODE(0x00A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -501,20 +564,22 @@ OPCODE(0x00A8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(17) +#endif } // ORI OPCODE(0x00B0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -522,19 +587,21 @@ OPCODE(0x00B0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(15) +#endif } // ORI OPCODE(0x00B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -542,19 +609,21 @@ OPCODE(0x00B8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(11) +#endif } // ORI OPCODE(0x00B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -562,20 +631,22 @@ OPCODE(0x00B9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(36) +#ifdef OPCODES_M68000 + RET(36) +#else + RET(12) +#endif } // ORI OPCODE(0x009F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -583,20 +654,22 @@ OPCODE(0x009F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // ORI OPCODE(0x00A7) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -604,78 +677,89 @@ OPCODE(0x00A7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // ORICCR OPCODE(0x003C) { - u32 adr, res; - u32 src, dst; - + u32 res; + FETCH_BYTE(res); res &= M68K_CCR_MASK; res |= GET_CCR; SET_CCR(res) -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(12) +#endif } // ORISR OPCODE(0x007C) { - u32 adr, res; - u32 src, dst; - - if (flag_S) - { - u32 res; - FETCH_WORD(res); - res &= M68K_SR_MASK; - res |= GET_SR; - SET_SR(res) - CHECK_INT_TO_JUMP(20) - } - else - { - u32 newPC = (u32)(PC) - BasePC; - SET_PC(newPC-2); - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); -#ifdef USE_CYCLONE_TIMING - RET(0) + u32 res; + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) #else - RET(4) + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + FETCH_WORD(res); + res &= M68K_SR_MASK; + res |= GET_SR; + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) #endif - } -RET(20) } // ANDI OPCODE(0x0200) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); - res = DREGu8((Opcode >> 0) & 7); + res = DREGu8((Opcode /*>> 0*/) & 7); res &= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - DREGu8((Opcode >> 0) & 7) = res; -RET(8) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ANDI OPCODE(0x0210) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -683,20 +767,22 @@ OPCODE(0x0210) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ANDI OPCODE(0x0218) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -704,20 +790,22 @@ OPCODE(0x0218) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ANDI OPCODE(0x0220) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -725,20 +813,22 @@ OPCODE(0x0220) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ANDI OPCODE(0x0228) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -746,20 +836,22 @@ OPCODE(0x0228) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // ANDI OPCODE(0x0230) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -767,19 +859,21 @@ OPCODE(0x0230) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // ANDI OPCODE(0x0238) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -787,19 +881,21 @@ OPCODE(0x0238) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ANDI OPCODE(0x0239) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -807,20 +903,22 @@ OPCODE(0x0239) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // ANDI OPCODE(0x021F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -828,20 +926,22 @@ OPCODE(0x021F) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ANDI OPCODE(0x0227) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -849,36 +949,42 @@ OPCODE(0x0227) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ANDI OPCODE(0x0240) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); - res = DREGu16((Opcode >> 0) & 7); + res = DREGu16((Opcode /*>> 0*/) & 7); res &= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - DREGu16((Opcode >> 0) & 7) = res; -RET(8) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ANDI OPCODE(0x0250) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -886,20 +992,22 @@ OPCODE(0x0250) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ANDI OPCODE(0x0258) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -907,20 +1015,22 @@ OPCODE(0x0258) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ANDI OPCODE(0x0260) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -928,20 +1038,22 @@ OPCODE(0x0260) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) -} - +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif +} + // ANDI OPCODE(0x0268) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -949,20 +1061,22 @@ OPCODE(0x0268) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // ANDI OPCODE(0x0270) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -970,19 +1084,21 @@ OPCODE(0x0270) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // ANDI OPCODE(0x0278) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -990,19 +1106,21 @@ OPCODE(0x0278) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ANDI OPCODE(0x0279) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -1010,20 +1128,22 @@ OPCODE(0x0279) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // ANDI OPCODE(0x025F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -1031,20 +1151,22 @@ OPCODE(0x025F) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ANDI OPCODE(0x0267) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -1052,28 +1174,32 @@ OPCODE(0x0267) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ANDI OPCODE(0x0280) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_LONG(src); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); res &= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(14) + DREGu32((Opcode /*>> 0*/) & 7) = res; + // Reference manual says 14 cycles, why was here 16? +#ifdef OPCODES_M68000 + RET(14) #else -RET(16) + RET(6) #endif } @@ -1081,11 +1207,10 @@ RET(16) OPCODE(0x0290) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1093,20 +1218,22 @@ OPCODE(0x0290) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ANDI OPCODE(0x0298) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1114,20 +1241,22 @@ OPCODE(0x0298) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // ANDI OPCODE(0x02A0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1135,20 +1264,22 @@ OPCODE(0x02A0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // ANDI OPCODE(0x02A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1156,20 +1287,22 @@ OPCODE(0x02A8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(17) +#endif } // ANDI OPCODE(0x02B0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1177,19 +1310,21 @@ OPCODE(0x02B0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(15) +#endif } // ANDI OPCODE(0x02B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1197,19 +1332,21 @@ OPCODE(0x02B8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(11) +#endif } // ANDI OPCODE(0x02B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1217,20 +1354,22 @@ OPCODE(0x02B9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(36) +#ifdef OPCODES_M68000 + RET(36) +#else + RET(12) +#endif } // ANDI OPCODE(0x029F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1238,20 +1377,22 @@ OPCODE(0x029F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // ANDI OPCODE(0x02A7) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -1259,79 +1400,90 @@ OPCODE(0x02A7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // ANDICCR OPCODE(0x023C) { - u32 adr, res; - u32 src, dst; - + u32 res; + FETCH_BYTE(res); res &= M68K_CCR_MASK; res &= GET_CCR; SET_CCR(res) -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(12) +#endif } // ANDISR OPCODE(0x027C) { - u32 adr, res; - u32 src, dst; - - if (flag_S) - { - FETCH_WORD(res); - res &= M68K_SR_MASK; - res &= GET_SR; - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - CHECK_INT_TO_JUMP(20) - } - else - { - u32 newPC = (u32)(PC) - BasePC; - SET_PC(newPC-2); - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(20) + u32 res; + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + + FETCH_WORD(res); + res &= M68K_SR_MASK; + res &= GET_SR; + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // EORI OPCODE(0x0A00) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); - res = DREGu8((Opcode >> 0) & 7); + res = DREGu8((Opcode /*>> 0*/) & 7); res ^= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - DREGu8((Opcode >> 0) & 7) = res; -RET(8) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // EORI OPCODE(0x0A10) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1339,20 +1491,22 @@ OPCODE(0x0A10) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // EORI OPCODE(0x0A18) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1360,20 +1514,22 @@ OPCODE(0x0A18) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // EORI OPCODE(0x0A20) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1381,20 +1537,22 @@ OPCODE(0x0A20) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // EORI OPCODE(0x0A28) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1402,20 +1560,22 @@ OPCODE(0x0A28) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // EORI OPCODE(0x0A30) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1423,19 +1583,21 @@ OPCODE(0x0A30) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // EORI OPCODE(0x0A38) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1443,19 +1605,21 @@ OPCODE(0x0A38) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // EORI OPCODE(0x0A39) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1463,20 +1627,22 @@ OPCODE(0x0A39) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // EORI OPCODE(0x0A1F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1484,20 +1650,22 @@ OPCODE(0x0A1F) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // EORI OPCODE(0x0A27) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -1505,36 +1673,42 @@ OPCODE(0x0A27) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // EORI OPCODE(0x0A40) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); - res = DREGu16((Opcode >> 0) & 7); + res = DREGu16((Opcode /*>> 0*/) & 7); res ^= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - DREGu16((Opcode >> 0) & 7) = res; -RET(8) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // EORI OPCODE(0x0A50) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1542,20 +1716,22 @@ OPCODE(0x0A50) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // EORI OPCODE(0x0A58) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1563,20 +1739,22 @@ OPCODE(0x0A58) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // EORI OPCODE(0x0A60) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1584,20 +1762,22 @@ OPCODE(0x0A60) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // EORI OPCODE(0x0A68) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1605,20 +1785,22 @@ OPCODE(0x0A68) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // EORI OPCODE(0x0A70) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1626,19 +1808,21 @@ OPCODE(0x0A70) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // EORI OPCODE(0x0A78) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1646,19 +1830,21 @@ OPCODE(0x0A78) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // EORI OPCODE(0x0A79) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1666,20 +1852,22 @@ OPCODE(0x0A79) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // EORI OPCODE(0x0A5F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1687,20 +1875,22 @@ OPCODE(0x0A5F) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // EORI OPCODE(0x0A67) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_WORD(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -1708,36 +1898,42 @@ OPCODE(0x0A67) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // EORI OPCODE(0x0A80) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_LONG(src); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); res ^= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(16) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // EORI OPCODE(0x0A90) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1745,20 +1941,22 @@ OPCODE(0x0A90) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // EORI OPCODE(0x0A98) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1766,20 +1964,22 @@ OPCODE(0x0A98) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // EORI OPCODE(0x0AA0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1787,20 +1987,22 @@ OPCODE(0x0AA0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // EORI OPCODE(0x0AA8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1808,20 +2010,22 @@ OPCODE(0x0AA8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(17) +#endif } // EORI OPCODE(0x0AB0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1829,19 +2033,21 @@ OPCODE(0x0AB0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(15) +#endif } // EORI OPCODE(0x0AB8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1849,19 +2055,21 @@ OPCODE(0x0AB8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(11) +#endif } // EORI OPCODE(0x0AB9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1869,20 +2077,22 @@ OPCODE(0x0AB9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(36) +#ifdef OPCODES_M68000 + RET(36) +#else + RET(12) +#endif } // EORI OPCODE(0x0A9F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1890,20 +2100,22 @@ OPCODE(0x0A9F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) -} - +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif +} + // EORI OPCODE(0x0AA7) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(src); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -1911,67 +2123,78 @@ OPCODE(0x0AA7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // EORICCR OPCODE(0x0A3C) { - u32 adr, res; - u32 src, dst; - + u32 res; + FETCH_BYTE(res); res &= M68K_CCR_MASK; res ^= GET_CCR; SET_CCR(res) -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(12) +#endif } // EORISR OPCODE(0x0A7C) { - u32 adr, res; - u32 src, dst; - - if (flag_S) - { - FETCH_WORD(res); - res &= M68K_SR_MASK; - res ^= GET_SR; - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - CHECK_INT_TO_JUMP(20) - } - else - { - u32 newPC = (u32)(PC) - BasePC; - SET_PC(newPC-2); - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(20) + u32 res; + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + FETCH_WORD(res); + res &= M68K_SR_MASK; + res ^= GET_SR; + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // SUBI OPCODE(0x0400) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_BYTE(src); - dst = DREGu8((Opcode >> 0) & 7); + dst = DREGu8((Opcode /*>> 0*/) & 7); res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(8) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // SUBI @@ -1979,18 +2202,20 @@ OPCODE(0x0410) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // SUBI @@ -1998,19 +2223,21 @@ OPCODE(0x0418) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // SUBI @@ -2018,19 +2245,21 @@ OPCODE(0x0420) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // SUBI @@ -2038,19 +2267,21 @@ OPCODE(0x0428) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // SUBI @@ -2058,19 +2289,21 @@ OPCODE(0x0430) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // SUBI @@ -2078,18 +2311,20 @@ OPCODE(0x0438) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SUBI @@ -2097,18 +2332,20 @@ OPCODE(0x0439) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // SUBI @@ -2116,19 +2353,21 @@ OPCODE(0x041F) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // SUBI @@ -2136,35 +2375,41 @@ OPCODE(0x0427) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // SUBI OPCODE(0x0440) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); - dst = DREGu16((Opcode >> 0) & 7); + dst = DREGu16((Opcode /*>> 0*/) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(8) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // SUBI @@ -2172,18 +2417,20 @@ OPCODE(0x0450) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // SUBI @@ -2191,19 +2438,21 @@ OPCODE(0x0458) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // SUBI @@ -2211,19 +2460,21 @@ OPCODE(0x0460) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // SUBI @@ -2231,19 +2482,21 @@ OPCODE(0x0468) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // SUBI @@ -2251,19 +2504,21 @@ OPCODE(0x0470) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // SUBI @@ -2271,18 +2526,20 @@ OPCODE(0x0478) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SUBI @@ -2290,18 +2547,20 @@ OPCODE(0x0479) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // SUBI @@ -2309,19 +2568,21 @@ OPCODE(0x045F) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // SUBI @@ -2329,36 +2590,42 @@ OPCODE(0x0467) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // SUBI OPCODE(0x0480) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); - dst = DREGu32((Opcode >> 0) & 7); + dst = DREGu32((Opcode /*>> 0*/) & 7); res = dst - src; flag_NotZ = res; flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(16) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // SUBI @@ -2366,10 +2633,9 @@ OPCODE(0x0490) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2377,8 +2643,11 @@ OPCODE(0x0490) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // SUBI @@ -2386,11 +2655,10 @@ OPCODE(0x0498) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2398,8 +2666,11 @@ OPCODE(0x0498) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // SUBI @@ -2407,11 +2678,10 @@ OPCODE(0x04A0) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2419,8 +2689,11 @@ OPCODE(0x04A0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // SUBI @@ -2428,11 +2701,10 @@ OPCODE(0x04A8) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2440,8 +2712,11 @@ OPCODE(0x04A8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(17) +#endif } // SUBI @@ -2449,11 +2724,10 @@ OPCODE(0x04B0) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2461,8 +2735,11 @@ OPCODE(0x04B0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(15) +#endif } // SUBI @@ -2470,10 +2747,9 @@ OPCODE(0x04B8) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2481,8 +2757,11 @@ OPCODE(0x04B8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(11) +#endif } // SUBI @@ -2490,10 +2769,9 @@ OPCODE(0x04B9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2501,8 +2779,11 @@ OPCODE(0x04B9) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(36) +#ifdef OPCODES_M68000 + RET(36) +#else + RET(12) +#endif } // SUBI @@ -2510,11 +2791,10 @@ OPCODE(0x049F) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2522,8 +2802,11 @@ OPCODE(0x049F) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // SUBI @@ -2531,11 +2814,10 @@ OPCODE(0x04A7) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -2543,24 +2825,31 @@ OPCODE(0x04A7) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // ADDI OPCODE(0x0600) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_BYTE(src); - dst = DREGu8((Opcode >> 0) & 7); + dst = DREGu8((Opcode /*>> 0*/) & 7); res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(8) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ADDI @@ -2568,18 +2857,20 @@ OPCODE(0x0610) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ADDI @@ -2587,19 +2878,21 @@ OPCODE(0x0618) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ADDI @@ -2607,19 +2900,21 @@ OPCODE(0x0620) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ADDI @@ -2627,19 +2922,21 @@ OPCODE(0x0628) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // ADDI @@ -2647,19 +2944,21 @@ OPCODE(0x0630) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // ADDI @@ -2667,18 +2966,20 @@ OPCODE(0x0638) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ADDI @@ -2686,18 +2987,20 @@ OPCODE(0x0639) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // ADDI @@ -2705,19 +3008,21 @@ OPCODE(0x061F) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ADDI @@ -2725,35 +3030,41 @@ OPCODE(0x0627) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ADDI OPCODE(0x0640) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); - dst = DREGu16((Opcode >> 0) & 7); + dst = DREGu16((Opcode /*>> 0*/) & 7); res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(8) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ADDI @@ -2761,18 +3072,20 @@ OPCODE(0x0650) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ADDI @@ -2780,19 +3093,21 @@ OPCODE(0x0658) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ADDI @@ -2800,19 +3115,21 @@ OPCODE(0x0660) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ADDI @@ -2820,19 +3137,21 @@ OPCODE(0x0668) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // ADDI @@ -2840,19 +3159,21 @@ OPCODE(0x0670) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // ADDI @@ -2860,18 +3181,20 @@ OPCODE(0x0678) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ADDI @@ -2879,18 +3202,20 @@ OPCODE(0x0679) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // ADDI @@ -2898,19 +3223,21 @@ OPCODE(0x065F) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ADDI @@ -2918,36 +3245,42 @@ OPCODE(0x0667) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ADDI OPCODE(0x0680) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); - dst = DREGu32((Opcode >> 0) & 7); + dst = DREGu32((Opcode /*>> 0*/) & 7); res = dst + src; flag_NotZ = res; flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23; flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(16) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ADDI @@ -2955,10 +3288,9 @@ OPCODE(0x0690) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -2966,8 +3298,11 @@ OPCODE(0x0690) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ADDI @@ -2975,11 +3310,10 @@ OPCODE(0x0698) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -2987,8 +3321,11 @@ OPCODE(0x0698) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // ADDI @@ -2996,11 +3333,10 @@ OPCODE(0x06A0) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3008,8 +3344,11 @@ OPCODE(0x06A0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // ADDI @@ -3017,11 +3356,10 @@ OPCODE(0x06A8) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3029,8 +3367,11 @@ OPCODE(0x06A8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(17) +#endif } // ADDI @@ -3038,11 +3379,10 @@ OPCODE(0x06B0) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3050,8 +3390,11 @@ OPCODE(0x06B0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(15) +#endif } // ADDI @@ -3059,10 +3402,9 @@ OPCODE(0x06B8) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3070,8 +3412,11 @@ OPCODE(0x06B8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(11) +#endif } // ADDI @@ -3079,10 +3424,9 @@ OPCODE(0x06B9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3090,8 +3434,11 @@ OPCODE(0x06B9) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(36) +#ifdef OPCODES_M68000 + RET(36) +#else + RET(12) +#endif } // ADDI @@ -3099,11 +3446,10 @@ OPCODE(0x069F) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3111,8 +3457,11 @@ OPCODE(0x069F) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(12) +#endif } // ADDI @@ -3120,11 +3469,10 @@ OPCODE(0x06A7) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -3132,23 +3480,30 @@ OPCODE(0x06A7) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(11) +#endif } // CMPI OPCODE(0x0C00) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_BYTE(src); - dst = DREGu8((Opcode >> 0) & 7); + dst = DREGu8((Opcode /*>> 0*/) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // CMPI @@ -3156,17 +3511,19 @@ OPCODE(0x0C10) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // CMPI @@ -3174,18 +3531,20 @@ OPCODE(0x0C18) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CMPI @@ -3193,18 +3552,20 @@ OPCODE(0x0C20) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // CMPI @@ -3212,18 +3573,20 @@ OPCODE(0x0C28) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // CMPI @@ -3231,18 +3594,20 @@ OPCODE(0x0C30) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // CMPI @@ -3250,17 +3615,19 @@ OPCODE(0x0C38) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // CMPI @@ -3268,36 +3635,76 @@ OPCODE(0x0C39) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif +} + +#ifdef OPCODES_M68020 +// CMPI.B (d16,PC) - 68020+ +OPCODE(0x0C3A) +{ + u32 adr, res; + u32 src, dst; + + FETCH_BYTE(src); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_BYTE_F(adr, dst) + res = dst - src; + flag_N = flag_C = res; + flag_V = (src ^ dst) & (res ^ dst); + flag_NotZ = res & 0xFF; + RET(13) +} + +// CMPI.B (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x0C3B) +{ + u32 adr, res; + u32 src, dst; + + FETCH_BYTE(src); + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_BYTE_F(adr, dst) + res = dst - src; + flag_N = flag_C = res; + flag_V = (src ^ dst) & (res ^ dst); + flag_NotZ = res & 0xFF; + RET(11) } +#endif // CMPI OPCODE(0x0C1F) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CMPI @@ -3305,33 +3712,39 @@ OPCODE(0x0C27) { u32 adr, res; u32 src, dst; - + FETCH_BYTE(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // CMPI OPCODE(0x0C40) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); - dst = DREGu16((Opcode >> 0) & 7); + dst = DREGu16((Opcode /*>> 0*/) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // CMPI @@ -3339,17 +3752,19 @@ OPCODE(0x0C50) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // CMPI @@ -3357,18 +3772,20 @@ OPCODE(0x0C58) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CMPI @@ -3376,18 +3793,20 @@ OPCODE(0x0C60) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // CMPI @@ -3395,18 +3814,20 @@ OPCODE(0x0C68) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // CMPI @@ -3414,18 +3835,20 @@ OPCODE(0x0C70) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // CMPI @@ -3433,17 +3856,19 @@ OPCODE(0x0C78) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // CMPI @@ -3451,36 +3876,76 @@ OPCODE(0x0C79) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif +} + +#ifdef OPCODES_M68020 +// CMPI.W #,(d16,PC) - 68020+ +OPCODE(0x0C7A) +{ + u32 adr, res; + u32 src, dst; + + FETCH_WORD(src); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_WORD_F(adr, dst) + res = dst - src; + flag_N = flag_C = res; + flag_V = (src ^ dst) & (res ^ dst); + flag_NotZ = res & 0xFFFF; + RET(13) +} + +// CMPI.W #,(d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x0C7B) +{ + u32 adr, res; + u32 src, dst; + + FETCH_WORD(src); + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_WORD_F(adr, dst) + res = dst - src; + flag_N = flag_C = res; + flag_V = (src ^ dst) & (res ^ dst); + flag_NotZ = res & 0xFFFF; + RET(11) } +#endif // CMPI OPCODE(0x0C5F) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CMPI @@ -3488,34 +3953,40 @@ OPCODE(0x0C67) { u32 adr, res; u32 src, dst; - + FETCH_WORD(src); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // CMPI OPCODE(0x0C80) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); - dst = DREGu32((Opcode >> 0) & 7); + dst = DREGu32((Opcode /*>> 0*/) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // CMPI @@ -3523,18 +3994,20 @@ OPCODE(0x0C90) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // CMPI @@ -3542,19 +4015,21 @@ OPCODE(0x0C98) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // CMPI @@ -3562,19 +4037,21 @@ OPCODE(0x0CA0) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // CMPI @@ -3582,19 +4059,21 @@ OPCODE(0x0CA8) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(15) +#endif } // CMPI @@ -3602,19 +4081,21 @@ OPCODE(0x0CB0) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(13) +#endif } // CMPI @@ -3622,18 +4103,20 @@ OPCODE(0x0CB8) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // CMPI @@ -3641,38 +4124,78 @@ OPCODE(0x0CB9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(10) +#endif +} + +#ifdef OPCODES_M68020 +// CMPI.L #,(d16,PC) - 68020+ +OPCODE(0x0CBA) +{ + u32 adr, res; + u32 src, dst; + + FETCH_LONG(src); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_LONG_F(adr, dst) + res = dst - src; + flag_N = flag_C = res; + flag_V = (src ^ dst) & (res ^ dst); + flag_NotZ = res /*& 0xFFFF*/; + RET(15) +} + +// CMPI.L #,(d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x0CBB) +{ + u32 adr, res; + u32 src, dst; + + FETCH_LONG(src); + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, dst) + res = dst - src; + flag_N = flag_C = res; + flag_V = (src ^ dst) & (res ^ dst); + flag_NotZ = res /*& 0xFFFF*/; + RET(13) } +#endif // CMPI OPCODE(0x0C9F) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // CMPI @@ -3680,1551 +4203,1742 @@ OPCODE(0x0CA7) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } -// BTSTn +// BTSTn #.W,Dn OPCODE(0x0800) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(4) +#endif } -// BTSTn +// BTSTn #.W,(An) OPCODE(0x0810) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } -// BTSTn +// BTSTn #.W,(An)+ OPCODE(0x0818) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(10) +#endif } -// BTSTn +// BTSTn #.W,-(An) OPCODE(0x0820) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } -// BTSTn +// BTSTn #.W,(d16,An) OPCODE(0x0828) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(15) +#endif } -// BTSTn +// BTSTn #.W,(d8,An,Xn) OPCODE(0x0830) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(13) +#endif } -// BTSTn +// BTSTn #.W,(xx).W OPCODE(0x0838) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } -// BTSTn +// BTSTn #.W,(xx).L OPCODE(0x0839) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } -// BTSTn +// BTSTn #.W,(d16,PC) OPCODE(0x083A) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = GET_SWORD + ((u32)(PC) - BasePC); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(15) +#endif } -// BTSTn +// BTSTn #.W,(d8,PC,Xn) OPCODE(0x083B) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(13) +#endif } // BTSTn OPCODE(0x081F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(10) +#endif } // BTSTn OPCODE(0x0827) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // BCHGn OPCODE(0x0840) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; res ^= src; - DREGu32((Opcode >> 0) & 7) = res; -RET(12) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // BCHGn OPCODE(0x0850) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BCHGn OPCODE(0x0858) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) -} - -// BCHGn +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif +} + +// BCHGn OPCODE(0x0860) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // BCHGn OPCODE(0x0868) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // BCHGn OPCODE(0x0870) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // BCHGn OPCODE(0x0878) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // BCHGn OPCODE(0x0879) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // BCHGn OPCODE(0x085F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // BCHGn OPCODE(0x0867) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // BCLRn OPCODE(0x0880) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; res &= ~src; - DREGu32((Opcode >> 0) & 7) = res; -RET(14) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(14) +#else + RET(4) +#endif } // BCLRn OPCODE(0x0890) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BCLRn OPCODE(0x0898) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // BCLRn OPCODE(0x08A0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // BCLRn OPCODE(0x08A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // BCLRn OPCODE(0x08B0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // BCLRn OPCODE(0x08B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // BCLRn OPCODE(0x08B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // BCLRn OPCODE(0x089F) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // BCLRn OPCODE(0x08A7) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // BSETn OPCODE(0x08C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; res |= src; - DREGu32((Opcode >> 0) & 7) = res; -RET(12) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // BSETn OPCODE(0x08D0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BSETn OPCODE(0x08D8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // BSETn OPCODE(0x08E0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // BSETn OPCODE(0x08E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // BSETn OPCODE(0x08F0) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(13) +#endif } // BSETn OPCODE(0x08F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // BSETn OPCODE(0x08F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // BSETn OPCODE(0x08DF) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // BSETn OPCODE(0x08E7) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_BYTE(src); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // BTST OPCODE(0x0100) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu32((Opcode >> 9) & 7); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // BTST OPCODE(0x0110) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(8) +#endif } // BTST OPCODE(0x0118) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(8) +#endif } // BTST OPCODE(0x0120) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(9) +#endif } // BTST OPCODE(0x0128) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(13) +#endif } // BTST OPCODE(0x0130) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(11) +#endif } // BTST OPCODE(0x0138) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BTST OPCODE(0x0139) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BTST OPCODE(0x013A) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = GET_SWORD + ((u32)(PC) - BasePC); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // BTST OPCODE(0x013B) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(11) +#endif } // BTST OPCODE(0x013C) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_BYTE(res); flag_NotZ = res & src; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // BTST OPCODE(0x011F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(8) +#endif } // BTST OPCODE(0x0127) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(9) +#endif } // BCHG OPCODE(0x0140) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu32((Opcode >> 9) & 7); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; res ^= src; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCHG OPCODE(0x0150) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BCHG OPCODE(0x0158) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BCHG OPCODE(0x0160) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // BCHG OPCODE(0x0168) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // BCHG OPCODE(0x0170) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // BCHG OPCODE(0x0178) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BCHG OPCODE(0x0179) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // BCHG OPCODE(0x015F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BCHG OPCODE(0x0167) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res ^= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // BCLR OPCODE(0x0180) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu32((Opcode >> 9) & 7); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; res &= ~src; - DREGu32((Opcode >> 0) & 7) = res; -RET(10) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(4) +#endif } // BCLR OPCODE(0x0190) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BCLR OPCODE(0x0198) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BCLR OPCODE(0x01A0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // BCLR OPCODE(0x01A8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // BCLR OPCODE(0x01B0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // BCLR OPCODE(0x01B8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BCLR OPCODE(0x01B9) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // BCLR OPCODE(0x019F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BCLR OPCODE(0x01A7) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res &= ~src; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // BSET OPCODE(0x01C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu32((Opcode >> 9) & 7); src = 1 << (src & 31); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); flag_NotZ = res & src; res |= src; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BSET OPCODE(0x01D0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BSET OPCODE(0x01D8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BSET OPCODE(0x01E0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // BSET OPCODE(0x01E8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // BSET OPCODE(0x01F0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // BSET OPCODE(0x01F8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // BSET OPCODE(0x01F9) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // BSET OPCODE(0x01DF) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // BSET OPCODE(0x01E7) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); src = 1 << (src & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_NotZ = res & src; res |= src; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEPWaD OPCODE(0x0108) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr + 0, res) READ_BYTE_F(adr + 2, src) DREGu16((Opcode >> 9) & 7) = (res << 8) | src; - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(12) +#endif } // MOVEPLaD OPCODE(0x0148) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res <<= 24; adr += 2; @@ -5236,36 +5950,38 @@ OPCODE(0x0148) adr += 2; READ_BYTE_F(adr, src) DREG((Opcode >> 9) & 7) = res | src; - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(18) +#endif } // MOVEPWDa OPCODE(0x0188) { u32 adr, res; - u32 src, dst; - + res = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); WRITE_BYTE_F(adr + 0, res >> 8) WRITE_BYTE_F(adr + 2, res >> 0) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(11) +#endif } // MOVEPLDa OPCODE(0x01C8) { u32 adr, res; - u32 src, dst; - + res = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); WRITE_BYTE_F(adr, res >> 24) adr += 2; WRITE_BYTE_F(adr, res >> 16) @@ -5273,452 +5989,478 @@ OPCODE(0x01C8) WRITE_BYTE_F(adr, res >> 8) adr += 2; WRITE_BYTE_F(adr, res >> 0) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(17) +#endif } // MOVEB OPCODE(0x1000) { - u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + u32 res; + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEB OPCODE(0x1080) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEB OPCODE(0x10C0) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEB OPCODE(0x1100) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(5) +#endif } // MOVEB OPCODE(0x1140) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEB OPCODE(0x1180) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEB OPCODE(0x11C0) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; FETCH_SWORD(adr); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEB OPCODE(0x13C0) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; FETCH_LONG(adr); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEB OPCODE(0x1EC0) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG(7); AREG(7) += 2; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEB OPCODE(0x1F00) { u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(5) +#endif } // MOVEB OPCODE(0x1008) { - u32 adr, res; - u32 src, dst; - + // u32 res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - DREGu8((Opcode >> 9) & 7) = res; -*/ -RET(4) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + DREGu8((Opcode >> 9) & 7) = res; + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 4; + RET(4) +#else + m68kcontext.io_cycle_counter = 2; + RET(2) +#endif } // MOVEB OPCODE(0x1088) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - adr = AREG((Opcode >> 9) & 7); - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(8) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + adr = AREG((Opcode >> 9) & 7); + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 8; + RET(8) +#else + m68kcontext.io_cycle_counter = 4; + RET(4) +#endif } // MOVEB OPCODE(0x10C8) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - adr = AREG((Opcode >> 9) & 7); - AREG((Opcode >> 9) & 7) += 1; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(8) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + adr = AREG((Opcode >> 9) & 7); + AREG((Opcode >> 9) & 7) += 1; + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 8; + RET(8) +#else + m68kcontext.io_cycle_counter = 4; + RET(4) +#endif } // MOVEB OPCODE(0x1108) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - adr = AREG((Opcode >> 9) & 7) - 1; - AREG((Opcode >> 9) & 7) = adr; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(8) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + adr = AREG((Opcode >> 9) & 7) - 1; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 8; + RET(8) +#else + m68kcontext.io_cycle_counter = 5; + RET(5) +#endif } // MOVEB OPCODE(0x1148) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - FETCH_SWORD(adr); - adr += AREG((Opcode >> 9) & 7); - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(12) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + FETCH_SWORD(adr); + adr += AREG((Opcode >> 9) & 7); + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 12; + RET(12) +#else + m68kcontext.io_cycle_counter = 5; + RET(5) +#endif } // MOVEB OPCODE(0x1188) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(14) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + adr = AREG((Opcode >> 9) & 7); + DECODE_EXT_WORD(&adr); + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 14; + RET(14) +#else + m68kcontext.io_cycle_counter = 7; + RET(7) +#endif } // MOVEB OPCODE(0x11C8) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - FETCH_SWORD(adr); - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(12) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + FETCH_SWORD(adr); + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 12; + RET(12) +#else + m68kcontext.io_cycle_counter = 4; + RET(4) +#endif } // MOVEB OPCODE(0x13C8) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - FETCH_LONG(adr); - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(16) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + FETCH_LONG(adr); + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 16; + RET(16) +#else + m68kcontext.io_cycle_counter = 6; + RET(6) +#endif } // MOVEB OPCODE(0x1EC8) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - adr = AREG(7); - AREG(7) += 2; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(8) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + adr = AREG(7); + AREG(7) += 2; + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 8; + RET(8) +#else + m68kcontext.io_cycle_counter = 4; + RET(4) +#endif } // MOVEB OPCODE(0x1F08) { - u32 adr, res; - u32 src, dst; - + // u32 adr, res; + // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - flag_C = 0; - flag_V = 0; - flag_NotZ = res; - flag_N = res; - adr = AREG(7) - 2; - AREG(7) = adr; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO -*/ -RET(8) + /* + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + adr = AREG(7) - 2; + AREG(7) = adr; + WRITE_BYTE_F(adr, res) + */ +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 8; + RET(8) +#else + m68kcontext.io_cycle_counter = 5; + RET(5) +#endif } // MOVEB OPCODE(0x1010) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEB OPCODE(0x1090) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5726,18 +6468,19 @@ OPCODE(0x1090) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5746,18 +6489,19 @@ OPCODE(0x10D0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1110) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5766,18 +6510,19 @@ OPCODE(0x1110) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1150) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5786,38 +6531,40 @@ OPCODE(0x1150) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1190) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEB OPCODE(0x11D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5825,18 +6572,19 @@ OPCODE(0x11D0) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x13D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5844,18 +6592,19 @@ OPCODE(0x13D0) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEB OPCODE(0x1ED0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5864,18 +6613,19 @@ OPCODE(0x1ED0) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1F10) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5884,38 +6634,40 @@ OPCODE(0x1F10) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1018) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEB OPCODE(0x1098) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5923,19 +6675,20 @@ OPCODE(0x1098) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5944,19 +6697,20 @@ OPCODE(0x10D8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1118) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5965,19 +6719,20 @@ OPCODE(0x1118) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1158) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -5986,40 +6741,42 @@ OPCODE(0x1158) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1198) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEB OPCODE(0x11D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6027,19 +6784,20 @@ OPCODE(0x11D8) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x13D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6047,19 +6805,20 @@ OPCODE(0x13D8) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEB OPCODE(0x1ED8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6068,19 +6827,20 @@ OPCODE(0x1ED8) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1F18) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6089,38 +6849,40 @@ OPCODE(0x1F18) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1020) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6128,19 +6890,20 @@ OPCODE(0x10A0) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x10E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6149,19 +6912,20 @@ OPCODE(0x10E0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1120) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6170,19 +6934,20 @@ OPCODE(0x1120) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1160) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6191,40 +6956,42 @@ OPCODE(0x1160) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEB OPCODE(0x11A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // MOVEB OPCODE(0x11E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6232,19 +6999,20 @@ OPCODE(0x11E0) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEB OPCODE(0x13E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6252,19 +7020,20 @@ OPCODE(0x13E0) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1EE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6273,19 +7042,20 @@ OPCODE(0x1EE0) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1F20) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6294,38 +7064,40 @@ OPCODE(0x1F20) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1028) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6333,19 +7105,20 @@ OPCODE(0x10A8) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x10E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6354,19 +7127,20 @@ OPCODE(0x10E8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1128) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6375,19 +7149,20 @@ OPCODE(0x1128) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1168) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6396,40 +7171,42 @@ OPCODE(0x1168) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEB OPCODE(0x11A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x11E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6437,19 +7214,20 @@ OPCODE(0x11E8) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEB OPCODE(0x13E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6457,19 +7235,20 @@ OPCODE(0x13E8) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1EE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6478,19 +7257,20 @@ OPCODE(0x1EE8) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1F28) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6499,38 +7279,40 @@ OPCODE(0x1F28) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1030) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEB OPCODE(0x10B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6538,19 +7320,20 @@ OPCODE(0x10B0) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x10F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6559,19 +7342,20 @@ OPCODE(0x10F0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1130) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6580,19 +7364,20 @@ OPCODE(0x1130) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1170) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6601,40 +7386,42 @@ OPCODE(0x1170) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x11B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(12) +#endif } // MOVEB OPCODE(0x11F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6642,19 +7429,20 @@ OPCODE(0x11F0) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x13F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6662,19 +7450,20 @@ OPCODE(0x13F0) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(12) +#endif } // MOVEB OPCODE(0x1EF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6683,19 +7472,20 @@ OPCODE(0x1EF0) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1F30) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6704,36 +7494,38 @@ OPCODE(0x1F30) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1038) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEB OPCODE(0x10B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6741,18 +7533,19 @@ OPCODE(0x10B8) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6761,18 +7554,19 @@ OPCODE(0x10F8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1138) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6781,18 +7575,19 @@ OPCODE(0x1138) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1178) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6801,38 +7596,40 @@ OPCODE(0x1178) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x11B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // MOVEB OPCODE(0x11F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6840,18 +7637,19 @@ OPCODE(0x11F8) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x13F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6859,18 +7657,19 @@ OPCODE(0x13F8) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // MOVEB OPCODE(0x1EF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6879,18 +7678,19 @@ OPCODE(0x1EF8) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1F38) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6899,36 +7699,38 @@ OPCODE(0x1F38) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1039) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEB OPCODE(0x10B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6936,18 +7738,19 @@ OPCODE(0x10B9) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6956,18 +7759,19 @@ OPCODE(0x10F9) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1139) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6976,18 +7780,19 @@ OPCODE(0x1139) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1179) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -6996,38 +7801,40 @@ OPCODE(0x1179) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEB OPCODE(0x11B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(9) +#endif } // MOVEB OPCODE(0x11F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7035,18 +7842,19 @@ OPCODE(0x11F9) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEB OPCODE(0x13F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7054,18 +7862,19 @@ OPCODE(0x13F9) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(9) +#endif } // MOVEB OPCODE(0x1EF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7074,18 +7883,19 @@ OPCODE(0x1EF9) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1F39) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7094,38 +7904,40 @@ OPCODE(0x1F39) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEB OPCODE(0x103A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7133,19 +7945,20 @@ OPCODE(0x10BA) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x10FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7154,19 +7967,20 @@ OPCODE(0x10FA) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x113A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7175,19 +7989,20 @@ OPCODE(0x113A) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x117A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7196,40 +8011,42 @@ OPCODE(0x117A) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEB OPCODE(0x11BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x11FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7237,19 +8054,20 @@ OPCODE(0x11FA) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEB OPCODE(0x13FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7257,19 +8075,20 @@ OPCODE(0x13FA) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1EFA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7278,19 +8097,20 @@ OPCODE(0x1EFA) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1F3A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7299,38 +8119,40 @@ OPCODE(0x1F3A) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEB OPCODE(0x103B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEB OPCODE(0x10BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7338,19 +8160,20 @@ OPCODE(0x10BB) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x10FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7359,19 +8182,20 @@ OPCODE(0x10FB) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x113B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7380,19 +8204,20 @@ OPCODE(0x113B) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x117B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7401,40 +8226,42 @@ OPCODE(0x117B) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x11BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(12) +#endif } // MOVEB OPCODE(0x11FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7442,19 +8269,20 @@ OPCODE(0x11FB) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x13FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7462,19 +8290,20 @@ OPCODE(0x13FB) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(12) +#endif } // MOVEB OPCODE(0x1EFB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7483,19 +8312,20 @@ OPCODE(0x1EFB) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1F3B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7504,49 +8334,55 @@ OPCODE(0x1F3B) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) -} +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif +} // MOVEB OPCODE(0x103C) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEB OPCODE(0x10BC) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEB OPCODE(0x10FC) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; @@ -7554,18 +8390,19 @@ OPCODE(0x10FC) flag_N = res; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEB OPCODE(0x113C) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; @@ -7573,18 +8410,19 @@ OPCODE(0x113C) flag_N = res; adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x117C) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; @@ -7592,73 +8430,77 @@ OPCODE(0x117C) flag_N = res; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x11BC) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // MOVEB OPCODE(0x11FC) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; FETCH_SWORD(adr); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEB OPCODE(0x13FC) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; FETCH_LONG(adr); - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1EFC) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; @@ -7666,18 +8508,19 @@ OPCODE(0x1EFC) flag_N = res; adr = AREG(7); AREG(7) += 2; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEB OPCODE(0x1F3C) { u32 adr, res; - u32 src, dst; - + FETCH_BYTE(res); flag_C = 0; flag_V = 0; @@ -7685,40 +8528,41 @@ OPCODE(0x1F3C) flag_N = res; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x101F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEB OPCODE(0x109F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7726,19 +8570,20 @@ OPCODE(0x109F) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7747,19 +8592,20 @@ OPCODE(0x10DF) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x111F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7768,19 +8614,20 @@ OPCODE(0x111F) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x115F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7789,40 +8636,42 @@ OPCODE(0x115F) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x119F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEB OPCODE(0x11DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7830,19 +8679,20 @@ OPCODE(0x11DF) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEB OPCODE(0x13DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7850,19 +8700,20 @@ OPCODE(0x13DF) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEB OPCODE(0x1EDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7871,19 +8722,20 @@ OPCODE(0x1EDF) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1F1F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7892,38 +8744,40 @@ OPCODE(0x1F1F) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEB OPCODE(0x1027) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // MOVEB OPCODE(0x10A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7931,19 +8785,20 @@ OPCODE(0x10A7) flag_N = res; adr = AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x10E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7952,19 +8807,20 @@ OPCODE(0x10E7) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1127) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7973,19 +8829,20 @@ OPCODE(0x1127) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1167) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -7994,40 +8851,42 @@ OPCODE(0x1167) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEB OPCODE(0x11A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // MOVEB OPCODE(0x11E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -8035,19 +8894,20 @@ OPCODE(0x11E7) flag_N = res; FETCH_SWORD(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEB OPCODE(0x13E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -8055,19 +8915,20 @@ OPCODE(0x13E7) flag_N = res; FETCH_LONG(adr); WRITE_BYTE_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEB OPCODE(0x1EE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -8076,19 +8937,20 @@ OPCODE(0x1EE7) adr = AREG(7); AREG(7) += 2; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEB OPCODE(0x1F27) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; @@ -8097,402 +8959,428 @@ OPCODE(0x1F27) adr = AREG(7) - 2; AREG(7) = adr; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2000) { - u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + u32 res; + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEL OPCODE(0x2080) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEL OPCODE(0x20C0) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEL OPCODE(0x2100) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEL OPCODE(0x2140) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(5) +#endif } // MOVEL OPCODE(0x2180) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // MOVEL OPCODE(0x21C0) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_SWORD(adr); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(4) +#endif } // MOVEL OPCODE(0x23C0) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_LONG(adr); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // MOVEL OPCODE(0x2EC0) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG(7); AREG(7) += 4; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEL OPCODE(0x2F00) { u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEL OPCODE(0x2008) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEL OPCODE(0x2088) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEL OPCODE(0x20C8) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEL OPCODE(0x2108) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEL OPCODE(0x2148) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(5) +#endif } // MOVEL OPCODE(0x2188) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // MOVEL OPCODE(0x21C8) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_SWORD(adr); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(4) +#endif } // MOVEL OPCODE(0x23C8) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_LONG(adr); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // MOVEL OPCODE(0x2EC8) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG(7); AREG(7) += 4; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEL OPCODE(0x2F08) { u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + + res = AREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEL OPCODE(0x2010) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEL OPCODE(0x2090) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8500,18 +9388,19 @@ OPCODE(0x2090) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8520,18 +9409,19 @@ OPCODE(0x20D0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2110) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8540,18 +9430,19 @@ OPCODE(0x2110) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2150) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8560,38 +9451,40 @@ OPCODE(0x2150) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2190) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8599,18 +9492,19 @@ OPCODE(0x21D0) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x23D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8618,18 +9512,19 @@ OPCODE(0x23D0) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(9) +#endif } // MOVEL OPCODE(0x2ED0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8638,18 +9533,19 @@ OPCODE(0x2ED0) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2F10) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8658,38 +9554,40 @@ OPCODE(0x2F10) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2018) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEL OPCODE(0x2098) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8697,19 +9595,20 @@ OPCODE(0x2098) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8718,19 +9617,20 @@ OPCODE(0x20D8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2118) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8739,19 +9639,20 @@ OPCODE(0x2118) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2158) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8760,40 +9661,42 @@ OPCODE(0x2158) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2198) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8801,19 +9704,20 @@ OPCODE(0x21D8) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x23D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8821,19 +9725,20 @@ OPCODE(0x23D8) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(9) +#endif } // MOVEL OPCODE(0x2ED8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8842,19 +9747,20 @@ OPCODE(0x2ED8) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2F18) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8863,38 +9769,40 @@ OPCODE(0x2F18) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2020) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8902,19 +9810,20 @@ OPCODE(0x20A0) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x20E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8923,19 +9832,20 @@ OPCODE(0x20E0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2120) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8944,19 +9854,20 @@ OPCODE(0x2120) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2160) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -8965,40 +9876,42 @@ OPCODE(0x2160) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(8) +#endif } // MOVEL OPCODE(0x21A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(10) +#endif } // MOVEL OPCODE(0x21E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9006,19 +9919,20 @@ OPCODE(0x21E0) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(8) +#endif } // MOVEL OPCODE(0x23E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9026,19 +9940,20 @@ OPCODE(0x23E0) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2EE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9047,19 +9962,20 @@ OPCODE(0x2EE0) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2F20) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9068,38 +9984,40 @@ OPCODE(0x2F20) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2028) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9107,19 +10025,20 @@ OPCODE(0x20A8) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x20E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9128,19 +10047,20 @@ OPCODE(0x20E8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2128) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9149,19 +10069,20 @@ OPCODE(0x2128) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2168) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9170,40 +10091,42 @@ OPCODE(0x2168) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // MOVEL OPCODE(0x21A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x21E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9211,19 +10134,20 @@ OPCODE(0x21E8) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // MOVEL OPCODE(0x23E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9231,19 +10155,20 @@ OPCODE(0x23E8) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2EE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9252,19 +10177,20 @@ OPCODE(0x2EE8) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2F28) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9273,38 +10199,40 @@ OPCODE(0x2F28) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2030) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEL OPCODE(0x20B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9312,19 +10240,20 @@ OPCODE(0x20B0) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x20F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9333,19 +10262,20 @@ OPCODE(0x20F0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2130) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9354,19 +10284,20 @@ OPCODE(0x2130) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2170) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9375,40 +10306,42 @@ OPCODE(0x2170) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x21B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(12) +#endif } // MOVEL OPCODE(0x21F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9416,19 +10349,20 @@ OPCODE(0x21F0) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x23F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9436,19 +10370,20 @@ OPCODE(0x23F0) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(12) +#endif } // MOVEL OPCODE(0x2EF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9457,19 +10392,20 @@ OPCODE(0x2EF0) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2F30) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9478,36 +10414,38 @@ OPCODE(0x2F30) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2038) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEL OPCODE(0x20B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9515,18 +10453,19 @@ OPCODE(0x20B8) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9535,18 +10474,19 @@ OPCODE(0x20F8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2138) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9555,18 +10495,19 @@ OPCODE(0x2138) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2178) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9575,38 +10516,40 @@ OPCODE(0x2178) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x21B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9614,18 +10557,19 @@ OPCODE(0x21F8) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x23F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9633,18 +10577,19 @@ OPCODE(0x23F8) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(9) +#endif } // MOVEL OPCODE(0x2EF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9653,18 +10598,19 @@ OPCODE(0x2EF8) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2F38) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9673,36 +10619,38 @@ OPCODE(0x2F38) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2039) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // MOVEL OPCODE(0x20B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9710,18 +10658,19 @@ OPCODE(0x20B9) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9730,18 +10679,19 @@ OPCODE(0x20F9) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2139) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9750,18 +10700,19 @@ OPCODE(0x2139) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2179) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9770,38 +10721,40 @@ OPCODE(0x2179) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(7) +#endif } // MOVEL OPCODE(0x21B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9809,18 +10762,19 @@ OPCODE(0x21F9) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(7) +#endif } // MOVEL OPCODE(0x23F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9828,18 +10782,19 @@ OPCODE(0x23F9) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(36) +#ifdef OPCODES_M68000 + RET(36) +#else + RET(9) +#endif } // MOVEL OPCODE(0x2EF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9848,18 +10803,19 @@ OPCODE(0x2EF9) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2F39) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9868,38 +10824,40 @@ OPCODE(0x2F39) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(7) +#endif } // MOVEL OPCODE(0x203A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9907,19 +10865,20 @@ OPCODE(0x20BA) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x20FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9928,19 +10887,20 @@ OPCODE(0x20FA) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x213A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9949,19 +10909,20 @@ OPCODE(0x213A) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x217A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -9970,40 +10931,42 @@ OPCODE(0x217A) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // MOVEL OPCODE(0x21BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x21FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10011,19 +10974,20 @@ OPCODE(0x21FA) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // MOVEL OPCODE(0x23FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10031,19 +10995,20 @@ OPCODE(0x23FA) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2EFA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10052,19 +11017,20 @@ OPCODE(0x2EFA) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2F3A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10073,38 +11039,40 @@ OPCODE(0x2F3A) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x203B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEL OPCODE(0x20BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10112,19 +11080,20 @@ OPCODE(0x20BB) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x20FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10133,19 +11102,20 @@ OPCODE(0x20FB) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x213B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10154,19 +11124,20 @@ OPCODE(0x213B) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x217B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10175,40 +11146,42 @@ OPCODE(0x217B) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x21BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(32) +#ifdef OPCODES_M68000 + RET(32) +#else + RET(12) +#endif } // MOVEL OPCODE(0x21FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10216,19 +11189,20 @@ OPCODE(0x21FB) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x23FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10236,19 +11210,20 @@ OPCODE(0x23FB) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(34) +#ifdef OPCODES_M68000 + RET(34) +#else + RET(12) +#endif } // MOVEL OPCODE(0x2EFB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10257,19 +11232,20 @@ OPCODE(0x2EFB) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2F3B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10278,49 +11254,55 @@ OPCODE(0x2F3B) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(10) +#endif } // MOVEL OPCODE(0x203C) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEL OPCODE(0x20BC) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEL OPCODE(0x20FC) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; @@ -10328,18 +11310,19 @@ OPCODE(0x20FC) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEL OPCODE(0x213C) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; @@ -10347,18 +11330,19 @@ OPCODE(0x213C) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEL OPCODE(0x217C) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; @@ -10366,73 +11350,77 @@ OPCODE(0x217C) flag_N = res >> 24; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21BC) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21FC) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_SWORD(adr); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEL OPCODE(0x23FC) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; FETCH_LONG(adr); - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2EFC) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; @@ -10440,18 +11428,19 @@ OPCODE(0x2EFC) flag_N = res >> 24; adr = AREG(7); AREG(7) += 4; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2F3C) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(res); flag_C = 0; flag_V = 0; @@ -10459,40 +11448,41 @@ OPCODE(0x2F3C) flag_N = res >> 24; adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEL OPCODE(0x201F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEL OPCODE(0x209F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10500,19 +11490,20 @@ OPCODE(0x209F) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10521,19 +11512,20 @@ OPCODE(0x20DF) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x211F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10542,19 +11534,20 @@ OPCODE(0x211F) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x215F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10563,40 +11556,42 @@ OPCODE(0x215F) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x219F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(9) +#endif } // MOVEL OPCODE(0x21DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10604,19 +11599,20 @@ OPCODE(0x21DF) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEL OPCODE(0x23DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10624,19 +11620,20 @@ OPCODE(0x23DF) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(9) +#endif } // MOVEL OPCODE(0x2EDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10645,19 +11642,20 @@ OPCODE(0x2EDF) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(20) -} - +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif +} + // MOVEL OPCODE(0x2F1F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10666,38 +11664,40 @@ OPCODE(0x2F1F) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEL OPCODE(0x2027) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEL OPCODE(0x20A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10705,19 +11705,20 @@ OPCODE(0x20A7) flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x20E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10726,19 +11727,20 @@ OPCODE(0x20E7) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2127) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10747,19 +11749,20 @@ OPCODE(0x2127) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2167) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10768,40 +11771,42 @@ OPCODE(0x2167) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(8) +#endif } // MOVEL OPCODE(0x21A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(10) +#endif } // MOVEL OPCODE(0x21E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10809,19 +11814,20 @@ OPCODE(0x21E7) flag_N = res >> 24; FETCH_SWORD(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(8) +#endif } // MOVEL OPCODE(0x23E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10829,19 +11835,20 @@ OPCODE(0x23E7) flag_N = res >> 24; FETCH_LONG(adr); WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(10) +#endif } // MOVEL OPCODE(0x2EE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10850,19 +11857,20 @@ OPCODE(0x2EE7) adr = AREG(7); AREG(7) += 4; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEL OPCODE(0x2F27) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; @@ -10871,597 +11879,643 @@ OPCODE(0x2F27) adr = AREG(7) - 4; AREG(7) = adr; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // MOVEAL OPCODE(0x2040) { - u32 adr, res; - u32 src, dst; - - res = (s32)DREGs32((Opcode >> 0) & 7); + u32 res; + + res = (s32)DREGs32((Opcode /*>> 0*/) & 7); AREG((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEAL OPCODE(0x2048) { - u32 adr, res; - u32 src, dst; - - res = (s32)AREGs32((Opcode >> 0) & 7); + u32 res; + + res = (s32)AREGs32((Opcode /*>> 0*/) & 7); AREG((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEAL OPCODE(0x2050) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEAL OPCODE(0x2058) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEAL OPCODE(0x2060) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEAL OPCODE(0x2068) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEAL OPCODE(0x2070) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEAL OPCODE(0x2078) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEAL OPCODE(0x2079) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // MOVEAL OPCODE(0x207A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEAL OPCODE(0x207B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEAL OPCODE(0x207C) { - u32 adr, res; - u32 src, dst; - + u32 res; + FETCH_LONG(res); AREG((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEAL OPCODE(0x205F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEAL OPCODE(0x2067) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READSX_LONG_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3000) { - u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + u32 res; + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEW OPCODE(0x3080) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x30C0) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x3100) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(5) +#endif } // MOVEW OPCODE(0x3140) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEW OPCODE(0x3180) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEW OPCODE(0x31C0) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_SWORD(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEW OPCODE(0x33C0) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_LONG(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEW OPCODE(0x3EC0) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG(7); AREG(7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x3F00) { u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(5) +#endif } // MOVEW OPCODE(0x3008) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEW OPCODE(0x3088) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x30C8) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x3108) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(5) +#endif } // MOVEW OPCODE(0x3148) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(5) +#endif } // MOVEW OPCODE(0x3188) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEW OPCODE(0x31C8) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_SWORD(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEW OPCODE(0x33C8) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_LONG(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEW OPCODE(0x3EC8) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG(7); AREG(7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x3F08) { u32 adr, res; - u32 src, dst; - - res = AREGu16((Opcode >> 0) & 7); + + res = AREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(5) +#endif } // MOVEW OPCODE(0x3010) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEW OPCODE(0x3090) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11469,18 +12523,19 @@ OPCODE(0x3090) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11489,18 +12544,19 @@ OPCODE(0x30D0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3110) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11509,18 +12565,19 @@ OPCODE(0x3110) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(12) -} - +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif +} + // MOVEW OPCODE(0x3150) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11529,38 +12586,40 @@ OPCODE(0x3150) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3190) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEW OPCODE(0x31D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11568,18 +12627,19 @@ OPCODE(0x31D0) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x33D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11587,18 +12647,19 @@ OPCODE(0x33D0) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEW OPCODE(0x3ED0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11607,18 +12668,19 @@ OPCODE(0x3ED0) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3F10) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11627,38 +12689,40 @@ OPCODE(0x3F10) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3018) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEW OPCODE(0x3098) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11666,19 +12730,20 @@ OPCODE(0x3098) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11687,19 +12752,20 @@ OPCODE(0x30D8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3118) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11708,19 +12774,20 @@ OPCODE(0x3118) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3158) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11729,40 +12796,42 @@ OPCODE(0x3158) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3198) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEW OPCODE(0x31D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11770,19 +12839,20 @@ OPCODE(0x31D8) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x33D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11790,19 +12860,20 @@ OPCODE(0x33D8) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEW OPCODE(0x3ED8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11811,19 +12882,20 @@ OPCODE(0x3ED8) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3F18) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11832,38 +12904,40 @@ OPCODE(0x3F18) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3020) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11871,19 +12945,20 @@ OPCODE(0x30A0) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x30E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11892,19 +12967,20 @@ OPCODE(0x30E0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3120) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11913,19 +12989,20 @@ OPCODE(0x3120) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3160) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11934,40 +13011,42 @@ OPCODE(0x3160) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEW OPCODE(0x31A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // MOVEW OPCODE(0x31E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11975,19 +13054,20 @@ OPCODE(0x31E0) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEW OPCODE(0x33E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -11995,19 +13075,20 @@ OPCODE(0x33E0) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3EE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12016,19 +13097,20 @@ OPCODE(0x3EE0) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3F20) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12037,38 +13119,40 @@ OPCODE(0x3F20) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3028) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12076,19 +13160,20 @@ OPCODE(0x30A8) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x30E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12097,19 +13182,20 @@ OPCODE(0x30E8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3128) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12118,19 +13204,20 @@ OPCODE(0x3128) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3168) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12139,40 +13226,42 @@ OPCODE(0x3168) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEW OPCODE(0x31A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x31E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12180,19 +13269,20 @@ OPCODE(0x31E8) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEW OPCODE(0x33E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12200,19 +13290,20 @@ OPCODE(0x33E8) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3EE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12221,19 +13312,20 @@ OPCODE(0x3EE8) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3F28) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12242,38 +13334,40 @@ OPCODE(0x3F28) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3030) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEW OPCODE(0x30B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12281,19 +13375,20 @@ OPCODE(0x30B0) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x30F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12302,19 +13397,20 @@ OPCODE(0x30F0) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3130) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12323,19 +13419,20 @@ OPCODE(0x3130) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3170) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12344,40 +13441,42 @@ OPCODE(0x3170) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x31B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(12) +#endif } // MOVEW OPCODE(0x31F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12385,19 +13484,20 @@ OPCODE(0x31F0) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x33F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12405,19 +13505,20 @@ OPCODE(0x33F0) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(12) +#endif } // MOVEW OPCODE(0x3EF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12426,19 +13527,20 @@ OPCODE(0x3EF0) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3F30) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12447,36 +13549,38 @@ OPCODE(0x3F30) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3038) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEW OPCODE(0x30B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12484,18 +13588,19 @@ OPCODE(0x30B8) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12504,18 +13609,19 @@ OPCODE(0x30F8) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(16) -} - +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif +} + // MOVEW OPCODE(0x3138) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12524,18 +13630,19 @@ OPCODE(0x3138) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3178) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12544,38 +13651,40 @@ OPCODE(0x3178) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x31B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // MOVEW OPCODE(0x31F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12583,18 +13692,19 @@ OPCODE(0x31F8) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x33F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12602,18 +13712,19 @@ OPCODE(0x33F8) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // MOVEW OPCODE(0x3EF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12622,18 +13733,19 @@ OPCODE(0x3EF8) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3F38) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12642,36 +13754,38 @@ OPCODE(0x3F38) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3039) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEW OPCODE(0x30B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12679,18 +13793,19 @@ OPCODE(0x30B9) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12699,18 +13814,19 @@ OPCODE(0x30F9) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3139) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12719,18 +13835,19 @@ OPCODE(0x3139) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3179) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12739,38 +13856,40 @@ OPCODE(0x3179) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEW OPCODE(0x31B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(9) +#endif } // MOVEW OPCODE(0x31F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12778,18 +13897,19 @@ OPCODE(0x31F9) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(7) +#endif } // MOVEW OPCODE(0x33F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12797,18 +13917,19 @@ OPCODE(0x33F9) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(9) +#endif } // MOVEW OPCODE(0x3EF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12817,18 +13938,19 @@ OPCODE(0x3EF9) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3F39) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12837,38 +13959,40 @@ OPCODE(0x3F39) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // MOVEW OPCODE(0x303A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12876,19 +14000,20 @@ OPCODE(0x30BA) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x30FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12897,19 +14022,20 @@ OPCODE(0x30FA) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x313A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12918,19 +14044,20 @@ OPCODE(0x313A) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x317A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12939,40 +14066,42 @@ OPCODE(0x317A) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEW OPCODE(0x31BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x31FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -12980,19 +14109,20 @@ OPCODE(0x31FA) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEW OPCODE(0x33FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13000,19 +14130,20 @@ OPCODE(0x33FA) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3EFA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13021,19 +14152,20 @@ OPCODE(0x3EFA) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3F3A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13042,38 +14174,40 @@ OPCODE(0x3F3A) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEW OPCODE(0x303B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEW OPCODE(0x30BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13081,19 +14215,20 @@ OPCODE(0x30BB) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x30FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13102,19 +14237,20 @@ OPCODE(0x30FB) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x313B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13123,19 +14259,20 @@ OPCODE(0x313B) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x317B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13144,40 +14281,42 @@ OPCODE(0x317B) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x31BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(12) +#endif } // MOVEW OPCODE(0x31FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13185,19 +14324,20 @@ OPCODE(0x31FB) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x33FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13205,19 +14345,20 @@ OPCODE(0x33FB) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(12) +#endif } // MOVEW OPCODE(0x3EFB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13226,19 +14367,20 @@ OPCODE(0x3EFB) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3F3B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13247,49 +14389,55 @@ OPCODE(0x3F3B) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } // MOVEW OPCODE(0x303C) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEW OPCODE(0x30BC) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEW OPCODE(0x30FC) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; @@ -13297,18 +14445,19 @@ OPCODE(0x30FC) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEW OPCODE(0x313C) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; @@ -13316,18 +14465,19 @@ OPCODE(0x313C) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x317C) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; @@ -13335,73 +14485,77 @@ OPCODE(0x317C) flag_N = res >> 8; FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x31BC) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD - PRE_IO + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // MOVEW OPCODE(0x31FC) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_SWORD(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEW OPCODE(0x33FC) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; FETCH_LONG(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3EFC) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; @@ -13409,18 +14563,19 @@ OPCODE(0x3EFC) flag_N = res >> 8; adr = AREG(7); AREG(7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEW OPCODE(0x3F3C) { u32 adr, res; - u32 src, dst; - + FETCH_WORD(res); flag_C = 0; flag_V = 0; @@ -13428,40 +14583,41 @@ OPCODE(0x3F3C) flag_N = res >> 8; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x301F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEW OPCODE(0x309F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13469,19 +14625,20 @@ OPCODE(0x309F) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13490,19 +14647,20 @@ OPCODE(0x30DF) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x311F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13511,19 +14669,20 @@ OPCODE(0x311F) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x315F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13532,40 +14691,42 @@ OPCODE(0x315F) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x319F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEW OPCODE(0x31DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13573,19 +14734,20 @@ OPCODE(0x31DF) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVEW OPCODE(0x33DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13593,19 +14755,20 @@ OPCODE(0x33DF) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEW OPCODE(0x3EDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13614,19 +14777,20 @@ OPCODE(0x3EDF) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3F1F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13635,38 +14799,40 @@ OPCODE(0x3F1F) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEW OPCODE(0x3027) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // MOVEW OPCODE(0x30A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13674,19 +14840,20 @@ OPCODE(0x30A7) flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x30E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13695,19 +14862,20 @@ OPCODE(0x30E7) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3127) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13716,19 +14884,20 @@ OPCODE(0x3127) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3167) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13737,40 +14906,42 @@ OPCODE(0x3167) FETCH_SWORD(adr); adr += AREG((Opcode >> 9) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEW OPCODE(0x31A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; adr = AREG((Opcode >> 9) & 7); - DECODE_EXT_WORD + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // MOVEW OPCODE(0x31E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13778,19 +14949,20 @@ OPCODE(0x31E7) flag_N = res >> 8; FETCH_SWORD(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // MOVEW OPCODE(0x33E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13798,19 +14970,20 @@ OPCODE(0x33E7) flag_N = res >> 8; FETCH_LONG(adr); WRITE_WORD_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(10) +#endif } // MOVEW OPCODE(0x3EE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13819,19 +14992,20 @@ OPCODE(0x3EE7) adr = AREG(7); AREG(7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEW OPCODE(0x3F27) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; @@ -13840,1623 +15014,1870 @@ OPCODE(0x3F27) adr = AREG(7) - 2; AREG(7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // MOVEAW OPCODE(0x3040) { - u32 adr, res; - u32 src, dst; - - res = (s32)DREGs16((Opcode >> 0) & 7); + u32 res; + + res = (s32)DREGs16((Opcode /*>> 0*/) & 7); AREG((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEAW OPCODE(0x3048) { - u32 adr, res; - u32 src, dst; - - res = (s32)AREGs16((Opcode >> 0) & 7); + u32 res; + + res = (s32)AREGs16((Opcode /*>> 0*/) & 7); AREG((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEAW OPCODE(0x3050) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEAW OPCODE(0x3058) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEAW OPCODE(0x3060) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // MOVEAW OPCODE(0x3068) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEAW OPCODE(0x3070) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEAW OPCODE(0x3078) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEAW OPCODE(0x3079) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEAW OPCODE(0x307A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVEAW OPCODE(0x307B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // MOVEAW OPCODE(0x307C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_SWORD(res); AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // MOVEAW OPCODE(0x305F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // MOVEAW OPCODE(0x3067) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READSX_WORD_F(adr, res) AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // NEGX OPCODE(0x4000) { - u32 adr, res; - u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu8((Opcode /*>> 0*/) & 7); res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // NEGX OPCODE(0x4010) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEGX OPCODE(0x4018) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEGX OPCODE(0x4020) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEGX OPCODE(0x4028) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // NEGX OPCODE(0x4030) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // NEGX OPCODE(0x4038) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // NEGX OPCODE(0x4039) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEGX OPCODE(0x401F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEGX OPCODE(0x4027) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEGX OPCODE(0x4040) { u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 src; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // NEGX OPCODE(0x4050) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEGX OPCODE(0x4058) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEGX OPCODE(0x4060) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEGX OPCODE(0x4068) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // NEGX OPCODE(0x4070) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // NEGX OPCODE(0x4078) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // NEGX OPCODE(0x4079) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) -} +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif +} // NEGX OPCODE(0x405F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEGX OPCODE(0x4067) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEGX OPCODE(0x4080) { - u32 adr, res; - u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu32((Opcode /*>> 0*/) & 7); res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(6) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // NEGX OPCODE(0x4090) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) | (src >> 1) | (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEGX OPCODE(0x4098) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEGX OPCODE(0x40A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // NEGX OPCODE(0x40A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // NEGX OPCODE(0x40B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // NEGX OPCODE(0x40B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // NEGX OPCODE(0x40B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // NEGX OPCODE(0x409F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEGX OPCODE(0x40A7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) res = -src - ((flag_X >> 8) & 1); flag_NotZ |= res; flag_V = (res & src) >> 24; -flag_X = flag_C = (res?1:0)<<8; -// flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; + flag_X = flag_C = (res?1:0)<<8; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // CLR OPCODE(0x4200) { - u32 adr, res; - u32 src, dst; - + u32 res; + res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // CLR OPCODE(0x4210) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CLR OPCODE(0x4218) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CLR OPCODE(0x4220) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CLR OPCODE(0x4228) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // CLR OPCODE(0x4230) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // CLR OPCODE(0x4238) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // CLR OPCODE(0x4239) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // CLR OPCODE(0x421F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CLR OPCODE(0x4227) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CLR OPCODE(0x4240) { - u32 adr, res; - u32 src, dst; - + u32 res; + res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // CLR OPCODE(0x4250) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CLR OPCODE(0x4258) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CLR OPCODE(0x4260) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CLR OPCODE(0x4268) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // CLR OPCODE(0x4270) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // CLR OPCODE(0x4278) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // CLR OPCODE(0x4279) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // CLR OPCODE(0x425F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // CLR OPCODE(0x4267) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CLR OPCODE(0x4280) { - u32 adr, res; + u32 res; u32 src, dst; - + res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - DREGu32((Opcode >> 0) & 7) = res; -RET(6) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // CLR OPCODE(0x4290) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // CLR OPCODE(0x4298) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // CLR OPCODE(0x42A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // CLR OPCODE(0x42A8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // CLR OPCODE(0x42B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // CLR OPCODE(0x42B8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // CLR OPCODE(0x42B9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // CLR OPCODE(0x429F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // CLR OPCODE(0x42A7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; res = 0; flag_N = flag_NotZ = flag_V = flag_C = 0; - PRE_IO WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif +} + +#ifdef OPCODES_M68020 +// MOVE CCR, Dn - 68010+ +OPCODE(0x42C0) +{ + DREGu16((Opcode /*>> 0*/) & 7) = GET_CCR; + RET(4) +} + +// MOVE CCR, (An) - 68010+ +OPCODE(0x42D0) +{ + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); + WRITE_WORD_F(adr, GET_CCR) + RET(7) +} + +// MOVE CCR, (An)+ - 68010+ +OPCODE(0x42D8) +{ + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; + WRITE_WORD_F(adr, GET_CCR) + RET(7) +} + +// MOVE CCR, -(An) - 68010+ +OPCODE(0x42E0) +{ + u32 adr; + + AREG((Opcode /*>> 0*/) & 7) -= 2; + adr = AREG((Opcode /*>> 0*/) & 7); + WRITE_WORD_F(adr, GET_CCR) + RET(7) +} + +// MOVE CCR, (d16,An) - 68020+ +OPCODE(0x42E8) +{ + u32 adr; + + FETCH_SWORD(adr); + adr += AREG((Opcode /*>> 0*/) & 7); + WRITE_WORD_F(adr, GET_CCR) + RET(7) +} + +// MOVE CCR, (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x42F0) +{ + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + WRITE_WORD_F(adr, GET_CCR) + RET(9) +} + +// MOVE CCR, (xx).W - 68010+ +OPCODE(0x42F8) +{ + u32 adr; + + FETCH_SWORD(adr); + WRITE_WORD_F(adr, GET_CCR) + RET(7) +} + +// MOVE CCR, (xx).L - 68010+ +OPCODE(0x42F9) +{ + u32 adr; + + FETCH_LONG(adr); + WRITE_WORD_F(adr, GET_CCR) + RET(9) } +#endif // NEG OPCODE(0x4400) { - u32 adr, res; - u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu8((Opcode /*>> 0*/) & 7); res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // NEG OPCODE(0x4410) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEG OPCODE(0x4418) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEG OPCODE(0x4420) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src ; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) -} - +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif +} + // NEG OPCODE(0x4428) { u32 adr, res; - u32 src, dst; - + u32 src ; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // NEG OPCODE(0x4430) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src ; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // NEG OPCODE(0x4438) { u32 adr, res; - u32 src, dst; - + u32 src ; + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // NEG OPCODE(0x4439) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEG OPCODE(0x441F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEG OPCODE(0x4427) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) res = -src; flag_V = res & src; flag_N = flag_X = flag_C = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEG OPCODE(0x4440) { - u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // NEG OPCODE(0x4450) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEG OPCODE(0x4458) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEG OPCODE(0x4460) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEG OPCODE(0x4468) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // NEG OPCODE(0x4470) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // NEG OPCODE(0x4478) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // NEG OPCODE(0x4479) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEG OPCODE(0x445F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NEG OPCODE(0x4467) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = -src; flag_V = (res & src) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NEG OPCODE(0x4480) { - u32 adr, res; - u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu32((Opcode /*>> 0*/) & 7); res = -src; flag_NotZ = res; flag_V = (res & src) >> 24; flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(6) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // NEG OPCODE(0x4490) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15464,19 +16885,21 @@ OPCODE(0x4490) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEG OPCODE(0x4498) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15484,19 +16907,21 @@ OPCODE(0x4498) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NEG OPCODE(0x44A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15504,19 +16929,21 @@ OPCODE(0x44A0) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // NEG OPCODE(0x44A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15524,19 +16951,21 @@ OPCODE(0x44A8) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // NEG OPCODE(0x44B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15544,18 +16973,20 @@ OPCODE(0x44B0) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // NEG OPCODE(0x44B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15563,18 +16994,20 @@ OPCODE(0x44B8) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // NEG OPCODE(0x44B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15582,19 +17015,21 @@ OPCODE(0x44B9) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // NEG OPCODE(0x449F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15602,19 +17037,21 @@ OPCODE(0x449F) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // NEG OPCODE(0x44A7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) res = -src; flag_NotZ = res; @@ -15622,34 +17059,40 @@ OPCODE(0x44A7) flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // NOT OPCODE(0x4600) { - u32 adr, res; - u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu8((Opcode /*>> 0*/) & 7); res = ~src; flag_C = 0; flag_V = 0; flag_N = res; flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // NOT OPCODE(0x4610) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15657,19 +17100,21 @@ OPCODE(0x4610) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NOT OPCODE(0x4618) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15677,19 +17122,21 @@ OPCODE(0x4618) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NOT OPCODE(0x4620) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15697,19 +17144,21 @@ OPCODE(0x4620) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NOT OPCODE(0x4628) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15717,19 +17166,21 @@ OPCODE(0x4628) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // NOT OPCODE(0x4630) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15737,18 +17188,20 @@ OPCODE(0x4630) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // NOT OPCODE(0x4638) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15756,18 +17209,20 @@ OPCODE(0x4638) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // NOT OPCODE(0x4639) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15775,19 +17230,21 @@ OPCODE(0x4639) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NOT OPCODE(0x461F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15795,19 +17252,21 @@ OPCODE(0x461F) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NOT OPCODE(0x4627) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) res = ~src; flag_C = 0; @@ -15815,34 +17274,40 @@ OPCODE(0x4627) flag_N = res; flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NOT OPCODE(0x4640) { - u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = ~src; flag_C = 0; flag_V = 0; flag_NotZ = res & 0xFFFF; flag_N = res >> 8; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // NOT OPCODE(0x4650) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15850,19 +17315,21 @@ OPCODE(0x4650) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NOT OPCODE(0x4658) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15870,19 +17337,21 @@ OPCODE(0x4658) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NOT OPCODE(0x4660) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15890,19 +17359,21 @@ OPCODE(0x4660) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NOT OPCODE(0x4668) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15910,19 +17381,21 @@ OPCODE(0x4668) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // NOT OPCODE(0x4670) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15930,18 +17403,20 @@ OPCODE(0x4670) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // NOT OPCODE(0x4678) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15949,18 +17424,20 @@ OPCODE(0x4678) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // NOT OPCODE(0x4679) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15968,19 +17445,21 @@ OPCODE(0x4679) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NOT OPCODE(0x465F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -15988,19 +17467,21 @@ OPCODE(0x465F) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // NOT OPCODE(0x4667) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = ~src; flag_C = 0; @@ -16008,34 +17489,40 @@ OPCODE(0x4667) flag_NotZ = res & 0xFFFF; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // NOT OPCODE(0x4680) { - u32 adr, res; - u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu32((Opcode /*>> 0*/) & 7); res = ~src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(6) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // NOT OPCODE(0x4690) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16043,19 +17530,21 @@ OPCODE(0x4690) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NOT OPCODE(0x4698) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16063,19 +17552,21 @@ OPCODE(0x4698) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NOT OPCODE(0x46A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16083,19 +17574,21 @@ OPCODE(0x46A0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // NOT OPCODE(0x46A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16103,19 +17596,21 @@ OPCODE(0x46A8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // NOT OPCODE(0x46B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16123,18 +17618,20 @@ OPCODE(0x46B0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // NOT OPCODE(0x46B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16142,18 +17639,20 @@ OPCODE(0x46B8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // NOT OPCODE(0x46B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16161,19 +17660,21 @@ OPCODE(0x46B9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // NOT OPCODE(0x469F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16181,19 +17682,21 @@ OPCODE(0x469F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // NOT OPCODE(0x46A7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) res = ~src; flag_C = 0; @@ -16201,1120 +17704,1164 @@ OPCODE(0x46A7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // MOVESRa OPCODE(0x40C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + res = GET_SR; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // MOVESRa OPCODE(0x40D0) { u32 adr, res; - u32 src, dst; - + res = GET_SR; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVESRa OPCODE(0x40D8) { u32 adr, res; - u32 src, dst; - + res = GET_SR; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVESRa OPCODE(0x40E0) { u32 adr, res; - u32 src, dst; - + res = GET_SR; - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVESRa OPCODE(0x40E8) { u32 adr, res; - u32 src, dst; - + res = GET_SR; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVESRa OPCODE(0x40F0) { u32 adr, res; - u32 src, dst; - + res = GET_SR; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVESRa OPCODE(0x40F8) { u32 adr, res; - u32 src, dst; - + res = GET_SR; FETCH_SWORD(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // MOVESRa OPCODE(0x40F9) { u32 adr, res; - u32 src, dst; - + res = GET_SR; FETCH_LONG(adr); - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVESRa OPCODE(0x40DF) { u32 adr, res; - u32 src, dst; - + res = GET_SR; adr = AREG(7); AREG(7) += 2; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // MOVESRa OPCODE(0x40E7) { u32 adr, res; - u32 src, dst; - + res = GET_SR; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // MOVEaCCR OPCODE(0x44C0) { - u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + u32 res; + + res = DREGu16((Opcode /*>> 0*/) & 7); SET_CCR(res) -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // MOVEaCCR OPCODE(0x44D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEaCCR OPCODE(0x44D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEaCCR OPCODE(0x44E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEaCCR OPCODE(0x44E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEaCCR OPCODE(0x44F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(11) +#endif } // MOVEaCCR OPCODE(0x44F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // MOVEaCCR OPCODE(0x44F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // MOVEaCCR OPCODE(0x44FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // MOVEaCCR OPCODE(0x44FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(11) +#endif } // MOVEaCCR OPCODE(0x44FC) { - u32 adr, res; - u32 src, dst; - + u32 res; + FETCH_WORD(res); SET_CCR(res) -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // MOVEaCCR OPCODE(0x44DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // MOVEaCCR OPCODE(0x44E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) SET_CCR(res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // MOVEaSR OPCODE(0x46C0) { - u32 adr, res; - u32 src, dst; - - if (flag_S) - { - res = DREGu16((Opcode >> 0) & 7); - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - CHECK_INT_TO_JUMP(12) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(12) + u32 res; + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,8) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + res = DREGu16((Opcode /*>> 0*/) & 7); + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(12) + RET(12) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(8) + RET(8) +#endif } // MOVEaSR OPCODE(0x46D0) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = AREG((Opcode >> 0) & 7); - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(16) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(16) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,16) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = AREG((Opcode /*>> 0*/) & 7); + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(16) + RET(16) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // MOVEaSR OPCODE(0x46D8) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(16) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(16) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,16) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(16) + RET(16) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // MOVEaSR OPCODE(0x46E0) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(18) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(18) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,18) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,13) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(18) + RET(18) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(13) + RET(13) +#endif } // MOVEaSR OPCODE(0x46E8) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(20) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(20) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,13) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + FETCH_SWORD(adr); + adr += AREG((Opcode /*>> 0*/) & 7); + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(13) + RET(13) +#endif } // MOVEaSR OPCODE(0x46F0) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(22) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(22) -} + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,22) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,15) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(22) + RET(22) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(15) + RET(15) +#endif +} // MOVEaSR OPCODE(0x46F8) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - FETCH_SWORD(adr); - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(20) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(20) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + FETCH_SWORD(adr); + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // MOVEaSR OPCODE(0x46F9) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - FETCH_LONG(adr); - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(24) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(24) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,24) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + FETCH_LONG(adr); + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(24) + RET(24) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // MOVEaSR OPCODE(0x46FA) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = GET_SWORD + ((u32)(PC) - BasePC); - PC++; - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(24) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(20) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,13) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(13) + RET(13) +#endif } // MOVEaSR OPCODE(0x46FB) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(22) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(22) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,22) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,15) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(22) + RET(22) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(15) + RET(15) +#endif } // MOVEaSR OPCODE(0x46FC) { - u32 adr, res; - u32 src, dst; - - if (flag_S) - { - FETCH_WORD(res); - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - CHECK_INT_TO_JUMP(16) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(16) + u32 res; + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,16) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,10) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + FETCH_WORD(res); + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(16) + RET(16) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(10) + RET(10) +#endif } // MOVEaSR OPCODE(0x46DF) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = AREG(7); - AREG(7) += 2; - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(16) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(16) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,16) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = AREG(7); + AREG(7) += 2; + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(16) + RET(16) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(12) + RET(12) +#endif } // MOVEaSR OPCODE(0x46E7) { u32 adr, res; - u32 src, dst; - - if (flag_S) - { - adr = AREG(7) - 2; - AREG(7) = adr; - PRE_IO - READ_WORD_F(adr, res) - SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - CHECK_INT_TO_JUMP(18) - } - else - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } -RET(18) + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,18) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,13) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + adr = AREG(7) - 2; + AREG(7) = adr; + READ_WORD_F(adr, res) + SET_SR(res) +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(18) + RET(18) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(13) + RET(13) +#endif } // NBCD OPCODE(0x4800) { - u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + u32 res; + + res = DREGu8((Opcode /*>> 0*/) & 7); res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // NBCD OPCODE(0x4810) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(12) // Not sure about this value +#endif } // NBCD OPCODE(0x4818) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(12) // Not sure about this value +#endif } // NBCD OPCODE(0x4820) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(13) // Not sure about this value +#endif } // NBCD OPCODE(0x4828) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) // Not sure about this value +#endif } // NBCD OPCODE(0x4830) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(15) // Not sure about this value +#endif } // NBCD OPCODE(0x4838) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(12) // Not sure about this value +#endif } // NBCD OPCODE(0x4839) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(12) // Not sure about this value +#endif } // NBCD OPCODE(0x481F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(12) // Not sure about this value +#endif } // NBCD OPCODE(0x4827) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res = 0x9a - res - ((flag_X >> M68K_SR_X_SFT) & 1); - + if (res != 0x9a) { if ((res & 0x0f) == 0xa) res = (res & 0xf0) + 0x10; res &= 0xFF; - WRITE_BYTE_F(adr, res) + WRITE_BYTE_F(adr, res) flag_NotZ |= res; flag_X = flag_C = M68K_SR_C; } else flag_X = flag_C = 0; flag_N = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(13) // Not sure about this value +#endif } // PEA OPCODE(0x4850) { - u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); PUSH_32_F(adr) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // PEA OPCODE(0x4868) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); PUSH_32_F(adr) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // PEA OPCODE(0x4870) { - u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); PUSH_32_F(adr) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // PEA OPCODE(0x4878) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_SWORD(adr); - PRE_IO PUSH_32_F(adr) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // PEA OPCODE(0x4879) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_LONG(adr); - PRE_IO PUSH_32_F(adr) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // PEA OPCODE(0x487A) { - u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 adr; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO PUSH_32_F(adr) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // PEA OPCODE(0x487B) { - u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 adr; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); PUSH_32_F(adr) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SWAP OPCODE(0x4840) { - u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + u32 res; + + res = DREGu32((Opcode /*>> 0*/) & 7); res = (res >> 16) | (res << 16); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(4) -} - -// MOVEMRa + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(4) +#endif +} + +// MOVEMRa OPCODE(0x4890) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17324,12 +18871,12 @@ OPCODE(0x4890) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(8) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(8) #else -RET(12) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 1) * 3) << mainMenu_CPU_speed); + RET(6) #endif } @@ -17337,44 +18884,50 @@ RET(12) OPCODE(0x48A0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &AREGu32(7); dst = adr; - PRE_IO do { if (res & 1) { adr -= 2; +#ifdef OPCODES_M68020 + if (prefs_cpu_model >= M68020) + AREG((Opcode /*>> 0*/) & 7) = adr; +#endif WRITE_WORD_F(adr, *psrc) } psrc--; } while (res >>= 1); - AREG((Opcode >> 0) & 7) = adr; - POST_IO - io_cycle_counter -= (dst - adr) * 2; -RET(8) + AREG((Opcode /*>> 0*/) & 7) = adr; +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((dst - adr) * 2) << mainMenu_CPU_speed); + RET(8) +#else + m68kcontext.io_cycle_counter -= ((((dst - adr) >> 1) * 3) << mainMenu_CPU_speed); + RET(8) +#endif } // MOVEMRa OPCODE(0x48A8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17384,12 +18937,12 @@ OPCODE(0x48A8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(12) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) #else -RET(20) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 1) * 3) << mainMenu_CPU_speed); + RET(14) #endif } @@ -17397,16 +18950,15 @@ RET(20) OPCODE(0x48B0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17416,12 +18968,12 @@ OPCODE(0x48B0) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(14) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(14) #else -RET(24) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 1) * 3) << mainMenu_CPU_speed); + RET(10) #endif } @@ -17429,15 +18981,14 @@ RET(24) OPCODE(0x48B8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17447,12 +18998,12 @@ OPCODE(0x48B8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(12) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) #else -RET(20) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 1) * 3) << mainMenu_CPU_speed); + RET(8) #endif } @@ -17460,15 +19011,14 @@ RET(20) OPCODE(0x48B9) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_LONG(adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17478,12 +19028,12 @@ OPCODE(0x48B9) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(16) #else -RET(28) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 1) * 3) << mainMenu_CPU_speed); + RET(8) #endif } @@ -17491,15 +19041,14 @@ RET(28) OPCODE(0x48A7) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); adr = AREG(7); psrc = &AREGu32(7); dst = adr; - PRE_IO do { if (res & 1) @@ -17510,24 +19059,27 @@ OPCODE(0x48A7) psrc--; } while (res >>= 1); AREG(7) = adr; - POST_IO - io_cycle_counter -= (dst - adr) * 2; -RET(8) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((dst - adr) * 2) << mainMenu_CPU_speed); + RET(8) +#else + m68kcontext.io_cycle_counter -= ((((dst - adr) >> 1) * 3) << mainMenu_CPU_speed); + RET(6) +#endif } // MOVEMRa OPCODE(0x48D0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17537,12 +19089,12 @@ OPCODE(0x48D0) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(8) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(8) #else -RET(16) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 2) * 3) << mainMenu_CPU_speed); + RET(6) #endif } @@ -17550,44 +19102,50 @@ RET(16) OPCODE(0x48E0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &AREGu32(7); dst = adr; - PRE_IO do { if (res & 1) { adr -= 4; +#ifdef OPCODES_M68020 + if (prefs_cpu_model >= M68020) + AREG((Opcode /*>> 0*/) & 7) = adr; +#endif WRITE_LONG_DEC_F(adr, *psrc) } psrc--; } while (res >>= 1); - AREG((Opcode >> 0) & 7) = adr; - POST_IO - io_cycle_counter -= (dst - adr) * 2; -RET(8) + AREG((Opcode /*>> 0*/) & 7) = adr; +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((dst - adr) * 2) << mainMenu_CPU_speed); + RET(8) +#else + m68kcontext.io_cycle_counter -= ((((dst - adr) >> 2) * 3) << mainMenu_CPU_speed); + RET(8) +#endif } // MOVEMRa OPCODE(0x48E8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17597,12 +19155,12 @@ OPCODE(0x48E8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(12) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) #else -RET(24) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 2) * 3) << mainMenu_CPU_speed); + RET(14) #endif } @@ -17610,16 +19168,15 @@ RET(24) OPCODE(0x48F0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17629,12 +19186,12 @@ OPCODE(0x48F0) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(14) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(14) #else -RET(28) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 2) * 3) << mainMenu_CPU_speed); + RET(10) #endif } @@ -17642,15 +19199,14 @@ RET(28) OPCODE(0x48F8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17660,12 +19216,12 @@ OPCODE(0x48F8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(12) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) #else -RET(24) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 2) * 3) << mainMenu_CPU_speed); + RET(8) #endif } @@ -17673,15 +19229,14 @@ RET(24) OPCODE(0x48F9) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_LONG(adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -17691,12 +19246,12 @@ OPCODE(0x48F9) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(16) #else -RET(32) + m68kcontext.io_cycle_counter -= ((((adr - dst) >> 2) * 3) << mainMenu_CPU_speed); + RET(8) #endif } @@ -17704,797 +19259,1432 @@ RET(32) OPCODE(0x48E7) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); adr = AREG(7); psrc = &AREGu32(7); dst = adr; - PRE_IO do { if (res & 1) { adr -= 4; +#ifdef OPCODES_M68020 + if (prefs_cpu_model >= M68020) + AREG((Opcode /*>> 0*/) & 7) = adr; +#endif WRITE_LONG_DEC_F(adr, *psrc) } psrc--; } while (res >>= 1); AREG(7) = adr; - POST_IO - io_cycle_counter -= (dst - adr) * 2; -RET(8) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((dst - adr) * 2) << mainMenu_CPU_speed); + RET(8) +#else + m68kcontext.io_cycle_counter -= ((((dst - adr) >> 2) * 3) << mainMenu_CPU_speed); + RET(6) +#endif } // EXT OPCODE(0x4880) { - u32 adr, res; - u32 src, dst; - - res = (s32)DREGs8((Opcode >> 0) & 7); + u32 res; + + res = (s32)DREGs8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(4) +#endif } // EXT OPCODE(0x48C0) { - u32 adr, res; - u32 src, dst; - - res = (s32)DREGs16((Opcode >> 0) & 7); + u32 res; + + res = (s32)DREGs16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - DREGu32((Opcode >> 0) & 7) = res; -RET(4) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(4) +#endif +} + +#ifdef OPCODES_M68020 +// EXTB.L - 68020+ +OPCODE(0x49C0) +{ + s32 res; + + res = (s32)DREGs8((Opcode /*>> 0*/) & 7); + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 24; + DREGu32((Opcode /*>> 0*/) & 7) = res; + RET(4) } +#endif // TST OPCODE(0x4A00) { - u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + u32 res; + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // TST OPCODE(0x4A10) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // TST OPCODE(0x4A18) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // TST OPCODE(0x4A20) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // TST OPCODE(0x4A28) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // TST OPCODE(0x4A30) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // TST OPCODE(0x4A38) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // TST OPCODE(0x4A39) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif +} + +#ifdef OPCODES_M68020 +// TST.B (d16,PC) - 68020+ +OPCODE(0x4A3A) +{ + u32 adr, res; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_BYTE_F(adr, res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + RET(7) +} + +// TST.B - (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x4A3B) +{ + u32 adr, res; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_BYTE_F(adr, res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + RET(9) +} + +// TST.B #.B - 68020+ +OPCODE(0x4A3C) +{ + u32 res; + + FETCH_BYTE(res); + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res; + RET(4) } +#endif // TST OPCODE(0x4A1F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // TST OPCODE(0x4A27) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // TST OPCODE(0x4A40) { - u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + u32 res; + + res = DREGu16((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif +} + +#ifdef OPCODES_M68020 +// TST.W An - 68020+ +OPCODE(0x4A48) +{ + u32 res; + + res = AREGu16((Opcode /*>> 0*/) & 7); + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 8; + RET(2) } +#endif // TST OPCODE(0x4A50) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // TST OPCODE(0x4A58) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // TST OPCODE(0x4A60) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // TST OPCODE(0x4A68) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // TST OPCODE(0x4A70) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // TST OPCODE(0x4A78) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // TST OPCODE(0x4A79) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif +} + +#ifdef OPCODES_M68020 +// TST.W (d16,PC) - 68020+ +OPCODE(0x4A7A) +{ + u32 adr, res; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_WORD_F(adr, res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 8; + RET(7) +} + +// TST.W - (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x4A7B) +{ + u32 adr, res; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_WORD_F(adr, res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 8; + RET(9) +} + +// TST.W #.W - 68020+ +OPCODE(0x4A7C) +{ + u32 res; + + FETCH_SWORD(res); + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 8; + RET(4) } +#endif // TST OPCODE(0x4A5F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // TST OPCODE(0x4A67) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // TST OPCODE(0x4A80) { - u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + u32 res; + + res = DREGu32((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } +#ifdef OPCODES_M68020 +// TST.L An - 68020+ +OPCODE(0x4A88) +{ + u32 res; + + res = AREGu32((Opcode /*>> 0*/) & 7); + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 24; + RET(2) +} +#endif + // TST OPCODE(0x4A90) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // TST OPCODE(0x4A98) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // TST OPCODE(0x4AA0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // TST OPCODE(0x4AA8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // TST OPCODE(0x4AB0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // TST OPCODE(0x4AB8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // TST OPCODE(0x4AB9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif +} + +#ifdef OPCODES_M68020 +// TST.L (d16,PC) - 68020+ +OPCODE(0x4ABA) +{ + u32 adr, res; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_LONG_F(adr, res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 24; + RET(7) +} + +// TST.L - (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x4ABB) +{ + u32 adr, res; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 24; + RET(9) +} + +// TST.L #.L - 68020+ +OPCODE(0x4ABC) +{ + u32 res; + + FETCH_LONG(res) + flag_C = 0; + flag_V = 0; + flag_NotZ = res; + flag_N = res >> 24; + RET(6) } +#endif // TST OPCODE(0x4A9F) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // TST OPCODE(0x4AA7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // TAS OPCODE(0x4AC0) { - u32 adr, res; - u32 src, dst; - - res = DREGu8((Opcode >> 0) & 7); + u32 res; + + res = DREGu8((Opcode /*>> 0*/) & 7); flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; res |= 0x80; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(4) +#endif } // TAS OPCODE(0x4AD0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(14) +#endif } // TAS OPCODE(0x4AD8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(14) +#endif } // TAS OPCODE(0x4AE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(14) +#endif } // TAS OPCODE(0x4AE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(14) +#endif } // TAS OPCODE(0x4AF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(18) +#endif } // TAS OPCODE(0x4AF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(14) +#endif } // TAS OPCODE(0x4AF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(16) +#endif } // TAS OPCODE(0x4ADF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(14) +#endif } // TAS OPCODE(0x4AE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(14) +#endif } // ILLEGAL OPCODE(0x4AFC) { - u32 res; - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_ILLEGAL_INSTRUCTION_EX); -RET(4) + u32 oldPC=GET_PC; + SET_PC(oldPC-2) + execute_exception(M68K_ILLEGAL_INSTRUCTION_EX); +#ifdef OPCODES_M68000 + RET(4) +#else + RET(20) +#endif } // ILLEGAL A000-AFFF OPCODE(0xA000) { - u32 res; - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_1010_EX); -RET(4) + u32 oldPC=GET_PC; + SET_PC(oldPC-2) + execute_exception(M68K_1010_EX); +#ifdef OPCODES_M68000 + RET(4) +#else + RET(20) +#endif } // ILLEGAL F000-FFFF OPCODE(0xF000) { - u32 res; - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_1111_EX); -RET(4) + u32 oldPC=GET_PC; + SET_PC(oldPC-2) + execute_exception(M68K_1111_EX); +#ifdef OPCODES_M68000 + RET(4) +#else + RET(20) +#endif +} + +#ifdef OPCODES_M68020 +// MULS/MULU.L Dn - Long Format, 68020+ +OPCODE(0x4C00) +{ + u32 res; + u32 src; + + FETCH_WORD(res) + src = DREGu32((Opcode /*>> 0*/) & 7); + + MULL(src, res); + + RET(45) +} + +// MULS/MULU.L (An) - Long Format, 68020+ +OPCODE(0x4C10) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + MULL(src, res); + + RET(47) +} + +// MULS/MULU.L (An)+ - Long Format, 68020+ +OPCODE(0x4C18) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; + READ_LONG_F(adr, src) + MULL(src, res); + + RET(49) +} + +// MULS/MULU.L -(An) - Long Format, 68020+ +OPCODE(0x4C20) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + AREG((Opcode /*>> 0*/) & 7) -= 4; + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + MULL(src, res); + + RET(48) +} + +// MULS/MULU.L (d16,An) - Long Format, 68020+ +OPCODE(0x4C28) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + MULL(src, res); + + RET(54) +} + +// MULS/MULU.L (d8,An,Xn) / (bd,An,Xn)... - Long Format, 68020+ +OPCODE(0x4C30) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, src) + MULL(src, res); + + RET(52) +} + +// MULS/MULU.L (xx).W - Long Format, 68020+ +OPCODE(0x4C38) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_SWORD(adr) + READ_LONG_F(adr, src) + MULL(src, res); + + RET(48) +} + +// MULS/MULU.L (xx).L - Long Format, 68020+ +OPCODE(0x4C39) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_LONG(adr) + READ_LONG_F(adr, src) + MULL(src, res); + + RET(49) +} + +// MULS/MULU.L (d16,PC) - Long Format, 68020+ +OPCODE(0x4C3A) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_LONG_F(adr, src) + MULL(src, res); + + RET(54) +} + +// MULS/MULU.L (d8,PC,Xn) / (bd,PC,Xn)... - Long Format, 68020+ +OPCODE(0x4C3B) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, src) + MULL(src, res); + + RET(52) +} + +// MULS/MULU.L .W, .L - Long Format, 68020+ +OPCODE(0x4C3C) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_LONG(src) + MULL(src, res); + + RET(49) +} + +// DIVSL/DIVUL.L Dn - Long Format, 68020+ +OPCODE(0x4C40) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res); + src = DREGu32((Opcode /*>> 0*/) & 7); + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 2) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(80 + res) +} + +// DIVSL/DIVUL.L (An) - Long Format, 68020+ +OPCODE(0x4C50) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 4) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(82 + res) +} + +// DIVSL/DIVUL.L (An)+ - Long Format, 68020+ +OPCODE(0x4C58) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 6) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(84 + res) +} + +// DIVSL/DIVUL.L -(An) - Long Format, 68020+ +OPCODE(0x4C60) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + AREG((Opcode /*>> 0*/) & 7) -= 4; + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 5) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(83 + res) +} + +// DIVSL/DIVUL.L (d16,An) - Long Format, 68020+ +OPCODE(0x4C68) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 11) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(89 + res) +} + +// DIVSL/DIVUL.L (d8,An,Xn) / (bd,An,Xn)... - Long Format, 68020+ +OPCODE(0x4C70) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 9) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(87 + res) +} + +// DIVSL/DIVUL.L (xx).W - Long Format, 68020+ +OPCODE(0x4C78) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_SWORD(adr) + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 5) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(83 + res) +} + +// DIVSL/DIVUL.L (xx).L - Long Format, 68020+ +OPCODE(0x4C79) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_LONG(adr) + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 6) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(84 + res) +} + +// DIVSL/DIVUL.L (d16,PC) - Long Format, 68020+ +OPCODE(0x4C7A) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 11) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(89 + res) +} + +// DIVSL/DIVUL.L (d8,PC,Xn) / (bd,PC,Xn)... - Long Format, 68020+ +OPCODE(0x4C7B) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 9) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(87 + res) +} + +// DIVSL/DIVUL.L .W / .L - Long Format, 68020+ +OPCODE(0x4C7C) +{ + u32 adr, res; + u32 src; + + FETCH_WORD(res) + FETCH_LONG(src) + if (src == 0) + { + execute_exception(M68K_ZERO_DIVIDE_EX); + RET(3 + 6) // Cycles for fetch of operants + } + + res = DIVL(src, res); + + RET(84 + res) } +#endif // MOVEMaR OPCODE(0x4C90) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18504,12 +20694,11 @@ OPCODE(0x4C90) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(12) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(12) #else -RET(16) + RET(10) #endif } @@ -18517,15 +20706,14 @@ RET(16) OPCODE(0x4C98) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18535,26 +20723,28 @@ OPCODE(0x4C98) } psrc++; } while (res >>= 1); - AREG((Opcode >> 0) & 7) = adr; - POST_IO - io_cycle_counter -= (adr - dst) * 2; -RET(12) + AREG((Opcode /*>> 0*/) & 7) = adr; + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(12) +#else + RET(12) +#endif } // MOVEMaR OPCODE(0x4CA8) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18564,12 +20754,11 @@ OPCODE(0x4CA8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(16) #else -RET(24) + RET(18) #endif } @@ -18577,16 +20766,15 @@ RET(24) OPCODE(0x4CB0) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18596,12 +20784,11 @@ OPCODE(0x4CB0) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(18) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(18) #else -RET(28) + RET(14) #endif } @@ -18609,15 +20796,14 @@ RET(28) OPCODE(0x4CB8) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18627,12 +20813,11 @@ OPCODE(0x4CB8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(16) #else -RET(24) + RET(12) #endif } @@ -18640,15 +20825,14 @@ RET(24) OPCODE(0x4CB9) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); FETCH_LONG(adr); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18658,12 +20842,11 @@ OPCODE(0x4CB9) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(20) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(20) #else -RET(32) + RET(12) #endif } @@ -18671,16 +20854,15 @@ RET(32) OPCODE(0x4CBA) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); - adr = GET_SWORD + ((u32)(PC) - BasePC); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18690,12 +20872,11 @@ OPCODE(0x4CBA) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(16) #else -RET(24) + RET(18) #endif } @@ -18703,16 +20884,15 @@ RET(24) OPCODE(0x4CBB) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18722,12 +20902,11 @@ OPCODE(0x4CBB) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(18) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(18) #else -RET(28) + RET(14) #endif } @@ -18735,15 +20914,14 @@ RET(28) OPCODE(0x4C9F) { u32 adr, res; - u32 src, dst; - + u32 dst; + s32 *psrc; - + FETCH_WORD(res); adr = AREG(7); psrc = &DREGs32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18754,24 +20932,26 @@ OPCODE(0x4C9F) psrc++; } while (res >>= 1); AREG(7) = adr; - POST_IO - io_cycle_counter -= (adr - dst) * 2; -RET(12) + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); +#ifdef OPCODES_M68000 + RET(12) +#else + RET(12) +#endif } // MOVEMaR OPCODE(0x4CD0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18781,12 +20961,12 @@ OPCODE(0x4CD0) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(12) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) #else -RET(20) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(12) #endif } @@ -18794,15 +20974,14 @@ RET(20) OPCODE(0x4CD8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); + adr = AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18812,26 +20991,29 @@ OPCODE(0x4CD8) } psrc++; } while (res >>= 1); - AREG((Opcode >> 0) & 7) = adr; - POST_IO - io_cycle_counter -= (adr - dst) * 2; -RET(12) + AREG((Opcode /*>> 0*/) & 7) = adr; +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) +#else + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(14) +#endif } // MOVEMaR OPCODE(0x4CE8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18841,12 +21023,12 @@ OPCODE(0x4CE8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(16) #else -RET(28) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(20) #endif } @@ -18854,16 +21036,15 @@ RET(28) OPCODE(0x4CF0) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18873,12 +21054,12 @@ OPCODE(0x4CF0) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(18) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(18) #else -RET(32) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(16) #endif } @@ -18886,15 +21067,14 @@ RET(32) OPCODE(0x4CF8) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_SWORD(adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18904,12 +21084,12 @@ OPCODE(0x4CF8) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(16) #else -RET(28) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(14) #endif } @@ -18917,15 +21097,14 @@ RET(28) OPCODE(0x4CF9) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); FETCH_LONG(adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18935,12 +21114,12 @@ OPCODE(0x4CF9) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(20) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(20) #else -RET(36) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(16) #endif } @@ -18948,16 +21127,15 @@ RET(36) OPCODE(0x4CFA) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = GET_SWORD + ((u32)(PC) - BasePC); + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18967,12 +21145,12 @@ OPCODE(0x4CFA) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(16) #else -RET(28) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(20) #endif } @@ -18980,16 +21158,15 @@ RET(28) OPCODE(0x4CFB) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -18999,12 +21176,12 @@ OPCODE(0x4CFB) } psrc++; } while (res >>= 1); - POST_IO - io_cycle_counter -= (adr - dst) * 2; -#ifdef USE_CYCLONE_TIMING -RET(18) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(18) #else -RET(32) + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(16) #endif } @@ -19012,15 +21189,14 @@ RET(32) OPCODE(0x4CDF) { u32 adr, res; - u32 src, dst; - + u32 dst; + u32 *psrc; - + FETCH_WORD(res); adr = AREG(7); psrc = &DREGu32(0); dst = adr; - PRE_IO do { if (res & 1) @@ -19031,495 +21207,1184 @@ OPCODE(0x4CDF) psrc++; } while (res >>= 1); AREG(7) = adr; - POST_IO - io_cycle_counter -= (adr - dst) * 2; -RET(12) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter -= (((adr - dst) * 2) << mainMenu_CPU_speed); + RET(12) +#else + m68kcontext.io_cycle_counter -= ((adr - dst) << mainMenu_CPU_speed); + RET(12) +#endif } // TRAP OPCODE(0x4E40) { - u32 res; execute_exception(M68K_TRAP_BASE_EX + (Opcode & 0xF)); -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(20) +#endif } // LINK OPCODE(0x4E50) { - u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); - PRE_IO + u32 res; + + res = AREGu32((Opcode /*>> 0*/) & 7); PUSH_32_F(res) res = AREG(7); - AREG((Opcode >> 0) & 7) = res; + AREG((Opcode /*>> 0*/) & 7) = res; FETCH_SWORD(res); AREG(7) += res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(5) +#endif } // LINKA7 OPCODE(0x4E57) { - u32 adr, res; - u32 src, dst; - + u32 res; + AREG(7) -= 4; - PRE_IO WRITE_LONG_DEC_F(AREG(7), AREG(7)) FETCH_SWORD(res); AREG(7) += res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(5) +#endif +} + +#ifdef OPCODES_M68020 +// LINK32 - 68020+ +OPCODE(0x4808) +{ + u32 res; + + res = AREGu32((Opcode /*>> 0*/) & 7); + PUSH_32_F(res) + res = AREG(7); + AREG((Opcode /*>> 0*/) & 7) = res; + FETCH_LONG(res); + AREG(7) += res; + RET(6) +} + +// LINK32A7 - 68020+ +OPCODE(0x480F) +{ + u32 res; + + AREG(7) -= 4; + WRITE_LONG_DEC_F(AREG(7), AREG(7)) + FETCH_LONG(res); + AREG(7) += res; + RET(6) } +#endif // ULNK OPCODE(0x4E58) { - u32 adr, res; - u32 src, dst; - - src = AREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = AREGu32((Opcode /*>> 0*/) & 7); AREG(7) = src + 4; - PRE_IO READ_LONG_F(src, res) - AREG((Opcode >> 0) & 7) = res; - POST_IO -RET(12) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ULNKA7 OPCODE(0x4E5F) { - u32 adr, res; - u32 src, dst; - - PRE_IO READ_LONG_F(AREG(7), AREG(7)) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // MOVEAUSP OPCODE(0x4E60) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!flag_S) { u32 oldPC=GET_PC; SET_PC(oldPC-2) execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } - res = AREGu32((Opcode >> 0) & 7); - ASP = res; -RET(4) + res = AREGu32((Opcode /*>> 0*/) & 7); + USP = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // MOVEUSPA OPCODE(0x4E68) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!flag_S) { u32 oldPC=GET_PC; SET_PC(oldPC-2) execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } - res = ASP; - AREG((Opcode >> 0) & 7) = res; -RET(4) + res = USP; + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // RESET OPCODE(0x4E70) { - u32 adr, res; - u32 src, dst; - if (!flag_S) { u32 oldPC=GET_PC; SET_PC(oldPC-2) execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(4) +#endif } - PRE_IO - if (m68kcontext.reset_handler) *(m68kcontext.reset_handler); -// CPU->Reset_CallBack(); - POST_IO -RET(132) +#ifdef OPCODES_M68000 + RET(132) +#else + RET(518) +#endif } // NOP OPCODE(0x4E71) { - u32 adr, res; - u32 src, dst; - -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // STOP OPCODE(0x4E72) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!flag_S) - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,4) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,8) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; FETCH_WORD(res); - res &= M68K_SR_MASK; + // res &= M68K_SR_MASK; SET_SR(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - m68kcontext.execinfo |= M68K_HALTED; - io_cycle_counter = 0; -RET(4) +#ifdef OPCODES_M68000 + UPDATE_SP_000 +#else + UPDATE_SP_020 +#endif + + m68kcontext.execinfo |= M68K_HALTED; +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 4; + RET(4) +#else + m68kcontext.io_cycle_counter = 8; + RET(8) +#endif } // RTE OPCODE(0x4E73) { - u32 adr, res; - u32 src, dst; - - if (!flag_S) - { - u32 oldPC=GET_PC; - SET_PC(oldPC-2) - execute_exception(M68K_PRIVILEGE_VIOLATION_EX); - RET(4) - } - PRE_IO - POP_16_F(res) + u32 res; + + if (!flag_S) +#ifdef OPCODES_M68000 + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,20) +#else + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,21) +#endif + +#ifdef OPCODES_M68020 + int oldM = flag_M; +#endif + int oldS = flag_S; + POP_16_F(res) SET_SR(res) POP_32_F(res) SET_PC(res) - if (!flag_S) - { - res = AREG(7); - AREG(7) = ASP; - ASP = res; - } - POST_IO - m68kcontext.execinfo &= ~(M68K_EMULATE_GROUP_0|M68K_EMULATE_TRACE|M68K_DO_TRACE); - CHECK_INT_TO_JUMP(20) -RET(20) + +#ifdef OPCODES_M68020 + POP_16_F(res) /* Exception Format */ + res &= 0xF000; + if (res == 0) {} /* most common, just skip checks below */ + else if (res == 0x2000) { AREG(7) += 4; } + else if (res == 0x7000) { AREG(7) += 52; } + else if (res == 0x8000) { AREG(7) += 50; } + else if (res == 0x9000) { AREG(7) += 12; } + else if (res == 0xa000) { AREG(7) += 24; } + else if (res == 0xb000) { AREG(7) += 84; } +#endif + +#ifdef OPCODES_M68000 + UPDATE_SP_000 + CHECK_INT_TO_JUMP(20) + RET(20) +#else + UPDATE_SP_020 + CHECK_INT_TO_JUMP(21) + RET(21) +#endif +} + +#ifdef OPCODES_M68020 +// RTD +OPCODE(0x4E74) +{ + u32 res; + u32 dst; + + POP_32_F(res) + POP_16_F(dst) + AREG(7) += (s16)dst; + CHECK_BRANCH_EXCEPTION(res,16); + SET_PC(res) + RET(10) } +#endif // RTS OPCODE(0x4E75) { - u32 adr, res; - u32 src, dst; - - PRE_IO + u32 res; + POP_32_F(res) + // CHECK_BRANCH_EXCEPTION(res,16); SET_PC(res) - CHECK_BRANCH_EXCEPTION(res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // TRAPV OPCODE(0x4E76) { - u32 res; if (flag_V & 0x80) execute_exception(M68K_TRAPV_EX); -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(25) +#endif } // RTR OPCODE(0x4E77) { - u32 adr, res; - u32 src, dst; - - PRE_IO + u32 res; + POP_16_F(res) SET_CCR(res) POP_32_F(res) + // CHECK_BRANCH_EXCEPTION(res,20); SET_PC(res) - CHECK_BRANCH_EXCEPTION(res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(14) +#endif +} + +#ifdef OPCODES_M68020 +// MOVEC Rc, Xn - 68010+, 68020 +OPCODE(0x4E7A) +{ + u32 src; + + if (!flag_S) + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,6); + + FETCH_WORD(src); + MOVEC2(src & 0x0FFF, src >> 12); + RET(6) +} + +// MOVEC Xn, Rc - 68010+, 68020 +OPCODE(0x4E7B) +{ + u32 src; + + if (!flag_S) + EXECUTE_EXCEPTION(M68K_PRIVILEGE_VIOLATION_EX,12); + + FETCH_WORD(src); + MOVE2C(src & 0x0FFF, src >> 12); + RET(12) } +#endif // JSR OPCODE(0x4E90) { - u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,16); +#else + CHECK_BRANCH_EXCEPTION(adr,7); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // JSR OPCODE(0x4EA8) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,18); +#else + CHECK_BRANCH_EXCEPTION(adr,9); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO - PUSH_32_F(oldPC) + + oldPC = (uintptr_t)(PC) - BasePC; + PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // JSR OPCODE(0x4EB0) { - u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,22); +#else + CHECK_BRANCH_EXCEPTION(adr,11); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(11) +#endif } // JSR OPCODE(0x4EB8) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_SWORD(adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,18); +#else + CHECK_BRANCH_EXCEPTION(adr,7); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // JSR OPCODE(0x4EB9) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_LONG(adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,20); +#else + CHECK_BRANCH_EXCEPTION(adr,7); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(7) +#endif } // JSR OPCODE(0x4EBA) { - u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 adr; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,18); +#else + CHECK_BRANCH_EXCEPTION(adr,9); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // JSR OPCODE(0x4EBB) { - u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD + u32 adr; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,22); +#else + CHECK_BRANCH_EXCEPTION(adr,11); +#endif { u32 oldPC; - - oldPC = (u32)(PC) - BasePC; - PRE_IO + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) } SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(11) +#endif } // JMP OPCODE(0x4ED0) { - u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,8); +#else + CHECK_BRANCH_EXCEPTION(adr,6); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // JMP OPCODE(0x4EE8) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,10); +#else + CHECK_BRANCH_EXCEPTION(adr,8); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(8) +#endif } // JMP OPCODE(0x4EF0) { - u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + u32 adr; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,14); +#else + CHECK_BRANCH_EXCEPTION(adr,10); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // JMP OPCODE(0x4EF8) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_SWORD(adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,10); +#else + CHECK_BRANCH_EXCEPTION(adr,6); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } // JMP OPCODE(0x4EF9) { - u32 adr, res; - u32 src, dst; - + u32 adr; + FETCH_LONG(adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,12); +#else + CHECK_BRANCH_EXCEPTION(adr,6); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // JMP OPCODE(0x4EFA) { - u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 adr; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,10); +#else + CHECK_BRANCH_EXCEPTION(adr,8); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(8) +#endif } // JMP OPCODE(0x4EFB) { - u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD + u32 adr; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(adr,14); +#else + CHECK_BRANCH_EXCEPTION(adr,10); +#endif SET_PC(adr) - CHECK_BRANCH_EXCEPTION(adr) -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif +} + +#ifdef OPCODES_M68020 +// CHK.L Dn - 68020+ +OPCODE(0x4100) +{ + s32 src, dst; + + src = DREGs32((Opcode /*>> 0*/) & 7); + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(8) +} + +// CHK.L (An) - 68020+ +OPCODE(0x4110) +{ + u32 adr; + s32 src, dst; + + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(12) +} + +// CHK.L (An)+ - 68020+ +OPCODE(0x4118) +{ + u32 adr; + s32 src, dst; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(12) +} + +// CHK.L -(An) - 68020+ +OPCODE(0x4120) +{ + u32 adr; + s32 src, dst; + + AREG((Opcode /*>> 0*/) & 7) -= 4; + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(13) +} + +// CHK.L (d16,An) - 68020+ +OPCODE(0x4128) +{ + u32 adr; + s32 src, dst; + + FETCH_SWORD(adr); + adr += AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(13) +} + +// CHK.L (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x4130) +{ + u32 adr; + s32 src, dst; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(15) +} + +// CHK.L (xx).W - 68020+ +OPCODE(0x4138) +{ + u32 adr; + s32 src, dst; + + FETCH_SWORD(adr); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(12) +} + +// CHK.L (xx).L - 68020+ +OPCODE(0x4139) +{ + u32 adr; + s32 src, dst; + + FETCH_LONG(adr); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(12) +} + +// CHK.L (d16,PC) - 68020+ +OPCODE(0x413A) +{ + u32 adr; + s32 src, dst; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(13) +} + +// CHK.L (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x413B) +{ + u32 adr; + s32 src, dst; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, src) + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(15) +} + +// CHK.L .L - 68020+ +OPCODE(0x413C) +{ + u32 adr; + s32 src, dst; + + FETCH_LONG(src); + dst = DREGs32((Opcode >> 9) & 7); + if ((dst < 0) || (dst > src)) + { + flag_N = dst >> 24; + execute_exception(M68K_CHK_EX); + } + RET(12) } +// CMP2/CHK2.B (An) - 68020+ +OPCODE(0x00D0) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + + CMP2_CHK2_EXECUTE(s8, 1) + RET(22) +} + +// CMP2/CHK2.B (d16,An) - 68020+ +OPCODE(0x00E8) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_SWORD(adr); + adr += AREG((Opcode /*>> 0*/) & 7); + + CMP2_CHK2_EXECUTE(s8, 2) + RET(33) +} + +// CMP2/CHK2.B (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x00F0) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + + CMP2_CHK2_EXECUTE(s8, 1) + RET(27) +} + +// CMP2/CHK2.B (xx).W - 68020+ +OPCODE(0x00F8) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_SWORD(adr) + + CMP2_CHK2_EXECUTE(s8, 2) + RET(23) +} + +// CMP2/CHK2.B (xx).L - 68020+ +OPCODE(0x00F9) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_LONG(adr) + + CMP2_CHK2_EXECUTE(s8, 3) + RET(24) +} + +// CMP2/CHK2.B (d16,PC) - 68020+ +OPCODE(0x00FA) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + + CMP2_CHK2_EXECUTE(s8, 2) + RET(29) +} + +// CMP2/CHK2.B (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x00FB) +{ + u32 adr, res; + u32 src1, src2, dst; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + + CMP2_CHK2_EXECUTE(s8, 1) + RET(27) +} + +// CMP2/CHK2.W (An) - 68020+ +OPCODE(0x02D0) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + + CMP2_CHK2_EXECUTE(s16, 1) + RET(22) +} + +// CMP2/CHK2.W (d16,An) - 68020+ +OPCODE(0x02E8) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_SWORD(adr); + adr += AREG((Opcode /*>> 0*/) & 7); + + CMP2_CHK2_EXECUTE(s16, 2) + RET(29) +} + +// CMP2/CHK2.W (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x02F0) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + + CMP2_CHK2_EXECUTE(s16, 1) + RET(27) +} + +// CMP2/CHK2.W (xx).W - 68020+ +OPCODE(0x02F8) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_SWORD(adr) + + CMP2_CHK2_EXECUTE(s16, 2) + RET(23) +} + +// CMP2/CHK2.W (xx).L - 68020+ +OPCODE(0x02F9) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_LONG(adr) + + CMP2_CHK2_EXECUTE(s16, 3) + RET(24) +} + +// CMP2/CHK2.W (d16,PC) - 68020+ +OPCODE(0x02FA) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + + CMP2_CHK2_EXECUTE(s16, 2) + RET(29) +} + +// CMP2/CHK2.W (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x02FB) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + + CMP2_CHK2_EXECUTE(s16, 1) + RET(27) +} + +// CMP2/CHK2.L (An) - 68020+ +OPCODE(0x04D0) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + + CMP2_CHK2_EXECUTE(s32, 1) + RET(22) +} + +// CMP2/CHK2.L (d16,An) - 68020+ +OPCODE(0x04E8) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + + CMP2_CHK2_EXECUTE(s32, 2) + RET(29) +} + +// CMP2/CHK2.L (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x04F0) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + + CMP2_CHK2_EXECUTE(s32, 1) + RET(27) +} + +// CMP2/CHK2.L (xx).W - 68020+ +OPCODE(0x04F8) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_SWORD(adr); + + CMP2_CHK2_EXECUTE(s32, 2) + RET(23) +} + +// CMP2/CHK2.L (xx).L - 68020+ +OPCODE(0x04F9) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + FETCH_LONG(adr); + + CMP2_CHK2_EXECUTE(s32, 3) + RET(24) +} + +// CMP2/CHK2.L (d16,PC) - 68020+ +OPCODE(0x04FA) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + + CMP2_CHK2_EXECUTE(s32, 2) + RET(29) +} + +// CMP2/CHK2.L (d8,PC,Xn) / (bd,PC,Xn)... - 68020+ +OPCODE(0x04FB) +{ + u32 adr, res; + s32 src1, src2, dst; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + + CMP2_CHK2_EXECUTE(s32, 1) + RET(27) +} +#endif + // CHK OPCODE(0x4180) { - u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) { flag_N = res >> 8; execute_exception(M68K_CHK_EX); } -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(8) +#endif } // CHK OPCODE(0x4190) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19527,19 +22392,21 @@ OPCODE(0x4190) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif } // CHK OPCODE(0x4198) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19547,19 +22414,21 @@ OPCODE(0x4198) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif } // CHK OPCODE(0x41A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19567,19 +22436,21 @@ OPCODE(0x41A0) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // CHK OPCODE(0x41A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19587,19 +22458,21 @@ OPCODE(0x41A8) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(13) +#endif } // CHK OPCODE(0x41B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19607,18 +22480,20 @@ OPCODE(0x41B0) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // CHK OPCODE(0x41B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19626,18 +22501,20 @@ OPCODE(0x41B8) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // CHK OPCODE(0x41B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19645,19 +22522,21 @@ OPCODE(0x41B9) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(12) +#endif } // CHK OPCODE(0x41BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19665,19 +22544,21 @@ OPCODE(0x41BA) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(13) +#endif } // CHK OPCODE(0x41BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19685,16 +22566,19 @@ OPCODE(0x41BB) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(15) +#endif } // CHK OPCODE(0x41BC) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19702,19 +22586,21 @@ OPCODE(0x41BC) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // CHK OPCODE(0x419F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19722,19 +22608,21 @@ OPCODE(0x419F) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif } // CHK OPCODE(0x41A7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); if (((s32)res < 0) || (res > src)) @@ -19742,3959 +22630,4738 @@ OPCODE(0x41A7) flag_N = res >> 8; execute_exception(M68K_CHK_EX); } - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(13) +#endif } // LEA OPCODE(0x41D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); res = adr; AREG((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // LEA OPCODE(0x41E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); res = adr; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // LEA OPCODE(0x41F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); res = adr; AREG((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // LEA OPCODE(0x41F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); res = adr; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // LEA OPCODE(0x41F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); res = adr; AREG((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // LEA OPCODE(0x41FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; res = adr; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // LEA OPCODE(0x41FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); res = adr; AREG((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif +} + +#ifdef OPCODES_M68020 +// TRAPcc .W - 68020+ +OPCODE(0x50FA) +{ + u32 res; + + TRAPCC_EXECUTE(Opcode); + FETCH_WORD(res) + RET(25) +} + +// TRAPcc .L - 68020+ +OPCODE(0x50FB) +{ + u32 res; + + TRAPCC_EXECUTE(Opcode); + FETCH_LONG(res) + RET(25) +} + +// TRAPcc - 68020+ +OPCODE(0x50FC) +{ + TRAPCC_EXECUTE(Opcode); + RET(25) } +#endif // STCC OPCODE(0x50C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(6) +#else + RET(4) +#endif } // STCC OPCODE(0x51C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(4) +#else + RET(4) +#endif } // STCC OPCODE(0x52C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x53C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x54C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!(flag_C & 0x100)) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x55C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (flag_C & 0x100) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(4) +#else + RET(4) +#endif } // STCC OPCODE(0x56C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (flag_NotZ) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x57C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!flag_NotZ) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x58C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!(flag_V & 0x80)) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x59C0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (flag_V & 0x80) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(4) +#else + RET(4) +#endif } // STCC OPCODE(0x5AC0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!(flag_N & 0x80)) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x5BC0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (flag_N & 0x80) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x5CC0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else RET(4) +#endif } // STCC OPCODE(0x5DC0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(4) +#else + RET(4) +#endif } // STCC OPCODE(0x5EC0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(4) -} +#else + RET(4) +#endif +} // STCC OPCODE(0x5FC0) { - u32 adr, res; - u32 src, dst; - + u32 res; + if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + res = 0xFF; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 RET(4) +#else + RET(4) +#endif } // STCC OPCODE(0x50D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x51D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x52D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x53D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x54D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x55D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x56D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x57D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x58D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x59D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5AD0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5BD0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5CD0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5DD0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5ED0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5FD0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); + + adr = AREG((Opcode /*>> 0*/) & 7); if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x50D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x51D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x52D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x53D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x54D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x55D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x56D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x57D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x58D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x59D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5AD8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5BD8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5CD8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5DD8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5ED8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5FD8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x50E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x51E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x52E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x53E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x54E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x55E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x56E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x57E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x58E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x59E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5AE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5BE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5CE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5DE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5EE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5FE0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x50E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x51E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x52E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x53E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x54E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x55E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x56E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x57E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x58E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x59E8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5AE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5BE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) - } + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif + } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5CE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5DE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5EE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5FE8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); + adr += AREG((Opcode /*>> 0*/) & 7); if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x50F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x51F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x52F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x53F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x54F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x55F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x56F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x57F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x58F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x59F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x5AF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x5BF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x5CF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x5DF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x5EF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x5FF0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(18) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(18) +#else + RET(10) +#endif } // STCC OPCODE(0x50F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x51F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x52F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x53F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x54F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x55F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x56F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x57F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x58F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x59F8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5AF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5BF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5CF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5DF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5EF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x5FF8) { u32 adr, res; - u32 src, dst; - + FETCH_SWORD(adr); if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(16) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(16) +#else + RET(8) +#endif } // STCC OPCODE(0x50F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x51F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x52F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x53F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x54F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x55F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x56F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x57F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x58F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x59F9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x5AF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x5BF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x5CF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x5DF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x5EF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x5FF9) { u32 adr, res; - u32 src, dst; - + FETCH_LONG(adr); if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(20) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(20) +#else + RET(10) +#endif } // STCC OPCODE(0x50DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x51DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x52DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x53DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x54DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x55DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x56DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x57DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x58DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x59DF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5ADF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5BDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5CDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5DDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5EDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x5FDF) { u32 adr, res; - u32 src, dst; - + adr = AREG(7); AREG(7) += 2; if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(12) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(12) +#else + RET(8) +#endif } // STCC OPCODE(0x50E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; res = 0xFF; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x51E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x52E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (flag_NotZ && (!(flag_C & 0x100))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x53E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if ((!flag_NotZ) || (flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x54E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (!(flag_C & 0x100)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x55E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (flag_C & 0x100) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x56E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x57E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (!flag_NotZ) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x58E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (!(flag_V & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x59E7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (flag_V & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5AE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (!(flag_N & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5BE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (flag_N & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5CE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (!((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5DE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if ((flag_N ^ flag_V) & 0x80) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5EE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // STCC OPCODE(0x5FE7) { u32 adr, res; - u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { - res = 0xFF; - PRE_IO - WRITE_BYTE_F(adr, res) - POST_IO - RET(14) + res = 0xFF; + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } res = 0; - PRE_IO WRITE_BYTE_F(adr, res) - POST_IO +#ifdef OPCODES_M68000 RET(14) +#else + RET(8) +#endif } // DBCC OPCODE(0x50C8) { - u32 adr, res; - u32 src, dst; - PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // DBCC OPCODE(0x51C8) { - u32 adr, res; - u32 src, dst; - - res = DREGu16((Opcode >> 0) & 7); + u32 res; + + res = DREGu16((Opcode /*>> 0*/) & 7); res--; - DREGu16((Opcode >> 0) & 7) = res; + DREGu16((Opcode /*>> 0*/) & 7) = res; if ((s32)res != -1) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // DBCC OPCODE(0x52C8) { - u32 adr, res; - u32 src, dst; - + u32 res; + if ((!flag_NotZ) || (flag_C & 0x100)) { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) - } + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } } else { - PC++; - RET(12) + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } PC++; -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // DBCC OPCODE(0x53C8) { - u32 adr, res; - u32 src, dst; - - if (flag_NotZ && (!(flag_C & 0x100))) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (flag_NotZ && (!(flag_C & 0x100))) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x54C8) { - u32 adr, res; - u32 src, dst; - - if (flag_C & 0x100) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (flag_C & 0x100) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x55C8) { - u32 adr, res; - u32 src, dst; - - if (!(flag_C & 0x100)) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (!(flag_C & 0x100)) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x56C8) { - u32 adr, res; - u32 src, dst; - - if (!flag_NotZ) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (!flag_NotZ) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x57C8) { - u32 adr, res; - u32 src, dst; - - if (flag_NotZ) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; + u32 res; + + if (flag_NotZ) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 RET(14) +#else + RET(10) +#endif } // DBCC OPCODE(0x58C8) { - u32 adr, res; - u32 src, dst; - - if (flag_V & 0x80) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (flag_V & 0x80) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x59C8) { - u32 adr, res; - u32 src, dst; - - if (!(flag_V & 0x80)) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (!(flag_V & 0x80)) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x5AC8) { - u32 adr, res; - u32 src, dst; - - if (flag_N & 0x80) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (flag_N & 0x80) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x5BC8) { - u32 adr, res; - u32 src, dst; - - if (!(flag_N & 0x80)) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (!(flag_N & 0x80)) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x5CC8) { - u32 adr, res; - u32 src, dst; - - if ((flag_N ^ flag_V) & 0x80) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if ((flag_N ^ flag_V) & 0x80) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x5DC8) { - u32 adr, res; - u32 src, dst; - - if (!((flag_N ^ flag_V) & 0x80)) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (!((flag_N ^ flag_V) & 0x80)) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x5EC8) { - u32 adr, res; - u32 src, dst; - - if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // DBCC OPCODE(0x5FC8) { - u32 adr, res; - u32 src, dst; - - if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) - { - res = DREGu16((Opcode >> 0) & 7); - res--; - DREGu16((Opcode >> 0) & 7) = res; - if ((s32)res != -1) - { - u32 newPC; - - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) + u32 res; + + if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) + { + res = DREGu16((Opcode /*>> 0*/) & 7); + res--; + DREGu16((Opcode /*>> 0*/) & 7) = res; + if ((s32)res != -1) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif + } + } + else + { + PC++; +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif + } + PC++; +#ifdef OPCODES_M68000 + RET(14) +#else RET(10) - } - } - else - { - PC++; - RET(12) - } - PC++; -RET(14) +#endif } // ADDQ OPCODE(0x5000) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = DREGu8((Opcode >> 0) & 7); + dst = DREGu8((Opcode /*>> 0*/) & 7); res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDQ @@ -23702,18 +27369,20 @@ OPCODE(0x5010) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDQ @@ -23721,19 +27390,21 @@ OPCODE(0x5018) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDQ @@ -23741,19 +27412,21 @@ OPCODE(0x5020) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDQ @@ -23761,19 +27434,21 @@ OPCODE(0x5028) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ADDQ @@ -23781,19 +27456,21 @@ OPCODE(0x5030) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ADDQ @@ -23801,18 +27478,20 @@ OPCODE(0x5038) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ADDQ @@ -23820,18 +27499,20 @@ OPCODE(0x5039) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDQ @@ -23839,19 +27520,21 @@ OPCODE(0x501F) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDQ @@ -23859,51 +27542,57 @@ OPCODE(0x5027) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDQ OPCODE(0x5040) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = DREGu16((Opcode >> 0) & 7); + dst = DREGu16((Opcode /*>> 0*/) & 7); res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDQ OPCODE(0x5048) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = AREGu32((Opcode >> 0) & 7); + dst = AREGu32((Opcode /*>> 0*/) & 7); res = dst + src; - AREG((Opcode >> 0) & 7) = res; -#ifdef USE_CYCLONE_TIMING_ // breaks Project-X -RET(4) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) #else -RET(8) + RET(4) #endif } @@ -23912,18 +27601,20 @@ OPCODE(0x5050) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDQ @@ -23931,19 +27622,21 @@ OPCODE(0x5058) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDQ @@ -23951,19 +27644,21 @@ OPCODE(0x5060) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDQ @@ -23971,19 +27666,21 @@ OPCODE(0x5068) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ADDQ @@ -23991,19 +27688,21 @@ OPCODE(0x5070) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ADDQ @@ -24011,18 +27710,20 @@ OPCODE(0x5078) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ADDQ @@ -24030,18 +27731,20 @@ OPCODE(0x5079) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDQ @@ -24049,19 +27752,21 @@ OPCODE(0x505F) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDQ @@ -24069,49 +27774,59 @@ OPCODE(0x5067) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDQ OPCODE(0x5080) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = DREGu32((Opcode >> 0) & 7); + dst = DREGu32((Opcode /*>> 0*/) & 7); res = dst + src; flag_NotZ = res; flag_X = flag_C = ((src & dst & 1) + (src >> 1) + (dst >> 1)) >> 23; flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ADDQ OPCODE(0x5088) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = AREGu32((Opcode >> 0) & 7); + dst = AREGu32((Opcode /*>> 0*/) & 7); res = dst + src; - AREG((Opcode >> 0) & 7) = res; -RET(8) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ADDQ @@ -24119,10 +27834,9 @@ OPCODE(0x5090) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24130,8 +27844,11 @@ OPCODE(0x5090) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDQ @@ -24139,11 +27856,10 @@ OPCODE(0x5098) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24151,8 +27867,11 @@ OPCODE(0x5098) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDQ @@ -24160,11 +27879,10 @@ OPCODE(0x50A0) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24172,8 +27890,11 @@ OPCODE(0x50A0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // ADDQ @@ -24181,11 +27902,10 @@ OPCODE(0x50A8) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24193,8 +27913,11 @@ OPCODE(0x50A8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // ADDQ @@ -24202,11 +27925,10 @@ OPCODE(0x50B0) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24214,8 +27936,11 @@ OPCODE(0x50B0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // ADDQ @@ -24223,10 +27948,9 @@ OPCODE(0x50B8) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24234,8 +27958,11 @@ OPCODE(0x50B8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // ADDQ @@ -24243,10 +27970,9 @@ OPCODE(0x50B9) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24254,8 +27980,11 @@ OPCODE(0x50B9) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ADDQ @@ -24263,11 +27992,10 @@ OPCODE(0x509F) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24275,8 +28003,11 @@ OPCODE(0x509F) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDQ @@ -24284,11 +28015,10 @@ OPCODE(0x50A7) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -24296,24 +28026,31 @@ OPCODE(0x50A7) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // SUBQ OPCODE(0x5100) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = DREGu8((Opcode >> 0) & 7); + dst = DREGu8((Opcode /*>> 0*/) & 7); res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBQ @@ -24321,18 +28058,20 @@ OPCODE(0x5110) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBQ @@ -24340,19 +28079,21 @@ OPCODE(0x5118) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBQ @@ -24360,19 +28101,21 @@ OPCODE(0x5120) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBQ @@ -24380,19 +28123,21 @@ OPCODE(0x5128) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // SUBQ @@ -24400,19 +28145,21 @@ OPCODE(0x5130) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // SUBQ @@ -24420,18 +28167,20 @@ OPCODE(0x5138) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // SUBQ @@ -24439,18 +28188,20 @@ OPCODE(0x5139) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBQ @@ -24458,19 +28209,21 @@ OPCODE(0x511F) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBQ @@ -24478,48 +28231,58 @@ OPCODE(0x5127) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBQ OPCODE(0x5140) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = DREGu16((Opcode >> 0) & 7); + dst = DREGu16((Opcode /*>> 0*/) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBQ OPCODE(0x5148) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = AREGu32((Opcode >> 0) & 7); + dst = AREGu32((Opcode /*>> 0*/) & 7); res = dst - src; - AREG((Opcode >> 0) & 7) = res; -RET(8) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // SUBQ @@ -24527,18 +28290,20 @@ OPCODE(0x5150) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBQ @@ -24546,19 +28311,21 @@ OPCODE(0x5158) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBQ @@ -24566,19 +28333,21 @@ OPCODE(0x5160) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBQ @@ -24586,19 +28355,21 @@ OPCODE(0x5168) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // SUBQ @@ -24606,19 +28377,21 @@ OPCODE(0x5170) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // SUBQ @@ -24626,18 +28399,20 @@ OPCODE(0x5178) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // SUBQ @@ -24645,18 +28420,20 @@ OPCODE(0x5179) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBQ @@ -24664,19 +28441,21 @@ OPCODE(0x515F) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBQ @@ -24684,49 +28463,59 @@ OPCODE(0x5167) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBQ OPCODE(0x5180) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = DREGu32((Opcode >> 0) & 7); + dst = DREGu32((Opcode /*>> 0*/) & 7); res = dst - src; flag_NotZ = res; flag_X = flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // SUBQ OPCODE(0x5188) { - u32 adr, res; + u32 res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - dst = AREGu32((Opcode >> 0) & 7); + dst = AREGu32((Opcode /*>> 0*/) & 7); res = dst - src; - AREG((Opcode >> 0) & 7) = res; -RET(8) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // SUBQ @@ -24734,10 +28523,9 @@ OPCODE(0x5190) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24745,8 +28533,11 @@ OPCODE(0x5190) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBQ @@ -24754,11 +28545,10 @@ OPCODE(0x5198) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24766,8 +28556,11 @@ OPCODE(0x5198) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBQ @@ -24775,11 +28568,10 @@ OPCODE(0x51A0) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24787,8 +28579,11 @@ OPCODE(0x51A0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // SUBQ @@ -24796,11 +28591,10 @@ OPCODE(0x51A8) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24808,8 +28602,11 @@ OPCODE(0x51A8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // SUBQ @@ -24817,11 +28614,10 @@ OPCODE(0x51B0) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24829,8 +28625,11 @@ OPCODE(0x51B0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // SUBQ @@ -24838,10 +28637,9 @@ OPCODE(0x51B8) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24849,8 +28647,11 @@ OPCODE(0x51B8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // SUBQ @@ -24858,10 +28659,9 @@ OPCODE(0x51B9) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24869,8 +28669,11 @@ OPCODE(0x51B9) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // SUBQ @@ -24878,11 +28681,10 @@ OPCODE(0x519F) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24890,8 +28692,11 @@ OPCODE(0x519F) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBQ @@ -24899,11 +28704,10 @@ OPCODE(0x51A7) { u32 adr, res; u32 src, dst; - + src = (((Opcode >> 9) - 1) & 7) + 1; adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -24911,584 +28715,1062 @@ OPCODE(0x51A7) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // BCC OPCODE(0x6201) { - u32 adr, res; - u32 src, dst; - if (flag_NotZ && (!(flag_C & 0x100))) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6301) { - u32 adr, res; - u32 src, dst; - if ((!flag_NotZ) || (flag_C & 0x100)) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6401) { - u32 adr, res; - u32 src, dst; - if (!(flag_C & 0x100)) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6501) { - u32 adr, res; - u32 src, dst; - if (flag_C & 0x100) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6601) { - u32 adr, res; - u32 src, dst; - if (flag_NotZ) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6701) { - u32 adr, res; - u32 src, dst; - if (!flag_NotZ) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6801) { - u32 adr, res; - u32 src, dst; - if (!(flag_V & 0x80)) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6901) { - u32 adr, res; - u32 src, dst; - if (flag_V & 0x80) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6A01) { - u32 adr, res; - u32 src, dst; - if (!(flag_N & 0x80)) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6B01) { - u32 adr, res; - u32 src, dst; - if (flag_N & 0x80) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6C01) { - u32 adr, res; - u32 src, dst; - if (!((flag_N ^ flag_V) & 0x80)) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6D01) { - u32 adr, res; - u32 src, dst; - if ((flag_N ^ flag_V) & 0x80) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6E01) { - u32 adr, res; - u32 src, dst; - if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC OPCODE(0x6F01) { - u32 adr, res; - u32 src, dst; - if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { PC += ((s8)(Opcode & 0xFE)) >> 1; - io_cycle_counter -= 2; +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // BCC16 OPCODE(0x6200) { - u32 adr, res; - u32 src, dst; - if (flag_NotZ && (!(flag_C & 0x100))) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6300) { - u32 adr, res; - u32 src, dst; - if ((!flag_NotZ) || (flag_C & 0x100)) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6400) { - u32 adr, res; - u32 src, dst; - if (!(flag_C & 0x100)) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6500) { - u32 adr, res; - u32 src, dst; - if (flag_C & 0x100) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6600) { - u32 adr, res; - u32 src, dst; - if (flag_NotZ) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6700) { - u32 adr, res; - u32 src, dst; - if (!flag_NotZ) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6800) { - u32 adr, res; - u32 src, dst; - if (!(flag_V & 0x80)) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6900) { - u32 adr, res; - u32 src, dst; - if (flag_V & 0x80) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6A00) { - u32 adr, res; - u32 src, dst; - if (!(flag_N & 0x80)) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6B00) { - u32 adr, res; - u32 src, dst; - if (flag_N & 0x80) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6C00) { - u32 adr, res; - u32 src, dst; - if (!((flag_N ^ flag_V) & 0x80)) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6D00) { - u32 adr, res; - u32 src, dst; - if ((flag_N ^ flag_V) & 0x80) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6E00) { - u32 adr, res; - u32 src, dst; - if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // BCC16 OPCODE(0x6F00) { - u32 adr, res; - u32 src, dst; - if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) { u32 newPC; - - newPC = (u32)(PC) - BasePC; + + newPC = (uintptr_t)(PC) - BasePC; newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } PC++; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif +} + +#ifdef OPCODES_M68020 +// BCC32 - 68020+ +OPCODE(0x62FF) +{ + if (flag_NotZ && (!(flag_C & 0x100))) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x63FF) +{ + if ((!flag_NotZ) || (flag_C & 0x100)) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x64FF) +{ + if (!(flag_C & 0x100)) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x65FF) +{ + if (flag_C & 0x100) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x66FF) +{ + if (flag_NotZ) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x67FF) +{ + if (!flag_NotZ) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x68FF) +{ + if (!(flag_V & 0x80)) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x69FF) +{ + if (flag_V & 0x80) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x6AFF) +{ + if (!(flag_N & 0x80)) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x6BFF) +{ + if (flag_N & 0x80) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x6CFF) +{ + if (!((flag_N ^ flag_V) & 0x80)) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x6DFF) +{ + if ((flag_N ^ flag_V) & 0x80) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x6EFF) +{ + if (flag_NotZ && (!((flag_N ^ flag_V) & 0x80))) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) +} + +// BCC32 - 68020+ +OPCODE(0x6FFF) +{ + if ((!flag_NotZ) || ((flag_N ^ flag_V) & 0x80)) + { + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) + } + PC += 2; + RET(6) } +#endif // BRA OPCODE(0x6001) { - u32 res; -#ifdef FAMEC_CHECK_BRANCHES - u32 newPC = (u32)(PC) - BasePC; + u32 newPC = (uintptr_t)(PC) - BasePC; s8 offs=Opcode; newPC += offs; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(offs) +#ifdef OPCODES_M68000 + RET(10) #else - PC += ((s8)(Opcode & 0xFE)) >> 1; + RET(6) #endif -RET(10) } // BRA16 OPCODE(0x6000) { - u32 adr, res; - u32 src, dst; - - { - u32 newPC; + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(newPC,10); +#else + CHECK_BRANCH_EXCEPTION(newPC,6); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif +} - newPC = (u32)(PC) - BasePC; - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - } -RET(10) +#ifdef OPCODES_M68020 +// BRA32 - 68020+ +OPCODE(0x60FF) +{ + u32 newPC; + + newPC = (uintptr_t)(PC) - BasePC; + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,6); + SET_PC(newPC); + RET(6) } +#endif // BSR OPCODE(0x6101) { - u32 adr, res; - u32 src, dst; u32 oldPC; s8 offs; - - PRE_IO - - oldPC = (u32)(PC) - BasePC; + + oldPC = (uintptr_t)(PC) - BasePC; PUSH_32_F(oldPC) -#ifdef FAMEC_CHECK_BRANCHES offs = Opcode; oldPC += offs; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(oldPC,18); +#else + CHECK_BRANCH_EXCEPTION(oldPC,7); +#endif SET_PC(oldPC); - CHECK_BRANCH_EXCEPTION(offs) +#ifdef OPCODES_M68000 + RET(18) #else - PC += ((s8)(Opcode & 0xFE)) >> 1; + RET(7) #endif - POST_IO -RET(18) } // BSR16 OPCODE(0x6100) { - u32 adr, res; - u32 src, dst; - - PRE_IO - { - u32 oldPC, newPC; + u32 oldPC, newPC; + + newPC = (uintptr_t)(PC) - BasePC; + oldPC = newPC + 2; + PUSH_32_F(oldPC) + newPC += GET_SWORD; +#ifdef OPCODES_M68000 + CHECK_BRANCH_EXCEPTION(oldPC,18); +#else + CHECK_BRANCH_EXCEPTION(oldPC,7); +#endif + SET_PC(newPC); +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif +} - newPC = (u32)(PC) - BasePC; - oldPC = newPC + 2; - PUSH_32_F(oldPC) - newPC += GET_SWORD; - SET_PC(newPC); - CHECK_BRANCH_EXCEPTION(newPC) - } - POST_IO -RET(18) +#ifdef OPCODES_M68020 +// BSR32 - 68020+ +OPCODE(0x61FF) +{ + u32 oldPC, newPC; + + newPC = (uintptr_t)(PC) - BasePC; + oldPC = newPC + 4; + PUSH_32_F(oldPC) + newPC += GET_SLONG; + CHECK_BRANCH_EXCEPTION(newPC,7); + SET_PC(newPC); + RET(7) } +#endif // MOVEQ OPCODE(0x7000) { - u32 adr, res; - u32 src, dst; - + u32 res; + res = (s32)(s8)Opcode; flag_C = flag_V = 0; flag_N = flag_NotZ = res; DREGu32((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ORaD OPCODE(0x8000) { - u32 adr, res; - u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu8((Opcode /*>> 0*/) & 7); res = DREGu8((Opcode >> 9) & 7); res |= src; flag_C = 0; @@ -25496,17 +29778,20 @@ OPCODE(0x8000) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ORaD OPCODE(0x8010) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25515,19 +29800,21 @@ OPCODE(0x8010) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ORaD OPCODE(0x8018) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25536,19 +29823,21 @@ OPCODE(0x8018) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ORaD OPCODE(0x8020) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25557,19 +29846,21 @@ OPCODE(0x8020) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ORaD OPCODE(0x8028) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25578,19 +29869,21 @@ OPCODE(0x8028) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ORaD OPCODE(0x8030) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25599,18 +29892,20 @@ OPCODE(0x8030) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORaD OPCODE(0x8038) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25619,18 +29914,20 @@ OPCODE(0x8038) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ORaD OPCODE(0x8039) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25639,19 +29936,21 @@ OPCODE(0x8039) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ORaD OPCODE(0x803A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25660,19 +29959,21 @@ OPCODE(0x803A) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ORaD OPCODE(0x803B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25681,16 +29982,19 @@ OPCODE(0x803B) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORaD OPCODE(0x803C) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25699,18 +30003,21 @@ OPCODE(0x803C) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ORaD OPCODE(0x801F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25719,19 +30026,21 @@ OPCODE(0x801F) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ORaD OPCODE(0x8027) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res |= src; @@ -25740,17 +30049,20 @@ OPCODE(0x8027) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ORaD OPCODE(0x8040) { - u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 res; + u32 src ; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = DREGu16((Opcode >> 9) & 7); res |= src; flag_C = 0; @@ -25758,17 +30070,20 @@ OPCODE(0x8040) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ORaD OPCODE(0x8050) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25777,19 +30092,21 @@ OPCODE(0x8050) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ORaD OPCODE(0x8058) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25798,19 +30115,21 @@ OPCODE(0x8058) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ORaD OPCODE(0x8060) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25819,19 +30138,21 @@ OPCODE(0x8060) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ORaD OPCODE(0x8068) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25840,19 +30161,21 @@ OPCODE(0x8068) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ORaD OPCODE(0x8070) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25861,18 +30184,20 @@ OPCODE(0x8070) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORaD OPCODE(0x8078) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25881,18 +30206,20 @@ OPCODE(0x8078) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ORaD OPCODE(0x8079) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25901,19 +30228,21 @@ OPCODE(0x8079) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ORaD OPCODE(0x807A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25922,19 +30251,21 @@ OPCODE(0x807A) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ORaD OPCODE(0x807B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25943,16 +30274,19 @@ OPCODE(0x807B) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORaD OPCODE(0x807C) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25961,18 +30295,21 @@ OPCODE(0x807C) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ORaD OPCODE(0x805F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -25981,19 +30318,21 @@ OPCODE(0x805F) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ORaD OPCODE(0x8067) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res |= src; @@ -26002,17 +30341,20 @@ OPCODE(0x8067) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ORaD OPCODE(0x8080) { - u32 adr, res; - u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu32((Opcode /*>> 0*/) & 7); res = DREGu32((Opcode >> 9) & 7); res |= src; flag_C = 0; @@ -26020,17 +30362,20 @@ OPCODE(0x8080) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ORaD OPCODE(0x8090) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26039,19 +30384,21 @@ OPCODE(0x8090) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ORaD OPCODE(0x8098) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26060,19 +30407,21 @@ OPCODE(0x8098) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ORaD OPCODE(0x80A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26081,19 +30430,21 @@ OPCODE(0x80A0) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ORaD OPCODE(0x80A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26102,19 +30453,21 @@ OPCODE(0x80A8) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ORaD OPCODE(0x80B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26123,18 +30476,20 @@ OPCODE(0x80B0) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ORaD OPCODE(0x80B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26143,18 +30498,20 @@ OPCODE(0x80B8) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // ORaD OPCODE(0x80B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26163,19 +30520,21 @@ OPCODE(0x80B9) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // ORaD OPCODE(0x80BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26184,19 +30543,21 @@ OPCODE(0x80BA) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ORaD OPCODE(0x80BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26205,16 +30566,19 @@ OPCODE(0x80BB) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ORaD OPCODE(0x80BC) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src ; + FETCH_LONG(src); res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26223,18 +30587,21 @@ OPCODE(0x80BC) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ORaD OPCODE(0x809F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26243,19 +30610,21 @@ OPCODE(0x809F) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ORaD OPCODE(0x80A7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res |= src; @@ -26264,19 +30633,21 @@ OPCODE(0x80A7) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ORDa OPCODE(0x8110) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26284,20 +30655,22 @@ OPCODE(0x8110) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ORDa OPCODE(0x8118) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26305,20 +30678,22 @@ OPCODE(0x8118) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ORDa OPCODE(0x8120) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26326,20 +30701,22 @@ OPCODE(0x8120) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORDa OPCODE(0x8128) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26347,20 +30724,22 @@ OPCODE(0x8128) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ORDa OPCODE(0x8130) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26368,19 +30747,21 @@ OPCODE(0x8130) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ORDa OPCODE(0x8138) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26388,19 +30769,21 @@ OPCODE(0x8138) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ORDa OPCODE(0x8139) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26408,20 +30791,22 @@ OPCODE(0x8139) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ORDa OPCODE(0x811F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26429,20 +30814,22 @@ OPCODE(0x811F) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ORDa OPCODE(0x8127) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res |= src; flag_C = 0; @@ -26450,19 +30837,21 @@ OPCODE(0x8127) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORDa OPCODE(0x8150) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26470,20 +30859,22 @@ OPCODE(0x8150) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ORDa OPCODE(0x8158) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26491,20 +30882,22 @@ OPCODE(0x8158) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ORDa OPCODE(0x8160) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26512,20 +30905,22 @@ OPCODE(0x8160) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORDa OPCODE(0x8168) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26533,20 +30928,22 @@ OPCODE(0x8168) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ORDa OPCODE(0x8170) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26554,19 +30951,21 @@ OPCODE(0x8170) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ORDa OPCODE(0x8178) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26574,19 +30973,21 @@ OPCODE(0x8178) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ORDa OPCODE(0x8179) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26594,41 +30995,45 @@ OPCODE(0x8179) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ORDa OPCODE(0x815F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - WRITE_WORD_F(adr, res) - POST_IO -RET(12) + WRITE_WORD_F(adr, res) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ORDa OPCODE(0x8167) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) res |= src; flag_C = 0; @@ -26636,19 +31041,21 @@ OPCODE(0x8167) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ORDa OPCODE(0x8190) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26656,20 +31063,22 @@ OPCODE(0x8190) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ORDa OPCODE(0x8198) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26677,20 +31086,22 @@ OPCODE(0x8198) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ORDa OPCODE(0x81A0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26698,20 +31109,22 @@ OPCODE(0x81A0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // ORDa OPCODE(0x81A8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26719,20 +31132,22 @@ OPCODE(0x81A8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // ORDa OPCODE(0x81B0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26740,19 +31155,21 @@ OPCODE(0x81B0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // ORDa OPCODE(0x81B8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26760,19 +31177,21 @@ OPCODE(0x81B8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // ORDa OPCODE(0x81B9) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26780,20 +31199,22 @@ OPCODE(0x81B9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ORDa OPCODE(0x819F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26801,20 +31222,22 @@ OPCODE(0x819F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ORDa OPCODE(0x81A7) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) res |= src; flag_C = 0; @@ -26822,17 +31245,203 @@ OPCODE(0x81A7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif +} + +#ifdef OPCODES_M68020 +// PACK Dn,Dn - 68020+ +OPCODE(0x8140) +{ + u16 src, dst; + + FETCH_WORD(src) + src += DREGu16((Opcode /*>> 0*/) & 7); + dst = ((src >> 4) & 0x00F0) | (src & 0x000F); + DREGu8((Opcode >> 9) & 7) = dst; + RET(6) +} + +// PACK -(An),-(An) - 68020+ +OPCODE(0x8148) +{ + u32 adr, res; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + READ_BYTE_F(adr, dst) + adr -= 1; + READ_BYTE_F(adr, res); + AREG((Opcode /*>> 0*/) & 7) = adr; + dst = (dst | (res << 8)) + src; + dst = ((dst >> 4) & 0xF0) | (dst & 0x0F); + adr = AREG((Opcode >> 9) & 7) - 1; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst) + RET(13) +} + +// PACK -(A7),-(An) - 68020+ +OPCODE(0x814F) +{ + u32 adr, res; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + READ_BYTE_F(adr, dst) + adr -= 2; + READ_BYTE_F(adr, res); + AREG((Opcode /*>> 0*/) & 7) = adr; + dst = (dst | (res << 8)) + src; + dst = ((dst >> 4) & 0xF0) | (dst & 0x0F); + adr = AREG((Opcode >> 9) & 7) - 1; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst) + RET(13) +} + +// PACK -(An),-(A7) - 68020+ +OPCODE(0x8F48) +{ + u32 adr, res; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + READ_BYTE_F(adr, dst) + adr -= 1; + READ_BYTE_F(adr, res); + AREG((Opcode /*>> 0*/) & 7) = adr; + dst = (dst | (res << 8)) + src; + dst = ((dst >> 4) & 0xF0) | (dst & 0x0F); + adr = AREG((Opcode >> 9) & 7) - 2; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst) + RET(13) +} + +// PACK -(A7),-(A7) - 68020+ +OPCODE(0x8F4F) +{ + u32 adr, res; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + READ_BYTE_F(adr, dst) + adr -= 2; + READ_BYTE_F(adr, res); + AREG((Opcode /*>> 0*/) & 7) = adr; + dst = (dst | (res << 8)) + src; + dst = ((dst >> 4) & 0xF0) | (dst & 0x0F); + adr = AREG((Opcode >> 9) & 7) - 2; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst) + RET(13) +} + +// UNPK Dn,Dn - 68020+ +OPCODE(0x8180) +{ + u16 src, dst; + + FETCH_WORD(src) + dst = DREGu16((Opcode /*>> 0*/) & 7); + dst = (((dst << 4) & 0x0F00) | (dst & 0x000F)) + src; + DREGu16((Opcode >> 9) & 7) = dst; + RET(8) +} + +// UNPK -(An),-(An) - 68020+ +OPCODE(0x8188) +{ + u32 adr; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; + READ_BYTE_F(adr, dst) + dst = (((dst << 4) & 0x0F00) | (dst & 0x000F)) + src; + adr = AREG((Opcode >> 9) & 7) - 1; + WRITE_BYTE_F(adr, dst) + adr -= 1; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst >> 8) + RET(13) +} + +// UNPK -(A7),-(An) - 68020+ +OPCODE(0x8F88) +{ + u32 adr; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; + READ_BYTE_F(adr, dst) + dst = (((dst << 4) & 0x0F00) | (dst & 0x000F)) + src; + adr = AREG((Opcode >> 9) & 7) - 2; + WRITE_BYTE_F(adr, dst) + adr -= 2; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst >> 8) + RET(13) +} + +// UNPK -(An),-(A7) - 68020+ +OPCODE(0x818F) +{ + u32 adr; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; + READ_BYTE_F(adr, dst) + dst = (((dst << 4) & 0x0F00) | (dst & 0x000F)) + src; + adr = AREG((Opcode >> 9) & 7) - 1; + WRITE_BYTE_F(adr, dst) + adr -= 1; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst >> 8) + RET(13) +} + +// UNPK -(A7),-(A7) - 68020+ +OPCODE(0x8F8F) +{ + u32 adr; + u16 src, dst; + + FETCH_WORD(src) + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; + READ_BYTE_F(adr, dst) + dst = (((dst << 4) & 0x0F00) | (dst & 0x000F)) + src; + adr = AREG((Opcode >> 9) & 7) - 2; + WRITE_BYTE_F(adr, dst) + adr -= 2; + AREG((Opcode >> 9) & 7) = adr; + WRITE_BYTE_F(adr, dst >> 8) + RET(13) } +#endif + // SBCD OPCODE(0x8100) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = (dst & 0xF) - (src & 0xF) - ((flag_X >> M68K_SR_X_SFT) & 1); if (res > 9) res -= 6; @@ -26846,7 +31455,11 @@ OPCODE(0x8100) flag_NotZ |= res & 0xFF; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // SBCDM @@ -26854,10 +31467,9 @@ OPCODE(0x8108) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -26874,8 +31486,11 @@ OPCODE(0x8108) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // SBCD7M @@ -26883,10 +31498,9 @@ OPCODE(0x810F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -26903,8 +31517,11 @@ OPCODE(0x810F) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // SBCDM7 @@ -26912,10 +31529,9 @@ OPCODE(0x8F08) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -26932,8 +31548,11 @@ OPCODE(0x8F08) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // SBCD7M7 @@ -26941,10 +31560,9 @@ OPCODE(0x8F0F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -26961,40 +31579,43 @@ OPCODE(0x8F0F) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // DIVU OPCODE(0x80C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + + src = DREGu16((Opcode /*>> 0*/) & 7); if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(140) +#ifdef OPCODES_M68000 + RET(4 + 0) // Cycles for fetch of operants #else -RET(10) + RET(2 + 0) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(140) +#ifdef OPCODES_M68000 + RET(10 + 0) #else -RET(70) + RET(10 + 0) #endif } q &= 0x0000FFFF; @@ -27002,12 +31623,12 @@ RET(70) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(140) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 0) #else -RET(90) + RET(44 + 0) #endif } @@ -27016,33 +31637,32 @@ OPCODE(0x80D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants #else -RET(14) + RET(2 + 4) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(10 + 4) #else - RET(74) + RET(10 + 4) #endif } q &= 0x0000FFFF; @@ -27050,12 +31670,12 @@ RET(144) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 4) #else -RET(94) + RET(44 + 4) #endif } @@ -27064,34 +31684,33 @@ OPCODE(0x80D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants #else -RET(14) + RET(2 + 4) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(10 + 4) #else - RET(74) + RET(10 + 4) #endif } q &= 0x0000FFFF; @@ -27099,12 +31718,12 @@ RET(144) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 4) #else -RET(94) + RET(44 + 4) #endif } @@ -27113,34 +31732,33 @@ OPCODE(0x80E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(146) +#ifdef OPCODES_M68000 + RET(4 + 6) // Cycles for fetch of operants #else -RET(16) + RET(2 + 5) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(146) +#ifdef OPCODES_M68000 + RET(10 + 6) #else - RET(76) + RET(10 + 5) #endif } q &= 0x0000FFFF; @@ -27148,12 +31766,12 @@ RET(146) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(146) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 6) #else -RET(96) + RET(44 + 5) #endif } @@ -27162,34 +31780,33 @@ OPCODE(0x80E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(4 + 8) // Cycles for fetch of operants #else -RET(18) + RET(2 + 5) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(10 + 8) #else - RET(78) + RET(10 + 5) #endif } q &= 0x0000FFFF; @@ -27197,12 +31814,12 @@ RET(148) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 8) #else -RET(98) + RET(44 + 5) #endif } @@ -27211,34 +31828,33 @@ OPCODE(0x80F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(150) +#ifdef OPCODES_M68000 + RET(4 + 10) // Cycles for fetch of operants #else -RET(20) + RET(2 + 7) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(150) +#ifdef OPCODES_M68000 + RET(10 + 10) #else - RET(80) + RET(10 + 7) #endif } q &= 0x0000FFFF; @@ -27246,12 +31862,12 @@ RET(150) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(150) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 10) #else -RET(100) + RET(44 + 7) #endif } @@ -27260,33 +31876,32 @@ OPCODE(0x80F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(4 + 8) // Cycles for fetch of operants #else -RET(18) + RET(2 + 4) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(10 + 8) #else - RET(78) + RET(10 + 4) #endif } q &= 0x0000FFFF; @@ -27294,12 +31909,12 @@ RET(148) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 8) #else -RET(98) + RET(44 + 4) #endif } @@ -27308,33 +31923,32 @@ OPCODE(0x80F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(162) +#ifdef OPCODES_M68000 + RET(4 + 12) // Cycles for fetch of operants #else -RET(22) + RET(2 + 4) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(162) +#ifdef OPCODES_M68000 + RET(10 + 12) #else - RET(82) + RET(10 + 4) #endif } q &= 0x0000FFFF; @@ -27342,12 +31956,12 @@ RET(162) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(162) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 12) #else -RET(102) + RET(44 + 4) #endif } @@ -27356,34 +31970,33 @@ OPCODE(0x80FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(4 + 8) // Cycles for fetch of operants #else -RET(18) + RET(2 + 5) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(10 + 8) #else - RET(78) + RET(10 + 5) #endif } q &= 0x0000FFFF; @@ -27391,12 +32004,12 @@ RET(148) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(148) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 8) #else -RET(98) + RET(44 + 5) #endif } @@ -27405,34 +32018,33 @@ OPCODE(0x80FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(160) +#ifdef OPCODES_M68000 + RET(4 + 10) // Cycles for fetch of operants #else -RET(20) + RET(2 + 7) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(160) +#ifdef OPCODES_M68000 + RET(10 + 10) #else - RET(80) + RET(10 + 7) #endif } q &= 0x0000FFFF; @@ -27440,45 +32052,45 @@ RET(160) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(160) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 10) #else -RET(100) + RET(44 + 7) #endif } // DIVU OPCODE(0x80FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants #else -RET(14) + RET(2 + 2) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(10 + 4) #else - RET(74) + RET(10 + 2) #endif } q &= 0x0000FFFF; @@ -27486,12 +32098,12 @@ RET(144) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 4) #else -RET(94) + RET(44 + 2) #endif } @@ -27500,34 +32112,33 @@ OPCODE(0x80DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants #else -RET(14) + RET(2 + 4) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(10 + 4) #else - RET(74) + RET(10 + 4) #endif } q &= 0x0000FFFF; @@ -27535,12 +32146,12 @@ RET(144) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(144) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 4) #else -RET(94) + RET(44 + 4) #endif } @@ -27549,34 +32160,33 @@ OPCODE(0x80E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -RET(146) +#ifdef OPCODES_M68000 + RET(4 + 6) // Cycles for fetch of operants #else -RET(16) + RET(2 + 5) #endif } dst = DREGu32((Opcode >> 9) & 7); { u32 q, r; - + q = dst / src; r = dst % src; - + if (q & 0xFFFF0000) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -RET(146) +#ifdef OPCODES_M68000 + RET(10 + 6) #else - RET(76) + RET(10 + 5) #endif } q &= 0x0000FFFF; @@ -27584,29 +32194,30 @@ RET(146) flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -RET(146) +#ifdef OPCODES_M68000 + RET(getDivu68kCycles(dst, src) + 6) #else -RET(96) + RET(44 + 5) #endif } // DIVS OPCODE(0x81C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs16((Opcode >> 0) & 7); + + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 0) // Cycles for fetch of operants +#else + RET(2 + 0) #endif - RET(10) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27614,37 +32225,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 0) +#else + RET(56 + 0) #endif - RET(50) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 0) +#else + RET(18 + 0) #endif - RET(80) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 0) +#else + RET(56 + 0) #endif -RET(108) } // DIVS @@ -27652,17 +32266,17 @@ OPCODE(0x81D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants +#else + RET(2 + 4) #endif - RET(14) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27670,37 +32284,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 4) #endif - RET(54) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 4) +#else + RET(18 + 4) #endif - RET(84) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 4) #endif -RET(112) } // DIVS @@ -27708,18 +32325,18 @@ OPCODE(0x81D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants +#else + RET(2 + 4) #endif - RET(14) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27727,37 +32344,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 4) #endif - RET(54) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 4) +#else + RET(18 + 4) #endif - RET(84) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 4) #endif -RET(112) } // DIVS @@ -27765,18 +32385,18 @@ OPCODE(0x81E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 6) // Cycles for fetch of operants +#else + RET(2 + 5) #endif - RET(16) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27784,37 +32404,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 6) +#else + RET(56 + 5) #endif - RET(56) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 6) +#else + RET(18 + 5) #endif - RET(86) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 6) +#else + RET(56 + 5) #endif -RET(114) } // DIVS @@ -27822,18 +32445,18 @@ OPCODE(0x81E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 8) // Cycles for fetch of operants +#else + RET(2 + 5) #endif - RET(18) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27841,37 +32464,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 8) +#else + RET(56 + 5) #endif - RET(58) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 8) +#else + RET(18 + 5) #endif - RET(88) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 8) +#else + RET(56 + 5) #endif -RET(116) } // DIVS @@ -27879,18 +32505,18 @@ OPCODE(0x81F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 10) // Cycles for fetch of operants +#else + RET(2 + 7) #endif - RET(20) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27898,37 +32524,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 10) +#else + RET(56 + 7) #endif - RET(60) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 10) +#else + RET(18 + 7) #endif - RET(90) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 10) +#else + RET(56 + 7) #endif -RET(118) } // DIVS @@ -27936,17 +32565,17 @@ OPCODE(0x81F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 8) // Cycles for fetch of operants +#else + RET(2 + 4) #endif - RET(18) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -27954,37 +32583,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 8) +#else + RET(56 + 4) #endif - RET(58) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 8) +#else + RET(18 + 4) #endif - RET(88) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 8) +#else + RET(56 + 4) #endif -RET(116) } // DIVS @@ -27992,17 +32624,17 @@ OPCODE(0x81F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 12) // Cycles for fetch of operants +#else + RET(2 + 4) #endif - RET(22) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -28010,37 +32642,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 12) +#else + RET(56 + 4) #endif - RET(62) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 12) +#else + RET(18 + 4) #endif - RET(92) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 12) +#else + RET(56 + 4) #endif -RET(120) } // DIVS @@ -28048,18 +32683,18 @@ OPCODE(0x81FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 8) // Cycles for fetch of operants +#else + RET(2 + 5) #endif - RET(18) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -28067,37 +32702,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 8) +#else + RET(56 + 5) #endif - RET(58) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 8) +#else + RET(18 + 5) #endif - RET(88) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 8) +#else + RET(56 + 5) #endif -RET(116) } // DIVS @@ -28105,18 +32743,18 @@ OPCODE(0x81FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 10) // Cycles for fetch of operants +#else + RET(2 + 7) #endif - RET(20) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -28124,53 +32762,57 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 10) +#else + RET(56 + 7) #endif - RET(60) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 10) +#else + RET(18 + 7) #endif - RET(90) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 10) +#else + RET(56 + 7) #endif -RET(118) } // DIVS OPCODE(0x81FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_SWORD(src); if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants +#else + RET(2 + 2) #endif - RET(14) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -28178,37 +32820,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 2) #endif - RET(54) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 4) +#else + RET(18 + 2) #endif - RET(84) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 2) #endif -RET(112) } // DIVS @@ -28216,18 +32861,18 @@ OPCODE(0x81DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 4) // Cycles for fetch of operants +#else + RET(2 + 4) #endif - RET(14) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -28235,37 +32880,40 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 4) #endif - RET(54) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 4) +#else + RET(18 + 4) #endif - RET(84) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 4) +#else + RET(56 + 4) #endif -RET(112) } // DIVS @@ -28273,18 +32921,18 @@ OPCODE(0x81E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READSX_WORD_F(adr, src) if (src == 0) { execute_exception(M68K_ZERO_DIVIDE_EX); -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(4 + 6) // Cycles for fetch of operants +#else + RET(2 + 5) #endif - RET(16) } dst = DREGu32((Opcode >> 9) & 7); if ((dst == 0x80000000) && (src == (u32)-1)) @@ -28292,74 +32940,74 @@ goto end; flag_NotZ = flag_N = 0; flag_V = flag_C = 0; res = 0; - DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; + DREGu32((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 6) +#else + RET(56 + 5) #endif - RET(56) } { s32 q, r; - + q = (s32)dst / (s32)src; r = (s32)dst % (s32)src; - + if ((q > 0x7FFF) || (q < -0x8000)) { flag_V = M68K_SR_V; -#ifdef USE_CYCLONE_TIMING_DIV -goto end; +#ifdef OPCODES_M68000 + RET(18 + 6) +#else + RET(18 + 5) #endif - RET(86) } q &= 0x0000FFFF; flag_NotZ = q; flag_N = q >> 8; flag_V = flag_C = 0; res = q | (r << 16); - DREGu32((Opcode >> 9) & 7) = res; + DREGu32((Opcode >> 9) & 7) = res; } -#ifdef USE_CYCLONE_TIMING_DIV -end: io_cycle_counter -= 50; +#ifdef OPCODES_M68000 + RET(getDivs68kCycles(dst, src) + 6) +#else + RET(56 + 5) #endif -RET(114) } // SUBaD OPCODE(0x9000) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBaD OPCODE(0x9008) { - u32 adr, res; - u32 src, dst; - // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - dst = DREGu8((Opcode >> 9) & 7); - res = dst - src; - flag_N = flag_X = flag_C = res; - flag_V = (src ^ dst) & (res ^ dst); - flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 9) & 7) = res; -*/ -RET(4) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 4; + RET(4) +#else + m68kcontext.io_cycle_counter = 2; + RET(2) +#endif } // SUBaD @@ -28367,9 +33015,8 @@ OPCODE(0x9010) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28377,8 +33024,11 @@ OPCODE(0x9010) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // SUBaD @@ -28386,10 +33036,9 @@ OPCODE(0x9018) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28397,8 +33046,11 @@ OPCODE(0x9018) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // SUBaD @@ -28406,10 +33058,9 @@ OPCODE(0x9020) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28417,8 +33068,11 @@ OPCODE(0x9020) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // SUBaD @@ -28426,10 +33080,9 @@ OPCODE(0x9028) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28437,8 +33090,11 @@ OPCODE(0x9028) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // SUBaD @@ -28446,10 +33102,9 @@ OPCODE(0x9030) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28457,8 +33112,11 @@ OPCODE(0x9030) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBaD @@ -28466,9 +33124,8 @@ OPCODE(0x9038) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28476,8 +33133,11 @@ OPCODE(0x9038) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // SUBaD @@ -28485,9 +33145,8 @@ OPCODE(0x9039) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28495,8 +33154,11 @@ OPCODE(0x9039) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // SUBaD @@ -28504,10 +33166,9 @@ OPCODE(0x903A) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28515,8 +33176,11 @@ OPCODE(0x903A) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // SUBaD @@ -28524,10 +33188,9 @@ OPCODE(0x903B) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28535,16 +33198,19 @@ OPCODE(0x903B) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBaD OPCODE(0x903C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_BYTE(src); dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28552,7 +33218,11 @@ OPCODE(0x903C) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // SUBaD @@ -28560,10 +33230,9 @@ OPCODE(0x901F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28571,8 +33240,11 @@ OPCODE(0x901F) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // SUBaD @@ -28580,10 +33252,9 @@ OPCODE(0x9027) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; @@ -28591,40 +33262,51 @@ OPCODE(0x9027) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // SUBaD OPCODE(0x9040) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + + src = DREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBaD OPCODE(0x9048) { - u32 adr, res; + u32 res; u32 src, dst; - - src = AREGu16((Opcode >> 0) & 7); + + src = AREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBaD @@ -28632,9 +33314,8 @@ OPCODE(0x9050) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28642,8 +33323,11 @@ OPCODE(0x9050) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // SUBaD @@ -28651,10 +33335,9 @@ OPCODE(0x9058) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28662,8 +33345,11 @@ OPCODE(0x9058) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // SUBaD @@ -28671,10 +33357,9 @@ OPCODE(0x9060) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28682,8 +33367,11 @@ OPCODE(0x9060) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // SUBaD @@ -28691,10 +33379,9 @@ OPCODE(0x9068) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28702,8 +33389,11 @@ OPCODE(0x9068) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // SUBaD @@ -28711,10 +33401,9 @@ OPCODE(0x9070) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28722,8 +33411,11 @@ OPCODE(0x9070) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBaD @@ -28731,9 +33423,8 @@ OPCODE(0x9078) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28741,8 +33432,11 @@ OPCODE(0x9078) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // SUBaD @@ -28750,9 +33444,8 @@ OPCODE(0x9079) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28760,8 +33453,11 @@ OPCODE(0x9079) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // SUBaD @@ -28769,10 +33465,9 @@ OPCODE(0x907A) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28780,8 +33475,11 @@ OPCODE(0x907A) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // SUBaD @@ -28789,10 +33487,9 @@ OPCODE(0x907B) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28800,16 +33497,19 @@ OPCODE(0x907B) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBaD OPCODE(0x907C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28817,7 +33517,11 @@ OPCODE(0x907C) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // SUBaD @@ -28825,10 +33529,9 @@ OPCODE(0x905F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28836,8 +33539,11 @@ OPCODE(0x905F) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // SUBaD @@ -28845,10 +33551,9 @@ OPCODE(0x9067) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; @@ -28856,17 +33561,20 @@ OPCODE(0x9067) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // SUBaD OPCODE(0x9080) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + + src = DREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; @@ -28874,16 +33582,20 @@ OPCODE(0x9080) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // SUBaD OPCODE(0x9088) { - u32 adr, res; + u32 res; u32 src, dst; - - src = AREGu32((Opcode >> 0) & 7); + + src = AREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; @@ -28891,7 +33603,11 @@ OPCODE(0x9088) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // SUBaD @@ -28899,9 +33615,8 @@ OPCODE(0x9090) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -28910,8 +33625,11 @@ OPCODE(0x9090) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // SUBaD @@ -28919,10 +33637,9 @@ OPCODE(0x9098) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -28931,8 +33648,11 @@ OPCODE(0x9098) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // SUBaD @@ -28940,10 +33660,9 @@ OPCODE(0x90A0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -28952,8 +33671,11 @@ OPCODE(0x90A0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // SUBaD @@ -28961,10 +33683,9 @@ OPCODE(0x90A8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -28973,8 +33694,11 @@ OPCODE(0x90A8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // SUBaD @@ -28982,10 +33706,9 @@ OPCODE(0x90B0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -28994,8 +33717,11 @@ OPCODE(0x90B0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SUBaD @@ -29003,9 +33729,8 @@ OPCODE(0x90B8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29014,8 +33739,11 @@ OPCODE(0x90B8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // SUBaD @@ -29023,9 +33751,8 @@ OPCODE(0x90B9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29034,8 +33761,11 @@ OPCODE(0x90B9) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // SUBaD @@ -29043,10 +33773,9 @@ OPCODE(0x90BA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29055,8 +33784,11 @@ OPCODE(0x90BA) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // SUBaD @@ -29064,10 +33796,9 @@ OPCODE(0x90BB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29076,16 +33807,19 @@ OPCODE(0x90BB) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SUBaD OPCODE(0x90BC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29094,7 +33828,11 @@ OPCODE(0x90BC) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // SUBaD @@ -29102,10 +33840,9 @@ OPCODE(0x909F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29114,8 +33851,11 @@ OPCODE(0x909F) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // SUBaD @@ -29123,10 +33863,9 @@ OPCODE(0x90A7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -29135,8 +33874,11 @@ OPCODE(0x90A7) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // SUBDa @@ -29144,18 +33886,20 @@ OPCODE(0x9110) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBDa @@ -29163,19 +33907,21 @@ OPCODE(0x9118) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBDa @@ -29183,19 +33929,21 @@ OPCODE(0x9120) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBDa @@ -29203,19 +33951,21 @@ OPCODE(0x9128) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // SUBDa @@ -29223,19 +33973,21 @@ OPCODE(0x9130) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // SUBDa @@ -29243,18 +33995,20 @@ OPCODE(0x9138) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // SUBDa @@ -29262,18 +34016,20 @@ OPCODE(0x9139) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBDa @@ -29281,19 +34037,21 @@ OPCODE(0x911F) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBDa @@ -29301,19 +34059,21 @@ OPCODE(0x9127) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst - src; flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBDa @@ -29321,18 +34081,20 @@ OPCODE(0x9150) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBDa @@ -29340,19 +34102,21 @@ OPCODE(0x9158) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBDa @@ -29360,19 +34124,21 @@ OPCODE(0x9160) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBDa @@ -29380,19 +34146,21 @@ OPCODE(0x9168) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // SUBDa @@ -29400,19 +34168,21 @@ OPCODE(0x9170) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // SUBDa @@ -29420,18 +34190,20 @@ OPCODE(0x9178) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // SUBDa @@ -29439,18 +34211,20 @@ OPCODE(0x9179) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBDa @@ -29458,19 +34232,21 @@ OPCODE(0x915F) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // SUBDa @@ -29478,19 +34254,21 @@ OPCODE(0x9167) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // SUBDa @@ -29498,10 +34276,9 @@ OPCODE(0x9190) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29509,8 +34286,11 @@ OPCODE(0x9190) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBDa @@ -29518,11 +34298,10 @@ OPCODE(0x9198) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29530,8 +34309,11 @@ OPCODE(0x9198) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBDa @@ -29539,11 +34321,10 @@ OPCODE(0x91A0) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29551,8 +34332,11 @@ OPCODE(0x91A0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // SUBDa @@ -29560,11 +34344,10 @@ OPCODE(0x91A8) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29572,8 +34355,11 @@ OPCODE(0x91A8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // SUBDa @@ -29581,11 +34367,10 @@ OPCODE(0x91B0) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29593,8 +34378,11 @@ OPCODE(0x91B0) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // SUBDa @@ -29602,10 +34390,9 @@ OPCODE(0x91B8) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29613,8 +34400,11 @@ OPCODE(0x91B8) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // SUBDa @@ -29622,10 +34412,9 @@ OPCODE(0x91B9) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29633,8 +34422,11 @@ OPCODE(0x91B9) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // SUBDa @@ -29642,11 +34434,10 @@ OPCODE(0x919F) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29654,8 +34445,11 @@ OPCODE(0x919F) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // SUBDa @@ -29663,11 +34457,10 @@ OPCODE(0x91A7) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst - src; flag_NotZ = res; @@ -29675,49 +34468,60 @@ OPCODE(0x91A7) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // SUBX OPCODE(0x9100) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = dst - src - ((flag_X >> 8) & 1); flag_N = flag_X = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ |= res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBX OPCODE(0x9140) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + + src = DREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst - src - ((flag_X >> 8) & 1); flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // SUBX OPCODE(0x9180) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + + src = DREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst - src - ((flag_X >> 8) & 1); flag_NotZ |= res; @@ -29725,7 +34529,11 @@ OPCODE(0x9180) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // SUBXM @@ -29733,10 +34541,9 @@ OPCODE(0x9108) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -29746,8 +34553,11 @@ OPCODE(0x9108) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBXM @@ -29755,10 +34565,9 @@ OPCODE(0x9148) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; @@ -29768,8 +34577,11 @@ OPCODE(0x9148) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBXM @@ -29777,10 +34589,9 @@ OPCODE(0x9188) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; @@ -29791,8 +34602,11 @@ OPCODE(0x9188) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // SUBX7M @@ -29800,10 +34614,9 @@ OPCODE(0x910F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -29813,8 +34626,11 @@ OPCODE(0x910F) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBX7M @@ -29822,10 +34638,9 @@ OPCODE(0x914F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; @@ -29835,8 +34650,11 @@ OPCODE(0x914F) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBX7M @@ -29844,10 +34662,9 @@ OPCODE(0x918F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; @@ -29858,8 +34675,11 @@ OPCODE(0x918F) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // SUBXM7 @@ -29867,10 +34687,9 @@ OPCODE(0x9F08) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -29880,8 +34699,11 @@ OPCODE(0x9F08) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBXM7 @@ -29889,10 +34711,9 @@ OPCODE(0x9F48) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -29902,8 +34723,11 @@ OPCODE(0x9F48) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBXM7 @@ -29911,10 +34735,9 @@ OPCODE(0x9F88) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) adr = AREG(7) - 4; AREG(7) = adr; @@ -29925,8 +34748,11 @@ OPCODE(0x9F88) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // SUBX7M7 @@ -29934,10 +34760,9 @@ OPCODE(0x9F0F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -29947,8 +34772,11 @@ OPCODE(0x9F0F) flag_V = (src ^ dst) & (res ^ dst); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBX7M7 @@ -29956,10 +34784,9 @@ OPCODE(0x9F4F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -29969,8 +34796,11 @@ OPCODE(0x9F4F) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // SUBX7M7 @@ -29978,10 +34808,9 @@ OPCODE(0x9F8F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) adr = AREG(7) - 4; AREG(7) = adr; @@ -29992,34 +34821,45 @@ OPCODE(0x9F8F) flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // SUBA OPCODE(0x90C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs16((Opcode >> 0) & 7); + + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // SUBA OPCODE(0x90C8) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)AREGs16((Opcode >> 0) & 7); + + src = (s32)AREGs16((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // SUBA @@ -30027,15 +34867,17 @@ OPCODE(0x90D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // SUBA @@ -30043,16 +34885,18 @@ OPCODE(0x90D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // SUBA @@ -30060,16 +34904,18 @@ OPCODE(0x90E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // SUBA @@ -30077,16 +34923,18 @@ OPCODE(0x90E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // SUBA @@ -30094,16 +34942,18 @@ OPCODE(0x90F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // SUBA @@ -30111,15 +34961,17 @@ OPCODE(0x90F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // SUBA @@ -30127,15 +34979,17 @@ OPCODE(0x90F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // SUBA @@ -30143,16 +34997,18 @@ OPCODE(0x90FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // SUBA @@ -30160,29 +35016,35 @@ OPCODE(0x90FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // SUBA OPCODE(0x90FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_SWORD(src); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // SUBA @@ -30190,16 +35052,18 @@ OPCODE(0x90DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // SUBA @@ -30207,49 +35071,51 @@ OPCODE(0x90E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // SUBA OPCODE(0x91C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs32((Opcode >> 0) & 7); + + src = (s32)DREGs32((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(8) +#ifdef OPCODES_M68000 + RET(8) #else -RET(6) + RET(2) #endif } // SUBA OPCODE(0x91C8) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)AREGs32((Opcode >> 0) & 7); + + src = (s32)AREGs32((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(8) +#ifdef OPCODES_M68000 + RET(8) #else -RET(6) + RET(2) #endif } @@ -30258,15 +35124,17 @@ OPCODE(0x91D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // SUBA @@ -30274,16 +35142,18 @@ OPCODE(0x91D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // SUBA @@ -30291,16 +35161,18 @@ OPCODE(0x91E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // SUBA @@ -30308,16 +35180,18 @@ OPCODE(0x91E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // SUBA @@ -30325,16 +35199,18 @@ OPCODE(0x91F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SUBA @@ -30342,15 +35218,17 @@ OPCODE(0x91F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // SUBA @@ -30358,15 +35236,17 @@ OPCODE(0x91F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // SUBA @@ -30374,16 +35254,18 @@ OPCODE(0x91FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // SUBA @@ -30391,32 +35273,34 @@ OPCODE(0x91FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // SUBA OPCODE(0x91FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + RET(16) #else -RET(14) + RET(6) #endif } @@ -30425,16 +35309,18 @@ OPCODE(0x91DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // SUBA @@ -30442,51 +35328,51 @@ OPCODE(0x91E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // CMP OPCODE(0xB000) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // CMP OPCODE(0xB008) { - u32 adr, res; - u32 src, dst; - // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - dst = DREGu8((Opcode >> 9) & 7); - res = dst - src; - flag_N = flag_C = res; - flag_V = (src ^ dst) & (res ^ dst); - flag_NotZ = res & 0xFF; -*/ -RET(4) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 4; + RET(4) +#else + m68kcontext.io_cycle_counter = 2; + RET(2) +#endif } // CMP @@ -30494,17 +35380,19 @@ OPCODE(0xB010) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // CMP @@ -30512,18 +35400,20 @@ OPCODE(0xB018) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // CMP @@ -30531,18 +35421,20 @@ OPCODE(0xB020) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // CMP @@ -30550,18 +35442,20 @@ OPCODE(0xB028) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // CMP @@ -30569,18 +35463,20 @@ OPCODE(0xB030) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CMP @@ -30588,17 +35484,19 @@ OPCODE(0xB038) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // CMP @@ -30606,17 +35504,19 @@ OPCODE(0xB039) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // CMP @@ -30624,18 +35524,20 @@ OPCODE(0xB03A) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // CMP @@ -30643,33 +35545,39 @@ OPCODE(0xB03B) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CMP OPCODE(0xB03C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_BYTE(src); dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // CMP @@ -30677,18 +35585,20 @@ OPCODE(0xB01F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // CMP @@ -30696,48 +35606,58 @@ OPCODE(0xB027) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst - src; flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // CMP OPCODE(0xB040) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + + src = DREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // CMP OPCODE(0xB048) { - u32 adr, res; + u32 res; u32 src, dst; - - src = AREGu16((Opcode >> 0) & 7); + + src = AREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // CMP @@ -30745,17 +35665,19 @@ OPCODE(0xB050) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // CMP @@ -30763,18 +35685,20 @@ OPCODE(0xB058) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // CMP @@ -30782,18 +35706,20 @@ OPCODE(0xB060) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // CMP @@ -30801,18 +35727,20 @@ OPCODE(0xB068) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // CMP @@ -30820,18 +35748,20 @@ OPCODE(0xB070) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CMP @@ -30839,17 +35769,19 @@ OPCODE(0xB078) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // CMP @@ -30857,17 +35789,19 @@ OPCODE(0xB079) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // CMP @@ -30875,18 +35809,20 @@ OPCODE(0xB07A) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // CMP @@ -30894,33 +35830,39 @@ OPCODE(0xB07B) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CMP OPCODE(0xB07C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // CMP @@ -30928,18 +35870,20 @@ OPCODE(0xB05F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // CMP @@ -30947,50 +35891,60 @@ OPCODE(0xB067) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst - src; flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // CMP OPCODE(0xB080) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + + src = DREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // CMP OPCODE(0xB088) { - u32 adr, res; + u32 res; u32 src, dst; - - src = AREGu32((Opcode >> 0) & 7); + + src = AREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // CMP @@ -30998,9 +35952,8 @@ OPCODE(0xB090) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31008,8 +35961,11 @@ OPCODE(0xB090) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // CMP @@ -31017,10 +35973,9 @@ OPCODE(0xB098) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31028,8 +35983,11 @@ OPCODE(0xB098) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // CMP @@ -31037,10 +35995,9 @@ OPCODE(0xB0A0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31048,8 +36005,11 @@ OPCODE(0xB0A0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // CMP @@ -31057,10 +36017,9 @@ OPCODE(0xB0A8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31068,8 +36027,11 @@ OPCODE(0xB0A8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // CMP @@ -31077,10 +36039,9 @@ OPCODE(0xB0B0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31088,8 +36049,11 @@ OPCODE(0xB0B0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // CMP @@ -31097,9 +36061,8 @@ OPCODE(0xB0B8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31107,8 +36070,11 @@ OPCODE(0xB0B8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // CMP @@ -31116,9 +36082,8 @@ OPCODE(0xB0B9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31126,8 +36091,11 @@ OPCODE(0xB0B9) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // CMP @@ -31135,10 +36103,9 @@ OPCODE(0xB0BA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31146,8 +36113,11 @@ OPCODE(0xB0BA) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // CMP @@ -31155,10 +36125,9 @@ OPCODE(0xB0BB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31166,16 +36135,19 @@ OPCODE(0xB0BB) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // CMP OPCODE(0xB0BC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31183,7 +36155,11 @@ OPCODE(0xB0BC) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // CMP @@ -31191,10 +36167,9 @@ OPCODE(0xB09F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31202,8 +36177,11 @@ OPCODE(0xB09F) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // CMP @@ -31211,10 +36189,9 @@ OPCODE(0xB0A7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst - src; @@ -31222,8 +36199,11 @@ OPCODE(0xB0A7) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // CMPM @@ -31231,10 +36211,9 @@ OPCODE(0xB108) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; @@ -31243,8 +36222,11 @@ OPCODE(0xB108) flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMPM @@ -31252,10 +36234,9 @@ OPCODE(0xB148) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; @@ -31264,8 +36245,11 @@ OPCODE(0xB148) flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMPM @@ -31273,10 +36257,9 @@ OPCODE(0xB188) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; @@ -31286,8 +36269,11 @@ OPCODE(0xB188) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // CMP7M @@ -31295,10 +36281,9 @@ OPCODE(0xB10F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 1; @@ -31307,8 +36292,11 @@ OPCODE(0xB10F) flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMP7M @@ -31316,10 +36304,9 @@ OPCODE(0xB14F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 2; @@ -31328,8 +36315,11 @@ OPCODE(0xB14F) flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMP7M @@ -31337,10 +36327,9 @@ OPCODE(0xB18F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) adr = AREG((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) += 4; @@ -31350,8 +36339,11 @@ OPCODE(0xB18F) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // CMPM7 @@ -31359,10 +36351,9 @@ OPCODE(0xBF08) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) adr = AREG(7); AREG(7) += 2; @@ -31371,8 +36362,11 @@ OPCODE(0xBF08) flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMPM7 @@ -31380,10 +36374,9 @@ OPCODE(0xBF48) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) adr = AREG(7); AREG(7) += 2; @@ -31392,8 +36385,11 @@ OPCODE(0xBF48) flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMPM7 @@ -31401,10 +36397,9 @@ OPCODE(0xBF88) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) adr = AREG(7); AREG(7) += 4; @@ -31414,8 +36409,11 @@ OPCODE(0xBF88) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // CMP7M7 @@ -31423,10 +36421,9 @@ OPCODE(0xBF0F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) adr = AREG(7); AREG(7) += 2; @@ -31435,8 +36432,11 @@ OPCODE(0xBF0F) flag_N = flag_C = res; flag_V = (src ^ dst) & (res ^ dst); flag_NotZ = res & 0xFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMP7M7 @@ -31444,10 +36444,9 @@ OPCODE(0xBF4F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) adr = AREG(7); AREG(7) += 2; @@ -31456,8 +36455,11 @@ OPCODE(0xBF4F) flag_V = ((src ^ dst) & (res ^ dst)) >> 8; flag_N = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMP7M7 @@ -31465,10 +36467,9 @@ OPCODE(0xBF8F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) adr = AREG(7); AREG(7) += 4; @@ -31478,36 +36479,42 @@ OPCODE(0xBF8F) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // EORDa OPCODE(0xB100) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu8((Opcode >> 9) & 7); - res = DREGu8((Opcode >> 0) & 7); + res = DREGu8((Opcode /*>> 0*/) & 7); res ^= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res; - DREGu8((Opcode >> 0) & 7) = res; -RET(4) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // EORDa OPCODE(0xB110) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31515,20 +36522,22 @@ OPCODE(0xB110) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // EORDa OPCODE(0xB118) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31536,20 +36545,22 @@ OPCODE(0xB118) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // EORDa OPCODE(0xB120) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31557,20 +36568,22 @@ OPCODE(0xB120) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // EORDa OPCODE(0xB128) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31578,20 +36591,22 @@ OPCODE(0xB128) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // EORDa OPCODE(0xB130) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31599,19 +36614,21 @@ OPCODE(0xB130) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // EORDa OPCODE(0xB138) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31619,19 +36636,21 @@ OPCODE(0xB138) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // EORDa OPCODE(0xB139) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31639,20 +36658,22 @@ OPCODE(0xB139) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // EORDa OPCODE(0xB11F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31660,20 +36681,22 @@ OPCODE(0xB11F) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // EORDa OPCODE(0xB127) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res ^= src; flag_C = 0; @@ -31681,36 +36704,42 @@ OPCODE(0xB127) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // EORDa OPCODE(0xB140) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu16((Opcode >> 9) & 7); - res = DREGu16((Opcode >> 0) & 7); + res = DREGu16((Opcode /*>> 0*/) & 7); res ^= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 8; - DREGu16((Opcode >> 0) & 7) = res; -RET(4) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // EORDa OPCODE(0xB150) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31718,20 +36747,22 @@ OPCODE(0xB150) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // EORDa OPCODE(0xB158) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31739,20 +36770,22 @@ OPCODE(0xB158) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // EORDa OPCODE(0xB160) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31760,20 +36793,22 @@ OPCODE(0xB160) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // EORDa OPCODE(0xB168) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31781,20 +36816,22 @@ OPCODE(0xB168) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // EORDa OPCODE(0xB170) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31802,19 +36839,21 @@ OPCODE(0xB170) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // EORDa OPCODE(0xB178) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31822,19 +36861,21 @@ OPCODE(0xB178) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // EORDa OPCODE(0xB179) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31842,20 +36883,22 @@ OPCODE(0xB179) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // EORDa OPCODE(0xB15F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31863,20 +36906,22 @@ OPCODE(0xB15F) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // EORDa OPCODE(0xB167) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) res ^= src; flag_C = 0; @@ -31884,36 +36929,42 @@ OPCODE(0xB167) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // EORDa OPCODE(0xB180) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + src = DREGu32((Opcode >> 9) & 7); - res = DREGu32((Opcode >> 0) & 7); + res = DREGu32((Opcode /*>> 0*/) & 7); res ^= src; flag_C = 0; flag_V = 0; flag_NotZ = res; flag_N = res >> 24; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // EORDa OPCODE(0xB190) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -31921,20 +36972,22 @@ OPCODE(0xB190) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // EORDa OPCODE(0xB198) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -31942,20 +36995,22 @@ OPCODE(0xB198) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // EORDa OPCODE(0xB1A0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -31963,20 +37018,22 @@ OPCODE(0xB1A0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // EORDa OPCODE(0xB1A8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -31984,20 +37041,22 @@ OPCODE(0xB1A8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // EORDa OPCODE(0xB1B0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -32005,19 +37064,21 @@ OPCODE(0xB1B0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // EORDa OPCODE(0xB1B8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -32025,19 +37086,21 @@ OPCODE(0xB1B8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // EORDa OPCODE(0xB1B9) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -32045,20 +37108,22 @@ OPCODE(0xB1B9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // EORDa OPCODE(0xB19F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -32066,20 +37131,22 @@ OPCODE(0xB19F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // EORDa OPCODE(0xB1A7) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) res ^= src; flag_C = 0; @@ -32087,40 +37154,51 @@ OPCODE(0xB1A7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // CMPA OPCODE(0xB0C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs16((Opcode >> 0) & 7); + + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // CMPA OPCODE(0xB0C8) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)AREGs16((Opcode >> 0) & 7); + + src = (s32)AREGs16((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // CMPA @@ -32128,9 +37206,8 @@ OPCODE(0xB0D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32138,8 +37215,11 @@ OPCODE(0xB0D0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(8) +#endif } // CMPA @@ -32147,10 +37227,9 @@ OPCODE(0xB0D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32158,8 +37237,11 @@ OPCODE(0xB0D8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(8) +#endif } // CMPA @@ -32167,10 +37249,9 @@ OPCODE(0xB0E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32178,8 +37259,11 @@ OPCODE(0xB0E0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMPA @@ -32187,10 +37271,9 @@ OPCODE(0xB0E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32198,8 +37281,11 @@ OPCODE(0xB0E8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CMPA @@ -32207,10 +37293,9 @@ OPCODE(0xB0F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32218,8 +37303,11 @@ OPCODE(0xB0F0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(11) +#endif } // CMPA @@ -32227,9 +37315,8 @@ OPCODE(0xB0F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32237,8 +37324,11 @@ OPCODE(0xB0F8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // CMPA @@ -32246,9 +37336,8 @@ OPCODE(0xB0F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32256,8 +37345,11 @@ OPCODE(0xB0F9) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // CMPA @@ -32265,10 +37357,9 @@ OPCODE(0xB0FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32276,8 +37367,11 @@ OPCODE(0xB0FA) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // CMPA @@ -32285,10 +37379,9 @@ OPCODE(0xB0FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32296,16 +37389,19 @@ OPCODE(0xB0FB) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(11) +#endif } // CMPA OPCODE(0xB0FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_SWORD(src); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32313,7 +37409,11 @@ OPCODE(0xB0FC) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(6) +#endif } // CMPA @@ -32321,10 +37421,9 @@ OPCODE(0xB0DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32332,8 +37431,11 @@ OPCODE(0xB0DF) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(8) +#endif } // CMPA @@ -32341,10 +37443,9 @@ OPCODE(0xB0E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32352,40 +37453,51 @@ OPCODE(0xB0E7) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // CMPA OPCODE(0xB1C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs32((Opcode >> 0) & 7); + + src = (s32)DREGs32((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // CMPA OPCODE(0xB1C8) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)AREGs32((Opcode >> 0) & 7); + + src = (s32)AREGs32((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; flag_NotZ = res; flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // CMPA @@ -32393,9 +37505,8 @@ OPCODE(0xB1D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32403,8 +37514,11 @@ OPCODE(0xB1D0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // CMPA @@ -32412,10 +37526,9 @@ OPCODE(0xB1D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32423,8 +37536,11 @@ OPCODE(0xB1D8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // CMPA @@ -32432,10 +37548,9 @@ OPCODE(0xB1E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32443,8 +37558,11 @@ OPCODE(0xB1E0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // CMPA @@ -32452,10 +37570,9 @@ OPCODE(0xB1E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32463,8 +37580,11 @@ OPCODE(0xB1E8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // CMPA @@ -32472,10 +37592,9 @@ OPCODE(0xB1F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32483,8 +37602,11 @@ OPCODE(0xB1F0) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(11) +#endif } // CMPA @@ -32492,9 +37614,8 @@ OPCODE(0xB1F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32502,8 +37623,11 @@ OPCODE(0xB1F8) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(8) +#endif } // CMPA @@ -32511,9 +37635,8 @@ OPCODE(0xB1F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32521,8 +37644,11 @@ OPCODE(0xB1F9) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(8) +#endif } // CMPA @@ -32530,10 +37656,9 @@ OPCODE(0xB1FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32541,8 +37666,11 @@ OPCODE(0xB1FA) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // CMPA @@ -32550,10 +37678,9 @@ OPCODE(0xB1FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32561,16 +37688,19 @@ OPCODE(0xB1FB) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(11) +#endif } // CMPA OPCODE(0xB1FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32578,7 +37708,11 @@ OPCODE(0xB1FC) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // CMPA @@ -32586,10 +37720,9 @@ OPCODE(0xB1DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32597,8 +37730,11 @@ OPCODE(0xB1DF) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(8) +#endif } // CMPA @@ -32606,10 +37742,9 @@ OPCODE(0xB1E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst - src; @@ -32617,17 +37752,20 @@ OPCODE(0xB1E7) flag_C = ((src & res & 1) + (src >> 1) + (res >> 1)) >> 23; flag_V = ((src ^ dst) & (res ^ dst)) >> 24; flag_N = res >> 24; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC000) { - u32 adr, res; - u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu8((Opcode /*>> 0*/) & 7); res = DREGu8((Opcode >> 9) & 7); res &= src; flag_C = 0; @@ -32635,17 +37773,20 @@ OPCODE(0xC000) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ANDaD OPCODE(0xC010) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32654,19 +37795,21 @@ OPCODE(0xC010) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC018) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32675,19 +37818,21 @@ OPCODE(0xC018) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC020) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32696,19 +37841,21 @@ OPCODE(0xC020) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC028) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32717,19 +37864,21 @@ OPCODE(0xC028) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC030) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32738,18 +37887,20 @@ OPCODE(0xC030) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC038) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32758,18 +37909,20 @@ OPCODE(0xC038) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC039) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32778,19 +37931,21 @@ OPCODE(0xC039) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC03A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32799,19 +37954,21 @@ OPCODE(0xC03A) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC03B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32820,16 +37977,19 @@ OPCODE(0xC03B) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC03C) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_BYTE(src); res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32838,18 +37998,21 @@ OPCODE(0xC03C) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ANDaD OPCODE(0xC01F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32858,19 +38021,21 @@ OPCODE(0xC01F) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC027) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) res = DREGu8((Opcode >> 9) & 7); res &= src; @@ -32879,17 +38044,20 @@ OPCODE(0xC027) flag_NotZ = res; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC040) { - u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = DREGu16((Opcode >> 9) & 7); res &= src; flag_C = 0; @@ -32897,17 +38065,20 @@ OPCODE(0xC040) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ANDaD OPCODE(0xC050) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -32916,19 +38087,21 @@ OPCODE(0xC050) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC058) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -32937,19 +38110,21 @@ OPCODE(0xC058) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC060) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -32958,19 +38133,21 @@ OPCODE(0xC060) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC068) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -32979,19 +38156,21 @@ OPCODE(0xC068) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC070) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33000,18 +38179,20 @@ OPCODE(0xC070) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC078) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33020,18 +38201,20 @@ OPCODE(0xC078) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC079) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33040,19 +38223,21 @@ OPCODE(0xC079) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC07A) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33061,19 +38246,21 @@ OPCODE(0xC07A) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC07B) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33082,16 +38269,19 @@ OPCODE(0xC07B) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC07C) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33100,18 +38290,21 @@ OPCODE(0xC07C) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ANDaD OPCODE(0xC05F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33120,19 +38313,21 @@ OPCODE(0xC05F) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC067) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res &= src; @@ -33141,17 +38336,20 @@ OPCODE(0xC067) flag_NotZ = res; flag_N = res >> 8; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC080) { - u32 adr, res; - u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu32((Opcode /*>> 0*/) & 7); res = DREGu32((Opcode >> 9) & 7); res &= src; flag_C = 0; @@ -33159,17 +38357,20 @@ OPCODE(0xC080) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ANDaD OPCODE(0xC090) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33178,19 +38379,21 @@ OPCODE(0xC090) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC098) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33199,19 +38402,21 @@ OPCODE(0xC098) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC0A0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33220,19 +38425,21 @@ OPCODE(0xC0A0) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC0A8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33241,19 +38448,21 @@ OPCODE(0xC0A8) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC0B0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33262,18 +38471,20 @@ OPCODE(0xC0B0) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC0B8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33282,18 +38493,20 @@ OPCODE(0xC0B8) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC0B9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33302,19 +38515,21 @@ OPCODE(0xC0B9) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC0BA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33323,19 +38538,21 @@ OPCODE(0xC0BA) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ANDaD OPCODE(0xC0BB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33344,16 +38561,19 @@ OPCODE(0xC0BB) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ANDaD OPCODE(0xC0BC) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_LONG(src); res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33362,18 +38582,21 @@ OPCODE(0xC0BC) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC09F) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33382,19 +38605,21 @@ OPCODE(0xC09F) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ANDaD OPCODE(0xC0A7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) res = DREGu32((Opcode >> 9) & 7); res &= src; @@ -33403,19 +38628,21 @@ OPCODE(0xC0A7) flag_NotZ = res; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ANDDa OPCODE(0xC110) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33423,20 +38650,22 @@ OPCODE(0xC110) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC118) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33444,20 +38673,22 @@ OPCODE(0xC118) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC120) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33465,20 +38696,22 @@ OPCODE(0xC120) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC128) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33486,20 +38719,22 @@ OPCODE(0xC128) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC130) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33507,19 +38742,21 @@ OPCODE(0xC130) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ANDDa OPCODE(0xC138) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33527,19 +38764,21 @@ OPCODE(0xC138) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC139) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33547,20 +38786,22 @@ OPCODE(0xC139) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC11F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33568,20 +38809,22 @@ OPCODE(0xC11F) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC127) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, res) res &= src; flag_C = 0; @@ -33589,19 +38832,21 @@ OPCODE(0xC127) flag_NotZ = res; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC150) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33609,20 +38854,22 @@ OPCODE(0xC150) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC158) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33630,20 +38877,22 @@ OPCODE(0xC158) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC160) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33651,20 +38900,22 @@ OPCODE(0xC160) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC168) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33672,20 +38923,22 @@ OPCODE(0xC168) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC170) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33693,19 +38946,21 @@ OPCODE(0xC170) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ANDDa OPCODE(0xC178) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33713,19 +38968,21 @@ OPCODE(0xC178) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC179) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33733,20 +38990,22 @@ OPCODE(0xC179) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC15F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33754,20 +39013,22 @@ OPCODE(0xC15F) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC167) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, res) res &= src; flag_C = 0; @@ -33775,19 +39036,21 @@ OPCODE(0xC167) flag_NotZ = res; flag_N = res >> 8; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC190) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33795,20 +39058,22 @@ OPCODE(0xC190) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC198) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33816,20 +39081,22 @@ OPCODE(0xC198) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC1A0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33837,20 +39104,22 @@ OPCODE(0xC1A0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC1A8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33858,20 +39127,22 @@ OPCODE(0xC1A8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // ANDDa OPCODE(0xC1B0) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33879,19 +39150,21 @@ OPCODE(0xC1B0) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // ANDDa OPCODE(0xC1B8) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33899,19 +39172,21 @@ OPCODE(0xC1B8) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC1B9) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33919,20 +39194,22 @@ OPCODE(0xC1B9) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC19F) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33940,20 +39217,22 @@ OPCODE(0xC19F) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ANDDa OPCODE(0xC1A7) { u32 adr, res; - u32 src, dst; - + u32 src; + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, res) res &= src; flag_C = 0; @@ -33961,17 +39240,20 @@ OPCODE(0xC1A7) flag_NotZ = res; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // ABCD OPCODE(0xC100) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = (dst & 0xF) + (src & 0xF) + ((flag_X >> M68K_SR_X_SFT) & 1); if (res > 9) res += 6; @@ -33985,7 +39267,11 @@ OPCODE(0xC100) flag_NotZ |= res & 0xFF; flag_N = res; DREGu8((Opcode >> 9) & 7) = res; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(4) +#endif } // ABCDM @@ -33993,10 +39279,9 @@ OPCODE(0xC108) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -34013,8 +39298,11 @@ OPCODE(0xC108) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // ABCD7M @@ -34022,10 +39310,9 @@ OPCODE(0xC10F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -34042,8 +39329,11 @@ OPCODE(0xC10F) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // ABCDM7 @@ -34051,10 +39341,9 @@ OPCODE(0xCF08) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -34071,8 +39360,11 @@ OPCODE(0xCF08) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // ABCD7M7 @@ -34080,10 +39372,9 @@ OPCODE(0xCF0F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -34100,27 +39391,30 @@ OPCODE(0xCF0F) flag_NotZ |= res & 0xFF; flag_N = res; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(16) +#endif } // MULU OPCODE(0xC0C0) { - u32 adr, res; - u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = DREGu16((Opcode /*>> 0*/) & 7); res = DREGu16((Opcode >> 9) & 7); res *= src; flag_N = res >> 24; flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(54) +#ifdef OPCODES_M68000 + RET(38 + bitset_count(src & 0xFFFF) * 2) #else -RET(50) + RET(27) #endif } @@ -34128,10 +39422,9 @@ RET(50) OPCODE(0xC0D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34139,11 +39432,10 @@ OPCODE(0xC0D0) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src & 0xFFFF) * 2) #else -RET(54) + RET(31) #endif } @@ -34151,11 +39443,10 @@ RET(54) OPCODE(0xC0D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34163,11 +39454,10 @@ OPCODE(0xC0D8) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src & 0xFFFF) * 2) #else -RET(54) + RET(31) #endif } @@ -34175,11 +39465,10 @@ RET(54) OPCODE(0xC0E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34187,11 +39476,10 @@ OPCODE(0xC0E0) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(60) +#ifdef OPCODES_M68000 + RET(44 + bitset_count(src & 0xFFFF) * 2) #else -RET(56) + RET(32) #endif } @@ -34199,11 +39487,10 @@ RET(56) OPCODE(0xC0E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34211,11 +39498,10 @@ OPCODE(0xC0E8) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(62) +#ifdef OPCODES_M68000 + RET(46 + bitset_count(src & 0xFFFF) * 2) #else -RET(58) + RET(32) #endif } @@ -34223,11 +39509,10 @@ RET(58) OPCODE(0xC0F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34235,11 +39520,10 @@ OPCODE(0xC0F0) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(64) +#ifdef OPCODES_M68000 + RET(48 + bitset_count(src & 0xFFFF) * 2) #else -RET(60) + RET(34) #endif } @@ -34247,10 +39531,9 @@ RET(60) OPCODE(0xC0F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34258,11 +39541,10 @@ OPCODE(0xC0F8) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(62) +#ifdef OPCODES_M68000 + RET(46 + bitset_count(src & 0xFFFF) * 2) #else -RET(58) + RET(31) #endif } @@ -34270,10 +39552,9 @@ RET(58) OPCODE(0xC0F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34281,11 +39562,10 @@ OPCODE(0xC0F9) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(66) +#ifdef OPCODES_M68000 + RET(50 + bitset_count(src & 0xFFFF) * 2) #else -RET(62) + RET(31) #endif } @@ -34293,11 +39573,10 @@ RET(62) OPCODE(0xC0FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34305,11 +39584,10 @@ OPCODE(0xC0FA) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(62) +#ifdef OPCODES_M68000 + RET(46 + bitset_count(src & 0xFFFF) * 2) #else -RET(58) + RET(32) #endif } @@ -34317,11 +39595,10 @@ RET(58) OPCODE(0xC0FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34329,20 +39606,19 @@ OPCODE(0xC0FB) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(64) +#ifdef OPCODES_M68000 + RET(48 + bitset_count(src & 0xFFFF) * 2) #else -RET(60) + RET(34) #endif } // MULU OPCODE(0xC0FC) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_WORD(src); res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34350,10 +39626,10 @@ OPCODE(0xC0FC) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src & 0xFFFF) * 2) #else -RET(54) + RET(29) #endif } @@ -34361,11 +39637,10 @@ RET(54) OPCODE(0xC0DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34373,11 +39648,10 @@ OPCODE(0xC0DF) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src & 0xFFFF) * 2) #else -RET(54) + RET(31) #endif } @@ -34385,11 +39659,10 @@ RET(54) OPCODE(0xC0E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) res = DREGu16((Opcode >> 9) & 7); res *= src; @@ -34397,31 +39670,30 @@ OPCODE(0xC0E7) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(60) +#ifdef OPCODES_M68000 + RET(44 + bitset_count(src & 0xFFFF) * 2) #else -RET(56) + RET(32) #endif } // MULS OPCODE(0xC1C0) { - u32 adr, res; - u32 src, dst; - - src = (s32)DREGs16((Opcode >> 0) & 7); + u32 res; + u32 src; + + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); flag_N = res >> 24; flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(54) +#ifdef OPCODES_M68000 + RET(38 + bitset_count(src ^ (src << 1)) * 2) #else -RET(50) + RET(27) #endif } @@ -34429,10 +39701,9 @@ RET(50) OPCODE(0xC1D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34440,11 +39711,10 @@ OPCODE(0xC1D0) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src ^ (src << 1)) * 2) #else -RET(54) + RET(31) #endif } @@ -34452,11 +39722,10 @@ RET(54) OPCODE(0xC1D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34464,11 +39733,10 @@ OPCODE(0xC1D8) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src ^ (src << 1)) * 2) #else -RET(54) + RET(31) #endif } @@ -34476,11 +39744,10 @@ RET(54) OPCODE(0xC1E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34488,11 +39755,10 @@ OPCODE(0xC1E0) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(60) +#ifdef OPCODES_M68000 + RET(44 + bitset_count(src ^ (src << 1)) * 2) #else -RET(56) + RET(32) #endif } @@ -34500,11 +39766,10 @@ RET(56) OPCODE(0xC1E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34512,11 +39777,10 @@ OPCODE(0xC1E8) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(62) +#ifdef OPCODES_M68000 + RET(46 + bitset_count(src ^ (src << 1)) * 2) #else -RET(58) + RET(32) #endif } @@ -34524,11 +39788,10 @@ RET(58) OPCODE(0xC1F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34536,11 +39799,10 @@ OPCODE(0xC1F0) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(64) +#ifdef OPCODES_M68000 + RET(48 + bitset_count(src ^ (src << 1)) * 2) #else -RET(60) + RET(34) #endif } @@ -34548,10 +39810,9 @@ RET(60) OPCODE(0xC1F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34559,11 +39820,10 @@ OPCODE(0xC1F8) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(62) +#ifdef OPCODES_M68000 + RET(46 + bitset_count(src ^ (src << 1)) * 2) #else -RET(58) + RET(31) #endif } @@ -34571,10 +39831,9 @@ RET(58) OPCODE(0xC1F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34582,11 +39841,10 @@ OPCODE(0xC1F9) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(66) +#ifdef OPCODES_M68000 + RET(50 + bitset_count(src ^ (src << 1)) * 2) #else -RET(62) + RET(31) #endif } @@ -34594,11 +39852,10 @@ RET(62) OPCODE(0xC1FA) { u32 adr, res; - u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + u32 src; + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34606,11 +39863,10 @@ OPCODE(0xC1FA) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(62) +#ifdef OPCODES_M68000 + RET(46 + bitset_count(src ^ (src << 1)) * 2) #else -RET(58) + RET(32) #endif } @@ -34618,11 +39874,10 @@ RET(58) OPCODE(0xC1FB) { u32 adr, res; - u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34630,20 +39885,19 @@ OPCODE(0xC1FB) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(64) +#ifdef OPCODES_M68000 + RET(48 + bitset_count(src ^ (src << 1)) * 2) #else -RET(60) + RET(34) #endif } // MULS OPCODE(0xC1FC) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; + FETCH_SWORD(src); res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34651,10 +39905,10 @@ OPCODE(0xC1FC) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src ^ (src << 1)) * 2) #else -RET(54) + RET(29) #endif } @@ -34662,11 +39916,10 @@ RET(54) OPCODE(0xC1DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34674,11 +39927,10 @@ OPCODE(0xC1DF) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(58) +#ifdef OPCODES_M68000 + RET(42 + bitset_count(src ^ (src << 1)) * 2) #else -RET(54) + RET(31) #endif } @@ -34686,11 +39938,10 @@ RET(54) OPCODE(0xC1E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READSX_WORD_F(adr, src) res = (s32)DREGs16((Opcode >> 9) & 7); res = ((s32)res) * ((s32)src); @@ -34698,91 +39949,99 @@ OPCODE(0xC1E7) flag_NotZ = res; flag_V = flag_C = 0; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -#ifdef USE_CYCLONE_TIMING -RET(60) +#ifdef OPCODES_M68000 + RET(44 + bitset_count(src ^ (src << 1)) * 2) #else -RET(56) + RET(32) #endif } // EXGDD OPCODE(0xC140) { - u32 adr, res; - u32 src, dst; - - res = DREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + res = DREGu32((Opcode /*>> 0*/) & 7); src = DREGu32((Opcode >> 9) & 7); DREGu32((Opcode >> 9) & 7) = res; res = src; - DREGu32((Opcode >> 0) & 7) = res; -RET(6) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // EXGAA OPCODE(0xC148) { - u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + res = AREGu32((Opcode /*>> 0*/) & 7); src = AREGu32((Opcode >> 9) & 7); AREG((Opcode >> 9) & 7) = res; res = src; - AREG((Opcode >> 0) & 7) = res; -RET(6) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // EXGAD OPCODE(0xC188) { - u32 adr, res; - u32 src, dst; - - res = AREGu32((Opcode >> 0) & 7); + u32 res; + u32 src; + + res = AREGu32((Opcode /*>> 0*/) & 7); src = DREGu32((Opcode >> 9) & 7); DREGu32((Opcode >> 9) & 7) = res; res = src; - AREG((Opcode >> 0) & 7) = res; -RET(6) + AREG((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6) +#else + RET(2) +#endif } // ADDaD OPCODE(0xD000) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDaD OPCODE(0xD008) { - u32 adr, res; - u32 src, dst; - // can't read byte from Ax registers ! m68kcontext.execinfo |= M68K_FAULTED; - io_cycle_counter = 0; -/* - goto famec_Exec_End; - dst = DREGu8((Opcode >> 9) & 7); - res = dst + src; - flag_N = flag_X = flag_C = res; - flag_V = (src ^ res) & (dst ^ res); - flag_NotZ = res & 0xFF; - DREGu8((Opcode >> 9) & 7) = res; -*/ -RET(4) +#ifdef OPCODES_M68000 + m68kcontext.io_cycle_counter = 4; + RET(4) +#else + m68kcontext.io_cycle_counter = 2; + RET(2) +#endif } // ADDaD @@ -34790,9 +40049,8 @@ OPCODE(0xD010) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34800,8 +40058,11 @@ OPCODE(0xD010) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ADDaD @@ -34809,10 +40070,9 @@ OPCODE(0xD018) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34820,8 +40080,11 @@ OPCODE(0xD018) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ADDaD @@ -34829,10 +40092,9 @@ OPCODE(0xD020) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34840,8 +40102,11 @@ OPCODE(0xD020) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ADDaD @@ -34849,10 +40114,9 @@ OPCODE(0xD028) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34860,8 +40124,11 @@ OPCODE(0xD028) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ADDaD @@ -34869,10 +40136,9 @@ OPCODE(0xD030) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34880,8 +40146,11 @@ OPCODE(0xD030) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDaD @@ -34889,9 +40158,8 @@ OPCODE(0xD038) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34899,8 +40167,11 @@ OPCODE(0xD038) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ADDaD @@ -34908,9 +40179,8 @@ OPCODE(0xD039) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34918,8 +40188,11 @@ OPCODE(0xD039) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ADDaD @@ -34927,10 +40200,9 @@ OPCODE(0xD03A) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34938,8 +40210,11 @@ OPCODE(0xD03A) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ADDaD @@ -34947,10 +40222,9 @@ OPCODE(0xD03B) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34958,16 +40232,19 @@ OPCODE(0xD03B) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDaD OPCODE(0xD03C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_BYTE(src); dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34975,7 +40252,11 @@ OPCODE(0xD03C) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ADDaD @@ -34983,10 +40264,9 @@ OPCODE(0xD01F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -34994,8 +40274,11 @@ OPCODE(0xD01F) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ADDaD @@ -35003,10 +40286,9 @@ OPCODE(0xD027) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) dst = DREGu8((Opcode >> 9) & 7); res = dst + src; @@ -35014,40 +40296,51 @@ OPCODE(0xD027) flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ADDaD OPCODE(0xD040) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + + src = DREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDaD OPCODE(0xD048) { - u32 adr, res; + u32 res; u32 src, dst; - - src = AREGu16((Opcode >> 0) & 7); + + src = AREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDaD @@ -35055,9 +40348,8 @@ OPCODE(0xD050) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35065,8 +40357,11 @@ OPCODE(0xD050) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ADDaD @@ -35074,10 +40369,9 @@ OPCODE(0xD058) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35085,8 +40379,11 @@ OPCODE(0xD058) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ADDaD @@ -35094,10 +40391,9 @@ OPCODE(0xD060) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35105,8 +40401,11 @@ OPCODE(0xD060) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ADDaD @@ -35114,10 +40413,9 @@ OPCODE(0xD068) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35125,8 +40423,11 @@ OPCODE(0xD068) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ADDaD @@ -35134,10 +40435,9 @@ OPCODE(0xD070) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35145,8 +40445,11 @@ OPCODE(0xD070) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDaD @@ -35154,9 +40457,8 @@ OPCODE(0xD078) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35164,8 +40466,11 @@ OPCODE(0xD078) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ADDaD @@ -35173,9 +40478,8 @@ OPCODE(0xD079) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35183,8 +40487,11 @@ OPCODE(0xD079) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ADDaD @@ -35192,10 +40499,9 @@ OPCODE(0xD07A) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35203,8 +40509,11 @@ OPCODE(0xD07A) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(7) +#endif } // ADDaD @@ -35212,10 +40521,9 @@ OPCODE(0xD07B) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35223,16 +40531,19 @@ OPCODE(0xD07B) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDaD OPCODE(0xD07C) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_WORD(src); dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35240,7 +40551,11 @@ OPCODE(0xD07C) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(4) +#endif } // ADDaD @@ -35248,10 +40563,9 @@ OPCODE(0xD05F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35259,8 +40573,11 @@ OPCODE(0xD05F) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ADDaD @@ -35268,10 +40585,9 @@ OPCODE(0xD067) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) dst = DREGu16((Opcode >> 9) & 7); res = dst + src; @@ -35279,17 +40595,20 @@ OPCODE(0xD067) flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; DREGu16((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(10) +#else + RET(7) +#endif } // ADDaD OPCODE(0xD080) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + + src = DREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst + src; flag_NotZ = res; @@ -35297,16 +40616,20 @@ OPCODE(0xD080) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ADDaD OPCODE(0xD088) { - u32 adr, res; + u32 res; u32 src, dst; - - src = AREGu32((Opcode >> 0) & 7); + + src = AREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst + src; flag_NotZ = res; @@ -35314,7 +40637,11 @@ OPCODE(0xD088) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ADDaD @@ -35322,9 +40649,8 @@ OPCODE(0xD090) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35333,8 +40659,11 @@ OPCODE(0xD090) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ADDaD @@ -35342,10 +40671,9 @@ OPCODE(0xD098) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35354,8 +40682,11 @@ OPCODE(0xD098) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ADDaD @@ -35363,10 +40694,9 @@ OPCODE(0xD0A0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35375,8 +40705,11 @@ OPCODE(0xD0A0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ADDaD @@ -35384,10 +40717,9 @@ OPCODE(0xD0A8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35396,8 +40728,11 @@ OPCODE(0xD0A8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ADDaD @@ -35405,10 +40740,9 @@ OPCODE(0xD0B0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35417,8 +40751,11 @@ OPCODE(0xD0B0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ADDaD @@ -35426,9 +40763,8 @@ OPCODE(0xD0B8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35437,8 +40773,11 @@ OPCODE(0xD0B8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // ADDaD @@ -35446,9 +40785,8 @@ OPCODE(0xD0B9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35457,8 +40795,11 @@ OPCODE(0xD0B9) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // ADDaD @@ -35466,10 +40807,9 @@ OPCODE(0xD0BA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35478,8 +40818,11 @@ OPCODE(0xD0BA) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ADDaD @@ -35487,10 +40830,9 @@ OPCODE(0xD0BB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35499,16 +40841,19 @@ OPCODE(0xD0BB) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ADDaD OPCODE(0xD0BC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_LONG(src); dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35517,7 +40862,11 @@ OPCODE(0xD0BC) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ADDaD @@ -35525,10 +40874,9 @@ OPCODE(0xD09F) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35537,8 +40885,11 @@ OPCODE(0xD09F) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ADDaD @@ -35546,10 +40897,9 @@ OPCODE(0xD0A7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) dst = DREGu32((Opcode >> 9) & 7); res = dst + src; @@ -35558,8 +40908,11 @@ OPCODE(0xD0A7) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ADDDa @@ -35567,18 +40920,20 @@ OPCODE(0xD110) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDDa @@ -35586,19 +40941,21 @@ OPCODE(0xD118) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 1; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 1; READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDDa @@ -35606,19 +40963,21 @@ OPCODE(0xD120) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDDa @@ -35626,19 +40985,21 @@ OPCODE(0xD128) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ADDDa @@ -35646,19 +41007,21 @@ OPCODE(0xD130) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ADDDa @@ -35666,18 +41029,20 @@ OPCODE(0xD138) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ADDDa @@ -35685,18 +41050,20 @@ OPCODE(0xD139) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDDa @@ -35704,19 +41071,21 @@ OPCODE(0xD11F) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDDa @@ -35724,19 +41093,21 @@ OPCODE(0xD127) { u32 adr, res; u32 src, dst; - + src = DREGu8((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, dst) res = dst + src; flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ = res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDDa @@ -35744,18 +41115,20 @@ OPCODE(0xD150) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDDa @@ -35763,19 +41136,21 @@ OPCODE(0xD158) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDDa @@ -35783,19 +41158,21 @@ OPCODE(0xD160) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDDa @@ -35803,19 +41180,21 @@ OPCODE(0xD168) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ADDDa @@ -35823,19 +41202,21 @@ OPCODE(0xD170) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(11) +#endif } // ADDDa @@ -35843,18 +41224,20 @@ OPCODE(0xD178) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(8) +#endif } // ADDDa @@ -35862,18 +41245,20 @@ OPCODE(0xD179) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDDa @@ -35881,19 +41266,21 @@ OPCODE(0xD15F) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(8) +#endif } // ADDDa @@ -35901,19 +41288,21 @@ OPCODE(0xD167) { u32 adr, res; u32 src, dst; - + src = DREGu16((Opcode >> 9) & 7); adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, dst) res = dst + src; flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ = res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(9) +#endif } // ADDDa @@ -35921,10 +41310,9 @@ OPCODE(0xD190) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -35932,8 +41320,11 @@ OPCODE(0xD190) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDDa @@ -35941,11 +41332,10 @@ OPCODE(0xD198) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -35953,8 +41343,11 @@ OPCODE(0xD198) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDDa @@ -35962,11 +41355,10 @@ OPCODE(0xD1A0) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -35974,8 +41366,11 @@ OPCODE(0xD1A0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // ADDDa @@ -35983,11 +41378,10 @@ OPCODE(0xD1A8) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -35995,8 +41389,11 @@ OPCODE(0xD1A8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(9) +#endif } // ADDDa @@ -36004,11 +41401,10 @@ OPCODE(0xD1B0) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -36016,8 +41412,11 @@ OPCODE(0xD1B0) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(26) +#ifdef OPCODES_M68000 + RET(26) +#else + RET(11) +#endif } // ADDDa @@ -36025,10 +41424,9 @@ OPCODE(0xD1B8) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); FETCH_SWORD(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -36036,8 +41434,11 @@ OPCODE(0xD1B8) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(24) +#ifdef OPCODES_M68000 + RET(24) +#else + RET(8) +#endif } // ADDDa @@ -36045,10 +41446,9 @@ OPCODE(0xD1B9) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); FETCH_LONG(adr); - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -36056,8 +41456,11 @@ OPCODE(0xD1B9) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(28) +#ifdef OPCODES_M68000 + RET(28) +#else + RET(8) +#endif } // ADDDa @@ -36065,11 +41468,10 @@ OPCODE(0xD19F) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7); AREG(7) += 4; - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -36077,8 +41479,11 @@ OPCODE(0xD19F) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(8) +#endif } // ADDDa @@ -36086,11 +41491,10 @@ OPCODE(0xD1A7) { u32 adr, res; u32 src, dst; - + src = DREGu32((Opcode >> 9) & 7); adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, dst) res = dst + src; flag_NotZ = res; @@ -36098,49 +41502,60 @@ OPCODE(0xD1A7) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(9) +#endif } // ADDX OPCODE(0xD100) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu8((Opcode >> 0) & 7); + + src = DREGu8((Opcode /*>> 0*/) & 7); dst = DREGu8((Opcode >> 9) & 7); res = dst + src + ((flag_X >> 8) & 1); flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ |= res & 0xFF; DREGu8((Opcode >> 9) & 7) = res; -RET(4) +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDX OPCODE(0xD140) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu16((Opcode >> 0) & 7); + + src = DREGu16((Opcode /*>> 0*/) & 7); dst = DREGu16((Opcode >> 9) & 7); res = dst + src + ((flag_X >> 8) & 1); flag_V = ((src ^ res) & (dst ^ res)) >> 8; flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; - DREGu16((Opcode >> 9) & 7) = res; -RET(4) + DREGu16((Opcode >> 9) & 7) = res; +#ifdef OPCODES_M68000 + RET(4) +#else + RET(2) +#endif } // ADDX OPCODE(0xD180) { - u32 adr, res; + u32 res; u32 src, dst; - - src = DREGu32((Opcode >> 0) & 7); + + src = DREGu32((Opcode /*>> 0*/) & 7); dst = DREGu32((Opcode >> 9) & 7); res = dst + src + ((flag_X >> 8) & 1); flag_NotZ |= res; @@ -36148,7 +41563,11 @@ OPCODE(0xD180) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; DREGu32((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ADDXM @@ -36156,10 +41575,9 @@ OPCODE(0xD108) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -36169,8 +41587,11 @@ OPCODE(0xD108) flag_V = (src ^ res) & (dst ^ res); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDXM @@ -36178,10 +41599,9 @@ OPCODE(0xD148) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; @@ -36191,8 +41611,11 @@ OPCODE(0xD148) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDXM @@ -36200,10 +41623,9 @@ OPCODE(0xD188) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; @@ -36214,8 +41636,11 @@ OPCODE(0xD188) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // ADDX7M @@ -36223,10 +41648,9 @@ OPCODE(0xD10F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 1; AREG((Opcode >> 9) & 7) = adr; @@ -36235,9 +41659,12 @@ OPCODE(0xD10F) flag_N = flag_X = flag_C = res; flag_V = (src ^ res) & (dst ^ res); flag_NotZ |= res & 0xFF; - WRITE_BYTE_F(adr, res) - POST_IO -RET(18) + WRITE_BYTE_F(adr, res) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDX7M @@ -36245,10 +41672,9 @@ OPCODE(0xD14F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 2; AREG((Opcode >> 9) & 7) = adr; @@ -36258,8 +41684,11 @@ OPCODE(0xD14F) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDX7M @@ -36267,10 +41696,9 @@ OPCODE(0xD18F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) adr = AREG((Opcode >> 9) & 7) - 4; AREG((Opcode >> 9) & 7) = adr; @@ -36281,8 +41709,11 @@ OPCODE(0xD18F) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // ADDXM7 @@ -36290,10 +41721,9 @@ OPCODE(0xDF08) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 1; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 1; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -36303,8 +41733,11 @@ OPCODE(0xDF08) flag_V = (src ^ res) & (dst ^ res); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDXM7 @@ -36312,10 +41745,9 @@ OPCODE(0xDF48) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -36325,8 +41757,11 @@ OPCODE(0xDF48) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDXM7 @@ -36334,10 +41769,9 @@ OPCODE(0xDF88) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_LONG_F(adr, src) adr = AREG(7) - 4; AREG(7) = adr; @@ -36348,8 +41782,11 @@ OPCODE(0xDF88) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // ADDX7M7 @@ -36357,10 +41794,9 @@ OPCODE(0xDF0F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_BYTE_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -36370,8 +41806,11 @@ OPCODE(0xDF0F) flag_V = (src ^ res) & (dst ^ res); flag_NotZ |= res & 0xFF; WRITE_BYTE_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDX7M7 @@ -36379,10 +41818,9 @@ OPCODE(0xDF4F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) adr = AREG(7) - 2; AREG(7) = adr; @@ -36392,8 +41830,11 @@ OPCODE(0xDF4F) flag_N = flag_X = flag_C = res >> 8; flag_NotZ |= res & 0xFFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ADDX7M7 @@ -36401,10 +41842,9 @@ OPCODE(0xDF8F) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READ_LONG_F(adr, src) adr = AREG(7) - 4; AREG(7) = adr; @@ -36415,34 +41855,45 @@ OPCODE(0xDF8F) flag_V = ((src ^ res) & (dst ^ res)) >> 24; flag_N = res >> 24; WRITE_LONG_F(adr, res) - POST_IO -RET(30) +#ifdef OPCODES_M68000 + RET(30) +#else + RET(12) +#endif } // ADDA OPCODE(0xD0C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs16((Opcode >> 0) & 7); + + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ADDA OPCODE(0xD0C8) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)AREGs16((Opcode >> 0) & 7); + + src = (s32)AREGs16((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; -RET(8) +#ifdef OPCODES_M68000 + RET(8) +#else + RET(2) +#endif } // ADDA @@ -36450,15 +41901,17 @@ OPCODE(0xD0D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ADDA @@ -36466,16 +41919,18 @@ OPCODE(0xD0D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ADDA @@ -36483,16 +41938,18 @@ OPCODE(0xD0E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // ADDA @@ -36500,16 +41957,18 @@ OPCODE(0xD0E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ADDA @@ -36517,16 +41976,18 @@ OPCODE(0xD0F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ADDA @@ -36534,15 +41995,17 @@ OPCODE(0xD0F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(6) +#endif } // ADDA @@ -36550,15 +42013,17 @@ OPCODE(0xD0F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(6) +#endif } // ADDA @@ -36566,16 +42031,18 @@ OPCODE(0xD0FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ADDA @@ -36583,29 +42050,35 @@ OPCODE(0xD0FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(9) +#endif } // ADDA OPCODE(0xD0FC) { - u32 adr, res; + u32 res; u32 src, dst; - + FETCH_SWORD(src); dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(4) +#endif } // ADDA @@ -36613,16 +42086,18 @@ OPCODE(0xD0DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 2; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(10) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(6) +#endif } // ADDA @@ -36630,49 +42105,51 @@ OPCODE(0xD0E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READSX_WORD_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(7) +#endif } // ADDA OPCODE(0xD1C0) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)DREGs32((Opcode >> 0) & 7); + + src = (s32)DREGs32((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(8) +#ifdef OPCODES_M68000 + RET(8) #else -RET(6) + RET(2) #endif } // ADDA OPCODE(0xD1C8) { - u32 adr, res; + u32 res; u32 src, dst; - - src = (s32)AREGs32((Opcode >> 0) & 7); + + src = (s32)AREGs32((Opcode /*>> 0*/) & 7); dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(8) +#ifdef OPCODES_M68000 + RET(8) #else -RET(6) + RET(2) #endif } @@ -36681,15 +42158,17 @@ OPCODE(0xD1D0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ADDA @@ -36697,16 +42176,18 @@ OPCODE(0xD1D8) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 4; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 4; READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ADDA @@ -36714,16 +42195,18 @@ OPCODE(0xD1E0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 4; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7) - 4; + AREG((Opcode /*>> 0*/) & 7) = adr; READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ADDA @@ -36731,16 +42214,18 @@ OPCODE(0xD1E8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ADDA @@ -36748,16 +42233,18 @@ OPCODE(0xD1F0) { u32 adr, res; u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ADDA @@ -36765,15 +42252,17 @@ OPCODE(0xD1F8) { u32 adr, res; u32 src, dst; - + FETCH_SWORD(adr); - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(6) +#endif } // ADDA @@ -36781,15 +42270,17 @@ OPCODE(0xD1F9) { u32 adr, res; u32 src, dst; - + FETCH_LONG(adr); - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(22) +#ifdef OPCODES_M68000 + RET(22) +#else + RET(6) +#endif } // ADDA @@ -36797,16 +42288,18 @@ OPCODE(0xD1FA) { u32 adr, res; u32 src, dst; - - adr = GET_SWORD + ((u32)(PC) - BasePC); + + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); PC++; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(7) +#endif } // ADDA @@ -36814,16 +42307,18 @@ OPCODE(0xD1FB) { u32 adr, res; u32 src, dst; - - adr = (u32)(PC) - BasePC; - DECODE_EXT_WORD - PRE_IO + + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ADDA @@ -36831,15 +42326,15 @@ OPCODE(0xD1FC) { u32 adr, res; u32 src, dst; - + FETCH_LONG(src); dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; -#ifdef USE_CYCLONE_TIMING -RET(16) +#ifdef OPCODES_M68000 + RET(16) #else -RET(14) + RET(6) #endif } @@ -36848,16 +42343,18 @@ OPCODE(0xD1DF) { u32 adr, res; u32 src, dst; - + adr = AREG(7); AREG(7) += 4; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(6) +#endif } // ADDA @@ -36865,188 +42362,204 @@ OPCODE(0xD1E7) { u32 adr, res; u32 src, dst; - + adr = AREG(7) - 4; AREG(7) = adr; - PRE_IO READSX_LONG_F(adr, src) dst = AREGu32((Opcode >> 9) & 7); res = dst + src; AREG((Opcode >> 9) & 7) = res; - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(7) +#endif } // ASRk OPCODE(0xE000) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = (s32)DREGs8((Opcode >> 0) & 7); + src = (s32)DREGs8((Opcode /*>> 0*/) & 7); flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = ((s32)src) >> sft; flag_N = res >> 0; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } // ASRk OPCODE(0xE040) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = (s32)DREGs16((Opcode >> 0) & 7); + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = ((s32)src) >> sft; flag_N = res >> 8; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } // ASRk OPCODE(0xE080) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = (s32)DREGs32((Opcode >> 0) & 7); + src = (s32)DREGs32((Opcode /*>> 0*/) & 7); flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = ((s32)src) >> sft; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } // LSRk OPCODE(0xE008) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); flag_N = flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = src >> sft; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } // LSRk OPCODE(0xE048) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); flag_N = flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = src >> sft; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } // LSRk OPCODE(0xE088) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); flag_N = flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = src >> sft; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } // ROXRk OPCODE(0xE010) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); src |= (flag_X & M68K_SR_X) << 0; res = (src >> sft) | (src << (9 - sft)); flag_X = flag_C = res >> 0; flag_V = 0; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(12) +#endif } // ROXRk OPCODE(0xE050) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); src |= (flag_X & M68K_SR_X) << 8; res = (src >> sft) | (src << (17 - sft)); flag_X = flag_C = res >> 8; flag_V = 0; flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(12) +#endif } // ROXRk OPCODE(0xE090) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); flag_C = src << ((M68K_SR_C_SFT + 1) - sft); if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1))); else res = (src >> sft) | (src << (33 - sft)) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + sft))); @@ -37054,88 +42567,96 @@ OPCODE(0xE090) flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(12) +#endif } // RORk OPCODE(0xE018) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); flag_V = 0; flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = (src >> sft) | (src << (8 - sft)); flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } // RORk OPCODE(0xE058) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); flag_V = 0; flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = (src >> sft) | (src << (16 - sft)); flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } // RORk OPCODE(0xE098) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); flag_V = 0; flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = (src >> sft) | (src << (32 - sft)); flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(8) +#endif } // ASLk OPCODE(0xE100) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft < 8) { flag_X = flag_C = src << (0 + sft); res = src << sft; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; flag_V = 0; if ((sft > 7) && (src)) flag_V = M68K_SR_V; else @@ -37144,182 +42665,202 @@ OPCODE(0xE100) src &= msk; if ((src) && (src != msk)) flag_V = M68K_SR_V; } - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } - + if (src) flag_V = M68K_SR_V; else flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; flag_N = 0; flag_NotZ = 0; -RET(6) +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } // ASLk OPCODE(0xE140) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); - flag_X = flag_C = src >> (8 - sft); - res = src << sft; - flag_N = res >> 8; - flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; - flag_V = 0; - { - u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF; - src &= msk; - if ((src) && (src != msk)) flag_V = M68K_SR_V; - } -RET(6) + src = DREGu16((Opcode /*>> 0*/) & 7); + flag_X = flag_C = src >> (8 - sft); + res = src << sft; + flag_N = res >> 8; + flag_NotZ = res & 0x0000FFFF; + DREGu16((Opcode /*>> 0*/) & 7) = res; + flag_V = 0; + { + u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF; + src &= msk; + if ((src) && (src != msk)) flag_V = M68K_SR_V; + } +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } // ASLk OPCODE(0xE180) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); - flag_X = flag_C = src >> (24 - sft); - res = src << sft; - flag_N = res >> 24; - flag_NotZ = res & 0xFFFFFFFF; - DREGu32((Opcode >> 0) & 7) = res; - flag_V = 0; - { - u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF; - src &= msk; - if ((src) && (src != msk)) flag_V = M68K_SR_V; - } -RET(8) + src = DREGu32((Opcode /*>> 0*/) & 7); + flag_X = flag_C = src >> (24 - sft); + res = src << sft; + flag_N = res >> 24; + flag_NotZ = res & 0xFFFFFFFF; + DREGu32((Opcode /*>> 0*/) & 7) = res; + flag_V = 0; + { + u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF; + src &= msk; + if ((src) && (src != msk)) flag_V = M68K_SR_V; + } +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(8) +#endif } // LSLk OPCODE(0xE108) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); flag_V = 0; flag_X = flag_C = src << (0 + sft); res = src << sft; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } // LSLk OPCODE(0xE148) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); flag_V = 0; flag_X = flag_C = src >> (8 - sft); res = src << sft; flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } // LSLk OPCODE(0xE188) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); flag_V = 0; flag_X = flag_C = src >> (24 - sft); res = src << sft; flag_N = res >> 24; flag_NotZ = res & 0xFFFFFFFF; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } // ROXLk OPCODE(0xE110) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); src |= (flag_X & M68K_SR_X) << 0; res = (src << sft) | (src >> (9 - sft)); flag_X = flag_C = res >> 0; flag_V = 0; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(12) +#endif } // ROXLk OPCODE(0xE150) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); src |= (flag_X & M68K_SR_X) << 8; res = (src << sft) | (src >> (17 - sft)); flag_X = flag_C = res >> 8; flag_V = 0; flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(12) +#endif } // ROXLk OPCODE(0xE190) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); flag_C = src >> ((32 - M68K_SR_C_SFT) - sft); if (sft == 1) res = (src << 1) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - 1)); else res = (src << sft) | (src >> (33 - sft)) | ((flag_X & M68K_SR_X) >> ((M68K_SR_X_SFT + 1) - sft)); @@ -37327,83 +42868,91 @@ OPCODE(0xE190) flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(12) +#endif } // ROLk OPCODE(0xE118) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); flag_V = 0; flag_C = src << (0 + sft); res = (src << sft) | (src >> (8 - sft)); flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; -RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } // ROLk OPCODE(0xE158) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); flag_V = 0; flag_C = src >> (8 - sft); res = (src << sft) | (src >> (16 - sft)); flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; -RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } // ROLk OPCODE(0xE198) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = (((Opcode >> 9) - 1) & 7) + 1; - io_cycle_counter -= sft * 2; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); flag_V = 0; flag_C = src >> (24 - sft); res = (src << sft) | (src >> (32 - sft)); flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; -RET(8) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(8) +#endif } // ASRD OPCODE(0xE020) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = (s32)DREGs8((Opcode >> 0) & 7); + src = (s32)DREGs8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 8) { flag_V = 0; @@ -37411,10 +42960,14 @@ OPCODE(0xE020) res = ((s32)src) >> sft; flag_N = res >> 0; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + if (src & (1 << 7)) { flag_N = M68K_SR_N; @@ -37423,40 +42976,50 @@ OPCODE(0xE020) flag_C = M68K_SR_C; flag_X = M68K_SR_X; res = 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_N = 0; flag_NotZ = 0; flag_V = 0; flag_C = 0; flag_X = 0; res = 0; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // ASRD OPCODE(0xE060) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = (s32)DREGs16((Opcode >> 0) & 7); + src = (s32)DREGs16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 16) { flag_V = 0; @@ -37464,10 +43027,14 @@ OPCODE(0xE060) res = ((s32)src) >> sft; flag_N = res >> 8; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + if (src & (1 << 15)) { flag_N = M68K_SR_N; @@ -37476,45 +43043,50 @@ OPCODE(0xE060) flag_C = M68K_SR_C; flag_X = M68K_SR_X; res = 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_N = 0; flag_NotZ = 0; flag_V = 0; flag_C = 0; flag_X = 0; res = 0; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // ASRD OPCODE(0xE0A0) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = (s32)DREGs32((Opcode >> 0) & 7); + src = (s32)DREGs32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 32) { flag_V = 0; @@ -37522,10 +43094,14 @@ OPCODE(0xE0A0) res = ((s32)src) >> sft; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + if (src & (1 << 31)) { flag_N = M68K_SR_N; @@ -37534,134 +43110,162 @@ OPCODE(0xE0A0) flag_C = M68K_SR_C; flag_X = M68K_SR_X; res = 0xFFFFFFFF; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + flag_N = 0; flag_NotZ = 0; flag_V = 0; flag_C = 0; flag_X = 0; res = 0; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // LSRD OPCODE(0xE028) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft <= 8) { flag_N = flag_V = 0; flag_X = flag_C = src << ((M68K_SR_C_SFT + 1) - sft); res = src >> sft; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_X = flag_C = 0; flag_N = 0; flag_NotZ = 0; flag_V = 0; res = 0; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // LSRD OPCODE(0xE068) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft <= 16) { flag_N = flag_V = 0; flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT; res = src >> sft; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_X = flag_C = 0; flag_N = 0; flag_NotZ = 0; flag_V = 0; res = 0; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // LSRD OPCODE(0xE0A8) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 32) { flag_N = flag_V = 0; flag_X = flag_C = (src >> (sft - 1)) << M68K_SR_C_SFT; res = src >> sft; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + if (sft == 32) flag_C = src >> (31 - M68K_SR_C_SFT); else flag_C = 0; flag_X = flag_C; @@ -37669,387 +43273,448 @@ OPCODE(0xE0A8) flag_NotZ = 0; flag_V = 0; res = 0; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ROXRD OPCODE(0xE030) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft %= 9; - + src |= (flag_X & M68K_SR_X) << 0; res = (src >> sft) | (src << (9 - sft)); flag_X = flag_C = res >> 0; flag_V = 0; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(12) +#endif } - + flag_V = 0; flag_C = flag_X; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(12) +#endif } // ROXRD OPCODE(0xE070) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft %= 17; - + src |= (flag_X & M68K_SR_X) << 8; res = (src >> sft) | (src << (17 - sft)); flag_X = flag_C = res >> 8; flag_V = 0; flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(12) +#endif } - + flag_V = 0; flag_C = flag_X; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(12) +#endif } // ROXRD OPCODE(0xE0B0) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft %= 33; - + if (sft != 0) { if (sft == 1) res = (src >> 1) | ((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1))); else res = (src >> sft) | (src << (33 - sft)) | (((flag_X & M68K_SR_X) << (32 - (M68K_SR_X_SFT + 1))) >> (sft - 1)); - flag_X = (src >> (32 - sft)) << M68K_SR_X_SFT; + flag_X = ((src >> (sft - 1)) & 1) << M68K_SR_X_SFT; + // bug, least significant bit goes to X, not the most significant one + // flag_X = (src >> (32 - sft)) << M68K_SR_X_SFT; } else res = src; flag_C = flag_X; flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + + sftr * 2) +#else + RET(12) +#endif } - + flag_V = 0; flag_C = flag_X; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(12) +#endif } // RORD -OPCODE(0xE038) -{ - u32 adr, res; - u32 src, dst; - +OPCODE(0xE038) +{ + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft &= 0x07; - + flag_C = src << (M68K_SR_C_SFT - ((sft - 1) & 7)); res = (src >> sft) | (src << (8 - sft)); flag_V = 0; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(8) +#endif } // RORD OPCODE(0xE078) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft &= 0x0F; - + flag_C = (src >> ((sft - 1) & 15)) << M68K_SR_C_SFT; res = (src >> sft) | (src << (16 - sft)); flag_V = 0; flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(8) +#endif } // RORD OPCODE(0xE0B8) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft &= 0x1F; - + flag_C = (src >> ((sft - 1) & 31)) << M68K_SR_C_SFT; res = (src >> sft) | (src << (32 - sft)); flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(8) +#endif } // ASLD OPCODE(0xE120) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 8) { flag_X = flag_C = (src << sft) >> 0; res = (src << sft) & 0x000000FF; flag_N = res >> 0; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; flag_V = 0; { u32 msk = (((s32)0x80000000) >> (sft + 24)) & 0x000000FF; src &= msk; if ((src) && (src != msk)) flag_V = M68K_SR_V; } - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } - + if (sft == 256) flag_C = src << M68K_SR_C_SFT; else flag_C = 0; flag_X = flag_C; if (src) flag_V = M68K_SR_V; else flag_V = 0; res = 0; - DREGu8((Opcode >> 0) & 7) = res; + DREGu8((Opcode /*>> 0*/) & 7) = res; flag_N = 0; flag_NotZ = 0; - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(8) +#endif } // ASLD OPCODE(0xE160) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 16) { flag_X = flag_C = (src << sft) >> 8; res = (src << sft) & 0x0000FFFF; flag_N = res >> 8; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; + DREGu16((Opcode /*>> 0*/) & 7) = res; flag_V = 0; { u32 msk = (((s32)0x80000000) >> (sft + 16)) & 0x0000FFFF; src &= msk; if ((src) && (src != msk)) flag_V = M68K_SR_V; } - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } - + if (sft == 65536) flag_C = src << M68K_SR_C_SFT; else flag_C = 0; flag_X = flag_C; if (src) flag_V = M68K_SR_V; else flag_V = 0; res = 0; - DREGu16((Opcode >> 0) & 7) = res; + DREGu16((Opcode /*>> 0*/) & 7) = res; flag_N = 0; flag_NotZ = 0; - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(8) +#endif } // ASLD OPCODE(0xE1A0) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 32) { flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT; res = src << sft; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; + DREGu32((Opcode /*>> 0*/) & 7) = res; flag_V = 0; { u32 msk = (((s32)0x80000000) >> (sft + 0)) & 0xFFFFFFFF; src &= msk; if ((src) && (src != msk)) flag_V = M68K_SR_V; } - RET(CYC) +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(8) +#endif } - + if (sft == 0) flag_C = src << M68K_SR_C_SFT; else flag_C = 0; flag_X = flag_C; if (src) flag_V = M68K_SR_V; else flag_V = 0; res = 0; - DREGu32((Opcode >> 0) & 7) = res; + DREGu32((Opcode /*>> 0*/) & 7) = res; flag_N = 0; flag_NotZ = 0; - RET(CYC) +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(8) +#endif } // LSLD OPCODE(0xE128) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft <= 8) { flag_X = flag_C = (src << sft) >> 0; @@ -38057,39 +43722,49 @@ OPCODE(0xE128) flag_V = 0; flag_N = res >> 0; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_X = flag_C = 0; flag_N = 0; flag_NotZ = 0; flag_V = 0; res = 0; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // LSLD OPCODE(0xE168) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft <= 16) { flag_X = flag_C = (src << sft) >> 8; @@ -38097,44 +43772,49 @@ OPCODE(0xE168) flag_V = 0; flag_N = res >> 8; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_X = flag_C = 0; flag_N = 0; flag_NotZ = 0; flag_V = 0; res = 0; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(6) +#endif } // LSLD OPCODE(0xE1A8) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; if (sft < 32) { flag_X = flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT; @@ -38142,10 +43822,14 @@ OPCODE(0xE1A8) flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + if (sft == 32) flag_C = src << M68K_SR_C_SFT; else flag_C = 0; flag_X = flag_C; @@ -38153,102 +43837,117 @@ OPCODE(0xE1A8) flag_NotZ = 0; flag_V = 0; res = 0; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sft * 2) +#else + RET(6) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(6) +#endif } // ROXLD OPCODE(0xE130) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft %= 9; - + src |= (flag_X & M68K_SR_X) << 0; res = (src << sft) | (src >> (9 - sft)); flag_X = flag_C = res >> 0; flag_V = 0; flag_N = res >> 0; flag_NotZ = res & 0x000000FF; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(12) +#endif } - + flag_V = 0; flag_C = flag_X; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(12) +#endif } // ROXLD OPCODE(0xE170) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft %= 17; - + src |= (flag_X & M68K_SR_X) << 8; res = (src << sft) | (src >> (17 - sft)); flag_X = flag_C = res >> 8; flag_V = 0; flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(12) +#endif } - + flag_V = 0; flag_C = flag_X; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(12) +#endif } // ROXLD OPCODE(0xE1B0) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; sft %= 33; - + if (sft != 0) { if (sft == 1) res = (src << 1) | ((flag_X >> ((M68K_SR_X_SFT + 1) - 1)) & 1); @@ -38260,31 +43959,37 @@ OPCODE(0xE1B0) flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sftr * 2) +#else + RET(12) +#endif } - + flag_V = 0; flag_C = flag_X; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(12) +#endif } // ROLD OPCODE(0xE138) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu8((Opcode >> 0) & 7); + src = DREGu8((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; if (sft &= 0x07) { flag_C = (src << sft) >> 0; @@ -38292,37 +43997,48 @@ OPCODE(0xE138) flag_V = 0; flag_N = res >> 0; flag_NotZ = res; - DREGu8((Opcode >> 0) & 7) = res; - RET(6) + DREGu8((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = src << M68K_SR_C_SFT; flag_N = src >> 0; flag_NotZ = src; - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 0; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(8) +#endif } // ROLD OPCODE(0xE178) { - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu16((Opcode >> 0) & 7); + src = DREGu16((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; if (sft &= 0x0F) { flag_C = (src << sft) >> 8; @@ -38330,42 +44046,48 @@ OPCODE(0xE178) flag_V = 0; flag_N = res >> 8; flag_NotZ = res; - DREGu16((Opcode >> 0) & 7) = res; - RET(6) + DREGu16((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = src << M68K_SR_C_SFT; flag_N = src >> 8; flag_NotZ = src; - RET(6) +#ifdef OPCODES_M68000 + RET(6 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 8; flag_NotZ = src; -RET(6) +#ifdef OPCODES_M68000 + RET(6) +#else + RET(8) +#endif } // ROLD OPCODE(0xE1B8) { -#ifdef USE_CYCLONE_TIMING -#define CYC 8 -#else -#define CYC 6 -#endif - u32 adr, res; - u32 src, dst; - + u32 res; + u32 src; u32 sft; - + sft = DREG((Opcode >> 9) & 7) & 0x3F; - src = DREGu32((Opcode >> 0) & 7); + src = DREGu32((Opcode /*>> 0*/) & 7); if (sft) { - io_cycle_counter -= sft * 2; + u32 sftr = sft; if (sft &= 0x1F) { flag_C = (src >> (32 - sft)) << M68K_SR_C_SFT; @@ -38373,33 +44095,43 @@ OPCODE(0xE1B8) flag_V = 0; flag_N = res >> 24; flag_NotZ = res; - DREGu32((Opcode >> 0) & 7) = res; - RET(CYC) + DREGu32((Opcode /*>> 0*/) & 7) = res; +#ifdef OPCODES_M68000 + RET(8 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = src << M68K_SR_C_SFT; flag_N = src >> 24; flag_NotZ = src; - RET(CYC) +#ifdef OPCODES_M68000 + RET(8 + sftr * 2) +#else + RET(8) +#endif } - + flag_V = 0; flag_C = 0; flag_N = src >> 24; flag_NotZ = src; -RET(CYC) -#undef CYC +#ifdef OPCODES_M68000 + RET(8) +#else + RET(8) +#endif } // ASR OPCODE(0xE0D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38407,19 +44139,21 @@ OPCODE(0xE0D0) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ASR OPCODE(0xE0D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38427,19 +44161,21 @@ OPCODE(0xE0D8) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ASR OPCODE(0xE0E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38447,19 +44183,21 @@ OPCODE(0xE0E0) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ASR OPCODE(0xE0E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38467,19 +44205,21 @@ OPCODE(0xE0E8) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ASR OPCODE(0xE0F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38487,18 +44227,20 @@ OPCODE(0xE0F0) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ASR OPCODE(0xE0F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38506,18 +44248,20 @@ OPCODE(0xE0F8) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ASR OPCODE(0xE0F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38525,19 +44269,21 @@ OPCODE(0xE0F9) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ASR OPCODE(0xE0DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38545,19 +44291,21 @@ OPCODE(0xE0DF) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ASR OPCODE(0xE0E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; @@ -38565,186 +44313,206 @@ OPCODE(0xE0E7) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // LSR OPCODE(0xE2D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // LSR OPCODE(0xE2D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // LSR OPCODE(0xE2E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // LSR OPCODE(0xE2E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // LSR OPCODE(0xE2F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // LSR OPCODE(0xE2F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // LSR OPCODE(0xE2F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // LSR OPCODE(0xE2DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // LSR OPCODE(0xE2E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_N = flag_V = 0; flag_X = flag_C = src << M68K_SR_C_SFT; res = src >> 1; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ROXR OPCODE(0xE4D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38752,19 +44520,21 @@ OPCODE(0xE4D0) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ROXR OPCODE(0xE4D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38772,19 +44542,21 @@ OPCODE(0xE4D8) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(12) +#endif } // ROXR OPCODE(0xE4E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38792,19 +44564,21 @@ OPCODE(0xE4E0) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ROXR OPCODE(0xE4E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38812,19 +44586,21 @@ OPCODE(0xE4E8) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ROXR OPCODE(0xE4F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38832,18 +44608,20 @@ OPCODE(0xE4F0) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ROXR OPCODE(0xE4F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38851,18 +44629,20 @@ OPCODE(0xE4F8) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ROXR OPCODE(0xE4F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38870,19 +44650,21 @@ OPCODE(0xE4F9) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ROXR OPCODE(0xE4DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38890,19 +44672,21 @@ OPCODE(0xE4DF) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ROXR OPCODE(0xE4E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src >> 1) | ((flag_X & M68K_SR_X) << 7); @@ -38910,18 +44694,20 @@ OPCODE(0xE4E7) flag_N = res >> 8; flag_NotZ = res; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ROR OPCODE(0xE6D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -38929,19 +44715,21 @@ OPCODE(0xE6D0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(11) +#endif } // ROR OPCODE(0xE6D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -38949,19 +44737,21 @@ OPCODE(0xE6D8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(11) +#endif } // ROR OPCODE(0xE6E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -38969,19 +44759,21 @@ OPCODE(0xE6E0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif } // ROR OPCODE(0xE6E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -38989,19 +44781,21 @@ OPCODE(0xE6E8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(12) +#endif } // ROR OPCODE(0xE6F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -39009,18 +44803,20 @@ OPCODE(0xE6F0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(14) +#endif } // ROR OPCODE(0xE6F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -39028,18 +44824,20 @@ OPCODE(0xE6F8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(11) +#endif } // ROR OPCODE(0xE6F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -39047,19 +44845,21 @@ OPCODE(0xE6F9) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(11) +#endif } // ROR OPCODE(0xE6DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -39067,19 +44867,21 @@ OPCODE(0xE6DF) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(11) +#endif } // ROR OPCODE(0xE6E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src << M68K_SR_C_SFT; @@ -39087,18 +44889,20 @@ OPCODE(0xE6E7) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif } // ASL OPCODE(0xE1D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39106,19 +44910,21 @@ OPCODE(0xE1D0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(10) +#endif } // ASL OPCODE(0xE1D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39126,19 +44932,21 @@ OPCODE(0xE1D8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(10) +#endif } // ASL OPCODE(0xE1E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39146,19 +44954,21 @@ OPCODE(0xE1E0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(11) +#endif } // ASL OPCODE(0xE1E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39166,19 +44976,21 @@ OPCODE(0xE1E8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(11) +#endif } // ASL OPCODE(0xE1F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39186,18 +44998,20 @@ OPCODE(0xE1F0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(13) +#endif } // ASL OPCODE(0xE1F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39205,18 +45019,20 @@ OPCODE(0xE1F8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ASL OPCODE(0xE1F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39224,19 +45040,21 @@ OPCODE(0xE1F9) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(10) +#endif } // ASL OPCODE(0xE1DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39244,19 +45062,21 @@ OPCODE(0xE1DF) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(10) +#endif } // ASL OPCODE(0xE1E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_X = flag_C = src >> 7; res = src << 1; @@ -39264,18 +45084,20 @@ OPCODE(0xE1E7) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(11) +#endif } // LSL OPCODE(0xE3D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39283,19 +45105,21 @@ OPCODE(0xE3D0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // LSL OPCODE(0xE3D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39303,19 +45127,21 @@ OPCODE(0xE3D8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // LSL OPCODE(0xE3E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39323,19 +45149,21 @@ OPCODE(0xE3E0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // LSL OPCODE(0xE3E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39343,19 +45171,21 @@ OPCODE(0xE3E8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // LSL OPCODE(0xE3F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39363,18 +45193,20 @@ OPCODE(0xE3F0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // LSL OPCODE(0xE3F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39382,18 +45214,20 @@ OPCODE(0xE3F8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // LSL OPCODE(0xE3F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39401,19 +45235,21 @@ OPCODE(0xE3F9) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // LSL OPCODE(0xE3DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39421,19 +45257,21 @@ OPCODE(0xE3DF) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // LSL OPCODE(0xE3E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_X = flag_C = src >> 7; @@ -39441,18 +45279,20 @@ OPCODE(0xE3E7) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ROXL OPCODE(0xE5D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39460,19 +45300,21 @@ OPCODE(0xE5D0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ROXL OPCODE(0xE5D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39480,19 +45322,21 @@ OPCODE(0xE5D8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ROXL OPCODE(0xE5E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39500,19 +45344,21 @@ OPCODE(0xE5E0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ROXL OPCODE(0xE5E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39520,19 +45366,21 @@ OPCODE(0xE5E8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(10) +#endif } // ROXL OPCODE(0xE5F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39540,18 +45388,20 @@ OPCODE(0xE5F0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(12) +#endif } // ROXL OPCODE(0xE5F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39559,18 +45409,20 @@ OPCODE(0xE5F8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(9) +#endif } // ROXL OPCODE(0xE5F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39578,19 +45430,21 @@ OPCODE(0xE5F9) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(9) +#endif } // ROXL OPCODE(0xE5DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39598,19 +45452,21 @@ OPCODE(0xE5DF) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(9) +#endif } // ROXL OPCODE(0xE5E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; res = (src << 1) | ((flag_X & M68K_SR_X) >> 8); @@ -39618,18 +45474,20 @@ OPCODE(0xE5E7) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(10) +#endif } // ROL OPCODE(0xE7D0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39637,19 +45495,21 @@ OPCODE(0xE7D0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(11) +#endif } // ROL OPCODE(0xE7D8) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - AREG((Opcode >> 0) & 7) += 2; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + AREG((Opcode /*>> 0*/) & 7) += 2; READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39657,19 +45517,21 @@ OPCODE(0xE7D8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(11) +#endif } // ROL OPCODE(0xE7E0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7) - 2; - AREG((Opcode >> 0) & 7) = adr; - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7) - 2; + AREG((Opcode /*>> 0*/) & 7) = adr; READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39677,19 +45539,21 @@ OPCODE(0xE7E0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif } // ROL OPCODE(0xE7E8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - adr += AREG((Opcode >> 0) & 7); - PRE_IO + adr += AREG((Opcode /*>> 0*/) & 7); READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39697,19 +45561,21 @@ OPCODE(0xE7E8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(12) +#endif } // ROL OPCODE(0xE7F0) { u32 adr, res; - u32 src, dst; - - adr = AREG((Opcode >> 0) & 7); - DECODE_EXT_WORD - PRE_IO + u32 src; + + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39717,18 +45583,20 @@ OPCODE(0xE7F0) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(18) +#ifdef OPCODES_M68000 + RET(18) +#else + RET(14) +#endif } // ROL OPCODE(0xE7F8) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_SWORD(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39736,18 +45604,20 @@ OPCODE(0xE7F8) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(16) +#ifdef OPCODES_M68000 + RET(16) +#else + RET(11) +#endif } // ROL OPCODE(0xE7F9) { u32 adr, res; - u32 src, dst; - + u32 src; + FETCH_LONG(adr); - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39755,19 +45625,21 @@ OPCODE(0xE7F9) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(20) +#ifdef OPCODES_M68000 + RET(20) +#else + RET(11) +#endif } // ROL OPCODE(0xE7DF) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7); AREG(7) += 2; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39775,19 +45647,21 @@ OPCODE(0xE7DF) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(12) +#ifdef OPCODES_M68000 + RET(12) +#else + RET(11) +#endif } // ROL OPCODE(0xE7E7) { u32 adr, res; - u32 src, dst; - + u32 src; + adr = AREG(7) - 2; AREG(7) = adr; - PRE_IO READ_WORD_F(adr, src) flag_V = 0; flag_C = src >> 7; @@ -39795,7 +45669,1563 @@ OPCODE(0xE7E7) flag_N = res >> 8; flag_NotZ = res & 0x0000FFFF; WRITE_WORD_F(adr, res) - POST_IO -RET(14) +#ifdef OPCODES_M68000 + RET(14) +#else + RET(12) +#endif +} + +#ifdef OPCODES_M68020 +// BFTST Dn - 68020+ +OPCODE(0xE8C0) +{ + u32 res; + u32 dst; + u32 offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, dst, offset, width) + RET(6) +} + +// BFTST (An) - 68020+ +OPCODE(0xE8D0) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(13) +} + +// BFTST (d16,An) - 68020+ +OPCODE(0xE8E8) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(21) +} + +// BFTST (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xE8F0) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(17) +} + +// BFTST (xx).W - 68020+ +OPCODE(0xE8F8) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(15) +} + +// BFTST (xx).L - 68020+ +OPCODE(0xE8F9) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(15) +} + +// BFTST (d16,PC) - 68020+ +OPCODE(0xE8FA) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(21) +} + +// BFTST (d8,PC,Xn) / (bd,PC,XN)...- 68020+ +OPCODE(0xE8FB) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + RET(17) +} + +// BFEXTU Dn - 68020+ +OPCODE(0xE9C0) +{ + u32 res; + u32 dst; + u32 offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, dst, offset, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(8) +} + +// BFEXTU (An) - 68020+ +OPCODE(0xE9D0) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(17) +} + +// BFEXTU (d16,An) - 68020+ +OPCODE(0xE9E8) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(23) +} + +// BFEXTU (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xE9F0) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(19) +} + +// BFEXTU (xx).W - 68020+ +OPCODE(0xE9F8) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(17) +} + +// BFEXTU (xx).L - 68020+ +OPCODE(0xE9F9) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(17) +} + +// BFEXTU (d16,PC) - 68020+ +OPCODE(0xE9FA) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(23) +} + +// BFEXTU (d8,PC,Xn) / (bd,PC,XN)...- 68020+ +OPCODE(0xE9FB) +{ + u32 adr, res; + u32 dst; + u32 width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + DREG((res >> 12) /*& 7*/) = dst; + RET(19) +} + +// BFCHG Dn - 68020+ +OPCODE(0xEAC0) +{ + u32 res; + u32 dst; + u32 mask, offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, dst, offset, width) + mask = ((u32)0xFFFFFFFF << (32 - width)) >> offset; + // BF_MASK(mask, offset, width) + // BF_SHIFT_UP(mask, offset, width) + DREG((Opcode /*>> 0*/) & 7) ^= mask; + RET(12) +} + +// BFCHG (An) - 68020+ +OPCODE(0xEAD0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + dst ^= mask; + BF_MEM_PUT(adr, dst, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFCHG (d16,An) - 68020+ +OPCODE(0xEAE8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + dst ^= mask; + BF_MEM_PUT(adr, dst, mask, offset, width, bf0, bf1); + RET(26) +} + +// BFCHG (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xEAF0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + dst ^= mask; + BF_MEM_PUT(adr, dst, mask, offset, width, bf0, bf1); + RET(22) +} + +// BFCHG (xx).W - 68020+ +OPCODE(0xEAF8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + dst ^= mask; + BF_MEM_PUT(adr, dst, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFCHG (xx).L - 68020+ +OPCODE(0xEAF9) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + dst ^= mask; + BF_MEM_PUT(adr, dst, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFEXTS Dn - 68020+ +OPCODE(0xEBC0) +{ + u32 adr, res; + u32 dst; + u32 mask, offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, dst, offset, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(8) +} + +// BFEXTS (An) - 68020+ +OPCODE(0xEBD0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(17) +} + +// BFEXTS (d16,An) - 68020+ +OPCODE(0xEBE8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(23) +} + +// BFEXTS (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xEBF0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(19) +} + +// BFEXTS (xx).W - 68020+ +OPCODE(0xEBF8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(17) +} + +// BFEXTS (xx).L - 68020+ +OPCODE(0xEBF9) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(17) +} + +// BFEXTS (d16,PC) - 68020+ +OPCODE(0xEBFA) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(23) +} + +// BFEXTS (d8,PC,Xn) / (bd,PC,XN)...- 68020+ +OPCODE(0xEBFB) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + BF_EXTS(dst, width, mask) + DREG((res >> 12) /*& 7*/) = dst; + RET(19) +} + +// BFCLR Dn - 68020+ +OPCODE(0xECC0) +{ + u32 adr, res; + u32 dst; + u32 mask, offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, dst, offset, width) + mask = ((u32)0xFFFFFFFF << (32 - width)) >> offset; + // BF_MASK(mask, offset, width) + // BF_SHIFT_UP(mask, offset, width) + DREG((Opcode /*>> 0*/) & 7) &= ~mask; + RET(12) +} + +// BFCLR (An) - 68020+ +OPCODE(0xECD0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst &= ~mask; + BF_MEM_PUT(adr, dst, 0/*mask*/, offset, width, bf0, bf1); + RET(20) } +// BFCLR (d16,An) - 68020+ +OPCODE(0xECE8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst &= ~mask; + BF_MEM_PUT(adr, 0/*dst*/, mask, offset, width, bf0, bf1); + RET(26) +} + +// BFCLR (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xECF0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst &= ~mask; + BF_MEM_PUT(adr, 0/*dst*/, mask, offset, width, bf0, bf1); + RET(22) +} + +// BFCLR (xx).W - 68020+ +OPCODE(0xECF8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst &= ~mask; + BF_MEM_PUT(adr, 0/*dst*/, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFCLR (xx).L - 68020+ +OPCODE(0xECF9) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst &= ~mask; + BF_MEM_PUT(adr, 0/*dst*/, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFFFO Dn - 68020+ +OPCODE(0xEDC0) +{ + u32 adr, res; + u32 src, dst; + u32 mask, offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, src, offset, width) + BF_FFO(src, mask, offset, width) + RET(18) +} + +// BFFFO (An) - 68020+ +OPCODE(0xEDD0) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(28) +} + +// BFFFO (d16,An) - 68020+ +OPCODE(0xEDE8) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(34) +} + +// BFFFO (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xEDF0) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(30) +} + +// BFFFO (xx).W - 68020+ +OPCODE(0xEDF8) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(28) +} + +// BFFFO (xx).L - 68020+ +OPCODE(0xEDF9) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(28) +} + +// BFFFO (d16,PC) - 68020+ +OPCODE(0xEDFA) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = GET_SWORD + ((uintptr_t)(PC) - BasePC); + PC++; + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(34) +} + +// BFFFO (d8,PC,Xn) / (bd,PC,XN)...- 68020+ +OPCODE(0xEDFB) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = (uintptr_t)(PC) - BasePC; + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &src, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(src, width) + BF_FFO(src, mask, dst, width) + RET(30) +} + +// BFSET Dn - 68020+ +OPCODE(0xEEC0) +{ + u32 adr, res; + u32 dst; + u32 mask, offset, width; + + FETCH_WORD(res) + BF_REG_GET(res, dst, offset, width) + mask = ((u32)0xFFFFFFFF << (32 - width)) >> offset; + // BF_MASK(mask, offset, width) + // BF_SHIFT_UP(mask, offset, width) + DREG((Opcode /*>> 0*/) & 7) |= mask; + RET(12) +} + +// BFSET (An) - 68020+ +OPCODE(0xEED0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst |= mask; + BF_MEM_PUT(adr, mask/*dst*/, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFSET (d16,An) - 68020+ +OPCODE(0xEEE8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst |= mask; + BF_MEM_PUT(adr, mask/*dst*/, mask, offset, width, bf0, bf1); + RET(26) +} + +// BFSET (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xEEF0) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst |= mask; + BF_MEM_PUT(adr, mask/*dst*/, mask, offset, width, bf0, bf1); + RET(22) +} + +// BFSET (xx).W - 68020+ +OPCODE(0xEEF8) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst |= mask; + BF_MEM_PUT(adr, mask/*dst*/, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFSET (xx).L - 68020+ +OPCODE(0xEEF9) +{ + u32 adr, res; + u32 dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + BF_GET_PARM(res, offset, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_SET_FLAGS(dst, width) + BF_MASK(mask, offset, width) + // dst |= mask; + BF_MEM_PUT(adr, mask/*dst*/, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFINS Dn - 68020+ +OPCODE(0xEFC0) +{ + u32 adr, res; + u32 src, dst; + u32 mask, offset, width; + + FETCH_WORD(res) + dst = DREG((Opcode /*>> 0*/) & 7); + src = DREG((res >> 12) /*& 7*/); + BF_GET_PARM(res, offset, width) + offset &= 0x1F; + BF_SET_FLAGS(src, width) + mask = ((u32)0xFFFFFFFF << (32 - width)) >> offset; + // BF_MASK(mask, offset, width) + // BF_SHIFT_UP(mask, offset, width) + BF_SHIFT_UP(src, offset, width) + DREG((Opcode /*>> 0*/) & 7) = (dst & ~mask) | (src & mask); + RET(10) +} + +// BFINS (An) - 68020+ +OPCODE(0xEFD0) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + src = DREG((res >> 12) /*& 7*/); + BF_GET_PARM(res, offset, width) + BF_SET_FLAGS(src, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_MASK(mask, offset, width) + BF_MEM_PUT(adr, src, mask, offset, width, bf0, bf1); + RET(18) +} + +// BFINS (d16,An) - 68020+ +OPCODE(0xEFE8) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + src = DREG((res >> 12) /*& 7*/); + BF_GET_PARM(res, offset, width) + BF_SET_FLAGS(src, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_MASK(mask, offset, width) + BF_MEM_PUT(adr, src, mask, offset, width, bf0, bf1); + RET(24) +} + +// BFINS (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0xEFF0) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + src = DREG((res >> 12) /*& 7*/); + DECODE_EXT_WORD(&adr); + BF_GET_PARM(res, offset, width) + BF_SET_FLAGS(src, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_MASK(mask, offset, width) + BF_MEM_PUT(adr, src, mask, offset, width, bf0, bf1); + RET(20) +} + +// BFINS (xx).W - 68020+ +OPCODE(0xEFF8) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_SWORD(adr) + src = DREG((res >> 12) /*& 7*/); + BF_GET_PARM(res, offset, width) + BF_SET_FLAGS(src, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_MASK(mask, offset, width) + BF_MEM_PUT(adr, src, mask, offset, width, bf0, bf1); + RET(18) +} + +// BFINS (xx).L - 68020+ +OPCODE(0xEFF9) +{ + u32 adr, res; + u32 src, dst; + u32 mask, width; + s32 offset; + u32 bf0, bf1; + + FETCH_WORD(res) + FETCH_LONG(adr) + src = DREG((res >> 12) /*& 7*/); + BF_GET_PARM(res, offset, width) + BF_SET_FLAGS(src, width) + BF_MEM_GET(&adr, &dst, &offset, width, &bf0, &bf1); + BF_MASK(mask, offset, width) + BF_MEM_PUT(adr, src, mask, offset, width, bf0, bf1); + RET(18) +} + +// CAS.B (An) - 68020+ +OPCODE(0x0AD0) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(14) +} + +// CAS.B (An)+ - 68020+ +OPCODE(0x0AD8) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + adr = AREG(areg); + AREG(areg) += 1; + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(16) +} + +// CAS.B (A7)+ - 68020+ +OPCODE(0x0ADF) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + u8 areg; + + FETCH_WORD(res) + adr = AREG(7); + AREG(7) += 2; + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(16) +} + +// CAS.B -(An) - 68020+ +OPCODE(0x0AE0) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + AREG(areg) -= 1; + adr = AREG(areg); + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(17) +} + +// CAS.B -(A7) - 68020+ +OPCODE(0x0AE7) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + AREG(areg) -= 2; + adr = AREG(areg); + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(17) +} + +// CAS.B (d16,An) - 68020+ +OPCODE(0x0AE8) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(22) +} + +// CAS.B (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x0AF0) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(18) +} + +// CAS.B (xx).W - 68020+ +OPCODE(0x0AF8) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + + FETCH_WORD(res) + FETCH_SWORD(adr) + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(16) +} + +// CAS.B (xx).L - 68020+ +OPCODE(0x0AF9) +{ + u32 adr, res; + s8 src, dst; + s8 tmp; + + FETCH_WORD(res) + FETCH_LONG(adr) + READ_BYTE_F(adr, tmp); + + CAS_EXECUTE(0, WRITE_BYTE_F(adr, DREGs8((res >> 6) & 7))) + RET(16) +} + +// CAS.W (An) - 68020+ +OPCODE(0x0CD0) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + READ_WORD_F(adr, tmp); + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(14) +} + +// CAS.W (An)+ - 68020+ +OPCODE(0x0CD8) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + adr = AREG(areg); + READ_WORD_F(adr, tmp); + AREG(areg) += 2; + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(16) +} + +// CAS.W -(An) - 68020+ +OPCODE(0x0CE0) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + AREG(areg) -= 2; + adr = AREG(areg); + READ_WORD_F(adr, tmp); + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(17) +} + +// CAS.W (d16,An) - 68020+ +OPCODE(0x0CE8) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + READ_WORD_F(adr, tmp); + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(22) +} + +// CAS.W (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x0CF0) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_WORD_F(adr, tmp); + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(18) +} + +// CAS.W (xx).W - 68020+ +OPCODE(0x0CF8) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + + FETCH_WORD(res) + FETCH_SWORD(adr) + READ_WORD_F(adr, tmp); + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(16) +} + +// CAS.W (xx).L - 68020+ +OPCODE(0x0CF9) +{ + u32 adr, res; + s16 src, dst; + s16 tmp; + + FETCH_WORD(res) + FETCH_LONG(adr) + READ_WORD_F(adr, tmp); + + CAS_EXECUTE(8, WRITE_WORD_F(adr, DREGs16((res >> 6) & 7))) + RET(16) +} + +// CAS.L (An) - 68020+ +OPCODE(0x0ED0) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, tmp); + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(14) +} + +// CAS.L (An)+ - 68020+ +OPCODE(0x0ED8) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + adr = AREG(areg); + READ_LONG_F(adr, tmp); + AREG(areg) += 4; + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(16) +} + +// CAS.L -(An) - 68020+ +OPCODE(0x0EE0) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + u8 areg; + + FETCH_WORD(res) + areg = Opcode & 7; + AREG(areg) -= 4; + adr = AREG(areg); + READ_LONG_F(adr, tmp); + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(17) +} + +// CAS.L (d16,An) - 68020+ +OPCODE(0x0EE8) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + + FETCH_WORD(res) + FETCH_SWORD(adr) + adr += AREG((Opcode /*>> 0*/) & 7); + READ_LONG_F(adr, tmp); + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(22) +} + +// CAS.L (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x0EF0) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + + FETCH_WORD(res) + adr = AREG((Opcode /*>> 0*/) & 7); + DECODE_EXT_WORD(&adr); + READ_LONG_F(adr, tmp); + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(18) +} + +// CAS.L (xx).W - 68020+ +OPCODE(0x0EF8) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + + FETCH_WORD(res) + FETCH_SWORD(adr) + READ_LONG_F(adr, tmp); + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(16) +} + +// CAS.L (xx).L - 68020+ +OPCODE(0x0EF9) +{ + u32 adr, res; + s32 src, dst; + s32 tmp; + + FETCH_WORD(res) + FETCH_LONG(adr) + READ_LONG_F(adr, tmp); + + CAS_EXECUTE(24, WRITE_LONG_F(adr, DREGs32((res >> 6) & 7))) + RET(16) +} + +// CAS2.W .L - 68020+ +OPCODE(0x0CFC) +{ + u32 adr1, adr2, res1, res2; + s16 src, dst; + s16 tmp1, tmp2; + + FETCH_WORD(res1) + FETCH_WORD(res2) + + /* 1st memory operand (Rn1) */ + if (res1 & 0x8000) + adr1 = AREG((res1 >> 12) & 7); + else + adr1 = DREG(res1 >> 12); + READ_WORD_F(adr1, tmp1); + + /* 2nd memory operand (Rn2) */ + if (res2 & 0x8000) + adr2 = AREG((res2 >> 12) & 7); + else + adr2 = DREG(res2 >> 12); + READ_WORD_F(adr2, tmp2); + + CAS2_EXECUTE(8, WRITE_WORD_F(adr1, DREGs16((res1 >> 6) & 7)), WRITE_WORD_F(adr2, DREGs16((res2 >> 6) & 7))) + RET(22) +} + +// CAS2.L .L - 68020+ +OPCODE(0x0EFC) +{ + u32 adr1, adr2, res1, res2; + s32 src, dst; + s32 tmp1, tmp2; + + FETCH_WORD(res1) + FETCH_WORD(res2) + + /* 1st memory operand (Rn1) */ + if (res1 & 0x8000) + adr1 = AREG((res1 >> 12) & 7); + else + adr1 = DREG(res1 >> 12); + READ_LONG_F(adr1, tmp1); + + /* 2nd memory operand (Rn2) */ + if (res2 & 0x8000) + adr2 = AREG((res2 >> 12) & 7); + else + adr2 = DREG(res2 >> 12); + READ_LONG_F(adr2, tmp2); + + CAS2_EXECUTE(24, WRITE_WORD_F(adr1, DREGs32((res1 >> 6) & 7)), WRITE_WORD_F(adr2, DREGs32((res2 >> 6) & 7))) + RET(22) +} + +// RTM Dn - 68020+ +OPCODE(0x06C0) +{ + /* Skip instruction */ + RET(4) +} + +// RTM An - 68020+ +OPCODE(0x06C8) +{ + /* Skip instruction */ + RET(4) +} + +// CALLM (An) - 68020+ +OPCODE(0x06D0) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} + +// CALLM (d16,An) - 68020+ +OPCODE(0x06E8) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} + +// CALLM (d8,An,Xn) / (bd,An,Xn)... - 68020+ +OPCODE(0x06F0) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} + +// CALLM (xx).W - 68020+ +OPCODE(0x06F8) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} + +// CALLM (xx).L - 68020+ +OPCODE(0x06F9) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} + +// CALLM (d16,PC) - 68020+ +OPCODE(0x06FA) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} + +// CALLM (d8,PC,Xn) - 68020+ +OPCODE(0x06FB) +{ + PC++; /* Skip 2nd instruction word */ + RET(4) +} +#endif + +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/m68k/fame/m68k_intrf.cpp b/uae4all_gp2x_0.7.2a/src/m68k/fame/m68k_intrf.cpp index b7e24ee..22afde3 100755 --- a/uae4all_gp2x_0.7.2a/src/m68k/fame/m68k_intrf.cpp +++ b/uae4all_gp2x_0.7.2a/src/m68k/fame/m68k_intrf.cpp @@ -1,15 +1,12 @@ -#include "sysconfig.h" - -#ifdef USE_FAME_CORE_C - #include +#include "sysconfig.h" #include "sysdeps.h" #include "debug_uae4all.h" #include "config.h" #include "uae.h" #include "options.h" -#include "memory.h" +#include "memory-uae.h" #include "custom.h" #include "autoconf.h" #include "ersatz.h" @@ -17,13 +14,6 @@ #include "m68k/debug_m68k.h" -#undef dprintf -#if defined(DEBUG_UAE4ALL) || defined(UAE_CONSOLE) -#define dprintf(f,...) printf("%05i: %s: " f "\n",M68KCONTEXT.cycles_counter,__FUNCTION__,##__VA_ARGS__) -#else -#define dprintf(...) -#endif - static unsigned short mimemoriadummy[65536/2]; void clear_fame_mem_dummy(void) @@ -31,183 +21,101 @@ void clear_fame_mem_dummy(void) memset((void *)&mimemoriadummy[0],0,65536); } -struct M68K_CONTEXT micontexto; -struct M68K_PROGRAM miprograma[257]; -struct M68K_DATA midato_read_8[257]; -struct M68K_DATA midato_read_16[257]; -struct M68K_DATA midato_write_8[257]; -struct M68K_DATA midato_write_16[257]; -static unsigned micontexto_fpa[256]; - - -void init_m68k(void) -{ - m68k_init(); -} - -static void m68k_exception(unsigned n) -{ - unsigned pc=m68k_get_pc(); - unsigned sr=m68k_get_register(M68K_REG_SR); - unsigned sp=m68k_get_register(M68K_REG_A7); +static uintptr_t micontexto_fpa[256]; - if (!(sr&0x2000)) - { - unsigned asp=m68k_get_register(M68K_REG_ASP); - m68k_set_register(M68K_REG_SR,(sr&0x7FF)|0x2000); - m68k_set_register(M68K_REG_ASP,sp); - m68k_set_register(M68K_REG_A7,asp-6); - sp=asp; - } - else - m68k_set_register(M68K_REG_A7,sp-6); - - put_long(sp-4,pc); - put_word(sp-6,sr); - m68k_set_register(M68K_REG_PC,m68k_fetch((n*4)+2,0)+(m68k_fetch(n*4,0)<<16)); - - //m68k_release_timeslice(); - if (n==4) IO_CYCLE+=4; // adjust for cyclone - M68KCONTEXT.execinfo&=0x65; -} +void process_exception(unsigned int vect); void uae_chk_handler(unsigned vector) { - unsigned opcode=m68k_fetch(m68k_get_pc(),0); + unsigned opcode=m68k_fetch(m68k_get_pc()); unsigned pc=m68k_get_pc(); - -#ifdef DEBUG_UAE4ALL - dprintf("INVALID OPCODE 0x%X at PC=0x%X -> ",opcode,pc); -#endif + if (cloanto_rom && (opcode & 0xF100) == 0x7100) { -#ifdef DEBUG_UAE4ALL - dprintf("cloanto"); -#endif _68k_dreg((opcode >> 9) & 7) = (uae_s8)(opcode & 0xFF); m68k_set_register(M68K_REG_PC,pc+2); return; } - + if (opcode == 0x4E7B && get_long (0x10) == 0 && (pc & 0xF80000) == 0xF80000) { -#ifdef DEBUG_UAE4ALL - dprintf("68020"); -#endif write_log ("Your Kickstart requires a 68020 CPU. Giving up.\n"); set_special (SPCFLAG_BRK); - g_emulator.quit_program = RunStateExit; + g_emulator.quit_program = RunStateExit; return; } - + if (opcode == 0xFF0D) { if ((pc & 0xF80000) == 0xF80000) { -#ifdef DEBUG_UAE4ALL - dprintf("dummy"); -#endif // This is from the dummy Kickstart replacement - uae_u16 arg = m68k_fetch(pc+2,0); + uae_u16 arg = m68k_fetch(pc+2); m68k_set_register(M68K_REG_PC,pc+4); ersatz_perform (arg); return; } else - if ((pc & 0xFFFF0000) == RTAREA_BASE) { -#ifdef DEBUG_UAE4ALL - dprintf("stop"); -#endif - // User-mode STOP replacement - M68KCONTEXT.execinfo|=0x0080; -#ifdef DEBUG_M68K - mispcflags|=SPCFLAG_STOP; -#endif - m68k_set_register(M68K_REG_PC,pc+2); - return; - } + if ((pc & 0xFFFF0000) == RTAREA_BASE) { + // User-mode STOP replacement + M68KCONTEXT.execinfo|=0x0080; + m68k_set_register(M68K_REG_PC,pc+2); + return; + } } - + if ((opcode & 0xF000) == 0xA000 && (pc & 0xFFFF0000) == RTAREA_BASE) { -#ifdef DEBUG_UAE4ALL - dprintf("call"); -#endif // Calltrap. -#ifdef USE_AUTOCONFIG m68k_set_register(M68K_REG_PC,pc+2); - call_calltrap (opcode & 0xFFF); -#endif + #ifdef USE_AUTOCONFIG + call_calltrap (opcode & 0xFFF); + #endif + return; } - + if ((opcode & 0xF000) == 0xF000) { -#ifdef DEBUG_UAE4ALL - dprintf("exp8"); -#endif // Exception 0xB - m68k_exception(0xB); + process_exception(0xB); return; } - + if ((opcode & 0xF000) == 0xA000) { if ((pc & 0xFFFF0000) == RTAREA_BASE) { -#ifdef DEBUG_UAE4ALL - dprintf("call +"); -#endif // Calltrap. -#ifdef USE_AUTOCONFIG - call_calltrap (opcode & 0xFFF); -#endif - } -#ifdef DEBUG_UAE4ALL - dprintf("expA"); -#endif - m68k_exception(0xA); + #ifdef USE_AUTOCONFIG + call_calltrap (opcode & 0xFFF); + #endif + } + process_exception(0xA); return; } - -#ifdef DEBUG_UAE4ALL - dprintf("Real invalid"); -#endif + write_log ("Illegal instruction: %04x at %08lx\n", opcode, pc); - m68k_exception(0x4); + process_exception(0x4); } void init_memmaps(addrbank* banco) { unsigned i; - - memset(&micontexto,0,sizeof(struct M68K_CONTEXT)); - + + M68K_CONTEXT *context = m68k_get_context(); + + memset(context,0,sizeof(M68K_CONTEXT)); memset(&micontexto_fpa,0,sizeof(unsigned)*256); - - micontexto_fpa[0x04]=(unsigned)&uae_chk_handler; -// micontexto_fpa[0x10]=(unsigned)&uae_chk_handler; // FAME BUG !!! - micontexto.icust_handler = (unsigned int*)&micontexto_fpa; - - micontexto.fetch=(struct M68K_PROGRAM *)&miprograma; - micontexto.read_byte=(struct M68K_DATA *)&midato_read_8; - micontexto.read_word=(struct M68K_DATA *)&midato_read_16; - micontexto.write_byte=(struct M68K_DATA *)&midato_write_8; - micontexto.write_word=(struct M68K_DATA *)&midato_write_16; - - micontexto.sv_fetch=(struct M68K_PROGRAM *)&miprograma; - micontexto.sv_read_byte=(struct M68K_DATA *)&midato_read_8; - micontexto.sv_read_word=(struct M68K_DATA *)&midato_read_16; - micontexto.sv_write_byte=(struct M68K_DATA *)&midato_write_8; - micontexto.sv_write_word=(struct M68K_DATA *)&midato_write_16; - - micontexto.user_fetch=(struct M68K_PROGRAM *)&miprograma; - micontexto.user_read_byte=(struct M68K_DATA *)&midato_read_8; - micontexto.user_read_word=(struct M68K_DATA *)&midato_read_16; - micontexto.user_write_byte=(struct M68K_DATA *)&midato_write_8; - micontexto.user_write_word=(struct M68K_DATA *)&midato_write_16; - - micontexto.reset_handler=NULL; - micontexto.iack_handler=NULL; - + + micontexto_fpa[0x04]=(uintptr_t)&uae_chk_handler; + + /* PocketUAE/WinUAE traps */ + micontexto_fpa[0x0A]=(uintptr_t)&uae_chk_handler; + micontexto_fpa[0x10]=(uintptr_t)&uae_chk_handler; + micontexto_fpa[0x14]=(uintptr_t)&uae_chk_handler; + micontexto_fpa[0x15]=(uintptr_t)&uae_chk_handler; + + context->icust_handler = (uintptr_t*)&micontexto_fpa; + for(i=0;i<256;i++) { - unsigned offset=(unsigned)banco->baseaddr; + uintptr_t offset=(uintptr_t)banco->baseaddr; unsigned low_addr=(i<<16); unsigned high_addr=((i+1)<<16)-1; void *data=NULL; @@ -215,7 +123,7 @@ void init_memmaps(addrbank* banco) void *mem_handler_r16=NULL; void *mem_handler_w8=NULL; void *mem_handler_w16=NULL; - + if (offset) data=(void *)(offset-low_addr); else @@ -225,179 +133,29 @@ void init_memmaps(addrbank* banco) mem_handler_w8=(void *)banco->bput; mem_handler_w16=(void *)banco->wput; } - - miprograma[i].low_addr=low_addr; - miprograma[i].high_addr=high_addr; - miprograma[i].offset=((unsigned)&mimemoriadummy)-low_addr; - midato_read_8[i].low_addr=low_addr; - midato_read_8[i].high_addr=high_addr; - midato_read_8[i].mem_handler=mem_handler_r8; - midato_read_8[i].data=data; - midato_read_16[i].low_addr=low_addr; - midato_read_16[i].high_addr=high_addr; - midato_read_16[i].mem_handler=mem_handler_r16; - midato_read_16[i].data=data; - midato_write_8[i].low_addr=low_addr; - midato_write_8[i].high_addr=high_addr; - midato_write_8[i].mem_handler=mem_handler_w8; - midato_write_8[i].data=data; - midato_write_16[i].low_addr=low_addr; - midato_write_16[i].high_addr=high_addr; - midato_write_16[i].mem_handler=mem_handler_w16; - midato_write_16[i].data=data; + + famec_SetBank(low_addr, high_addr, ((uintptr_t)&mimemoriadummy)-low_addr, mem_handler_r8, + mem_handler_r16, mem_handler_w8, mem_handler_w16, data); } - miprograma[256].low_addr=(unsigned)-1; - miprograma[256].high_addr=(unsigned)-1; - miprograma[256].offset=(unsigned)NULL; - midato_read_8[256].low_addr=(unsigned)-1; - midato_read_8[256].high_addr=(unsigned)-1; - midato_read_8[256].mem_handler=NULL; - midato_read_8[256].data=NULL; - midato_read_16[256].low_addr=(unsigned)-1; - midato_read_16[256].high_addr=(unsigned)-1; - midato_read_16[256].mem_handler=NULL; - midato_read_16[256].data=NULL; - midato_write_8[256].low_addr=(unsigned)-1; - midato_write_8[256].high_addr=(unsigned)-1; - midato_write_8[256].mem_handler=NULL; - midato_write_8[256].data=NULL; - midato_write_16[256].low_addr=(unsigned)-1; - midato_write_16[256].high_addr=(unsigned)-1; - midato_write_16[256].mem_handler=NULL; - midato_write_16[256].data=NULL; - - m68k_set_context(&micontexto); } void map_zone(unsigned addr, addrbank* banco, unsigned realstart) { - unsigned offset=(unsigned)banco->baseaddr; + uintptr_t offset=(uintptr_t)banco->baseaddr; if (addr>255) return; - + unsigned low_addr=(addr<<16); unsigned high_addr=((addr+1)<<16)-1; - m68k_get_context(&micontexto); - -#ifdef DEBUG_MAPPINGS - dprintf("map_zone: 0x%.8X (0x%.8X 0x%.8X)",addr<<16,low_addr,high_addr); -#endif - + if (offset) { -#ifdef DEBUG_MAPPINGS - dprintf(" offset"); -#endif offset+=((addr-realstart)<<16); - miprograma[addr].low_addr=low_addr; - miprograma[addr].high_addr=high_addr; - miprograma[addr].offset=offset-low_addr; - midato_read_8[addr].low_addr=low_addr; - midato_read_8[addr].high_addr=high_addr; - midato_read_8[addr].mem_handler=NULL; - midato_read_8[addr].data=(void *)(offset-low_addr); - midato_read_16[addr].low_addr=low_addr; - midato_read_16[addr].high_addr=high_addr; - midato_read_16[addr].mem_handler=NULL; - midato_read_16[addr].data=(void *)(offset-low_addr); - midato_write_8[addr].low_addr=low_addr; - midato_write_8[addr].high_addr=high_addr; - midato_write_8[addr].mem_handler=NULL; - midato_write_8[addr].data=(void *)(offset-low_addr); - midato_write_16[addr].low_addr=low_addr; - midato_write_16[addr].high_addr=high_addr; - midato_write_16[addr].mem_handler=NULL; - midato_write_16[addr].data=(void *)(offset-low_addr); + famec_SetBank(low_addr, high_addr, offset-low_addr, NULL, NULL, NULL, NULL, (void *)(offset-low_addr)); } else { -#ifdef DEBUG_MAPPINGS - dprintf(" handler"); -#endif - miprograma[addr].low_addr=low_addr; - miprograma[addr].high_addr=high_addr; - miprograma[addr].offset=((unsigned)&mimemoriadummy)-low_addr; - midato_read_8[addr].low_addr=low_addr; - midato_read_8[addr].high_addr=high_addr; - midato_read_8[addr].mem_handler=(void*)banco->bget; - midato_read_8[addr].data=NULL; - midato_read_16[addr].low_addr=low_addr; - midato_read_16[addr].high_addr=high_addr; - midato_read_16[addr].mem_handler=(void*)banco->wget; - midato_read_16[addr].data=NULL; - midato_write_8[addr].low_addr=low_addr; - midato_write_8[addr].high_addr=high_addr; - midato_write_8[addr].mem_handler=(void*)banco->bput; - midato_write_8[addr].data=NULL; - midato_write_16[addr].low_addr=low_addr; - midato_write_16[addr].high_addr=high_addr; - midato_write_16[addr].mem_handler=(void*)banco->wput; - midato_write_16[addr].data=NULL; + famec_SetBank(low_addr, high_addr, ((uintptr_t)&mimemoriadummy)-low_addr, + (void*)banco->bget, (void*)banco->wget, (void*)banco->bput, (void*)banco->wput, NULL); } - m68k_set_context(&micontexto); -} - - -/* CPU save/restore code */ - -#define CPUTYPE_EC 1 -#define CPUMODE_HALT 1 - -uae_u8 *restore_cpu (uae_u8 *src) -{ - int i,model,flags; - uae_u32 l; - - model = restore_u32(); - flags = restore_u32(); - for (i = 0; i < 8; i++) - _68k_dreg(i)=restore_u32 (); - for (i = 0; i < 8; i++) - _68k_areg(i)=restore_u32 (); - _68k_setpc(restore_u32 ()); - /* We don't actually use this - we deliberately set prefetch_pc to a - zero so that prefetch isn't used for the first insn after a state - restore. */ - /* uae_regs.prefetch = */ restore_u32 (); - /* uae_regs.prefetch_pc = uae_regs.pc + 128; */ - _68k_mspreg = restore_u32 (); - /* uae_regs.isp = */ restore_u32 (); - _68k_sreg = restore_u16 (); - l = restore_u32(); - if (l & CPUMODE_HALT) { - M68KCONTEXT.execinfo|=0x0080; - mispcflags=SPCFLAG_STOP; - } else { - M68KCONTEXT.execinfo&=~0x0080; - mispcflags=0; - } - write_log ("CPU %d%s%03d, PC=%08.8X\n", - model/1000, flags & 1 ? "EC" : "", model % 1000, _68k_getpc()); - - return src; -} - - -uae_u8 *save_cpu (int *len) -{ - uae_u8 *dstbak,*dst; - int model,i; - - dstbak = dst = (uae_u8 *)malloc(4+4+15*4+4+4+4+4+2+4+4+4+4+4+4+4); - model = 68000; - save_u32 (model); /* MODEL */ - save_u32 (1); //currprefs.address_space_24 ? 1 : 0); /* FLAGS */ - for(i = 0;i < 8; i++) - save_u32 (_68k_dreg(i)); - for(i = 0;i < 8; i++) - save_u32 (_68k_areg(i)); - save_u32 (_68k_getpc ()); /* PC */ - save_u32 (0); //uae_regs.prefetch); /* prefetch */ - save_u32 (_68k_mspreg); - save_u32 (_68k_areg(7)); - save_u16 (_68k_sreg); /* SR/CCR */ - save_u32 (M68KCONTEXT.execinfo&0x0080 ? CPUMODE_HALT : 0); /* flags */ - *len = dst - dstbak; - return dstbak; } -#endif \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/m68k/m68k_cmn_intrf.cpp b/uae4all_gp2x_0.7.2a/src/m68k/m68k_cmn_intrf.cpp index 14f7b92..b2c402e 100755 --- a/uae4all_gp2x_0.7.2a/src/m68k/m68k_cmn_intrf.cpp +++ b/uae4all_gp2x_0.7.2a/src/m68k/m68k_cmn_intrf.cpp @@ -1,6 +1,5 @@ -#ifdef DREAMCAST -#include -#endif +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" #define NO_SHORT_EVENTS #define PROTECT_INFINITE @@ -11,14 +10,15 @@ #include "sysconfig.h" #include "sysdeps.h" -#include "debug_uae4all.h" #include "config.h" +#include "debug_uae4all.h" #include "uae.h" #include "options.h" -#include "memory.h" +#include "memory-uae.h" #include "custom.h" #include "autoconf.h" #include "ersatz.h" +#include "debug.h" #include "gui.h" #include "savestate.h" #include "blitter.h" @@ -27,100 +27,22 @@ #include "m68k/debug_m68k.h" -#ifdef FAME_INTERRUPTS_PATCH -int uae4all_go_interrupt=0; -#endif - - -#ifdef DEBUG_UAE4ALL -int DEBUG_AHORA=1; -#endif - -#ifdef DEBUG_UAE4ALL -void carga(void) -{ - unsigned pc,sr,a0,a1,a2,a3,a4,a5,a6,a7,d0,d1,d2,d3,d4,d5,d6,d7; - FILE *f=fopen("/tmp/uae4all_guarda","rb"); - if (f) - { - fread((void *)&pc,sizeof(unsigned),1,f); - fread((void *)&sr,sizeof(unsigned),1,f); - fread((void *)&a0,sizeof(unsigned),1,f); - fread((void *)&a1,sizeof(unsigned),1,f); - fread((void *)&a2,sizeof(unsigned),1,f); - fread((void *)&a3,sizeof(unsigned),1,f); - fread((void *)&a4,sizeof(unsigned),1,f); - fread((void *)&a5,sizeof(unsigned),1,f); - fread((void *)&a6,sizeof(unsigned),1,f); - fread((void *)&a7,sizeof(unsigned),1,f); - fread((void *)&d0,sizeof(unsigned),1,f); - fread((void *)&d1,sizeof(unsigned),1,f); - fread((void *)&d2,sizeof(unsigned),1,f); - fread((void *)&d3,sizeof(unsigned),1,f); - fread((void *)&d4,sizeof(unsigned),1,f); - fread((void *)&d5,sizeof(unsigned),1,f); - fread((void *)&d6,sizeof(unsigned),1,f); - fread((void *)&d7,sizeof(unsigned),1,f); - fread((void *)chipmemory,1,allocated_chipmem,f); - fclose(f); - { - unsigned char *p=(unsigned char *)chipmemory; - unsigned i; - for (i=0;i do_copper"); -#endif do_copper (); } - + /*n_spcinsns++;*/ while ((mispcflags & SPCFLAG_BLTNASTY) && cycles > 0) { int c = blitnasty(); @@ -130,77 +52,14 @@ static int do_specialties (int cycles) cycles = 0; c = 1; } -#ifdef DEBUG_M68K - dbgf("do_specialties -> do_cycles BLTNASTY %i\n",c); -#endif + do_cycles(c * CYCLE_UNIT); if (mispcflags & SPCFLAG_COPPER) - { -#ifdef DEBUG_M68K - dbg("do_specialties -> do_copper BLTNASTY"); -#endif - do_copper (); - } - } - -#ifdef DEBUG_M68K - while (M68KCONTEXT.execinfo & 0x0080) { - if (mispcflags & SPCFLAG_BRK) - break; - else - if (M68KCONTEXT.execinfo & 0x0080) - { - int intr = intlev (); - if (intr != -1 && intr > _68k_intmask) - { - M68KCONTEXT.execinfo &= 0xFF7F; - break; - } - } - dbg("CPU STOPPED !"); - do_cycles(4 * CYCLE_UNIT); - if (mispcflags & SPCFLAG_COPPER) - { - dbg("do_specialties -> do_copper STOPPED"); + { do_copper (); - } - } - unset_special (SPCFLAG_STOP); -#endif - -#if 0 // !defined(FAME_INTERRUPTS_SECURE_PATCH) && defined(FAME_INTERRUPTS_PATCH) - if (uae4all_go_interrupt) - { - /*if (verb)*/ printf("uae4all_go_interrupt (s): %02x\n", uae4all_go_interrupt); - M68KCONTEXT.interrupts[0]=uae4all_go_interrupt; - M68KCONTEXT.execinfo&=0xFF67; - uae4all_go_interrupt=0; - m68k_irq_update(0); - } -#endif - -#ifdef SPECIAL_DEBUG_INTERRUPTS - if ((mispcflags & SPCFLAG_DOINT)&&(!(mispcflags & SPCFLAG_INT))) { - int intr = intlev (); -#ifdef DEBUG_INTERRUPTS_EXTRA - dbgf("DOINT : intr = %i, intmask=%i\n", intr, _68k_intmask); -#endif - unset_special (SPCFLAG_DOINT); - if (intr != -1 && intr > _68k_intmask) { - M68KCONTEXT.execinfo&=0xFF6F; - m68k_raise_irq(intr,M68K_AUTOVECTORED_IRQ); -// m68k_emulate(0); - } + } } - if (mispcflags & SPCFLAG_INT) { -#ifdef DEBUG_INTERRUPTS_EXTRA - dbg("ESTAMOS EN INT -> PASAMOS A DOINT"); -#endif - unset_special (SPCFLAG_INT); - set_special (SPCFLAG_DOINT); - } -#endif - + if (mispcflags & SPCFLAG_BRK) { unset_special (SPCFLAG_BRK); return 1; @@ -208,129 +67,75 @@ static int do_specialties (int cycles) return 0; } -#define DEBUG_CPU -#ifdef DEBUG_CPU -extern int do_debug; -extern int do_disa; -#endif - static void uae4all_reset(void) { int i; -#if !defined(USE_CYCLONE_CORE) && !defined(USE_FAME_CORE_ARM2) - m68k_set_context(&micontexto); -#endif + + /*int new_table = (prefs_cpu_model != changed_prefs.cpu_level) ? 1 : 0; + prefs_cpu_model = changed_prefs.cpu_level; + if(new_table) + m68k_init(1);*/ // CPU model changed -> rebuild jump table m68k_reset(); for(i=1;i<8;i++) -#if defined(DEBUG_INTERRUPTS) - M68KCONTEXT.interrupts[i]=0xFF; -#else M68KCONTEXT.interrupts[i]=0x18+i; -#endif M68KCONTEXT.interrupts[0]=0; - m68k_irq_update(0); mispcflags=0; _68k_areg(7) = get_long (0x00f80000); _68k_setpc(get_long (0x00f80004)); //_68k_sreg = 0x2700; // already done by m68k_reset() mispcflags=0; -#ifdef DEBUG_FRAMERATE - uae4all_update_time(); -#endif } static void m68k_run (void) { - // uae4all_reset (); - unsigned cycles, cycles_actual=M68KCONTEXT.cycles_counter; - for (;;) { -#ifdef DEBUG_M68K - dbg_cycle(m68k_fetch(m68k_get_pc(),0)); - m68k_emulate(1); - -#else - uae4all_prof_start(0); - - cycles = nextevent - currcycle; - switch (timeslice_mode) { - case 3: cycles>>=6; break; - case 2: cycles>>=7; break; - case 1: cycles=(cycles>>8)+(cycles>>9); break; - default: cycles>>=8; break; - } - -#define NDEBUG_CYCLES -#ifdef DEBUG_CYCLES - static unsigned next_cycles = 60000000; - if (M68KCONTEXT.cycles_counter > next_cycles) { - next_cycles += 100000; - printf("cycles=%9d|%03i|%03i, pc=%.6x\n", M68KCONTEXT.cycles_counter, cycles, IO_CYCLE, _68k_getpc()); - } - - if (M68KCONTEXT.cycles_counter > 80000000) { - // exit(0); - } - - if (M68KCONTEXT.cycles_counter >= 500000000) { - // do_debug = 1; - } - -#endif - -#if defined(FAME_INTERRUPTS_SECURE_PATCH) && defined(FAME_INTERRUPTS_PATCH) - if (uae4all_go_interrupt) - m68k_emulate(FAME_INTERRUPTS_PATCH); - else -#endif - m68k_emulate(cycles); + unsigned long cycles; + unsigned int cycles_actual = M68KCONTEXT.cycles_counter; + unsigned long last_currcycle = currcycle; - uae4all_prof_end(0); -#endif -#if 0 // def FAME_INTERRUPTS_PATCH - if (uae4all_go_interrupt) + for (;;) + { + // Using last_currcycle instead of currcycle gives the CPU the cycles which + // may taken in do_specialties() (see below) + cycles = nextevent - last_currcycle; + cycles >>= 8; + + last_currcycle = currcycle; + m68k_emulate(cycles); + + cycles = (M68KCONTEXT.cycles_counter - cycles_actual) << 8; + // In m68k_emulate, calls to cia_wait() may occur and some cycles are added to currcycle. + if(cycles > currcycle - last_currcycle) + { + cycles = cycles - (currcycle - last_currcycle); + do_cycles(cycles); + last_currcycle = currcycle; + + if (mispcflags) + if (do_specialties (cycles)) // Perhaps some cycles in do_specialties are done... + return; + } + else + last_currcycle = currcycle; + + unsigned cuentalo = 0; + while((nextevent - currcycle) <= 2048) { - /*if (verb)*/ printf("uae4all_go_interrupt: %02x\n", uae4all_go_interrupt); - M68KCONTEXT.interrupts[0]=uae4all_go_interrupt; - M68KCONTEXT.execinfo&=0xFF67; - uae4all_go_interrupt=0; - m68k_irq_update(0); - } -#endif - - uae4all_prof_start(1); - - cycles=(M68KCONTEXT.cycles_counter-cycles_actual) * cycles_factor; - -#ifdef DEBUG_INTERRUPTS - dbgf("cycles=%i (%i) -> PC=%.6x\n",cycles>>8,nextevent - currcycle, _68k_getpc()); -#endif - - -#ifdef NO_SHORT_EVENTS -#ifdef PROTECT_INFINITE - unsigned cuentalo=0; -#endif - do{ -#endif + cycles = 2048; // 2048 are four cycles... + do_cycles(cycles); if (mispcflags) - if (do_specialties (cycles)) + if (do_specialties (cycles)) // Perhaps some cycles in do_specialties are done... return; -#ifndef DEBUG_M68K -#ifdef NO_SHORT_EVENTS - cycles=2048; -#ifdef PROTECT_INFINITE + cuentalo++; - if (cuentalo>1024) { - g_emulator.quit_program=RunStateReset; + if (cuentalo>1024) + { + g_emulator.quit_program = RunStateReset; return; } -#endif - } while((nextevent - currcycle)<=2048); -#endif - cycles_actual=M68KCONTEXT.cycles_counter; -#endif - uae4all_prof_end(1); + } + + cycles_actual = M68KCONTEXT.cycles_counter; } } @@ -338,123 +143,105 @@ static void m68k_run (void) void m68k_go (int may_quit) { gui_purge_events(); -#if !defined(DREAMCAST) || defined(DEBUG_UAE4ALL) + if (in_m68k_go || !may_quit) { -#ifdef DEBUG_UAE4ALL - puts("Bug! m68k_go is not reentrant.\n"); -#endif return; } - + in_m68k_go++; -#endif g_emulator.quit_program = RunStateReset; for (;;) { - if (g_emulator.quit_program > RunStateNormal) { + if (g_emulator.quit_program > 0) { if (g_emulator.quit_program == RunStateExit) break; - - g_emulator.quit_program = RunStateNormal; - bool restoring = false; + g_emulator.quit_program = RunStateNormal; + if (savestate_state == STATE_RESTORE) { restore_state (savestate_filename); mispcflags = 0; - restoring = true; - // _m68k_setpc(M68KCONTEXT.pc); } - g_emulator.reset_all_systems (); - customreset (); - - if (!restoring) { - check_prefs_changed_cpu (); - sound_default_evtime (); - } - /* We may have been restoring state, but we're done now. */ - handle_active_events (); - if (mispcflags) - do_specialties (0); + g_emulator.reset_all_systems (); + customreset (); + sound_default_evtime (); + /* We may have been restoring state, but we're done now. */ + handle_active_events (); + if (mispcflags) + do_specialties (0); } - - if (!savestate_state) - uae4all_reset (); - savestate_restore_finish (); - - g_emulator.running = true; + + if(!savestate_state) + uae4all_reset(); + savestate_restore_finish(); m68k_run(); - g_emulator.running = false; } -#if !defined(DREAMCAST) || defined(DEBUG_UAE4ALL) in_m68k_go--; -#endif -#ifdef DEBUG_UAE4ALL - puts("BYE?"); -#endif } -void check_prefs_changed_cpu (void) -{ - int i; +/* CPU save/restore code */ - for(i=0;i<512;i++) - next_vpos[i]=i+1; +#define CPUMODE_HALT 1 - switch(m68k_speed) - { - case 6: - cycles_factor=(unsigned)(1.86*256); - if (!(beamcon0 & 0x20)) break; - for(i=0;i<4;i++) - next_vpos[i]=4; - next_vpos[4]=5; - for(i=5;i<20;i++) - next_vpos[i]=20; - for(i=20;i<280;i++) - next_vpos[i]=i+1; - for(i=280;i<306;i++) - next_vpos[i]=306; - for(i=306;i<311;i++) - next_vpos[i]=i+1; - for(i=311;i<512;i++) - next_vpos[i]=510; - break; - case 5: - case 4: - cycles_factor=(unsigned)(4.0/3.0*256); - if (!(beamcon0 & 0x20)) break; - for(i=0;i<4;i++) - next_vpos[i]=4; - next_vpos[4]=5; - for(i=5;i<40;i++) - next_vpos[i]=40; - for(i=40;i<280;i++) - next_vpos[i]=i+1; - for(i=280;i<312;i++) - next_vpos[i]=510; - break; - case 3: - case 2: - cycles_factor=(unsigned)(7.0/6.0*256); - if (!(beamcon0 & 0x20)) break; - for(i=0;i<4;i++) - next_vpos[i]=4; - next_vpos[4]=5; - for(i=5;i<20;i++) - next_vpos[i]=20; - for(i=20;i<280;i++) - next_vpos[i]=i+1; - for(i=280;i<306;i++) - next_vpos[i]=306; - for(i=306;i<311;i++) - next_vpos[i]=i+1; - for(i=311;i<512;i++) - next_vpos[i]=510; - break; - case 1: - default: - cycles_factor=1*256; - break; +uae_u8 *restore_cpu (uae_u8 *src) +{ + int i,model,flags; + uae_u32 l; + + prefs_cpu_model = restore_u32(); + //model=2; + flags = restore_u32(); + for (i = 0; i < 8; i++) + _68k_dreg(i)=restore_u32 (); + for (i = 0; i < 8; i++) + _68k_areg(i)=restore_u32 (); + _68k_setpc(restore_u32 ()); + /* We don't actually use this - we deliberately set prefetch_pc to a + zero so that prefetch isn't used for the first insn after a state + restore. */ + /* uae_regs.prefetch = */ restore_u32 (); + /* uae_regs.prefetch_pc = uae_regs.pc + 128; */ + + // in new FAME_C, mspreg is always 0, uspreg is now the important one... + _68k_mspreg = 0; + _68k_uspreg = restore_u32 (); + /* uae_regs.isp = */ restore_u32 (); + _68k_sreg = restore_u16 (); + l = restore_u32(); + if (l & CPUMODE_HALT) { + M68KCONTEXT.execinfo|=0x0080; + mispcflags=SPCFLAG_STOP; + } else { + M68KCONTEXT.execinfo&=~0x0080; + mispcflags=0; + } + + return src; +} - } - next_vpos[511]=0; +uae_u8 *save_cpu (int *len) +{ + uae_u8 *dstbak,*dst; + int model,i; + + dstbak = dst = (uae_u8 *)malloc(4+4+15*4+4+4+4+4+2+4+4+4+4+4+4+4); + save_u32 (prefs_cpu_model); /* MODEL */ + save_u32 (1); //currprefs.address_space_24 ? 1 : 0); /* FLAGS */ + for(i = 0;i < 8; i++) + save_u32 (_68k_dreg(i)); + for(i = 0;i < 8; i++) + save_u32 (_68k_areg(i)); + save_u32 (m68k_get_pc()); /* PC */ + save_u32 (0); //uae_regs.prefetch); /* prefetch */ + + // in new FAME_C, mspreg is always 0, uspreg is now the important one... + //save_u32 (_68k_mspreg); + save_u32 (_68k_uspreg); + save_u32 (_68k_areg(7)); + save_u16 (_68k_sreg); /* SR/CCR */ + save_u32 (M68KCONTEXT.execinfo&0x0080 ? CPUMODE_HALT : 0); /* flags */ + *len = dst - dstbak; + return dstbak; } + +#pragma clang diagnostic pop + diff --git a/uae4all_gp2x_0.7.2a/src/m68k/m68k_intrf.h b/uae4all_gp2x_0.7.2a/src/m68k/m68k_intrf.h index 7aea358..37aa4ac 100644 --- a/uae4all_gp2x_0.7.2a/src/m68k/m68k_intrf.h +++ b/uae4all_gp2x_0.7.2a/src/m68k/m68k_intrf.h @@ -1,10 +1,9 @@ -#ifndef _M68K_INTRF -#define _M68K_INTRF +#ifndef M68KIntrfH +#define M68KIntrfH -//#if defined(USE_FAME_CORE) +//#include "menu_config.h" /* defined in m68k_cmn_intrf.cpp */ -extern int uae4all_go_interrupt; extern unsigned mispcflags; void init_memmaps(addrbank* banco); @@ -12,53 +11,29 @@ void map_zone(unsigned addr, addrbank* banco, unsigned realstart); void m68k_go(int may_quit); void init_m68k(void); -#define _68k_spcflags mispcflags +#define M68KCONTEXT m68kcontext + #define fill_prefetch_0() #define dump_counts() #define flush_icache(X) -//#endif +#define m68k_irq_update() m68kcontext.more_cycles_to_do=m68kcontext.io_cycle_counter; m68kcontext.io_cycle_counter=0; -#if defined(USE_FAME_CORE) && !defined(USE_CYCLONE_CORE) && !defined(USE_FAME_CORE_ARM2) - -#if defined(DREAMCAST) || defined(USE_FAME_CORE_C) -#define M68KCONTEXT m68kcontext -#else -#define M68KCONTEXT _m68kcontext -#endif -#if defined(DREAMCAST) || defined(USE_FAME_CORE_C) -#define IO_CYCLE io_cycle_counter -#else -#define IO_CYCLE __io_cycle_counter -#endif -extern int IO_CYCLE; -#define m68k_irq_update(end_timeslice) \ - if ((end_timeslice) && IO_CYCLE > 0) { \ - M68KCONTEXT.cycles_counter += 24 - IO_CYCLE; \ - IO_CYCLE = 24; \ - } - - -#include "fame.h" +#include "m68k/fame/fame.h" #include "memory.h" -extern struct M68K_CONTEXT M68KCONTEXT; +extern M68K_CONTEXT M68KCONTEXT; -#define _68k_dreg(num) (M68KCONTEXT.dreg[(num)]) -#define _68k_areg(num) (M68KCONTEXT.areg[(num)]) +#define _68k_dreg(num) (M68KCONTEXT.dreg[(num)].D) +#define _68k_areg(num) (M68KCONTEXT.areg[(num)].D) #define _68k_sreg M68KCONTEXT.sr -#define _68k_ispreg M68KCONTEXT.areg[7] -#define _68k_mspreg M68KCONTEXT.asp -#define _68k_uspreg M68KCONTEXT.asp +#define _68k_ispreg M68KCONTEXT.isp +#define _68k_mspreg M68KCONTEXT.msp +#define _68k_uspreg M68KCONTEXT.usp #define _68k_intmask ((M68KCONTEXT.sr >> 8) & 7) -#define _68k_incpc(o) (M68KCONTEXT.pc += (o)) +#define _68k_spcflags mispcflags -static __inline__ unsigned _68k_getpc(void) -{ -// return M68KCONTEXT.pc; - return m68k_get_pc(); -} static __inline__ void _68k_setpc(unsigned mipc) { M68KCONTEXT.pc=mipc; @@ -75,277 +50,13 @@ static __inline__ void unset_special (uae_u32 x) _68k_spcflags &= ~x; } -/* -static __inline__ uae_u8 *restore_cpu (uae_u8 *src) -{ - return src; -} - -static __inline__ uae_u8 *save_cpu (int *len) -{ - return (uae_u8 *)len; -}*/ - -#elif defined(USE_CYCLONE_CORE) - -#include "m68k/cyclone/cyclone.h" - -extern struct Cyclone m68k_context; - -// FAME interface -void m68k_release_timeslice(void); -int m68k_raise_irq(int level, int vector); -int m68k_lower_irq(int level); -int m68k_reset(void); -//int m68k_emulate(int cycles); -//void m68k_irq_update(int end_timeslice); -#define M68K_AUTOVECTORED_IRQ 0 // not going to use vector number - - -typedef struct -{ - uae_u8 interrupts[8]; // only interrupts[0] is used - uae_u32 cycles_counter; - uae_u16 execinfo; // will really only use bit7 (HALTED) -} M68KCONTEXT_t; - -extern M68KCONTEXT_t M68KCONTEXT; - -#define m68k_emulate(cycles) \ -{ \ - m68k_context.cycles = (cycles) - 1; \ - CycloneRun(&m68k_context); \ - M68KCONTEXT.cycles_counter += (cycles) - 1 - m68k_context.cycles; \ -} - -/* -#define m68k_irq_update(end_timeslice) \ - if ((end_timeslice) && m68k_context.cycles > 0) { \ - M68KCONTEXT.cycles_counter += 24 - m68k_context.cycles; \ - m68k_context.cycles = 24; \ - } -*/ - -#define m68k_irq_update(end_timeslice) \ -{ \ - int level, ints = M68KCONTEXT.interrupts[0]; \ - for (level = 7; level && !(ints & (1 << level)); level--); \ - m68k_context.irq = level; \ -\ - if ((end_timeslice) && m68k_context.cycles >= 0 && !(m68k_context.state_flags & 1)) \ - { \ - M68KCONTEXT.cycles_counter += 24 - 1 - m68k_context.cycles; \ - m68k_context.cycles = 24 - 1; \ - } \ -} - -#define IO_CYCLE m68k_context.cycles - -// this is only set in one place, .srh is ok in that situation -#define _68k_sreg m68k_context.srh - -#define _68k_dreg(num) m68k_context.d[num] -#define _68k_areg(num) m68k_context.a[num] -#define _68k_ispreg m68k_context.a[7] -#define _68k_mspreg m68k_context.osp -#define _68k_uspreg m68k_context.osp -#define _68k_intmask (m68k_context.srh & 7) - -#define _68k_getpc() (m68k_context.pc - m68k_context.membase) -#define set_special(x) _68k_spcflags |= x -#define unset_special(x) _68k_spcflags &= ~x - -static __inline__ void _68k_setpc(unsigned mipc) -{ - // this will only work if we are not in CycloneRun - // (which always appears to be the case as far as I checked - // (except exception handlers, which should properly reload PC)) - m68k_context.membase = 0; - m68k_context.pc = m68k_context.checkpc(mipc); -} - -static __inline__ void _68k_set_flags(unsigned short val) { - m68k_context.flags = (val & 0x0c); // NZ - m68k_context.flags |= ((val & 0x01) << 1); // C - m68k_context.flags |= ((val & 0x02) >> 1); // V - m68k_context.xc = (val & 0x10) << 25; // X -} - -static __inline__ unsigned short _68k_get_flags() { - unsigned short flags = m68k_context.flags; - unsigned short result = (flags & 0x0c); // NZ - result |= ((flags & 0x02) >> 1); // C - result |= ((flags & 0x01) << 1); // V - result |= (m68k_context.xc & 0x20000000) ? 0x10 : 0x00; // X - return result; -} - -static __inline__ unsigned short _68k_get_sr() { - return _68k_get_flags() | m68k_context.srh << 8; -} - -static __inline__ void _68k_set_sr(unsigned short val) { - _68k_set_flags((unsigned short)val); - m68k_context.srh = val >> 8; -} - -/* -static __inline__ uae_u8 *restore_cpu (uae_u8 *src) -{ - return src; -} - -static __inline__ uae_u8 *save_cpu (int *len) -{ - return (uae_u8 *)len; -} */ - -#elif defined(USE_FAME_CORE_ARM2) - -#import "fame_arm.h" - -#if defined(M68KCONTEXT) -#undef M68KCONTEXT -#endif - -#define m68k_irq_update(end_timeslice) \ - if ((end_timeslice) && m68k_context.cycles > 0) { \ - M68KCONTEXT.cycles_counter += 24 - m68k_context.cycles; \ - m68k_context.cycles = 24; \ - } -/* -#define m68k_irq_update(end_timeslice) \ -{ \ - int level, ints = M68KCONTEXT.interrupts[0]; \ - for (level = 7; level && !(ints & (1 << level)); level--); \ - m68k_context.irq = level; \ -\ - if ((end_timeslice) && m68k_context.cycles >= 0 && !(M68KCONTEXT.execinfo & 0x80)) \ - { \ - M68KCONTEXT.cycles_counter += 24 - 1 - m68k_context.cycles; \ - m68k_context.cycles = 24 - 1; \ - } \ -} -*/ - -#define IO_CYCLE m68k_context.cycles - -// this is only set in one place, .srh is ok in that situation -#define _68k_sreg _68k_get_sr() - -#define _68k_dreg(num) m68k_context.d[num].D -#define _68k_dregs8(num) m68k_context.d[num].SB -#define _68k_dregu8(num) m68k_context.d[num].B -#define _68k_dregs16(num) m68k_context.d[num].SW -#define _68k_dregu16(num) m68k_context.d[num].W - -#define _68k_areg(num) m68k_context.a[num].D -#define _68k_aregu16(num) m68k_context.a[num].W - -#define _68k_ispreg m68k_context.a[7].D -#define _68k_mspreg m68k_context.osp -#define _68k_uspreg m68k_context.osp -//#define _68k_intmask (m68k_context.srh & 7) -#define _68k_intmask (m68k_context.irq & 7) - -// flags -#define flag_all (_68k_get_flags()) -#define flag_c (m68k_context.flags & 0x02) -#define flag_v (m68k_context.flags & 0x01) -#define flag_z (m68k_context.flags & 0x04) -#define flag_n (m68k_context.flags & 0x08) -#define flag_x (m68k_context.xc & 0x20000000) - -#define SET_flag_X (m68k_context.xc = 0x20000000) -#define CLR_flag_X (m68k_context.xc = 0) +/* PocketUAE */ +/* UAE redefine */ +#define m68k_dreg(r,num) (m68kcontext.dreg[num].D) +#define m68k_areg(r,num) (m68kcontext.areg[num].D) -#define n_xor_v ((flag_n >> 3) ^ (flag_v)) - -// condition codes -#define cond_true (!flag_z) -#define cond_false ( flag_z) -#define cond_hi (!flag_c && !flag_z) -#define cond_ls (flag_c || flag_z) -#define cond_cc (!flag_c) -#define cond_cs (flag_c) -#define cond_ne (!flag_z) -#define cond_eq ( flag_z) -#define cond_vc (!flag_v) -#define cond_vs (flag_v) -#define cond_pl (!flag_n) -#define cond_mi (flag_n) -#define cond_ge !(n_xor_v) -#define cond_lt n_xor_v -#define cond_gt (!flag_z && !n_xor_v) -#define cond_le (flag_z || n_xor_v) - -// cycle counter -#define _68k_cycles (M68KCONTEXT.cycles_counter) - -//#define _68k_getpc (m68k_context.pc - m68k_context.membase) -#define set_special(x) _68k_spcflags |= x -#define unset_special(x) _68k_spcflags &= ~x - -static __inline__ unsigned _68k_getpc() { - return (unsigned)(m68k_context.pc - m68k_context.membase); -} - -static __inline__ void _68k_setpc(unsigned mipc) { - // this will only work if we are not in CycloneRun - // (which always appears to be the case as far as I checked - // (except exception handlers, which should properly reload PC)) - m68k_context.membase = 0; - m68k_context.pc = m68k_context.checkpc(mipc); -} - -static __inline__ void _68k_set_flags(unsigned short val) { - m68k_context.flags = (val & 0x0c); // NZ - m68k_context.flags |= ((val & 0x01) << 1); // C - m68k_context.flags |= ((val & 0x02) >> 1); // V - m68k_context.xc = (val & 0x10) << 25; // X -} - -static __inline__ unsigned short _68k_get_flags() { - unsigned short flags = m68k_context.flags; - unsigned short result = (flags & 0x0c); // NZ - result |= ((flags & 0x02) >> 1); // C - result |= ((flags & 0x01) << 1); // V - result |= (m68k_context.xc & 0x20000000) ? 0x10 : 0x00; // X - return result; -} - - -static __inline__ unsigned short _68k_get_sr() { - return _68k_get_flags() | m68k_context.srh << 8; -} - -static __inline__ void _68k_set_sr(unsigned short val) { - _68k_set_flags((u8)val); - m68k_context.srh = val >> 8; -} - -#define EXECINFO M68KCONTEXT.execinfo - -#else - -#define _68k_getpc m68k_getpc -#define _68k_setpc m68k_setpc -#define _68k_areg m68k_areg -#define _68k_dreg m68k_dreg -#define _68k_incp m68k_incp -#define _68k_sreg uae_regs.s -#define _68k_ispreg uae_regs.isp -#define _68k_mspreg uae_regs.msp -#define _68k_uspreg uae_regs.usp -#define _68k_intmask uae_regs.intmask -#define _68k_incpc(o) m68k_incpc(o) -#define _68k_spcflags uae_regs.spcflags - -#include "custom.h" -#include "m68k/uae/newcpu.h" +/***************/ #endif - -#endif \ No newline at end of file diff --git a/uae4all_gp2x_0.7.2a/src/memory.cpp b/uae4all_gp2x_0.7.2a/src/memory.cpp old mode 100755 new mode 100644 index 73e002d..1a1fd02 --- a/uae4all_gp2x_0.7.2a/src/memory.cpp +++ b/uae4all_gp2x_0.7.2a/src/memory.cpp @@ -1,10 +1,14 @@ - /* - * UAE - The Un*x Amiga Emulator - * - * Memory management - * - * (c) 1995 Bernd Schmidt - */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#pragma clang diagnostic ignored "-Wparentheses" + +/* + * UAE - The Un*x Amiga Emulator + * + * Memory management + * + * (c) 1995 Bernd Schmidt + */ #include "sysconfig.h" #include "sysdeps.h" @@ -12,7 +16,7 @@ #include "config.h" #include "uae.h" #include "options.h" -#include "memory.h" +#include "memory-uae.h" #include "ersatz.h" #include "custom.h" #include "debug_uae4all.h" @@ -20,34 +24,30 @@ #include "m68k/m68k_intrf.h" #include "autoconf.h" #include "savestate.h" +#ifdef ANDROIDSDL +#include +#endif int bReloadKickstart = 0; #include "zfile.h" unsigned prefs_chipmem_size; +unsigned prefs_fastmem_size; +unsigned prefs_bogomem_size; -#ifdef USE_MAPPED_MEMORY -#include -#endif - -#ifdef USE_FAME_CORE void clear_fame_mem_dummy(void); -#endif - -/* Set by each memory handler that does not simply access real memory. */ -#ifdef USE_SPECIAL_MEM -int special_mem; -#endif int ersatzkickfile = 0; -uae_u32 allocated_chipmem; -uae_u32 allocated_fastmem; -uae_u32 allocated_bogomem; -uae_u32 allocated_gfxmem; -uae_u32 allocated_z3fastmem; -uae_u32 allocated_a3000mem; +uae_u32 allocated_chipmem=0; +uae_u32 allocated_fastmem=0; +uae_u32 allocated_bogomem=0; +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +uae_u32 allocated_gfxmem=0; +uae_u32 allocated_z3fastmem=0; +uae_u32 allocated_a3000mem=0; +#endif static long chip_filepos; static long bogo_filepos; @@ -58,44 +58,10 @@ static long compressed_size; addrbank *mem_banks[65536]; -/* This has two functions. It either holds a host address that, when added - to the 68k address, gives the host address corresponding to that 68k - address (in which case the value in this array is even), OR it holds the - same value as mem_banks, for those banks that have baseaddr==0. In that - case, bit 0 is set (the memory access routines will take care of it). */ - -uae_u8 *baseaddr[65536]; - -#ifdef NO_INLINE_MEMORY_ACCESS -static __inline__ uae_u32 longget (uaecptr addr) -{ - return call_mem_get_func (get_mem_bank (addr).lget, addr); -} -static __inline__ uae_u32 wordget (uaecptr addr) -{ - return call_mem_get_func (get_mem_bank (addr).wget, addr); -} -static __inline__ uae_u32 byteget (uaecptr addr) -{ - return call_mem_get_func (get_mem_bank (addr).bget, addr); -} -static __inline__ void longput (uaecptr addr, uae_u32 l) -{ - call_mem_put_func (get_mem_bank (addr).lput, addr, l); -} -static __inline__ void wordput (uaecptr addr, uae_u32 w) -{ - call_mem_put_func (get_mem_bank (addr).wput, addr, w); -} -static __inline__ void byteput (uaecptr addr, uae_u32 b) -{ - call_mem_put_func (get_mem_bank (addr).bput, addr, b); -} -#endif +uae_u32 chipmem_mask, kickmem_mask, bogomem_mask; -uae_u32 chipmem_mask, kickmem_mask, extendedkickmem_mask, bogomem_mask, a3000mem_mask; +uae_u32 extendedkickmem_mask, a3000mem_mask; -static int illegal_count; /* A dummy bank that only contains zeros */ static uae_u32 dummy_lget (uaecptr) REGPARAM; @@ -108,60 +74,37 @@ static int dummy_check (uaecptr addr, uae_u32 size) REGPARAM; uae_u32 REGPARAM2 dummy_lget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("dummy_lget 0x%X\n",addr); -#endif - SMEM_READ; - return 0xFFFFFFFF; + return NONEXISTINGDATA; /*0xFFFFFFFF;*/ } uae_u32 REGPARAM2 dummy_wget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("dummy_wget 0x%X\n",addr); -#endif - SMEM_READ; - return 0xFFFF; + return NONEXISTINGDATA; /*0xFFFF*/; } uae_u32 REGPARAM2 dummy_bget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("dummy_bget 0x%X\n",addr); -#endif - SMEM_READ; - return 0xFF; + return NONEXISTINGDATA; /*0xFF;*/ } void REGPARAM2 dummy_lput (uaecptr addr, uae_u32 l) { -#ifdef DEBUG_MEMORY - dbgf("dummy_lput 0x%X = 0x%X\n",addr,l); -#endif - SMEM_WRITE; } + void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w) { -#ifdef DEBUG_MEMORY - dbgf("dummy_wput 0x%X = 0x%X\n",addr,w); -#endif - SMEM_WRITE; } + void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b) { -#ifdef DEBUG_MEMORY - dbgf("dummy_bput 0x%X = 0x%X\n",addr,b); -#endif - SMEM_WRITE; } int REGPARAM2 dummy_check (uaecptr addr, uae_u32 size) { - SMEM_READ; - return 0; } +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) /* A3000 "motherboard resources" bank. */ static uae_u32 mbres_lget (uaecptr) REGPARAM; static uae_u32 mbres_wget (uaecptr) REGPARAM; @@ -175,150 +118,128 @@ static int mbres_val = 0; uae_u32 REGPARAM2 mbres_lget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("mbres_lget 0x%X\n",addr); -#endif - SMEM_READ; - return 0; } uae_u32 REGPARAM2 mbres_wget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("mbres_wget 0x%X\n",addr); -#endif - SMEM_READ; - return 0; } uae_u32 REGPARAM2 mbres_bget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("mbres_bget 0x%X\n",addr); -#endif - SMEM_READ; - return (addr & 0xFFFF) == 3 ? mbres_val : 0; } void REGPARAM2 mbres_lput (uaecptr addr, uae_u32 l) { -#ifdef DEBUG_MEMORY - dbgf("mbres_lput 0x%X = 0x%X\n",addr,l); -#endif - SMEM_WRITE; } void REGPARAM2 mbres_wput (uaecptr addr, uae_u32 w) { -#ifdef DEBUG_MEMORY - dbgf("mbres_wput 0x%X = 0x%X\n",addr,w); -#endif - SMEM_WRITE; } void REGPARAM2 mbres_bput (uaecptr addr, uae_u32 b) { -#ifdef DEBUG_MEMORY - dbgf("mbres_bput 0x%X = 0x%X\n",addr,b); -#endif - SMEM_WRITE; - if ((addr & 0xFFFF) == 3) - mbres_val = b; + mbres_val = b; } int REGPARAM2 mbres_check (uaecptr addr, uae_u32 size) { return 0; } +#endif /* Chip memory */ uae_u8 *chipmemory; uae_u16 *chipmemory_word; -#ifdef DEBUG_UAE4ALL -unsigned chipmem_checksum(void) -{ - unsigned *p=(unsigned *)chipmemory; - unsigned max=allocated_chipmem/4; - unsigned i,ret=0; - if (p) - for(i=0;i= 0xfc0000) { - addr -= kickmem_start & kickmem_mask; - addr &= kickmem_mask; - m = (uae_u32 *)(kickmemory + addr); - do_put_mem_long (m, swab_l(b)); - return; - } else - a1000_handle_kickstart (0); + if (addr >= 0xfc0000) { + addr -= kickmem_start /*& kickmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= kickmem_mask; +#endif + m = (uae_u16 *)(kickmemory + addr); + do_put_mem_word(m, l >> 16); + do_put_mem_word(m + 1, l); + return; + } else + a1000_handle_kickstart (0); } } -void REGPARAM2 kickmem_wput (uaecptr addr, uae_u32 b) +void REGPARAM2 kickmem_wput (uaecptr addr, uae_u32 w) { uae_u16 *m; if (a1000_kickstart_mode) { - if (addr >= 0xfc0000) { - addr -= kickmem_start & kickmem_mask; - addr &= kickmem_mask; - m = (uae_u16 *)(kickmemory + addr); - do_put_mem_word (m, swab_w(b)); - return; - } else - a1000_handle_kickstart (0); + if (addr >= 0xfc0000) { + addr -= kickmem_start /*& kickmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= kickmem_mask; +#endif + m = (uae_u16 *)(kickmemory + addr); + do_put_mem_word (m, w); + return; + } else + a1000_handle_kickstart (0); } } void REGPARAM2 kickmem_bput (uaecptr addr, uae_u32 b) { + uae_u8 *m; if (a1000_kickstart_mode) { - if (addr >= 0xfc0000) { - addr -= kickmem_start & kickmem_mask; - addr &= kickmem_mask; - kickmemory[addr] = b; - return; - } else - a1000_handle_kickstart (0); + if (addr >= 0xfc0000) { + addr -= kickmem_start /*& kickmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS + addr &= kickmem_mask; +#endif + m = (uae_u8 *)(kickmemory + addr); + do_put_mem_byte (m, b); + return; + } else + a1000_handle_kickstart (0); } } int REGPARAM2 kickmem_check (uaecptr addr, uae_u32 size) { - addr -= kickmem_start & kickmem_mask; + addr -= kickmem_start /*& kickmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS addr &= kickmem_mask; +#endif return (addr + size) <= kickmem_size; } uae_u8 REGPARAM2 *kickmem_xlate (uaecptr addr) { - addr -= kickmem_start & kickmem_mask; + addr -= kickmem_start /*& kickmem_mask*/; +#ifdef SAFE_MEMORY_ACCESS addr &= kickmem_mask; +#endif return kickmemory + addr; } @@ -656,10 +590,10 @@ static uae_u32 extendedkickmem_start; static int extromtype (void) { switch (extendedkickmem_size) { - case 524288: - return EXTENDED_ROM_CD32; - case 262144: - return EXTENDED_ROM_CDTV; + case 524288: + return EXTENDED_ROM_CD32; + case 262144: + return EXTENDED_ROM_CDTV; } return 0; } @@ -675,33 +609,24 @@ static uae_u8 *extendedkickmem_xlate (uaecptr addr) REGPARAM; uae_u32 REGPARAM2 extendedkickmem_lget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("extendedkickmem_lget 0x%X\n",addr); -#endif uae_u32 *m; addr -= extendedkickmem_start & extendedkickmem_mask; addr &= extendedkickmem_mask; m = (uae_u32 *)(extendedkickmemory + addr); - return swab_l(do_get_mem_long (m)); + return do_get_mem_long (m); } uae_u32 REGPARAM2 extendedkickmem_wget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("extendedkickmem_wget 0x%X\n",addr); -#endif uae_u16 *m; addr -= extendedkickmem_start & extendedkickmem_mask; addr &= extendedkickmem_mask; m = (uae_u16 *)(extendedkickmemory + addr); - return swab_w(do_get_mem_word (m)); + return do_get_mem_word (m); } uae_u32 REGPARAM2 extendedkickmem_bget (uaecptr addr) { -#ifdef DEBUG_MEMORY - dbgf("extendedkickmem_bget 0x%X\n",addr); -#endif addr -= extendedkickmem_start & extendedkickmem_mask; addr &= extendedkickmem_mask; return extendedkickmemory[addr]; @@ -709,23 +634,14 @@ uae_u32 REGPARAM2 extendedkickmem_bget (uaecptr addr) void REGPARAM2 extendedkickmem_lput (uaecptr addr, uae_u32 b) { -#ifdef DEBUG_MEMORY - dbgf("extendedkickmem_lput 0x%X = 0x%X\n",addr,b); -#endif } void REGPARAM2 extendedkickmem_wput (uaecptr addr, uae_u32 b) { -#ifdef DEBUG_MEMORY - dbgf("extendedkickmem_wput 0x%X = 0x%X\n",addr,b); -#endif } void REGPARAM2 extendedkickmem_bput (uaecptr addr, uae_u32 b) { -#ifdef DEBUG_MEMORY - dbgf("extendedkickmem_bput 0x%X = 0x%X\n",addr,b); -#endif } int REGPARAM2 extendedkickmem_check (uaecptr addr, uae_u32 size) @@ -742,6 +658,7 @@ uae_u8 REGPARAM2 *extendedkickmem_xlate (uaecptr addr) return extendedkickmemory + addr; } + /* Default memory access functions */ int REGPARAM2 default_check (uaecptr a, uae_u32 b) @@ -752,7 +669,7 @@ int REGPARAM2 default_check (uaecptr a, uae_u32 b) uae_u8 REGPARAM2 *default_xlate (uaecptr a) { write_log ("Your Amiga program just did something terribly stupid\n"); - g_emulator.uae_reset (); + uae_reset (); return kickmem_xlate (get_long (0xF80000)); /* So we don't crash. */ } @@ -762,47 +679,99 @@ addrbank dummy_bank = { dummy_lget, dummy_wget, dummy_bget, dummy_lput, dummy_wput, dummy_bput, default_xlate, dummy_check, NULL + }; +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) addrbank mbres_bank = { mbres_lget, mbres_wget, mbres_bget, mbres_lput, mbres_wput, mbres_bput, default_xlate, mbres_check, NULL + }; +#endif addrbank chipmem_bank = { chipmem_lget, chipmem_wget, chipmem_bget, chipmem_lput, chipmem_wput, chipmem_bput, chipmem_xlate, chipmem_check, NULL + }; addrbank bogomem_bank = { bogomem_lget, bogomem_wget, bogomem_bget, bogomem_lput, bogomem_wput, bogomem_bput, bogomem_xlate, bogomem_check, NULL + }; -addrbank a3000mem_bank = { +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) +/*addrbank a3000mem_bank = { a3000mem_lget, a3000mem_wget, a3000mem_bget, a3000mem_lput, a3000mem_wput, a3000mem_bput, a3000mem_xlate, a3000mem_check, NULL -}; + +};*/ +#endif addrbank kickmem_bank = { kickmem_lget, kickmem_wget, kickmem_bget, kickmem_lput, kickmem_wput, kickmem_bput, kickmem_xlate, kickmem_check, NULL + }; addrbank extendedkickmem_bank = { extendedkickmem_lget, extendedkickmem_wget, extendedkickmem_bget, extendedkickmem_lput, extendedkickmem_wput, extendedkickmem_bput, extendedkickmem_xlate, extendedkickmem_check, NULL + }; static int decode_cloanto_rom (uae_u8 *mem, int size, int real_size) { - return 0; + FILE *keyf; + uae_u8 *p; + long cnt, t; + int keysize; + +#ifdef ANDROIDSDL + __android_log_print(ANDROID_LOG_INFO, "UAE", "decode_cloanto_rom %s", romkeyfile); +#endif + + if (strlen (romkeyfile) == 0) { + return 0; + } else { + keyf = fopen (romkeyfile, "rb"); + if (keyf == 0) { +#ifdef ANDROIDSDL + __android_log_print(ANDROID_LOG_ERROR, "UAE", "Error opening keyfile \"%s\"\n", romkeyfile ); +#endif + return 0; + } + + p = (uae_u8 *)xmalloc (524288); + keysize = fread (p, 1, 524288, keyf); + if (keysize == 0 || p == 0) { +#ifdef ANDROIDSDL + __android_log_print(ANDROID_LOG_ERROR, "UAE", "Error reading keyfile \"%s\"\n", romkeyfile ); +#endif + fclose (keyf); + free (p); + return 0; + } +#ifdef ANDROIDSDL + __android_log_print(ANDROID_LOG_INFO, "UAE", "rom size: %d %d, keyfile size: %d\n", size, real_size, keysize ); +#endif + for (t = cnt = 0; cnt < size; cnt++, t = (t + 1) % keysize) { + mem[cnt] ^= p[t]; + if (real_size == cnt + 1) + t = keysize - 1; + } + fclose (keyf); + free (p); + } + return 1; } static int kickstart_checksum (uae_u8 *mem, int size) @@ -810,14 +779,14 @@ static int kickstart_checksum (uae_u8 *mem, int size) uae_u32 cksum = 0, prevck = 0; int i; for (i = 0; i < size; i += 4) { - uae_u32 data = mem[i] * 65536 * 256 + mem[i + 1] * 65536 + mem[i + 2] * 256 + mem[i + 3]; - cksum += data; - if (cksum < prevck) - cksum++; - prevck = cksum; + uae_u32 data = mem[i] * 65536 * 256 + mem[i + 1] * 65536 + mem[i + 2] * 256 + mem[i + 3]; + cksum += data; + if (cksum < prevck) + cksum++; + prevck = cksum; } if (cksum != 0xFFFFFFFFul) { - write_log ("Kickstart checksum incorrect. You probably have a corrupted ROM image.\n"); + write_log ("Kickstart checksum incorrect. You probably have a corrupted ROM image.\n"); } return 0; } @@ -826,86 +795,127 @@ static int read_kickstart (FILE *f, uae_u8 *mem, int size, int dochecksum, int * { unsigned char buffer[20]; int i, cr = 0; - + if (cloanto_rom) - *cloanto_rom = 0; + *cloanto_rom = 0; i = uae4all_rom_fread (buffer, 1, 11, f); if (strncmp ((char *) buffer, "AMIROMTYPE1", 11) != 0) { - uae4all_rom_fseek (f, 0, SEEK_SET); + uae4all_rom_fseek (f, 0, SEEK_SET); } else { - cr = 1; + cr = 1; } - + i = uae4all_rom_fread (mem, 1, size, f); if (i == 8192) { - a1000_bootrom = (uae_u8*)xmalloc (8192); - memcpy (a1000_bootrom, kickmemory, 8192); - a1000_handle_kickstart (1); + a1000_bootrom = (uae_u8*)xmalloc (8192); + memcpy (a1000_bootrom, kickmemory, 8192); + a1000_handle_kickstart (1); } else if (i == size / 2) { - memcpy (mem + size / 2, mem, i); + memcpy (mem + size / 2, mem, i); } else if (i != size) { - write_log ("Error while reading Kickstart.\n"); - uae4all_rom_fclose (f); - return 0; + write_log ("Error while reading Kickstart.\n"); + uae4all_rom_fclose (f); + return 0; } uae4all_rom_fclose (f); - + if (cr) - decode_cloanto_rom (mem, size, i); + decode_cloanto_rom (mem, size, i); if (dochecksum && i >= 262144) - kickstart_checksum (mem, size); + kickstart_checksum (mem, size); if (cloanto_rom) - *cloanto_rom = cr; + *cloanto_rom = cr; return 1; } -static int load_extendedkickstart (void) +/*static int load_extendedkickstart (void) { - return 0; -} + FILE *f; + int size; + + if (strlen (extfile) == 0) + return 0; + f = fopen (extfile, "rb"); + if (!f) + { + printf ("No extended Kickstart ROM found.\n"); + return 0; + } + + fseek (f, 0, SEEK_END); + size = ftell (f); + if (size > 300000) + extendedkickmem_size = 524288; + else + extendedkickmem_size = 262144; + fseek (f, 0, SEEK_SET); + + switch (extromtype ()) + { + case EXTENDED_ROM_CDTV: + extendedkickmemory = (uae_u8 *) mapped_malloc (extendedkickmem_size, "rom_f0"); + extendedkickmem_bank.baseaddr = (uae_u8 *) extendedkickmemory; + break; + case EXTENDED_ROM_CD32: + extendedkickmemory = (uae_u8 *) mapped_malloc (extendedkickmem_size, "rom_e0"); + extendedkickmem_bank.baseaddr = (uae_u8 *) extendedkickmemory; + break; + } + + //read_kickstart (f, extendedkickmemory, 524288, 0, 0); + int i; + i = fread (extendedkickmemory, 1, 524288, f); + if (i != 8192 && i != 65536 && i != 131072 && i != 262144 && i != 524288 && i != 524288 * 2 && i != 524288 * 4) + { + printf ("Error while reading Kickstart ROM file.\n"); + fclose (f); + return 0; + } + fclose (f); + printf("Extended ROM loaded: %s\n", extfile); + swab_memory(extendedkickmemory, extendedkickmem_size); + + return 1; +}*/ -static void swab_kickstart(void) +void swab_memory(uae_u8 *apMemory, uae_u32 aSize) { -#ifdef USE_FAME_CORE - unsigned i; - unsigned char *km=kickmemory; - for(i=0;i -#include -#include -#include - -shmpiece *shm_start = NULL; -int canbang = 1; - -static void dumplist (void) -{ - shmpiece *x = shm_start; -#ifdef DEBUG_MEMORY - dbgf ("Start Dump:\n"); -#endif - while (x) { -#ifdef DEBUG_MEMORY - dbgf (" this=%p, Native %p, id %d, prev=%p, next=%p, size=0x%08x\n", - x, x->native_address, x->id, x->prev, x->next, x->size); -#endif - x = x->next; - } -#ifdef DEBUG_MEMORY - dbgf ("End Dump:\n"); -#endif -} - -static shmpiece *find_shmpiece (uae_u8 *base) -{ - shmpiece *x = shm_start; - - while (x && x->native_address != base) - x = x->next; - if (!x) { -#ifdef DEBUG_MEMORY - dbgf ("NATMEM: Failure to find mapping at %p\n", base); -#endif - dumplist (); - canbang = 0; - return 0; - } - return x; -} - -static void delete_shmmaps (uae_u32 start, uae_u32 size) -{ - if (!canbang) - return; - - while (size) { - uae_u8 *base = mem_banks[bankindex (start)]->baseaddr; - if (base) { - shmpiece *x; - base = ((uae_u8 *) NATMEM_OFFSET) + start; - - x = find_shmpiece (base); - if (!x) - return; - - if (x->size > size) { -#ifdef DEBUG_MEMORY - dbgf ("NATMEM: Failure to delete mapping at %08x(size %08x, delsize %08x)\n", start, x->size, size); -#endif - dumplist (); - canbang = 0; - return; - } - shmdt (x->native_address); - size -= x->size; - start += x->size; - if (x->next) - x->next->prev = x->prev; /* remove this one from the list */ - if (x->prev) - x->prev->next = x->next; - else - shm_start = x->next; - free (x); - } else { - size -= 0x10000; - start += 0x10000; - } - } -} - -static void add_shmmaps (uae_u32 start, addrbank *what) -{ - shmpiece *x = shm_start; - shmpiece *y; - uae_u8 *base = what->baseaddr; - if (!canbang) - return; - if (!base) - return; - - x = find_shmpiece (base); - if (!x) - return; - y = xmalloc (sizeof (shmpiece)); - *y = *x; - base = ((uae_u8 *) NATMEM_OFFSET) + start; - y->native_address = shmat (y->id, base, 0); - if (y->native_address == (void *) -1) { -#ifdef DEBUG_MEMORY - dbgf ("NATMEM: Failure to map existing at %08x(%p)\n", start, base); -#endif - perror ("shmat"); - dumplist (); - canbang = 0; - return; - } - y->next = shm_start; - y->prev = NULL; - if (y->next) - y->next->prev = y; - shm_start = y; -} - -uae_u8 *mapped_malloc (size_t s, char *file) -{ - int id; - void *answer; - shmpiece *x; - - if (!canbang) - return xmalloc (s); - - id = shmget (IPC_PRIVATE, s, 0x1ff, file); - if (id == 1) { - canbang = 0; - return mapped_malloc (s, file); - } - answer = shmat (id, 0, 0); - shmctl (id, IPC_RMID, NULL); - if (answer != (void *) -1) { - x = xmalloc (sizeof (shmpiece)); - x->native_address = answer; - x->id = id; - x->size = s; - x->next = shm_start; - x->prev = NULL; - if (x->next) - x->next->prev = x; - shm_start = x; - - return answer; - } - canbang = 0; - return mapped_malloc (s, file); -} - -void mapped_free (uae_u8 *base) -{ - shmpiece *x = find_shmpiece (base); - if (!x) - return; - shmdt (x->native_address); -} - -#endif static void init_mem_banks (void) { - int i; + unsigned int i; + unsigned int z; for (i = 0; i < 65536; i++) - put_mem_bank (i << 16, &dummy_bank, 0); -#ifdef USE_FAME_CORE + { + put_mem_bank (i << 16, &dummy_bank); + } if (!savestate_state) - init_memmaps(&dummy_bank); -#endif + init_memmaps(&dummy_bank); } static void allocate_memory (void) { - if (allocated_chipmem != prefs_chipmem_size) { - if (chipmemory) - mapped_free (chipmemory); - chipmemory = 0; - - allocated_chipmem = prefs_chipmem_size; - chipmem_mask = allocated_chipmem - 1; - - chipmemory = (uae_u8 *)mapped_malloc (allocated_chipmem, "chip"); - - if (chipmemory == 0) { - write_log ("Fatal error: out of memory for chipmem.\n"); - allocated_chipmem = 0; - } else - do_put_mem_long ((uae_u32 *)(chipmemory + 4), swab_l(0)); + if (allocated_chipmem != prefs_chipmem_size) + { + if (chipmemory) + mapped_free (chipmemory); + chipmemory = 0; + + allocated_chipmem = prefs_chipmem_size; + chipmem_mask = allocated_chipmem - 1; + + chipmemory = mapped_malloc (allocated_chipmem, "chip"); + + if (chipmemory == 0) { + write_log ("Fatal error: out of memory for chipmem.\n"); + allocated_chipmem = 0; + } + else do_put_mem_long ((uae_u32 *)(chipmemory + 4), 0); + } + + /* PocketUAE code */ + if (allocated_bogomem != prefs_bogomem_size) { + if (bogomemory) + mapped_free (bogomemory); + bogomemory = 0; + + if(prefs_bogomem_size > 0x1c0000) + prefs_bogomem_size = 0x1c0000; + /*if (prefs_bogomem_size > 0x180000 && ((changed_prefs.chipset_mask & CSMASK_AGA) || (prefs_cpu_model >= 68020))) + prefs_bogomem_size = 0x180000;*/ + + allocated_bogomem = prefs_bogomem_size; + bogomem_mask = allocated_bogomem - 1; + + if (allocated_bogomem) { + bogomemory = mapped_malloc (allocated_bogomem, "bogo"); + if (bogomemory == 0) { + write_log ("Out of memory for bogomem.\n"); + allocated_bogomem = 0; + } + } } - + + /******************/ if (savestate_state == STATE_RESTORE) { - fseek (savestate_file, chip_filepos, SEEK_SET); - - void *tmp=malloc(compressed_size); - int outSize=allocated_chipmem; - int inSize=compressed_size; - int res; - fread (tmp, 1, compressed_size, savestate_file); - res=uncompress((Bytef *)chipmemory, (uLongf *)&outSize, (const Bytef *)tmp, (uLong) inSize); - free(tmp); - if(res != Z_OK) - { - // decompression failed - treat data literaly - allocated_chipmem=compressed_size; - fseek (savestate_file, chip_filepos, SEEK_SET); - fread (chipmemory, 1, allocated_chipmem, savestate_file); - } - if (allocated_bogomem > 0) - { - fseek (savestate_file, bogo_filepos, SEEK_SET); - fread (bogomemory, 1, allocated_bogomem, savestate_file); - } + fseek (savestate_file, chip_filepos, SEEK_SET); + + void *tmp=malloc(compressed_size); + uLong outSize=allocated_chipmem; + uLong inSize=compressed_size; + int res; + fread (tmp, 1, compressed_size, savestate_file); + res=uncompress((Bytef *)chipmemory, (uLongf *)&outSize, (const Bytef *)tmp, (uLong) inSize); + free(tmp); + if(res != Z_OK) + { + // decompression failed - treat data literaly + allocated_chipmem=compressed_size; + fseek (savestate_file, chip_filepos, SEEK_SET); + fread (chipmemory, 1, allocated_chipmem, savestate_file); + } + if (allocated_bogomem > 0) + { + fseek (savestate_file, bogo_filepos, SEEK_SET); + fread (bogomemory, 1, allocated_bogomem, savestate_file); + } } - + chipmem_bank.baseaddr = chipmemory; bogomem_bank.baseaddr = bogomemory; chipmemory_word=(uae_u16 *)chipmemory; @@ -1140,173 +1016,155 @@ static void allocate_memory (void) static void reload_kickstart(void) { - load_extendedkickstart (); + // load_extendedkickstart (); if (!load_kickstart ()) { - init_ersatz_rom (kickmemory); - ersatzkickfile = 1; + init_ersatz_rom (kickmemory); + ersatzkickfile = 1; } - swab_kickstart(); + swab_memory(kickmemory, kickmem_size); kickmem_checksum=get_kickmem_checksum(); } void memory_reset (void) { - int i, custom_start; - -#ifdef DEBUG_MEMORY - dbg("memory_reset!"); -#endif -#ifdef NATMEM_OFFSET - delete_shmmaps (0, 0xFFFF0000); -#endif + int bnk, bnk_end, custom_start; + init_mem_banks (); - - memset(chipmemory,0,allocated_chipmem); -#ifdef USE_FAME_CORE - clear_fame_mem_dummy(); -#endif - rtarea_cleanup(); - + allocate_memory (); - - /* Map the chipmem into all of the lower 8MB */ - i = allocated_chipmem > 0x200000 ? (allocated_chipmem >> 16) : 32; -#ifdef DEBUG_MEMORY - dbg("map_banks : chipmem_bank"); -#endif - map_banks (&chipmem_bank, 0x00, i, allocated_chipmem); - + + // memset(chipmemory,0,allocated_chipmem); + clear_fame_mem_dummy(); + + /* Can't be done here, or we'll lose all the extension/filesys traps that were set up */ + // rtarea_cleanup(); + + if (kickmem_checksum!=get_kickmem_checksum() | bReloadKickstart) + { + bReloadKickstart=0; + unsigned chksum=kickmem_checksum; + reload_kickstart(); + if (chksum!=kickmem_checksum) + { + uae4all_rom_reinit(); + reload_kickstart(); + } + } + custom_start = 0xC0; - -#ifdef DEBUG_MEMORY - dbg("map_banks : custom_bank"); -#endif map_banks (&custom_bank, custom_start, 0xE0 - custom_start, 0); -#ifdef DEBUG_MEMORY - dbg("map_banks : cia_bank"); -#endif map_banks (&cia_bank, 0xA0, 32, 0); -#ifdef DEBUG_MEMORY - dbg("map_banks : clock_bank"); -#endif - map_banks (&clock_bank, 0xDC, 1, 0); - - /* @@@ Does anyone have a clue what should be in the 0x200000 - 0xA00000 - * range on an Amiga without expansion memory? */ - custom_start = allocated_chipmem >> 16; - if (custom_start < 0x20) - custom_start = 0x20; -#ifdef DEBUG_MEMORY - dbg("map_banks : dummy_bank"); -#endif - map_banks (&dummy_bank, custom_start, 0xA0 - custom_start, 0); - /*map_banks (&mbres_bank, 0xDE, 1); */ - + if (!a1000_bootrom) + /* D80000 - DDFFFF not mapped (A1000 = custom chips) */ + map_banks (&dummy_bank, 0xD8, 6, 0); + + /* Map "nothing" to 0x200000 - 0x9FFFFF (0xBEFFFF if PCMCIA or AGA) */ + /*bnk = allocated_chipmem >> 16;*/ + if (bnk < 0x20 + (allocated_fastmem >> 16)) + bnk = 0x20 + (allocated_fastmem >> 16); + //bnk_end = (((changed_prefs.chipset_mask & CSMASK_AGA) /*|| currprefs.cs_pcmcia*/) ? 0xBF : 0xA0); + /*map_banks (&dummy_bank, bnk, bnk_end - bnk, 0); + if (changed_prefs.chipset_mask & CSMASK_AGA) + map_banks (&dummy_bank, 0xc0, 0xd8 - 0xc0, 0);*/ + + /* Map chipmem */ + bnk = allocated_chipmem > 0x200000 ? (allocated_chipmem >> 16) : 0x20; + map_banks (&chipmem_bank, 0x00, bnk, allocated_chipmem); + if (bogomemory != 0) { - int t = allocated_bogomem >> 16; - if (t > 0x1C) - t = 0x1C; -#ifdef DEBUG_MEMORY - dbg("map_banks : bogomem_bank"); -#endif - map_banks (&bogomem_bank, 0xC0, t, allocated_bogomem); + int t = allocated_bogomem >> 16; + + // memset(bogomemory,0,allocated_bogomem); + map_banks (&bogomem_bank, 0xC0, t, allocated_bogomem); } - if (a3000memory != 0) + + map_banks (&clock_bank, 0xDC, 1, 0); + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + /*if (a3000memory != 0) { -#ifdef DEBUG_MEMORY - dbg("map_banks : a3000mem_bank"); -#endif - map_banks (&a3000mem_bank, a3000mem_start >> 16, allocated_a3000mem >> 16, allocated_a3000mem); - } - -#ifdef DEBUG_MEMORY - dbg("map_banks : rtarea_bank"); + map_banks (&a3000mem_bank, a3000mem_start >> 16, allocated_a3000mem >> 16, allocated_a3000mem); + }*/ #endif + map_banks (&rtarea_bank, RTAREA_BASE >> 16, 1, 0); - -#ifdef DEBUG_MEMORY - dbg("map_banks : kickmem_bank"); -#endif + map_banks (&kickmem_bank, 0xF8, 8, 0); + + /* map beta Kickstarts at 0x200000 */ + if (kickmemory[2] == 0x4e && kickmemory[3] == 0xf9 && kickmemory[4] == 0x00) { + uae_u32 addr = kickmemory[5]; + if (addr == 0x20 && allocated_chipmem <= 0x200000 && allocated_fastmem == 0) + map_banks (&kickmem_bank, addr, 8, 0); + } + if (a1000_bootrom) - a1000_handle_kickstart (1); - - switch (extromtype ()) { - case EXTENDED_ROM_CDTV: -#ifdef DEBUG_MEMORY - dbg("map_banks : extendedkickmem_bank"); -#endif - map_banks (&extendedkickmem_bank, 0xF0, 4, 0); - break; - case EXTENDED_ROM_CD32: -#ifdef DEBUG_MEMORY - dbg("map_banks : extendedkickmem_bank"); + a1000_handle_kickstart (1); + +#ifdef USE_AUTOCONFIG + map_banks (&expamem_bank, 0xE8, 1, 0); #endif - map_banks (&extendedkickmem_bank, 0xE0, 8, 0); - break; - default: - if (cloanto_rom) - { -#ifdef DEBUG_MEMORY - dbg("map_banks : kickmem_bank"); -#endif - map_banks (&kickmem_bank, 0xE0, 8, 0); - } - } - if (kickmem_checksum!=get_kickmem_checksum() | bReloadKickstart) + + switch (extromtype ()) { - bReloadKickstart=0; - unsigned chksum=kickmem_checksum; - reload_kickstart(); - if (chksum!=kickmem_checksum) - { - uae4all_rom_reinit(); - reload_kickstart(); - } + case EXTENDED_ROM_CDTV: + map_banks (&extendedkickmem_bank, 0xF0, 8, 0); + break; + case EXTENDED_ROM_CD32: + map_banks (&extendedkickmem_bank, 0xE0, 8, 0); + break; + default: + if (cloanto_rom) + { + map_banks (&kickmem_bank, 0xE0, 8, 0); + } } } void memory_init (void) { -#ifdef DEBUG_MEMORY - dbg("memory_init!"); -#endif allocated_chipmem = 0; allocated_bogomem = 0; +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) allocated_a3000mem = 0; + //a3000memory = 0; +#endif kickmemory = 0; extendedkickmemory = 0; chipmemory = 0; - a3000memory = 0; bogomemory = 0; - + kickmemory = mapped_malloc (kickmem_size, "kick"); kickmem_bank.baseaddr = kickmemory; - + reload_kickstart(); - + init_mem_banks (); memory_reset (); - + kickmem_mask = kickmem_size - 1; extendedkickmem_mask = extendedkickmem_size - 1; } void memory_cleanup (void) { - if (a3000memory) - mapped_free (a3000memory); +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + /*if (a3000memory) + mapped_free (a3000memory);*/ +#endif if (bogomemory) - mapped_free (bogomemory); + mapped_free (bogomemory); if (kickmemory) - mapped_free (kickmemory); + mapped_free (kickmemory); if (a1000_bootrom) - free (a1000_bootrom); + free (a1000_bootrom); if (chipmemory) - mapped_free (chipmemory); - - a3000memory = 0; + mapped_free (chipmemory); + +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) + //a3000memory = 0; +#endif bogomemory = 0; kickmemory = 0; a1000_bootrom = 0; @@ -1319,67 +1177,43 @@ void map_banks (addrbank *bank, int start, int size, int realsize) unsigned long int hioffs = 0, endhioffs = 0x100; addrbank *orgbank = bank; uae_u32 realstart = start; - -#ifdef DEBUG_MEMORY - dbg("Map"); -#endif - flush_icache (1); /* Sure don't want to keep any old mappings around! */ -#ifdef NATMEM_OFFSET - delete_shmmaps (start << 16, size << 16); -#endif - + if (!realsize) - realsize = size << 16; - + realsize = size << 16; + if ((size << 16) < realsize) { - write_log ("Please report to bmeyer@cs.monash.edu.au, and mention:\n"); - write_log ("Broken mapping, size=%x, realsize=%x\n", size, realsize); - write_log ("Start is %x\n", start); - write_log ("Reducing memory sizes, especially chipmem, may fix this problem\n"); - return; + write_log ("Please report to bmeyer@cs.monash.edu.au, and mention:\n"); + write_log ("Broken mapping, size=%x, realsize=%x\n", size, realsize); + write_log ("Start is %x\n", start); + write_log ("Reducing memory sizes, especially chipmem, may fix this problem\n"); + return; } - + if (start >= 0x100) { - int real_left = 0; - for (bnr = start; bnr < start + size; bnr++) { - if (!real_left) { - realstart = bnr; - real_left = realsize >> 16; -#ifdef NATMEM_OFFSET - add_shmmaps (realstart << 16, bank); -#endif - } - put_mem_bank (bnr << 16, bank, realstart << 16); -#ifdef USE_FAME_CORE - map_zone(bnr,bank,realstart); -#endif - real_left--; - } -#ifdef DEBUG_MEMORY - dbg("!Map"); -#endif - return; + int real_left = 0; + for (bnr = start; bnr < start + size; bnr++) { + if (!real_left) { + realstart = bnr; + real_left = realsize >> 16; + } + put_mem_bank (bnr << 16, bank); + map_zone(bnr,bank,realstart); + real_left--; + } + return; } for (hioffs = 0; hioffs < endhioffs; hioffs += 0x100) { - int real_left = 0; - for (bnr = start; bnr < start + size; bnr++) { - if (!real_left) { - realstart = bnr + hioffs; - real_left = realsize >> 16; -#ifdef NATMEM_OFFSET - add_shmmaps (realstart << 16, bank); -#endif - } - put_mem_bank ((bnr + hioffs) << 16, bank, realstart << 16); -#ifdef USE_FAME_CORE - map_zone(bnr+hioffs,bank,realstart); -#endif - real_left--; - } + int real_left = 0; + for (bnr = start; bnr < start + size; bnr++) { + if (!real_left) { + realstart = bnr + hioffs; + real_left = realsize >> 16; + } + put_mem_bank ((bnr + hioffs) << 16, bank); + map_zone(bnr+hioffs,bank,realstart); + real_left--; + } } -#ifdef DEBUG_MEMORY - dbg("!Map!"); -#endif } @@ -1415,7 +1249,7 @@ uae_u8 *restore_rom (uae_u8 *src) restore_u32 (); restore_u32 (); restore_u32 (); - + return src; } @@ -1425,57 +1259,55 @@ uae_u8 *save_rom (int first, int *len) uae_u8 *dst, *dstbak; uae_u8 *mem_real_start; int mem_start, mem_size, mem_type, i, saverom; - + saverom = 0; if (first) - count = 0; + count = 0; for (;;) { - mem_type = count; - switch (count) { - case 0: /* Kickstart ROM */ - mem_start = 0xf80000; - mem_real_start = kickmemory; - mem_size = kickmem_size; - /* 256KB or 512KB ROM? */ - for (i = 0; i < mem_size / 2 - 4; i++) { - if (longget (i + mem_start) != longget (i + mem_start + mem_size / 2)) - break; - } - if (i == mem_size / 2 - 4) { - mem_size /= 2; - mem_start += 262144; - } - mem_type = 0; - break; - default: - return 0; - } - count++; - if (mem_size) - break; + mem_type = count; + switch (count) { + case 0: /* Kickstart ROM */ + mem_start = 0xf80000; + mem_real_start = kickmemory; + mem_size = kickmem_size; + /* 256KB or 512KB ROM? */ + for (i = 0; i < mem_size / 2 - 4; i++) { + if (longget (i + mem_start) != longget (i + mem_start + mem_size / 2)) + break; + } + if (i == mem_size / 2 - 4) { + mem_size /= 2; + mem_start += 262144; + } + mem_type = 0; + break; + default: + return 0; + } + count++; + if (mem_size) + break; } - dstbak = dst = (uae_u8 *)malloc (4 + 4 + 4 + 4 + 4 + mem_size); + if(saverom) + dstbak = dst = (uae_u8 *)malloc (4 + 4 + 4 + 4 + 4 + mem_size); + else + dstbak = dst = (uae_u8 *)malloc (4 + 4 + 4 + 4 + 4); save_u32 (mem_start); save_u32 (mem_size); save_u32 (mem_type); save_u32 (longget (mem_start + 12)); /* version+revision */ save_u32 (0); - sprintf ((char *)dst, "Kickstart %d.%d", wordget (mem_start + 12), wordget (mem_start + 14)); - dst += strlen ((char *)dst) + 1; + // no memory allocated for "Kickstart %d.%d" + //snprintf ((char *)dst, 32, "Kickstart %d.%d", wordget (mem_start + 12), wordget (mem_start + 14)); + //dst += strlen ((char *)dst) + 1; if (saverom) { - for (i = 0; i < mem_size; i++) - *dst++ = byteget (mem_start + i); + for (i = 0; i < mem_size; i++) + *dst++ = byteget (mem_start + i); } *len = dst - dstbak; return dstbak; } -uae_u8 *save_fram (int *len) -{ - *len = 0; //allocated_fastmem; - return NULL; -} - uae_u8 *save_zram (int *len) { *len = 0; //allocated_z3fastmem; @@ -1490,39 +1322,4 @@ void restore_zram (int len, long filepos) { } -uae_u8 *save_expansion (int *len) -{ - static uae_u8 t[20], *dst = t; - save_u32 (0); - save_u32 (0); - *len = 8; - return dst; -} - -uae_u8 *restore_expansion (uae_u8 *src) -{ - restore_u32 (); - restore_u32 (); - return src; -} - -#define MEMORY_DEBUGGER - -#ifdef MEMORY_DEBUGGER - -void find_word(uae_u16 aWord) { - uae_u16 *p = chipmemory_word; - uae_u16 *end = (uae_u16*)(chipmemory + allocated_chipmem); - int count = 0; - while (p < end) { - if (*p++ == aWord && count++ < 100) { - printf("%06x, ", (p-chipmemory_word)); - } - } - if (count > 100) { - printf("and %d more...", count); - } - printf("\n"); -} - -#endif +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/native2amiga.cpp b/uae4all_gp2x_0.7.2a/src/native2amiga.cpp new file mode 100755 index 0000000..9c1fd68 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/native2amiga.cpp @@ -0,0 +1,94 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * Call Amiga Exec functions outside the main UAE thread. + * + * Copyright 1999 Patrick Ohly + * + * Uses the EXTER interrupt that is setup in filesys.c + * and needs thread support. + */ + +#include "sysconfig.h" +#include "sysdeps.h" + +#include "config.h" +#include "thread.h" +#include "options.h" +#include "memory-uae.h" +#include "custom.h" +#include "m68k/m68k_intrf.h" +#include "disk.h" +#include "autoconf.h" +#include "filesys.h" +#include "execlib.h" +#include "native2amiga.h" + +smp_comm_pipe native2amiga_pending; + +/* + * to be called when setting up the hardware + */ + +void native2amiga_install (void) +{ + init_comm_pipe (&native2amiga_pending, 10, 2); +} + +/* + * to be called when the Amiga boots, i.e. by filesys_diagentry() + */ +void native2amiga_startup (void) +{ +} + +#ifdef SUPPORT_THREADS +void uae_ReplyMsg(uaecptr msg) +{ + write_comm_pipe_int (&native2amiga_pending, 2, 0); + write_comm_pipe_u32 (&native2amiga_pending, msg, 1); + + uae_int_requested = 1; +} + +void uae_PutMsg(uaecptr port, uaecptr msg) +{ + uae_pt data; + data.i = 1; + write_comm_pipe_int (&native2amiga_pending, 1, 0); + write_comm_pipe_u32 (&native2amiga_pending, port, 0); + write_comm_pipe_u32 (&native2amiga_pending, msg, 1); + + uae_int_requested = 1; +} + +void uae_Signal(uaecptr task, uae_u32 mask) +{ + write_comm_pipe_int (&native2amiga_pending, 0, 0); + write_comm_pipe_u32 (&native2amiga_pending, task, 0); + write_comm_pipe_int (&native2amiga_pending, mask, 1); + + uae_int_requested = 1; +} +#endif + +void uae_NewList(uaecptr list) +{ + put_long (list, list + 4); + put_long (list + 4, 0); + put_long (list + 8, list); +} + +uaecptr uae_AllocMem (uae_u32 size, uae_u32 flags) +{ + m68k_dreg (regs, 0) = size; + m68k_dreg (regs, 1) = flags; + return CallLib (get_long (4), -198); /* AllocMem */ +} + +void uae_FreeMem (uaecptr memory, uae_u32 size) +{ + m68k_dreg (regs, 0) = size; + m68k_areg (regs, 1) = memory; + CallLib (get_long (4), -0xD2); /* FreeMem */ +} diff --git a/uae4all_gp2x_0.7.2a/src/od-joy.cpp b/uae4all_gp2x_0.7.2a/src/od-joy.mm similarity index 51% rename from uae4all_gp2x_0.7.2a/src/od-joy.cpp rename to uae4all_gp2x_0.7.2a/src/od-joy.mm index d28d8b0..e7fafb5 100644 --- a/uae4all_gp2x_0.7.2a/src/od-joy.cpp +++ b/uae4all_gp2x_0.7.2a/src/od-joy.mm @@ -1,4 +1,7 @@ -/* +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch" + +/* * UAE - The Un*x Amiga Emulator * * Joystick emulation for Linux and BSD. They share too much code to @@ -7,6 +10,23 @@ * Copyright 1997 Bernd Schmidt * Copyright 1998 Krister Walfridsson */ +// Changed by Emufr3ak on 17.11.2014 +// +// iUAE is free software: you may copy, redistribute +// and/or modify it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 2 of the +// License, or (at your option) any later version. +// +// This file is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + #include "sysconfig.h" #include "sysdeps.h" @@ -17,7 +37,10 @@ #include "vkbd.h" +#import + int nr_joysticks; +int joystickselected; SDL_Joystick *uae4all_joy0, *uae4all_joy1; @@ -28,19 +51,17 @@ void read_joystick(int nr, unsigned int *dir, int *button) #ifndef MAX_AUTOEVENTS int left = 0, right = 0, top = 0, bot = 0; int i, num; - SDL_Joystick *joy = nr == 0 ? uae4all_joy0 : uae4all_joy0; + + nr = !nr; + + SDL_Joystick *joy = nr == 0 ? uae4all_joy0 : uae4all_joy1; *dir = 0; *button = 0; -#if defined (SWAP_JOYSTICK) - if (nr == 0) return; -#else - if (nr == 1) return; -#endif - nr = (~nr)&0x1; - - switch (g_touchStick.dPadState()) { + TouchStickDPadState dpadstate = nr == 0 ? g_touchStick.dPadStateP0() : g_touchStick.dPadStateP1(); + + switch (dpadstate) { case DPadUp: top = 1; break; @@ -66,15 +87,23 @@ void read_joystick(int nr, unsigned int *dir, int *button) top = 1; left = 1; break; } - - *button = g_touchStick.buttonOneState(); + + if(nr==0) + { + *button = g_touchStick.buttonOneStateP0(); + } + else + { + *button = g_touchStick.buttonOneStateP1(); + } + // now read current "SDL" joystick num = SDL_JoystickNumButtons (joy); // NOTE: should really only map one button, but this code maps any button press as a fire for (i = 0; i < num; i++) - //*button |= (SDL_JoystickGetButton (joy, i) & 1) << i; + *button |= (SDL_JoystickGetButton (joy, i) & 1) << i; *button |= (SDL_JoystickGetButton (joy, i) & 1); int hat = SDL_JoystickGetHat(joy, 0); @@ -95,8 +124,21 @@ void read_joystick(int nr, unsigned int *dir, int *button) } void init_joystick(void) { + nr_joysticks = 1; - uae4all_joy0 = SDL_JoystickOpen(3); // iCADE by default + joystickselected = 3; + + SDL_JoystickClose(uae4all_joy0); + if ([[GCController controllers] count] > 0) + { + uae4all_joy0 = SDL_JoystickOpen(4); // MFI Controller detected + joystickselected = 4; + } + else + { + uae4all_joy0 = SDL_JoystickOpen(3); // iCADE by default + joystickselected = 3; + } } void close_joystick(void) { @@ -109,3 +151,13 @@ void switch_joystick(int joynum) { uae4all_joy0 = newJoystick; SDL_JoystickClose(oldJoystick); } + +void set_joystickactive(void) { + if(uae4all_joy0) + { + SDL_JoystickSetActive(uae4all_joy0); + } +} + +#pragma clang diagnostic pop + diff --git a/uae4all_gp2x_0.7.2a/src/savestate.cpp b/uae4all_gp2x_0.7.2a/src/savestate.cpp index 2d76b6f..b0874e0 100755 --- a/uae4all_gp2x_0.7.2a/src/savestate.cpp +++ b/uae4all_gp2x_0.7.2a/src/savestate.cpp @@ -1,46 +1,46 @@ - /* - * UAE - The Un*x Amiga Emulator - * - * Save/restore emulator state - * - * (c) 1999-2001 Toni Wilen - * - * see below for ASF-structure - */ - - /* Features: - * - * - full CPU state (68000/68010/68020, no FPU) - * - full CIA-A and CIA-B state (with all internal registers) - * - saves all custom registers and audio internal state but not all registers are restored yet. - * - only Chip-ram and Bogo-ram are saved and restored. - * - disk drive type, imagefile, track and motor state - * - Kickstart ROM version, address and size is saved. This data is not used during restore yet. - */ - - /* Notes: - * - * - blitter state is not saved, blitter is forced to finish immediately if it - * was active - * - disk DMA state is completely saved (I hope so..) - * - does not ask for statefile name and description. Currently uses DF0's disk - * image name (".adf" is replaced with ".asf") - * - only Amiga state is restored, harddisk support, autoconfig, expansion boards etc.. - * are not saved/restored (and probably never will). - * - use this for saving games that can't be saved to disk - */ - - /* Usage : - * - * save: - * - * set savestate_state = STATE_DOSAVE, savestate_filename = "..." - * - * restore: - * - * set savestate_state = STATE_DORESTORE, savestate_filename = "..." - * - */ +/* + * UAE - The Un*x Amiga Emulator + * + * Save/restore emulator state + * + * (c) 1999-2001 Toni Wilen + * + * see below for ASF-structure + */ + +/* Features: + * + * - full CPU state (68000/68010/68020, no FPU) + * - full CIA-A and CIA-B state (with all internal registers) + * - saves all custom registers and audio internal state but not all registers are restored yet. + * - only Chip-ram and Bogo-ram are saved and restored. + * - disk drive type, imagefile, track and motor state + * - Kickstart ROM version, address and size is saved. This data is not used during restore yet. + */ + +/* Notes: + * + * - blitter state is not saved, blitter is forced to finish immediately if it + * was active + * - disk DMA state is completely saved (I hope so..) + * - does not ask for statefile name and description. Currently uses DF0's disk + * image name (".adf" is replaced with ".asf") + * - only Amiga state is restored, harddisk support, autoconfig, expansion boards etc.. + * are not saved/restored (and probably never will). + * - use this for saving games that can't be saved to disk + */ + +/* Usage : + * + * save: + * + * set savestate_state = STATE_DOSAVE, savestate_filename = "..." + * + * restore: + * + * set savestate_state = STATE_DORESTORE, savestate_filename = "..." + * + */ #include "uae.h" #include "sysconfig.h" @@ -49,7 +49,7 @@ #include "config.h" #include "gui.h" #include "options.h" -#include "memory.h" +#include "memory-uae.h" #include "custom.h" #include "sound.h" #include "audio.h" @@ -63,17 +63,8 @@ int savestate_state; -static char savestate_filename_default[]={ - '/', 't', 'm', 'p', '/', 'n', 'u', 'l', 'l', '.', 'a', 's', 'f', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', +static char savestate_filename_default[255]={ + '/', 't', 'm', 'p', '/', 'n', 'u', 'l', 'l', '.', 'a', 's', 'f', '\0' }; char *savestate_filename=(char *)&savestate_filename_default[0]; FILE *savestate_file=NULL; @@ -81,7 +72,7 @@ FILE *savestate_file=NULL; /* functions for reading/writing bytes, shorts and longs in big-endian * format independent of host machine's endianess */ -void save_u32_func (uae_u8 **dstp, uae_u32 v) +void save_u32_func (uae_u8 **dstp, uintptr_t v) { uae_u8 *dst = *dstp; *dst++ = (uae_u8)(v >> 24); @@ -103,7 +94,7 @@ void save_u8_func (uae_u8 **dstp, uae_u8 v) *dst++ = v; *dstp = dst; } -void save_string_func (uae_u8 **dstp, char *from) +void save_string_func (uae_u8 **dstp, const char *from) { uae_u8 *dst = *dstp; while(*from) @@ -138,7 +129,7 @@ uae_u8 restore_u8_func (uae_u8 **dstp) } char *restore_string_func (uae_u8 **dstp) { - int len; + uintptr_t len; uae_u8 v; uae_u8 *dst = *dstp; char *top, *to; @@ -149,7 +140,7 @@ char *restore_string_func (uae_u8 **dstp) *top++ = v; } while(v); *dstp = dst; - return to; + return to; } /* read and write IFF-style hunks */ @@ -166,7 +157,7 @@ static void save_chunk (FILE *f, uae_u8 *chunk, long len, const char *name) fwrite (name, 1, 4, f); /* chunk size */ dst = &tmp[0]; - save_u32 (len + 4 + 4 + 4); + save_u32 ((uae_u32)len + 4 + 4 + 4); fwrite (&tmp[0], 1, 4, f); /* chunk flags */ dst = &tmp[0]; @@ -180,14 +171,14 @@ static void save_chunk (FILE *f, uae_u8 *chunk, long len, const char *name) fwrite (zero, 1, len, f); } -static void save_chunk_compressed (FILE *f, uae_u8 *chunk, long len, char *name) +static void save_chunk_compressed (FILE *f, uae_u8 *chunk, long len, const char *name) { - void *tmp=malloc(len); - long outSize=len; - compress2((Bytef *)tmp, (uLongf *)&outSize, (const Bytef *)chunk, (uLong)len, Z_COMPRESSION_LEVEL); - save_chunk(f,(uae_u8*)tmp,outSize,name); - free(tmp); + void *tmp=malloc(len); + long outSize=len; + compress2((Bytef *)tmp, (uLongf *)&outSize, (const Bytef *)chunk, (uLong)len, Z_COMPRESSION_LEVEL); + save_chunk(f,(uae_u8*)tmp,outSize,name); + free(tmp); } static uae_u8 *restore_chunk (FILE *f, char *name, long *len, long *filepos) @@ -294,24 +285,24 @@ void restore_state (char *filename) i++; } if (!strcmp (name, "CRAM")) { - restore_cram (len, filepos); + restore_cram ((int) len, filepos); continue; } else if (!strcmp (name, "BRAM")) { - restore_bram (len, filepos); + restore_bram ((int) len, filepos); continue; } else if (!strcmp (name, "FRAM")) { - restore_fram (len, filepos); + restore_fram ((int) len, filepos); continue; } else if (!strcmp (name, "ZRAM")) { +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) restore_zram (len, filepos); +#endif continue; } if (!strcmp (name, "CPU ")) - { end = restore_cpu (chunk); - } else if (!strcmp (name, "AGAC")) end = restore_custom_agacolors (chunk); else if (!strcmp (name, "SPR0")) @@ -369,9 +360,6 @@ void restore_state (char *filename) #ifdef DEBUG_SAVESTATE puts("-->OK");fflush(stdout); printf("RESTORED state=%X, flags=%X, PC=%X\n",savestate_state,_68k_spcflags,_68k_getpc());fflush(stdout); -#endif -#ifdef AUTO_SAVESTATE - DEBUG_AHORA=1; #endif return; @@ -395,9 +383,6 @@ void savestate_restore_finish (void) printf("-->savestate_restore_finish state=%X, flags=%X, PC=%X\n",savestate_state,_68k_spcflags,_68k_getpc());fflush(stdout); #endif fclose (savestate_file); -#ifdef DINGOO - sync(); -#endif resume_sound(); update_audio(); savestate_file = 0; @@ -409,10 +394,10 @@ void savestate_restore_finish (void) /* Save all subsystems */ -void save_state (char *filename, char *description) +void save_state (char *filename, const char *description) { - uae_u8 header[1000]; - char tmp[100]; + uae_u8 header[256]; + char tmp[32]; uae_u8 *dst; FILE *f; int len,i; @@ -432,7 +417,7 @@ void save_state (char *filename, char *description) dst = header; save_u32 (0); save_string("UAE"); - sprintf (tmp, "%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); + snprintf (tmp, 32, "%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); save_string (tmp); save_string (description); save_chunk (f, header, dst-header, "ASF "); @@ -516,14 +501,19 @@ void save_state (char *filename, char *description) #endif dst = save_expansion (&len); save_chunk (f, dst, len, "EXPA"); + free (dst); dst = save_cram (&len); save_chunk_compressed (f, dst, len, "CRAM"); dst = save_bram (&len); save_chunk (f, dst, len, "BRAM"); dst = save_fram (&len); save_chunk (f, dst, len, "FRAM"); +#if !( defined(PANDORA) || defined(ANDROIDSDL) || defined(IPHONE) ) dst = save_zram (&len); save_chunk (f, dst, len, "ZRAM"); +#else + save_chunk (f, 0, 0, "ZRAM"); +#endif gui_show_window_bar(8, 10, 0); #ifdef DEBUG_SAVESTATE @@ -531,6 +521,7 @@ void save_state (char *filename, char *description) #endif dst = save_rom (1, &len); do { + if (!dst) break; save_chunk (f, dst, len, "ROM "); @@ -545,269 +536,190 @@ void save_state (char *filename, char *description) fwrite ("\0\0\0\08", 1, 4, f); write_log ("Save of '%s' complete\n", filename); fclose (f); -#ifdef DINGOO - sync(); -#endif + gui_show_window_bar(10, 10, 0); notice_screen_contents_lost(); #ifdef DEBUG_SAVESTATE printf("SAVED state=%X, flags=%X, PC=%X\n",savestate_state,_68k_spcflags,_68k_getpc());fflush(stdout); #endif -#ifdef START_DEBUG_SAVESTATE - DEBUG_AHORA=1; -#endif } /* - -My (Toni Wilen ) -proposal for Amiga-emulators' state-save format - -Feel free to comment... - -This is very similar to IFF-fileformat -Every hunk must end to 4 byte boundary, -fill with zero bytes if needed - -version 0.7 - -HUNK HEADER (beginning of every hunk) - - hunk name (4 ascii-characters) - hunk size (including header) - hunk flags - - bit 0 = chunk contents are compressed with zlib (maybe RAM chunks only?) - -HEADER - - "ASF " (AmigaStateFile) - + My (Toni Wilen ) + proposal for Amiga-emulators' state-save format + Feel free to comment... + This is very similar to IFF-fileformat + Every hunk must end to 4 byte boundary, + fill with zero bytes if needed + version 0.7 + HUNK HEADER (beginning of every hunk) + hunk name (4 ascii-characters) + hunk size (including header) + hunk flags + bit 0 = chunk contents are compressed with zlib (maybe RAM chunks only?) + HEADER + "ASF " (AmigaStateFile) + statefile version - emulator name ("uae", "fellow" etc..) - emulator version string (example: "0.8.15") - free user writable comment string - -CPU - - "CPU " - - CPU model 4 (68000,68010 etc..) - CPU typeflags bit 0=EC-model or not - D0-D7 8*4=32 - A0-A6 7*4=32 - PC 4 - prefetch address 4 - prefetch data 4 - USP 4 - ISP 4 - SR/CCR 2 - flags 4 (bit 0=CPU was HALTed) - - CPU specific registers - - 68000: SR/CCR is last saved register - 68010: save also DFC,SFC and VBR - 68020: all 68010 registers and CAAR,CACR and MSP - etc.. - - DFC 4 (010+) - SFC 4 (010+) - VBR 4 (010+) - - CAAR 4 (020-030) - CACR 4 (020+) - MSP 4 (020+) - -MMU (when and if MMU is supported in future..) - - MMU model 4 (68851,68030,68040) - - // 68040 fields - - ITT0 4 - ITT1 4 - DTT0 4 - DTT1 4 - URP 4 - SRP 4 - MMUSR 4 - TC 2 - - -FPU (only if used) - + emulator name ("uae", "fellow" etc..) + emulator version string (example: "0.8.15") + free user writable comment string + CPU + "CPU " + CPU model 4 (68000,68010 etc..) + CPU typeflags bit 0=EC-model or not + D0-D7 8*4=32 + A0-A6 7*4=32 + PC 4 + prefetch address 4 + prefetch data 4 + USP 4 + ISP 4 + SR/CCR 2 + flags 4 (bit 0=CPU was HALTed) + CPU specific registers + 68000: SR/CCR is last saved register + 68010: save also DFC,SFC and VBR + 68020: all 68010 registers and CAAR,CACR and MSP + etc.. + DFC 4 (010+) + SFC 4 (010+) + VBR 4 (010+) + CAAR 4 (020-030) + CACR 4 (020+) + MSP 4 (020+) + MMU (when and if MMU is supported in future..) + MMU model 4 (68851,68030,68040) + // 68040 fields + ITT0 4 + ITT1 4 + DTT0 4 + DTT1 4 + URP 4 + SRP 4 + MMUSR 4 + TC 2 + + FPU (only if used) "FPU " - - FPU model 4 (68881 or 68882) - FPU typeflags 4 (keep zero) - - FP0-FP7 4+2 (80 bits) - FPCR 4 - FPSR 4 - FPIAR 4 - -CUSTOM CHIPS - - "CHIP" - - chipset flags 4 OCS=0,ECSAGNUS=1,ECSDENISE=2,AGA=4 - ECSAGNUS and ECSDENISE can be combined - - DFF000-DFF1FF 352 (0x120 - 0x17f and 0x0a0 - 0xdf excluded) - - sprite registers (0x120 - 0x17f) saved with SPRx chunks - audio registers (0x0a0 - 0xdf) saved with AUDx chunks - -AGA COLORS - - "AGAC" - - AGA color 8 banks * 32 registers * - registers LONG (XRGB) = 1024 - -SPRITE - - "SPR0" - "SPR7" - - - SPRxPT 4 - SPRxPOS 2 - SPRxCTL 2 - SPRxDATA 2 - SPRxDATB 2 - AGA sprite DATA/DATB 3 * 2 * 2 - sprite "armed" status 1 - - sprites maybe armed in non-DMA mode - use bit 0 only, other bits are reserved - - -AUDIO - "AUD0" "AUD1" "AUD2" "AUD3" - - audio state 1 - machine mode - AUDxVOL 1 + FPU model 4 (68881 or 68882) + FPU typeflags 4 (keep zero) + FP0-FP7 4+2 (80 bits) + FPCR 4 + FPSR 4 + FPIAR 4 + CUSTOM CHIPS + "CHIP" + chipset flags 4 OCS=0,ECSAGNUS=1,ECSDENISE=2,AGA=4 + ECSAGNUS and ECSDENISE can be combined + DFF000-DFF1FF 352 (0x120 - 0x17f and 0x0a0 - 0xdf excluded) + sprite registers (0x120 - 0x17f) saved with SPRx chunks + audio registers (0x0a0 - 0xdf) saved with AUDx chunks + AGA COLORS + "AGAC" + AGA color 8 banks * 32 registers * + registers LONG (XRGB) = 1024 + SPRITE + "SPR0" - "SPR7" + SPRxPT 4 + SPRxPOS 2 + SPRxCTL 2 + SPRxDATA 2 + SPRxDATB 2 + AGA sprite DATA/DATB 3 * 2 * 2 + sprite "armed" status 1 + sprites maybe armed in non-DMA mode + use bit 0 only, other bits are reserved + AUDIO + "AUD0" "AUD1" "AUD2" "AUD3" + audio state 1 + machine mode + AUDxVOL 1 irq? 1 data_written? 1 - internal AUDxLEN 2 - AUDxLEN 2 + internal AUDxLEN 2 + AUDxLEN 2 internal AUDxPER 2 AUDxPER 2 - internal AUDxLC 4 + internal AUDxLC 4 AUDxLC 4 evtime? 4 - -BLITTER - - "BLIT" - - internal blitter state - - blitter running 1 - anything else? - -CIA - - "CIAA" and "CIAB" - - BFE001-BFEF01 16*1 (CIAA) - BFD000-BFDF00 16*1 (CIAB) - - internal registers - - IRQ mask (ICR) 1 BYTE - timer latches 2 timers * 2 BYTES (LO/HI) - latched tod 3 BYTES (LO/MED/HI) - alarm 3 BYTES (LO/MED/HI) - flags 1 BYTE - bit 0=tod latched (read) - bit 1=tod stopped (write) + BLITTER + "BLIT" + internal blitter state + blitter running 1 + anything else? + CIA + "CIAA" and "CIAB" + BFE001-BFEF01 16*1 (CIAA) + BFD000-BFDF00 16*1 (CIAB) + internal registers + IRQ mask (ICR) 1 BYTE + timer latches 2 timers * 2 BYTES (LO/HI) + latched tod 3 BYTES (LO/MED/HI) + alarm 3 BYTES (LO/MED/HI) + flags 1 BYTE + bit 0=tod latched (read) + bit 1=tod stopped (write) div10 counter 1 BYTE - -FLOPPY DRIVES - - "DSK0" "DSK1" "DSK2" "DSK3" - - drive state - - drive ID-word 4 - state 1 (bit 0: motor on, bit 1: drive disabled) - rw-head track 1 - dskready 1 - id-mode 1 (ID mode bit number 0-31) - floppy information - - bits from 4 - beginning of track - CRC of disk-image 4 (used during restore to check if image - is correct) - disk-image null-terminated - file name - -INTERNAL FLOPPY CONTROLLER STATUS - - "DISK" - - current DMA word 2 - DMA word bit offset 1 - WORDSYNC found 1 (no=0,yes=1) - hpos of next bit 1 - DSKLENGTH status 0=off,1=written once,2=written twice - -RAM SPACE - - "xRAM" (CRAM = chip, BRAM = bogo, FRAM = fast, ZFRAM = Z3) - - start address 4 ("bank"=chip/slow/fast etc..) - of RAM "bank" - RAM "bank" size 4 - RAM flags 4 - RAM "bank" contents - -ROM SPACE - - "ROM " - - ROM start 4 - address - size of ROM 4 - ROM type 4 KICK=0 - ROM flags 4 - ROM version 2 - ROM revision 2 - ROM CRC 4 see below - ROM-image null terminated, see below - ID-string - ROM contents (Not mandatory, use hunk size to check if - this hunk contains ROM data or not) - - Kickstart ROM: - ID-string is "Kickstart x.x" - ROM version: version in high word and revision in low word - Kickstart ROM version and revision can be found from ROM start - + 12 (version) and +14 (revision) - - ROM version and CRC is only meant for emulator to automatically - find correct image from its ROM-directory during state restore. - - Usually saving ROM contents is not good idea. - - -END - hunk "END " ends, remember hunk size 8! - - -EMULATOR SPECIFIC HUNKS - -Read only if "emulator name" in header is same as used emulator. -Maybe useful for configuration? - -misc: - -- save only at position 0,0 before triggering VBLANK interrupt -- all data must be saved in bigendian format -- should we strip all paths from image file names? - -*/ + FLOPPY DRIVES + "DSK0" "DSK1" "DSK2" "DSK3" + drive state + drive ID-word 4 + state 1 (bit 0: motor on, bit 1: drive disabled) + rw-head track 1 + dskready 1 + id-mode 1 (ID mode bit number 0-31) + floppy information + bits from 4 + beginning of track + CRC of disk-image 4 (used during restore to check if image + is correct) + disk-image null-terminated + file name + INTERNAL FLOPPY CONTROLLER STATUS + "DISK" + current DMA word 2 + DMA word bit offset 1 + WORDSYNC found 1 (no=0,yes=1) + hpos of next bit 1 + DSKLENGTH status 0=off,1=written once,2=written twice + RAM SPACE + "xRAM" (CRAM = chip, BRAM = bogo, FRAM = fast, ZFRAM = Z3) + start address 4 ("bank"=chip/slow/fast etc..) + of RAM "bank" + RAM "bank" size 4 + RAM flags 4 + RAM "bank" contents + ROM SPACE + "ROM " + ROM start 4 + address + size of ROM 4 + ROM type 4 KICK=0 + ROM flags 4 + ROM version 2 + ROM revision 2 + ROM CRC 4 see below + ROM-image null terminated, see below + ID-string + ROM contents (Not mandatory, use hunk size to check if + this hunk contains ROM data or not) + Kickstart ROM: + ID-string is "Kickstart x.x" + ROM version: version in high word and revision in low word + Kickstart ROM version and revision can be found from ROM start + + 12 (version) and +14 (revision) + ROM version and CRC is only meant for emulator to automatically + find correct image from its ROM-directory during state restore. + Usually saving ROM contents is not good idea. + END + hunk "END " ends, remember hunk size 8! + EMULATOR SPECIFIC HUNKS + Read only if "emulator name" in header is same as used emulator. + Maybe useful for configuration? + misc: + - save only at position 0,0 before triggering VBLANK interrupt + - all data must be saved in bigendian format + - should we strip all paths from image file names? + */ diff --git a/uae4all_gp2x_0.7.2a/src/scsi-none.cpp b/uae4all_gp2x_0.7.2a/src/scsi-none.cpp new file mode 100755 index 0000000..52c6d62 --- /dev/null +++ b/uae4all_gp2x_0.7.2a/src/scsi-none.cpp @@ -0,0 +1,20 @@ +#include "sysconfig.h" +#include "sysdeps.h" + +#include "config.h" +#include "thread.h" +#include "options.h" +#include "memory-uae.h" +#include "custom.h" +#include "m68k/m68k_intrf.h" +#include "disk.h" +#include "autoconf.h" +#include "filesys.h" +#include "execlib.h" +#include "scsidev.h" + +uaecptr scsidev_startup (uaecptr resaddr) { return resaddr; } +void scsidev_install (void) {} +void scsidev_reset (void) {} +void scsidev_start_threads (void) {} + diff --git a/uae4all_gp2x_0.7.2a/src/sdlgfx.cpp b/uae4all_gp2x_0.7.2a/src/sdlgfx.cpp index 6d2c3fb..4e4c5ce 100644 --- a/uae4all_gp2x_0.7.2a/src/sdlgfx.cpp +++ b/uae4all_gp2x_0.7.2a/src/sdlgfx.cpp @@ -1,3 +1,6 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" + /* * UAE - The Un*x Amiga Emulator * @@ -1015,3 +1018,4 @@ void gui_purge_events(void) keybuf_init(); } +#pragma clang diagnostic pop diff --git a/uae4all_gp2x_0.7.2a/src/sound.cpp b/uae4all_gp2x_0.7.2a/src/sound.cpp index 0f42fe9..a80205f 100755 --- a/uae4all_gp2x_0.7.2a/src/sound.cpp +++ b/uae4all_gp2x_0.7.2a/src/sound.cpp @@ -356,7 +356,7 @@ static int open_sound (void) have_sound = 1; // sound_default_evtime(0); - scaled_sample_evtime_ok = 1; + scaled_sample_evtime = 1; sound_available = 1; write_log ("SDL sound driver found and configured for %d bits at %d Hz, buffer is %d samples\n", diff --git a/uae4all_gp2x_0.7.2a/src/sound_iphone.cpp b/uae4all_gp2x_0.7.2a/src/sound_iphone.cpp index be17380..70f3349 100644 --- a/uae4all_gp2x_0.7.2a/src/sound_iphone.cpp +++ b/uae4all_gp2x_0.7.2a/src/sound_iphone.cpp @@ -275,6 +275,18 @@ void resume_sound (void) #endif } +void set_sound_volume(float volume) +{ + if (have_sound) { + g_audioQueue->setVolume(volume); + } +} + +float get_sound_volume(void) +{ + return g_audioQueue->getVolume(); +} + void uae4all_init_sound(void) { #ifdef DEBUG_SOUND diff --git a/uae4all_gp2x_0.7.2a/src/sysconfig.h b/uae4all_gp2x_0.7.2a/src/sysconfig.h index 8b795ee..bd4c835 100644 --- a/uae4all_gp2x_0.7.2a/src/sysconfig.h +++ b/uae4all_gp2x_0.7.2a/src/sysconfig.h @@ -426,9 +426,9 @@ #define USE_FAME_CORE #if TARGET_CPU_ARM -#define USE_CYCLONE_CORE +//#define USE_CYCLONE_CORE //#define USE_FAME_CORE_ARM2 -//#define USE_FAME_CORE_C +#define USE_FAME_CORE_C #else #define USE_FAME_CORE_C #endif diff --git a/uae4all_gp2x_0.7.2a/src/uae.cpp b/uae4all_gp2x_0.7.2a/src/uae.cpp index 62ed977..285a913 100644 --- a/uae4all_gp2x_0.7.2a/src/uae.cpp +++ b/uae4all_gp2x_0.7.2a/src/uae.cpp @@ -6,6 +6,7 @@ * Copyright 1995 Ed Hanway * Copyright 1995, 1996, 1997 Bernd Schmidt */ + #include "sysconfig.h" #include "sysdeps.h" #include @@ -24,7 +25,6 @@ #include "m68k/m68k_intrf.h" #include "disk.h" #include "xwin.h" -#include "joystick.h" #include "keybuf.h" #include "gui.h" #include "zfile.h" @@ -50,7 +50,7 @@ int cloanto_rom = 0; struct gui_info gui_data; -extern int timeslice_mode; +//extern int timeslice_mode; void uae::default_prefs () { #ifdef NO_SOUND @@ -70,12 +70,18 @@ void uae::default_prefs () { #if defined(DREAMCAST) strcpy (romfile, ROM_PATH_PREFIX "kick.rom"); #elif defined(IPHONE) + + strcpy(romfile, get_rom_path()); + strcpy(romkeyfile, get_key_path()); #else strcpy (romfile, "kick.rom"); #endif - - prefs_chipmem_size=0x00100000; + + prefs_chipmem_size = get_chipmem_size(); + prefs_fastmem_size = get_fastmem_size(); + + //prefs_chipmem_size=0x00200000; //prefs_chipmem_size=0x00080000; // 512kb // emu bias -> system clock | sync threshold @@ -92,12 +98,12 @@ void uae::default_prefs () { // 1 = 75% // 2 = 50% // 3 = 25% - timeslice_mode = 1; + //timeslice_mode = 0; // 0 = 100% // 2 = 83% // 4 = 75% - m68k_speed = 2; + m68k_speed = 0; } void uae::uae_reset (void) { @@ -126,8 +132,9 @@ void uae::uae_resume(void) { void uae::reset_all_systems (void) { init_eventtab (); - memory_reset (); + filesys_reset(); + filesys_start_threads(); } /* Okay, this stuff looks strange, but it is here to encourage people who @@ -148,7 +155,6 @@ void uae::do_start_program (void) { void uae::do_leave_program (void) { graphics_leave (); - close_joystick (); close_sound (); dump_counts (); zfile_exit (); @@ -183,12 +189,13 @@ void uae::real_main () { } rtarea_init (); - + + hardfile_install(); + if (! setup_sound ()) { write_log ("Sound driver unavailable: Sound output disabled\n"); produce_sound = 0; } - init_joystick (); int err = gui_init (); if (err == -1) { @@ -205,13 +212,19 @@ void uae::real_main () { rtarea_setup (); keybuf_init (); /* Must come after init_joystick */ + +#ifdef USE_AUTOCONFIG + expansion_init (); +#endif memory_init (); + + filesys_install(); custom_init (); /* Must come after memory_init */ DISK_init (); - init_m68k(); + m68k_init(0); gui_update (); if (graphics_init ()) { @@ -219,3 +232,8 @@ void uae::real_main () { } leave_program (); } + +void uae::set_joystickactive(void) +{ + set_joystickactive(); +} diff --git a/uae4all_gp2x_0.7.2a/src/zfile.cpp b/uae4all_gp2x_0.7.2a/src/zfile.cpp index 85397df..676e2d4 100644 --- a/uae4all_gp2x_0.7.2a/src/zfile.cpp +++ b/uae4all_gp2x_0.7.2a/src/zfile.cpp @@ -133,7 +133,7 @@ static void eliminate_file(char *filename) #define VRAM_MAX_LEN (384*1024) #define MAX_DISK_LEN 1024*(1024-128) -#define MAX_ROM_LEN (MAX_DISK_LEN-VRAM_MAX_LEN) +#define MAX_ROM_LEN 11 + (MAX_DISK_LEN-VRAM_MAX_LEN) static void *uae4all_rom_memory=NULL; static unsigned uae4all_rom_len=0; static unsigned uae4all_rom_pos=0; @@ -277,6 +277,7 @@ static void uae4all_disk_real_write(int num) fwrite((void *)&sizecompressed,1,4,f); fwrite(bc,1,sizecompressed,f); fclose(f); + } } } @@ -383,7 +384,7 @@ size_t uae4all_fread( void *ptr, size_t tam, size_t nmiemb, FILE *flujo) return 0; if (uae4all_disk_pos[i]>=uae4all_disk_len[i]) return 0; - memcpy(ptr,(void *)(((unsigned)uae4all_disk_memory[i])+((unsigned)uae4all_disk_pos[i])),tam*nmiemb); + memcpy(ptr,(void *)(((uintptr_t)uae4all_disk_memory[i])+((uintptr_t)uae4all_disk_pos[i])),tam*nmiemb); uae4all_disk_pos[i]+=tam*nmiemb; return nmiemb; } @@ -398,7 +399,15 @@ size_t uae4all_fwrite( void *ptr, size_t tam, size_t nmiemb, FILE *flujo) return 0; if (uae4all_disk_pos[i]>=uae4all_disk_len[i]) return 0; - memcpy((void *)(((unsigned)uae4all_disk_memory[i])+((unsigned)uae4all_disk_pos[i])),ptr,tam*nmiemb); + memcpy( + (void *) ( + ((uintptr_t) uae4all_disk_memory[i]) + + + ((uintptr_t)uae4all_disk_pos[i]) + ), + ptr, + tam*nmiemb + ); uae4all_disk_pos[i]+=tam*nmiemb; uae4all_disk_writed[i]=1; return nmiemb; @@ -490,9 +499,11 @@ size_t uae4all_rom_fread(void *ptr, size_t tam, size_t nmiemb, FILE *flujo) return 0; if (uae4all_rom_pos>=uae4all_rom_len) return 0; - memcpy(ptr,(void *)(((unsigned)uae4all_rom_memory)+((unsigned)uae4all_rom_pos)),tam*nmiemb); + + memcpy(ptr,(void *)(((uintptr_t)uae4all_rom_memory)+((uintptr_t)uae4all_rom_pos)),tam*nmiemb); uae4all_rom_pos+=tam*nmiemb; - return nmiemb; + return (uae4all_rom_len == 262155 || uae4all_rom_len == 524299) /* cloanto */ ? uae4all_rom_len - 11 : uae4all_rom_len; + }