Jump to content
IGNORED

Supernotes


GDMike

Recommended Posts

56 minutes ago, Lee Stewart said:

 

The screen timeout timer reset has little to do with interrupts. I say, “little”, because it is the console ISR that increments the timer, which is effectively reset when it rolls over to 0. It does not ever, however, explicitly reset the timer.

 

In non-Basic environments, the screen timeout timer is explicitly reset only by KSCAN. Every call to KSCAN that detects a key-press resets the timer. The only key-press that does not require KSCAN is <quit>, which is the only key checked for by the console ISR. This is done without explicitly resetting the timer. It does, of course, execute a console reset.

 

...lee

 

 

"Minor nit" :) 

 

There is one other key.

Sub-routine  >0020   for the break key.

 

I just tested it and it doesn't reset the screen timeout timer.

 

image.png.4f44d610827e1e858d3f1a7c7349fecd.png

 

 

 

 

  • Like 2
Link to comment
Share on other sites

3 hours ago, TheBF said:

I will never stop being amazed at the concept of "polled" interrupts.  :)   What a weird machine we have.

Yes, it has its quirks. But blocking interrupts now and then is a common technique, when your code can't handle interrupts in all cases. The p-system does the same thing. It allows interrupts between the more complex p-codes, but not between the more simple ones.

  • Like 3
Link to comment
Share on other sites

I've always, like @wilsy said, do a limi 2,0 after each kscan. BUT, there was an area that I used kscan, limi 0, because I didn't want an inadvertent quit press (not knowing a way around), but watching the debugger, I noticed that the address  >83D4 - >83D6 stopped counting, I mean like very soon in the program, rt after setting my registers for the F18A.

is there anything in the F18A that would cause this?

I'll do a dump of code later on when I get to work.

 

Link to comment
Share on other sites

5 hours ago, TheBF said:

"Minor nit" :)   There is one other key.  Sub-routine  >0020   for the break key.

 

I just tested it and it doesn't reset the screen timeout timer.

 

Yup. Forgot about that one, but that is an explicit check for <break> that does not (as you said) reset the screen timeout timer—only KSCAN does that after a key-press is detected.

 

...lee

  • Like 2
Link to comment
Share on other sites

5 hours ago, apersson850 said:

Yes, it has its quirks. But blocking interrupts now and then is a common technique, when your code can't handle interrupts in all cases. The p-system does the same thing. It allows interrupts between the more complex p-codes, but not between the more simple ones.

Yes there are always some times when you don't want another interrupt to mess things up. Typically while you are in the bowels of the interrupt handler.

TI-99 turns things upside down so that the interrupts are almost like a cooperative tasker where you give them permission to "interrupt", which I find amusing.

It's just me.

 

  • Haha 1
Link to comment
Share on other sites

1 hour ago, GDMike said:

I've always, like @wilsy said, do a limi 2,0 after each kscan. BUT, there was an area that I used kscan, limi 0, because I didn't want an inadvertent quit press (not knowing a way around), but watching the debugger, I noticed that the address  >83D4 - >83D6 stopped counting, I mean like very soon in the program, rt after setting my registers for the F18A.

is there anything in the F18A that would cause this?

I'll do a dump of code later on when I get to work.

 

 

You can control which interrupts will respond using the byte at address >83C2 

 

83C2 CONSTANT AMSQ      \ interrupt DISABLE bits
\ AMSQ bit meaning:
\ 80 all interrupts disabled
\ 40 motion disabled
\ 20 Sound disabled
\ 10 quit key disabled

 

Here is some Forth code that controls if QUIT key is active or not for example

\ QUIT key enable/disable
HEX
: QUIT-OFF ( -- ) 83C2 DUP C@ 70 AND 10 OR SWAP  C! ;
: QUIT-ON  ( -- ) 83C2 DUP C@ 60 AND SWAP C! ;

 

  • Thanks 1
Link to comment
Share on other sites

2 hours ago, TheBF said:

 

You can control which interrupts will respond using the byte at address >83C2 

 


83C2 CONSTANT AMSQ      \ interrupt DISABLE bits
\ AMSQ bit meaning:
\ 80 all interrupts disabled
\ 40 motion disabled
\ 20 Sound disabled
\ 10 quit key disabled

 

Here is some Forth code that controls if QUIT key is active or not for example


\ QUIT key enable/disable
HEX
: QUIT-OFF ( -- ) 83C2 DUP C@ 70 AND 10 OR SWAP  C! ;
: QUIT-ON  ( -- ) 83C2 DUP C@ 60 AND SWAP C! ;

 

Right. Good deal

Link to comment
Share on other sites

Note.. my video didn't upload...

Video 1. Showing >83D6 in fact incrementing as normal.

After adding in my limi 2,0.

But I'm not sure if it was my routine that blanked the screen or not, so I'm running another test without my routine in Play this time.

Ok, Why does this happen???? Grrrrrr

After removing my routine to count and blank the screen, the built in timer/ blanker now works again as normal. I don't know why it didn't work last night after I tried this Same test but today it is in fact working, just like it's supposed to and it's just like I had it working before I removed the limi 2, last month,which, I should not have done..

