void psxRcntInit() { memset(psxCounters, 0, sizeof(psxCounters)); psxCounters[0].rate = 1; psxCounters[0].interrupt = 0x10; psxCounters[1].rate = 1; psxCounters[1].interrupt = 0x20; psxCounters[2].rate = 1; psxCounters[2].interrupt = 64; psxCounters[3].interrupt = 1; psxCounters[3].mode = 0x58; // The VSync counter mode psxCounters[3].target = 1; psxUpdateVSyncRate(); cnts = 4; psxRcntUpd(0); psxRcntUpd(1); psxRcntUpd(2); psxRcntUpd(3); psxRcntSet(); last = 0; }
void psxRcntInit(upse_module_instance_t *ins) { upse_psx_counter_state_t *ctrstate; ctrstate = calloc(sizeof(upse_psx_counter_state_t), 1); ctrstate->psxCounters[0].rate = 1; ctrstate->psxCounters[0].interrupt = 0x10; ctrstate->psxCounters[1].rate = 1; ctrstate->psxCounters[1].interrupt = 0x20; ctrstate->psxCounters[2].rate = 1; ctrstate->psxCounters[2].interrupt = 64; ctrstate->psxCounters[3].interrupt = 1; ctrstate->psxCounters[3].mode = 0x58; // The VSync counter mode ctrstate->psxCounters[3].target = 1; ins->ctrstate = ctrstate; psxUpdateVSyncRate(ins); psxRcntUpd(ins, 0); psxRcntUpd(ins, 1); psxRcntUpd(ins, 2); psxRcntUpd(ins, 3); psxRcntSet(ins); ctrstate->last = 0; }
int RecvPcsxInfo() { int tmp; if (NET_recvData == NULL || NET_sendData == NULL) return 0; // SysPrintf("RecvPcsxInfo\n"); NET_recvData(&Config.Xa, sizeof(Config.Xa), PSE_NET_BLOCKING); NET_recvData(&Config.Sio, sizeof(Config.Sio), PSE_NET_BLOCKING); NET_recvData(&Config.SpuIrq, sizeof(Config.SpuIrq), PSE_NET_BLOCKING); NET_recvData(&Config.RCntFix, sizeof(Config.RCntFix), PSE_NET_BLOCKING); NET_recvData(&Config.PsxType, sizeof(Config.PsxType), PSE_NET_BLOCKING); psxUpdateVSyncRate(); SysUpdate(); tmp = Config.Cpu; NET_recvData(&Config.Cpu, sizeof(Config.Cpu), PSE_NET_BLOCKING); if (tmp != Config.Cpu) { psxCpu->Shutdown(); #ifdef PSXREC if (Config.Cpu) psxCpu = &psxInt; else psxCpu = &psxRec; #else psxCpu = &psxInt; #endif if (psxCpu->Init() == -1) { SysClose(); return -1; } psxCpu->Reset(); } // SysPrintf("Recv OK\n"); return 0; }
int CheckCdrom() { struct iso_directory_record *dir; unsigned char time[4],*buf; unsigned char mdir[4096]; char exename[256]; int i, c; time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10); READTRACK(); strncpy(CdromLabel, buf+52, 11); // skip head and sub, and go to the root directory record dir = (struct iso_directory_record*) &buf[12+156]; mmssdd(dir->extent, (char*)time); READDIR(mdir); if (GetCdromFile(mdir, time, "SYSTEM.CNF;1") != -1) { READTRACK(); sscanf((char*)buf+12, "BOOT = cdrom:\\%s", exename); if (GetCdromFile(mdir, time, exename) == -1) { sscanf((char*)buf+12, "BOOT = cdrom:%s", exename); if (GetCdromFile(mdir, time, exename) == -1) { char *ptr = strstr(buf+12, "cdrom:"); for (i=0; i<32; i++) { if (ptr[i] == ' ') continue; if (ptr[i] == '\\') continue; } strcpy(exename, ptr); if (GetCdromFile(mdir, time, exename) == -1) return 0; } } } i = strlen(exename); if (i >= 2) { if (exename[i - 2] == ';') i-= 2; c = 8; i--; while (i >= 0 && c >= 0) { if (isalnum(exename[i])) CdromId[c--] = exename[i]; i--; } } if (Config.PsxAuto) { // autodetect system (pal or ntsc) if (strstr(exename, "ES") != NULL) Config.PsxType = 1; // pal else Config.PsxType = 0; // ntsc } psxUpdateVSyncRate(); if (CdromLabel[0] == ' ') { strcpy(CdromLabel, CdromId); } SysPrintf("*PCSX*: CdromLabel: %s\n", CdromLabel); SysPrintf("*PCSX*: CdromId: %s\n", CdromId); AgemoTrace("Loading cdrom label %s", CdromLabel); AgemoTrace("Loading cdrom id %s", CdromId); return 0; }
int CheckCdrom() { struct iso_directory_record *dir; unsigned char time[4],*buf; unsigned char mdir[4096]; char exename[256]; int i, c; time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10); READTRACK(); CdromLabel[32]=0; CdromId[9]=0; strncpy(CdromLabel, (char*)buf+52, 32); // skip head and sub, and go to the root directory record dir = (struct iso_directory_record*) &buf[12+156]; mmssdd(dir->extent, (char*)time); READDIR(mdir); if (GetCdromFile(mdir, time, "SYSTEM.CNF;1") != -1) { READTRACK(); sscanf((char*)buf+12, "BOOT = cdrom:\\%s", exename); if (GetCdromFile(mdir, time, exename) == -1) { sscanf((char*)buf+12, "BOOT = cdrom:%s", exename); if (GetCdromFile(mdir, time, exename) == -1) { char *ptr = strstr((char*)buf+12, "cdrom:"); for (i=0; i<32; i++) { if (ptr[i] == ' ') continue; if (ptr[i] == '\\') continue; } strcpy(exename, ptr); if (GetCdromFile(mdir, time, exename) == -1) return 0; } } } i = strlen(exename); if (i >= 2) { if (exename[i - 2] == ';') i-= 2; c = 8; i--; while (i >= 0 && c >= 0) { if (isalnum(exename[i])) CdromId[c--] = exename[i]; i--; } } if (Config.PsxAuto) { // autodetect system (pal or ntsc) if (strstr(exename, "ES") != NULL) Config.PsxType = 1; // pal else Config.PsxType = 0; // ntsc } psxUpdateVSyncRate(); //zeromus 21-oct-2009 - why would you want this to be the label? it is not unique. //if it is not going to be the rom filename then it should be the id which is unique //if (CdromLabel[0] == ' ') { strncpy(CdromLabel, CdromId, 9); //} SysPrintf("CD-ROM Label: %.32s\n", CdromLabel); SysPrintf("CD-ROM ID: %.9s\n", CdromId); return 0; }