Coder's Blog

Diary of an Amiga fanatic

Mags

Posted by Coder on January 22, 2012

After writing about ACE Basic in the previous column and that I would like to do some tutorials about it I decided to start anyway without waiting if there is any interest for it. At the moment the first one is already done and posted and more will follow. Next up is a new C tutorial which I am planning to post this week. Since I focussed on the programming tutorials the past week my work on the Redhouse File Manager has been reduced to zero. I hope to start doing some more work on it the coming weeks but also get more tutorials out. Another great surprise is that I finally found that demo I was looking for. The search was long but finally I found it which made my weekend.

 

 

A site that you should visit is Amiga Magazine Rack which contains scans of several Amiga magazines. Besides that there is also information on the cover disks that came with the magazines and in some cases you can also download them. From all the cover disks I had I remember two games vividly that had a demo version on those disks that I played a lot. Those two games are Back to the Future II and Flood. I downloaded the Amiga Power 33 (Jan 1994) cover disk that contained the Terminator 2 (The Arcade Game) demo.

 

Amiga Power33 (Jan 1994) cover disk

 

Terminator 2 (Arcade Game) demo

 

The site is certainly a time killer as there is so much to explore. It seems my Sunday afternoon is booked.

Posted in The Bucket Weekly | Tagged: , , , , , , , | 2 Comments »

Jackpot!

Posted by Coder on January 21, 2012

I have been on the search for a certain demo for a long time already. I wrote about it some time ago which was titled Searching for Number 5. I was thinking about it again and I thought I would do another search on Google with “amiga jas demo” and the first search result resulted in hitting the jackpot. I was directed to BitWorld and when I saw that screenshot I knew I found it. The name of the demo is “A new decade” and (I was right about the name) Jas is a member of the group Empire. I am happy there is a download link as well to a compilation disc called (surprise) COMPILATIONDISK #2 from Istvan from Empire.

Jas from Empire

 

Mantronix from Emipre

 

ESPI

 

The car!

I am really happy I finally found it. Besides the name of the demo and that it was Jas I also know he belonged to Empire who are from Sweden. I would love to hear from people that have more info about Jas or Empire. Back to watching the demo!

Posted in Amiga Demos | Tagged: , , , , , , | 3 Comments »

ACE: How to get started

Posted by Coder on January 20, 2012

I have not been this excited about a Basic language since Amos. The strange thing is that this Basic version has been around for a long time already and I just re-discovered it. What basic version I am talking about? Well ACE Basic Compiler of course. The big difference, and one to win you over, is the GUI support it has. Without having played a lot with it I already decided I should start a series of tutorials about ACE Basic. I believe this to be the perfect language for beginners to start programming on the Amiga.

The begin with I would really recommend you subscribe to the Amiga ACE mailing list. Once you are subscribed you can also download the latest version of ACE Basic Compiler from the Files section. The latest version can also be downloaded from Aminet. The installation instructions are pretty easy to follow. Everything is well documented so you won’t have any problems and if you do there is the ACE Basic mailing list and me of course.

The ACE Basic Compiler packages comes with the  AIDE (ACE Integrated Development Environment) which is a graphical front-end for the development of ACE programs. This makes it easy to compile your code compared to the more crude way of doing it from the shell. In this first tutorial I am going to show you how to compile ACE code both ways. First we need a very simple example that we can use for this.

print “Trying out ACE Basic Compiler”;
LOCATE 2
print “I like ACE Basic Compiler”;
LOCATE 3

Above you see our very simple example we are going to use in our compiling sessions. The command PRINT will print our sentence on the screen and the LOCATE command moves our cursor to the next line so that our two lines will not end up next to each other.

If you start AIDE and it is up and running you can select “Set” to get the file requester to open the source code file you want to run.

AIDE - Open source code file

If you select “Run” in the “Program” section it will run our example code.

AIDE - Running our code

Of course we want to create an executable file. You can set the folder in which the executable file can be placed. In Project you can select AIDE setup in which we will be able to set our folder. In “Temp Dir” you can select the folder which I have set to “Applications:ACEBASIC”.

AIDE - Setting the folder for our executable files