But I tested , I know for a fact I tested this yesterday with the limi 2,0 in tact.

With no screen blanker happening, that's why I added my own routine.

AND I closed classic 99 several times and reopened, BUT never did I shut the machine down, that's the difference here today.

Ok...my bad... nothing to see here...it in fact works like it's supposed to.. sorry for the uproar about interrupts.

 

I did another time test, and the internal blanker kicks in at 9:07 while my blanker was kicking in at 10.0. and what was happening was that the internal blanker was kicking in and making mine look like it was coming on prematurely. Bwhhaha....

 

 

Edited by GDMike
Link to comment
Share on other sites

I just added a toggle, (ctrl S), that simply let's the timer run (enable screen saver),

OR during cursor blink (clears >83D6) disabling the screensaver from kicking in. 

I don't like Messing with the interrupts. 

(Had to adjust my delay a bit, slow fingers cause multiple S/S activation, deactivations)...lol

 

 

 

 

Edited by GDMike
Link to comment
Share on other sites

5 hours ago, TheBF said:

 

You can control which interrupts will respond using the byte at address >83C2 

 


83C2 CONSTANT AMSQ      \ interrupt DISABLE bits
\ AMSQ bit meaning:
\ 80 all interrupts disabled
\ 40 motion disabled
\ 20 Sound disabled
\ 10 quit key disabled

 

Here is some Forth code that controls if QUIT key is active or not for example


\ QUIT key enable/disable
HEX
: QUIT-OFF ( -- ) 83C2 DUP C@ 70 AND 10 OR SWAP  C! ;
: QUIT-ON  ( -- ) 83C2 DUP C@ 60 AND SWAP C! ;

 

I'm trying to figure this one out. 

I ended up with losing the quit function like I wanted, but also Lost sound.

Are you saying, place>7010 into address>83C2?

I haven't tried that... but I place >B2 and it got close to the desired fix.

Link to comment
Share on other sites

9 hours ago, GDMike said:

during cursor blink (clears >83D6) disabling the screensaver from kicking in

 

Cursor blink should not be clearing the screen timeout timer (STT). Are you doing that explicitly?

 

If you need to disable the STT during cursor blink between keystrokes, just store an odd number at >83D6 when you initialize the blink count.

 

...lee

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

9 hours ago, GDMike said:

Are you saying, place>7010 into address>83C2?

I haven't tried that... but I place >B2 and it got close to the desired fix.

Where did you get 7010 from?

B would take out everything except sprite motion. Don't know why you keep that running? And the 2 wasn't even mentioned.

What is it you are trying to accomplish?

  • Like 1
Link to comment
Share on other sites

15 hours ago, TheBF said:

Yes there are always some times when you don't want another interrupt to mess things up. Typically while you are in the bowels of the interrupt handler.

Disabling interrupt, at least of equal or less priority, is something the processor will do by itself, usually. That's true for the TMS 9900 as well. If you implement the full interrupt structure you have several prioritized interrupt levels.

If you then get an interrupt at level 8, a new interrupt at level 11 will not be serviced. But a new interrupt at level 4 will interrupt the service of the level 8 interrupt. When level 4 has been served, the CPU will return to level 8, and when that has been serviced, it will return to the main level, which immediately will interrupt at level 11, since that has not been serviced yet.

In the operating system for the TI 99/4A, they take advantage of the fact that there is a GPL interpreter running. Since the interpreter, just like the CPU itself, can't be interrupted in the middle of an instruction, the GPL interpreter will open for interrupts when it's possible to handle. That is, between instructions or when doing other stuff, which comes back frequently enough to allow service of the interrupt(s) within a reasonable time.

As I wrote above, the p-system does something equivalent.

Edited by apersson850
  • Like 2
Link to comment
Share on other sites

Just now, apersson850 said:

Disabling interrupt, at least of equal or less priority, is something the processor will do by itself, usually. That's true for the TMS 9900 as well. If you implement the full interrupt structure you have several prioritized interrupt levels.

If you then get an interrupt at level 8, a new interrupt at level 11 will not be serviced. But a new interrupt at level 4 will interrupt the service of the level 8 interrupt. When level 4 has been served, the CPU will return to level 8, and when that has been serviced, it will return to the main level, which immediately will interrupt at level 11, since that has not been serviced yet.

In the operating systems for the TI 99/4A, they take advantage of the fact that there is a GPL interpreter running. Since the interpreter, just like the CPU itself, can't be interrupted in the middle of an instruction, the GPL interpreter will open for interrupts when it's possible to handle. That is, between instructions or when doing other stuff, which comes back frequently enough to allow service of the interrupt(s) within a reasonable time.

Yes that multi-level interrupt system on the 9900 system is really nice IMHO.

 

The idea that the interpreter can't be interrupted is foreign to me coming from the Forth world.

Interrupts in Forth systems typically are reserved for things that truly must be dealt with in real time and since the context is living on stacks for the most part, changing context is pretty straightforward to handle an interrupt. I have done it on x86 for serial communication and on 68HC11 for a machine that counted baby chicks.  :) 

