Work on 64-bit support

parent 69151d2d
......@@ -115,6 +115,14 @@ int main(int argc, char *argv[]) {
/* add binary path */
file_addp(appexepath);
/* Allocate 3GB of RAM so that -hopefully- 64bit porting errors arise */
printf("WARNING!!! Allocating a lot of RAM!!\n");
size_t limit = (size_t)(4 * 1024 * 1024) * 1024;
if(!malloc(limit)) {
printf("Could not allocated memory...\n");
exit(EXIT_FAILURE);
}
if (!standalone) {
/* Hand-made interpreter: search for DCB at EOF */
fp = file_open(argv[0], "rb0");
......
......@@ -202,8 +202,8 @@ int instance_go(INSTANCE *r) {
register int *ptr = r->codeptr;
int n, return_value = LOCDWORD(r, PROCESS_ID);
SYSPROC *p = NULL;
INSTANCE *i = NULL;
SYSPROC *p = NULL;
INSTANCE *i = NULL;
static char buffer[16];
char *str = NULL;
int status;
......@@ -217,18 +217,21 @@ int instance_go(INSTANCE *r) {
if (debug_DCB > 0) {
PXTRTM_LOG("\n>>> Instance:%s ProcID:%d StackUsed:%u/%d\n", r->proc->name,
LOCDWORD(r, PROCESS_ID), (r->stack_ptr - r->stack) / sizeof(r->stack[0]),
(r->stack[0] & ~STACK_RETURN_VALUE));
LOCDWORD(r, PROCESS_ID), (r->stack_ptr - r->stack) / sizeof(r->stack[0]),
(r->stack[0] & ~STACK_RETURN_VALUE));
}
/* Hook */
if (instance_pre_execute_hook_count)
for (n = 0; n < instance_pre_execute_hook_count; n++)
if (instance_pre_execute_hook_count) {
for (n = 0; n < instance_pre_execute_hook_count; n++) {
instance_pre_execute_hook_list[n](r);
}
}
/* Hook */
if ((r->proc->breakpoint || r->breakpoint) && trace_instance != r)
if ((r->proc->breakpoint || r->breakpoint) && trace_instance != r) {
debug_next = 1;
}
trace_sentence = -1;
......
......@@ -84,8 +84,9 @@ int bgd_move_window(INSTANCE *my, int *params) {
/* --------------------------------------------------------------------------- */
int bgd_get_window_pos(INSTANCE *my, int *params) {
if (full_screen)
if (full_screen) {
return -1;
}
int x, y;
......
......@@ -5,6 +5,7 @@ if (${CMAKE_C_COMPILER_ID} MATCHES "GNU" OR
${CMAKE_C_COMPILER_ID} MATCHES "Clang" OR
${CMAKE_C_COMPILER_ID} MATCHES "AppleClang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -Wall -Wshadow -fno-strict-aliasing")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG} -g")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE} -O2")
elseif (MSVC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment