Rename

Tags

,

It has been a while since I did some work on the editor project. It was time I made some progress. Lately I got this urge to keep doing as much work on Amiga programming as I can. I try to do at least a bit each day and if I am unable to do any actual programming I try to do some reading to learn. Also my attempts at getting something to work and actually succeed in it does make me feel great and feeds my passion to do more.

I thought I better give the project a new name and thus Redhouse Editor was born. I already have the Redhouse File Manager (a bit dormant at the moment) so I should stick to the Redhouse home name.

I already had the Window part (basic) done and to handle the text I will use the Text Editor gadget. It provides you with functions to handle text so a rather handy gadget if you ask me. I don’t know that much about it but from what I read online it does have some limitations. Surely I will come across them and when I do I will see how I will cope with it.

Redhouse Editor

The above screenshot shows some text added in the window. Still all really basic but I am happy I was able to add the text to it. You can also already type some text in the window. I also want to add a row of icons on top to give it a proper look. But before I do that I want to add a menu to it. Next up is adding a saving routine to the code so I can save the text and opening it as well. I think I will do both together with the menu part.

Requesters

Tags

, , , ,

Lately I have this urge to program a lot and I have to admit I do seem to do a bit each day. As far as programming goes I seem to get a lot done lately and more importantly I learned a lot. The other day I though I would have a quick crack at a file requester and as you can see from the picture below I succeeded. I was actually surprised how quick I got it up and running. It just displays the requester and does not do anything else. But that was exactly what I wanted. I will work it out further at a later time so it will actually do something.

Basic File Requester

The reason I wanted to try creating a File Requester is because I would need one for my Amiga Editor project. I have been working on that project for the last couple of days and will write about this in a different article.

Mastering Amiga C

Finally I have my Mastering Amiga C book back. My wife’s parents arrived a couple of days ago and brought the book with them. I still need my Amos Professional manual and Mastering Amiga Amos but due to a lack of space only one book could make it so I picked the Mastering Amiga C book. My wife’s brother will also pay us a visit later this year and he should bring the other two books. But for now I will have a great time reading the Mastering Amiga C book.

File attributes – File info

Tags

,

In our previous tutorial in the “File Attributes” series we opened a file and printed if we managed to open it or not. In this tutorial we are going to obtain some information of a certain file. We will obtain it’s name, comment info and the file size.

Comment example

If you are not familiar with the comment part you just have a look at the above picture. For this example I created a file called “example.txt” for which I added a comment as well. Make sure you have this file in the same folder in which you would run the example.

Click here to download the (fileinfo.c) source code file.

In order for us to get this info we will use the function “ExamineObject” from the DOS Library. As you know we don’t have to open the DOS Library but we also don’t have to open our file to get the info we want. On to the show!

File Attributes - File info

Line 8 is setting up our ExamineData structure called “data”. In here all the info of our file will be stored if we succeed to get this. And as you might have guessed we will also use this to check if we managed to get all the file info.

Line 13 will try to get all the info of our file. IDOS->ExamineObjectTags is the function that will obtain this. It will require us to tell it a few things. EX_StringNameInput is telling it that the file we want to use is not open and will be given in a text string which we will provide in the next part. I don’t want to make it to complicated but we can also tell it to use a file that is already open and if we would we would use for example EX_FileHandleInput. Next up is indeed the name of our file in a text string. TAG_END will tell it that we have reached the end of our instructions. So what we are doing is get the info from a file called “example.txt” which is not currently open and store it in a box called data.

Line 15 will check if we succeeded in doing this. Our pointer (or box if you like) called data will be empty if we failed and full if we succeeded. Line 22 till 28 will take care of the part if it failed. If you want to see if this part actually works if it does fail try to change the name of the file (in the source code or the actual file) and you will be greeted by the failure message.

Line 18 till 20 will get the info we want. As you might have guess line 18 will get the name, line 19 the comment info and line 20 the files size. This will be printed on the screen and in my case I will be greeted with the below info.

File Attributes - Outcome

There is one more part left which is what we are doing on line 30. We need to cleanup and on line 30 we are freeing up what we have used using the IDOS->FreeDosObject function. We are telling it that we have DOS info in our data box which we no longer need so dispose of it. That’s it! Please let me know if something is not clear, you can’t get it to work or you have any other questions. I hope you learned something and until next time; Happy coding!

Gift and travel

Tags

, , , , , , , ,

I wanted to play a bit with Amos and since I don’t have any room, actually table, to setup my A1200 I have to use emulation. Instead of using WinUAE I thought I would try to set it up on my A1SE with OS4.1. I got really excited about it and setting it all up using two hard drive files, one for the Workbench installation and the other to have Amos installed, was just great. Since I want to write some Amos tutorials I need to transfer the source code files to OS4.1. I was thinking about using a folder as hard drive but thought I would give the hard drive option a try. You can mount this as a drive in OS4.1 so that should enable me to get the source code files. I am not sure but I remember from last time that Amos would not let itself be installed in a folder that is being used as a hard drive. I was not sure but I thought I better go for the hard drive file option. I already mounted the file and it worked perfectly but about this more later on.

