Search
lxdream.org :: lxdream/src/aica/armmem.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/aica/armmem.c
changeset 11:0a82ef380c45
prev7:976a16e92aab
next14:fc481a638848
author nkeynes
date Sun Dec 11 12:00:09 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Moved arm material under aica/
Hooked arm disasm up
view annotate diff log raw
     1 #include <stdlib.h>
     2 #include "dream.h"
     3 #include "mem.h"
     5 char *arm_mem = NULL;
     7 void arm_mem_init() {
     8     arm_mem = mem_get_region_by_name( MEM_REGION_AUDIO );
    10 }
    12 int32_t arm_read_long( uint32_t addr ) {
    13     if( addr < 0x00200000 ) {
    14 	return *(int32_t *)(arm_mem + addr);
    15 	/* Main sound ram */
    16     } else if( addr >= 0x00800000 && addr <= 0x00803000 ) {
    17 	/* Sound registers / scratch ram */
    18     } else {
    19 	/* Undefined memory */
    20 	ERROR( "Attempted long read to undefined page: %08X",
    21 	       addr );
    22 	return 0;
    23     }
    24 }
    26 int16_t arm_read_word( uint32_t addr ) {
    27     if( addr < 0x00200000 ) {
    28 	return *(int16_t *)(arm_mem + addr);
    29 	/* Main sound ram */
    30     } else {
    31 	/* Undefined memory */
    32 	ERROR( "Attempted word read to undefined page: %08X",
    33 	       addr );
    34 	return 0;
    35     }
    37 }
    39 int8_t arm_read_byte( uint32_t addr ) {
    40     if( addr < 0x00200000 ) {
    41 	return *(int8_t *)(arm_mem + addr);
    42 	/* Main sound ram */
    43     } else {
    44 	/* Undefined memory */
    45 	ERROR( "Attempted byte read to undefined page: %08X",
    46 	       addr );
    47 	return 0;
    48     }
    49 }
    51 uint32_t arm_read_long_user( uint32_t addr ) {
    53 }
    55 uint32_t arm_read_byte_user( uint32_t addr ) {
    57 }
.