Sunday, 18 May 2014

Codebench and Hollywood on X1000

I am the first to admit that I am not a programmer. But it is good to know that AmigaOS4 has many different ways to program applications for it in 2014. I wanted to draw attention to two of those options - Codebench and Hollywood.

First up is Codebench, which exists in an AmigaOS4 SDK version and Hollywood version. This allows developers to use a modern IDE to manage projects, synchronise code with internet based respositories and more. Codebench can be downloaded from their website here, and it is currently free.

At the annual AmiWest Amiga show in the USA, they now hold a 2 day programming seminar covering programming topics for AmigaOS4, focusing on the use of Codebench as the programming environment. The training sessions from AmiWest are all online on the AmigaOS4 Wiki website here (including some videos).

This makes Codebench a logical place to start for many people, but keep in mind C is not an easy language to learn if you are new to programming - the good news is there are other alternatives like Hollywood, as I will discuss later on in this post.

The AmigaOS4 SDK is a requirement to use Codebench, and it can be downloaded from Hyperion Entertainment here. The SDK includes examples, include files, gcc compiler and a lot more too! Installation of the SDK is straightforward, so I will not cover it here.

Installing Codebench is straightforward - from the extracted archive (I placed it in RAM), run the Install_Codebench installer:

The initial installer screen for Codebench:

Unfortunately I have installed an older version of Codebench previously - the installer is smart and picks that up and lets you know it will upgrade the existing version:

Because my installation is an upgrade, I can't change the installation path (on a new install you can choose the location):

Installation of files is about to start:

....and the install is finished successfully. A few options to create a leave out icon on the Workbench, help and release notes is available here too. Reboot is needed before you can use Codebench:

After the reboot and after launching Codebench, you can also choose to register as part of the Codebench community - basically an Instant Messaging client that allows you to chat with other developers in real time while coding:

The Community Client looks like this when running - no one there of course because of the time difference, and because I didn't add anyone in yet:

Once the Codebench program has launched, you will see a Codebench Toolbar like below:

Hidden from view is a bar at the bottom of the screen which appears when you move your mouse to the bottom of the screen to switch between various windows within Codebench:

The project window shows the files that are part of the project - additional files can be added from this window - based on file extension they are placed in the right section:

For my first program in Codebench, I used the Amiga Future magazine AmigaOS 4.1 C tutorial, which started each issue from Issue 104 for those interested in following it. Source code is included on the CD with the Magazine.

This example code checks whether the installed AmigaOS4 version is 4.1 or not:

You can then compile your project within Codebench by clicking on the Compile button in the toolbar - error messages are displayed and highlighted in the code for easy bug fixing:

Once compiling successfully, you can also run the project from within Codebench, specifying if the program will run from Workbench or the Shell:

I ran it from the Shell, and it works as expected:

You can also assign function key macros to commonly used code or actions to speed things up while in Codebench - I didn't try this out yet:

Next I created a Hello World project in Codebench, following the AmigaOS4 Wiki tutorials presented at AmiWest 2012 Programmers Sessions (link is here).

The initial project creation screen is filled with many options, but for this example in the General tab I just need to fill in the project name, the folder for the project to be created in, and in the Linker tab the name of the executable. The rest is left as per the defaults:

I then created a file hello-world.c, copied the code from the tutorial and then saved it in the project:

Here is the successful compile and test run (click to expand):

Next, I created a new project for the next tutorial Hello world with a GUI, which also compiled and ran well:

The program run has a fully resizable window and button:

Of course I had to play around with it a bit to add my name in:

Taking full advantage of the recently improved LiveForIt MPlayer v4.2 (Available on os4depot.net), I was watching the AmiWest 2012 programming conference videos (downloaded to my X1000) for reference while I was learning from the AmigaOS4 Wiki and mucking around in CodeBench (click to expand) - AmigaOS 4.1 is great isn't it!

And if you are reading this Steven Solie (pictured in the movie playing above) - respect for the cool t-shirt :-)

So that is a brief look at Codebench. As I said, I am not a programmer so anything beyond Hello World in C right now is beyond me....

The good news is there are other options...

Hollywood by AirSoftwair is a simpler entry into coding on AmigaOS4.1, with the advantage that code generated using Hollywood can be compiled for AmigaOS3, AmigaOS4.1, MorphOS and AROS! Resulting programs can also be compiled to work on Windows, Mac and Android. Great stuff!

Befitting such a useful program, this software is not free. It is broken up into the main Hollywood 5 program, and the separate WYSIWYG Hollywood Designer 4 program.

You can choose to just buy the Hollywood program and then use the Codebench Hollywood version or Cubic IDE (with Hollywood plugin) to create and manage your Hollywood programs. You can also use other editors of your choice of course!

To install it after purchase, you download an iso, and join it with a file sent to you directly by the author which creates your uniquely identified iso to burn off and then install it. (not sure if this process has changed recently - it was like this when I bought it in 2012)

Here is the installed Hollywood 5 program:

Here is the Designer program:

Once installed, there are also a number of plugins and updates for Hollywood on their website here, adding extra functionality to Hollywood such as opening various formats of file types, etc:

I downloaded them all for Amiga, since I wanted all the plugins and updates installed before I did anything. There are quite a few to install:

