Search
lxdream.org :: lxdream/src/mem.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/mem.h
changeset 19:9da7a8e38f9d
prev18:9a1b5d75703f
next31:495e480360d7
author nkeynes
date Thu Dec 22 07:38:12 2005 +0000 (14 years ago)
permissions -rw-r--r--
last change Implement 95% of the SCIF serial interface
Implement basic load_bin_file function to try to load demos directly
Update TMU to run all 3 timers, start on general timing
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 void *mem_create_ram_region( uint32_t base, uint32_t size, char *name );
    30 void *mem_load_rom( char *name, uint32_t base, uint32_t size, uint32_t crc );
    31 void *mem_alloc_pages( int n );
    32 char *mem_get_region( uint32_t addr );
    33 char *mem_get_region_by_name( char *name );
    34 int mem_has_page( uint32_t addr );
    35 char *mem_get_page( uint32_t addr );
    37 void mem_init( void );
    38 void mem_reset( void );
    40 #define ENABLE_WATCH 1
    42 #define WATCH_WRITE 1
    43 #define WATCH_READ  2
    44 #define WATCH_EXEC  3  /* AKA Breakpoint :) */
    46 #define MEM_FLAG_ROM 4 /* Mem region is ROM-based */
    47 #define MEM_FLAG_RAM 6 
    49 typedef struct watch_point *watch_point_t;
    51 watch_point_t mem_new_watch( uint32_t start, uint32_t end, int flags );
    52 void mem_delete_watch( watch_point_t watch );
    53 watch_point_t mem_is_watched( uint32_t addr, int size, int op );
    55 extern char **page_map;
    56 #ifdef __cplusplus
    57 }
    58 #endif
    59 #endif
.