Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BasiliskII/src/SDL/audio_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static bool open_sdl_audio(void)
audio_channel_counts.push_back(2);

// Default to highest supported values
audio_sample_rate_index = audio_sample_rates.size() - 1;
audio_sample_rate_index = 1; // audio_sample_rates.size() - 1;
audio_sample_size_index = audio_sample_sizes.size() - 1;
audio_channel_count_index = audio_channel_counts.size() - 1;
}
Expand Down Expand Up @@ -135,7 +135,7 @@ static bool open_audio(void)
void AudioInit(void)
{
// Init audio status and feature flags
AudioStatus.sample_rate = 44100 << 16;
AudioStatus.sample_rate = 22050 << 16;
AudioStatus.sample_size = 16;
AudioStatus.channels = 2;
AudioStatus.mixer = 0;
Expand Down
13 changes: 9 additions & 4 deletions BasiliskII/src/SDL/video_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,10 @@ static int sdl_depth_of_video_depth(int video_depth)
// Get screen dimensions
static void sdl_display_dimensions(int &width, int &height)
{
static int max_width, max_height;
static int max_width = 0;
static int max_height = 0;
if (max_width == 0 && max_height == 0) {
max_width = 640 ; max_height = 480;
max_width = 800 ; max_height = 600;
SDL_Rect **modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE);
if (modes && modes != (SDL_Rect **)-1) {
// It turns out that on some implementations, and contrary to the documentation,
Expand Down Expand Up @@ -1018,8 +1019,12 @@ bool VideoInit(bool classic)
else if (default_height > sdl_display_height())
default_height = sdl_display_height();

// Mac screen depth follows X depth
screen_depth = SDL_GetVideoInfo()->vfmt->BitsPerPixel;
uint32 user_bpp = PrefsFindInt32("bpp");
if(user_bpp == 8 || user_bpp == 16 || user_bpp == 24 || user_bpp == 32)
screen_depth = user_bpp;
else
screen_depth = 16;

int default_depth;
switch (screen_depth) {
case 8:
Expand Down
6 changes: 4 additions & 2 deletions BasiliskII/src/Unix/ether_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ bool ether_init(void)
}
#endif
else {
net_if_type = NET_IF_SHEEPNET;
printf("selected Ethernet device type sheep_net\n");
net_if_type = NET_IF_VDE;
printf("selected Ethernet device type vde\n");
}

// Don't raise SIGPIPE, let errno be set to EPIPE
Expand Down Expand Up @@ -349,6 +349,7 @@ bool ether_init(void)
/* for select/poll when this fd receive data, there are
* packets to recv(call vde_recv) */
fd = vde_datafd(vde_conn);
printf("vde socket connected");
}
}
#endif
Expand Down Expand Up @@ -831,6 +832,7 @@ static int16 ether_do_write(uint32 arg)

do {
len = vde_send(vde_conn, packet, sizeof(packet), 0);
printf("sent: %l\n", len);
} while (len < 0);

return noErr;
Expand Down
5 changes: 2 additions & 3 deletions BasiliskII/src/include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ extern void kprintf(const char *, ...);

#else

// Other systems just print it to stdout
#include <stdio.h>
#define bug printf
#include <syslog.h>
#define bug(...) syslog(1,__VA_ARGS__)

#endif

Expand Down
1 change: 1 addition & 0 deletions BasiliskII/src/prefs_items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ prefs_desc common_prefs_items[] = {
{"scsi5", TYPE_STRING, false, "SCSI target for Mac SCSI ID 5"},
{"scsi6", TYPE_STRING, false, "SCSI target for Mac SCSI ID 6"},
{"screen", TYPE_STRING, false, "video mode"},
{"bpp", TYPE_INT32, false, "bpp"},
{"seriala", TYPE_STRING, false, "device name of Mac serial port A"},
{"serialb", TYPE_STRING, false, "device name of Mac serial port B"},
{"ether", TYPE_STRING, false, "device name of Mac ethernet adapter"},
Expand Down
64 changes: 24 additions & 40 deletions BasiliskII/src/slirp/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,23 +195,19 @@ struct ip_timestamp {

#define IP_MSS 576 /* default maximum segment size */

#ifdef HAVE_SYS_TYPES32_H /* Overcome some Solaris 2.x junk */
#include <sys/types32.h>
#else
#if SIZEOF_CHAR_P == 4
typedef caddr_t caddr32_t;
struct mbuf_ptr {
struct mbuf *mptr;
uint32_t dummy;
};
#else
typedef u_int32_t caddr32_t;
#endif
#endif

#if SIZEOF_CHAR_P == 4
typedef struct ipq *ipqp_32;
typedef struct ipasfrag *ipasfragp_32;
#else
typedef caddr32_t ipqp_32;
typedef caddr32_t ipasfragp_32;
struct mbuf_ptr {
struct mbuf *mptr;
};
#endif
struct qlink {
void *next, *prev;
};

/*
* Overlay for ip header used by other protocols (tcp, udp).
Expand All @@ -221,13 +217,13 @@ typedef caddr32_t ipasfragp_32;
#endif

struct ipovly {
caddr32_t ih_next, ih_prev; /* for protocol sequence q's */
struct mbuf_ptr ih_mbuf; /* backpointer to mbuf */
u_int8_t ih_x1; /* (unused) */
u_int8_t ih_pr; /* protocol */
u_int16_t ih_len; /* protocol length */
struct in_addr ih_src; /* source internet address */
struct in_addr ih_dst; /* destination internet address */
} PACKED__;
} __attribute__((packed));

#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(PACK_RESET)
Expand All @@ -241,12 +237,13 @@ struct ipovly {
* size 28 bytes
*/
struct ipq {
ipqp_32 next,prev; /* to other reass headers */
struct qlink frag_link; /* to ip headers of fragments */
struct qlink ip_link; /* to other reass headers */

u_int8_t ipq_ttl; /* time for reass q to live */
u_int8_t ipq_p; /* protocol of this fragment */
u_int16_t ipq_id; /* sequence id for reassembly */
ipasfragp_32 ipq_next,ipq_prev;
/* to ip headers of fragments */

struct in_addr ipq_src,ipq_dst;
};

Expand All @@ -256,29 +253,16 @@ struct ipq {
* Note: ipf_next must be at same offset as ipq_next above
*/
struct ipasfrag {
#ifdef WORDS_BIGENDIAN
u_char ip_v:4,
ip_hl:4;
#else
u_char ip_hl:4,
ip_v:4;
#endif
/* BUG : u_int changed to u_int8_t.
* sizeof(u_int)==4 on linux 2.0
*/
u_int8_t ipf_mff; /* XXX overlays ip_tos: use low bit
* to avoid destroying tos (PPPDTRuu);
* copied from (ip_off&IP_MF) */
u_int16_t ip_len;
u_int16_t ip_id;
u_int16_t ip_off;
u_int8_t ip_ttl;
u_int8_t ip_p;
u_int16_t ip_sum;
ipasfragp_32 ipf_next; /* next fragment */
ipasfragp_32 ipf_prev; /* previous fragment */
struct qlink ipf_link;
struct ip ipf_ip;
};

#define ipf_off ipf_ip.ip_off
#define ipf_tos ipf_ip.ip_tos
#define ipf_len ipf_ip.ip_len
#define ipf_next ipf_link.next
#define ipf_prev ipf_link.prev

/*
* Structure stored in mbuf in inpcb.ip_options
* and passed to ip_output when ip options are in use.
Expand Down
Loading