Once you click on “Executable” in the “Make” section our code will be compiled and the executable file will be placed in the “Applications:ACEBASIC” folder. Let’s move on to compiling from the shell. Let’s say our source code file is called “howtocompile.b” we would need to execute the below two commands.

ace howtocompile.b
bas howtocompile

The problem I ran in to is that “bas” would not run saying it is not executable. What you need to do is set the “script” option for the “bas” file. The “bas” file is located in the “bin” folder of “ACE:”.

Setting the script option for the BAS file

By default the “bas” script is looking for your file in the “RAM:T” folder. You can change the location by editing the “bas” script file in the editor of your choice. I am not sure if it can be set somewhere else like for example in the AIDE set up. For now I just moved my file to the location the “bas” script file is looking for. The ACE package comes with a lot of documentation which I would recommend you read. That’s it for starters. Next time we will dive deeper in to basic programming.

Posted in Amiga OS4.x, The Bucket Programming Corner | Tagged: , , , , | 4 Comments »

ACE

Posted by Coder on January 14, 2012

I don’t like to use Amiga emulation a lot since nothing beats the real thing. But it does come in handy at some moments when I am using my laptop and I want to quickly check something or make screenshot for my articles. Many years ago I also used it and at that time I used a Workbench distribution called Amiga In A Box (AIAB). Its a ‘snapshot’ of a nice-looking Workbench setup for WinUAE. Instead of having the plain old Amiga Workbench 3.1 setup you have a nice looking Workbench with also some extra installed software. Like you have with Amiga Forever or AmiKit but AIAB is not that advanced which is what I like. I need some extra’s but not too much.

Amiga In A Box

Amiga emulation, or AIAB for that matter, is not the main topic of this column. The reason I brought it up was because of ACE Basic Compiler. To my shame I have to admit that I completely forgot about it and that I never ever tried it in the past. I do remember reading some raving reviews about it at that time. But this was also the time it was very difficult to get software that was out there as freeware and shareware. Since there was no internet (yes kids) you had to place orders and since there was also no paypal or similar options (yes again kids) it was rather difficult to place orders.

This week on the Facebook page of AmigaWeb.net I saw a posting of Barry Walker regarding ACE Basic Compiler. After reading Barry’s posts I got intrigued and wanted to know more. Since he said he was the moderator of the Amiga ACE mailing list I had to subscribe to it. David Benn is the guy that actually wrote ACE Basic Compiler. After subscribing to the list I was already in talks with both of them from the first minute. At the same moment I also installed AIAB so I could istall ACE Basic Compiler and try out a few things. Over at Green Amiga Alien Guide you can download AIAB and also read the installation instructions.

ACE Basic Compiler

After trying out some examples and trying to get to grips with ACE Basic Compiler I got more and more excited about it. I barely scratched the surface of what is possible so I am really keen to learn more. If there is some interest I might consider doing a project about it explaining how it works and get people to program in ACE. It does look to my like a great beginners program language for people that want to get into programming on the Amiga. I would really suggest you subscribe to the ACE mailing list to begin with. See you there!

Posted in The Bucket Weekly | Tagged: , , , , , , , | 3 Comments »

2012

Posted by Coder on December 31, 2011

With the end of the year approaching you are reading the last Bucket Weekly of 2011. It is that time of the year we always look forward and say to ourselves that this year is going to be the year you will do it all. My plan is to get more content on the blog. I would love to create more articles for The Bucket Programming Corner. Another idea I am toying with is audio segments. I am looking into the idea of doing a weekly Amiga news round-up. Personally I would love to see a weekly radio show that does a news round-up of that week. Since it is very unlikely we will see something like this any time soon or in the future I am thinking of maybe doing this myself. This is certainly high, if not topping it, on my to do list for 2012.

AmigaOne Netbook (www.amigax.com)

The year 2012 will be all about the new Amiga netbook that is scheduled to be released. This has everyone really excited. Not only is it portable but also affordable. How’s that for a slogan? I hope sooner but I am guessing it will be towards the end of 2012 that we will see a release. The most important thing is that it will be there and we finally can have access to affordable hardware.

