void fme7_sync() { int i; //special case prg page if(prg[0] & 0x40) if(prg[0] & 0x80) mem_setsram8(6,0); else mem_unsetcpu8(6); else mem_setprg8(6,prg[0] & 0x3F); //set prg pages mem_setprg8(0x8,prg[1]); mem_setprg8(0xA,prg[2]); mem_setprg8(0xC,prg[3]); mem_setprg8(0xE,-1); //set chr pages for(i=0;i<8;i++) mem_setchr1(i,chr[i]); switch(mirror) { case 0: ppu_setmirroring(MIRROR_V); break; case 1: ppu_setmirroring(MIRROR_H); break; case 2: ppu_setmirroring(MIRROR_1L); break; case 3: ppu_setmirroring(MIRROR_1H); break; } }
static void sync() { mem_setprg32(8,prg); mem_setvram8(0,0); switch(mirror) { case 0: ppu_setmirroring(MIRROR_H); break; case 1: ppu_setmirroring(MIRROR_V); break; case 2: ppu_setmirroring(MIRROR_1L); break; case 3: ppu_setmirroring(MIRROR_1H); break; } }
static void sync() { mem_setprg16(0x8,prg[0]); mem_setprg16(0xA,prg[1]); mem_setprg16(0xC,prg[2]); mem_setprg16(0xE,0xF); mem_setchr4(0,chr[0]); mem_setchr4(4,chr[1]); if(mirror) ppu_setmirroring(MIRROR_H); else ppu_setmirroring(MIRROR_V); }
static void sync() { int i; mem_setprg8(0x8,prg[0]); mem_setprg8(0xA,prg[1]); mem_setprg16(0xC,0x1F); for(i=0;i<8;i++) mem_setchr1(i,chr[i] >> map[4]); if(mirror & 1) ppu_setmirroring(MIRROR_H); else ppu_setmirroring(MIRROR_V); }
static void sync() { int i; mem_setprg8(0x8,prg[0]); mem_setprg8(0xA,prg[1]); mem_setprg8(0xC,prg[2]); mem_setprg8(0xE,-1); for(i=0;i<8;i++) mem_setchr1(i,chr[i]); if(mirror & 0x80) ppu_setmirroring(MIRROR_V); else ppu_setmirroring(MIRROR_H); }
static void sync() { int i; mem_setprg16(0x8,prg); mem_setprg16(0xC,0xFF); for(i=0;i<4;i++) mem_setchr2(i * 2,chr[i]); switch(mirror & 3) { case 0: ppu_setmirroring(MIRROR_V); break; case 1: ppu_setmirroring(MIRROR_H); break; case 2: ppu_setmirroring(MIRROR_1L); break; case 3: ppu_setmirroring(MIRROR_1H); break; } }
static void sync() { mem_setprg16(0x8,reg[1]); mem_setprg16(0xC,0xFF); mem_setvram8(0,0); ppu_setmirroring((reg[0] & 0x10) ? MIRROR_1H : MIRROR_1L); }
void mmc4_sync() { mem_setsram8(0x6,0); mem_setprg16(0x8,PRGBank); mem_setprg16(0xC,0xF); mem_setchr4(0,LatchA[LatchAState]); mem_setchr4(4,LatchB[LatchBState]); ppu_setmirroring(Mirroring); }
static void sync() { int i; for(i=0;i<4;i++) mem_setprg8(8 + (i * 2),prg[i]); for(i=0;i<8;i++) mem_setchr1(i,chr[i]); ppu_setmirroring(mirror); }
void mmc2_sync() { mem_setprg8(0x8,PRGBank); mem_setprg8(0xA,0xD); mem_setprg8(0xC,0xE); mem_setprg8(0xE,0xF); mem_setchr4(0,LatchA[LatchAState]); mem_setchr4(4,LatchB[LatchBState]); ppu_setmirroring(Mirroring); }
static void syncnt() { if((bankmode & 0x20) && (revision == MAPPER90B)) { int i; for(i=0;i<4;i++) { if(bankmode & 0x40) { } else { mem_setchr1(0x8 + i,nt[i] & 1); mem_setchr1(0xC + i,nt[i] & 1); } } } else { switch(mirror & 3) { case 0: ppu_setmirroring(MIRROR_V); break; case 1: ppu_setmirroring(MIRROR_H); break; case 2: ppu_setmirroring(MIRROR_1L); break; case 3: ppu_setmirroring(MIRROR_1H); break; } } }
static void sync() { int i; mem_setprg16(0x8,prg[0]); mem_setprg8(0xC,prg[1]); mem_setprg8(0xE,0xFF); for(i=0; i<8; i++) mem_setchr1(i,chr[i]); switch(mirror & 0xC) { case 0x0: ppu_setmirroring(MIRROR_V); break; case 0x4: ppu_setmirroring(MIRROR_H); break; case 0x8: ppu_setmirroring(MIRROR_1L); break; case 0xC: ppu_setmirroring(MIRROR_1H); break; } }
static void sync() { int i; mmc3_syncprg(0xFF,0); for(i=0;i<8;i++) { if(i == 0) mem_setchr4(0,mmc3_getchrbank(i) >> 1); if(i == 4) mem_setchr2(4,mmc3_getchrbank(i)); if(i == 5) mem_setchr2(6,mmc3_getchrbank(i)); } if(nes->rom->mirroring & 8) ppu_setmirroring(MIRROR_4); else mmc3_syncmirror(); mmc3_syncsram(); }
//try to load a rom into the nes int nes_load(rom_t *r) { //init the nes nes_init(); //if this is a unif rom if(r->mapper == -1) { mapper_unif_t *mapper; if((mapper = mapper_init_unif(r->board)) == 0) { log_message("unif board '%s' not supported\n",r->board); return(1); } nes->mapper = (mapper_ines_t*)mapper; nes->rom = r; nes->rom->prgbankmask = rom_createmask(mapper->info.prg); nes->rom->chrbankmask = rom_createmask(mapper->info.chr); nes->rom->vrambankmask = rom_createmask(mapper->info.vram); nes->rom->srambankmask = rom_createmask(mapper->info.sram); if(mapper->info.vram) nes_setvramsize(mapper->info.vram / 8); if(mapper->info.sram) nes_setsramsize(mapper->info.sram / 4); log_message("unif mapper '%s' loaded\n",r->board); } else if(r->mapper == 20) { //disk should never be loaded if the bios is not found nes->mapper = (config.fdsbios ? &mapper_hle_fds : &mapper_fds); printf("%s mapper loaded\n",config.fdsbios ? "hle fds" : "fds"); } else { if((nes->mapper = mapper_init_ines(r->mapper)) == 0) { log_message("ines mapper %d not supported\n",r->mapper); return(1); } log_message("ines mapper %d loaded\n",r->mapper); } nes->rom = r; ppu_setmirroring(nes->rom->mirroring); return(0); }