/* * Castaway * (C) 1994 - 2002 Martin Doering, Joachim Hoenig * * $File$ - memory read/write * * This file is distributed under the GPL, version 2 or at your * option any later version. See doc/license.txt for details. * * revision history * 23.05.2002 JH FAST1.0.1 code import: KR -> ANSI, restructuring * 30.05.2002 JH Discontinued using mmap and mprotect, now using * Martin's memory access jump table. * 12.06.2002 JH Correct bus error/address error exception stack frame * 14.06.2002 JH LowRamSetX() functions improved. * 09.07.2002 JH Now loads any 192k ROM file * 10.07.2002 MAD Now loads any ROM file * 16.09.2002 JH Bugfix: Word access on unmapped I/O address stacked * two bus error stack frames. Fault address corrected. * 08.10.2002 JH Fixed integer types. * 27.10.2002 AG Trashed everything for more speed! mwuhahaha! */ #include #include #include #ifndef DREAMCAST #else #include #endif #include "dcastaway.h" #include "st.h" #include "mem.h" #include "m68k_intrf.h" static unsigned rombase_pos=0; char rom[80]; // = ROM; #ifdef DREAMCAST void reinit_sdcard(void); char rom_sd[24] = ROM_SD; #endif static int samvol[16]={0,0,0,1,1,1,2,3,5,7,11,17,25,38,57,85}; extern uint32 psg[26]; #define lastpsg psg[25] #define sampos psg[24] char GetMemB(unsigned long address) { address &= MEMADDRMASK; if (address=IOBASE && address=IOBASE && address= vid_mem) && (address < (vid_mem+32768) ) ) { printf("vwlmem\n"); WriteL(&videobuf[address-vid_mem], value); } else #endif WriteL(address/* + mem1base*/, value); return; } if (address>=IOBASE && address