In both cases I was interrupting the Forth interpreter all the time and these were purchased Forth systems, not something I wrote. 

 

On 9900, where an interrupt can access it's own private register set, interrupting an interpreter should be easy, or am I missing something?

 

  • Like 1
Link to comment
Share on other sites

16 hours ago, TheBF said:

\ QUIT key enable/disable 
HEX 
: QUIT-OFF ( -- ) 83C2 DUP C@ 70 AND 10 OR SWAP  C! ; 
: QUIT-ON  ( -- ) 83C2 DUP C@ 60 AND SWAP C! ;

 

 

10 hours ago, GDMike said:

Ahh. I suppose that's it. Because it worked this time. I have my sounds AND stopped the "quit" function.

I hope I did this rt Brian, but I'm not seeing any side effects so far.. thanks for that info.

 

image.png.b6873a23e3bbb4463a0d2c50df814b85.png

 

A method to enable/disable <quit> should not disturb the other two toggles, console automotion and console sound processing. If the byte at >83C2 = >80,

  1. ANDing the byte with >70 gratuitously re-enables automotion and sound.
  2. ANDing the byte with >60 also gratuitously re-enables automotion and sound.

I would change QUIT-OFF and QUIT-ON to something like this:

\ QUIT key enable/disable 
HEX 
: QUIT-OFF ( -- ) 
   83C2 C@                                   
   DUP 80 < IF    \ all-toggles-off bit set? 
      10 OR 83C2 C!  \ no..set <quit> off bit
   ELSE         
      DROP        \ yes..nothing to do 
   THEN  ;

: QUIT-ON  ( -- ) 
   83C2 DUP C@                                      
   DUP 80 < IF    \ all-toggles-off bit set?        
      60 AND   \ no..clear <quit> off bit           
   ELSE
      DROP 60  \ yes..set all off bits except <quit>
   THEN
   SWAP C!  ;

...lee

  • Like 3
Link to comment
Share on other sites

3 hours ago, Lee Stewart said:

 

Cursor blink should not be clearing the screen timeout timer (STT). Are you doing that explicitly?

 

If you need to disable the STT during cursor blink between keystrokes, just store an odd number at >83D6 when you initialize the blink count.

 

...lee

Yes, exactly what I'm doing lee.im throwing a 1 at it to basically reset the counter in order to keep the screen FROM blanking during cursor timer routine. I guess I should just go to the kscan routine and throw the odd number at it instead. And save the routine from that area if cursor timing. Initially I did throw an odd number at it and watched the debugger and it just kept counting...I'll go back and try again.

 

Nevermind...it's early for me and I misunderstood your comment...I'll leave everything alone, as I'm already clearing the counter where it needs to happen..

Edited by GDMike
Link to comment
Share on other sites

16 hours ago, GDMike said:

I'm trying to figure this one out. 

I ended up with losing the quit function like I wanted, but also Lost sound.

Are you saying, place>7010 into address>83C2?

I haven't tried that... but I place >B2 and it got close to the desired fix.

 

He was ANDing >70 and ORing >10.

 

Since you are probably doing this in ALC, here it is that way (maybe it will be clearer):

*
* QUIT key enable/disable 
*     BL   @QITOFF or 
*     BL   @QUITON
*
QITOFF MOVB @>83C2,R0      all-toggles-off bit set? 
       JLT  QUITEX         yes..nothing to do but exit
       ORI  R0,>1000       no..only set <quit> off bit
       JMP  QUIT02         process bits
*
QUITON MOVB @>83C2,R0      all-toggles-off bit set? 
       JLT  QUIT01         yes..manage all toggles
       ANDI R0,>6000       no..clear only <quit> toggle
       JMP  QUIT02         process bits
QUIT01 LI   R0,>6000       set all off bits except <quit>
QUIT02 MOVB R0,@>83C2      store new settings
QUITEX RT

...lee

Edited by Lee Stewart
correction
  • Like 1
Link to comment
Share on other sites

1 hour ago, Lee Stewart said:

 

 

A method to enable/disable <quit> should not disturb the other two toggles, console automotion and console sound processing. If the byte at >83C2 = >80,

  1. ANDing the byte with >70 gratuitously re-enables automotion and sound.
  2. ANDing the byte with >60 also gratuitously re-enables automotion and sound.

I would change QUIT-OFF and QUIT-ON to something like this:


\ QUIT key enable/disable 
HEX 
: QUIT-OFF ( -- ) 
   83C2 C@                                   
   DUP 80 < IF    \ all-toggles-off bit set? 
      10 OR 83C2 C!  \ no..set <quit> off bit
   ELSE         
      DROP        \ yes..nothing to do 
   THEN  ;

: QUIT-ON  ( -- ) 
   83C2 DUP C@                                      
   DUP 80 < IF    \ all-toggles-off bit set?        
      60 AND   \ no..clear <quit> off bit           
   ELSE
      DROP 60  \ yes..set all off bits except <quit>
   THEN
   SWAP C!  ;

...lee

This is really cool as I never knew there was this type of control and handling available as were discussing. I'd never learn it if I hadn't of screwed it up originally, I think.. bwhhaha.lol 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...