0 Members and 3 Guests are viewing this topic.
I'm writing my first major Axe program and I noticed that the speed isn't much faster than BASIC. Is this because my TI-84+ is too old?
Nevermind! I did it, thanks anyway guys! I was storing getKey to a variable, which I'm guessing is a no-no in Axe. Maybe that's your problem too, mrmprog?
Repeat getKey(15)getKey->KX-(K=...)+(K=...)->XY-(K=...)+(K=...)->Y
Hmm... Well, here was my original code:Code: [Select]Repeat getKey(15)getKey->KX-(K=...)+(K=...)->XY-(K=...)+(K=...)->YThat ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast.
Quote from: BlakPilar on July 18, 2011, 11:40:39 pmI'm writing my first major Axe program and I noticed that the speed isn't much faster than BASIC. Is this because my TI-84+ is too old? No it must be the way you are formatting your code. A 84+ runs at ~15MHz no matter how old it is.Maybe
Quote from: BlakPilar on July 19, 2011, 12:46:35 amHmm... Well, here was my original code:Code: [Select]Repeat getKey(15)getKey->KX-(K=...)+(K=...)->XY-(K=...)+(K=...)->YThat ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast. Then your issue was probably key debouncing. Direct input [getKey(xx)] will fire every frame. getKey->K and testing K will fire every few frames because of the way that input routine works...if I recall correctly. Don't quote me on that, tho.Regardless, getKey->K and testing K shouldn't be itself particularly slower than getKey(K). That is to say, the instructions shouldn't take much longer.
Quote from: JustCause on July 19, 2011, 12:51:08 amQuote from: BlakPilar on July 19, 2011, 12:46:35 amHmm... Well, here was my original code:Code: [Select]Repeat getKey(15)getKey->KX-(K=...)+(K=...)->XY-(K=...)+(K=...)->YThat ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast. Then your issue was probably key debouncing. Direct input [getKey(xx)] will fire every frame. getKey->K and testing K will fire every few frames because of the way that input routine works...if I recall correctly. Don't quote me on that, tho.Regardless, getKey->K and testing K shouldn't be itself particularly slower than getKey(K). That is to say, the instructions shouldn't take much longer.Wait... Could it possibly be different or help to know that I'm using sprites, not just a single pixel?
Maybe I should clarify. Direct input goes off every frame. Testing getKey->K does not. This means that, if you're updating the position of ANYTHING, be it sprite, character or pixel, that thing will move every few frames if you're using getKey->K, and every frame if you're using direct input. I'm about 80% sure I know what I'm talking about.
I wasn't doubting your knowledge of Axe