Annotation of uae/main.c, revision 1.1

1.1     ! root        1:  /* 
        !             2:   * UAE - The Un*x Amiga Emulator
        !             3:   * 
        !             4:   * Main program 
        !             5:   * 
        !             6:   * (c) 1995 Bernd Schmidt, Ed Hanway
        !             7:   */
        !             8: 
        !             9: #include <assert.h>
        !            10: #include <stdio.h>
        !            11: #include <stdlib.h>
        !            12: #include <string.h>
        !            13: 
        !            14: #include "config.h"
        !            15: #include "amiga.h"
        !            16: #include "options.h"
        !            17: #include "memory.h"
        !            18: #include "custom.h"
        !            19: #include "newcpu.h"
        !            20: #include "disk.h"
        !            21: #include "debug.h"
        !            22: #include "xwin.h"
        !            23: #include "os.h"
        !            24: #include "filesys.h"
        !            25: #include "keybuf.h"
        !            26: 
        !            27: int framerate = DEFAULT_FRAMERATE;
        !            28: bool dont_want_aspect = DEFAULT_NO_ASPECT;
        !            29: bool use_fast_draw = true;
        !            30: bool use_debugger = false;
        !            31: bool use_slow_mem = false;
        !            32: bool automount_uaedev = true;
        !            33: bool produce_sound = true;
        !            34: KbdLang keyboard_lang = DEFAULT_KBD_LANG;
        !            35: 
        !            36: #ifdef __unix
        !            37: 
        !            38: static bool mount_seen = false;
        !            39: 
        !            40: static void parse_cmdline(int argc, char **argv)
        !            41: {
        !            42:     int c;
        !            43:     extern char *optarg;
        !            44: 
        !            45:     while(((c = getopt(argc, argv, "l:Df:dxasSm:M:")) != EOF)) switch(c) {
        !            46:        case 'm':
        !            47:        case 'M':
        !            48:        {
        !            49:            /* mount file system (repeatable)
        !            50:             * syntax: [-m | -M] VOLNAME:/mount_point
        !            51:             * example: -M CDROM:/cdrom -m UNIXFS:./disk
        !            52:             */
        !            53:            static char buf[256];
        !            54:            char *s2;
        !            55:            bool readonly = (c == 'M');
        !            56:            
        !            57:            if (mount_seen)
        !            58:                fprintf (stderr, "Multiple mounts not supported right now, sorry.\n");
        !            59:            else {
        !            60:                mount_seen = true;
        !            61:                strcpy(buf, optarg);
        !            62:                s2 = strchr(buf, ':');
        !            63:                if(s2) {
        !            64:                    *s2++ = '\0';
        !            65:                    add_filesys_unit(buf, s2, readonly);
        !            66:                } else {
        !            67:                    fprintf(stderr, "Usage: [-m | -M] VOLNAME:/mount_point\n");
        !            68:                }
        !            69:            }
        !            70:        }
        !            71:        break;
        !            72:        
        !            73:      case 'S':
        !            74:        produce_sound = false;
        !            75:        break;
        !            76: 
        !            77:      case 'f':
        !            78:        framerate = atoi(optarg);
        !            79:        break;
        !            80:        
        !            81:      case 'd':
        !            82:        dont_want_aspect = false;
        !            83:        break;
        !            84:        
        !            85:      case 'x':
        !            86:        use_fast_draw = false;
        !            87:        break;
        !            88: 
        !            89:      case 'D':
        !            90:        use_debugger = true;
        !            91:        break;
        !            92: 
        !            93:      case 'l':
        !            94:        if (0 == strcasecmp(optarg, "de"))
        !            95:            keyboard_lang = KBD_LANG_DE;
        !            96:        else if (0 == strcasecmp(optarg, "us"))
        !            97:            keyboard_lang = KBD_LANG_US;
        !            98:        break;
        !            99:        
        !           100:      case 'a':
        !           101:        automount_uaedev = false;
        !           102:        break;
        !           103:        
        !           104:      case 's':
        !           105:        use_slow_mem = true;
        !           106:        break;
        !           107:     }
        !           108: }
        !           109: #endif
        !           110: 
        !           111: int main(int argc, char **argv)
        !           112: {
        !           113:     parse_cmdline(argc, argv);
        !           114:     
        !           115:     if (produce_sound && !init_sound()) {      
        !           116:        fprintf(stderr, "Sound driver unavailable: Sound output disabled\n");
        !           117:        produce_sound = false;
        !           118:     }
        !           119: 
        !           120:     init_joystick();
        !           121:     keybuf_init ();    
        !           122:     graphics_init();
        !           123:     memory_init();
        !           124:     custom_init();
        !           125:     DISK_init();
        !           126:     MC68000_init();
        !           127:     MC68000_reset();
        !           128: 
        !           129:     debug();
        !           130:     
        !           131:     graphics_leave();
        !           132:     close_joystick();
        !           133: #if 0
        !           134:     extern void dump_counts();
        !           135:     dump_counts();
        !           136: #endif
        !           137:     return 0;
        !           138: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.