mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-12 14:42:31 -05:00
Port of Duke Nukem 3D
This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL for Rockbox. Change-Id: I8f2c4c78af19de10c1633ed7bb7a997b43256dd9
This commit is contained in:
parent
01c6dcf6c7
commit
a855d62025
994 changed files with 336924 additions and 15 deletions
54
apps/plugins/sdl/progs/duke3d/Engine/src/fixedPoint_math.c
Normal file
54
apps/plugins/sdl/progs/duke3d/Engine/src/fixedPoint_math.c
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
// converted from asm to c by Jonof
|
||||
|
||||
#include <stdio.h>
|
||||
#include "platform.h"
|
||||
#include "fixedPoint_math.h"
|
||||
|
||||
void clearbuf(void *d, int32_t c, int32_t a)
|
||||
{
|
||||
int32_t *p = (int32_t*)d;
|
||||
while ((c--) > 0) *(p++) = a;
|
||||
}
|
||||
|
||||
void clearbufbyte(void *D, int32_t c, int32_t a)
|
||||
{ // Cringe City
|
||||
uint8_t *p = (uint8_t *)D;
|
||||
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
|
||||
int32_t n[4] = { 0,8,16,24 };
|
||||
int32_t z=0;
|
||||
while ((c--) > 0) {
|
||||
*(p++) = (uint8_t )((a & m[z])>>n[z]);
|
||||
z=(z+1)&3;
|
||||
}
|
||||
}
|
||||
|
||||
void copybuf(void *s, void *d, int32_t c)
|
||||
{
|
||||
int32_t *p = (int32_t*)s, *q = (int32_t*)d;
|
||||
while ((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void copybufbyte(void *S, void *D, int32_t c)
|
||||
{
|
||||
uint8_t *p = (uint8_t *)S, *q = (uint8_t *)D;
|
||||
while((c--) > 0) *(q++) = *(p++);
|
||||
}
|
||||
|
||||
void copybufreverse(void *S, void *D, int32_t c)
|
||||
{
|
||||
uint8_t *p = (uint8_t *)S, *q = (uint8_t *)D;
|
||||
while((c--) > 0) *(q++) = *(p--);
|
||||
}
|
||||
|
||||
void qinterpolatedown16(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
|
||||
{ // gee, I wonder who could have provided this...
|
||||
int32_t i, *lptr = bufptr;
|
||||
for(i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
|
||||
}
|
||||
|
||||
void qinterpolatedown16short(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
|
||||
{ // ...maybe the same person who provided this too?
|
||||
int32_t i; short *sptr = (short *)bufptr;
|
||||
for(i=0;i<num;i++) { sptr[i] = (short)(val>>16); val += add; }
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue