--- uae/amiga/source/uaectrl.c 2018/04/24 16:38:39 1.1.1.1 +++ uae/amiga/source/uaectrl.c 2018/04/24 16:39:42 1.1.1.2 @@ -1,15 +1,15 @@ /*********************************************************** - * UAE - The U*nix Amiga Emulator * - * * - * UAE-Ctrl -- Emulator Control from Inside Emulation * + * UAE - The U*nix Amiga Emulator * + * * + * UAE-Ctrl -- Emulator Control from Inside Emulation * * (c) 1996 Tauno Taipaleenmaki * - * * - * Version 0.1 * - * * + * * + * Version 0.1 * + * * * Command line version, Should work with any KS version * - * * + * * ***********************************************************/ -#include +#include #include #include #include @@ -17,9 +17,7 @@ #include "uae-control.h" #include "uae_pragmas.h" -#define MAX_DRV_NAME 20 - - struct Library *UaeBase; +#define MAX_DRV_NAME 20 struct UAE_CONFIG config; @@ -27,24 +25,16 @@ void print_drive_status(void); void quit_program(int error, char *text); /************************************ - * Main program * + * Main program * ************************************/ int main() { - int quit = 0,i, correct,number; - char buf[257]; - char *langs[]={ - "US\0","DE\0","SE\0","FR\0","IT\0", + int quit = 0,i, correct,number; + char buf[257]; + char *langs[]={ + "US\0","DE\0","SE\0","FR\0","IT\0", }; - UaeBase = OpenLibrary("uae.library",0); - if (!UaeBase) { - UaeBase = OpenLibrary("uae.library",0); - if (!UaeBase) { - quit_program(1, "Emulator not running or uae.library not installed.\n"); - return(1); - } - } /* Read UAE configuration */ i = GetUaeConfig( &config ); @@ -70,7 +60,7 @@ int main() } switch( i ) { case 1: - printf("\n The reset function does not work correctly yet.\n"); + HardReset(); break; case 2: DebugFunc(); @@ -82,15 +72,13 @@ int main() printf(" Enter new framerate (1-20) :"); gets( buf ); number = atoi( buf ); - if ((number > 0) && (number < 21)) { - SetFrameRate( number ); - GetUaeConfig( &config ); - } else { + if (SetFrameRate (number)) + GetUaeConfig(&config); + else printf(" Illegal value, not changed.\n"); - } break; case 5: - if (config.do_output_sound) + if (config.do_output_sound) DisableSound(); else EnableSound(); @@ -131,7 +119,7 @@ int main() print_drive_status(); printf(" Enter disk to drive (1-4): "); gets( buf ); - number = atoi( buf ); + number = atoi( buf ); if ((number >= 1) && (number <= 4)) { printf("Name of diskfile :"); gets( buf ); @@ -151,21 +139,20 @@ int main() } /****************************************** - * Prints drive status * + * Prints drive status * ******************************************/ void print_drive_status(void) -{ +{ printf(" DF0 : %s\n", config.disk_in_df0 ? config.df0_name : "EMPTY"); printf(" DF1 : %s\n", config.disk_in_df1 ? config.df1_name : "EMPTY"); printf(" DF2 : %s\n", config.disk_in_df2 ? config.df2_name : "EMPTY"); printf(" DF3 : %s\n", config.disk_in_df3 ? config.df3_name : "EMPTY"); } - - - - + + + /****************************************** - * Quits the program * + * Quits the program * ******************************************/ void quit_program(int error, char *text) { @@ -174,9 +161,4 @@ void quit_program(int error, char *text) printf(" (c)1996 Tauno Taipaleenmaki\n\n"); printf(" ERROR: %s\n", text); } - if (UaeBase) - CloseLibrary( UaeBase ); } - - -