Search
lxdream.org :: lxdream/src/mem.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.h
changeset 10:c898b37506e0
next11:0a82ef380c45
author nkeynes
date Sun Dec 11 05:15:36 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Add CPU disasembly options to mode dropdown
Split sh4/mem.c into core mem.c and sh4/mem.c
Start adding copyright comments to file headers
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/mem.h Sun Dec 11 05:15:36 2005 +0000
1.3 @@ -0,0 +1,63 @@
1.4 +#ifndef dream_sh4_mem_H
1.5 +#define dream_sh4_mem_H
1.6 +
1.7 +#include <stdint.h>
1.8 +
1.9 +#ifdef __cplusplus
1.10 +extern "C" {
1.11 +#endif
1.12 +
1.13 +typedef struct mem_region {
1.14 + uint32_t base;
1.15 + uint32_t size;
1.16 + char *name;
1.17 + char *mem;
1.18 + int flags;
1.19 +} *mem_region_t;
1.20 +
1.21 +#define MAX_IO_REGIONS 24
1.22 +#define MAX_MEM_REGIONS 8
1.23 +
1.24 +#define MEM_REGION_MAIN "System RAM"
1.25 +#define MEM_REGION_VIDEO "Video RAM"
1.26 +#define MEM_REGION_AUDIO "Audio RAM"
1.27 +#define MEM_REGION_AUDIO_SCRATCH "Audio Scratch RAM"
1.28 +
1.29 +#define MB * (1024 * 1024)
1.30 +#define KB * 1024
1.31 +
1.32 +int32_t sh4_read_long( uint32_t addr );
1.33 +int32_t sh4_read_word( uint32_t addr );
1.34 +int32_t sh4_read_byte( uint32_t addr );
1.35 +void sh4_write_long( uint32_t addr, uint32_t val );
1.36 +void sh4_write_word( uint32_t addr, uint32_t val );
1.37 +void sh4_write_byte( uint32_t addr, uint32_t val );
1.38 +int32_t sh4_read_phys_word( uint32_t addr );
1.39 +
1.40 +void *mem_create_ram_region( uint32_t base, uint32_t size, char *name );
1.41 +void *mem_load_rom( char *name, uint32_t base, uint32_t size, uint32_t crc );
1.42 +char *mem_get_region( uint32_t addr );
1.43 +char *mem_get_region_by_name( char *name );
1.44 +int mem_has_page( uint32_t addr );
1.45 +char *mem_get_page( uint32_t addr );
1.46 +
1.47 +void mem_init( void );
1.48 +void mem_reset( void );
1.49 +
1.50 +#define ENABLE_WATCH 1
1.51 +
1.52 +#define WATCH_WRITE 1
1.53 +#define WATCH_READ 2
1.54 +#define WATCH_EXEC 3 /* AKA Breakpoint :) */
1.55 +
1.56 +typedef struct watch_point *watch_point_t;
1.57 +
1.58 +watch_point_t mem_new_watch( uint32_t start, uint32_t end, int flags );
1.59 +void mem_delete_watch( watch_point_t watch );
1.60 +watch_point_t mem_is_watched( uint32_t addr, int size, int op );
1.61 +
1.62 +extern char **page_map;
1.63 +#ifdef __cplusplus
1.64 +}
1.65 +#endif
1.66 +#endif
.