If you haven’t already I suggest you listen to the latest episode of Amiga Roundtable called ART Episode 52 – Rogue for The Holidays. It contains two sets of interviews with Rogue (Hans-Joerg Frieden) from Hyperion. While you are over there you might want to check out Amiga.org Owner to Take Questions from the Amiga Community on ART. That is all for 2012 folks! Happy new year Amigans!

Posted in The Bucket Weekly | Tagged: , , | 6 Comments »

Click, close and move on

Posted by Coder on December 31, 2011

Finally I managed to fix the crashing issue when another issue surfaced.

After solving this one I ran into another one that seems to be even worse. My window displays but when I click to close it nothing happens.

After spending a lot of time on it and not getting really any further I decided to move back to my previous “older” code. I was following Trixie’s article over at OS4Coding.net regarding the proper way of programming with ReAction. One of part of the proper way of using ReAction was:

Instead of using OpenLibrary() to open ReAction Classes we should use OpenClass() to open the ReAction Classes. Besides returning the class library base (which we store in WindowBase) it will also return something called the class pointer.

Instead of using the OpenClass() function I am now (again) using OpenLibrary() and GetInterface() to open ReAction Classes. You might remember that in a previous article I was talking about how can you check if the class pointer is also being opened when you use the OpenClass() function.

My question about this is that when we check if we opened the Window class do we also need to check if we got the pointer and if so how? Or can we assume that if we succeed in opening the Window class we also have successfully got the class pointer?

Maybe it did not really open (class pointer) which is the reason my code for closing the window is not working. Besides this part there is another part for which I switched back to my “older” code. Don’t use RA_OpenWindow()  to open a window but instead use  WM_OPEN which would look something like this:

window = (struct Window *)IIntuition->IDoMethod(objects[OID_WINDOW], WM_OPEN, NULL);

I moved back to using RA_OpenWindow() which would look something like this:

window = RA_OpenWindow (winobj);

Just ignore all the parts of the code it is just for reference. The third and last part I moved away from is WM_HANDLEINPUT. This is part of the code that will loop (keeping our window open till we do something like clicking something) and would look like something like this:

while ( (result = IIntuition->IDoMethod(winObj, WM_HANDLEINPUT, &code)) != WMHI_LASTMSG )
{

}

I moved back to using the RA_HandleInput() macro which would look something like this:

while ( (result = RA_HandleInput(winObj, &code)))
{

}

As a result my code works now and clicking on the close button actually closes my window. I could not keep spending time on this issue so I had to move back in order for my code to work and move on. At a later stage I might do some further testing so that eventually I can move back. If you go through the ReAction examples for OS4 you do get rather confused since every example seems to differ from the other. But since I now got it to work I am moving on to the next part which is the layout. At first I want to start with having buttons on top of the window. See example screenshot below which is from the utility Filer from Bjorn Hagstrom.

Filer 53.27 from Bjorn Hagstrom

I will discuss the layout and buttons in the next article. Till next time!

Posted in Redhouse File Manager | Tagged: , , , , , , , , | 2 Comments »

Season’s Greetings

Posted by Coder on December 24, 2011

The first Bucket Weekly Christmas edition has arrived. I am actually putting it together on Christmas Eve. I suffered a bad cold this week and I am still sort of recovering from it. Sadly that meant I could not do much Amiga work this week. Hence the reason I am writing this column on Christmas Eve. Sitting next to the Christmas tree writing it makes if feel sort of magical.

A nice surprise was the release of Update 4 for Amiga OS4.1 this week.

The following new functionality and bug fixes are included in Update 4:

  • Introducing the new Emulation drawer with official AmigaOS 3.x ROMs and Workbench files. AmigaOS ROMs are provided for all classic Amiga models and the CD32 platform.
  • Added RunInUAE contribution to utilize the new Emulation drawer.
  • New scsi.device patch for Classic installations which enables internal IDE drives to be used for memory paging (SWAP).
  • Added NoDriveClick utility for Classic users.
  • Added DefIcons support for RunInUAE.
  • Updated TCP/IP stack with much improved DHCP support.
  • Updated MUI with various fixes.
  • Various Workbench fixes.
  • Fixed several USB issues.
  • Fixed elf.library that could cause programs using shared objects to misbehave when unloading (e.g. Timberwolf).

