Search
lxdream.org :: lxdream/src/mem.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.h
changeset 934:3acd3b3ee6d1
prev931:430048ea8b71
next939:6f2302afeb89
author nkeynes
date Fri Dec 26 14:25:23 2008 +0000 (11 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Change RAM regions to use static arrays rather than mmap regions, for a 2-3% performance gain.
General mem cleanups, including some save state fixes that break states again.
file annotate diff log raw
1.1 --- a/src/mem.h Tue Dec 23 05:48:05 2008 +0000
1.2 +++ b/src/mem.h Fri Dec 26 14:25:23 2008 +0000
1.3 @@ -68,14 +68,17 @@
1.4 #define MEM_REGION_AUDIO "Audio RAM"
1.5 #define MEM_REGION_AUDIO_SCRATCH "Audio Scratch RAM"
1.6 #define MEM_REGION_FLASH "System Flash"
1.7 +#define MEM_REGION_PVR2TA "PVR2 TA Command"
1.8 +#define MEM_REGION_PVR2YUV "PVR2 YUV Decode"
1.9 +#define MEM_REGION_PVR2VDMA1 "PVR2 VRAM DMA 1"
1.10 +#define MEM_REGION_PVR2VDMA2 "PVR2 VRAM DMA 2"
1.11
1.12 typedef gboolean (*mem_page_remapped_hook_t)(sh4addr_t page, mem_region_fn_t newfn, void *user_data);
1.13 DECLARE_HOOK( mem_page_remapped_hook, mem_page_remapped_hook_t );
1.14
1.15 -void *mem_create_ram_region( uint32_t base, uint32_t size, const char *name, mem_region_fn_t fn );
1.16 -void *mem_create_repeating_ram_region( uint32_t base, uint32_t size, const char *name, mem_region_fn_t fn,
1.17 - uint32_t repeat_offset, uint32_t last_repeat );
1.18 -void register_misc_region( uint32_t base, uint32_t size, const char *name, mem_region_fn_t fn );
1.19 +struct mem_region *mem_map_region( void *mem, uint32_t base, uint32_t size,
1.20 + const char *name, mem_region_fn_t fn, int flags, uint32_t repeat_offset,
1.21 + uint32_t repeat_until );
1.22
1.23 /**
1.24 * Load a ROM image from the specified filename. If the memory region has not
1.25 @@ -83,13 +86,11 @@
1.26 * If the CRC check fails, a warning will be printed.
1.27 * @return TRUE if the image was loaded successfully (irrespective of CRC failure).
1.28 */
1.29 -gboolean mem_load_rom( const gchar *filename, uint32_t base, uint32_t size,
1.30 - uint32_t crc, const gchar *region_name, mem_region_fn_t fn );
1.31 +gboolean mem_load_rom( void *output, const gchar *filename, uint32_t size, uint32_t crc );
1.32 void *mem_alloc_pages( int n );
1.33 sh4ptr_t mem_get_region( uint32_t addr );
1.34 sh4ptr_t mem_get_region_by_name( const char *name );
1.35 -int mem_has_page( uint32_t addr );
1.36 -sh4ptr_t mem_get_page( uint32_t addr );
1.37 +gboolean mem_has_page( uint32_t addr );
1.38 int mem_load_block( const gchar *filename, uint32_t base, uint32_t size );
1.39 int mem_save_block( const gchar *filename, uint32_t base, uint32_t size );
1.40 void mem_set_trace( const gchar *tracelist, int flag );
1.41 @@ -130,7 +131,6 @@
1.42 void mem_delete_watch( watch_point_t watch );
1.43 watch_point_t mem_is_watched( uint32_t addr, int size, int op );
1.44
1.45 -extern sh4ptr_t *page_map;
1.46 extern mem_region_fn_t *ext_address_space;
1.47
1.48 #define SIGNEXT4(n) ((((int32_t)(n))<<28)>>28)
.