[A83] Re: LCD update freq and working with 16bit numbers on the Z80
[Prev][Next][Index][Thread]
[A83] Re: LCD update freq and working with 16bit numbers on the Z80
> Adding by 12 is easy, since there is a 16 bit add, but subtracting by 12
> seems to be very complicated, the only solution I could have come up with
> this far is this (which looks like it's waisting many clock cycles) :
It's much simpler than you think :)
Addition is the same thing as subtraction. Subtracting by one is the same
thing as adding the max value ($FF or $FFFF). Of course, the assembler will
calculate the value for you.
ld de,-12 ; subtract 12 from hl
add hl,de
> My second question - does anyone know how many times per second you can
> update the LCD using the _GRBUFCPY_V call? I mean, what 'FPS' is the
> theoretical max, assuming that nothing else but the buffer copy is done?
You should be able to get at least 60-80 FPS with fast buffer copy routine,
such as the one from the ION shell. Hideaki's map routine gets at least 60
FPS, but it doesn't use a buffer copy routine. It writes to the screen
itself, interleaved with the map drawing code. TI's routine is known to be
slow, so if you want maximum performance, it is best to write one yourself
(or use the one provided by the shell).
References: