marc.hull Posted October 17, 2013 Share Posted October 17, 2013 Awhile back (early July) there was some discussion about checking the VDP interrupt through the 9901. Tim posted an example and I simply cannot find it (albeit my search skills suck.) Anyone know what I am talking about and mind pointing it out please ? Marc Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/ Share on other sites More sharing options...
+Lee Stewart Posted October 17, 2013 Share Posted October 17, 2013 Awhile back (early July) there was some discussion about checking the VDP interrupt through the 9901. Tim posted an example and I simply cannot find it (albeit my search skills suck.) Anyone know what I am talking about and mind pointing it out please ? Marc It was late in this thread: http://atariage.com/forums/topic/210888-smooth-scrolling/ ...lee Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849222 Share on other sites More sharing options...
matthew180 Posted October 17, 2013 Share Posted October 17, 2013 The the Smooth Scrolling thread (as mentioned), but specifically posts 155-156 and 173-175. Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849226 Share on other sites More sharing options...
marc.hull Posted October 17, 2013 Author Share Posted October 17, 2013 (edited) Ok, thanks.... I found the code Tim posted and it follows (Might get mangled)..... wait1 clr r12 wait2 tb 2 *VDP interrupt (poll 9901) jeq wait2 *no, keep waiting sbo 2 *yes, clear 9901 bit/VDP interrupt movb @8802,r0 *read status from VPD rt I have duplicated it on a console and I cannot get it to behave correctly. It acts like the interrupt is constantly being presented but I don't know if the code is not quite correct or if my implementation is causing a problem. While it is executing the interrupts have been turned off using LIMI 0 but my understanding is that this only prevents the 9900 from seeing them. Surely this instruction does not interfere with the VDP to 9901 line perhaps ? At any rate, If someone has included this code successfully would you please report that. Thanks <EDIT> Just occurred to me that between the last time I tried to get it to work and now I had to change the 9901 in the console because it stopped picking up some keys. Maybe the cause cause I can't why the code would not work. I'll try again this evening.. <UNEDIT> Edited October 17, 2013 by marc.hull Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849241 Share on other sites More sharing options...
Stuart Posted October 17, 2013 Share Posted October 17, 2013 (edited) Doesn't it need to be >8802 (with a ">") in the second to last line? I don't think you need the SBO 2 as you're only reading the state of the input bit, not using it to generate an interrupt. If you're interested, I've put a 'tutorial' on using VDP interrupts on my TM990 system at <www.avjd51.dsl.pipex.com/tm990/tm990.htm#using_vdp_interrupts>. I've got the VDP interrupt connected to a TMS9901 in the same way as the 4A, but you can't use this technique directly on a 4A because you can't (easily) change the interrupt vectors at the bottom of memory. Edited October 17, 2013 by Stuart Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849324 Share on other sites More sharing options...
marc.hull Posted October 17, 2013 Author Share Posted October 17, 2013 Thanks Stuart. Of course it should be in hex notation, you are correct. I am not getting that far though. It gets caught in an endless loop waiting for CRU bit 2 to be low. Tim's bit 2 has been verified by both the Explorer manual and Thierry's site. Code looks good so I'm befuddled. Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849477 Share on other sites More sharing options...
Stuart Posted October 18, 2013 Share Posted October 18, 2013 Have you before that done anything with the VDP register 1? Could you have inadvertently cleared the Interrupt Enable bit in the VDP? Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849503 Share on other sites More sharing options...
marc.hull Posted October 18, 2013 Author Share Posted October 18, 2013 I'm not there to look right now but I doubt it as I can still get the interrupt through the >8802 memory location with...... test movb @>8802,r1 andi r1,>8000 jeq out *** delay to reduce race (>02ff count down loop) *** jmp test out rt 9900 interrupts are turned off in the code with LIMI 0. I'm not actually looking to use the interrupts but rather trying to detect them when they occur without the delay nor possibility of the read/write clash. Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849742 Share on other sites More sharing options...
Stuart Posted October 18, 2013 Share Posted October 18, 2013 Ah, but that's reading the interrupt flag in the VDP status register. Whether that signal leaves the VDP chip and goes down the bit of wire to the 9901 is controlled by the IE bit in register 1. In other words, the fact that you can read the interrupts from the status register does not necessarily mean that those interrupts are getting to the 9901. Try loading the value >E0 into register 1 just before your bit of code, and see if it still loops forever. Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849807 Share on other sites More sharing options...
marc.hull Posted October 18, 2013 Author Share Posted October 18, 2013 Ah, but that's reading the interrupt flag in the VDP status register. Whether that signal leaves the VDP chip and goes down the bit of wire to the 9901 is controlled by the IE bit in register 1. In other words, the fact that you can read the interrupts from the status register does not necessarily mean that those interrupts are getting to the 9901. Try loading the value >E0 into register 1 just before your bit of code, and see if it still loops forever. My reg 1 set up is >E2 so that bit is covered. Any ideas ? Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2849992 Share on other sites More sharing options...
+InsaneMultitasker Posted October 18, 2013 Share Posted October 18, 2013 My reg 1 set up is >E2 so that bit is covered. Any ideas ? I seem to recall not being sure I had the SBZ/SBO properly set up in my sample code. If I have a chance, I'll go find my original code for comparison. You set LIMI 0, right? Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850021 Share on other sites More sharing options...
+Lee Stewart Posted October 18, 2013 Share Posted October 18, 2013 My reg 1 set up is >E2 so that bit is covered. Any ideas ? I don't know whether this affects your situation; but, did you put the value (>E2) in >83D4 before stashing it in VR1? ...lee Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850032 Share on other sites More sharing options...
Stuart Posted October 18, 2013 Share Posted October 18, 2013 (edited) Hmmmm ... not sure. Try inserting after your CLR R12 this little bit of code from Thierry's site which checks the <Enter> key, to confirm that at that point in your code you're able to read the INT bits on the 9901 ... CLR R1 Test column 0 LI R12,>0024 Address for column selection LDCR R1,3 Select column TB -13 Test R12-address >000A, i.e <enter> (then depending on how the bit is set, use VSBW to write either one character or another to the top left of the screen, then loop round again) So with that loop running, do you get a different character displayed when you press/release the <enter> key? Edited October 18, 2013 by Stuart Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850036 Share on other sites More sharing options...
marc.hull Posted October 18, 2013 Author Share Posted October 18, 2013 I seem to recall not being sure I had the SBZ/SBO properly set up in my sample code. If I have a chance, I'll go find my original code for comparison. You set LIMI 0, right? yes no lemmings .... Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850064 Share on other sites More sharing options...
marc.hull Posted October 18, 2013 Author Share Posted October 18, 2013 I don't know whether this affects your situation; but, did you put the value (>E2) in >83D4 before stashing it in VR1? ...lee Well that's a good idea but I'm not using KSCAN...... Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850065 Share on other sites More sharing options...
marc.hull Posted October 18, 2013 Author Share Posted October 18, 2013 Hmmmm ... not sure. Try inserting after your CLR R12 this little bit of code from Thierry's site which checks the <Enter> key, to confirm that at that point in your code you're able to read the INT bits on the 9901 ... CLR R1 Test column 0 LI R12,>0024 Address for column selection LDCR R1,3 Select column TB -13 Test R12-address >000A, i.e <enter> (then depending on how the bit is set, use VSBW to write either one character or another to the top left of the screen, then loop round again) So with that loop running, do you get a different character displayed when you press/release the <enter> key? I am swapping this routine in to a working bit of code so if you are looking for a hangup somewhere else then I'm afraid that's not the case. There is a definite disconnect between the VDP and the 9901. If your wondering if perhaps the 9901 is not set to accept interrupts then I have wondered the same. I am using thierry's code to detect the joysticks. I am beginning to wonder if I am missing something with resetting up the 9901 when exiting the joy stick sub ??? I have blatantly lifted his code so it is available on his site. Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850073 Share on other sites More sharing options...
Stuart Posted October 18, 2013 Share Posted October 18, 2013 Try putting a SBZ 0 after the CLR R12, just to make absolutely sure the 9901 is in interrupt mode rather than clock mode. Clutching at straws here! Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850104 Share on other sites More sharing options...
+InsaneMultitasker Posted October 18, 2013 Share Posted October 18, 2013 I tried the code and discovered in a stand-alone situation it got stuck in an endless loop. The 9901 interrupt line was not receiving the signal. To fix, I needed to set VDP register 1's IE bit as Stuart recommended earlier. You will also need to read the VDP status byte to properly clear the 9918 interrupt. SBO 2 (9901) is there to enable the 9901 output, which allows you to detect the interrupt via the TB 2 instruction. Seems the 9918 interrupt is not being presented via the 9901 for some reason. If the 9901 were bad the OS interrupt routine would fail along with automotion and other ROM-specific code. Sounds like you may be mucking up VDP Reg 1. That's my current theory Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850109 Share on other sites More sharing options...
+InsaneMultitasker Posted October 19, 2013 Share Posted October 19, 2013 Here is the test code. It spins for 5 seconds then returns. LIMI 0 LI R1,>0170 VDP Reg 1, Enable IE bit.(mode bits may vary) BLWP @VWTR CLR R12 9901 base cru SBO 2 vdp int via 9901, enable LI R1,60*5 duration in 60th of a second slice WAIT1 CLR R12 WAIT2 TB 2 vdp interrupt? (via 9901) JEQ WAIT2 no, spin and wait SBO 2 enable 9901 int (tests show this may not be needed) MOVB @VDPST,R2 read status to clear 9918 VDP Interrupt DEC R1 counter expired? JNE WAIT1 no, tick off another 60th of a second BLWP @0 1 Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850118 Share on other sites More sharing options...
marc.hull Posted October 19, 2013 Author Share Posted October 19, 2013 Here is the test code. It spins for 5 seconds then returns. LIMI 0 LI R1,>0170 VDP Reg 1, Enable IE bit.(mode bits may vary) BLWP @VWTR CLR R12 9901 base cru SBO 2 vdp int via 9901, enable LI R1,60*5 duration in 60th of a second slice WAIT1 CLR R12WAIT2 TB 2 vdp interrupt? (via 9901) JEQ WAIT2 no, spin and wait SBO 2 enable 9901 int (tests show this may not be needed) MOVB @VDPST,R2 read status to clear 9918 VDP Interrupt DEC R1 counter expired? JNE WAIT1 no, tick off another 60th of a second BLWP @0 I think may shit the bed on my reports. Before I come off the top rope at you gents I'd like to check my facts. time out ???? Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850142 Share on other sites More sharing options...
+InsaneMultitasker Posted October 19, 2013 Share Posted October 19, 2013 Should we all quickly run out and buy stock in bed sheets and cleaning supplies????? Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850152 Share on other sites More sharing options...
marc.hull Posted October 19, 2013 Author Share Posted October 19, 2013 Should we all quickly run out and buy stock in bed sheets and cleaning supplies????? Nope...... This seems a dead end....... Doesn't work on the gear.... Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850193 Share on other sites More sharing options...
+InsaneMultitasker Posted October 19, 2013 Share Posted October 19, 2013 (edited) Nope...... This seems a dead end....... Doesn't work on the gear.... Post some code? What I posted above does work on real gear here. Edit: I should clarify this works on my Geneve both in Geneve mode and in TI mode. The 9901 and VDPINT lines are set up in the same fashion between the 4A and Geneve, for compatibility with joysticks, VDP, etc. I could not test (yet) on my TI. Edited October 19, 2013 by InsaneMultitasker Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850197 Share on other sites More sharing options...
marc.hull Posted October 19, 2013 Author Share Posted October 19, 2013 What I posted is what was run....... Don't think the TI passes the VDP interrupt to the 9901 like it says it should. At least after a LIMI 0...... Could be I don't understand the 9901 either ? Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850201 Share on other sites More sharing options...
+InsaneMultitasker Posted October 19, 2013 Share Posted October 19, 2013 Maybe someone else can do a tie-breaker and test the code I posted around 7pm. The code you posted is a little different than my post today. 1 Quote Link to comment https://forums.atariage.com/topic/217747-cant-find-something/#findComment-2850202 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.