Closed rickcollette closed 3 weeks ago
for some reason i could not find the original question - now i can.. closing this as "holy cow i cant use the internet..."
Devices work with IOCBs (IO control blocks).
You also have channels so that you can open more than one at a time.
I don’t know fastbasic, but the below looks like you are using channel “modem” for the open, but then channel 1 for the XIO call, and “#modem” is defined as 2.
So you are opening using channel 1, and doing XIO with channel 2 if I am interpreting that correctly.
It is also good practice to check the error returns from each of open and XIO. For example, if the channel is already open any something else, you’d get an error. The XIO may also be returning a useful error code that would help you debug the code - for example, “not open”.
On Nov 3, 2024, at 1:44 PM, Rick Collette @.***> wrote:
PROC ModemStatus OPEN #Modem,13,0,"R:" XIO #1,13,0,0,"R:" X = PEEK(749) Y = PEEK(747) Z = PEEK(748)
Yeah - thank you - oversight in the paste i did.. forgot to change the #1 to #Modem.
So whats happening, those valuse for 747 and 747 increment up to 32; then sit there. Even after a disconnect - which it does not seem to to want to recognize - altirra just locks up. I am using the altirra RHND850 for the r:handler.
have not tried on real hardware.
Hi!
I am trying to get the R: device to work properly.
However, I cannot seem to duplicate the functionality of Atari BASICs "status" command.
I see that you already answered this part.
But I have some comments on your code:
' Trying to duplicate Atari Basic STATUS command ' Define constants and initialize variables PROC InitializeVariables ' Constants C0 = 0 : C1 = 1 : C2 = 2 : C3 = 3 : C4 = 4 : C5 = 5 : C6 = 6 : C7 = 7 : C8 = 8 : C9 = 9 C10 = 10 : C13 = 13 : C14 = 14 : C16 = 16 : C24 = 24 : C32 = 32 : C34 = 34 : C36 = 36
This will produce bigger and slower code in FastBasic that simply using the constants as is.
Loading the number 0 or 1 uses one byte. Loading numbers from 2 to 255, uses two bytes. Loading the value from one variable, also uses two bytes, but it is slower than a number.
So, this will only make your code smaller if you are using this for numbers bigger than 256, were loading the number will be 3 bytes, and only if you use the number may times.
Have Fun!
Thats awesome to know - I always had a dislike for that bit in atari basic. This will make it cleaner for me.
I am trying to get the R: device to work properly.
However, I cannot seem to duplicate the functionality of Atari BASICs "status" command.
In atari basic, we would request status of IOCB,intvar
Then we could peek at the memory location (747, 748, 749)
I have been trying to accomplish this via XIO; but I'm just not getting the result i am hoping for. Ultimately, I would love to tell when there is an incoming call to R:, then perform some action based on that.
I have been trying for a couple of days to get this nailed down. After a lot of trial and error, this is what I have arrived at, but it is not working either.
Maybe someone else can explain this to me?