//--------------------------------------------------------------------------- //- BiGFooT's 65EL02 Emulator V0.12 ---------------------------- 2012.08.17 - //--------------------------------------------------------------------------- #include #include #include #include //--------------------------------------------------------------------------- #include "video/gbuffer.h" #include "drive/drive.h" #include "calc.h" //--------------------------------------------------------------------------- #include "emuversion.h" #include "emubase.h" #include "memory/memory.h" #include "cpu/65el02.h" #include "monitor.h" #include "SDL/SDL.h" //--------------------------------------------------------------------------- int main(int argc, char **argv) { char tempstring[512]; double tempdouble; int qi, tempint; *defdiskname = 0; // stdout is redirected to a text file... // printf("%s\n%s\n\n",emuversion,eloraam); for (qi = 1; qi < argc; qi++) { if (*argv[qi] == '-') { if (strcmp(argv[qi], "-s") == 0) { emulation_run = 0; } if (strcmp(argv[qi], "-nospbug") == 0) { nospbug = 1; } if (strncmp(argv[qi], "-pc=", 4) == 0) { calc(&argv[qi][4], &tempdouble); start_pc = (int) tempdouble; printf("PC at reset: %04X\n", start_pc); } if (strncmp(argv[qi], "-b=", 3) == 0) { if (!calc(&argv[qi][3], &tempdouble)) { init_breakpoint = (int) tempdouble; } else { init_breakpoint = getaddress(&argv[qi][3]); } // printf("Breakpoint: %04X\n", init_breakpoint); } if (strncmp(argv[qi], "-m=", 3) == 0) { calc(&argv[qi][3], &tempdouble); tempint = (int) tempdouble; if ((tempint<1) || (tempint>8)) { printf("Invalid memory banks %d. Must be between 1 and 8.\n",tempint); exit(0); } else { printf("Memory: %dkb\n", tempint << 3); memory_max = tempint << 13; } } if (strncmp(argv[qi], "-l=", 3) == 0) { monitor_listing(&argv[qi][3]); } } else { if (!*defdiskname) { strncpy(defdiskname, argv[qi], sizeof(defdiskname)); defdisktype = 0; } } } if (!*defdiskname) { strcpy(defdiskname, "roms/redforth.img"); defdisktype = 1; } SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO); SDL_EnableUNICODE(1); SDL_EnableKeyRepeat(250, 25); if (startptc(emuversion)) { emulation(); endptc(); } else { printf("Video initialization failed.\n"); } SDL_Quit(); return (0); }