Re: A89: Change Auto-Int 5 in C


[Prev][Next][Index][Thread]

Re: A89: Change Auto-Int 5 in C




auto int 5 goes of every time the counter at $600017 overflows from $FF to $00.
When it does, it resets itself to its initial value, and then starts to count
_up_ again.
you can change what the initial value should be by writeing to this port. should
be something like this in C: 
*(char *)0x600017 = 0xB2; 
$B2 is the standard initial value that the rom sets. If you still can't get is
fast enough, even with an initial value of $FF, you can make it count faster by
changeing bits 5 and 4 in $600015.
here is the entry for $600015 in 89hw.txt that can be found at
http://alh.dhs.org/ti89/ : 

600015:0                turns on the ~740kHz oscillator used for the LCD and the
timers 
      :1                turns on data to the LCD, if 0, the LCD is all "white"
      :2                enables Autointerrupt 3, OSC/2^19 (1.4Hz)
      :3                enables incrementing of $600017 
      :5..4             frequency of increment of $600017:    

                        0 = OSC/2^5 (~22kHz)
                        1 = OSC/2^9 (~1.5kHz)
                        2 = OSC/2^12 (~18Hz)
                        3 = OSC/2^19 (1.4Hz)
                
      :7                disables all the interrupt generating counters
                        (Autointerrupt 1 is NOT fixed at LCD-update*4, if the 
                        number of rows or the row-change frequency is changed,
                        grayscale and similar things doesnt nececarily work)
                                                                default: $1b

a value of $0b should make it count as fast as possible.
Hope that helps.
//Olle

JHill8075@aol.com wrote:
> 
> Currently, auto-int 5 goes off 20 times per second, and decreases the Timers
> by one each time. There is a routine in my program I need to call to display
> sprites, but it's too fast, and I thought I could set a timer and then check
> it and when it expires, run the routine. At only 20 times a second this is
> WAY to slow. Is there a way in C that I can change auto-int 5 to go off many
> more times per second, and then change it back at the end of my program? The
> routine I'm currently using is okay, but it's slow, and I want to give the
> user the option to change the speed of the game and speed it up as the game
> progresses (using a new routine that is too fast). I did a little quick math
> and using a stopwatch, I figured that I would need Auto-Int 5 to go off about
> 100 times per second (I know that the screen doesn't refresh 100 times per
> second, but the routine does more than displaying sprites). Thanks.
> 
>         Josh
>         <A HREF="http://pa.ticalc.org">Programmers Anonymous</A> Member



References: