--- uae/src/hardfile.c 2018/04/24 16:39:58 1.1.1.3 +++ uae/src/hardfile.c 2018/04/24 17:16:31 1.1.1.7 @@ -1,19 +1,17 @@ /* * UAE - The Un*x Amiga Emulator * - * AutoConfig devices + * Hardfile emulation * - * (c) 1995 Bernd Schmidt + * Copyright 1995 Bernd Schmidt */ #include "sysconfig.h" #include "sysdeps.h" -#include "config.h" #include "options.h" #include "memory.h" #include "custom.h" -#include "readcpu.h" #include "newcpu.h" #include "disk.h" #include "autoconf.h" @@ -22,7 +20,7 @@ static int opencount = 0; -static uae_u32 hardfile_open(void) +static uae_u32 hardfile_open (void) { uaecptr tmp1 = m68k_areg(regs, 1); /* IOReq */ @@ -30,31 +28,31 @@ static uae_u32 hardfile_open(void) if (get_hardfile_data (m68k_dreg (regs, 0))) { opencount++; put_word (m68k_areg(regs, 6)+32, get_word (m68k_areg(regs, 6)+32) + 1); - put_long (tmp1+24, m68k_dreg (regs, 0)); /* io_Unit */ - put_byte (tmp1+31, 0); /* io_Error */ - put_byte (tmp1+8, 7); /* ln_type = NT_REPLYMSG */ + put_long (tmp1 + 24, m68k_dreg (regs, 0)); /* io_Unit */ + put_byte (tmp1 + 31, 0); /* io_Error */ + put_byte (tmp1 + 8, 7); /* ln_type = NT_REPLYMSG */ return 0; } - put_long (tmp1+20, (uae_u32)-1); - put_byte (tmp1+31, (uae_u8)-1); + put_long (tmp1 + 20, (uae_u32)-1); + put_byte (tmp1 + 31, (uae_u8)-1); return (uae_u32)-1; } -static uae_u32 hardfile_close(void) +static uae_u32 hardfile_close (void) { opencount--; - put_word (m68k_areg(regs, 6)+32, get_word (m68k_areg(regs, 6)+32) - 1); + put_word (m68k_areg(regs, 6) + 32, get_word (m68k_areg(regs, 6) + 32) - 1); return 0; } -static uae_u32 hardfile_expunge(void) +static uae_u32 hardfile_expunge (void) { return 0; /* Simply ignore this one... */ } -static uae_u32 hardfile_beginio(void) +static uae_u32 hardfile_beginio (void) { uae_u32 tmp1, tmp2, dataptr, offset; uae_u32 retval = m68k_dreg(regs, 0); @@ -171,89 +169,89 @@ static uae_u32 hardfile_beginio(void) return retval; } -static uae_u32 hardfile_abortio(void) +static uae_u32 hardfile_abortio (void) { return (uae_u32)-3; } -void hardfile_install(void) +void hardfile_install (void) { - uae_u32 functable, datatable, inittable; + uae_u32 functable, datatable; uae_u32 initcode, openfunc, closefunc, expungefunc; uae_u32 beginiofunc, abortiofunc; - ROM_hardfile_resname = ds("uaehf.device"); - ROM_hardfile_resid = ds("UAE hardfile.device 0.2"); + ROM_hardfile_resname = ds ("uaehf.device"); + ROM_hardfile_resid = ds ("UAE hardfile.device 0.2"); /* initcode */ #if 0 - initcode = here(); - calltrap(deftrap(hardfile_init)); dw(RTS); + initcode = here (); + calltrap (deftrap (hardfile_init)); dw (RTS); #else initcode = filesys_initcode; #endif /* Open */ - openfunc = here(); - calltrap(deftrap(hardfile_open)); dw(RTS); + openfunc = here (); + calltrap (deftrap (hardfile_open)); dw (RTS); /* Close */ - closefunc = here(); - calltrap(deftrap(hardfile_close)); dw(RTS); + closefunc = here (); + calltrap (deftrap (hardfile_close)); dw (RTS); /* Expunge */ - expungefunc = here(); - calltrap(deftrap(hardfile_expunge)); dw(RTS); + expungefunc = here (); + calltrap (deftrap (hardfile_expunge)); dw (RTS); /* BeginIO */ - beginiofunc = here(); - calltrap(deftrap(hardfile_beginio)); + beginiofunc = here (); + calltrap (deftrap (hardfile_beginio)); dw (0x48E7); dw (0x8002); /* movem.l d0/a6,-(a7) */ dw (0x0829); dw (0); dw (30); /* btst #0,30(a1) */ dw (0x6608); /* bne.b +8 */ dw (0x2C78); dw (0x0004); /* move.l 4,a6 */ dw (0x4EAE); dw (-378); /* jsr ReplyMsg(a6) */ dw (0x4CDF); dw (0x4001); /* movem.l (a7)+,d0/a6 */ - dw(RTS); + dw (RTS); /* AbortIO */ - abortiofunc = here(); - calltrap(deftrap(hardfile_abortio)); dw(RTS); + abortiofunc = here (); + calltrap (deftrap (hardfile_abortio)); dw (RTS); /* FuncTable */ - functable = here(); - dl(openfunc); /* Open */ - dl(closefunc); /* Close */ - dl(expungefunc); /* Expunge */ - dl(EXPANSION_nullfunc); /* Null */ - dl(beginiofunc); /* BeginIO */ - dl(abortiofunc); /* AbortIO */ - dl(0xFFFFFFFFul); /* end of table */ + functable = here (); + dl (openfunc); /* Open */ + dl (closefunc); /* Close */ + dl (expungefunc); /* Expunge */ + dl (EXPANSION_nullfunc); /* Null */ + dl (beginiofunc); /* BeginIO */ + dl (abortiofunc); /* AbortIO */ + dl (0xFFFFFFFFul); /* end of table */ /* DataTable */ - datatable = here(); - dw(0xE000); /* INITBYTE */ - dw(0x0008); /* LN_TYPE */ - dw(0x0300); /* NT_DEVICE */ - dw(0xC000); /* INITLONG */ - dw(0x000A); /* LN_NAME */ - dl(ROM_hardfile_resname); - dw(0xE000); /* INITBYTE */ - dw(0x000E); /* LIB_FLAGS */ - dw(0x0600); /* LIBF_SUMUSED | LIBF_CHANGED */ - dw(0xD000); /* INITWORD */ - dw(0x0014); /* LIB_VERSION */ - dw(0x0004); /* 0.4 */ - dw(0xD000); - dw(0x0016); /* LIB_REVISION */ - dw(0x0000); - dw(0xC000); - dw(0x0018); /* LIB_IDSTRING */ - dl(ROM_hardfile_resid); - dw(0x0000); /* end of table */ - - ROM_hardfile_init = here(); - dl(0x00000100); /* ??? */ - dl(functable); - dl(datatable); - dl(initcode); + datatable = here (); + dw (0xE000); /* INITBYTE */ + dw (0x0008); /* LN_TYPE */ + dw (0x0300); /* NT_DEVICE */ + dw (0xC000); /* INITLONG */ + dw (0x000A); /* LN_NAME */ + dl (ROM_hardfile_resname); + dw (0xE000); /* INITBYTE */ + dw (0x000E); /* LIB_FLAGS */ + dw (0x0600); /* LIBF_SUMUSED | LIBF_CHANGED */ + dw (0xD000); /* INITWORD */ + dw (0x0014); /* LIB_VERSION */ + dw (0x0004); /* 0.4 */ + dw (0xD000); + dw (0x0016); /* LIB_REVISION */ + dw (0x0000); + dw (0xC000); + dw (0x0018); /* LIB_IDSTRING */ + dl (ROM_hardfile_resid); + dw (0x0000); /* end of table */ + + ROM_hardfile_init = here (); + dl (0x00000100); /* ??? */ + dl (functable); + dl (datatable); + dl (initcode); }