Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ahefner/tenes
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
	filters.c
  • Loading branch information
ahefner committed Dec 27, 2014
2 parents da5a97a + 5f77d1c commit efd6eb8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,4 +10,5 @@ diffs
*.log
gmon.out
movies
TAGS
tenes
2 changes: 2 additions & 0 deletions M6502/M6502.h
Expand Up @@ -132,4 +132,6 @@ byte Debug6502(register M6502 *R);

word Sub6502(M6502 *R, word addr, unsigned max_cycles);

void note_brk (void);

#endif /* M6502_H */
11 changes: 3 additions & 8 deletions filters.c
Expand Up @@ -24,11 +24,6 @@ void build_color_maps (void)
rgb_palette[i] = (nes_palette[i*3+0] << 16) | (nes_palette[i*3+1] << 8) | nes_palette[i*3+2];
grayscale_palette[i] = (nes_palette[i*3] + nes_palette[i*3+1] + nes_palette[i*3+2]) / 3; /* FIXME.. */
}

for (int i=64; i<128; i++) {
rgb_palette[i] = rgb_palette[i-64];
grayscale_palette[i] = grayscale_palette[i-64];
}
}

static inline unsigned convert_pixel (byte color, byte emphasis, struct rgb_shifts sw)
Expand Down Expand Up @@ -248,6 +243,7 @@ void ntsc_emitter (unsigned line, byte *colors, byte *emphasis)
#else
/* Vectorized output loop. */
v8hi *in = (v8hi *)rgb;

//v8hi *out = &vbuf[idx][0];
__m128i *out = (__m128i *)&vbuf[idx][0];

Expand All @@ -271,12 +267,11 @@ void ntsc_emitter (unsigned line, byte *colors, byte *emphasis)
for (int i=0; i<11; i++) {
// If I fixed the alignment issue, I could do this:
//printf("out[%i] += in[%i]; out=%p vbuf=%p idx=%i off=%i x=%i\n", i, i, out, vbuf, idx, off, x);

//out[i] += in[i];
//out[i] += in[i]; (assumes aligned read/write)

//v8hi old = __builtin_ia32_loadups(out);

v8hi old = _mm_loadu_si128(out);

//__builtin_ia32_storedqu(out, in[i] + old);
_mm_storeu_si128(out, in[i] + old);

Expand Down
1 change: 1 addition & 0 deletions nes.c
Expand Up @@ -1105,6 +1105,7 @@ void note_brk (void)
if (debug_brk) {
byte code = Rd6502(nes.cpu.PC.W);
printf("%sBRK %02X: ", nes_time_string(), code);
fflush(stdout);
regs();
/* The MSB of the break code enables instruction tracing */
nes.cpu.Trace = code >> 7;
Expand Down

0 comments on commit efd6eb8

Please sign in to comment.