Showing posts with label RISC OS. Show all posts
Showing posts with label RISC OS. Show all posts

Moon Phase Program

Need to know when the next few phases of the moon will be?

Time and Date dot com will give you an accurate and reliable moon phase data, should you, for example, be a werewolf. In this case, knowing the exact minute of your upcoming transformation, I imagine, would be incredibly useful information.

I am not a werewolf (to my knowledge), but I am interested in astronomy, ancient computers and a bit of paganism. Therefore, this post is about a different Moon Phase application I often run on my BBC microcomputer and Raspberry Pi running RISC OS.

I hope this post will be of use to amateur astronomers, pagans and lycanthropes everywhere. Following the phases of the moon not only provides great evidence that the world is not a flat plane but studying our celestial neighbour is very relaxing. The moon is more than just a heavenly calendar. Really.

I originally found this program on a disk of public domain software, and it was originally adapted by D. Ambrose from that given in Microsoft QuickBasic 4.5 in Chapter 1 of Numerical Recipes in Basic by J. C. Sprott, CUP 1991. I have adapted the code slightly so that it picks up the time from the BBC micro's inbuilt battery-backed clock, and I also included some nifty 8-bit graphics for the moon phases. I have also changed the date format so it uses the (more correct) IEEE standard (follow that link for an in-depth rant about the subject).

Moon Phases running on the Beebem BBC micro emulator (Note, that this BBC has not been adjusted for the millennium bug as to my knowledge it is NOT 1999 all over).

Moon Phases running on my desktop PC in BBC BASIC for Windows.

I am assuming that this program remains in the public domain, and so I present it here. You can download the code from my OneDrive, and the directory includes:

  • A BBC microcomputer disk image; 
  • BBC BASIC for Windows source code; 
  • a Windows executable file (totally not a virus!); 
  • RISC OS application for Raspberry Pi, 
  • and the source code in plain text for you to do whatever you want with. 


Have fun now.


Could win an award for the best comment ever?

+1 Geek experience points awarded to J. C. Sprott and D Ambrose.

This is all for today, but if you like this sort of thing, then you might like other posts about the BBC microcomputer, or Raspberry Pi. Maybe you just want something completely different, or you are feeling brave enough to click this link.

RISC OS web server

If you have read this blog before (and I am pretty sure at least one person has) you will know that I am a big fan of RISC OS on Raspberry Pi.

RISC OS is an operating system that has the 'look' of  Linux and the 'feel' of the BBC microcomputer. I have delved into various aspects of RISC OS Pi before.

Whilst looking for web server solutions for RISC OS, I recently discovered WebJames. WebJames is a server with an integrated PHP interpreter. It is available in the PackMan package manager and it is really easy to use. In this post I will show you how to set it up (really easy) and get going as a hoe server.

Once you have finished installing from PacMan, all you need to do is provide a folder called 'Site' and you are good to go.
Packman installs WebJames into :0.$.Apps.Web, however, you can easily move it to any location you like. As most of my files are stored on a removable USB stick, I've put WebJames there. This has got to be the simplest web server ever. No complex configuration; no mucking about with Linux; simply launch the server and point it at some HTML files. As long as WebJames is running on the pi it will dutifully listen on port 80 for any requests.

PackMan (not Pac-man)
There is also an example code package which is worth exploring.

I've only just scratched the surface of what we can do with WebJames, but I am certainly glad it exists.

The first thing you might want to do is create a test site. Here I have provided a new HTML file called index and placed it in the 'site' folder. The test page has a single link that opens a folder called 'files' (useful for grabbing files from the pi onto another machine).

The index test page is shown in StrongEd for RISCOS (although I actually wrote this in qedit for DOS under DOSBox for that extra geekiness).


My first test page running on my Samsung Galaxy Note. Not very exciting, just a link to a folder.

Directory listing of files on the server.

To view your web server test page on your home network, simply point your browser at http://your IP address, for example, mine is http://192.168.1.218

To view your page on your Raspberry Pi instead, try http://127.0.0.1

Well, that's all for today. We have only dipped our feet into the RISC OS server waters. I hope somebody found this a useful guide. I am certainly looking forward to doing more with this software. In fact, the Apache web server I have running on my second Pi is the only reason I actually have a second pi running at all. WebJames really makes RISC OS more and more attractive as an operating system. Oh, and did I mention that you can use BBC BASIC as a server-side scripting language?

If you enjoyed this post, then there is a slim chance you will enjoy this post about my experience of RISC OS on Raspberry Pi, or that time I installed DOSBox on Raspberry Pi, or even something completely different.

