int main() { InitCPU(); InitEmulator(); GraphicsInit(); EnableInterpreter(); Continue(); FillKeyboardBufferString("CCLR\n"); Continue(); FillKeyboardBufferString("STARTER\n"); Continue(); FillKeyboardBufferString("MOUNTA\nLDFONTS\n"); Continue(); FillKeyboardBufferString("GAME-OV\nMOUNTB\n?EGA ON\nGDE\n"); Continue(); int idx = 0; for(;;) { if (planets[idx].species == -1) return 0; printf("=== Generate planet %i x=%3i y=%3i orbit=%i species=%i ===\n", idx, planets[idx].x, planets[idx].y, planets[idx].orbit, planets[idx].species ); char str[1024]; /* sprintf(str, "CDEPTH .\n", planets[idx].seed); FillKeyboardBufferString(str); Continue(); */ sprintf(str, "%i GLOBALSEED !\n", planets[idx].seed); FillKeyboardBufferString(str); Continue(); sprintf(str, "%i %i (SYSTEM) 1.5!\n", planets[idx].starsystemoffset&0xFFFF, planets[idx].starsystemoffset>>16 ); FillKeyboardBufferString(str); Continue(); sprintf(str, "%i %i (PLANET) 1.5!\n", planets[idx].instanceoffset&0xFFFF, planets[idx].instanceoffset>>16 ); FillKeyboardBufferString(str); Continue(); // 123 101 1 (ORBIT) 0x1dc1 0x6502 // 123 101 2 (ORBIT) 0x1dae 0x6502 // 123 101 3 (ORBIT) 0x1d9b 0x6502 // 123 101 4 (ORBIT) 0x1d88 0x6502 // 125 100 5 (ORBIT) 0x1d9b 0x6502 // 123 101 6 (ORBIT) 0x1d75 0x6502 // 123 101 7 (ORBIT) 0x1dd4 0x6502 // 123 101 8 (ORBIT) 0x1de7 0x6502 FillKeyboardBufferString("7541 25858 (ORBIT) 1.5!\n"); Continue(); sprintf(str, "(ORBIT) @>C+S %i INST-QTY !_3 ICLOSE\n", planets[idx].orbit); FillKeyboardBufferString(str); Continue(); //PrintCStack(); //exit(1); /* FillKeyboardBufferString("(ORBIT) @>C+S INST-QTY @ . ICLOSE\n"); Continue(); still needs, because it doesn't work // random generator if (ORBIT)=0 FillKeyboardBufferString("PLSET-OV (PLANET) @>C+S WEC62\n"); Continue(); */ FillKeyboardBufferString("SET-PLANET\n"); Continue(); /* GetAtmosphericActivity(); exit(1); */ //GetAtmosphere(idx); GetScienceAndSensorReading(idx); GetRegions(); /* FillKeyboardBufferString("MAPS- WF4F4\n"); Continue(); exit(1); */ /* FillKeyboardBufferString("?POPULA\n"); Continue(); */ /* FillKeyboardBufferString("POPULA\n"); Continue(); */ /* FillKeyboardBufferString("BIO\n"); Continue(); FillKeyboardBufferString("0. THIS-REGION 1.5!\n"); Continue(); FillKeyboardBufferString("POPULA\n"); Continue(); */ /* FillKeyboardBufferString("?POPULA\n"); Continue(); */ /* FillKeyboardBufferString("32 RECORD# ! 68 SAYIT\n"); Continue(); exit(1); FillKeyboardBufferString("DPART-OV WF166 OTHER-DELETE\n"); Continue(); */ /* FillKeyboardBufferString("SAVE-BUFFERS\n"); Continue(); */ /* FillKeyboardBufferString("POPULA\n"); Continue(); */ /* FillKeyboardBufferString("0 RECORD# !\n"); Continue(); FillKeyboardBufferString("OTHER-PAR\n"); // LP-OV Continue(); */ //exit(1); idx++; } return 0; }
int main() { InitCPU(); InitEmulator(); GraphicsInit(); #ifndef SDL //setvbuf(stdout, NULL, _IONBF, 0); printf("Try the following commands:\n"); printf("'2 3 + .'\n"); printf("'mountb bank-ov d@balance d.'\n"); printf("'mounta PM-OV PORT-PIC'\n"); printf("'mounta music-OV 141 cscr>ega'\n"); printf("'mounta u-b'\n"); printf("'mountb\n 1234 mercator-gen'\n"); printf("'SCI-OV 32 .READINGS'\n"); // 32 is the planet class EnableInterpreter(); //FillKeyboardBufferString("STARTER\nMOUNTA\nLDFONTS\nMOUNTB\n?EGA ON\nSET.COLORS\nLOAD-CO\nSETDBUF\n>DISPLAY\n"); FillKeyboardBufferString("STARTER\n"); Continue(); //FillKeyboardBufferString("RELAXTIME ON\n"); //Continue(); FillKeyboardBufferString("MOUNTA\nLDFONTS\n"); Continue(); //FillKeyboardBufferString("RELAXTIME OFF\n"); //Continue(); FillKeyboardBufferString("GAME-OV\nMOUNTB\n?EGA ON\nGDE\n"); Continue(); #endif // Load Compound /* FillKeyboardBufferString("130 FILE# ! 40 RECORD# !\n"); Continue(); FillKeyboardBufferString("SCI-OV WE696 @ .\n"); Continue(); */ /* FillKeyboardBufferString("SCI-OV WE696 @ .\n"); Continue(); */ /* // planet data earth FillKeyboardBufferString("32 FILE# ! 18 RECORD# !\n"); Continue(); // Load mass FillKeyboardBufferString("SCI-OV WE676 @ .\n"); Continue(); */ /* FillKeyboardBufferString("(SYSTEM) 1.5@ >C+S @INST-SPECIES\n"); Continue(); */ /* // Load one element from a starsystem FillKeyboardBufferString("4195 0 >C+S @INST-SPECIES\n"); Continue(); */ /* // default interrupt vector Write16Long(0, 0x1C*4+2, 0xF000); Write16Long(0, 0x1C*4+0, 0x1280); */ enum RETURNCODE ret; do { ret = Step(); if (ret == INPUT) { // 1. either low byte ascii, high byte 0 // 2. or low byte scancode, high byte 1 #ifdef SDL FillKeyboardBufferKey(GraphicsGetChar()); #else char input[256]; input[0] = 0; printf("input: "); fflush(stdout); int n = 0; int c; do { c = getchar(); input[n] = c; input[n+1] = 0; n++; } while(c != '\n'); input[n+1] = 0; FillKeyboardBufferString(input); #endif } } while (ret == OK || ret == INPUT); //GraphicsWait(); GraphicsQuit(); return 0; }
void InitMenu() { /* Reset variables */ TabIndex = TAB_ABOUT; Background = NULL; /* Initialize paths */ sprintf(SaveStatePath, "%ssavedata/", pl_psp_get_app_directory()); sprintf(ScreenshotPath, "%sscreenshot/", pl_psp_get_app_directory()); sprintf(GamePath, "%s", pl_psp_get_app_directory()); if (!pl_file_exists(SaveStatePath)) pl_file_mkdir_recursive(SaveStatePath); /* Initialize options */ LoadOptions(); InitEmulator(); /* Load the background image */ pl_file_path background; snprintf(background, sizeof(background) - 1, "%sbackground.png", pl_psp_get_app_directory()); Background = pspImageLoadPng(background); //Background = pspImageLoadPng("background.png"); /* Init NoSaveState icon image */ NoSaveIcon = pspImageCreate(136, 114, PSP_IMAGE_16BPP); pspImageClear(NoSaveIcon, RGB(0x0c,0,0x3f)); /* Initialize state menu */ int i; pl_menu_item *item; for (i = 0; i < 10; i++) { item = pl_menu_append_item(&SaveStateGallery.Menu, i, NULL); pl_menu_set_item_help_text(item, EmptySlotText); } /* Initialize menus */ pl_menu_create(&SystemUiMenu.Menu, SystemMenuDef); pl_menu_create(&OptionUiMenu.Menu, OptionMenuDef); pl_menu_create(&ControlUiMenu.Menu, ControlMenuDef); /* Load default configuration */ LoadButtonConfig(); /* Initialize UI components */ UiMetric.Background = Background; UiMetric.Font = &PspStockFont; UiMetric.Left = 16; UiMetric.Top = 48; UiMetric.Right = 944; UiMetric.Bottom = 500; UiMetric.OkButton = (!Options.ControlMode) ? PSP_CTRL_CROSS : PSP_CTRL_CIRCLE; UiMetric.CancelButton = (!Options.ControlMode) ? PSP_CTRL_CIRCLE : PSP_CTRL_CROSS; UiMetric.ScrollbarColor = PSP_COLOR_GRAY; UiMetric.ScrollbarBgColor = 0x44ffffff; UiMetric.ScrollbarWidth = 10; UiMetric.TextColor = PSP_COLOR_GRAY; UiMetric.SelectedColor = PSP_COLOR_YELLOW; UiMetric.SelectedBgColor = COLOR(0xff,0xff,0xff,0x44); UiMetric.StatusBarColor = PSP_COLOR_WHITE; UiMetric.BrowserFileColor = PSP_COLOR_GRAY; UiMetric.BrowserDirectoryColor = PSP_COLOR_YELLOW; UiMetric.GalleryIconsPerRow = 5; UiMetric.GalleryIconMarginWidth = 8; UiMetric.MenuItemMargin = 20; UiMetric.MenuSelOptionBg = PSP_COLOR_BLACK; UiMetric.MenuOptionBoxColor = PSP_COLOR_GRAY; UiMetric.MenuOptionBoxBg = COLOR(0, 0, 33, 0xBB); UiMetric.MenuDecorColor = PSP_COLOR_YELLOW; UiMetric.DialogFogColor = COLOR(0, 0, 0, 88); UiMetric.TitlePadding = 4; UiMetric.TitleColor = PSP_COLOR_WHITE; UiMetric.MenuFps = 30; UiMetric.TabBgColor = COLOR(0x74,0x74,0xbe,0xff); UiMetric.BrowserScreenshotPath = ScreenshotPath; UiMetric.BrowserScreenshotDelay = 30; }