1 |
|
/* |
2 |
|
* name_registry.cpp - Name Registry handling |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2002 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2004 Christian Bauer and Marc Hellwig |
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 |
25 |
|
#include "main.h" |
26 |
|
#include "macos_util.h" |
27 |
|
#include "user_strings.h" |
28 |
+ |
#include "emul_op.h" |
29 |
+ |
#include "thunks.h" |
30 |
|
|
31 |
|
#define DEBUG 0 |
32 |
|
#include "debug.h" |
57 |
|
#include "EthernetDriverStub.i" |
58 |
|
}; |
59 |
|
|
60 |
+ |
// Helper for RegEntryID |
61 |
+ |
struct SheepRegEntryID : public SheepArray<sizeof(RegEntryID)> { |
62 |
+ |
RegEntryID *ptr() const { return (RegEntryID *)addr(); } |
63 |
+ |
}; |
64 |
+ |
|
65 |
+ |
// Helper for a <uint32, uint32> pair |
66 |
+ |
struct SheepPair : public SheepArray<8> { |
67 |
+ |
SheepPair(uint32 base, uint32 size) : SheepArray<8>() |
68 |
+ |
{ WriteMacInt32(addr(), base); WriteMacInt32(addr() + 4, size); } |
69 |
+ |
uint32 *ptr() const |
70 |
+ |
{ return (uint32 *)addr(); } |
71 |
+ |
}; |
72 |
+ |
|
73 |
|
|
74 |
|
/* |
75 |
|
* Patch Name Registry during startup |
76 |
|
*/ |
77 |
|
|
78 |
< |
static void patch_name_registry(void) |
78 |
> |
void DoPatchNameRegistry(void) |
79 |
|
{ |
80 |
< |
uint32 u32; |
80 |
> |
SheepVar32 u32; |
81 |
|
D(bug("Patching Name Registry...")); |
82 |
|
|
83 |
|
// Create "device-tree" |
84 |
< |
RegEntryID device_tree; |
85 |
< |
if (!RegistryCStrEntryCreate(NULL, "Devices:device-tree", &device_tree)) { |
86 |
< |
u32 = BusClockSpeed; |
87 |
< |
RegistryPropertyCreate(&device_tree, "clock-frequency", &u32, 4); |
88 |
< |
RegistryPropertyCreateStr(&device_tree, "model", "Power Macintosh"); |
84 |
> |
SheepRegEntryID device_tree; |
85 |
> |
if (!RegistryCStrEntryCreate(NULL, "Devices:device-tree", device_tree.ptr())) { |
86 |
> |
u32.set_value(BusClockSpeed); |
87 |
> |
RegistryPropertyCreate(device_tree.ptr(), "clock-frequency", u32.ptr(), 4); |
88 |
> |
RegistryPropertyCreateStr(device_tree.ptr(), "model", "Power Macintosh"); |
89 |
|
|
90 |
|
// Create "AAPL,ROM" |
91 |
< |
RegEntryID aapl_rom; |
92 |
< |
if (!RegistryCStrEntryCreate(&device_tree, "AAPL,ROM", &aapl_rom)) { |
93 |
< |
RegistryPropertyCreateStr(&aapl_rom, "device_type", "rom"); |
94 |
< |
uint32 reg[2] = {ROM_BASE, ROM_SIZE}; |
95 |
< |
RegistryPropertyCreate(&aapl_rom, "reg", ®, 8); |
91 |
> |
SheepRegEntryID aapl_rom; |
92 |
> |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "AAPL,ROM", aapl_rom.ptr())) { |
93 |
> |
RegistryPropertyCreateStr(aapl_rom.ptr(), "device_type", "rom"); |
94 |
> |
SheepPair reg(ROM_BASE, ROM_SIZE); |
95 |
> |
RegistryPropertyCreate(aapl_rom.ptr(), "reg", reg.ptr(), 8); |
96 |
|
} |
97 |
|
|
98 |
|
// Create "PowerPC,60x" |
99 |
< |
RegEntryID power_pc; |
99 |
> |
SheepRegEntryID power_pc; |
100 |
|
char *str; |
101 |
|
switch (PVR >> 16) { |
102 |
|
case 1: // 601 |
133 |
|
str = "PowerPC,???"; |
134 |
|
break; |
135 |
|
} |
136 |
< |
if (!RegistryCStrEntryCreate(&device_tree, str, &power_pc)) { |
137 |
< |
u32 = CPUClockSpeed; |
138 |
< |
RegistryPropertyCreate(&power_pc, "clock-frequency", &u32, 4); |
139 |
< |
RegistryPropertyCreate(&power_pc, "cpu-version", &PVR, 4); |
140 |
< |
RegistryPropertyCreateStr(&power_pc, "device_type", "cpu"); |
136 |
> |
if (!RegistryCStrEntryCreate(device_tree.ptr(), str, power_pc.ptr())) { |
137 |
> |
u32.set_value(CPUClockSpeed); |
138 |
> |
RegistryPropertyCreate(power_pc.ptr(), "clock-frequency", u32.ptr(), 4); |
139 |
> |
u32.set_value(BusClockSpeed); |
140 |
> |
RegistryPropertyCreate(power_pc.ptr(), "bus-frequency", u32.ptr(), 4); |
141 |
> |
u32.set_value(BusClockSpeed / 4); |
142 |
> |
RegistryPropertyCreate(power_pc.ptr(), "timebase-frequency", u32.ptr(), 4); |
143 |
> |
u32.set_value(PVR); |
144 |
> |
RegistryPropertyCreate(power_pc.ptr(), "cpu-version", u32.ptr(), 4); |
145 |
> |
RegistryPropertyCreateStr(power_pc.ptr(), "device_type", "cpu"); |
146 |
|
switch (PVR >> 16) { |
147 |
|
case 1: // 601 |
148 |
< |
u32 = 64; |
149 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-block-size", &u32, 4); |
150 |
< |
u32 = 128; |
151 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-sets", &u32, 4); |
152 |
< |
u32 = 0x8000; |
153 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-size", &u32, 4); |
154 |
< |
u32 = 64; |
155 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-block-size", &u32, 4); |
156 |
< |
u32 = 128; |
157 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-sets", &u32, 4); |
158 |
< |
u32 = 0x8000; |
159 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-size", &u32, 4); |
160 |
< |
u32 = 128; |
161 |
< |
RegistryPropertyCreate(&power_pc, "tlb-sets", &u32, 4); |
162 |
< |
u32 = 256; |
163 |
< |
RegistryPropertyCreate(&power_pc, "tlb-size", &u32, 4); |
148 |
> |
u32.set_value(64); |
149 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
150 |
> |
u32.set_value(128); |
151 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
152 |
> |
u32.set_value(0x8000); |
153 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
154 |
> |
u32.set_value(64); |
155 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
156 |
> |
u32.set_value(128); |
157 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
158 |
> |
u32.set_value(0x8000); |
159 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
160 |
> |
u32.set_value(128); |
161 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
162 |
> |
u32.set_value(256); |
163 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
164 |
|
break; |
165 |
|
case 3: // 603 |
166 |
< |
u32 = 32; |
167 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-block-size", &u32, 4); |
168 |
< |
u32 = 64; |
169 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-sets", &u32, 4); |
170 |
< |
u32 = 0x2000; |
171 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-size", &u32, 4); |
172 |
< |
u32 = 32; |
173 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-block-size", &u32, 4); |
174 |
< |
u32 = 64; |
175 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-sets", &u32, 4); |
176 |
< |
u32 = 0x2000; |
177 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-size", &u32, 4); |
178 |
< |
u32 = 32; |
179 |
< |
RegistryPropertyCreate(&power_pc, "tlb-sets", &u32, 4); |
180 |
< |
u32 = 64; |
181 |
< |
RegistryPropertyCreate(&power_pc, "tlb-size", &u32, 4); |
166 |
> |
u32.set_value(32); |
167 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
168 |
> |
u32.set_value(64); |
169 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
170 |
> |
u32.set_value(0x2000); |
171 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
172 |
> |
u32.set_value(32); |
173 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
174 |
> |
u32.set_value(64); |
175 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
176 |
> |
u32.set_value(0x2000); |
177 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
178 |
> |
u32.set_value(32); |
179 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
180 |
> |
u32.set_value(64); |
181 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
182 |
|
break; |
183 |
|
case 4: // 604 |
184 |
< |
u32 = 32; |
185 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-block-size", &u32, 4); |
186 |
< |
u32 = 128; |
187 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-sets", &u32, 4); |
188 |
< |
u32 = 0x4000; |
189 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-size", &u32, 4); |
190 |
< |
u32 = 32; |
191 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-block-size", &u32, 4); |
192 |
< |
u32 = 128; |
193 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-sets", &u32, 4); |
194 |
< |
u32 = 0x4000; |
195 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-size", &u32, 4); |
196 |
< |
u32 = 64; |
197 |
< |
RegistryPropertyCreate(&power_pc, "tlb-sets", &u32, 4); |
198 |
< |
u32 = 128; |
199 |
< |
RegistryPropertyCreate(&power_pc, "tlb-size", &u32, 4); |
184 |
> |
u32.set_value(32); |
185 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
186 |
> |
u32.set_value(128); |
187 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
188 |
> |
u32.set_value(0x4000); |
189 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
190 |
> |
u32.set_value(32); |
191 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
192 |
> |
u32.set_value(128); |
193 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
194 |
> |
u32.set_value(0x4000); |
195 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
196 |
> |
u32.set_value(64); |
197 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
198 |
> |
u32.set_value(128); |
199 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
200 |
|
break; |
201 |
|
case 6: // 603e |
202 |
|
case 7: // 603ev |
203 |
< |
u32 = 32; |
204 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-block-size", &u32, 4); |
205 |
< |
u32 = 128; |
206 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-sets", &u32, 4); |
207 |
< |
u32 = 0x4000; |
208 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-size", &u32, 4); |
209 |
< |
u32 = 32; |
210 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-block-size", &u32, 4); |
211 |
< |
u32 = 128; |
212 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-sets", &u32, 4); |
213 |
< |
u32 = 0x4000; |
214 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-size", &u32, 4); |
215 |
< |
u32 = 32; |
216 |
< |
RegistryPropertyCreate(&power_pc, "tlb-sets", &u32, 4); |
217 |
< |
u32 = 64; |
218 |
< |
RegistryPropertyCreate(&power_pc, "tlb-size", &u32, 4); |
203 |
> |
u32.set_value(32); |
204 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
205 |
> |
u32.set_value(128); |
206 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
207 |
> |
u32.set_value(0x4000); |
208 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
209 |
> |
u32.set_value(32); |
210 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
211 |
> |
u32.set_value(128); |
212 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
213 |
> |
u32.set_value(0x4000); |
214 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
215 |
> |
u32.set_value(32); |
216 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
217 |
> |
u32.set_value(64); |
218 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
219 |
|
break; |
220 |
|
case 8: // 750 |
221 |
< |
u32 = 32; |
222 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-block-size", &u32, 4); |
223 |
< |
u32 = 256; |
224 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-sets", &u32, 4); |
225 |
< |
u32 = 0x8000; |
226 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-size", &u32, 4); |
227 |
< |
u32 = 32; |
228 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-block-size", &u32, 4); |
229 |
< |
u32 = 256; |
230 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-sets", &u32, 4); |
231 |
< |
u32 = 0x8000; |
232 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-size", &u32, 4); |
233 |
< |
u32 = 64; |
234 |
< |
RegistryPropertyCreate(&power_pc, "tlb-sets", &u32, 4); |
235 |
< |
u32 = 128; |
236 |
< |
RegistryPropertyCreate(&power_pc, "tlb-size", &u32, 4); |
221 |
> |
u32.set_value(32); |
222 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
223 |
> |
u32.set_value(256); |
224 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
225 |
> |
u32.set_value(0x8000); |
226 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
227 |
> |
u32.set_value(32); |
228 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
229 |
> |
u32.set_value(256); |
230 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
231 |
> |
u32.set_value(0x8000); |
232 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
233 |
> |
u32.set_value(64); |
234 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
235 |
> |
u32.set_value(128); |
236 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
237 |
|
break; |
238 |
|
case 9: // 604e |
239 |
|
case 10: // 604ev5 |
240 |
< |
u32 = 32; |
241 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-block-size", &u32, 4); |
242 |
< |
u32 = 256; |
243 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-sets", &u32, 4); |
244 |
< |
u32 = 0x8000; |
245 |
< |
RegistryPropertyCreate(&power_pc, "d-cache-size", &u32, 4); |
246 |
< |
u32 = 32; |
247 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-block-size", &u32, 4); |
248 |
< |
u32 = 256; |
249 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-sets", &u32, 4); |
250 |
< |
u32 = 0x8000; |
251 |
< |
RegistryPropertyCreate(&power_pc, "i-cache-size", &u32, 4); |
252 |
< |
u32 = 64; |
253 |
< |
RegistryPropertyCreate(&power_pc, "tlb-sets", &u32, 4); |
254 |
< |
u32 = 128; |
255 |
< |
RegistryPropertyCreate(&power_pc, "tlb-size", &u32, 4); |
240 |
> |
u32.set_value(32); |
241 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
242 |
> |
u32.set_value(256); |
243 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
244 |
> |
u32.set_value(0x8000); |
245 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
246 |
> |
u32.set_value(32); |
247 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
248 |
> |
u32.set_value(256); |
249 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
250 |
> |
u32.set_value(0x8000); |
251 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
252 |
> |
u32.set_value(64); |
253 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
254 |
> |
u32.set_value(128); |
255 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
256 |
> |
break; |
257 |
> |
case 12: // 7400, 7410 |
258 |
> |
case 0x800c: |
259 |
> |
u32.set_value(32); |
260 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-block-size", u32.ptr(), 4); |
261 |
> |
u32.set_value(128); |
262 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-sets", u32.ptr(), 4); |
263 |
> |
u32.set_value(0x8000); |
264 |
> |
RegistryPropertyCreate(power_pc.ptr(), "d-cache-size", u32.ptr(), 4); |
265 |
> |
u32.set_value(32); |
266 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-block-size", u32.ptr(), 4); |
267 |
> |
u32.set_value(128); |
268 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-sets", u32.ptr(), 4); |
269 |
> |
u32.set_value(0x8000); |
270 |
> |
RegistryPropertyCreate(power_pc.ptr(), "i-cache-size", u32.ptr(), 4); |
271 |
> |
u32.set_value(64); |
272 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-sets", u32.ptr(), 4); |
273 |
> |
u32.set_value(128); |
274 |
> |
RegistryPropertyCreate(power_pc.ptr(), "tlb-size", u32.ptr(), 4); |
275 |
|
break; |
276 |
|
default: |
277 |
|
break; |
278 |
|
} |
279 |
< |
u32 = 32; |
280 |
< |
RegistryPropertyCreate(&power_pc, "reservation-granularity", &u32, 4); |
281 |
< |
uint32 reg[2] = {0, 0}; |
282 |
< |
RegistryPropertyCreate(&power_pc, "reg", ®, 8); |
279 |
> |
u32.set_value(32); |
280 |
> |
RegistryPropertyCreate(power_pc.ptr(), "reservation-granularity", u32.ptr(), 4); |
281 |
> |
SheepPair reg(0, 0); |
282 |
> |
RegistryPropertyCreate(power_pc.ptr(), "reg", reg.ptr(), 8); |
283 |
|
} |
284 |
|
|
285 |
|
// Create "memory" |
286 |
< |
RegEntryID memory; |
287 |
< |
if (!RegistryCStrEntryCreate(&device_tree, "memory", &memory)) { |
288 |
< |
uint32 reg[2] = {RAMBase, RAMSize}; |
289 |
< |
RegistryPropertyCreateStr(&memory, "device_type", "memory"); |
290 |
< |
RegistryPropertyCreate(&memory, "reg", ®, 8); |
286 |
> |
SheepRegEntryID memory; |
287 |
> |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "memory", memory.ptr())) { |
288 |
> |
SheepPair reg(RAMBase, RAMSize); |
289 |
> |
RegistryPropertyCreateStr(memory.ptr(), "device_type", "memory"); |
290 |
> |
RegistryPropertyCreate(memory.ptr(), "reg", reg.ptr(), 8); |
291 |
|
} |
292 |
|
|
293 |
|
// Create "video" |
294 |
< |
RegEntryID video; |
295 |
< |
if (!RegistryCStrEntryCreate(&device_tree, "video", &video)) { |
296 |
< |
RegistryPropertyCreateStr(&video, "AAPL,connector", "monitor"); |
297 |
< |
RegistryPropertyCreateStr(&video, "device_type", "display"); |
298 |
< |
RegistryPropertyCreate(&video, "driver,AAPL,MacOS,PowerPC", &video_driver, sizeof(video_driver)); |
299 |
< |
RegistryPropertyCreateStr(&video, "model", "SheepShaver Video"); |
294 |
> |
SheepRegEntryID video; |
295 |
> |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "video", video.ptr())) { |
296 |
> |
RegistryPropertyCreateStr(video.ptr(), "AAPL,connector", "monitor"); |
297 |
> |
RegistryPropertyCreateStr(video.ptr(), "device_type", "display"); |
298 |
> |
RegistryPropertyCreate(video.ptr(), "driver,AAPL,MacOS,PowerPC", video_driver, sizeof(video_driver)); |
299 |
> |
RegistryPropertyCreateStr(video.ptr(), "model", "SheepShaver Video"); |
300 |
|
} |
301 |
|
|
302 |
|
// Create "ethernet" |
303 |
< |
RegEntryID ethernet; |
304 |
< |
if (!RegistryCStrEntryCreate(&device_tree, "ethernet", ðernet)) { |
305 |
< |
RegistryPropertyCreateStr(ðernet, "AAPL,connector", "ethernet"); |
306 |
< |
RegistryPropertyCreateStr(ðernet, "device_type", "network"); |
307 |
< |
RegistryPropertyCreate(ðernet, "driver,AAPL,MacOS,PowerPC", ðernet_driver, sizeof(ethernet_driver)); |
303 |
> |
SheepRegEntryID ethernet; |
304 |
> |
if (!RegistryCStrEntryCreate(device_tree.ptr(), "ethernet", ethernet.ptr())) { |
305 |
> |
RegistryPropertyCreateStr(ethernet.ptr(), "AAPL,connector", "ethernet"); |
306 |
> |
RegistryPropertyCreateStr(ethernet.ptr(), "device_type", "network"); |
307 |
> |
RegistryPropertyCreate(ethernet.ptr(), "driver,AAPL,MacOS,PowerPC", ethernet_driver, sizeof(ethernet_driver)); |
308 |
|
// local-mac-address |
309 |
|
// max-frame-size 2048 |
310 |
|
} |
325 |
|
} |
326 |
|
|
327 |
|
// Main routine must be executed in PPC mode |
328 |
< |
ExecutePPC(patch_name_registry); |
328 |
> |
ExecuteNative(NATIVE_PATCH_NAME_REGISTRY); |
329 |
|
} |