Lines 23-28
Link Here
|
23 |
#include <stdlib.h> |
23 |
#include <stdlib.h> |
24 |
#include <string.h> |
24 |
#include <string.h> |
25 |
#include <time.h> |
25 |
#include <time.h> |
|
|
26 |
#include <sys/mman.h> |
26 |
|
27 |
|
27 |
#include "PsxCommon.h" |
28 |
#include "PsxCommon.h" |
28 |
#include "ix86.h" |
29 |
#include "ix86.h" |
Lines 380-389
Link Here
|
380 |
|
381 |
|
381 |
psxRecLUT = (u32*) malloc(0x010000 * 4); |
382 |
psxRecLUT = (u32*) malloc(0x010000 * 4); |
382 |
|
383 |
|
383 |
recMem = (char*) malloc(RECMEM_SIZE); |
384 |
recMem = (char*) mmap(NULL, RECMEM_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); |
384 |
recRAM = (char*) malloc(0x200000); |
385 |
recRAM = (char*) malloc(0x200000); |
385 |
recROM = (char*) malloc(0x080000); |
386 |
recROM = (char*) malloc(0x080000); |
386 |
if (recRAM == NULL || recROM == NULL || recMem == NULL || psxRecLUT == NULL) { |
387 |
if (recRAM == NULL || recROM == NULL || recMem == NULL || recMem == -1 || psxRecLUT == NULL) { |
387 |
SysMessage("Error allocating memory"); return -1; |
388 |
SysMessage("Error allocating memory"); return -1; |
388 |
} |
389 |
} |
389 |
|
390 |
|
Lines 412-418
Link Here
|
412 |
static void recShutdown() { |
413 |
static void recShutdown() { |
413 |
if (recMem == NULL) return; |
414 |
if (recMem == NULL) return; |
414 |
free(psxRecLUT); |
415 |
free(psxRecLUT); |
415 |
free(recMem); |
416 |
munmap(recMem, RECMEM_SIZE); |
416 |
free(recRAM); |
417 |
free(recRAM); |
417 |
free(recROM); |
418 |
free(recROM); |
418 |
x86Shutdown(); |
419 |
x86Shutdown(); |