Add NES emulator

It's now possible to play classic video game roms with teletypewriters.
https://justine.storage.googleapis.com/nesemu.png
This commit is contained in:
Justine Tunney 2020-07-02 13:46:08 -07:00
parent 4918121810
commit 72b654cb6c
28 changed files with 1888 additions and 79 deletions

View file

@ -17,7 +17,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#include "dsp/scale/scale.h"
#include "libc/assert.h"
#include "libc/intrin/packuswb.h"
#include "libc/intrin/paddw.h"

View file

@ -0,0 +1,11 @@
#ifndef COSMOPOLITAN_DSP_SCALE_CDECIMATE2XUINT8X8_H_
#define COSMOPOLITAN_DSP_SCALE_CDECIMATE2XUINT8X8_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
void *cDecimate2xUint8x8(unsigned long n, unsigned char[n],
const signed char[8]);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_DSP_SCALE_CDECIMATE2XUINT8X8_H_ */

View file

@ -22,7 +22,6 @@
#include "dsp/core/ituround.h"
#include "dsp/core/q.h"
#include "dsp/core/twixt8.h"
#include "dsp/scale/scale.h"
#include "libc/limits.h"
#include "libc/log/check.h"
#include "libc/log/log.h"

View file

@ -20,7 +20,7 @@
#include "dsp/core/half.h"
#include "dsp/core/ks8.h"
#include "dsp/core/kss8.h"
#include "dsp/scale/scale.h"
#include "dsp/scale/cdecimate2xuint8x8.h"
#include "libc/macros.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/str/str.h"

View file

@ -18,7 +18,6 @@
02110-1301 USA
*/
#include "dsp/core/half.h"
#include "dsp/scale/scale.h"
void *Scale2xX(long ys, long xs, unsigned char p[ys][xs], long yn, long xn) {
long y, x, w;

View file

@ -15,34 +15,22 @@ void FreeSamplingSolution(struct SamplingSolution *);
struct SamplingSolution *ComputeSamplingSolution(long, long, double, double,
double);
void *Scale2xX(long ys, long xs, unsigned char[ys][xs], long, long);
void *Scale2xY(long ys, long xs, unsigned char[ys][xs], long, long);
void *Magikarp2xX(long ys, long xs, unsigned char[ys][xs], long, long);
void *Magikarp2xY(long ys, long xs, unsigned char[ys][xs], long, long);
void *Magkern2xX(long ys, long xs, unsigned char[ys][xs], long, long);
void *Magkern2xY(long ys, long xs, unsigned char[ys][xs], long, long);
void *MagikarpY(long dys, long dxs, unsigned char d[restrict dys][dxs],
long sys, long sxs, const unsigned char s[sys][sxs], long yn,
long xn, const signed char K[8]);
void *Scale2xX(long, long, void *, long, long);
void *Scale2xY(long, long, void *, long, long);
void *Magikarp2xX(long, long, void *, long, long);
void *Magikarp2xY(long, long, void *, long, long);
void *Magkern2xX(long, long, void *, long, long);
void *Magkern2xY(long, long, void *, long, long);
void *MagikarpY(long, long, void *, long, long, const void *, long, long,
const signed char[8]);
void *GyaradosUint8(long dyw, long dxw, unsigned char dst[dyw][dxw], long syw,
long sxw, const unsigned char src[syw][sxw], long dyn,
long dxn, long syn, long sxn, long lo, long hi,
struct SamplingSolution *cy, struct SamplingSolution *cx,
bool sharpen);
void *EzGyarados(long dcw, long dyw, long dxw, unsigned char dst[dcw][dyw][dxw],
long scw, long syw, long sxw,
const unsigned char src[scw][syw][sxw], long c0, long cn,
long dyn, long dxn, long syn, long sxn, double ry, double rx,
double oy, double ox);
void Decimate2xUint8x8(unsigned long n, unsigned char[n * 2],
const signed char[static 8]);
void *cDecimate2xUint8x8(unsigned long n, unsigned char[n * 2],
const signed char[8]);
void *transpose(long yn, long xn, const unsigned char[yn][xn]);
extern void (*const transpose88b)(unsigned char[8][8]);
void *GyaradosUint8(long, long, void *, long, long, const void *, long, long,
long, long, long, long, struct SamplingSolution *,
struct SamplingSolution *, bool);
void *GyaradosInt16(long, void *, long, const void *, long, long,
struct SamplingSolution *, bool);
void *EzGyarados(long, long, long, void *, long, long, long, const void *, long,
long, long, long, long, long, double, double, double, double);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */