Files
ti-nesulator/src/os/ti68k/loadfile.c
Godzil 8fcf756566 Update headers
- Update copyrights dates
- Remove the useless "All right reserved"
- Change incorrect name(s)
2019-12-05 16:42:11 +00:00

30 lines
564 B
C

/*
* TI-68k Loading external file functions - The peTI-NESulator Project
* ti68k/loadfile.c
*
* Created by Manoël Trapier.
* Copyright (c) 2002-2019 986-Studio.
*
*/
#define TIGCC_COMPAT
#include <tigcclib.h>
/* Map a file in memory */
void *LoadFilePtr(char * filename)
{
void *RetPtr = NULL;
FILE *fp;
if ((fp = fopen(filename,"rb")) == NULL)
return -1;
/* TI Related stuff, very ugly, and need to be changed.. */
HeapLock(fp->handle);
RetPtr = 2 + HeapDeref(fp->handle);
fclose (fp);
return RetPtr;
}