####             #    #     # #
#   #            #    #       #          The FreeWare C library for
#   #  ##   ###  #  # #     # ###             RISC OS machines
#   # #  # #     # #  #     # #  #   ----------------------------------
#   # ####  ###  ##   #     # #  #     Originally by Jason Williams,
#   # #        # # #  #     # #  #     Julian Smith, and many others.
####   ###  ###  #  # ##### # ###      Now maintained by Rick Murray.
Last updated: 26th July 2015

Before we begin...

I'd rather hack code right now, so this document is a blah looking wall of text with no quick links or pictures or anything cute like that; but if you just want to see what's new then click here.
There is an unofficial release available if you'd like to play!


What is DeskLib?

DeskLib is a library for use with RISC OS. If you have the Desktop Development Environment (also available as part of the NutPi pack), then you can make use of DeskLib.
Why would you want to? Easy. Because the standard RISC_OSLib library is fairly simple and has weird named structure elements. Some people would be even less kind - one person describing an earlier version as "Note that the RISC_OSLib library (on average) is mediocre (half of it is brilliant, but is badly let down by the other half)" in a rather entertaining document.
DeskLib? DeskLib is a bit old now - my mission is to modernise it - but even then you can benefit from a cleaner, clearer library with a wonderful event based Wimp system where you can attach handler functions to icons and such. RISC OS doesn't do the likes of VisualBasic, but this is the closest I've seen to a non-painful way of writing programs. I was a pretty instant convert after a long time struggling to do simple things with RISC_OSLib. That was like 20 years ago, I've not looked back.


But, wait, isn't there an updated DeskLib?

Yes. A newer version is available at http://www.riscos.info/index.php/DeskLib; however that version is going off in its own direction and future releases will be ELF only (meaning that it will only work with GCC). Indeed, a lot of things have changed to support GCC's not-quite-RISC-OS way of working, such as naming header files with a '/h' suffix instead of them being in an 'h' subdirectory, plus a future library in an ELF file - pretty much guarantees that the "RISC OS library" will not work with the official toolchain.

My version, currently, is targeted at the DDE on 32 bit machines. I am also currently modifying the code so that a version of the library can also be made available for 26 bit machines - while I personally believe that it is high time to move on from quarter century old hardware, there are many still using RISC OS Select/Adjust on their RiscPCs (or via emulation) for a variety of reasons from the long-expired political to "my favourite app doesn't run on new machines". While a version of DeskLib exists for them, it is the version from circa 1993 and won't have any of the updates. My plan is for a version of the library to run on both old and new hardware. It is up to app developers to decide if they want to target older and newer machines. For my part, I intend to give them the choice.
As for GCC - there are no plans to support GCC at the moment. I would like to offer an ELF version of my library, but if a future GCC cannot read source code laid out in standard RISC OS layout, it may prove impractical to build using GCC. These are problems for another day...


Original 32 bit conversion

I made an updated version of DeskLib circa 2004, and revised it to work correctly on 32 bit systems in 2013. It contains the following enhancements:


Current work

I was never planning to take on updating DeskLib, I was happy to leave it to the guys behind the GCCSDK (the riscos.info version) however the decision to move to an ELF only library is not one that I agree with. Sure, GCC is a free compiler and it is a useful choice to have a free compiler and good library for it; however there are plenty of people with the DDE who will no longer have a version of DeskLib available for them (v2.80 will be the last ALF release). With this in mind, I am looking to update DeskLib primarily for supporting the DDE and all those who use it. Now and in the future.

I have a rough roadmap for changes to apply to the original v2.30 source code, which are (roughly, and in no specific order (did I mention this was roughly a rough idea?)):
(green strokethrough = DONE, red strokethough = abandoned, modification comments are in 'coffee' (they didn't have a 'tea' colour ☹))


Major changes in a nutshell


Fancy new DeskLib release

There is no official release of either the library nor the source code at this time, as the modifications are a work in progress.

I have put up an early example build desklib230rm32-20150726.zip (234KiB) but note that this has had very little testing. It should be okay (I have linked a couple of my own programs with it)...


Changelog for the new versions of DeskLib RM/32

2015/07/10 (Rick Murray)

2015/07/11 (Rick Murray)

2015/07/12 (Rick Murray)

2015/07/13 (Rick Murray)

2015/07/24 (Rick Murray)

2015/07/26 (Rick Murray)

I am also redesigning the build process so that it can be built for APCS-32 (as it is now), APCS-R (for older machines), and maybe (some day in the future) GCC-ELF if the GCC compiler doesn't choke on the files-in-directories method of file storage.


All that remains to say is...

        MOV     PC, LR