Amos Emulation

All this happened just a few days before the weekend that we would go to France. Not that I was not excited to go to France but being all worked up and everything worked the first time I tried I could not help thinking that I would have to wait till after the trip to continue. That was last week and the long weekend to France was absolutely marvelous. That great that I did not give much thought to my Amos emulation project.

Mount Amos HDF drive

At my first attempt I succeeded in mounting my hard drive file that contains the Amos installation. It was no fluke since each other attempt after this also worked. This will enable me to access the source code files I want to use for my tutorials. It just feels better and is more fun to emulate the classic Amiga on the new Amiga. There is just a lot of excitement doing it this way. Since I also have a partition on my OS4.1 installation called development I need to make sure I unmount the HDF file since rebooting will case some start-up errors. Mountdiskimage will also mount the HDF file again on the next boot of OS4.1. Since everything is up an running now it is time to start playing around with Amos. Hopefully I can do a new tutorial soon.

Leatherneck - Front

Leatherneck - Back

I was delighted to receive a gift from OldSchoolGameBlog. It is just the kind of game I love. I have some great memories playing Leatherneck as well in single player mode as two player mode. This game will be the next game I will do a review about. Looking forward to start on this. Thanks to OldSchoolGameBlog!

NetSurf 3.0

I also installed the latest NetSurf (version 3) version. I have to admit I use mostly OWB and it has been some time since I used NetSurf. From now on I will use NetSurf 3.0 to see how it behaves on my A1SE. Time to play some Leatherneck and do some coding.

First Blood

Tags

,

Monday evening so I thought I better start writing a bit since usually I manage to start writing something on a Monday evening but the rest of the week I get nothing done. I thought it might be a nice idea to keep a daily log on Amiga activities. This would also push me to work a bit on Amiga stuff each day. But I already know this week won’t be such a week I could do that so I will put it in ice for the moment.

Rambo III - Title Screen

I am looking for a game that I can use for my next game review. I think I will pick Rambo III for this. Not so long ago I had a bit of a go at it and I enjoyed it. It might be some time before I actually have the time to sit down and play and review it but I certainly will. This is really my type of game. I remember being a bit jealous of the C64 since it had a lot of these games. The top view walk around war games in which you shoot and blast your way through enemy territory.

I get most of my Amiga news from other blogs. I subscribe to their RSS feed so I won’t miss anything. I don’t visit the Amiga forums that much anymore. I also follow some Facebook pages with Amiga information. I thought that creating a Facebook page for The Bucket Diary would be a great addition. It will give me the opportunity to share other blog postings and upload some great Amiga pictures. If you are on Facebook just check out The Bucket Diary Facebook page.

Platoon - Title screen

Platoon - Starting point

I am pretty sure that I played Platoon first on the C64 before on the Amiga. I just gave it another try and just like I remembered it is a really difficult game. Getting shot after a few steps each time is a big show stopper. I don’t remember if it was also difficult when playing the C64 version. I am happy to hear your thoughts on this.

Cliffhanger

Tags

, , ,

Cliffhanger - Title screen

cliffhanger - Starting point

I was really surprised when I came across the game Cliffhanger for the Amiga. This is, can’t recall I ever did, the first time I saw it and I had no idea this game was made for the Amiga. I am always excited about new games I never knew existed. I played it a bit and it’s not that bad but it has not excited me that much yet. I guess I need to play it a bit more. It did get me excited to go out and look for other Amiga movie titles. I guess I played most of them but still it might be fun to play some again or come across some games I never played before.

Amos Professional User Guide

When I was back in Thailand for a holiday in 2011 I wanted to bring back a lot that we left there when we moved to Holland in 2005. At first I wanted to bring back my Amos Professional manual but at the last moment I decided not to bring it and made room for something else. I wish I did bring it because when I have one of my Amos flashback moments I want to read it it. I did believe I brought it back since why would I leave such a book in Thailand? But I did leave it there.

Mastering Amiga C

Another gem I left there was the “Mastering Amiga C” book. My issue with this book is that I hate it and love it. I want to have it when I don’t and don’t want it when I have. And of course now I want it. And the good news is that I will have both of them soon. My wife’s parents are coming to visit us for a holiday so I will have them bring it with them. All our stuff we left there is stored with them. I just hope they will be able to find it. At least I got the pictures of the books so it should be no problem for them to find it.

Mastering Amiga Amos