I am sure we will see some reviews popping up in the next couple of days. I certainly like the adding of the Amiga 3.x ROMs and Workbench files together with RunInUAE. Reading all this makes me really wish I had Amiga OS4.1 so I could enjoy all this. Especially with the holidays at the doorstep.

Thanks to my pal over at Old School Game Blog for his Christmas greetings. Below are some Christmas greetings from The Bucket Diary to you mate. And of course to everyone else as well. Merry Christmas!

Merry Christmas from The Bucket Diary

Posted in The Bucket Weekly | Tagged: , , , | 4 Comments »

RetroGaming Radio

Posted by Coder on December 22, 2011

I consider it a Christmas gift. What I am taking about? I am talking about RetroGaming Radio. It went of the air in 2008 and till that time it was my favourite radio show I listened to. I don’t even remember how I came across it at the time. I started to listen to it when I was still in Thailand and (of course) continued to do so when I moved to Holland in 2005 till it stopped in 2008. I kept checking the site during that time but never any news of a return. Till this week when I happen to come across a posting on the Facebook page of MaximumRD’s Classic Gaming and Computing in which Rob Daviau was referring to RetroGaming Radio. He pointed out to me that the show was back an so far four new episodes (starting from August) have been released. I can’t wait to start listening to them.

Shane R. Monroe

Those new episodes are going to make the holidays even more fun. If you never heard of the show I urge you to start listening to it. There is a huge archive to check out. Shane (the host) does a great job with the shows. Check it out!

Posted in Amiga News | Tagged: , , , | 2 Comments »

Smash one and get another one

Posted by Coder on December 11, 2011

I did manage to locate the bug that made my code crash. If you remember my previous posting you know how much that bug haunted me. The declaration “Object *winObj” was the one that caused it. By changing it to  ”Object *winObj = NULL” I solved it. If you follow The Bucket Programming Corner you might remember me talking about setting pointers to NULL. I see a lot of ReAction examples which do not set this to NULL. Since it solved it for me and I can’t find any other info on this I will just leave the statement as it is.

Home free right? Not exactly. After solving this one I ran into another one that seems to be even worse. My window displays but when I click to close it nothing happens. After running some tests it seems the code never reaches the part that checks if the window needs to be closed. After staring at it till my eyes hurt and compare it to several examples I still have not found the bug and I decided I need some outside help. So I posted my problem over at OS4Coding for some outside help. Let’s hope I find it soon so I can continue.

Posted in Redhouse File Manager | Tagged: , , | Leave a Comment »

Screens (part 1)

Posted by Coder on December 10, 2011

Working with screens using the C programming language on the Amiga is a first for me. Remember how easy it was in Amos? I had seen some C code using screens before and frankly it scared me. Actually it is not really difficult to open a screen on the Amiga using C. As with all my articles I will try to take all the difficult information that is out there on a particular subject and make it understandable. The same goes for the example source code that is out there. I come across so many examples that even make me scratch my head. Especially when you can write in a much better and understandable way.

What steps do we need to take in order to open a screen?

Step 1 – Declare a pointer that will hold our screen structure (Line 10)
Step 2 – Setting up our screen’s parameters (Line 12 till 27)
Step 3 – Open the Intuition Library and Interface (Line 33 till 44)
Step 4 – Opening our screen and check if we managed to open it (Line 45 till 48)
Step 5 – Cleaning up by closing our screen, Intuition Library and it’s Interface (Line 50 till 79)

