amiga-news DEUTSCHE VERSION
.
Links| Forums| Comments| Report news
.
Chat| Polls| Newsticker| Archive
.

14.-16.06.24 • Flashback-Symposium #01 • Plauen-Jößnitz (Germany)
28.-30.06.24 • Alternatives Computer-Meeting 2024 • Wolfsburg (Germany)
17.08.24 • ZZAP! Live 2024 • Kenilwort (England)

12.Oct.2023



ACube Systems: Sam460LE boards at a reduced trade fair price
Press release: Dear valued customers,

We have returned from the amazing Amiga38 exhibition, where we had the pleasure of meeting many fellow Amiga enthusiasts. We sincerely appreciate your support and the enjoyable moments we shared, all centered around our shared passion.

During the exhibition, we presented our Sam460LE board at a discounted price. We are excited to announce that we have decided to extend this special offer to coincide with the upcoming Amiwest event! Although we will not be physically present at the event, you can still take advantage of purchasing the Sam460LE from our store at the exclusive price of 729 Euros (excluding VAT) or 890 Euros (including VAT).

Thank you for your continuous support, and we look forward to serving you!

ACube Systems (dr)

[News message: 12. Oct. 2023, 20:50] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
12.Oct.2023



Arcade classic: Bagman500
Jean-François Fabre ported his SDL-based clone of the arcade classic Bagman to the Amiga, which required SDL libraries and thus a graphics card. In late 2019, he released a real port that directly used the Amiga's chipset graphics (amiga-news.de reported), but required a 68020 processor and was "still slow," according to the author.

Now Bagman 500 was transcoded to 68000 and should run on any A500. (dr)

[News message: 12. Oct. 2023, 06:08] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
11.Oct.2023



AmigaOS 4: MilkyTracker 1.04 Release Candidate 1
Juha 'capehill' Niemimaki has again cross-compiled the source code of MilkyTracker for AmigaOS 4 with GCC 11.3.0 and linked it with the last stable version of SDL 2.28.0.. (dr)

[News message: 11. Oct. 2023, 05:23] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
10.Oct.2023



AmigaOS 4.1: SDL 2.28.4 Release Candidate 1
Juha 'capehill' Niemimaki has published the first release candidate of version 2.28.4 of the multimedia library SDL for AmigaOS 4.1. The library is intended to make it easier for programmers to develop portable applications and is used by numerous open source games. SDL requires AmigaOS 4.1 Final Edition and optionally OpenGL ES 2.0. Changes:
  • Fix renderer viewport issues
  • Fill renderer bitmaps with 0 during creation
  • Fill frame buffer bitmap with 0 during creation
Download: SDL2.lha (6,8 MB) (dr)

[News message: 10. Oct. 2023, 21:20] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
10.Oct.2023
Misja van Laatum (Mail)


Pixelart: Designs for unreleased game "Conflict
Misja van Laatum had recently reported in a Mastodon article that he and a friend played a lot of Empire: Wargame Of The Century in the 90s and had then made the "half-hearted plan" to make it "bigger and better". Unfortunately, nothing came of that plan. Misja, however, still owns some of the graphics he had already started, which he released to us for publication upon request: Combat backgrounds, user interface designs, a title logo and some Sculpt-3D images for an intro sequence.

Misja van Laatum explains further to us: "The game we were planning was to be called Conflict, and we had ambitious plans: terrain of different heights (hence the bunch of tiny tile graphics), more types of units than in Empire, a zoomed in view when attacking cities (the larger tiles) allowing you to target individual infrastructure, etc. The problem was that I'm not a great programmer (my skillset was limited to Blitzbasic and AMOS) and I didn't really know anyone that could, at that time... but it might be fun to one day pick this up now that I have a bit more experience."

In this respect, there is hope that the "half-hearted plan" will eventually become reality.

(dr)

[News message: 10. Oct. 2023, 06:23] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
09.Oct.2023



Review: Impbox - Internet chat on Amigas (German)
Paweł 'juen' Nowak's Infinity Music Player (IMP3) also offers internet functions such as a chat with Discord connection or sharing files with other users. While IMP3 itself runs on any Amiga with at least 512 KB RAM and OS 2.0, Chat & Co. naturally have considerably higher requirements since network hardware and a TCP stack are still needed.

The "Impbox", a version of the Plipbox adapted to IMP3, which was introduced in August, corrects this problem: it enables the use of IMP's Internet functionality without requiring additional hardware or software. A user has documented his experiences with setting up and using the Impbox in a short report including a video. (cg) (Translation: dr)

[News message: 09. Oct. 2023, 23:57] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
09.Oct.2023



New diskmag: Amiga Rulez
"Amiga Rulez" is a quarterly free diskmag whose first issue was distributed on real disks at the "Amiga 38" last Saturday and can meanwhile also be downloaded from the magazine's website. The German edition is already available, an English translation is to follow shortly. (cg)

[News message: 09. Oct. 2023, 23:17] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023
ALBs Blog


Program for DeepL use: AmiTranslate 0.3
Marcus 'ALB42' Sackrow's programme AmiTranslate (video) serves as a link to the translation service DeepL and is available for AmigaOS, AmigaOS 4, AROS (x86, x64, ARM) and MorphOS.

The new version 0.3 can now also display and print Japanese characters.

Besides an SSL-secured internet connection (OpenSSL3 under MorphOS resp. AmiSSL for the other systems) the program also needs the MUI class texteditor.mcc. (dr)

[News message: 08. Oct. 2023, 21:57] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