DOSBox for RISC OS

I have recently discovered that DOSBox is available for RISC OS. If you didn't already know, DOSBox is an x86 emulator that lets you run all of your favourite DOS software on a wide variety of platforms - including Raspberry Pi's running RISC OS.

This post will primarily deal with DOSBox running under RISC OS, but it is hoped that my reader will immediately go and grab a copy for her own OS, if not get the wonderful RISC OS installed on Raspberry Pi, like, this minute.

How to install
Simply find DosBox in the '!PackMan' package manager. What are you waiting for?

Getting started
The first thing you will want to do is create a folder on your Pi for all of your delicious DOS programs. The next step is to map this folder to a drive in DOS.

When you first launch DOSBox, you will see the Z: drive. There is not much you can do here. The names of your drives will be different, however on my machine:

mount c SDFS::RISCOSpi.$ (maps the Pi SD card as 'C:' drive)
mount d Fat32fs.RISCDISC.$ (maps my 'RISCDISC' flash card as 'D:' drive)
mount a RAM::RAMDISC0.$ (maps the ram drive as 'A:' drive)

If you need a primer in DOS commands.

To change to a new drive, type drive letter followed by a colon:

A: (will change to drive A)

To navigate to a new sub-directory:

cd directoryName

To move up one level:

cd..

To run a program, look for a .exe .bat or .com file (and type it)

To read a text file:

type filename

To get a directory listing

dir
or
dir /p (paged mode)
dir /w (wide mode)

For more help with DOSBox, type 'help'.


The software
This is the reason you want DOSBox, to run all of that amazing software written before 1990 (before Ant and Dec were a thing and when MTV was actually about music).

I spent this morning raiding my IBM 286 PC for games and apps that I'll probably want to run under RISC OS. Here is some of my DOS software running on my Raspberry Pi:

One of the ubiquitous chess programs for DOS. This one is quite good. I'm going to let it beat me later.

I have no idea what I am doing but I'm glad I get to fly around in a spaceship that looks like it has been drawn by my ten-year-old nephew.

Dangerous Dave, no relation to Rik Dangerous, or Danger Dog.

Well Done, Dave!


Can you defeat the invaders' dastardly 'move right... then move left' strategy?

''Wilbling Wilf was a favourite of mine. Written by now computer security expert Graham Cluely @gcluely. The aim of the game is to guide Wilf through all infinity levels dopping jam from your leaky jam sandwich, whilst not getting eaten by the evil Glumphs!

Intra-Galactic Battles. I often dust this off and have a battle

Intra-Galactic Battles. Did someone say Startrek? It's okay, some of the ships look like they have been copied from Starwars too. Nevertheless, this is a truly awesome game. You choose to build ships from one of four different races and then go toe-to-toe in a slugging match of resource management against the computer.

Yay! ASCII clock and calendar. I don't know why I don't do a blog post about ASCII clocks. Oh, wait, I already have.

There is now even more reason to leave your Raspberry Pi switched on all day. Relax as you watch the virtual fish tank do its thing. Can you see the little snail?

Hello

Problems
As with most emulators, you will find some of your software does not run as expected. I encountered a few programs that would disable the mouse in RISC OS, or cause the whole system to freeze. On the whole, software tended to behave itself.

The sound emulation sometimes goes a lot wrong. Typically adjusting the emulated system speed will fix this problem. You can speed up and slow down the emulation (essential for Wilf) using CRTL+f11 and CTRL+f12.

You will also probably want to drop the resolution of RISC OS. Click on the monitor icon on the bottom right of the icon bar and select 800 x 600 for an authentic experience, depending on your own hardware.

Th...th...th...th...that's all folks!
If you enjoyed this post then you should go and get DOSBox installed on your Raspberry Pi. If you are sticking around for a bit, then you might like to read some posts about Intra-Galactic Battles, or just something completely different.

Search for the most precious substance in the universe


Who thought it was unobtainium?

Riemannian is a text-based space adventure game written in BASIC. I am not certain of its origins but it was converted to BBC BASIC by Janny Looyenga (and I think it was released as either a Beebug, or an Acorn User magazine disk).

I have just spent my afternoon converting it to run on the Raspberry Pi under RISC OS and subsequently on the PC under BBC BASIC for Windows.

In Riemannian, you control a spacecraft, which teleports randomly around a text-based Teletext universe. You have three resources that need to be managed: oxygen, fuel and provisions. Your quest requires you to mine as much of the elusive riemannian ore before your resources run out and you are unceremoniously dumped back to the BASIC prompt.

