I've been rewriting a program I made in BASIC and part of it involves changing an arrow (244) to a different one (240) when pressing the relevant key.
The problem I think i'm having is that it's running too quickly. Using BASIC was good as the slowness caused a good animation between the two characters. But now it's running far too quick. In most cases you can't even see it change because it's happening so fast.
When the correct key is pressed (in this case up) the program goes to the following routine, changing the arrow to the new one briefly before jumping to the routine that resets the arrows.
Code: Select all
IncreaseDate:
ld hl,&0a08 ;column 10 row 8
call &bb75 ;calls firmware to move cursor to hl
call PrintUpArrowPressed ;jump to PrintUpArrowPressed routine
jp ArrowOne ;return arrow to original
Is there any way I could call on a firmware routine to wait for a moment to let the change be seen and then continue the program?
The routines contain a very small amount of data and the print routine is the same as what is used in one of the z80 tutorial video's
.
Code: Select all
PrintUpArrow:
ld hl,UpArrow
call Print
ret
PrintUpArrowPressed:
ld hl,UpArrowPressed
call Print
ret
Now that i've written this down (this seems t happen a lot), I'm wondering if the next routine that i'm going to put in might slow things down enough to make the effect that i'm after.