NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Speedup emulator on slow hardware  
Posted bydarknight
Posted on11/16/01 11:30 PM
From IP138.72.15.48  



There's no difference between accessing an array using the bracket operators or using a pointer.

int a = foo[3];

is equivalent to

int a = *(foo + 3);

The speed hit comes from recomputing an array index instead of just incrementing; for example, writing pixels inside a double for loop. Chances are you're doing something like:

pixel[y*WIDTH + x] = val;

every iteration. Computers are very good at adding 1 -- just start the pixel pointer in the right place and then increment it each time through.



-
Entire Thread
Subject  Posted byPosted On
*Speedup emulator on slow hardware  Anonymous7/3/01 8:22 PM
.*Re: Speedup emulator on slow hardware  Anonymous7/6/01 04:12 AM
...Re: Speedup emulator on slow hardware  darknight11/16/01 11:30 PM
.*Re: Speedup emulator on slow hardware  oRBIT7/5/01 1:54 PM
..*Re: Speedup emulator on slow hardware  Tricob10/31/01 2:19 PM
...*Re: Speedup emulator on slow hardware  Anonymous11/1/01 03:00 AM
....*I Have to disagree....  Anonymous11/15/01 1:40 PM
.....*Re: I Have to disagree....  Tricob11/15/01 4:15 PM
......*Re: I Have to disagree....  koitsu12/7/01 00:47 AM
.......*Re: I Have to disagree....  Tricob12/7/01 2:54 PM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo