Author Topic: frame rate/speed  (Read 14329 times)

0 Members and 1 Guest are viewing this topic.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
frame rate/speed
« on: September 14, 2010, 07:18:23 am »
Is there any way to limit a programs frame rate/speed?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: frame rate/speed
« Reply #1 on: September 14, 2010, 08:03:58 am »
Use the Pause(EXP) command every now and again. But, I don't think you can do it accurately...
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: frame rate/speed
« Reply #2 on: September 14, 2010, 09:38:11 am »
u could use an interrupt to update the screen, and do a 'Stop' every time you updated the buffer.
Quote from: Documentation
Stop:Stops execution until the next interrupt occurs. Interrupts must be enabled or else the calculator will freeze.
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: frame rate/speed
« Reply #3 on: September 14, 2010, 09:45:19 am »
Yeah, that too.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: frame rate/speed
« Reply #4 on: September 14, 2010, 12:26:02 pm »
Another solution if you aren't using interrupts is to make sure DispGraph is only ran like every 2 or 3 loop. If slowed down too much it can make the game a bit too fast, though, so you may have to add a Pause command or stuff more features there.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

SirCmpwn

  • Guest
Re: frame rate/speed
« Reply #5 on: September 19, 2010, 11:58:33 am »
DO NOT USE STOP WITHIN AN INTERRUPT!
This would be bad.  Interrupt code turns OFF interrupts upon executing.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: frame rate/speed
« Reply #6 on: September 19, 2010, 12:39:30 pm »
What kind of stuff can happen if you do so?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: frame rate/speed
« Reply #7 on: September 19, 2010, 12:44:33 pm »
The calc would hang and you would have to pull a battery.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: frame rate/speed
« Reply #8 on: September 19, 2010, 12:53:26 pm »
Code: [Select]
FnOff
Stop
or, in ASM
Code: [Select]
di
halt
Shortest way to freeze a z80 processor AFAIK ;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: frame rate/speed
« Reply #9 on: September 19, 2010, 12:57:17 pm »
The calc would hang and you would have to pull a battery.
Ah ok I was worried worse stuff migth happen or something x.x
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: frame rate/speed
« Reply #10 on: September 19, 2010, 01:08:24 pm »
so nothing will make it even?
so i have a consistent speed of a ship or something in real time?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: frame rate/speed
« Reply #11 on: September 19, 2010, 01:14:32 pm »
Back to your original problem, interrupts would probably be the way to go.
An example:
Code: [Select]
0->C->X
ClrHome
fnInt(T,0
Repeat getKey(0)
!If C
Disp X+1->X>Dec
50->C
End
End
Return
Lbl T
C-1->C
(Untested, should work)
Edit: Oops, wrote getKey instead of getKey(0). Fixed.
Edit 2: Bad typo. Fixed
« Last Edit: September 19, 2010, 01:18:10 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: frame rate/speed
« Reply #12 on: September 19, 2010, 01:15:49 pm »
Ah ok I was worried worse stuff migth happen or something x.x

It would also clear RAM.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: frame rate/speed
« Reply #13 on: September 19, 2010, 01:18:41 pm »
Back to your original problem, interrupts would probably be the way to go.
An example:
Code: [Select]
0->C->X
ClrHome
fnInt(T,0
Repeat getKey(0)
!If C
Disp X+1->X>Dec
50->C
End
End
Return
Lbl T
C-1->C
(Untested, should work)
Edit: Oops, wrote getKey instead of getKey(0). Fixed.
Edit 2: Bad typo. Fixed

ok thanks
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: frame rate/speed
« Reply #14 on: September 19, 2010, 01:23:41 pm »
And it crashes horribly... You get the idea, though.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.