hw/xbox: Transform assert(false) to assert(!"<diagnostic message>")

This commit is contained in:
Reedzit
2026-05-23 16:42:13 -04:00
committed by GitHub
parent e00c1511d1
commit e72e76bd1f
29 changed files with 112 additions and 95 deletions
+2 -2
View File
@@ -172,7 +172,7 @@ static void lpc47m157_io_write(void *opaque, hwaddr addr, uint64_t val,
s->config_regs[CONFIG_DEVICE_NUMBER], s->selected_reg, val);
}
} else {
assert(false);
assert(!"lpc47m157 IO write failed");
}
}
}
@@ -196,7 +196,7 @@ static uint64_t lpc47m157_io_read(void *opaque, hwaddr addr, unsigned int size)
val = dev[s->selected_reg];
}
} else if (addr != INDEX_PORT) {
assert(false);
assert(!"lpc47m157 IO failed to read");
}
}
+2 -2
View File
@@ -212,7 +212,7 @@ uint32_t dsp_read_memory(DSPState* dsp, char space, uint32_t address)
space_id = DSP_SPACE_P;
break;
default:
assert(false);
assert(!"Invalid dsp space when reading from memory");
return 0;
}
@@ -234,7 +234,7 @@ void dsp_write_memory(DSPState* dsp, char space, uint32_t address, uint32_t valu
space_id = DSP_SPACE_P;
break;
default:
assert(false);
assert(!"Invalid dsp space when writing to memory");
return;
}
+10 -10
View File
@@ -422,7 +422,7 @@ static const OpcodeEntry *lookup_opcode_slow(uint32_t op) {
}
fprintf(stderr, "op = %08x\n", op);
assert(false);
assert(!"Invalid op code in dsp_cpu");
return NULL;
}
@@ -894,13 +894,13 @@ static void dsp_postexecute_interrupts(dsp_core_t* dsp)
/* SSI receive data with exception ? */
if (dsp->interrupt_instr_fetch == 0xe) {
// dsp->periph[DSP_SPACE_X][DSP_SSI_SR] &= 0xff-(1<<DSP_SSI_SR_ROE);
assert(false);
assert(!"SSI receive data failed");
}
/* SSI transmit data with exception ? */
else if (dsp->interrupt_instr_fetch == 0x12) {
// dsp->periph[DSP_SPACE_X][DSP_SSI_SR] &= 0xff-(1<<DSP_SSI_SR_TUE);
assert(false);
assert(!"SSI transmit data failed");
}
/* host command ? */
@@ -911,7 +911,7 @@ static void dsp_postexecute_interrupts(dsp_core_t* dsp)
// dsp->interrupt_instr_fetch = dsp->hostport[CPU_HOST_CVR] & BITMASK(5);
// dsp->interrupt_instr_fetch *= 2;
assert(false);
assert(!"Host command failure");
}
}
@@ -954,7 +954,7 @@ uint32_t dsp56k_read_memory(dsp_core_t* dsp, int space, uint32_t address)
} else if (space == DSP_SPACE_P) {
return read_memory_p(dsp, address);
} else {
assert(false);
assert(!"Invalid dsp space in read memory");
return 0;
}
}
@@ -993,7 +993,7 @@ static void write_memory_raw(dsp_core_t* dsp, int space, uint32_t address, uint3
stl_le_p(&dsp->pram[address], value);
dsp->pram_opcache[address] = NULL;
} else {
assert(false);
assert(!"Invalid dsp space in write raw memory");
}
}
@@ -1022,7 +1022,7 @@ static void write_memory_disasm(dsp_core_t* dsp, int space, uint32_t address, ui
space_c = 'p';
break;
default:
assert(false);
assert(!"Invalid dsp space in write memory disasm");
}
curvalue = read_memory_disasm(dsp, space, address);
@@ -1061,7 +1061,7 @@ static void dsp_write_reg(dsp_core_t* dsp, uint32_t numreg, uint32_t value)
dsp->registers[DSP_REG_SP] = value & (3<<DSP_SP_SE);
DPRINTF("Dsp: Stack Overflow or Underflow\n");
if (dsp->exception_debugging) {
assert(false);
assert(!"Dsp stack overflow or underflow detected");
}
} else {
dsp->registers[DSP_REG_SP] = value & BITMASK(6);
@@ -1104,7 +1104,7 @@ static void dsp_stack_push(dsp_core_t* dsp, uint32_t curpc, uint32_t cursr, uint
dsp56k_add_interrupt(dsp, DSP_INTER_STACK_ERROR);
DPRINTF("Dsp: Stack Overflow\n");
if (dsp->exception_debugging)
assert(false);
assert(!"dsp stack overflow");
}
dsp->registers[DSP_REG_SP] = (underflow | stack_error | stack) & BITMASK(6);
@@ -1140,7 +1140,7 @@ static void dsp_stack_pop(dsp_core_t* dsp, uint32_t *newpc, uint32_t *newsr)
dsp56k_add_interrupt(dsp, DSP_INTER_STACK_ERROR);
DPRINTF("Dsp: Stack underflow\n");
if (dsp->exception_debugging)
assert(false);
assert(!"Dsp stack underflow");
}
dsp->registers[DSP_REG_SP] = (underflow | stack_error | stack) & BITMASK(6);
+11 -11
View File
@@ -124,7 +124,7 @@ static void dsp_dma_run(DSPDMAState *s)
block_space = DSP_SPACE_P;
block_addr = addr - 0x2800;
} else {
assert(false);
assert(!"Dsp dma space address out of range");
}
uint32_t next_block = dsp56k_read_memory(s->core, block_space, block_addr);
@@ -175,7 +175,7 @@ static void dsp_dma_run(DSPDMAState *s)
break;
default:
fprintf(stderr, "Unknown dsp dma format: 0x%x\n", format);
assert(false);
assert(!"Unknown dsp dma format");
break;
}
@@ -197,7 +197,7 @@ static void dsp_dma_run(DSPDMAState *s)
mem_address = dsp_offset - 0x2800;
} else {
fprintf(stderr, "Attempt to access %08x\n", dsp_offset);
assert(false);
assert(!"Dsp dma offset out of range");
}
size_t transfer_size = count * item_size;
@@ -229,7 +229,7 @@ static void dsp_dma_run(DSPDMAState *s)
*(uint32_t*)(scratch_buf + i*4*channel_count + ch*4) = v;
break;
default:
assert(false);
assert(!"Invalid dsp dma item size for interleaved samples");
break;
}
}
@@ -245,7 +245,7 @@ static void dsp_dma_run(DSPDMAState *s)
*(uint32_t*)(scratch_buf + i*4) = v;
break;
default:
assert(false);
assert(!"Invalid dsp dma item size");
break;
}
}
@@ -268,7 +268,7 @@ static void dsp_dma_run(DSPDMAState *s)
break;
default:
fprintf(stderr, "Unknown DSP DMA buffer: 0x%x\n", buf_id);
assert(false);
assert(!"Unknown dsp dma buffer");
break;
}
} else {
@@ -280,7 +280,7 @@ static void dsp_dma_run(DSPDMAState *s)
s->scratch_rw(s->rw_opaque, scratch_buf, scratch_addr, transfer_size, 0);
} else {
fprintf(stderr, "Unhandled DSP DMA buffer: 0x%x\n", buf_id);
assert(false);
assert(!"Unhandled dsp dma buffer");
}
for (int i = 0; i < count; i++) {
@@ -294,7 +294,7 @@ static void dsp_dma_run(DSPDMAState *s)
break;
default:
v = 0;
assert(false);
assert(!"Invalid dsp dma item size");
break;
}
@@ -321,7 +321,7 @@ uint32_t dsp_dma_read(DSPDMAState *s, DSPDMARegister reg)
case DMA_NEXT_BLOCK:
return s->next_block;
default:
assert(false);
assert(!"Invalid register for dsp_dma_read");
}
return 0;
}
@@ -349,7 +349,7 @@ void dsp_dma_write(DSPDMAState *s, DSPDMARegister reg, uint32_t v)
s->control &= ~DMA_CONTROL_FROZEN;
break;
default:
assert(false);
assert(!"Invalid DMA_CONTROL action");
break;
}
dsp_dma_run(s);
@@ -364,7 +364,7 @@ void dsp_dma_write(DSPDMAState *s, DSPDMARegister reg, uint32_t v)
s->next_block = v;
break;
default:
assert(false);
assert(!"Invalid dma write register");
}
}
+2 -2
View File
@@ -32,7 +32,7 @@ static void emu_undefined(dsp_core_t* dsp)
/* Add some artificial CPU cycles to avoid being stuck in an infinite loop */
dsp->instr_cycle += 100;
if (dsp->exception_debugging) {
assert(false);
assert(!"Illegal dsp instruction");
}
}
@@ -6846,7 +6846,7 @@ static void emu_illegal(dsp_core_t* dsp)
/* Raise interrupt p:0x003e */
dsp56k_add_interrupt(dsp, DSP_INTER_ILLEGAL);
if (dsp->exception_debugging) {
assert(false);
assert(!"Illegal dsp instruction - interrupt 0x003e raised");
}
}
+5 -4
View File
@@ -565,11 +565,12 @@ static void fe_method(MCPXAPUState *d, uint32_t method, uint32_t argument)
DPRINTF("idle voice %d\n", argument);
d->set_irq = true;
} else {
assert(false);
assert(!"SE2FE_IDLE_VOICE called but NV_PAPU_FETFORCE1_SE2FE_IDLE_VOICE not enabled");
}
break;
default:
assert(false);
DPRINTF("Unrecognized method: 0x%08x\n", method);
assert(!"Unrecognized VP method - could be unimplemented or invalid");
break;
}
}
@@ -828,7 +829,7 @@ static float voice_step_envelope(MCPXAPUState *d, uint16_t v, uint32_t reg_0,
return 0.0f;
default:
fprintf(stderr, "Unknown envelope state 0x%x\n", cur);
assert(false);
assert(!"Unknown envelope state");
return 0.0f;
}
}
@@ -1076,7 +1077,7 @@ static int voice_get_samples(MCPXAPUState *d, uint32_t v, float samples[][2],
fval = int32_to_float(ival);
break;
default:
assert(false);
assert(!"Invalid sample size for NV_PAYS_VOICE_CFG_FMT");
break;
}
samples[sample_count][channel] = fval;
+1 -1
View File
@@ -164,7 +164,7 @@ static int nv2a_get_bpp(VGACommonState *s)
/* This is only a fallback path */
bpp = depth * 8;
fprintf(stderr, "Unknown VGA depth: %d\n", depth);
assert(false);
assert(!"Unknown VGA depth - check logs for depth value");
break;
}
+4 -4
View File
@@ -232,7 +232,7 @@ static ssize_t pfifo_run_puller(NV2AState *d, uint32_t method_entry,
qemu_mutex_unlock(&d->pgraph.lock);
qemu_mutex_lock(&d->pfifo.lock);
} else {
assert(false);
assert(!"Unrecognized pfifo puller method");
}
if (num_proc > 0) {
@@ -296,7 +296,7 @@ static void pfifo_run_pusher(NV2AState *d)
uint32_t dma_put_v = *dma_put;
if (dma_get_v == dma_put_v) break;
if (dma_get_v >= dma_len) {
assert(false);
assert(!"Dma value is out of range in PFIFO pusher");
SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR,
NV_PFIFO_CACHE1_DMA_STATE_ERROR_PROTECTION);
break;
@@ -423,7 +423,7 @@ static void pfifo_run_pusher(NV2AState *d)
SET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR,
NV_PFIFO_CACHE1_DMA_STATE_ERROR_RESERVED_CMD);
// break;
assert(false);
assert(!"Reserved pb command - invalid GPU command. Check logs for more info");
}
}
@@ -440,7 +440,7 @@ static void pfifo_run_pusher(NV2AState *d)
uint32_t error = GET_MASK(*dma_state, NV_PFIFO_CACHE1_DMA_STATE_ERROR);
if (error) {
NV2A_DPRINTF("pb error: %d\n", error);
assert(false);
assert(!"Error reported in PFIFO dma state - check logs for more info");
SET_MASK(*dma_push, NV_PFIFO_CACHE1_DMA_PUSH_STATUS, 1); /* suspended */
+1 -1
View File
@@ -97,7 +97,7 @@ void pgraph_gl_image_blit(NV2AState *d)
default:
fprintf(stderr, "Unknown blit surface format: 0x%x\n",
context_surfaces->color_format);
assert(false);
assert(!"Unknown blit surface format");
break;
}
+2 -2
View File
@@ -109,7 +109,7 @@ static GLuint compile_shader(GLenum type, const char *source)
log[sizeof(log) - 1] = '\0';
fprintf(stderr, "GL shader type %d compilation failed: %s\n", type,
log);
assert(false);
assert(!"GL shader compilation failed");
}
return shader;
@@ -135,7 +135,7 @@ static GLuint create_program(const char *vert_source, const char *geom_source,
glGetProgramInfoLog(shader_prog, sizeof(log), NULL, log);
log[sizeof(log) - 1] = '\0';
fprintf(stderr, "GL shader linking failed: %s\n", log);
assert(false);
assert(!"GL shader linking failed");
}
glDeleteShader(vert_shader);
+5 -4
View File
@@ -417,7 +417,7 @@ gl_internal_format_to_s3tc_enum(GLint gl_internal_format)
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
return S3TC_DECOMPRESS_FORMAT_DXT5;
default:
assert(!"Invalid format");
assert(!"Invalid gl_internal_format");
}
}
@@ -442,7 +442,7 @@ static void upload_gl_texture(GLenum gl_target,
switch(gl_target) {
case GL_TEXTURE_1D:
assert(false);
assert(!"Invalid 1D gl target texture");
break;
case GL_TEXTURE_2D:
if (f.linear) {
@@ -634,7 +634,7 @@ static void upload_gl_texture(GLenum gl_target,
break;
}
default:
assert(false);
assert(!"Invalid gl target texture type");
break;
}
}
@@ -664,7 +664,8 @@ static TextureBinding* generate_texture(const TextureShape s,
case 2: gl_target = GL_TEXTURE_2D; break;
case 3: gl_target = GL_TEXTURE_3D; break;
default:
assert(false);
NV2A_GL_DPRINTF(true, "Invalid texture dimensionality: %u", (unsigned)s.dimensionality);
assert(!"Invalid texture dimensionality");
break;
}
}
+1 -1
View File
@@ -129,7 +129,7 @@ void pgraph_gl_bind_vertex_attributes(NV2AState *d, unsigned int min_element,
break;
default:
fprintf(stderr, "Unknown vertex type: 0x%x\n", attr->format);
assert(false);
assert(!"Unknown vertex type");
break;
}
+3 -3
View File
@@ -100,7 +100,7 @@ bool pgraph_glsl_need_geom(const GeomState *state)
return true;
case PRIM_TYPE_POLYGON:
if (polygon_mode == POLY_MODE_POINT) {
assert(false);
assert(!"POLY_MODE_POINT not supported");
return false;
}
return true;
@@ -283,13 +283,13 @@ MString *pgraph_glsl_gen_geom(const GeomState *state, GenGeomGlslOptions opts)
layout_out = "layout(line_strip, max_vertices = 2) out;\n";
body = " emit_line(0, 1, 0.0);\n";
} else {
assert(false);
assert(!"Invalid polygon mode for PRIM_TYPE_POLYGON");
return NULL;
}
break;
default:
assert(false);
assert(!"Invalid primitive mode");
return NULL;
}
+24 -10
View File
@@ -225,9 +225,8 @@ void pgraph_glsl_set_psh_state(PGRAPHState *pg, PshState *state)
z_format ? DEPTH_FORMAT_F24 : DEPTH_FORMAT_D24;
break;
default:
fprintf(stderr, "Unknown zeta surface format: 0x%x\n",
pg->surface_shape.zeta_format);
assert(false);
fprintf(stderr, "Unknown zeta surface format: 0x%x\n", pg->surface_shape.zeta_format);
assert(!"Unknown zeta surface format");
break;
}
}
@@ -361,7 +360,8 @@ static MString* get_var(struct PixelShader *ps, int reg, bool is_dest)
mstring_get_str(ps->varE),
mstring_get_str(ps->varF));
default:
assert(false);
fprintf(stderr, "Invalid register for get var: %d\n", reg);
assert(!"Invalid register for get_var");
return NULL;
}
}
@@ -379,7 +379,8 @@ static MString* get_input_var(struct PixelShader *ps, struct InputInfo in, bool
mstring_append(reg, ".aaa");
break;
default:
assert(false);
fprintf(stderr, "Invalid PS_CHANNEL format: %d\n", in.chan);
assert(!"Invalid PS_CHANNEL format - expected RGB or ALPHA");
break;
}
} else {
@@ -391,7 +392,8 @@ static MString* get_input_var(struct PixelShader *ps, struct InputInfo in, bool
mstring_append(reg, ".a");
break;
default:
assert(false);
fprintf(stderr, "Invalid PS_CHANNEL format: %d\n", in.chan);
assert(!"Invalid PS_CHANNEL format - expected BLUE or ALPHA");
break;
}
}
@@ -424,7 +426,8 @@ static MString* get_input_var(struct PixelShader *ps, struct InputInfo in, bool
res = mstring_from_fmt("-%s", mstring_get_str(reg));
break;
default:
assert(false);
fprintf(stderr, "Invalid PS_INPUTMAPPING mode: %d\n", in.mod);
assert(!"Invalid PS_INPUTMAPPING mode");
break;
}
@@ -456,7 +459,8 @@ static MString* get_output(MString *reg, int mapping)
res = mstring_from_fmt("(%s / 2.0)", mstring_get_str(reg));
break;
default:
assert(false);
fprintf(stderr, "Invalid PS_COMBINEROUTPUT mode: %d\n", mapping);
assert(!"Invalid PS_COMBINEROUTPUT mode");
break;
}
return res;
@@ -638,6 +642,7 @@ static const char *get_sampler_type(struct PixelShader *ps, enum PS_TEXTUREMODES
return sampler2D;
}
if (dim == 3) return sampler3D;
fprintf(stderr, "Unhandled texture dimensions in get_sampler_type: mode=%d stage=%d dim=%d\n", mode, i, dim);
assert(!"Unhandled texture dimensions");
return NULL;
@@ -650,6 +655,7 @@ static const char *get_sampler_type(struct PixelShader *ps, enum PS_TEXTUREMODES
}
if (dim == 2) return sampler2D;
if (dim == 3 && mode != PS_TEXTUREMODES_DOT_ST) return sampler3D;
fprintf(stderr, "Unhandled texture dimensions in get_sampler_type: mode=%d stage=%d dim=%d\n", mode, i, dim);
assert(!"Unhandled texture dimensions");
return NULL;
@@ -1129,6 +1135,8 @@ static MString* psh_convert(struct PixelShader *ps)
mstring_append_fmt(vars, "vec4 t%d = textureProj(texSamp%d, vec4(pT%d.xy, 0.0, pT%d.w));\n",
i, i, i, i);
} else {
fprintf(stderr, "Unhandled texture dimensions in PROJECT2D: stage=%d dim_tex=%d cubemap=%d rect=%d\n",
i, ps->state->dim_tex[i], ps->state->tex_cubemap[i], ps->state->rect_tex[i]);
assert(!"Unhandled texture dimensions");
}
}
@@ -1192,6 +1200,8 @@ static MString* psh_convert(struct PixelShader *ps)
mstring_append_fmt(vars, "vec4 t%d = texture(texSamp%d, vec3(pT%d.xy + dsdt%d, pT%d.z));\n",
i, i, i, i, i);
} else {
fprintf(stderr,"Unhandled texture dimensions in BUMPENVMAP: stage=%d dim_tex=%d\n",
i, ps->state->dim_tex[i]);
assert(!"Unhandled texture dimensions");
}
break;
@@ -1219,6 +1229,8 @@ static MString* psh_convert(struct PixelShader *ps)
mstring_append_fmt(vars, "vec4 t%d = texture(texSamp%d, vec3(pT%d.xy + dsdtl%d.st, pT%d.z));\n",
i, i, i, i, i);
} else {
fprintf(stderr, "Unhandled texture dimensions in BUMPENVMAP_LUM: stage=%d dim_tex=%d\n",
i, ps->state->dim_tex[i]);
assert(!"Unhandled texture dimensions");
}
@@ -1352,7 +1364,7 @@ static MString* psh_convert(struct PixelShader *ps)
break;
default:
fprintf(stderr, "Unknown ps tex mode: 0x%x\n", ps->tex_modes[i]);
assert(false);
assert(!"Unknown ps texture mode.");
break;
}
@@ -1396,6 +1408,7 @@ static MString* psh_convert(struct PixelShader *ps)
break;
default:
fprintf(stderr, "Unhandled color key mode: stage=%d mode=%d\n", i, color_key_mode);
assert(!"Unhandled key mode.");
}
@@ -1453,7 +1466,8 @@ static MString* psh_convert(struct PixelShader *ps)
case ALPHA_FUNC_NOTEQUAL: alpha_op = "!="; break;
case ALPHA_FUNC_GEQUAL: alpha_op = ">="; break;
default:
assert(false);
fprintf(stderr, "Invalid ALPHA_FUNC mode: %d\n", ps->state->alpha_func);
assert(!"Invalid ALPHA_FUNC mode");
break;
}
mstring_append_fmt(ps->code,
+3 -3
View File
@@ -162,7 +162,7 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
case SKINNING_4WEIGHTS4MATRICES:
mix = false; count = 4; break;
default:
assert(false);
assert(!"Invalid skinning weight");
break;
}
mstring_append_fmt(body, "/* Skinning mode %d */\n",
@@ -237,7 +237,7 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
i, c, c);
break;
default:
assert(false);
assert(!"Unrecognized Texgen map mode - could be unimplemented or invalid");
break;
}
}
@@ -363,7 +363,7 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
i);
break;
default:
assert(false);
assert(!"Invalid light type");
break;
}
+1 -1
View File
@@ -331,7 +331,7 @@ static MString *decode_opcode_input(const uint32_t *shader_token,
break;
default:
fprintf(stderr, "Unknown vs param: 0x%x\n", param);
assert(false);
assert(!"Unknown vs param");
break;
}
mstring_append(ret_str, tmp);
+1 -1
View File
@@ -369,7 +369,7 @@ MString *pgraph_glsl_gen_vsh(const VshState *state, GenVshGlslOptions opts)
mstring_append(body, " fogFactor -= 1.5;\n");
break;
default:
assert(false);
assert(!"Invalid fog mode");
break;
}
switch (state->fog_mode) {
+10 -10
View File
@@ -1121,7 +1121,7 @@ DEF_METHOD(NV097, SET_FOG_MODE)
case NV097_SET_FOG_MODE_V_LINEAR_ABS:
mode = NV_PGRAPH_CONTROL_3_FOG_MODE_LINEAR_ABS; break;
default:
assert(false);
assert(!"Invalid or unimplemented fog mode");
break;
}
PG_SET_MASK(NV_PGRAPH_CONTROL_3, NV_PGRAPH_CONTROL_3_FOG_MODE,
@@ -1143,7 +1143,7 @@ DEF_METHOD(NV097, SET_FOG_GEN_MODE)
case NV097_SET_FOG_GEN_MODE_V_FOG_X:
mode = NV_PGRAPH_CSV0_D_FOGGENMODE_FOG_X; break;
default:
assert(false);
assert(!"Invalid fog gen mode");
break;
}
PG_SET_MASK(NV_PGRAPH_CSV0_D, NV_PGRAPH_CSV0_D_FOGGENMODE, mode);
@@ -1490,7 +1490,7 @@ static unsigned int kelvin_map_stencil_op(uint32_t parameter)
case NV097_SET_STENCIL_OP_V_DECR:
op = NV_PGRAPH_CONTROL_2_STENCIL_OP_V_DECR; break;
default:
assert(false);
assert(!"Invalid kelvin map stencil operation");
break;
}
return op;
@@ -1562,7 +1562,7 @@ static unsigned int kelvin_map_polygon_mode(uint32_t parameter)
case NV097_SET_FRONT_POLYGON_MODE_V_FILL:
mode = NV_PGRAPH_SETUPRASTER_FRONTFACEMODE_FILL; break;
default:
assert(false);
assert(!"Invalid kelvin map polygon mode");
break;
}
return mode;
@@ -1603,7 +1603,7 @@ DEF_METHOD(NV097, SET_CULL_FACE)
case NV097_SET_CULL_FACE_V_FRONT_AND_BACK:
face = NV_PGRAPH_SETUPRASTER_CULLCTRL_FRONT_AND_BACK; break;
default:
assert(false);
assert(!"Invalid cull face parameter");
break;
}
PG_SET_MASK(NV_PGRAPH_SETUPRASTER, NV_PGRAPH_SETUPRASTER_CULLCTRL, face);
@@ -1675,7 +1675,7 @@ static unsigned int kelvin_map_texgen(uint32_t parameter, unsigned int channel)
assert(channel < 3);
texgen = NV_PGRAPH_CSV1_A_T0_S_NORMAL_MAP; break;
default:
assert(false);
assert(!"Invalid kelvin map texgen parameter");
break;
}
return texgen;
@@ -2067,7 +2067,7 @@ DEF_METHOD_INC(NV097, SET_BACK_LIGHT_AMBIENT_COLOR)
pg->ltctxb_dirty[NV_IGRAPH_XF_LTCTXB_L0_BSPC + slot*6] = true;
break;
default:
assert(false);
assert(!"Invalid back light type");
break;
}
}
@@ -2135,7 +2135,7 @@ DEF_METHOD_INC(NV097, SET_LIGHT_AMBIENT_COLOR)
pg->light_local_attenuation[slot][part] = *(float*)&parameter;
break;
default:
assert(false);
assert(!"Invalid light source prop or unhandled back light prop");
break;
}
}
@@ -2440,7 +2440,7 @@ DEF_METHOD_INC(NV097, SET_VERTEX_DATA_ARRAY_FORMAT)
break;
default:
fprintf(stderr, "Unknown vertex type: 0x%x\n", attr->format);
assert(false);
assert(!"Unknown vertex type");
break;
}
@@ -3133,7 +3133,7 @@ void pgraph_get_clear_depth_stencil_value(PGRAPHState *pg, float *depth,
default:
fprintf(stderr, "Unknown zeta surface format: 0x%x\n",
pg->surface_shape.zeta_format);
assert(false);
assert(!"Unknown zeta surface format");
break;
}
}
+1 -1
View File
@@ -374,7 +374,7 @@ static inline void pgraph_apply_anti_aliasing_factor(PGRAPHState *pg,
if (height) { *height *= 2; }
break;
default:
assert(false);
assert(!"Invalid aa surface format");
break;
}
}
+2 -2
View File
@@ -34,7 +34,7 @@ uint32_t pgraph_rdi_read(PGRAPHState *pg, unsigned int select,
default:
fprintf(stderr, "nv2a: unknown rdi read select 0x%x address 0x%x\n",
select, address);
assert(false);
assert(!"Unknown rdi read select");
break;
}
return r;
@@ -46,7 +46,7 @@ void pgraph_rdi_write(PGRAPHState *pg, unsigned int select,
switch(select) {
case RDI_INDEX_VTX_CONSTANTS0:
case RDI_INDEX_VTX_CONSTANTS1:
assert(false); /* Untested */
assert(!"Untested vertex constants select"); /* Untested */
assert((address / 4) < NV2A_VERTEXSHADER_CONSTANTS);
pg->vsh_constants_dirty[address / 4] |=
(val != pg->vsh_constants[address / 4][3 - address % 4]);
+2 -2
View File
@@ -197,7 +197,7 @@ uint8_t *s3tc_decompress_3d(enum S3TC_DECOMPRESS_FORMAT color_format,
decompress_dxt5_block(data + 16 * sub_block_index, converted_data,
i, j, width, height, z_pos_factor);
} else {
assert(false);
assert(!"Invalid S3TC_DECOMPRESS_FORMAT");
}
sub_block_index++;
}
@@ -231,7 +231,7 @@ uint8_t *s3tc_decompress_2d(enum S3TC_DECOMPRESS_FORMAT color_format,
decompress_dxt5_block(data + 16 * block_index,
converted_data, i, j, width, height, 0);
} else {
assert(false);
assert(!"Invalid S3TC_DECOMPRESS_FORMAT");
}
}
}
+1 -1
View File
@@ -121,7 +121,7 @@ hwaddr pgraph_get_texture_palette_phys_addr_length(PGRAPHState *pg, int texture_
case NV_PGRAPH_TEXPALETTE0_LENGTH_128: palette_length = 128; break;
case NV_PGRAPH_TEXPALETTE0_LENGTH_64: palette_length = 64; break;
case NV_PGRAPH_TEXPALETTE0_LENGTH_32: palette_length = 32; break;
default: assert(false); break;
default: assert(!"Invalid palette length"); break;
}
if (length) {
*length = palette_length * 4;
+1 -1
View File
@@ -101,7 +101,7 @@ void pgraph_vk_image_blit(NV2AState *d)
default:
fprintf(stderr, "Unknown blit surface format: 0x%x\n",
context_surfaces->color_format);
assert(false);
assert(!"Unknown blit surface format");
break;
}
+1 -1
View File
@@ -80,7 +80,7 @@ static enum S3TC_DECOMPRESS_FORMAT kelvin_format_to_s3tc_format(int color_format
case NV097_SET_TEXTURE_FORMAT_COLOR_L_DXT45_A8R8G8B8:
return S3TC_DECOMPRESS_FORMAT_DXT5;
default:
assert(false);
assert(!"Invalid texture color format");
}
}
+1 -1
View File
@@ -188,7 +188,7 @@ void pgraph_vk_bind_vertex_attributes(NV2AState *d, unsigned int min_element,
break;
default:
fprintf(stderr, "Unknown vertex type: 0x%x\n", attr->format);
assert(false);
assert(!"Unknown vertex type");
break;
}
+6 -5
View File
@@ -57,11 +57,11 @@ uint64_t user_read(void *opaque, hwaddr addr, unsigned int size)
}
} else {
/* ramfc */
assert(false);
assert(!"Unsupported: channel_id != cur_channel_id");
}
} else {
/* PIO Mode */
assert(false);
assert(!"Failed to enter DMA mode - entered PIO mode");
}
qemu_mutex_unlock(&d->pfifo.lock);
@@ -100,7 +100,8 @@ void user_write(void *opaque, hwaddr addr, uint64_t val, unsigned int size)
d->pfifo.regs[NV_PFIFO_CACHE1_REF] = val;
break;
default:
assert(false);
NV2A_DPRINTF(true, "Unsupported NV_USER write: channel=%u offset=0x%04x\n", channel_id, (unsigned)(addr & 0xFFFF));
assert(!"Unsupported NV_USER DMA register write offset");
break;
}
@@ -108,11 +109,11 @@ void user_write(void *opaque, hwaddr addr, uint64_t val, unsigned int size)
} else {
/* ramfc */
assert(false);
assert(!"Invalid channel id");
}
} else {
/* PIO Mode */
assert(false);
assert(!"Failed to enter DMA mode - entered PIO mode");
}
qemu_mutex_unlock(&d->pfifo.lock);
+1 -1
View File
@@ -138,7 +138,7 @@ static int xbox_lpc_map_irq(PCIDevice *pci_dev, int intx)
case 30: return XBOX_NUM_INT_IRQS + 2; /* agp bridge -> PIRQC, IRQ 3 */
default:
/* don't actually know how this should work */
assert(false);
assert(!"Mapping LPC to IRQ failed");
return XBOX_NUM_INT_IRQS + ((slot + intx) & 3);
}
}
+3 -3
View File
@@ -139,7 +139,7 @@ static void usb_xid_gamepad_handle_data(USBDevice *dev, USBPacket *p)
update_input(s);
usb_packet_copy(p, &s->in_state, s->in_state.bLength);
} else {
assert(false);
assert(!"Invalid GAMEPAD_IN_ENDPOINT_ID");
}
break;
case USB_TOKEN_OUT:
@@ -147,12 +147,12 @@ static void usb_xid_gamepad_handle_data(USBDevice *dev, USBPacket *p)
usb_packet_copy(p, &s->out_state, s->out_state.length);
update_output(s);
} else {
assert(false);
assert(!"Invalid GAMEPAD_OUT_ENDPOINT_ID");
}
break;
default:
p->status = USB_RET_STALL;
assert(false);
assert(!"Invalid USB pid");
break;
}
}
+5 -5
View File
@@ -135,7 +135,7 @@ void usb_xid_handle_control(USBDevice *dev, USBPacket *p,
}
} else {
p->status = USB_RET_STALL;
assert(false);
assert(!"USB XID failed to GET_REPORT");
}
break;
case ClassInterfaceOutRequest | HID_SET_REPORT:
@@ -155,7 +155,7 @@ void usb_xid_handle_control(USBDevice *dev, USBPacket *p,
update_output(s);
} else {
p->status = USB_RET_STALL;
assert(false);
assert(!"USB XID failed to SET_REPORT");
}
break;
/* XID requests */
@@ -167,7 +167,7 @@ void usb_xid_handle_control(USBDevice *dev, USBPacket *p,
p->actual_length = s->xid_desc->bLength;
} else {
p->status = USB_RET_STALL;
assert(false);
assert(!"USB XID failed to GET_DESCRIPTOR");
}
break;
case VendorInterfaceRequest | XID_GET_CAPABILITIES:
@@ -186,7 +186,7 @@ void usb_xid_handle_control(USBDevice *dev, USBPacket *p,
p->actual_length = length;
} else {
p->status = USB_RET_STALL;
assert(false);
assert(!"USB XID failed to GET_CAPABILITIES");
}
break;
case ((USB_DIR_IN|USB_TYPE_CLASS|USB_RECIP_DEVICE)<<8)
@@ -210,7 +210,7 @@ void usb_xid_handle_control(USBDevice *dev, USBPacket *p,
default:
DPRINTF("xid USB stalled on request 0x%x value 0x%x\n", request, value);
p->status = USB_RET_STALL;
assert(false);
assert(!"USB XID stalled on request");
break;
}
}