├── FF7LIB.lib ├── FF7MENU.lib ├── FF7SND.lib ├── README.md ├── FF7WorldMap.sln ├── NEWFF7 ├── C_00404D80.cpp ├── wmdefine.cpp ├── C_0075EE50.cpp ├── ff7_macros.h ├── C_007688E0.cpp ├── C_004067A0.cpp ├── C_0075E7A0.cpp ├── psx.h ├── C_0040A460.cpp ├── C_00767D40.cpp ├── ff7_sound.h ├── loadmenu.h ├── C_007663E0.cpp ├── initpath.cpp ├── C_0041A1B0.cpp ├── C_0074BA80.cpp ├── C_00766B70.cpp ├── menu_data.h └── wm_data.h ├── fontinfo.h └── FF7WorldMap.vcproj /FF7LIB.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ergonomy-joe/ff7-worldmap/HEAD/FF7LIB.lib -------------------------------------------------------------------------------- /FF7MENU.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ergonomy-joe/ff7-worldmap/HEAD/FF7MENU.lib -------------------------------------------------------------------------------- /FF7SND.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ergonomy-joe/ff7-worldmap/HEAD/FF7SND.lib -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ff7-worldmap 2 | 3 | This Visual Studio 2008 project allows to you to build a standalone version of the FF7 World Map engine. The Graphics/Sound/Menu functions are provided through library files(The Menu library is used for dialog windows). 4 | 5 | FF7WorldMapMain.cpp is an original creation(though I used parts of the original "main.c"). It tries to load one of your "save??.ff7" files so you should indicate valid "fileindex" and "saveindex" before building/runing. 6 | 7 | The World Map Engine source code have been recreated by decompiling the original FF7 executable file. I should add more comments in the future and rename some of the structures'fields and functions, but for now you can enjoy the algorithms in their splendor ... 8 | 9 | by ergonomy_joe 10 | -------------------------------------------------------------------------------- /FF7WorldMap.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FF7WorldMap", "FF7WorldMap.vcproj", "{1C9E59AB-FCBB-4336-B659-709A1A540667}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {1C9E59AB-FCBB-4336-B659-709A1A540667}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {1C9E59AB-FCBB-4336-B659-709A1A540667}.Debug|Win32.Build.0 = Debug|Win32 14 | {1C9E59AB-FCBB-4336-B659-709A1A540667}.Release|Win32.ActiveCfg = Release|Win32 15 | {1C9E59AB-FCBB-4336-B659-709A1A540667}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /NEWFF7/C_00404D80.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #include "ff7.h" 7 | 8 | const char D_007B6448[] = FF7_REG_PATH "\\1.00\\Graphics"; 9 | const char D_007B6488[] = "Mode"; 10 | 11 | //Get "Graphics/Mode" Key 12 | int C_00404D80() { 13 | struct { 14 | int dwValue;//local_6 15 | int dwGrMode;//local_5 16 | HKEY hKey;//local_4 17 | int dwResult;//local_3 18 | DWORD dwType;//local_2 19 | DWORD cbData;//local_1 20 | }lolo; 21 | 22 | lolo.dwGrMode = 2; 23 | lolo.dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B6448, 0, KEY_READ/*0x20019*/, &lolo.hKey); 24 | if(lolo.dwResult == 0) { 25 | lolo.cbData = 0x100; 26 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B6488, 0, &lolo.dwType, (LPBYTE)&lolo.dwValue, &lolo.cbData); 27 | if(lolo.dwResult == 0) 28 | lolo.dwGrMode = lolo.dwValue; 29 | RegCloseKey(lolo.hKey); 30 | } 31 | 32 | return lolo.dwGrMode; 33 | } 34 | -------------------------------------------------------------------------------- /NEWFF7/wmdefine.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #define __FF7FILE__ "C:\\FF7\\src\\wm\\wmdefine.cpp" 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | //////////////////////////////////////// 11 | //TODO in another module? 12 | struct VECTOR D_00E2D1E0; 13 | struct SVECTOR D_00E2D1F0; 14 | struct SVECTOR D_00E2D1F8; 15 | short D_00E2D200; 16 | //char 00E2D204[0x3d4]? 17 | struct SVECTOR D_00E2D5D8; 18 | //////////////////////////////////////// 19 | unsigned char *D_00E2D5E0; 20 | unsigned char *D_00E2D5E4; 21 | unsigned char *D_00E2D5E8; 22 | unsigned char *D_00E2D5EC; 23 | unsigned char *D_00E2D5F0; 24 | unsigned char *D_00E2D5F4; 25 | unsigned char *D_00E2D5F8; 26 | struct POLY_GT3 *D_00E2D5FC; 27 | char *D_00E2D600; 28 | //////////////////////////////////////// 29 | //wmdefine:init? 30 | void C_0075AB50() { 31 | D_00E2D600 = (char *)mem_malloc(0xE7801, __FF7FILE__, 0x1f); 32 | if(D_00E2D600) { 33 | //-- unused -- 34 | D_00E2D5E0 = (unsigned char *)(D_00E2D600); 35 | D_00E2D5E4 = (unsigned char *)(D_00E2D600 + 0x79000); 36 | //-- unused-- 37 | D_00E2D5E8 = (unsigned char *)(D_00E2D600); 38 | D_00E2D5EC = (unsigned char *)(D_00E2D600 + 0x23800); 39 | D_00E2D5F0 = (unsigned char *)(D_00E2D600 + 0x33600);//0x23800 + 0xfe00 40 | D_00E2D5F4 = (unsigned char *)(D_00E2D600 + 0x38C00);//0x33600 + 0x5600 41 | //-- -- 42 | D_00E2D5F8 = (unsigned char *)(D_00E2D600 + 0x3F000);//0x38C00 + 0x6400 43 | D_00E2D5FC = (struct POLY_GT3 *)(D_00E2D600 + 0xA6800);//0x3F000 + 9 * 0xb800 44 | //0xe7801 = 0xA6800 + 2 * 0xd00 * 0x28 + 1 45 | } 46 | } 47 | 48 | //wmdefine:clean? 49 | void C_0075ABF3() { 50 | if(D_00E2D600) { 51 | mem_free(D_00E2D600, __FF7FILE__, 0x34); 52 | D_00E2D600 = 0; 53 | 54 | D_00E2D5E0 = 55 | D_00E2D5E4 = 56 | D_00E2D5EC = 57 | D_00E2D5F0 = 58 | D_00E2D5F8 = 0; 59 | 60 | D_00E2D5E8 = 61 | D_00E2D5F4 = 0; 62 | 63 | D_00E2D5FC = 0; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /NEWFF7/C_0075EE50.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | #include "field_data.h" 11 | #include "menu_data.h" 12 | //////////////////////////////////////// 13 | short D_00E36100; 14 | short D_00E36104; 15 | short D_00E36108; 16 | int D_00E3610C; 17 | //////////////////////////////////////// 18 | void C_0075EE50(void *bp08) { 19 | D_00CC0960[0] = 0xff; 20 | D_00CC0964 = 0xff; 21 | D_00CBF5E8 = (struct t_script_20 *)bp08; 22 | D_00CBF5E8->f_04 = 8;//force offset to string 23 | C_00768C7A(); 24 | D_00CBF9D8 = &D_00CC0D88; 25 | } 26 | 27 | void C_0075EE86(int bp08) { 28 | if(D_00CFF5B8[0].wStatus == 0) { 29 | D_00E36108 = 30 | D_00E36100 = 0; 31 | C_00769050(0, bp08);//dialog:refresh(1) 32 | } 33 | } 34 | 35 | void C_0075EEBB(short bp08, short bp0c, short bp10) { 36 | if(D_00CFF5B8[0].wStatus == 0) { 37 | D_00E36108 = bp0c; 38 | D_00E36100 = bp10; 39 | C_007693A1(0, bp08, (unsigned char)D_00E36108, (unsigned char)D_00E36100, &D_00E36104);//dialog:refresh(2) 40 | } 41 | } 42 | 43 | int C_0075EF01() { 44 | return !(D_00CFF5B8[0].wStatus == 0); 45 | } 46 | 47 | int C_0075EF13() { 48 | if(D_00CFF5B8[0].wStatus && D_00CFF5B8[0].wStatus != 7) 49 | C_00768E3D(0); 50 | 51 | return !(D_00CFF5B8[0].wStatus == 0); 52 | } 53 | 54 | //wm:manage text event? 55 | void C_0075EF46() { 56 | struct { 57 | int local_2; 58 | int dwInputMask;//local_1 59 | }lolo; 60 | 61 | if(D_00CFF5B8[0].wStatus) { 62 | lolo.dwInputMask = C_007186B9();//menu_input:get "current mask" 63 | D_00CBF9D8->f_68.dwKEYON = lolo.dwInputMask & ~D_00CBF9D8->f_68.dwKEY; 64 | D_00CBF9D8->f_68.dwKEY = lolo.dwInputMask; 65 | lolo.dwInputMask = C_007186B9();//menu_input:get "current mask" 66 | D_00CBF9D8->f_78.dwKEYON = lolo.dwInputMask & ~D_00CBF9D8->f_78.dwKEY; 67 | D_00CBF9D8->f_78.dwKEY = lolo.dwInputMask; 68 | if(D_00E36108 == 0 && D_00E36100 == 0) { 69 | lolo.local_2 = C_00769050(0, 0);//dialog:refresh(1) 70 | } else { 71 | lolo.local_2 = C_007693A1(0, 0, (unsigned char)D_00E36108, (unsigned char)D_00E36100, &D_00E36104);//dialog:refresh(2) 72 | } 73 | D_00E3610C = 1; 74 | } 75 | } 76 | 77 | short C_0075F00E() { 78 | return (D_00CFF5B8[0].wStatus == 0)?D_00E36104:-1; 79 | } 80 | 81 | void C_0075F038(short *bp08) { 82 | if(bp08) 83 | C_00768F48(0, bp08[0], bp08[1], bp08[2], bp08[3]);//dialog:set location and size 84 | } 85 | 86 | void C_0075F06C(int bp08, int bp0c) { 87 | C_00768EC3(0, bp08, bp0c); 88 | } 89 | -------------------------------------------------------------------------------- /NEWFF7/ff7_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #ifndef __FF7_MACROS_H__ 7 | #define __FF7_MACROS_H__ 8 | 9 | //====---- some macros for declaration(padding) ----==== 10 | #define DECL_bool(a) bool a; char pad_ ## a[3] 11 | #define DECL_char(a) char a; char pad_ ## a[3] 12 | #define DECL_unsigned_char(a) unsigned char a; char pad_ ## a[3] 13 | #define DECL_short(a) short a; char pad_ ## a[2] 14 | #define DECL_unsigned_short(a) unsigned short a; char pad_ ## a[2] 15 | #define DECL_struct_MATRIX(a) struct MATRIX a; char pad_ ## a[2] 16 | //====---- ----==== 17 | #define BIT(a) ((unsigned)(1L<<(a))) 18 | //====---- ----==== 19 | #define ALIGN(base, algn) (((unsigned)(base) + (algn) - 1) & ~((algn) - 1)) 20 | //====---- ----==== 21 | #define RELEASE(x) if(x) { (x)->Release(); (x) = 0; } 22 | //====---- ----==== 23 | #define FKMB(t, p, o) (*(t *)((char *)p + o)) 24 | //====---- ----==== 25 | #define SWAP(a,b,t) ((t) = (a),(a) = (b), (b) = (t)) 26 | //====---- ----==== 27 | //fast float to integer conversion 28 | #define fFloat2Int(d, s) __asm FLD s __asm FISTP d 29 | //====---- ----==== 30 | #define FIX_DIV(a,b) (((a)<<0xc)/(b)) 31 | #define FIX_MUL(a,b) (((a)*(b))>>0xc) 32 | //////////////////////////////////////// 33 | #define MK_VERTEX_0(p, vx, _x, _y, _z, _rhw, col, tx, ty) \ 34 | vx = p; \ 35 | vx->x = _x; \ 36 | vx->y = _y; \ 37 | vx->z = _z; \ 38 | vx->rhw = _rhw; \ 39 | vx->color.bgra = col; \ 40 | vx->tu = tx; \ 41 | vx->tv = ty; 42 | 43 | #define MK_VERTEX(p, vx, _x, _y, _z, _rhw, col, sp, tx, ty) \ 44 | vx = p; \ 45 | vx->x = _x; \ 46 | vx->y = _y; \ 47 | vx->z = _z; \ 48 | vx->rhw = _rhw; \ 49 | vx->color.bgra = col; \ 50 | vx->specular = sp; \ 51 | vx->tu = tx; \ 52 | vx->tv = ty; 53 | 54 | #define MK_VERTEX_NOTEXTURE_0(p, vx, _x, _y, _z, col) \ 55 | vx = p; \ 56 | vx->x = _x; \ 57 | vx->y = _y; \ 58 | vx->z = _z; \ 59 | vx->color.bgra = col; 60 | 61 | #define MK_VERTEX_NOTEXTURE_1(p, vx, _x, _y, _z, _rhw, col) \ 62 | vx = p; \ 63 | vx->x = _x; \ 64 | vx->y = _y; \ 65 | vx->z = _z; \ 66 | vx->rhw = _rhw; \ 67 | vx->color.bgra = col; 68 | 69 | #define MK_VERTEX_NOTEXTURE(p, vx, _x, _y, _z, _rhw, col, sp) \ 70 | vx = p; \ 71 | vx->x = _x; \ 72 | vx->y = _y; \ 73 | vx->z = _z; \ 74 | vx->rhw = _rhw; \ 75 | vx->color.bgra = col; \ 76 | vx->specular = sp; 77 | 78 | #define MK_QUAD_2D_NOTEXTURE(p, vx, x, y, w, h, z, rhw, col, sp) \ 79 | MK_VERTEX_NOTEXTURE(p, vx[3], x, y, z, rhw, col, sp) \ 80 | MK_VERTEX_NOTEXTURE(p + 1, vx[2], x, y + h, z, rhw, col, sp) \ 81 | MK_VERTEX_NOTEXTURE(p + 2, vx[1], x + w, y, z, rhw, col, sp) \ 82 | MK_VERTEX_NOTEXTURE(p + 3, vx[0], x + w, y + h, z, rhw, col, sp) 83 | 84 | #define MK_QUAD_2D(p, vx, x, y, w, h, z, rhw, col, sp, tx, ty, tw, th) \ 85 | MK_VERTEX(p, vx[3], x, y, z, rhw, col, sp, tx, ty ) \ 86 | MK_VERTEX(p + 1, vx[2], x, y + h, z, rhw, col, sp, tx, ty + th) \ 87 | MK_VERTEX(p + 2, vx[1], x + w, y, z, rhw, col, sp, tx + tw, ty ) \ 88 | MK_VERTEX(p + 3, vx[0], x + w, y + h, z, rhw, col, sp, tx + tw, ty + th) 89 | //////////////////////////////////////// 90 | #define DX_DRAWPRIMITIVE_BIS(hr, lpd3dd2, pt, vtd, lpvt, vtcnt, flgs, app_ignored) \ 91 | do { \ 92 | hr = lpd3dd2->DrawPrimitive(pt, vtd, lpvt, vtcnt, flgs); \ 93 | switch(hr) { \ 94 | case D3D_OK: break; \ 95 | case DDERR_WASSTILLDRAWING: /*C_006A479C(1, app); */break; \ 96 | default: \ 97 | dx_dbg_Try(hr, __FILE__, __LINE__); \ 98 | hr = D3D_OK; \ 99 | } \ 100 | } while(hr != D3D_OK); 101 | //////////////////////////////////////// 102 | #define DX_DRAWPRIMITIVE(hr, lpd3dd2, pt, vtd, lpvt, vtcnt, flgs, app) \ 103 | do { \ 104 | hr = lpd3dd2->DrawPrimitive(pt, vtd, lpvt, vtcnt, flgs); \ 105 | switch(hr) { \ 106 | case D3D_OK: break; \ 107 | case DDERR_WASSTILLDRAWING: C_006A479C(1, app); break; \ 108 | default: \ 109 | dx_dbg_Try(hr, __FILE__, __LINE__); \ 110 | hr = D3D_OK; \ 111 | } \ 112 | } while(hr != D3D_OK); 113 | //////////////////////////////////////// 114 | #define DX_DRAWINDEXEDPRIMITIVE(hr, lpd3dd2, pt, vtd, lpvt, vtcnt, lpind, indcnt, flgs, app) \ 115 | do { \ 116 | hr = lpd3dd2->DrawIndexedPrimitive(pt, vtd, lpvt, vtcnt, lpind, indcnt, flgs); \ 117 | switch(hr) { \ 118 | case D3D_OK: break; \ 119 | case DDERR_WASSTILLDRAWING: C_006A479C(1, app); break; \ 120 | default: \ 121 | dx_dbg_Try(hr, __FILE__, __LINE__); \ 122 | hr = D3D_OK; \ 123 | } \ 124 | } while(hr != D3D_OK); 125 | //////////////////////////////////////// 126 | #define DX_DRAWINDEXEDPRIMITIVE_BIS(hr, lpd3dd2, pt, vtd, lpvt, vtcnt, lpind, indcnt, flgs, app) \ 127 | do { \ 128 | hr = lpd3dd2->DrawIndexedPrimitive(pt, vtd, lpvt, vtcnt, lpind, indcnt, flgs); \ 129 | if(hr == D3D_OK) \ 130 | break; \ 131 | if(hr == DDERR_WASSTILLDRAWING) { \ 132 | C_006A479C(1, app); \ 133 | } else { \ 134 | dx_dbg_Try(hr, __FILE__, __LINE__); \ 135 | hr = D3D_OK; \ 136 | } \ 137 | } while(hr != D3D_OK); 138 | //////////////////////////////////////// 139 | 140 | #endif 141 | -------------------------------------------------------------------------------- /NEWFF7/C_007688E0.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | //////////////////////////////////////// 11 | struct t_wm_unused_stuff_24 {//size 0x24 12 | char __00[0x24]; 13 | }; 14 | 15 | struct t_wm_unused_stuff_xx { 16 | /*00*/char __00[0x10]; 17 | /*10*/struct t_wm_unused_stuff_24 *f_10; 18 | /*14*/ 19 | //...? 20 | }; 21 | //////////////////////////////////////// 22 | int D_00E3A8A8; 23 | int D_00E3A8AC; 24 | struct t_wm_unused_stuff_xx *D_00E3A8B0; 25 | int D_00E3A8B4; 26 | int D_00E3A8B8; 27 | int D_00E3A8BC; 28 | char D_00E3A8C0[WM_MAX_MODELID]; 29 | int D_00E3B0F0; 30 | int D_00E3B0F4; 31 | char D_00E3B0F8[WM_MAX_MODELID]; 32 | int D_00E3B124;//"highwind has reactor" flag? 33 | int D_00E3B128; 34 | int D_00E3B12C; 35 | //////////////////////////////////////// 36 | void C_007688E0() { 37 | int i; 38 | 39 | for(i = 0; i < WM_MAX_MODELID; i ++) { 40 | D_00E3B0F8[i] = -1; 41 | D_00E3A8C0[i] = 0; 42 | }//end for 43 | D_00E3A8B0 = 0; 44 | D_00E3A8B8 = 0; 45 | D_00E3B128 = 46 | D_00E3A8A8 = 47 | D_00E3B0F4 = 0; 48 | D_00E3A8BC = 0; 49 | 50 | D_00E3A8B4 = 51 | D_00E3A8AC = 52 | D_00E3B12C = 53 | D_00E3B0F0 = 0; 54 | 55 | D_00E3B124 = 0; 56 | } 57 | 58 | void C_0076898A() { 59 | int i; 60 | 61 | //-- unused? -- 62 | if(D_00E3B0F4) { 63 | D_00E3B0F4 = 0; 64 | D_00E3B0F0 = 3; 65 | for(i = 0; i < WM_MAX_MODELID; i ++) 66 | D_00E3A8C0[i] = 0; 67 | for(i = 0x20; i < WM_MAX_MODELID; i ++) 68 | D_00E3B0F8[i] = -1; 69 | } 70 | //-- -- 71 | } 72 | 73 | void C_007689F7() { 74 | //-- unused? -- 75 | if(D_00E3B0F4 && !C_00761176()) 76 | C_0076898A(); 77 | //-- -- 78 | if(D_00E3B0F0) { 79 | D_00E3B0F0 --; 80 | if(D_00E3B0F0 == 0) 81 | C_00750784(); 82 | } 83 | } 84 | 85 | void C_00768B36(short); 86 | 87 | struct t_wm_b8 *C_00768A37(short wModelId/*bp08*/) { 88 | struct { 89 | struct t_wm_unused_stuff_24 *local_2_unused; 90 | int local_1; 91 | }lolo; 92 | 93 | if(wModelId < 0 || wModelId >= WM_MAX_MODELID) 94 | wModelId = WM_MODELID_00; 95 | if(D_00E3B0F8[wModelId] < 0) {//else 00768A8B 96 | if(wModelId < 3) { 97 | C_00768B36(wModelId); 98 | } else if(wModelId < 0x20) { 99 | return 0; 100 | } 101 | } 102 | if(wModelId < 3) 103 | return D_00E3B128?D_00E2C430:0; 104 | if(wModelId < 0x20)//else 00768AE4 105 | return /*lolo.local_3*/D_00E3A8A8?&(D_00E2C808[D_00E3B0F8[wModelId] - 1]):0; 106 | //-- unused? -- 107 | if(D_00E3B0F4) { 108 | lolo.local_1 = D_00E3B0F8[wModelId] - 13; 109 | if(D_00E3A8C0[wModelId] == 0) { 110 | lolo.local_2_unused = &(D_00E3A8B0->f_10[lolo.local_1]); 111 | D_00E3A8C0[wModelId] = 1; 112 | } 113 | 114 | return 0; 115 | } 116 | //-- -- 117 | 118 | return 0; 119 | } 120 | 121 | void C_00768B82(void); 122 | 123 | void C_00768B36(short wModelId/*bp08*/) { 124 | if(!D_00E3A8AC && C_007538C9(2)) {//wm:start something(unused)? 125 | D_00E3B128 = 0; 126 | C_00759A65(wModelId);//wmfile:load 3d models[chara]? 127 | D_00E3A8AC = 1; 128 | } 129 | D_00E3B12C = wModelId; 130 | C_00768B82(); 131 | } 132 | 133 | void C_00768BA9(void); 134 | 135 | void C_00768B82() { 136 | if(D_00E3A8AC) { 137 | D_00E3A8AC = 0; 138 | C_0075395E(2);//wm:stop something(unused)? 139 | C_00768BA9(); 140 | } 141 | } 142 | 143 | void C_00768BA9() { 144 | D_00E3B128 = 1; 145 | D_00E3B0F8[0] = 146 | D_00E3B0F8[1] = 147 | D_00E3B0F8[2] = -1; 148 | D_00E3B0F8[D_00E3B12C] = 0; 149 | } 150 | 151 | void C_00768BF5(void); 152 | 153 | void C_00768BE2(short bp08) { 154 | D_00E3A8B4 = bp08; 155 | C_00768BF5(); 156 | } 157 | 158 | //correspondance [modelId]->[model list index] 159 | char D_0096DF10[0xd][0x20] = { 160 | { 0, 0, 0,-1, 1, 2, 3, 9,-1,-1,-1,-1, 5,-1, 8, 6, 7,-1,-1,-1,-1,-1,-1,-1, 4,10,-1,-1,-1,-1,-1,-1}, 161 | { 0, 0, 0, 3, 1,-1,-1, 9,-1,10,12,-1, 5, 4, 8, 6, 7,-1,-1, 2,-1,-1,-1,-1,11,13,-1,-1,-1,-1,-1,-1}, 162 | { 0, 0, 0, 3, 1,-1,-1,-1,-1,10,12,-1, 5, 4, 8, 6, 7,-1,-1, 2, 9,-1,-1,-1,11,13,-1,-1,-1,-1,-1,-1}, 163 | { 0, 0, 0, 3, 1,-1,-1, 9,-1,10,12,-1, 5, 4, 8, 6, 7,-1,-1, 2,-1,-1,-1,-1,11,13,-1,-1,-1,-1,-1,-1}, 164 | { 0, 0, 0, 3, 1,-1,-1,-1,-1,10,12,-1, 5, 4, 8, 6, 7,-1,-1, 2, 9,-1,-1,-1,11,13,-1,-1,-1,-1,-1,-1}, 165 | { 0, 0, 0, 3, 1,-1,-1,-1,-1,10,-1,12, 5, 4, 8, 6, 7,-1,-1, 2, 9,-1,-1,-1,11,13,-1,-1,-1,-1,-1,-1}, 166 | { 0, 0, 0, 3, 1,-1,-1,-1,-1,10,-1,12, 5, 4, 8, 6, 7,-1,-1, 2, 9,-1,-1,-1,11,13,-1,-1,-1,-1,-1,-1}, 167 | { 0, 0, 0, 3, 1,-1,-1,-1,-1,10,-1,-1, 5, 4, 8, 6, 7,-1,-1, 2, 9,-1,-1,-1,-1,12,-1,-1,-1,11,-1,-1}, 168 | { 0, 0, 0, 3, 1,-1,-1,-1,-1,10,-1,-1, 5, 4, 8, 6, 7,-1,-1, 2, 9,-1,-1,-1,-1,12,-1,-1,-1,11,-1,-1}, 169 | { 0, 0, 0,-1,-1,-1,-1, 2, 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, 170 | { 0, 0, 0,-1,-1,-1,-1, 2, 1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, 171 | { 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 1,-1,-1,-1, 2, 3,-1,-1,-1,-1,-1,-1,-1, 4, 5, 6,-1, 7,-1}, 172 | { 0, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 1, 2, 3,-1,-1,-1,-1,-1,-1,-1,-1} 173 | }; 174 | 175 | void C_00768BF5() { 176 | int i; 177 | 178 | for(i = 3; i < 0x20; i ++) 179 | D_00E3B0F8[i] = D_0096DF10[D_00E3A8B4][i]; 180 | D_00E3A8A8 = 1; 181 | } 182 | 183 | void C_00768C3D() { 184 | D_00E3A8AC = 0; 185 | } 186 | 187 | //wm:set "highwind has reactor"? 188 | void C_00768C4C(int bp08) { 189 | D_00E3B124 = bp08; 190 | } 191 | 192 | //wm:highwind has reactor? 193 | int C_00768C59() { 194 | return D_00E3B124; 195 | } 196 | -------------------------------------------------------------------------------- /NEWFF7/C_004067A0.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | 7 | #include "ff7.h" 8 | //////////////////////////////////////// 9 | const char D_007B64A0[] = FF7_REG_PATH; 10 | const char D_007B64D0[] = FF7_REG_PATH "\\1.00\\Graphics"; 11 | const char D_007B6510[] = "DD_GUID"; 12 | const char D_007B6518[] = "Driver"; 13 | const char D_007B6520[] = "DriverPath"; 14 | const char D_007B6530[] = "Mode"; 15 | const char D_007B6538[] = "Options"; 16 | const char D_007B6540[] = "SSI_DEBUG"; 17 | //////////////////////////////////////// 18 | struct t_config_local {//size 0x124, or more? 19 | /*000*/unsigned char f_00[0x10];//"DD_GUID" 20 | /*010*/int dwHasDD_GUID; 21 | /*014*/int dwDriver;//[0 "sw"; 1 "hw"; 2 "OpenGL"; >= 3 "dll driver"] 22 | /*018*/char f_18[MAX_PATH];//"DriverPath" 23 | /*11c*/int dwMode; 24 | /*120*/int dwOptions; 25 | }; 26 | //////////////////////////////////////// 27 | int D_009A054C;//not in this module:should be extern? 28 | //////////////////////////////////////// 29 | //get SSI_DEBUG option 30 | int C_004067A0() { 31 | struct { 32 | char local_68[256]; 33 | DWORD dwType;//local_4 34 | int dwResult;//local_3 35 | DWORD cbData;//local_2 36 | HKEY hKey;//local_1 37 | }lolo; 38 | 39 | lolo.dwResult = 0; 40 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B64A0, 0, KEY_QUERY_VALUE, &lolo.hKey) == 0) { 41 | lolo.cbData = 0x10; 42 | if(RegQueryValueEx(lolo.hKey, D_007B6540, 0, &lolo.dwType, (LPBYTE)lolo.local_68, &lolo.cbData) == 0) { 43 | if(lolo.cbData == 0x10 && stricmp("SHOWMETHEAPPLOG", lolo.local_68) == 0) 44 | lolo.dwResult = 1; 45 | } 46 | RegCloseKey(lolo.hKey); 47 | } 48 | return lolo.dwResult; 49 | } 50 | 51 | //graphic driver registry 52 | int C_0040682D(struct t_config_local *bp08) { 53 | struct { 54 | unsigned char local_73[0x10]; 55 | char local_69[MAX_PATH]; 56 | int dwSuccess;//local_4 57 | DWORD dwType;//local_3 58 | HKEY hKey;//local_2 59 | DWORD cbData;//local_1 60 | }lolo; 61 | 62 | lolo.dwSuccess = 1; 63 | #if (_MSC_VER < 1500) 64 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B64D0, 0, KEY_ALL_ACCESS/*0xf003f*/, &lolo.hKey) == 0) { 65 | #else 66 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B64D0, 0, KEY_QUERY_VALUE, &lolo.hKey) == 0) { 67 | #endif 68 | //-- "DD_GUID" -- 69 | lolo.cbData = 0x10; 70 | if(RegQueryValueEx(lolo.hKey, D_007B6510, 0, &lolo.dwType, (LPBYTE)&(bp08->f_00), &lolo.cbData) == 0) { 71 | memset(lolo.local_73, 0, 0x10);//i.e lolo.local_73 = ""? 72 | if(memcmp(bp08->f_00, lolo.local_73, 0x10)) 73 | bp08->dwHasDD_GUID = 1; 74 | else 75 | bp08->dwHasDD_GUID = 0; 76 | } else { 77 | lolo.dwSuccess = 0; 78 | } 79 | //-- "Driver" -- 80 | lolo.cbData = 4; 81 | if(RegQueryValueEx(lolo.hKey, D_007B6518, 0, &lolo.dwType, (LPBYTE)&(bp08->dwDriver), &lolo.cbData) != 0) 82 | lolo.dwSuccess = 0; 83 | #if 1 84 | //we can force the driver here 85 | // bp08->dwDriver = 0;//sw 86 | bp08->dwDriver = 1;//d3d 87 | // bp08->dwDriver = 2;//opengl 88 | #endif 89 | //-- "DriverPath" -- 90 | if(bp08->dwDriver >= 3) { 91 | lolo.cbData = MAX_PATH; 92 | if(RegQueryValueEx(lolo.hKey, D_007B6520, 0, &lolo.dwType, (LPBYTE)lolo.local_69, &lolo.cbData) != 0) { 93 | lolo.dwSuccess = 0; 94 | bp08->f_18[0] = 0; 95 | } else { 96 | strcpy(bp08->f_18, lolo.local_69); 97 | } 98 | } 99 | //-- "Mode" -- 100 | lolo.cbData = 4; 101 | if(RegQueryValueEx(lolo.hKey, D_007B6530, 0, &lolo.dwType, (LPBYTE)&bp08->dwMode, &lolo.cbData) != 0) 102 | lolo.dwSuccess = 0; 103 | //note: mode is also polled with C_00404D80() 104 | //-- "Options" -- 105 | lolo.cbData = 4; 106 | if(RegQueryValueEx(lolo.hKey, D_007B6538, 0, &lolo.dwType, (LPBYTE)&bp08->dwOptions, &lolo.cbData) != 0) 107 | lolo.dwSuccess = 0; 108 | //-- -- 109 | RegCloseKey(lolo.hKey); 110 | } else { 111 | lolo.dwSuccess = 0; 112 | } 113 | 114 | return lolo.dwSuccess; 115 | } 116 | 117 | //prepare graphic driver? 118 | int C_004069FD(struct t_aa0 *bp08) { 119 | struct { 120 | struct t_extdll_24 bp_2d8; 121 | int dwShowLog;//bp_2b4 122 | int dwSuccess;//bp_2b0 123 | struct t_config_local bp_2ac; 124 | char _dummy_[0x188];//should be in t_config_local? 125 | }lolo; 126 | 127 | lolo.dwSuccess = C_0040682D(&lolo.bp_2ac);//graphic driver registry 128 | if(lolo.dwSuccess) { 129 | switch(lolo.bp_2ac.dwMode) { 130 | case 0: 131 | bp08->dwDisplayWidth = 320; 132 | bp08->dwDisplayHeight = 240; 133 | D_009A054C = 0; 134 | break; 135 | case 1: 136 | bp08->dwDisplayWidth = 640; 137 | bp08->dwDisplayHeight = 480; 138 | D_009A054C = 1; 139 | break; 140 | case 2: 141 | bp08->dwDisplayWidth = 640; 142 | bp08->dwDisplayHeight = 480; 143 | D_009A054C = 2; 144 | break; 145 | }//end switch 146 | switch(lolo.bp_2ac.dwHasDD_GUID) { 147 | case 0: bp08->f_968 = 1; break; 148 | case 1: bp08->f_968 = 0; break; 149 | }//end switch 150 | bp08->f_988 = 0;//HEL off 151 | if(lolo.bp_2ac.dwOptions & 1) 152 | bp08->f_96c = 1; 153 | else 154 | bp08->f_96c = 0; 155 | bp08->f_a94 = 0; 156 | if(lolo.bp_2ac.dwOptions & 2) {//else 00406B9D 157 | bp08->f_a90 = 1;//nvidia 158 | if(lolo.bp_2ac.dwOptions & 8) 159 | bp08->f_a98 = 0;//texture bleeding patch(field) 160 | if(lolo.bp_2ac.dwOptions & 0x10) { 161 | bp08->f_a98 = 0; 162 | bp08->f_a94 = 1;//"tnt_fix" 163 | } 164 | } else { 165 | bp08->f_a90 = 0; 166 | } 167 | #if 1 //[debug]force window mode 168 | bp08->dwIsFullScreen = 0; 169 | #else 170 | bp08->dwIsFullScreen = 1; 171 | #endif 172 | bp08->f_948 = 0; 173 | bp08->f_94c = 1; 174 | bp08->dwUseD3D2 = 1; 175 | switch(lolo.bp_2ac.dwDriver) { 176 | case 0: bp08->f_a60 = 1; break;//Software renderer 177 | case 1: bp08->f_a60 = 0; break;//Hardware renderer 178 | case 2: bp08->f_a60 = 3; break;//OpenGL 179 | case 3://extern DLL ("custom driver") 180 | bp08->f_a60 = 2; 181 | bp08->f_a64 = mem_strdup(lolo.bp_2ac.f_18); 182 | C_00666AB0(2, &lolo.bp_2d8); 183 | lolo.bp_2d8.f_04 = bp08->f_a64; 184 | if(C_00666AD5(&lolo.bp_2d8, bp08)) {//load graphic dll? 185 | //ok 186 | } else { 187 | //failed:fallback to sw renderer 188 | bp08->f_a60 = 1; 189 | } 190 | break; 191 | default: 192 | bp08->f_a60 = 1; 193 | }//end switch 194 | //-- log -- 195 | lolo.dwShowLog = C_004067A0();//get SSI_DEBUG option 196 | bp08->f_838 = lolo.dwShowLog; 197 | bp08->f_834 = lolo.dwShowLog; 198 | //-- -- 199 | bp08->f_a30 = 1; 200 | } 201 | 202 | return lolo.dwSuccess; 203 | } 204 | -------------------------------------------------------------------------------- /fontinfo.h: -------------------------------------------------------------------------------- 1 | //part of WINDOW.BIN 2 | unsigned char FONTINFO[0x518] = { 3 | 0x03,0x45,0x48,0x0A,0x07,0x0A,0x09,0x03,0x48,0x48,0x07,0x07,0x27,0x05,0x26,0x06, 4 | 0x08,0x47,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x45,0x04,0x07,0x08,0x07,0x27, 5 | 0x0A,0x09,0x07,0x08,0x08,0x07,0x07,0x08,0x08,0x03,0x06,0x07,0x07,0x0B,0x08,0x09, 6 | 0x07,0x09,0x07,0x07,0x07,0x08,0x09,0x0B,0x08,0x09,0x07,0x04,0x06,0x04,0x07,0x08, 7 | 0x04,0x07,0x07,0x06,0x07,0x07,0x06,0x07,0x07,0x03,0x04,0x06,0x03,0x0B,0x07,0x07, 8 | 0x07,0x07,0x05,0x06,0x06,0x07,0x07,0x0B,0x07,0x07,0x06,0x05,0x03,0x05,0x08,0x44, 9 | 0x4B,0x4C,0x4B,0x49,0x4B,0x09,0x08,0x07,0x49,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 10 | 0x07,0x07,0x04,0x03,0x04,0x04,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07, 11 | 0x0B,0x06,0x07,0x08,0x0B,0x06,0x07,0x07,0x09,0x2A,0x4D,0x04,0x05,0x08,0x0C,0x09, 12 | 0x0B,0x07,0x07,0x07,0x09,0x07,0x07,0x07,0x09,0x08,0x04,0x06,0x06,0x09,0x0B,0x07, 13 | 0x06,0x03,0x08,0x07,0x08,0x08,0x09,0x07,0x07,0x09,0x01,0x09,0x09,0x09,0x0C,0x0B, 14 | 0x08,0x0C,0x06,0x06,0x04,0x04,0x07,0x07,0x07,0x09,0x07,0x09,0x05,0x05,0x07,0x07, 15 | 0x08,0x03,0x04,0x06,0x0D,0x09,0x07,0x09,0x07,0x07,0x03,0x03,0x03,0x03,0x09,0x09, 16 | 0x08,0x09,0x08,0x08,0x08,0x03,0x06,0x07,0x05,0x06,0x03,0x06,0x05,0x06,0x05,0x05, 17 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 18 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 19 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 20 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 21 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 22 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 23 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 24 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 25 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 26 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 27 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 28 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 29 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 30 | 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 31 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 32 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 33 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 34 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 35 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 36 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 37 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 38 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 39 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 40 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 41 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 42 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 43 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 44 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 45 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 46 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 47 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 48 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 49 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 50 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 51 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 52 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 53 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 54 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 55 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 56 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 57 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 58 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 59 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 60 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 61 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 62 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 63 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 64 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 65 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 66 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 67 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 68 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 69 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 70 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 71 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 72 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 73 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 74 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 75 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 76 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 77 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 78 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 79 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 80 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 81 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 82 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 83 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 84 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 85 | }; 86 | -------------------------------------------------------------------------------- /FF7WorldMap.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 26 | 29 | 32 | 35 | 38 | 41 | 53 | 56 | 59 | 62 | 71 | 74 | 77 | 80 | 83 | 86 | 89 | 92 | 93 | 101 | 104 | 107 | 110 | 113 | 116 | 128 | 131 | 134 | 137 | 147 | 150 | 153 | 156 | 159 | 162 | 165 | 168 | 169 | 170 | 171 | 172 | 173 | 178 | 181 | 182 | 185 | 186 | 189 | 190 | 193 | 194 | 197 | 198 | 201 | 202 | 205 | 206 | 209 | 210 | 213 | 214 | 217 | 218 | 221 | 222 | 225 | 226 | 229 | 230 | 233 | 234 | 237 | 238 | 241 | 242 | 245 | 246 | 247 | 252 | 255 | 256 | 259 | 260 | 263 | 264 | 267 | 268 | 271 | 272 | 275 | 276 | 279 | 280 | 283 | 284 | 285 | 288 | 291 | 292 | 295 | 296 | 299 | 300 | 303 | 304 | 305 | 308 | 309 | 312 | 313 | 314 | 315 | 316 | 317 | -------------------------------------------------------------------------------- /NEWFF7/C_0075E7A0.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- light related 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | //////////////////////////////////////// 11 | tBGRA D_00E360F0; 12 | struct t_light_5ac *D_00E360F4;//light system(2) 13 | struct t_light_5ac *D_00E360F8;//light system(1) 14 | //////////////////////////////////////// 15 | //wm:create light system(1) 16 | struct t_light_5ac *C_0075E7A0(int bp08) { 17 | struct { 18 | D3DVECTOR pos_Light1;//local_33 19 | D3DVECTOR pos_Light2;//local_30 20 | struct t_light_5ac *local_27; 21 | D3DVECTOR pos_Light0;//local_26 22 | D3DVECTOR local_23; 23 | tBGRA col_Light0;//local_20 24 | tBGRA local_19; 25 | D3DMATRIX local_18; 26 | tBGRA col_Light2;//local_2 27 | tBGRA col_Light1;//local_1 28 | }lolo; 29 | 30 | C_0075E029(&lolo.local_18);//wm:init matrix(switch y z axis)? 31 | if(bp08 != 2) { 32 | // 0.16088867f -0.1003418f -0.9848633f 33 | //-0.375f 0.81762695f 0.4489746f 34 | // 0.7128906f 0.35986328f 0.6064453f 35 | lolo.pos_Light0.x = 659.0f/4096.0f; lolo.pos_Light0.y = - 411.0f/4096.0f; lolo.pos_Light0.z = -4034.0f/4096.0f; 36 | lolo.pos_Light1.x = -1536.0f/4096.0f; lolo.pos_Light1.y = 3349.0f/4096.0f; lolo.pos_Light1.z = 1839.0f/4096.0f; 37 | lolo.pos_Light2.x = 2920.0f/4096.0f; lolo.pos_Light2.y = 1474.0f/4096.0f; lolo.pos_Light2.z = 2484.0f/4096.0f; 38 | 39 | lolo.local_23.x = lolo.pos_Light0.x; lolo.local_23.y = lolo.pos_Light0.y; lolo.local_23.z = lolo.pos_Light0.z; 40 | fast_multRotByVector(&lolo.local_18, &lolo.local_23, &lolo.pos_Light0); 41 | lolo.local_23.x = lolo.pos_Light1.x; lolo.local_23.y = lolo.pos_Light1.y; lolo.local_23.z = lolo.pos_Light1.z; 42 | fast_multRotByVector(&lolo.local_18, &lolo.local_23, &lolo.pos_Light1); 43 | lolo.local_23.x = lolo.pos_Light2.x; lolo.local_23.y = lolo.pos_Light2.y; lolo.local_23.z = lolo.pos_Light2.z; 44 | fast_multRotByVector(&lolo.local_18, &lolo.local_23, &lolo.pos_Light2); 45 | 46 | lolo.col_Light0.bgra = 0xff6e6e6e; 47 | lolo.col_Light1.bgra = 0xffaaaaaa; 48 | lolo.col_Light2.bgra = 0xff3c3c3c; 49 | 50 | lolo.local_19.c.r = 0x40; 51 | lolo.local_19.c.g = 0x40; 52 | lolo.local_19.c.b = 0x40; 53 | lolo.local_19.c.a = 0xff; 54 | } else { 55 | lolo.pos_Light0.x = 0; lolo.pos_Light0.y = 1.0f; lolo.pos_Light0.z = 0; 56 | lolo.pos_Light1.x = 0; lolo.pos_Light1.y = 0; lolo.pos_Light1.z = 0; 57 | lolo.pos_Light2.x = 0; lolo.pos_Light2.y = 0; lolo.pos_Light2.z = 0; 58 | 59 | lolo.local_23.x = lolo.pos_Light0.x; lolo.local_23.y = lolo.pos_Light0.y; lolo.local_23.z = lolo.pos_Light0.z; 60 | fast_multRotByVector(&lolo.local_18, &lolo.local_23, &lolo.pos_Light0); 61 | lolo.local_23.x = lolo.pos_Light1.x; lolo.local_23.y = lolo.pos_Light1.y; lolo.local_23.z = lolo.pos_Light1.z; 62 | fast_multRotByVector(&lolo.local_18, &lolo.local_23, &lolo.pos_Light1); 63 | lolo.local_23.x = lolo.pos_Light2.x; lolo.local_23.y = lolo.pos_Light2.y; lolo.local_23.z = lolo.pos_Light2.z; 64 | fast_multRotByVector(&lolo.local_18, &lolo.local_23, &lolo.pos_Light2); 65 | 66 | lolo.col_Light0.bgra = 0xffffffff; 67 | lolo.col_Light1.bgra = 0xff000000; 68 | lolo.col_Light2.bgra = 0xff000000; 69 | 70 | lolo.local_19.c.r = 0x20; 71 | lolo.local_19.c.g = 0x20; 72 | lolo.local_19.c.b = 0x30; 73 | lolo.local_19.c.a = 0xff; 74 | } 75 | lolo.local_27 = C_0069CA53(&lolo.pos_Light0, &lolo.pos_Light1, &lolo.pos_Light2, lolo.col_Light0, lolo.col_Light1, lolo.col_Light2, lolo.local_19);//light:create light system 76 | 77 | return lolo.local_27; 78 | } 79 | 80 | //wm:create light system(2) 81 | struct t_light_5ac *C_0075E9B3(int bp08) { 82 | struct { 83 | D3DVECTOR pos_Light1;//local_14 84 | D3DVECTOR pos_Light2;//local_11 85 | struct t_light_5ac *local_8; 86 | D3DVECTOR pos_Light0;//local_7 87 | tBGRA col_Light0;//local_4 88 | tBGRA local_3; 89 | tBGRA col_Light2;//local_2 90 | tBGRA col_Light1;//local_1 91 | }lolo; 92 | 93 | switch(bp08) { 94 | case 0: case 3: 95 | lolo.pos_Light0.x = 1.0f; lolo.pos_Light0.y = 1.0f; lolo.pos_Light0.z = 1.0f; 96 | lolo.pos_Light1.x = 0; lolo.pos_Light1.y = 0; lolo.pos_Light1.z = 0; 97 | lolo.pos_Light2.x = 0; lolo.pos_Light2.y = 0; lolo.pos_Light2.z = 0; 98 | 99 | lolo.col_Light0.bgra = 0xff6e6e6e; 100 | lolo.col_Light1.bgra = 0xff000000; 101 | lolo.col_Light2.bgra = 0xff000000; 102 | 103 | lolo.local_3.c.r = 0x40; 104 | lolo.local_3.c.g = 0x40; 105 | lolo.local_3.c.b = 0x40; 106 | lolo.local_3.c.a = 0xff; 107 | break; 108 | case 2: 109 | lolo.pos_Light0.x = 0; lolo.pos_Light0.y = 1.0f; lolo.pos_Light0.z = 0; 110 | lolo.pos_Light1.x = 0; lolo.pos_Light1.y = 0; lolo.pos_Light1.z = 0; 111 | lolo.pos_Light2.x = 0; lolo.pos_Light2.y = 0; lolo.pos_Light2.z = 0; 112 | 113 | lolo.col_Light0.bgra = 0xff6e6e6e; 114 | lolo.col_Light1.bgra = 0xff000000; 115 | lolo.col_Light2.bgra = 0xff000000; 116 | 117 | lolo.local_3.c.r = 0x20; 118 | lolo.local_3.c.g = 0x20; 119 | lolo.local_3.c.b = 0x20; 120 | lolo.local_3.c.a = 0xff; 121 | break; 122 | }//end switch 123 | 124 | lolo.local_8 = C_0069CA53(&lolo.pos_Light0, &lolo.pos_Light1, &lolo.pos_Light2, lolo.col_Light0, lolo.col_Light1, lolo.col_Light2, lolo.local_3);//light:create light system 125 | 126 | return lolo.local_8; 127 | } 128 | 129 | //wm:secure clean light(2) 130 | void C_0075EACE() { 131 | if(D_00E360F4) { 132 | C_0069C6CF(1, D_00E360F4);//light:release light system 133 | D_00E360F4 = 0; 134 | } 135 | } 136 | 137 | //wm:secure clean light(1) 138 | void C_0075EAF6() { 139 | if(D_00E360F8) { 140 | C_0069C6CF(1, D_00E360F8);//light:release light system 141 | D_00E360F8 = 0; 142 | } 143 | } 144 | 145 | //wm:clean lights? 146 | void C_0075EB1E() { 147 | C_0075EAF6();//wm:secure clean light(1) 148 | C_0075EACE();//wm:secure clean light(2) 149 | } 150 | 151 | //wm:change light params? 152 | void C_0075EB2D(int bp08) { 153 | if(D_00E360F4) { 154 | switch(bp08) { 155 | case 0: 156 | D_00E360F4->f_008[0]->sDir.x = 1.0f; D_00E360F4->f_008[0]->sDir.y = 1.0f; D_00E360F4->f_008[0]->sDir.z = 1.0f; 157 | D_00E360F4->f_008[1]->sDir.x = 0; D_00E360F4->f_008[1]->sDir.y = 0; D_00E360F4->f_008[1]->sDir.z = 0; 158 | D_00E360F4->f_008[2]->sDir.x = 0; D_00E360F4->f_008[2]->sDir.y = 0; D_00E360F4->f_008[2]->sDir.z = 0; 159 | 160 | D_00E360F4->f_008[0]->color.bgra = 0xff6e6e6e; 161 | D_00E360F4->f_008[1]->color.bgra = 0xff000000; 162 | D_00E360F4->f_008[2]->color.bgra = 0xff000000; 163 | break; 164 | case 1: 165 | D_00E360F4->f_008[0]->sDir.x = 0; D_00E360F4->f_008[0]->sDir.y = 1.0f; D_00E360F4->f_008[0]->sDir.z = 0; 166 | D_00E360F4->f_008[1]->sDir.x = 0; D_00E360F4->f_008[1]->sDir.y = 0; D_00E360F4->f_008[1]->sDir.z = 0; 167 | D_00E360F4->f_008[2]->sDir.x = 0; D_00E360F4->f_008[2]->sDir.y = 0; D_00E360F4->f_008[2]->sDir.z = 0; 168 | 169 | D_00E360F4->f_008[0]->color.bgra = 0xff6e6e6e; 170 | D_00E360F4->f_008[1]->color.bgra = 0xff000000; 171 | D_00E360F4->f_008[2]->color.bgra = 0xff000000; 172 | break; 173 | case 2: 174 | D_00E360F4->f_008[0]->color.bgra = D_00E360F0.bgra; 175 | D_00E360F4->f_008[1]->color.bgra = 0xff000000; 176 | D_00E360F4->f_008[2]->color.bgra = 0xff000000; 177 | break; 178 | case 3: 179 | D_00E360F4->f_008[0]->color.bgra = 0xff6e6e6e; 180 | D_00E360F4->f_008[1]->color.bgra = 0xff000000; 181 | D_00E360F4->f_008[2]->color.bgra = 0xff000000; 182 | break; 183 | }//end switch 184 | C_0069BF90(D_00E360F4->f_008[0]->color, &(D_00E360F4->f_008[0]->color_norm));//light:tBGRA to fBGRA? 185 | C_0069C11F(&(D_00E360F4->f_008[0]->color_norm));//light:normalize fBGRA[no copy]? 186 | D_00E360F4->f_008[1]->color_norm.r = 0; D_00E360F4->f_008[1]->color_norm.g = 0; D_00E360F4->f_008[1]->color_norm.b = 0; D_00E360F4->f_008[1]->color_norm.a = 1.0f; 187 | D_00E360F4->f_008[2]->color_norm.r = 0; D_00E360F4->f_008[2]->color_norm.g = 0; D_00E360F4->f_008[2]->color_norm.b = 0; D_00E360F4->f_008[2]->color_norm.a = 1.0f; 188 | C_0069C5EE(D_00E360F4);//light:reset 189 | } 190 | } 191 | 192 | //wm:set some global light color? 193 | void C_0075EE10(struct MATRIX *bp08) { 194 | D_00E360F0.c.r = bp08->m[0][0] >> 4; 195 | D_00E360F0.c.g = bp08->m[1][0] >> 4; 196 | D_00E360F0.c.b = bp08->m[2][0] >> 4; 197 | D_00E360F0.c.a = 0xff; 198 | } 199 | -------------------------------------------------------------------------------- /NEWFF7/psx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #ifndef __PSX_H__ 7 | #define __PSX_H__ 8 | 9 | //inspired by LIBGPU.H 10 | 11 | /* 12 | * Primitive Handling Macros 13 | */ 14 | #define setlen( p, _len) (((struct P_TAG *)(p))->len = (unsigned char)(_len)) 15 | #define setaddr(p, _addr) (((struct P_TAG *)(p))->addr = (unsigned)(_addr)) 16 | #define setcode(p, _code) (((struct P_TAG *)(p))->code = (unsigned char)(_code)) 17 | 18 | #define getlen(p) (unsigned char)(((struct P_TAG *)(p))->len) 19 | #define getcode(p) (unsigned char)(((struct P_TAG *)(p))->code) 20 | #define getaddr(p) (unsigned)(((struct P_TAG *)(p))->addr) 21 | 22 | #define setSemiTrans(p, abe) \ 23 | ((abe)?setcode(p, getcode(p)|0x02):setcode(p, getcode(p)&~0x02)) 24 | 25 | #define setShadeTex(p, tge) \ 26 | ((tge)?setcode(p, getcode(p)|0x01):setcode(p, getcode(p)&~0x01)) 27 | 28 | #define setPolyFT3(p) setlen(p, 7), setcode(p, 0x24) 29 | #define setPolyGT3(p) setlen(p, 9), setcode(p, 0x34) 30 | #define setPolyF4(p) setlen(p, 5), setcode(p, 0x28) 31 | #define setPolyFT4(p) setlen(p, 9), setcode(p, 0x2c) 32 | #define setPolyG4(p) setlen(p, 8), setcode(p, 0x38) 33 | #define setPolyGT4(p) setlen(p, 12), setcode(p, 0x3c) 34 | 35 | #define setLineG2(p) setlen(p, 4), setcode(p, 0x50) 36 | #define setLineG3(p) setlen(p, 7), setcode(p, 0x58),(p)->pad = 0x55555555 37 | 38 | #define setTile(p) setlen(p, 3), setcode(p, 0x60) 39 | #define setTile1(p) setlen(p, 2), setcode(p, 0x68) 40 | 41 | /* 42 | * Set Primitive Colors 43 | */ 44 | #define setRGB0(p,_r0,_g0,_b0) \ 45 | (p)->r0 = _r0,(p)->g0 = _g0,(p)->b0 = _b0 46 | 47 | #define setRGB1(p,_r1,_g1,_b1) \ 48 | (p)->r1 = _r1,(p)->g1 = _g1,(p)->b1 = _b1 49 | 50 | #define setRGB2(p,_r2,_g2,_b2) \ 51 | (p)->r2 = _r2,(p)->g2 = _g2,(p)->b2 = _b2 52 | 53 | #define setRGB3(p,_r3,_g3,_b3) \ 54 | (p)->r3 = _r3,(p)->g3 = _g3,(p)->b3 = _b3 55 | 56 | /* 57 | * Set Primitive Screen Points 58 | */ 59 | #define setXY4(p,_x0,_y0,_x1,_y1,_x2,_y2,_x3,_y3) \ 60 | (p)->x0 = (_x0), (p)->y0 = (_y0), \ 61 | (p)->x1 = (_x1), (p)->y1 = (_y1), \ 62 | (p)->x2 = (_x2), (p)->y2 = (_y2), \ 63 | (p)->x3 = (_x3), (p)->y3 = (_y3) 64 | 65 | /* 66 | * Set Primitive Texture Points 67 | */ 68 | #define setUVWH(p,_u0,_v0,_w,_h) \ 69 | (p)->u0 = (_u0), (p)->v0 = (_v0), \ 70 | (p)->u1 = (_u0)+(_w), (p)->v1 = (_v0), \ 71 | (p)->u2 = (_u0), (p)->v2 = (_v0)+(_h), \ 72 | (p)->u3 = (_u0)+(_w), (p)->v3 = (_v0)+(_h) 73 | 74 | /* 75 | * Polygon Primitive Definitions 76 | */ 77 | struct P_TAG { 78 | /*00*/unsigned addr: 24; 79 | /*03*/unsigned len: 8; 80 | /*04*/unsigned char r0,g0,b0; 81 | /*07*/unsigned char code; 82 | }; 83 | 84 | struct POLY_F3 {//size 0x14 85 | /*00*/unsigned tag; 86 | /*04*/unsigned char r0,g0,b0; 87 | /*07*/unsigned char code; 88 | // 89 | /*08*/short x0,y0; 90 | /*0c*/short x1,y1; 91 | /*10*/short x2,y2; 92 | }; 93 | 94 | struct POLY_F4 {//size 0x18 95 | /*00*/unsigned tag; 96 | /*04*/unsigned char r0,g0,b0; 97 | /*07*/unsigned char code; 98 | // 99 | /*08*/short x0,y0; 100 | /*0c*/short x1,y1; 101 | /*10*/short x2,y2; 102 | /*14*/short x3,y3; 103 | }; 104 | 105 | struct POLY_FT3 {//size 0x20 106 | /*00*/unsigned tag; 107 | /*04*/unsigned char r0,g0,b0; 108 | /*07*/unsigned char code; 109 | // 110 | /*08*/short x0,y0; 111 | /*0c*/unsigned char u0,v0; unsigned short clut; 112 | /*10*/short x1,y1; 113 | /*14*/unsigned char u1,v1; 114 | /*16*/unsigned short tpage; 115 | /*18*/short x2,y2; 116 | /*1c*/unsigned char u2,v2; char __1e[2]; 117 | }; 118 | 119 | struct POLY_FT4 {//size 0x28 120 | /*00*/unsigned tag; 121 | /*04*/unsigned char r0,g0,b0; 122 | /*07*/unsigned char code; 123 | // 124 | /*08*/short x0,y0; 125 | /*0c*/unsigned char u0,v0; unsigned short clut; 126 | /*10*/short x1,y1; 127 | /*14*/unsigned char u1,v1; unsigned short tpage; 128 | /*18*/short x2,y2; 129 | /*1c*/unsigned char u2,v2; /*unsigned */short pad1; 130 | /*20*/short x3,y3; 131 | /*24*/unsigned char u3,v3; /*unsigned */short pad2; 132 | }; 133 | 134 | struct POLY_G3 {//size 0x1c 135 | /*00*/unsigned tag; 136 | /*04*/unsigned char r0,g0,b0; 137 | /*07*/unsigned char code; 138 | // 139 | /*08*/short x0,y0; 140 | /*0c*/unsigned char r1,g1,b1,__0f; 141 | /*10*/short x1,y1; 142 | /*14*/unsigned char r2,g2,b2,__17; 143 | /*18*/short x2,y2; 144 | }; 145 | 146 | struct POLY_G4 {//size 0x24 147 | /*00*/unsigned tag; 148 | /*04*/unsigned char r0,g0,b0; 149 | /*07*/unsigned char code; 150 | // 151 | /*08*/short x0,y0; 152 | /*0c*/unsigned char r1,g1,b1,pad1; 153 | /*10*/short x1,y1; 154 | /*14*/unsigned char r2,g2,b2,pad2; 155 | /*18*/short x2,y2; 156 | /*1c*/unsigned char r3,g3,b3,pad3; 157 | /*20*/short x3,y3; 158 | }; 159 | 160 | struct POLY_GT3 {//size 0x28 161 | /*00*/char __00[4]; 162 | /*04*/unsigned char r0,g0,b0; 163 | /*07*/unsigned char code; 164 | // 165 | /*08*/short x0,y0; 166 | /*0c*/unsigned char u0,v0; unsigned short clut; 167 | /*10*/unsigned char r1,g1,b1,__13; 168 | /*14*/short x1,y1; 169 | /*18*/unsigned char u1,v1; unsigned short tpage; 170 | /*1c*/unsigned char r2,g2,b2,__1f; 171 | /*20*/short x2,y2; 172 | /*24*/unsigned char u2,v2; char __26[2]; 173 | }; 174 | 175 | struct POLY_GT4 {//size 0x34 176 | /*00*/unsigned tag; 177 | /*04*/unsigned char r0,g0,b0; 178 | /*07*/unsigned char code; 179 | // 180 | /*08*/short x0,y0; 181 | /*0c*/unsigned char u0,v0; unsigned short clut; 182 | /*10*/unsigned char r1,g1,b1,__13; 183 | /*14*/short x1,y1; 184 | /*18*/unsigned char u1,v1; unsigned short tpage; 185 | /*1c*/unsigned char r2,g2,b2,__1f; 186 | /*20*/short x2,y2; 187 | /*24*/unsigned char u2,v2; char __26[2]; 188 | /*28*/unsigned char r3,g3,b3,__2b; 189 | /*2c*/short x3,y3; 190 | /*30*/unsigned char u3,v3; char __32[2]; 191 | }; 192 | 193 | /* 194 | * Line Primitive Definitions 195 | */ 196 | struct LINE_F2 {//size 0x10 197 | /*00*/unsigned tag; 198 | /*04*/unsigned char r0,g0,b0; 199 | /*07*/unsigned char code; 200 | // 201 | /*08*/short x0,y0; 202 | /*0c*/short x1,y1; 203 | }; 204 | 205 | struct LINE_G2 {//size 0x14 206 | /*00*/unsigned tag; 207 | /*04*/unsigned char r0,g0,b0; 208 | /*07*/unsigned char code; 209 | // 210 | /*08*/short x0,y0; 211 | /*0c*/unsigned char r1,g1,b1,__0f; 212 | /*10*/short x1,y1; 213 | }; 214 | 215 | struct LINE_G3 {//size 0x20 216 | /*00*/unsigned tag; 217 | /*04*/unsigned char r0,g0,b0; 218 | /*07*/unsigned char code; 219 | // 220 | /*08*/short x0,y0; 221 | /*0c*/unsigned char r1,g1,b1,__0f; 222 | /*10*/short x1,y1; 223 | /*14*/unsigned char r2,g2,b2,__17; 224 | /*18*/short x2,y2; 225 | /*1c*/unsigned pad; 226 | }; 227 | 228 | /* 229 | * Sprite Primitive Definitions 230 | */ 231 | struct SPRT {//size 0x14 232 | /*00*/unsigned tag; 233 | /*04*/unsigned char r0,g0,b0; 234 | /*07*/unsigned char code; 235 | // 236 | /*08*/short x0,y0; 237 | /*0c*/unsigned char u0,v0; unsigned short clut; 238 | /*10*/short w,h; 239 | }; 240 | 241 | struct SPRT_16 {//size 0x10 242 | /*00*/char __00[4]; 243 | /*04*/unsigned char r0,g0,b0; 244 | /*07*/unsigned char code; 245 | // 246 | /*08*/short x0,y0; 247 | /*0c*/unsigned char u0,v0; unsigned short clut; 248 | }; 249 | 250 | struct SPRT_8 {//size 0x10 251 | /*00*/char __00[4]; 252 | /*04*/unsigned char r0,g0,b0; 253 | /*07*/unsigned char code; 254 | // 255 | /*08*/short x0,y0; 256 | /*0c*/unsigned char u0,v0; unsigned short clut; 257 | }; 258 | 259 | /* 260 | * Tile Primitive Definitions 261 | */ 262 | struct TILE {//size 0x10 263 | /*00*/unsigned tag; 264 | /*04*/unsigned char r0,g0,b0; 265 | /*07*/unsigned char code; 266 | // 267 | /*08*/short x0,y0; 268 | /*0c*/short w,h; 269 | }; 270 | 271 | struct TILE_16 {//size 0xc 272 | /*00*/char __00[4]; 273 | /*04*/unsigned char r0,g0,b0; 274 | /*07*/unsigned char code; 275 | // 276 | /*08*/short x0,y0; 277 | }; 278 | 279 | struct TILE_8 {//size 0xc 280 | /*00*/char __00[4]; 281 | /*04*/unsigned char r0,g0,b0; 282 | /*07*/unsigned char code; 283 | // 284 | /*08*/short x0,y0; 285 | }; 286 | 287 | struct TILE_1 {//size 0xc 288 | /*00*/char __00[4]; 289 | /*04*/unsigned char r0,g0,b0; 290 | /*07*/unsigned char code; 291 | // 292 | /*08*/short x0,y0; 293 | }; 294 | 295 | #endif 296 | -------------------------------------------------------------------------------- /NEWFF7/C_0040A460.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #include "ff7.h" 7 | //////////////////////////////////////// 8 | const char D_007B6730[] = FF7_REG_PATH; 9 | const char D_007B6760[] = "MIDI_DeviceID"; 10 | const char D_007B6770[] = "Sound_GUID"; 11 | const char D_007B6780[] = "Options"; 12 | const char D_007B6788[] = "DD_GUID"; 13 | const char D_007B6790[] = "MIDI_data"; 14 | const char D_007B67A0[] = "Options"; 15 | const char D_007B67A8[] = FF7_REG_PATH "\\1.00\\Sound"; 16 | const char D_007B67E0[] = FF7_REG_PATH "\\1.00\\Midi"; 17 | //////////////////////////////////////// 18 | HKEY D_009A06EC; 19 | //////////////////////////////////////// 20 | int __0040A460() { 21 | return RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B6730, 0, KEY_READ/*0x20019*/, &D_009A06EC) == 0; 22 | } 23 | 24 | int __0040A486() { 25 | return RegCloseKey(D_009A06EC) == 0; 26 | } 27 | 28 | int C_0040A8DD(HKEY, unsigned *);//get "Options"[SOUND] 29 | 30 | //get registry ...\SOUND:"Options" 31 | int C_0040A49C(unsigned *bp08) { 32 | HKEY hKey;//local_2 33 | int local_1; 34 | 35 | local_1 = 0; 36 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67A8, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 37 | local_1 = C_0040A8DD(hKey, bp08);//get "Options"[SOUND] 38 | RegCloseKey(hKey); 39 | } 40 | 41 | return local_1; 42 | } 43 | 44 | int C_0040A823(HKEY, char *); 45 | 46 | //get registry ...\SOUND:"Sound_GUID" 47 | int C_0040A4EC(LPGUID bp08) { 48 | HKEY hKey;//local_2 49 | int local_1; 50 | 51 | local_1 = 1; 52 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67A8, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 53 | local_1 = C_0040A823(hKey, (char *)bp08); 54 | RegCloseKey(hKey); 55 | } else { 56 | local_1 = 0; 57 | } 58 | 59 | return local_1; 60 | } 61 | 62 | int C_0040A989(HKEY, int *); 63 | 64 | //get registry ...\MIDI:"MIDI_DeviceID" 65 | int C_0040A545(int *bp08) { 66 | HKEY hKey;//local_2 67 | int local_1; 68 | 69 | local_1 = 1; 70 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67E0, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 71 | local_1 = C_0040A989(hKey, bp08); 72 | RegCloseKey(hKey); 73 | } else { 74 | local_1 = 0; 75 | } 76 | 77 | return local_1; 78 | } 79 | 80 | int C_0040A933(HKEY, int *);//get "Options"[MIDI] 81 | 82 | //get registry ...\MIDI:"Options" 83 | int C_0040A59E(int *bp08) { 84 | HKEY hKey;//local_2 85 | int local_1; 86 | 87 | local_1 = 0; 88 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67E0, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 89 | local_1 = C_0040A933(hKey, bp08);//get "Options"[MIDI] 90 | RegCloseKey(hKey); 91 | } 92 | 93 | return local_1; 94 | } 95 | 96 | int C_0040A89E(HKEY, char *); 97 | 98 | //set registry ...\SOUND:"Sound_GUID" 99 | int __0040A5EE(char *bp08) { 100 | HKEY hKey;//local_2 101 | int local_1; 102 | 103 | local_1 = 1; 104 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67A8, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 105 | local_1 = C_0040A89E(hKey, bp08); 106 | RegCloseKey(hKey); 107 | } else { 108 | local_1 = 0; 109 | } 110 | 111 | return local_1; 112 | } 113 | 114 | //set "DD_GUID" 115 | int __0040A647(char *bp08) { 116 | if(bp08) 117 | return RegSetValueEx(D_009A06EC, D_007B6788, 0, REG_SZ/*1*/, (LPBYTE)bp08, strlen(bp08) + 1) == 0; 118 | 119 | return RegDeleteValue(D_009A06EC, D_007B6788) == 0; 120 | } 121 | 122 | int C_0040A9BC(HKEY, char *);//set "MIDI_DeviceID" 123 | 124 | //set registry ...\MIDI:"MIDI_DeviceID" 125 | int __0040A699(char *bp08) { 126 | HKEY hKey;//local_2 127 | int local_1; 128 | 129 | local_1 = 1; 130 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67E0, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 131 | local_1 = C_0040A9BC(hKey, bp08);//set "MIDI_DeviceID" 132 | RegCloseKey(hKey); 133 | } else { 134 | local_1 = 0; 135 | } 136 | 137 | return local_1; 138 | } 139 | 140 | //get "DD_GUID" 141 | int __0040A6F2(char *bp08) { 142 | struct { 143 | int local_67; 144 | char local_66[256]; 145 | DWORD dwType;//local_2 146 | DWORD cbData;//local_1 147 | }lolo; 148 | 149 | lolo.cbData = 0x100; 150 | lolo.local_67 = RegQueryValueEx(D_009A06EC, D_007B6788, 0, &lolo.dwType, (LPBYTE)&lolo.local_66, &lolo.cbData); 151 | if(lolo.local_67 == 0) { 152 | strcpy(bp08, lolo.local_66); 153 | return 1; 154 | } 155 | bp08 = 0; 156 | 157 | return 0; 158 | } 159 | 160 | int C_0040A9E7(HKEY, char *);//get "MIDI_data" 161 | 162 | //get registry ...\MIDI:"MIDI_data" 163 | int C_0040A771(char *bp08) { 164 | HKEY hKey;//local_2 165 | int local_1; 166 | 167 | local_1 = 1; 168 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67E0, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 169 | local_1 = C_0040A9E7(hKey, bp08);//get "MIDI_data" 170 | RegCloseKey(hKey); 171 | } else { 172 | local_1 = 0; 173 | } 174 | 175 | return local_1; 176 | } 177 | 178 | int C_0040AA64(HKEY, char *);//set "MIDI_data" 179 | 180 | //set registry ...\MIDI:"MIDI_data" 181 | int __0040A7CA(char *bp08) { 182 | HKEY hKey;//local_2 183 | int local_1; 184 | 185 | local_1 = 1; 186 | if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B67E0, 0, KEY_READ/*0x20019*/, &hKey) == 0) { 187 | local_1 = C_0040AA64(hKey, bp08);//set "MIDI_data" 188 | RegCloseKey(hKey); 189 | } else { 190 | local_1 = 0; 191 | } 192 | 193 | return local_1; 194 | } 195 | 196 | //get "Sound_GUID" 197 | int C_0040A823(HKEY hKey/*bp08*/, char *bp0c) { 198 | struct { 199 | unsigned i;//local_4 200 | int local_3; 201 | DWORD dwType;//local_2 202 | DWORD cbData;//local_1 203 | }lolo; 204 | 205 | lolo.local_3 = 1; 206 | lolo.cbData = 0x10; 207 | if(RegQueryValueEx(hKey, D_007B6770, 0, &lolo.dwType, (LPBYTE)bp0c, &lolo.cbData) == 0) { 208 | if(bp0c && lolo.cbData == 0) { 209 | for(lolo.i = 0; lolo.i < 0x10; lolo.i ++) 210 | bp0c[lolo.i] = (char)0xff; 211 | lolo.local_3 = 0; 212 | } 213 | } else { 214 | lolo.local_3 = 0; 215 | } 216 | 217 | return lolo.local_3; 218 | } 219 | 220 | //set "Sound_GUID" 221 | int C_0040A89E(HKEY hKey/*bp08*/, char *bp0c) { 222 | if(bp0c) 223 | return RegSetValueEx(hKey, D_007B6770, 0, REG_BINARY/*3*/, (LPBYTE)bp0c, 0x10) == 0; 224 | 225 | return RegDeleteValue(hKey, D_007B6770) == 0; 226 | } 227 | 228 | //get "Options"[SOUND] 229 | int C_0040A8DD(HKEY hKey/*bp08*/, unsigned *bp0c) { 230 | struct { 231 | DWORD dwType;//local_2 232 | DWORD cbData;//local_1 233 | }lolo; 234 | 235 | lolo.cbData = 4; 236 | 237 | return RegQueryValueEx(hKey, D_007B6780, 0, &lolo.dwType, (LPBYTE)bp0c, &lolo.cbData) == 0; 238 | } 239 | 240 | //set "Options" 241 | int __0040A910(HKEY hKey/*bp08*/, char *bp0c) { 242 | return RegSetValueEx(hKey, D_007B6780, 0, REG_DWORD/*4*/, (LPBYTE)bp0c, 4) == 0; 243 | } 244 | 245 | //get "Options"[MIDI] 246 | int C_0040A933(HKEY hKey/*bp08*/, int *bp0c) { 247 | struct { 248 | DWORD dwType;//local_2 249 | DWORD cbData;//local_1 250 | }lolo; 251 | 252 | lolo.cbData = 4; 253 | 254 | return RegQueryValueEx(hKey, D_007B67A0, 0, &lolo.dwType, (LPBYTE)bp0c, &lolo.cbData) == 0; 255 | } 256 | 257 | //set "Options" 258 | int __0040A966(HKEY hKey/*bp08*/, char *bp0c) { 259 | return RegSetValueEx(hKey, D_007B67A0, 0, REG_DWORD/*4*/, (LPBYTE)bp0c, 4) == 0; 260 | } 261 | 262 | //get "MIDI_DeviceID" 263 | int C_0040A989(HKEY hKey/*bp08*/, int *bp0c) { 264 | struct { 265 | DWORD dwType;//local_2 266 | DWORD cbData;//local_1 267 | }lolo; 268 | 269 | lolo.cbData = 4; 270 | 271 | return RegQueryValueEx(hKey, D_007B6760, 0, &lolo.dwType, (LPBYTE)bp0c, &lolo.cbData) == 0; 272 | } 273 | 274 | //set "MIDI_DeviceID" 275 | int C_0040A9BC(HKEY hKey/*bp08*/, char *bp0c) { 276 | if(RegSetValueEx(hKey, D_007B6760, 0, REG_DWORD/*4*/, (LPBYTE)bp0c, 4) == 0) 277 | return 1; 278 | 279 | return 0; 280 | } 281 | 282 | //get "MIDI_data" 283 | int C_0040A9E7(HKEY hKey/*bp08*/, char *bp0c) { 284 | struct { 285 | int local_67; 286 | char local_66[256]; 287 | DWORD dwType;//local_2 288 | DWORD cbData;//local_1 289 | }lolo; 290 | 291 | lolo.cbData = 0x100; 292 | lolo.local_67 = RegQueryValueEx(hKey, D_007B6790, 0, &lolo.dwType, (LPBYTE)&lolo.local_66, &lolo.cbData); 293 | if(lolo.local_67 == 0) { 294 | strcpy(bp0c, lolo.local_66); 295 | return 1; 296 | } 297 | bp0c = 0; 298 | 299 | return 0; 300 | } 301 | 302 | //set "MIDI_data" 303 | int C_0040AA64(HKEY hKey/*bp08*/, char *bp0c) { 304 | if(bp0c) 305 | return RegSetValueEx(hKey, D_007B6790, 0, REG_SZ/*1*/, (LPBYTE)bp0c, strlen(bp0c) + 1) == 0; 306 | 307 | return RegDeleteValue(hKey, D_007B6790) == 0; 308 | } 309 | -------------------------------------------------------------------------------- /NEWFF7/C_00767D40.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- map/radar 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | //////////////////////////////////////// 11 | //-- color on map -- 12 | int D_0096DEF0[6] = { 13 | 0x80800000, 14 | 0x80006000, 15 | 0x80006060, 16 | 0x80606060, 17 | 0x80600060, 18 | 0x80606000 19 | }; 20 | //-- -- 21 | char D_0096DF08[6] = { 22 | WM_MODELID_00, 23 | WM_MODELID_06, 24 | WM_MODELID_05, 25 | WM_MODELID_03, 26 | WM_MODELID_13, 27 | WM_MODELID_19 28 | }; 29 | //00 00 30 | //////////////////////////////////////// 31 | struct t_wm_local_xyuv { 32 | short wX,wY,wU,wV; 33 | }; 34 | //////////////////////////////////////// 35 | int D_00E3A898; 36 | int D_00E3A89C; 37 | int D_00E3A8A0; 38 | //////////////////////////////////////// 39 | //wm:reset map/radar 40 | void C_00767D40() { 41 | D_00E3A898 = 42 | D_00E3A8A0 = 0; 43 | D_00E3A89C = D_00DE69D8 * 8; 44 | } 45 | 46 | void C_00768366(float, float, float, float);//display "big map" 47 | void C_00768530(float, float, float, float);//display "small map" 48 | void C_007686FA(float, float, float, int, struct t_dx_sfx_e0 *);//display radar stuff? 49 | 50 | //wm:render map/radar 51 | void C_00767D68(short wAngle/*bp08*/) { 52 | struct {//xd8 53 | //above local_34 for compiler 54 | struct t_dx_rend_vertex_20 *local_33; 55 | struct t_dx_rend_vertex_20 *local_32; 56 | struct t_dx_rend_vertex_20 *local_31; 57 | short local_30[2]; 58 | short local_29[2]; 59 | short local_28[2]; 60 | int _ocal_27; 61 | DECL_struct_MATRIX(local_26); 62 | int i;//local_18 63 | int dwMapY;//local_17 64 | int local_16_unused; 65 | int dwMapX;//local_15 66 | struct VECTOR local_14; 67 | struct t_wm_local_xyuv local_10; 68 | int dwFlags_unused;//local_8 69 | int dwModelType;//local_7 70 | struct VECTOR local_6; 71 | struct SVECTOR local_2; 72 | }lolo; 73 | 74 | if(D_00E3A898 < 2) {//else 0076831B 75 | D_00E3A89C = /*lolo.local_34*/(D_00E3A898 == 1 && C_0074D330() == 0)? 76 | D_00DE69D8 * 24: 77 | D_00DE69D8 * 8 78 | ; 79 | lolo.dwMapX = D_00DE69D8 * 316 - D_00E3A89C * 11; 80 | lolo.dwMapY = D_00DE69D8 * 220 - D_00E3A89C * 8; 81 | lolo.local_16_unused = C_0074C9A5();//wm:get backbuffer index[unused]? 82 | lolo.dwModelType = C_00761735();//wm:get model type(2)? 83 | //-- positions on map -- 84 | for(lolo.i = 0; lolo.i < 6; lolo.i ++) { 85 | if(/*lolo.local_36*/lolo.i? 86 | /*lolo.local_35*/(D_0096DF08[lolo.i] != lolo.dwModelType && C_00762047(D_0096DF08[lolo.i])): 87 | (C_007616B3(), 1)//wm:set some info(1)? 88 | ) { 89 | C_00762763(&lolo.local_14);//wm:get model pos(1)? 90 | lolo.local_10.wX = lolo.dwMapX + ((D_00E3A89C * lolo.local_14.vx) >> 0xf) - D_00DE69D8 * 4 + D_00E2C424; 91 | lolo.local_10.wY = lolo.dwMapY + ((D_00E3A89C * lolo.local_14.vz) >> 0xf) - D_00DE69D8 * 4 + D_00E2C428; 92 | lolo.local_10.wV = (((((unsigned)C_0040AC84() + lolo.i * 4) >> (lolo.i != 0)) & 0x10) << (D_00E3A89C > D_00DE69D8 * 8)) + 4; 93 | C_007686FA( 94 | (float)lolo.local_10.wX, 95 | (float)lolo.local_10.wY, 96 | (float)lolo.local_10.wV, 97 | D_0096DEF0[lolo.i], 98 | D_00E2C3E4 99 | );//display radar stuff? 100 | } 101 | } 102 | //-- view cone -- 103 | if(C_0074D28E() == 2 || C_0074D28E() == 3) {//wm:get view mode?//else 00768232 104 | C_00762798(&lolo.local_14);//wm:get model pos(2)? 105 | lolo.local_30[0] = lolo.dwMapX + ((D_00E3A89C * lolo.local_14.vx) >> 0xf) + D_00E2C424; 106 | lolo.local_30[1] = lolo.dwMapY + ((D_00E3A89C * lolo.local_14.vz) >> 0xf) + D_00E2C428; 107 | lolo.local_2.vx = 108 | lolo.local_2.vy = 0; 109 | lolo.local_2.vz = wAngle; 110 | psx_RotMatrixXYZ(&lolo.local_2, &lolo.local_26); 111 | lolo.local_6.vx = 112 | lolo.local_6.vy = 113 | lolo.local_6.vz = 0; 114 | psx_TransMatrix(&lolo.local_26, &lolo.local_6); 115 | psx_SetRotMatrix(&lolo.local_26); 116 | psx_SetTransMatrix(&lolo.local_26); 117 | lolo.i = /*lolo.local_40*/(D_00E3A89C == D_00DE69D8 * 8)? 118 | D_00DE69D8 * -8: 119 | D_00DE69D8 * -16 120 | ; 121 | lolo.local_2.vx = lolo.i >> 1; 122 | lolo.local_2.vy = lolo.i; 123 | psx_RotTrans(&lolo.local_2, &lolo.local_6, &lolo.dwFlags_unused); 124 | lolo.local_29[0] = lolo.local_30[0] + lolo.local_6.vx; 125 | lolo.local_29[1] = lolo.local_30[1] + lolo.local_6.vy; 126 | lolo.local_2.vx = -lolo.local_2.vx; 127 | psx_RotTrans(&lolo.local_2, &lolo.local_6, &lolo.dwFlags_unused); 128 | lolo.local_28[0] = lolo.local_30[0] + lolo.local_6.vx; 129 | lolo.local_28[1] = lolo.local_30[1] + lolo.local_6.vy; 130 | if(C_0066E272(1, D_00E2C3E0)) {//else 00768232 131 | if(C_0074C969()) {//wm:get "isRendering"?//else 00768232 132 | MK_VERTEX_NOTEXTURE(&(D_00E2C3E0->f_70.asVertex[0]), lolo.local_31, (float)lolo.local_30[0], (float)lolo.local_30[1], 0.01f, 1.0f, 0x80606000, 0xff000000); 133 | MK_VERTEX_NOTEXTURE(&(D_00E2C3E0->f_70.asVertex[1]), lolo.local_32, (float)lolo.local_29[0], (float)lolo.local_29[1], 0.01f, 1.0f, 0x80101000, 0xff000000); 134 | MK_VERTEX_NOTEXTURE(&(D_00E2C3E0->f_70.asVertex[2]), lolo.local_33, (float)lolo.local_28[0], (float)lolo.local_28[1], 0.01f, 1.0f, 0x80101000, 0xff000000); 135 | } 136 | } 137 | } 138 | //-- map -- 139 | if(D_00E3A89C == D_00DE69D8 * 8) 140 | C_00768530((float)(lolo.dwMapX + D_00E2C424), (float)(lolo.dwMapY + D_00E2C428), (float)(D_00DE69D8 * 72), (float)(D_00DE69D8 * 56));//display "small map" 141 | else 142 | C_00768366((float)(lolo.dwMapX + D_00E2C424), (float)(lolo.dwMapY + D_00E2C428), (float)(D_00E3A89C * 9), (float)(D_00E3A89C * 7));//display "big map" 143 | } 144 | } 145 | 146 | //wm:set map/radar state 147 | void C_0076831F(short bp08) { 148 | D_00E3A898 = bp08; 149 | if(C_00761735() != WM_MODELID_03)//wm:get model type(2)? 150 | D_00E3A8A0 = D_00E3A898; 151 | 152 | } 153 | 154 | //wm:get map/radar state 155 | short C_00768343() { 156 | return D_00E3A898; 157 | } 158 | 159 | //wm:restore map/radar state? 160 | void C_0076834E() { 161 | if(D_00E3A898 == 1) 162 | D_00E3A898 = D_00E3A8A0; 163 | } 164 | 165 | //display "big map" 166 | void C_00768366(float fX/*bp08*/, float fY/*bp0c*/, float fWidth/*bp10*/, float fHeight/*bp14*/) { 167 | struct { 168 | struct t_dx_rend_vertex_20 *local_9[4]; 169 | float fTexHeight;//local_5 170 | float fTexWidth;//local_4 171 | float fZ;//local_3 172 | float fV;//local_2 173 | float fU;//local_1 174 | }lolo; 175 | 176 | if(C_0066E272(1, D_00E2C3DC)) { 177 | if(C_0074C969()) {//wm:get "isRendering"? 178 | lolo.fZ = 0.001f; 179 | lolo.fU = (1.0f/256.0f); 180 | lolo.fV = (1.0f/256.0f); 181 | lolo.fTexWidth = (214.0f/256.0f); 182 | lolo.fTexHeight = (166.0f/256.0f); 183 | MK_QUAD_2D(D_00E2C3DC->f_70.asVertex, lolo.local_9, fX, fY, fWidth, fHeight, lolo.fZ, 1.0f, 0x80ffffff, 0xff000000, lolo.fU, lolo.fV, lolo.fTexWidth, lolo.fTexHeight); 184 | } 185 | } 186 | } 187 | 188 | //display "small map" 189 | void C_00768530(float fX/*bp08*/, float fY/*bp0c*/, float fWidth/*bp10*/, float fHeight/*bp14*/) { 190 | struct { 191 | struct t_dx_rend_vertex_20 *local_9[4]; 192 | float fTexHeight;//local_5 193 | float fTexWidth;//local_4 194 | float fZ;//local_3 195 | float fV;//local_2 196 | float fU;//local_1 197 | }lolo; 198 | 199 | if(C_0066E272(1, D_00E2C3D8)) { 200 | if(C_0074C969()) {//wm:get "isRendering"? 201 | lolo.fZ = 0.001f; 202 | lolo.fU = 1.0f/128.0f; 203 | lolo.fV = 1.0f/64.0f; 204 | lolo.fTexWidth = 70.0f/128.0f; 205 | lolo.fTexHeight = 54.0f/64.0f; 206 | MK_QUAD_2D(D_00E2C3D8->f_70.asVertex, lolo.local_9, fX, fY, fWidth, fHeight, lolo.fZ, 1.0f, 0x80ffffff, 0xff000000, lolo.fU, lolo.fV, lolo.fTexWidth, lolo.fTexHeight); 207 | } 208 | } 209 | } 210 | 211 | //display radar stuff? 212 | void C_007686FA(float fX/*bp08*/, float fY/*bp0c*/, float fV/*bp10*/, int dwColor/*bp14*/, struct t_dx_sfx_e0 *bp18) { 213 | struct { 214 | struct t_dx_rend_vertex_20 *local_10[4]; 215 | float fTexHeight;//local_6 216 | float fTexWidth;//local_5 217 | float fZ;//local_4 218 | float fHeight;//local_3 219 | float fWidth;//local_2 220 | float fU;//local_1 221 | }lolo; 222 | 223 | if(C_0066E272(1, bp18)) { 224 | if(C_0074C969()) {//wm:get "isRendering"? 225 | lolo.fZ = 0; 226 | lolo.fWidth = (float)D_00DE69D8 * 8.0f; 227 | lolo.fHeight = (float)D_00DE69D8 * 8.0f; 228 | lolo.fU = 4.0f/128.0f;//0.03125f 229 | fV /= 64.0f; 230 | lolo.fTexWidth = 8.0f/128.0f;//0.0625f 231 | lolo.fTexHeight = 8.0f/64.0f;//0.125f 232 | MK_QUAD_2D(bp18->f_70.asVertex, lolo.local_10, fX, fY, lolo.fWidth, lolo.fHeight, lolo.fZ, 1.0f, dwColor, 0xff000000, lolo.fU, fV, lolo.fTexWidth, lolo.fTexHeight); 233 | } 234 | } 235 | } 236 | -------------------------------------------------------------------------------- /NEWFF7/ff7_sound.h: -------------------------------------------------------------------------------- 1 | #ifndef __FF7_SOUND_H__ 2 | #define __FF7_SOUND_H__ 3 | 4 | #include 5 | #include 6 | //#include 7 | 8 | #define NUM_SONGS 0x62 9 | //====---- sound ----==== 10 | struct t_sound_related_24 {//size 0x24 11 | /*00*/unsigned short wOpCode; char __02[2]; 12 | /*04*/int f_04[6]; 13 | /*1c*/char __1c[8]; 14 | }; 15 | 16 | #define NUM_THREADSOUNDS 4 17 | 18 | struct t_sound_thread_10 {//size 0x10 19 | /*00*/int aSoundId[NUM_THREADSOUNDS]; 20 | }; 21 | 22 | //thread info? 23 | struct t_thread_10 {//size 0x10 24 | /*00*/int f_00; 25 | /*04*/int dwStackSize; 26 | /*08*/void (*pCallback)(void); 27 | /*0c*/char *szThreadName; 28 | }; 29 | //====---- C_00740D80.cpp ----==== 30 | #define SOUND_OP_10 0x10 //"MUSIC" 31 | #define SOUND_OP_14 0x14 //"MUSVT" 32 | #define SOUND_OP_15 0x15 //"MUSVM" 33 | 34 | #define SOUND_OP_18 0x18 //"MUSIC"+cross fade 35 | #define SOUND_OP_19 0x19 //"MUSVT"+cross fade 36 | 37 | #define SOUND_OP_20 0x20 //"SOUND"//play 1 sfx 38 | #define SOUND_OP_21 0x21 //play 2 sfx 39 | #define SOUND_OP_22 0x22 //play 3 sfx 40 | #define SOUND_OP_23 0x23 //play 4 sfx 41 | 42 | #define SOUND_OP_24 0x24 //play 1 sfx 43 | #define SOUND_OP_25 0x25 //play 2 sfx 44 | #define SOUND_OP_26 0x26 //play 3 sfx 45 | #define SOUND_OP_27 0x27 //play 4 sfx 46 | 47 | #define SOUND_OP_28 0x28 //[ch=1] 48 | #define SOUND_OP_29 0x29 //[ch=2] 49 | #define SOUND_OP_2A 0x2a //[ch=3] 50 | #define SOUND_OP_2B 0x2b //[ch=4] 51 | 52 | #define SOUND_OP_30 0x30 //sound:play SE? 53 | 54 | #define SOUND_OP_98 0x98 //resume 55 | #define SOUND_OP_99 0x99 //pause 56 | #define SOUND_OP_9A 0x9a //resume 57 | #define SOUND_OP_9B 0x9b //pause 58 | #define SOUND_OP_9C 0x9c //sound:resume 59 | #define SOUND_OP_9D 0x9d //sound:pause 60 | 61 | #define SOUND_OP_A0 0xa0 //[ch=1]volume 62 | #define SOUND_OP_A1 0xa1 //[ch=2]volume 63 | #define SOUND_OP_A2 0xa2 //[ch=3]volume 64 | #define SOUND_OP_A3 0xa3 //[ch=4]volume 65 | 66 | #define SOUND_OP_A4 0xa4 //[ch=1]Volume transition 67 | #define SOUND_OP_A5 0xa5 //[ch=2]Volume transition 68 | #define SOUND_OP_A6 0xa6 //[ch=3]Volume transition 69 | #define SOUND_OP_A7 0xa7 //[ch=4]Volume transition 70 | 71 | #define SOUND_OP_A8 0xa8 //[ch=1]PAN 72 | #define SOUND_OP_A9 0xa9 //[ch=2]PAN 73 | #define SOUND_OP_AA 0xaa //[ch=3]PAN 74 | #define SOUND_OP_AB 0xab //[ch=4]PAN 75 | 76 | #define SOUND_OP_AC 0xac //[ch=1]Pan transition 77 | #define SOUND_OP_AD 0xad //[ch=2]Pan transition 78 | #define SOUND_OP_AE 0xae //[ch=3]Pan transition 79 | #define SOUND_OP_AF 0xaf //[ch=4]Pan transition 80 | 81 | #define SOUND_OP_B0 0xb0 //[ch=1]Tempo 82 | #define SOUND_OP_B1 0xb1 //[ch=2]Tempo 83 | #define SOUND_OP_B2 0xb2 //[ch=3]Tempo 84 | #define SOUND_OP_B3 0xb3 //[ch=4]Tempo 85 | 86 | #define SOUND_OP_B4 0xb4 //[ch=1]Tempo transition 87 | #define SOUND_OP_B5 0xb5 //[ch=2]Tempo transition 88 | #define SOUND_OP_B6 0xb6 //[ch=3]Tempo transition 89 | #define SOUND_OP_B7 0xb7 //[ch=4]Tempo transition 90 | 91 | #define SOUND_OP_B8 0xb8 //volume 92 | #define SOUND_OP_B9 0xb9 //Volume transition 93 | #define SOUND_OP_BA 0xba //PAN 94 | #define SOUND_OP_BB 0xbb //Pan transition 95 | #define SOUND_OP_BC 0xbc //Tempo 96 | #define SOUND_OP_BD 0xbd //Tempo transition 97 | 98 | #define SOUND_OP_C0 0xc0 //volume(music) 99 | #define SOUND_OP_C1 0xc1 //volume trans(music) 100 | #define SOUND_OP_C2 0xc2 //volume fade(music) 101 | 102 | #define SOUND_OP_D0 0xd0 //"MIDI set tempo" 103 | #define SOUND_OP_D1 0xd1 //"MIDI set tempo trans" 104 | #define SOUND_OP_D2 0xd2 //"MIDI fade tempo" 105 | 106 | #define SOUND_OP_E4 0xe4 //??? 107 | 108 | #define SOUND_OP_F0 0xf0 //stop 109 | #define SOUND_OP_F1 0xf1 //stop 110 | 111 | #define SOUND_OP_F4 0xf4 //??? 112 | #define SOUND_OP_F5 0xf5 //??? 113 | 114 | extern int C_00740D80(unsigned short, int, int, int, int, int, int, int, int); 115 | //====---- midi1.cpp ----==== 116 | extern int C_00741780(const char *, HWND);//MIDI:init 117 | extern void C_00741F5F(void);//MIDI:reset 118 | extern void C_00742055(int, int, int);//"MIDI play" 119 | extern void C_00742BEE(int, int);//"MIDI cross fade" 120 | extern void C_00742D7B(void);//"MIDI pause" 121 | extern void C_00742DD3(void);//"MIDI resume" 122 | extern void C_00742E2B(void);//"MIDI stop" 123 | extern int C_00742EB3(void);//"MIDI status" 124 | extern void C_00742EDA(unsigned);//"MIDI set master volume 125 | extern void C_00742F37(unsigned);//"MIDI set volume" 126 | extern void C_0074304C(unsigned, int);//"MIDI set volume trans" 127 | extern void C_0074313D(int, unsigned, unsigned);//"MIDI fade volume" 128 | extern void C_007431BD(char);//"MIDI set tempo" 129 | extern void C_0074327A(char, int);//"MIDI set tempo trans" 130 | extern void C_007432AC(char, unsigned char, char);//"MIDI fade tempo" 131 | extern void C_00743C57(void);//midi1:refresh "trans" 132 | extern int C_00744090(void);//get "volume control supported" flag 133 | extern const char *C_007443E7(void);//MIDI:get archive's name 134 | //====---- sound.cpp ----==== 135 | extern int C_00744400(const char *, const char *, HWND);//sound:init? 136 | extern void C_007446D7(void);//sound:clean 137 | extern void C_00744B13(void);//sound:refresh trans? 138 | extern void C_00745160(unsigned char, int, int/*?*/); 139 | extern void C_00745606(unsigned char, int, int/*?*/, int/*?*/, int/*?*/); 140 | extern void C_0074580A(int);//sound:play SE? 141 | extern void C_00745873(void);//sound:pause 142 | extern void C_00745995(void);//sound:resume 143 | extern void C_00745B64(void);//sound:stop(2)? 144 | /*C_00745CF3*/extern int sound_load(int, LPDIRECTSOUNDBUFFER *); 145 | /*C_00745DBB*/extern void sound_unload(int, int); 146 | extern void C_007478BD(int, int); 147 | extern void C_00747AED(void);//sound:stop? 148 | extern void C_00747B53(void); 149 | extern void C_00747B9A(void); 150 | extern int C_00747B3C(void); 151 | extern void C_00747BE3(char); 152 | extern void C_00747C15(char, char); 153 | extern void C_00747C4B(unsigned char, int); 154 | extern void C_00747DDA(unsigned char, int, unsigned char); 155 | extern void C_00747F31(unsigned char); 156 | extern void C_00747F63(unsigned char, unsigned char); 157 | extern void C_00747F99(unsigned char, int); 158 | extern void C_0074809E(unsigned char, int, unsigned char); 159 | extern void C_007481AD(char); 160 | extern void C_007481DF(char, unsigned char); 161 | extern void C_00748215(char, int); 162 | extern void C_00748309(char, int, unsigned char); 163 | extern void C_00748525(int, int); 164 | extern void C_00748669(unsigned char); 165 | extern void C_00748750(unsigned char, unsigned char); 166 | extern void C_00748861(unsigned char, unsigned char, unsigned char); 167 | extern void C_00748D69(int, unsigned char, unsigned char, unsigned char);//sound:... 168 | extern void C_00748F8F(int); 169 | extern void C_0074908D(int);//sound:... 170 | extern void C_007490EF(int);//sound:... 171 | extern void C_0074913C(int);//sound:... 172 | extern void C_007491CB(int, unsigned char);//sound:... 173 | extern void C_0074933D(int);//set SE volume? 174 | extern void C_0074934A(int);//set SE main volume? 175 | extern int C_00749366(void);//get SE main volume? 176 | extern int C_00749370(void);//get SE volume? 177 | /*C_0074938D*/extern void sound_group_init(struct t_sound_thread_10 **); 178 | /*C_00749404*/extern void sound_group_play(unsigned char, int); 179 | extern void C_007497AC(void); 180 | extern void C_007498AF(void); 181 | extern void C_007498FA(void); 182 | extern void C_00749C0D(int);//sound thread related 183 | //====---- from C_00749EE0.cpp ----==== 184 | extern int C_0074A071(int, const char *, int);//check midi error? 185 | //====---- from C_0074a0d0.cpp ----==== 186 | extern const char *C_0074A0D0(int);//get_midi_name 187 | //====---- from C_0074AB90.cpp ----==== 188 | extern int C_0074AD6D(HRESULT, const char *, int); 189 | //====---- from sfutils.cpp ----==== 190 | typedef WORD SFDEVINDEX; 191 | 192 | extern int C_0074ADE0(void);//sfutils:load SFMAN32.DLL 193 | extern int C_0074AF09(SFDEVINDEX);//sfutils: 194 | extern int C_0074AF57(SFDEVINDEX);//sfutils: 195 | extern int C_0074AF7D(SFDEVINDEX);//sfutils: 196 | extern int C_0074AF93(SFDEVINDEX);//sfutils: 197 | extern void C_0074AFA9(SFDEVINDEX);//sfutils:free library 198 | extern SFDEVINDEX C_0074AFBA(unsigned *, unsigned *);//sfutils: 199 | extern int C_0074B275(SFDEVINDEX);//sfutils: 200 | extern int C_0074B3AF(SFDEVINDEX);//sfutils: 201 | extern int C_0074B438(SFDEVINDEX);//sfutils: 202 | extern int C_0074B4B4(unsigned/*?!?*/, unsigned short, char *);//sfutils: 203 | extern int C_0074B4F6(SFDEVINDEX, unsigned short, unsigned short, unsigned short, unsigned short, const char *);//sfutils: 204 | extern int C_0074B6EE(SFDEVINDEX, unsigned *, unsigned *);//sfutils: 205 | extern int C_0074B746(SFDEVINDEX);//sfutils: 206 | extern int C_0074B860(void);//sfutils: 207 | extern int C_0074B87F(SFDEVINDEX);//sfutils:SF_ClearLoadedPreset 208 | extern const char *C_0074B96C(int); 209 | //====---- ----==== 210 | 211 | extern int D_00DDFFE4;//wave_music flag? 212 | 213 | #endif 214 | -------------------------------------------------------------------------------- /NEWFF7/loadmenu.h: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #ifndef __LOADMENU_H__ 7 | #define __LOADMENU_H__ 8 | 9 | //====---- loadmenu.cpp ----==== 10 | struct t_loadmenu_preview {//size 0x54 11 | /*00*/int f_00;//checksum//00DBFD38 12 | // 13 | /*04*/unsigned char f_04;//00DBFD3C 14 | /*05*/unsigned char f_05[3];//00DBFD3D 15 | /*08*/unsigned char f_08[0x10];//00DBFD40 16 | /*18*/short f_18,f_1a;//HP,HPMax//00DBFD50,00DBFD52 17 | /*1c*/short f_1c,f_1e;//MP,MPMAX//00DBFD54,00DBFD56 18 | /*20*/int f_20;//00DBFD58 19 | /*24*/int f_24;//playtime in seconds//00DBFD5C 20 | /*28*/unsigned char f_28[0x20];//current place//00DBFD60 21 | /*48*/unsigned char f_48[4*3];//menu colors//00DBFD80 22 | }; 23 | 24 | struct t_loadmenu_charaInfo {//size 0x84 25 | /*00*/unsigned char f_00;//00DBFD8C 26 | /*01*/unsigned char bLVL;//00DBFD8D 27 | /*02*/unsigned char f_02;//00DBFD8E 28 | /*03*/unsigned char f_03;//00DBFD8F 29 | /*04*/unsigned char f_04;//00DBFD90 30 | /*05*/unsigned char f_05;//00DBFD91 31 | /*06*/unsigned char f_06;//00DBFD92 32 | /*07*/unsigned char f_07;//00DBFD93 33 | /*08*/unsigned char f_08;//00DBFD94 34 | /*09*/unsigned char f_09;//00DBFD95 35 | /*0a*/unsigned char f_0a;//00DBFD96 36 | /*0b*/unsigned char f_0b;//00DBFD97 37 | /*0c*/unsigned char f_0c;//00DBFD98 38 | /*0d*/unsigned char f_0d;//00DBFD99 39 | /*0e*/unsigned char bLimitLvl;//00DBFD9A 40 | /*0f*/unsigned char bLimitGauge;//00DBFD9B 41 | /*10*/unsigned char f_10[0xc];//name//00DBFD9C 42 | /*1c*/unsigned char f_1c;//00DBFDA8 43 | /*1d*/unsigned char f_1d;//00DBFDA9 44 | /*1e*/unsigned char f_1e;//00DBFDAA 45 | /*1f*/unsigned char f_1f;//status//00DBFDAB 46 | /*20*/unsigned char f_20;//00DBFDAC 47 | /*21*/unsigned char f_21;//00DBFDAD 48 | /*22*/unsigned short f_22;//00DBFDAE 49 | /*24*/unsigned short f_24;//00DBFDB0 50 | /*26*/unsigned short f_26[3];//00DBFDB2 51 | /*2c*/unsigned short wHP,wHPBase;//00DBFDBA 52 | /*30*/unsigned short wMP,wMPBase;//00DBFDBC 53 | /*34*/char _34[4];//00DBFDC0 54 | /*38*/unsigned short wHPMax;//00DBFDC4 55 | /*3a*/unsigned short wMPMax;//00DBFDC6 56 | /*3c*/int f_3c;//00DBFDC8 57 | /*40*/unsigned f_40[8];//00DBFDCC 58 | /*60*/unsigned f_60[8];//00DBFDEC 59 | /*80*/int f_80;//00DBFE0C 60 | }; 61 | 62 | /* 63 | config mask format 64 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 65 | |///|bat|///|magic order| camera| A T B | cursor|control| ??? | 66 | |///|inf|///| | | | | | | 67 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ 68 | */ 69 | 70 | struct t_loadmenu_10f4 {//size 0x10f4 71 | /*0000*/struct t_loadmenu_preview f_0000;//00DBFD38 72 | //-- kernel.bin|section 3 -- 73 | /*0054*/struct t_loadmenu_charaInfo f_0054[9];//00DBFD8C 74 | /*04f8*/unsigned char f_04f8[4];//00DC0230 75 | /*04fc*/unsigned short f_04fc[0x140];//00DC0234 76 | /*077c*/unsigned f_077c[0xc8];//00DC04B4 77 | /*0a9c*/int f_0a9c[0x30];//00DC07D4 78 | /*0b5c*/char __0b5c[0x20];//00DC0894 79 | // 80 | /*0b7c*/unsigned dwGIL;//00DC08B4 81 | /*0b80*/unsigned dwPlayTime;//(in seconds)//00DC08B8 82 | /*0b84*/unsigned dwTimer;//00DC08BC 83 | /*0b88*/unsigned dwCounter1;//00DC08C0 84 | /*0b8c*/unsigned dwCounter2;//00DC08C4 85 | //-- kernel load end -- 86 | //-- backup infos for field? -- 87 | /*0b90*/int f_0b90;//00DC08C8 88 | /*0b94*/short f_0b94;//last module?//00DC08CC 89 | /*0b96*/short f_0b96;//00DC08CE 90 | /*0b98*/char __0b98[2];//00DC08D0 91 | /*0b9a*/short f_0b9a;//x//00DC08D2 92 | /*0b9c*/short f_0b9c;//y//00DC08D4 93 | /*0b9e*/short f_0b9e;//some walkmesh indice?//00DC08D6 94 | /*0ba0*/unsigned char f_0ba0;//some angle//00DC08D8 95 | /*0ba1*/char f_0ba1;//index in pseudo-random table//00DC08D9 96 | /*0ba2*/char f_0ba2;//random related//00DC08DA 97 | /*0ba3*/char __0ba3[1];//00DC08DB 98 | //-- -- 99 | /*0ba4*/unsigned char f_0ba4[0x500];//variable address space(2)//00DC08DC 100 | /*10a4*/unsigned short f_10a4;//00DC0DDC 101 | /*10a6*/unsigned short f_10a6;//phs related/00DC0DDE 102 | /*10a8*/char __10a8[0x30];//00DC0DE0 103 | /*10d8*/unsigned char f_10d8;//battle speed/00DC0E10 104 | /*10d9*/unsigned char f_10d9;//battle message speed/00DC0E11 105 | /*10da*/unsigned short wConfigMask;//00DC0E12 106 | /*10dc*/unsigned char f_10dc[0x10];//00DC0E14 107 | /*10ec*/unsigned char f_10ec;//field/world message speed/00DC0E24 108 | /*10ed*/char __10ed[7];//00DC0E25 109 | //~00DC0E2C 110 | }; 111 | 112 | extern struct t_loadmenu_10f4 D_00DBFD38;//~00DC0E2C 113 | //-- BANK 0x000~ -- 114 | #define D_00DC08DC (*(unsigned short *)(D_00DBFD38.f_0ba4 + 0x000)) 115 | #define D_00DC08DE (D_00DBFD38.f_0ba4[0x002]) 116 | //-- time related? -- 117 | #define D_00DC08EC (D_00DBFD38.f_0ba4[0x010]) 118 | #define D_00DC08ED (D_00DBFD38.f_0ba4[0x011]) 119 | #define D_00DC08EE (D_00DBFD38.f_0ba4[0x012]) 120 | #define D_00DC08EF (D_00DBFD38.f_0ba4[0x013]) 121 | #define D_00DC08F0 (D_00DBFD38.f_0ba4[0x014]) 122 | #define D_00DC08F1 (D_00DBFD38.f_0ba4[0x015]) 123 | //-- countdown? -- 124 | #define D_00DC08F2 ((unsigned char *)(D_00DBFD38.f_0ba4 + 0x016)) 125 | //#define D_00DC08F3 (D_00DC08F2[1]) 126 | //-- -- 127 | #define D_00DC08F4 (D_00DBFD38.f_0ba4[0x018]) 128 | #define D_00DC08F5 (D_00DBFD38.f_0ba4[0x019]) 129 | #define D_00DC08F6 (D_00DBFD38.f_0ba4[0x01a]) 130 | #define D_00DC08F7 (D_00DBFD38.f_0ba4[0x01b]) 131 | #define D_00DC08FA (*(unsigned short *)(D_00DBFD38.f_0ba4 + 0x01e)) 132 | #define D_00DC091C ((unsigned char *)(D_00DBFD38.f_0ba4 + 0x040)) 133 | #define D_00DC0927 (D_00DBFD38.f_0ba4[0x04b]) 134 | #define D_00DC093B (D_00DBFD38.f_0ba4[0x05f]) 135 | //-- battle point -- 136 | #define D_00DC094C (D_00DBFD38.f_0ba4[0x070]) 137 | #define D_00DC094D (D_00DBFD38.f_0ba4[0x071]) 138 | #define D_00DC094E (D_00DBFD38.f_0ba4[0x072]) 139 | #define D_00DC094F (D_00DBFD38.f_0ba4[0x073]) 140 | //-- -- 141 | #define D_00DC0950 (D_00DBFD38.f_0ba4[0x074]) 142 | #define D_00DC0956 (D_00DBFD38.f_0ba4[0x07a]) 143 | //-- BANK 0x100~ -- 144 | #define D_00DC09E5 (&(D_00DBFD38.f_0ba4[0x109])) 145 | //#define D_00DC09E6 (D_00DC09E5[1]) 146 | //#define D_00DC09E7 (D_00DC09E5[2]) 147 | #define D_00DC0A3E (D_00DBFD38.f_0ba4[0x162]) 148 | #define D_00DC0A3F (D_00DBFD38.f_0ba4[0x163]) 149 | #define D_00DC0A4F (D_00DBFD38.f_0ba4[0x173]) 150 | #define D_00DC0A50 (&(D_00DBFD38.f_0ba4[0x174])) 151 | #define D_00DC0A61 (D_00DBFD38.f_0ba4[0x185]) 152 | #define D_00DC0AA0 (D_00DBFD38.f_0ba4 + 0x1c4) 153 | #define D_00DC0AAA (D_00DBFD38.f_0ba4[0x1ce]) 154 | //-- BANK 0x200~ -- 155 | //-- chocobo? -- 156 | #define D_00DC0ADC ((unsigned char *)(D_00DBFD38.f_0ba4 + 0x200)) 157 | #define D_00DC0AE2 (D_00DBFD38.f_0ba4[0x206]) 158 | #define D_00DC0AE3 (D_00DBFD38.f_0ba4[0x207]) 159 | #define D_00DC0AE4 (D_00DBFD38.f_0ba4[0x208]) 160 | #define D_00DC0AE5 (D_00DBFD38.f_0ba4[0x209]) 161 | #define D_00DC0AE6 (D_00DBFD38.f_0ba4[0x20a]) 162 | #define D_00DC0AE7 (D_00DBFD38.f_0ba4[0x20b]) 163 | #define D_00DC0AE8 (D_00DBFD38.f_0ba4[0x20c]) 164 | #define D_00DC0AE9 (D_00DBFD38.f_0ba4[0x20d]) 165 | #define D_00DC0AEA (D_00DBFD38.f_0ba4[0x20e]) 166 | #define D_00DC0AEB (D_00DBFD38.f_0ba4[0x20f]) 167 | #define D_00DC0AEC (D_00DBFD38.f_0ba4[0x210]) 168 | #define D_00DC0AED (D_00DBFD38.f_0ba4[0x211]) 169 | #define D_00DC0AEE (D_00DBFD38.f_0ba4[0x212]) 170 | #define D_00DC0AF2 (D_00DBFD38.f_0ba4[0x216]) 171 | #define D_00DC0AF3 (D_00DBFD38.f_0ba4[0x217]) 172 | #define D_00DC0AF5 (D_00DBFD38.f_0ba4[0x219]) 173 | #define D_00DC0AF6 (D_00DBFD38.f_0ba4[0x21a]) 174 | #define D_00DC0AF7 (D_00DBFD38.f_0ba4[0x21b]) 175 | #define D_00DC0AF8 (D_00DBFD38.f_0ba4[0x21c]) 176 | //-- highway? -- 177 | #define D_00DC0B47 (D_00DBFD38.f_0ba4[0x26b]) 178 | #define D_00DC0B48 (D_00DBFD38.f_0ba4[0x26c]) 179 | #define D_00DC0B49 (D_00DBFD38.f_0ba4[0x26d]) 180 | #define D_00DC0B4A (D_00DBFD38.f_0ba4[0x26e]) 181 | #define D_00DC0B4B (D_00DBFD38.f_0ba4[0x26f]) 182 | #define D_00DC0B4C (D_00DBFD38.f_0ba4 + 0x270) 183 | #define D_00DC0B5B (D_00DBFD38.f_0ba4[0x27f]) 184 | //-- BANK 0x300~ -- 185 | //expected CD number? 186 | #define D_00DC0BDC (D_00DBFD38.f_0ba4[0x300]) 187 | #define D_00DC0BDE (&(D_00DBFD38.f_0ba4[0x302])) 188 | #define D_00DC0BE2 (D_00DBFD38.f_0ba4[0x306]) 189 | #define D_00DC0BE3 (D_00DBFD38.f_0ba4[0x307]) 190 | #define D_00DC0BFA (D_00DBFD38.f_0ba4[0x31e]) 191 | #define D_00DC0BFB (D_00DBFD38.f_0ba4[0x31f]) 192 | #define D_00DC0C39 (D_00DBFD38.f_0ba4[0x35d]) 193 | #define D_00DC0C3A (D_00DBFD38.f_0ba4[0x35e]) 194 | #define D_00DC0C3B (D_00DBFD38.f_0ba4[0x35f]) 195 | #define D_00DC0C3C (D_00DBFD38.f_0ba4[0x360]) 196 | #define D_00DC0C3D (D_00DBFD38.f_0ba4[0x361]) 197 | 198 | #define D_00DC0C44 ((unsigned char *)(D_00DBFD38.f_0ba4 + 0x368)) 199 | #define D_00DC0C62 (D_00DBFD38.f_0ba4[0x386]) 200 | #define D_00DC0C90 (*(unsigned short *)&(D_00DBFD38.f_0ba4[0x3b4])) 201 | #define D_00DC0C92 (*(unsigned short *)&(D_00DBFD38.f_0ba4[0x3b6])) 202 | #define D_00DC0C94 (D_00DBFD38.f_0ba4[0x3b8]) 203 | #define D_00DC0CC4 ((unsigned *)&(D_00DBFD38.f_0ba4[0x3e8])) 204 | #define D_00DC0CD0 (*(int *)&(D_00DBFD38.f_0ba4[0x3f4])) 205 | #define D_00DC0CD4 (*(unsigned short *)(D_00DBFD38.f_0ba4 + 0x3f8)) 206 | #define D_00DC0CD7 (D_00DBFD38.f_0ba4[0x3fb]) 207 | #define D_00DC0CD8 (D_00DBFD38.f_0ba4[0x3fc]) 208 | #define D_00DC0CD9 (D_00DBFD38.f_0ba4[0x3fd]) 209 | #define D_00DC0CDA (D_00DBFD38.f_0ba4[0x3fe]) 210 | #define D_00DC0CDB (D_00DBFD38.f_0ba4[0x3ff]) 211 | //00DC0CDC 212 | //-- BANK 0x400~ -- 213 | #define D_00DC0D4B (D_00DBFD38.f_0ba4[0x46f]) 214 | #define D_00DC0D5F (D_00DBFD38.f_0ba4[0x483]) 215 | //-- -- 216 | 217 | //extern unsigned char D_00DC0E6C;//pause related? 218 | //extern unsigned char D_00DC0E70; 219 | extern char D_00DD74E8[/*256*/];//from loadmenu.cpp 220 | extern char D_00DD75E8[0xa][3]; 221 | extern struct t_loadmenu_10f4 *D_00DD7700; 222 | 223 | #endif 224 | -------------------------------------------------------------------------------- /NEWFF7/C_007663E0.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | #include "menu_data.h" 11 | //////////////////////////////////////// 12 | unsigned char D_00E3A860[8]; 13 | unsigned char *D_00E3A868; 14 | int D_00E3A86C;//"leave vehicle" state? 15 | int D_00E3A870;//"X" button short trigger counter? 16 | int D_00E3A874;//[unused]counter/flag for enter vehicle? 17 | int D_00E3A878; 18 | //////////////////////////////////////// 19 | void C_007663E0() { 20 | D_00E3A86C = 0; 21 | D_00E3A874 = 0; 22 | D_00E3A868 = &(D_00E3A860[0]); 23 | D_00E3A878 = 0; 24 | D_00E3A870 = 0; 25 | } 26 | 27 | void C_00766417(int bp08) { 28 | struct SVECTOR local_2; 29 | 30 | C_007628B5(); 31 | C_007616B3();//wm:set some info(1)? 32 | local_2.vx = local_2.vy = 0; 33 | switch(C_00761735()) {//wm:get model type(2)? 34 | case WM_MODELID_05: case WM_MODELID_13: 35 | local_2.vz = 36 | bp08?bp08: 37 | C_00761FE8()?100: 38 | 800 39 | ; 40 | C_00753D00(&local_2, C_00761EEC());//wm:SVECTOR z rotation? 41 | break; 42 | default: 43 | local_2.vz = 300; 44 | C_00753D00(&local_2, C_00761EEC() + 0x400);//wm:SVECTOR z rotation? 45 | }//end switch 46 | C_00762E87(local_2.vx, local_2.vz); 47 | } 48 | 49 | //wm:some stack.push? 50 | void C_007664C2(unsigned char bp08) { 51 | if(D_00E3A868 < &(D_00E3A860[8])/*00E3A868*/) 52 | *(D_00E3A868 ++) = bp08; 53 | } 54 | 55 | //some stack.pop? 56 | unsigned char C_007664EC() { 57 | return (D_00E3A868 > &(D_00E3A860[0]))?*(--D_00E3A868):0; 58 | } 59 | 60 | //wm:some stack.peek? 61 | unsigned char C_00766526() { 62 | return (D_00E3A868 > &(D_00E3A860[0]))?*(D_00E3A868 - 1):0; 63 | } 64 | 65 | //wm:some stack.set element 0? 66 | void C_00766553(int bp08) { 67 | D_00E3A860[0] = bp08; 68 | } 69 | 70 | //wm:some stack.is not empty? 71 | int C_00766560() { 72 | return (D_00E3A868 > &(D_00E3A860[0])); 73 | } 74 | 75 | //wm:"O" button near a vehicle? 76 | void C_00766574() { 77 | struct { 78 | struct VECTOR local_5; 79 | int dwModelType;//local_1 80 | }lolo; 81 | 82 | lolo.dwModelType = C_00761735();//wm:get model type(2)? 83 | //-- -- 84 | if(lolo.dwModelType == WM_MODELID_05 && D_00E3A878) { 85 | C_00761FAA(1); 86 | C_0074D4F7(1);//wm:set "highwind" state? 87 | return; 88 | } 89 | //-- -- 90 | if(C_007620B6()) {//else 00766678 91 | C_00762763(&lolo.local_5);//wm:get model pos(1)? 92 | C_0075027C(&lolo.local_5, C_0076170B() == WM_MODELID_03?-1:1);//wm:set some pos? 93 | C_007664C2(C_00761735());//wm:get model type(2)? 94 | //-- -- 95 | if(C_007618B7()) {//wm:is current model a chocobo(2)? 96 | C_007611AE(); 97 | C_0075E5C0(2);//wm:play song 98 | return; 99 | } 100 | //-- -- 101 | C_007615D6(); 102 | C_0076154F(); 103 | C_007616CB();//wm:set some info(2)? 104 | switch(C_00761735()) {//wm:get model type(2)? 105 | case WM_MODELID_03://"highwind"? 106 | C_00761FAA(1); 107 | C_0074D4F7(1);//wm:set "highwind" state? 108 | C_0075BB25(); 109 | if(C_0075E64D() < 6)//wm:get current song? 110 | C_0075E5C0(C_00766C33() == 0?3:1);//wm:play song 111 | break; 112 | case WM_MODELID_06://"buggy"? 113 | C_0075E6CC(0x1ec);//wm:start/stop SFX? 114 | break; 115 | }//end switch 116 | } 117 | } 118 | 119 | int C_007666FF(void);//can leave vehicle here? 120 | 121 | //wm:"X" button short trigger? 122 | void C_0076667C() { 123 | int dwModelType; 124 | 125 | dwModelType = C_00761735();//wm:get model type(2)? 126 | if(D_00E3A86C == 0) {//else 007666FB 127 | if(C_007666FF()) {//can leave vehicle here?//else 007666E7 128 | if(dwModelType == WM_MODELID_03 || (dwModelType == WM_MODELID_05 && C_00761FE8())) { 129 | C_0074D4F7(-1);//wm:set "highwind" state? 130 | } else { 131 | C_0074D438(0, 2);//wm:set enable something? 132 | } 133 | D_00E3A86C = 1;//start leave vehicle 134 | if(dwModelType == WM_MODELID_03 || dwModelType == WM_MODELID_04) 135 | C_00763D6C(1);//wm:set enable/disable script? 136 | } 137 | //-- descent in north crater -- 138 | if(C_00762136() == 0x1b)//wm:get current terrain? 139 | C_007640BC(9);//wm:start script(2)? 140 | } 141 | } 142 | 143 | //can leave vehicle here? 144 | int C_007666FF() { 145 | int bp_04; 146 | 147 | bp_04 = C_00762136();//wm:get current terrain? 148 | if(C_00761844())//wm:is current model a chocobo(1)? 149 | return (0x221B0F03 >> bp_04) & 1; 150 | switch(C_00761735()) {//wm:get model type(2)? 151 | case WM_MODELID_03: return bp_04 == 0; 152 | case WM_MODELID_06: return (0x221B0F83 >> bp_04) & 1; 153 | case WM_MODELID_05: return (0x70 >> bp_04) & 1; 154 | case WM_MODELID_13: return 1; 155 | }//end switch 156 | 157 | return 0; 158 | } 159 | 160 | //wm:start "leave vehicle"? 161 | void C_007667A3() { 162 | D_00E3A86C = 1;//start leave vehicle 163 | } 164 | 165 | //wm:manage ride/leave vehicle? 166 | void C_007667B2(int bp08) { 167 | struct {//x3c 168 | unsigned local_14; 169 | unsigned local_13; 170 | DECL_short(local_12); 171 | int dwModelType;//local_11 172 | struct VECTOR local_10; 173 | int dwIsHighwind;//local_6 174 | int dwInputMask;//local_5 175 | struct VECTOR local_4; 176 | }lolo; 177 | 178 | lolo.dwIsHighwind = (C_00761735() == WM_MODELID_03);//wm:get model type(2)? 179 | //-- [unused] -- 180 | if(D_00E3A874) { 181 | D_00E3A874 --; 182 | return; 183 | } 184 | //-- -- 185 | if(C_0074D504() == 0 && C_0074D330() != 3) {//else 00766B4F 186 | lolo.dwInputMask = C_007186B9();//menu_input:get "current mask" 187 | if(D_00E3A86C == 0 && bp08 == 1) { 188 | C_00766574();//wm:"O" button near a vehicle? 189 | //goto 00766B28 190 | } else if( 191 | C_0074D4B6() &&//wm:get enable something? 192 | !(lolo.dwInputMask & (C_00761844()?(0xf000|PAD_06):PAD_06)) && 193 | D_00E3A870 > 0 && D_00E3A870 < 15 && 194 | (C_00761769(BIT(WM_MODELID_13)) == 0 || C_00762136() == 0x12)//wm:is current model in list(1)?//wm:get current terrain? 195 | ) {//else 0076687B 196 | C_0076667C();//wm:"X" button short trigger? 197 | //goto 00766B28 198 | } else if(D_00E3A86C == 1) { 199 | D_00E3A86C = 2; 200 | //goto 00766B28 201 | } else if(D_00E3A86C == 2) {//else 00766B28 202 | D_00E3A86C = 0; 203 | C_007616B3();//wm:set some info(1)? 204 | lolo.dwModelType = C_0076170B(); 205 | C_00762763(&lolo.local_4);//wm:get model pos(1)? 206 | C_007627CD(&lolo.local_10);//wm:get model previous pos(1)? 207 | C_0074D438(1, 2);//wm:set enable something? 208 | if(lolo.local_4.vx != lolo.local_10.vx || lolo.local_4.vz != lolo.local_10.vz) {//else 00766AE7 209 | C_00767524(); 210 | if(lolo.dwIsHighwind) { 211 | C_00761FAA(0); 212 | C_00763D6C(0);//wm:set enable/disable script? 213 | } 214 | C_00762837(); 215 | C_0074D323(0);//wm:set camera tilt angle? 216 | if(lolo.dwModelType == WM_MODELID_05 && C_00761FE8()) { 217 | C_00761FAA(0); 218 | //goto 00766AE5 219 | } else { 220 | if(lolo.dwModelType == WM_MODELID_04) 221 | C_00763D6C(0);//wm:set enable/disable script? 222 | C_00764014(lolo.dwModelType, 5);//wm:start script(1)? 223 | if(lolo.dwModelType == WM_MODELID_04) 224 | C_00763D6C(1);//wm:set enable/disable script? 225 | //-- -- 226 | if(C_007618B7()) {//wm:is current model a chocobo(2)?//else 00766A18 227 | //-- chocobo -- 228 | lolo.local_12 = C_00753F2E(&lolo.local_10, &lolo.local_4) - 0x400; 229 | C_00761B19(lolo.local_12); 230 | C_007664EC();//some stack.pop? 231 | C_0076142D(); 232 | if(lolo.dwModelType < WM_MODELID_41) 233 | C_007616CB();//wm:set some info(2)? 234 | C_00762955(2); 235 | C_00761B19(lolo.local_12); 236 | C_0075E5C0(1);//wm:play song 237 | C_0074D438(0, 6);//wm:set enable something? 238 | if(lolo.dwModelType == WM_MODELID_04) { 239 | C_0075334D(); 240 | } else if(lolo.dwModelType >= WM_MODELID_41) { 241 | C_00762047(C_0076736E());//wm:set current model 242 | C_007616CB();//wm:set some info(2)? 243 | } 244 | C_007663A8(&lolo.local_4); 245 | //goto 00766AE5 246 | } else { 247 | //-- other rides -- 248 | C_007610B3();//wm:alloc new model 249 | lolo.local_13 = C_007664EC();//some stack.pop? 250 | if(C_0076192A(lolo.local_13)) {//else 00766A70 251 | lolo.local_14 = C_00766526();//wm:some stack.peek? 252 | C_0076197B(lolo.local_14); 253 | C_007616CB();//wm:set some info(2)? 254 | C_007610B3();//wm:alloc new model 255 | C_0076197B(lolo.local_13); 256 | C_007611AE(); 257 | } else { 258 | C_0076197B(lolo.local_13); 259 | C_007616CB();//wm:set some info(2)? 260 | if(lolo.dwIsHighwind) 261 | C_0076834E();//wm:restore map/radar state? 262 | } 263 | C_0076247D(&lolo.local_4); 264 | C_0075E5C0(C_00761844()?2:1);//wm:play song 265 | if(lolo.dwModelType == WM_MODELID_06) 266 | C_0075E6CC(-0x1ec);//wm:start/stop SFX? 267 | else if(lolo.dwModelType == WM_MODELID_05) 268 | C_0075E6CC(-0x1ed);//wm:start/stop SFX? 269 | C_0075027C(&lolo.local_4, 1);//wm:set some pos? 270 | } 271 | //-- -- 272 | } 273 | //00766AE5 goto 00766B28 274 | } else { 275 | if(C_00761735() == WM_MODELID_03 || C_00761735() == WM_MODELID_04)//wm:get model type(2)? 276 | C_00763D6C(0);//wm:set enable/disable script? 277 | if(lolo.dwIsHighwind || (C_00761735() == WM_MODELID_05 && C_00761FE8())) 278 | C_0074D4F7(1);//wm:set "highwind" state? 279 | } 280 | } 281 | //-- "X" button short trigger counter? -- 282 | D_00E3A870 = /*lolo.local_15*/(lolo.dwInputMask & PAD_06)?D_00E3A870 + 1:0; 283 | } 284 | //00766B4F 285 | } 286 | 287 | //wm:get "leave vehicle" state? 288 | int C_00766B53() { 289 | return D_00E3A86C; 290 | } 291 | 292 | void C_00766B5D(int bp08) { 293 | D_00E3A878 = bp08; 294 | } 295 | -------------------------------------------------------------------------------- /NEWFF7/initpath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #define __FF7FILE__ "C:\\FF7\\Src\\main\\initpath.cpp" 7 | 8 | #include "ff7.h" 9 | #include "menu_data.h" 10 | //////////////////////////////////////// 11 | const char D_007B6550[] = FF7_REG_PATH; 12 | const char D_007B6580[] = "AppPath"; 13 | const char D_007B6588[] = "MoviePath"; 14 | const char D_007B6598[] = "DataDrive"; 15 | const char D_007B65A8[] = "DataPath"; 16 | const char D_007B65B8[] = "MusicVolume"; 17 | const char D_007B65C8[] = "SFXVolume"; 18 | const char D_007B65D8[] = "FullInstall"; 19 | const char D_007B65E8[] = FF7_REG_PATH "\\1.00\\Sound"; 20 | const char D_007B6620[] = FF7_REG_PATH "\\1.00\\Midi"; 21 | //////////////////////////////////////// 22 | char D_009A0598[256]; 23 | char *D_009A0698;//AppPath 24 | char *D_009A069C;//MoviePath 25 | int D_009A06A0;//sound "on" flag 26 | char *D_009A06A4;//music path 27 | char *D_009A06A8;//sound path 28 | char *D_009A06AC;//midi path 29 | int D_009A06B0;//midi "on" flag 30 | char *D_009A06B4;//a path 31 | char *D_009A06B8;//DataPath 32 | int D_009A06BC;//FullInstall 33 | char *D_009A06C0;//DataDrive 34 | char *D_009A06C4;//minigame path 35 | //////////////////////////////////////// 36 | //initpath:start? 37 | void C_00406D10(void) { 38 | struct { 39 | HKEY hKey;//local_136 40 | char local_135[6]; char _ocal_135[2];// = "Sound"; 41 | LONG dwResult;//local_133 42 | char local_132[5]; char _ocal_132[3];// = "Midi"; 43 | DWORD dwType;//local_130 44 | char local_129[256]; 45 | char local_065[256]; 46 | DWORD cbData;//local_001 47 | }lolo; 48 | 49 | memcpy(lolo.local_135, "Sound", 6);//char local_135[] = "Sound"; 50 | memcpy(lolo.local_132, "Midi", 5);//char local_132[] = "Midi"; 51 | 52 | D_009A0698 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x37); 53 | D_009A069C = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x38); 54 | D_009A06C0 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x39); 55 | D_009A06B8 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x3A); 56 | D_009A06A8 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x3B); 57 | D_009A06A4 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x3C); 58 | D_009A06AC = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x3D); 59 | D_009A06C4 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x3E); 60 | D_009A06B4 = (char *)mem_calloc(0x100, 1, __FF7FILE__, 0x3f); 61 | 62 | //.../Final Fantasy VII: 63 | lolo.dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B6550, 0, KEY_READ/*0x20019*/, &lolo.hKey); 64 | FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM/*0x1000*/, 0, GetLastError(), 0, (char *)&lolo.local_129, 0x100, 0); 65 | if(lolo.dwResult == 0) { 66 | //"DataDrive" 67 | #ifndef FORCE_PATH 68 | lolo.cbData = 0x100; 69 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B6598, 0, &lolo.dwType, (LPBYTE)lolo.local_065, &lolo.cbData); 70 | strcpy(D_009A06C0, lolo.local_065); 71 | #else 72 | strcpy(D_009A06C0, "\\"); 73 | #endif 74 | //"Sound" 75 | lolo.cbData = 0x100; 76 | lolo.dwResult = RegQueryValueEx(lolo.hKey, lolo.local_135, 0, &lolo.dwType, (LPBYTE)lolo.local_065, &lolo.cbData); 77 | if(lolo.dwResult == 0) { 78 | if(strcmp(lolo.local_065, "ON") == 0) 79 | D_009A06A0 = 1; 80 | else 81 | D_009A06A0 = 0; 82 | } else { 83 | D_009A06A0 = 1; 84 | } 85 | //"Midi" 86 | lolo.cbData = 0x100; 87 | lolo.dwResult = RegQueryValueEx(lolo.hKey, lolo.local_132, 0, &lolo.dwType, (LPBYTE)lolo.local_065, &lolo.cbData); 88 | if(lolo.dwResult == 0) { 89 | if(strcmp(lolo.local_065, "ON") == 0) 90 | D_009A06B0 = 1; 91 | else 92 | D_009A06B0 = 0; 93 | } else { 94 | D_009A06B0 = 1; 95 | } 96 | //"AppPath" 97 | #ifndef FORCE_PATH 98 | lolo.cbData = 0x100; 99 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B6580, 0, &lolo.dwType, (LPBYTE)lolo.local_065, &lolo.cbData); 100 | FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM/*0x1000*/, 0, GetLastError(), 0, (char *)&lolo.local_129, 0x100, 0); 101 | if(lolo.dwResult == 0) 102 | strcpy(D_009A0698, lolo.local_065); 103 | else 104 | strcpy(D_009A0698, "/ff7/"); 105 | #else 106 | strcpy(D_009A0698, "\\WORKSPACE\\FF7test\\INSTALL\\"); 107 | #endif 108 | //"DataPath" 109 | #ifndef FORCE_PATH 110 | lolo.cbData = 0x100; 111 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B65A8, 0, &lolo.dwType, (LPBYTE)lolo.local_065, &lolo.cbData); 112 | FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM/*0x1000*/, 0, GetLastError(), 0, (char *)&lolo.local_129, 0x100, 0); 113 | if(lolo.dwResult == 0) 114 | strcpy(D_009A06B8, lolo.local_065); 115 | else 116 | strcpy(D_009A06B8, "/ff7/data/"); 117 | #else 118 | strcpy(D_009A06B8, "\\WORKSPACE\\FF7test\\INSTALL\\" "data\\"); 119 | #endif 120 | //"MoviePath" 121 | #ifndef FORCE_PATH 122 | lolo.cbData = 0x100; 123 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B6588, 0, &lolo.dwType, (LPBYTE)lolo.local_065, &lolo.cbData); 124 | FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM/*0x1000*/, 0, GetLastError(), 0, (char *)lolo.local_129, 0x100, 0); 125 | if(lolo.dwResult == 0) 126 | strcpy(D_009A069C, lolo.local_065); 127 | else 128 | strcpy(D_009A069C, "/ff7/data/movies/"); 129 | #else 130 | strcpy(D_009A069C, "\\WORKSPACE\\FF7test\\INSTALL\\" "movies\\"); 131 | #endif 132 | //"FullInstall" 133 | lolo.cbData = 4; 134 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B65D8, 0, &lolo.dwType, (LPBYTE)&D_009A06BC, &lolo.cbData); 135 | if(lolo.dwResult == 0) {//else 004072B2 136 | if(D_009A06BC) { 137 | strcpy(D_009A06B4, D_009A06B8); 138 | } else { 139 | strcpy(D_009A06B4, D_009A06C0); 140 | strcat(D_009A06B4, "ff7/"); 141 | } 142 | } else { 143 | strcpy(D_009A06B4, D_009A06C0); 144 | strcat(D_009A06B4, "ff7/"); 145 | } 146 | 147 | strcpy(D_009A06A8, D_009A06B8); 148 | strcat(D_009A06A8, "sound"); 149 | 150 | strcpy(D_009A06A4, D_009A06B8); 151 | strcat(D_009A06A4, "music"); 152 | 153 | strcpy(D_009A06AC, D_009A06B8); 154 | strcat(D_009A06AC, "midi"); 155 | 156 | lolo.dwResult = RegCloseKey(lolo.hKey); 157 | } 158 | } 159 | 160 | //initpath:clean? 161 | void C_004073F7() { 162 | mem_free(D_009A0698, __FF7FILE__, 0xdf); 163 | mem_free(D_009A069C, __FF7FILE__, 0xe0); 164 | mem_free(D_009A06C0, __FF7FILE__, 0xe1); 165 | mem_free(D_009A06B8, __FF7FILE__, 0xe2); 166 | mem_free(D_009A06A8, __FF7FILE__, 0xe3); 167 | mem_free(D_009A06A4, __FF7FILE__, 0xe4); 168 | mem_free(D_009A06AC, __FF7FILE__, 0xe5); 169 | mem_free(D_009A06C4, __FF7FILE__, 0xe6); 170 | mem_free(D_009A06B4, __FF7FILE__, 0xe7); 171 | } 172 | 173 | //initpath:set music&sfx volume? 174 | int C_004074DA(int bp08, int bp0c) { 175 | struct { 176 | HKEY hKey;//local_3 177 | int local_2; 178 | int dwResult;//local_1 179 | }lolo; 180 | 181 | lolo.local_2 = 1; 182 | //.../Midi:"MusicVolume" 183 | lolo.dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B6620, 0, KEY_WRITE/*0x20006*/, &lolo.hKey); 184 | if(lolo.dwResult == 0) { 185 | lolo.local_2 = 1; 186 | lolo.dwResult = RegSetValueEx(lolo.hKey, D_007B65B8, 0, REG_DWORD/*4*/, (LPBYTE)&bp08, 4); 187 | if(lolo.dwResult == 0) 188 | lolo.local_2 = 0; 189 | lolo.dwResult = RegCloseKey(lolo.hKey); 190 | } 191 | 192 | //.../Sound:SFXVolume 193 | lolo.dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B65E8, 0, KEY_WRITE/*0x20006*/, &lolo.hKey); 194 | if(lolo.dwResult == 0) { 195 | lolo.local_2 = 1; 196 | lolo.dwResult = RegSetValueEx(lolo.hKey, D_007B65C8, 0, REG_DWORD/*4*/, (LPBYTE)&bp0c, 4); 197 | if(lolo.dwResult == 0) 198 | lolo.local_2 = 0; 199 | lolo.dwResult = RegCloseKey(lolo.hKey); 200 | } 201 | 202 | return lolo.local_2; 203 | } 204 | 205 | //initpath:get music&sfx volume? 206 | int C_004075B0() { 207 | struct { 208 | HKEY hKey;//local_7 209 | int local_6; 210 | int dwSFXVol;//local_5 211 | int dwResult;//local_4 212 | DWORD dwType;//local_3 213 | int dwMusicVol;//local_2 214 | DWORD cbData;//local_1 215 | }lolo; 216 | 217 | lolo.local_6 = 1; 218 | //.../Midi:"MusicVolume" 219 | lolo.dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B6620, 0, KEY_QUERY_VALUE, &lolo.hKey); 220 | if(lolo.dwResult == 0) { 221 | lolo.cbData = 4; 222 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B65B8, 0, &lolo.dwType, (LPBYTE)&lolo.dwMusicVol, &lolo.cbData); 223 | if(lolo.dwResult == 0) { 224 | if(lolo.dwMusicVol < 0) 225 | lolo.dwMusicVol = 0; 226 | if(lolo.dwMusicVol > 100) 227 | lolo.dwMusicVol = 100; 228 | #ifndef __JOE_FIX_BUGS__ 229 | //-- potential error: close 2 times -- 230 | lolo.dwResult = RegCloseKey(lolo.hKey); 231 | #endif 232 | } else { 233 | lolo.local_6 = 0; 234 | } 235 | RegCloseKey(lolo.hKey); 236 | } 237 | 238 | //.../Sound:SFXVolume 239 | lolo.dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, D_007B65E8, 0, KEY_QUERY_VALUE, &lolo.hKey); 240 | if(lolo.dwResult == 0) { 241 | lolo.cbData = 4; 242 | lolo.dwResult = RegQueryValueEx(lolo.hKey, D_007B65C8, 0, &lolo.dwType, (LPBYTE)&lolo.dwSFXVol, &lolo.cbData); 243 | if(lolo.dwResult == 0) { 244 | if(lolo.dwSFXVol < 0) 245 | lolo.dwSFXVol = 0; 246 | if(lolo.dwSFXVol > 100) 247 | lolo.dwSFXVol = 100; 248 | #ifndef __JOE_FIX_BUGS__ 249 | //-- potential error: close 2 times -- 250 | lolo.dwResult = RegCloseKey(lolo.hKey); 251 | #endif 252 | } else { 253 | lolo.local_6 = 0; 254 | } 255 | RegCloseKey(lolo.hKey); 256 | } 257 | if(lolo.local_6) 258 | C_006C4946(lolo.dwMusicVol, lolo.dwSFXVol);//set SFX&MIDI volumes[menu related]? 259 | 260 | return lolo.local_6; 261 | } 262 | 263 | //initpath:... 264 | const char *C_004076EA() { 265 | return D_009A06B8; 266 | } 267 | 268 | const char *__004076F4() { 269 | return D_009A06B4; 270 | } 271 | 272 | //minigame path(1) "chocobo"? 273 | const char *C_004076FE() { 274 | memset(D_009A06C4, 0, 0x100); 275 | strcpy(D_009A06C4, D_009A06B4); 276 | strcat(D_009A06C4, "minigame/"); 277 | 278 | return D_009A06C4; 279 | } 280 | 281 | //minigame path(2) "condor"? 282 | const char *C_0040776F() { 283 | memset(D_009A06C4, 0, 0x100); 284 | strcpy(D_009A06C4, D_009A06B4); 285 | strcat(D_009A06C4, "minigame/"); 286 | 287 | return D_009A06C4; 288 | } 289 | 290 | //minigame path(3) "highway"? 291 | const char *C_004077E0() { 292 | memset(D_009A06C4, 0, 0x100); 293 | strcpy(D_009A06C4, D_009A06B4); 294 | strcat(D_009A06C4, "minigame/"); 295 | #ifdef FORCE_PATH 296 | strcat(D_009A06C4, "data_high-us/"); 297 | #endif 298 | 299 | return D_009A06C4; 300 | } 301 | 302 | //minigame path(4) "coaster"? 303 | const char *C_00407851() { 304 | memset(D_009A06C4, 0, 0x100); 305 | strcpy(D_009A06C4, D_009A06B4); 306 | strcat(D_009A06C4, "minigame/"); 307 | #if 0//def FORCE_PATH 308 | strcat(D_009A06C4, "data_coaster/"); 309 | #endif 310 | 311 | return D_009A06C4; 312 | } 313 | 314 | //minigame path(5) "snowboard"? 315 | const char *C_004078C2() { 316 | memset(D_009A06C4, 0, 0x100); 317 | strcpy(D_009A06C4, D_009A06B4); 318 | strcat(D_009A06C4, "minigame/"); 319 | 320 | return D_009A06C4; 321 | } 322 | 323 | //minigame path(6) "submarine"? 324 | const char *C_00407933() { 325 | memset(D_009A06C4, 0, 0x100); 326 | strcpy(D_009A06C4, D_009A06B4); 327 | strcat(D_009A06C4, "minigame/"); 328 | 329 | return D_009A06C4; 330 | } 331 | 332 | const char *__004079A4() { 333 | return D_009A06AC; 334 | } 335 | 336 | const char *__004079AE() { 337 | return D_009A06A8; 338 | } 339 | 340 | const char *__004079B8(int bp08) { 341 | const char *bp_04; 342 | 343 | switch(bp08) { 344 | case 0x00: 345 | strcpy(D_009A0598, D_009A06B4); 346 | strcat(D_009A0598, "field/char.lgp"); 347 | break; 348 | case 0x01: 349 | strcpy(D_009A0598, D_009A06B4); 350 | strcat(D_009A0598, "field/flevel.lgp"); 351 | break; 352 | case 0x02: 353 | strcpy(D_009A0598, D_009A06B8); 354 | strcat(D_009A0598, "battle/battle.lgp"); 355 | break; 356 | case 0x03: 357 | strcpy(D_009A0598, D_009A06B8); 358 | strcat(D_009A0598, "battle/magic.lgp"); 359 | break; 360 | case 0x04: 361 | strcpy(D_009A0598, D_009A06B8); 362 | strcat(D_009A0598, "menu/menu_us.lgp"); 363 | break; 364 | case 0x05: 365 | strcpy(D_009A0598, D_009A06B4); 366 | strcat(D_009A0598, "wm/world_us.lgp"); 367 | break; 368 | case 0x06: 369 | strcpy(D_009A0598, C_0040776F()); 370 | strcat(D_009A0598, "condor.lgp"); 371 | break; 372 | case 0x07: 373 | strcpy(D_009A0598, C_004076FE()); 374 | strcat(D_009A0598, "chocobo.lgp"); 375 | break; 376 | case 0x08: 377 | strcpy(D_009A0598, C_004077E0()); 378 | strcat(D_009A0598, "high-us.lgp"); 379 | break; 380 | case 0x09: 381 | strcpy(D_009A0598, C_00407851()); 382 | strcat(D_009A0598, "coaster.lgp"); 383 | break; 384 | case 0x0a: 385 | strcpy(D_009A0598, C_004078C2()); 386 | strcat(D_009A0598, "snowboard-us.lgp"); 387 | break; 388 | case 0x0b: 389 | bp_04 = C_007443E7();//MIDI:get archive's name 390 | if(bp_04) 391 | strcpy(D_009A0598, bp_04); 392 | break; 393 | case 0x0e: 394 | strcpy(D_009A0598, D_009A06B8); 395 | strcat(D_009A0598, "cd/moviecam.lgp"); 396 | break; 397 | case 0x0f: 398 | strcpy(D_009A0598, D_009A06B8); 399 | strcat(D_009A0598, "cd/cr_us.lgp"); 400 | break; 401 | case 0x10: 402 | strcpy(D_009A0598, C_004076EA()); 403 | strcat(D_009A0598, "cd/disc_us.lgp"); 404 | break; 405 | case 0x11: 406 | strcpy(D_009A0598, C_00407933()); 407 | strcat(D_009A0598, "sub.lgp"); 408 | break; 409 | }//end switch 410 | 411 | return D_009A0598; 412 | } 413 | -------------------------------------------------------------------------------- /NEWFF7/C_0041A1B0.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //high-level input module? 7 | 8 | #include "ff7.h" 9 | //////////////////////////////////////// 10 | int D_009A85C0,D_009A85C4;//pointer x,y 11 | int D_009A85C8;//repeat delay(1) 12 | unsigned char *D_009A85CC; 13 | struct t_aa0 *D_009A85D0; 14 | int D_009A85D4;//current mask 15 | int D_009A85D8;//mouse mask(unused) 16 | LPDIMOUSESTATE D_009A85DC; 17 | int D_009A85E0;//trigger mask 18 | int D_009A85E4;//repeat delay(2) 19 | unsigned D_009A85E8[3][25]; 20 | unsigned D_009A8714;//current repeat delay 21 | int D_009A8718;//time now 22 | struct t_input_98 *D_009A871C; 23 | int D_009A8720;//previous "time now" 24 | int D_009A8724;//mouse mask[w repeat](unused) 25 | int D_009A8728;//previous mask? 26 | int D_009A872C;//current repeat state 27 | unsigned D_009A8730;//time since last refresh 28 | int D_009A8734;//"is repeating" flag 29 | //009A8738 30 | int D_009A873C,D_009A8740;//mouse x,y[for joypad simulation]? 31 | //////////////////////////////////////// 32 | void C_0041A828(void);//key maps 33 | 34 | /*0041A1B0*/void PAD_init(struct t_aa0 *bp08) { 35 | D_009A85E0 ^= D_009A85E0; 36 | D_009A85D4 ^= D_009A85D4; 37 | D_009A85D0 = bp08; 38 | C_0041EEA0(D_009A85D0); 39 | C_0041A828();//key maps 40 | D_009A8720 = 41 | D_009A8718 = timeGetTime(); 42 | D_009A8730 = 0; 43 | } 44 | 45 | /*0041A214*/void PAD_clean() { 46 | C_0041EF0E();//clean direct input driver? 47 | } 48 | 49 | void C_0041B108(void); 50 | 51 | /*0041A21E*/void PAD_refresh(struct t_aa0 *bp08) { 52 | int j;//bp_08 53 | int i;//bp_04 54 | 55 | D_009A85DC = C_0041F139();//get mouse state? 56 | D_009A85CC = C_0041F55E();//get keyboard map? 57 | D_009A871C = C_0041F7D8();//get joypad related object? 58 | //-- game object -- 59 | if(bp08) { 60 | D_009A85D0 = bp08; 61 | } else if(D_009A85D0 == 0) { 62 | return; 63 | } 64 | //-- mouse pointer -- 65 | if(D_009A85DC) { 66 | D_009A85D0->dwPointerX += D_009A85DC->lX; 67 | if(D_009A85D0->dwPointerX < 0) 68 | D_009A85D0->dwPointerX = 0; 69 | if(D_009A85D0->dwPointerX >= D_009A85D0->dwDisplayWidth) 70 | D_009A85D0->dwPointerX = D_009A85D0->dwDisplayWidth - 1; 71 | 72 | D_009A85D0->dwPointerY += D_009A85DC->lY; 73 | if(D_009A85D0->dwPointerY < 0) 74 | D_009A85D0->dwPointerY = 0; 75 | if(D_009A85D0->dwPointerY >= D_009A85D0->dwDisplayHeight) 76 | D_009A85D0->dwPointerY = D_009A85D0->dwDisplayHeight - 1; 77 | D_009A85C0 = D_009A85D0->dwPointerX; 78 | D_009A85C4 = D_009A85D0->dwPointerY; 79 | } 80 | //-- -- 81 | D_009A8728 = D_009A85D4; 82 | D_009A85D4 ^= D_009A85D4; 83 | for(i = 0; i < 3; i ++) { 84 | for(j = 0; j < 25; j ++) { 85 | if(D_009A85E8[i][j] < LOCAL_DIK_DE) { 86 | //keyboard 87 | if(D_009A85CC) { 88 | #if 0 //"right shift" scancode is 0? 89 | if(D_009A85E8[i][j]) 90 | #endif 91 | if(D_009A85CC[D_009A85E8[i][j]] & 0x80) 92 | D_009A85D4 |= BIT(j); 93 | } 94 | } else { 95 | //mouse buttons 96 | if(D_009A85DC) { 97 | switch(D_009A85E8[i][j]) { 98 | case LOCAL_DIK_MOUSE_B1: if(D_009A85DC->rgbButtons[0] & 0x80) D_009A85D4 |= BIT(j); break; 99 | case LOCAL_DIK_MOUSE_B2: if(D_009A85DC->rgbButtons[1] & 0x80) D_009A85D4 |= BIT(j); break; 100 | case LOCAL_DIK_MOUSE_B3: if(D_009A85DC->rgbButtons[2] & 0x80) D_009A85D4 |= BIT(j); break; 101 | }//end switch 102 | } 103 | //joypad 104 | if(D_009A871C) { 105 | switch(D_009A85E8[i][j]) { 106 | case LOCAL_DIK_JOY_UP: if(D_009A871C->f_08) D_009A85D4 |= BIT(j); break; 107 | case LOCAL_DIK_JOY_DOWN: if(D_009A871C->f_0c) D_009A85D4 |= BIT(j); break; 108 | case LOCAL_DIK_JOY_LEFT: if(D_009A871C->f_10) D_009A85D4 |= BIT(j); break; 109 | case LOCAL_DIK_JOY_RIGHT: if(D_009A871C->f_14) D_009A85D4 |= BIT(j); break; 110 | case LOCAL_DIK_JOY_B1: if(D_009A871C->f_18[0]) D_009A85D4 |= BIT(j); break; 111 | case LOCAL_DIK_JOY_B2: if(D_009A871C->f_18[1]) D_009A85D4 |= BIT(j); break; 112 | case LOCAL_DIK_JOY_B3: if(D_009A871C->f_18[2]) D_009A85D4 |= BIT(j); break; 113 | case LOCAL_DIK_JOY_B4: if(D_009A871C->f_18[3]) D_009A85D4 |= BIT(j); break; 114 | case LOCAL_DIK_JOY_B5: if(D_009A871C->f_18[4]) D_009A85D4 |= BIT(j); break; 115 | case LOCAL_DIK_JOY_B6: if(D_009A871C->f_18[5]) D_009A85D4 |= BIT(j); break; 116 | case LOCAL_DIK_JOY_B7: if(D_009A871C->f_18[6]) D_009A85D4 |= BIT(j); break; 117 | case LOCAL_DIK_JOY_B8: if(D_009A871C->f_18[7]) D_009A85D4 |= BIT(j); break; 118 | case LOCAL_DIK_JOY_B9: if(D_009A871C->f_18[8]) D_009A85D4 |= BIT(j); break; 119 | case LOCAL_DIK_JOY_BA: if(D_009A871C->f_18[9]) D_009A85D4 |= BIT(j); break; 120 | }//end switch 121 | } 122 | } 123 | }//end for 124 | }//end for 125 | //-- make "trigger" mask -- 126 | D_009A85E0 = ((D_009A85D4 & D_009A8728) ^ 0xffffffff) & D_009A85D4; 127 | //-- refresh "repeat" -- 128 | if(D_009A85E4) { 129 | D_009A8718 = timeGetTime(); 130 | D_009A8730 += D_009A8718 - D_009A8720; 131 | D_009A8720 = D_009A8718; 132 | C_0041B108(); 133 | } 134 | //-- -- 135 | #if 0 //test joe: gives some mouse control in the menu 136 | extern int __0041AD4B(void);//make mouse mask[joypad simulation]? 137 | __0041AD4B();//make mouse mask[joypad simulation]? 138 | #endif 139 | } 140 | 141 | //note:ff8 names it "set_command" 142 | /*0041A7EF*/void PAD_setCommand(int dwMap, unsigned dwMask, int dwKeyCode) { 143 | int i; 144 | 145 | i = 1; 146 | while(dwMask >> i) 147 | i ++; 148 | D_009A85E8[dwMap][i - 1] = dwKeyCode; 149 | } 150 | 151 | void C_0041AA5F(void);//key map #3[joy] 152 | 153 | //key maps 154 | void C_0041A828() { 155 | memset(D_009A85E8, 0, sizeof(D_009A85E8)); 156 | 157 | C_0041A96D();//key map #2[numpad] 158 | C_0041AA5F();//key map #3[joy] 159 | 160 | PAD_setCommand(0, PAD_16, DIK_ESCAPE);//0x01 161 | PAD_setCommand(1, PAD_16, LOCAL_DIK_JOY_B2);//0xec 162 | //-- -- 163 | PAD_setCommand(0, PAD_21, DIK_RETURN);//0x1c 164 | PAD_setCommand(0, PAD_17, DIK_UP);//0xc8 165 | PAD_setCommand(0, PAD_18, DIK_DOWN);//0xd0 166 | PAD_setCommand(0, PAD_19, DIK_LEFT);//0xcb 167 | PAD_setCommand(0, PAD_20, DIK_RIGHT);//0xcd 168 | //-- -- 169 | PAD_setCommand(1, PAD_17, LOCAL_DIK_JOY_UP);//0xe3 170 | PAD_setCommand(1, PAD_18, LOCAL_DIK_JOY_DOWN);//0xe4 171 | PAD_setCommand(1, PAD_19, LOCAL_DIK_JOY_LEFT);//0xe5 172 | PAD_setCommand(1, PAD_20, LOCAL_DIK_JOY_RIGHT);//0xe6 173 | //-- -- 174 | PAD_setCommand(0, PAD_22, LOCAL_DIK_MOUSE_B1);//0xdf 175 | PAD_setCommand(1, PAD_22, LOCAL_DIK_MOUSE_B2);//0xe0 176 | //-- -- 177 | PAD_setCommand(0, PAD_23, LOCAL_DIK_JOY_B1);//0xeb 178 | PAD_setCommand(0, PAD_24, LOCAL_DIK_JOY_B3);//0xed 179 | } 180 | 181 | //note PAD_09 is not assigned 182 | 183 | //key map #2[numpad] 184 | void C_0041A96D() { 185 | PAD_setCommand(0, PAD_05, DIK_NUMPADENTER);//0x9c 186 | PAD_setCommand(0, PAD_06, DIK_NUMPAD0);//0x52 187 | PAD_setCommand(0, PAD_04, DIK_ADD);//0x4e 188 | PAD_setCommand(0, PAD_08, DIK_SUBTRACT);//0x4a 189 | PAD_setCommand(0, PAD_07, DIK_DECIMAL);//0x53 190 | PAD_setCommand(0, PAD_UP, DIK_NUMPAD8);//0x48 191 | PAD_setCommand(0, PAD_RIGHT, DIK_NUMPAD6);//0x4d 192 | PAD_setCommand(0, PAD_DOWN, DIK_NUMPAD2);//0x50 193 | PAD_setCommand(0, PAD_LEFT, DIK_NUMPAD4);//0x4b 194 | PAD_setCommand(0, PAD_00, DIK_NUMPAD7);//0x47 195 | PAD_setCommand(0, PAD_02, DIK_NUMPAD9);//0x49 196 | PAD_setCommand(0, PAD_01, DIK_NUMPAD1);//0x4f 197 | PAD_setCommand(0, PAD_03, DIK_NUMPAD3);//0x51 198 | PAD_setCommand(0, PAD_08, DIK_SUBTRACT);//0x4a//why twice? 199 | PAD_setCommand(0, PAD_11, DIK_NUMPAD5);//0x4c 200 | } 201 | 202 | //key map #3[joy] 203 | void C_0041AA5F() { 204 | PAD_setCommand(1, PAD_00, LOCAL_DIK_JOY_B7);//0xF1 205 | PAD_setCommand(1, PAD_01, LOCAL_DIK_JOY_B8);//0xF2 206 | PAD_setCommand(1, PAD_02, LOCAL_DIK_JOY_B5);//0xEF 207 | PAD_setCommand(1, PAD_03, LOCAL_DIK_JOY_B6);//0xF0 208 | PAD_setCommand(1, PAD_04, LOCAL_DIK_JOY_B4);//0xEE 209 | PAD_setCommand(1, PAD_05, LOCAL_DIK_JOY_B3);//0xED 210 | PAD_setCommand(1, PAD_06, LOCAL_DIK_JOY_B2);//0xEC 211 | PAD_setCommand(1, PAD_07, LOCAL_DIK_JOY_B1);//0xEB 212 | PAD_setCommand(1, PAD_08, LOCAL_DIK_JOY_B9);//0xF3 213 | PAD_setCommand(1, PAD_11, LOCAL_DIK_JOY_BA);//0xF4 214 | PAD_setCommand(1, PAD_UP, LOCAL_DIK_JOY_UP);//0xE3 215 | PAD_setCommand(1, PAD_RIGHT, LOCAL_DIK_JOY_RIGHT);//0xE6 216 | PAD_setCommand(1, PAD_DOWN, LOCAL_DIK_JOY_DOWN);//0xE4 217 | PAD_setCommand(1, PAD_LEFT, LOCAL_DIK_JOY_LEFT);//0xE5 218 | } 219 | 220 | //test input mask[pressed]? 221 | /*0041AB67*/unsigned PAD_test(unsigned bp08) { 222 | return D_009A85D4 & bp08; 223 | } 224 | 225 | //test input mask[trigger]? 226 | /*0041AB74*/unsigned PAD_testTrigger(unsigned bp08) { 227 | return D_009A85E0 & bp08; 228 | } 229 | 230 | int __0041AB81() { 231 | struct { 232 | struct t_input_98 *bp_0c; 233 | LPDIDEVICEOBJECTDATA bp_08; 234 | int i;//bp_04 235 | }lolo; 236 | 237 | //-- -- 238 | #if (_MSC_VER < 1500) 239 | //!!!bug!!! 240 | //C_0041F766() should be called only once, before the loop!!! 241 | for(lolo.i = 0; lolo.i < C_0041F766(); lolo.i ++) { 242 | #else 243 | while(C_0041F766() > 0) { 244 | #endif 245 | lolo.bp_08 = C_0041F5F5();//get keyboard DeviceObjectData? 246 | if(lolo.bp_08 && lolo.bp_08->dwData & 0x80) 247 | return lolo.bp_08->dwOfs; 248 | }//end for 249 | //-- -- 250 | if(D_009A85D8 & BIT(4)) return LOCAL_DIK_MOUSE_B1; 251 | if(D_009A85D8 & BIT(5)) return LOCAL_DIK_MOUSE_B2; 252 | if(D_009A85D8 & BIT(6)) return LOCAL_DIK_MOUSE_B3; 253 | //-- -- 254 | if(PAD_testTrigger(PAD_17)) return LOCAL_DIK_JOY_UP; 255 | if(PAD_testTrigger(PAD_18)) return LOCAL_DIK_JOY_DOWN; 256 | if(PAD_testTrigger(PAD_19)) return LOCAL_DIK_JOY_LEFT; 257 | if(PAD_testTrigger(PAD_20)) return LOCAL_DIK_JOY_RIGHT; 258 | if(PAD_testTrigger(PAD_23)) return LOCAL_DIK_JOY_B1; 259 | if(PAD_testTrigger(PAD_24)) return LOCAL_DIK_JOY_B3; 260 | //-- -- 261 | lolo.bp_0c = C_0041F7D8();//get joypad related object? 262 | if(lolo.bp_0c) { 263 | if(lolo.bp_0c->f_18[1]) return LOCAL_DIK_JOY_B2; 264 | if(lolo.bp_0c->f_18[3]) return LOCAL_DIK_JOY_B4; 265 | if(lolo.bp_0c->f_18[4]) return LOCAL_DIK_JOY_B5; 266 | if(lolo.bp_0c->f_18[5]) return LOCAL_DIK_JOY_B6; 267 | if(lolo.bp_0c->f_18[6]) return LOCAL_DIK_JOY_B7; 268 | if(lolo.bp_0c->f_18[7]) return LOCAL_DIK_JOY_B8; 269 | if(lolo.bp_0c->f_18[8]) return LOCAL_DIK_JOY_B9; 270 | if(lolo.bp_0c->f_18[9]) return LOCAL_DIK_JOY_BA; 271 | } 272 | 273 | return 0; 274 | } 275 | 276 | //make mouse mask[joypad simulation]? 277 | int __0041AD4B() { 278 | struct { 279 | LPDIDEVICEOBJECTDATA bp_14; 280 | int dwMouseMin;//bp_10 281 | unsigned bp_0c; 282 | int i;//bp_08 283 | int dwMouseMax;//bp_04 284 | }lolo; 285 | 286 | lolo.dwMouseMin = 15; 287 | lolo.dwMouseMax = 200; 288 | D_009A85D8 ^= D_009A85D8; 289 | D_009A8724 ^= D_009A8724; 290 | if(D_009A85E4 == 0) { 291 | D_009A873C = 0; 292 | D_009A8740 = 0; 293 | } 294 | #if (_MSC_VER < 1500) 295 | //!!!bug!!! 296 | //C_0041F32A() should be called only once, before the loop!!! 297 | for(lolo.i = 0; lolo.i < C_0041F32A(); lolo.i ++) { 298 | #else 299 | while(C_0041F32A() > 0) { 300 | #endif 301 | lolo.bp_14 = C_0041F1C3();//get mouse DeviceObjectData? 302 | if(lolo.bp_14) { 303 | switch(lolo.bp_14->dwOfs) { 304 | case DIMOFS_X/*0x00*/: D_009A873C += lolo.bp_14->dwData; break; 305 | case DIMOFS_Y/*0x04*/: D_009A8740 += lolo.bp_14->dwData; break; 306 | case DIMOFS_BUTTON0/*0x0c*/: if(lolo.bp_14->dwData & 0x80) D_009A85D8 |= BIT(4); break; 307 | case DIMOFS_BUTTON1/*0x0d*/: if(lolo.bp_14->dwData & 0x80) D_009A85D8 |= BIT(5); break; 308 | case DIMOFS_BUTTON2/*0x0e*/: if(lolo.bp_14->dwData & 0x80) D_009A85D8 |= BIT(6); break; 309 | }//end switch 310 | } 311 | }//end for 312 | //-- LEFT -- 313 | if(D_009A873C < -lolo.dwMouseMin) { 314 | D_009A85D8 |= BIT(3); 315 | //-- repeat -- 316 | if(D_009A85E4) { 317 | if(D_009A873C < -lolo.dwMouseMax) 318 | D_009A873C = -lolo.dwMouseMax; 319 | lolo.bp_0c = D_009A85E4 - D_009A85E4 * (-D_009A873C / lolo.dwMouseMax); 320 | if(D_009A8730 >= lolo.bp_0c) 321 | D_009A8724 |= BIT(3); 322 | } 323 | //-- -- 324 | D_009A873C = 0; 325 | } 326 | //-- RIGHT -- 327 | if(D_009A873C > lolo.dwMouseMin) { 328 | D_009A85D8 |= BIT(2); 329 | //-- repeat -- 330 | if(D_009A85E4) { 331 | if(D_009A873C > lolo.dwMouseMax) 332 | D_009A873C = lolo.dwMouseMax; 333 | lolo.bp_0c = D_009A85E4 - D_009A85E4 * (D_009A873C / lolo.dwMouseMax); 334 | if(D_009A8730 >= lolo.bp_0c) 335 | D_009A8724 |= BIT(2); 336 | } 337 | //-- -- 338 | D_009A873C = 0; 339 | } 340 | //-- UP -- 341 | if(D_009A8740 < -lolo.dwMouseMin) { 342 | D_009A85D8 |= BIT(0); 343 | //-- repeat -- 344 | if(D_009A85E4) { 345 | if(D_009A8740 < -lolo.dwMouseMax) 346 | D_009A8740 = -lolo.dwMouseMax; 347 | lolo.bp_0c = D_009A85E4 - D_009A85E4 * (-D_009A8740 / lolo.dwMouseMax); 348 | if(D_009A8730 >= lolo.bp_0c) 349 | D_009A8724 |= BIT(0); 350 | } 351 | //-- -- 352 | D_009A8740 = 0; 353 | } 354 | //-- DOWN -- 355 | if(D_009A8740 > lolo.dwMouseMin) { 356 | D_009A85D8 |= BIT(1); 357 | //-- repeat -- 358 | if(D_009A85E4) { 359 | if(D_009A8740 > lolo.dwMouseMax) 360 | D_009A8740 = lolo.dwMouseMax; 361 | lolo.bp_0c = D_009A85E4 - D_009A85E4 * (D_009A8740 / lolo.dwMouseMax); 362 | if(D_009A8730 >= lolo.bp_0c) 363 | D_009A8724 |= BIT(1); 364 | } 365 | //-- -- 366 | D_009A8740 = 0; 367 | } 368 | //-- -- 369 | 370 | return D_009A85D8; 371 | } 372 | 373 | //get mouse mask[unused]? 374 | /*0041B08F*/int PAD_getMouseMask() { 375 | return D_009A85D8; 376 | } 377 | 378 | //test input mask[w repeat]? 379 | /*0041B099*/int PAD_testRepeat(unsigned dwMask/*bp08*/) { 380 | if(D_009A85E4 == 0) 381 | return PAD_test(dwMask); 382 | if(PAD_test(dwMask)) 383 | return D_009A872C; 384 | 385 | return 0; 386 | } 387 | 388 | //get mouse mask[w repeat][unused]? 389 | /*0041B0CE*/int PAD_getMouseMaskRepeat() { 390 | return D_009A8724; 391 | } 392 | 393 | /*0041B0D8*/void PAD_setRepeatParams(int bp08, int bp0c) { 394 | D_009A85C8 = bp08; 395 | D_009A85E4 = bp0c; 396 | } 397 | 398 | //get input repeat parameters? 399 | void __0041B0EE(int *bp08, int *bp0c) { 400 | *bp08 = D_009A85C8; 401 | *bp0c = D_009A85E4; 402 | } 403 | 404 | //manage repeat 405 | void C_0041B108() { 406 | D_009A872C = 0; 407 | if(D_009A85E0 != 0) { 408 | D_009A8734 = 0; 409 | D_009A8714 = D_009A85C8; 410 | D_009A872C = 1; 411 | D_009A8730 = 0; 412 | } else if(D_009A85D4 && D_009A8730 >= D_009A8714) { 413 | D_009A8714 = D_009A85E4; 414 | D_009A8734 = 1; 415 | D_009A872C = 1; 416 | D_009A8730 = 0; 417 | } 418 | } 419 | 420 | void __0041B18B() { 421 | D_009A8730 = 0; 422 | D_009A85C8 = 0; 423 | D_009A85E4 = D_009A85C8; 424 | D_009A8734 = 0; 425 | } 426 | 427 | //[condor only] 428 | /*0041B1B8*/int PAD_isMouseButtonPressed(int bp08) { 429 | if(D_009A85DC) { 430 | switch(bp08) { 431 | case LOCAL_DIK_MOUSE_B1: return D_009A85DC->rgbButtons[0] & 0x80; break; 432 | case LOCAL_DIK_MOUSE_B2: return D_009A85DC->rgbButtons[1] & 0x80; break; 433 | case LOCAL_DIK_MOUSE_B3: return D_009A85DC->rgbButtons[2] & 0x80; break; 434 | default: 435 | return 0; 436 | }//end switch 437 | } 438 | 439 | return 0; 440 | } 441 | 442 | //[submarine only] 443 | /*0041B22B*/int PAD_isKeyPressed(unsigned bp08) { 444 | if(bp08 > 0xff) 445 | return 0; 446 | if(D_009A85CC) 447 | return D_009A85CC[bp08] & 0x80; 448 | 449 | return 0; 450 | } 451 | 452 | //get mouse X/Y 453 | void *__0041B25D() { 454 | return &D_009A85C0; 455 | } 456 | 457 | //mouse related 458 | void __0041B267(int dwPointerX/*bp08*/, int dwPointerY/*bp0c*/) { 459 | if(dwPointerX < 0 || dwPointerY < 0) 460 | return; 461 | if(D_009A85D0) { 462 | if(D_009A85D0->dwDisplayWidth >= dwPointerX) 463 | D_009A85D0->dwPointerX = D_009A85C0 = dwPointerX; 464 | if(D_009A85D0->dwDisplayHeight >= dwPointerY) 465 | D_009A85D0->dwPointerY = D_009A85C4 = dwPointerY; 466 | } 467 | } 468 | 469 | void __0041B2D8() { 470 | D_009A8730 = 0; 471 | D_009A8734 = 0; 472 | } 473 | -------------------------------------------------------------------------------- /NEWFF7/C_0074BA80.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | #include "field_data.h" 11 | #include "menu_data.h" 12 | //////////////////////////////////////// 13 | int __00969948 = 1; 14 | int D_0096994C = 1;//isRendering? 15 | int D_00969950 = 1;//allowsFrameSkip? 16 | //00969954 00 00 00 00 17 | double D_00969958 = 30.0;//requested frame rate 18 | double D_00969960 = 22.0;//requested frame rate 19 | //////////////////////////////////////// 20 | unsigned D_00DE67E8;//viewport height 21 | //00DE67EC 22 | LARGE_INTEGER D_00DE67F0; 23 | unsigned D_00DE68F8;//viewport width 24 | void (*D_00DE68FC)(void);//wm render callback 25 | float D_00DE6900; 26 | //00DE6904 27 | double D_00DE6908; 28 | LARGE_INTEGER D_00DE6910; 29 | struct tMainCallbacks D_00DE6918; 30 | //00DE6934 31 | double D_00DE6938;//CPU cycles per frame? 32 | int D_00DE6940; 33 | //char 00DE6944[0x94] 34 | int D_00DE69D8; 35 | int D_00DE69DC;//go to main dispatcher 36 | int D_00DE69E0;//"init/reset done" flag 37 | int D_00DE69E4; 38 | int D_00DE69EC;//skip this frame 39 | double D_00DE69F0; 40 | int D_00DE69F8; 41 | //00DE69FC 42 | //////////////////////////////////////// 43 | //WORLD MAP[ONMOUSE][callback] 44 | void C_0074BA80(int uMsg/*_p08*/, int wParam/*_p0c*/, int lParam/*_p10*/, struct t_aa0 *_p14) { 45 | } 46 | 47 | //WORLD MAP[ONKEY][callback] 48 | void C_0074BA85(int uMsg/*_p08*/, int wParam/*_p0c*/, int lParam/*_p10*/, struct t_aa0 *_p14) { 49 | } 50 | 51 | void __0074BA8A(int dwX/*bp08*/, int dwY/*bp0c*/, const char *pString/*bp10*/, HDC hdc/*bp14*/) { 52 | SetBkColor(hdc, RGB(0x00,0x00,0xff)); 53 | SetTextColor(hdc, RGB(0xff,0xff,0x00)); 54 | TextOut(hdc, dwX, dwY, pString, lstrlen(pString)); 55 | TextOut(hdc, 0, D_00DE67E8 - 32, D_00E28C48, lstrlen(D_00E28C48)); 56 | } 57 | 58 | //WORLD MAP[BEGIN][callback] 59 | void C_0074BAF5(struct t_aa0 *bp08) { 60 | struct { 61 | int dwGrMode;//local_3 62 | int i;//local_2 63 | int local_1; 64 | }lolo; 65 | 66 | dx_dbg_puts("-=-=[START OF WORLD MAP!!!]=-=-\n"); 67 | //-- -- 68 | if(!D_00E045EC) { 69 | lolo.dwGrMode = C_00404D80();//Get "Graphics/Mode" Key 70 | lolo.local_1 = 0x4000|0x40|0x10|1;//0x4051 71 | C_006833DE(&lolo.local_1);//anm:set some flags? 72 | C_0075E6BD();//wm:reset SFX? 73 | D_00E2C41C = 74 | D_00E2C420 = 0; 75 | if(lolo.dwGrMode == 2) { 76 | D_00E2C424 = 0; 77 | D_00E2C428 = 0; 78 | D_00DE69D8 = 2; 79 | D_00DE6900 = 2.0f; 80 | D_00DE68F8 = 640; 81 | D_00DE67E8 = 480; 82 | C_006F193E(2);//menu:set graphic mode[world map] 83 | } else { 84 | if(lolo.dwGrMode == 1) { 85 | D_00E2C424 = 160; 86 | D_00E2C428 = 120; 87 | C_006F193E(1);//menu:set graphic mode[world map] 88 | } else { 89 | D_00E2C424 = 0; 90 | D_00E2C428 = 0; 91 | C_006F193E(0);//menu:set graphic mode[world map] 92 | } 93 | D_00DE69D8 = 1; 94 | D_00DE6900 = 1.0f; 95 | D_00DE68F8 = 320; 96 | D_00DE67E8 = 240; 97 | } 98 | C_00661966(1);//psx:set LH/RH flag? 99 | C_006619AA(240.0);//psx:D_0090AAF0->f_08 = (double)? 100 | PAD_setRepeatParams(200, 50); 101 | C_0075AB50();//wmdefine:init? 102 | D_00DE69E4 = 103 | D_00DE69DC = 104 | D_00DE69E0 = 0;//force init/reset 105 | for(lolo.i = 0; lolo.i < 3; lolo.i ++) 106 | D_00E2C430[lolo.i].f_24 = 0; 107 | for(lolo.i = 0; lolo.i < 0xd; lolo.i ++) 108 | D_00E2C808[lolo.i].f_24 = 0; 109 | g_drv_viewport(D_00E2C424, D_00E2C428, D_00DE68F8, D_00DE67E8, bp08); 110 | D_0096B414 = -1; 111 | bp08->fNear = 500.0f; 112 | bp08->fFar = 40000.0f; 113 | } 114 | //-- -- 115 | D_00DE6938 = bp08->f_030 / D_00969958; 116 | D_00DE69EC = 0; 117 | D_00DE69F8 = 0; 118 | C_0074C973(1);//wm:set "isRendering"? 119 | C_0074C980(1);//wm:set "allowsFrameSkip"? 120 | C_00753879();//fade in/out related(2)? 121 | C_0075389C();//fade in/out related(4)? 122 | D_00DE6908 = bp08->f_030 / D_00969960; 123 | } 124 | 125 | //WORLD MAP:clean? 126 | void C_0074BD50() { 127 | if(D_00E045EC) { 128 | C_0075A921();//wmfile:clean textures & models? 129 | C_00759EEA();//wmfile:release 3d models[world]? 130 | C_0075A01D();//wmfile:release 3d models[chara]? 131 | C_0075ABF3();//wmdefine:clean? 132 | C_0075EB1E();//wm:clean lights? 133 | } 134 | } 135 | 136 | //WORLD MAP[END][callback] 137 | void C_0074BD77(struct t_aa0 *_p08) { 138 | if(!D_00E045EC) { 139 | C_0075A921();//wmfile:clean textures & models? 140 | C_00759EEA();//wmfile:release 3d models[world]? 141 | C_0075A01D();//wmfile:release 3d models[chara]? 142 | C_0075ABF3();//wmdefine:clean? 143 | C_0075EB1E();//wm:clean lights? 144 | //-- -- 145 | if(D_00CC15D0 != D_00CC15D8 || D_00CC15D8 == 0) { 146 | ; 147 | } else { 148 | D_00CC15D8 = 0; 149 | D_00CC15DC = 0; 150 | } 151 | D_00CC0974 = D_00DE6940; 152 | D_00CC15D0 = D_00CC0D88.wEventParam;//set field id 153 | switch(D_00CC1644) { 154 | case 0://go to field 155 | D_00CC0D84 = MAIN_STATE_03;//(world map) 156 | D_00CBF9DC = MAIN_STATE_01;//(field) 157 | break; 158 | case 1://go to battle 159 | D_00CC0D84 = MAIN_STATE_03;//(world map) 160 | D_00CBF9DC = MAIN_STATE_17;//swirl(before battle) 161 | break; 162 | case 2://to ending sequence? 163 | D_00CC0D88.bEventType = FIELD_EVENT_0A; 164 | break; 165 | }//end switch 166 | } 167 | dx_dbg_puts("-=-=[END OF WORLD MAP!!!]=-=-\n"); 168 | } 169 | 170 | void C_0074C7E4(struct t_aa0 *);//world.tempo? 171 | 172 | //WORLD MAP[UPDATE][callback] 173 | void C_0074BE49(struct t_aa0 *bp08) { 174 | struct { 175 | char __00[0xd0]; 176 | int local_5_unused; 177 | struct fBGRA local_4; 178 | }lolo; 179 | 180 | lolo.local_5_unused = 1; 181 | //-- -- 182 | if(D_00DE69F8) 183 | C_0074C7E4(bp08);//world.tempo? 184 | if(D_00DE69EC) 185 | D_00DE69F8 = 0; 186 | else 187 | D_00DE69F8 = 1; 188 | TS_getCPUTimeStamp(&D_00DE67F0); 189 | //-- -- 190 | PAD_refresh(0); 191 | C_00744B13();//sound:refresh trans? 192 | C_00666DDD(bp08);//reset "transparent heap" 193 | C_006656A4(bp08);//dx_3d2d:reset[sort related]? 194 | C_00666DA3(bp08);//calls "instance:reset" 195 | C_00666DC0(bp08);//calls "dx_sfx:reset heaps" 196 | lolo.local_4.r = 0; 197 | lolo.local_4.g = 0; 198 | lolo.local_4.b = 0; 199 | lolo.local_4.a = 1.0f; 200 | g_drv_clearColor(&lolo.local_4, bp08); 201 | g_drv_clear(1, 1, 1, bp08); 202 | if(g_drv_beginScene(0, bp08)) { 203 | if(D_00DE69EC) 204 | C_0074C973(0);//wm:set "isRendering"? 205 | else 206 | C_0074C973(1);//wm:set "isRendering"? 207 | //------------- 208 | //-- LAYER 0 -- 209 | //------------- 210 | //-- main render -- 211 | D_00DE6940 = C_0074DB8C(&D_00CC1644, &D_00CC1648, &D_00CC0D80, 0); 212 | D_00DE68FC();//wm render callback 213 | C_00666DF4(bp08);//render "transparent heap" 214 | C_006656D1(bp08);//dx_3d2d:render[sort related]? 215 | //------------- 216 | //-- LAYER 1 -- 217 | //------------- 218 | //-- fade in/out? -- 219 | C_00660E95(1, bp08);//G_DRV_84:change_layer? 220 | C_0066E641(D_00E2C3F4[0], bp08);//dx_spr:render 221 | //-- -- 222 | if(1) { 223 | if(D_00DE69EC) { 224 | D_00DE69F8 = 1; 225 | D_00DE69EC = 0; 226 | C_0074C973(1);//wm:set "isRendering"? 227 | bp08->f_040 += 1.0; 228 | C_00666DDD(bp08);//reset "transparent heap" 229 | C_006656A4(bp08);//dx_3d2d:reset[sort related]? 230 | C_00666DA3(bp08);//calls "instance:reset" 231 | C_00666DC0(bp08);//calls "dx_sfx:reset heaps" 232 | TS_getCPUTimeStamp(&D_00DE67F0); 233 | PAD_refresh(0); 234 | //-- main render -- 235 | D_00DE6940 = C_0074DB8C(&D_00CC1644, &D_00CC1648, &D_00CC0D80, 0); 236 | D_00DE68FC();//wm render callback 237 | C_00666DF4(bp08);//render "transparent heap" 238 | C_006656D1(bp08);//dx_3d2d:render[sort related]? 239 | //------------- 240 | //-- LAYER 1 -- 241 | //------------- 242 | //-- fade in/out? -- 243 | C_00660E95(1, bp08);//G_DRV_84:change_layer? 244 | C_0066E641(D_00E2C3F4[0], bp08);//dx_spr:render 245 | //-- -- 246 | } 247 | } 248 | g_drv_endScene(bp08); 249 | } 250 | //-- -- 251 | if(D_00DE69DC) { 252 | //*** to main dispatcher *** 253 | if(0); 254 | if(0); 255 | D_00DE69DC = 256 | D_00DE69E0 = 0;//force init/reset 257 | C_00666D47(&D_00DE6918, bp08);//get main loop callbacks? 258 | D_00DE6918.f_14 = C_00409DF1;//MainDispatcher[ONMOUSE][callback] 259 | D_00DE6918.f_18 = C_00409E39;//MainDispatcher[ONKEY][callback] 260 | D_00DE6918.f_10 = C_004090E6;//MainDispatcher[UPDATE][callback] 261 | D_00DE6918.f_08 = C_00408FA6;//MainDispatcher[BEGIN][callback] 262 | D_00DE6918.f_0c = C_004090C7;//MainDispatcher[END][callback] 263 | C_00666CF2(&D_00DE6918, bp08);//set main loop callbacks? 264 | } else if(D_00E045EC) { 265 | //*** to menu system *** 266 | C_00666D47(&D_00DE6918, bp08);//get main loop callbacks? 267 | D_00DE6918.f_14 = C_006CC619;//MENU SYSTEM[ONMOUSE][callback] 268 | D_00DE6918.f_18 = C_006CC61E;//MENU SYSTEM[ONKEY][callback] 269 | D_00DE6918.f_10 = C_006CC623;//MENU SYSTEM[UPDATE][callback] 270 | D_00DE6918.f_08 = C_006CD3B0;//MENU SYSTEM[BEGIN][callback] 271 | D_00DE6918.f_0c = C_006CD5B3;//MENU SYSTEM[END][callback] 272 | C_00666CF2(&D_00DE6918, bp08);//set main loop callbacks? 273 | } 274 | } 275 | 276 | void C_0074C6B0(struct t_aa0 *);//render 3d objects? 277 | 278 | //wm:render_0(surface)(callback) 279 | void C_0074C179() { 280 | struct { 281 | unsigned i;//local_2 282 | struct t_aa0 *local_1; 283 | }lolo; 284 | 285 | lolo.local_1 = C_00676578(); 286 | if(C_0074C969() == 0)//wm:get "isRendering"? 287 | return; 288 | //------------- 289 | //-- LAYER 0 -- 290 | //------------- 291 | C_00660E95(0, lolo.local_1);//G_DRV_84:change_layer? 292 | //-- terrain mesh? -- "sea" 293 | for(lolo.i = 0; lolo.i < 0x16; lolo.i ++) { 294 | C_0066E641(D_00E2BBD8[D_0096B418[lolo.i]], lolo.local_1);//dx_spr:render 295 | } 296 | //-- terrain mesh? -- "land" 297 | for(lolo.i = 0; lolo.i < D_00E2C420; lolo.i ++) { 298 | if(!C_007592E0(lolo.i))//wmfile:texture is animated? 299 | C_0066E641(D_00E2BBD8[lolo.i], lolo.local_1);//dx_spr:render 300 | } 301 | //-- background color -- 302 | C_0066E641(D_00E2C3E8, lolo.local_1);//dx_spr:render 303 | g_drv_setRenderState(G_DRV_STATE_02, 0, lolo.local_1); 304 | //-- midgar zolom -- 305 | C_0066E641(D_00E2C414, lolo.local_1);//dx_spr:render 306 | //------------- 307 | //-- LAYER 1 -- backround sky? 308 | //------------- 309 | C_00660E95(1, lolo.local_1);//G_DRV_84:change_layer? 310 | C_0066E641(D_00E2C3EC, lolo.local_1);//dx_spr:render 311 | C_0066E641(D_00E2C3F0, lolo.local_1);//dx_spr:render 312 | //------------- 313 | //-- LAYER 1 -- shadows? 314 | //------------- 315 | C_00660E95(1, lolo.local_1);//G_DRV_84:change_layer? 316 | g_drv_setRenderState(G_DRV_STATE_02, 0, lolo.local_1); 317 | C_0066E641(D_00E2C400, lolo.local_1);//dx_spr:render 318 | //------------- 319 | //-- LAYER 0 -- 320 | //------------- 321 | //-- 3d objects? -- 322 | C_00660E95(0, lolo.local_1);//G_DRV_84:change_layer? 323 | C_0074C6B0(lolo.local_1);//render 3d objects? 324 | //------------- 325 | //-- LAYER 1 -- 326 | //------------- 327 | //-- map? -- 328 | C_00660E95(1, lolo.local_1);//G_DRV_84:change_layer? 329 | C_0066E641(D_00E2C3E0, lolo.local_1);//dx_spr:render 330 | C_0066E641(D_00E2C3DC, lolo.local_1);//dx_spr:render 331 | C_0066E641(D_00E2C3D8, lolo.local_1);//dx_spr:render 332 | //-- vehicule fx? -- 333 | g_drv_setRenderState(G_DRV_STATE_02, 0, lolo.local_1); 334 | C_0066E641(D_00E2C404[0], lolo.local_1);//dx_spr:render 335 | C_0066E641(D_00E2C404[1], lolo.local_1);//dx_spr:render 336 | C_0066E641(D_00E2C404[2], lolo.local_1);//dx_spr:render 337 | C_0066E641(D_00E2C404[3], lolo.local_1);//dx_spr:render 338 | //-- -- 339 | // 340 | //-- radar? -- 341 | C_0066E641(D_00E2C3E4, lolo.local_1);//dx_spr:render 342 | //-- dialog? -- 343 | if(D_00E3610C) { 344 | C_006F19F3(0);//set dialog y offset? 345 | C_006EBF2C(D_00CFF5B8, 1, C_0074C9A5() == 0); 346 | C_006ECA68(); 347 | D_00E3610C = 0; 348 | g_drv_viewport(D_00E2C424, D_00E2C428, D_00DE68F8, D_00DE67E8, lolo.local_1); 349 | } 350 | } 351 | 352 | //wm:render_2(undersea)(callback) 353 | void C_0074C3F0() { 354 | struct { 355 | unsigned i;//local_2 356 | struct t_aa0 *local_1; 357 | }lolo; 358 | 359 | lolo.local_1 = C_00676578(); 360 | if(C_0074C969() == 0)//wm:get "isRendering"? 361 | return; 362 | //------------- 363 | //-- LAYER 0 -- 364 | //------------- 365 | C_00660E95(0, lolo.local_1);//G_DRV_84:change_layer? 366 | //-- terrain mesh? -- 367 | for(lolo.i = 0; lolo.i < D_00E2C420; lolo.i ++) { 368 | C_0066E641(D_00E2BBD8[lolo.i], lolo.local_1);//dx_spr:render 369 | } 370 | //-- 3d objects? -- 371 | // 372 | C_0074C6B0(lolo.local_1);//render 3d objects? 373 | //------------- 374 | //-- LAYER 1 -- 375 | //------------- 376 | //-- map? -- 377 | C_00660E95(1, lolo.local_1);//G_DRV_84:change_layer? 378 | C_0066E641(D_00E2C3E0, lolo.local_1);//dx_spr:render 379 | C_0066E641(D_00E2C3DC, lolo.local_1);//dx_spr:render 380 | C_0066E641(D_00E2C3D8, lolo.local_1);//dx_spr:render 381 | //-- vehicule fx? -- 382 | g_drv_setRenderState(G_DRV_STATE_02, 0, lolo.local_1); 383 | C_0066E641(D_00E2C404[0], lolo.local_1);//dx_spr:render 384 | C_0066E641(D_00E2C404[1], lolo.local_1);//dx_spr:render 385 | C_0066E641(D_00E2C404[2], lolo.local_1);//dx_spr:render 386 | C_0066E641(D_00E2C404[3], lolo.local_1);//dx_spr:render 387 | //-- shadows? -- 388 | C_0066E641(D_00E2C400, lolo.local_1);//dx_spr:render 389 | //-- radar? -- 390 | C_0066E641(D_00E2C3E4, lolo.local_1);//dx_spr:render 391 | //-- dialog? -- 392 | if(D_00E3610C) { 393 | C_006F19F3(0);//set dialog y offset? 394 | C_006EBF2C(D_00CFF5B8, 1, C_0074C9A5() == 0); 395 | C_006ECA68(); 396 | D_00E3610C = 0; 397 | g_drv_viewport(D_00E2C424, D_00E2C428, D_00DE68F8, D_00DE67E8, lolo.local_1); 398 | } 399 | } 400 | 401 | //wm:render_3(snowfield)(callback) 402 | void C_0074C589() { 403 | struct { 404 | unsigned i;//local_2 405 | struct t_aa0 *local_1; 406 | }lolo; 407 | 408 | lolo.local_1 = C_00676578(); 409 | if(C_0074C969() == 0)//wm:get "isRendering"? 410 | return; 411 | //------------- 412 | //-- LAYER 0 -- 413 | //------------- 414 | C_00660E95(0, lolo.local_1);//G_DRV_84:change_layer? 415 | //-- terrain mesh? -- 416 | for(lolo.i = 0; lolo.i < D_00E2C420; lolo.i ++) { 417 | C_0066E641(D_00E2BBD8[lolo.i], lolo.local_1);//dx_spr:render 418 | } 419 | //-- 3d objects? -- 420 | C_00660E95(0, lolo.local_1);//G_DRV_84:change_layer? 421 | C_0074C6B0(lolo.local_1);//render 3d objects? 422 | //------------- 423 | //-- LAYER 1 -- 424 | //------------- 425 | C_00660E95(1, lolo.local_1);//G_DRV_84:change_layer? 426 | //-- snow -- 427 | C_0066E641(D_00E2C3F4[1], lolo.local_1);//dx_spr:render 428 | C_0066E641(D_00E2C3F4[2], lolo.local_1);//dx_spr:render 429 | //-- shadows? -- 430 | C_0066E641(D_00E2C400, lolo.local_1);//dx_spr:render 431 | //-- dialog? -- 432 | if(D_00E3610C) { 433 | C_006F19F3(0);//set dialog y offset? 434 | C_006EBF2C(D_00CFF5B8, 1, C_0074C9A5() == 0); 435 | C_006ECA68(); 436 | D_00E3610C = 0; 437 | g_drv_viewport(D_00E2C424, D_00E2C428, D_00DE68F8, D_00DE67E8, lolo.local_1); 438 | } 439 | } 440 | 441 | //render 3d objects? 442 | void C_0074C6B0(struct t_aa0 *bp08) { 443 | struct { 444 | int i;//local_2 445 | int dwCount;//local_1 446 | }lolo; 447 | 448 | if(C_0074C969() == 0)//wm:get "isRendering"? 449 | return; 450 | //-- main chara -- 451 | if(D_00E2C430[0].f_24) 452 | C_006840DA(D_00E2C430[0].dwAnimFrame, D_00E2C430[0].f_3c[D_00E2C430[0].wAnim], &(D_00E2C430[0].f_44), D_00E2C430[0].f_40, bp08);//anm:.. 453 | //-- -- 454 | lolo.dwCount = C_00759EE0();//wmfile:get 3d models count[world]? 455 | for(lolo.i = 0; lolo.i < lolo.dwCount; lolo.i ++) { 456 | if(D_00E2C808[lolo.i].f_24) { 457 | if(D_00E2C808[lolo.i].dwIsTransparent) 458 | C_00660E95(1, bp08);//G_DRV_84:change_layer? 459 | C_006840DA(D_00E2C808[lolo.i].dwAnimFrame, D_00E2C808[lolo.i].f_3c[D_00E2C808[lolo.i].wAnim], &(D_00E2C808[lolo.i].f_44), D_00E2C808[lolo.i].f_40, bp08);//anm:.. 460 | if(D_00E2C808[lolo.i].dwIsTransparent) 461 | C_00660E95(0, bp08);//G_DRV_84:change_layer? 462 | } 463 | }//end for 464 | } 465 | 466 | int C_0074C98D(void);//get "allowsFrameSkip"? 467 | 468 | //world.tempo? 469 | //(credits, battle, world, field, swirl, menu, condor, submarine and chocobo tempo are very close) 470 | void C_0074C7E4(struct t_aa0 *bp08) { 471 | //#pragma pack(1) 472 | struct { 473 | LARGE_INTEGER local_4; 474 | double local_2; 475 | }lolo; 476 | //#pragma pack() 477 | 478 | lolo.local_2 = 0; 479 | TS_getCPUTimeStamp(&D_00DE6910); 480 | TS_diff(&D_00DE6910, &D_00DE67F0, &lolo.local_4); 481 | lolo.local_2 = TS_toDouble(&lolo.local_4) - 358484.5; 482 | if(!D_00DE69EC) { 483 | if(lolo.local_2 <= D_00DE6938) { 484 | while(lolo.local_2 < D_00DE6938) { 485 | TS_getCPUTimeStamp(&D_00DE6910); 486 | TS_diff(&D_00DE6910, &D_00DE67F0, &lolo.local_4); 487 | lolo.local_2 = TS_toDouble(&lolo.local_4); 488 | }//end while 489 | D_00DE69EC = 0; 490 | D_00DE69F0 = 0; 491 | } else { 492 | if(lolo.local_2 <= D_00DE6908) { 493 | D_00DE69EC = 0; 494 | } else { 495 | D_00DE69F0 = lolo.local_2 - D_00DE6908; 496 | if(C_0074C98D())//get "allowsFrameSkip"? 497 | D_00DE69EC = 1; 498 | else 499 | D_00DE69EC = 0; 500 | } 501 | } 502 | } else { 503 | while(lolo.local_2 < D_00DE6908 - D_00DE69F0) { 504 | TS_getCPUTimeStamp(&D_00DE6910); 505 | TS_diff(&D_00DE6910, &D_00DE67F0, &lolo.local_4); 506 | lolo.local_2 = TS_toDouble(&lolo.local_4); 507 | }//end while 508 | D_00DE69EC = 0; 509 | D_00DE69F0 = 0; 510 | } 511 | } 512 | 513 | //wm:get "isRendering"? 514 | int C_0074C969() { 515 | return D_0096994C; 516 | } 517 | 518 | //wm:set "isRendering"? 519 | void C_0074C973(int bp08) { 520 | D_0096994C = bp08; 521 | } 522 | 523 | //wm:set "allowsFrameSkip"? 524 | void C_0074C980(int bp08) { 525 | D_00969950 = bp08; 526 | } 527 | 528 | //get "allowsFrameSkip"? 529 | int C_0074C98D() { 530 | return D_00969950; 531 | } 532 | -------------------------------------------------------------------------------- /NEWFF7/C_00766B70.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | //WORLD MAP -- 7 | 8 | #include "ff7.h" 9 | #include "wm_data.h" 10 | #include "field_data.h" 11 | #include "menu_data.h" 12 | #include "loadmenu.h" 13 | //////////////////////////////////////// 14 | int D_00E3A87C;//counter to next encounter test 15 | int D_00E3A880;//flag countdown[for battle]? 16 | int D_00E3A884;//last/next module id[0:field,1:combat,2:ending/world]? 17 | int D_00E3A888;//encounter probability counter 18 | int D_00E3A88C;//encounter id 19 | int D_00E3A890;//inhibits random encounter? 20 | int D_00E3A894;//last/next field id? 21 | //////////////////////////////////////// 22 | void __00766B70() { 23 | int i; 24 | 25 | for(i = 0; i < 0x400; i ++) 26 | D_00DBFD38.f_0ba4[i] = 0; 27 | } 28 | 29 | int C_00766B9F() { 30 | return /*local_1*/(D_00DC08DC < 1000)?0: 31 | /*local_2*/(D_00DC08DC < 1580)? 32 | 1 + ((D_00DC0956 & 1) | ((D_00DC08DC >= 1620) << 1))://1~4 33 | 5 + ((D_00DC08DC >= 1620) | (((D_00DC0C62 & 0x10)?1:0) << 1))//5~8 34 | ; 35 | } 36 | 37 | //wm:progress between 1000 and 1200? 38 | int C_00766C33() { 39 | return (D_00DC08DC >= 1000 && D_00DC08DC < 1200); 40 | } 41 | 42 | //wm:get saved map id? 43 | int C_00766C6E() { 44 | return D_00DC0CDA; 45 | } 46 | 47 | void C_007671CB(void); 48 | void C_00767218(unsigned char *, unsigned char *, int);//update characters list? 49 | 50 | void C_00766C7A(int *pForDispatcher/*bp08*/, int *forField/*bp0c*/, int bp10) { 51 | struct { 52 | struct VECTOR local_7; 53 | int i;//local_3 54 | int local_2; 55 | int dwChecksum;//local_1 56 | }lolo; 57 | 58 | //-- some checksum? -- 59 | lolo.dwChecksum = 0; 60 | for(lolo.i = 0x380; lolo.i < 0x400; lolo.i ++) 61 | lolo.dwChecksum += D_00DBFD38.f_0ba4[lolo.i]; 62 | if(lolo.dwChecksum & 0xff) 63 | C_0074C9A0(2);//:some error management? 64 | //-- -- 65 | D_00E3A884 = /*lolo.local_8*/pForDispatcher?*pForDispatcher:0; 66 | D_00E3A894 = /*lolo.local_9*/forField?*forField:0; 67 | lolo.local_2 = (D_00DC0CD4 >> 12) & 3; 68 | C_0074D3D1((lolo.local_2 >= 0 && lolo.local_2 < 3)?lolo.local_2:0);//wm:set view mode? 69 | if((D_00E3A884 == 0 && D_00E3A894 == 0) || D_00E3A884 == 1 || D_00E3A884 == 2) 70 | C_0074D2B9(D_00DC0CD4 & 0xfff); 71 | C_0076831F((D_00DC0CD4 >> 14) & 3);//wm:set map/radar state 72 | C_00767218(D_00DC09E5, D_00DBFD38.f_04f8, 0);//update characters list? 73 | C_00753A01(D_00DBFD38.dwPlayTime);//wm:randomize 74 | C_00758D17(D_00DC0CD0);//wm:set bridges info word? 75 | C_00750466(D_00DC0C92);//wm:set bridge move counter? 76 | C_00760FB0(&D_00DC0C94); 77 | if(bp10) { 78 | D_00DC08FA &= ~0x300; 79 | //goto 00766EC2 80 | } else { 81 | C_00758AC4(D_00DC0CD7);//wm:set snowpole indice? 82 | if(D_00E3A884 == 1) {//else 00766E9A 83 | for(lolo.i = 0; lolo.i < 3; lolo.i ++) { 84 | if(D_00DC0CC4[lolo.i]) { 85 | C_007610B3();//wm:alloc new model 86 | C_0076197B(WM_MODELID_21 + lolo.i); 87 | lolo.local_7.vx = D_00DC0CC4[lolo.i] & 0xffff; 88 | lolo.local_7.vy = 0; 89 | lolo.local_7.vz = (D_00DC0CC4[lolo.i] >> 0x10) & 0xffff; 90 | C_007621EF(&lolo.local_7); 91 | } 92 | }//end for 93 | } else { 94 | for(lolo.i = 0; lolo.i < 3; lolo.i ++) 95 | D_00DC0CC4[lolo.i] = 0; 96 | } 97 | } 98 | C_007671CB(); 99 | } 100 | 101 | void C_00766ECB() { 102 | struct { 103 | struct VECTOR local_6; 104 | int i;//local_2 105 | int dwChecksum;//local_1 106 | }lolo; 107 | 108 | if(C_0074D28E() == 0 && C_0074D330() != 3) 109 | C_0074D2B9(0); 110 | D_00DC0CD4 = 111 | (C_0074D298() & 0x0fff) | 112 | ((C_0074D28E() << 12) & 0x3000) |//wm:get view mode? 113 | ((C_00768343() << 14) & 0xc000)//wm:get map/radar state 114 | ; 115 | D_00DC0CD9 = C_00761735();//wm:get model type(2)? 116 | if(D_00DC0CD9 == WM_MODELID_03 && C_0076192A(C_00766526())) 117 | D_00DC0CD9 = WM_MAX_MODELID; 118 | C_0076609E(); 119 | D_00DC0CDA = C_0074D330();//wm:get current map id? 120 | D_00DC0CD0 = C_00758D76();//wm:get bridges info word? 121 | D_00DC0C92 = C_0075045C();//wm:get bridge move counter? 122 | if(D_00DC0CDA == 3) {//else 00766FF2 123 | D_00DC0CD7 = C_00758D0B();//wm:get snowpole indice? 124 | for(lolo.i = 0; lolo.i < 3; lolo.i ++) { 125 | if(C_00762047(WM_MODELID_21 + lolo.i)) {//wm:set current model 126 | C_00762763(&lolo.local_6);//wm:get model pos(1)? 127 | D_00DC0CC4[lolo.i] = (lolo.local_6.vx & 0xffff) | (lolo.local_6.vz << 0x10); 128 | } else { 129 | D_00DC0CC4[lolo.i] = 0; 130 | } 131 | } 132 | } 133 | //-- set some checksum? -- 134 | lolo.dwChecksum = 0; 135 | for(lolo.i = 0x380; lolo.i < 0x3ff; lolo.i ++) 136 | lolo.dwChecksum += D_00DBFD38.f_0ba4[lolo.i]; 137 | D_00DC0CDB = -lolo.dwChecksum; 138 | //-- -- 139 | } 140 | 141 | void C_00767039(int *pForDispatcher/*bp08*/, int *pForField/*bp0c*/, int *pForBattle/*bp10*/) { 142 | if(pForDispatcher)//0:field,1:battle,2:ending[unused]? 143 | *pForDispatcher = D_00E3A884; 144 | if(pForField)//for field? 145 | *pForField = D_00E3A894; 146 | if(pForBattle)//for battle? 147 | *pForBattle = D_00E3A88C | ((D_00E3A880 != 0) << 29); 148 | D_00DC08FA |= 0x300; 149 | C_00766ECB(); 150 | } 151 | 152 | void C_00767097() { 153 | if(D_00DC0CD9 >= WM_MODELID_03) { 154 | if(D_00DC0CD9 < WM_MAX_MODELID) { 155 | C_00762047(D_00DC0CD9);//wm:set current model 156 | C_00766574();//wm:"O" button near a vehicle? 157 | } else { 158 | C_00762047(WM_MODELID_19);//wm:set current model 159 | C_00766574();//wm:"O" button near a vehicle? 160 | C_00762047(WM_MODELID_03);//wm:set current model 161 | C_00766574();//wm:"O" button near a vehicle? 162 | } 163 | C_0074D4C0(C_00761EB6()); 164 | } 165 | } 166 | 167 | //wm:field infos related? 168 | void C_007670F9(int bp08) { 169 | struct t_wm_FieldTblEntry *local_1; 170 | 171 | D_00E3A884 = 0;//to field 172 | D_00E3A894 = bp08; 173 | local_1 = &(D_00E37D30[(((bp08 >> 8) * 2 - 2) & 0x1fe) | (bp08 & 1)]); 174 | D_00CC0D88.wEventParam = local_1->f_06;//field id 175 | D_00CC0D88.f_04 = local_1->f_00;//field x 176 | D_00CC0D88.f_06 = local_1->f_02;//field y 177 | D_00CC0D88.f_22 = local_1->f_04;//triangle id 178 | D_00CC0D88.f_24 = local_1->f_08;//angle/direction 179 | } 180 | 181 | void C_0076717C(int dwEncounterId/*bp08*/) { 182 | if(dwEncounterId & BIT(30)) 183 | C_007670F9(0x2100);//wm:field infos related? 184 | D_00E3A884 = 1;//to battle 185 | D_00E3A88C = dwEncounterId; 186 | } 187 | 188 | //wm:set countdown? 189 | void C_007671AD(int bp08) { 190 | D_00DBFD38.dwTimer = bp08; 191 | D_00E3A880 = 1; 192 | D_00DC093B = 1; 193 | } 194 | 195 | void C_007671CB() { 196 | D_00E3A880 = 0; 197 | D_00DC093B = 0; 198 | } 199 | 200 | void C_007671E1() { 201 | D_00E3A884 = 2;//to ending? 202 | D_00E3A894 = 0; 203 | D_00E3A88C = 0; 204 | } 205 | 206 | //wm:get last module id? 207 | int C_00767204() { 208 | return D_00E3A884; 209 | } 210 | 211 | //wm:get last field id? 212 | int C_0076720E() { 213 | return D_00E3A894; 214 | } 215 | 216 | //update characters list? 217 | void C_00767218(unsigned char *bp08, unsigned char *bp0c, int bp10) { 218 | struct { 219 | int dwCharMask_old;//local_5 220 | int dwCharMask_new;//local_4 221 | unsigned local_3; 222 | unsigned i;//local_2 223 | unsigned dwDiff;//local_1 224 | }lolo; 225 | 226 | lolo.dwCharMask_old = (1 << bp08[0]) | (1 << bp08[1]) | (1 << bp08[2]); 227 | lolo.dwCharMask_new = (1 << bp0c[0]) | (1 << bp0c[1]) | (1 << bp0c[2]); 228 | //-- -- 229 | if(bp10) 230 | C_00766255(lolo.dwCharMask_old, lolo.dwCharMask_new);//wm:update characters list for script? 231 | //-- charas who left -- 232 | lolo.dwDiff = lolo.dwCharMask_old & ~lolo.dwCharMask_new; 233 | for(lolo.i = 0; lolo.i < 3; lolo.i ++) { 234 | if(lolo.dwDiff & (1 << bp08[lolo.i])) 235 | bp08[lolo.i] = 0xff; 236 | }//end for 237 | //-- new charas -- 238 | lolo.dwDiff = ~lolo.dwCharMask_old & lolo.dwCharMask_new; 239 | for(lolo.i = lolo.local_3 = 0; lolo.dwDiff; lolo.i ++, lolo.dwDiff >>= 1) { 240 | if(lolo.dwDiff & 1) { 241 | while(lolo.local_3 < 3 && bp08[lolo.local_3] != 0xff) 242 | lolo.local_3 ++; 243 | if(lolo.local_3 >= 3) 244 | break; 245 | bp08[lolo.local_3] = lolo.i; 246 | lolo.local_3 ++; 247 | } 248 | }//end for 249 | } 250 | 251 | //wm:player's model id[cloud|tifa|cid] 252 | int C_0076736E() { 253 | return 254 | /*local_3*/(D_00DC09E5[0] == 0 || D_00DC09E5[1] == 0 || D_00DC09E5[2] == 0)?0: 255 | /*local_2*/(D_00DC09E5[0] == 2 || D_00DC09E5[1] == 2 || D_00DC09E5[2] == 2)?1: 256 | /*local_1*/(D_00DC09E5[0] == 8 || D_00DC09E5[1] == 8 || D_00DC09E5[2] == 8)?2: 257 | 0 258 | ; 259 | } 260 | 261 | void C_0076741C() { 262 | C_00767218(D_00DC09E5, D_00DBFD38.f_04f8, C_0074D330() != 2);//update characters list? 263 | if(C_0074D330() != 2) 264 | (C_00766560()?C_00766553:C_00762102)(C_0076736E()); 265 | } 266 | 267 | //wm:save location name? 268 | void C_00767473(int bp08) { 269 | struct { 270 | int local_2; 271 | unsigned char *local_1; 272 | }lolo; 273 | 274 | lolo.local_1 = C_0074D915(bp08);//wm:get string from "mes" 275 | lolo.local_2 = 0x368; 276 | while(lolo.local_2 < 0x380 && (D_00DBFD38.f_0ba4[lolo.local_2 ++] = *(lolo.local_1 ++)) != 0xff); 277 | } 278 | 279 | void C_007674D2(int bp08) { 280 | D_00DC0CD8 = bp08; 281 | } 282 | 283 | int C_007674DF() { 284 | return D_00DC0CD8; 285 | } 286 | 287 | int C_007674EB() { 288 | return (D_00DB958A & 8)?1:0; 289 | } 290 | 291 | void C_00767501() { 292 | D_00E3A888 = 0; 293 | C_00767515(); 294 | } 295 | 296 | void C_00767515() { 297 | D_00E3A87C = -140; 298 | } 299 | 300 | void C_00767524() { 301 | D_00E3A87C = -30; 302 | } 303 | 304 | //wm:set random inhibits encounter? 305 | void C_00767533(int bp08) { 306 | D_00E3A890 = bp08; 307 | } 308 | 309 | int C_00767641(void); 310 | 311 | void C_00767540() { 312 | struct { 313 | struct VECTOR local_11; 314 | int local_7; 315 | int dwEncounterId;//local_6 316 | int dwMapId;//local_5 317 | struct VECTOR local_4; 318 | }lolo; 319 | 320 | lolo.dwMapId = C_0074D330();//wm:get current map id? 321 | if(D_00CC0D88.f_3b == 0 && lolo.dwMapId != 2 && C_00758A6C() == 0 && C_0074D4B6()) {//wm:get enable something? 322 | lolo.local_7 = C_007621C0();//wm:current terrains's script? 323 | C_00762798(&lolo.local_4);//wm:get model pos(2)? 324 | C_00762802(&lolo.local_11);//wm:get model previous pos(2)? 325 | if(C_00761769(BIT(WM_MODELID_06)|BIT(WM_MODELID_02)|BIT(WM_MODELID_01)|BIT(WM_MODELID_00)) && D_00E3A890) {//wm:is current model in list(1)?//else 00767633 326 | if( 327 | lolo.local_7 == 0 && 328 | (lolo.local_4.vx != lolo.local_11.vx || lolo.local_4.vz != lolo.local_11.vz) 329 | ) {//else 00767631 330 | if(D_00E3A87C == 8 || D_00E3A87C == 16) 331 | C_006CC4A8();//"Cat's Bell" effect 332 | //-- -- 333 | if(D_00E3A87C ++ >= 16) {//else 00767631 334 | D_00E3A87C = 0; 335 | lolo.dwEncounterId = C_00767641();//check encounter 336 | if(lolo.dwEncounterId != -1) {//else 00767631 337 | C_00762465(&lolo.local_11); 338 | C_0074D7CD(lolo.dwEncounterId); 339 | } 340 | } 341 | //-- -- 342 | } 343 | } else { 344 | D_00E3A87C = 0; 345 | } 346 | } 347 | } 348 | 349 | char D_0096DEA0[16][4] = { 350 | {0x00,0x09,0x00,0x11}, 351 | {0x00,0x00,0x00,0x11}, 352 | {0x00,0x09,0x01,0x11}, 353 | {0x00,0x14,0x00,0x11}, 354 | {0x00,0x09,0x08,0x11}, 355 | {0x00,0x00,0x19,0x11}, 356 | {0x00,0x09,0x13,0x11}, 357 | {0x00,0x00,0x01,0x11}, 358 | {0x00,0x00,0x01,0x11}, 359 | {0x00,0x09,0x0E,0x11}, 360 | {0x00,0x09,0x19,0x11}, 361 | {0x00,0x0A,0x09,0x11}, 362 | {0x00,0x09,0x19,0x11}, 363 | {0x00,0x00,0x08,0x0B}, 364 | {0x00,0x00,0x08,0x00}, 365 | {0x00,0x00,0x01,0x00} 366 | }; 367 | 368 | unsigned char D_0096DEE0[16] = { 369 | 0x00, 370 | 0x00, 371 | 0x20, 372 | 0x00, 373 | 0x00, 374 | 0x40, 375 | 0x00, 376 | 0x40, 377 | 0xFF, 378 | 0x00, 379 | 0x80, 380 | 0x00, 381 | 0x80, 382 | 0x00, 383 | 0x00, 384 | 0x80 385 | }; 386 | 387 | int C_00767C55(void);//Enemy Lure/Away? 388 | int C_00767C77(void);//Pre-Emptive 389 | int C_00767C9E(void);//Pre-Emptive is level 5 390 | int C_00767CB5(void);//chocobo probability 391 | int C_00767CC1(void);//yuffie flag 392 | int C_00767CD0(void);//returns 1 393 | int C_00767CDA(void);//at least 2 members 394 | int C_00767D2C(void);//returns 1(bis) 395 | 396 | //check encounter 397 | int C_00767641() { 398 | struct { 399 | //local_15 and above for compiler 400 | int local_14; 401 | int local_13; 402 | int local_12; 403 | int dwLVL;//local_11 404 | int dwEncounterId;//local_10 405 | int local_9; 406 | int dwTerrain;//local_8 407 | int dwLocation;//local_7 408 | int local_6; 409 | int local_5; 410 | int local_4; 411 | int local_3; 412 | int local_2; 413 | struct t_wm_local_20_xxx *local_1; 414 | }lolo; 415 | 416 | lolo.local_2 = 0; 417 | lolo.local_6 = 0; 418 | lolo.local_9 = 0; 419 | lolo.dwEncounterId = -1; 420 | lolo.dwTerrain = C_00762136();//wm:get current terrain? 421 | lolo.dwLocation = C_00762162();//wm:get location id? 422 | if(C_00767C55() != 0) {//else 00767C0B 423 | if(lolo.dwLocation < 0) 424 | lolo.dwLocation = 0; 425 | else if(lolo.dwLocation > 15) 426 | lolo.dwLocation = 15; 427 | 428 | if(lolo.dwTerrain == 0x10) 429 | lolo.dwTerrain = 0; 430 | if(lolo.dwTerrain == 0x18) 431 | lolo.dwTerrain = 8; 432 | 433 | if(D_0096DEA0[lolo.dwLocation][0] == lolo.dwTerrain) 434 | lolo.dwTerrain = 0; 435 | else if(D_0096DEA0[lolo.dwLocation][1] == lolo.dwTerrain) 436 | lolo.dwTerrain = 1; 437 | else if(D_0096DEA0[lolo.dwLocation][2] == lolo.dwTerrain) 438 | lolo.dwTerrain = 2; 439 | else if(D_0096DEA0[lolo.dwLocation][3] == lolo.dwTerrain) 440 | lolo.dwTerrain = 3; 441 | else 442 | lolo.dwTerrain = 0; 443 | 444 | lolo.local_1 = &(D_00DE6B78.f_0a0[lolo.dwLocation][lolo.dwTerrain]); 445 | lolo.local_4 = (lolo.local_1->f_00 >> 8) & 0xff; 446 | D_00E3A888 += /*lolo.local_15*/lolo.local_4?(C_00767C55() << 10) / lolo.local_4:0x7fff; 447 | if( 448 | C_00753BE8() < (D_00E3A888 >> 8) &&//wm:random? 449 | (lolo.local_1->f_00 & 1) 450 | ) {//else 00767C0B 451 | if( 452 | C_00753BE8() < D_0096DEE0[lolo.dwLocation] &&//wm:random? 453 | (C_00762136() == 1 || C_00762136() == 0x19) &&//wm:get current terrain? 454 | C_00767CC1()//yuffie flag 455 | ) {//else 00767853 456 | lolo.dwLVL = C_006CB8D6(0); 457 | for( 458 | lolo.local_12 = 0; 459 | lolo.local_12 < 8 && lolo.dwLVL > D_00DE6B78.f_000[lolo.local_12][0]; 460 | lolo.local_12 ++ 461 | ); 462 | if(lolo.local_12 >= 8) 463 | lolo.local_12 = 7; 464 | lolo.dwEncounterId = (D_00DE6B78.f_000[lolo.local_12][1] & 0x3ff) + (C_00762136() == 0x19); 465 | lolo.local_9 = 1; 466 | //goto 00767C0B 467 | } else { 468 | D_00E3A888 = 0; 469 | if( 470 | C_00762191() &&//wm:is chocobo location? 471 | C_00767CB5() &&//chocobo probability 472 | C_00761769(BIT(WM_MODELID_02)|BIT(WM_MODELID_01)|BIT(WM_MODELID_00))//wm:is current model in list(1)? 473 | ) { 474 | lolo.local_3 = (C_00753BE8() << 12) / C_00767CB5(); 475 | lolo.local_5 = lolo.local_1->f_16; 476 | if(lolo.local_5 > lolo.local_3) { 477 | lolo.dwEncounterId = lolo.local_1->f_16 & 0x3ff; 478 | } else if((lolo.local_5 += lolo.local_1->f_18) > lolo.local_3) { 479 | lolo.dwEncounterId = lolo.local_1->f_18 & 0x3ff; 480 | } else if((lolo.local_5 += lolo.local_1->f_1a) > lolo.local_3) { 481 | lolo.dwEncounterId = lolo.local_1->f_1a & 0x3ff; 482 | } else if((lolo.local_5 += lolo.local_1->f_1c) > lolo.local_3) { 483 | lolo.dwEncounterId = lolo.local_1->f_1c & 0x3ff; 484 | } 485 | for(lolo.local_13 = 0; lolo.local_13 < 0x20 && D_00DE6B78.f_020[lolo.local_13][0] != lolo.dwEncounterId; lolo.local_13 ++); 486 | if(lolo.local_13 < 0x20) 487 | C_007674D2(D_00DE6B78.f_020[lolo.local_13][1]); 488 | lolo.local_6 = lolo.dwEncounterId != -1; 489 | } 490 | lolo.local_2 = C_00753BE8() < C_00767C77();//Pre-Emptive 491 | if(lolo.local_2 == 0) {//else 00767AC3 492 | //-- -- 493 | if(C_00767CD0() && lolo.dwEncounterId < 0) {//else 00767A38 494 | lolo.local_3 = C_00753BE8() << (C_00767C9E() + 8);//Pre-Emptive is level 5 495 | lolo.local_5 = lolo.local_1->f_0e; 496 | if(lolo.local_5 > lolo.local_3) { 497 | lolo.dwEncounterId = lolo.local_1->f_0e & 0x3ff; 498 | } else { 499 | lolo.local_5 += lolo.local_1->f_10; 500 | if(lolo.local_5 > lolo.local_3) { 501 | lolo.dwEncounterId = lolo.local_1->f_10 & 0x3ff; 502 | } 503 | } 504 | } 505 | //-- -- 506 | if(C_00767CDA() && lolo.dwEncounterId < 0) {//else 00767A78 507 | lolo.local_3 = C_00753BE8() << 8; 508 | lolo.local_5 = lolo.local_1->f_12; 509 | if(lolo.local_5 > lolo.local_3) { 510 | lolo.dwEncounterId = lolo.local_1->f_12 & 0x3ff; 511 | } 512 | } 513 | //-- -- 514 | if(C_00767D2C() && lolo.dwEncounterId < 0) {//else 00767AC3 515 | lolo.local_3 = C_00753BE8() << (C_00767C9E() + 8);//Pre-Emptive is level 5 516 | lolo.local_5 = lolo.local_1->f_14; 517 | if(lolo.local_5 > lolo.local_3) { 518 | lolo.dwEncounterId = lolo.local_1->f_14 & 0x3ff; 519 | } 520 | } 521 | //-- -- 522 | } 523 | if(lolo.dwEncounterId < 0) {//else 00767C0B 524 | lolo.local_14 = 0; 525 | do { 526 | lolo.local_3 = C_00753BE8() << 8; 527 | lolo.local_5 = lolo.local_1->f_02; 528 | if(lolo.local_5 > lolo.local_3) { 529 | lolo.dwEncounterId = lolo.local_1->f_02 & 0x3ff; 530 | } else if((lolo.local_5 += lolo.local_1->f_04) > lolo.local_3) { 531 | lolo.dwEncounterId = lolo.local_1->f_04 & 0x3ff; 532 | } else if((lolo.local_5 += lolo.local_1->f_06) > lolo.local_3) { 533 | lolo.dwEncounterId = lolo.local_1->f_06 & 0x3ff; 534 | } else if((lolo.local_5 += lolo.local_1->f_08) > lolo.local_3) { 535 | lolo.dwEncounterId = lolo.local_1->f_08 & 0x3ff; 536 | } else if((lolo.local_5 += lolo.local_1->f_0a) > lolo.local_3) { 537 | lolo.dwEncounterId = lolo.local_1->f_0a & 0x3ff; 538 | } else if((lolo.local_5 += lolo.local_1->f_0c) > lolo.local_3) { 539 | lolo.dwEncounterId = lolo.local_1->f_0c & 0x3ff; 540 | } 541 | } while(lolo.local_14 ++ < 1 && lolo.dwEncounterId == D_00DC0C90); 542 | } 543 | } 544 | } 545 | } 546 | //-- has encounter -- 547 | if(lolo.dwEncounterId != -1) { 548 | D_00DC0C90 = lolo.dwEncounterId; 549 | C_0075E5B3(1);//wm:set music related flag on/off 550 | C_0075E5C0(lolo.local_6?5:4);//wm:play song 551 | } 552 | //-- -- 553 | 554 | return lolo.dwEncounterId | (lolo.local_2 << 0x1f) | (lolo.local_9 << 0x1e); 555 | } 556 | 557 | //Enemy Lure/Away? 558 | int C_00767C55() { 559 | return D_00DBCAD9 * ((D_00DBCAD9 > 0x10) + 1); 560 | } 561 | 562 | //Pre-Emptive 563 | int C_00767C77() { 564 | int local_1 = D_00DBCADB & 0x7f; 565 | 566 | return local_1 * ((local_1 > 0x10) + 1); 567 | } 568 | 569 | //Pre-Emptive is level 5 570 | int C_00767C9E() { 571 | return (D_00DBCADB & 0x80) != 0; 572 | } 573 | 574 | //chocobo probability 575 | int C_00767CB5() { 576 | return D_00DBCADA; 577 | } 578 | 579 | //yuffie flag 580 | int C_00767CC1() { 581 | return D_00DC0A61 & 1; 582 | } 583 | 584 | //returns 1 585 | int C_00767CD0() { 586 | return 1; 587 | } 588 | 589 | //at least 2 members 590 | int C_00767CDA() { 591 | struct { 592 | int i;//local_2 593 | int dwCount;//local_1 594 | }lolo; 595 | 596 | lolo.dwCount = 0; 597 | for(lolo.i = 0; lolo.i < 3; lolo.i ++) 598 | lolo.dwCount += D_00DBFD38.f_04f8[lolo.i] != 0xff; 599 | 600 | return lolo.dwCount > 1; 601 | } 602 | 603 | //returns 1(bis) 604 | int C_00767D2C() { 605 | return 1; 606 | } 607 | -------------------------------------------------------------------------------- /NEWFF7/menu_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #ifndef __MENU_DATA_H__ 7 | #define __MENU_DATA_H__ 8 | 9 | struct t_input_config {//size 0x38? 10 | /*00*/int dwX,dwY; 11 | /*08*/int dwPageWidth,dwPageHeight; 12 | /*10*/int dwReserved1; 13 | /*14*/int dwPage; 14 | /*18*/int dwWidth,dwHeight; 15 | /*20*/int dwReserved2; 16 | /*24*/int dwCounter; 17 | /*28*/int dwHAttr; 18 | /*2c*/int dwVAttr; 19 | /*30*/int dwTransition; 20 | /*34*/int dwAllowsPgDnPgUp; 21 | }; 22 | 23 | struct t_menu_rect {//size 8 24 | /*00*/short wX; 25 | /*02*/short wY; 26 | /*04*/short f_04; 27 | /*06*/short f_06; 28 | }; 29 | 30 | //00DC20A0/size 0x1500=3*0x700? 31 | struct t_menu_battle_700 {//size 0x700 = 0x20 * 0x38 32 | /*000*/struct t_input_config f_000;//menu[1]?//00DC20A0 33 | /*038*/struct t_input_config f_038;//menu[5]?//00DC20D8 34 | /*070*/struct t_input_config f_070;//menu[6]?//00DC2110 35 | /*0A8*/struct t_input_config f_0a8;//menu[7]?//00DC2148 36 | /*0E0*/struct t_input_config f_0e0;//menu[4]?//00DC2180//int _00DC2184; int _00DC2194; 37 | /*118*/struct t_input_config f_118;//menu[0x18]?//00DC21B8 38 | /*150*/struct t_input_config f_150;//menu[0x14]?//00DC21F0 39 | /*188*/struct t_input_config f_188;//menu[0x1c]?//00DC2228 40 | /*1c0*/struct t_input_config f_1c0;//menu[9]?//00DC2260 41 | /*1f8*/char __pad[0x4d0];//0x4d0 = 0x16 * 0x38 42 | /*6c8*/struct t_input_config f_6c8;//menu[0x13]?//00DC2768 43 | }; 44 | 45 | struct t_menu_shop_local___ {//size 0x24? 46 | /*00*/unsigned char f_00; 47 | /*01*/unsigned char f_01; 48 | /*02*/char __02[2]; 49 | /*04*/int f_04; 50 | /*08*/char __08[2]; 51 | /*0a*/short f_0a[8]; 52 | /*1a*/unsigned char f_1a[5][2]; 53 | }; 54 | 55 | struct t_menu_scroller_0e {//size 0xe 56 | /*00*/short f_00; 57 | /*02*/short f_02; 58 | /*04*/short f_04; 59 | //struct t_menu_rect f_06;? 60 | /*06*/short f_06,f_08,f_0a,f_0c;//wX,wY,wWidth,wHeight 61 | }; 62 | 63 | struct t_menu_small_gauge_14 {//size 0x14 64 | /*00*/short wX,wY; 65 | /*04*/short wWidth,wHeight; 66 | /*08*/short wVal,wMax; 67 | /*0c*/short f_0c; 68 | /*0e*/short wExVal; 69 | /*10*/tBGRA f_10; 70 | }; 71 | 72 | //kernel.bin|section 0 73 | struct t_battle_local_08_IIII {//size 8 74 | /*00*/unsigned char f_00; 75 | /*01*/unsigned char bTargetFlags; 76 | /*02*/char f_02; 77 | /*03*/char f_03; 78 | /*04*/unsigned short f_04; 79 | /*06*/unsigned short f_06; 80 | }; 81 | 82 | //kernel.bin|section 1 83 | //kernel.bin|section 4[items] 84 | struct t_menu_temp_1c {//size 0x1c 85 | /*00*/unsigned char f_00;//00DB9690 86 | /*01*/unsigned char f_01;//00DB9691 87 | /*02*/unsigned char f_02;//00DB9692 88 | /*03*/char __03[1];//00DB9693 89 | /*04*/unsigned short wMPCost;//00DB9694 90 | /*06*/short wSoundId;//00DB9696 91 | /*08*/unsigned short f_08[2];//00DB9698 92 | /*0c*/unsigned char bTargetFlags;//00DB969C 93 | /*0d*/unsigned char bEffectId;//index in D_008FE5E8[]?//00DB969D 94 | /*0e*/unsigned char f_0e;//00DB969E 95 | /*0f*/unsigned char f_0f;//00DB969F 96 | /*10*/unsigned char f_10;//00DB96A0 97 | /*11*/unsigned char f_11;//00DB96A1 98 | /*12*/unsigned char f_12;//00DB96A2 99 | /*13*/unsigned char f_13;//00DB96A3 100 | /*14*/int f_14;//00DB96A4 101 | /*18*/unsigned short f_18;//00DB96A8 102 | /*1a*/unsigned short f_1a;//00DB96AA 103 | }; 104 | 105 | //kernel.bin|section 5[weapons] 106 | struct t_menu_temp_2c {//size 0x2c 107 | /*00*/unsigned char bTargetFlags;//00DBE730 108 | /*01*/unsigned char f_01;//00DBE731 109 | /*02*/unsigned char f_02;//00DBE732 110 | /*03*/char __03[1];//00DBE733 111 | /*04*/unsigned char f_04;//00DBE734 112 | /*05*/unsigned char f_05;//00DBE735 113 | /*06*/unsigned char f_06;//00DBE736 114 | /*07*/unsigned char f_07;//00DBE737 115 | /*08*/unsigned char f_08;//00DBE738 116 | /*09*/unsigned char f_09;//00DBE739 117 | /*0a*/char __0a[1];//00DBE73A 118 | /*0b*/unsigned char f_0b;//00DBE73B 119 | /*0c*/unsigned short f_0c;//00DBE73C 120 | /*0e*/unsigned short f_0e;//00DBE73E 121 | /*10*/unsigned short f_10;//00DBE740 122 | /*12*/char __12[2];//00DBE742 123 | /*14*/unsigned char f_14[4];//00DBE744 124 | /*18*/unsigned char f_18[4];//00DBE748 125 | /*1c*/unsigned char f_1c[8];//00DBE74C 126 | /*24*/unsigned char abSoundId[3];//00DBE754 127 | /*27*/unsigned char f_27;//00DBE757 128 | /*28*/unsigned short f_28;//00DBE758 129 | /*2a*/unsigned short f_2a;//00DBE75A 130 | }; 131 | 132 | //kernel.bin|section 6[armors] 133 | struct t_menu_temp_24 {//size 0x24 134 | /*00*/char __00[1];//00DBCCE0 135 | /*01*/unsigned char f_01;//00DBCCE1 136 | /*02*/unsigned char f_02;//00DBCCE2 137 | /*03*/unsigned char f_03;//00DBCCE3 138 | /*04*/unsigned char f_04;//00DBCCE4 139 | /*05*/unsigned char f_05;//00DBCCE5 140 | /*06*/unsigned char f_06;//00DBCCE6 141 | /*07*/char __07[2];//00DBCCE7 142 | /*09*/unsigned char f_09[8];//00DBCCE9 143 | /*11*/unsigned char f_11;//00DBCCF1 144 | /*12*/unsigned short f_12;//00DBCCF2 145 | /*14*/unsigned short f_14;//00DBCCF4 146 | /*16*/char __16[2];//00DBCCF6 147 | /*18*/unsigned char f_18[4];//00DBCCF8 148 | /*1c*/unsigned char f_1c[4];//00DBCCFC 149 | /*20*/unsigned short f_20;//00DBCD00 150 | /*22*/char __22[2];//00DBCD02 151 | }; 152 | 153 | //kernel.bin|section 7[accessories] 154 | struct t_menu_temp_10 {//size 0x10 155 | /*00*/unsigned char f_00[2];//00DBCAE0 156 | /*01*/unsigned char f_02[2];//00DBCAE2 157 | /*04*/unsigned char f_04;//00DBCAE4 158 | /*05*/unsigned char f_05;//00DBCAE5 159 | /*06*/unsigned short f_06;//00DBCAE6 160 | /*08*/int f_08;//00DBCAE8 161 | /*0c*/unsigned short f_0c;//00DBCAEC 162 | /*0e*/unsigned short f_0e;//00DBCAEE 163 | }; 164 | 165 | //kernel.bin|section 8[materia] 166 | struct t_menu_temp_14 {//size 0x14 167 | /*00*/unsigned short f_00[4];//00DBDF60 168 | /*08*/unsigned char f_08;//00DBDF68 169 | /*09*/unsigned char f_09;//00DBDF69 170 | /*0a*/unsigned char f_0a;//00DBDF6A 171 | /*0b*/unsigned char f_0b;//00DBDF6B 172 | /*0c*/unsigned char f_0c;//00DBDF6C 173 | /*0d*/unsigned char f_0d;//00DBDF6D 174 | /*0e*/unsigned char f_0e[6];//00DBDF6E 175 | }; 176 | 177 | struct t_menu_something_size_08 {//size 8 178 | /*00*/unsigned char f_00; 179 | /*01*/unsigned char bMPCost; 180 | /*02*/unsigned char f_02; 181 | /*03*/unsigned char f_03; 182 | /*04*/unsigned char f_04; 183 | /*05*/unsigned char bTargetFlags; 184 | /*06*/unsigned char bStatus; 185 | /*07*/unsigned char f_07; 186 | }; 187 | 188 | struct t_battle_menuEntryInfo {//size 6 189 | /*00*/unsigned char bType;//009AEAB8 190 | /*01*/unsigned char f_01;//009AEAB9 191 | /*02*/unsigned char bTargetFlags;//009AEABA 192 | /*03*/unsigned char bMenuFlags;//009AEABB 193 | /*04*/unsigned char f_04;//009AEABC 194 | /*05*/unsigned char f_05;//009AEABD 195 | }; 196 | 197 | //limit related? 198 | struct t_menu_something_size_5c {//size 0x5c 199 | /*00*/unsigned char f_00[3];//00DBA544 200 | /*03*/unsigned char abTargetFlags[3];//00DBA547 201 | /*06*/unsigned char f_06;//00DBA54A 202 | /*07*/unsigned char f_07;//00DBA54B 203 | /*08*/struct t_menu_temp_1c f_08[3];//00DBA54C 204 | }; 205 | 206 | struct t_menu_temp_440 {//size 0x440 207 | /*000*/unsigned char f_000;//00DBA498 208 | /*001*/unsigned char f_001;//00DBA499 209 | /*002*/unsigned char f_002;//00DBA49A 210 | /*003*/unsigned char f_003;//00DBA49B 211 | /*004*/unsigned char f_004;//00DBA49C 212 | /*005*/unsigned char f_005;//00DBA49D 213 | /*006*/unsigned char f_006;//00DBA49E 214 | /*007*/unsigned char f_007;//00DBA49F 215 | /*008*/unsigned short f_008;//00DBA4A0 216 | /*00a*/unsigned short f_00a;//00DBA4A2 217 | /*00c*/unsigned short f_00c;//00DBA4A4 218 | /*00e*/unsigned short f_00e;//00DBA4A6 219 | /*010*/short wHP,wHPMax;//00DBA4A8,00DBA4AA 220 | /*014*/short wMP,wMPMax;//00DBA4AC,00DBA4AE 221 | /*018*/unsigned short wWait;//00DBA4B0 222 | /*01a*/unsigned short wLimit;//00DBA4B2 223 | /*01c*/unsigned short f_01c;//BARRIER(physical)//00DBA4B4 224 | /*01e*/unsigned short f_01e;//BARRIER(magical)//00DBA4B6 225 | /*020*/unsigned char f_020;//00DBA4B8 226 | /*021*/unsigned char bMenuColumnCount;//00DBA4B9 227 | /*022*/unsigned char f_022;//00DBA4BA 228 | /*023*/unsigned char f_023;//00DBA4BB 229 | /*024*/struct t_inner_03 {//size 3 230 | /*00*/unsigned char f_00; 231 | /*01*/unsigned char f_01; 232 | /*02*/unsigned char f_02; 233 | }f_024[8];//00DBA4BC 234 | /*03c*/unsigned short f_03c;//00DBA4D4 235 | /*03e*/unsigned short f_03e;//00DBA4D6 236 | /*040*/unsigned short f_040;//00DBA4D8 237 | /*042*/unsigned short f_042;//00DBA4DA 238 | /*044*/int f_044;//00DBA4DC 239 | /*048*/int f_048;//00DBA4E0 240 | /*04c*/struct t_battle_menuEntryInfo f_04c[0x10];//00DBA4E4 241 | /*108*/struct t_menu_something_size_5c f_0ac;//00DBA544 242 | /*2c8*/struct t_menu_something_size_08 f_108[0x38];//00DBA5A0 243 | /*348*/struct t_menu_something_size_08 f_2c8[0x10];//00DBA760 244 | /*348*/struct t_menu_something_size_08 f_348[0x18];//00DBA7E0 245 | /*408*/struct t_menu_temp_2c f_408;//00DBA8A0 246 | /*434*/char __434[3];//00DBA8CC 247 | /*437*/unsigned char f_437;//"Enemy Away"//00DBA8CF 248 | /*438*/char __438[4];//00DBA8D0 249 | /*43c*/unsigned char f_43c;//"Gil Plus"//00DBA8D4 250 | /*43d*/unsigned char f_43d;//"Enemy Lure"//00DBA8D5 251 | /*43e*/unsigned char f_43e;//"Chocobo Lure"//00DBA8D6 252 | /*43f*/unsigned char f_43f;//"Pre-Emptive"//00DBA8D7 253 | }; 254 | //////////////////////////////////////// 255 | extern int D_00919928[]; 256 | extern unsigned char D_0091A8C0[][0x14]; 257 | extern tBGRA D_0091AB08[]; 258 | extern tBGRA D_0091EFC8[/*4*/]; 259 | extern unsigned char D_0091EFD8[/*4*3*/]; 260 | extern unsigned char D_00920540[][0xa]; 261 | extern unsigned char D_00925760[][0x24]; 262 | extern unsigned char D_00925C98[][0x30]; 263 | extern unsigned char D_00926118[][0xc]; 264 | 265 | extern int D_00DB9580; 266 | extern unsigned short D_00DB9588,D_00DB958A; 267 | extern unsigned char *D_00DB958C;//pointer to font info(size)? 268 | //extern char D_00DB9590[];//size:0x100 = 0x20 * 8 269 | extern struct t_battle_local_08_IIII D_00DB9590[/*0x20*/]; 270 | extern struct t_menu_temp_1c D_00DB9690[];//size:0xe00 = 0x80 * sizeof(struct t_menu_temp_1c) 271 | extern struct t_menu_temp_440 D_00DBA498[]; 272 | extern unsigned char D_00DBCAD8,D_00DBCAD9,D_00DBCADA,D_00DBCADB; 273 | extern struct t_menu_temp_10 D_00DBCAE0[];//size:0x200 = 0x20 * sizeof(struct t_menu_temp_10) 274 | extern struct t_menu_temp_24 D_00DBCCE0[];//size:0x480 = 0x20 * sizeof(struct t_menu_temp_24) 275 | extern struct t_menu_temp_1c D_00DBD160[];//size:0xe00 = 0x80 * sizeof(struct t_menu_temp_1c) 276 | extern struct t_menu_temp_14 D_00DBDF60[];//size:0x780 277 | extern struct t_menu_temp_2c D_00DBE730[];//size:0x1600 = 0x80 * sizeof(struct t_menu_temp_2c) 278 | extern int D_00DBFD30;//combat related? 279 | 280 | //extern unsigned char D_00DC0E6C;//pause related? 281 | 282 | extern struct t_dx_sfx_e0 *D_00DC0FC8; 283 | extern struct t_dx_sfx_e0 *D_00DC0FCC; 284 | extern struct t_dx_sfx_e0 *D_00DC0FD0; 285 | extern struct t_dx_sfx_e0 *D_00DC0FD4; 286 | extern struct t_dx_sfx_e0 *D_00DC0FD8; 287 | extern struct t_dx_sfx_e0 *D_00DC0FDC; 288 | extern struct t_dx_sfx_e0 *D_00DC0FE0; 289 | extern struct t_dx_sfx_e0 *D_00DC0FE4; 290 | extern struct t_dx_sfx_e0 *D_00DC0FE8; 291 | extern struct t_dx_sfx_e0 *D_00DC0FEC; 292 | extern struct t_dx_sfx_e0 *D_00DC0FF0; 293 | extern struct t_dx_sfx_e0 *D_00DC0FF4; 294 | extern struct t_dx_sfx_e0 *D_00DC0FF8; 295 | extern struct t_dx_sfx_e0 *D_00DC0FFC; 296 | extern struct t_dx_sfx_e0 *D_00DC1000; 297 | extern struct t_dx_sfx_e0 *D_00DC1004; 298 | extern struct t_dx_sfx_e0 *D_00DC1008; 299 | extern struct t_dx_sfx_e0 *D_00DC100C; 300 | extern struct t_dx_sfx_e0 *D_00DC1010; 301 | extern struct t_dx_sfx_e0 *D_00DC1014[3]; 302 | extern struct t_dx_sfx_e0 *D_00DC1020[9]; 303 | extern struct t_dx_sfx_e0 *D_00DC1044; 304 | extern struct t_dx_sfx_e0 *D_00DC1048; 305 | extern struct t_dx_sfx_e0 *D_00DC104C; 306 | extern struct t_dx_sfx_e0 *D_00DC1050; 307 | extern struct t_dx_sfx_e0 *D_00DC1054; 308 | extern int D_00DC1058; 309 | extern int D_00DC105C,D_00DC1060,D_00DC1064,D_00DC1068;//viewport x0,y0,w,h 310 | extern int D_00DC106C; 311 | extern int D_00DC1070; 312 | 313 | extern int D_00DC1108; 314 | extern int D_00DC1124; 315 | extern unsigned short D_00DC1130; 316 | extern unsigned short D_00DC1134; 317 | 318 | extern int D_00DC1210; 319 | extern int D_00DC1288; 320 | extern int D_00DC1290; 321 | 322 | extern int D_00DC12DC;//some ratio flag? 323 | 324 | extern int D_00DC12E4; 325 | extern int D_00DC12F4; 326 | 327 | extern int D_00DC130C;//"is low-res" flag 328 | 329 | extern struct t_dx_sfx_e0 *D_00DC16D8; 330 | extern struct t_dx_sfx_e0 *D_00DC16DC; 331 | extern struct t_dx_sfx_e0 *D_00DC16E0; 332 | extern struct t_dx_sfx_e0 *D_00DC16E4; 333 | 334 | extern struct t_dx_sfx_e0 *D_00DC1788; 335 | 336 | extern struct t_dx_sfx_e0 *D_00DC1990; 337 | extern struct t_dx_sfx_e0 *D_00DC1994; 338 | extern struct t_dx_sfx_e0 *D_00DC1998; 339 | 340 | extern short D_00DC1F3C; 341 | 342 | //extern int D_00DC3D10; 343 | extern unsigned char D_00DC3D14; 344 | extern void *D_00DC38C4; 345 | extern unsigned char D_00DC3BA0; 346 | //////////////////////////////////////// 347 | extern void C_006C09C0(const char *);//(seems to be used only in case of CD ejection)[menu related]? 348 | extern void C_006C0E2D(struct t_aa0 *);//on "Exit box"?[callback] 349 | extern void C_006C0F60(void);//init menu system? 350 | extern void C_006C12B1(void);//clean menu system? 351 | extern void C_006C1468(int); 352 | extern void C_006C1ABA(int, int); 353 | extern void C_006C1B93(int); 354 | extern void C_006C1CE7(void);//load "buster" resource 355 | extern void C_006C1D8D(void); 356 | extern void C_006C1F1B(void); 357 | extern void C_006C4946(int, int);//set SFX&MIDI volumes? 358 | extern int C_006C4970(void); 359 | extern void C_006C497C(const unsigned char *, int); 360 | extern void C_006C49CB(int, int, int); 361 | extern void C_006C49FD(void); 362 | extern void C_006C4D6D(void); 363 | extern int C_006C50DD(int);//get restrictions mask? 364 | extern int C_006C5154(int, int);//get Att/Def equip bonuses? 365 | extern void C_006C545B(int); 366 | extern void C_006C5A5A(int, int, int, float);//chara info[phs][HIRES] 367 | extern void C_006C5E7E(int, int, int, float);//chara info[phs][LORES] 368 | extern void C_006C62A2(int, int, int, float);//chara info[top menu][HIRES] 369 | extern void C_006C66C8(int, int, int, float);//chara info[top menu][LORES] 370 | extern void C_006C6AEE(int);//menu:go to submenu 371 | extern unsigned char *C_006C6B06(int); 372 | extern unsigned char *C_006C6B1B(int); 373 | extern void C_006C96BC(void); 374 | extern int C_006C9808(void); 375 | extern void C_006C9812(int, int); 376 | extern void C_006C98A6(int);//render menu header?[HIRES] 377 | extern void C_006C9D07(int);//render menu header?[LORES] 378 | extern int C_006CA1EF(int);//time:make hours[XX:__:__] 379 | extern int C_006CA23F(int);//time:make minutes[__:XX:__] 380 | extern void C_006CA32D(void); 381 | extern int C_006CB8D6(int); 382 | extern unsigned char *C_006CB8E2(int);//get armor material slots? 383 | extern unsigned char *C_006CB928(int);//get weapon material slots? 384 | extern struct t_menu_temp_24 *C_006CB96E(int); 385 | extern struct t_menu_temp_440 *C_006CB98E(int); 386 | extern unsigned char *C_006CB9B8(int);//get character's name? 387 | extern void C_006CB9D2(int, int);//decrease HP? 388 | extern void C_006CBA6A(int, int);//increase HP? 389 | extern void C_006CBB27(int, int);//decrease MP? 390 | extern void C_006CBBBF(int, int);//increase MP? 391 | extern int C_006CBC7C(int);//decrease GILs? 392 | extern void C_006CBCB9(int);//increase GILs? 393 | extern int C_006CBCE9(void);//get GILs? 394 | extern int C_006CBCF3(int); 395 | extern void C_006CBD1E(void); 396 | extern void C_006CBD82(void); 397 | extern void C_006CBD8C(void); 398 | extern void C_006CBD96(int); 399 | extern void C_006CBDCE(void); 400 | extern void C_006CBE33(void); 401 | extern void C_006CBE3D(int); 402 | extern void C_006CBE4E(int); 403 | extern unsigned short C_006CBE5F(unsigned short); 404 | extern unsigned short C_006CBF57(unsigned short); 405 | extern void C_006CBFFA(unsigned short);//add item to inventory? 406 | extern int C_006CC0EA(int); 407 | extern void C_006CC173(void); 408 | extern void C_006CC17F(int); 409 | extern int C_006CC2ED(int, int);// 410 | extern int C_006CC2F4(int, int);// 411 | extern void C_006CC2FB(void); 412 | extern void C_006CC3E8(void);//compute party's weapon/armor/accessory/materia/... related stuff? 413 | extern void C_006CC446(void); 414 | extern void C_006CC4A8(void);//"Cat's Bell" effect 415 | extern void C_006CC5A2(void); 416 | //====---- MENU SYSTEM ----==== 417 | extern void C_006CC623(struct t_aa0 *);//MENU SYSTEM[UPDATE][callback] 418 | extern void C_006CC619(int, int, int, struct t_aa0 *);//MENU SYSTEM[ONMOUSE][callback] 419 | extern void C_006CC61E(int, int, int, struct t_aa0 *);//MENU SYSTEM[ONKEY][callback] 420 | extern void C_006CD3B0(struct t_aa0 *);//MENU SYSTEM[BEGIN][callback] 421 | extern void C_006CD5B3(struct t_aa0 *);//MENU SYSTEM[END][callback] 422 | //====---- ----==== 423 | extern void C_006CD64E(unsigned char, float);//draw alpha quad? 424 | extern void C_006CD808(int); 425 | extern void C_006CD815(void);//"end scene"(chara portrait?) 426 | extern int C_006CDBF2(void);//menu.get_flag_1(render on?) 427 | extern void C_006CDBFC(int);//menu.set_flag_1(render on?) 428 | extern void C_006CDC09(int);//menu.set_flag_2 429 | extern int C_006CDC16(void);//menu.get_flag_2 430 | extern void C_006CDE2B(void); 431 | extern void C_006CDE72(int *);//configure key menu? 432 | extern void C_006CE64B(void); 433 | extern void C_006CE665(void);//save "ff7input.cfg"? 434 | extern void C_006CE6EC(void);//load "ff7input.cfg"? 435 | extern void C_006CE79B(void); 436 | extern void C_006CE811(char); 437 | extern int C_006CE81E(void);//callback:... 438 | extern void C_006CE85E(void);//menu.callback:check pause? 439 | extern void C_006CE8B3(void);//english.callback:refresh? 440 | extern void C_006CEA08(int, int, int, char, char, char);// 441 | extern void C_006CEA17(void);//english.callback:init? 442 | extern void C_006CEDAD(void);//english.callback:clean? 443 | extern void C_006CEE84(void);//english.callback:render? 444 | extern void C_006CF2AA(struct t_dx_sfx_e0 **, struct t_rsd_74 *, struct t_dx_sfx_70 *);//english.callback:... 445 | extern void C_006D0ADE(int);//start something? 446 | extern void C_006D0AE3(int);//end something? 447 | extern short C_006D0AE8(short);//get battle menu state? 448 | extern void C_006D0AF9(short, short, short);//open battle menu? 449 | extern void C_006D0BF1(void); 450 | extern void C_006D1B88(void *);//render target pointing hand?[HIRES] 451 | extern void C_006D1C00(void *);//render target pointing hand?[LORES] 452 | extern void C_006D1C78(void);// 453 | extern void C_006D71FA(short, short);//set "in battle script display" parameters 454 | extern void C_006D721C(short);//set "in battle target's attack display" parameters 455 | extern void C_006D7245(void *);//battle text & info render? 456 | extern void C_006D83C8(void);//render lower part?[HIRES] 457 | extern void C_006D8550(void);//render lower part?[LORES] 458 | extern void C_006DB0EE(void);//...:refresh? 459 | extern void C_006DB0BC(void);//reset all menus? 460 | extern void C_006DB716(void); 461 | extern void C_006DB7AB(void *, int, int, int); 462 | extern void C_006DC89A(void); 463 | extern int C_006DC910(void); 464 | extern void C_006E434E(void); 465 | extern void C_006E6C30(tBGRA *, unsigned char, unsigned char, unsigned char); 466 | extern void C_006E6C5B(int, int, int, float);//draw portrait[HIRES] 467 | extern void C_006E6E66(int, int, int, int, int, float);//draw portrait[for preview][HIRES] 468 | extern void C_006E7B6A(int, int, int, int);//[HIRES] 469 | extern void C_006E7BA1(struct t_menu_rect *, int, int, int, int);//menu:set rect 470 | extern void C_006E7BD1(struct t_menu_rect *, int, int);//menu:rect += {x,y} 471 | extern void C_006E7BF8(struct t_menu_rect *, struct t_menu_rect *);//menu:copy rect 472 | extern void C_006E7C33(void);//menu:backup color option? 473 | extern void C_006E7C69(void);//menu:restore color option? 474 | extern void C_006E7C9F(tBGRA *);//menu:set color option? 475 | extern void C_006E7CD9(struct t_menu_rect *, int, float); 476 | extern void C_006E7D20(struct t_menu_rect *, float);//window frame[HIRES] 477 | extern void C_006EB3B8(int, int, float);//draw "hand"[HIRES] 478 | extern int C_006EBF2C(struct t_script_DialogInfo_30 *, short, int); 479 | extern void C_006ECA68(void); 480 | extern void C_006ECECE(int, int, int, float);//draw portrait[LORES] 481 | extern void C_006ED0EC(int, int, int, int, int, float);//draw portrait[for preview][LORES] 482 | extern void C_006EDD6F(int, int, int, int);//[LORES] 483 | extern void C_006EDE1D(struct t_menu_rect *, float);//window frame[LORES] 484 | extern void C_006F0D7D(int, int, float);//draw "hand"[LORES] 485 | extern void C_006F193E(int);//menu:set graphic mode[world map] 486 | extern void C_006F19F3(int);//set dialog y offset? 487 | extern void C_006F1A00(struct t_menu_rect *, float);//window frame(3)[HIRES] 488 | extern void C_006F3492(struct t_menu_rect *, float);//window frame(3)[LORES] 489 | extern void C_006F4CFF(int, unsigned char);//menu alpha related? 490 | extern void C_006F4D15(int);//menu alpha related[on/off]? 491 | extern void C_006F4D30(struct t_input_config *, int, int, int, int, int, int, int, int, int, int, int, int, int, int);//input_config:init 492 | extern void C_006F4DB2(struct t_input_config *);//input_config:refresh? 493 | extern int C_006F5317(unsigned, unsigned);//test input mask[pressed]+mouse for menu? 494 | extern int C_006F535C(unsigned, unsigned);//test input mask[trigger]+mouse for menu? 495 | extern unsigned C_006F53A1(unsigned);//test input mask[trigger] for menu? 496 | extern int C_006F53B2(unsigned, unsigned);//test input mask[w repeat]+mouse for menu? 497 | extern int C_006F53F1(unsigned);//test input mask[w repeat] for menu? 498 | extern int C_006F5402(unsigned, unsigned, int);//test input mask for menu? 499 | extern void C_006F5490(int);//menu:set string parameter[unused] 500 | //-- HIRES -- 501 | extern int C_006F54A2(const unsigned char *);//ff7 string length[HIRES] 502 | extern int C_006F564E(int, int, int, unsigned short, float);//menu.putchar[HIRES] 503 | extern void C_006F5B03(int, int, const unsigned char *, unsigned char, float);//menu.drawString[HIRES] 504 | extern void C_006F5C0C(int, int, unsigned char, unsigned char, float);//menu.putchar(2)[HIRES] 505 | extern void C_006F62F7(int, int, unsigned char *, unsigned char, float);//menu.drawString(2)[HIRES] 506 | extern void C_006F638C(struct t_menu_small_gauge_14 *, float);//render small gauge[HIRES] 507 | extern void C_006F69AA(int, int, int, int, unsigned);//[HIRES] 508 | extern void C_006F6A0C(struct t_menu_rect *, float);//"slot" rectangle?[HIRES] 509 | extern void C_006F713B(struct t_menu_rect *, float);//"cursor" rectangle?[HIRES] 510 | extern void C_006F7270(struct t_menu_scroller_0e *, float);//"scroller"?[HIRES] 511 | extern void C_006F7346(int, int, int, int, unsigned, float);//draw gauge[HIRES] 512 | extern void C_006F7607(int, int, int, int);//round shade box[HIRES] 513 | extern void C_006F7BFB(int, int, int, int, int, int, int, int, int, float);//2D sprite(for battle)[HIRES] 514 | extern void C_006F9739(int, int, int, char, char, float);//display integer[HIRES] 515 | extern void C_006F9C44(int, int, int, unsigned char, unsigned char, float);//display integer(0-padded)[HIRES] 516 | extern void C_006FA12F(int, int, int, int);//"end scene"(1)[HIRES] 517 | extern void C_006FA347(void);//"end scene"(2)[HIRES] 518 | //-- LORES -- 519 | extern int C_006FA55D(const unsigned char *);//ff7 string length[LORES] 520 | extern int C_006FA706(int, int, int, unsigned short, float);//menu.putchar[LORES] 521 | extern void C_006FAB2F(int, int, const unsigned char *, unsigned char, float);//menu.drawString[LORES] 522 | extern void C_006FAC38(int, int, unsigned char, unsigned char, float);//menu.putchar(2)[LORES] 523 | extern void C_006FB35C(int, int, unsigned char *, unsigned char, float);//menu.drawString(2)[LORES] 524 | extern void C_006FB3FF(struct t_menu_small_gauge_14 *, float);//render small gauge[LORES] 525 | extern void C_006FBA29(int, int, int, int, unsigned);//[LORES] 526 | extern void C_006FBAA4(struct t_menu_rect *, float);//"slot" rectangle?[LORES] 527 | extern void C_006FC218(struct t_menu_rect *, float);//"cursor" rectangle?[LORES] 528 | extern void C_006FC38C(struct t_menu_scroller_0e *, float);//"scroller"?[LORES] 529 | extern void C_006FC462(int, int, int, int, unsigned, float);//draw gauge[LORES] 530 | extern void C_006FC73A(int, int, int, int);//round shade box[LORES] 531 | extern void C_006FCD45(int, int, int, int, int, int, int, int, int, float);//2D sprite(for battle)[LORES] 532 | extern void C_006FCF5B(int, int, int, char, char, float);//display integer[LORES] 533 | extern void C_006FD48B(int, int, int, unsigned char, unsigned char, float);//display integer(0-padded)[LORES] 534 | extern void C_006FD9A3(int, int, int, int);//"end scene"(1)[LORES] 535 | extern void C_006FDAEB(void);//"end scene"(2)[LORES] 536 | //-- -- 537 | extern void C_006FDC26(struct t_aa0 *);//(for chocobo)? 538 | extern void C_006FE265(unsigned char *, const char *);//C string to ff7 string? 539 | extern void C_006FE4BE(void); 540 | extern void C_006FE53A(int); 541 | extern void C_006FE8DA(int); 542 | extern int C_006FFFAA(void); 543 | extern void C_00701EE4(int); 544 | extern void C_00702085(void); 545 | extern void C_00703517(void); 546 | extern void C_00717961(void); 547 | extern void C_00717D32(void); 548 | extern void C_00717EB6(int); 549 | extern void C_00717FD6(int); 550 | extern void C_0071810C(int); 551 | extern void C_0071820F(void *bp08); 552 | extern int C_00718226(void); 553 | extern int C_007186B9(void);//menu_input:get "current mask" 554 | extern void C_007186C8(void); 555 | extern void C_00719C08(int); 556 | extern void C_0071FF95(int); 557 | extern void C_007201E2(struct t_input_config *); 558 | extern int C_00720746(int, int); 559 | extern void C_00720775(int, int, int);//[HIRES] 560 | extern void C_00720AEE(int, int, int);//[LORES] 561 | extern void C_00720F2F(void);//free savefile? 562 | extern int C_00720F5F(int);//savefile:get some flag? 563 | extern int C_00720F6E(int);//"save" related(2)? 564 | extern int C_007210BC(int, int);//load savefile? 565 | extern void C_0072237A(int); 566 | extern int C_00722393(void);//loadmenu:refresh 567 | extern void C_0072288F(void); 568 | extern void C_00722913(void); 569 | extern unsigned short C_00722ACA(unsigned short, unsigned char *); 570 | extern int C_00722BB0(int);//fade in/out? 571 | //////////////////////////////////////// 572 | 573 | #endif 574 | -------------------------------------------------------------------------------- /NEWFF7/wm_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | Final Fantasy VII 3 | (c) 1997 Square 4 | decompiled by ergonomy_joe in 2018 5 | */ 6 | #ifndef __WM_DATA_H__ 7 | #define __WM_DATA_H__ 8 | 9 | #include "psx.h" 10 | //////////////////////////////////////// 11 | #define inline_abs(a) ((a)>0?(a):-(a)) 12 | #define BIT_ISSET_2(mask,bit) (((mask)>>((bit)&0x1f))&1) 13 | //////////////////////////////////////// 14 | #define WM_MODELID_00 0 15 | #define WM_MODELID_01 1 16 | #define WM_MODELID_02 2 17 | //"highwind" 18 | #define WM_MODELID_03 3 19 | //chocobo? 20 | #define WM_MODELID_04 4 21 | #define WM_MODELID_05 5 22 | //"buggy" 23 | #define WM_MODELID_06 6 24 | 25 | #define WM_MODELID_08 8 26 | //"tail"(propeller for highwind) 27 | #define WM_MODELID_09 9 28 | #define WM_MODELID_10 10 29 | #define WM_MODELID_11 11 30 | 31 | //submarine 32 | #define WM_MODELID_13 13 33 | 34 | #define WM_MODELID_17 17 35 | #define WM_MODELID_18 18 36 | //chocobo? 37 | #define WM_MODELID_19 19 38 | 39 | //"snowpole"? 40 | #define WM_MODELID_21 21 41 | #define WM_MODELID_22 22 42 | #define WM_MODELID_23 23 43 | 44 | #define WM_MODELID_25 25 45 | #define WM_MODELID_26 26 46 | //wrecked red submarine 47 | #define WM_MODELID_27 27 48 | #define WM_MODELID_28 28 49 | #define WM_MODELID_29 29 50 | #define WM_MODELID_30 30 51 | 52 | #define WM_MODELID_38 38 53 | 54 | //chocobo? 55 | #define WM_MODELID_41 41 56 | //chocobo? 57 | #define WM_MODELID_42 42 58 | 59 | #define WM_MAX_MODELID 43 60 | //////////////////////////////////////// 61 | struct t_wm_local_sRect {//size 8 62 | short wX,wY,wWidth,wHeight; 63 | }; 64 | 65 | struct t_wm_file_TexUVCoord {//size 4 66 | unsigned short u,v;//tex coords u,v 67 | }; 68 | 69 | //aka "struct t_wm_local_0c_xxx" 70 | struct t_wm_FieldTblEntry {//size 0xc 71 | /*00*/short f_00; 72 | /*02*/short f_02; 73 | /*04*/short f_04; 74 | /*06*/short f_06; 75 | /*08*/unsigned char f_08; 76 | /*09*/char __09[3]; 77 | }; 78 | 79 | struct t_wm_local_20_xxx {//size 0x20 80 | /*00*/unsigned short f_00; 81 | /*02*/unsigned short f_02; 82 | /*04*/unsigned short f_04; 83 | /*06*/unsigned short f_06; 84 | /*08*/unsigned short f_08; 85 | /*0a*/unsigned short f_0a; 86 | /*0c*/unsigned short f_0c; 87 | /*0e*/unsigned short f_0e; 88 | /*10*/unsigned short f_10; 89 | /*12*/unsigned short f_12; 90 | /*14*/unsigned short f_14; 91 | /*16*/unsigned short f_16; 92 | /*18*/unsigned short f_18; 93 | /*1a*/unsigned short f_1a; 94 | /*1c*/unsigned short f_1c; 95 | /*1e*/char __1e[2]; 96 | }; 97 | 98 | struct t_wm_8a0 {//"enc_w.bin"//size 0x8a0 99 | /*000*/unsigned short f_000[8][2];//D_00DE6B78 100 | /*020*/unsigned short f_020[0x20][2];//D_00DE6B98 101 | /*0a0*/struct t_wm_local_20_xxx f_0a0[0x10][4];//D_00DE6C18 102 | }; 103 | 104 | struct t_wm_b8 {//size 0xb8 105 | /*00*/char __00[1];//__00E2C430//__00E2C808 106 | /*01*/char f_01;//__00E2C431//__00E2C809 107 | /*02*/char __02[2];//__00E2C432//__00E2C80A 108 | /*04*/unsigned char bAnimationCount;//__00E2C434//__00E2C80C 109 | /*05*/char __05[0x1b];//__00E2C435//__00E2C80D 110 | /*20*/unsigned short wAnim;//__00E2C450//__00E2C828 111 | /*22*/char __22[2];//__00E2C452//__00E2C82A 112 | /*24*/int f_24;//__00E2C454//__00E2C82C 113 | /*28*/char __28[8];//__00E2C458//__00E2C830 114 | /*30*/int dwAnimFrame;//__00E2C460//__00E2C83800E2C83C 115 | /*34*/int dwIsTransparent;//__00E2C464//__ 116 | /*38*/float f_38;//__00E2C468//__00E2C840 117 | /*3c*/struct t_animationHeader **f_3c;//__00E2C46C//__00E2C844 118 | /*40*/struct tSkeleton *f_40;//__00E2C470//__00E2C848 119 | /*44*/struct t_plytopd_74 f_44;//__00E2C474//__00E2C84C 120 | }; 121 | 122 | struct t_wm_SkyPoly {//size 0x34 123 | /*00*/struct POLY_G4 f_00; 124 | /*24*/unsigned bgra0; 125 | /*28*/unsigned bgra1; 126 | /*2c*/unsigned bgra2; 127 | /*30*/unsigned bgra3; 128 | }; 129 | 130 | struct t_wm_local_08 {//size 8 131 | /*00*/struct t_wm_TerrainTriangle *f_00; 132 | /*04*/short wChunkX,wChunkY; 133 | }; 134 | 135 | /* 136 | f_03: 137 | +---+---+---+ +---+---+---+---+---+ 138 | | script id | | terrain type | 139 | +---+---+---+ +---+---+---+---+---+ 140 | __0a: 141 | +---+---+---+---+---+---+---+---+ 142 | |tx7|tx6|tx5|tx4|tx3|tx2|tx1|tx0| 143 | +---+---+---+---+---+---+---+---+ 144 | f_0b: 145 | +---+ +---+ +---+---+---+---+---+ +---+ 146 | |cho| |flg| | location id | |tx8| 147 | +---+ +---+ +---+---+---+---+---+ +---+ 148 | 149 | cho: is this a chocobo location 150 | flg: seems to be set/reset at runtime 151 | */ 152 | struct t_wm_TerrainTriangle {//size 0xc 153 | /*00*/unsigned char vect0,vect1,vect2; unsigned char f_03; 154 | /*04*/unsigned char u0,v0; unsigned char u1,v1; 155 | /*08*/unsigned char u2,v2; unsigned char __0a,f_0b; 156 | }; 157 | 158 | struct t_wm_TerrainChunkInfo {//size 0x18 159 | /*00*/struct t_wm_TerrainChunkInfo *pNext; 160 | //-- -- 161 | /*04*/struct t_wm_TerrainTriangle *f_04; 162 | /*08*/struct SVECTOR *pVertices; 163 | /*0c*/struct SVECTOR *pNormals; 164 | /*10*/short wChunkX,wChunkY; 165 | /*14*/short wTriangleCount; 166 | /*16*/short wAge; 167 | }; 168 | 169 | struct t_wm_local_30 {//size 0x30 170 | /*00*/struct POLY_FT4 f_00; 171 | /*28*/struct t_dx_sfx_e0 *f_28; 172 | /*2c*/unsigned f_2c;//color related 173 | }; 174 | 175 | struct t_wm_ScriptStackElement {//size 4 176 | /*00*/short wScriptPC; 177 | /*02*/char bMoveCnt; 178 | /*03*/char bPriority; 179 | }; 180 | 181 | struct t_local_unknown_c0 {//size 0xc0 182 | /*00*/struct t_local_unknown_c0 *pNext; 183 | /*04*/struct t_local_unknown_c0 *f_04; 184 | /*08*/struct t_local_unknown_c0 *f_08; 185 | /*0c*/struct VECTOR sPos,sPrevPos; 186 | /*2c*/struct t_wm_ScriptStackElement f_2c[4]; 187 | /*3c*/short f_3c;//direction related 188 | /*3e*/short f_3e; 189 | /*40*/short f_40;//direction related 190 | /*42*/short f_42; 191 | /*44*/short f_44;//y? 192 | /*46*/short wScriptPC;//index in "WM?.EV"/+0x400 193 | /*48*/short f_48; 194 | /*4a*/short wTerrainInfo; 195 | /*4c*/short wDirection; 196 | /*4e*/short f_4e; 197 | /*50*/unsigned char bModelType; 198 | /*51*/unsigned char f_51; 199 | /*52*/unsigned char f_52; 200 | /*53*/unsigned char bAnimFrame; 201 | /*54*/unsigned char bStackDepth; 202 | /*55*/unsigned char bSpeed; 203 | /*56*/unsigned char bMoveCnt; 204 | /*57*/unsigned char bPriority; 205 | /*58*/unsigned char f_58; 206 | /*59*/unsigned char f_59; 207 | /*5a*/char __5a[2]; 208 | /*5c*/char f_5c;//vertical speed(1)? 209 | /*5d*/char f_5d; 210 | /*5e*/char f_5e;//unused stuff? 211 | /*5f*/char f_5f;//vertical speed(2)? 212 | /*60*/struct t_wm_local_08 f_60[6]; 213 | /*90*/struct t_wm_local_30 f_90;//rendering infos for shadow 214 | }; 215 | //////////////////////////////////////// 216 | extern int D_0096B414;//from wmfile? 217 | extern short D_0096B418[]; 218 | extern short D_0096B448[]; 219 | 220 | extern int D_00DFC480; 221 | 222 | extern int D_00E045EC; 223 | extern char D_00E28C48[];//debug string 224 | extern struct fBGRA D_00E28F40[]; 225 | extern tBGRA D_00E2B778[]; 226 | extern struct t_dx_sfx_e0 *D_00E2BBD8[/*0x200*/]; 227 | extern struct t_dx_sfx_e0 *D_00E2C3D8; 228 | extern struct t_dx_sfx_e0 *D_00E2C3DC; 229 | extern struct t_dx_sfx_e0 *D_00E2C3E0; 230 | extern struct t_dx_sfx_e0 *D_00E2C3E4; 231 | extern struct t_dx_sfx_e0 *D_00E2C3E8; 232 | extern struct t_dx_sfx_e0 *D_00E2C3EC; 233 | extern struct t_dx_sfx_e0 *D_00E2C3F0; 234 | extern struct t_dx_sfx_e0 *D_00E2C3F4[/*3*/]; 235 | extern struct t_dx_sfx_e0 *D_00E2C400; 236 | extern struct t_dx_sfx_e0 *D_00E2C404[4]; 237 | extern struct t_dx_sfx_e0 *D_00E2C414; 238 | extern int D_00E2C41C; 239 | extern int D_00E2C420; 240 | extern int D_00E2C424; 241 | extern int D_00E2C428; 242 | extern struct t_wm_b8 D_00E2C430[/*3*/]; 243 | extern struct t_dx_sfx_e0 *D_00E2C658[/*0x6c*/];//check 244 | extern struct t_wm_b8 D_00E2C808[/*0xd*/]; 245 | extern struct t_wm_file_TexUVCoord *D_00E2D168;//check 246 | extern struct VECTOR D_00E2D1E0; 247 | extern struct SVECTOR D_00E2D1F0; 248 | extern struct SVECTOR D_00E2D1F8; 249 | extern short D_00E2D200; 250 | extern struct SVECTOR D_00E2D5D8; 251 | extern unsigned char *D_00E2D5F8; 252 | extern struct POLY_GT3 *D_00E2D5FC;//[2*0xd00] 253 | extern int D_00E3564C; 254 | extern struct t_light_5ac *D_00E360F4;//light system(2) 255 | extern struct t_light_5ac *D_00E360F8;//light system(1) 256 | extern int D_00E3610C; 257 | extern struct t_wm_TerrainTriangle *D_00E36110; 258 | extern int *D_00E36114; 259 | extern unsigned char D_00E36118[/*8 + 0x1000*/];//"mes" 260 | extern short D_00E37120[/*0x200*/];//"atn.tbl" 261 | extern int D_00E37520; 262 | extern int D_00E37524;//[undersea fog]distance threshold? 263 | 264 | extern int D_00E37D28;//[camera occlusion]distance threshold? 265 | extern struct t_wm_FieldTblEntry D_00E37D30[]; 266 | extern struct t_wm_TerrainTriangle *D_00E38330; 267 | extern D3DVECTOR D_00E38338[]; 268 | extern unsigned D_00DE67E8; 269 | extern unsigned D_00DE68F8; 270 | extern void (*D_00DE68FC)(void); 271 | 272 | extern float D_00DE6900; 273 | extern int D_00DE69D8; 274 | extern int D_00DE69DC; 275 | extern int D_00DE69E0; 276 | extern int D_00DE69E4; 277 | extern int D_00DE6A04; 278 | 279 | extern struct t_wm_8a0 D_00DE6B78;//"enc_w.bin" 280 | //////////////////////////////////////// 281 | //-- C_0074BA80.cpp -- 282 | extern void C_0074C179(void);//wm:render_0(surface)(callback) 283 | extern void C_0074C3F0(void);//wm:render_2(undersea)(callback) 284 | extern void C_0074C589(void);//wm:render_3(snowfield)(callback) 285 | extern int C_0074C969(void);//wm:get "isRendering"? 286 | extern void C_0074C973(int);//wm:set "isRendering"? 287 | extern void C_0074C980(int);//wm:set "allowsFrameSkip"? 288 | //-- C_0074C9A0.cpp -- 289 | extern void C_0074C9A0(int);//:some error management? 290 | extern int C_0074C9A5(void);//wm:get backbuffer index[unused]? 291 | extern struct POLY_GT3 *C_0074C9AF(unsigned);//wm:alloc mem for POLY_GT3[unused]? 292 | extern char *C_0074CA00(int, int);//wm:make path(1) 293 | extern void C_0074CBB5(int);//wm:set earthquake effect 294 | extern void *C_0074CBC2(void); 295 | extern int C_0074CC07(struct t_wm_TerrainChunkInfo *, struct SVECTOR *, struct t_wm_local_08 *, short *, struct t_wm_TerrainTriangle **, short *, unsigned char); 296 | extern int C_0074D28E(void);//wm:get view mode? 297 | extern int C_0074D298(void); 298 | extern void C_0074D2A7(int); 299 | extern void C_0074D2B9(int); 300 | extern void C_0074D2D7(int);//wm:set some zoom/rotation mode? 301 | extern int C_0074D30F(void);//wm:get some zoom/rotation mode? 302 | extern int C_0074D319(void);//wm:get camera tilt angle? 303 | extern void C_0074D323(int);//wm:set camera tilt angle? 304 | extern int C_0074D330(void);//wm:get current map id? 305 | extern void C_0074D33A(struct SVECTOR *);//wm:set trans matrix from svector? 306 | extern void C_0074D3A7(void);//wm:set camera transform? 307 | extern short C_0074D3C6(void); 308 | extern void C_0074D3D1(int);//wm:set view mode? 309 | extern void C_0074D438(int, int);//wm:set enable something? 310 | extern int C_0074D4B6(void);//wm:get enable something? 311 | extern void C_0074D4C0(short); 312 | extern int C_0074D4DC(void);//wm:returns true[debug stuff?] 313 | extern int C_0074D4ED(void); 314 | extern void C_0074D4F7(int);//wm:set "highwind" state? 315 | extern int C_0074D504(void);//wm:get "highwind" state? 316 | extern void C_0074D50E(struct t_wm_b8 *, struct SVECTOR *, struct MATRIX *, int); 317 | extern void C_0074D6BB(void);//wm:go to surface 318 | extern void C_0074D731(int);//wm:go to field? 319 | extern void C_0074D74C(int); 320 | extern void C_0074D7CD(int); 321 | extern int C_0074D8CF(void);//wm:get view mod/map|radar state 322 | extern void C_0074D8EF(int);//wm:set view mod/map|radar state 323 | extern unsigned char *C_0074D915(short);//wm:get string from "mes" 324 | extern void C_0074D955(int);//wm:start some fade in/out? 325 | extern void C_0074DA26(int);//wm:set some rotation param 326 | extern void C_0074DA33(int);//wm:set some zoom param(1) 327 | extern void C_0074DA40(int);//wm:set some zoom param(2) 328 | extern void C_0074DB2B(int);//wm:set some zoom/rotation parameter(1)? 329 | extern void C_0074DB38(int);//wm:set some zoom/rotation parameter(2)? 330 | extern void C_0074DB45(int);//wm:set chocobo tint? 331 | extern int C_0074DB8C(int *, int *, int *, int); 332 | //-- C_0074FFC0.cpp -- 333 | extern void C_00750134(struct VECTOR *, struct SVECTOR *, short *, short *);//wm:world to chunk coordinates? 334 | extern void C_00750202(struct VECTOR *);//wm:clamp x,z? 335 | extern void C_0075027C(struct VECTOR *, int);//wm:set some pos? 336 | extern void C_0075042B(struct VECTOR *);//wm:get some pos? 337 | extern int C_0075045C(void);//wm:get bridge move counter? 338 | extern void C_00750466(int);//wm:set bridge move counter? 339 | extern void C_00750473(void);//wm:terrain init/reset stuff? 340 | extern void C_007506B6(void); 341 | extern void C_007506C0(void); 342 | extern void C_00750784(void); 343 | extern void C_0075079D(short, int);//wm:refresh terrain stuff? 344 | extern void C_0075334D(void);//wm:set chocobo farm related flag? 345 | extern int C_0075335C(void);//wm:allow control/move? 346 | extern int C_00753366(short, short);//wm:(for midgar zolom) 347 | extern void C_007533AF(void);//wm:map init/reset? 348 | extern void C_0075378A(int);//wm:some patch for submarine? 349 | extern void C_007537A1(int);//wm:set world map state? 350 | extern void C_007537AE(struct VECTOR *); 351 | //-- C_00753860.cpp -- 352 | extern void C_00753860(void); 353 | extern void C_00753879(void); 354 | extern void C_00753888(void); 355 | extern void C_0075389C(void); 356 | extern int C_007538B0(void); 357 | extern void C_007538BA(void); 358 | extern int C_007538C9(short);//wm:start something(unused)? 359 | extern void C_0075395E(short);//wm:stop something(unused)? 360 | extern void C_00753A01(int);//wm:randomize 361 | extern int C_00753BE8(void);//wm:random? 362 | extern int C_00753C23(struct VECTOR *, struct VECTOR *); 363 | extern void C_00753D00(struct SVECTOR *, short);//wm:SVECTOR z rotation? 364 | extern short C_00753DA9(int, int); 365 | extern short C_00753F2E(struct VECTOR *, struct VECTOR *); 366 | extern void C_00753F53(void); 367 | extern struct t_wm_SkyPoly *C_007540E5(void); 368 | extern void C_00754100(short);//wm:update sky related infos 369 | extern void C_007543D3(void);//wm:init meteor related stuff? 370 | extern void C_007547A6(short);//wm:render clouds(+meteor) 371 | extern void C_00754E10(int);//wm:set render meteor 372 | extern void C_00754E1D(void);//wm:init sky color? 373 | extern void C_00754EBC(int, int);//wm:start color effect zone? 374 | extern void C_00754EEF(int, int);//wm:set color effect zone chunk x,y? 375 | extern void C_00754F72(int, int);//wm:set color effect zone x,y? 376 | extern void C_00754FE2(int, int, int);//wm:set ambient light color? 377 | extern void C_00755013(int);//wm:set color effect zone radius(1)? 378 | extern void C_0075502C(int);//wm:set color effect zone radius(2)? 379 | extern void C_007550A7(struct VECTOR *);//wm:sky color transition? 380 | extern void C_00755045(int, int, int);//wm:set color effect zone rgb(1)? 381 | extern void C_00755076(int, int, int);//wm:set color effect zone rgb(2)? 382 | extern int C_0075542D(struct VECTOR *); 383 | extern short C_0075545F(struct VECTOR *); 384 | extern void C_00755495(void); 385 | extern void C_0075551A(void);//wm:render "extra layers"? 386 | extern void C_00755B70(int, int);//wm:start fade in? 387 | extern void C_00755B97(int, int);//wm:start fade out? 388 | extern int C_00755C2F(void);//wm:is fade in/out over? 389 | extern void C_00755C40(void);//undersea:init "layer" 0? 390 | extern void C_00755CFF(int);//undersea:init "layer" 1~? 391 | extern void C_00755F95(void);//wm:midgar zolom related.init/reset? 392 | extern void C_0075611B(void);//wm:reset Midgar Zolom? 393 | extern int C_007561EC(void);//wm:is in marshlands? 394 | extern void C_007561F6(struct t_wm_TerrainChunkInfo *);//wm:Midgar Zolom related(2) 395 | extern void C_007562FF(void);//wm:refresh Midgar Zolom stuff? 396 | extern void C_00756A95(void); 397 | extern void C_00756B0C(struct t_wm_TerrainChunkInfo *); 398 | extern void C_00756FF9(struct t_wm_TerrainChunkInfo *, struct t_wm_TerrainTriangle *);//wm:chocobo farm related? 399 | extern void C_007570E8(int); 400 | extern void C_007573D9(void);//wm:chocobo related refresh? 401 | extern void C_00758A32(int); 402 | extern int C_00758A3F(void); 403 | extern int C_00758A6C(void); 404 | extern void C_00758AC4(int);//wm:set snowpole indice? 405 | extern int C_00758B12(int, int); 406 | extern int C_00758D0B(void);//wm:get snowpole indice? 407 | extern void C_00758D17(unsigned);//wm:set bridges info word? 408 | extern int C_00758D76(void);//wm:get bridges info word? 409 | extern void C_00758DA5(short, short);//wm:refresh bridge at? 410 | extern void C_007591C2(int *, int *); 411 | extern void C_007591F3(void);//wm:refresh bridge SFX 412 | //-- wmfile.cpp -- 413 | extern int C_007592E0(int);//wmfile:texture is animated? 414 | extern int C_0075931B(const char *, int, void *, int);//wmfile:read file(archive) 415 | extern int C_007593CD(const char *, int, int, void *, int);//wmfile:read file 416 | extern void C_00759A65(int);//wmfile:load 3d models[chara]? 417 | extern int C_00759EE0(void);//wmfile:get 3d models count[world]? 418 | extern void C_00759EEA(void);//wmfile:release 3d models[world]? 419 | extern void C_0075A01D(void);//wmfile:release 3d models[chara]? 420 | extern void C_0075A1C6(int);//wmfile:secure init? 421 | extern void C_0075A921(void);//wmfile:clean textures & models? 422 | //-- wmdefine.cpp -- 423 | extern void C_0075AB50(void);//wmdefine:init? 424 | extern void C_0075ABF3(void);//wmdefine:clean? 425 | //-- C_0075AC80.cpp -- 426 | extern void C_0075AC80(void); 427 | extern void C_0075AD28(struct t_local_unknown_c0 *, int);//wm:terrain, vehicle 2D fx? 428 | extern void C_0075BB25(void); 429 | extern void C_0075BBB3(struct t_local_unknown_c0 *, int);//2danimfx:do anim 430 | extern void C_0075BFE5(int, int, int, int);//2danimfx:start 431 | extern void C_0075C01B(int);//2danimfx:stop 432 | extern void C_0075C02B(void);//2danimfx:refresh 433 | extern void C_0075D482(struct t_wm_local_30 *, struct t_wm_local_sRect *);//wm:set model's texture coords? 434 | extern void C_0075D544(short, short, short, short, struct t_wm_local_30 *, short); 435 | extern void C_0075DEAA(struct t_local_unknown_c0 *);//wm:shadow related? 436 | extern void C_0075E024(struct t_wm_b8 *);//wm: 437 | extern void C_0075E029(LPD3DMATRIX);//wm:init matrix(switch y z axis)? 438 | extern void C_0075E0BA(struct t_wm_b8 *, struct t_local_unknown_c0 *, short, short, struct SVECTOR *); 439 | extern void C_0075E4D6(short, short);//wm:apply tint to model? 440 | extern void C_0075E59A(int);//wm:music init 441 | extern void C_0075E5B3(int);//wm:set music related flag on/off 442 | extern void C_0075E5C0(int);//wm:play song 443 | extern void C_0075E63A(void);//wm:play current song? 444 | extern int C_0075E64D(void);//wm:get current song? 445 | extern void C_0075E657(int);//wm:play SFX? 446 | extern void C_0075E683(void);//wm:stop sfx and music? 447 | extern void C_0075E697(int);//wm:set music volume 448 | extern void C_0075E6A8(int, int);//wm:engine noise params[for buggy]? 449 | extern void C_0075E6BD(void);//wm:reset SFX? 450 | extern void C_0075E6CC(int);//wm:start/stop SFX? 451 | extern void C_0075E720(int);//wm:set song list 452 | //-- C_0075E7A0.cpp -- 453 | extern struct t_light_5ac *C_0075E7A0(int);//wm:create light system(1) 454 | extern struct t_light_5ac *C_0075E9B3(int);//wm:create light system(2) 455 | extern void C_0075EACE(void);//wm:secure clean light(2) 456 | extern void C_0075EAF6(void);//wm:secure clean light(1) 457 | extern void C_0075EB1E(void);//wm:clean lights? 458 | extern void C_0075EB2D(int);//wm:change light params? 459 | extern void C_0075EE10(struct MATRIX *);//wm:set some global light color? 460 | //-- C_0075EE50.cpp -- 461 | extern void C_0075EE50(void *); 462 | extern void C_0075EE86(int); 463 | extern void C_0075EEBB(short, short, short); 464 | extern int C_0075EF01(void); 465 | extern int C_0075EF13(void); 466 | extern void C_0075EF46(void);//wm:manage text event? 467 | extern short C_0075F00E(void); 468 | extern void C_0075F038(short *); 469 | extern void C_0075F06C(int, int); 470 | //-- C_0075F090.cpp -- 471 | extern int C_0075F090(float);//wm:float to int 472 | extern void C_0075F0AD(struct SVECTOR *, int);//wm:send terrain vertices for rendering? 473 | extern void C_0075F263(void);//wm:2d clip terrain vertices? 474 | extern void C_0075F68C(struct t_wm_TerrainTriangle *, struct t_wm_TerrainTriangle *, struct SVECTOR *, struct POLY_GT3 *); 475 | extern int C_0076085F(struct t_wm_TerrainTriangle *, struct SVECTOR *, int *); 476 | extern void C_00760E1D(struct t_wm_TerrainTriangle *, struct t_wm_TerrainTriangle *, int);//wm:adjust terrain triangle u,v? 477 | //-- C_00760FB0.cpp -- 478 | extern void C_00760FB0(void *); 479 | extern struct t_local_unknown_c0 *C_007610B3(void);//wm:alloc new model 480 | extern void C_0076110B(void); 481 | extern int C_00761176(void); 482 | extern void C_007611AE(void); 483 | extern void C_0076142D(void); 484 | extern int C_00761521(void); 485 | extern void C_0076154F(void); 486 | extern void C_007615BA(void); 487 | extern void C_007615D6(void); 488 | extern void C_0076160D(void); 489 | extern void C_00761644(short, short);//wm:chunk unloaded? 490 | extern void C_007616B3(void);//wm:set some info(1)? 491 | extern void C_007616CB(void);//wm:set some info(2)? 492 | extern struct t_wm_local_08 *C_007616E3(void); 493 | extern int C_0076170B(void);//wm:get model type(1)? 494 | extern int C_00761735(void);//wm:current transportation mode? 495 | extern struct t_local_unknown_c0 *C_0076175F(void); 496 | extern int C_00761769(int);//wm:is current model in list(1)? 497 | extern int C_00761805(int, unsigned char);//wm:is model in list? 498 | extern int C_00761844(void);//wm:is current model a chocobo(1)? 499 | extern int C_007618B7(void);//wm:is current model a chocobo(2)? 500 | extern int C_0076192A(unsigned char);//wm:is model a chocobo? 501 | extern void C_0076197B(int); 502 | extern void C_00761B19(short); 503 | extern void C_00761B83(short); 504 | extern void C_00761BAC(short); 505 | extern void C_00761DF5(short); 506 | extern short C_00761EB6(void); 507 | extern short C_00761EEC(void); 508 | extern void C_00761F22(int); 509 | extern int C_00761F44(void); 510 | extern int C_00761F77(void); 511 | extern void C_00761FAA(int); 512 | extern int C_00761FE8(void); 513 | extern int C_0076201E(void); 514 | extern int C_00762047(int);//wm:set current model 515 | extern int C_007620B6(void); 516 | extern void C_00762102(int);//wm:set model type? 517 | extern void C_0076211B(int);//wm:set terrain info? 518 | extern int C_00762136(void);//wm:get current terrain? 519 | extern int C_00762162(void);//wm:get location id? 520 | extern int C_00762191(void);//wm:is chocobo location? 521 | extern int C_007621C0(void);//wm:current terrains's script? 522 | extern void C_007621EF(struct VECTOR *); 523 | extern void C_00762465(struct VECTOR *); 524 | extern void C_0076247D(struct VECTOR *); 525 | extern void C_007624C5(struct VECTOR *); 526 | extern void C_00762702(int); 527 | extern void C_0076271B(int); 528 | extern void C_00762763(struct VECTOR *);//wm:get model pos(1)? 529 | extern void C_00762798(struct VECTOR *);//wm:get model pos(2)? 530 | extern void C_007627CD(struct VECTOR *);//wm:get model previous pos(1)? 531 | extern void C_00762802(struct VECTOR *);//wm:get model previous pos(2)? 532 | extern void C_00762837(void); 533 | extern void C_007628B5(void); 534 | extern void C_00762933(void); 535 | extern void C_00762955(int); 536 | extern struct t_local_unknown_c0 *C_0076296E(void); 537 | extern void C_00762D52(void); 538 | extern void C_00762D74(struct t_wm_TerrainChunkInfo *); 539 | extern void C_00762E87(int, int); 540 | extern void C_00762F75(int, int, int);//wm:set model tilt x,y,z? 541 | extern int C_00762F9A(int, int); 542 | extern void C_0076312D(struct SVECTOR *); 543 | extern void C_0076315C(void); 544 | extern void C_0076323A(void); 545 | extern void C_00763C35(void *); 546 | extern void C_00763D6C(int);//wm:set enable/disable script? 547 | extern void C_00764014(int, int);//wm:start script(1)? 548 | extern void C_007640BC(int);//wm:start script(2)? 549 | extern void C_007641A7(void);//wm:execute scripts? 550 | extern void C_00765F61(void);//wm:refresh script stuff? 551 | extern int C_0076603F(void); 552 | extern void C_0076609E(void); 553 | extern void C_00766255(int, int);//wm:update characters list for script? 554 | extern void C_007663A8(struct VECTOR *); 555 | //-- C_007663E0.cpp -- 556 | extern void C_007663E0(void); 557 | extern void C_00766417(int); 558 | extern void C_007664C2(unsigned char);//wm:some stack.push? 559 | extern unsigned char C_00766526(void);//wm:some stack.peek? 560 | extern void C_00766553(int);//wm:some stack.set element 0? 561 | extern int C_00766560(void);//wm:some stack.is not empty? 562 | extern void C_00766574(void);//wm:"O" button near a vehicle? 563 | extern void C_0076667C(void);//wm:"X" button short trigger? 564 | extern void C_007667A3(void);//wm:start "leave vehicle"? 565 | extern void C_007667B2(int);//wm:manage ride/leave vehicle? 566 | extern int C_00766B53(void);//wm:get "leave vehicle" state? 567 | extern void C_00766B5D(int); 568 | //-- C_00766B70.cpp -- 569 | extern int C_00766B9F(void); 570 | extern int C_00766C33(void); 571 | extern int C_00766C6E(void);//wm:get saved map id? 572 | extern void C_00766C7A(int *, int *, int); 573 | extern void C_00766ECB(void); 574 | extern void C_00767039(int *, int *, int *); 575 | extern void C_00767097(void); 576 | extern void C_007670F9(int);//wm:field infos related? 577 | extern void C_0076717C(int); 578 | extern void C_007671AD(int);//wm:set countdown? 579 | extern void C_007671E1(void); 580 | extern int C_00767204(void);//wm:get last module id? 581 | extern int C_0076720E(void);//wm:get last field id? 582 | extern int C_0076736E(void);//wm:player's model id[cloud|tifa|cid] 583 | extern void C_0076741C(void); 584 | extern void C_00767473(int);//wm:save location name? 585 | extern int C_007674DF(void); 586 | extern int C_007674EB(void); 587 | extern void C_00767501(void); 588 | extern void C_00767515(void); 589 | extern void C_00767524(void); 590 | extern void C_00767533(int);//wm:set random inhibits encounter? 591 | extern void C_00767540(void); 592 | //-- C_00767D40.cpp -- 593 | extern void C_00767D40(void);//wm:reset map/radar 594 | extern void C_00767D68(short);//wm:render map/radar 595 | extern void C_0076831F(short);//wm:set map/radar state 596 | extern short C_00768343(void);//wm:get map/radar state 597 | extern void C_0076834E(void);//wm:restore map/radar state? 598 | //-- C_007688E0.cpp -- 599 | extern void C_007688E0(void); 600 | extern void C_007689F7(void); 601 | extern struct t_wm_b8 *C_00768A37(short); 602 | extern void C_00768BE2(short); 603 | extern void C_00768C3D(void); 604 | extern void C_00768C4C(int);//wm:set "highwind has reactor"? 605 | extern int C_00768C59(void);//wm:highwind has reactor? 606 | //-- C_00768C70.cpp -- 607 | extern void C_00768C7A(void); 608 | extern int C_00768E3D(short); 609 | extern void C_00768EC3(short, short, short); 610 | extern void C_00768F48(short, short, short, short, short); 611 | extern int C_00769050(unsigned char, unsigned char); 612 | extern int C_007693A1(unsigned char, unsigned char, unsigned char, unsigned char, short *); 613 | //////////////////////////////////////// 614 | 615 | #endif 616 | --------------------------------------------------------------------------------