Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
64-bit. Use "long" instead of "intptr_t".
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-n committed Mar 26, 2019
1 parent d85cf36 commit 8d380fa
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions Engine/src/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static int transrev = 0;

/* --------------- WALLS RENDERING METHOD (USED TO BE HIGHLY OPTIMIZED ASSEMBLY) ----------------------------*/
extern int32_t asm1;
extern intptr_t asm2;
extern long asm2;
extern uint8_t *asm3;
extern int32_t asm4;

Expand Down Expand Up @@ -90,9 +90,9 @@ void hlineasm4(int32_t numPixels, int32_t shade, uint32_t i4, uint32_t i5, uint8
static int32_t rmach_eax;
static int32_t rmach_ebx;
static int32_t rmach_ecx;
static intptr_t rmach_edx;
static long rmach_edx;
static int32_t rmach_esi;
void setuprhlineasm4(int32_t i1, int32_t i2, int32_t i3, intptr_t i4, int32_t i5, int32_t i6)
void setuprhlineasm4(int32_t i1, int32_t i2, int32_t i3, long i4, int32_t i5, int32_t i6)
{
rmach_eax = i1;
rmach_ebx = i2;
Expand Down Expand Up @@ -305,15 +305,15 @@ void setuptvlineasm2(int32_t i1, long i2, long i3)
} /* */


void tvlineasm2(uint32_t i1, uint32_t i2, uintptr_t i3, uintptr_t i4, uint32_t i5, uintptr_t i6)
void tvlineasm2(uint32_t i1, uint32_t i2, unsigned long i3, unsigned long i4, uint32_t i5, unsigned long i6)
{
uint32_t ebp = i1;
uint32_t tran2inca = i2;
uint32_t tran2incb = asm1;
uintptr_t tran2bufa = i3;
uintptr_t tran2bufb = i4;
uintptr_t tran2edi = asm2;
uintptr_t tran2edi1 = asm2 + 1;
unsigned long tran2bufa = i3;
unsigned long tran2bufb = i4;
unsigned long tran2edi = asm2;
unsigned long tran2edi1 = asm2 + 1;

i6 -= asm2;

Expand Down Expand Up @@ -400,7 +400,7 @@ void setupvlineasm(int32_t i1)
}

//FCS This is used to fill the inside of a wall (so it draws VERTICAL column, always).
void vlineasm4(int32_t columnIndex, intptr_t framebuffer)
void vlineasm4(int32_t columnIndex, long framebuffer)
{

if (!RENDER_DRAW_WALL_INSIDE)
Expand All @@ -410,7 +410,7 @@ void vlineasm4(int32_t columnIndex, intptr_t framebuffer)
int i;
uint32_t temp;

uintptr_t index = (framebuffer + ylookup[columnIndex]);
unsigned long index = (framebuffer + ylookup[columnIndex]);
uint8_t *dest= (uint8_t *)(-ylookup[columnIndex]);
//uint8_t *dest= (uint8_t *)framebuffer;

Expand Down Expand Up @@ -440,11 +440,11 @@ void setupmvlineasm(int32_t i1)
}


void mvlineasm4(int32_t column, intptr_t framebufferOffset)
void mvlineasm4(int32_t column, long framebufferOffset)
{
int i;
uint32_t temp;
uintptr_t index = (framebufferOffset + ylookup[column]);
unsigned long index = (framebufferOffset + ylookup[column]);
uint8_t *dest = (uint8_t *)(-ylookup[column]);

do {
Expand Down Expand Up @@ -821,14 +821,14 @@ void tsethlineshift(int32_t i1, int32_t i2)



static intptr_t slopemach_ebx;
static long slopemach_ebx;
static int32_t slopemach_ecx;
static long slopemach_edx;
static uint8_t slopemach_ah1;
static uint8_t slopemach_ah2;
static float asm2_f;
typedef union { unsigned int i; float f; } bitwisef2i;
void setupslopevlin(int32_t i1, intptr_t i2, int32_t i3)
void setupslopevlin(int32_t i1, long i2, int32_t i3)
{
bitwisef2i c;
slopemach_ebx = i2;
Expand Down
12 changes: 6 additions & 6 deletions Engine/src/draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ extern uint8_t *transluc;
extern uint8_t *globalpalwritten;
extern int16_t globalshiftval;
extern int32_t vplce[4], vince[4];
extern intptr_t bufplce[4];
extern long bufplce[4];
extern uint8_t* palookupoffse[4];

void sethlinesizes(int32_t,int32_t,uint8_t *);


void hlineasm4(int32_t,int32_t,uint32_t,uint32_t,uint8_t*);
void setuprhlineasm4(int32_t,int32_t,int32_t,intptr_t,int32_t,int32_t);
void setuprhlineasm4(int32_t,int32_t,int32_t,long,int32_t,int32_t);
void rhlineasm4(int32_t,uint8_t*,int32_t,uint32_t,uint32_t,uint8_t*);
void setuprmhlineasm4(int32_t,int32_t,int32_t,long,int32_t,int32_t);
void rmhlineasm4(int32_t,uint8_t*,int32_t,int32_t,int32_t,uint8_t*);
Expand All @@ -47,12 +47,12 @@ int32_t vlineasm1(int32_t,uint8_t*,int32_t,int32_t,uint8_t *,uint8_t*);

int32_t tvlineasm1(int32_t,uint8_t*,int32_t,int32_t,uint8_t *,uint8_t * dest);
void setuptvlineasm2(int32_t,long,long);
void tvlineasm2(uint32_t,uint32_t,uintptr_t,uintptr_t,uint32_t,uintptr_t);
void tvlineasm2(uint32_t,uint32_t,unsigned long,unsigned long,uint32_t,unsigned long);
int32_t mvlineasm1(int32_t,uint8_t*,int32_t,int32_t,uint8_t* texture,uint8_t* dest);
void setupvlineasm(int32_t);
void vlineasm4(int32_t,intptr_t);
void vlineasm4(int32_t,long);
void setupmvlineasm(int32_t);
void mvlineasm4(int32_t,intptr_t);
void mvlineasm4(int32_t,long);
void setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
void spritevline(int32_t,uint32_t,int32_t,uint32_t,uint8_t*,uint8_t*);
void msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
Expand All @@ -65,7 +65,7 @@ void msethlineshift(int32_t,int32_t);
void thline(uint8_t*,int32_t,int32_t,int32_t,int32_t,uint8_t *);
void thlineskipmodify(int32_t,uint32_t,uint32_t,int32_t,int32_t,uint8_t *);
void tsethlineshift(int32_t,int32_t);
void setupslopevlin(int32_t,intptr_t,int32_t);
void setupslopevlin(int32_t,long,int32_t);
void slopevlin(long,uint32_t,long*,uint32_t,int32_t,int32_t,int32_t);


Expand Down
14 changes: 7 additions & 7 deletions Engine/src/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ uint8_t globparaceilclip, globparaflorclip;
int32_t xyaspect, viewingrangerecip;

int32_t asm1, asm4;
intptr_t asm2, asm3;
long asm2, asm3;


int32_t vplce[4], vince[4];
intptr_t bufplce[4];
long bufplce[4];

uint8_t* palookupoffse[4];

Expand Down Expand Up @@ -1226,7 +1226,7 @@ static void wallscan(int32_t x1, int32_t x2,
int32_t *swal, int32_t *lwal)
{
int32_t x, xnice, ynice;
intptr_t i;
long i;
uint8_t* fpalookup;
int32_t y1ve[4], y2ve[4], u4, d4, z, tileWidth, tsizy;
uint8_t bad;
Expand Down Expand Up @@ -1416,7 +1416,7 @@ static void maskwallscan(int32_t x1, int32_t x2,
int32_t *swal, int32_t *lwal)
{
int32_t x, startx, xnice, ynice;
intptr_t i;
long i;
uint8_t* fpalookup;
int32_t y1ve[4], y2ve[4], u4, d4, dax, z, tileWidth, tileHeight;
uint8_t* p;
Expand Down Expand Up @@ -3080,7 +3080,7 @@ static void transmaskvline(int32_t x)
static void transmaskvline2 (int32_t x)
{
int32_t y1, y2, x2;
intptr_t i;
long i;
short y1ve[2], y2ve[2];

if ((x < 0) || (x >= xdimen)) return;
Expand Down Expand Up @@ -8996,7 +8996,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, short ang)
void clearview(int32_t dacol)
{
int32_t y, dx;
intptr_t p;
long p;

if (qsetmode != 200) return;

Expand Down Expand Up @@ -9109,7 +9109,7 @@ void preparemirror(int32_t dax, int32_t day, int32_t daz,
void completemirror(void)
{
int32_t i, dy;
intptr_t p;
long p;

/* Can't reverse with uninitialized data */
if (inpreparemirror) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Contributors
* **Project Initiator:** [Fabien Sanglard](https://github.com/fabiensanglard)
* **Linux Integration:** [Juan Manuel Borges Caño](https://github.com/juanmabc)
* **Autoconf/Automake Build System:** [darealshinji](https://github.com/darealshinji)

* **64-bit Port:** [Rohit Nirmal](https://github.com/rohit-n)

More Information
================
Expand Down

0 comments on commit 8d380fa

Please sign in to comment.