Merge pull request #76 from Bekenn/msvc

A bunch of changes enabling the use of Visual Studio 2015.
This commit is contained in:
asvitkine 2015-08-09 18:12:29 -04:00
commit c689f178a1
118 changed files with 4338 additions and 2067 deletions

View File

@ -108,7 +108,7 @@ static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0"
#define X86_ASSEMBLY
#define UNALIGNED_PROFITABLE
#define OPTIMIZED_FLAGS
#define ASM_SYM_FOR_FUNC(a) __asm__(a)
#define ASM_SYM(a) __asm__(a)
#define REGPARAM __attribute__((regparm(3)))
#else
@ -122,7 +122,7 @@ static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {*a = v;}
#undef X86_ASSEMBLY
#define UNALIGNED_PROFITABLE
#undef OPTIMIZED_FLAGS
#define ASM_SYM_FOR_FUNC(a)
#define ASM_SYM(a)
#define REGPARAM
#endif

View File

@ -746,7 +746,7 @@ handleExceptions(void *priv)
#ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
// Decode and skip X86 instruction
#if (defined(i386) || defined(__i386__)) || (defined(__x86_64__) || defined(_M_X64))
#if (defined(i386) || defined(__i386__) || defined(_M_IX86)) || (defined(__x86_64__) || defined(_M_X64))
#if defined(__linux__)
enum {
#if (defined(i386) || defined(__i386__))

View File

@ -162,6 +162,6 @@ extern sigsegv_address_t sigsegv_get_fault_address(sigsegv_info_t *sip);
extern sigsegv_address_t sigsegv_get_fault_instruction_address(sigsegv_info_t *sip);
// Define an address that is bound to be invalid for a program counter
const sigsegv_address_t SIGSEGV_INVALID_ADDRESS = (sigsegv_address_t)(-1UL);
const sigsegv_address_t SIGSEGV_INVALID_ADDRESS = sigsegv_address_t(-1);
#endif /* SIGSEGV_H */

View File

@ -73,13 +73,13 @@
// Prototypes
static void vosf_do_set_dirty_area(uintptr first, uintptr last);
static void vosf_set_dirty_area(int x, int y, int w, int h, int screen_width, int screen_height, int bytes_per_row);
static void vosf_set_dirty_area(int x, int y, int w, int h, unsigned screen_width, unsigned screen_height, unsigned bytes_per_row);
// Variables for Video on SEGV support
static uint8 *the_host_buffer; // Host frame buffer in VOSF mode
struct ScreenPageInfo {
int top, bottom; // Mapping between this virtual page and Mac scanlines
unsigned top, bottom; // Mapping between this virtual page and Mac scanlines
};
struct ScreenInfo {
@ -148,7 +148,7 @@ static ScreenInfo mainBuffer;
// provides a really fast strchr() implementation
//#define HAVE_FAST_STRCHR 0
static inline int find_next_page_set(int page)
static inline unsigned find_next_page_set(unsigned page)
{
#if HAVE_FAST_STRCHR
char *match = strchr(mainBuffer.dirtyPages + page, PFLAG_SET_VALUE);
@ -162,7 +162,7 @@ static inline int find_next_page_set(int page)
#endif
}
static inline int find_next_page_clear(int page)
static inline unsigned find_next_page_clear(unsigned page)
{
#if HAVE_FAST_STRCHR
char *match = strchr(mainBuffer.dirtyPages + page, PFLAG_CLEAR_VALUE);
@ -235,17 +235,16 @@ static bool video_vosf_profitable(uint32 *duration_p = NULL, uint32 *n_page_faul
const bool accel = false;
#endif
for (int i = 0; i < n_tries; i++) {
for (uint32 i = 0; i < n_tries; i++) {
uint64 start = GetTicks_usec();
for (int p = 0; p < mainBuffer.pageCount; p++) {
for (uint32 p = 0; p < mainBuffer.pageCount; p++) {
uint8 *addr = (uint8 *)(mainBuffer.memStart + (p * mainBuffer.pageSize));
if (accel)
vosf_do_set_dirty_area((uintptr)addr, (uintptr)addr + mainBuffer.pageSize - 1);
else
addr[0] = 0; // Trigger Screen_fault_handler()
}
uint64 elapsed = GetTicks_usec() - start;
duration += elapsed;
duration += uint32(GetTicks_usec() - start);
PFLAG_CLEAR_ALL;
mainBuffer.dirty = false;
@ -353,7 +352,7 @@ static void vosf_do_set_dirty_area(uintptr first, uintptr last)
{
const int first_page = (first - mainBuffer.memStart) >> mainBuffer.pageBits;
const int last_page = (last - mainBuffer.memStart) >> mainBuffer.pageBits;
uint8 *addr = (uint8 *)(first & -mainBuffer.pageSize);
uint8 *addr = (uint8 *)(first & ~(mainBuffer.pageSize - 1));
for (int i = first_page; i <= last_page; i++) {
if (PFLAG_ISCLEAR(i)) {
PFLAG_SET(i);
@ -363,7 +362,7 @@ static void vosf_do_set_dirty_area(uintptr first, uintptr last)
}
}
static void vosf_set_dirty_area(int x, int y, int w, int h, int screen_width, int screen_height, int bytes_per_row)
static void vosf_set_dirty_area(int x, int y, int w, int h, unsigned screen_width, unsigned screen_height, unsigned bytes_per_row)
{
if (x < 0) {
w -= -x;
@ -375,10 +374,10 @@ static void vosf_set_dirty_area(int x, int y, int w, int h, int screen_width, in
}
if (w <= 0 || h <= 0)
return;
if (x + w > screen_width)
w -= (x + w) - screen_width;
if (y + h > screen_height)
h -= (y + h) - screen_height;
if (unsigned(x + w) > screen_width)
w -= unsigned(x + w) - screen_width;
if (unsigned(y + h) > screen_height)
h -= unsigned(y + h) - screen_height;
LOCK_VOSF;
if (bytes_per_row >= screen_width) {
const int bytes_per_pixel = bytes_per_row / screen_width;
@ -429,7 +428,7 @@ bool Screen_fault_handler(sigsegv_info_t *sip)
LOCK_VOSF;
if (PFLAG_ISCLEAR(page)) {
PFLAG_SET(page);
vm_protect((char *)(addr & -mainBuffer.pageSize), mainBuffer.pageSize, VM_PAGE_READ | VM_PAGE_WRITE);
vm_protect((char *)(addr & ~(mainBuffer.pageSize - 1)), mainBuffer.pageSize, VM_PAGE_READ | VM_PAGE_WRITE);
}
mainBuffer.dirty = true;
UNLOCK_VOSF;
@ -483,7 +482,7 @@ static void update_display_window_vosf(VIDEO_DRV_WIN_INIT)
{
VIDEO_MODE_INIT;
int page = 0;
unsigned page = 0;
for (;;) {
const unsigned first_page = find_next_page_set(page);
if (first_page >= mainBuffer.pageCount)
@ -553,7 +552,7 @@ static void update_display_dga_vosf(VIDEO_DRV_DGA_INIT)
memcpy(the_buffer_copy, the_buffer, VIDEO_MODE_ROW_BYTES * VIDEO_MODE_Y);
VIDEO_DRV_LOCK_PIXELS;
int i1 = 0, i2 = 0;
for (int j = 0; j < VIDEO_MODE_Y; j++) {
for (uint32_t j = 0; j < VIDEO_MODE_Y; j++) {
Screen_blit(the_host_buffer + i2, the_buffer + i1, src_bytes_per_row);
i1 += src_bytes_per_row;
i2 += scr_bytes_per_row;
@ -566,15 +565,16 @@ static void update_display_dga_vosf(VIDEO_DRV_DGA_INIT)
}
// Setup partial blitter (use 64-pixel wide chunks)
const int n_pixels = 64;
const int n_chunks = VIDEO_MODE_X / n_pixels;
const int n_pixels_left = VIDEO_MODE_X - (n_chunks * n_pixels);
const int src_chunk_size = src_bytes_per_row / n_chunks;
const int dst_chunk_size = dst_bytes_per_row / n_chunks;
const int src_chunk_size_left = src_bytes_per_row - (n_chunks * src_chunk_size);
const int dst_chunk_size_left = dst_bytes_per_row - (n_chunks * dst_chunk_size);
const uint32 n_pixels = 64;
const uint32 n_chunks = VIDEO_MODE_X / n_pixels;
const uint32 n_pixels_left = VIDEO_MODE_X - (n_chunks * n_pixels);
const uint32 src_chunk_size = src_bytes_per_row / n_chunks;
const uint32 dst_chunk_size = dst_bytes_per_row / n_chunks;
const uint32 src_chunk_size_left = src_bytes_per_row - (n_chunks * src_chunk_size);
const uint32 dst_chunk_size_left = dst_bytes_per_row - (n_chunks * dst_chunk_size);
int page = 0, last_scanline = -1;
unsigned page = 0;
uint32 last_scanline = uint32(-1);
for (;;) {
const unsigned first_page = find_next_page_set(page);
if (first_page >= mainBuffer.pageCount)
@ -589,28 +589,30 @@ static void update_display_dga_vosf(VIDEO_DRV_DGA_INIT)
vm_protect((char *)mainBuffer.memStart + offset, length, VM_PAGE_READ);
// Optimized for scanlines, don't process overlapping lines again
int y1 = mainBuffer.pageInfo[first_page].top;
int y2 = mainBuffer.pageInfo[page - 1].bottom;
if (y1 <= last_scanline && ++y1 >= VIDEO_MODE_Y)
continue;
if (y2 <= last_scanline && ++y2 >= VIDEO_MODE_Y)
continue;
uint32 y1 = mainBuffer.pageInfo[first_page].top;
uint32 y2 = mainBuffer.pageInfo[page - 1].bottom;
if (last_scanline != uint32(-1)) {
if (y1 <= last_scanline && ++y1 >= VIDEO_MODE_Y)
continue;
if (y2 <= last_scanline && ++y2 >= VIDEO_MODE_Y)
continue;
}
last_scanline = y2;
// Update the_host_buffer and copy of the_buffer, one line at a time
int i1 = y1 * src_bytes_per_row;
int i2 = y1 * scr_bytes_per_row;
uint32 i1 = y1 * src_bytes_per_row;
uint32 i2 = y1 * scr_bytes_per_row;
#ifdef USE_SDL_VIDEO
int bbi = 0;
SDL_Rect bb[3] = {
{ VIDEO_MODE_X, y1, 0, 0 },
{ VIDEO_MODE_X, -1, 0, 0 },
{ VIDEO_MODE_X, -1, 0, 0 }
{ Sint16(VIDEO_MODE_X), Sint16(y1), 0, 0 },
{ Sint16(VIDEO_MODE_X), -1, 0, 0 },
{ Sint16(VIDEO_MODE_X), -1, 0, 0 }
};
#endif
VIDEO_DRV_LOCK_PIXELS;
for (int j = y1; j <= y2; j++) {
for (int i = 0; i < n_chunks; i++) {
for (uint32 j = y1; j <= y2; j++) {
for (uint32 i = 0; i < n_chunks; i++) {
if (memcmp(the_buffer_copy + i1, the_buffer + i1, src_chunk_size) != 0) {
memcpy(the_buffer_copy + i1, the_buffer + i1, src_chunk_size);
Screen_blit(the_host_buffer + i2, the_buffer + i1, src_chunk_size);

View File

@ -132,7 +132,7 @@ static int translate_map_flags(int vm_flags)
#ifdef HAVE_WIN32_VM
static inline LPVOID align_addr_segment(LPVOID addr)
{
return (LPVOID)(((vm_uintptr_t)addr) & -((vm_uintptr_t)65536));
return LPVOID(vm_uintptr_t(addr) & ~vm_uintptr_t(0xFFFF));
}
static inline DWORD align_size_segment(LPVOID addr, DWORD size)

View File

@ -94,7 +94,7 @@ const char KEYCODE_FILE_NAME[] = DATADIR "/keycodes";
// Global variables
static int32 frame_skip; // Prefs items
static uint32 frame_skip; // Prefs items
static int16 mouse_wheel_mode;
static int16 mouse_wheel_lines;
@ -475,7 +475,7 @@ static bool has_mode(int type, int width, int height, int depth)
// Rely on SDL capabilities
return SDL_VideoModeOK(width, height,
sdl_depth_of_video_depth(depth),
SDL_HWSURFACE | (type == DISPLAY_SCREEN ? SDL_FULLSCREEN : 0));
SDL_HWSURFACE | (type == DISPLAY_SCREEN ? SDL_FULLSCREEN : 0)) != 0;
}
// Add mode to list of supported modes
@ -1840,21 +1840,22 @@ static void handle_events(void)
static void update_display_static(driver_base *drv)
{
// Incremental update code
int wide = 0, high = 0, x1, x2, y1, y2, i, j;
int wide = 0, high = 0;
uint32 x1, x2, y1, y2;
const VIDEO_MODE &mode = drv->mode;
int bytes_per_row = VIDEO_MODE_ROW_BYTES;
uint8 *p, *p2;
// Check for first line from top and first line from bottom that have changed
y1 = 0;
for (j=0; j<VIDEO_MODE_Y; j++) {
for (uint32 j = 0; j < VIDEO_MODE_Y; j++) {
if (memcmp(&the_buffer[j * bytes_per_row], &the_buffer_copy[j * bytes_per_row], bytes_per_row)) {
y1 = j;
break;
}
}
y2 = y1 - 1;
for (j=VIDEO_MODE_Y-1; j>=y1; j--) {
for (uint32 j = VIDEO_MODE_Y; j-- > y1; ) {
if (memcmp(&the_buffer[j * bytes_per_row], &the_buffer_copy[j * bytes_per_row], bytes_per_row)) {
y2 = j;
break;
@ -1864,16 +1865,16 @@ static void update_display_static(driver_base *drv)
// Check for first column from left and first column from right that have changed
if (high) {
if ((int)VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) {
if (VIDEO_MODE_DEPTH < VIDEO_DEPTH_8BIT) {
const int src_bytes_per_row = bytes_per_row;
const int dst_bytes_per_row = drv->s->pitch;
const int pixels_per_byte = VIDEO_MODE_X / src_bytes_per_row;
x1 = VIDEO_MODE_X / pixels_per_byte;
for (j = y1; j <= y2; j++) {
for (uint32 j = y1; j <= y2; j++) {
p = &the_buffer[j * bytes_per_row];
p2 = &the_buffer_copy[j * bytes_per_row];
for (i = 0; i < x1; i++) {
for (uint32 i = 0; i < x1; i++) {
if (*p != *p2) {
x1 = i;
break;
@ -1882,12 +1883,12 @@ static void update_display_static(driver_base *drv)
}
}
x2 = x1;
for (j = y1; j <= y2; j++) {
for (uint32 j = y1; j <= y2; j++) {
p = &the_buffer[j * bytes_per_row];
p2 = &the_buffer_copy[j * bytes_per_row];
p += bytes_per_row;
p2 += bytes_per_row;
for (i = (VIDEO_MODE_X / pixels_per_byte); i > x2; i--) {
for (uint32 i = (VIDEO_MODE_X / pixels_per_byte); i > x2; i--) {
p--; p2--;
if (*p != *p2) {
x2 = i;
@ -1909,7 +1910,7 @@ static void update_display_static(driver_base *drv)
// Blit to screen surface
int si = y1 * src_bytes_per_row + (x1 / pixels_per_byte);
int di = y1 * dst_bytes_per_row + x1;
for (j = y1; j <= y2; j++) {
for (uint32 j = y1; j <= y2; j++) {
memcpy(the_buffer_copy + si, the_buffer + si, wide / pixels_per_byte);
Screen_blit((uint8 *)drv->s->pixels + di, the_buffer + si, wide / pixels_per_byte);
si += src_bytes_per_row;
@ -1929,10 +1930,10 @@ static void update_display_static(driver_base *drv)
const int dst_bytes_per_row = drv->s->pitch;
x1 = VIDEO_MODE_X;
for (j=y1; j<=y2; j++) {
for (uint32 j = y1; j <= y2; j++) {
p = &the_buffer[j * bytes_per_row];
p2 = &the_buffer_copy[j * bytes_per_row];
for (i=0; i<x1*bytes_per_pixel; i++) {
for (uint32 i = 0; i < x1 * bytes_per_pixel; i++) {
if (*p != *p2) {
x1 = i / bytes_per_pixel;
break;
@ -1941,12 +1942,12 @@ static void update_display_static(driver_base *drv)
}
}
x2 = x1;
for (j=y1; j<=y2; j++) {
for (uint32 j = y1; j <= y2; j++) {
p = &the_buffer[j * bytes_per_row];
p2 = &the_buffer_copy[j * bytes_per_row];
p += bytes_per_row;
p2 += bytes_per_row;
for (i=VIDEO_MODE_X*bytes_per_pixel; i>x2*bytes_per_pixel; i--) {
for (uint32 i = VIDEO_MODE_X * bytes_per_pixel; i > x2 * bytes_per_pixel; i--) {
p--;
p2--;
if (*p != *p2) {
@ -1965,8 +1966,8 @@ static void update_display_static(driver_base *drv)
SDL_LockSurface(drv->s);
// Blit to screen surface
for (j=y1; j<=y2; j++) {
i = j * bytes_per_row + x1 * bytes_per_pixel;
for (uint32 j = y1; j <= y2; j++) {
uint32 i = j * bytes_per_row + x1 * bytes_per_pixel;
int dst_i = j * dst_bytes_per_row + x1 * bytes_per_pixel;
memcpy(the_buffer_copy + i, the_buffer + i, bytes_per_pixel * wide);
Screen_blit((uint8 *)drv->s->pixels + dst_i, the_buffer + i, bytes_per_pixel * wide);
@ -1990,35 +1991,34 @@ static void update_display_static_bbox(driver_base *drv)
const VIDEO_MODE &mode = drv->mode;
// Allocate bounding boxes for SDL_UpdateRects()
const int N_PIXELS = 64;
const int n_x_boxes = (VIDEO_MODE_X + N_PIXELS - 1) / N_PIXELS;
const int n_y_boxes = (VIDEO_MODE_Y + N_PIXELS - 1) / N_PIXELS;
const uint32 N_PIXELS = 64;
const uint32 n_x_boxes = (VIDEO_MODE_X + N_PIXELS - 1) / N_PIXELS;
const uint32 n_y_boxes = (VIDEO_MODE_Y + N_PIXELS - 1) / N_PIXELS;
SDL_Rect *boxes = (SDL_Rect *)alloca(sizeof(SDL_Rect) * n_x_boxes * n_y_boxes);
int nr_boxes = 0;
uint32 nr_boxes = 0;
// Lock surface, if required
if (SDL_MUSTLOCK(drv->s))
SDL_LockSurface(drv->s);
// Update the surface from Mac screen
const int bytes_per_row = VIDEO_MODE_ROW_BYTES;
const int bytes_per_pixel = bytes_per_row / VIDEO_MODE_X;
const int dst_bytes_per_row = drv->s->pitch;
int x, y;
for (y = 0; y < VIDEO_MODE_Y; y += N_PIXELS) {
int h = N_PIXELS;
const uint32 bytes_per_row = VIDEO_MODE_ROW_BYTES;
const uint32 bytes_per_pixel = bytes_per_row / VIDEO_MODE_X;
const uint32 dst_bytes_per_row = drv->s->pitch;
for (uint32 y = 0; y < VIDEO_MODE_Y; y += N_PIXELS) {
uint32 h = N_PIXELS;
if (h > VIDEO_MODE_Y - y)
h = VIDEO_MODE_Y - y;
for (x = 0; x < VIDEO_MODE_X; x += N_PIXELS) {
int w = N_PIXELS;
for (uint32 x = 0; x < VIDEO_MODE_X; x += N_PIXELS) {
uint32 w = N_PIXELS;
if (w > VIDEO_MODE_X - x)
w = VIDEO_MODE_X - x;
const int xs = w * bytes_per_pixel;
const int xb = x * bytes_per_pixel;
bool dirty = false;
for (int j = y; j < (y + h); j++) {
const int yb = j * bytes_per_row;
const int dst_yb = j * dst_bytes_per_row;
for (uint32 j = y; j < (y + h); j++) {
const uint32 yb = j * bytes_per_row;
const uint32 dst_yb = j * dst_bytes_per_row;
if (memcmp(&the_buffer[yb + xb], &the_buffer_copy[yb + xb], xs) != 0) {
memcpy(&the_buffer_copy[yb + xb], &the_buffer[yb + xb], xs);
Screen_blit((uint8 *)drv->s->pixels + dst_yb + xb, the_buffer + yb + xb, xs);
@ -2102,7 +2102,7 @@ static void video_refresh_dga_vosf(void)
possibly_quit_dga_mode();
// Update display (VOSF variant)
static int tick_counter = 0;
static uint32 tick_counter = 0;
if (++tick_counter >= frame_skip) {
tick_counter = 0;
if (mainBuffer.dirty) {
@ -2120,7 +2120,7 @@ static void video_refresh_window_vosf(void)
possibly_ungrab_mouse();
// Update display (VOSF variant)
static int tick_counter = 0;
static uint32 tick_counter = 0;
if (++tick_counter >= frame_skip) {
tick_counter = 0;
if (mainBuffer.dirty) {
@ -2138,7 +2138,7 @@ static void video_refresh_window_static(void)
possibly_ungrab_mouse();
// Update display (static variant)
static int tick_counter = 0;
static uint32 tick_counter = 0;
if (++tick_counter >= frame_skip) {
tick_counter = 0;
const VIDEO_MODE &mode = drv->mode;
@ -2214,7 +2214,7 @@ static int redraw_func(void *arg)
// Wait
next += VIDEO_REFRESH_DELAY;
int64 delay = next - GetTicks_usec();
int32 delay = int32(next - GetTicks_usec());
if (delay > 0)
Delay_usec(delay);
else if (delay < -VIDEO_REFRESH_DELAY)
@ -2247,9 +2247,9 @@ void video_set_dirty_area(int x, int y, int w, int h)
{
#ifdef ENABLE_VOSF
const VIDEO_MODE &mode = drv->mode;
const int screen_width = VIDEO_MODE_X;
const int screen_height = VIDEO_MODE_Y;
const int bytes_per_row = VIDEO_MODE_ROW_BYTES;
const unsigned screen_width = VIDEO_MODE_X;
const unsigned screen_height = VIDEO_MODE_Y;
const unsigned bytes_per_row = VIDEO_MODE_ROW_BYTES;
if (use_vosf) {
vosf_set_dirty_area(x, y, w, h, screen_width, screen_height, bytes_per_row);

View File

@ -21,7 +21,7 @@ CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CPUINCLUDES_FLAGS=@CPUINCLUDES@
CPUINCLUDES_FLAGS:=$(CPUINCLUDES_FLAGS:-I%=-I@top_srcdir@/%)
CPPFLAGS = @CPPFLAGS@ -I@top_srcdir@/../include -I@top_srcdir@/. -I. $(CPUINCLUDES_FLAGS) -I@top_srcdir@/../slirp
CPPFLAGS = @CPPFLAGS@ -I@top_srcdir@/../include -I@top_srcdir@/. -I. -I@top_srcdir@/../CrossPlatform $(CPUINCLUDES_FLAGS) -I@top_srcdir@/../slirp
DEFS = @DEFS@ @DEFINES@ -D_REENTRANT -DDATADIR=\"$(datadir)/$(APP)\"
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
@ -43,17 +43,18 @@ GUI_LIBS = @GUI_LIBS@
GUI_SRCS = ../prefs.cpp prefs_unix.cpp prefs_editor_gtk.cpp ../prefs_items.cpp \
../user_strings.cpp user_strings_unix.cpp xpram_unix.cpp sys_unix.cpp rpc_unix.cpp
XPLAT_SRCS = ../CrossPlatform/vm_alloc.cpp ../CrossPlatform/sigsegv.cpp ../CrossPlatform/video_blit.cpp
## Files
SRCS = ../main.cpp ../prefs.cpp ../prefs_items.cpp \
sys_unix.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \
../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_unix.cpp ../timer.cpp \
timer_unix.cpp ../adb.cpp ../serial.cpp ../ether.cpp \
../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../video.cpp \
video_blit.cpp \
vm_alloc.cpp sigsegv.cpp ../audio.cpp ../extfs.cpp disk_sparsebundle.cpp \
../audio.cpp ../extfs.cpp disk_sparsebundle.cpp \
tinyxml2.cpp \
../user_strings.cpp user_strings_unix.cpp sshpty.c strlcpy.c rpc_unix.cpp \
$(SYSSRCS) $(CPUSRCS) $(SLIRP_SRCS)
$(XPLAT_SRCS) $(SYSSRCS) $(CPUSRCS) $(SLIRP_SRCS)
APP_FLAVOR ?=
ifneq ($(APP_FLAVOR),)
CURR_APP_FLAVOR := -$(APP_FLAVOR)

View File

@ -493,9 +493,9 @@ static inline uae_u32 do_byteswap_16(uae_u32 v)
#define write_log printf
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY)
#define ASM_SYM_FOR_FUNC(a) __asm__(a)
#define ASM_SYM(a) __asm__(a)
#else
#define ASM_SYM_FOR_FUNC(a)
#define ASM_SYM(a)
#endif
#ifndef REGPARAM

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<ToolsDir>$(ProjectDir)Debug\</ToolsDir>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="ToolsDir">
<Value>$(ToolsDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<ToolsDir>$(ProjectDir)Release\</ToolsDir>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="ToolsDir">
<Value>$(ToolsDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<ToolsDir>$(OutDir)</ToolsDir>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="ToolsDir">
<Value>$(ToolsDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,140 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasiliskII", "BasiliskII.vcxproj", "{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}"
ProjectSection(ProjectDependencies) = postProject
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48} = {1A9EA738-8DA7-422F-9E0D-BE92893C0E48}
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04} = {95933FE9-C27C-41F0-B4AF-EAAADE94FD04}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "build68k", "build68k.vcxproj", "{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gencpu", "gencpu.vcxproj", "{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}"
ProjectSection(ProjectDependencies) = postProject
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0} = {7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gencomp", "gencomp.vcxproj", "{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}"
ProjectSection(ProjectDependencies) = postProject
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0} = {7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "..\..\..\..\SDL-1.2.15\VisualC\SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "..\..\..\..\SDL-1.2.15\VisualC\SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug JIT|x64 = Debug JIT|x64
Debug JIT|x86 = Debug JIT|x86
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release JIT|x64 = Release JIT|x64
Release JIT|x86 = Release JIT|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug JIT|x64.ActiveCfg = Debug JIT|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug JIT|x64.Build.0 = Debug JIT|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug JIT|x86.ActiveCfg = Debug JIT|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug JIT|x86.Build.0 = Debug JIT|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug|x64.ActiveCfg = Debug|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug|x64.Build.0 = Debug|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug|x86.ActiveCfg = Debug|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Debug|x86.Build.0 = Debug|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release JIT|x64.ActiveCfg = Release JIT|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release JIT|x64.Build.0 = Release JIT|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release JIT|x86.ActiveCfg = Release JIT|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release JIT|x86.Build.0 = Release JIT|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release|x64.ActiveCfg = Release|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release|x64.Build.0 = Release|x64
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release|x86.ActiveCfg = Release|Win32
{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}.Release|x86.Build.0 = Release|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug JIT|x64.ActiveCfg = Debug|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug JIT|x64.Build.0 = Debug|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug JIT|x86.ActiveCfg = Debug|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug JIT|x86.Build.0 = Debug|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug|x64.ActiveCfg = Debug|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug|x64.Build.0 = Debug|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug|x86.ActiveCfg = Debug|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Debug|x86.Build.0 = Debug|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release JIT|x64.ActiveCfg = Release|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release JIT|x64.Build.0 = Release|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release JIT|x86.ActiveCfg = Release|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release JIT|x86.Build.0 = Release|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release|x64.ActiveCfg = Release|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release|x64.Build.0 = Release|x64
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release|x86.ActiveCfg = Release|Win32
{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}.Release|x86.Build.0 = Release|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug JIT|x64.ActiveCfg = Debug|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug JIT|x64.Build.0 = Debug|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug JIT|x86.ActiveCfg = Debug|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug JIT|x86.Build.0 = Debug|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug|x64.ActiveCfg = Debug|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug|x64.Build.0 = Debug|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug|x86.ActiveCfg = Debug|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Debug|x86.Build.0 = Debug|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release JIT|x64.ActiveCfg = Release|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release JIT|x64.Build.0 = Release|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release JIT|x86.ActiveCfg = Release|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release JIT|x86.Build.0 = Release|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release|x64.ActiveCfg = Release|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release|x64.Build.0 = Release|x64
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release|x86.ActiveCfg = Release|Win32
{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}.Release|x86.Build.0 = Release|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug JIT|x64.ActiveCfg = Debug|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug JIT|x64.Build.0 = Debug|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug JIT|x86.ActiveCfg = Debug|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug JIT|x86.Build.0 = Debug|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug|x64.ActiveCfg = Debug|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug|x64.Build.0 = Debug|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug|x86.ActiveCfg = Debug|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Debug|x86.Build.0 = Debug|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release JIT|x64.ActiveCfg = Release|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release JIT|x64.Build.0 = Release|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release JIT|x86.ActiveCfg = Release|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release JIT|x86.Build.0 = Release|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release|x64.ActiveCfg = Release|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release|x64.Build.0 = Release|x64
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release|x86.ActiveCfg = Release|Win32
{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}.Release|x86.Build.0 = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug JIT|x64.ActiveCfg = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug JIT|x64.Build.0 = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug JIT|x86.ActiveCfg = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug JIT|x86.Build.0 = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.ActiveCfg = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x64.Build.0 = Debug|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x86.ActiveCfg = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|x86.Build.0 = Debug|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release JIT|x64.ActiveCfg = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release JIT|x64.Build.0 = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release JIT|x86.ActiveCfg = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release JIT|x86.Build.0 = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.ActiveCfg = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x64.Build.0 = Release|x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x86.ActiveCfg = Release|Win32
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|x86.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug JIT|x64.ActiveCfg = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug JIT|x64.Build.0 = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug JIT|x86.ActiveCfg = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug JIT|x86.Build.0 = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.ActiveCfg = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x64.Build.0 = Debug|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x86.ActiveCfg = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|x86.Build.0 = Debug|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release JIT|x64.ActiveCfg = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release JIT|x64.Build.0 = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release JIT|x86.ActiveCfg = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release JIT|x86.Build.0 = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.ActiveCfg = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x64.Build.0 = Release|x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x86.ActiveCfg = Release|Win32
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,685 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug JIT|Win32">
<Configuration>Debug JIT</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug JIT|x64">
<Configuration>Debug JIT</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release JIT|Win32">
<Configuration>Release JIT</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release JIT|x64">
<Configuration>Release JIT</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\adb.cpp" />
<ClCompile Include="..\audio.cpp" />
<ClCompile Include="..\cdrom.cpp" />
<ClCompile Include="..\CrossPlatform\sigsegv.cpp" />
<ClCompile Include="..\CrossPlatform\video_blit.cpp" />
<ClCompile Include="..\CrossPlatform\vm_alloc.cpp" />
<ClCompile Include="..\disk.cpp" />
<ClCompile Include="..\dummy\prefs_editor_dummy.cpp" />
<ClCompile Include="..\dummy\scsi_dummy.cpp" />
<ClCompile Include="..\emul_op.cpp" />
<ClCompile Include="..\ether.cpp" />
<ClCompile Include="..\extfs.cpp" />
<ClCompile Include="..\macos_util.cpp" />
<ClCompile Include="..\main.cpp" />
<ClCompile Include="..\prefs.cpp" />
<ClCompile Include="..\prefs_items.cpp" />
<ClCompile Include="..\rom_patches.cpp" />
<ClCompile Include="..\rsrc_patches.cpp" />
<ClCompile Include="..\scsi.cpp" />
<ClCompile Include="..\SDL\audio_sdl.cpp" />
<ClCompile Include="..\SDL\video_sdl.cpp" />
<ClCompile Include="..\serial.cpp" />
<ClCompile Include="..\slirp\bootp.c" />
<ClCompile Include="..\slirp\cksum.c" />
<ClCompile Include="..\slirp\debug.c" />
<ClCompile Include="..\slirp\if.c" />
<ClCompile Include="..\slirp\ip_icmp.c" />
<ClCompile Include="..\slirp\ip_input.c" />
<ClCompile Include="..\slirp\ip_output.c" />
<ClCompile Include="..\slirp\mbuf.c" />
<ClCompile Include="..\slirp\misc.c" />
<ClCompile Include="..\slirp\sbuf.c" />
<ClCompile Include="..\slirp\slirp.c" />
<ClCompile Include="..\slirp\socket.c" />
<ClCompile Include="..\slirp\tcp_input.c" />
<ClCompile Include="..\slirp\tcp_output.c" />
<ClCompile Include="..\slirp\tcp_subr.c" />
<ClCompile Include="..\slirp\tcp_timer.c" />
<ClCompile Include="..\slirp\tftp.c" />
<ClCompile Include="..\slirp\udp.c" />
<ClCompile Include="..\slot_rom.cpp" />
<ClCompile Include="..\sony.cpp" />
<ClCompile Include="..\timer.cpp" />
<ClCompile Include="..\uae_cpu\basilisk_glue.cpp" />
<ClCompile Include="..\uae_cpu\compemu.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\uae_cpu\compiler\codegen_x86.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release JIT|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release JIT|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug JIT|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug JIT|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\uae_cpu\compiler\compemu_support.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\uae_cpu\compstbl.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpudefs.cpp" />
<ClCompile Include="..\uae_cpu\cpuemu.cpp" />
<ClCompile Include="..\uae_cpu\cpuemu_nf.cpp" />
<ClCompile Include="..\uae_cpu\cpustbl.cpp" />
<ClCompile Include="..\uae_cpu\cpustbl_nf.cpp" />
<ClCompile Include="..\uae_cpu\fpu\fpu_ieee.cpp" />
<ClCompile Include="..\uae_cpu\memory.cpp" />
<ClCompile Include="..\uae_cpu\newcpu.cpp" />
<ClCompile Include="..\uae_cpu\readcpu.cpp" />
<ClCompile Include="..\user_strings.cpp" />
<ClCompile Include="..\video.cpp" />
<ClCompile Include="b2ether\packet32.cpp" />
<ClCompile Include="cdenable\cache.cpp" />
<ClCompile Include="cdenable\eject_nt.cpp" />
<ClCompile Include="cdenable\ntcd.cpp" />
<ClCompile Include="clip_windows.cpp" />
<ClCompile Include="ether_windows.cpp" />
<ClCompile Include="extfs_windows.cpp" />
<ClCompile Include="main_windows.cpp" />
<ClCompile Include="posix_emu.cpp" />
<ClCompile Include="prefs_windows.cpp" />
<ClCompile Include="router\arp.cpp" />
<ClCompile Include="router\dump.cpp" />
<ClCompile Include="router\dynsockets.cpp" />
<ClCompile Include="router\ftp.cpp" />
<ClCompile Include="router\icmp.cpp" />
<ClCompile Include="router\iphelp.cpp" />
<ClCompile Include="router\ipsocket.cpp" />
<ClCompile Include="router\mib\interfaces.cpp" />
<ClCompile Include="router\mib\mibaccess.cpp" />
<ClCompile Include="router\router.cpp" />
<ClCompile Include="router\tcp.cpp" />
<ClCompile Include="router\udp.cpp" />
<ClCompile Include="serial_windows.cpp" />
<ClCompile Include="sys_windows.cpp" />
<ClCompile Include="timer_windows.cpp" />
<ClCompile Include="user_strings_windows.cpp" />
<ClCompile Include="util_windows.cpp" />
<ClCompile Include="xpram_windows.cpp" />
<ClCompile Include="..\xpram.cpp" />
</ItemGroup>
<ItemGroup>
<Image Include="BasiliskII.ico" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="BasiliskII.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\CrossPlatform\sigsegv.h" />
<ClInclude Include="..\CrossPlatform\video_blit.h" />
<ClInclude Include="..\CrossPlatform\video_vosf.h" />
<ClInclude Include="..\CrossPlatform\vm_alloc.h" />
<ClInclude Include="..\include\adb.h" />
<ClInclude Include="..\include\audio.h" />
<ClInclude Include="..\include\audio_defs.h" />
<ClInclude Include="..\include\cdrom.h" />
<ClInclude Include="..\include\clip.h" />
<ClInclude Include="..\include\debug.h" />
<ClInclude Include="..\include\disk.h" />
<ClInclude Include="..\include\emul_op.h" />
<ClInclude Include="..\include\ether.h" />
<ClInclude Include="..\include\ether_defs.h" />
<ClInclude Include="..\include\extfs.h" />
<ClInclude Include="..\include\extfs_defs.h" />
<ClInclude Include="..\include\macos_util.h" />
<ClInclude Include="..\include\main.h" />
<ClInclude Include="..\include\pict.h" />
<ClInclude Include="..\include\prefs.h" />
<ClInclude Include="..\include\prefs_editor.h" />
<ClInclude Include="..\include\rom_patches.h" />
<ClInclude Include="..\include\rsrc_patches.h" />
<ClInclude Include="..\include\scsi.h" />
<ClInclude Include="..\include\serial.h" />
<ClInclude Include="..\include\serial_defs.h" />
<ClInclude Include="..\include\slot_rom.h" />
<ClInclude Include="..\include\sony.h" />
<ClInclude Include="..\include\sys.h" />
<ClInclude Include="..\include\timer.h" />
<ClInclude Include="..\include\user_strings.h" />
<ClInclude Include="..\include\version.h" />
<ClInclude Include="..\include\video.h" />
<ClInclude Include="..\include\video_defs.h" />
<ClInclude Include="..\include\xpram.h" />
<ClInclude Include="..\slirp\bootp.h" />
<ClInclude Include="..\slirp\ctl.h" />
<ClInclude Include="..\slirp\debug.h" />
<ClInclude Include="..\slirp\icmp_var.h" />
<ClInclude Include="..\slirp\if.h" />
<ClInclude Include="..\slirp\ip.h" />
<ClInclude Include="..\slirp\ip_icmp.h" />
<ClInclude Include="..\slirp\libslirp.h" />
<ClInclude Include="..\slirp\main.h" />
<ClInclude Include="..\slirp\mbuf.h" />
<ClInclude Include="..\slirp\misc.h" />
<ClInclude Include="..\slirp\sbuf.h" />
<ClInclude Include="..\slirp\slirp.h" />
<ClInclude Include="..\slirp\slirp_config.h" />
<ClInclude Include="..\slirp\socket.h" />
<ClInclude Include="..\slirp\tcp.h" />
<ClInclude Include="..\slirp\tcpip.h" />
<ClInclude Include="..\slirp\tcp_timer.h" />
<ClInclude Include="..\slirp\tcp_var.h" />
<ClInclude Include="..\slirp\tftp.h" />
<ClInclude Include="..\slirp\udp.h" />
<ClInclude Include="..\uae_cpu\compiler\codegen_x86.h" />
<ClInclude Include="..\uae_cpu\compiler\compemu.h" />
<ClInclude Include="..\uae_cpu\comptbl.h" />
<ClInclude Include="..\uae_cpu\cputbl.h" />
<ClInclude Include="..\uae_cpu\fpu\fpu.h" />
<ClInclude Include="..\uae_cpu\fpu\fpu_ieee.h" />
<ClInclude Include="..\uae_cpu\fpu\mathlib.h" />
<ClInclude Include="..\uae_cpu\fpu\types.h" />
<ClInclude Include="..\uae_cpu\m68k.h" />
<ClInclude Include="..\uae_cpu\memory.h" />
<ClInclude Include="..\uae_cpu\newcpu.h" />
<ClInclude Include="..\uae_cpu\noflags.h" />
<ClInclude Include="..\uae_cpu\readcpu.h" />
<ClInclude Include="..\uae_cpu\spcflags.h" />
<ClInclude Include="b2ether\inc\b2ether_hl.h" />
<ClInclude Include="b2ether\inc\ntddpack.h" />
<ClInclude Include="b2ether\multiopt.h" />
<ClInclude Include="cdenable\cache.h" />
<ClInclude Include="cdenable\cdenable.h" />
<ClInclude Include="cdenable\eject_nt.h" />
<ClInclude Include="cdenable\ntcd.h" />
<ClInclude Include="cd_defs.h" />
<ClInclude Include="config.h" />
<ClInclude Include="ether_windows.h" />
<ClInclude Include="kernel_windows.h" />
<ClInclude Include="posix_emu.h" />
<ClInclude Include="router\arp.h" />
<ClInclude Include="router\dump.h" />
<ClInclude Include="router\dynsockets.h" />
<ClInclude Include="router\ftp.h" />
<ClInclude Include="router\icmp.h" />
<ClInclude Include="router\iphelp.h" />
<ClInclude Include="router\ipsocket.h" />
<ClInclude Include="router\mib\interfaces.h" />
<ClInclude Include="router\mib\mibaccess.h" />
<ClInclude Include="router\router.h" />
<ClInclude Include="router\router_types.h" />
<ClInclude Include="router\tcp.h" />
<ClInclude Include="router\udp.h" />
<ClInclude Include="sysdeps.h" />
<ClInclude Include="user_strings_windows.h" />
<ClInclude Include="util_windows.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\SDL-1.2.15\VisualC\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\thirdparty\src\SDL-1.2.15\VisualC\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1AAA5D96-9498-4EB5-A436-0143E2B7A0B0}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>BasiliskII</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
<Import Project="BasiliskII.DebugJIT.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
<Import Project="BasiliskII.DebugJIT.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
<Import Project="BasiliskII.ReleaseJIT.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="BasiliskII.props" />
<Import Project="BasiliskII.ReleaseJIT.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|x64'">
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|x64'">
<CustomBuildBeforeTargets>ClCompile</CustomBuildBeforeTargets>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;USE_JIT;USE_JIT_FPU;JIT_DEBUG;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug JIT|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;USE_JIT;USE_JIT_FPU;JIT_DEBUG;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;OPTIMIZED_FLAGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;OPTIMIZED_FLAGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;OPTIMIZED_FLAGS;USE_JIT;USE_JIT_FPU;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release JIT|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>HAVE_CONFIG_H;DIRECT_ADDRESSING;UNALIGNED_PROFITABLE;MSVC_INTRINSICS;OPTIMIZED_FLAGS;SAHF_SETO_PROFITABLE;FPU_IEEE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;WIN32;_WINDOWS;NDEBUG;OPTIMIZED_FLAGS;USE_JIT;USE_JIT_FPU;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\include;..\uae_cpu;.;..\CrossPlatform;..\slirp;..\..\..\..\SDL-1.2.15\include</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)%(RelativeDir)</AssemblerListingLocation>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)%(RelativeDir)</XMLDocumentationFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>WS2_32.lib;IPHlpApi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<CustomBuildStep>
<Command>cd ..\uae_cpu
"$(ToolsDir)gencpu"
"$(ToolsDir)gencomp"
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>Generating CPU emulation sources...</Message>
</CustomBuildStep>
<CustomBuildStep>
<Outputs>..\uae_cpu\cpustbl.cpp;..\uae_cpu\cpustbl_nf.cpp;..\uae_cpu\cputbl.h;..\uae_cpu\cpuemu.cpp;..\uae_cpu\cpuemu_nf.cpp;..\uae_cpu\compstbl.cpp;..\uae_cpu\comptbl.h;..\uae_cpu\compemu.cpp;%(Outputs)</Outputs>
</CustomBuildStep>
<CustomBuildStep>
<Inputs>$(ToolsDir)gencpu.exe;$(ToolsDir)gencomp.exe</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,589 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\adb.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\audio.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\cdrom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\disk.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\emul_op.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ether.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\extfs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\macos_util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\prefs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\prefs_items.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\rom_patches.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\rsrc_patches.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\scsi.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\serial.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slot_rom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\sony.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\timer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\user_strings.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\video.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\xpram.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="clip_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ether_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="extfs_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="posix_emu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="prefs_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="serial_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="sys_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="timer_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="user_strings_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="util_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="xpram_windows.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cdenable\cache.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cdenable\eject_nt.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="cdenable\ntcd.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\arp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\dump.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\dynsockets.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\ftp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\icmp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\iphelp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\ipsocket.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\router.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\tcp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\udp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\mib\interfaces.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="router\mib\mibaccess.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\basilisk_glue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\memory.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\newcpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\readcpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\fpu\fpu_ieee.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\compiler\compemu_support.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\bootp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\cksum.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\debug.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\if.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\ip_icmp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\ip_input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\ip_output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\mbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\misc.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\sbuf.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\slirp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\socket.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\tcp_input.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\tcp_output.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\tcp_subr.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\tcp_timer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\tftp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\slirp\udp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\compemu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\compstbl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpudefs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpuemu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpustbl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpustbl_nf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpuemu_nf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="b2ether\packet32.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CrossPlatform\sigsegv.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CrossPlatform\video_blit.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\CrossPlatform\vm_alloc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SDL\audio_sdl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\SDL\video_sdl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\dummy\scsi_dummy.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\dummy\prefs_editor_dummy.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\compiler\codegen_x86.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Image Include="BasiliskII.ico">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="BasiliskII.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ether_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="kernel_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="posix_emu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="user_strings_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="util_windows.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdenable\cache.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdenable\cdenable.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdenable\eject_nt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cdenable\ntcd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\arp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\dump.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\dynsockets.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\ftp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\icmp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\iphelp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\ipsocket.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\router.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\router_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\tcp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\udp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\mib\interfaces.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="router\mib\mibaccess.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\memory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\newcpu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\readcpu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\fpu\fpu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\fpu\fpu_ieee.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\compiler\compemu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\bootp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\ctl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\icmp_var.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\if.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\ip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\ip_icmp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\libslirp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\mbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\misc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\sbuf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\slirp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\slirp_config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\socket.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\tcp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\tcp_timer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\tcp_var.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\tcpip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\tftp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\slirp\udp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="sysdeps.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\comptbl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\cputbl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\noflags.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\adb.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\audio.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\audio_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\cdrom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\clip.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\disk.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\emul_op.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\ether.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\ether_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\extfs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\extfs_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\macos_util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\pict.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\prefs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\prefs_editor.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\rom_patches.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\rsrc_patches.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\scsi.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\serial.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\serial_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\slot_rom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\sony.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\sys.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\timer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\user_strings.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\video.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\video_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\xpram.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="cd_defs.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\m68k.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\spcflags.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\fpu\mathlib.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\fpu\types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="b2ether\multiopt.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="b2ether\inc\b2ether_hl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="b2ether\inc\ntddpack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CrossPlatform\sigsegv.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CrossPlatform\video_blit.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CrossPlatform\video_vosf.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\CrossPlatform\vm_alloc.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\uae_cpu\compiler\codegen_x86.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -37,7 +37,7 @@ CC = @CC@
CXX = @CXX@
CFLAGS = @CFLAGS@ $(SDL_CFLAGS)
CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS)
CPPFLAGS = @CPPFLAGS@ -I../include -I. @CPUINCLUDES@ -I../slirp
CPPFLAGS = @CPPFLAGS@ -I../include -I. -I../CrossPlatform @CPUINCLUDES@ -I../slirp
DEFS = @DEFS@ @DEFINES@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ -lwsock32 -liphlpapi
@ -50,7 +50,7 @@ HOST_CXXFLAGS = -O2
HOST_LDFLAGS =
## Files
UNIXSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h
XPLATSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h
CDENABLESRCS = cdenable/cache.cpp cdenable/eject_nt.cpp cdenable/ntcd.cpp
@ -66,7 +66,7 @@ SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_window
../scsi.cpp ../dummy/scsi_dummy.cpp ../video.cpp ../SDL/video_sdl.cpp \
video_blit.cpp ../audio.cpp ../SDL/audio_sdl.cpp clip_windows.cpp \
../extfs.cpp extfs_windows.cpp ../user_strings.cpp user_strings_windows.cpp \
vm_alloc.cpp sigsegv.cpp posix_emu.cpp util_windows.cpp kernel_windows.cpp \
vm_alloc.cpp sigsegv.cpp posix_emu.cpp util_windows.cpp \
../dummy/prefs_editor_dummy.cpp BasiliskII.rc \
$(CDENABLESRCS) $(ROUTERSRCS) $(CPUSRCS) $(SLIRP_OBJS)
@ -91,7 +91,7 @@ endif
all: $(PROGS)
$(UNIXSRCS): %: ../Unix/%
$(XPLATSRCS): %: ../CrossPlatform/%
$(LN_S) $< $@
OBJ_DIR = obj
@ -114,17 +114,17 @@ SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file))))
VPATH :=
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
$(APP): $(UNIXSRCS) $(OBJ_DIR) $(OBJS)
$(APP): $(XPLATSRCS) $(OBJ_DIR) $(OBJS)
$(CXX) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) $(SDL_LIBS)
$(UI_APP): $(UNIXSRCS) $(OBJ_DIR) $(UI_OBJS)
$(UI_APP): $(XPLATSRCS) $(OBJ_DIR) $(UI_OBJS)
$(CXX) -o $@ $(LDFLAGS) $(UI_OBJS) $(LIBS) $(GTK_LIBS) -mwindows -mno-cygwin
mostlyclean:
rm -f $(APP) $(UI_APP) $(OBJ_DIR)/* core* *.core *~ *.bak
clean: mostlyclean
rm -f $(UNIXSRCS)
rm -f $(XPLATSRCS)
rm -f cpuemu.cpp cpudefs.cpp cputmp*.s cpufast*.s cpustbl.cpp cputbl.h compemu.cpp compstbl.cpp comptbl.h
distclean: clean

View File

@ -50,11 +50,11 @@ typedef struct _PACKET {
BOOLEAN StartPacketDriver(
LPTSTR ServiceName
LPCTSTR ServiceName
);
LPADAPTER PacketOpenAdapter(
LPCSTR AdapterName,
LPCTSTR AdapterName,
int16 mode
);
@ -95,8 +95,7 @@ BOOLEAN PacketGetMAC( LPADAPTER AdapterObject, LPBYTE address, BOOL permanent );
BOOLEAN PacketAddMulticast( LPADAPTER AdapterObject, LPBYTE address );
BOOLEAN PacketDelMulticast( LPADAPTER AdapterObject, LPBYTE address );
ULONG PacketGetAdapterNames( LPADAPTER lpAdapter, PTSTR pStr, PULONG BufferSize );
ULONG PacketSelectAdapterByName( LPADAPTER AdapterObject, LPCSTR name );
ULONG PacketGetAdapterNames( LPADAPTER lpAdapter, LPTSTR pStr, PULONG BufferSize );
// callbacks
void recycle_write_packet( LPPACKET Packet );

View File

@ -21,7 +21,8 @@
*/
#include "sysdeps.h"
#include <windows.h>
#include "main.h"
#include "util_windows.h"
#include <windowsx.h>
#include <winioctl.h>
#include "cpu_emulation.h"
@ -73,26 +74,18 @@ extern "C" {
#define MAX_MULTICAST 100
#define MAX_MULTICAST_SZ (20*ETH_802_3_ADDRESS_LENGTH)
static int os = VER_PLATFORM_WIN32_WINDOWS;
static ULONG packet_filter = 0;
LPADAPTER PacketOpenAdapter( LPCSTR AdapterName, int16 mode )
LPADAPTER PacketOpenAdapter( LPCTSTR AdapterName, int16 mode )
{
LPADAPTER lpAdapter;
BOOLEAN Result = TRUE;
OSVERSIONINFO osv;
D(bug("Packet32: PacketOpenAdapter\n"));
osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx( &osv )) os = osv.dwPlatformId;
if(os == VER_PLATFORM_WIN32_NT) {
// May fail if user is not an Administrator.
StartPacketDriver( "B2ether" );
}
// May fail if user is not an Administrator.
StartPacketDriver( TEXT("B2ether") );
lpAdapter = (LPADAPTER)GlobalAllocPtr( GMEM_MOVEABLE|GMEM_ZEROINIT, sizeof(ADAPTER) );
if (lpAdapter==NULL) {
@ -100,25 +93,21 @@ LPADAPTER PacketOpenAdapter( LPCSTR AdapterName, int16 mode )
return NULL;
}
if(os == VER_PLATFORM_WIN32_NT) {
char device_name[256];
wsprintf( lpAdapter->SymbolicLink, "\\\\.\\B2ether_%s", AdapterName );
wsprintf( device_name, "\\Device\\B2ether_%s", AdapterName );
TCHAR device_name[256];
_sntprintf(lpAdapter->SymbolicLink, lengthof(lpAdapter->SymbolicLink), TEXT("\\\\.\\B2ether_%s"), AdapterName );
_sntprintf(device_name, lengthof(device_name), TEXT("\\Device\\B2ether_%s"), AdapterName );
// Work around one subtle NT4 bug.
DefineDosDevice(
DDD_REMOVE_DEFINITION,
&lpAdapter->SymbolicLink[4],
NULL
);
DefineDosDevice(
DDD_RAW_TARGET_PATH,
&lpAdapter->SymbolicLink[4],
device_name
);
} else {
wsprintf( lpAdapter->SymbolicLink, "\\\\.\\B2ether" );
}
// Work around one subtle NT4 bug.
DefineDosDevice(
DDD_REMOVE_DEFINITION,
&lpAdapter->SymbolicLink[4],
NULL
);
DefineDosDevice(
DDD_RAW_TARGET_PATH,
&lpAdapter->SymbolicLink[4],
device_name
);
packet_filter = NDIS_PACKET_TYPE_DIRECTED |
NDIS_PACKET_TYPE_MULTICAST |
@ -138,10 +127,7 @@ LPADAPTER PacketOpenAdapter( LPCSTR AdapterName, int16 mode )
0
);
if (lpAdapter->hFile != INVALID_HANDLE_VALUE) {
if(*AdapterName && strcmp(AdapterName,"<None>") != 0) {
if(os == VER_PLATFORM_WIN32_WINDOWS) {
PacketSelectAdapterByName( lpAdapter, AdapterName );
}
if(*AdapterName && _tcscmp(AdapterName,TEXT("<None>")) != 0) {
PacketSetFilter( lpAdapter, packet_filter );
}
return lpAdapter;
@ -282,58 +268,48 @@ BOOLEAN PacketSendPacket(
D(bug("Packet32: PacketSendPacket bytes=%d, sync=%d\n",lpPacket->Length,Sync));
#endif
if(os == VER_PLATFORM_WIN32_NT) {
lpPacket->OverLapped.Offset = 0;
lpPacket->OverLapped.OffsetHigh = 0;
lpPacket->bIoComplete = FALSE;
lpPacket->OverLapped.Offset = 0;
lpPacket->OverLapped.OffsetHigh = 0;
lpPacket->bIoComplete = FALSE;
if(Sync) {
Result = WriteFile(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->BytesReceived,
&lpPacket->OverLapped
);
if(Result) {
Result = GetOverlappedResult(
AdapterObject->hFile,
&lpPacket->OverLapped,
&lpPacket->BytesReceived,
TRUE
);
} else {
D(bug("Packet32: PacketSendPacket WriteFile failed, err=%d\n",(int)GetLastError()));
}
lpPacket->bIoComplete = TRUE;
if(RecyclingAllowed) PacketFreePacket(lpPacket);
#if DEBUG_PACKETS
D(bug("Packet32: PacketSendPacket result=%d, bytes=%d\n",(int)Result,(int)lpPacket->BytesReceived));
#endif
if(Sync) {
Result = WriteFile(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->BytesReceived,
&lpPacket->OverLapped
);
if(Result) {
Result = GetOverlappedResult(
AdapterObject->hFile,
&lpPacket->OverLapped,
&lpPacket->BytesReceived,
TRUE
);
} else {
// don't care about the result
Result = WriteFileEx(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->OverLapped,
PacketSendCompletionRoutine
);
#if DEBUG_PACKETS
D(bug("Packet32: PacketSendPacket result=%d\n",(int)Result));
#endif
if(!Result && RecyclingAllowed) {
recycle_write_packet(lpPacket);
}
D(bug("Packet32: PacketSendPacket WriteFile failed, err=%d\n",(int)GetLastError()));
}
lpPacket->bIoComplete = TRUE;
if(RecyclingAllowed) PacketFreePacket(lpPacket);
#if DEBUG_PACKETS
D(bug("Packet32: PacketSendPacket result=%d, bytes=%d\n",(int)Result,(int)lpPacket->BytesReceived));
#endif
} else {
// Now: make writes always synchronous under Win9x
Sync = TRUE;
Result = PacketDeviceIoControl( AdapterObject,
lpPacket,
IOCTL_PROTOCOL_WRITE,
Sync );
if(RecyclingAllowed) recycle_write_packet(lpPacket);
// don't care about the result
Result = WriteFileEx(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->OverLapped,
PacketSendCompletionRoutine
);
#if DEBUG_PACKETS
D(bug("Packet32: PacketSendPacket result=%d\n",(int)Result));
#endif
if(!Result && RecyclingAllowed) {
recycle_write_packet(lpPacket);
}
}
return Result;
@ -347,58 +323,46 @@ BOOLEAN PacketReceivePacket(
{
BOOLEAN Result;
if(os == VER_PLATFORM_WIN32_NT) {
lpPacket->OverLapped.Offset=0;
lpPacket->OverLapped.OffsetHigh=0;
lpPacket->bIoComplete = FALSE;
lpPacket->OverLapped.Offset=0;
lpPacket->OverLapped.OffsetHigh=0;
lpPacket->bIoComplete = FALSE;
#if DEBUG_PACKETS
D(bug("Packet32: PacketReceivePacket\n"));
D(bug("Packet32: PacketReceivePacket\n"));
#endif
if (Sync) {
Result = ReadFile(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->BytesReceived,
&lpPacket->OverLapped
);
if(Result) {
Result = GetOverlappedResult(
AdapterObject->hFile,
&lpPacket->OverLapped,
&lpPacket->BytesReceived,
TRUE
);
if(Result)
lpPacket->bIoComplete = TRUE;
else
lpPacket->free = TRUE;
}
} else {
Result = ReadFileEx(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->OverLapped,
packet_read_completion
);
if (Sync) {
Result = ReadFile(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->BytesReceived,
&lpPacket->OverLapped
);
if(Result) {
Result = GetOverlappedResult(
AdapterObject->hFile,
&lpPacket->OverLapped,
&lpPacket->BytesReceived,
TRUE
);
if(Result)
lpPacket->bIoComplete = TRUE;
else
lpPacket->free = TRUE;
}
if(!Result) lpPacket->BytesReceived = 0;
} else {
Result = PacketDeviceIoControl( AdapterObject,
lpPacket,
IOCTL_PROTOCOL_READ,
Sync );
if( !Result && !Sync ) {
if (GetLastError() == ERROR_IO_PENDING) {
Result = TRUE;
}
}
Result = ReadFileEx(
AdapterObject->hFile,
lpPacket->Buffer,
lpPacket->Length,
&lpPacket->OverLapped,
packet_read_completion
);
}
if(!Result) lpPacket->BytesReceived = 0;
#if DEBUG_PACKETS
D(bug("Packet32: PacketReceivePacket got %d bytes, result=%d\n",lpPacket->BytesReceived,(int)Result));
#endif
@ -641,7 +605,7 @@ BOOLEAN PacketSetFilter( LPADAPTER AdapterObject, ULONG Filter )
return Status;
}
BOOLEAN StartPacketDriver( LPTSTR ServiceName )
BOOLEAN StartPacketDriver( LPCTSTR ServiceName )
{
BOOLEAN Status = FALSE;
@ -658,7 +622,7 @@ BOOLEAN StartPacketDriver( LPTSTR ServiceName )
} else {
SCServiceHandle = OpenService(SCManagerHandle,ServiceName,SERVICE_START);
if (SCServiceHandle == NULL) {
D(bug("Could not open service %s\r\n",ServiceName));
D(bug(TEXT("Could not open service %s\r\n"),ServiceName));
} else {
Status = StartService( SCServiceHandle, 0, NULL );
if(!Status) {
@ -686,7 +650,7 @@ BOOLEAN StartPacketDriver( LPTSTR ServiceName )
} else {
waiting = FALSE;
}
}
}
CloseServiceHandle(SCServiceHandle);
}
CloseServiceHandle(SCManagerHandle);
@ -694,91 +658,33 @@ BOOLEAN StartPacketDriver( LPTSTR ServiceName )
return Status;
}
ULONG PacketGetAdapterNames( LPADAPTER lpAdapter, PTSTR pStr, PULONG BufferSize )
ULONG PacketGetAdapterNames( LPADAPTER lpAdapter, LPTSTR pStr, PULONG BufferSize )
{
LONG Status;
if(os == VER_PLATFORM_WIN32_NT) {
HKEY hKey;
DWORD RegType;
HKEY hKey;
DWORD RegType;
Status = RegOpenKey(
HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Services\\B2Ether\\Linkage",
&hKey
);
if( Status == ERROR_SUCCESS ) {
Status = RegQueryValueEx(
hKey,
"Export",
NULL,
&RegType,
(LPBYTE)pStr,
BufferSize
);
RegCloseKey(hKey);
}
} else {
if (lpAdapter && lpAdapter->hFile != INVALID_HANDLE_VALUE) {
LPPACKET Packet = PacketAllocatePacket( lpAdapter, *BufferSize );
if(Packet) {
memset( pStr, 0, *BufferSize );
Packet->Buffer = (PVOID)pStr;
Packet->Length = *BufferSize;
Status = PacketDeviceIoControl(
lpAdapter,
Packet,
(ULONG)IOCTL_PROTOCOL_MACNAME,
TRUE
);
if(Status) {
while(*pStr) {
if(*pStr == '|' || *pStr == ' ') *pStr = 0;
pStr++;
}
*(++pStr) = 0;
Status = ERROR_SUCCESS;
} else {
Status = ERROR_ACCESS_DENIED;
}
*BufferSize = Packet->BytesReceived;
PacketFreePacket(Packet);
}
}
Status = RegOpenKey(
HKEY_LOCAL_MACHINE,
TEXT("SYSTEM\\CurrentControlSet\\Services\\B2Ether\\Linkage"),
&hKey
);
if( Status == ERROR_SUCCESS ) {
Status = RegQueryValueEx(
hKey,
TEXT("Export"),
NULL,
&RegType,
(LPBYTE)pStr,
BufferSize
);
RegCloseKey(hKey);
}
return Status;
}
ULONG PacketSelectAdapterByName( LPADAPTER lpAdapter, LPCSTR name )
{
ULONG Status = 0;
if(os == VER_PLATFORM_WIN32_WINDOWS) {
int len = strlen(name) + 1;
LPPACKET Packet = PacketAllocatePacket( lpAdapter, len );
if(Packet) {
Packet->Buffer = (PVOID)name;
Packet->Length = len;
Status = PacketDeviceIoControl(
lpAdapter,
Packet,
(ULONG)IOCTL_PROTOCOL_SELECT_BY_NAME,
TRUE
);
if(Status) {
Status = ERROR_SUCCESS;
} else {
Status = ERROR_ACCESS_DENIED;
}
PacketFreePacket(Packet);
}
}
return Status;
}
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7BCEAB0D-0C62-46E1-BA1E-AF42798B67D0}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>build68k</RootNamespace>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\uae_cpu\build68k.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\uae_cpu\build68k.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -23,6 +23,8 @@
#define MAXIMUM_NUMBER_TRACKS 100
#define MAXIMUM_CDROM_SIZE 804
#pragma pack(push, 1)
typedef struct _TRACK_DATA {
UCHAR Reserved;
UCHAR Control : 4;
@ -30,14 +32,14 @@ typedef struct _TRACK_DATA {
UCHAR TrackNumber;
UCHAR Reserved1;
UCHAR Address[4];
} ATTRIBUTE_PACKED TRACK_DATA, *PTRACK_DATA;
} TRACK_DATA, *PTRACK_DATA;
typedef struct _CDROM_TOC {
UCHAR Length[2];
UCHAR FirstTrack;
UCHAR LastTrack;
TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
} ATTRIBUTE_PACKED CDROM_TOC, *PCDROM_TOC;
} CDROM_TOC, *PCDROM_TOC;
// #include "ntddcdrm.h"
#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
@ -61,7 +63,7 @@ typedef struct _CDROM_TOC {
typedef struct _VOLUME_CONTROL {
UCHAR PortVolume[4];
} ATTRIBUTE_PACKED VOLUME_CONTROL, *PVOLUME_CONTROL;
} VOLUME_CONTROL, *PVOLUME_CONTROL;
typedef struct _CDROM_PLAY_AUDIO_MSF {
UCHAR StartingM;
@ -70,13 +72,13 @@ typedef struct _CDROM_PLAY_AUDIO_MSF {
UCHAR EndingM;
UCHAR EndingS;
UCHAR EndingF;
} ATTRIBUTE_PACKED CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
} CDROM_PLAY_AUDIO_MSF, *PCDROM_PLAY_AUDIO_MSF;
typedef struct _CDROM_SEEK_AUDIO_MSF {
UCHAR M;
UCHAR S;
UCHAR F;
} ATTRIBUTE_PACKED CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
} CDROM_SEEK_AUDIO_MSF, *PCDROM_SEEK_AUDIO_MSF;
//
@ -87,7 +89,7 @@ typedef struct _SUB_Q_HEADER {
UCHAR Reserved;
UCHAR AudioStatus;
UCHAR DataLength[2];
} ATTRIBUTE_PACKED SUB_Q_HEADER, *PSUB_Q_HEADER;
} SUB_Q_HEADER, *PSUB_Q_HEADER;
typedef struct _SUB_Q_CURRENT_POSITION {
SUB_Q_HEADER Header;
@ -98,7 +100,7 @@ typedef struct _SUB_Q_CURRENT_POSITION {
UCHAR IndexNumber;
UCHAR AbsoluteAddress[4];
UCHAR TrackRelativeAddress[4];
} ATTRIBUTE_PACKED SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
} SUB_Q_CURRENT_POSITION, *PSUB_Q_CURRENT_POSITION;
typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
SUB_Q_HEADER Header;
@ -107,7 +109,7 @@ typedef struct _SUB_Q_MEDIA_CATALOG_NUMBER {
UCHAR Reserved1 : 7;
UCHAR Mcval : 1;
UCHAR MediaCatalog[15];
} ATTRIBUTE_PACKED SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
} SUB_Q_MEDIA_CATALOG_NUMBER, *PSUB_Q_MEDIA_CATALOG_NUMBER;
typedef struct _SUB_Q_TRACK_ISRC {
SUB_Q_HEADER Header;
@ -118,7 +120,7 @@ typedef struct _SUB_Q_TRACK_ISRC {
UCHAR Reserved2 : 7;
UCHAR Tcval : 1;
UCHAR TrackIsrc[15];
} ATTRIBUTE_PACKED SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
} SUB_Q_TRACK_ISRC, *PSUB_Q_TRACK_ISRC;
typedef union _SUB_Q_CHANNEL_DATA {
SUB_Q_CURRENT_POSITION CurrentPosition;
@ -136,16 +138,16 @@ typedef struct __RAW_READ_INFO {
LARGE_INTEGER DiskOffset;
ULONG SectorCount;
TRACK_MODE_TYPE TrackMode;
} ATTRIBUTE_PACKED RAW_READ_INFO, *PRAW_READ_INFO;
} RAW_READ_INFO, *PRAW_READ_INFO;
typedef struct _CDROM_SUB_Q_DATA_FORMAT {
UCHAR Format;
UCHAR Track;
} ATTRIBUTE_PACKED CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
} CDROM_SUB_Q_DATA_FORMAT, *PCDROM_SUB_Q_DATA_FORMAT;
#define IOCTL_CDROM_SUB_Q_CHANNEL 0x00
#define IOCTL_CDROM_CURRENT_POSITION 0x01
#define IOCTL_CDROM_MEDIA_CATALOG 0x02
#define IOCTL_CDROM_TRACK_ISRC 0x03
#pragma pack()
#pragma pack(pop)

View File

@ -27,7 +27,6 @@
*/
#include "sysdeps.h"
#include "windows.h"
#include "cache.h"
#ifdef __cplusplus

View File

@ -22,7 +22,6 @@
#include "sysdeps.h"
#include "windows.h"
#include <winioctl.h>
// Prototypes

View File

@ -21,7 +21,6 @@
*/
#include "sysdeps.h"
#include <windows.h>
extern "C" {
@ -30,9 +29,9 @@ extern "C" {
#include "ntcd.h"
#include "cdenable.h"
static char *sDriverShort = "cdenable";
static char *sDriverLong = "System32\\Drivers\\cdenable.sys";
static char *sCompleteName = "\\\\.\\cdenable";
static LPCTSTR sDriverShort = TEXT("cdenable");
static LPCTSTR sDriverLong = TEXT("System32\\Drivers\\cdenable.sys");
static LPCTSTR sCompleteName = TEXT("\\\\.\\cdenable");
#ifdef _DEBUG
#define new DEBUG_NEW

View File

@ -21,8 +21,6 @@
#include "sysdeps.h"
#include <vector>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "macos_util.h"
#include "clip.h"
@ -236,7 +234,7 @@ static void do_getscrap(void **handle, uint32 type, int32 offset)
// Convert text from ISO-Latin1 to Mac charset
uint8 *p = Mac2HostAddr(scrap_area);
for (int i = 0; i < length; i++) {
for (uint32 i = 0; i < length; i++) {
uint8 c = data[i];
if (c < 0x80) {
if (c == 0)
@ -262,7 +260,7 @@ static void do_getscrap(void **handle, uint32 type, int32 offset)
0x2f, 0x3c, 0, 0, 0, 0, // move.l #outbuf,-(sp)
0xa9, 0xfe, // PutScrap()
0x58, 0x8f, // addq.l #4,sp
M68K_RTS >> 8, M68K_RTS
uint8(M68K_RTS >> 8), uint8(M68K_RTS)
};
uint32 proc_area = Host2MacAddr(proc);
WriteMacInt32(proc_area + 6, out_length);

View File

@ -0,0 +1,260 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Define if using video enabled on SEGV signals. */
#ifndef _DEBUG
#define ENABLE_VOSF 1
#endif
/* Define to 1 if you have the `acoshl' function. */
#define HAVE_ACOSHL 1
/* Define to 1 if you have the `acosl' function. */
#define HAVE_ACOSL 1
/* Define to 1 if you have the `asinhl' function. */
#define HAVE_ASINHL 1
/* Define to 1 if you have the `asinl' function. */
#define HAVE_ASINL 1
/* Define to 1 if you have the `atanh' function. */
#define HAVE_ATANH 1
/* Define to 1 if you have the `atanhl' function. */
#define HAVE_ATANHL 1
/* Define to 1 if you have the `atanl' function. */
#define HAVE_ATANL 1
/* Define to 1 if the system has the type `caddr_t'. */
/* #undef HAVE_CADDR_T */
/* Define to 1 if you have the `ceill' function. */
#define HAVE_CEILL 1
/* Define to 1 if you have the `coshl' function. */
#define HAVE_COSHL 1
/* Define to 1 if you have the `cosl' function. */
#define HAVE_COSL 1
/* Define to 1 if you have the `expl' function. */
/* #undef HAVE_EXPL */
/* Define to 1 if you have the `fabsl' function. */
/* #undef HAVE_FABSL */
/* Define to 1 if you have the `finite' function. */
#define HAVE_FINITE 1
/* Define to 1 if you have the <floatingpoint.h> header file. */
/* #undef HAVE_FLOATINGPOINT_H */
/* Define to 1 if you have the `floorl' function. */
#define HAVE_FLOORL 1
/* Define to 1 if you have the <ieee754.h> header file. */
/* #undef HAVE_IEEE754_H */
/* Define to 1 if you have the <ieeefp.h> header file. */
/* #undef HAVE_IEEEFP_H */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `isinf' function. */
/* #undef HAVE_ISINF */
/* Define to 1 if you have the `isinfl' function. */
/* #undef HAVE_ISINFL */
/* Define to 1 if you have the `isnan' function. */
#define HAVE_ISNAN 1
/* Define to 1 if you have the `isnanl' function. */
/* #undef HAVE_ISNANL */
/* Define to 1 if you have the `isnormal' function. */
/* #undef HAVE_ISNORMAL */
/* Define to 1 if the system has the type `loff_t'. */
/* #undef HAVE_LOFF_T */
/* Define to 1 if you have the `log10l' function. */
/* #undef HAVE_LOG10L */
/* Define to 1 if you have the `logl' function. */
/* #undef HAVE_LOGL */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <nan.h> header file. */
/* #undef HAVE_NAN_H */
/* Define to 1 if you have the `powl' function. */
#define HAVE_POWL 1
/* Define to 1 if you have the `signbit' function. */
/* #undef HAVE_SIGNBIT */
/* Define if we can ignore the fault (instruction skipping in SIGSEGV
handler). */
#define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
/* Define to 1 if you have the `sinhl' function. */
#define HAVE_SINHL 1
/* Define to 1 if you have the `sinl' function. */
#define HAVE_SINL 1
/* Define to 1 if you have the `sqrtl' function. */
#define HAVE_SQRTL 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
/* #undef HAVE_STRINGS_H */
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `tanhl' function. */
#define HAVE_TANHL 1
/* Define to 1 if you have the `tanl' function. */
#define HAVE_TANL 1
/* Define to 1 if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
/* Define if your system supports Windows exceptions. */
#define HAVE_WIN32_EXCEPTIONS 1
/* Define if your system has a working Win32-based memory allocator. */
#define HAVE_WIN32_VM 1
/* Define to the floating point format of the host machine. */
#define HOST_FLOAT_FORMAT IEEE_FLOAT_FORMAT
/* Define to 1 if the host machine stores floating point numbers in memory
with the word containing the sign bit at the lowest address, or to 0 if it
does it the other way around. This macro should not be defined if the
ordering is the same as for multi-word integers. */
/* #undef HOST_FLOAT_WORDS_BIG_ENDIAN */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define this program name. */
#define PACKAGE "Basilisk II"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "Christian.Bauer@uni-mainz.de"
/* Define to the full name of this package. */
#define PACKAGE_NAME "Basilisk II"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Basilisk II 1.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "BasiliskII"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.0"
/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
/* The size of `float', as computed by sizeof. */
#define SIZEOF_FLOAT 4
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* The size of `long double', as computed by sizeof. */
#define SIZEOF_LONG_DOUBLE 8
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 4
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to enble SDL support */
#define USE_SDL 1
/* Define to enable SDL audio support */
#define USE_SDL_AUDIO 1
/* Define to enable SDL video graphics support */
#define USE_SDL_VIDEO 1
/* Define this program version. */
#define VERSION "1.0"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

View File

@ -38,7 +38,7 @@
#include "b2ether/inc/b2ether_hl.h"
#include "ether_windows.h"
#include "router/router.h"
#include "kernel_windows.h"
#include "util_windows.h"
#include "libslirp.h"
// Define to let the slirp library determine the right timeout for select()
@ -168,17 +168,17 @@ static HANDLE int_sig2 = 0;
static HANDLE int_send_now = 0;
// Prototypes
static LPADAPTER tap_open_adapter(const char *dev_name);
static LPADAPTER tap_open_adapter(LPCTSTR dev_name);
static void tap_close_adapter(LPADAPTER fd);
static bool tap_check_version(LPADAPTER fd);
static bool tap_set_status(LPADAPTER fd, ULONG status);
static bool tap_get_mac(LPADAPTER fd, LPBYTE addr);
static bool tap_receive_packet(LPADAPTER fd, LPPACKET lpPacket, BOOLEAN Sync);
static bool tap_send_packet(LPADAPTER fd, LPPACKET lpPacket, BOOLEAN Sync, BOOLEAN recycle);
static WINAPI unsigned int slirp_receive_func(void *arg);
static WINAPI unsigned int ether_thread_feed_int(void *arg);
static WINAPI unsigned int ether_thread_get_packets_nt(void *arg);
static WINAPI unsigned int ether_thread_write_packets(void *arg);
static unsigned int WINAPI slirp_receive_func(void *arg);
static unsigned int WINAPI ether_thread_feed_int(void *arg);
static unsigned int WINAPI ether_thread_get_packets_nt(void *arg);
static unsigned int WINAPI ether_thread_write_packets(void *arg);
static void init_queue(void);
static void final_queue(void);
static bool allocate_read_packets(void);
@ -218,7 +218,7 @@ static NetProtocol *find_protocol(uint16 type)
bool ether_init(void)
{
char str[256];
TCHAR buf[256];
// Do nothing if no Ethernet device specified
const char *name = PrefsFindString("ether");
@ -248,22 +248,21 @@ bool ether_init(void)
// Initialize slirp library
if (net_if_type == NET_IF_SLIRP) {
if (slirp_init() < 0) {
sprintf(str, GetString(STR_SLIRP_NO_DNS_FOUND_WARN));
WarningAlert(str);
WarningAlert(GetString(STR_SLIRP_NO_DNS_FOUND_WARN));
return false;
}
}
// Open ethernet device
const char *dev_name;
decltype(tstr(std::declval<const char*>())) dev_name;
switch (net_if_type) {
case NET_IF_B2ETHER:
dev_name = PrefsFindString("etherguid");
dev_name = tstr(PrefsFindString("etherguid"));
if (dev_name == NULL || strcmp(name, "b2ether") != 0)
dev_name = name;
dev_name = tstr(name);
break;
case NET_IF_TAP:
dev_name = PrefsFindString("etherguid");
dev_name = tstr(PrefsFindString("etherguid"));
break;
}
if (net_if_type == NET_IF_B2ETHER) {
@ -272,17 +271,17 @@ bool ether_init(void)
goto open_error;
}
fd = PacketOpenAdapter( dev_name, ether_multi_mode );
fd = PacketOpenAdapter( dev_name.get(), ether_multi_mode );
if (!fd) {
sprintf(str, "Could not open ethernet adapter %s.", dev_name);
WarningAlert(str);
_sntprintf(buf, lengthof(buf), TEXT("Could not open ethernet adapter %s."), dev_name.get());
WarningAlert(buf);
goto open_error;
}
// Get Ethernet address
if(!PacketGetMAC(fd,ether_addr,ether_use_permanent)) {
sprintf(str, "Could not get hardware address of device %s. Ethernet is not available.", dev_name);
WarningAlert(str);
_sntprintf(buf, lengthof(buf), TEXT("Could not get hardware address of device %s. Ethernet is not available."), dev_name.get());
WarningAlert(buf);
goto open_error;
}
D(bug("Real ethernet address %02x %02x %02x %02x %02x %02x\n", ether_addr[0], ether_addr[1], ether_addr[2], ether_addr[3], ether_addr[4], ether_addr[5]));
@ -306,28 +305,27 @@ bool ether_init(void)
goto open_error;
}
fd = tap_open_adapter(dev_name);
fd = tap_open_adapter(dev_name.get());
if (!fd) {
sprintf(str, "Could not open ethernet adapter %s.", dev_name);
WarningAlert(str);
_sntprintf(buf, lengthof(buf), TEXT("Could not open ethernet adapter %s."), dev_name.get());
WarningAlert(buf);
goto open_error;
}
if (!tap_check_version(fd)) {
sprintf(str, "Minimal TAP-Win32 version supported is %d.%d.", TAP_VERSION_MIN_MAJOR, TAP_VERSION_MIN_MINOR);
WarningAlert(str);
_sntprintf(buf, lengthof(buf), TEXT("Minimal TAP-Win32 version supported is %d.%d."), TAP_VERSION_MIN_MAJOR, TAP_VERSION_MIN_MINOR);
WarningAlert(buf);
goto open_error;
}
if (!tap_set_status(fd, true)) {
sprintf(str, "Could not set media status to connected.");
WarningAlert(str);
WarningAlert("Could not set media status to connected.");
goto open_error;
}
if (!tap_get_mac(fd, ether_addr)) {
sprintf(str, "Could not get hardware address of device %s. Ethernet is not available.", dev_name);
WarningAlert(str);
_sntprintf(buf, lengthof(buf), TEXT("Could not get hardware address of device %s. Ethernet is not available."), dev_name.get());
WarningAlert(buf);
goto open_error;
}
D(bug("Real ethernet address %02x %02x %02x %02x %02x %02x\n", ether_addr[0], ether_addr[1], ether_addr[2], ether_addr[3], ether_addr[4], ether_addr[5]));
@ -403,26 +401,10 @@ bool ether_init(void)
// No need to enter wait state if we can avoid it.
// These all terminate fast.
if(pfnInitializeCriticalSectionAndSpinCount) {
pfnInitializeCriticalSectionAndSpinCount( &fetch_csection, 5000 );
} else {
InitializeCriticalSection( &fetch_csection );
}
if(pfnInitializeCriticalSectionAndSpinCount) {
pfnInitializeCriticalSectionAndSpinCount( &queue_csection, 5000 );
} else {
InitializeCriticalSection( &queue_csection );
}
if(pfnInitializeCriticalSectionAndSpinCount) {
pfnInitializeCriticalSectionAndSpinCount( &send_csection, 5000 );
} else {
InitializeCriticalSection( &send_csection );
}
if(pfnInitializeCriticalSectionAndSpinCount) {
pfnInitializeCriticalSectionAndSpinCount( &wpool_csection, 5000 );
} else {
InitializeCriticalSection( &wpool_csection );
}
InitializeCriticalSectionAndSpinCount( &fetch_csection, 5000 );
InitializeCriticalSectionAndSpinCount( &queue_csection, 5000 );
InitializeCriticalSectionAndSpinCount( &send_csection, 5000 );
InitializeCriticalSectionAndSpinCount( &wpool_csection, 5000 );
ether_th = (HANDLE)_beginthreadex( 0, 0, ether_thread_feed_int, 0, 0, &ether_tid );
if (!ether_th) {
@ -497,8 +479,8 @@ void ether_exit(void)
if(int_send_now) ReleaseSemaphore(int_send_now,1,NULL);
D(bug("CancelIO if needed\n"));
if (fd && fd->hFile && pfnCancelIo)
pfnCancelIo(fd->hFile);
if (fd && fd->hFile)
CancelIo(fd->hFile);
// Wait max 2 secs to shut down pending io. After that, kill them.
D(bug("Wait delay\n"));
@ -992,7 +974,7 @@ static LPPACKET get_write_packet( UINT len )
return Packet;
}
static unsigned int ether_thread_write_packets(void *arg)
unsigned int WINAPI ether_thread_write_packets(void *arg)
{
LPPACKET Packet;
@ -1184,15 +1166,15 @@ static bool set_wait_request(void)
* TAP-Win32 glue
*/
static LPADAPTER tap_open_adapter(const char *dev_name)
static LPADAPTER tap_open_adapter(LPCTSTR dev_name)
{
fd = (LPADAPTER)GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT, sizeof(*fd));
if (fd == NULL)
return NULL;
char dev_path[MAX_PATH];
snprintf(dev_path, sizeof(dev_path),
"\\\\.\\Global\\%s.tap", dev_name);
TCHAR dev_path[MAX_PATH];
_sntprintf(dev_path, lengthof(dev_path),
TEXT("\\\\.\\Global\\%s.tap"), dev_name);
HANDLE handle = CreateFile(
dev_path,
@ -1246,7 +1228,7 @@ static bool tap_set_status(LPADAPTER fd, ULONG status)
DWORD len = 0;
return DeviceIoControl(fd->hFile, TAP_IOCTL_SET_MEDIA_STATUS,
&status, sizeof (status),
&status, sizeof (status), &len, NULL);
&status, sizeof (status), &len, NULL) != FALSE;
}
static bool tap_get_mac(LPADAPTER fd, LPBYTE addr)
@ -1254,8 +1236,7 @@ static bool tap_get_mac(LPADAPTER fd, LPBYTE addr)
DWORD len = 0;
return DeviceIoControl(fd->hFile, TAP_IOCTL_GET_MAC,
addr, 6,
addr, 6, &len, NULL);
addr, 6, &len, NULL) != FALSE;
}
static VOID CALLBACK tap_write_completion(
@ -1309,7 +1290,7 @@ static bool tap_send_packet(
recycle_write_packet(lpPacket);
}
return Result;
return Result != FALSE;
}
static bool tap_receive_packet(LPADAPTER fd, LPPACKET lpPacket, BOOLEAN Sync)
@ -1348,7 +1329,7 @@ static bool tap_receive_packet(LPADAPTER fd, LPPACKET lpPacket, BOOLEAN Sync)
lpPacket->BytesReceived = 0;
}
return Result;
return Result != FALSE;
}
@ -1366,7 +1347,7 @@ void slirp_output(const uint8 *packet, int len)
enqueue_packet(packet, len);
}
static unsigned int slirp_receive_func(void *arg)
unsigned int WINAPI slirp_receive_func(void *arg)
{
D(bug("slirp_receive_func\n"));
thread_active_2 = true;
@ -1508,7 +1489,7 @@ static void free_read_packets(void)
}
}
static unsigned int ether_thread_get_packets_nt(void *arg)
unsigned int WINAPI ether_thread_get_packets_nt(void *arg)
{
static uint8 packet[1514];
int i, packet_sz = 0;
@ -1565,7 +1546,7 @@ static unsigned int ether_thread_get_packets_nt(void *arg)
return 0;
}
static unsigned int ether_thread_feed_int(void *arg)
unsigned int WINAPI ether_thread_feed_int(void *arg)
{
bool looping;

View File

@ -18,17 +18,18 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdeps.h"
#include "main.h"
#include "extfs.h"
#include "extfs_defs.h"
#include "posix_emu.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "sysdeps.h"
#include "extfs.h"
#include "extfs_defs.h"
#include "posix_emu.h"
#define DEBUG 0
#include "debug.h"
@ -127,8 +128,13 @@ static int open_helper(const char *path, const char *add, int flag)
char helper_path[MAX_PATH_LENGTH];
make_helper_path(path, helper_path, add);
if ((flag & O_ACCMODE) == O_RDWR || (flag & O_ACCMODE) == O_WRONLY)
switch (flag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
case _O_WRONLY:
case _O_RDWR:
flag |= O_CREAT;
break;
}
int fd = open(helper_path, flag, 0666);
if (fd < 0) {
if (/*errno == ENOENT &&*/ (flag & O_CREAT)) {

View File

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{95933FE9-C27C-41F0-B4AF-EAAADE94FD04}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>gencomp</RootNamespace>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\uae_cpu\compiler\gencomp.c" />
<ClCompile Include="..\uae_cpu\cpudefs.cpp" />
<ClCompile Include="..\uae_cpu\readcpu.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\uae_cpu\readcpu.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\uae_cpu\table68k">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating cpudefs.cpp...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating cpudefs.cpp...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating cpudefs.cpp...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating cpudefs.cpp...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\uae_cpu\cpudefs.cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\uae_cpu\cpudefs.cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\uae_cpu\cpudefs.cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\uae_cpu\cpudefs.cpp</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)build68k.exe</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)build68k.exe</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)build68k.exe</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)build68k.exe</AdditionalInputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\uae_cpu\compiler\gencomp.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\readcpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpudefs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\uae_cpu\readcpu.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\uae_cpu\table68k" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1A9EA738-8DA7-422F-9E0D-BE92893C0E48}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>gencpu</RootNamespace>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\uae_cpu\cpudefs.cpp" />
<ClCompile Include="..\uae_cpu\gencpu.c" />
<ClCompile Include="..\uae_cpu\readcpu.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\uae_cpu\readcpu.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\uae_cpu\table68k">
<FileType>Document</FileType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating cpudefs.cpp...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating cpudefs.cpp...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\uae_cpu\cpudefs.cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\uae_cpu\cpudefs.cpp</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(OutDir)build68k.exe</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(OutDir)build68k.exe</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(OutDir)build68k" "%(Identity)" &gt; ..\uae_cpu\cpudefs.cpp</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating cpudefs.cpp...</Message>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating cpudefs.cpp...</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\uae_cpu\cpudefs.cpp</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\uae_cpu\cpudefs.cpp</Outputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(OutDir)build68k.exe</AdditionalInputs>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(OutDir)build68k.exe</AdditionalInputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\uae_cpu\gencpu.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\readcpu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\uae_cpu\cpudefs.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\uae_cpu\readcpu.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<CustomBuild Include="..\uae_cpu\table68k" />
</ItemGroup>
</Project>

View File

@ -1,88 +0,0 @@
/*
* kernel_windows.cpp
*
* Basilisk II (C) 1997-2008 Christian Bauer
*
* Windows platform specific code copyright (C) Lauri Pesonen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdeps.h"
#include "prefs.h"
#include "kernel_windows.h"
// From main_windows.cpp
extern DWORD win_os;
extern DWORD win_os_major;
static HMODULE hKernel32 = 0;
static HMODULE hUser32 = 0;
static HMODULE hB2Win32 = 0;
UINT (WINAPI *pfnGetWriteWatch) (DWORD,PVOID,SIZE_T,PVOID *,LPDWORD,LPDWORD) = 0;
BOOL (WINAPI *pfnInitializeCriticalSectionAndSpinCount) (LPCRITICAL_SECTION,DWORD) = 0;
BOOL (WINAPI *pfnCancelIo) (HANDLE) = 0;
BOOL (WINAPI *pfnGETCDSECTORS) (BYTE,DWORD,WORD,LPBYTE) = 0;
UINT (WINAPI *pfnSendInput) (UINT,LPVOID,int) = 0;
BOOL (WINAPI *pfnGetDiskFreeSpaceEx) (LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER) = 0;
void KernelInit( void )
{
hKernel32 = LoadLibrary( "kernel32.dll" );
hUser32 = LoadLibrary( "user32.dll" );
if(hKernel32) {
if(win_os == VER_PLATFORM_WIN32_WINDOWS) {
// NT5 RC2 Kernel exports GetWriteWatch(), but VirtualAlloc(MEM_WRITE_WATCH) fails
pfnGetWriteWatch = (UINT (WINAPI *)(DWORD,PVOID,SIZE_T,PVOID *,LPDWORD,LPDWORD))GetProcAddress( hKernel32, "GetWriteWatch" );
}
pfnInitializeCriticalSectionAndSpinCount = (BOOL (WINAPI *)(LPCRITICAL_SECTION,DWORD))GetProcAddress( hKernel32, "InitializeCriticalSectionAndSpinCount" );
pfnCancelIo = (BOOL (WINAPI *)(HANDLE))GetProcAddress( hKernel32, "CancelIo" );
pfnGetDiskFreeSpaceEx = (BOOL (WINAPI *)(LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER))GetProcAddress( hKernel32, "GetDiskFreeSpaceExA" );
}
if(hUser32) {
// Win98 has this one too.
// if(win_os == VER_PLATFORM_WIN32_NT) {
pfnSendInput = (UINT (WINAPI *)(UINT,LPVOID,int))GetProcAddress( hUser32, "SendInput" );
// }
}
if(win_os == VER_PLATFORM_WIN32_WINDOWS) {
hB2Win32 = LoadLibrary( "B2Win32.dll" );
if(hB2Win32) {
pfnGETCDSECTORS = (BOOL (WINAPI *)(BYTE,DWORD,WORD,LPBYTE))GetProcAddress( hB2Win32, "GETCDSECTORS" );
}
}
}
void KernelExit( void )
{
if(hKernel32) {
FreeLibrary( hKernel32 );
hKernel32 = 0;
}
if(hUser32) {
FreeLibrary( hUser32 );
hUser32 = 0;
}
if(hB2Win32) {
FreeLibrary( hB2Win32 );
hB2Win32 = 0;
}
pfnGetWriteWatch = 0;
pfnInitializeCriticalSectionAndSpinCount = 0;
pfnCancelIo = 0;
pfnSendInput = 0;
pfnGETCDSECTORS = 0;
}

View File

@ -1,36 +0,0 @@
/*
* kernel_windows.h
*
* Basilisk II (C) 1997-2008 Christian Bauer
*
* Windows platform specific code copyright (C) Lauri Pesonen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _KERNEL_WINDOWS_H_
#define _KERNEL_WINDOWS_H_
extern UINT (WINAPI *pfnGetWriteWatch) (DWORD,PVOID,SIZE_T,PVOID *,LPDWORD,LPDWORD);
extern BOOL (WINAPI *pfnInitializeCriticalSectionAndSpinCount) (LPCRITICAL_SECTION,DWORD);
extern BOOL (WINAPI *pfnCancelIo) (HANDLE);
extern BOOL (WINAPI *pfnGETCDSECTORS) (BYTE,DWORD,WORD,LPBYTE);
extern UINT (WINAPI *pfnSendInput) (UINT,LPVOID,int);
extern BOOL (WINAPI *pfnGetDiskFreeSpaceEx) (LPCSTR,PULARGE_INTEGER,PULARGE_INTEGER,PULARGE_INTEGER);
void KernelInit( void );
void KernelExit( void );
#endif // _KERNEL_WINDOWS_H_

View File

@ -30,7 +30,7 @@
#include <SDL_thread.h>
#include <string>
using std::string;
typedef std::basic_string<TCHAR> tstring;
#include "cpu_emulation.h"
#include "sys.h"
@ -49,7 +49,6 @@ using std::string;
#include "vm_alloc.h"
#include "sigsegv.h"
#include "util_windows.h"
#include "kernel_windows.h"
#if USE_JIT
extern void flush_icache_range(uint8 *start, uint32 size); // from compemu_support.cpp
@ -64,7 +63,7 @@ extern void flush_icache_range(uint8 *start, uint32 size); // from compemu_suppo
// Constants
const char ROM_FILE_NAME[] = "ROM";
const TCHAR ROM_FILE_NAME[] = TEXT("ROM");
const int SCRATCH_MEM_SIZE = 0x10000; // Size of scratch memory area
@ -91,9 +90,6 @@ static SDL_mutex *intflag_lock = NULL; // Mutex to protect InterruptFlags
#define LOCK_INTFLAGS SDL_LockMutex(intflag_lock)
#define UNLOCK_INTFLAGS SDL_UnlockMutex(intflag_lock)
DWORD win_os; // Windows OS id
DWORD win_os_major; // Windows OS version major
#if USE_SCRATCHMEM_SUBTERFUGE
uint8 *ScratchMem = NULL; // Scratch memory for Mac ROM writes
#endif
@ -219,7 +215,7 @@ int main(int argc, char **argv)
// Initialize variables
RAMBaseHost = NULL;
ROMBaseHost = NULL;
srand(time(NULL));
srand(unsigned(time(NULL)));
tzset();
// Print some info
@ -239,8 +235,8 @@ int main(int argc, char **argv)
} else if (strcmp(argv[i], "--config") == 0) {
argv[i++] = NULL;
if (i < argc) {
extern string UserPrefsPath; // from prefs_unix.cpp
UserPrefsPath = argv[i];
extern tstring UserPrefsPath; // from prefs_windows.cpp
UserPrefsPath = to_tstring(argv[i]);
argv[i] = NULL;
}
} else if (strcmp(argv[i], "--rominfo") == 0) {
@ -281,27 +277,11 @@ int main(int argc, char **argv)
}
}
// Check we are using a Windows NT kernel >= 4.0
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx(&osvi)) {
ErrorAlert("Could not determine OS type");
QuitEmulator();
}
win_os = osvi.dwPlatformId;
win_os_major = osvi.dwMajorVersion;
if (win_os != VER_PLATFORM_WIN32_NT || win_os_major < 4) {
ErrorAlert(STR_NO_WIN32_NT_4);
QuitEmulator();
}
#if 0
// Check that drivers are installed
if (!check_drivers())
QuitEmulator();
// Load win32 libraries
KernelInit();
#endif
// FIXME: default to DIB driver
if (getenv("SDL_VIDEODRIVER") == NULL)
@ -381,12 +361,12 @@ int main(int argc, char **argv)
D(bug("Mac ROM starts at %p (%08x)\n", ROMBaseHost, ROMBaseMac));
// Get rom file path from preferences
const char *rom_path = PrefsFindString("rom");
auto rom_path = tstr(PrefsFindString("rom"));
// Load Mac ROM
HANDLE rom_fh = CreateFile(rom_path ? rom_path : ROM_FILE_NAME,
HANDLE rom_fh = CreateFile(rom_path ? rom_path.get() : ROM_FILE_NAME,
GENERIC_READ,
0, NULL,
FILE_SHARE_READ, NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
@ -495,9 +475,6 @@ void QuitEmulator(void)
// Exit preferences
PrefsExit();
// Release win32 libraries
KernelExit();
exit(0);
}
@ -631,7 +608,7 @@ static int tick_func(void *arg)
next += 16625;
int64 delay = next - GetTicks_usec();
if (delay > 0)
Delay_usec(delay);
Delay_usec(uint32(delay));
else if (delay < -16625)
next = GetTicks_usec();
ticks++;
@ -664,7 +641,12 @@ HWND GetMainWindowHandle(void)
static void display_alert(int title_id, const char *text, int flags)
{
HWND hMainWnd = GetMainWindowHandle();
MessageBox(hMainWnd, text, GetString(title_id), MB_OK | flags);
MessageBoxA(hMainWnd, text, GetString(title_id), MB_OK | flags);
}
static void display_alert(int title_id, const wchar_t *text, int flags)
{
HWND hMainWnd = GetMainWindowHandle();
MessageBoxW(hMainWnd, text, GetStringW(title_id).get(), MB_OK | flags);
}
@ -680,6 +662,14 @@ void ErrorAlert(const char *text)
VideoQuitFullScreen();
display_alert(STR_ERROR_ALERT_TITLE, text, MB_ICONSTOP);
}
void ErrorAlert(const wchar_t *text)
{
if (PrefsFindBool("nogui"))
return;
VideoQuitFullScreen();
display_alert(STR_ERROR_ALERT_TITLE, text, MB_ICONSTOP);
}
/*
@ -693,6 +683,13 @@ void WarningAlert(const char *text)
display_alert(STR_WARNING_ALERT_TITLE, text, MB_ICONINFORMATION);
}
void WarningAlert(const wchar_t *text)
{
if (PrefsFindBool("nogui"))
return;
display_alert(STR_WARNING_ALERT_TITLE, text, MB_ICONINFORMATION);
}
/*

View File

@ -114,21 +114,21 @@ int my_errno = 0;
#define VIRTUAL_ROOT_ID ((HANDLE)0xFFFFFFFE)
static const char *desktop_name = "Virtual Desktop";
static LPCTSTR desktop_name = TEXT("Virtual Desktop");
static const char *custom_icon_name = "Icon\r";
#define my_computer GetString(STR_EXTFS_VOLUME_NAME)
static char lb1[MAX_PATH_LENGTH];
static char lb2[MAX_PATH_LENGTH];
static TCHAR lb1[MAX_PATH_LENGTH];
static TCHAR lb2[MAX_PATH_LENGTH];
#define MRP(path) translate(path,lb1)
#define MRP(path) translate(path,lb1)
#define MRP2(path) translate(path,lb2)
#define DISABLE_ERRORS UINT prevmode = SetErrorMode(SEM_NOOPENFILEERRORBOX|SEM_FAILCRITICALERRORS)
#define RESTORE_ERRORS SetErrorMode(prevmode);
static char host_drive_list[512];
static char virtual_root[248]; // Not _MAX_PATH
static TCHAR host_drive_list[512];
static TCHAR virtual_root[248]; // Not _MAX_PATH
const uint8 my_comp_icon[2670] = {
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0xD8, 0x00, 0x00, 0x08, 0xD8, 0x00, 0x00, 0x00, 0x96,
@ -302,12 +302,12 @@ const uint8 my_comp_icon[2670] = {
static bool use_streams[ 'Z'-'A'+1 ];
static bool is_ntfs_volume( char *rootdir )
static bool is_ntfs_volume(LPCTSTR rootdir)
{
bool ret = false;
char tst_file[_MAX_PATH], tst_stream[_MAX_PATH];
sprintf( tst_file, "%sb2query.tmp", rootdir );
sprintf( tst_stream, "%s:AFP_AfpInfo", tst_file );
TCHAR tst_file[_MAX_PATH], tst_stream[_MAX_PATH];
_sntprintf( tst_file, lengthof(tst_file), TEXT("%sb2query.tmp"), rootdir );
_sntprintf( tst_stream, lengthof(tst_stream), TEXT("%s:AFP_AfpInfo"), tst_file );
if(!exists(tst_file)) {
if(create_file( tst_file, 0 )) {
if(create_file( tst_stream, 0 )) {
@ -353,12 +353,11 @@ void init_posix_emu(void)
const char *extdrives = PrefsFindString("extdrives");
// Set up drive list.
int outinx = 0;
for( char letter = 'A'; letter <= 'Z'; letter++ ) {
size_t outinx = 0;
for( TCHAR letter = TEXT('A'); letter <= TEXT('Z'); letter++ ) {
if(extdrives && !strchr(extdrives,letter)) continue;
int i = (int)( letter - 'A' );
char rootdir[20];
wsprintf( rootdir, "%c:\\", letter );
TCHAR rootdir[20];
_sntprintf( rootdir, lengthof(rootdir), TEXT("%c:\\"), letter );
use_streams[ letter - 'A' ] = false;
switch(GetDriveType(rootdir)) {
case DRIVE_FIXED:
@ -368,7 +367,7 @@ void init_posix_emu(void)
// fall
case DRIVE_REMOVABLE:
case DRIVE_CDROM:
if(outinx < sizeof(host_drive_list)) {
if(outinx < lengthof(host_drive_list)) {
host_drive_list[outinx] = letter;
outinx += 2;
}
@ -377,14 +376,13 @@ void init_posix_emu(void)
// Set up virtual desktop root.
// TODO: this should be customizable.
GetModuleFileName( NULL, virtual_root, sizeof(virtual_root) );
char *p = strrchr( virtual_root, '\\' );
GetModuleFileName( NULL, virtual_root, lengthof(virtual_root) );
TCHAR *p = _tcsrchr( virtual_root, TEXT('\\') );
if(p) {
*(++p) = 0;
strcat( virtual_root, desktop_name );
_tcscpy( ++p, desktop_name );
} else {
// should never happen
sprintf( virtual_root, "C:\\%s", desktop_name );
_sntprintf( virtual_root, lengthof(virtual_root), TEXT("C:\\%s"), desktop_name );
}
CreateDirectory( virtual_root, 0 );
@ -433,14 +431,14 @@ static void charset_host2mac( char *s )
}
}
static void charset_mac2host( char *s )
static void charset_mac2host( LPTSTR s )
{
int i, convert, len = strlen(s);
size_t len = _tcslen(s);
D(bug("charset_mac2host(%s)...\n", s));
D(bug(TEXT("charset_mac2host(%s)...\n"), s));
for( i=len-1; i>=0; i-- ) {
convert = 0;
for( size_t i=len; i-->0; ) {
bool convert = false;
switch( (unsigned char)s[i] ) {
// case '\r': // handled by "default"
// case '\n':
@ -455,61 +453,61 @@ static void charset_mac2host( char *s )
case '>':
case '|':
case '%':
convert = 1;
convert = true;
break;
default:
if((unsigned char)s[i] < ' ') convert = 1;
if((unsigned char)s[i] < ' ') convert = true;
break;
}
if(convert) {
char sml[10];
sprintf( sml, "%%%02X", s[i] );
memmove( &s[i+2], &s[i], strlen(&s[i])+1 );
memmove( &s[i], sml, 3 );
TCHAR sml[10];
_sntprintf( sml, lengthof(sml), TEXT("%%%02X"), s[i] );
memmove( &s[i+2], &s[i], (_tcslen(&s[i])+1) * sizeof(TCHAR) );
memmove( &s[i], sml, 3 * sizeof(TCHAR) );
}
}
D(bug("charset_mac2host = %s\n", s));
D(bug(TEXT("charset_mac2host = %s\n"), s));
}
static void make_mask(
char *mask,
const char *dir,
const char *a1,
const char *a2
TCHAR *mask,
LPCTSTR dir,
LPCTSTR a1,
LPCTSTR a2
)
{
strcpy( mask, dir );
_tcscpy( mask, dir );
int len = strlen(mask);
if( len && mask[len-1] != '\\' ) strcat( mask, "\\" );
size_t len = _tcslen(mask);
if( len && mask[len-1] != '\\' ) _tcscat( mask, TEXT("\\") );
if( a1 ) strcat( mask, a1 );
if( a2 ) strcat( mask, a2 );
if( a1 ) _tcscat( mask, a1 );
if( a2 ) _tcscat( mask, a2 );
}
// !!UNC
static char *translate( const char *path, char *buffer )
static LPTSTR translate( LPCTSTR path, TCHAR *buffer )
{
char *l = host_drive_list;
char *p = (char *)path;
TCHAR *l = host_drive_list;
const TCHAR *p = path;
while(*l) {
if(toupper(p[1]) == toupper(*l)) break;
l += strlen(l) + 1;
if(_totupper(p[1]) == _totupper(*l)) break;
l += _tcslen(l) + 1;
}
if(p[0] == '\\' && *l && (p[2] == 0 || p[2] == ':' || p[2] == '\\')) {
if(p[0] == TEXT('\\') && *l && (p[2] == 0 || p[2] == TEXT(':') || p[2] == TEXT('\\'))) {
p += 2;
if(*p == ':') p++;
if(*p == '\\') p++;
sprintf( buffer, "%c:\\%s", *l, p );
if(*p == TEXT(':')) p++;
if(*p == TEXT('\\')) p++;
_sntprintf( buffer, MAX_PATH_LENGTH, TEXT("%c:\\%s"), *l, p );
} else {
if(*path == '\\') {
sprintf( buffer, "%s%s", virtual_root, path );
if(*path == TEXT('\\')) {
_sntprintf( buffer, MAX_PATH_LENGTH, TEXT("%s%s"), virtual_root, path );
} else {
int len = strlen(path);
if(len == 0 || path[len-1] == '\\') {
make_mask( buffer, virtual_root, path, my_computer );
int len = _tcslen(path);
if(len == 0 || path[len-1] == TEXT('\\')) {
make_mask( buffer, virtual_root, path, tstr(my_computer).get() );
} else {
make_mask( buffer, virtual_root, path, 0 );
}
@ -521,10 +519,10 @@ static char *translate( const char *path, char *buffer )
}
// helpers
static void strip_trailing_bs( char *path )
static void strip_trailing_bs( LPTSTR path )
{
int len = strlen(path);
if(len > 0 && path[len-1] == '\\') path[len-1] = 0;
size_t len = _tcslen(path);
if(len > 0 && path[len-1] == TEXT('\\')) path[len-1] = 0;
}
#if 0 /* defined is util_windows.cpp */
@ -546,7 +544,7 @@ static int exists( const char *p )
}
#endif
static int is_dir( char *p )
static int is_dir( LPCTSTR p )
{
WIN32_FIND_DATA fdata;
@ -560,31 +558,31 @@ static int is_dir( char *p )
return result;
}
static int myRemoveDirectory( const char *source )
static int myRemoveDirectory( LPCTSTR source )
{
HANDLE fh;
WIN32_FIND_DATA FindFileData;
int ok, result = 1;
char mask[_MAX_PATH];
TCHAR mask[_MAX_PATH];
D(bug("removing folder %s\n", source));
D(bug(TEXT("removing folder %s\n"), source));
make_mask( mask, source, "*.*", 0 );
make_mask( mask, source, TEXT("*.*"), 0 );
fh = FindFirstFile( mask, &FindFileData );
ok = fh != INVALID_HANDLE_VALUE;
while(ok) {
make_mask( mask, source, FindFileData.cFileName, 0 );
D(bug("removing item %s\n", mask));
D(bug(TEXT("removing item %s\n"), mask));
int isdir = (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
if(isdir) {
// must delete ".finf", ".rsrc" but not ".", ".."
if(strcmp(FindFileData.cFileName,".") && strcmp(FindFileData.cFileName,"..")) {
if(_tcscmp(FindFileData.cFileName,TEXT(".")) && _tcscmp(FindFileData.cFileName,TEXT(".."))) {
result = myRemoveDirectory( mask );
if(!result) break;
}
} else {
D(bug("DeleteFile %s\n", mask));
D(bug(TEXT("DeleteFile %s\n"), mask));
result = DeleteFile( mask );
if(!result) break;
}
@ -592,41 +590,41 @@ static int myRemoveDirectory( const char *source )
}
if(fh != INVALID_HANDLE_VALUE) FindClose( fh );
if(result) {
D(bug("RemoveDirectory %s\n", source));
D(bug(TEXT("RemoveDirectory %s\n"), source));
result = RemoveDirectory( source );
}
return result;
}
static void make_folders( char *path )
static void make_folders( LPCTSTR path )
{
char local_path[_MAX_PATH], *p;
strcpy( local_path, path );
p = strrchr( local_path, '\\' );
TCHAR local_path[_MAX_PATH], *p;
_tcscpy( local_path, path );
p = _tcsrchr( local_path, TEXT('\\') );
if(p) {
*p = 0;
if(strlen(local_path) > 3) {
if(_tcslen(local_path) > 3) {
make_folders(local_path);
mkdir(local_path);
_tmkdir(local_path);
}
}
}
// !!UNC
static bool is_same_drive( char *p1, char *p2 )
static bool is_same_drive( LPCTSTR p1, LPCTSTR p2 )
{
return toupper(*p1) == toupper(*p2);
return _totupper(*p1) == _totupper(*p2);
}
// Used when the drives are known to be different.
// Can't use MoveFileEx() etc because of the Win9x limitations.
// It would simulate CopyFile*() -- DeleteFile*() anyway
int file_move_copy( char *src, char *dst, bool delete_old )
static int file_move_copy( LPCTSTR src, LPCTSTR dst, bool delete_old )
{
int result = 0;
my_errno = 0;
D(bug("file_copy %s -> %s\n", src, dst));
D(bug(TEXT("file_copy %s -> %s\n"), src, dst));
// Fail if exists -- it's up to MacOS to move things to Trash
if(CopyFile(src,dst,TRUE)) {
@ -644,24 +642,24 @@ int file_move_copy( char *src, char *dst, bool delete_old )
return result;
}
int file_move( char *src, char *dst )
static int file_move( LPCTSTR src, LPCTSTR dst )
{
return file_move_copy( src, dst, true );
}
int file_copy( char *src, char *dst )
static int file_copy( LPCTSTR src, LPCTSTR dst )
{
return file_move_copy( src, dst, false );
}
int folder_copy( char *folder_src, char *folder_dst )
static int folder_copy( LPCTSTR folder_src, LPCTSTR folder_dst )
{
HANDLE fh;
WIN32_FIND_DATA FindFileData;
int ok, result = 0;
char mask[_MAX_PATH];
TCHAR mask[_MAX_PATH];
D(bug("copying folder %s -> \n", folder_src, folder_dst));
D(bug(TEXT("copying folder %s -> \n"), folder_src, folder_dst));
my_errno = 0;
@ -670,18 +668,18 @@ int folder_copy( char *folder_src, char *folder_dst )
return -1;
}
make_mask( mask, folder_src, "*.*", 0 );
make_mask( mask, folder_src, TEXT("*.*"), 0 );
fh = FindFirstFile( mask, &FindFileData );
ok = fh != INVALID_HANDLE_VALUE;
while(ok) {
make_mask( mask, folder_src, FindFileData.cFileName, 0 );
int isdir = (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
char target[_MAX_PATH];
TCHAR target[_MAX_PATH];
make_mask( target, folder_dst, FindFileData.cFileName, 0 );
D(bug("copying item %s -> %s\n", mask, target));
D(bug(TEXT("copying item %s -> %s\n"), mask, target));
if(isdir) {
if(strcmp(FindFileData.cFileName,".") && strcmp(FindFileData.cFileName,"..")) {
if(_tcscmp(FindFileData.cFileName,TEXT(".")) && _tcscmp(FindFileData.cFileName,TEXT(".."))) {
result = folder_copy( mask, target );
if(result < 0) break;
}
@ -715,12 +713,11 @@ static int make_dentry( struct DIR *d )
memset( &d->de, 0, sizeof(d->de) );
if(d->h != INVALID_HANDLE_VALUE) {
if( (d->FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 &&
*d->FindFileData.cFileName == '.')
*d->FindFileData.cFileName == TEXT('.'))
{
ok = 0;
} else {
strncpy( d->de.d_name, d->FindFileData.cFileName, sizeof(d->de.d_name)-1 );
d->de.d_name[sizeof(d->de.d_name)-1] = 0;
strlcpy( d->de.d_name, d->FindFileData.cFileName, lengthof(d->de.d_name) );
charset_host2mac( d->de.d_name );
ok = 1;
}
@ -739,14 +736,14 @@ struct dirent *readdir( struct DIR *d )
if(d->h == VIRTUAL_ROOT_ID) {
make_dentry(d);
de = &d->de;
d->vname_list += strlen(d->vname_list) + 1;
d->vname_list += _tcslen(d->vname_list) + 1;
if(*d->vname_list) {
strcpy( d->FindFileData.cFileName, d->vname_list );
_tcscpy( d->FindFileData.cFileName, d->vname_list );
d->FindFileData.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
} else {
// Out of static drive entries. Continue with other stuff.
char mask[MAX_PATH_LENGTH];
make_mask( mask, virtual_root, "*.*", 0 );
TCHAR mask[MAX_PATH_LENGTH];
make_mask( mask, virtual_root, TEXT("*.*"), 0 );
d->h = FindFirstFile( mask, &d->FindFileData );
}
} else {
@ -778,23 +775,24 @@ struct dirent *readdir( struct DIR *d )
struct DIR *opendir( const char *path )
{
DISABLE_ERRORS;
auto tpath = tstr(path);
DIR *d = new DIR;
if(d) {
memset( d, 0, sizeof(DIR) );
if(*path == 0) {
if(*tpath.get() == 0) {
d->vname_list = host_drive_list;
if(d->vname_list) {
d->h = VIRTUAL_ROOT_ID;
strcpy( d->FindFileData.cFileName, d->vname_list );
_tcscpy( d->FindFileData.cFileName, d->vname_list );
d->FindFileData.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
} else {
d->h = INVALID_HANDLE_VALUE;
}
} else {
char mask[MAX_PATH_LENGTH];
make_mask( mask, MRP(path), "*.*", 0 );
TCHAR mask[MAX_PATH_LENGTH];
make_mask( mask, MRP(tpath.get()), TEXT("*.*"), 0 );
D(bug("opendir path=%s, mask=%s\n", path, mask));
D(bug(TEXT("opendir path=%s, mask=%s\n"), tpath.get(), mask));
d->h = FindFirstFile( mask, &d->FindFileData );
if(d->h == INVALID_HANDLE_VALUE) {
@ -804,7 +802,7 @@ struct DIR *opendir( const char *path )
}
}
D(bug("opendir(%s,%s) = %08x\n", path, MRP(path), d));
D(bug(TEXT("opendir(%s,%s) = %08x\n"), tpath.get(), MRP(tpath.get()), d));
RESTORE_ERRORS;
@ -823,16 +821,17 @@ int my_stat( const char *path, struct my_stat *st )
{
DISABLE_ERRORS;
auto tpath = tstr(path);
int result;
if(*path == 0) {
if(*tpath.get() == 0) {
/// virtual root
memset( st, 0, sizeof(struct my_stat) );
st->st_mode = _S_IFDIR;
result = 0;
my_errno = 0;
} else {
result = stat( MRP(path), (struct stat *)st );
result = _tstat( MRP(tpath.get()), (struct _stat *)st );
if(result < 0) {
my_errno = errno;
} else {
@ -840,7 +839,7 @@ int my_stat( const char *path, struct my_stat *st )
}
}
D(bug("stat(%s,%s) = %d\n", path, MRP(path), result));
D(bug(TEXT("stat(%s,%s) = %d\n"), tpath.get(), MRP(tpath.get()), result));
if(result >= 0) dump_stat( st );
RESTORE_ERRORS;
return result;
@ -849,7 +848,7 @@ int my_stat( const char *path, struct my_stat *st )
int my_fstat( int fd, struct my_stat *st )
{
DISABLE_ERRORS;
int result = fstat( fd, (struct stat *)st );
int result = _fstat( fd, (struct _stat *)st );
if(result < 0) {
my_errno = errno;
} else {
@ -865,24 +864,25 @@ int my_open( const char *path, int mode, ... )
{
DISABLE_ERRORS;
int result;
char *p = MRP(path);
auto tpath = tstr(path);
LPCTSTR p = MRP(tpath.get());
// Windows "open" does not handle _O_CREAT and _O_BINARY as it should
if(mode & _O_CREAT) {
if(exists(p)) {
result = open( p, mode & ~_O_CREAT );
D(bug("open-nocreat(%s,%s,%d) = %d\n", path, p, mode, result));
result = _topen( p, mode & ~_O_CREAT );
D(bug(TEXT("open-nocreat(%s,%s,%d) = %d\n"), tpath.get(), p, mode, result));
} else {
result = creat( p, _S_IWRITE|_S_IREAD );
result = _tcreat( p, _S_IWRITE|_S_IREAD );
if(result < 0) {
make_folders(p);
result = creat( p, _S_IWRITE|_S_IREAD );
result = _tcreat( p, _S_IWRITE|_S_IREAD );
}
D(bug("open-creat(%s,%s,%d) = %d\n", path, p, mode, result));
D(bug(TEXT("open-creat(%s,%s,%d) = %d\n"), tpath.get(), p, mode, result));
}
} else {
result = open( p, mode );
D(bug("open(%s,%s,%d) = %d\n", path, p, mode, result));
result = _topen( p, mode );
D(bug(TEXT("open(%s,%s,%d) = %d\n"), tpath.get(), p, mode, result));
}
if(result < 0) {
my_errno = errno;
@ -898,15 +898,17 @@ int my_rename( const char *old_path, const char *new_path )
{
DISABLE_ERRORS;
int result = -1;
char *p_old = MRP(old_path);
char *p_new = MRP2(new_path);
auto told_path = tstr(old_path);
auto tnew_path = tstr(new_path);
LPCTSTR p_old = MRP(told_path.get());
LPCTSTR p_new = MRP2(tnew_path.get());
result = my_access(old_path,0);
if(result < 0) {
// my_errno already set
} else {
if(is_same_drive(p_old,p_new)) {
result = rename( p_old, p_new );
result = _trename( p_old, p_new );
if(result != 0) { // by definition, rename may also return a positive value to indicate an error
my_errno = errno;
} else {
@ -932,7 +934,7 @@ int my_rename( const char *old_path, const char *new_path )
}
}
}
D(bug("rename(%s,%s,%s,%s) = %d\n", old_path, p_old, new_path, p_new, result));
D(bug(TEXT("rename(%s,%s,%s,%s) = %d\n"), told_path.get(), p_old, tnew_path.get(), p_new, result));
RESTORE_ERRORS;
return result;
}
@ -940,7 +942,8 @@ int my_rename( const char *old_path, const char *new_path )
int my_access( const char *path, int mode )
{
DISABLE_ERRORS;
char *p = MRP(path);
auto tpath = tstr(path);
LPCTSTR p = MRP(tpath.get());
WIN32_FIND_DATA fdata;
int result;
@ -968,7 +971,7 @@ int my_access( const char *path, int mode )
}
} else {
// W_OK, F_OK are ok.
result = access(p,mode);
result = _taccess(p,mode);
if(result < 0) {
my_errno = errno;
} else {
@ -976,7 +979,7 @@ int my_access( const char *path, int mode )
}
}
D(bug("access(%s,%s,%d) = %d\n", path, MRP(path), mode, result));
D(bug(TEXT("access(%s,%s,%d) = %d\n"), tpath.get(), p, mode, result));
RESTORE_ERRORS;
return result;
}
@ -984,19 +987,20 @@ int my_access( const char *path, int mode )
int my_mkdir( const char *path, int mode )
{
DISABLE_ERRORS;
char *p = MRP(path);
auto tpath = tstr(path);
LPTSTR p = MRP(tpath.get());
strip_trailing_bs(p);
int result = mkdir( p );
int result = _tmkdir( p );
if(result < 0) {
make_folders(p);
result = mkdir( p );
result = _tmkdir( p );
}
if(result < 0) {
my_errno = errno;
} else {
my_errno = 0;
}
D(bug("mkdir(%s,%s,%d) = %d\n", path, p, mode, result));
D(bug(TEXT("mkdir(%s,%s,%d) = %d\n"), tpath.get(), p, mode, result));
RESTORE_ERRORS;
return result;
}
@ -1004,13 +1008,14 @@ int my_mkdir( const char *path, int mode )
int my_remove( const char *path )
{
DISABLE_ERRORS;
char *p = MRP(path);
auto tpath = tstr(path);
LPTSTR p = MRP(tpath.get());
strip_trailing_bs(p);
int result;
if(is_dir(p)) {
result = myRemoveDirectory( p );
} else {
D(bug("DeleteFile %s\n", p));
D(bug(TEXT("DeleteFile %s\n"), p));
result = DeleteFile( p );
}
if(result) {
@ -1024,7 +1029,7 @@ int my_remove( const char *path )
my_errno = ENOENT;
}
}
D(bug("remove(%s,%s) = %d\n", path, p, result));
D(bug(TEXT("remove(%s,%s) = %d\n"), tpath.get(), p, result));
RESTORE_ERRORS;
return result;
}
@ -1032,11 +1037,12 @@ int my_remove( const char *path )
int my_creat( const char *path, int mode )
{
DISABLE_ERRORS;
char *p = MRP(path);
int result = creat( p, _S_IWRITE|_S_IREAD ); // note mode
auto tpath = tstr(path);
LPCTSTR p = MRP(tpath.get());
int result = _tcreat( p, _S_IWRITE|_S_IREAD ); // note mode
if(result < 0) {
make_folders(p);
result = creat( p, _S_IWRITE|_S_IREAD ); // note mode
result = _tcreat( p, _S_IWRITE|_S_IREAD ); // note mode
}
if(result < 0) {
my_errno = errno;
@ -1044,7 +1050,7 @@ int my_creat( const char *path, int mode )
setmode(result, _O_BINARY);
my_errno = 0;
}
D(bug("creat(%s,%s,%d) = %d\n", path, p, mode,result));
D(bug(TEXT("creat(%s,%s,%d) = %d\n"), tpath.get(), p, mode,result));
RESTORE_ERRORS;
return result;
}

View File

@ -39,7 +39,7 @@ typedef struct DIR {
HANDLE h;
WIN32_FIND_DATA FindFileData;
dirent de;
char *vname_list;
TCHAR *vname_list;
} DIR;
// emulated

View File

@ -20,14 +20,11 @@
#include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
using std::string;
typedef std::basic_string<TCHAR> tstring;
#include "prefs.h"
@ -61,9 +58,9 @@ prefs_desc platform_prefs_items[] = {
// Prefs file name and path
const char PREFS_FILE_NAME[] = "BasiliskII_prefs";
string UserPrefsPath;
static string prefs_path;
const TCHAR PREFS_FILE_NAME[] = TEXT("BasiliskII_prefs");
tstring UserPrefsPath;
static tstring prefs_path;
/*
@ -75,16 +72,15 @@ void LoadPrefs(const char *vmdir)
// Construct prefs path
if (UserPrefsPath.empty()) {
int pwd_len = GetCurrentDirectory(0, NULL);
char *pwd = new char[pwd_len];
if (GetCurrentDirectory(pwd_len, pwd) == pwd_len - 1)
prefs_path = string(pwd) + '\\';
delete[] pwd;
prefs_path.resize(pwd_len);
pwd_len = GetCurrentDirectory(pwd_len, &prefs_path.front());
prefs_path[pwd_len] = TEXT('\\');
prefs_path += PREFS_FILE_NAME;
} else
prefs_path = UserPrefsPath;
// Read preferences from settings file
FILE *f = fopen(prefs_path.c_str(), "r");
FILE *f = _tfopen(prefs_path.c_str(), TEXT("r"));
if (f != NULL) {
// Prefs file found, load settings
@ -106,7 +102,7 @@ void LoadPrefs(const char *vmdir)
void SavePrefs(void)
{
FILE *f;
if ((f = fopen(prefs_path.c_str(), "w")) != NULL) {
if ((f = _tfopen(prefs_path.c_str(), TEXT("w"))) != NULL) {
SavePrefsToStream(f);
fclose(f);
}

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "cpu_emulation.h"
#include "prefs.h"
#include "ether_windows.h"

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "dump.h"
#if DEBUG

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "dynsockets.h"
#include "dump.h"
#include "main.h"
@ -40,7 +41,7 @@
Win95 b2 users who can't (or won't) upgrade.
*/
static const char *wslib = "WS2_32.DLL";
static LPCTSTR wslib = TEXT("WS2_32.DLL");
static HMODULE hWinsock32 = 0;
static WSADATA WSAData;

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include <ctype.h>
#include "dump.h"
#include "prefs.h"

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "cpu_emulation.h"
#include "ws2tcpip.h"
#include "prefs.h"

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "cpu_emulation.h"
#include "ether_windows.h"
#include "ether.h"

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "cpu_emulation.h"
#include "ws2tcpip.h"
#include "prefs.h"

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "interfaces.h"
#include "../dump.h"
#include "mibaccess.h"

View File

@ -61,6 +61,7 @@
#include "sysdeps.h"
#include "main.h"
#include "mibaccess.h"
#include "../dynsockets.h"
#include "../dump.h"
@ -71,9 +72,8 @@
#include "debug.h"
MibExtLoad::MibExtLoad( LPSTR MibDllName, LPSTR SnmpDllName )
MibExtLoad::MibExtLoad( LPCTSTR MibDllName, LPCTSTR SnmpDllName )
{
m_Init = NULL;
m_InitEx = NULL;
@ -88,10 +88,10 @@ MibExtLoad::MibExtLoad( LPSTR MibDllName, LPSTR SnmpDllName )
m_hInst = LoadLibrary( MibDllName );
if(!m_hInst) {
D(bug("MIB: library %s could not be loaded.\r\n", MibDllName));
D(bug(TEXT("MIB: library %s could not be loaded.\r\n"), MibDllName));
return;
}
D(bug("MIB: library %s loaded ok.\r\n", MibDllName));
D(bug(TEXT("MIB: library %s loaded ok.\r\n"), MibDllName));
m_Init = (pSnmpExtensionInit)GetProcAddress(m_hInst ,"SnmpExtensionInit");
m_InitEx= (pSnmpExtensionInitEx)GetProcAddress(m_hInst ,"SnmpExtensionInitEx");
@ -100,19 +100,19 @@ MibExtLoad::MibExtLoad( LPSTR MibDllName, LPSTR SnmpDllName )
if( !m_Init || !m_InitEx || !m_Query || !m_Trap )
{
D(bug("MIB: required entry points not found in library %s.\r\n", MibDllName));
D(bug(TEXT("MIB: required entry points not found in library %s.\r\n"), MibDllName));
FreeLibrary( m_hInst );
m_hInst = NULL;
}
m_hInst_snmputil = LoadLibrary( SnmpDllName );
if(!m_hInst_snmputil){
D(bug("MIB: library %s could not be loaded.\r\n", SnmpDllName));
D(bug(TEXT("MIB: library %s could not be loaded.\r\n"), SnmpDllName));
FreeLibrary( m_hInst );
m_hInst = NULL;
return;
}
D(bug("MIB: library %s loaded ok.\r\n", SnmpDllName));
D(bug(TEXT("MIB: library %s loaded ok.\r\n"), SnmpDllName));
m_SnmpUtilVarBindFree = (VOID (SNMP_FUNC_TYPE *)(SnmpVarBind *))GetProcAddress( m_hInst_snmputil, "SnmpUtilVarBindFree" );
m_SnmpUtilOidNCmp = (SNMPAPI (SNMP_FUNC_TYPE *)(AsnObjectIdentifier *, AsnObjectIdentifier *, UINT))GetProcAddress( m_hInst_snmputil, "SnmpUtilOidNCmp" );
@ -120,7 +120,7 @@ MibExtLoad::MibExtLoad( LPSTR MibDllName, LPSTR SnmpDllName )
if( !m_SnmpUtilVarBindFree || !m_SnmpUtilOidNCmp || !m_SnmpUtilOidCpy )
{
D(bug("MIB: required entry points not found in library %s.\r\n", SnmpDllName));
D(bug(TEXT("MIB: required entry points not found in library %s.\r\n"), SnmpDllName));
FreeLibrary( m_hInst );
FreeLibrary( m_hInst_snmputil );
m_hInst = NULL;
@ -181,7 +181,7 @@ BOOL MibExtLoad::Trap(AsnObjectIdentifier *enterprise, AsnInteger *genericTrap,
return FALSE;
}
MibII::MibII( bool load_winsock ):MibExtLoad("inetmib1.dll","snmpapi.dll")
MibII::MibII(bool load_winsock) : MibExtLoad(TEXT("inetmib1.dll"), TEXT("snmpapi.dll"))
{
WSADATA wsa;
m_load_winsock = load_winsock;

View File

@ -38,7 +38,7 @@ typedef BOOL (WINAPI *pSnmpExtensionInitEx)(OUT AsnObjectIdentifier *supportedVi
class MibExtLoad
{
public:
MibExtLoad( LPSTR MibDllName, LPSTR SnmpDllName );
MibExtLoad( LPCTSTR MibDllName, LPCTSTR SnmpDllName );
~MibExtLoad();
BOOL Init(DWORD dwTimeZeroReference,HANDLE *hPollForTrapEvent,AsnObjectIdentifier *supportedView);
BOOL InitEx(AsnObjectIdentifier *supportedView);

View File

@ -27,9 +27,8 @@
*/
#include "sysdeps.h"
#include "main.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
#include "cpu_emulation.h"
@ -147,7 +146,7 @@ bool router_read_packet(uint8 *packet, int len)
Arguably an ugly hack, but needed since there is no way to
listen to all ports w/o writing another ndis filter driver
*/
static WINAPI unsigned int router_expire_thread(void *arg)
static unsigned int WINAPI router_expire_thread(void *arg)
{
while(!is_router_shutting_down) {
close_old_sockets();

View File

@ -23,7 +23,7 @@
#ifndef _ROUTER_TYPES_H_
#define _ROUTER_TYPES_H_
#pragma pack(1)
#pragma pack(push, 1)
// --------------------------- MAC ---------------------------
@ -31,7 +31,7 @@ typedef struct {
uint8 dest[6];
uint8 src[6];
uint16 type;
} ATTRIBUTE_PACKED mac_t;
} mac_t;
enum {
mac_type_llc_ipx_limit = 0x05DC, // <= mac_type_llc_ipx_limit -->> 802.3 MAC frame
@ -54,7 +54,7 @@ typedef struct {
uint8 srcp[4]; // size for ip
uint8 dsth[6]; // size for ethernet
uint8 dstp[4]; // size for ip
} ATTRIBUTE_PACKED arp_t;
} arp_t;
enum {
arp_request = 1,
@ -79,7 +79,7 @@ typedef struct {
uint32 src;
uint32 dest;
// ip options, size = 4 * header_len - 20
} ATTRIBUTE_PACKED ip_t;
} ip_t;
// Protocol STD numbers
enum {
@ -95,7 +95,7 @@ typedef struct {
uint8 code;
uint16 checksum;
// data
} ATTRIBUTE_PACKED icmp_t;
} icmp_t;
enum {
icmp_Echo_reply = 0,
@ -140,7 +140,7 @@ typedef struct {
uint16 urgent_ptr;
// options + padding: size = dataoffset*4-20
// data
} ATTRIBUTE_PACKED tcp_t;
} tcp_t;
enum {
tcp_flags_URG = 0x20, // The urgent pointer field is significant in this segment.
@ -173,15 +173,15 @@ typedef struct {
uint16 msg_len;
uint16 checksum;
// data
} ATTRIBUTE_PACKED udp_t;
} udp_t;
typedef struct {
uint16 src_lo, src_hi;
uint16 dest_lo, dest_hi;
uint16 proto;
uint16 msg_len;
} ATTRIBUTE_PACKED pseudo_ip_t;
} pseudo_ip_t;
#pragma pack()
#pragma pack(pop)
#endif // _ROUTER_TYPES_H_

View File

@ -66,9 +66,8 @@
*/
#include "sysdeps.h"
#include "main.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
#include "cpu_emulation.h"
@ -1333,7 +1332,7 @@ void write_tcp( tcp_t *tcp, int len )
- Expire time-waits.
- Handle resend timeouts.
*/
static WINAPI unsigned int tcp_connect_close_thread(void *arg)
static unsigned int WINAPI tcp_connect_close_thread(void *arg)
{
WSAEVENT wait_handles[MAX_SOCKETS];
@ -1429,7 +1428,7 @@ static WINAPI unsigned int tcp_connect_close_thread(void *arg)
return 0;
}
static WINAPI unsigned int tcp_listen_thread(void *arg)
static unsigned int WINAPI tcp_listen_thread(void *arg)
{
WSAEVENT wait_handles[MAX_SOCKETS];
@ -1505,9 +1504,9 @@ static void init_tcp_listen_ports()
const char *port_str;
while ((port_str = PrefsFindString("tcp_port", index++)) != NULL) {
uint32 iface = 0;
char *if_str = strchr(port_str,',');
const char *if_str = strchr(port_str,',');
if(if_str) {
*if_str++ = 0;
if_str++;
uint32 if_net = _inet_addr( if_str );
if(if_net == INADDR_NONE) if_net = INADDR_ANY;
iface = ntohl( if_net );

View File

@ -21,6 +21,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "cpu_emulation.h"
#include "prefs.h"
#include "ether_windows.h"

View File

@ -27,6 +27,7 @@
#include <process.h>
#include "main.h"
#include "util_windows.h"
#include "macos_util.h"
#include "prefs.h"
#include "serial.h"
@ -38,7 +39,7 @@
#undef OutputDebugString
#define OutputDebugString serial_log_write
static void serial_log_write( char *s );
#define SERIAL_LOG_FILE_NAME "serial.log"
#define SERIAL_LOG_FILE_NAME TEXT("serial.log")
#include "debug.h"
#undef D
#define D(x) if(debug_serial != DB_SERIAL_NONE) (x);
@ -54,7 +55,7 @@ static int16 debug_serial = DB_SERIAL_NONE;
static HANDLE serial_log_file = INVALID_HANDLE_VALUE;
static void serial_log_open( char *path )
static void serial_log_open( LPCTSTR path )
{
if(debug_serial == DB_SERIAL_NONE) return;
@ -108,28 +109,27 @@ static void serial_log_write( char *s )
// Driver private variables
class XSERDPort : public SERDPort {
public:
XSERDPort(const char *dev, const char *suffix)
XSERDPort(LPCTSTR dev, LPCTSTR suffix)
{
D(bug("XSERDPort constructor %s\r\n", dev));
// device_name = (char *)dev;
D(bug(TEXT("XSERDPort constructor %s\r\n"), dev));
read_pending = write_pending = false;
if(dev)
strcpy( device_name, (char *)dev );
_tcscpy( device_name, dev );
else
*device_name = 0;
strupr(device_name);
is_parallel = (strncmp(device_name,"LPT",3) == 0);
is_file = (strncmp(device_name,"FILE",4) == 0);
_tcsupr(device_name);
is_parallel = (_tcsncmp(device_name, TEXT("LPT"), 3) == 0);
is_file = (_tcsncmp(device_name, TEXT("FILE"), 4) == 0);
if(is_file) {
char entry_name[20];
wsprintf( entry_name, "portfile%s", suffix );
_snprintf( entry_name, lengthof(entry_name), "portfile%s", str(suffix).get() );
const char *path = PrefsFindString(entry_name);
if(path) {
strcpy( output_file_name, path );
_tcscpy( output_file_name, tstr(path).get() );
} else {
strcpy( output_file_name, "C:\\B2TEMP.OUT" );
_tcscpy( output_file_name, TEXT("C:\\B2TEMP.OUT") );
}
}
@ -166,12 +166,12 @@ public:
private:
bool configure(uint16 config);
void set_handshake(uint32 s, bool with_dtr);
static WINAPI unsigned int input_func(void *arg);
static WINAPI unsigned int output_func(void *arg);
static unsigned int WINAPI input_func(void *arg);
static unsigned int WINAPI output_func(void *arg);
static int acknowledge_error(HANDLE h, bool is_read);
bool set_timeouts(int bauds, int parity_bits, int stop_bits);
char device_name[256];
TCHAR device_name[256];
HANDLE fd;
bool io_killed; // Flag: KillIO called, I/O threads must not call deferred tasks
@ -193,7 +193,7 @@ private:
bool is_parallel; // true if LPTx
bool is_file; // true if FILE
char output_file_name[256];
TCHAR output_file_name[256];
};
/*
@ -214,13 +214,13 @@ void SerialInit(void)
if(port) {
D(bug("SerialInit seriala=%s\r\n",port));
}
the_serd_port[0] = new XSERDPort(port,"0");
the_serd_port[0] = new XSERDPort(tstr(port).get(), TEXT("0"));
port = PrefsFindString("serialb");
if(port) {
D(bug("SerialInit serialb=%s\r\n",port));
}
the_serd_port[1] = new XSERDPort(port,"1");
the_serd_port[1] = new XSERDPort(tstr(port).get(), TEXT("1"));
}
@ -249,7 +249,7 @@ int16 XSERDPort::open(uint16 config)
if (!device_name || !*device_name)
return openErr;
D(bug("XSERDPort::open device=%s,config=0x%X\r\n",device_name,(int)config));
D(bug(TEXT("XSERDPort::open device=%s,config=0x%X\r\n"),device_name,(int)config));
// Init variables
io_killed = false;
@ -268,7 +268,7 @@ int16 XSERDPort::open(uint16 config)
}
if(fd == INVALID_HANDLE_VALUE) {
goto open_error;
D(bug("XSERDPort::open failed to open port %s\r\n",device_name));
D(bug(TEXT("XSERDPort::open failed to open port %s\r\n"),device_name));
}
if(is_serial) {
@ -1046,7 +1046,7 @@ unsigned int XSERDPort::input_func(void *arg)
set_desktop();
#endif
D(bug("XSERDPort::input_func started for device %s\r\n",s->device_name));
D(bug(TEXT("XSERDPort::input_func started for device %s\r\n"),s->device_name));
for (;;) {
@ -1131,7 +1131,7 @@ unsigned int XSERDPort::output_func(void *arg)
set_desktop();
#endif
D(bug("XSERDPort::output_func started for device %s\r\n",s->device_name));
D(bug(TEXT("XSERDPort::output_func started for device %s\r\n"),s->device_name));
for (;;) {

View File

@ -20,17 +20,16 @@
#include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winioctl.h>
#include <string>
using std::string;
typedef std::basic_string<TCHAR> tstring;
#include <algorithm>
using std::min;
#include "main.h"
#include "util_windows.h"
#include "macos_util.h"
#include "prefs.h"
#include "user_strings.h"
@ -47,7 +46,7 @@ using std::min;
// File handles are pointers to these structures
struct file_handle {
char *name; // Copy of device/file name
TCHAR *name; // Copy of device/file name
HANDLE fh;
bool is_file; // Flag: plain file or physical device?
bool is_floppy; // Flag: floppy device
@ -151,8 +150,8 @@ void mount_removable_media(int media)
CloseHandle(fh->fh);
// Re-open device
char device_name[MAX_PATH];
sprintf(device_name, "\\\\.\\%c:", fh->name[0]);
TCHAR device_name[MAX_PATH];
_sntprintf(device_name, lengthof(device_name), TEXT("\\\\.\\%c:"), fh->name[0]);
fh->fh = CreateFile(
device_name,
GENERIC_READ,
@ -232,11 +231,10 @@ void SysAddCDROMPrefs(void)
if (PrefsFindBool("nocdrom"))
return;
for (char letter = 'C'; letter <= 'Z'; letter++) {
int i = (int)(letter - 'A');
string rootdir = letter + ":\\";
if (GetDriveType(rootdir.c_str()) == DRIVE_CDROM)
PrefsAddString("cdrom", rootdir.c_str());
char rootdir[] = "C:\\";
for (; rootdir[0] <= 'Z'; rootdir[0]++) {
if (GetDriveTypeA(rootdir) == DRIVE_CDROM)
PrefsAddString("cdrom", rootdir);
}
}
@ -397,9 +395,9 @@ static bool is_cdrom_readable(file_handle *fh)
* Check if NAME represents a read-only file
*/
static bool is_read_only_path(const char *name)
static bool is_read_only_path(const TCHAR *name)
{
DWORD attrib = GetFileAttributes((char *)name);
DWORD attrib = GetFileAttributes(name);
return (attrib != INVALID_FILE_ATTRIBUTES && ((attrib & FILE_ATTRIBUTE_READONLY) != 0));
}
@ -413,25 +411,25 @@ void *Sys_open(const char *path_name, bool read_only)
file_handle * fh = NULL;
// Parse path name and options
char name[MAX_PATH];
strcpy(name, path_name);
TCHAR name[MAX_PATH];
tcslcpy(name, path_name, lengthof(name));
// Normalize floppy / cd path
int name_len = strlen(name);
if (name_len == 1 && isalpha(name[0]))
strcat(name, ":\\");
if (name_len > 0 && name[name_len - 1] == ':')
strcat(name, "\\");
name_len = strlen(name);
int name_len = _tcslen(name);
if (name_len == 1 && _istalpha(name[0]))
_tcscat(name, TEXT(":\\"));
if (name_len > 0 && name[name_len - 1] == TEXT(':'))
_tcscat(name, TEXT("\\"));
name_len = _tcslen(name);
D(bug("Sys_open(%s, %s)\n", name, read_only ? "read-only" : "read/write"));
if (name_len > 0 && name[name_len - 1] == '\\') {
D(bug(TEXT("Sys_open(%s, %s)\n"), name, read_only ? TEXT("read-only") : TEXT("read/write")));
if (name_len > 0 && name[name_len - 1] == TEXT('\\')) {
int type = GetDriveType(name);
if (type == DRIVE_CDROM) {
read_only = true;
char device_name[MAX_PATH];
sprintf(device_name, "\\\\.\\%c:", name[0]);
TCHAR device_name[MAX_PATH];
_sntprintf(device_name, lengthof(device_name), TEXT("\\\\.\\%c:"), name[0]);
// Open device
HANDLE h = CreateFile(
@ -441,7 +439,7 @@ void *Sys_open(const char *path_name, bool read_only)
if (h != INVALID_HANDLE_VALUE) {
fh = new file_handle;
fh->name = strdup(name);
fh->name = _tcsdup(name);
fh->fh = h;
fh->is_file = false;
fh->read_only = read_only;
@ -480,7 +478,7 @@ void *Sys_open(const char *path_name, bool read_only)
if (h != INVALID_HANDLE_VALUE) {
fh = new file_handle;
fh->name = strdup(name);
fh->name = _tcsdup(name);
fh->fh = h;
fh->is_file = true;
fh->read_only = read_only;
@ -497,11 +495,11 @@ void *Sys_open(const char *path_name, bool read_only)
}
}
if (fh->is_floppy && first_floppy == NULL)
first_floppy = fh;
if (fh)
if (fh) {
if (fh->is_floppy && first_floppy == NULL)
first_floppy = fh;
sys_add_file_handle(fh);
}
return fh;
}
@ -793,7 +791,7 @@ bool SysCDReadTOC(void *arg, uint8 *toc)
NULL, 0,
toc, min((int)sizeof(CDROM_TOC), 804),
&dummy,
NULL);
NULL) != FALSE;
}
@ -819,7 +817,7 @@ bool SysCDGetPosition(void *arg, uint8 *pos)
&q_format, sizeof(CDROM_SUB_Q_DATA_FORMAT),
&q_data, sizeof(SUB_Q_CHANNEL_DATA),
&dwBytesReturned,
NULL);
NULL) != FALSE;
if (ok)
memcpy(pos, &q_data.CurrentPosition, sizeof(SUB_Q_CURRENT_POSITION));
@ -851,7 +849,7 @@ bool SysCDPlay(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, uint8 end
&msf, sizeof(CDROM_PLAY_AUDIO_MSF),
NULL, 0,
&dwBytesReturned,
NULL);
NULL) != FALSE;
}
@ -871,7 +869,7 @@ bool SysCDPause(void *arg)
NULL, 0,
NULL, 0,
&dwBytesReturned,
NULL);
NULL) != FALSE;
}
@ -890,7 +888,7 @@ bool SysCDResume(void *arg)
IOCTL_CDROM_RESUME_AUDIO,
NULL, 0,
NULL, 0,
&dwBytesReturned, NULL);
&dwBytesReturned, NULL) != FALSE;
}
@ -910,7 +908,7 @@ bool SysCDStop(void *arg, uint8 lead_out_m, uint8 lead_out_s, uint8 lead_out_f)
NULL, 0,
NULL, 0,
&dwBytesReturned,
NULL);
NULL) != FALSE;
}
@ -935,7 +933,7 @@ bool SysCDScan(void *arg, uint8 start_m, uint8 start_s, uint8 start_f, bool reve
&msf, sizeof(CDROM_SEEK_AUDIO_MSF),
NULL, 0,
&dwBytesReturned,
NULL);
NULL) != FALSE;
}

View File

@ -21,7 +21,7 @@
#ifndef SYSDEPS_H
#define SYSDEPS_H
#ifndef __STDC__
#if !defined _MSC_VER && !defined __STDC__
#error "Your compiler is not ANSI. Get a real one."
#endif
@ -40,10 +40,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <time.h>
#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <WinSock2.h>
#include <sys/types.h>
@ -78,6 +79,10 @@
/* ExtFS is supported */
#define SUPPORTS_EXTFS 1
/* POSIX data types missing from Microsoft's CRT */
#ifdef _MSC_VER
typedef ptrdiff_t ssize_t;
#endif
/* Data types */
typedef unsigned char uint8;
@ -123,13 +128,21 @@ typedef int64 intptr;
#error "Unsupported size of pointer"
#endif
#ifdef __WIN32__
#ifdef _WIN32
typedef int64 loff_t;
#endif
#ifndef HAVE_CADDR_T
typedef char * caddr_t;
#endif
#ifdef _MSC_VER
#ifdef _M_IX86
#define __i386__
#elif defined _M_AMD64
#define __x86_64__
#endif
#endif
/* Time data type for Time Manager emulation */
typedef int64 tm_time_t;
@ -207,31 +220,42 @@ static inline int spin_trylock(spinlock_t *lock)
}
#endif
/* Intel x86 */
#define X86_PPRO_OPT
#define HAVE_OPTIMIZED_BYTESWAP_32
#define HAVE_OPTIMIZED_BYTESWAP_16
#ifdef _MSC_VER
static inline uae_u32 do_get_mem_long(uae_u32 *a) {return _byteswap_ulong(*a);}
static inline uae_u32 do_get_mem_word(uae_u16 *a) {return _byteswap_ushort(*a);}
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {*a = _byteswap_ulong(v);}
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {*a = _byteswap_ushort(v);}
static inline uae_u32 do_byteswap_32_g(uae_u32 v) {return _byteswap_ulong(v);}
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {return _byteswap_ushort(v);}
#else
/* Intel x86 */
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;}
#ifdef X86_PPRO_OPT
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#else
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#endif
#define HAVE_GET_WORD_UNSWAPPED
#define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#ifdef X86_PPRO_OPT
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;}
#else
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#endif
#define HAVE_OPTIMIZED_BYTESWAP_32
/* bswap doesn't affect condition codes */
static inline uae_u32 do_byteswap_32_g(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;}
#define HAVE_OPTIMIZED_BYTESWAP_16
#ifdef X86_PPRO_OPT
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;}
#else
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;}
#endif
#endif
#define HAVE_GET_WORD_UNSWAPPED
#define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
#ifndef HAVE_OPTIMIZED_BYTESWAP_32
static inline uae_u32 do_byteswap_32_g(uae_u32 v)
@ -294,12 +318,10 @@ static inline uae_u32 do_byteswap_16_g(uae_u32 v)
#define ENUMNAME(name) name
#define write_log printf
#define ATTRIBUTE_PACKED __attribute__((packed))
#if defined(X86_ASSEMBLY) || defined(X86_64_ASSEMBLY)
#define ASM_SYM_FOR_FUNC(a) __asm__(a)
#define ASM_SYM(a) __asm__(a)
#else
#define ASM_SYM_FOR_FUNC(a)
#define ASM_SYM(a)
#endif
#ifndef REGPARAM
@ -307,4 +329,8 @@ static inline uae_u32 do_byteswap_16_g(uae_u32 v)
#endif
#define REGPARAM2
#ifdef _MSC_VER
#define ATTRIBUTE_PACKED
#endif
#endif

View File

@ -20,9 +20,6 @@
#include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "main.h"
#include "macos_util.h"
#include "timer.h"
@ -169,9 +166,9 @@ int32 timer_host2mac_time(tm_time_t hosttime)
else {
uint64 t = TICKS2USECS(hosttime);
if (t > 0x7fffffff)
return t / 1000; // Time in milliseconds
return int32(t / 1000); // Time in milliseconds
else
return -t; // Time in negative microseconds
return -int32(t); // Time in negative microseconds
}
}

View File

@ -21,9 +21,6 @@
#include "sysdeps.h"
#include "user_strings.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// Platform-specific string definitions
user_string_def platform_strings[] = {
@ -91,7 +88,7 @@ static const char *get_volume_name(void)
// Try Windows 2000 key first
if (ERROR_SUCCESS == RegOpenKey(
HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"),
&hHelpKey))
{
cbData = sizeof(volume);
@ -102,7 +99,7 @@ static const char *get_volume_name(void)
if (volume[0] == 0 &&
ERROR_SUCCESS == RegOpenKey(
HKEY_CURRENT_USER,
"Software\\Classes\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
TEXT("Software\\Classes\\CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"),
&hHelpKey))
{
cbData = sizeof(volume);
@ -113,7 +110,7 @@ static const char *get_volume_name(void)
if (volume[0] == 0 &&
ERROR_SUCCESS == RegOpenKey(
HKEY_CLASSES_ROOT,
"CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
TEXT("CLSID\\{20D04FE0-3AEA-1069-A2D8-08002B30309D}"),
&hHelpKey))
{
cbData = sizeof(volume);
@ -122,7 +119,7 @@ static const char *get_volume_name(void)
}
// Fix the error that some "tweak" apps do.
if (stricmp(volume, "%USERNAME% on %COMPUTER%") == 0)
if (_stricmp(volume, "%USERNAME% on %COMPUTER%") == 0)
volume[0] = '\0';
// No volume name found, default to "My Computer"
@ -162,3 +159,21 @@ const char *GetString(int num)
}
return NULL;
}
/*
* Convert text to wide string, given the string number
*/
std::unique_ptr<wchar_t[]> GetStringW(int num)
{
auto str = GetString(num);
if (str == nullptr)
return nullptr;
auto length = MultiByteToWideChar(CP_ACP, 0, str, -1, nullptr, 0);
if (length == 0)
return nullptr;
auto p = std::unique_ptr<wchar_t[]>(new wchar_t[length]);
MultiByteToWideChar(CP_ACP, 0, str, -1, p.get(), length);
return p;
}

View File

@ -1,5 +1,5 @@
/*
* user_strings_unix.h - Unix-specific localizable strings
* user_strings_windows.h - Windows-specific localizable strings
*
* Basilisk II (C) 1997-2008 Christian Bauer
*
@ -18,8 +18,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef USER_STRINGS_UNIX_H
#define USER_STRINGS_UNIX_H
#ifndef USER_STRINGS_WINDOWS_H
#define USER_STRINGS_WINDOWS_H
#ifdef __cplusplus
#if __cplusplus >= 201103L || _MSC_VER >= 1600
#include <memory>
// Convert text to wide string, given the string number
extern std::unique_ptr<wchar_t[]> GetStringW(int num);
#endif
#endif
enum {
STR_NO_XVISUAL_ERR = 10000,

View File

@ -23,27 +23,159 @@
#include "sysdeps.h"
#include "util_windows.h"
#include "main.h"
#include <io.h>
#include <fcntl.h>
#include <list>
using std::list;
#include <string>
using std::string;
using std::wstring;
typedef std::basic_string<TCHAR> tstring;
BOOL exists( const char *path )
std::unique_ptr<char[]> str(const wchar_t* s)
{
auto length = WideCharToMultiByte(CP_ACP, 0, s, -1, nullptr, 0, nullptr, nullptr);
if (length == -1)
return nullptr;
std::unique_ptr<char[]> p(new char[length]);
WideCharToMultiByte(CP_ACP, 0, s, -1, p.get(), length, nullptr, nullptr);
return p;
}
std::unique_ptr<wchar_t[]> wstr(const char* s)
{
auto length = MultiByteToWideChar(CP_ACP, 0, s, -1, nullptr, 0);
if (length == -1)
return nullptr;
std::unique_ptr<wchar_t[]> p(new wchar_t[length]);
MultiByteToWideChar(CP_ACP, 0, s, -1, p.get(), length);
return p;
}
string to_string(const wchar_t* s)
{
auto wlen = wcslen(s); // length without null terminator
auto len = WideCharToMultiByte(CP_ACP, 0, s, wlen, nullptr, 0, nullptr, nullptr);
if (len == -1)
return string();
string str(len, '\0');
WideCharToMultiByte(CP_ACP, 0, s, wlen, &str.front(), len, nullptr, nullptr);
return str;
}
wstring to_wstring(const char* s)
{
auto len = strlen(s); // length without null terminator
auto wlen = MultiByteToWideChar(CP_ACP, 0, s, len, nullptr, 0);
if (len == -1)
return wstring();
wstring str(wlen, L'\0');
MultiByteToWideChar(CP_ACP, 0, s, len, &str.front(), wlen);
return str;
}
size_t strlcpy(char* dst, const char* src, size_t size)
{
size_t length = strlen(src);
if (size-- > 0) {
if (length < size)
size = length;
memcpy(dst, src, size);
dst[size] = '\0';
}
return length;
}
size_t strlcpy(char* dst, const wchar_t* src, size_t size)
{
size_t length = WideCharToMultiByte(CP_ACP, 0, src, -1, dst, size, nullptr, nullptr);
if (size > 0) {
if (length == 0)
return strlcpy(dst, str(src).get(), size);
--length;
}
return length;
}
size_t strlcat(char* dst, const char* src, size_t size)
{
char* end = static_cast<char*>(memchr(dst, '\0', size));
if (end == nullptr)
return size;
size_t length = end - dst;
return length + strlcpy(end, src, size - length);
}
size_t strlcat(char* dst, const wchar_t* src, size_t size)
{
char* end = static_cast<char*>(memchr(dst, '\0', size));
if (end == nullptr)
return size;
size_t length = end - dst;
return length + strlcpy(end, src, size - length);
}
size_t wcslcpy(wchar_t* dst, const wchar_t* src, size_t size)
{
size_t length = wcslen(src);
if (size-- > 0) {
if (length < size)
size = length;
wmemcpy(dst, src, size);
dst[size] = '\0';
}
return length;
}
size_t wcslcpy(wchar_t* dst, const char* src, size_t size)
{
size_t length = MultiByteToWideChar(CP_ACP, 0, src, -1, dst, size);
if (size > 0) {
if (length == 0)
return wcslcpy(dst, wstr(src).get(), size);
--length;
}
return length;
}
size_t wcslcat(wchar_t* dst, const wchar_t* src, size_t size)
{
wchar_t* end = wmemchr(dst, L'\0', size);
if (end == nullptr)
return size;
size_t length = end - dst;
return length + wcslcpy(end, src, size - length);
}
size_t wcslcat(wchar_t* dst, const char* src, size_t size)
{
wchar_t* end = wmemchr(dst, L'\0', size);
if (end == nullptr)
return size;
size_t length = end - dst;
return length + wcslcpy(end, src, size - length);
}
BOOL exists( const TCHAR *path )
{
HFILE h;
bool ret = false;
h = _lopen( path, OF_READ );
if(h != HFILE_ERROR) {
h = _topen( path, _O_RDONLY | _O_BINARY );
if(h != -1) {
ret = true;
_lclose(h);
_close(h);
}
return(ret);
}
BOOL create_file( const char *path, DWORD size )
BOOL create_file( const TCHAR *path, DWORD size )
{
HANDLE h;
bool ok = false;
@ -78,7 +210,7 @@ BOOL create_file( const char *path, DWORD size )
return(ok);
}
int32 get_file_size( const char *path )
int32 get_file_size( const TCHAR *path )
{
HANDLE h;
DWORD size = 0;
@ -123,22 +255,22 @@ void kill_thread(HANDLE thread)
bool check_drivers(void)
{
char path[_MAX_PATH];
GetSystemDirectory(path, sizeof(path));
strcat(path, "\\drivers\\cdenable.sys");
TCHAR path[_MAX_PATH];
GetSystemDirectory(path, lengthof(path));
_tcscat(path, TEXT("\\drivers\\cdenable.sys"));
if (exists(path)) {
int32 size = get_file_size(path);
if (size != 6112) {
char str[256];
sprintf(str, "The CD-ROM driver file \"%s\" is too old or corrupted.", path);
TCHAR str[256];
_sntprintf(str, lengthof(str), TEXT("The CD-ROM driver file \"%s\" is too old or corrupted."), path);
ErrorAlert(str);
return false;
}
}
else {
char str[256];
sprintf(str, "The CD-ROM driver file \"%s\" is missing.", path);
TCHAR str[256];
_sntprintf(str, lengthof(str), TEXT("The CD-ROM driver file \"%s\" is missing."), path);
WarningAlert(str);
}
@ -151,15 +283,15 @@ bool check_drivers(void)
*/
struct panel_reg {
string name;
string guid;
tstring name;
tstring guid;
};
static list<panel_reg> network_registry;
typedef list<panel_reg>::const_iterator network_registry_iterator;
#define NETWORK_CONNECTIONS_KEY \
"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
TEXT("SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}")
static void get_network_registry(void)
{
@ -182,14 +314,14 @@ static void get_network_registry(void)
return;
while (true) {
char enum_name[256];
char connection_string[256];
TCHAR enum_name[256];
TCHAR connection_string[256];
HKEY connection_key;
char name_data[256];
TCHAR name_data[256];
DWORD name_type;
const char name_string[] = "Name";
const TCHAR name_string[] = TEXT("Name");
len = sizeof (enum_name);
len = lengthof(enum_name);
status = RegEnumKeyEx(
network_connections_key,
i,
@ -202,8 +334,8 @@ static void get_network_registry(void)
if (status != ERROR_SUCCESS)
break;
snprintf (connection_string, sizeof(connection_string),
"%s\\%s\\Connection",
_sntprintf (connection_string, lengthof(connection_string),
TEXT("%s\\%s\\Connection"),
NETWORK_CONNECTIONS_KEY, enum_name);
status = RegOpenKeyEx(
@ -214,7 +346,7 @@ static void get_network_registry(void)
&connection_key);
if (status == ERROR_SUCCESS) {
len = sizeof (name_data);
len = lengthof(name_data);
status = RegQueryValueEx(
connection_key,
name_string,
@ -237,24 +369,24 @@ static void get_network_registry(void)
RegCloseKey (network_connections_key);
}
const char *ether_name_to_guid(const char *name)
const TCHAR *ether_name_to_guid(const TCHAR *name)
{
get_network_registry();
for (network_registry_iterator it = network_registry.begin(); it != network_registry.end(); it++) {
if (strcmp((*it).name.c_str(), name) == 0)
if (_tcscmp((*it).name.c_str(), name) == 0)
return (*it).guid.c_str();
}
return NULL;
}
const char *ether_guid_to_name(const char *guid)
const TCHAR *ether_guid_to_name(const TCHAR *guid)
{
get_network_registry();
for (network_registry_iterator it = network_registry.begin(); it != network_registry.end(); it++) {
if (strcmp((*it).guid.c_str(), guid) == 0)
if (_tcscmp((*it).guid.c_str(), guid) == 0)
return (*it).name.c_str();
}
@ -266,11 +398,11 @@ const char *ether_guid_to_name(const char *guid)
* Get TAP-Win32 adapters
*/
#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
#define ADAPTER_KEY TEXT("SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}")
#define TAP_COMPONENT_ID "tap0801"
#define TAP_COMPONENT_ID TEXT("tap0801")
const char *ether_tap_devices(void)
const TCHAR *ether_tap_devices(void)
{
HKEY adapter_key;
LONG status;
@ -287,19 +419,19 @@ const char *ether_tap_devices(void)
if (status != ERROR_SUCCESS)
return NULL;
list<string> devices;
list<tstring> devices;
while (true) {
char enum_name[256];
char unit_string[256];
TCHAR enum_name[256];
TCHAR unit_string[256];
HKEY unit_key;
char component_id_string[] = "ComponentId";
char component_id[256];
char net_cfg_instance_id_string[] = "NetCfgInstanceId";
char net_cfg_instance_id[256];
TCHAR component_id_string[] = TEXT("ComponentId");
TCHAR component_id[256];
TCHAR net_cfg_instance_id_string[] = TEXT("NetCfgInstanceId");
TCHAR net_cfg_instance_id[256];
DWORD data_type;
len = sizeof (enum_name);
len = lengthof(enum_name);
status = RegEnumKeyEx(
adapter_key,
i,
@ -312,7 +444,7 @@ const char *ether_tap_devices(void)
if (status != ERROR_SUCCESS)
break;
snprintf (unit_string, sizeof(unit_string), "%s\\%s",
_sntprintf (unit_string, lengthof(unit_string), TEXT("%s\\%s"),
ADAPTER_KEY, enum_name);
status = RegOpenKeyEx(
@ -323,7 +455,7 @@ const char *ether_tap_devices(void)
&unit_key);
if (status == ERROR_SUCCESS) {
len = sizeof (component_id);
len = lengthof(component_id);
status = RegQueryValueEx(
unit_key,
component_id_string,
@ -333,7 +465,7 @@ const char *ether_tap_devices(void)
&len);
if (status == ERROR_SUCCESS && data_type == REG_SZ) {
len = sizeof (net_cfg_instance_id);
len = lengthof(net_cfg_instance_id);
status = RegQueryValueEx(
unit_key,
net_cfg_instance_id_string,
@ -343,7 +475,7 @@ const char *ether_tap_devices(void)
&len);
if (status == ERROR_SUCCESS && data_type == REG_SZ) {
if (!strcmp (component_id, TAP_COMPONENT_ID))
if (!_tcscmp (component_id, TAP_COMPONENT_ID))
devices.push_back(net_cfg_instance_id);
}
}
@ -358,17 +490,17 @@ const char *ether_tap_devices(void)
return NULL;
// The result is a '\0' separated list of strings
list<string>::const_iterator it;
list<tstring>::const_iterator it;
len = 0;
for (it = devices.begin(); it != devices.end(); it++)
len += (*it).length() + 1;
char *names = (char *)malloc(len);
TCHAR *names = (TCHAR *)malloc(len * sizeof(TCHAR));
if (names) {
char *p = names;
TCHAR *p = names;
for (it = devices.begin(); it != devices.end(); it++) {
len = (*it).length();
strcpy(p, (*it).c_str());
_tcscpy(p, (*it).c_str());
p[len] = '\0';
p += len + 1;
}

View File

@ -23,9 +23,12 @@
#ifndef _UTIL_WINDOWS_H
#define _UTIL_WINDOWS_H
BOOL exists( const char *path );
int32 get_file_size( const char *path );
BOOL create_file( const char *path, DWORD size );
#include <memory>
#include <string>
BOOL exists( const TCHAR *path );
int32 get_file_size( const TCHAR *path );
BOOL create_file( const TCHAR *path, DWORD size );
bool check_drivers(void);
// Thread wrappers
@ -44,10 +47,79 @@ class mutex_t {
};
// Network control panel helpers
extern const char *ether_name_to_guid(const char *name);
extern const char *ether_guid_to_name(const char *guid);
extern const TCHAR *ether_name_to_guid(const TCHAR *name);
extern const TCHAR *ether_guid_to_name(const TCHAR *guid);
// Get TAP-Win32 devices (caller free()s returned buffer)
extern const char *ether_tap_devices(void);
extern const TCHAR *ether_tap_devices(void);
// Wide string versions of commonly used functions
extern void ErrorAlert(const wchar_t *text);
extern void WarningAlert(const wchar_t *text);
// ----------------- String conversion functions -----------------
// Null deleter -- does nothing. Allows returning a non-owning
// unique_ptr. This should go away if observer_ptr makes it into
// the standard.
template <class T> struct null_delete {
constexpr null_delete() noexcept = default;
template <class U> null_delete(const null_delete<U>&) noexcept { }
void operator ()(T*) const noexcept { }
};
template <class T> struct null_delete<T[]> {
constexpr null_delete() noexcept = default;
void operator ()(T*) const noexcept { }
template <class U> void operator ()(U*) const = delete;
};
// Functions returning null-terminated C strings
std::unique_ptr<char[]> str(const wchar_t* s);
std::unique_ptr<wchar_t[]> wstr(const char* s);
inline std::unique_ptr<const char[], null_delete<const char[]>> str(const char* s)
{
return std::unique_ptr<const char[], null_delete<const char[]>>(s);
}
inline std::unique_ptr<const wchar_t[], null_delete<const wchar_t[]>> wstr(const wchar_t* s)
{
return std::unique_ptr<const wchar_t[], null_delete<const wchar_t[]>>(s);
}
#ifdef _UNICODE
#define tstr wstr
#else
#define tstr str
#endif
// Functions returning std::strings
std::string to_string(const wchar_t* s);
std::wstring to_wstring(const char* s);
inline std::string to_string(const char* s) { return std::string(s); }
inline std::wstring to_wstring(const wchar_t* s) { return std::wstring(s); }
#ifdef _UNICODE
#define to_tstring to_wstring
#else
#define to_tstring to_string
#endif
// BSD strlcpy/strlcat with overloads for converting between wide and narrow strings
size_t strlcpy(char* dst, const char* src, size_t size);
size_t strlcpy(char* dst, const wchar_t* src, size_t size);
size_t strlcat(char* dst, const char* src, size_t size);
size_t strlcat(char* dst, const wchar_t* src, size_t size);
size_t wcslcpy(wchar_t* dst, const wchar_t* src, size_t size);
size_t wcslcpy(wchar_t* dst, const char* src, size_t size);
size_t wcslcat(wchar_t* dst, const wchar_t* src, size_t size);
size_t wcslcat(wchar_t* dst, const char* src, size_t size);
#ifdef _UNICODE
#define tcslcpy wcslcpy
#define tcslcat wcslcat
#else
#define tcslcpy strlcpy
#define tcslcat strlcat
#endif
#endif // _UTIL_WINDOWS_H

View File

@ -20,22 +20,19 @@
#include "sysdeps.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <string>
using std::string;
typedef std::basic_string<TCHAR> tstring;
#include "xpram.h"
// XPRAM file name and path
#if POWERPC_ROM
const char XPRAM_FILE_NAME[] = "SheepShaver_nvram.dat";
const TCHAR XPRAM_FILE_NAME[] = TEXT("SheepShaver_nvram.dat");
#else
const char XPRAM_FILE_NAME[] = "BasiliskII_xpram.dat";
const TCHAR XPRAM_FILE_NAME[] = TEXT("BasiliskII_xpram.dat");
#endif
static string xpram_path;
static tstring xpram_path;
/*
@ -46,9 +43,9 @@ static void build_xpram_path(void)
{
xpram_path.clear();
int pwd_len = GetCurrentDirectory(0, NULL);
char *pwd = new char[pwd_len];
TCHAR *pwd = new TCHAR[pwd_len];
if (GetCurrentDirectory(pwd_len, pwd) == pwd_len - 1)
xpram_path = string(pwd) + '\\';
xpram_path = tstring(pwd) + TEXT('\\');
delete[] pwd;
xpram_path += XPRAM_FILE_NAME;
}

View File

@ -340,7 +340,7 @@ void ADBInterrupt(void)
int my = mouse_y;
if (relative_mouse)
mouse_x = mouse_y = 0;
int mb[3] = {mouse_button[0], mouse_button[1], mouse_button[2]};
bool mb[3] = {mouse_button[0], mouse_button[1], mouse_button[2]};
B2_unlock_mutex(mouse_lock);
uint32 key_base = adb_base + 4;

View File

@ -39,7 +39,7 @@
// Supported sample rates, sizes and channels
vector<uint32> audio_sample_rates;
vector<uint16> audio_sample_sizes;
vector<uint16> audio_channel_counts;
vector<uint8> audio_channel_counts;
// Global variables
struct audio_status AudioStatus; // Current audio status (sample rate etc.)
@ -233,7 +233,7 @@ static int32 AudioSetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
return badChannel;
case siSpeakerMute:
audio_set_speaker_mute((uint16)infoPtr);
audio_set_speaker_mute(uint16(infoPtr) != 0);
break;
case siSpeakerVolume:
@ -242,7 +242,7 @@ static int32 AudioSetInfo(uint32 infoPtr, uint32 selector, uint32 sourceID)
break;
case siHardwareMute:
audio_set_main_mute((uint16)infoPtr);
audio_set_main_mute(uint16(infoPtr) != 0);
break;
case siHardwareVolume:

View File

@ -557,7 +557,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
}
case 76: // ModifyPostEvent
info->mount_non_hfs = ReadMacInt16(pb + csParam);
info->mount_non_hfs = ReadMacInt16(pb + csParam) != 0;
return noErr;
case 79: { // Change block size
@ -792,7 +792,7 @@ int16 CDROMControl(uint32 pb, uint32 dce)
if (!position2msf(*info, ReadMacInt16(pb + csParam), ReadMacInt32(pb + csParam + 2), false, start_m, start_s, start_f))
return paramErr;
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6))) {
if (!SysCDScan(info->fh, start_m, start_s, start_f, ReadMacInt16(pb + csParam + 6) != 0)) {
return paramErr;
} else {
return noErr;
@ -944,7 +944,7 @@ int16 CDROMStatus(uint32 pb, uint32 dce)
if (ReadMacInt16(pb + csParam) > 0) {
uint32 adr = ReadMacInt32(pb + csParam + 2);
WriteMacInt16(pb + csParam, 1); // 1 format
WriteMacInt32(adr, SysGetFileSize(info->fh) / 512); // Number of blocks
WriteMacInt32(adr, uint32(SysGetFileSize(info->fh) / 512)); // Number of blocks
WriteMacInt32(adr + 4, 0); // heads/track/sectors
return noErr;
} else {

View File

@ -200,7 +200,7 @@ bool DiskMountVolume(void *fh)
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0xff : 0);
find_hfs_partition(*info);
if (info->start_byte == 0)
info->num_blocks = SysGetFileSize(info->fh) / 512;
info->num_blocks = uint32(SysGetFileSize(info->fh) / 512);
WriteMacInt16(info->status + dsDriveSize, info->num_blocks & 0xffff);
WriteMacInt16(info->status + dsDriveS1, info->num_blocks >> 16);
info->to_be_mounted = true;
@ -288,7 +288,7 @@ int16 DiskOpen(uint32 pb, uint32 dce)
WriteMacInt8(info->status + dsWriteProt, info->read_only ? 0x80 : 0);
find_hfs_partition(*info);
if (info->start_byte == 0)
info->num_blocks = SysGetFileSize(info->fh) / 512;
info->num_blocks = uint32(SysGetFileSize(info->fh) / 512);
info->to_be_mounted = true;
}
D(bug(" %d blocks\n", info->num_blocks));

View File

@ -19,6 +19,7 @@
*/
#include "sysdeps.h"
#include "main.h"
#include "scsi.h"
#define DEBUG 0

View File

@ -111,7 +111,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
}
case M68K_EMUL_OP_CLKNOMEM: { // Clock/PRAM operations
bool is_read = r->d[1] & 0x80;
bool is_read = (r->d[1] & 0x80) != 0;
if ((r->d[1] & 0x78) == 0x38) {
// XPRAM
uint8 reg = (r->d[1] << 5) & 0xe0 | (r->d[1] >> 10) & 0x1f;

View File

@ -334,7 +334,7 @@ static void pstrcpy(char *dst, const char *src)
// Convert C string to pascal string
static void cstr2pstr(char *dst, const char *src)
{
*dst++ = strlen(src);
*dst++ = char(strlen(src));
char c;
while ((c = *src++) != 0) {
// Note: we are converting host ':' characters to Mac '/' characters here
@ -2158,7 +2158,7 @@ static int16 fs_get_wd_info(uint32 pb, uint32 vcb)
int16 ExtFSHFS(uint32 vcb, uint16 selectCode, uint32 paramBlock, uint32 globalsPtr, int16 fsid)
{
uint16 trapWord = selectCode & 0xf0ff;
bool hfs = selectCode & kHFSMask;
bool hfs = (selectCode & kHFSMask) != 0;
switch (trapWord) {
case kFSMOpen:
return fs_open(paramBlock, hfs ? ReadMacInt32(paramBlock + ioDirID) : 0, vcb, false);

View File

@ -76,7 +76,7 @@ extern uint32 audio_component_flags; // Component feature flags
extern vector<uint32> audio_sample_rates; // Vector of supported sample rates (16.16 fixed point)
extern vector<uint16> audio_sample_sizes; // Vector of supported sample sizes
extern vector<uint16> audio_channel_counts; // Array of supported channels counts
extern vector<uint8> audio_channel_counts; // Array of supported channels counts
// Audio component global data and 68k routines
enum {

View File

@ -30,24 +30,62 @@
#include <sys/types.h>
#include <sys/timeb.h>
static void _cdecl inline winbug( char *s, ...)
static inline void _cdecl vwinbug(const char *s, va_list vargs)
{
va_list vargs;
char msg[1024], date[50], hours[50];
struct _timeb tstruct;
_ftime( &tstruct );
_strtime( hours );
_strdate( date );
sprintf( msg, "B2: %s %s:%03u ", date, hours, tstruct.millitm );
va_start( vargs, s );
vsprintf( &msg[strlen(msg)], s, vargs );
va_end( vargs );
_snprintf( msg, lengthof(msg), "B2: %s %s:%03u ", date, hours, tstruct.millitm );
OutputDebugString(msg);
char *rest = &msg[strlen(msg)];
_vsnprintf( rest, lengthof(msg) - (rest - msg), s, vargs );
OutputDebugStringA(msg);
}
static inline void _cdecl vwwinbug( const wchar_t *s, va_list vargs)
{
wchar_t msg[1024], date[50], hours[50];
struct _timeb tstruct;
_ftime( &tstruct );
_wstrtime( hours );
_wstrdate( date );
_snwprintf( msg, lengthof(msg), L"B2: %s %s:%03u ", date, hours, tstruct.millitm );
wchar_t *rest = &msg[wcslen(msg)];
_vsnwprintf( rest, lengthof(msg) - (rest - msg), s, vargs );
OutputDebugStringW(msg);
}
static inline void _cdecl winbug( const char *s, ...)
{
va_list vargs;
va_start(vargs, s);
vwinbug(s, vargs);
va_end(vargs);
}
static inline void _cdecl wwinbug(const wchar_t *s, ...)
{
va_list vargs;
va_start(vargs, s);
vwwinbug(s, vargs);
va_end(vargs);
}
#ifdef __cplusplus
static inline void _cdecl winbug(wchar_t *s, ...)
{
va_list vargs;
va_start(vargs, s);
vwwinbug(s, vargs);
va_end(vargs);
}
#endif
#define bug winbug
#define wbug wwinbug
#elif defined(AMIGA)

View File

@ -74,4 +74,15 @@ extern uint32 InterruptFlags; // Currently pending interrupts
extern void SetInterruptFlag(uint32 flag); // Set/clear interrupt flags
extern void ClearInterruptFlag(uint32 flag);
// Array length
#if __cplusplus >= 201103L || (_MSC_VER >= 1900 && defined __cplusplus)
template <typename T, size_t size>
constexpr size_t lengthof(T (& a)[size])
{
return size;
}
#else
#define lengthof(a) (sizeof(a) / sizeof(a[0]))
#endif
#endif

View File

@ -209,7 +209,7 @@ private:
bool allocate_gamma_table(int size);
// Set gamma table (0 = build linear ramp)
bool set_gamma_table(uint32 user_table);
int16 set_gamma_table(uint32 user_table);
// Switch video mode
void switch_mode(vector<video_mode>::const_iterator it, uint32 param, uint32 dce);

View File

@ -177,7 +177,7 @@ bool InitAll(const char *vmdir)
XPRAM[0x56] = 0x42; // 'B'
XPRAM[0x57] = 0x32; // '2'
const monitor_desc &main_monitor = *VideoMonitors[0];
XPRAM[0x58] = main_monitor.depth_to_apple_mode(main_monitor.get_current_mode().depth);
XPRAM[0x58] = uint8(main_monitor.depth_to_apple_mode(main_monitor.get_current_mode().depth));
XPRAM[0x59] = 0;
#if EMULATED_68K

View File

@ -115,7 +115,7 @@ struct bootp_t {
} PACKED__;
#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(0)
#pragma pack(PACK_RESET)
#endif
void bootp_input(struct mbuf *m);

View File

@ -16,8 +16,6 @@ int dostats = 0;
#endif
int slirp_debug = 0;
extern char *strerror _P((int));
/* Carry over one item from main.c so that the tty's restored.
* Only done when the tty being used is /dev/tty --RedWolf */
extern struct termios slirp_tty_settings;
@ -294,6 +292,7 @@ mbufstats()
void
sockstats()
{
char addr[INET_ADDRSTRLEN];
char buff[256];
int n;
struct socket *so;
@ -311,9 +310,11 @@ sockstats()
buff[17] = 0;
lprint("%s %3d %15s %5d ",
buff, so->s,
inet_ntoa(so->so_laddr), ntohs(so->so_lport));
inet_ntop(AF_INET, &so->so_laddr, addr, sizeof(addr)),
ntohs(so->so_lport));
lprint("%15s %5d %5d %5d\r\n",
inet_ntoa(so->so_faddr), ntohs(so->so_fport),
inet_ntop(AF_INET, &so->so_faddr, addr, sizeof(addr)),
ntohs(so->so_fport),
so->so_rcv.sb_cc, so->so_snd.sb_cc);
}
@ -325,9 +326,11 @@ sockstats()
buff[17] = 0;
lprint("%s %3d %15s %5d ",
buff, so->s,
inet_ntoa(so->so_laddr), ntohs(so->so_lport));
inet_ntop(AF_INET, &so->so_laddr, addr, sizeof(addr)),
ntohs(so->so_lport));
lprint("%15s %5d %5d %5d\r\n",
inet_ntoa(so->so_faddr), ntohs(so->so_fport),
inet_ntop(AF_INET, &so->so_faddr, addr, sizeof(addr)),
ntohs(so->so_fport),
so->so_rcv.sb_cc, so->so_snd.sb_cc);
}
}

View File

@ -36,15 +36,15 @@ extern int slirp_debug;
#endif
void debug_init _P((char *, int));
//void ttystats _P((struct ttys *));
void allttystats _P((void));
void ipstats _P((void));
void vjstats _P((void));
void tcpstats _P((void));
void udpstats _P((void));
void icmpstats _P((void));
void mbufstats _P((void));
void sockstats _P((void));
void slirp_exit _P((int));
void debug_init(char *, int);
//void ttystats(struct ttys *);
void allttystats(void);
void ipstats(void);
void vjstats(void);
void tcpstats(void);
void udpstats(void);
void icmpstats(void);
void mbufstats(void);
void sockstats(void);
void slirp_exit(int);

View File

@ -7,11 +7,11 @@
#include <slirp.h>
int if_mtu, if_mru;
size_t if_mtu, if_mru;
int if_comp;
int if_maxlinkhdr;
int if_queued = 0; /* Number of packets queued so far */
int if_thresh = 10; /* Number of packets queued before we start sending
int if_queued = 0; /* Number of packets queued so far */
int if_thresh = 10; /* Number of packets queued before we start sending
* (to prevent allocing too many mbufs) */
struct mbuf if_fastq; /* fast queue (for interactive data) */
@ -116,7 +116,8 @@ if_input(ttyp)
DEBUG_MISC((dfd, " read %d bytes\n", if_n));
if (if_n <= 0) {
if (if_n == 0 || (errno != EINTR && errno != EAGAIN)) {
int error = WSAGetLastError();
if (if_n == 0 || (error != WSAEINTR && error != EAGAIN)) {
if (ttyp->up)
link_up--;
tty_detached(ttyp, 0);

View File

@ -15,8 +15,8 @@
/* Needed for FreeBSD */
#undef if_mtu
extern int if_mtu;
extern int if_mru; /* MTU and MRU */
extern size_t if_mtu;
extern size_t if_mru; /* MTU and MRU */
extern int if_comp; /* Flags for compression */
extern int if_maxlinkhdr;
extern int if_queued; /* Number of packets queued so far */

View File

@ -98,7 +98,7 @@ struct ip {
} PACKED__;
#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(0)
#pragma pack(PACK_RESET)
#endif
#define IP_MAXPACKET 65535 /* maximum packet size */
@ -168,7 +168,7 @@ struct ip_timestamp {
} PACKED__;
#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(0)
#pragma pack(PACK_RESET)
#endif
/* flag bits for ipt_flg */
@ -230,7 +230,7 @@ struct ipovly {
} PACKED__;
#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(0)
#pragma pack(PACK_RESET)
#endif
/*

View File

@ -223,9 +223,9 @@ icmp_error(msrc, type, code, minsize, message)
if(!msrc) goto end_error;
ip = mtod(msrc, struct ip *);
#if DEBUG
{ char bufa[20], bufb[20];
strcpy(bufa, inet_ntoa(ip->ip_src));
strcpy(bufb, inet_ntoa(ip->ip_dst));
{ char bufa[INET_ADDRSTRLEN], bufb[INET_ADDRSTRLEN];
inet_ntop(AF_INET, &ip->ip_src, bufa, sizeof(bufa));
inet_ntop(AF_INET, &ip->ip_dst, bufb, sizeof(bufb));
DEBUG_MISC((dfd, " %.16s to %.16s\n", bufa, bufb));
}
#endif
@ -244,7 +244,7 @@ icmp_error(msrc, type, code, minsize, message)
/* make a copy */
if(!(m=m_get())) goto end_error; /* get mbuf */
{ int new_m_size;
{ u_int new_m_size;
new_m_size=sizeof(struct ip )+ICMP_MINLEN+msrc->m_len+ICMP_MAXDATALEN;
if(new_m_size>m->m_size) m_inc(m, new_m_size);
}
@ -299,7 +299,7 @@ icmp_error(msrc, type, code, minsize, message)
/* fill in ip */
ip->ip_hl = hlen >> 2;
ip->ip_len = m->m_len;
ip->ip_len = (u_int16_t)m->m_len;
ip->ip_tos=((ip->ip_tos & 0x1E) | 0xC0); /* high priority for errors */

View File

@ -95,7 +95,7 @@ struct icmp {
} PACKED__;
#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(0)
#pragma pack(PACK_RESET)
#endif
/*
@ -161,8 +161,8 @@ struct icmp {
(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
void icmp_input _P((struct mbuf *, int));
void icmp_error _P((struct mbuf *, u_char, u_char, int, char *));
void icmp_reflect _P((struct mbuf *));
void icmp_input(struct mbuf *, int);
void icmp_error(struct mbuf *, u_char, u_char, int, char *);
void icmp_reflect(struct mbuf *);
#endif

View File

@ -68,7 +68,7 @@ ip_input(m)
struct mbuf *m;
{
register struct ip *ip;
int hlen;
u_int hlen;
DEBUG_CALL("ip_input");
DEBUG_ARG("m = %lx", (long)m);

View File

@ -55,8 +55,9 @@ ip_output(so, m0)
{
register struct ip *ip;
register struct mbuf *m = m0;
register int hlen = sizeof(struct ip );
int len, off, error = 0;
register u_int hlen = sizeof(struct ip);
u_int len, off;
int error = 0;
DEBUG_CALL("ip_output");
DEBUG_ARG("so = %lx", (long)so);
@ -128,7 +129,7 @@ ip_output(so, m0)
*/
m0 = m;
mhlen = sizeof (struct ip);
for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) {
for (off = hlen + len; off < ip->ip_len; off += len) {
register struct ip *mhip;
m = m_get();
if (m == 0) {
@ -173,7 +174,7 @@ ip_output(so, m0)
* and updating header, then send each fragment (in order).
*/
m = m0;
m_adj(m, hlen + firstlen - (u_int16_t)ip->ip_len);
m_adj(m, hlen + firstlen - ip->ip_len);
ip->ip_len = htons((u_int16_t)m->m_len);
ip->ip_off = htons((u_int16_t)(ip->ip_off | IP_MF));
ip->ip_sum = 0;

View File

@ -24,18 +24,16 @@ int mbuf_alloced = 0;
struct mbuf m_freelist, m_usedlist;
int mbuf_thresh = 30;
int mbuf_max = 0;
int msize;
size_t msize;
void
m_init()
void m_init()
{
m_freelist.m_next = m_freelist.m_prev = &m_freelist;
m_usedlist.m_next = m_usedlist.m_prev = &m_usedlist;
msize_init();
}
void
msize_init()
void msize_init()
{
/*
* Find a nice value for msize
@ -53,8 +51,7 @@ msize_init()
* free old mbufs, we mark all mbufs above mbuf_thresh as M_DOFREE,
* which tells m_free to actually free() it
*/
struct mbuf *
m_get()
struct mbuf *m_get()
{
register struct mbuf *m;
int flags = 0;
@ -89,9 +86,7 @@ end_error:
return m;
}
void
m_free(m)
struct mbuf *m;
void m_free(struct mbuf *m)
{
DEBUG_CALL("m_free");
@ -124,9 +119,7 @@ m_free(m)
* the other.. if result is too big for one mbuf, malloc()
* an M_EXT data segment
*/
void
m_cat(m, n)
register struct mbuf *m, *n;
void m_cat(register struct mbuf *m, register struct mbuf *n)
{
/*
* If there's no room, realloc
@ -142,10 +135,7 @@ m_cat(m, n)
/* make m size bytes large */
void
m_inc(m, size)
struct mbuf *m;
int size;
void m_inc(struct mbuf *m, u_int size)
{
int datasize;
@ -179,10 +169,7 @@ m_inc(m, size)
void
m_adj(m, len)
struct mbuf *m;
int len;
void m_adj(struct mbuf *m, int len)
{
if (m == NULL)
return;
@ -202,9 +189,7 @@ m_adj(m, len)
* Copy len bytes from m, starting off bytes into n
*/
int
m_copy(n, m, off, len)
struct mbuf *n, *m;
int off, len;
m_copy(struct mbuf *n, struct mbuf *m, u_int off, u_int len)
{
if (len > M_FREEROOM(n))
return -1;
@ -220,9 +205,7 @@ m_copy(n, m, off, len)
* XXX This is a kludge, I should eliminate the need for it
* Fortunately, it's not used often
*/
struct mbuf *
dtom(dat)
void *dat;
struct mbuf *dtom(void *dat)
{
struct mbuf *m;

View File

@ -63,11 +63,11 @@ struct m_hdr {
struct mbuf *mh_prevpkt; /* Flags aren't used in the output queue */
int mh_flags; /* Misc flags */
int mh_size; /* Size of data */
size_t mh_size; /* Size of data */
struct socket *mh_so;
caddr_t mh_data; /* Location of data */
int mh_len; /* Amount of data in this mbuf */
size_t mh_len; /* Amount of data in this mbuf */
};
/*
@ -130,14 +130,14 @@ extern int mbuf_alloced;
extern struct mbuf m_freelist, m_usedlist;
extern int mbuf_max;
void m_init _P((void));
void msize_init _P((void));
struct mbuf * m_get _P((void));
void m_free _P((struct mbuf *));
void m_cat _P((register struct mbuf *, register struct mbuf *));
void m_inc _P((struct mbuf *, int));
void m_adj _P((struct mbuf *, int));
int m_copy _P((struct mbuf *, struct mbuf *, int, int));
struct mbuf * dtom _P((void *));
void m_init(void);
void msize_init(void);
struct mbuf * m_get(void);
void m_free(struct mbuf *);
void m_cat(register struct mbuf *, register struct mbuf *);
void m_inc(struct mbuf *, u_int);
void m_adj(struct mbuf *, int);
int m_copy(struct mbuf *, struct mbuf *, u_int, u_int);
struct mbuf * dtom(void *);
#endif

View File

@ -17,10 +17,7 @@ int x_port = -1;
int x_display = 0;
int x_screen = 0;
int
show_x(buff, inso)
char *buff;
struct socket *inso;
int show_x(char *buff, struct socket *inso)
{
if (x_port < 0) {
lprint("X Redir: X not being redirected.\r\n");
@ -40,12 +37,7 @@ show_x(buff, inso)
/*
* XXX Allow more than one X redirection?
*/
void
redir_x(inaddr, start_port, display, screen)
u_int32_t inaddr;
int start_port;
int display;
int screen;
void redir_x(u_int32_t inaddr, int start_port, int display, int screen)
{
int i;
@ -69,34 +61,34 @@ redir_x(inaddr, start_port, display, screen)
#endif
#ifndef HAVE_INET_ATON
int
inet_aton(cp, ia)
const char *cp;
struct in_addr *ia;
int inet_aton(const char *cp, struct in_addr *ia)
{
u_int32_t addr = inet_addr(cp);
if (addr == 0xffffffff)
return 0;
ia->s_addr = addr;
return 1;
return inet_pton(AF_INET, cp, &ia->s_addr);
}
#endif
/*
* Get our IP address and put it in our_addr
*/
void
getouraddr()
void getouraddr()
{
char buff[256];
struct hostent *he = NULL;
if (gethostname(buff,256) == 0)
he = gethostbyname(buff);
if (he)
our_addr = *(struct in_addr *)he->h_addr;
if (our_addr.s_addr == 0)
our_addr.s_addr = loopback_addr.s_addr;
{
struct addrinfo hints = { 0 };
hints.ai_flags = AI_NUMERICHOST;
hints.ai_family = AF_INET;
struct addrinfo* ai;
if (getaddrinfo(buff, NULL, &hints, &ai) == 0)
{
our_addr = *(struct in_addr *)ai->ai_addr->sa_data;
freeaddrinfo(ai);
}
}
if (our_addr.s_addr == 0)
our_addr.s_addr = loopback_addr.s_addr;
}
#if SIZEOF_CHAR_P == 8
@ -106,10 +98,7 @@ struct quehead_32 {
u_int32_t qh_rlink;
};
inline void
insque_32(a, b)
void *a;
void *b;
inline void insque_32(void *a, void *b)
{
register struct quehead_32 *element = (struct quehead_32 *) a;
register struct quehead_32 *head = (struct quehead_32 *) b;
@ -120,9 +109,7 @@ insque_32(a, b)
= (u_int32_t)element;
}
inline void
remque_32(a)
void *a;
inline void remque_32(void *a)
{
register struct quehead_32 *element = (struct quehead_32 *) a;
((struct quehead_32 *)(element->qh_link))->qh_rlink = element->qh_rlink;
@ -137,9 +124,7 @@ struct quehead {
struct quehead *qh_rlink;
};
void
insque(a, b)
void *a, *b;
void insque(void *a, void *b)
{
register struct quehead *element = (struct quehead *) a;
register struct quehead *head = (struct quehead *) b;
@ -150,9 +135,7 @@ insque(a, b)
= (struct quehead *)element;
}
void
remque(a)
void *a;
void remque(void *a)
{
register struct quehead *element = (struct quehead *) a;
((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
@ -164,13 +147,7 @@ remque(a)
/* #endif */
int
add_exec(ex_ptr, do_pty, exec, addr, port)
struct ex_list **ex_ptr;
int do_pty;
char *exec;
int addr;
int port;
int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec, int addr, int port)
{
struct ex_list *tmp_ptr;
@ -199,9 +176,7 @@ add_exec(ex_ptr, do_pty, exec, addr, port)
extern int sys_nerr;
extern char *sys_errlist[];
char *
strerror(error)
int error;
char *strerror(int error)
{
if (error < sys_nerr)
return sys_errlist[error];
@ -214,11 +189,7 @@ strerror(error)
#ifdef _WIN32
int
fork_exec(so, ex, do_pty)
struct socket *so;
char *ex;
int do_pty;
int fork_exec(struct socket *so, char *ex, int do_pty)
{
/* not implemented */
return 0;
@ -226,9 +197,7 @@ fork_exec(so, ex, do_pty)
#else
int
slirp_openpty(amaster, aslave)
int *amaster, *aslave;
int slirp_openpty(int *amaster, int *aslave)
{
register int master, slave;
@ -302,11 +271,7 @@ slirp_openpty(amaster, aslave)
* do_pty = 1 Fork/exec using slirp.telnetd
* do_ptr = 2 Fork/exec using pty
*/
int
fork_exec(so, ex, do_pty)
struct socket *so;
char *ex;
int do_pty;
int fork_exec(struct socket *so, char *ex, int do_pty)
{
int s;
struct sockaddr_in addr;
@ -462,9 +427,7 @@ fork_exec(so, ex, do_pty)
#endif
#ifndef HAVE_STRDUP
char *
strdup(str)
const char *str;
char *strdup(const char *str)
{
char *bptr;
@ -476,9 +439,7 @@ strdup(str)
#endif
#if 0
void
snooze_hup(num)
int num;
void snooze_hup(int num)
{
int s, ret;
#ifndef NO_UNIX_SOCKETS
@ -518,8 +479,7 @@ snooze_hup(num)
}
void
snooze()
void snooze()
{
sigset_t s;
int i;
@ -543,9 +503,7 @@ snooze()
exit(255);
}
void
relay(s)
int s;
void relay(int s)
{
char buf[8192];
int n;
@ -605,25 +563,14 @@ relay(s)
}
#endif
int (*lprint_print) _P((void *, const char *, va_list));
int (*lprint_print)(void *, const char *, va_list);
char *lprint_ptr, *lprint_ptr2, **lprint_arg;
void
#ifdef __STDC__
lprint(const char *format, ...)
#else
lprint(va_alist) va_dcl
#endif
void lprint(const char *format, ...)
{
va_list args;
#ifdef __STDC__
va_start(args, format);
#else
char *format;
va_start(args);
format = va_arg(args, char *);
#endif
va_start(args, format);
#if 0
/* If we're printing to an sbuf, make sure there's enough room */
/* XXX +100? */
@ -672,9 +619,7 @@ lprint(va_alist) va_dcl
va_end(args);
}
void
add_emu(buff)
char *buff;
void add_emu(char *buff)
{
u_int lport, fport;
u_int8_t tos = 0, emu = 0;
@ -766,42 +711,24 @@ add_emu(buff)
* Some BSD-derived systems have a sprintf which returns char *
*/
int
vsprintf_len(string, format, args)
char *string;
const char *format;
va_list args;
int vsprintf_len(char *string, const char *format, va_list args)
{
vsprintf(string, format, args);
return strlen(string);
}
int
#ifdef __STDC__
sprintf_len(char *string, const char *format, ...)
#else
sprintf_len(va_alist) va_dcl
#endif
int sprintf_len(char *string, const char *format, ...)
{
va_list args;
#ifdef __STDC__
va_start(args, format);
#else
char *string;
char *format;
va_start(args);
string = va_arg(args, char *);
format = va_arg(args, char *);
#endif
vsprintf(string, format, args);
va_end(args);
return strlen(string);
}
#endif
void
u_sleep(usec)
int usec;
void u_sleep(int usec)
{
struct timeval t;
fd_set fdset;
@ -818,9 +745,7 @@ u_sleep(usec)
* Set fd blocking and non-blocking
*/
void
fd_nonblock(fd)
int fd;
void fd_nonblock(int fd)
{
#if defined USE_FIONBIO && defined FIONBIO
ioctlsockopt_t opt = 1;
@ -835,9 +760,7 @@ fd_nonblock(fd)
#endif
}
void
fd_block(fd)
int fd;
void fd_block(int fd)
{
#if defined USE_FIONBIO && defined FIONBIO
ioctlsockopt_t opt = 0;
@ -857,13 +780,8 @@ fd_block(fd)
/*
* invoke RSH
*/
int
rsh_exec(so,ns, user, host, args)
struct socket *so;
struct socket *ns;
char *user;
char *host;
char *args;
int rsh_exec(struct socket *so, struct socket *ns,
char *user, char *host, char *args)
{
int fd[2];
int fd0[2];

View File

@ -19,15 +19,15 @@ struct ex_list {
extern struct ex_list *exec_list;
extern u_int curtime, time_fasttimo, last_slowtimo, detach_time, detach_wait;
extern int (*lprint_print) _P((void *, const char *, va_list));
extern int (*lprint_print)(void *, const char *, va_list);
extern char *lprint_ptr, *lprint_ptr2, **lprint_arg;
extern struct sbuf *lprint_sb;
#ifndef HAVE_STRDUP
char *strdup _P((const char *));
char *strdup(const char *);
#endif
void do_wait _P((int));
void do_wait(int);
#define EMU_NONE 0x0
@ -67,21 +67,21 @@ extern struct emu_t *tcpemu;
extern int x_port, x_server, x_display;
int show_x _P((char *, struct socket *));
void redir_x _P((u_int32_t, int, int, int));
void getouraddr _P((void));
void slirp_insque _P((void *, void *));
void slirp_remque _P((void *));
int add_exec _P((struct ex_list **, int, char *, int, int));
int slirp_openpty _P((int *, int *));
int fork_exec _P((struct socket *, char *, int));
void snooze_hup _P((int));
void snooze _P((void));
void relay _P((int));
void add_emu _P((char *));
void u_sleep _P((int));
void fd_nonblock _P((int));
void fd_block _P((int));
int rsh_exec _P((struct socket *, struct socket *, char *, char *, char *));
int show_x(char *, struct socket *);
void redir_x(u_int32_t, int, int, int);
void getouraddr(void);
void slirp_insque(void *, void *);
void slirp_remque(void *);
int add_exec(struct ex_list **, int, char *, int, int);
int slirp_openpty(int *, int *);
int fork_exec(struct socket *, char *, int);
void snooze_hup(int);
void snooze(void);
void relay(int);
void add_emu(char *);
void u_sleep(int);
void fd_nonblock(int);
void fd_block(int);
int rsh_exec(struct socket *, struct socket *, char *, char *, char *);
#endif

View File

@ -16,17 +16,12 @@
* }
*/
void
sbfree(sb)
struct sbuf *sb;
void sbfree(struct sbuf *sb)
{
free(sb->sb_data);
}
void
sbdrop(sb, num)
struct sbuf *sb;
int num;
void sbdrop(struct sbuf *sb, u_int num)
{
/*
* We can only drop how much we have
@ -41,10 +36,7 @@ sbdrop(sb, num)
}
void
sbreserve(sb, size)
struct sbuf *sb;
int size;
void sbreserve(struct sbuf *sb, size_t size)
{
if (sb->sb_data) {
/* Already alloced, realloc if necessary */
@ -72,10 +64,7 @@ sbreserve(sb, size)
* this prevents an unnecessary copy of the data
* (the socket is non-blocking, so we won't hang)
*/
void
sbappend(so, m)
struct socket *so;
struct mbuf *m;
void sbappend(struct socket *so, struct mbuf *m)
{
int ret = 0;
@ -134,10 +123,7 @@ sbappend(so, m)
* Copy the data from m into sb
* The caller is responsible to make sure there's enough room
*/
void
sbappendsb(sb, m)
struct sbuf *sb;
struct mbuf *m;
void sbappendsb(struct sbuf *sb, struct mbuf *m)
{
int len, n, nn;
@ -173,12 +159,7 @@ sbappendsb(sb, m)
* Don't update the sbuf rptr, this will be
* done in sbdrop when the data is acked
*/
void
sbcopy(sb, off, len, to)
struct sbuf *sb;
int off;
int len;
char *to;
void sbcopy(struct sbuf *sb, u_int off, u_int len, char *to)
{
char *from;

View File

@ -8,6 +8,8 @@
#ifndef _SBUF_H_
#define _SBUF_H_
#include <stddef.h>
#define sbflush(sb) sbdrop((sb),(sb)->sb_cc)
#define sbspace(sb) ((sb)->sb_datalen - (sb)->sb_cc)
@ -21,11 +23,11 @@ struct sbuf {
char *sb_data; /* Actual data */
};
void sbfree _P((struct sbuf *));
void sbdrop _P((struct sbuf *, int));
void sbreserve _P((struct sbuf *, int));
void sbappend _P((struct socket *, struct mbuf *));
void sbappendsb _P((struct sbuf *, struct mbuf *));
void sbcopy _P((struct sbuf *, int, int, char *));
void sbfree(struct sbuf *);
void sbdrop(struct sbuf *, u_int);
void sbreserve(struct sbuf *, size_t);
void sbappend(struct socket *, struct mbuf *);
void sbappendsb(struct sbuf *, struct mbuf *);
void sbcopy(struct sbuf *, u_int, u_int, char *);
#endif

View File

@ -220,14 +220,14 @@ int slirp_select_fill(int *pnfds,
* See if we need a tcp_fasttimo
*/
if (time_fasttimo == 0 && so->so_tcpcb->t_flags & TF_DELACK)
time_fasttimo = curtime; /* Flag when we want a fasttimo */
time_fasttimo = curtime; /* Flag when we want a fasttimo */
/*
* NOFDREF can include still connecting to local-host,
* newly socreated() sockets etc. Don't want to select these.
*/
if (so->so_state & SS_NOFDREF || so->s == -1)
continue;
continue;
/*
* Set for reading sockets which are accepting
@ -346,18 +346,18 @@ int slirp_select_fill(int *pnfds,
void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds)
{
struct socket *so, *so_next;
int ret;
struct socket *so, *so_next;
int ret;
global_readfds = readfds;
global_writefds = writefds;
global_xfds = xfds;
global_readfds = readfds;
global_writefds = writefds;
global_xfds = xfds;
/* Update time */
updtime();
/*
* See if anything has timed out
* See if anything has timed out
*/
if (link_up) {
if (time_fasttimo && ((curtime - time_fasttimo) >= FAST_TIMO)) {
@ -370,7 +370,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds)
last_slowtimo = curtime;
}
}
/*
* Check sockets
*/
@ -380,21 +380,21 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds)
*/
for (so = tcb.so_next; so != &tcb; so = so_next) {
so_next = so->so_next;
/*
* FD_ISSET is meaningless on these sockets
* (and they can crash the program)
*/
if (so->so_state & SS_NOFDREF || so->s == -1)
continue;
continue;
/*
* Check for URG data
* This will soread as well, so no need to
* test for readfds below if this succeeds
*/
if (FD_ISSET(so->s, xfds))
sorecvoob(so);
sorecvoob(so);
/*
* Check sockets for reading
*/
@ -407,86 +407,92 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds)
continue;
} /* else */
ret = soread(so);
/* Output it if we read something */
if (ret > 0)
tcp_output(sototcpcb(so));
tcp_output(sototcpcb(so));
}
/*
* Check sockets for writing
*/
if (FD_ISSET(so->s, writefds)) {
/*
* Check for non-blocking, still-connecting sockets
*/
if (so->so_state & SS_ISFCONNECTING) {
/* Connected */
so->so_state &= ~SS_ISFCONNECTING;
ret = send(so->s, &ret, 0, 0);
if (ret < 0) {
/* XXXXX Must fix, zero bytes is a NOP */
if (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EINPROGRESS || errno == ENOTCONN)
continue;
/* else failed */
so->so_state = SS_NOFDREF;
}
/* else so->so_state &= ~SS_ISFCONNECTING; */
/*
* Continue tcp_input
*/
tcp_input((struct mbuf *)NULL, sizeof(struct ip), so);
/* continue; */
} else
ret = sowrite(so);
/*
* XXXXX If we wrote something (a lot), there
* could be a need for a window update.
* In the worst case, the remote will send
* a window probe to get things going again
*/
/*
* Check for non-blocking, still-connecting sockets
*/
if (so->so_state & SS_ISFCONNECTING) {
/* Connected */
so->so_state &= ~SS_ISFCONNECTING;
ret = send(so->s, (char*)&ret, 0, 0);
if (ret < 0) {
/* XXXXX Must fix, zero bytes is a NOP */
int error = WSAGetLastError();
if (error == EAGAIN || error == WSAEWOULDBLOCK ||
error == WSAEINPROGRESS || error == WSAENOTCONN)
continue;
/* else failed */
so->so_state = SS_NOFDREF;
}
/* else so->so_state &= ~SS_ISFCONNECTING; */
/*
* Continue tcp_input
*/
tcp_input((struct mbuf *)NULL, sizeof(struct ip), so);
/* continue; */
}
else
ret = sowrite(so);
/*
* XXXXX If we wrote something (a lot), there
* could be a need for a window update.
* In the worst case, the remote will send
* a window probe to get things going again
*/
}
/*
* Probe a still-connecting, non-blocking socket
* to check if it's still alive
*/
*/
#ifdef PROBE_CONN
if (so->so_state & SS_ISFCONNECTING) {
ret = recv(so->s, (char *)&ret, 0,0);
if (ret < 0) {
/* XXX */
if (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EINPROGRESS || errno == ENOTCONN)
continue; /* Still connecting, continue */
/* else failed */
so->so_state = SS_NOFDREF;
/* tcp_input will take care of it */
} else {
ret = send(so->s, &ret, 0,0);
if (ret < 0) {
/* XXX */
if (errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EINPROGRESS || errno == ENOTCONN)
continue;
/* else failed */
so->so_state = SS_NOFDREF;
} else
so->so_state &= ~SS_ISFCONNECTING;
}
tcp_input((struct mbuf *)NULL, sizeof(struct ip),so);
} /* SS_ISFCONNECTING */
ret = recv(so->s, (char *)&ret, 0, 0);
if (ret < 0) {
/* XXX */
int error = WSAGetLastError();
if (error == EAGAIN || error == WSAEWOULDBLOCK ||
error == WSAEINPROGRESS || error == WSAENOTCONN)
continue; /* Still connecting, continue */
/* else failed */
so->so_state = SS_NOFDREF;
/* tcp_input will take care of it */
}
else {
ret = send(so->s, &ret, 0, 0);
if (ret < 0) {
/* XXX */
int error = WSAGetLastError();
if (error == EAGAIN || error == WSAEWOULDBLOCK ||
error == WSAEINPROGRESS || error == WSAENOTCONN)
continue;
/* else failed */
so->so_state = SS_NOFDREF;
}
else
so->so_state &= ~SS_ISFCONNECTING;
}
tcp_input((struct mbuf *)NULL, sizeof(struct ip), so);
} /* SS_ISFCONNECTING */
#endif
}
}
/*
* Now UDP sockets.
* Incoming packets are sent straight away, they're not buffered.
@ -494,27 +500,27 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds)
*/
for (so = udb.so_next; so != &udb; so = so_next) {
so_next = so->so_next;
if (so->s != -1 && FD_ISSET(so->s, readfds)) {
sorecvfrom(so);
}
sorecvfrom(so);
}
}
}
}
/*
* See if we can start outputting
*/
if (if_queued && link_up)
if_start();
if_start();
/* clear global file descriptor sets.
* these reside on the stack in vl.c
* so they're unusable if we're not in
* slirp_select_fill or slirp_select_poll.
*/
global_readfds = NULL;
global_writefds = NULL;
global_xfds = NULL;
global_readfds = NULL;
global_writefds = NULL;
global_xfds = NULL;
}
#define ETH_ALEN 6

View File

@ -22,18 +22,12 @@ typedef char *caddr_t;
typedef int socklen_t;
typedef unsigned long ioctlsockopt_t;
# include <windows.h>
# include <winsock2.h>
# include <WS2tcpip.h>
# include <sys/timeb.h>
# include <iphlpapi.h>
# define USE_FIONBIO 1
# define EWOULDBLOCK WSAEWOULDBLOCK
# define EINPROGRESS WSAEINPROGRESS
# define ENOTCONN WSAENOTCONN
# define EHOSTUNREACH WSAEHOSTUNREACH
# define ENETUNREACH WSAENETUNREACH
# define ECONNREFUSED WSAECONNREFUSED
/* Basilisk II Router defines those */
# define udp_read_completion slirp_udp_read_completion
@ -41,6 +35,14 @@ typedef unsigned long ioctlsockopt_t;
# define init_udp slirp_init_udp
# define final_udp slirp_final_udp
#else
# define WSAGetLastError() (int)(errno)
# define WSASetLastError(e) (void)(errno = (e))
# define WSAEWOULDBLOCK EWOULDBLOCK
# define WSAEINPROGRESS EINPROGRESS
# define WSAENOTCONN ENOTCONN
# define WSAEHOSTUNREACH EHOSTUNREACH
# define WSAENETUNREACH ENETUNREACH
# define WSAECONNREFUSED ECONNREFUSED
typedef int ioctlsockopt_t;
# define ioctlsocket ioctl
# define closesocket(s) close(s)
@ -55,7 +57,9 @@ typedef int ioctlsockopt_t;
# include <stdint.h>
#endif
#ifndef _WIN32
#include <sys/time.h>
#endif
#ifdef NEED_TYPEDEFS
typedef char int8_t;
@ -125,17 +129,6 @@ typedef u_int32_t uint32;
#ifndef _WIN32
#include <sys/uio.h>
#endif
#ifndef _P
#ifndef NO_PROTOTYPES
# define _P(x) x
#else
# define _P(x) ()
#endif
#endif
#ifndef _WIN32
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
@ -146,20 +139,23 @@ typedef u_int32_t uint32;
/* Systems lacking strdup() definition in <string.h>. */
#if defined(ultrix)
char *strdup _P((const char *));
char *strdup(const char *);
#endif
/* Systems lacking malloc() definition in <stdlib.h>. */
#if defined(ultrix) || defined(hcx)
void *malloc _P((size_t arg));
void free _P((void *ptr));
void *malloc(size_t arg);
void free(void *ptr);
#endif
#ifndef HAVE_INET_ATON
int inet_aton _P((const char *cp, struct in_addr *ia));
int inet_aton(const char *cp, struct in_addr *ia);
#endif
#include <fcntl.h>
#ifdef _WIN32
#include <io.h>
#endif
#ifndef NO_UNIX_SOCKETS
#include <sys/un.h>
#endif
@ -191,11 +187,7 @@ int inet_aton _P((const char *cp, struct in_addr *ia));
#include <ppp/slirppp.h>
#endif
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <sys/stat.h>
@ -212,8 +204,13 @@ int inet_aton _P((const char *cp, struct in_addr *ia));
#if defined __GNUC__
#define PACKED__ __attribute__ ((packed))
#elif defined _MSC_VER
#define PRAGMA_PACK_SUPPORTED 1
#define PACK_RESET
#define PACKED__
#elif defined __sgi
#define PRAGMA_PACK_SUPPORTED 1
#define PACK_RESET 0
#define PACKED__
#else
#error "Packed attribute or pragma shall be supported"
@ -249,38 +246,38 @@ extern struct ttys *ttys_unit[MAX_INTERFACES];
#endif
#ifndef FULL_BOLT
void if_start _P((void));
void if_start(void);
#else
void if_start _P((struct ttys *));
void if_start(struct ttys *);
#endif
#ifdef BAD_SPRINTF
# define vsprintf vsprintf_len
# define sprintf sprintf_len
extern int vsprintf_len _P((char *, const char *, va_list));
extern int sprintf_len _P((char *, const char *, ...));
extern int vsprintf_len(char *, const char *, va_list);
extern int sprintf_len(char *, const char *, ...);
#endif
#ifdef DECLARE_SPRINTF
# ifndef BAD_SPRINTF
extern int vsprintf _P((char *, const char *, va_list));
extern int vsprintf(char *, const char *, va_list);
# endif
extern int vfprintf _P((FILE *, const char *, va_list));
extern int vfprintf(FILE *, const char *, va_list);
#endif
#ifndef HAVE_STRERROR
extern char *strerror _P((int error));
extern char *strerror(int error);
#endif
#ifndef HAVE_INDEX
char *index _P((const char *, int));
char *index(const char *, int);
#endif
#ifndef HAVE_GETHOSTID
long gethostid _P((void));
long gethostid(void);
#endif
void lprint _P((const char *, ...));
void lprint(const char *, ...);
extern int do_echo;
@ -288,8 +285,8 @@ extern int do_echo;
# define insque_32 insque
# define remque_32 remque
#else
extern inline void insque_32 _P((void *, void *));
extern inline void remque_32 _P((void *));
extern inline void insque_32(void *, void *);
extern inline void remque_32(void *);
#endif
#ifndef _WIN32
@ -302,47 +299,47 @@ extern int do_echo;
int cksum(struct mbuf *m, int len);
/* if.c */
void if_init _P((void));
void if_output _P((struct socket *, struct mbuf *));
void if_init(void);
void if_output(struct socket *, struct mbuf *);
/* ip_input.c */
void ip_init _P((void));
void ip_input _P((struct mbuf *));
struct ip * ip_reass _P((register struct ipasfrag *, register struct ipq *));
void ip_freef _P((struct ipq *));
void ip_enq _P((register struct ipasfrag *, register struct ipasfrag *));
void ip_deq _P((register struct ipasfrag *));
void ip_slowtimo _P((void));
void ip_stripoptions _P((register struct mbuf *, struct mbuf *));
void ip_init(void);
void ip_input(struct mbuf *);
struct ip * ip_reass(register struct ipasfrag *, register struct ipq *);
void ip_freef(struct ipq *);
void ip_enq(register struct ipasfrag *, register struct ipasfrag *);
void ip_deq(register struct ipasfrag *);
void ip_slowtimo(void);
void ip_stripoptions(register struct mbuf *, struct mbuf *);
/* ip_output.c */
int ip_output _P((struct socket *, struct mbuf *));
int ip_output(struct socket *, struct mbuf *);
/* tcp_input.c */
int tcp_reass _P((register struct tcpcb *, register struct tcpiphdr *, struct mbuf *));
void tcp_input _P((register struct mbuf *, int, struct socket *));
void tcp_dooptions _P((struct tcpcb *, u_char *, int, struct tcpiphdr *));
void tcp_xmit_timer _P((register struct tcpcb *, int));
int tcp_mss _P((register struct tcpcb *, u_int));
int tcp_reass(register struct tcpcb *, register struct tcpiphdr *, struct mbuf *);
void tcp_input(register struct mbuf *, int, struct socket *);
void tcp_dooptions(struct tcpcb *, u_char *, int, struct tcpiphdr *);
void tcp_xmit_timer(register struct tcpcb *, int);
u_int tcp_mss(register struct tcpcb *, u_int);
/* tcp_output.c */
int tcp_output _P((register struct tcpcb *));
void tcp_setpersist _P((register struct tcpcb *));
int tcp_output(register struct tcpcb *);
void tcp_setpersist(register struct tcpcb *);
/* tcp_subr.c */
void tcp_init _P((void));
void tcp_template _P((struct tcpcb *));
void tcp_respond _P((struct tcpcb *, register struct tcpiphdr *, register struct mbuf *, tcp_seq, tcp_seq, int));
struct tcpcb * tcp_newtcpcb _P((struct socket *));
struct tcpcb * tcp_close _P((register struct tcpcb *));
void tcp_drain _P((void));
void tcp_sockclosed _P((struct tcpcb *));
int tcp_fconnect _P((struct socket *));
void tcp_connect _P((struct socket *));
int tcp_attach _P((struct socket *));
u_int8_t tcp_tos _P((struct socket *));
int tcp_emu _P((struct socket *, struct mbuf *));
int tcp_ctl _P((struct socket *));
void tcp_init(void);
void tcp_template(struct tcpcb *);
void tcp_respond(struct tcpcb *, register struct tcpiphdr *, register struct mbuf *, tcp_seq, tcp_seq, int);
struct tcpcb * tcp_newtcpcb(struct socket *);
struct tcpcb * tcp_close(register struct tcpcb *);
void tcp_drain(void);
void tcp_sockclosed(struct tcpcb *);
int tcp_fconnect(struct socket *);
void tcp_connect(struct socket *);
int tcp_attach(struct socket *);
u_int8_t tcp_tos(struct socket *);
int tcp_emu(struct socket *, struct mbuf *);
int tcp_ctl(struct socket *);
struct tcpcb *tcp_drop(struct tcpcb *tp, int err);
#ifdef USE_PPP
@ -358,9 +355,4 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err);
#define max(x,y) ((x) > (y) ? (x) : (y))
#endif
#ifdef _WIN32
#undef errno
#define errno (WSAGetLastError())
#endif
#endif

View File

@ -40,11 +40,6 @@
*/
#undef USE_LOWCPU
/* Define this if your compiler doesn't like prototypes */
#ifndef __STDC__
#define NO_PROTOTYPES
#endif
/*********************************************************/
/*
* Autoconf defined configuration options
@ -77,9 +72,6 @@
/* Define if you have sys/stropts.h */
#undef HAVE_SYS_STROPTS_H
/* Define if your compiler doesn't like prototypes */
#undef NO_PROTOTYPES
/* Define if you don't have u_int32_t etc. typedef'd */
#undef NEED_TYPEDEFS
#ifdef __sun__

View File

@ -97,11 +97,12 @@ int
soread(so)
struct socket *so;
{
int n, nn, lss, total;
int n, nn;
u_int lss, total;
struct sbuf *sb = &so->so_snd;
int len = sb->sb_datalen - sb->sb_cc;
u_int len = sb->sb_datalen - sb->sb_cc;
struct iovec iov[2];
int mss = so->so_tcpcb->t_maxseg;
u_int mss = so->so_tcpcb->t_maxseg;
DEBUG_CALL("soread");
DEBUG_ARG("so = %lx", (long )so);
@ -159,7 +160,8 @@ soread(so)
nn = recv(so->s, iov[0].iov_base, iov[0].iov_len,0);
#endif
if (nn <= 0) {
if (nn < 0 && (errno == EINTR || errno == EAGAIN))
int error = WSAGetLastError();
if (nn < 0 && (error == WSAEINTR || error == EAGAIN))
return 0;
else {
DEBUG_MISC((dfd, " --- soread() disconnected, nn = %d, errno = %d-%s\n", nn, errno,strerror(errno)));
@ -297,7 +299,7 @@ sowrite(so)
{
int n,nn;
struct sbuf *sb = &so->so_rcv;
int len = sb->sb_cc;
u_int len = sb->sb_cc;
struct iovec iov[2];
DEBUG_CALL("sowrite");
@ -344,9 +346,12 @@ sowrite(so)
nn = send(so->s, iov[0].iov_base, iov[0].iov_len,0);
#endif
/* This should never happen, but people tell me it does *shrug* */
if (nn < 0 && (errno == EAGAIN || errno == EINTR))
return 0;
if (nn < 0) {
int error = WSAGetLastError();
if (error == EAGAIN || error == WSAEINTR)
return 0;
}
if (nn <= 0) {
DEBUG_MISC((dfd, " --- sowrite disconnected, so->so_state = %x, errno = %d\n",
so->so_state, errno));
@ -405,8 +410,9 @@ sorecvfrom(so)
if(len == -1 || len == 0) {
u_char code=ICMP_UNREACH_PORT;
if(errno == EHOSTUNREACH) code=ICMP_UNREACH_HOST;
else if(errno == ENETUNREACH) code=ICMP_UNREACH_NET;
int error = WSAGetLastError();
if(error == WSAEHOSTUNREACH) code=ICMP_UNREACH_HOST;
else if(error == WSAENETUNREACH) code=ICMP_UNREACH_NET;
DEBUG_MISC((dfd," udp icmp rx errno = %d-%s\n",
errno,strerror(errno)));
@ -419,7 +425,7 @@ sorecvfrom(so)
udp_detach(so);
} else { /* A "normal" UDP packet */
struct mbuf *m;
int len;
u_int len;
ioctlsockopt_t n;
if (!(m = m_get())) return;
@ -447,8 +453,9 @@ sorecvfrom(so)
if(m->m_len<0) {
u_char code=ICMP_UNREACH_PORT;
if(errno == EHOSTUNREACH) code=ICMP_UNREACH_HOST;
else if(errno == ENETUNREACH) code=ICMP_UNREACH_NET;
int error = WSAGetLastError();
if(error == WSAEHOSTUNREACH) code=ICMP_UNREACH_HOST;
else if(error == WSAENETUNREACH) code=ICMP_UNREACH_NET;
DEBUG_MISC((dfd," rx error, tx icmp ICMP_UNREACH:%i\n", code));
icmp_error(so->so_m, ICMP_UNREACH,code, 0,strerror(errno));
@ -513,7 +520,9 @@ sosendto(so, m)
addr.sin_addr = so->so_faddr;
addr.sin_port = so->so_fport;
DEBUG_MISC((dfd, " sendto()ing, addr.sin_port=%d, addr.sin_addr.s_addr=%.16s\n", ntohs(addr.sin_port), inet_ntoa(addr.sin_addr)));
char addrstr[INET_ADDRSTRLEN];
DEBUG_MISC((dfd, " sendto()ing, addr.sin_port=%d, addr.sin_addr.s_addr=%.16s\n",
ntohs(addr.sin_port), inet_ntop(AF_INET, &addr.sin_addr, addrstr, sizeof(addrstr))));
/* Don't care what port we get */
ret = sendto(so->s, m->m_data, m->m_len, 0,
@ -584,16 +593,12 @@ solisten(port, laddr, lport, flags)
(setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) ||
(bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) ||
(listen(s,1) < 0)) {
int tmperrno = errno; /* Don't clobber the real reason we failed */
int error = WSAGetLastError(); /* Don't clobber the real reason we failed */
close(s);
sofree(so);
/* Restore the real errno */
#ifdef _WIN32
WSASetLastError(tmperrno);
#else
errno = tmperrno;
#endif
WSASetLastError(error);
return NULL;
}
setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int));

View File

@ -81,24 +81,24 @@ struct iovec {
};
#endif
void so_init _P((void));
struct socket * solookup _P((struct socket *, struct in_addr, u_int, struct in_addr, u_int));
struct socket * socreate _P((void));
void sofree _P((struct socket *));
int soread _P((struct socket *));
void sorecvoob _P((struct socket *));
int sosendoob _P((struct socket *));
int sowrite _P((struct socket *));
void sorecvfrom _P((struct socket *));
int sosendto _P((struct socket *, struct mbuf *));
struct socket * solisten _P((u_int, u_int32_t, u_int, int));
void sorwakeup _P((struct socket *));
void sowwakeup _P((struct socket *));
void soisfconnecting _P((register struct socket *));
void soisfconnected _P((register struct socket *));
void sofcantrcvmore _P((struct socket *));
void sofcantsendmore _P((struct socket *));
void soisfdisconnected _P((struct socket *));
void sofwdrain _P((struct socket *));
void so_init(void);
struct socket * solookup(struct socket *, struct in_addr, u_int, struct in_addr, u_int);
struct socket * socreate(void);
void sofree(struct socket *);
int soread(struct socket *);
void sorecvoob(struct socket *);
int sosendoob(struct socket *);
int sowrite(struct socket *);
void sorecvfrom(struct socket *);
int sosendto(struct socket *, struct mbuf *);
struct socket * solisten(u_int, u_int32_t, u_int, int);
void sorwakeup(struct socket *);
void sowwakeup(struct socket *);
void soisfconnecting(register struct socket *);
void soisfconnected(register struct socket *);
void sofcantrcvmore(struct socket *);
void sofcantsendmore(struct socket *);
void soisfdisconnected(struct socket *);
void sofwdrain(struct socket *);
#endif /* _SOCKET_H_ */

View File

@ -38,8 +38,8 @@ typedef u_int32_t tcp_seq;
#define PR_SLOWHZ 2 /* 2 slow timeouts per second (approx) */
#define PR_FASTHZ 5 /* 5 fast timeouts per second (not important) */
extern int tcp_rcvspace;
extern int tcp_sndspace;
extern size_t tcp_rcvspace;
extern size_t tcp_sndspace;
extern struct socket *tcp_last_so;
#define TCP_SNDSPACE 8192
@ -78,7 +78,7 @@ struct tcphdr {
} PACKED__;
#ifdef PRAGMA_PACK_SUPPORTED
#pragma pack(0)
#pragma pack(PACK_RESET)
#endif
#include "tcp_var.h"

File diff suppressed because it is too large Load Diff

View File

@ -63,12 +63,10 @@ u_char tcp_outflags[TCP_NSTATES] = {
/*
* Tcp output routine: figure out what should be sent and send it.
*/
int
tcp_output(tp)
register struct tcpcb *tp;
int tcp_output(register struct tcpcb *tp)
{
register struct socket *so = tp->t_socket;
register long len, win;
register u_long len, win;
int off, flags, error;
register struct mbuf *m;
register struct tcpiphdr *ti;
@ -126,7 +124,7 @@ again:
* to send then the probe will be the FIN
* itself.
*/
if (off < so->so_snd.sb_cc)
if (off < (int)so->so_snd.sb_cc)
flags &= ~TH_FIN;
win = 1;
} else {
@ -201,12 +199,12 @@ again:
* taking into account that we are limited by
* TCP_MAXWIN << tp->rcv_scale.
*/
long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -
u_int adv = min(win, (u_int)TCP_MAXWIN << tp->rcv_scale) -
(tp->rcv_adv - tp->rcv_nxt);
if (adv >= (long) (2 * tp->t_maxseg))
if (adv >= (u_int)(2 * tp->t_maxseg))
goto send;
if (2 * adv >= (long) so->so_rcv.sb_datalen)
if (2 * adv >= so->so_rcv.sb_datalen)
goto send;
}
@ -359,7 +357,7 @@ send:
*/
/* if (len <= MHLEN - hdrlen - max_linkhdr) { */
sbcopy(&so->so_snd, off, (int) len, mtod(m, caddr_t) + hdrlen);
sbcopy(&so->so_snd, off, len, mtod(m, caddr_t) + hdrlen);
m->m_len += len;
/* } else {
@ -435,12 +433,12 @@ send:
* Calculate receive window. Don't shrink window,
* but avoid silly window syndrome.
*/
if (win < (long)(so->so_rcv.sb_datalen / 4) && win < (long)tp->t_maxseg)
if (win < (so->so_rcv.sb_datalen / 4) && win < tp->t_maxseg)
win = 0;
if (win > (long)TCP_MAXWIN << tp->rcv_scale)
win = (long)TCP_MAXWIN << tp->rcv_scale;
if (win < (long)(tp->rcv_adv - tp->rcv_nxt))
win = (long)(tp->rcv_adv - tp->rcv_nxt);
if (win > (u_long) (TCP_MAXWIN << tp->rcv_scale))
win = (u_long) (TCP_MAXWIN << tp->rcv_scale);
if (win < (tp->rcv_adv - tp->rcv_nxt))
win = (tp->rcv_adv - tp->rcv_nxt);
ti->ti_win = htons((u_int16_t) (win>>tp->rcv_scale));
if (SEQ_GT(tp->snd_up, tp->snd_una)) {
@ -530,7 +528,7 @@ send:
{
((struct ip *)ti)->ip_len = m->m_len;
((struct ip *)ti)->ip_len = (u_int16_t) m->m_len;
((struct ip *)ti)->ip_ttl = ip_defttl;
((struct ip *)ti)->ip_tos = so->so_iptos;
@ -581,9 +579,7 @@ out:
return (0);
}
void
tcp_setpersist(tp)
register struct tcpcb *tp;
void tcp_setpersist(register struct tcpcb *tp)
{
int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;

View File

@ -46,14 +46,13 @@
int tcp_mssdflt = TCP_MSS;
int tcp_rttdflt = TCPTV_SRTTDFLT / PR_SLOWHZ;
int tcp_do_rfc1323 = 0; /* Don't do rfc1323 performance enhancements */
int tcp_rcvspace; /* You may want to change this */
int tcp_sndspace; /* Keep small if you have an error prone link */
size_t tcp_rcvspace; /* You may want to change this */
size_t tcp_sndspace; /* Keep small if you have an error prone link */
/*
* Tcp initialization
*/
void
tcp_init()
void tcp_init()
{
tcp_iss = 1; /* wrong */
tcb.so_next = tcb.so_prev = &tcb;
@ -74,9 +73,7 @@ tcp_init()
* necessary when the connection is used.
*/
/* struct tcpiphdr * */
void
tcp_template(tp)
struct tcpcb *tp;
void tcp_template(struct tcpcb *tp)
{
struct socket *so = tp->t_socket;
register struct tcpiphdr *n = &tp->t_template;
@ -113,13 +110,8 @@ tcp_template(tp)
* In any case the ack and sequence number of the transmitted
* segment are as specified by the parameters.
*/
void
tcp_respond(tp, ti, m, ack, seq, flags)
struct tcpcb *tp;
register struct tcpiphdr *ti;
register struct mbuf *m;
tcp_seq ack, seq;
int flags;
void tcp_respond(struct tcpcb *tp, register struct tcpiphdr *ti,
register struct mbuf *m, tcp_seq ack, tcp_seq seq, int flags)
{
register int tlen;
int win = 0;
@ -193,9 +185,7 @@ tcp_respond(tp, ti, m, ack, seq, flags)
* empty reassembly queue and hooking it to the argument
* protocol control block.
*/
struct tcpcb *
tcp_newtcpcb(so)
struct socket *so;
struct tcpcb *tcp_newtcpcb(struct socket *so)
{
register struct tcpcb *tp;
@ -268,9 +258,7 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err)
* discard internet protocol block
* wake up any sleepers
*/
struct tcpcb *
tcp_close(tp)
register struct tcpcb *tp;
struct tcpcb *tcp_close(register struct tcpcb *tp)
{
register struct tcpiphdr *t;
struct socket *so = tp->t_socket;
@ -306,8 +294,7 @@ tcp_close(tp)
return ((struct tcpcb *)0);
}
void
tcp_drain()
void tcp_drain()
{
/* XXX */
}
@ -319,10 +306,7 @@ tcp_drain()
#ifdef notdef
void
tcp_quench(i, errno)
int errno;
void tcp_quench(int i, int errno)
{
struct tcpcb *tp = intotcpcb(inp);
@ -346,9 +330,7 @@ tcp_quench(i, errno)
* for peer to send FIN or not respond to keep-alives, etc.
* We can let the user exit from the close as soon as the FIN is acked.
*/
void
tcp_sockclosed(tp)
struct tcpcb *tp;
void tcp_sockclosed(struct tcpcb *tp)
{
DEBUG_CALL("tcp_sockclosed");
@ -389,8 +371,7 @@ tcp_sockclosed(tp)
* nonblocking. Connect returns after the SYN is sent, and does
* not wait for ACK+SYN.
*/
int tcp_fconnect(so)
struct socket *so;
int tcp_fconnect(struct socket *so)
{
int ret=0;
@ -423,10 +404,12 @@ int tcp_fconnect(so)
} else
addr.sin_addr = so->so_faddr;
addr.sin_port = so->so_fport;
char addrstr[INET_ADDRSTRLEN];
DEBUG_MISC((dfd, " connect()ing, addr.sin_port=%d, "
"addr.sin_addr.s_addr=%.16s\n",
ntohs(addr.sin_port), inet_ntoa(addr.sin_addr)));
ntohs(addr.sin_port), inet_ntop(AF_INET, &addr.sin_addr,
addrstr, sizeof(addrstr))));
/* We don't care what port we get */
ret = connect(s,(struct sockaddr *)&addr,sizeof (addr));
@ -452,9 +435,7 @@ int tcp_fconnect(so)
* the time it gets to accept(), so... We simply accept
* here and SYN the local-host.
*/
void
tcp_connect(inso)
struct socket *inso;
void tcp_connect(struct socket *inso)
{
struct socket *so;
struct sockaddr_in addr;
@ -486,7 +467,7 @@ tcp_connect(inso)
so->so_lport = inso->so_lport;
}
(void) tcp_mss(sototcpcb(so), 0);
tcp_mss(sototcpcb(so), 0);
if ((s = accept(inso->s,(struct sockaddr *)&addr,&addrlen)) < 0) {
tcp_close(sototcpcb(so)); /* This will sofree() as well */
@ -539,9 +520,7 @@ tcp_connect(inso)
/*
* Attach a TCPCB to a socket.
*/
int
tcp_attach(so)
struct socket *so;
int tcp_attach(struct socket *so)
{
if ((so->so_tcpcb = tcp_newtcpcb(so)) == NULL)
return -1;
@ -575,9 +554,7 @@ struct emu_t *tcpemu = 0;
/*
* Return TOS according to the above table
*/
u_int8_t
tcp_tos(so)
struct socket *so;
u_int8_t tcp_tos(struct socket *so)
{
int i = 0;
struct emu_t *emup;
@ -629,10 +606,7 @@ int do_echo = -1;
*
* NOTE: if you return 0 you MUST m_free() the mbuf!
*/
int
tcp_emu(so, m)
struct socket *so;
struct mbuf *m;
int tcp_emu(struct socket *so, struct mbuf *m)
{
u_int n1, n2, n3, n4, n5, n6;
char buff[256];
@ -833,7 +807,7 @@ tcp_emu(so, m)
ns->so_laddr=so->so_laddr;
ns->so_lport=htons(port);
(void) tcp_mss(sototcpcb(ns), 0);
tcp_mss(sototcpcb(ns), 0);
ns->so_faddr=so->so_faddr;
ns->so_fport=htons(IPPORT_RESERVED-1); /* Use a fake port. */
@ -1060,7 +1034,7 @@ do_prompt:
* of the connection as a NUL-terminated decimal ASCII string.
*/
so->so_emu = 0;
for (lport = 0, i = 0; i < m->m_len-1; ++i) {
for (lport = 0, i = 0; i < (int) (m->m_len-1); ++i) {
if (m->m_data[i] < '0' || m->m_data[i] > '9')
return 1; /* invalid number */
lport *= 10;
@ -1245,9 +1219,7 @@ do_prompt:
* Return 0 if this connections is to be closed, 1 otherwise,
* return 2 if this is a command-line connection
*/
int
tcp_ctl(so)
struct socket *so;
int tcp_ctl(struct socket *so)
{
struct sbuf *sb = &so->so_snd;
int command;

Some files were not shown because too many files have changed in this diff Show More