I am pretty sure that I also have left “Mastering Amiga Amos” in Thailand. If so it would be a great addition to the other two gems. I want to do some more stuff with Amos so both the manual and this book would be helping me a lot in this.

Shelved

Tags

, , , , ,

A good start of the week for me since I just posted “Automatically opening of libraries and classes (part 2)”. I posted part 1 yesterday and I thought I would waste no time and get part 2 done and posted today on this Monday evening. Not only that, I also have started to write the column for this week already. At least make a start with it. Hopefully it will not just stay at only this Monday evening that I am doing some Amiga work. But if it will at least I got some stuff done on this Monday evening.

Hyperion Entertainment Message Boards LogoYesterday I checked out the Hyperion forums a bit. My interest is the developer forums. I joined almost a year ago and yesterday I made my first post. I got some good response which is nothing but good of course. I had some questions regarding the Dos Library. Things have changed a bit since the old days. I want to get certain info about a file like for example the size, date it was created or the comment (something new). The comment part can contain for example a URL to the file or website on the internet. The function ExamineObject() is what we can use for this. I will write about this in my “File Attributes” series in The Bucket Programming Corner. Currently I am writing some code that will use this function to try and get all sorts of info from a file.

amigalogo.jpgAnother great source of information for developers is AmigaOS Documentation Wiki. All developer info is on there or will be placed on there. It is also for normal users who can find a lot of useful information on the site.

It was a good thing I already started to write something for this weeks column. After Monday evening nothing got done until now this Saturday afternoon. I made some good progress on my “File Attributes” series in The Bucket Programming Corner. I was looking into the ExamineObject() function to get certain information of a file and I just got it to print the file name and also the comment info of a file. I was amazed how fast I got it to work. Normally I have to battle a lot of errors before it will do what I wanted it to do.

Amazingly I started to write this column about 2 weeks ago on a Monday and since that time I have done nothing on this or any other Amiga related stuff. That just shows how weird things can get with trying to find time. I am trying to improve upon it this coming week. I will try to finish the ExamineObject() article for the ”File Attributes” series in The Bucket Programming Corner. We will see next week if I manage to get some Amiga stuff done as planned.

Automatically opening of libraries and classes (part 2)

Tags

, , ,

In part one I showed you how to open a Library. But just the Library is not enough as we also need to open the Interface of the Library.

Amiga Editor - Open Libraries OPENINGThe statement “IIntuition = (struct IntuitionIFace *) IExec->GetInterface (IntuitionBase, “main”, 1, NULL);” will open the Interface of the Intuition Library. IExec->GetInterface will open the Interface of the Intuition Library. The (struct IntuitionIFace *) will make sure the value returned will be of the type struct IntuitionIFace. This is called a cast and if you have opened libraries on the classic Amiga you have encountered this before and are familiar with it. It might be somewhat technical to understand at first. With a cast we are forcing the system to make sure the returned value is of a value we need. See it as asking for Euros and to make sure you get Euros and not Dollars you clearly tell the person at the other end of the booth that you need it to be in Euros. That, telling the person, is what you can call the cast.

The part (IntuitionBase, “main”, 1, NULL); is trying to get the Interface of the (IntuitionBase) Intuition Library. Looking at ….“main”, 1, NULL); we can see that we are trying to get the main interface and the version number is 1. The last parameter (NULL) is a pointer to a tag list which we won’t discuss here. Just like with the Library we need to check if we managed to get the Interface. If we did IIntuition would not be zero (NULL) and we managed to get the Interface. If it is still zero (NULL) we failed to get the Interface. The “if (IIntuition != NULL)” statement will check this for us.

Of course we need to close everything we have opened.

Amiga Editor - Open Libraries CLOSINGThe IExec->DropInterface will close the Interface if it is open. The “struct Interface *” part is indeed a cast telling that the value of IIntuition is of the type struct Interface. When we tried to get the Interface we checked if it succeeded or not. If it would have failed our code would drop to this part printing that we cannot get the Interface. The same goes for the Library part. If it is open close it and if our previous check to see if we managed to open the Library resulted in failure our code would drop to this part printing that we are unable to open the Library.

Getting to understand the opening and closing of Libraries and Interfaces can be a bit of a hurdle at first. Besides talking about it here I also have some other articles in The Bucket Programming Corner that discuss Libraries and Interfaces with an example as well. Don’t worry as sooner or later you will understand the concept of Libraries and Interfaces.

That leaves us with ReAction classes. It’s the same concept as with the Libraries. You open it, check if you managed or failed and when you are done close them

Amiga Editor - Classes STRUCTSIn this example we are trying to open the Window Class. When we open the Window Class we need to store the value somewhere. For this we have the statement “struct ClassLibrary *WindowBase = NULL;”. And yes we indeed set it to zero (NULL) like we did with the Library so we can check if we succeeded in opening the Window Class. Besides opening the Window Class we will also have to get it’s Class pointer. And this also need to be stored somewhere for which we have the statement “Class *WindowClass;”. We will discuss the concept class pointer at a later stage. For now all we need to know is that besides the Class we also need to get the Class pointer.

