~ubuntu-branches/ubuntu/quantal/vice/quantal

« back to all changes in this revision

Viewing changes to src/c64/cart/comal80.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2010-02-11 18:30:16 UTC
  • mfrom: (1.1.8 upstream) (9.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100211183016-f6n8usn3tzp0u6dp
Tags: 2.2.dfsg-1
* New upstream release, C64 DTV is included so update package description
  and add it to the menu.
* Drop patch fixing build failure with gcc-4.4 , applied upstream.
* Fix some lintian problems and clean up debian/rules .

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
void REGPARM2 comal80_io1_store(WORD addr, BYTE value)
45
45
{
46
 
    if (value >= 0x80 && value <= 0x83)
47
 
    {
 
46
    if (value >= 0x80 && value <= 0x83) {
48
47
        cartridge_romhbank_set(value & 3);
49
48
        cartridge_romlbank_set(value & 3);
50
49
    }
73
72
    BYTE chipheader[0x10];
74
73
 
75
74
    while (1) {
76
 
        if (fread(chipheader, 0x10, 1, fd) < 1)
 
75
        if (fread(chipheader, 0x10, 1, fd) < 1) {
77
76
            break;
78
 
 
79
 
        if (chipheader[0xc] != 0x80 && chipheader[0xe] != 0x40
80
 
            && chipheader[0xb] > 3)
81
 
            return -1;
82
 
 
83
 
        if (fread(&rawcart[chipheader[0xb] << 14], 0x4000, 1, fd) < 1)
84
 
            return -1;
 
77
        }
 
78
 
 
79
        if (chipheader[0xc] != 0x80 && chipheader[0xe] != 0x40 && chipheader[0xb] > 3) {
 
80
            return -1;
 
81
        }
 
82
 
 
83
        if (fread(&rawcart[chipheader[0xb] << 14], 0x4000, 1, fd) < 1) {
 
84
            return -1;
 
85
        }
85
86
    }
86
87
 
87
 
    if (c64export_add(&export_res) < 0)
 
88
    if (c64export_add(&export_res) < 0) {
88
89
        return -1;
 
90
    }
89
91
 
90
92
    return 0;
91
93
}