~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/vic20/vic20rom.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "vice.h"
30
30
 
31
31
#include <stdio.h>
 
32
#include <string.h>
32
33
 
33
34
#include "log.h"
34
35
#include "mem.h"
37
38
#include "types.h"
38
39
#include "util.h"
39
40
#include "vic20mem.h"
 
41
#include "vic20memrom.h"
40
42
#include "vic20rom.h"
41
43
 
42
44
 
53
55
 
54
56
    /* Check Kernal ROM.  */
55
57
    for (i = 0, sum = 0; i < VIC20_KERNAL_ROM_SIZE; i++)
56
 
        sum += mem_kernal_rom[i];
 
58
        sum += vic20memrom_kernal_rom[i];
57
59
 
58
60
    if (sum != VIC20_KERNAL_CHECKSUM) {
59
61
        log_error(vic20rom_log,
74
76
    resources_get_value("VirtualDevices", (void *)&trapfl);
75
77
    resources_set_value("VirtualDevices", (resource_value_t)1);
76
78
 
77
 
    if (!util_check_null_string(rom_name)) {
78
 
        /* Load Kernal ROM. */
79
 
        if (sysfile_load(rom_name,
80
 
            mem_kernal_rom, VIC20_KERNAL_ROM_SIZE,
81
 
            VIC20_KERNAL_ROM_SIZE) < 0) {
82
 
            log_error(vic20rom_log, "Couldn't load kernal ROM.");
83
 
            resources_set_value("VirtualDevices", (resource_value_t) trapfl);
84
 
            return -1;
85
 
        }
 
79
    /* Load Kernal ROM. */
 
80
    if (sysfile_load(rom_name,
 
81
        vic20memrom_kernal_rom, VIC20_KERNAL_ROM_SIZE,
 
82
        VIC20_KERNAL_ROM_SIZE) < 0) {
 
83
        log_error(vic20rom_log, "Couldn't load kernal ROM.");
 
84
        resources_set_value("VirtualDevices", (resource_value_t) trapfl);
 
85
        return -1;
86
86
    }
 
87
    memcpy(vic20memrom_kernal_trap_rom, vic20memrom_kernal_rom,
 
88
           VIC20_KERNAL_ROM_SIZE);
87
89
 
88
90
    vic20rom_kernal_checksum();
89
91
 
90
 
    resources_set_value("VirtualDevices", (resource_value_t) trapfl);
 
92
    resources_set_value("VirtualDevices", (resource_value_t)trapfl);
91
93
 
92
94
    return 0;
93
95
}
99
101
 
100
102
    /* Check Basic ROM. */
101
103
    for (i = 0, sum = 0; i < VIC20_BASIC_ROM_SIZE; i++)
102
 
        sum += mem_basic_rom[i];
 
104
        sum += vic20memrom_basic_rom[i];
103
105
 
104
106
    if (sum != VIC20_BASIC_CHECKSUM)
105
107
        log_error(vic20rom_log,
116
118
    if (!util_check_null_string(rom_name)) {
117
119
        /* Load Basic ROM. */
118
120
        if (sysfile_load(rom_name,
119
 
            mem_basic_rom, VIC20_BASIC_ROM_SIZE,
 
121
            vic20memrom_basic_rom, VIC20_BASIC_ROM_SIZE,
120
122
            VIC20_BASIC_ROM_SIZE) < 0) {
121
123
            log_error(vic20rom_log, "Couldn't load basic ROM.");
122
124
            return -1;
133
135
    if (!util_check_null_string(rom_name)) {
134
136
        /* Load chargen ROM. */
135
137
        if (sysfile_load(rom_name,
136
 
            mem_chargen_rom + 0x400, VIC20_CHARGEN_ROM_SIZE,
 
138
            vic20memrom_chargen_rom + 0x400, VIC20_CHARGEN_ROM_SIZE,
137
139
            VIC20_CHARGEN_ROM_SIZE) < 0) {
138
140
            log_error(vic20rom_log, "Couldn't load character ROM.");
139
141
            return -1;