Amiga Editor - Classes OpeningThe above statement will open the Window Class Library and the Class pointer in one time. The part “52″ is the minimum version we want. We check just like with the Libraries if we managed to open the Window Class. The “&WindowClass” part will get the Class pointer. I could not find any info on this but I assume that if we managed to open the Window Class we automatically will get the Class pointer and do not need to check this as well.

Amiga Editor - Classes ClosingAll that is left is to close the Window Class Library. With it we also take care of the Class pointer. Just like with the Library example our code with jump to here if we failed to open the Window Class Library and prints that we are unable to do this. That’s it for this short tutorial in Libraries and Interfaces and ReAction classes.

Automatically opening of libraries and classes (part 1)

Tags

, , , ,

I was always a fan of opening and closing my libraries myself. You could have them automatically opened and closed and save you the time of writing the code for it. I did sometimes switch to use the auto open and close function so I could skip writing code for it. When you have to open and close a lot of libraries this certainly save you a lot of time. Not to mention the check part if you actually managed to open them. I was about to switch to this automatically opening if libraries when I came across some new info regarding ReAction. Since ReAction classes are implemented as system libraries we use the OpenLibrary function to open them. With the release of OS4.x a new Intuition function called OpenClass has been introduced which will open ReAction classes. If we make use of the auto open function we will also open ReAction classes. To avoid problems we better switch to opening and closing everything ourself. Besides following the proper way of opening our ReAction classes we also have full control on what is happening with our code.

Let’s talk a bit about opening Libraries and of course closing them. And not to forget opening and closing ReAction classes. In this example we are going to open the Intuition Library. If you programmed in C on the classic Amiga and also worked with libraries you will notice something new when it comes to OS4.x. Besides opening the Library we also need to open it’s Interface. The Interface can be seen as a front end for the Library. Let’s say we want to ask the Library to do a certain task. Instead of asking it directly we will ask it’s Interface to talk for us with the Library. The reason why this Interface was added would be to technical and complicated (at this moment) to discuss but one of the reason has to do with compatibility of classic software.

Amiga Editor - Open Libraries STRUCTSFirst up we need to declare two pointer structures for our Library and it’s Interface. When we open both of them we need to store the values we get back and for this we have the above two statements. It is very important we set the value to zero (NULL). If we don’t they might point to a random address in memory which might cause the whole system to crash.

Amiga Editor - Open Libraries OPENINGNext up we need to open the Library and also the Interface. With the statement “IntuitionBase = IExec->OpenLibrary(“intuition.library”, 50L);” we are trying to open the Intuition Library. Important to know is that with the Amiga OS there is always one Library open from the moment the system is up and running and that is the Exec Library. You might have guessed it already that the “IExec->” function is part of the Interface of the Exec Library. As explained before the Interface of the Exec Library is talking to the Exec Library for us and in this case it is asking to open the Intuition Library for us. The “50L” part is the minimum version we want to open. The value that we get back when trying to open it will be stored in IntuitionBase. We will have to check if we managed to open it. For this we will check the value that is stored in IntuitionBase. Remember we set it to zero (NULL)? So if we check that the value is not zero (NULL) we managed to open it. If it still has the value zero (NULL) we failed to open it.

I will divide this article in two parts. In the next and last part I will discuss opening the Interface of a Library as well as closing it including the Library and also discuss ReAction classes.

Attributes

Tags

, , ,

On yet to be released new Amiga game I am really looking forward to play is called Tales of Gorluth. I have seen the video of it and it looks really nice. It is designed by Patrick Nevian. I hope he will release a demo version soon so we can have a bit of a try.

I have started on a new series of programming articles for OS4.x called “File Attributes”. It will be about programming with files on OS4.x. From opening a file, obtaining it’s attributes and much more. I have already released the first article called “File attributes – Opening a file”. Before I write the next one I will write a next article for the Amiga Editor section. I will talk about libraries and their interfaces. I did talk about this before but it’s always good to bring it up again.

Ernie und LockeCurrently I am listening to the latest episode of BoingsWorld. This time Ernie & Locke are also present. This time they are on the show as interview partners. I am just a small bit into the interview section and so far I am having a great time listening to it.

AmigaVikkeI came across rather interesting site called AmigaVikke. The site is dedicated to coding the Amiga the old way. It’s new and at the moment there is only a Copperbars tutorial on there. It is interesting to read some Assembler code and explanation.

A rather short column this time but since I had not written one for some weeks I prefer getting one out even if it is is a short column.

Follow

Get every new post delivered to your Inbox.