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

« back to all changes in this revision

Viewing changes to src/boards/addrlatch.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:
85
85
        AddExState(&latche, 2, 0, "LATC");
86
86
}
87
87
 
88
 
//------------------ UNLCC21 ---------------------------
89
 
 
90
 
static void UNLCC21Sync(void) {
91
 
        setprg32(0x8000, 0);
92
 
        setchr8(latche & 1);
93
 
        setmirror(MI_0 + ((latche & 2) >> 1));
94
 
}
95
 
 
96
 
void UNLCC21_Init(CartInfo *info) {
97
 
        Latch_Init(info, UNLCC21Sync, NULL, 0x0000, 0x8000, 0xFFFF, 0);
98
 
}
99
 
 
100
88
//------------------ BMCD1038 ---------------------------
101
89
 
102
90
static void BMCD1038Sync(void) {
248
236
//------------------ Map 201 ---------------------------
249
237
 
250
238
static void M201Sync(void) {
251
 
        if(latche & 8) {
 
239
        if (latche & 8) {
252
240
                setprg32(0x8000, latche & 3);
253
241
                setchr8(latche & 3);
254
242
        } else {
303
291
}
304
292
 
305
293
static void M212Sync(void) {
306
 
        if(latche & 0x4000) {
 
294
        if (latche & 0x4000) {
307
295
                setprg32(0x8000, (latche >> 1) & 3);
308
296
        } else {
309
297
                setprg16(0x8000, latche & 7);
310
298
                setprg16(0xC000, latche & 7);
311
299
        }
312
300
        setchr8(latche & 7);
313
 
        setmirror(((latche >> 3) & 1)^1);
 
301
        setmirror(((latche >> 3) & 1) ^ 1);
314
302
}
315
303
 
316
304
void Mapper212_Init(CartInfo *info) {
385
373
                }
386
374
        }
387
375
 
388
 
        setmirror(((latche >> 1) & 1)^1);
 
376
        setmirror(((latche >> 1) & 1) ^ 1);
389
377
        setchr8(0);
390
378
        setprg8r(0x10, 0x6000, 0);
391
379
}
398
386
 
399
387
static void M229Sync(void) {
400
388
        setchr8(latche);
401
 
        if(!(latche & 0x1e))
 
389
        if (!(latche & 0x1e))
402
390
                setprg32(0x8000, 0);
403
391
        else {
404
392
                setprg16(0x8000, latche & 0x1F);
405
393
                setprg16(0xC000, latche & 0x1F);
406
394
        }
407
 
        setmirror(((latche >> 5) & 1)^1);
 
395
        setmirror(((latche >> 5) & 1) ^ 1);
408
396
}
409
397
 
410
398
void Mapper229_Init(CartInfo *info) {
415
403
 
416
404
static void M231Sync(void) {
417
405
        setchr8(0);
418
 
        if(latche & 0x20)
 
406
        if (latche & 0x20)
419
407
                setprg32(0x8000, (latche >> 1) & 0x0F);
420
408
        else {
421
409
                setprg16(0x8000, latche & 0x1E);
422
410
                setprg16(0xC000, latche & 0x1E);
423
411
        }
424
 
        setmirror(((latche >> 7) & 1)^1);
 
412
        setmirror(((latche >> 7) & 1) ^ 1);
425
413
}
426
414
 
427
415
void Mapper231_Init(CartInfo *info) {
460
448
        uint32 bank = latche >> 7;
461
449
        if (latche & 0x40)
462
450
                setprg32(0x8000, bank);
463
 
        else{
 
451
        else {
464
452
                setprg16(0x8000, (bank << 1) | ((latche >> 5) & 1));
465
453
                setprg16(0xC000, (bank << 1) | ((latche >> 5) & 1));
466
454
        }
498
486
 
499
487
static void BMCG146Sync(void) {
500
488
        setchr8(0);
501
 
        if (latche & 0x800) {           // UNROM mode
 
489
        if (latche & 0x800) {           // UNROM mode
502
490
                setprg16(0x8000, (latche & 0x1F) | (latche & ((latche & 0x40) >> 6)));
503
491
                setprg16(0xC000, (latche & 0x18) | 7);
504
492
        } else {
505
 
                if (latche & 0x40) {    // 16K mode
 
493
                if (latche & 0x40) {    // 16K mode
506
494
                        setprg16(0x8000, latche & 0x1F);
507
495
                        setprg16(0xC000, latche & 0x1F);
508
496
                } else {