00 #include <stdio.h>
01 #include <exec/types.h>
02 #include <intuition/intuition.h>
03
04 #include <proto/exec.h>
05 #include <proto/intuition.h>
06 
07 struct Library *IntuitionBase = NULL;
08 struct IntuitionIFace *IIntuition = NULL;
09 
10 struct Screen *my_screen = NULL;
11
12 /* Declare and initialize our screen structure */
13 struct NewScreen my_new_screen=
14 {
15 0, /* LeftEdge */
16 0, /* TopEdge */
17 320, /* Width */
18 200, /* Height */
19 3, /* Depth */
20 0, /* DetailPen */
21 1, /* BlockPen */ 
22 CUSTOMSCREEN, /* Type of screen */
23 SPRITES, /* ViewModes option */
24 NULL, /* Font option */
25 NULL, /* Title of the screen */
26 NULL /* Gadgets option */
27 };
28
29 int main (void)
30 {
31
32 /* Opening the Intuition Library */
33 IntuitionBase = IExec->OpenLibrary("intuition.library", 50L);
34
35 /* Could we open the Intuition Library? */
36 if (IntuitionBase != NULL)
37 {
38
39 /* Open the Intuition Interface */
40 IIntuition = (struct IntuitionIFace *) IExec->GetInterface (IntuitionBase, "main", 1, NULL);
41
42 /* Did we get the Intuition Interface? */
43 if (IIntuition != NULL)
44 {
45 my_screen = IIntuition->OpenScreen(&my_new_screen);
46
47 if (my_screen !=NULL)
48 {
49
50 /* If the screen is still open we need to close it */
51 IIntuition->CloseScreen(my_screen);
52 }
53
54 /* We could not open our screen */
56 else
57 {
58 printf ("Unable to open our screen!\n");
59 }
60
61 /* If the Intuition Library Interface is open, close it */
62 IExec->DropInterface((struct Interface *)IIntuition);
63 }
64 
65 /* We could not open the Intuition Library Interface */
66 else
67 {
68 printf ("Unable to open the Intuition Library Interface!\n");
69 }
70
71 /* If the Intuition Library is open, close it */
72 IExec->CloseLibrary(IntuitionBase);
73 }
74
75 /* We could not open the Intuition Library */
76 else
77 {
78 printf ("Unable to open the Intuition Library!\n");
79 }
80
81 return 0;
82 }

When you compile the code and run it you will see it flashes a black screen for just a second. This is because we have not instruct our little example to do anything with our screen. We will do a lot more in the coming articles regarding screens.

Let’s analyse the source code.

10 struct Screen *my_screen = NULL;

Line 10 will set up a pointer called “my_screen” which will hold our screen structure. In other words if we open our screen successfully we will store the screens info in the “my_screen” pointer. We are going to use this to make our screen do things. To put it simple; every time we want to do things with our screen we need to refer to which screen we would like to use which means we will refer to “my_screen”. If my wife asks me to get a certain pair of shoes she will always refer to one of the 200 boxes she has. Without this info I would not be able to know what to do and shout some error codes.

12 struct NewScreen my_new_screen =
14 {
15 0, /* LeftEdge */
16 0, /* TopEdge */
17 320, /* Width */
18 200, /* Height */
19 3, /* Depth */
20 0, /* DetailPen */
21 1, /* BlockPen */
22 CUSTOMSCREEN, /* Type of screen */
23 SPRITES, /* ViewModes option */
24 NULL, /* Font option */
25 NULL, /* Title of the screen */
26 NULL /* Gadgets option */
27 };

Line 12 till 27 will define our screens parameters. Here we will define for example the width and height of our screen. For the moment we will not pay much attention to this. Going in to depth on this might just scare you away. Our screen will be of the type CUSTOMSCREEN and the width is 320 and the height is 200 is all you need to know at this stage. The width and height speaks for itself and a CUSTOMSCREEN means that we control how it looks, talks and breaths. In order words we decide the width, hight, colours etc.

45 my_screen = IIntuition->OpenScreen(&my_new_screen);

Line 45 will open our screen and store the info in our “my_screen” pointer. The part “(&my_new_screen)” tells the system how our screen should look like.

47 if (my_screen !=NULL)
48 {

Line 47-48 will check if we managed to open the screen. If not the program will jump to line 55-58 and display the message that the screen could not be opened.

51 IIntuition->CloseScreen(my_screen);

Line 51 will close our screen once we are done. Remember I was talking about the fact that we would use our “my_screen” pointer every time we would do something with our screen? Here we are closing our screen and referring to which screen we would like to close. In other words my wife asked me to put her pair of shoes back in box number 145. Next time we will actually keep our screen open until we decide it should be closed. Happy coding!

Posted in Amiga OS4.x, The Bucket Programming Corner | Tagged: , , , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.