Event: News from the Amiga38 (update)
This weekend the Amiga38 took place. We asked around for news and things worth reporting:

AmigaOS 3.3: Camilla Boemann, who joined the AmigaOS 3 development team 4 years ago, gave a preview of the upcoming version 3.3 in a speech (YouTube video), which among other things should offer an improved and more intelligent handling of ADF files and run noticeably faster. The HDToolbox will also be replaced and partitioning will become much easier: it will no longer be necessary to specify a device or block size.

Enhancer 2.3, Virtio GPU driver: In his talk (YouTube video), Trevor Dickinson described the history of A-EON's hardware developments, announced a new Enhancer version 2.3 for probably before Christmas, and introduced the Virtio GPU driver for Picasso96: a virtual GPU for use with emulators like QEMU and virtual machines (KVMs), developed for A-EON by Hans der Ruiter. Features:
  • Looks like a regular PCI device
  • Passes graphics commands through the host operating systems graphics drivers
  • Provides 32-bit display support
  • High resolution
  • Fast - no need to emulate hardware registers
  • Virtio GPU has 3D and video decoding hardware acceleration - WIP
Virtio GPU driver current status:
  • Fully working framebuffer driver, with 8, 16, and 32-bit modes
  • Hardware accelerated mouse pointer
  • DDC/EDID working, so automatically gets available screen-modes
  • High resolution
  • Fast - no need to emulate hardware registers
  • Virtio GPU has 3D and video decoding hardware acceleration - WIP
  • Version 0.5 has just been released
  • Very usable as-is

Pre-order of A1222 Plus: At Amedia France, part of the "AAA Technology" alliance consisting of Amedia Computer, AmigaKit and A-Eon, one could place pre-orders for an A1222-Plus complete system at the special price of 1600 Euros (incl. VAT, plus PayPal or extra shipping costs), and continue to do so by via e-mail or the corresponding website. The following is a sample offer, which can be modified according to your wishes, e.g. graphics card, tower, etc:
  • Chieftec mATX Tower
  • A1222+ 1.3 Motherboard
  • Kingston 4GB SoDDR3 1600MHz
  • Crucial 240GB SSD harddisk SATA3
  • AFox Radeon RX550 4GB gfc card
There should be an official sales link on the official A1222 Plus website soon.

new products from Alinea Computer: new products were available for purchase at the Alinea Computer stand, which will also be available in the shop this week. More details will be published this week:
  • Wodem - WLAN via the serial interface for every Amiga
  • KickRom-Flash - 4-fold flash-rom adapter with up to 4 kickstarts
  • KickRom-Progger - Flash-Rom programmer for programming the KickRom flash modules directly on the Amiga
And a few prototypes were also shown, which will be released this year:
  • KickRom switch - 4-fold kick-start switch for the KickRom flash
  • KickRom switch as TV port version
  • Joyport Power Adapter - Get 5V power via the joystick port and use it for Wodem, KickRom Progger or other 5 V devices so that a separate power supply unit no longer has to be used.
  • Floppy to 5V/12V switch - To be able to quickly connect e.g. fans via the floppy power cable
native AmigaOS 4 version of Heretic II: At the beginning of the year we reported that Steffen Häuser was working on a native AmigaOS 4 version of Heretic II. The finished version could be marvelled at both at the HunoPPC stand and at Alinea Computer. At the latter, the game was shown on a Sam460ex with Radeon HD 7750 and the new GL drivers. According to Simon Neumann, it ran "absolutely smoothly". On the Sam with a resolution of 1280x1024 with 39 fps, on Steffen Häusers own AmigaOne 1000 at 1024x768 with about 100 fps.

Videos: In addition to the recording of the official live stream, there are also short tours of the fair that visitors have uploaded to YouTube, including Retro Merlin and Propheus. (dr)

[News message: 08. Oct. 2023, 21:33] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023
ALB-Blog


Web browser: AmiFox 0.4
"AmiFox" displays modern web pages on an Amiga by downloading and displaying pages converted to images by a web rendering proxy ("AmiFox server"). At Amiga38, some copies of a boxed version financed by the author were given away, which contains the new version 0.4. This offers some new features like an AREXX interface or the possibility to pass a web page as a command line parameter (both useful for OpenURL use).

Especially for Amigas with small screens (e.g. Native PAL Hires Mode), parts of the interface can be hidden: either automatically (the status bar) or by pressing a button (the text input bar). (dr)

[News message: 08. Oct. 2023, 17:39] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



Shoot'em Up: Reshoot Proxima 3 released
The official release party took place at this weekend's Amiga38, and now, after Reshoot and Reshoot R, the third part of Richard Löwenstein's shoot'em-up series has been released: Reshoot Proxima 3 (official YouTube teaser) offers the following features:
  • Custom-made for Amiga AGA-hardware
  • Fluid gameflow experience
  • 5 uniquely themed stages
  • adaptive attack wave design
  • makes full use of AGA-chipset
  • 24 bit color pixel art
  • Steady 50 fps framerate
  • 2 difficulty settings
  • Energizing music and sound-fx
  • Entire code in Assembly-language
  • Local and global highscore table
  • Available on CD-ROM boxed, USB and digital
  • Exclusive for Commodore Amiga A1200, A4000 and CD32
  • Compatible with most Amiga-emulation systems, MISTer, A500 Mini, PPC
In addition to Richard Löwenstein as project manager and coder, Kevin Saunders was responsible for the graphics and Martin "Altraz" Ahman and Jochen "Virgill" Feldkötter for the sound design. The game is available in different versions in the Amiga Onlineshop (dr)

