|
|
|
|
@@ -580,14 +580,14 @@ iidxhook_util_d3d9_iidx13_fix_song_select_bg(struct hook_d3d9_irp *irp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
iidxhook_util_d3d9_iidx11_to_17_fix_uvs_bg_videos(struct hook_d3d9_irp *irp)
|
|
|
|
|
iidxhook_util_d3d9_iidx09_to_17_fix_uvs_bg_videos(struct hook_d3d9_irp *irp)
|
|
|
|
|
{
|
|
|
|
|
log_assert(irp);
|
|
|
|
|
log_assert(irp->op == HOOK_D3D9_IRP_OP_DEV_DRAW_PRIMITIVE_UP);
|
|
|
|
|
|
|
|
|
|
/* same code taken from the d3d8 module. but, this just fixes the quad
|
|
|
|
|
seam issue as there are no reports of streched bg videos */
|
|
|
|
|
if (iidxhook_util_d3d9_config.iidx11_to_17_fix_uvs_bg_videos &&
|
|
|
|
|
if (iidxhook_util_d3d9_config.iidx09_to_17_fix_uvs_bg_videos &&
|
|
|
|
|
irp->args.dev_draw_primitive_up.primitive_type == D3DPT_TRIANGLEFAN &&
|
|
|
|
|
irp->args.dev_draw_primitive_up.primitive_count == 2 &&
|
|
|
|
|
irp->args.dev_draw_primitive_up.stride == 28) {
|
|
|
|
|
@@ -632,52 +632,100 @@ iidxhook_util_d3d9_iidx11_to_17_fix_uvs_bg_videos(struct hook_d3d9_irp *irp)
|
|
|
|
|
/* different versions have different themes and position the bg
|
|
|
|
|
video on slightly different positions (good job...) */
|
|
|
|
|
if (/* single */
|
|
|
|
|
((vertices[0].x >= 164.0f && vertices[0].x <= 168.0f &&
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[0].y, 0.0f, 0.1f)) &&
|
|
|
|
|
(vertices[1].x >= 472.0f && vertices[1].x <= 476.0f &&
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[1].y, 0.0f, 0.1f)) &&
|
|
|
|
|
(vertices[2].x >= 472.0f && vertices[2].x <= 476.0f &&
|
|
|
|
|
(vertices[0].x >= 164.0f && vertices[0].x <= 168.0f &&
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[0].y, 0.0f, 0.1f) &&
|
|
|
|
|
vertices[1].x >= 472.0f && vertices[1].x <= 476.1f &&
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[1].y, 0.0f, 0.1f) &&
|
|
|
|
|
vertices[2].x >= 472.0f && vertices[2].x <= 476.1f &&
|
|
|
|
|
((iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[2].y, 415.0f, 0.1f)) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[2].y, 416.0f, 0.1f)) &&
|
|
|
|
|
(vertices[3].x >= 164.0f && vertices[3].x <= 168.0f &&
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[3].y, 416.0f, 0.1f))) ||
|
|
|
|
|
vertices[3].x >= 164.0f && vertices[3].x <= 168.0f &&
|
|
|
|
|
((iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[3].y, 415.0f, 0.1f)) ||
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[3].y, 416.0f, 0.1f)))) ||
|
|
|
|
|
/* double top left */
|
|
|
|
|
((iidxhook_util_d3d9_float_equal(vertices[0].x, 6.0f, 0.1f) &&
|
|
|
|
|
vertices[0].y >= 24.0f && vertices[0].y <= 28.0f) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].x, 147.0f, 0.1f) &&
|
|
|
|
|
vertices[1].y >= 24.0f && vertices[1].y <= 28.0f) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].x, 147.0f, 0.1f) &&
|
|
|
|
|
vertices[2].y >= 212.0f && vertices[2].y <= 216.0f) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].x, 6.0f, 0.1f) &&
|
|
|
|
|
vertices[3].y >= 212.0f && vertices[3].y <= 216.0f)) ||
|
|
|
|
|
((iidxhook_util_d3d9_float_equal(vertices[0].x, 6.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[0].x, 11.0f, 0.1f)) &&
|
|
|
|
|
vertices[0].y >= 23.9f && vertices[0].y <= 28.0f &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].x, 137.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[1].x, 147.0f, 0.1f)) &&
|
|
|
|
|
vertices[1].y >= 23.9f && vertices[1].y <= 28.0f &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].x, 137.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[2].x, 147.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].y, 192.0f, 0.1f) ||
|
|
|
|
|
(vertices[2].y >= 212.0f && vertices[2].y <= 216.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].x, 6.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[3].x, 11.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].y, 192.0f, 0.1f) ||
|
|
|
|
|
(vertices[3].y >= 212.0f && vertices[3].y <= 216.0f))) ||
|
|
|
|
|
/* double bottom left */
|
|
|
|
|
((iidxhook_util_d3d9_float_equal(vertices[0].x, 6.0f, 0.1f) &&
|
|
|
|
|
vertices[0].y >= 216.0f && vertices[0].y <= 220.0f) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].x, 147.0f, 0.1f) &&
|
|
|
|
|
vertices[1].y >= 216.0f && vertices[1].y <= 220.0f) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].x, 147.0f, 0.1) &&
|
|
|
|
|
vertices[2].y >= 404.0f && vertices[2].y <= 408.0f) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].x, 6.0f, 0.1f) &&
|
|
|
|
|
vertices[3].y >= 404.0f && vertices[3].y <= 408.0f)) ||
|
|
|
|
|
((iidxhook_util_d3d9_float_equal(vertices[0].x, 6.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[0].x, 11.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[0].y, 200.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[0].y, 206.0f, 0.1f) ||
|
|
|
|
|
(vertices[0].y >= 216.0f && vertices[0].y <= 220.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].x, 137.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[1].x, 147.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].y, 200.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[1].y, 206.0f, 0.1f) ||
|
|
|
|
|
(vertices[1].y >= 216.0f && vertices[1].y <= 220.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].x, 137.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[2].x, 147.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].y, 368.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[2].y, 394.0f, 0.1f) ||
|
|
|
|
|
(vertices[2].y >= 404.0f && vertices[2].y <= 408.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].x, 6.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[3].x, 11.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].y, 368.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[3].y, 394.0f, 0.1f) ||
|
|
|
|
|
(vertices[3].y >= 404.0f && vertices[3].y <= 408.0f))) ||
|
|
|
|
|
/* double top right */
|
|
|
|
|
((vertices[0].x >= 493.0f && vertices[0].x <= 494.0f &&
|
|
|
|
|
vertices[0].y >= 24.0f && vertices[0].y <= 28.0f) &&
|
|
|
|
|
(vertices[1].x >= 634.0f && vertices[1].x <= 635.0f &&
|
|
|
|
|
vertices[1].y >= 24.0f && vertices[1].y <= 28.0f) &&
|
|
|
|
|
(vertices[2].x >= 634.0f && vertices[2].x <= 635.0f &&
|
|
|
|
|
vertices[2].y >= 212.0f && vertices[2].y <= 216.0f) &&
|
|
|
|
|
(vertices[3].x >= 493.0f && vertices[3].x <= 494.0f &&
|
|
|
|
|
vertices[3].y >= 212.0f && vertices[3].y <= 216.0f)) ||
|
|
|
|
|
(((vertices[0].x >= 493.0f && vertices[0].x <= 494.0f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[0].x, 500.0f, 0.1f)) &&
|
|
|
|
|
vertices[0].y >= 23.9f && vertices[0].y <= 28.0f &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].x, 626.0f, 0.1f) ||
|
|
|
|
|
(vertices[1].x >= 634.0f && vertices[1].x <= 635.0f)) &&
|
|
|
|
|
vertices[1].y >= 23.9f && vertices[1].y <= 28.0f &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].x, 626.0f, 0.1f) ||
|
|
|
|
|
(vertices[2].x >= 634.0f && vertices[2].x <= 635.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].y, 192.0f, 0.1f) ||
|
|
|
|
|
(vertices[2].y >= 212.0f && vertices[2].y <= 216.0f)) &&
|
|
|
|
|
((vertices[3].x >= 493.0f && vertices[3].x <= 494.0f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[3].x, 500.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].y, 192.0f, 0.1f) ||
|
|
|
|
|
(vertices[3].y >= 212.0f && vertices[3].y <= 216.0f))) ||
|
|
|
|
|
/* double bottom right */
|
|
|
|
|
((vertices[0].x >= 493.0f && vertices[0].x <= 494.0f &&
|
|
|
|
|
vertices[0].y >= 216.0f && vertices[0].y <= 220.0f) &&
|
|
|
|
|
(vertices[1].x >= 634.0f && vertices[1].x <= 635.0f &&
|
|
|
|
|
vertices[1].y >= 216.0f && vertices[1].y <= 220.0f) &&
|
|
|
|
|
(vertices[2].x >= 634.0f && vertices[2].x <= 635.0f &&
|
|
|
|
|
vertices[2].y >= 404.0f && vertices[2].y <= 408.0f) &&
|
|
|
|
|
(vertices[3].x >= 493.0f && vertices[3].x <= 494.0f &&
|
|
|
|
|
vertices[3].y >= 404.0f && vertices[3].y <= 408.0f))) {
|
|
|
|
|
(((vertices[0].x >= 493.0f && vertices[0].x <= 494.0f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[0].x, 500.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[0].y, 200.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[0].y, 206.0f, 0.1f) ||
|
|
|
|
|
(vertices[0].y >= 216.0f && vertices[0].y <= 220.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].x, 626.0f, 0.1f) ||
|
|
|
|
|
(vertices[1].x >= 634.0f && vertices[1].x <= 635.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[1].y, 200.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[1].y, 206.0f, 0.1f) ||
|
|
|
|
|
(vertices[1].y >= 216.0f && vertices[1].y <= 220.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].x, 626.0f, 0.1f) ||
|
|
|
|
|
(vertices[2].x >= 634.0f && vertices[2].x <= 635.0f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[2].y, 368.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[2].y, 394.0f, 0.1f) ||
|
|
|
|
|
(vertices[2].y >= 404.0f && vertices[2].y <= 408.0f)) &&
|
|
|
|
|
((vertices[3].x >= 493.0f && vertices[3].x <= 494.0f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(
|
|
|
|
|
vertices[3].x, 500.0f, 0.1f)) &&
|
|
|
|
|
(iidxhook_util_d3d9_float_equal(vertices[3].y, 368.0f, 0.1f) ||
|
|
|
|
|
iidxhook_util_d3d9_float_equal(vertices[3].y, 394.0f, 0.1f) ||
|
|
|
|
|
(vertices[3].y >= 404.0f && vertices[3].y <= 408.0f)))) {
|
|
|
|
|
/* fix UVs
|
|
|
|
|
1.0f / 512 fixes the diagonal seam connecting the two
|
|
|
|
|
triangles which is visible on some GPUs (why? idk)
|
|
|
|
|
@@ -695,7 +743,7 @@ iidxhook_util_d3d9_iidx11_to_17_fix_uvs_bg_videos(struct hook_d3d9_irp *irp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
iidxhook_uti_d3d9_fix_iidx9_to_13_viewport_size(struct hook_d3d9_irp *irp)
|
|
|
|
|
iidxhook_uti_d3d9_fix_iidx09_to_13_viewport_size(struct hook_d3d9_irp *irp)
|
|
|
|
|
{
|
|
|
|
|
log_assert(irp);
|
|
|
|
|
log_assert(irp->op == HOOK_D3D9_IRP_OP_GET_CLIENT_RECT);
|
|
|
|
|
@@ -967,7 +1015,7 @@ iidxhook_util_d3d9_log_config(const struct iidxhook_util_d3d9_config *config)
|
|
|
|
|
"pci_vid: %X\n"
|
|
|
|
|
"pci_pid: %X\n"
|
|
|
|
|
"iidx09_to_19_monitor_check_cb: %p\n"
|
|
|
|
|
"iidx11_to_17_fix_uvs_bg_videos: %d\n"
|
|
|
|
|
"iidx09_to_17_fix_uvs_bg_videos: %d\n"
|
|
|
|
|
"iidx12_fix_song_select_bg: %d\n"
|
|
|
|
|
"iidx13_fix_song_select_bg: %d\n"
|
|
|
|
|
"iidx14_to_19_nvidia_fix: %d\n"
|
|
|
|
|
@@ -985,7 +1033,7 @@ iidxhook_util_d3d9_log_config(const struct iidxhook_util_d3d9_config *config)
|
|
|
|
|
config->pci_vid,
|
|
|
|
|
config->pci_pid,
|
|
|
|
|
config->iidx09_to_19_monitor_check_cb,
|
|
|
|
|
config->iidx11_to_17_fix_uvs_bg_videos,
|
|
|
|
|
config->iidx09_to_17_fix_uvs_bg_videos,
|
|
|
|
|
config->iidx12_fix_song_select_bg,
|
|
|
|
|
config->iidx13_fix_song_select_bg,
|
|
|
|
|
config->iidx14_to_19_nvidia_fix,
|
|
|
|
|
@@ -1050,7 +1098,7 @@ void iidxhook_util_d3d9_init_config(struct iidxhook_util_d3d9_config *config)
|
|
|
|
|
config->pci_vid = 0;
|
|
|
|
|
config->pci_pid = 0;
|
|
|
|
|
config->iidx09_to_19_monitor_check_cb = NULL;
|
|
|
|
|
config->iidx11_to_17_fix_uvs_bg_videos = false;
|
|
|
|
|
config->iidx09_to_17_fix_uvs_bg_videos = false;
|
|
|
|
|
config->iidx12_fix_song_select_bg = false;
|
|
|
|
|
config->iidx13_fix_song_select_bg = false;
|
|
|
|
|
config->iidx14_to_19_nvidia_fix = false;
|
|
|
|
|
@@ -1109,7 +1157,7 @@ iidxhook_util_d3d9_irp_handler(struct hook_d3d9_irp *irp)
|
|
|
|
|
hr = hook_d3d9_irp_invoke_next(irp);
|
|
|
|
|
|
|
|
|
|
if (hr == S_OK) {
|
|
|
|
|
iidxhook_uti_d3d9_fix_iidx9_to_13_viewport_size(irp);
|
|
|
|
|
iidxhook_uti_d3d9_fix_iidx09_to_13_viewport_size(irp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
|
@@ -1161,7 +1209,7 @@ iidxhook_util_d3d9_irp_handler(struct hook_d3d9_irp *irp)
|
|
|
|
|
return hook_d3d9_irp_invoke_next(irp);
|
|
|
|
|
|
|
|
|
|
case HOOK_D3D9_IRP_OP_DEV_DRAW_PRIMITIVE_UP:
|
|
|
|
|
iidxhook_util_d3d9_iidx11_to_17_fix_uvs_bg_videos(irp);
|
|
|
|
|
iidxhook_util_d3d9_iidx09_to_17_fix_uvs_bg_videos(irp);
|
|
|
|
|
|
|
|
|
|
return hook_d3d9_irp_invoke_next(irp);
|
|
|
|
|
|
|
|
|
|
|