On your journey, you will encounter aliens, both friend and foe. Some will wish to sell you commodities, whilst others try to blow you away with their laser guns and robot slaves. There are also some other special encounters, but I wouldn't want to spoil your fun of encountering these yourself.

This world is very notable for the Uslian tree ant and its inhabitants' exceptional loathing of sit coms

I have covered how to convert BBC microcomputer programs to RISC OS BASIC programs in another post.

The main problem I had to overcome is the fact that, in Riemannian, much of the gameplay is time-based. You have to press the right key at just the right time to zap an alien or mine the planetoids. Upon inspection of the code, two facts became obvious. Firstly, the code was a horrible mess of spaghetti (probably indicating that it originated on a less elegant 8-bit machine to the BBC micro) and second, much of the timing revolved around how many loops the computer could perform whilst waiting for your input. As my target machine, the Raspberry Pi, is a much faster machine, I had to alter these timing loops so the original gameplay was restored. I think I have managed whilst also making the game a little more forgiving than the original.

From a time when mining was much more about guesswork (just like modern Fracking).

+1 Geek Experience Point awarded to by Janny Looyenga for the original BBC BASIC conversion.

I am going to assume that due to its age, Riemannian is currently in the public domain. So you can download a copy from my OneDrive. If you are the owner of Riemannian, and it is your sole source of income, then I am really sorry and I will remove this link as soon as you get in touch.

I've provided four versions:

  • A RISC OS BASIC file
  • A plain text file containing all the code
  • A BBC BASIC for Windows file
  • A Windows executable file (it is totally NOT a virus, but if you are in doubt run it in a sandbox such as Virtual Box rather than trusting a strange blogger on the Internet).

If you enjoyed this post, then that is it, you have reached the very bottom of the Web, but you might like some other conversions of ancient BASIC programs, such as this one, or this one, but especially this one.

That's it for today. I will be back later for more geeky stuff - stay tuned!

Stuff you can do with RISC OS for Raspberry Pi

My avid reader will know that I am a big fan of running RISC OS on Raspberry Pi.

I have already written a post answering whether you can use RISCOS as your main computer. The answer was yes (sort of). If you were not convinced then this is a post about stuff you can get your RISC OS Raspberry Pi computer to do right away.

Never forget to go to work again!
Shown above is the alarms section of the clock application and it is a surprisingly good alarm system. You can set multiple alarms, including specific dates of the year on various recurring patterns. There are two things I like about this. First, by having it in the 'run at startup' folder you get an analogue clock with seconds hand in your icon bar - as close to a 'live tile' as you will get in RISC OS Pi. Secondly, you can have multiple alarms (I am not sure what the maximum is) and alarms can seemingly be set years (months, weeks or days) into the future. There are options for 'working week', 'repeating alarms'. There is a 'Task Alarm' which allows you to boot up another RISC OS Pi app at the particular time of the day - for example, to load the radio player just in time for the shipping forecast. Simply drag the appropriate app into the alarm dialogue box. This includes your own BASIC programs as well (rather exciting, no?) Repeating alarms can be programmed to run on particular intervals, or on the first Sunday of each Month.



Calculator
As you might expect, RISC OS has a calculator app, and it is as good as any you will find on your 'other' desktop machine or phone. Shown here is the programmer's calculator should you need to perform a left shift on a nibble, or whatever.



Happy New Year! What? Not another one!
As desktop calendars go, it is not as good as Window's 10 calendars with Outlook integration, but if you need to know the date of the next Friday before payday, then this will do plenty. It is also highly customizable, and I think the result looks good. Some operating systems don't even have a desktop calendar - I'm looking at you, ChromeOS!



