ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/main.cpp
(Generate patch)

Comparing BasiliskII/src/main.cpp (file contents):
Revision 1.2 by cebix, 1999-10-21T22:39:53Z vs.
Revision 1.9 by cebix, 2001-06-30T17:21:51Z

# Line 1 | Line 1
1   /*
2   *  main.cpp - Startup/shutdown code
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2001 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 41 | Line 41
41   #define DEBUG 0
42   #include "debug.h"
43  
44 + #if ENABLE_MON
45 + #include "mon.h"
46 +
47 + static uint32 mon_read_byte_b2(uint32 adr)
48 + {
49 +        return ReadMacInt8(adr);
50 + }
51 +
52 + static void mon_write_byte_b2(uint32 adr, uint32 b)
53 + {
54 +        WriteMacInt8(adr, b);
55 + }
56 + #endif
57 +
58  
59   /*
60   *  Initialize everything, returns false on error
# Line 50 | Line 64 | bool InitAll(void)
64   {
65          // Check ROM version
66          if (!CheckROM()) {
67 <                ErrorAlert(GetString(STR_UNSUPPORTED_ROM_TYPE_ERR));
67 >                ErrorAlert(STR_UNSUPPORTED_ROM_TYPE_ERR);
68                  return false;
69          }
70  
# Line 65 | Line 79 | bool InitAll(void)
79                          TwentyFourBitAddressing = true;
80                          break;
81                  case ROM_VERSION_II:
82 <                        CPUType = 2;
82 >                        CPUType = PrefsFindInt32("cpu");
83 >                        if (CPUType < 2) CPUType = 2;
84 >                        if (CPUType > 4) CPUType = 4;
85                          FPUType = PrefsFindBool("fpu") ? 1 : 0;
86 +                        if (CPUType == 4) FPUType = 1;  // 68040 always with FPU
87                          TwentyFourBitAddressing = true;
88                          break;
89                  case ROM_VERSION_32:
90 <                        CPUType = 3;
90 >                        CPUType = PrefsFindInt32("cpu");
91 >                        if (CPUType < 2) CPUType = 2;
92 >                        if (CPUType > 4) CPUType = 4;
93                          FPUType = PrefsFindBool("fpu") ? 1 : 0;
94 +                        if (CPUType == 4) FPUType = 1;  // 68040 always with FPU
95                          TwentyFourBitAddressing = false;
96                          break;
97          }
# Line 82 | Line 102 | bool InitAll(void)
102          XPRAMInit();
103  
104          // Set boot volume
105 <        int16 i16 = PrefsFindInt16("bootdrive");
105 >        int16 i16 = PrefsFindInt32("bootdrive");
106          XPRAM[0x78] = i16 >> 8;
107          XPRAM[0x79] = i16 & 0xff;
108 <        i16 = PrefsFindInt16("bootdriver");
108 >        i16 = PrefsFindInt32("bootdriver");
109          XPRAM[0x7a] = i16 >> 8;
110          XPRAM[0x7b] = i16 & 0xff;
111  
# Line 119 | Line 139 | bool InitAll(void)
139          if (!VideoInit(ROMVersion == ROM_VERSION_64K || ROMVersion == ROM_VERSION_PLUS || ROMVersion == ROM_VERSION_CLASSIC))
140                  return false;
141  
142 +        // Set default video mode
143 +        XPRAM[0x56] = 0x42;     // 'B'
144 +        XPRAM[0x57] = 0x32;     // '2'
145 +        XPRAM[0x58] = DepthToAppleMode(VideoMonitor.mode.depth);
146 +        XPRAM[0x59] = 0;
147 +
148   #if EMULATED_68K
149          // Init 680x0 emulation (this also activates the memory system which is needed for PatchROM())
150          if (!Init680x0())
# Line 127 | Line 153 | bool InitAll(void)
153  
154          // Install ROM patches
155          if (!PatchROM()) {
156 <                ErrorAlert(GetString(STR_UNSUPPORTED_ROM_TYPE_ERR));
156 >                ErrorAlert(STR_UNSUPPORTED_ROM_TYPE_ERR);
157                  return false;
158          }
159 +
160 + #if ENABLE_MON
161 +        // Initialize mon
162 +        mon_init();
163 +        mon_read_byte = mon_read_byte_b2;
164 +        mon_write_byte = mon_write_byte_b2;
165 + #endif
166 +
167          return true;
168   }
169  
# Line 140 | Line 174 | bool InitAll(void)
174  
175   void ExitAll(void)
176   {
177 + #if ENABLE_MON
178 +        // Deinitialize mon
179 +        mon_exit();
180 + #endif
181 +
182          // Save XPRAM
183          XPRAMExit();
184  
# Line 172 | Line 211 | void ExitAll(void)
211          DiskExit();
212          SonyExit();
213   }
214 +
215 +
216 + /*
217 + *  Display error/warning alert given the message string ID
218 + */
219 +
220 + void ErrorAlert(int string_id)
221 + {
222 +        ErrorAlert(GetString(string_id));
223 + }
224 +
225 + void WarningAlert(int string_id)
226 + {
227 +        WarningAlert(GetString(string_id));
228 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines