0

I have coded a little Amiga-500 Application in C, and compiled it to a bootable image. When I boot from the image alone (in WinUAE), the Application is starting up after kick.rom start.

But now, I want to use some libraries (like the diskfont.library), so I was thinking to copy the boot image on a bootable disk (install df0: and makedir Libs). I have created a file s/startup-sequence, with contents bin:start.adf (because the start application resides in the directory df0:bin). I make the disk bootable with install. But when I try to start the application - without loading Workbench31 before - I get the message:

Not a DOS Disk in Drive.

So, something is wrong, but what?

That You can see that the application runs under the Workbench:

enter image description here

I don't know how to make a bootable disk. I think that must be done with using assembly stuff (boot header that loads the boot image...). However, I have created a hard disk file section on UAE as directory.

Here are the steps that I did, to start the application:

  1. Install WinUAE (the Windows Ultiminate Amiga Emulator), and

  2. Check out the kick31.rom

  3. Insert PC Windows 10 folder as drive in WinUAE.

  4. Create root directory for the application (hd0:apps/test)

  5. Create the sub-directory structure for my application:

    • bin (for the binary files of my package)
    • Fonts (for the used font(s) by the application)
    • Libs (for the .library files)
    • s (for startup-sequence: the file that boots and starts the application)
  6. Setup, and install, bebbo amigaos gcc c compiler (GitHub repository)

  7. Create start.c (see listing below)

  8. Create the Makefile file for the make command (this will need to be customised for your system)

  9. Run build.bat, which compiles start.c as df0:bin/start.exe.

  10. I already run WinUAE with loaded Workbench 3.1 and its rom.

  11. type start.exe into the shell, and the application should start. Make sure, you have install the ruby.font (Wb31 Fonts Disk in drive df2:)

  12. voila: you have start the application (press enter/return key, to leave the the application (see source file: "scanf();")

Don't forget to set the local, and system PATH into the environment of Windows in the system settings. They are a little bit hidden in Windows 10, but as you, you should be able to tricky that :-) Other versions of Windows, you could find this settings in the Computer configuration. As you can see, the most is done under Windows.

did you need more informations ?

At the moment, I working on the source file, to load TTF fonts that are attached to the source, soon. Then you could see, how I have load the TTF font engine, that I found on aminet archive. The normal fonts on the WB31 Font disk seems to be Bitmap fonts, which means, you have pixel art fonts, that does not do anti alias. anti alias is a algorithm to display font smart, and smother on screen.

Source files

start.c

# include <stdio.h>
# include <stdlib.h>
# include <string.h>

# include <exec/types.h>
# include <exec/io.h>
# include <exec/memory.h>
# include <exec/exec.h>

# include <graphics/text.h>
# include <graphics/gfx.h>
# include <graphics/gfxbase.h>

# include <intuition/intuition.h>

# include <libraries/dos.h>
# include <libraries/diskfont.h>

struct IntuitionBase *IntuitionBase;
struct GfxBase *GfxBase;

struct TextFont *textfont;
struct TextAttr  textattr;
struct Screen   *screen  ;

ULONG  DiskfontBase;

struct NewScreen ns = {
    0,              // left
    0,              // top
    640,            // width
    480,            // height
    4,              // bit-plane depth
    0,1,            // detail pen, block pen
    HIRES|LACE,     // video mode
    CUSTOMSCREEN,   // video type
    NULL,           // Font struct
    NULL,           // default title
    NULL,           // Gadgets struct
    NULL            // Bitmap
};

void close_all(void)
{
    CloseFont   (textfont);
    CloseScreen (screen);
    
    CloseLibrary(IntuitionBase);
    CloseLibrary(GfxBase);
    CloseLibrary(DiskfontBase);
}

int
main(int argc, char **argv)
{
    char taste;
    
    /* intition öffnen */
    IntuitionBase = (struct IntuitionBase *)
    OpenLibrary("intuition.library", 0);
    if (IntuitionBase == NULL) {
        printf("error: could not open intuition lib.\n");
        close_all();
        exit(FALSE);
    }
    
    /* graphics öffnen */
    GfxBase = (struct GfxBase *)
    OpenLibrary("graphics.library", 0);
    if (GfxBase == NULL) {
        printf("error: could not load graphics lib.\n");
        close_all();
        exit(FALSE);
    }

    /* screen öffnen */
    screen = (struct Screen*)
    OpenScreen(&ns);
    if (screen == NULL) {
        printf("error: could not open screen.\n");
        close_all();
        exit(FALSE);
    }

    DiskfontBase = (ULONG)
    OpenLibrary("diskfont.library", 0);
    if (DiskfontBase == 0) {
        printf("error: could not load disk font lib.\n");
        close_all();
        exit(FALSE);
    }
    
    // Fonr style:
    textattr.ta_Name  = "topaz.font";
    textattr.ta_YSize = 12;
    textattr.ta_Style =  8;
    textattr.ta_Flags =  0;

    textfont = (struct TextFont*)
    OpenDiskFont(&textattr);
    if (textfont == NULL) {
        printf("error: could not open font.\n");
        close_all();
        exit(FALSE);
    }
    
    /* Farben setzen */
    SetRGB4(&screen->ViewPort,0, 0, 0, 0);
    SetRGB4(&screen->ViewPort,1,15,15,15);
    SetRGB4(&screen->ViewPort,2,15, 0, 0);
    SetRGB4(&screen->ViewPort,3,15,15, 0);
    SetRGB4(&screen->ViewPort,4, 0, 0,15);
    
    SetAPen (&screen->RastPort,1);
    SetDrMd (&screen->RastPort,JAM1);
    RectFill(&screen->RastPort,0,0,639,481);

    SetAPen (&screen->RastPort,2);
    RectFill(&screen->RastPort,0,0,211,250);
    
    SetAPen (&screen->RastPort,3);
    RectFill(&screen->RastPort,14,60,100,120);
    
    SetAPen (&screen->RastPort,4);
    RectFill(&screen->RastPort,44,60,100,100);

    // Textausgabe:
    SetFont(&screen->RastPort, textfont);
    SetAPen(&screen->RastPort, 3);
    Move   (&screen->RastPort, 5,20);
    Text   (&screen->RastPort,"Hallo Welt Über über @euro", 26);
    
    fgetc(stdin);
    close_all();
    exit(TRUE);
}

Makefile

all: Makefile start.exe

GCC = E:\amiga-gcc\bin\m68k-amigaos-gcc
DIR = E:\Amiga-500\paule32\test1

INC =\
    -IE:/amiga-gcc/m68k-amigaos/include \
    -IE:/amiga-gcc/m68k-amigaos/clib2 \
    -IE:/amiga-gcc/m68k-amigaos/clib2/include
    
LIB =\
    -LE:/amiga-gcc/m68k-amigaos/lib \
    -LE:/amiga-gcc/m68k-amigaos/clib2/lib

DEF =\
    -Wno-implicit-function-declaration
    
start.exe: start.c
    $(GCC) -o start.o   -c start.c $(DEF)
    $(GCC) -o start.exe    start.o -Os -noixemul

build.bat (build and deploy script)

@echo off
E:
cd \Amiga-500\paule32\test1
make
if %errorlevel% equ 0 (goto ok) else (goto error)
:ok
echo no error found.
copy start.exe "E:\AMIGA-500\WinUAE\Hard Disk\apps\test\bin\start.exe"
goto done
:error
echo error occur
:done
pause
9
  • 4
    why are you calling your executable ".adf" ? adf is the disk image extension. It just adds to the confusion of your question Sep 11 at 19:58
  • 3
    Can you elaborate on the steps? Bullets on numbering preferably, ie 1) insert an empty disk (or adf file), 2) format it, OFS or FFS, 3) install df0: etc.
    – Krackout
    Sep 12 at 9:07
  • @Jean: I coming from the MS-DOS field, so I am not so firm in with the Amiga extensions. Please note this. I would help everyone. In the counter part, I let it be, that others can comment they stuff. So: don't worry, be happy. Please don't make comments with questions, too. Tell me the story, and post the right answer. I thank you all there for helping hands, Jens
    – Jens
    Sep 13 at 10:36
  • 1
    Please see How to Ask. Questions should be specific, and answerable, and you should How to Ask a new question instead of editing your question into a different one. (It's probably okay this time, because you didn't know what the problem was to start with, but in future, try not to do that.)
    – wizzwizz4
    Sep 14 at 22:25
  • 1
    I'm going to have a go at editing your question for clarity, but you'll probably need to clarify it further after I do; I don't actually understand what you're asking, so it's impossible for me to make it clear enough! :-)
    – wizzwizz4
    Sep 14 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.