Please indulge a dreadful RISCOS newbie question here, but how would I do that? I've looked around the !Boot folder, and can't find !CPUSetup anywhere that I can open as a BASIC file.theom wrote:(for an example, look at the BASIC code of the !CPUSetup program inside !Boot which does this to poke the processor registers)
Ah.pygmy_giant wrote:Thanks for all the info - how does one embed an SWI call into BASIC?
Specifically, how does one write / read from BSC I2C FIFOs via SWI ?
More generally, is there a reference resource explaining and describing SWIs ?
Code: Select all
SYS "Wimp_PollIdle",mask%,block% TO reason%
You can use BASIC with the IIC bus using SWI "OS_IICOp". If you go to the ROOL site and search for that name you will get all the detail. I wrote some test code in BASIC for the Ciseco SliceOfPI/O before I wrote similar functionality into a module with its own SWIs. I have uploaded this in a zip to http://www.kappa.me.uk/Lapdock/RPIO.zip. It is very short, but commented and might give you a flavour.pygmy_giant wrote: I would like to acheive this via BASIC for nostalgic reasons, but if that's not possible I might revert to C.
You could use BASIC libraries/extensions such as DrWimp/AppBasic/Basalt to program the WIMP. They hide a lot of the SWI specifics by providing providing wrapper functions (DrWimp, AppBasic) or new BASIC keywords (Basalt) that you can use instead of the raw SWIs.NigelJK wrote:If you need to interface with the WIMP (AKA GUI) then you're going to have to use SWI's all over the place anyway.
There is an ISO for the RISC OS 4.39 installation (160 MB) here:pygmy_giant wrote:More generally, is there a reference resource explaining and describing SWIs ?
The PDF's can also be downloaded directly from:SEDev wrote:There is an ISO for the RISC OS 4.39 installation (160 MB) here:
This is for the other branch of RISC OS so not much use with RO 5, but it does contain the PRMs (Programmer's Reference Manual) in PDF and HTML format, look in the 'Manuals' directory.
Yes, a comma!stylx wrote:I saw tank's module, looks great. But how do you use it. I install the module with RMLoad and it work's great , but How do I use it from basic.
I tried SYS "GPIO_WriteData" 7, -1 and some other combinations but keep getting a error.
is there a chance tank could give us a 101 on GPIO module he wrote.
Or am I missing something
The versions of BASIC you will find on the Pi allow R0 to R9 to be passed and returned.Burngate wrote: In BASIC you can use R0 to R7 inclusive, though the routine can use R8 and R9 as well (according to RISC OS 3 PRM vol 1 p.23)
I downloaded it out of curiosity, and was very impressed by the speed that it loads. Unfortunately, this was the first time I've ever seen RISC OS, and didn't really know how to proceed. I managed to get a connected, re-configured range-extender to get me on the network (no WiFi support, it seems) but that's about it. How do I:liz wrote:... and I hope some people will download it over the weekend out of curiosity!