Skip to content

Development of an application to run on Amiga Workbench.

License

Notifications You must be signed in to change notification settings

deans-code/spark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spark

๐ŸŽฅ Background

2025 marks the 40th anniversary of Commodore's Amiga line of personal computers, with the first model being introduced on July 23rd 1985.

My first personal computer was a Commodore Amiga 500, it introduced me to the world of the desktop GUI with Workbench running on the multi-tasking operating system AmigaOS.

A vibrant and enthusastic community exists today which continues to develop both software and hardware for the Amiga line, one notable recent development is the PiStorm accelerator which replaces the original Motorola 68k CPU to offer dramaticaly improved performance, simple Wi-Fi connectivity, emulated hard disk and other modern features. I have upgraded my own 30+ year old Amiga 500 with a PiStorm, along with the GoDRIvE 1200 USB floppy drive emulator and transparent Plexilaser Case.

My development experience on the Amiga is limited to using tools such as the Shoot-'Em-Up Construction Kit to create basic games as a child. I wanted to celebrate the anniversay of the Amiga line by learning how to develop my own applications for Workbench.

I have decided to use Magic User Interface to build a simple application providing financial management tools.

โœ… Scope

  • Create basic application.
  • Configure emulation.
  • Create compound interest calcualtor tool.

๐Ÿ”ญ Future Gazing

  • Configure emulation to match specification of original Amiga 500 hardware.
  • Adapt application to support a suite of tools.
  • Define additional tools to develop.

๐Ÿชฒ Known defects

No known defects.

๐Ÿ”ฎ Use of AI

GitHub Copilot was used to assist in the development of this software.

๐Ÿš€ Getting Started

๐Ÿ’ป System Requirements

Software

Windows Amiga Forever

Note

Other operating systems and versions will work, treat versions as minimums.

Note

I am recommending Amiga Forever which is a licenced product due to it including the necessary Amiga ROMs and AmigaOS/Workbench assets required to fully emulate the Amiga platform.

Visual Studio extensions

For compilation, emulation and debug support in VS Code install the Amiga C/C++ Compile, Debug & Profile (fork with libs support) extension.

Note

Both tasks.json and launch.json are configured to build and run the application using WinUAE which is installed as part of the above extension.

For general C/C++ support install Microsoft's C/C++ extension.

VS Code also recommended the use of Microsoft's C/C++ Extensions.

๐Ÿ’พ System Configuration

Amiga Forever ships with ROMs and Workbench adf disk images, along with other useful Amiga related files.

These files will typically be installed here: C:/Users/Public/Documents/Amiga Files/Shared/

You will need to copy the following files from this directory into the /amiga/ directory in the root of the solution:

  • amiga-os-310-a1200.rom
  • amiga-os-310-workbench.adf

The Workbench disk requires modification before it will work with the emulator:

  1. Load Amiga Forver.
  2. Configure the Amiga 1200 system to boot without loading a disk:
    1. Right click on the system and select Edit.
    2. Navigate to the Media tab and set Built-in Disks > Boot to None.
  3. Start the updated configuration.
  4. Load your copied amiga-os-310-workbench.adf file into the floppy disk drive.
  5. Free space on the amiga-os-310-workbench.adf disk:
    1. From the Workbench desktop, open the Workbench3.1 disk.
    2. Right click and from the context menus select Window > Show > All Files.
    3. Delete the Extensions directory.
  6. Add the directories required by the Amiga VS Code plugin:
    1. Create a new drawer called Fonts.
    2. Create a new drawer called Locale.
  7. Close the emulator.
  8. Rename your amiga-os-310-workbench.adf file to amiga-os-310-workbench-modified.adf.

Note

I haven't discovered an issue with removing the empty Extensions directory, however, issues may arise. The documention for the VS Code plugin details alternative methods of configuring WinUAE using hard disk files.

Amiga (hardware)

Not yet, but I would like to run the application on my original 30+ year old Amiga 500!

๐Ÿ”ง Development Setup

Clone the repository.

Open in Visual Studio code.

Hit F5 to build and run.

โšก Features

The application currently provides a single tool to calculate compound interest.

๐Ÿ“Ž Usage

Start the application.

Provide:

  • a monthly contribution value,
  • a number of years over which they will contribute,
  • the anticpated average interest rate over that period.

Click "Calculate", the tool will confirm the inputs and then calcualte the expected growth of their savings.

Screenshot

โ“ Testing

Testing has been conducted via the WinUAE emulator.

The WinUAE emulator is launched via the VS Code extension documented here.

๐Ÿค” Limitations

Working with retro technology raises certain interesting limitations.

The limitations I have encoutered will be listed here for reference.

Floating point arithmetic

When performing certain operations using floating point numbers, the following error is common:

Error 8000000B

The code which triggered the above example was as follows:

	char test[128];
	snprintf(
		test, 
		sizeof(test), 
		"%0.2f", 
		12.12);

This code fails when attempting to format a double as a string.

Many Amiga CPUs could not use hardware to process floating point arithmetic, for hardware support an FPU coprocessor was required.

The CPU could, however, process floating point arithmetic using slower software emulation.

During devlopment of my application, the default WinUAE configuration and C compilation did not produce the environment necessary for the handling of floating point numbers.

The compiler in use by the VS Code extension is part of GCC, the GNU Compiler Collection project.

This project supports many platforms, including the Motorola 68K, and provides many options for adjusting the compilation.

To instruct the compiler to build for software emulation the -msoft-float option must be passed into the compilation.

However, with this option added I still witnessed 8000000B errors being thrown.

Updating my code to use the Amiga native mathieeedoubbas.library when handling floating point numbers removed some sources of the error. Fixing both sprintf() and snprintf(), which were both failing when handling floating point numbers, was trickier.

Daedalus the Nun on the Retro Collective Discord assisted me throughout this challenge.

Yup, the compiler is most likely using FPU code in the background to translate the given value into a printable string, since you've told it to treat it as a float value

It was suggested that certain functions will result in FPU opcodes that dictate the the need for an FPU, regardless of the existence of the -msoft-float compilation option.

I fixed the remaining 8000000B errors by removing the use of sprintf() and snprintf() when formatting floating point numbers and instead creating a custom toString() method for managing the conversion.

๐Ÿ™Œ Thanks

While building this application I have relied on the knowledgable members of Retro Collective's Discord server to assist while learning and debugging the tools and code in use. Daedalus the Nun was particularly insightful and helpful.

The Amiga C/C++ Compile, Debug & Profile (fork with libs support) VS Code extension provides a templated quick-start application which uses the ShowHide example. This formed the basis of my application, elements will remain from this example.

๐Ÿ‘‹ Contributing

This repository was created primarily for my own exploration of the technologies involved.

๐ŸŽ License

I have selected an appropriate license using this tool.

This software is licensed under the MIT license.

๐Ÿ“– Further reading

More detailed information can be found in the documentation:

About

Development of an application to run on Amiga Workbench.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published