Shutting down Aranym from within TOS?

WinSTon, Nostalgia, MSA Converter, FloImg, Makedisk and all the others.

Moderators: Mug UK, Moderator Team

Count
Atari nerd
Atari nerd
Posts: 45
Joined: Sat Sep 16, 2017 9:15 am
Location: Castrop-Rauxel, Germany

Shutting down Aranym from within TOS?

Postby Count » Fri Aug 23, 2019 6:24 pm

Aranym can be shut down from MiNT applications using GEMDOS' Shutdown(). Unfortunately this function is MiNT-specific, but is there a similar way when running plain TOS 4.04?

https://freemint.github.io/tos.hyp/de/g ... l#Shutdown

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 949
Joined: Sun Aug 03, 2014 5:54 pm

Re: Shutting down Aranym from within TOS?

Postby ThorstenOtto » Fri Aug 23, 2019 7:30 pm

You can use the attached tool i wrote a while ago. In your case, call it with

Code: Select all

nfapi.ttp --shutdown


If passing arguments is not suitable, you can always write a small tool that queries the Native Feature NF_SHUTDOWN, and calls it.
You do not have the required permissions to view the files attached to this post.

czietz
Hardware Guru
Hardware Guru
Posts: 1095
Joined: Tue May 24, 2016 6:47 pm

Re: Shutting down Aranym from within TOS?

Postby czietz » Fri Aug 23, 2019 7:49 pm

ThorstenOtto wrote:If passing arguments is not suitable, you can always write a small tool that queries the Native Feature NF_SHUTDOWN, and calls it.


... or use EmuTOS :D. (EmuTOS has a "Shutdown" command in the Desktop's menu.)

ThorstenOtto
Atari Super Hero
Atari Super Hero
Posts: 949
Joined: Sun Aug 03, 2014 5:54 pm

Re: Shutting down Aranym from within TOS?

Postby ThorstenOtto » Fri Aug 23, 2019 10:40 pm

...or just close the Aranym window. Without MiNT, there is usually not much cached for the filesystem, no ext2-fs that has to be unmounted etc.

Count
Atari nerd
Atari nerd
Posts: 45
Joined: Sat Sep 16, 2017 9:15 am
Location: Castrop-Rauxel, Germany

Re: Shutting down Aranym from within TOS?

Postby Count » Sat Aug 24, 2019 8:49 am

ThorstenOtto wrote:... you can always write a small tool that queries the Native Feature NF_SHUTDOWN, and calls it.

It works! Thank you. 8)

Code: Select all

#include <osbind.h>
#include <mint/cookie.h>

#define MAGIC  0x20021021

typedef struct
{
    long magic;
    long (*get_id)(const char *name);
    long (*call)(long id, ...);
} NFDATA;

static int shutdown(void);

int
main(int argc, char* argv[])
{
    return Supexec(shutdown);
}

int
shutdown()
{
    long cval;

    if (!Getcookie(C___NF, &cval)) {
        register const NFDATA* nfdata = (void*)cval;

        if (nfdata->magic == MAGIC) {
            long id = nfdata->get_id("NF_SHUTDOWN");

            if (id != 0) {
                nfdata->call(id);
            }
        }
    }

    return 1;
}


czietz wrote:... or use EmuTOS :D. (EmuTOS has a "Shutdown" command in the Desktop's menu.)

Yes, I know. But I prefer a desktop icon.

ThorstenOtto wrote:...or just close the Aranym window. Without MiNT, there is usually not much cached for the filesystem, no ext2-fs that has to be unmounted etc.

Aranym runs full-screen (BeePi) and I wanted to avoid to open the menu to make it convenient.


Social Media

     

Return to “Other emulators & tools”

Who is online

Users browsing this forum: No registered users and 3 guests

cron