37 |
|
static uint32 rcec_tvect = 0; |
38 |
|
static inline int16 RegistryCStrEntryCreate(uintptr arg1, const char *arg2, uint32 arg3) |
39 |
|
{ |
40 |
< |
return (int16)CallMacOS3(rcec_ptr, rcec_tvect, (const RegEntryID *)arg1, Host2MacAddr((uint8 *)arg2), arg3); |
40 |
> |
SheepString arg2str(arg2); |
41 |
> |
return (int16)CallMacOS3(rcec_ptr, rcec_tvect, (const RegEntryID *)arg1, arg2str.addr(), arg3); |
42 |
|
} |
43 |
|
typedef int16 (*rpc_ptr)(const RegEntryID *, const char *, const void *, uint32); |
44 |
|
static uint32 rpc_tvect = 0; |
45 |
|
static inline int16 RegistryPropertyCreate(uintptr arg1, const char *arg2, uintptr arg3, uint32 arg4) |
46 |
|
{ |
47 |
< |
return (int16)CallMacOS4(rpc_ptr, rpc_tvect, (const RegEntryID *)arg1, Host2MacAddr((uint8 *)arg2), (const void *)arg3, arg4); |
47 |
> |
SheepString arg2str(arg2); |
48 |
> |
return (int16)CallMacOS4(rpc_ptr, rpc_tvect, (const RegEntryID *)arg1, arg2str.addr(), (const void *)arg3, arg4); |
49 |
> |
} |
50 |
> |
static inline int16 RegistryPropertyCreateStr(uintptr arg1, const char *arg2, const char *arg3) |
51 |
> |
{ |
52 |
> |
SheepString arg3str(arg3); |
53 |
> |
return RegistryPropertyCreate(arg1, arg2, arg3str.addr(), strlen(arg3) + 1); |
54 |
|
} |
48 |
– |
#define RegistryPropertyCreateStr(e,n,s) RegistryPropertyCreate(e,n,Host2MacAddr((uint8 *)s),strlen(s)+1) |
55 |
|
|
56 |
|
// Video driver stub |
57 |
|
static const uint8 video_driver[] = { |
319 |
|
if (!RegistryCStrEntryCreate(device_tree.addr(), "video", video.addr())) { |
320 |
|
RegistryPropertyCreateStr(video.addr(), "AAPL,connector", "monitor"); |
321 |
|
RegistryPropertyCreateStr(video.addr(), "device_type", "display"); |
322 |
< |
RegistryPropertyCreate(video.addr(), "driver,AAPL,MacOS,PowerPC", Host2MacAddr((uint8 *)video_driver), sizeof(video_driver)); |
322 |
> |
SheepArray<sizeof(video_driver)> the_video_driver; |
323 |
> |
Host2Mac_memcpy(the_video_driver.addr(), video_driver, sizeof(video_driver)); |
324 |
> |
RegistryPropertyCreate(video.addr(), "driver,AAPL,MacOS,PowerPC", the_video_driver.addr(), sizeof(video_driver)); |
325 |
|
RegistryPropertyCreateStr(video.addr(), "model", "SheepShaver Video"); |
326 |
|
} |
327 |
|
|
330 |
|
if (!RegistryCStrEntryCreate(device_tree.addr(), "ethernet", ethernet.addr())) { |
331 |
|
RegistryPropertyCreateStr(ethernet.addr(), "AAPL,connector", "ethernet"); |
332 |
|
RegistryPropertyCreateStr(ethernet.addr(), "device_type", "network"); |
333 |
< |
RegistryPropertyCreate(ethernet.addr(), "driver,AAPL,MacOS,PowerPC", Host2MacAddr((uint8 *)ethernet_driver), sizeof(ethernet_driver)); |
333 |
> |
SheepArray<sizeof(ethernet_driver)> the_ethernet_driver; |
334 |
> |
Host2Mac_memcpy(the_ethernet_driver.addr(), ethernet_driver, sizeof(ethernet_driver)); |
335 |
> |
RegistryPropertyCreate(ethernet.addr(), "driver,AAPL,MacOS,PowerPC", the_ethernet_driver.addr(), sizeof(ethernet_driver)); |
336 |
|
// local-mac-address |
337 |
|
// max-frame-size 2048 |
338 |
|
} |