The Hollywood 5 updates have to be installed in sequence - in my case 5.0 to 5.2 and then 5.2 to 5.3 version upgrades:

Here is the 5.2 updater installation:

Be aware that the update takes quite a long time to run - best get a coffee:

Eventually the installation completes:

The 5.3 updater works then same way, taking a similar amount of time to complete:

The readme.txt exaplins the large number of fixes and improvements. Hollywood is regularly updated:

The plugin installs are simple enough, just make sure you choose AmigaOS 4 as the platform when installing:

These plugins add extra file format support to Hollywood, making them an essential download to give maximum flexibility

MUI Royale 1.1 is the latest released plugin, allowing Hollywood 5.3 programs to use the standard MUI 4 functions in AmigaOS 4.1:

The installer for MUI Royale:

This creates a specific folder, unlike the other plugins:

Again, make sure you choose AmigaOS 4 - it appears in different spots in each installer so check carefully as it is not selected by default:

The installer reminds you of optional MUI components you may need to use all of it's functionality:

Once all the plugins are installed, let's get into it!

Looking at Hollywood Designer 4 first, it has a lot of functionality, and plenty of help available in AmigaGuide format to get started with it:

When launching Designer, we get the following default view (click to expand):

You may get an error message about MUI Royale needing Hollywood 5.3 - you can ignore this message. The author apparently knows about this bug and aims to fix it with the next Designer update.

In the About menu we can see the version information for Hollywood, and also the Designer. This shows us that we are all up to date:

I opened one of the example original Commodore presentations that has been re-created in Designer (click to expand):

You can see the various pages appear in the page manager window, and objects used on each page and layers are visible in the Object Manager window.

I then ran this project to view the presentation:

From the above CDTV is apparently the Living Room and School variant? No wonder people didn't buy it! But in 2014 I did finally buy a CDTV - if you are interested the details and photos are here!

Anyway, getting back to Designer I then created a new project titled X1000 Demo, as below:

I then create a new Page (click on New):

It will ask what type of page - I picked Picture:

Next you name the page how you want it:

It then asks me for the picture I want to use:

I picked a photo I took of the X1000 a while back, one of my favourite ones actually. As it is not included in the project folder, it asks me if I want to copy it there (which I do) - very convenient:

And so here is my first page created in Hollywood Designer:

Picture seems too big - in the Page properties I can adjust the size from the huge 3072x2304 original to something a bit closer to 1920x1080:

I then add a text field to the page - the default topaz is quickly changed:

Turned on Anti-aliasing in the Font tab, and tell it to use the default sans font with a size of 28:

I can also change the font colour to white under the Style tab:

Now to choose the font I want:

And here is the result on the page:

I then modify the text and make the font a bit bigger:

When run, this produces a full screen view of what you see above. The Designer program generates Hollywood code from the pages created and then it is compiled in the background, keeping the user from having to code anything by hand.

Simple example project, I know. There is so much more functionality in Designer - I am not doing it much justice with my crappy skills, but just wanted to show what is available to code with!

If the WYSIWYG interface of Hollywood Designer is not your thing, you can just use Codebench (with Hollywood plugin version) or Cubic IDE (with Hollywood plugin) to edit Hollywood code directly and compile it with Hollywood 5.

What strikes me is the simplicity of the code compared to C. I am quite interested in Hollywood as a language - the ability to compile for multiple Amiga platforms and even Windows, Mac and Android is very attractive!

Again, plenty of example guides to help you get started:

In the toolbars of Cubic IDE is sections specific for Hollywood, to compile and run your source code:

Here is the example BeastScroll program in action, having been compiled from Cubic IDE above:

The Hollywood add on for Cubic IDE is available from here:

Some of the other example Hollywood scripts cover demo scene cracktros from old Amiga games - most of which I have seen at one time or another - the strength of Hollywood is the ease of generating graphical applications easily. I hope to learn more about Hollywood - maybe I might be able to code one day!

I admit I haven't even scratched the surface of what these great programs can really do - this is not intended to be a review of features - just showing that modern tools exist and can be used on AmigaOS4 on the X1000!

I know there are other languages still being actively developed on AmigaOS4 too, like PortablE for example (based on the original Amiga E language), but I have run out of time for this weekend so I could only cover two!

The fact that there is so much active development to make these tools available to developers is great, and the programming sessions being available on the AmigaOS 4.1 Wiki can help them to get started!

I hope this inspires people who can program on AmigaOS4.1 to grab one of these programs and do so - the more the merrier!

1 comment:

There are lots of other great tools for developing on AmigaOS these days, too. programmers' editors such as StormC5ED, CygnusEd 5, Annotate 3, and so forth. You can also develop applications in AREXX, Perl, or Python -- including Reaction-based GUIs. Or you can use alternative languages such as PortablE (as you mentioned) or even Modula-2, the latter even coming with its own IDE.

There are so many options, terrific documentation in the SDK and on the wiki, an official developers support forum at support.amigaos.net, a dedicated online developers community at os4coding.net, and even the ability to help expand the OS itself through openamiga.org. If you're a budding developer, AmigaOS4 has the tools, docs, and support you need. This blog post is a great example of what's possible.