ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/C64.cpp
(Generate patch)

Comparing Frodo4/Src/C64.cpp (file contents):
Revision 1.1 by cebix, 2003-07-01T17:09:43Z vs.
Revision 1.4 by cebix, 2003-07-09T13:51:13Z

# Line 1 | Line 1
1   /*
2   *  C64.cpp - Put the pieces together
3   *
4 < *  Frodo (C) 1994-1997,2002 Christian Bauer
4 > *  Frodo (C) 1994-1997,2002-2003 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 50 | Line 50 | bool IsFrodoSC = false;
50  
51   C64::C64()
52   {
53        int i,j;
53          uint8 *p;
54  
55          // The thread is not yet running
# Line 65 | Line 64 | C64::C64()
64          TheDisplay = new C64Display(this);
65  
66          // Allocate RAM/ROM memory
67 <        RAM = new uint8[0x10000];
68 <        Basic = new uint8[0x2000];
69 <        Kernal = new uint8[0x2000];
70 <        Char = new uint8[0x1000];
71 <        Color = new uint8[0x0400];
72 <        RAM1541 = new uint8[0x0800];
73 <        ROM1541 = new uint8[0x4000];
67 >        RAM = new uint8[C64_RAM_SIZE];
68 >        Basic = new uint8[BASIC_ROM_SIZE];
69 >        Kernal = new uint8[KERNAL_ROM_SIZE];
70 >        Char = new uint8[CHAR_ROM_SIZE];
71 >        Color = new uint8[COLOR_RAM_SIZE];
72 >        RAM1541 = new uint8[DRIVE_RAM_SIZE];
73 >        ROM1541 = new uint8[DRIVE_ROM_SIZE];
74  
75          // Create the chips
76          TheCPU = new MOS6510(this, RAM, Basic, Kernal, Char, Color);
# Line 87 | Line 86 | C64::C64()
86          TheREU = TheCPU->TheREU = new REU(TheCPU);
87  
88          // Initialize RAM with powerup pattern
89 <        for (i=0, p=RAM; i<512; i++) {
90 <                for (j=0; j<64; j++)
89 >        p = RAM;
90 >        for (unsigned i=0; i<512; i++) {
91 >                for (unsigned j=0; j<64; j++)
92                          *p++ = 0;
93 <                for (j=0; j<64; j++)
93 >                for (unsigned j=0; j<64; j++)
94                          *p++ = 0xff;
95          }
96  
97          // Initialize color RAM with random values
98 <        for (i=0, p=Color; i<1024; i++)
98 >        p = Color;
99 >        for (unsigned i=0; i<COLOR_RAM_SIZE; i++)
100                  *p++ = rand() & 0x0f;
101  
102          // Clear 1541 RAM
103 <        memset(RAM1541, 0, 0x800);
103 >        memset(RAM1541, 0, DRIVE_RAM_SIZE);
104  
105          // Open joystick drivers if required
106 <        open_close_joysticks(false, false, ThePrefs.Joystick1On, ThePrefs.Joystick2On);
106 >        open_close_joysticks(0, 0, ThePrefs.Joystick1Port, ThePrefs.Joystick2Port);
107          joykey = 0xff;
108  
109   #ifdef FRODO_SC
# Line 120 | Line 121 | C64::C64()
121  
122   C64::~C64()
123   {
124 <        open_close_joysticks(ThePrefs.Joystick1On, ThePrefs.Joystick2On, false, false);
124 >        open_close_joysticks(ThePrefs.Joystick1Port, ThePrefs.Joystick2Port, 0, 0);
125  
126          delete TheJob1541;
127          delete TheREU;
# Line 178 | Line 179 | void C64::NMI(void)
179  
180   void C64::NewPrefs(Prefs *prefs)
181   {
182 <        open_close_joysticks(ThePrefs.Joystick1On, ThePrefs.Joystick2On, prefs->Joystick1On, prefs->Joystick2On);
182 >        open_close_joysticks(ThePrefs.Joystick1Port, ThePrefs.Joystick2Port, prefs->Joystick1Port, prefs->Joystick2Port);
183          PatchKernal(prefs->FastReset, prefs->Emul1541Proc);
184  
185          TheDisplay->NewPrefs(prefs);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines