~ubuntu-branches/ubuntu/vivid/fceux/vivid

« back to all changes in this revision

Viewing changes to src/boards/datalatch.cpp

  • Committer: Package Import Robot
  • Author(s): Joe Nahmias
  • Date: 2014-03-02 19:22:04 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140302192204-9f0aehi5stfnhn7d
Tags: 2.2.2+dfsg0-1
* Imported Upstream version 2.2.2
  + remove patches merged upstream; refresh remaining
  + remove windows compiled help files and non-free Visual C files
* Use C++11 standard static assertion functionality
* fix upstream installation of support files
* New patch 0004-ignore-missing-windows-help-CHM-file.patch
* update d/copyright for new, renamed, deleted files
* d/control: bump std-ver to 3.9.5, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
static DECLFW(LatchWrite) {
31
31
//      FCEU_printf("bs %04x %02x\n",A,V);
32
32
        if (bus_conflict)
33
 
                latche = V & CartBR(A);
 
33
                latche = (V == CartBR(A)) ? V : 0;
34
34
        else
35
35
                latche = V;
36
36
        WSync();
91
91
#endif
92
92
 
93
93
static void NROMPower(void) {
94
 
        setprg8r(0x10, 0x6000, 0); // Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB
 
94
        setprg8r(0x10, 0x6000, 0);      // Famili BASIC (v3.0) need it (uses only 4KB), FP-BASIC uses 8KB
95
95
        setprg16(0x8000, 0);
96
96
        setprg16(0xC000, ~0);
97
97
        setchr8(0);
127
127
                setprg16(0x8000, latche & 0x7);
128
128
                if (latche & 8) mirror_in_use = 1;
129
129
                if (mirror_in_use)
130
 
                        setmirror(((latche >> 3) & 1) ^ 1);  // Higway Star Hacked mapper
 
130
                        setmirror(((latche >> 3) & 1) ^ 1);     // Higway Star Hacked mapper
131
131
        } else
132
132
                setprg16(0x8000, latche & 0xf);
133
133
        setprg16(0xc000, ~0);
143
143
static void CNROMSync(void) {
144
144
        setchr8(latche);
145
145
        setprg32(0x8000, 0);
146
 
        setprg8r(0x10, 0x6000, 0); // Hayauchy IGO uses 2Kb or RAM
 
146
        setprg8r(0x10, 0x6000, 0);      // Hayauchy IGO uses 2Kb or RAM
147
147
}
148
148
 
149
149
void CNROM_Init(CartInfo *info) {
159
159
}
160
160
 
161
161
void ANROM_Init(CartInfo *info) {
162
 
        Latch_Init(info, ANROMSync, 0, 0x8000, 0xFFFF, 0, 0);
 
162
        Latch_Init(info, ANROMSync, 0, 0x4020, 0xFFFF, 0, 0);
163
163
}
164
164
 
165
165
//------------------ Map 8 ---------------------------
215
215
//------------------ Map 66 ---------------------------
216
216
 
217
217
static void MHROMSync(void) {
218
 
 
219
218
        setprg32(0x8000, latche >> 4);
220
219
        setchr8(latche & 0xF);
221
220
}
373
372
        setprg16(0x8000, (latche >> 4) & 7);
374
373
        setprg16(0xc000, ~0);
375
374
        setchr8(latche & 0xf);
376
 
        setmirror(MI_0 + ((latche >> 7) & 1));         /* Saint Seiya...hmm. */
 
375
        setmirror(MI_0 + ((latche >> 7) & 1));  /* Saint Seiya...hmm. */
377
376
}
378
377
 
379
378
void Mapper152_Init(CartInfo *info) {
435
434
static void M241Sync(void) {
436
435
        setchr8(0);
437
436
        setprg8r(0x10, 0x6000, 0);
438
 
        if(latche & 0x80)
439
 
                setprg32(0x8000, latche | 8);   // no 241 actually, but why not afterall?
 
437
        if (latche & 0x80)
 
438
                setprg32(0x8000, latche | 8);   // no 241 actually, but why not afterall?
440
439
        else
441
440
                setprg32(0x8000, latche);
442
441
}
455
454
static void BMCA65ASSync(void) {
456
455
        if (latche & 0x40)
457
456
                setprg32(0x8000, (latche >> 1) & 0x0F);
458
 
        else{
 
457
        else {
459
458
                setprg16(0x8000, ((latche & 0x30) >> 1) | (latche & 7));
460
459
                setprg16(0xC000, ((latche & 0x30) >> 1) | 7);
461
460
        }