void CfgTest() { #if 0 FOLDER *root; BUF *b; Debug("\nCFG Test Begin\n"); root = CfgCreateFolder(NULL, TAG_ROOT); CfgTest2(root, 5); b = CfgFolderToBufText(root); //Print("%s\n", b->Buf); SeekBuf(b, 0, 0); CfgDeleteFolder(root); DumpBuf(b, "test1.config"); root = CfgBufTextToFolder(b); FreeBuf(b); b = CfgFolderToBufText(root); // Print("%s\n", b->Buf); DumpBuf(b, "test2.config"); FreeBuf(b); CfgSave(root, "test.txt"); CfgDeleteFolder(root); Debug("\nCFG Test End\n"); #endif }
void handleCfgCmd(rfTrcvPacket_t* packet) { switch (packet->packet.data[0]) { case 1: CfgSave(); break; case 2: CfgLoad(); break; case 3: packet->packet.size = 2; packet->packet.data[1] = CfgParameterCount; break; case 4: packet->packet.size = 3; packet->packet.data[1] = cfgRam.checksum >> 8; packet->packet.data[2] = cfgRam.checksum & 0xFF; break; } }
void DoConfiguration() { std::cout << numMIDIs; LoadControls(); if(cfgFull) cfgDialog[1].flags |= D_SELECTED; if(cfgZoom) cfgDialog[2].flags |= D_SELECTED; int ret; while((ret = do_dialog(cfgDialog, -1)) != 5) { switch(ret) { case 4: //apply CfgApply(); if((screen->w != std::atoi(cfgW)) || (screen->h != std::atoi(cfgH))) { if(!set_gfx_mode(cfgFull ? GFX_AUTODETECT_FULLSCREEN : GFX_AUTODETECT_WINDOWED, std::atoi(cfgW), std::atoi(cfgH), 0, 0)) { if(alert("Keep this graphics mode?", "If not, configuration won't be saved", "", "Yes", "No", 0, 0) == 1) CfgSave(); else { strcpy(cfgW, "640"); strcpy(cfgH, "480"); set_gfx_mode(cfgFull ? GFX_AUTODETECT_FULLSCREEN : GFX_AUTODETECT_WINDOWED, std::atoi(cfgW), std::atoi(cfgH), 0, 0); } } else { strcpy(cfgW, "640"); strcpy(cfgH, "480"); set_gfx_mode(cfgFull ? GFX_AUTODETECT_FULLSCREEN : GFX_AUTODETECT_WINDOWED, std::atoi(cfgW), std::atoi(cfgH), 0, 0); } } break; case 5: //leave break; case 6: //kb CfgKb(); break; case 7: //joy CfgJoy(); break; case 16: //leave default CfgDefaults(); break; } } }