Search
lxdream.org :: lxdream/src/mem.h
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
view annotate diff log raw
     1 #ifndef dream_sh4_mem_H
     2 #define dream_sh4_mem_H
     4 #include <stdint.h>
     6 #ifdef __cplusplus
     7 extern "C" {
     8 #endif
    10 typedef struct mem_region {
    11     uint32_t base;
    12     uint32_t size;
    13     char *name;
    14     char *mem;
    15     int flags;
    16 } *mem_region_t;
    18 #define MAX_IO_REGIONS 24
    19 #define MAX_MEM_REGIONS 8
    21 #define MEM_REGION_MAIN "System RAM"
    22 #define MEM_REGION_VIDEO "Video RAM"
    23 #define MEM_REGION_AUDIO "Audio RAM"
    24 #define MEM_REGION_AUDIO_SCRATCH "Audio Scratch RAM"
    26 #define MB * (1024 * 1024)
    27 #define KB * 1024
    29 int32_t sh4_read_long( uint32_t addr );
    30 int32_t sh4_read_word( uint32_t addr );
    31 int32_t sh4_read_byte( uint32_t addr );
    32 void sh4_write_long( uint32_t addr, uint32_t val );
    33 void sh4_write_word( uint32_t addr, uint32_t val );
    34 void sh4_write_byte( uint32_t addr, uint32_t val );
    35 int32_t sh4_read_phys_word( uint32_t addr );
    37 void *mem_create_ram_region( uint32_t base, uint32_t size, char *name );
    38 void *mem_load_rom( char *name, uint32_t base, uint32_t size, uint32_t crc );
    39 char *mem_get_region( uint32_t addr );
    40 char *mem_get_region_by_name( char *name );
    41 int mem_has_page( uint32_t addr );
    42 char *mem_get_page( uint32_t addr );
    44 void mem_init( void );
    45 void mem_reset( void );
    47 #define ENABLE_WATCH 1
    49 #define WATCH_WRITE 1
    50 #define WATCH_READ  2
    51 #define WATCH_EXEC  3  /* AKA Breakpoint :) */
    53 typedef struct watch_point *watch_point_t;
    55 watch_point_t mem_new_watch( uint32_t start, uint32_t end, int flags );
    56 void mem_delete_watch( watch_point_t watch );
    57 watch_point_t mem_is_watched( uint32_t addr, int size, int op );
    59 extern char **page_map;
    60 #ifdef __cplusplus
    61 }
    62 #endif
    63 #endif
.