mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 18:08:20 -07:00
general minor code cleanups. fix logs, send vram writes (0x1000000-0x17fffff), if these ever happen, to DFB, and more
This commit is contained in:
@@ -137,12 +137,18 @@ option(GDBSTUB "Enable GDB stub server for debugging"
|
||||
option(DEV_BRANCH "Development branch" OFF)
|
||||
option(DISCORD "Discord Rich Presence support" ON)
|
||||
option(DEBUGREGS486 "Enable debug register opeartion on 486+ CPUs" OFF)
|
||||
# Remove when merged, should just be -D
|
||||
option(NV_LOG "NVidia RIVA 128 debug logging" OFF)
|
||||
option(NV_LOG_ULTRA "Even more NVidia RIVA 128 debug logging" OFF)
|
||||
|
||||
if (NV_LOG)
|
||||
add_compile_definitions(ENABLE_NV_LOG)
|
||||
endif()
|
||||
|
||||
if (NV_LOG_ULTRA)
|
||||
add_compile_definitions(ENABLE_NV_LOG_ULTRA)
|
||||
endif()
|
||||
|
||||
if((ARCH STREQUAL "arm64") OR (ARCH STREQUAL "arm"))
|
||||
set(NEW_DYNAREC ON)
|
||||
else()
|
||||
@@ -193,6 +199,7 @@ cmake_dependent_option(PCL "Generic PCL5e Printer"
|
||||
cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF)
|
||||
cmake_dependent_option(WACOM "Wacom Input Devices" ON "DEV_BRANCH" OFF)
|
||||
cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF)
|
||||
cmake_dependent_option(NV3 "NVidia RIVA 128/128ZX (NV3/NV3T)" ON "DEV_BRANCH" OFF)
|
||||
|
||||
# Ditto but for Qt
|
||||
if(QT)
|
||||
|
||||
@@ -1454,7 +1454,7 @@ void nv3_speed_changed(void *priv);
|
||||
void nv3_recalc_timings(svga_t* svga);
|
||||
void nv3_force_redraw(void* priv);
|
||||
|
||||
// Memory Mapping
|
||||
/* BAR0 GPU MMIO read */
|
||||
void nv3_update_mappings(); // Update memory mappings
|
||||
uint8_t nv3_mmio_read8(uint32_t addr, void* priv); // Read 8-bit MMIO
|
||||
uint16_t nv3_mmio_read16(uint32_t addr, void* priv); // Read 16-bit MMIO
|
||||
@@ -1544,10 +1544,7 @@ uint32_t nv3_pvideo_read(uint32_t address);
|
||||
void nv3_pvideo_write(uint32_t address, uint32_t value);
|
||||
uint32_t nv3_pramdac_read(uint32_t address);
|
||||
void nv3_pramdac_write(uint32_t address, uint32_t value);
|
||||
uint32_t nv3_vram_read(uint32_t address);
|
||||
void nv3_vram_write(uint32_t address, uint32_t value);
|
||||
#define nv3_nvm_read nv3_vram_read
|
||||
#define nv3_nvm_write nv3_vram_write
|
||||
|
||||
uint32_t nv3_user_read(uint32_t address);
|
||||
void nv3_user_write(uint32_t address, uint32_t value);
|
||||
#define nv3_object_submit_start nv3_user_read
|
||||
@@ -1641,5 +1638,5 @@ void nv3_ptimer_tick(double real_time);
|
||||
// NV3 PVIDEO
|
||||
void nv3_pvideo_init();
|
||||
|
||||
// NV3 PMEDIA (Mediaport)
|
||||
// NV3 PME (Mediaport)
|
||||
void nv3_pmedia_init();
|
||||
@@ -39,9 +39,11 @@ void nv3_class_001_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
else
|
||||
nv3->pgraph.beta_factor = param & 0x7F800000;
|
||||
|
||||
nv_log("Method Execution: Beta Factor = %02x", nv3->pgraph.beta_factor);
|
||||
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,10 @@ void nv3_class_002_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
{
|
||||
case NV3_ROP_SET_ROP:
|
||||
nv3->pgraph.rop = param & 0xFF;
|
||||
nv_log("Method Execution: ROP = %02x\n", nv3->pgraph.rop);
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void nv3_class_003_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.chroma_key = nv3_render_to_chroma(expanded_color);
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_004_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@ void nv3_class_005_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
case NV3_CLIP_POSITION:
|
||||
nv3->pgraph.clip_start.x = (param >> 16) & 0xFFFF;
|
||||
nv3->pgraph.clip_start.y = (param) & 0xFFFF;
|
||||
nv_log("Clip Position: %d,%d\n", nv3->pgraph.clip_start.x, nv3->pgraph.clip_start.y);
|
||||
nv_log("Method Execution: Clip Position: %d,%d\n", nv3->pgraph.clip_start.x, nv3->pgraph.clip_start.y);
|
||||
break;
|
||||
case NV3_CLIP_SIZE:
|
||||
nv3->pgraph.clip_size.x = (param >> 16) & 0xFFFF;
|
||||
nv3->pgraph.clip_size.y = (param) & 0xFFFF;
|
||||
nv_log("Clip Size: %d,%d\n", nv3->pgraph.clip_start.x, nv3->pgraph.clip_start.y);
|
||||
nv_log("Method Execution: Clip Size: %d,%d\n", nv3->pgraph.clip_start.x, nv3->pgraph.clip_start.y);
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void nv3_class_006_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ void nv3_class_007_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.rectangle.size[index].w = param & 0xFFFF;
|
||||
nv3->pgraph.rectangle.size[index].h = (param >> 16) & 0xFFFF;
|
||||
|
||||
nv_log("Rect%d Size=%d,%d Color=0x%08x\n", index, nv3->pgraph.rectangle.size[index].w, nv3->pgraph.rectangle.size[index].h, nv3->pgraph.rectangle.color);
|
||||
nv_log("Method Execution: Rect%d Size=%d,%d Color=0x%08x\n", index, nv3->pgraph.rectangle.size[index].w, nv3->pgraph.rectangle.size[index].h, nv3->pgraph.rectangle.color);
|
||||
|
||||
nv3_render_rect(nv3->pgraph.rectangle.position[index], nv3->pgraph.rectangle.size[index], nv3->pgraph.rectangle.color, grobj);
|
||||
}
|
||||
@@ -56,7 +56,7 @@ void nv3_class_007_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.rectangle.position[index].x = param & 0xFFFF;
|
||||
nv3->pgraph.rectangle.position[index].y = (param >> 16) & 0xFFFF;
|
||||
|
||||
nv_log("Rect%d Position=%d,%d\n", index, nv3->pgraph.rectangle.position[index].x, nv3->pgraph.rectangle.position[index].y);
|
||||
nv_log("Method Execution: Rect%d Position=%d,%d\n", index, nv3->pgraph.rectangle.position[index].x, nv3->pgraph.rectangle.position[index].y);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_008_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_009_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void nv3_class_00a_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_00b_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,32 +37,39 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
/* NOTE: This method is used by the GDI driver as part of the notification engine. */
|
||||
case NV3_W95TXT_A_COLOR:
|
||||
nv3->pgraph.win95_gdi_text.color_a = param;
|
||||
nv_log("Method Execution: GDI-A Color 0x%08x\n", nv3->pgraph.win95_gdi_text.color_a);
|
||||
break;
|
||||
/* Type B and C not implemented YET, as they are not used by NT GDI driver */
|
||||
case NV3_W95TXT_D_CLIP_TOPLEFT:
|
||||
nv3->pgraph.win95_gdi_text.clip_d.left = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.clip_d.top = ((param >> 16) & 0xFFFF);
|
||||
nv_log("Method Execution: GDI-A Clip Left,Top %04x,%04x\n", nv3->pgraph.win95_gdi_text.clip_d.left, nv3->pgraph.win95_gdi_text.clip_d.top);
|
||||
break;
|
||||
case NV3_W95TXT_D_CLIP_BOTTOMRIGHT:
|
||||
nv3->pgraph.win95_gdi_text.clip_d.right = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.clip_d.bottom = ((param >> 16) & 0xFFFF);
|
||||
/* is it "only if we are out of the top left or the bottom right or is it "all of them"*/
|
||||
nv_log("Method Execution: GDI-A Clip Right,Bottom %04x,%04x\n", nv3->pgraph.win95_gdi_text.clip_d.left, nv3->pgraph.win95_gdi_text.clip_d.top);
|
||||
break;
|
||||
case NV3_W95TXT_D_CLIP_COLOR:
|
||||
nv3->pgraph.win95_gdi_text.color1_d = param;
|
||||
nv_log("Method Execution: GDI-D Color 0x%08x\n", nv3->pgraph.win95_gdi_text.color_a);
|
||||
break;
|
||||
case NV3_W95TXT_D_CLIP_SIZE_IN:
|
||||
nv3->pgraph.win95_gdi_text.size_in_d.w = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.size_in_d.h = ((param >> 16) & 0xFFFF);
|
||||
nv_log("Method Execution: GDI-D Size In %04x,%04x\n", nv3->pgraph.win95_gdi_text.size_in_d.w, nv3->pgraph.win95_gdi_text.size_in_d.h);
|
||||
break;
|
||||
case NV3_W95TXT_D_CLIP_SIZE_OUT:
|
||||
nv3->pgraph.win95_gdi_text.size_out_d.w = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.size_out_d.h = ((param >> 16) & 0xFFFF);
|
||||
nv_log("Method Execution: GDI-D Size Out %04x,%04x\n", nv3->pgraph.win95_gdi_text.size_out_d.w, nv3->pgraph.win95_gdi_text.size_out_d.h);
|
||||
break;
|
||||
case NV3_W95TXT_D_CLIP_POSITION:
|
||||
nv3->pgraph.win95_gdi_text.point_d.x = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.point_d.y = ((param >> 16) & 0xFFFF);
|
||||
|
||||
nv_log("Method Execution: GDI-D Point %04x,%04x\n", nv3->pgraph.win95_gdi_text.point_d.x, nv3->pgraph.win95_gdi_text.point_d.y);
|
||||
|
||||
/* small case*/
|
||||
if (nv3->pgraph.win95_gdi_text.size_in_d.w < 0x0010)
|
||||
{
|
||||
@@ -90,17 +97,21 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
break;
|
||||
case NV3_W95TXT_E_CLIP_COLOR_0:
|
||||
nv3->pgraph.win95_gdi_text.color0_e = param;
|
||||
nv_log("Method Execution: GDI-E Color0 0x%08x\n", nv3->pgraph.win95_gdi_text.color_a);
|
||||
break;
|
||||
case NV3_W95TXT_E_CLIP_COLOR_1:
|
||||
nv3->pgraph.win95_gdi_text.color1_e = param;
|
||||
nv_log("Method Execution: GDI-E Color1 0x%08x\n", nv3->pgraph.win95_gdi_text.color_a);
|
||||
break;
|
||||
case NV3_W95TXT_E_CLIP_SIZE_IN:
|
||||
nv3->pgraph.win95_gdi_text.size_in_e.w = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.size_in_e.h = ((param >> 16) & 0xFFFF);
|
||||
nv_log("Method Execution: GDI-E Size In %04x,%04x\n", nv3->pgraph.win95_gdi_text.size_in_e.w, nv3->pgraph.win95_gdi_text.size_in_e.h);
|
||||
break;
|
||||
case NV3_W95TXT_E_CLIP_SIZE_OUT:
|
||||
nv3->pgraph.win95_gdi_text.size_out_e.w = (param & 0xFFFF);
|
||||
nv3->pgraph.win95_gdi_text.size_out_e.h = ((param >> 16) & 0xFFFF);
|
||||
nv_log("Method Execution: GDI-E Size Out %04x,%04x\n", nv3->pgraph.win95_gdi_text.size_out_e.w, nv3->pgraph.win95_gdi_text.size_out_e.h);
|
||||
break;
|
||||
case NV3_W95TXT_E_CLIP_POSITION:
|
||||
nv3->pgraph.win95_gdi_text.point_e.x = (param & 0xFFFF);
|
||||
@@ -110,8 +121,9 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
|
||||
//nv3->pgraph.win95_gdi_text_current_position.x = (nv3->pgraph.win95_gdi_text.point_e.x + large_start);
|
||||
nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_e.x;
|
||||
nv3->pgraph.win95_gdi_text_current_position.y = (nv3->pgraph.win95_gdi_text.point_e.y);
|
||||
nv3->pgraph.win95_gdi_text_current_position.y = nv3->pgraph.win95_gdi_text.point_e.y;
|
||||
|
||||
nv_log("Method Execution: GDI-E Point %04x,%04x\n", nv3->pgraph.win95_gdi_text.point_e.x, nv3->pgraph.win95_gdi_text.point_e.y);
|
||||
break;
|
||||
default:
|
||||
/* Type A submission: these are the same things as rectangles */
|
||||
@@ -125,7 +137,7 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.win95_gdi_text.rect_a_size[index].w = param & 0xFFFF;
|
||||
nv3->pgraph.win95_gdi_text.rect_a_size[index].h = (param >> 16) & 0xFFFF;
|
||||
|
||||
nv_log("Rect GDI-A%d Size=%d,%d Color=0x%08x\n", index, nv3->pgraph.win95_gdi_text.rect_a_size[index].w,
|
||||
nv_log("Method Execution: Rect GDI-A%d Size=%d,%d Color=0x%08x\n", index, nv3->pgraph.win95_gdi_text.rect_a_size[index].w,
|
||||
nv3->pgraph.win95_gdi_text.rect_a_size[index].h, nv3->pgraph.win95_gdi_text.color_a);
|
||||
|
||||
nv3_render_rect(nv3->pgraph.win95_gdi_text.rect_a_position[index],
|
||||
@@ -136,7 +148,7 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.win95_gdi_text.rect_a_position[index].x = param & 0xFFFF;
|
||||
nv3->pgraph.win95_gdi_text.rect_a_position[index].y = (param >> 16) & 0xFFFF;
|
||||
|
||||
nv_log("Rect GDI-A%d Position=%d,%d\n", index,
|
||||
nv_log("Method Execution: Rect GDI-A%d Position=%d,%d\n", index,
|
||||
nv3->pgraph.win95_gdi_text.rect_a_position[index].x, nv3->pgraph.win95_gdi_text.rect_a_position[index].y);
|
||||
}
|
||||
return;
|
||||
@@ -149,7 +161,7 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.win95_gdi_text.mono_color1_d[index] = param;
|
||||
|
||||
/* Mammoth logger! */
|
||||
nv_log("Rect GDI-D%d Data=%08x SizeIn%04x,%04x SizeOut%04x,%04x Point%04x,%04x Color=%08x Clip Left=0x%04x Right=0x%04x Top=0x%04x Bottom=0x%04x",
|
||||
nv_log("Method Execution: Rect GDI-D%d Data=%08x SizeIn%04x,%04x SizeOut%04x,%04x Point%04x,%04x Color=%08x Clip Left=0x%04x Right=0x%04x Top=0x%04x Bottom=0x%04x",
|
||||
index, param, nv3->pgraph.win95_gdi_text.size_in_d.w, nv3->pgraph.win95_gdi_text.size_in_d.h,
|
||||
nv3->pgraph.win95_gdi_text.size_out_d.w, nv3->pgraph.win95_gdi_text.size_out_d.h,
|
||||
nv3->pgraph.win95_gdi_text.point_d.x, nv3->pgraph.win95_gdi_text.point_d.y,
|
||||
@@ -167,7 +179,7 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
nv3->pgraph.win95_gdi_text.mono_color1_d[index] = param;
|
||||
|
||||
/* Mammoth logger! */
|
||||
nv_log("Rect GDI-E%d Data=%08x SizeIn%04x,%04x SizeOut%04x,%04x Point%04x,%04x Color=%08x Clip Left=0x%04x Right=0x%04x Top=0x%04x Bottom=0x%04x",
|
||||
nv_log("Method Execution: Rect GDI-E%d Data=%08x SizeIn%04x,%04x SizeOut%04x,%04x Point%04x,%04x Color=%08x Clip Left=0x%04x Right=0x%04x Top=0x%04x Bottom=0x%04x",
|
||||
index, param, nv3->pgraph.win95_gdi_text.size_in_e.w, nv3->pgraph.win95_gdi_text.size_in_e.h,
|
||||
nv3->pgraph.win95_gdi_text.size_out_e.w, nv3->pgraph.win95_gdi_text.size_out_e.h,
|
||||
nv3->pgraph.win95_gdi_text.point_e.x, nv3->pgraph.win95_gdi_text.point_e.y,
|
||||
@@ -178,7 +190,7 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
return;
|
||||
}
|
||||
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_00d_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_00e_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void nv3_class_010_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,17 +49,19 @@ void nv3_class_011_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
case NV3_IMAGE_START_POSITION:
|
||||
nv3->pgraph.image.point.x = (param & 0xFFFF);
|
||||
nv3->pgraph.image.point.y = (param >> 16);
|
||||
nv_log("Image Point=%d,%d", nv3->pgraph.image.point.x, nv3->pgraph.image.point.y);
|
||||
nv_log("Method Execution: Image Point=%d,%d\n", nv3->pgraph.image.point.x, nv3->pgraph.image.point.y);
|
||||
break;
|
||||
/* Seems to allow scaling of the bitblt. */
|
||||
case NV3_IMAGE_SIZE:
|
||||
nv3->pgraph.image.size.w = (param & 0xFFFF);
|
||||
nv3->pgraph.image.size.h = (param >> 16);
|
||||
nv_log("Method Execution: Image Size (Clip)=%d,%d\n", nv3->pgraph.image.size.w, nv3->pgraph.image.size.h);
|
||||
break;
|
||||
case NV3_IMAGE_SIZE_IN:
|
||||
nv3->pgraph.image.size_in.w = (param & 0xFFFF);
|
||||
nv3->pgraph.image.size_in.h = (param >> 16);
|
||||
nv3->pgraph.image_current_position = nv3->pgraph.image.point;
|
||||
nv_log("Method Execution: Image SizeIn=%d,%d\n", nv3->pgraph.image.size_in.w, nv3->pgraph.image.size_in.h);
|
||||
break;
|
||||
default:
|
||||
if (method_id >= NV3_IMAGE_COLOR_START && method_id <= NV3_IMAGE_COLOR_END)
|
||||
@@ -67,7 +69,8 @@ void nv3_class_011_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
// shift left by 2 because it's 4 bits per si\e..
|
||||
uint32_t pixel_slot = (method_id - NV3_IMAGE_COLOR_START) >> 2;
|
||||
uint32_t current_buffer = (nv3->pgraph.context_switch >> NV3_PGRAPH_CONTEXT_SWITCH_SRC_BUFFER) & 0x03;
|
||||
|
||||
nv_log("Method Execution: Pixel%d Colour%08x Format%x\n", pixel_slot, param, (grobj.grobj_0) & 0x07);
|
||||
|
||||
/* todo: a lot of stuff */
|
||||
|
||||
uint32_t pixel0 = 0, pixel1 = 0, pixel2 = 0, pixel3 = 0;
|
||||
@@ -130,7 +133,7 @@ void nv3_class_011_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
}
|
||||
else
|
||||
{
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void nv3_class_012_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void nv3_class_014_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_015_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void nv3_class_017_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void nv3_class_018_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
switch (method_id)
|
||||
{
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ void nv3_class_01c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
|
||||
nv3->pgraph.bpixel[src_buffer_id] = (real_format | NV3_BPIXEL_FORMAT_IS_VALID);
|
||||
|
||||
nv_log("Image in Memory BUF%d COLOR_FORMAT=0x%04x", src_buffer_id, param);
|
||||
nv_log("Method Execution: Image in Memory BUF%d COLOR_FORMAT=0x%04x\n", src_buffer_id, param);
|
||||
|
||||
break;
|
||||
/* DOn't log invalid */
|
||||
@@ -70,20 +70,19 @@ void nv3_class_01c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
|
||||
break;
|
||||
/* Pitch - length between scanlines */
|
||||
case NV3_IMAGE_IN_MEMORY_PITCH:
|
||||
|
||||
nv3->pgraph.image_in_memory.pitch = param & 0x1FF0;
|
||||
nv3->pgraph.bpitch[src_buffer_id] = param & 0x1FF0; // 12:0
|
||||
|
||||
nv_log("Image in Memory BUF%d PITCH=0x%04x", src_buffer_id, nv3->pgraph.bpitch[src_buffer_id]);
|
||||
nv_log("Method Execution: Image in Memory BUF%d PITCH=0x%04x\n", src_buffer_id, nv3->pgraph.bpitch[src_buffer_id]);
|
||||
break;
|
||||
/* Byte offset in GPU VRAM of top left pixel (22:0) */
|
||||
case NV3_IMAGE_IN_MEMORY_TOP_LEFT_OFFSET:
|
||||
nv3->pgraph.boffset[src_buffer_id] = param & ((1 << NV3_IMAGE_IN_MEMORY_TOP_LEFT_OFFSET_END) - 0x10);
|
||||
|
||||
nv_log("Image in Memory BUF%d TOP_LEFT_OFFSET=0x%08x", src_buffer_id, nv3->pgraph.boffset[src_buffer_id]);
|
||||
nv_log("Method Execution: Image in Memory BUF%d TOP_LEFT_OFFSET=0x%08x\n", src_buffer_id, nv3->pgraph.boffset[src_buffer_id]);
|
||||
break;
|
||||
default:
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv_log("%s: Invalid or Unimplemented method 0x%04x\n", nv3_class_names[context.class_id & 0x1F], method_id);
|
||||
nv3_pgraph_interrupt_invalid(NV3_PGRAPH_INTR_1_SOFTWARE_METHOD_PENDING);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ uint16_t nv3_mmio_read16(uint32_t addr, void* priv)
|
||||
ret = nv3_svga_in(real_address, nv3)
|
||||
| (nv3_svga_in(real_address + 1, nv3) << 8);
|
||||
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
//#ifdef ENABLE_NV_LOG_ULTRA
|
||||
nv_log("Redirected MMIO read16 to SVGA: addr=0x%04x returned 0x%04x\n", addr, ret);
|
||||
#endif
|
||||
//#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ uint32_t nv3_mmio_read32(uint32_t addr, void* priv)
|
||||
| (nv3_svga_in(real_address + 2, nv3) << 16)
|
||||
| (nv3_svga_in(real_address + 3, nv3) << 24);
|
||||
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
//#ifdef ENABLE_NV_LOG_ULTRA
|
||||
nv_log("Redirected MMIO read32 to SVGA: addr=0x%04x returned 0x%04x\n", addr, ret);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -147,9 +147,9 @@ void nv3_mmio_write8(uint32_t addr, uint8_t val, void* priv)
|
||||
// svga writes are not logged anyway rn
|
||||
uint32_t real_address = addr & 0x3FF;
|
||||
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
//#ifdef ENABLE_NV_LOG_ULTRA
|
||||
nv_log("Redirected MMIO write8 to SVGA: addr=0x%04x val=0x%02x\n", addr, val);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
nv3_svga_out(real_address, val & 0xFF, nv3);
|
||||
|
||||
@@ -176,9 +176,9 @@ void nv3_mmio_write16(uint32_t addr, uint16_t val, void* priv)
|
||||
// svga writes are not logged anyway rn
|
||||
uint32_t real_address = addr & 0x3FF;
|
||||
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
//#ifdef ENABLE_NV_LOG_ULTRA
|
||||
nv_log("Redirected MMIO write16 to SVGA: addr=0x%04x val=0x%02x\n", addr, val);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
nv3_svga_out(real_address, val & 0xFF, nv3);
|
||||
nv3_svga_out(real_address + 1, (val >> 8) & 0xFF, nv3);
|
||||
@@ -206,9 +206,9 @@ void nv3_mmio_write32(uint32_t addr, uint32_t val, void* priv)
|
||||
// svga writes are not logged anyway rn
|
||||
uint32_t real_address = addr & 0x3FF;
|
||||
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
//#ifdef ENABLE_NV_LOG_ULTRA
|
||||
nv_log("Redirected MMIO write32 to SVGA: addr=0x%04x val=0x%02x\n", addr, val);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
nv3_svga_out(real_address, val & 0xFF, nv3);
|
||||
nv3_svga_out(real_address + 1, (val >> 8) & 0xFF, nv3);
|
||||
@@ -842,7 +842,7 @@ void nv3_prom_write(uint32_t address, uint32_t value)
|
||||
// Initialise the MMIO mappings
|
||||
void nv3_init_mappings_mmio()
|
||||
{
|
||||
nv_log("Initialising 32MB MMIO area\n");
|
||||
nv_log("Initialising MMIO mapping\n");
|
||||
|
||||
// 0x0 - 1000000: regs
|
||||
// 0x1000000-2000000
|
||||
@@ -1107,6 +1107,7 @@ void* nv3_init(const device_t *info)
|
||||
nv3->pci_config.pci_regs[PCI_REG_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEM;
|
||||
|
||||
// svga is done, so now initialise the real gpu
|
||||
|
||||
nv_log("Initialising GPU core...\n");
|
||||
|
||||
nv3_pextdev_init(); // Initialise Straps
|
||||
|
||||
@@ -100,12 +100,12 @@ uint32_t nv3_mmio_arbitrate_read(uint32_t address)
|
||||
else if (address >= NV3_PRAMDAC_START && address <= NV3_PRAMDAC_END)
|
||||
ret = nv3_pramdac_read(address);
|
||||
else if (address >= NV3_VRAM_START && address <= NV3_VRAM_END)
|
||||
ret = nv3_vram_read(address);
|
||||
ret = nv3_dfb_read32(address & nv3->nvbase.svga.vram_mask, &nv3->nvbase.svga);
|
||||
else if (address >= NV3_USER_START && address <= NV3_USER_END)
|
||||
ret = nv3_user_read(address);
|
||||
else
|
||||
{
|
||||
nv_log("MMIO read arbitration failed, INVALID address NOT mapped to any GPU subsystem 0x%08x [returning 0x00]\n", address);
|
||||
warning("MMIO read arbitration failed, INVALID address NOT mapped to any GPU subsystem 0x%08x [returning 0x00]\n", address);
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
@@ -161,13 +161,13 @@ void nv3_mmio_arbitrate_write(uint32_t address, uint32_t value)
|
||||
else if (address >= NV3_PRAMDAC_START && address <= NV3_PRAMDAC_END)
|
||||
nv3_pramdac_write(address, value);
|
||||
else if (address >= NV3_VRAM_START && address <= NV3_VRAM_END)
|
||||
nv3_vram_write(address, value);
|
||||
nv3_dfb_write32(address, value, &nv3->nvbase.svga);
|
||||
else if (address >= NV3_USER_START && address <= NV3_USER_END)
|
||||
nv3_user_write(address, value);
|
||||
//RAMIN is its own thing
|
||||
else
|
||||
{
|
||||
nv_log("MMIO write arbitration failed, INVALID address NOT mapped to any GPU subsystem 0x%08x\n", address);
|
||||
warning("MMIO write arbitration failed, INVALID address NOT mapped to any GPU subsystem 0x%08x\n", address);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -192,6 +192,3 @@ void nv3_palt_write(uint32_t address, uint32_t value) {};
|
||||
// TODO: PGRAPH class registers
|
||||
uint32_t nv3_prmcio_read(uint32_t address) { return 0; };
|
||||
void nv3_prmcio_write(uint32_t address, uint32_t value) {};
|
||||
|
||||
uint32_t nv3_vram_read(uint32_t address) { return 0; };
|
||||
void nv3_vram_write(uint32_t address, uint32_t value) {};
|
||||
@@ -187,6 +187,9 @@ void nv3_pfb_config0_write(uint32_t val)
|
||||
uint32_t new_pfb_vtotal = new_pfb_htotal * (3.0/4.0);
|
||||
uint32_t new_bit_depth = (nv3->pfb.config_0 >> 8) & 0x03;
|
||||
|
||||
|
||||
// This doesn't actually seem very useful
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
nv_log("Framebuffer Config Change\n");
|
||||
nv_log("Horizontal Size=%d pixels\n", new_pfb_htotal);
|
||||
nv_log("Vertical Size @ 4:3=%d pixels\n", new_pfb_vtotal);
|
||||
@@ -197,5 +200,6 @@ void nv3_pfb_config0_write(uint32_t val)
|
||||
nv_log("Bit Depth=16bpp\n");
|
||||
else if (new_bit_depth == NV3_PFB_CONFIG_0_DEPTH_32BPP)
|
||||
nv_log("Bit Depth=32bpp\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -508,8 +508,7 @@ void nv3_debug_ramin_print_context_info(uint32_t name, nv3_ramin_context_t conte
|
||||
|
||||
nv_log("Context:\n");
|
||||
nv_log("DMA Channel %d (0-7 valid)\n", context.channel);
|
||||
nv_log("Class ID: as represented in ramin=%04x, Stupid 5 bit version (the actual id)=0x%04x (%s)\n", context.class_id,
|
||||
context.class_id & 0x1F, nv3_class_names[context.class_id & 0x1F]);
|
||||
nv_log("Class ID: =0x%04x (%s)\n", context.class_id & 0x1F, nv3_class_names[context.class_id & 0x1F]);
|
||||
nv_log("Render Engine %d (0=Software, also DMA? 1=Accelerated Renderer)\n", context.is_rendering);
|
||||
nv_log("PRAMIN Offset 0x%08x\n", context.ramin_offset << 4);
|
||||
#endif
|
||||
|
||||
@@ -37,12 +37,11 @@ uint32_t nv3_user_read(uint32_t address)
|
||||
//todo: print out the subchannel
|
||||
uint8_t method_offset = (address & 0x1FFC);
|
||||
|
||||
#ifdef ENABLE_NV_LOG_ULTRA
|
||||
uint8_t channel = (address - NV3_USER_START) / 0x10000;
|
||||
uint8_t subchannel = ((address - NV3_USER_START)) / 0x2000 % NV3_DMA_SUBCHANNELS_PER_CHANNEL;
|
||||
|
||||
nv_log("User Submission Area PIO Channel %d.%d method_offset=0x%04x\n", channel, subchannel, method_offset);
|
||||
#endif
|
||||
|
||||
|
||||
// 0x10 is free CACHE1 object
|
||||
// TODO: THERE ARE OTHER STUFF!
|
||||
@@ -55,7 +54,7 @@ uint32_t nv3_user_read(uint32_t address)
|
||||
|
||||
}
|
||||
|
||||
nv_log("IT'S NOT IMPLEMENTED!!!!\n", method_offset);
|
||||
nv_log("IT'S NOT IMPLEMENTED!!!! offset=0x%04x\n", method_offset);
|
||||
|
||||
|
||||
return 0x00;
|
||||
|
||||
@@ -72,8 +72,12 @@ void nv_log(const char *fmt, ...)
|
||||
}
|
||||
}
|
||||
#else
|
||||
void
|
||||
nv_log(const char *fmt, ...)
|
||||
void nv_log(const char *fmt, ...)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void nv_log_set_device(void* device)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user