Skip to content

Hacks for MSVS/clang compilation #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,49 @@ set -x # Print commands from now on
${debug_opts} \
${sys_opts} \
--target-list=i386-softmmu \
--enable-trace-backends="nop" \
--enable-sdl \
--with-sdlabi=2.0 \
--disable-curl \
--disable-vnc \
--disable-vnc-sasl \
--disable-docs \
--disable-tools \
--disable-guest-agent \
--disable-tpm \
--disable-live-block-migration \
--disable-rdma \
--disable-replication \
--disable-capstone \
--disable-fdt \
--disable-libiscsi \
--disable-spice \
--disable-user \
--disable-stack-protector \
--disable-glusterfs \
--disable-bluez \
--disable-gtk \
--disable-curses \
--disable-gnutls \
--disable-nettle \
--disable-gcrypt \
--disable-crypto-afalg \
--disable-virglrenderer \
--disable-vhost-net \
--disable-vhost-crypto \
--disable-vhost-vsock \
--disable-vhost-user \
--disable-virtfs \
--disable-libssh2 \
--disable-snappy \
--disable-bzip2 \
--disable-vde \
--disable-libxml2 \
--disable-seccomp \
--disable-numa \
--disable-lzo \
--disable-smartcard \
--disable-usb-redir \
${user_opts}

