JPC531 Posted March 18, 2019 Share Posted March 18, 2019 I just started playing around with Extended Basic to see what the TI-99/4A can do. I made a simple program where I want to see how many words can be entered in one minute, but I do not see any Basic commands for time.On the TI-99 do you just have to estimate based on how long each instruction takes to run? Not sure how I would do that since the number of words would be different every time it is run.How do you handle a time count down? Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 18, 2019 Share Posted March 18, 2019 This will be near-impossible to do without assembly language support to access the 9901 timer. To clarify, will you be timing at rest or in motion? There might be some complicating factors at play here Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted March 18, 2019 Share Posted March 18, 2019 (edited) TI-99-4A-CLOCK-Capability-v1.10.pdf I remember a program called 4aclock... I think it was in TI BASIC... can't locate. Edited March 18, 2019 by HOME AUTOMATION Quote Link to comment Share on other sites More sharing options...
Asmusr Posted March 18, 2019 Share Posted March 18, 2019 Isn't there a VDP interrupt counter that you can peek (>83d6)? Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 18, 2019 Share Posted March 18, 2019 Yes, the screen time-out counter. How long would it take for it to go from 0 to >FFFF? That would be the maximum time interval that could be counted. Problem is there is no POKE function in XB, so one would not be able to reset the timer before starting the word count. Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted March 18, 2019 Share Posted March 18, 2019 You can set a sprite in motion and then read its position to get time. 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 18, 2019 Share Posted March 18, 2019 You can set a sprite in motion and then read its position to get time. Great idea! Didn't think of that. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted March 18, 2019 Share Posted March 18, 2019 Yes, the screen time-out counter. How long would it take for it to go from 0 to >FFFF? That would be the maximum time interval that could be counted. Problem is there is no POKE function in XB, so one would not be able to reset the timer before starting the word count. The screen timeout counter steps by 2 at each interrupt, so 32768/3600 = 9.1 minutes. In XB, you use CALL LOAD() to poke byte values into RAM. ...lee Quote Link to comment Share on other sites More sharing options...
JPC531 Posted March 18, 2019 Author Share Posted March 18, 2019 This will be near-impossible to do without assembly language support to access the 9901 timer. To clarify, will you be timing at rest or in motion? There might be some complicating factors at play here The screen timeout counter steps by 2 at each interrupt, so 32768/3600 = 9.1 minutes. In XB, you use CALL LOAD() to poke byte values into RAM. ...lee Timing would be in motion. I do want to try assembly, but I wanted to see what is possible in Basic first. I think I can handle a peek and poke though. At least I know that I didn't miss anything easy Quote Link to comment Share on other sites More sharing options...
JPC531 Posted March 18, 2019 Author Share Posted March 18, 2019 You can set a sprite in motion and then read its position to get time. Using sprite motion is a great idea. I could not think of anything that was consistent over time. I'll try that. Thanks 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted March 19, 2019 Share Posted March 19, 2019 Yes, the screen time-out counter. How long would it take for it to go from 0 to >FFFF? That would be the maximum time interval that could be counted. Problem is there is no POKE function in XB, so one would not be able to reset the timer before starting the word count. GKXB, Super XB have a CALL LOAD or CALL PEEK, Problem is both require CALL INIT to access. RXB does not require a CALL INIT to use CALL LOAD or CALL PEEK this really speeds up access and ez to use. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 19, 2019 Share Posted March 19, 2019 Can you LOAD into CPU RAM? I thought you could only use CALL LOAD for the expansion RAM to directly load a value. EDIT: Never mind. You can Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 19, 2019 Share Posted March 19, 2019 The screen timeout counter steps by 2 at each interrupt, so 32768/3600 = 9.1 minutes. In XB, you use CALL LOAD() to poke byte values into RAM. ...lee Actually using the timeout counter won't work because it keeps getting reset while a program is running and only starts counting when the computer is idle. A quick test in Classic99 and its debugger confirmed that. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 19, 2019 Share Posted March 19, 2019 Timing would be in motion. I do want to try assembly, but I wanted to see what is possible in Basic first. I think I can handle a peek and poke though. At least I know that I didn't miss anything easy I was being obnoxious here. I was referring to time dilatation with motion Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted March 19, 2019 Share Posted March 19, 2019 Actually using the timeout counter won't work because it keeps getting reset while a program is running and only starts counting when the computer is idle. A quick test in Classic99 and its debugger confirmed that. I actually was not suggesting using the timeout counter—just answering the question. The timeout counter is incremented by 2 at every VDP interrupt. It is reset only when a keystroke is detected by KSCAN, the console’s keyboard routine. ...lee Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 19, 2019 Share Posted March 19, 2019 In my test, the timer kept getting reset while a short program was running even without any key presses... Quote Link to comment Share on other sites More sharing options...
Asmusr Posted March 19, 2019 Share Posted March 19, 2019 In my test, the timer kept getting reset while a short program was running even without any key presses... Yes that's also what I found. I then tried for fun to see if I could add my own ISR hook and counter using pokes only. It seems to be working but for some reason it's counting too slowly. XAS99 CROSS-ASSEMBLER VERSION 1.7.2 **** **** **** > isr.a99 0001 aorg >83b8 0002 83B8 05A0 34 inc @cnt 83BA 83BE 0003 83BC 045B 20 rt 0004 83BE 0000 cnt data 0 0005 10 CALL INIT 15 REM CREATE THE ROUTINE 20 CALL LOAD(-31816,5,160,131,190,4,91) 25 REM HOOK INTO ISR 30 CALL LOAD(-31804,131,184) 35 REM READ COUNTER 40 CALL PEEK(-31810,MSB,LSB) 50 TIME=(MSB*256+LSB)/60 60 PRINT INT(TIME) 70 GOTO 40 2 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted March 19, 2019 Share Posted March 19, 2019 In my test, the timer kept getting reset while a short program was running even without any key presses... Yes that's also what I found. ... My bad. I just checked the console code and, indeed, the VDP screen timeout timer, >83D6, is reset for each and every Basic statement executed. Sorry about that. However, what I said about KSCAN still obtains for any ALC (and TI Forth, fbForth and, I believe, TurboForth and Camel99 Forth) program that does not explicitly change >83D6, i.e., >83D6 will not be reset until a new keystroke is detected by KSCAN. ...lee Quote Link to comment Share on other sites More sharing options...
Tursi Posted March 19, 2019 Share Posted March 19, 2019 Yes that's also what I found. I then tried for fun to see if I could add my own ISR hook and counter using pokes only. It seems to be working but for some reason it's counting too slowly. XAS99 CROSS-ASSEMBLER VERSION 1.7.2 **** **** **** > isr.a99 0001 aorg >83b8 0002 83B8 05A0 34 inc @cnt 83BA 83BE 0003 83BC 045B 20 rt 0004 83BE 0000 cnt data 0 0005 10 CALL INIT 15 REM CREATE THE ROUTINE 20 CALL LOAD(-31816,5,160,131,190,4,91) 25 REM HOOK INTO ISR 30 CALL LOAD(-31804,131,184) 35 REM READ COUNTER 40 CALL PEEK(-31810,MSB,LSB) 50 TIME=(MSB*256+LSB)/60 60 PRINT INT(TIME) 70 GOTO 40 Print scrolls the screen, and scrolling the screen takes more than one frame in BASIC/XB. During the screen scroll, interrupts are blocked. You can see it happen with a moving sprite, too. 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted March 20, 2019 Share Posted March 20, 2019 Learn something everyday Quote Link to comment Share on other sites More sharing options...
RXB Posted March 20, 2019 Share Posted March 20, 2019 Print scrolls the screen, and scrolling the screen takes more than one frame in BASIC/XB. During the screen scroll, interrupts are blocked. You can see it happen with a moving sprite, too. Try RXB: 10 CALL INIT 15 REM CREATE THE ROUTINE 20 CALL LOAD(-31816,5,160,131,190,4,91) 25 REM HOOK INTO ISR 30 CALL LOAD(-31804,131,184) 35 REM READ COUNTER 40 CALL PEEK(-31810,MSB,LSB) 50 CALL HPUT(INT((MSB*256+LSB)/60) 60 GOTO 40 Quote Link to comment Share on other sites More sharing options...
1980gamer Posted March 20, 2019 Share Posted March 20, 2019 (edited) Print scrolls the screen, and scrolling the screen takes more than one frame in BASIC/XB. During the screen scroll, interrupts are blocked. You can see it happen with a moving sprite, too. Are you talking about the screen FREEZE for a split second? Or the output issues? 25 25 25 25 21 25 25 25 26 26 Edited March 20, 2019 by 1980gamer Quote Link to comment Share on other sites More sharing options...
LASooner Posted March 20, 2019 Share Posted March 20, 2019 Yes that's also what I found. I then tried for fun to see if I could add my own ISR hook and counter using pokes only. It seems to be working but for some reason it's counting too slowly. XAS99 CROSS-ASSEMBLER VERSION 1.7.2 **** **** **** > isr.a99 0001 aorg >83b8 0002 83B8 05A0 34 inc @cnt 83BA 83BE 0003 83BC 045B 20 rt 0004 83BE 0000 cnt data 0 0005 10 CALL INIT 15 REM CREATE THE ROUTINE 20 CALL LOAD(-31816,5,160,131,190,4,91) 25 REM HOOK INTO ISR 30 CALL LOAD(-31804,131,184) 35 REM READ COUNTER 40 CALL PEEK(-31810,MSB,LSB) 50 TIME=(MSB*256+LSB)/60 60 PRINT INT(TIME) 70 GOTO 40 This works in Classic99, but JS99er.net doesn't like it Quote Link to comment Share on other sites More sharing options...
Tursi Posted March 20, 2019 Share Posted March 20, 2019 Learn something everyday I do too, that's why it's so much fun to come here 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted March 20, 2019 Share Posted March 20, 2019 Are you talking about the screen FREEZE for a split second? I didn't run the code, so I guess the freeze. If you're running interrupts in XB and you scroll the screen, it will miss a few frames. I find it easiest to see with a sprite - you can visibly see the motion stutter: 10 CALL SPRITE(#1,65,3,100,100,0,50) 20 INPUT A$ 30 PRINT : : : : : : : : : : 40 GOTO 20 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.