[News message: 08. Oct. 2023, 17:28] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



Aminet uploads until 07.10.2023
The following files have been added until 07.10.2023 to Aminet:
SegTracker.lha           dev/debug  22K   68k A global SegList tracking uti...
c2plib.lha               dev/misc   201K  68k chunky2planar as an Amiga sha...
gibattaglianavale.lha    dev/misc   278K  68k GI Battaglia Navale 
giplanner.lha            dev/misc   290K  68k GI Planner 
P96Prefs.lha             driver/vid 111K  68k P96 Preferences Editor
AmiTechGazette-Issue0... mags/misc  3.7M      Free preview of Ami Tech-Gaze...
AmiVms.lha               misc/emu   3.7M  68k Simulates OpenVMS commands
PDF2JPG.lha              util/conv  16M   MOS convert PDF to JPG
PDF2PDF.lha              util/conv  15M   MOS convert PDF to PDF
Magellan_II_SDK.lha      util/dopus 146K  68k DOpus Magellan II Software De...
AmigaGPT.lha             util/misc  207K  68k App for chatting to ChatGPT
VATestprogram.zip        util/misc  15M   68k Versatile Amiga Testprogram
(snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



OS4Depot uploads until 07.10.2023
The following files have been added until 07.10.2023 to OS4Depot:
nallepuh.lha             aud/mis 83kb  4.1 Nalle Puh (Paula,CIAA,CIAB emula...
seq.lha                  aud/mis 424kb 4.1 MIDI sequencer
oo.lha                   dev/lib 2Mb   4.1 Bring easier programming to C an...
hidtouchusbfd.lha        dri/inp 63kb  4.1 USB HID driver for touchscreen m...
viivi.lha                gra/vie 323kb 4.1 Picture viewer
pdf2pdf.lha              uti/mis 15Mb  4.0 Convert PDF to PDF
touchbench.lha           uti/mis 61kb  4.1 Mouse emulator for touchscreens
quickstarter.lha         uti/wor 416kb 4.1 Quick program start menu
(snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



AROS Archives uploads until 07.10.2023
The following files have been added until 07.10.2023 to AROS Archives:
fade2black.i386-aros.zip     gam/act 6Mb   Fade to Black is an action-adven...
drawer_icon_games_kensv4.lha gra/ico 246kb Drawer Games Icons Kens v4 Style
icon_game_38x38.lha          gra/ico 234kb icon game 38x38
(snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



MorphOS-Storage uploads until 07.10.2023
The following files have been added until 07.10.2023 to MorphOS-Storage:
AstroMenace_1.3.3.lha     Games/Shoot3D             Hardcore 3D space scrol...
Easy2Install_1.0b38.lha   Network/PackageManager    A package manager to do...
PDF2PDF_1.3.lha           Office/Convert            Convert PDF to PDF
(snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



WHDLoad: New installers until 07.10.2023
Using WHDLoad, games, scene demos and intros by cracking groups, which were originally designed to run only from floppy disks, can be installed on harddisk. The following installers have been added until 07.10.2023:
  • 2023-10-04 improved: Zaxxon (Bignonia) overhauled, keyboard and snoop errors fixed, trainer and icons added (Info, Image)
(snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023



AmigaRemix: Further files added
AmigaRemix collects remixes of well-known soundtracks of Amiga games. Since our last news-item, the following mp3 files have been added:
  • Battle Squadron - Loose (Spatial Mix)
  • Physical Presence (Spatial mix)
(snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
08.Oct.2023
Amigaworld.net (Forum)


Forum: AROS-Exec preserved on AROSWorld
After the closure of Ola '4pLaY' Jensen's forum AROS-Exec for health reasons, AROSWorld has preserved it read-only for posterity at the title link. (snx)

[News message: 08. Oct. 2023, 10:54] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
07.Oct.2023



Music album: "Virtual Burnout" by LukHash
'LukHash' is a musician living in Edinburgh (Scotland). He describes his music as "fusion of 8-bit digital mayhem and '80s inspired synth music combined with modern sounds and cyberpunk aesthetics." In March we reported on his track Amiga, which is also included on the now released new album "Virtual Burnout" and can be purchased on music stores and streaming platforms. (dr)

[News message: 07. Oct. 2023, 22:17] [Comments: 2 - 12. Oct. 2023, 05:57]
[Send via e-mail]  [Print version]  [ASCII version]
07.Oct.2023



Blog: Author of "Fire and Ice" about game engines
Andrew Braybrook has also written classics for the Amiga: Rainbow Islands, Paradroid 90, Realms, Fire and Ice und Uridium 2. He runs his own blog and in his latest entry talks about his experiences with game engines gained during his long creative career as a developer.

Over the years, he said, he has developed a method for writing a game engine that makes it possible to write a new game faster, prototype new game elements faster, and even develop entire small games in a matter of weeks. (dr)

[News message: 07. Oct. 2023, 15:10] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
07.Oct.2023



Detailed article: Connecting an Amiga to a modern display
Developer Steffest, among other things author of the Amiga MOD tracker Bassoontracker and the web-based image editor DPaint.js, describes in a detailed article on the website of the Belgian Amiga Club the possibilities of running an old Amiga on a current monitor, if no old crt monitor is available. (dr)

[News message: 07. Oct. 2023, 06:39] [Comments: 0]
[Send via e-mail]  [Print version]  [ASCII version]
05.Oct.2023



Tutorial: Writing an Amiga GUI program in C
Edwin van den Oosterkamp has already dedicated two books to programming on the Amiga: "Classic AmigaOS Programming - An introduction" is an introduction to programming the AmigaOS in C and assembler. The target group are programmers without Amiga experience, or former Amiga programmers who want to develop for the Amiga again after a longer break. "Bare Metal Amiga Programming" goes into the programming of the hardware bypassing the operating system.

We invited the programmer to show how to get started with C programming by means of a concrete example and say thank you very much for the following instructions:

"There are many things I love about the Amiga and one of these is the OS. AmigaOS provides a lot of the things we now take for granted in an operating system. Not only the obvious things like windows, menus, icons and such but also things like multi-tasking and inter-process messaging. And compared to modern operating systems there are not many layers between AmigaOS and its applications, so it feels like you're having direct access to the OS. Personally I really like using my Amiga for productivity tasks and this includes using it to write Amiga software. This article uses a simple example program to show how an Amiga GUI program in C can be created using the Amiga itself. To save you all the typing I have also released the source code for this program so that you can download it from here.

Native development

When the new Kickstart/Workbench 3.2 was released its developers also released the matching Native Development Kit, or NDK for short. This kit can be downloaded for free from the Hyperion website and contains (amongst other things) the include headers needed for development in C. The 3.2 NDK does not just cover all the new things that Kickstart 3.2 brought, but also all includes for the older functionality of previous kickstarts. It is therefore perfectly fine to use the 3.2 NDK and develop software for Kickstart 2.0 and upwards - or even Kickstart 1.x and upwards. You do need to be careful not to call any of the new functions that were not available on the older Kickstart versions.

The NDK does not include a compiler nor a text editor. For the text editor you can use any editor you like. I've been using the "TextEdit" program that comes with Workbench 3.2 but plenty more options are available on places like Aminet. There is of course also "edit", the standard text editor that has been part of the Workbench since the 1.x days.

There are a number of different C compilers available for the Amiga. From gcc forks down to the old compilers people used in the 90's. My choice for native compilation is VBCC, which is a compiler that runs on the Amiga natively, creates good code and is still actively maintained. It is also designed to run on systems with considerably less resources than a modern PC, unlike for example versions of gcc.

Speaking of resources, to install the NDK your Amiga will definitely need a hard disk. It does not matter if it is a real spinning rust drive, a CF card or an emulated one on a memory card. When installed the NDK simply does not fit on a floppy. Of course it is possible to cherry pick just those header files that are required for a certain project, but then you are not making it easy on yourself. Your system also needs something faster than a standard 68000 CPU. The newer versions of VBCC require a 68020 or higher, and while it is possible to use an older version on a 7Mhz 68000, it just takes too long to compile any non-trivial project for it to be really practical.

Installing LHA

The NDK download will be in the LHA file format. This is an archive format similar to (but not the same as) the ZIP format used by Windows nowadays. The "lha" command is used to extract the archive, which can be downloaded from Aminet here: http://aminet.net/util/arc/lha.run. If your Amiga already has LHA installed then please feel free to skip this section.

The lha.run file is a self-extracting archive that, when run on an Amiga, will produce multiple files. Two are documentation files, one as a "readme" text and one in "guide" format. Then there are three executables, one for the 68k, one for the 68020 (and higher) and one for the 68040 and higher. Select the one that is correct for your system, rename it to "lha" and copy it into the C: folder.

Installing the 3.2 NDK

The first step is downloading the NDK from the Hyperion website.

To keep things organised I recommend creating a drawer named "Develop" in the root of your hard drive. If you use multiple partitions then it does not matter which one you choose, that is up to you. Then inside that "Develop" drawer create a drawer named "NDK3.2". Then copy the downloaded lha file of the NDK into this "NDK3.2" drawer.

Open a Shell or CLI window and navigate into this "NDK3.2" drawer. To extract the lha archive, type the following command into the shell window:
> lha x NDK3.2R4.lha
Please note that the developers of the NDK are planning to keep updating it as and when required. This means that the name of the lha archive may change and that the file you have downloaded may not be named "NDK3.2R4.lha" like mine was. Please update the filename used to unpack the archive with the name your archive has. The above command will unpack all the contents of the lha file. After that has successfully concluded you can safely delete the lha archive from the drawer.

Installing VBCC

The VBCC compiler consists of two parts, the compiler part and the target part. This allows VBCC to be used for cross-compilation. For example, with the Amiga compiler and the Atari target it is possible to write Atari software on an Amiga. With the Windows compiler and the Amiga target it is possible to create Amiga executables on a Windows PC.

In this case we want to download the Amiga 68k compiler: vbcc_bin_amigaos68k.lha.
And the AmigaOS 68k target: vbcc_target_m68k-amigaos.lha.

The above target allows for compiling software for Kickstart 2.0 and newer. To develop for the older Kickstart 1.x versions a different target is required, which can be downloaded from: vbcc_target_m68k-kick13.lha.

The example used by this article depends on Kickstart 2.0 functionality and therefore the first of the two target archives is required. For more information about VBCC, please check out the website (http://sun.hasenbraten.de/vbcc/) where you can also find compilers and targets for next generation PPC based Amigas and other systems.

The lha archives for VBCC contain an installer script that will copy all files to the correct location and set everything up for use. These archives therefore need to be unpacked into a temporary location like the ram: disk or the T: directory. After unpacking you can simply double click the "install" icon and follow the on-screen instructions. First start with the "bin" archive and then follow up with the contents of the "target" archive.

One of the things the VBCC installer is going to ask for is the location of the NDK. This location is the "NDK3.2" drawer into which the NDK lha archive was unpacked previously.

Hello world, meet our first program

The program below will open a small window titled "Hello World!", which then closes itself automatically after a short time. To open the window a function called OpenWindowTagList() is used, which was introduced with Kickstart 2.0 (Intuition library V36). This program therefore requires Kickstart 2.0 or newer to run.
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
#include <intuition/intuitionbase.h>
#include <intuition/intuition.h>
 
int main()
{
	char  Title[] = "Hello World!";
	ULONG WinTags[] = {
                        WA_Width,    	200,
                        WA_Height,   	100,
                        WA_Title,    	(ULONG)&Title,
                        WA_Activate, 	1,
			TAG_END
                     };
 
	struct Window * pWin = OpenWindowTagList( NULL, (struct TagItem *)&WinTags );
	if ( !pWin )
	{
		return -1;
	}
 
	Delay( 500 );
 
	CloseWindow( pWin );
 
	return 0;
} 
To compile it, copy/paste it into a text file named 'test.c' and use the following command in a shell/CLi window:
> vc -c99 -lauto test.c -o Test
This will create an executable named "Test", which you can run from the shell.

The "-c99" argument enables the compiler's support for the C99 standard. Amongst other things this enables support for comments starting with '//' as well as support for declaring variables at their first use, instead of placing them all at the top of the function.

The "-lauto" argument tells the linker to automatically open and close the system libraries used by the program. For example, the OpenWindowTagList() function is part of the Amiga's Intuition library, while the Delay() function is part of the Dos library. Without the "-lauto" argument it is up to the programmer to open and close these libraries as and when required. Letting the linker worry about these things keeps things a bit more readable.

Closing on command

Instead of closing automatically, it would be much better if the window had an actual working close gadget. To achieve that we need to enable the window's close gadget and then respond to it when it is clicked by the user. On AmigaOS the windows are managed by the Intuition library and the library communicates with the applications via messages. These messages are received via each window's "Intuition Direct Communications Message Port", or IDCMP for short. The messages are therefore known as IDCMP messages. It is up to the application to indicate which class of message it wants to receive for each window.

The updated program is shown below. Two new tags have appeared in the Window's taglist: the WA_CloseGadget tag enables the window's close gadget and the WA_IDCMP tag indicates the classes of messages the program wants to receive - only the IDCMP_CLOSEWINDOW class at this point.
#include <proto/exec.h>
#include <proto/intuition.h>
#include <intuition/intuitionbase.h>
#include <intuition/intuition.h>
 
int main()
{
	char  Title[] = "Hello World!";
	ULONG WinTags[] = {
                        WA_Width,    	200,
                        WA_Height,   	100,
                        WA_Title,    	(ULONG)&Title,
                        WA_Activate, 	1,
                        WA_IDCMP,	IDCMP_CLOSEWINDOW,
                        WA_CloseGadget,	1,
			TAG_END
                     };
 
	struct Window * pWin = OpenWindowTagList( NULL, (struct TagItem *)&WinTags );
	if ( !pWin )
	{
		return -1;
	}
 
	WaitPort( pWin->UserPort );
 
	CloseWindow( pWin );
 
	return 0;
} 
The only other difference is that the Delay() function from the Dos library has been replaced with the WaitPort() function from the Exec library. WaitPort() puts the program to sleep until a message arrives on the port. And in this case that can only be an IDCMP_CLOSEWINDOW message, so as soon as we receive a message on the port we know we can close the window and call it a day.

On AmigaOS it is important to ensure that the program closes all Windows, files and so on before it terminates. Unlike modern operating systems there is nothing keeping track of these things for your process. If you forget to close a window upon exit then that Window will stay there. On AmigaOS you are solely responsible to close/free everything that you've opened/allocated.

Closing on command, now properly please

The previous program works as intended but only because it is a trivial program. With a normal program there will be a number of different classes of IDCMP messages coming in, each requiring a different response from the program. To do this properly for our program the following part needs to be added instead of the "WaitPort( pWin->UserPort );" line:
	int Run = 1;
	while ( Run )
	{
		WaitPort( pWin->UserPort );
 
		struct Message * pMsg;
		while ( pMsg = GetMsg( pWin->UserPort ) )	
		{
			struct IntuiMessage * pIMsg = (struct IntuiMessage *)pMsg;
 
			switch ( pIMsg->Class )
			{
				case IDCMP_CLOSEWINDOW :
						Run = 0;
						break;
			}
 
			ReplyMsg( pMsg );
		}
	}
The program is still put to sleep while waiting for messages on the port. But now when the program wakes up it actually gets the message from the port, checks the class of the message and replies the message. This last point is important since only then will Intuition know that the message has been dealt with and that any resources held can be released. The program receives the messages in a loop since it is possible that there is more than one message waiting when the program wakes up. And if the message is not of the IDCMP_CLOSEWINDOW class (unlikely in our still trivial case) then the program needs to continue running and processing.

Let's add some more GUI based functionality to our little program.

Gadtools

With Kickstart 1.x the only way to create menus and gadgets was via the Intuition library. With Kickstart 2.0 a second method was introduced with the Gadtools library. Gadtools made creation of menus and gadgets much simpler and at the same time added a number of new standard gadgets. These new standard gadgets meant not only that programmers no longer needed to create their own, but also that these gadgets now had an uniform look across different programs. The menus and gadgets created with Gadtools still consist of Intuition based elements and can be mixed with traditional Intuition based gadgets and menus.

Since Gadtools has been bolted on top of Intuition all messages its elements generate are IDCMP messages. Some of these messages are for internal use by Gadtools only and to filter these out Gadtools provides its own version of the GetMsg() and ReplyMsg() functions that should be used instead. This also means that some IDCMP messages are for Gatools' use only, in which case the GT_GetIMsg() function may return NULL on the first call if there are no other messages available.

Using the Gadtools functions the message loop from the previous section now looks as follows:
	int Run = 1;
	while ( Run )
	{
		WaitPort( pWin->UserPort );
 
		struct IntuiMessage * pIMsg;
		while ( pIMsg = GT_GetIMsg( pWin->UserPort ) )	
		{
			switch ( pIMsg->Class )
			{
				case IDCMP_CLOSEWINDOW :
						Run = 0;
						break;
			}
 
			GT_ReplyIMsg( pIMsg );
		}
	}
One additional nicety is that the GT_ functions work on IntuiMessage structs instead of Message structs. This removes the need to cast from one type of pointer to another and makes the code look a bit cleaner.

Gadtool menus

GadTools menus are created via an array of NewMenu structs. From this array the Gadtools function CreateMenuA() generates a list of Intuition Menu structs. None of the sizes and locations of the menus and their items are calculated at this point. This is done by calling the Gadtools LayoutmenusA() function. This function also requires a pointer to a VisualInfo struct, which contains all information Gadtools requires to calculate screen and font sizes. A pointer to this struct is obtained from the GetVisualInfo() function.

The last field of the NewMenu struct is a pointer that can be used for user data. This can for example be a pointer to a function, when the user selects that menu item the program can use the pointer to call a particular function. In this case I have created a number of integer defines that are interpreted as commands. The program can read the user data and show the About window when it sees the CMD_ABOUT value or for example quit the program when it sees CMD_QUIT.
struct Menu * CreateMenu( void * pVI )
{
	struct NewMenu nm[] = {
			{ NM_TITLE, "Project",   0, 0, 0, 0 },
			{ NM_ITEM,  "About...",  "A", 0, 0, (APTR)CMD_ABOUT },
			{ NM_ITEM,  NM_BARLABEL, 0, 0, 0, 0 },
			{ NM_ITEM,  "Quit",      "Q", 0, 0, (APTR)CMD_QUIT },
			{ NM_TITLE, "Options",   0, 0, 0, 0 },
			{ NM_ITEM,  "High",      0, CHECKIT|MENUTOGGLE|CHECKED, 0x6, (APTR)CMD_OPTHIGH },
			{ NM_ITEM,  "Mid",       0, CHECKIT|MENUTOGGLE, 0x5, (APTR)CMD_OPTMID },
			{ NM_ITEM,  "Low",       0, CHECKIT|MENUTOGGLE, 0x3, (APTR)CMD_OPTLOW },
			{ NM_END, 0, 0, 0, 0, 0 }
			  };
 
	struct Menu * pMenu = CreateMenusA( nm, 0 );
	if ( !pMenu )
	{
		return NULL;
	}
 
	LayoutMenusA( pMenu, pVI, 0 );
 
	return pMenu;
}
At this point the menu structure has been setup including the size and location of each of its items. The menu is now ready to be added to a window, for example via the SetMenuStrip() function that is part of the Intuition library.

Intuition will send the IDCMP_MENUPICK message each time the user interacts with the menu. In order to receive these messages for our menu we need to add that message class to the WA_IDCMP tag used for the OpenWindowTagList() function. This is done by logic-OR-ing the new message class with the already existing class. In the message loop we also need to add the IDCMP_MENUPICK class to the switch statement that checks the pIMsg->Class field of the received message.

The code field of the IDCMP_MENUPICK message has a unique number identifying the menu/item. This number is assigned by Intuition and indicates the item's position in the menu bar (e.g. 5th item of 3rd menu). The NDK provides handy macros to decode the menu number and Intuition provides the ItemAddress() function for obtaining a pointer to the Menu or MenuItem struct of the menu element that the user interacted with.

Unfortunately neither the Menu struct nor the MenuItem struct have user data fields. Gadtools worked around this by placing the user data immediately after the struct of the element. It is important to keep in mind that a Menu struct has a different size compared to a MenuItem struct. Before we can read the user data we need to find out if it was a menu or an item that caused the message. In the case of our example program only items have interesting user data, so if the message was not caused by the user interacting with an item then we can skip the reading of the user data.

The following function does all the things discussed above; it uses one of the menu number macros to check if the message is from an item. Then it gets the address to the MenuItem struct and moves the pointer to directly after the struct. It interprets the data after the struct as an integer and returns the value of that integer. The returned value also includes a value defined elsewhere in the program to indicate that this command came from a menu selection.
int ProcessMenuPick( struct Menu * pMenu, struct IntuiMessage * pIMsg )
{
	if ( ITEMNUM( pIMsg->Code ) == NOITEM )
	{
		return CMD_NONE;
	}
 
	char * pItem = (char *)ItemAddress( pMenu, pIMsg->Code );
	if ( !pItem )
	{
		return CMD_NONE;
	}
 
	pItem += sizeof( struct MenuItem );
 
	int Command = *(int *)pItem;
 
	return Command | SRC_MENU;
}

Gadtools gadgets

The creation of gadgets works slightly different from the way Gadtools creates menus. Menu creation was done via an array of structs that represented multiple items and menus. Gadgets are created one at a time by calling the CreateGadgetA() function for each gadget. Gadgets are linked into a list by providing the pointer to the previous gadget when calling CreateGadgetA() to create the next gadget. The start of this linked list must first be created by calling CreateContext() and the pointer from CreateContext() is then passed on to CreateGadgetA() for the creation of the first actual gadget.

The following function creates a list of gadgets and returns a pointer to the top of the list. This pointer is later required to free the list. The function uses arrays for most of the arguments of CreateGadgetA(). More gadgets can be added by extending these arrays.
struct Gadget * CreateGadgets(  struct Window * pWin, 
					 void * pVI, 
				struct Gadget * pGadgets[] )
{
	#define NUM_GADGETS	3
 
	// The labels and tags for the cycle gadget
	static char * cycLabels[] = { "High", "Mid", "Low", 0 };
	ULONG cycTags[] = { GTCY_Labels, (ULONG)cycLabels, TAG_END };
 
	// The arrays used for the creation of the gadgets	 
	int ggKind[NUM_GADGETS] = { BUTTON_KIND, BUTTON_KIND, CYCLE_KIND };
	ULONG * ggTags[NUM_GADGETS] = { NULL, NULL, cycTags };
	struct NewGadget ggNew[NUM_GADGETS] = {
			{ 100,78,85,14, "Quit", 0,1,0, pVI, (APTR)CMD_QUIT },
			{ 100,20,85,14, "About..", 0,2,0, pVI, (APTR)CMD_ABOUT },
			{ 100,35,85,14, "Options", 0,3,0, pVI, (APTR)CMD_OPTIONS },
				};
 
	struct Gadget * pGad;
	struct Gadget * pContext = CreateContext( &pGad );
	if ( !pContext )
	{
		return NULL;
	}
 
	for ( int Index=0; Index < NUM_GADGETS; ++Index )
	{
		pGad = CreateGadgetA( ggKind[ Index ], pGad, &ggNew[ Index ], (struct TagItem *)ggTags[ Index ] );
		pGadgets[ Index ] = pGad;
	}
 
	AddGList( pWin, pContext, 0, -1, 0 );
 
	RefreshGList( pContext, pWin, 0, -1 );
 
	return pContext;
}
After the gadgets have been created the Intuition function AddGList() is used to add the gadgets to the window, followed by Intuition's RefreshGList() function which ensures that all gadgets are setup correctly and show the correct state on screen.

One additional thing to note is the pGadgets[] argument of the function above. This array of pointers takes the pointer of each gadget created by Gadtools. These pointers can be used by the program to manipulate the state of the gadgets when required. There wiil be an example of this later on in this article, where the selected item of the cycle gadget will be changed.

The window will receive IDCMP_GADGETUP messages when the user interacts with the buttons. Please note that other types of buttons may produce other classes of messages as well. Internally Gadtools may depend on other IDCMP messages as well, but without passing them on. To ensure that the right messages are being received for Gadtools' purposes a macro is provided for each type of Gadtools gadget. In our case we use only the BUTTON_KIND and CYCLE_KIND gadgets. To ensure these work correctly we need to logic-OR the macros BUTTONIDCMP and CYCLEIDCMP with the other classes already present for the window's WA_IDCMP tag.

The IDCMP_GADGETUP message has in its "IAddress" field the address of the Gadget structure of the gadget the user interacted with. This is a pointer to the Intuition Gadget struct and unlike the structs used by the menus, this struct does already contain a UserData field. Reading this field will tell us which gadget was being clicked by the user. The only extra step required is for the CYCLE_KIND gadget, where the "Code" field of the message gives the (zero-based) index number of the option the user selected.

Since all information we need is already provided by the IntuiMessage of the IDCMP_GADGETUP class, dealing with it is simpler than the dealing with the IDCMP_MENUPICK message, as the following function shows:
int ProcessGadgetUp( struct IntuiMessage * pIMsg )
{
	struct Gadget * pGadget = (struct Gadget *)pIMsg->IAddress;
	if ( !pGadget )
	{
		return CMD_NONE;	
	}
 
	int Command = (int)pGadget->UserData;
 
	if ( Command == CMD_OPTIONS )
	{
		Command += pIMsg->Code;
	}
 
	return Command | SRC_GADGET;
}
Just like the function dealing with the IDCMP_MENUPICK message, this function adds an indicator to show that the command was produced via interaction with a gadget.

Updating the user interface

There are times when a program needs to update the menu or gadget selections in order to reflect the program's state. In our example program we have a cycle gadget and a menu, each showing the exact same selection. It would only be proper for the program to ensure that both indeed always show the same selection. To do this, the program needs to be able to change the selection of the cycle gadget as well as the selection of the mutual-exclusive menu items.

Updating the cycle gadget is straight forward with Gadtools' GT_SetGadgetAttrsA() function. This function takes a pointer to the gadget as well as a taglist with the gadget's new setting. In this case all we need to do is to provide the new selection via the GTCY_Active tag and call GT_SetGadgetAttrsA(). The fact that we need the pointer to the gadget to be able to do this is the reason that our CreateGadgets() function returned all the individual pointers via the the pGadgets[] array.

Unfortunately updating the menu is a bit more involved. Before we can make any changes to the menu we need to remove it from the window using the ClearMenuStrip() function. After the changes have been made we can use ResetMenuStrip() to place it back on the window. Intuition menus consist of linked lists. We know that the first selection item is the 1st item on the 2nd menu, so we can use the ItemAddress() function to get the address of the MenuItem struct of the first selection item. The structs of the next two selection items can be found by following the "NextItem" fields of each struct. Updating the selection tick for an item is done by adding or removing the CHECKED flag in the "Flags" field of each item's MenuItem struct.

The following function uses the "Command" value to update the cycle gadget and the menu items. The "Command" value also indicates what the source of the command was so that it can be used to prevent updating the element that provided the command. For example, when the user interacts with the menu then the menu does not need to be updated by the program.
void UpdateOptions( int Command, struct Window * pWin, struct Gadget * pGadList[] )
{
	int Source = Command & SRC_MASK;
	int Option = Commnad & 0x0F;
 
	if ( (Source != SRC_GADGET) && pGadList && pGadList[2] )
	{
		ULONG cycTags[] = { GTCY_Active, (ULONG)Option, TAG_END };
		GT_SetGadgetAttrsA( pGadList[2], pWin, NULL, (struct TagItem *)&cycTags );
	}
 
	if ( Source != SRC_MENU )
	{
		struct Menu * pMenu = pWin->MenuStrip;
		if ( pMenu )
		{
			ClearMenuStrip( pWin );
 
			UWORD MenuNumber = FULLMENUNUM( 1, 0, 0 );
			struct MenuItem * pItem = ItemAddress( pMenu, MenuNumber );
			for ( int Index=0; Index < 3; ++Index )
			{
				if ( pItem )
				{
					if ( Index == Option )
					{
						pItem->Flags |= CHECKED; 
					}
					else
					{
						pItem->Flags &= ~CHECKED; 
					}
 
					pItem = pItem->NextItem;
				}
			}
 
			ResetMenuStrip( pWin, pMenu );
		}	
	}
}

Keyboard action

In a lot of cases there is not much to do for a program in order to support the keyboard. The menu takes care of its own shortcuts and any gadgets that take text, e.g. string gadgets, take care of the keyboard themselves. There is one thing though that Intuition does not provide for, mainly since it was not really a "thing" back in the day. And that "thing" is closing a window when the escape key is hit by the user. Of course our window is actually a main window for which close-on-esc is less common, but it still useful to show how simple it is to do this for an AmigaOS application.

Keyboard support is provided by means of IDCMP messages, of which there are two key related classes. The IDCMP_RAWKEY message is sent each time a key is pressed and each time a key is released. It contains the raw key code directly from the keyboard, but without translating it according to the installed keyboard layout. The other message is the IDCMP_VANILLAKEY message, which does translate the key codes by using the default keymap. For keys that don't translate to a keymap (like the function keys for example) no IDCMP_VANILLAKEY message will be sent, to receive key codes for those the IDCMP_RAWKEY message is needed.

In our case all we need to know is that the user has released the "Esc" key and for that the IDCMP_RAWKEY message is enough. To receive the message we need to add the IDCMP_RAWKEY class to the window's WA_IDCMP tag. Each time a key is pressed and each time a key is released the program will now receive an IDCMP message with the IDCMP_RAWKEY class and the raw key code in the "Code" field of the message. The function below shows a simple way to deal with this message:
int ProcessRawKey( struct IntuiMessage * pIMsg )
{
	if ( pIMsg->Code != 0xC5 )
	{
		return CMD_NONE;
	}
 
	return CMD_QUIT;
}
The magic number "0xC5" used above is the code sent by the keyboard when the "Esc" key is released. This key is in the same location on all keyboard layouts and therfore the code will be the same for all keyboard layouts.

Resources

There you have it, a small AmigaOS GUI program that does absolutely nothing. Nothing, apart from showing how things work within the AmigaOS graphical environment. It is up to you now to expand on it. Maybe add some different types of Gadtools gadgets? Or actually add some useful functionality? In any case, to take it further here are some resources that are useful to the general AmigaOS programmer..."
  • The "Autodocs" directory in the NDK3.2 directory contains a lot of in-depth information on the various system library calls.
  • The "Examples" directory in the NDK3.2 directory.
  • The Amiga Developer Docs at amigadev.elowar.com.
  • The coders section on the English Amiga Board at eab.abime.net.
(dr)

[News message: 05. Oct. 2023, 20:49] [Comments: 1 - 06. Oct. 2023, 23:34]
[Send via e-mail]  [Print version]  [ASCII version]
1 13 20 ... <- 25 26 27 28 29 30 31 32 33 34 35 -> ... 40 548 1061 [Archive]
 
 Recent Discussions
.
Calvin Harris - Amiga A1200
Amiga 4000(T)ower for sale
Amiga basic rewritten for Apple
Volker Wertich interview
Commodore Amiga MYSTYLE
.
 Latest Top-News
.
Interview: Announcement of a cost-reduced MiSTer FPGA board (08. May.)
MorphOS: Web browser Wayfarer 8.2 (2nd update) (04. May.)
Print/PDF magazine: Amiga Addict, issue 29 (02. May.)
A-EON announces new version of Personal Paint for A600GS (27. Apr.)
Hollywood Designer 7.0 released (14. Apr.)
Trevor Dickinson has already acquired co-ownership of AmigaOS 4 in 2019 (12. Apr.)
Practical report: Comparison between A1222 Plus and Sam460LE (Czech) (10. Apr.)
Hyperion has been managed by a receiver since last week (Update) (08. Apr.)
Hyperion: Bankruptcy proceedings reopened against Ben Hermans B.V. (Update) (29. Mar.)
Motorola68k emulation: Emu68 V1.0 (21. Mar.)
.
 amiga-news.de
.
Configure main page

 
 
.
Masthead | Privacy policy | Netiquette | Advertising | Contact
Copyright © 1998-2024 by amiga-news.de - all rights reserved.
.