int LoadManager () { int loadROM = OpenROM(GCSettings.LoadMethod); if (loadROM) { // load UPS/IPS/PPF patch LoadPatch(GCSettings.LoadMethod); Memory.LoadROM ("BLANK.SMC"); Memory.LoadSRAM ("BLANK"); // load SRAM or snapshot if ( GCSettings.AutoLoad == 1 ) LoadSRAM(GCSettings.SaveMethod, SILENT); else if ( GCSettings.AutoLoad == 2 ) NGCUnfreezeGame (GCSettings.SaveMethod, SILENT); // setup cheats SetupCheats(); } return loadROM; }
void TSS1_Delta (TSS_CONTROL_ID u8ControlId) { /* Write your code here ... */ UINT8 u8Event; /* 8 bits local variable used to store the event information */ while (!TSS_KEYPAD_BUFFER_EMPTY(Delta)) /* While unread events are in the buffer */ { TSS_KEYPAD_BUFFER_READ(u8Event,Delta); /* Read the buffer and store the event in the u8Event variable */ CurrentPatch = PATCH_DELTA; LoadPatch(CurrentPatch); } return; }
bool IDADiffReader::EnumerateLines() { int line = 0; char value[1024]; while (fgets(value, ARRAYSIZE(value), m_FileHandle) != NULL) { if (strchr(value, '\r')) *strchr(value, '\r') = '\0'; if (strchr(value, '\n')) *strchr(value, '\n') = '\0'; if (!LoadPatch(value, line)) return false; line++; } return true; }
void TSS1_VolumeWheel (TSS_CONTROL_ID u8ControlId) { YellowAnimationState = ANIMATION_STATE_VALUE_CHANGING; YellowAnimationOffset = 0; YellowHoldTick = 0; GreenAnimationState = ANIMATION_STATE_VALUE_CHANGING; GreenAnimationOffset = 0; GreenHoldTick = 0; if(VolumeWheel.DynamicStatus.Direction) { if(WheelCount[CurrentPatch][CurrentWheel]<255) WheelCount[CurrentPatch][CurrentWheel]++; } else { if(WheelCount[CurrentPatch][CurrentWheel]>0) WheelCount[CurrentPatch][CurrentWheel]--; } LoadPatch(CurrentPatch); }
void PatchSelWindow::BrowsePatch (void) { Gtk::FileSelection fileSel ("thinksynth - Load Patch"); if (prevDir != "") fileSel.set_filename(prevDir); if (fileSel.run() == Gtk::RESPONSE_OK) { struct stat st; stat(fileSel.get_filename().c_str(), &st); if (!S_ISLNK(st.st_mode) && !S_ISREG(st.st_mode)) { fprintf(stderr,"error box...\n"); return; } fileEntry.set_text(fileSel.get_filename()); if (LoadPatch()) { string dn = thUtil::dirname((char*)fileSel.get_filename().c_str()); string **vals = NULL; gthPrefs *prefs = gthPrefs::instance(); prevDir = dn; vals = new string *[2]; vals[0] = new string(prevDir); vals[1] = NULL; prefs->Set("patchdir", vals); } } }
int main(void) { // copy vector table to SRAM1! #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnonnull" memcpy((char *)0x20000000, (const char)0x00000000, 0x200); #pragma GCC diagnostic pop // remap SRAM1 to 0x00000000 SYSCFG->MEMRMP |= 0x03; halInit(); chSysInit(); sdcard_init(); sysmon_init(); #if ENABLE_SERIAL_DEBUG // SD2 for serial debug output palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7) | PAL_MODE_INPUT); // RX palSetPadMode(GPIOA, 2, PAL_MODE_OUTPUT_PUSHPULL); // TX palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7)); // TX // 115200 baud static const SerialConfig sd2Cfg = {115200, 0, 0, 0}; sdStart(&SD2, &sd2Cfg); chprintf((BaseSequentialStream * )&SD2,"Hello world!\r\n"); #endif exception_init(); InitPatch0(); InitPConnection(); InitPWM(); // display SPI CS? palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL); palSetPad(GPIOC, 1); chThdSleepMilliseconds(10); palSetPadMode(SW2_PORT, SW2_PIN, PAL_MODE_INPUT_PULLDOWN); axoloti_board_init(); codec_init(); if (!palReadPad(SW2_PORT, SW2_PIN)) { // button S2 not pressed // watchdog_init(); chThdSleepMilliseconds(1); } start_dsp_thread(); adc_init(); axoloti_math_init(); midi_init(); #if ((BOARD_AXOLOTI_V03)||(BOARD_AXOLOTI_V05)) axoloti_control_init(); #endif ui_init(); StartLoadPatchTread(); #if (BOARD_AXOLOTI_V05) configSDRAM(); //memTest(); #endif #ifdef ENABLE_USB_HOST MY_USBH_Init(); #endif if (!exception_check()) { // only try booting a patch when no exception is to be reported #if ((BOARD_AXOLOTI_V03)||(BOARD_AXOLOTI_V05)) sdcard_attemptMountIfUnmounted(); if (fs_ready && !palReadPad(SW2_PORT, SW2_PIN)){ // button S2 not pressed FRESULT res; // res = f_stat("/start.bin", NULL); // if (res == FR_OK) { LoadPatch("/start.bin"); // } } #endif // if no patch booting or running yet // try loading from flash if (patchStatus) { // patch in flash sector 11 memcpy((uint8_t *)PATCHMAINLOC, (uint8_t *)PATCHFLASHLOC, PATCHFLASHSIZE); if ((*(uint32_t *)PATCHMAINLOC != 0xFFFFFFFF) && (*(uint32_t *)PATCHMAINLOC != 0)) { if (!palReadPad(SW2_PORT, SW2_PIN)) // button S2 not pressed StartPatch(); } } } while (1) { chThdSleepMilliseconds(1000); } }
void PatchSelWindow::fileEntryActivate (void) { LoadPatch (); }