void CreateCPUFolders(int parent_index) { int i,jj; int nGames = GetNumGames(); int nFolder = numFolders; LPTREEFOLDER lpFolder = treeFolders[parent_index]; LPTREEFOLDER map[CPU_COUNT]; // no games in top level folder SetAllBits(lpFolder->m_lpGameBits,FALSE); for (i=1;i<CPU_COUNT;i++) { LPTREEFOLDER lpTemp; for (jj = 1; jj < i; jj++) if (!strcmp(cputype_name(i), cputype_name(jj))) break; if (i != jj) { map[i] = map[jj]; continue; } lpTemp = NewFolder(cputype_name(i), next_folder_id++, parent_index, IDI_CPU, GetFolderFlags(numFolders)); AddFolder(lpTemp); map[i] = treeFolders[nFolder++]; } for (jj = 0; jj < nGames; jj++) { int n; struct InternalMachineDriver drv; expand_machine_driver(drivers[jj]->drv,&drv); for (n = 0; n < MAX_CPU; n++) if (drv.cpu[n].cpu_type != CPU_DUMMY) { // cpu type #'s are one-based AddGame(map[drv.cpu[n].cpu_type],jj); } } }
static void print_game_micro(FILE* out, const game_driver* game) { machine_config driver; const cpu_config* cpu; const sound_config* sound; int j; expand_machine_driver(game->drv, &driver); cpu = driver.cpu; sound = driver.sound; for(j=0;j<MAX_CPU;++j) { if (cpu[j].cpu_type!=0) { fprintf(out, "\t\t<chip"); fprintf(out, " type=\"cpu\""); fprintf(out, " name=\"%s\"", normalize_string(cputype_name(cpu[j].cpu_type))); fprintf(out, " clock=\"%d\"", cpu[j].cpu_clock); fprintf(out, "/>\n"); } } for(j=0;j<MAX_SOUND;++j) if (sound[j].sound_type) { if (sound[j].sound_type) { fprintf(out, "\t\t<chip"); fprintf(out, " type=\"audio\""); fprintf(out, " name=\"%s\"", normalize_string(sndtype_name(sound[j].sound_type))); if (sound[j].clock) fprintf(out, " clock=\"%d\"", sound[j].clock); fprintf(out, "/>\n"); } } }
int cpuintrf_init(void) { int cputype; /* verify the order of entries in the cpuintrf[] array */ for (cputype = 0; cputype < CPU_COUNT; cputype++) { /* make sure the index in the array matches the current index */ if (cpuintrf[cputype].cpu_num != cputype) { log_cb(RETRO_LOG_ERROR, LOGPRE "CPU #%d [%s] wrong ID %d: check enum CPU_... in src/cpuintrf.h!\n", cputype, cputype_name(cputype), cpuintrf[cputype].cpu_num); exit(1); } /* also reset the active CPU context info */ cpu_active_context[cputype] = -1; } /* zap the CPU data structure */ memset(cpu, 0, sizeof(cpu)); totalcpu = 0; cpu_dasm_override = NULL; /* reset the context stack */ memset(cpu_context_stack, -1, sizeof(cpu_context_stack)); cpu_context_stack_ptr = 0; /* nothing active, nothing executing */ activecpu = -1; executingcpu = -1; return 0; }