[TI ASM] Interrupts/"Fast Mode"
Moderator: MaxCoderz Staff
[TI ASM] Interrupts/"Fast Mode"
I have some assembly-related questions:
1. Does disabling interrupts allow both regular assembly programs and Flash Applications to run faster?
2. There is something known as "fast mode" for the TI-83+ SE/TI-84+/TI-84+ SE that allows these calculators to run at 15MHz instead of 6MHz (I think). How would I turn on "fast mode" and turn off "fast mode" in an assembly program?
3. While "fast mode" is turned on, I will have to increase the delays when reading/writing from the key port and the LCD, right? If so, then by how much?
EDIT: Edited topic title
1. Does disabling interrupts allow both regular assembly programs and Flash Applications to run faster?
2. There is something known as "fast mode" for the TI-83+ SE/TI-84+/TI-84+ SE that allows these calculators to run at 15MHz instead of 6MHz (I think). How would I turn on "fast mode" and turn off "fast mode" in an assembly program?
3. While "fast mode" is turned on, I will have to increase the delays when reading/writing from the key port and the LCD, right? If so, then by how much?
EDIT: Edited topic title
Last edited by bfr on Thu 05 Apr, 2007 12:47 am, edited 1 time in total.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
1: Not a whole lot really. But yeah there maybe a speed up.
2:
Take a look at wiki ti for other info.link
3: yeah, between the in and outs of the key port, add in say 12~16 tstates, thats about 3 nop's.
For the lcd you should wait until its done for maximum compatibility. Read up here
2:
Code: Select all
ld a,1
out ($20),a
3: yeah, between the in and outs of the key port, add in say 12~16 tstates, thats about 3 nop's.
For the lcd you should wait until its done for maximum compatibility. Read up here
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
for 3 you could use my infamous LCD waiter: (destroys C and F)
if you call it, it will wait untill the LCD is ready for the next instruction regardless of CPU speed and the number of CC's that have already been passed since the last instruction to the LCD driver. The right place to call this would be right before an instruction to the LCD.
the "safecopy" on the page Jim E linked to uses the same trick, the safecopy routine will also always work no matter what the CPU speed is
Or you could mess with ports $29 - $2C (LCD delay)
Code: Select all
WaitLCD:
ld c,$10
-: in (c)
ret p
jr {-}
the "safecopy" on the page Jim E linked to uses the same trick, the safecopy routine will also always work no matter what the CPU speed is
Or you could mess with ports $29 - $2C (LCD delay)
- driesguldolf
- Extreme Poster
- Posts: 395
- Joined: Thu 17 May, 2007 4:49 pm
- Location: $4080
- Contact:
A little optimising (I think) of the waitlcd routine:
in your header file write
#define waitlcd in f, (c) \ jp m, $ - 4
hmm..., not sure about that -4, plz correct me if I'm wrong
make sure that c is $10 tough (and don't use c unless you reset it to $10)
to use it just type waitlcd as you would type an instruction
im not sure if this is faster
in your header file write
#define waitlcd in f, (c) \ jp m, $ - 4
hmm..., not sure about that -4, plz correct me if I'm wrong
make sure that c is $10 tough (and don't use c unless you reset it to $10)
to use it just type waitlcd as you would type an instruction
im not sure if this is faster
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
$-2
In terms of performance....it's mostly luck. How fast the driver works is not very uniform so its possible to get lucky and check the port at the right time. But if you missed the lcd reporting being ready by just a few tstates, then you would have to wait for the loop to check again. So thats why a smaller loop would be better.
In terms of performance....it's mostly luck. How fast the driver works is not very uniform so its possible to get lucky and check the port at the right time. But if you missed the lcd reporting being ready by just a few tstates, then you would have to wait for the loop to check again. So thats why a smaller loop would be better.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
It should under normal circumstances. It's possible it won't in certain circumstances but that would only happen if that calculator has already crashed or some one was playing with things they didn't know how to work.Halifax wrote:doesn't call $000B do a suffcient delay no matter what mode. Maybe it's not optimized because I don't know about TI, but that's what I think it is IIRC. I would just go with the waitlcd but I was just saying.