forked from kanjitalk755/macemu
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hook up Ethernet JS API to SheepShaver
Mostly a matter of bridging the Basilisk II ethernet APIs to SheepShaver's, similar to ether_unix.cpp. Two gotchas that were encountered: - SheepShaver's PRAM is offset by 0x1300 bytes, so toggling of the preferences to enable AppleTalk at boot time had to be adjusted. - We can end up trying to process an Ethernet packet before the driver is initialized, which leads to a segfault. Add a guard for ether_driver_opened (and in that case drop the packet on the floor). This is enough to make Marathon network play work under System 7.5.3, but it does not work under Mac OS 9. Updates mihaip/infinite-mac#34
- Loading branch information
Showing
10 changed files
with
134 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef ETHER_HELPERS_H | ||
#define ETHER_HELPERS_H | ||
|
||
/* | ||
* Check whether Ethernet address is AppleTalk or Ethernet broadcast address | ||
*/ | ||
|
||
static inline bool is_apple_talk_broadcast(uint8 *p) { | ||
return p[0] == 0x09 && p[1] == 0x00 && p[2] == 0x07 && p[3] == 0xff && | ||
p[4] == 0xff && p[5] == 0xff; | ||
} | ||
|
||
static inline bool is_ethernet_broadcast(uint8 *p) { | ||
return p[0] == 0xff && p[1] == 0xff && p[2] == 0xff && p[3] == 0xff && | ||
p[4] == 0xff && p[5] == 0xff; | ||
} | ||
|
||
static void enable_apple_talk_in_pram(uint8 *XPRAM) { | ||
// node ID hint for printer port (AppleTalk) | ||
XPRAM[0x12] = 0x01; | ||
// serial ports config bits: 4-7 A, 0-3 B | ||
// useFree 0 Use undefined | ||
// useATalk 1 AppleTalk | ||
// useAsync 2 Async | ||
// useExtClk 3 externally clocked | ||
XPRAM[0x13] = 0x20; | ||
// AppleTalk Zone name ("*") | ||
XPRAM[0xbd] = 0x01; | ||
XPRAM[0xbe] = 0x2a; | ||
// AppleTalk Network Number | ||
XPRAM[0xde] = 0xff; | ||
} | ||
|
||
#endif /* ETHER_HELPERS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../BasiliskII/src/CrossPlatform/ether_helpers.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../BasiliskII/src/Unix/JS/ether_js.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters