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