chore: Apply code formatting on entire codebase for consistent style
This commit is contained in:
@@ -33,7 +33,6 @@ static struct ac_io_emu_icca iidxhook_util_acio_emu_icca[2];
|
||||
static bool iidxhook_util_icca_override_version;
|
||||
static enum ac_io_emu_icca_version iidxhook_util_icca_override_version_value;
|
||||
|
||||
|
||||
void iidxhook_util_acio_override_version(enum ac_io_emu_icca_version version)
|
||||
{
|
||||
iidxhook_util_icca_override_version = true;
|
||||
@@ -56,8 +55,7 @@ void iidxhook_util_acio_init(bool legacy_mode)
|
||||
if (iidxhook_util_icca_override_version) {
|
||||
ac_io_emu_icca_set_version(
|
||||
&iidxhook_util_acio_emu_icca[i],
|
||||
iidxhook_util_icca_override_version_value
|
||||
);
|
||||
iidxhook_util_icca_override_version_value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
void iidxhook_util_acio_init(bool legacy_mode);
|
||||
|
||||
|
||||
/**
|
||||
* Use the specified ICCA emulation version
|
||||
*/
|
||||
|
||||
@@ -161,7 +161,7 @@ void iidxhook_config_gfx_init(struct cconfig *config)
|
||||
IIDXHOOK_CONFIG_GFX_DEFAULT_DEVICE_ADAPTER_VALUE,
|
||||
"D3D9 device adapter (monitor), -1 to use default, "
|
||||
"0, 1, 2 etc. to use specified adapter");
|
||||
|
||||
|
||||
cconfig_util_set_bool(
|
||||
config,
|
||||
IIDXHOOK_CONFIG_GFX_DIAGONAL_TEARING_FIX_KEY,
|
||||
|
||||
@@ -24,7 +24,8 @@ void iidxhook_config_io_init(struct cconfig *config)
|
||||
config,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DISABLE_IO_EMU_KEY,
|
||||
IIDXHOOK_UTIL_CONFIG_IO_DEFAULT_DISABLE_IO_EMU_VALUE,
|
||||
"Disable ezusb IO emulation and enable usage of real ezusb1/2 IO hardware");
|
||||
"Disable ezusb IO emulation and enable usage of real ezusb1/2 IO "
|
||||
"hardware");
|
||||
}
|
||||
|
||||
void iidxhook_config_io_get(
|
||||
|
||||
@@ -30,7 +30,8 @@ void iidxhook_config_misc_init(struct cconfig *config)
|
||||
config,
|
||||
IIDXHOOK_CONFIG_MISC_SETTINGS_PATH_STUB_KEY,
|
||||
IIDXHOOK_CONFIG_MISC_DEFAULT_SETTINGS_PATH_STUB_VALUE,
|
||||
"Path to store the settings, e.g. bookkeeping, operator settings. d:, e: and f: drive configuration/settings data");
|
||||
"Path to store the settings, e.g. bookkeeping, operator settings. d:, "
|
||||
"e: and f: drive configuration/settings data");
|
||||
}
|
||||
|
||||
void iidxhook_config_misc_get(
|
||||
|
||||
@@ -65,7 +65,7 @@ static struct {
|
||||
D3DTEXTUREFILTERTYPE filter;
|
||||
} iidxhook_util_d3d9_back_buffer_scaling;
|
||||
|
||||
static IDirect3DVertexShader9* vertex_shader;
|
||||
static IDirect3DVertexShader9 *vertex_shader;
|
||||
|
||||
/* ------------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -678,19 +678,19 @@ iidxhook_util_d3d9_iidx11_to_17_fix_uvs_bg_videos(struct hook_d3d9_irp *irp)
|
||||
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))) {
|
||||
/* fix UVs
|
||||
1.0f / 512 fixes the diagonal seam connecting the two triangles
|
||||
which is visible on some GPUs (why? idk)
|
||||
*/
|
||||
vertices[0].tu = 0.0f + 1.0f / 512;
|
||||
vertices[0].tv = 1.0f;
|
||||
vertices[1].tu = 1.0f;
|
||||
vertices[1].tv = 1.0f;
|
||||
vertices[2].tu = 1.0f;
|
||||
vertices[2].tv = 0.0f + 1.0f / 512;
|
||||
vertices[3].tu = 0.0f + 1.0f / 512;
|
||||
vertices[3].tv = 0.0f + 1.0f / 512;
|
||||
}
|
||||
/* fix UVs
|
||||
1.0f / 512 fixes the diagonal seam connecting the two
|
||||
triangles which is visible on some GPUs (why? idk)
|
||||
*/
|
||||
vertices[0].tu = 0.0f + 1.0f / 512;
|
||||
vertices[0].tv = 1.0f;
|
||||
vertices[1].tu = 1.0f;
|
||||
vertices[1].tv = 1.0f;
|
||||
vertices[2].tu = 1.0f;
|
||||
vertices[2].tv = 0.0f + 1.0f / 512;
|
||||
vertices[3].tu = 0.0f + 1.0f / 512;
|
||||
vertices[3].tv = 0.0f + 1.0f / 512;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -910,28 +910,36 @@ iidxhook_util_d3d9_iidx18_and_19_fix_diagonal_tearing(struct hook_d3d9_irp *irp)
|
||||
HRESULT hr;
|
||||
|
||||
log_assert(irp);
|
||||
log_assert(irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VIEWPORT || irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VERTEX_SHADER);
|
||||
log_assert(
|
||||
irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VIEWPORT ||
|
||||
irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VERTEX_SHADER);
|
||||
|
||||
if (!iidxhook_util_d3d9_config.iidx18_and_19_diagonal_tearing_fix)
|
||||
{
|
||||
if (!iidxhook_util_d3d9_config.iidx18_and_19_diagonal_tearing_fix) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VIEWPORT)
|
||||
{
|
||||
if (irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VIEWPORT) {
|
||||
const D3DVIEWPORT9 *pViewport = irp->args.dev_set_viewport.pViewport;
|
||||
const float fix_offset[2] = {-1.0F / (float)pViewport->Width, -1.0F / (float)pViewport->Height};
|
||||
const float fix_offset[2] = {
|
||||
-1.0F / (float) pViewport->Width,
|
||||
-1.0F / (float) pViewport->Height};
|
||||
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(irp->args.dev_set_viewport.self, 63, fix_offset, lengthof(fix_offset));
|
||||
hr = IDirect3DDevice9_SetVertexShaderConstantF(
|
||||
irp->args.dev_set_viewport.self,
|
||||
63,
|
||||
fix_offset,
|
||||
lengthof(fix_offset));
|
||||
if (hr != S_OK) {
|
||||
log_warning("SetVertexShaderConstantF failed: %lX", hr);
|
||||
}
|
||||
}
|
||||
|
||||
if (irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VERTEX_SHADER)
|
||||
{
|
||||
if (irp->op == HOOK_D3D9_IRP_OP_DEV_SET_VERTEX_SHADER) {
|
||||
if (!vertex_shader) {
|
||||
hr = IDirect3DDevice9_CreateVertexShader(irp->args.dev_set_vertex_shader.self, (const DWORD*) g_vs11_vs_main, &vertex_shader);
|
||||
hr = IDirect3DDevice9_CreateVertexShader(
|
||||
irp->args.dev_set_vertex_shader.self,
|
||||
(const DWORD *) g_vs11_vs_main,
|
||||
&vertex_shader);
|
||||
if (hr != S_OK) {
|
||||
log_fatal("CreateVertexShader failed: %lX", hr);
|
||||
}
|
||||
|
||||
@@ -95,8 +95,8 @@ void settings_hook_init(void)
|
||||
log_info("Inserted settings hooks, settings path: %s", settings_path);
|
||||
}
|
||||
|
||||
void settings_hook_set_path(const char* path)
|
||||
{
|
||||
void settings_hook_set_path(const char *path)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
len = strlen(path);
|
||||
@@ -121,9 +121,9 @@ HRESULT
|
||||
settings_hook_dispatch_irp(struct irp *irp)
|
||||
{
|
||||
if (irp->op == IRP_OP_OPEN &&
|
||||
(irp->open_filename[0] == L'd' || irp->open_filename[0] == L'e' ||
|
||||
irp->open_filename[0] == L'f') &&
|
||||
irp->open_filename[1] == L':') {
|
||||
(irp->open_filename[0] == L'd' || irp->open_filename[0] == L'e' ||
|
||||
irp->open_filename[0] == L'f') &&
|
||||
irp->open_filename[1] == L':') {
|
||||
HRESULT result;
|
||||
char new_path[MAX_PATH];
|
||||
const wchar_t *old_filename_wstr;
|
||||
@@ -161,7 +161,8 @@ settings_hook_dispatch_irp(struct irp *irp)
|
||||
new_path_folder[settings_path_len + 2] = '\0';
|
||||
|
||||
if (!path_exists(new_path_folder)) {
|
||||
log_misc("Creating local settings folder %s", new_path_folder);
|
||||
log_misc(
|
||||
"Creating local settings folder %s", new_path_folder);
|
||||
CreateDirectoryA(new_path_folder, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
* Remaps the paths for storing "settings data" that are usually stored on the
|
||||
* drives d:\, e:\ and f:\ by the game. This defaults to the local folders
|
||||
* d\, e\ and f\.
|
||||
*
|
||||
*
|
||||
* Required hook for 9th to Lincle.
|
||||
*/
|
||||
void settings_hook_init(void);
|
||||
|
||||
/**
|
||||
* Change the path where settings file are stored.
|
||||
*
|
||||
*
|
||||
* @param path Destination path for storage, relative or absolute.
|
||||
*/
|
||||
void settings_hook_set_path(const char* path);
|
||||
void settings_hook_set_path(const char *path);
|
||||
|
||||
/**
|
||||
* iohook dispatch function
|
||||
|
||||
@@ -34,74 +34,32 @@
|
||||
// approximately 8 instruction slots used
|
||||
#endif
|
||||
|
||||
const BYTE g_vs11_vs_main[] =
|
||||
{
|
||||
1, 1, 254, 255, 254, 255,
|
||||
59, 0, 67, 84, 65, 66,
|
||||
28, 0, 0, 0, 191, 0,
|
||||
0, 0, 1, 1, 254, 255,
|
||||
3, 0, 0, 0, 28, 0,
|
||||
0, 0, 0, 1, 0, 0,
|
||||
184, 0, 0, 0, 88, 0,
|
||||
0, 0, 2, 0, 4, 0,
|
||||
1, 0, 18, 0, 104, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
120, 0, 0, 0, 2, 0,
|
||||
63, 0, 1, 0, 254, 0,
|
||||
132, 0, 0, 0, 0, 0,
|
||||
0, 0, 148, 0, 0, 0,
|
||||
2, 0, 0, 0, 4, 0,
|
||||
2, 0, 168, 0, 0, 0,
|
||||
0, 0, 0, 0, 67, 111,
|
||||
108, 111, 114, 77, 117, 108,
|
||||
116, 105, 112, 108, 121, 0,
|
||||
171, 171, 1, 0, 3, 0,
|
||||
1, 0, 4, 0, 1, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
70, 105, 120, 79, 102, 102,
|
||||
115, 101, 116, 0, 171, 171,
|
||||
1, 0, 3, 0, 1, 0,
|
||||
2, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 87, 111,
|
||||
114, 108, 100, 86, 105, 101,
|
||||
119, 80, 114, 111, 106, 101,
|
||||
99, 116, 105, 111, 110, 0,
|
||||
3, 0, 3, 0, 4, 0,
|
||||
4, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 118, 115,
|
||||
95, 49, 95, 49, 0, 77,
|
||||
105, 99, 114, 111, 115, 111,
|
||||
102, 116, 32, 40, 82, 41,
|
||||
32, 72, 76, 83, 76, 32,
|
||||
83, 104, 97, 100, 101, 114,
|
||||
32, 67, 111, 109, 112, 105,
|
||||
108, 101, 114, 32, 49, 48,
|
||||
46, 49, 0, 171, 31, 0,
|
||||
0, 0, 0, 0, 0, 128,
|
||||
0, 0, 15, 144, 31, 0,
|
||||
0, 0, 10, 0, 0, 128,
|
||||
1, 0, 15, 144, 31, 0,
|
||||
0, 0, 5, 0, 0, 128,
|
||||
2, 0, 15, 144, 9, 0,
|
||||
0, 0, 0, 0, 4, 192,
|
||||
0, 0, 228, 144, 2, 0,
|
||||
228, 160, 5, 0, 0, 0,
|
||||
0, 0, 15, 208, 1, 0,
|
||||
228, 144, 4, 0, 228, 160,
|
||||
9, 0, 0, 0, 0, 0,
|
||||
1, 128, 0, 0, 228, 144,
|
||||
0, 0, 228, 160, 9, 0,
|
||||
0, 0, 0, 0, 2, 128,
|
||||
0, 0, 228, 144, 1, 0,
|
||||
228, 160, 9, 0, 0, 0,
|
||||
0, 0, 4, 128, 0, 0,
|
||||
228, 144, 3, 0, 228, 160,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
3, 192, 63, 0, 228, 160,
|
||||
0, 0, 170, 128, 0, 0,
|
||||
228, 128, 1, 0, 0, 0,
|
||||
0, 0, 8, 192, 0, 0,
|
||||
170, 128, 1, 0, 0, 0,
|
||||
0, 0, 3, 224, 2, 0,
|
||||
228, 144, 255, 255, 0, 0
|
||||
};
|
||||
const BYTE g_vs11_vs_main[] = {
|
||||
1, 1, 254, 255, 254, 255, 59, 0, 67, 84, 65, 66, 28, 0, 0,
|
||||
0, 191, 0, 0, 0, 1, 1, 254, 255, 3, 0, 0, 0, 28, 0,
|
||||
0, 0, 0, 1, 0, 0, 184, 0, 0, 0, 88, 0, 0, 0, 2,
|
||||
0, 4, 0, 1, 0, 18, 0, 104, 0, 0, 0, 0, 0, 0, 0,
|
||||
120, 0, 0, 0, 2, 0, 63, 0, 1, 0, 254, 0, 132, 0, 0,
|
||||
0, 0, 0, 0, 0, 148, 0, 0, 0, 2, 0, 0, 0, 4, 0,
|
||||
2, 0, 168, 0, 0, 0, 0, 0, 0, 0, 67, 111, 108, 111, 114,
|
||||
77, 117, 108, 116, 105, 112, 108, 121, 0, 171, 171, 1, 0, 3, 0,
|
||||
1, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 70, 105, 120,
|
||||
79, 102, 102, 115, 101, 116, 0, 171, 171, 1, 0, 3, 0, 1, 0,
|
||||
2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 87, 111, 114, 108, 100,
|
||||
86, 105, 101, 119, 80, 114, 111, 106, 101, 99, 116, 105, 111, 110, 0,
|
||||
3, 0, 3, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 118, 115, 95, 49, 95, 49, 0, 77, 105, 99, 114, 111, 115, 111,
|
||||
102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97,
|
||||
100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 49, 48,
|
||||
46, 49, 0, 171, 31, 0, 0, 0, 0, 0, 0, 128, 0, 0, 15,
|
||||
144, 31, 0, 0, 0, 10, 0, 0, 128, 1, 0, 15, 144, 31, 0,
|
||||
0, 0, 5, 0, 0, 128, 2, 0, 15, 144, 9, 0, 0, 0, 0,
|
||||
0, 4, 192, 0, 0, 228, 144, 2, 0, 228, 160, 5, 0, 0, 0,
|
||||
0, 0, 15, 208, 1, 0, 228, 144, 4, 0, 228, 160, 9, 0, 0,
|
||||
0, 0, 0, 1, 128, 0, 0, 228, 144, 0, 0, 228, 160, 9, 0,
|
||||
0, 0, 0, 0, 2, 128, 0, 0, 228, 144, 1, 0, 228, 160, 9,
|
||||
0, 0, 0, 0, 0, 4, 128, 0, 0, 228, 144, 3, 0, 228, 160,
|
||||
4, 0, 0, 0, 0, 0, 3, 192, 63, 0, 228, 160, 0, 0, 170,
|
||||
128, 0, 0, 228, 128, 1, 0, 0, 0, 0, 0, 8, 192, 0, 0,
|
||||
170, 128, 1, 0, 0, 0, 0, 0, 3, 224, 2, 0, 228, 144, 255,
|
||||
255, 0, 0};
|
||||
|
||||
Reference in New Issue
Block a user