mirror of https://github.com/OpenRCT2/OpenRCT2.git
First pass at 0x00406C96
This commit is contained in:
parent
841f9bd390
commit
cbb617c56f
|
@ -44,7 +44,7 @@ unsigned int gLastKeyPressed;
|
||||||
static void osinterface_create_window();
|
static void osinterface_create_window();
|
||||||
static void osinterface_close_window();
|
static void osinterface_close_window();
|
||||||
static void osinterface_resize(int width, int height);
|
static void osinterface_resize(int width, int height);
|
||||||
|
static void sub_406C96(int actionType);
|
||||||
|
|
||||||
static SDL_Window *_window;
|
static SDL_Window *_window;
|
||||||
static SDL_Surface *_surface;
|
static SDL_Surface *_surface;
|
||||||
|
@ -350,7 +350,7 @@ void osinterface_process_messages()
|
||||||
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
||||||
switch (e.button.button) {
|
switch (e.button.button) {
|
||||||
case SDL_BUTTON_LEFT:
|
case SDL_BUTTON_LEFT:
|
||||||
RCT2_CALLPROC_1(0x00406C96, int, 1);
|
sub_406C96(1); //RCT2_CALLPROC_1(0x00406C96, int, 1);
|
||||||
gCursorState.left = CURSOR_PRESSED;
|
gCursorState.left = CURSOR_PRESSED;
|
||||||
gCursorState.old = 1;
|
gCursorState.old = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -358,7 +358,7 @@ void osinterface_process_messages()
|
||||||
gCursorState.middle = CURSOR_PRESSED;
|
gCursorState.middle = CURSOR_PRESSED;
|
||||||
break;
|
break;
|
||||||
case SDL_BUTTON_RIGHT:
|
case SDL_BUTTON_RIGHT:
|
||||||
RCT2_CALLPROC_1(0x00406C96, int, 3);
|
sub_406C96(3); //RCT2_CALLPROC_1(0x00406C96, int, 3);
|
||||||
gCursorState.right = CURSOR_PRESSED;
|
gCursorState.right = CURSOR_PRESSED;
|
||||||
gCursorState.old = 2;
|
gCursorState.old = 2;
|
||||||
break;
|
break;
|
||||||
|
@ -369,7 +369,7 @@ void osinterface_process_messages()
|
||||||
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
RCT2_GLOBAL(0x0142431C, int) = e.button.y;
|
||||||
switch (e.button.button) {
|
switch (e.button.button) {
|
||||||
case SDL_BUTTON_LEFT:
|
case SDL_BUTTON_LEFT:
|
||||||
RCT2_CALLPROC_1(0x00406C96, int, 2);
|
sub_406C96(2); //RCT2_CALLPROC_1(0x00406C96, int, 2);
|
||||||
gCursorState.left = CURSOR_RELEASED;
|
gCursorState.left = CURSOR_RELEASED;
|
||||||
gCursorState.old = 3;
|
gCursorState.old = 3;
|
||||||
break;
|
break;
|
||||||
|
@ -377,7 +377,7 @@ void osinterface_process_messages()
|
||||||
gCursorState.middle = CURSOR_RELEASED;
|
gCursorState.middle = CURSOR_RELEASED;
|
||||||
break;
|
break;
|
||||||
case SDL_BUTTON_RIGHT:
|
case SDL_BUTTON_RIGHT:
|
||||||
RCT2_CALLPROC_1(0x00406C96, int, 4);
|
sub_406C96(4); //RCT2_CALLPROC_1(0x00406C96, int, 4);
|
||||||
gCursorState.right = CURSOR_RELEASED;
|
gCursorState.right = CURSOR_RELEASED;
|
||||||
gCursorState.old = 4;
|
gCursorState.old = 4;
|
||||||
break;
|
break;
|
||||||
|
@ -596,3 +596,23 @@ char osinterface_get_path_separator()
|
||||||
{
|
{
|
||||||
return '\\';
|
return '\\';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sub_406C96(int actionType)
|
||||||
|
{
|
||||||
|
int eax = RCT2_GLOBAL(0x009E2DE4, uint32);
|
||||||
|
int ecx = eax + 1;
|
||||||
|
ecx &= 0x3F; //Array of 64 point structs, loop around buffer?
|
||||||
|
if (ecx != RCT2_GLOBAL(0x009E2DE8, uint32)) {
|
||||||
|
int edx = RCT2_GLOBAL(0x01424318, uint32); // X
|
||||||
|
//eax is a struct index here. Mutliplied by then and then 4 for the struct with 3 4 byte fields
|
||||||
|
//Struct is {int x, int y, int actionType}
|
||||||
|
eax = eax + eax*2;
|
||||||
|
eax = 0x01424340 + eax * 4; //get base of struct, address is base of array
|
||||||
|
*((uint32*)eax) = edx;
|
||||||
|
edx = RCT2_GLOBAL(0x0142431C, uint32); // Y
|
||||||
|
*((uint32*)eax + 1) = edx;
|
||||||
|
edx = actionType;
|
||||||
|
*((uint32*)eax + 2) = edx;
|
||||||
|
RCT2_GLOBAL(0x009E2DE4, uint32) = ecx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue