mirror of
https://github.com/LIV2/amiga-par-to-spi-adapter.git
synced 2025-12-06 06:32:46 +00:00
When using autoinit the mounter would mount the devices before the device is added to execs Device list Before DOS is started (like rom boot) this is not a problem because the device will be added to the list before DOS is started After DOS is started though it becomes a problem, dos will try to OpenDevice() the device before it is even on the Device List
28 lines
600 B
C
28 lines
600 B
C
#include <exec/types.h>
|
|
#include <exec/resident.h>
|
|
#include <exec/nodes.h>
|
|
#include <dos/dos.h>
|
|
|
|
#include "version.h"
|
|
|
|
extern struct Library *init(__reg("a1") BPTR seg_list);
|
|
|
|
LONG noexec(void) {
|
|
return -1;
|
|
}
|
|
|
|
// Need to be const to be placed as constant in code segment
|
|
const struct Resident romtag =
|
|
{
|
|
.rt_MatchWord = RTC_MATCHWORD,
|
|
.rt_MatchTag = (void *)&romtag,
|
|
.rt_EndSkip = &romtag + 1,
|
|
.rt_Flags = RTF_COLDSTART,
|
|
.rt_Version = VERSION,
|
|
.rt_Type = NT_DEVICE,
|
|
.rt_Pri = 10,
|
|
.rt_Name = device_name,
|
|
.rt_IdString = id_string,
|
|
.rt_Init = (APTR)init,
|
|
};
|