NetRadio - highly recommended. 
My longtime reader will know that one day I hope to have a second reader on this blog. They will also know that I like to listen to a wide range of music as I sit back and relax with some knitting. The NetRadio app turns your RaspberryPi into an internet radio (oh, and before you ask, I don't record the top forty onto compact cassettes anymore, honest).



It's notepad
One of the main roles for my Raspberry Pi is to simply keep notes, records, and calculations. Between the simple but powerful StrongEd text editor (shown above) and PipeDream, RISC OS has this basic computing job covered. Pop over to the task window (F12) and you can navigate your text file library using the *BUILD <filename> and *TYPE <filename> commands. This, obviously, makes you feel more like a hacker even though you are really just writing your thank you letter to Santa. StrongEd is a little more than Notepad for RISC OS, featuring spell checker, split screen and various other features for the power user to enjoy.



Sometimes you need to know the distance to the shops in astronomical units.

Convert is my go-to app for converting various units. There are loads of units available, I'm just showing a small selection of the 'less common' ones.



Brrrr
Weather UK is an app for showing simple weather data for various cities in the UK.The data comes from the BBC weather feeds and clicking on the text will bring up a forecast in your browser.

And that's not it! One really awesome feature (for me at least) is that RISC OS will run most of your favourite BBC BASIC applications. I have already written a post all about this and I am currently in the process of converting various files from my BBC master 128 onto the Raspberry Pi. No doubt I shall be back really soon to write about this.

If you enjoyed reading this post, then do please share it with your friend. It would be great to have two readers! If you don't have a friend, then no worries, you might like to read about data logging on Raspberry Pi, or something random but similar.

Until next time...

Can you use RISC OS as your main computer?

The short answer is yes, sort of, but mostly yes.

The RISC OS desktop on Raspberry Pi showing the 'pinboard' and 'iconbar'

In my post on using the BBC Micro as your main computer, we decided that for a computer to be of any use, it must be able to do the following well:

  • Connect to the Internet and have a fast, secure browser.
  • Provide applications for workflow.
  • Provide applications for playing media files.

We'll look at these in turn, but first some information about this Operating System.

RISC OS was originally developed for the Acorn range of 32bit RISC computers in the late 1980s. That makes it older than 'Red Nose Day', GCSE examinations and the movie 'Die hard'. It was a time when plaid shirts were fashionable for men. If you turned on the radio you would suffer songs by Bros and Enya. Whereas you need not suffer Bros and plaid shirts anymore, RISC OS has continued to be developed to this day and is available for RISC architecture machines including the Raspberry Pi. In this post, I will be referring to RISC OS running on my Raspberry Pi 2.

This operating system is an advanced GUI-based operating system although many of its features will appear strange or unexpected to a modern user who has, perhaps, become habitually used to Windows or Linux. Nevertheless, despite its quirks, RISC OS is a joy to use. But can it be your main computer?

The Internet

The Raspberry Pi does indeed connect to The Internet, however, RISC OS will only support wired ethernet connections. The onboard wireless adapter will not work here.

Many of the applications for RISC OS are available through the online Pling store or the package manager. Some of these applications use network connections with little difficulty as you might expect from a modern OS. Sadly there are no applications for linking to your DropBox, OneDrive, Google or other cloud services. I use a second Raspberry Pi as a home file and web server and this serves files to the RISC Pi with ease.

The default web browser is NetSurf which is a little underdeveloped. Most modern web pages fail to render properly. JavaScript does not run and you can forget about Flash, other plugins and all your favourite browser extensions. It is possible to install a version of Firefox, however, it requires several dependencies that I am repeated failing to install properly. After a few hours of trying I have finally given in, but I may return to that at a later date.

My Blog as shown in NetSurf


Workflow

What your RISC machine can do here really depends on your workflow, however RISC OS is more capable than the BBC Micro so I shall cover some of the capabilities you might need.

For word processing, spreadsheets, text files and database work, RISC OS has a number of applications that are free (as in free pizza) to download from the Pling Store (or indeed, might even be bundled with your software distribution). Most notable applications are Fireworkz, PipeDream and StrongEd. It is worth noting that I don't do much word processing on the RISC machine, and none of these applications beat the Microsoft Office 365 suite on my Windows machine. Nevertheless, all of these applications are capable enough of being your workhorse. Fireworkz can open Rich Text Format files, so if you need to open your world domination plan from MS-Word, you may need to do some editing or conversion first.

Unless you are migrating thousands of files from Office 365 to RISC OS, you will find that your Raspberry Pi will be totally capable of most jobs here so I'm going to call it a 'pass'.

It is worth mentioning that I use my RISC machine to take and keep various notes. This can easily be achieved as an OS task. Simply hit CTRL+F12 to bring up a task window and type:

*build <filename>

Press ESC to finish.

A demo of Fireworkz as a spreadsheet program

If your workflow includes image editing or audio editing, then there are a number of applications available for you here, although nothing to beat your professional applications on your modern PC. Also, don't expect your favourite open source applications (GIMP, Audacity etc) to be available under RISC OS. That said, your RISC machine will perform this kind of workflow well, so it's another 'pass'.

It is highly likely that you will want to read a PDF document on your RISC machine. This is possible under the public domain PDF file viewer for RISC OS, however, I have noticed that it has failed to render some files that work perfectly well under Adobe and Edge on my Windows PC. Having said that, most documents have opened without problem on my Raspberry Pi, so we shall call this a 'pass'.

RISC OS PDF viewer showing a couple of PDF files displaying beautifully on my Raspberry Pi 2.

Media

I will skip to the end. It is a surprising 'pass'. In fact, I use RISC OS primarily as a media machine. The NetRadio application is perfectly capable of handling your internet radio needs, as well as being able to play MP3 format files. I think I once wrote a post about how I threw my DAB digital radio over the side of my ship after installing RISC OS.

Net Radio, perfectly capable of catching the BBC 4 puzzle for the day over your cornflakes as it is playing your pirate metal songs in the evening.
As for video files. I have managed to get MPG format files to work perfectly. Other formats with some difficulty or not at all.

My Pi


There are plenty of other applications available for RISC OS with many in active development. I generally have WeatherUK open at all times for my three-day forecast.

WeatherUK for your UK weather needs. Yes, it is snowing today, in March.

One of many useful apps for RISC OS
BASIC

One of the best features of RISC OS is that the BBC BASIC language is built right into the operating system. Whether you want the system to learn to program, so you want to write applications to get the computer to do what you want it to do, then BASIC is a good option. Simply press F12 and type:

BASIC

To exit the BASIC terminal and return to your desktop, type:

*DESKTOP

I have already covered BBC BASIC in RISC OS in another post, so I won't go into details here. You can also install a version of RISC OS (Pico) which boots directly into the BASIC prompt without any of the graphical 'fluff' discussed so far in this post.

Well, there it is. RISC OS will quite happily serve as a main computer based on the criteria we specified at the top of the page. If you haven't already explored it on your Raspberry Pi, then I thoroughly recommend it. You might find that you have other needs that I have not covered in this post, and you might also be equally surprised to discover that RISC OS has your back here as well.

If you enjoyed this post, and even if you haven't, then you might like (or hate) to read some more RISC articles on this blog. Maybe you just want to write a sticky note and pin it to a virtual board on the internet? Maybe you just want to kill some orcs?

BBC BASIC on Raspberry Pi

Recently I wrote about setting up RISC OS Pi for Raspberry Pi. One of the good things about RISCO OS is that it has a built in BASIC interpreter which is backwards compatible (mostly) with your BBC micro computer BASIC.

One way of running BBC software on your Raspberry Pi is to use an emulator, however it is also possible to run 'beeb' BASIC programs from your pinboard or command line, as this blog post will attempt to show.

RISC OS pinboard showing native BASIC apps and a stormy day in Scarborough.

Whether you choose to run the emulator, or run BASIC as native programs, your first port of call will be some BBC disc images. You might choose to download your BASIC disc images from the internet, or you may already have them on your vintage beeb machine. This post will cover both situations.

  • First load your disc image into your BBC emulator on your PC. I will be using the excellent BeebEm emulator for Windows.  To do this select: File > Load Disc 0 and find the disc image in your file explorer. The disc image will now be loaded into a virtual drive in your emulator. To see the files, type *cat in the BASIC command line.
Load your disc image into your emulator.
  • Export the BASIC programs that you want from the disc image. BeebEm provides you with the option of exporting a file from your disc image onto you PC. Save this onto a USB flash drive.  To do this select: Edit > Export Files from Disc > Disc 0

Export the BASIC files from the disk image onto a USB device.
  • Rename the file that has been exported. You don't want the DFS directory information showing. For example, change $.file to file only.
  • Plug the USB device into your Raspberry Pi. RISC OS should see the USB device which will allow you to copy the file and save it wherever it makes sense on your machine.
You should see the USB drive appear on your icon bar.
  • At this point you will probably have to change the file type to 'BASIC' rather than 'Text'. To do this, press the middle 'menu' mouse button and choose the appropriate option from the menu.
  • Your BASIC program will be ready to run directly from your pinboard.
To run from the command line, you will need a couple of extra steps.

  • First select the filing system for your USB drive. This is likely to be the command *fat32fs

  • Then mount the disk with *mount 0 or *mount 1 depending on the number of USB devices you have. To get a directory listing try *dir :0 followed by *cat and hopefully you will see your file. This can be executed with CH."filename" or edited with LOAD"filename" and LIST or RUN.

If in doubt, RISC OS provides documentation with the *help command. To return to the main filing system type *SFDS

Data Centre

If you have BASIC programs on floppy disc on a vintage beeb machine, you can also get your code running on RISC OS using the brilliant Data Centre from RetroClinic.

The documentation that comes with your data center explains fully how to transfer disc images from floppies or Compact Flash cards onto your PC.

In my case, I am transferring files stored on compact flash drive under ADFS to virtual RAM drives under DFS. These can then be exported onto the USB stick.  Once you have the disc images you can follow the instructions on getting them running on your Raspberry Pi from above.

Compatibility

Although you will find that most of your BBC micro, Electron or Master BASIC programs will run on your RISC OS Pi or RISC OS pico machine, there may be some minor compatibility problems.

Most notably is that you are going to find that your programs run fast. Very fast! This might not be a problem, in fact it might be very welcome if your program involves a lot of graphics. It could be a problem if you wish to play a game but don't have the reflexes of a Jedi.

With a program that I wrote myself for the BBC Master I notice that the different keyboard layout of the BBC machine and a modern USB keyboard caused an issue. This was because my program uses the key combination SHIFT + '3' to reset a timer. On the BBC machines this combination of keys produces the octothorpe character '#' whereas on my IEEE keyboard, this combination produces the '£' character. This was a minor problem which was overcome by a quick patch of the code.

Another problem was that some BBC BASIC programs do not have well-defined exit strategies. Oftentimes the way out of the program is to reset the machine with the 'BREAK' key. Under RISC OS this may cause programs to hang forever requiring a full reboot of the machine.  In most cases you either need to put up with this, or write an exit strategy.

One way of doing this would be to program the 'ESC' key to act like the 'BREAK' key. Just add the following BASIC line into the start of your program:

  ON ERROR IF ERR = 17 OSCLI("DESKTOP")

If you have enjoyed this post then you might want to read other posts about the Raspberry Pi, or about the BBC micro systems, or just something at random from this blog.



RISC OS setup

Yesterday I wrote about how to get going with Raspberry Pi and Noobs. Today I have completed installing the operating systems I wish to use and it is time to configure them to match my own preferences...starting with...

RISC OS Pi
RISC OS Pi is a version of the 30 year-old operating system that originally started life on the Acorn 32 bit machines that you may remember from their golden age in the early nineties- where they could be found as work-horses in nearly every school in the UK. It lives on today and is maintained by RISC OS Open.

And there is a version for your Raspberry Pi.

The RISC OS Pi desktop. It is very easy to think that this is a modern operating system, however it is actually thirty years old. Also, if you are expecting it to behave like Microsoft Windows then you are in for a surprise.

I wrote all about setting up RISC OS in a previous post last year where I talk about some of the essential productivity apps that you should download for your RISC desktop. Today I have downloaded all of the apps that I think will make my raspberry Pi as useful machine and then I then followed my own instructions for how to bind operations to the function keys.

Installing apps from the Pling store is usually a painless process, however some apps do require you to install additional packages (for example the Internet Radio app requires the Mplayer package) which can be installed with the !PackMan program, or may require additional resources to be merged with the operating system resources folder. Thankfully, most apps have very helpful help files included. I haven't managed to install the News app with success this time round, and I do not know what is wrong with it.

It's not Windows

If you are expecting RISC OS to behave like Windows, then you are in for a surprise. Here are some of the main differences.


  • You need a mouse to operate RISC OS. Furthermore you need a mouse with three buttons. If your mouse is one of the two-button varieties with a scroll-wheel, then the scroll wheel will probably act as a middle button. If you have no suitable mouse, then I would recommend the light-weight RISC OS Pico which will boot (in a few seconds) into a RISC BASIC prompt with more memory than you could possibly need.
  • The left mouse button is used for selecting items. The middle mouse button brings up a menu. The menu is always associated with whatever item is currently under the mouse pointer, so you do not need to aim at a separate menu bar at the top of the program. In fact, RISC OS programs typically do not have a menu bar as in Windows or Apple software which makes them look more minimalist. In effect, the menu is always just under the mouse pointer. The right menu button is for adjust. Often it behaves like the right click, but most often it provides you with more options that can be performed on an item under the mouse pointer.
  • When you launch an application, it doesn't actually open. This can seem very strange to a contemporary user who general expects their apps to open on demand. In RISC OS, when you launch an app, an icon will appear on the Icon Bar. This tells you that the app is running and ready for you. Selecting it with the left mouse button will usually open it as a window, otherwise you can drag files onto it or use the middle mouse button to generate a menu.
  • There is no desktop. You will get strange looks when you talk about the desktop. In RISC OS world, the part of the screen with the icons on it is called the 'pinboard'. Windows can be 'minimised' like in Windows operating systems and they become pinned to the pinboard instead of appearing as an icon on the icon bar.
  • Menus are interactive. Unlike other operating systems menus in RISC OS are an interactive experience. Often times you will be dragging icons into a menu, in order to get something to work, or you may be typing into an edit box in the menu itself as shown below.
Here the text file is saved by dragging the file out of the menu and into the folder that you want to save into.

Other useful stuff to know

  • RISC OS can rebooted by pressing CTRL + Pause/Break at the same time.
  • Pressing F12 will open the command line shell.
  • CTRL + F12 will bring up the TaskWindow.
  • If you have a USB storage device plugged into your Pi, you can access the files on this disk through the GUI or from the command line using the *fat32fs command. Go back to the main file system using *sdfs
  • If you have a ram disc set up, your can access this file system from the command line with the *ram command.
  • A BASIC program containing scripts can be set to run on boot-up by dragging the basic file into the !Configure > Boot > Run folder.
  • You can set the date/time using the following commands:

*basic
TIME$ = "Thu,30 Mar 2017,17:30:49"

...or whatever is the current time for you.

Well, that's all for now. I hope this post has inspired you to try out some RISC OS goodness, or has helped you get started with RISC OS on the Raspberry Pi.  See you next time.

RISC OS Pico

I was delighted to discover recently of the existence of RISC OS pico for the Raspberry Pi.

RISC OS Pico is a stripped-down version of RISC OS for Raspberry Pi. Essentially they have stripped out the graphical user interface from the operating system leaving a Raspberry Pi that boots directly into BBC BASIC VI.

Raspberry Pi booting into RISC OS Pico, showing BASIC prompt and more RAM than you could possibly ever fill.

RISC OS is an operating system designed in Cambridge, England by Acorn. First released in 1987, its origins can be traced back to the original team that developed the ARM microprocessor. Anyone who remembers the Acorn Archimedes range of computers will be familiar with RISC OS. For a 30 year-old OS, it really was ahead of its time. RISC OS in now owned by Castle Technology Ltd. You can find my adventures with RISC OS lurking on this blog.

RISC OS Pico boots very quickly (about eight seconds on my Raspberry Pi 2 between pressing SHIFT+BREAK and getting the BASIC prompt) as shown in this video (running on an early model Pi):



Installation is very easy. You simply extract the ZIP archive onto an SD card with FAT format.  The hardest part is finding an SD card that can be formatted in FAT format (not FAT-32).

Once loaded you have a computer that boots directly to BASIC, leaving you with a rather silly amount of RAM available for your programs - thousands of times more memory than available on the original BBC microcomputers, and of course a much faster processor.  BBC BASIC VI is rather more advanced that BASIC IV on the BBC Master, with greater graphics capability and some extra commands such as WHILE...ENDWHILE and CASE...ENDCASE structures.

The distribution comes with some example programs and a guide to writing BASIC programs for RISC OS.  There is no other documentation supplied (unless I am looking in all the wrong places) so you will have to figure stuff out for yourself.

Setting the time is achieved through the BASIC command:

TIME$ = "16 Sep 2016.18.51.00"

Or whatever the current time is for you, although you will be disappointed if you do not have an on-board battery backup, which sadly the Pi does not yet have (the clock resets to 1970 when you power down).

Retrieving the time is achieved through either printing this variable, or the operating system call:

OSCLI("TIME")

Other nice features I have discovered so far:

There is a BASIC editor program that beats the BBC Master.  Simply type 'EDIT'.  Options are selected using the function keys:

f1 - OS command
f2 - LOAD program
f3 - SAVE program
f4 - Search and edit
f5 - Search and replace
f7 - Search

A full list of function key definitions can be achieved with CTRL + f5.

There is also a full set of documentation for each of the BASIC commands.  Simply type:

HELP <command>

Well, that's it for now, because that is all I have learned so far.  I am going to continue to play with Pico, possibly try and get some BBC Master programs to run on it, so be sure to come back soon for more...

...if you are still awake, then you might like to read some more posts about the BBC Computers or RISC computers, or you might just want to play a browser-based adventure game.

#BBCBASIC #RISCOS #Pico #RaspberryPi





RISC OS Pi replaces my DAB Digital Radio

I have been playing with my Raspberry Pi RISC OS set-up, trying to find some 'essential' every-day apps for productivity on a cold English morning.  Here is my list:

Internet Radio

Long time followers of this blog will know that I like to get the shipping forecast in the morning before I go out in my boat. Having access to Internet radio is therefore a must. This is a nice light Internet radio client for RISC OS Pi available in the Plingstore. It comes with 25 pre-set radio stations including all of the BBC.

Humber, Thames. Southeast veering southwest 4 or 5, occasionally 6 later. Thundery showers. Moderate or good, occasionally poor.


Weather UK

Simply a weather RSS viewer for viewing the weather in your area (UK only).

Q: What kind of math do Snowy Owls like? A: Owlgebra.


News UK

This picks up the BBC news RSS feed. Clicking on items will load the article in your browser.

If only I could get it to make me coffee... Well, there is a GPIO library.....

MiniTime

Simply displays the date and time on the icon bar.  You can see it running in the screenshot above.

Alarm
How a Raspberry Pi could replace my DAB radio

There are two things I like about this. First, by having it in the 'run at startup' folder you get an analogue clock with seconds hand in your icon bar - as close to a 'live tile' as you will get in RISC OS Pi. Secondly you can have multiple alarms (I am not sure what the maximum is) and alarms can seemingly be set years (months, weeks or days) into the future.  There are options for 'working week', 'repeating alarms'.  There is a 'Task Alarm' which allows you to boot up another RISC OS Pi app at at particular time of the day - for example to load the radio player just in time for the shipping forecast.  Simply drag the appropriate app into the alarm dialogue box. Repeating alarms can be programmed to run on particular intervals, or on the first Sunday of each Month.



Th..th..that's all folks...
That's all for now. If you haven't already installed RISC OS Pi, then it is worth doing. Considering it is nearly 30 years old.. it has just replaced my DAB digital radio.

Playing with RISC OS for Raspberry Pi, day 3

So today my 32GB micro SD card arrived for my Raspberry Pi 2.  I used Noobs to flash it with RISC OS Pi, OpenELEC, OSMC and Raspbian.

Let's ignore for a minute the fact that the first thing I did was to accidentally delete a whole load of important system files from the RISC OS Pi. Once you delete a file on RISC OS it seems that there is no way back. No surprises there. Surprisingly it seems that the system managed to soldier on without various important files, complaining only now and again that it didn't know what it was doing. I did, however, have the sense to repair the install in Noobs. This took a couple of hours.

Finally I had a working version of RISC OS again. I haven't installed any apps on the device at all yet (not even the screen- shot software).

RISC OS straight out of the box.

I decided that my main goal was to write some code to manage the function keys, in other words, to bind some macros to the programmable function keys to perform various jobs.

To do this I would need to write some BASIC code.

You can write code in the 'Edit' program in your Apps folder. In the Edit menu, navigate to 'Set type' and type 'BASIC'. then save the file somewhere sensible on your SD card.

How to save text files as executable BASIC files.

My first line of code.

My first macro creates a nice-looking command prompt environment. If you didn't already know, by pressing F12 in RISC OS you enter a command prompt which allows you to enter operating system commands. Let's do something with this.

The code is:

*key 1 *basic|M: MODE 12:COLOUR 40+128:CLS:COLOUR0:*desktop|Mhelp|M

It's all one line, but it means:


  1. Bind to function key 1 (F1 key).
  2. Switch to ARM BASIC.
  3. Enter Graphics mode 12.
  4. Set the background colour to  cyan (a sort of bluey-green).
  5. Clear the screen to this colour.
  6. Set foreground (text) colour to black.
  7. Switch out of ARM BASIC back to the OS command prompt.
  8. Pull up some help messages.


NOTE: The colon (:) is a statement separator in ARM BASIC, and the pipe M (|M) is a carriage return.

So what does it do?

Well, it brings up a rather nice looking command prompt.  Run the program and then press F12 to enter the command prompt and F1 to run the script.
My first 'Hello World' program in RISC OS.

Automating the process.

You can add other macro bindings to the other function keys, so it would be useful to have them all available (ie pre-bound to the function keys) when the system boots. To do this add your BASIC script file to the !BOOT folder.

Here's how to make a BASIC script run when the computer loads:
  1. Open the Apps folder
  2. Open !Boot
  3. Open the 'Boot' folder.
  4. Open the 'Run' folder.
  5. Drag your BASIC script file to the 'Run at startup' list.

Your program will auto-load when the machine boots up and your macros will be automatically bound to the function keys.

Working out how to use RISC OS Pi

Other things I have discovered about RISC OS today

  • The pressing SHIFT+'break' key on your keyboard acts just like the 'break' key on your BBC Microcomputer.  I think this is the same as pressing CRTL+SHIFT+F12. I never owned an Archimedes computer so I can't tell you how they behaved.
  • Don't set a hard drive password for RISC OS. Terrible things will happen if you do.
  • Don't delete important system files by accident or on purpose. Nothing good will come of this.
  • Don't use RISC OS for any web-based thing that requires a password. I don't think that security is at the heart of this OS as it is in modern operating systems.

Still awake?

Follow this link for more of my RISC OS adventures on the Raspberry Pi, or for my general Raspberry Pi adventures.

#RaspberryPi #RPi #RISCOS #RISC

Label

World Karma Game