--- uae/src/expansion.c 2018/04/24 16:38:39 1.1.1.1 +++ uae/src/expansion.c 2018/04/24 16:39:02 1.1.1.2 @@ -3,7 +3,7 @@ * * Expansion Slots * - * (c) 1996 Stefan Reinauer + * Copyright 1996 Stefan Reinauer */ #include "sysconfig.h" @@ -13,6 +13,7 @@ #include "options.h" #include "memory.h" #include "custom.h" +#include "readcpu.h" #include "newcpu.h" #include "autoconf.h" @@ -40,7 +41,7 @@ /* ********************************************************** */ -/* Card Data - Where can I get a complete List of these ???? */ +/* Card Data */ /* 04 - 06 & 10-16 */ #define commodore_g 513 /* Commodore Braunschweig (Germany) */ @@ -102,27 +103,27 @@ void (*card_map[MAX_EXPANSION_BOARDS])(v int ecard = 0; -/* ********************************************************** +/* * Fast Memory - * ********************************************************** */ + */ static ULONG fastmem_mask; static ULONG fastmem_alget(CPTR) REGPARAM; -static UWORD fastmem_awget(CPTR) REGPARAM; +static ULONG fastmem_awget(CPTR) REGPARAM; static ULONG fastmem_lget(CPTR) REGPARAM; -static UWORD fastmem_wget(CPTR) REGPARAM; -static UBYTE fastmem_bget(CPTR) REGPARAM; +static ULONG fastmem_wget(CPTR) REGPARAM; +static ULONG fastmem_bget(CPTR) REGPARAM; static void fastmem_lput(CPTR, ULONG) REGPARAM; -static void fastmem_wput(CPTR, UWORD) REGPARAM; -static void fastmem_bput(CPTR, UBYTE) REGPARAM; +static void fastmem_wput(CPTR, ULONG) REGPARAM; +static void fastmem_bput(CPTR, ULONG) REGPARAM; static int fastmem_check(CPTR addr, ULONG size) REGPARAM; static UBYTE *fastmem_xlate(CPTR addr) REGPARAM; static ULONG fastmem_start; /* Determined by the OS */ static UBYTE *fastmemory = NULL; -ULONG fastmem_alget(CPTR addr) +ULONG REGPARAM2 fastmem_alget(CPTR addr) { UBYTE *m; addr -= fastmem_start & fastmem_mask; @@ -132,7 +133,7 @@ ULONG fastmem_alget(CPTR addr) + ((ULONG)m[2] << 8) + ((ULONG)m[3])); } -UWORD fastmem_awget(CPTR addr) +ULONG REGPARAM2 fastmem_awget(CPTR addr) { UBYTE *m; addr -= fastmem_start & fastmem_mask; @@ -141,7 +142,7 @@ UWORD fastmem_awget(CPTR addr) return ((UWORD)m[0] << 8) + m[1]; } -ULONG fastmem_lget(CPTR addr) +ULONG REGPARAM2 fastmem_lget(CPTR addr) { UBYTE *m; addr -= fastmem_start & fastmem_mask; @@ -151,7 +152,7 @@ ULONG fastmem_lget(CPTR addr) + ((ULONG)m[2] << 8) + ((ULONG)m[3])); } -UWORD fastmem_wget(CPTR addr) +ULONG REGPARAM2 fastmem_wget(CPTR addr) { UBYTE *m; addr -= fastmem_start & fastmem_mask; @@ -160,14 +161,14 @@ UWORD fastmem_wget(CPTR addr) return ((UWORD)m[0] << 8) + m[1]; } -UBYTE fastmem_bget(CPTR addr) +ULONG REGPARAM2 fastmem_bget(CPTR addr) { addr -= fastmem_start & fastmem_mask; addr &= fastmem_mask; return fastmemory[addr]; } -void fastmem_lput(CPTR addr, ULONG l) +void REGPARAM2 fastmem_lput(CPTR addr, ULONG l) { UBYTE *m; addr -= fastmem_start & fastmem_mask; @@ -179,7 +180,7 @@ void fastmem_lput(CPTR addr, ULONG l) m[3] = l; } -void fastmem_wput(CPTR addr, UWORD w) +void REGPARAM2 fastmem_wput(CPTR addr, ULONG w) { UBYTE *m; addr -= fastmem_start & fastmem_mask; @@ -189,21 +190,21 @@ void fastmem_wput(CPTR addr, UWORD w) m[1] = w; } -void fastmem_bput(CPTR addr, UBYTE b) +void REGPARAM2 fastmem_bput(CPTR addr, ULONG b) { addr -= fastmem_start & fastmem_mask; addr &= fastmem_mask; fastmemory[addr] = b; } -static int fastmem_check(CPTR addr, ULONG size) +static int REGPARAM2 fastmem_check(CPTR addr, ULONG size) { addr -= fastmem_start & fastmem_mask; addr &= fastmem_mask; return (addr + size) < fastmem_size; } -static UBYTE *fastmem_xlate(CPTR addr) +static UBYTE REGPARAM2 *fastmem_xlate(CPTR addr) { addr -= fastmem_start & fastmem_mask; addr &= fastmem_mask; @@ -220,21 +221,20 @@ addrbank fastmem_bank = { /* * Filesystem device ROM - * This is very simple, the Amiga shouldn't be doing things with it. No support - * for 68020 unaligned addressing etc. + * This is very simple, the Amiga shouldn't be doing things with it. */ static ULONG filesys_lget(CPTR) REGPARAM; -static UWORD filesys_wget(CPTR) REGPARAM; -static UBYTE filesys_bget(CPTR) REGPARAM; +static ULONG filesys_wget(CPTR) REGPARAM; +static ULONG filesys_bget(CPTR) REGPARAM; static void filesys_lput(CPTR, ULONG) REGPARAM; -static void filesys_wput(CPTR, UWORD) REGPARAM; -static void filesys_bput(CPTR, UBYTE) REGPARAM; +static void filesys_wput(CPTR, ULONG) REGPARAM; +static void filesys_bput(CPTR, ULONG) REGPARAM; static ULONG filesys_start; /* Determined by the OS */ static UBYTE filesysory[65536]; -ULONG filesys_lget(CPTR addr) +ULONG REGPARAM2 filesys_lget(CPTR addr) { UBYTE *m; addr -= filesys_start & 65535; @@ -244,7 +244,7 @@ ULONG filesys_lget(CPTR addr) + ((ULONG)m[2] << 8) + ((ULONG)m[3])); } -UWORD filesys_wget(CPTR addr) +ULONG REGPARAM2 filesys_wget(CPTR addr) { UBYTE *m; addr -= filesys_start & 65535; @@ -253,24 +253,24 @@ UWORD filesys_wget(CPTR addr) return ((UWORD)m[0] << 8) + m[1]; } -UBYTE filesys_bget(CPTR addr) +ULONG REGPARAM2 filesys_bget(CPTR addr) { addr -= filesys_start & 65535; addr &= 65535; return filesysory[addr]; } -static void filesys_lput(CPTR addr, ULONG l) +static void REGPARAM2 filesys_lput(CPTR addr, ULONG l) { fprintf(stderr, "filesys_lput called\n"); } -static void filesys_wput(CPTR addr, UWORD w) +static void REGPARAM2 filesys_wput(CPTR addr, ULONG w) { fprintf(stderr, "filesys_wput called\n"); } -static void filesys_bput(CPTR addr, UBYTE b) +static void REGPARAM2 filesys_bput(CPTR addr, ULONG b) { fprintf(stderr, "filesys_bput called\n"); } @@ -282,9 +282,6 @@ addrbank filesys_bank = { default_xlate, default_check }; - -/* ******************************************************* */ - /* Autoconfig address space at 0xE80000 */ static UBYTE expamem[65536]; @@ -292,11 +289,11 @@ static UBYTE expamem_lo; static UBYTE expamem_hi; static ULONG expamem_lget(CPTR) REGPARAM; -static UWORD expamem_wget(CPTR) REGPARAM; -static UBYTE expamem_bget(CPTR) REGPARAM; +static ULONG expamem_wget(CPTR) REGPARAM; +static ULONG expamem_bget(CPTR) REGPARAM; static void expamem_lput(CPTR, ULONG) REGPARAM; -static void expamem_wput(CPTR, UWORD) REGPARAM; -static void expamem_bput(CPTR, UBYTE) REGPARAM; +static void expamem_wput(CPTR, ULONG) REGPARAM; +static void expamem_bput(CPTR, ULONG) REGPARAM; addrbank expamem_bank = { expamem_lget, expamem_wget, @@ -305,26 +302,26 @@ addrbank expamem_bank = { default_xlate, default_check }; -static ULONG expamem_lget(CPTR addr) +static ULONG REGPARAM2 expamem_lget(CPTR addr) { fprintf(stderr,"warning: READ.L from address $%lx \n",addr); - return 0xffffffff; + return 0xfffffffful; } -static UWORD expamem_wget(CPTR addr) +static ULONG REGPARAM2 expamem_wget(CPTR addr) { fprintf(stderr,"warning: READ.W from address $%lx \n",addr); return 0xffff; } -static UBYTE expamem_bget(CPTR addr) +static ULONG REGPARAM2 expamem_bget(CPTR addr) { UBYTE value; addr &= 0xFFFF; return expamem[addr]; } -static void expamem_write(CPTR addr, UBYTE value) +static void REGPARAM2 expamem_write(CPTR addr, ULONG value) { addr &= 0xffff; if (addr==00 || addr==02 || addr==0x40 || addr==0x42) { @@ -336,17 +333,17 @@ static void expamem_write(CPTR addr, UB } } -static void expamem_lput(CPTR addr, ULONG value) +static void REGPARAM2 expamem_lput(CPTR addr, ULONG value) { fprintf(stderr,"warning: WRITE.L to address $%lx : value $%lx\n",addr,value); } -static void expamem_wput(CPTR addr, UWORD value) +static void REGPARAM2 expamem_wput(CPTR addr, ULONG value) { fprintf(stderr,"warning: WRITE.W to address $%lx : value $%x\n",addr,value); } -static void expamem_bput(CPTR addr, UBYTE value) +static void REGPARAM2 expamem_bput(CPTR addr, ULONG value) { switch (addr&0xff) { case 0x30: @@ -417,9 +414,9 @@ void expansion_init(void) } } -/* *************************************************************** +/* * Expansion Card (ZORRO II) for 1/2/4/8 MB of Fast Memory - * *************************************************************** */ + */ void expamem_map_fastcard() { @@ -511,9 +508,9 @@ void expamem_init_filesys() memcpy(filesysory, expamem, 0x2000); } -/* ********************************************************* +/* * Dummy Entries to show that there's no card in a slot - * ********************************************************* */ + */ void expamem_map_clear() {