time make -j"${job_count}" 2>&1 | tee build.log
Expand Down
2 changes: 1 addition & 1 deletion hw/usb/dev-storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ static const VMStateDescription vmstate_usb_msd = {
.minimum_version_id = 1,
.fields = (VMStateField[]) {
VMSTATE_USB_DEVICE(dev, MSDState),
VMSTATE_UINT32(mode, MSDState),
//VMSTATE_UINT32(mode, MSDState),
VMSTATE_UINT32(scsi_len, MSDState),
VMSTATE_UINT32(scsi_off, MSDState),
VMSTATE_UINT32(data_len, MSDState),
Expand Down
4 changes: 2 additions & 2 deletions hw/usb/hcd-xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3564,8 +3564,8 @@ static const VMStateDescription vmstate_xhci_event = {
.name = "xhci-event",
.version_id = 1,
.fields = (VMStateField[]) {
VMSTATE_UINT32(type, XHCIEvent),
VMSTATE_UINT32(ccode, XHCIEvent),
//VMSTATE_UINT32(type, XHCIEvent),
//VMSTATE_UINT32(ccode, XHCIEvent),
VMSTATE_UINT64(ptr, XHCIEvent),
VMSTATE_UINT32(length, XHCIEvent),
VMSTATE_UINT32(flags, XHCIEvent),
Expand Down
3 changes: 0 additions & 3 deletions hw/xbox/nv2a/nv2a_pgraph.c
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,6 @@ static void pgraph_method(NV2AState *d,
attribute->inline_value[3] = 1.0;
if (slot == 0) {
pgraph_finish_inline_buffer_vertex(pg);
assert(false); /* FIXME: Untested */
}
break;
}
Expand All @@ -2192,7 +2191,6 @@ static void pgraph_method(NV2AState *d,
attribute->inline_value[3] = ((parameter >> 24) & 0xFF) / 255.0;
if (slot == 0) {
pgraph_finish_inline_buffer_vertex(pg);
assert(false); /* FIXME: Untested */
}
break;
}
Expand All @@ -2211,7 +2209,6 @@ static void pgraph_method(NV2AState *d,
* 2.0 + 1) / 65535.0;
if ((slot == 0) && (part == 1)) {
pgraph_finish_inline_buffer_vertex(pg);
assert(false); /* FIXME: Untested */
}
break;
}
Expand Down
43 changes: 24 additions & 19 deletions hw/xbox/nv2a/nv2a_shaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,26 +246,31 @@ static void append_skinning_code(QString* str, bool mix,
} else {
qstring_append_fmt(str, "%s %s = %s(0.0);\n", type, output, type);
if (mix) {
/* Tweening */
if (count == 2) {
qstring_append_fmt(str,
"%s += mix((%s * %s1).%s,\n"
" (%s * %s0).%s, weight.x);\n",
output,
input, matrix, swizzle,
input, matrix, swizzle);
} else {
/* FIXME: Not sure how blend weights are calculated */
assert(false);
/* Generated final weight (like GL_WEIGHT_SUM_UNITY_ARB) */
qstring_append(str, "{\n"
" float weight_i;\n"
" float weight_n = 1.0;\n");
int i;
for (i = 0; i < count; i++) {
if (i < (count - 1)) {
char c = "xyzw"[i];
qstring_append_fmt(str, " weight_i = weight.%c;\n"
" weight_n -= weight_i;\n",
c);
} else {
qstring_append(str, " weight_i = weight_n;\n");
}
qstring_append_fmt(str, " %s += (%s * %s%d).%s * weight_i;\n",
output, input, matrix, i, swizzle);
}
qstring_append(str, "}\n");
} else {
/* Individual matrices */
/* Individual weights */
int i;
for (i = 0; i < count; i++) {
char c = "xyzw"[i];
qstring_append_fmt(str, "%s += (%s * %s%d * weight.%c).%s;\n",
output, input, matrix, i, c,
swizzle);
qstring_append_fmt(str, "%s += (%s * %s%d).%s * weight.%c;\n",
output, input, matrix, i, swizzle, c);
}
assert(false); /* FIXME: Untested */
}
Expand Down Expand Up @@ -372,14 +377,14 @@ GLSL_DEFINE(sceneAmbientColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_FR_AMB) ".xyz")
mix = false; count = 0; break;
case SKINNING_1WEIGHTS:
mix = true; count = 2; break;
case SKINNING_2WEIGHTS:
mix = true; count = 3; break;
case SKINNING_3WEIGHTS:
mix = true; count = 4; break;
case SKINNING_2WEIGHTS2MATRICES:
mix = false; count = 2; break;
case SKINNING_2WEIGHTS:
mix = true; count = 3; break;
case SKINNING_3WEIGHTS3MATRICES:
mix = false; count = 3; break;
case SKINNING_3WEIGHTS:
mix = true; count = 4; break;
case SKINNING_4WEIGHTS4MATRICES:
mix = false; count = 4; break;
default:
Expand Down
4 changes: 2 additions & 2 deletions hw/xbox/nv2a/nv2a_vsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ enum VshFoggen {
enum VshSkinning {
SKINNING_OFF,
SKINNING_1WEIGHTS,
SKINNING_2WEIGHTS,
SKINNING_3WEIGHTS,
SKINNING_2WEIGHTS2MATRICES,
SKINNING_2WEIGHTS,
SKINNING_3WEIGHTS3MATRICES,
SKINNING_3WEIGHTS,
SKINNING_4WEIGHTS4MATRICES,
};

Expand Down
7 changes: 0 additions & 7 deletions hw/xbox/nvnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,13 +829,6 @@ static void nvnet_realize(PCIDevice *pci_dev, Error **errp)
s->nic = qemu_new_nic(&net_nvnet_info, &s->conf,
object_get_typename(OBJECT(s)), dev->id, s);
assert(s->nic);

s->regs[NvRegMacAddrA + 0x00] = s->conf.macaddr.a[0];
s->regs[NvRegMacAddrA + 0x01] = s->conf.macaddr.a[1];
s->regs[NvRegMacAddrA + 0x02] = s->conf.macaddr.a[2];
s->regs[NvRegMacAddrA + 0x03] = s->conf.macaddr.a[3];
s->regs[NvRegMacAddrB + 0x00] = s->conf.macaddr.a[4];
s->regs[NvRegMacAddrB + 0x01] = s->conf.macaddr.a[5];
}

static void nvnet_uninit(PCIDevice *dev)
Expand Down
2 changes: 1 addition & 1 deletion include/sysemu/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "exec/memory.h"
#include "exec/address-spaces.h"
#include "hw/hw.h"
#include "block/block.h"
#include <block/block.h>
#include "block/accounting.h"

typedef struct ScatterGatherEntry ScatterGatherEntry;
Expand Down
2 changes: 1 addition & 1 deletion include/sysemu/os-win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <windows.h>
#include <ws2tcpip.h>

#if defined(_WIN64)
#if 0 // defined(_WIN64)
/* On w64, setjmp is implemented by _setjmp which needs a second parameter.
* If this parameter is NULL, longjump does no stack unwinding.
* That is what we need for QEMU. Passing the value of register rsp (default)
Expand Down
2 changes: 1 addition & 1 deletion replay/replay-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool replay_next_event_is(int event);
/*! Reads next clock value from the file.
If clock kind read from the file is different from the parameter,
the value is not used. */
void replay_read_next_clock(unsigned int kind);
void replay_read_next_clock(ReplayClockKind kind);

/* Asynchronous events queue */

Expand Down
4 changes: 2 additions & 2 deletions stubs/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

ReplayMode replay_mode;

int64_t replay_save_clock(unsigned int kind, int64_t clock)
int64_t replay_save_clock(ReplayClockKind kind, int64_t clock)
{
abort();
return 0;
}

int64_t replay_read_clock(unsigned int kind)
int64_t replay_read_clock(ReplayClockKind kind)
{
abort();
return 0;
Expand Down