<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 13 Feb 1996 17:01:28 +0000 (GMT)
From   : Mark Cooke <mpc@...>
Subject: Re: The BBC's Logical, Well-Documented and Non-Perverse Keyboard

On Tue, 13 Feb 1996, lamcw wrote:

> 
> 
> Tom Seddon wrote:
> 
> ;Now, I have another problem. My virtual BBC is now about 33% slower than 
> ;a real BBC, on a 486dx2-80. After I've done the obvious optimisations 
> ;(update VIA clocks every X cycles, that sort of thing), if the speed 
> ;isn't up to scratch what do people suggest?
> 
> 
> Here are a few nice tricks.
> 
> 1) Use a big SWITCH statement as the heart of your 6502 emulation.

Depending on your compiler. A potentially better trick is to use an array 
of function pointers. Mileage will vary with compiler.

> 2) Go into a tight loop for say 50 opcodes, then drop out to update
> counters, check IRQs etc. This may horrify some purists but I found
> this essential to get good performance.

Agreed. You might want to go further, and set a flag/dynamic count for 
this. Some copy protection/decoding was very very timing specific.

> 3) Draw the screen every x frames, e.g. 5 for instance.

Definately. It makes a huge difference.

Mark

Mark Cooke                             The views expressed above are mine
Systems Programmer                     and do not reflect in any way the
University Of Birmingham               current policy of my employers.

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>