Search
lxdream.org :: lxdream/src/aica/armmem.c :: diff
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:28 2005 +0000 (18 years ago)
permissions -rw-r--r--
last change Add armdasm.h header
file annotate diff log raw
1.1 --- a/src/aica/armmem.c Sun Dec 12 07:44:09 2004 +0000
1.2 +++ b/src/aica/armmem.c Sun Dec 11 12:00:28 2005 +0000
1.3 @@ -1,16 +1,57 @@
1.4 +#include <stdlib.h>
1.5 +#include "dream.h"
1.6 #include "mem.h"
1.7
1.8 +char *arm_mem = NULL;
1.9 +
1.10 void arm_mem_init() {
1.11 -
1.12 + arm_mem = mem_get_region_by_name( MEM_REGION_AUDIO );
1.13 +
1.14 }
1.15
1.16 -uint32_t arm_mem_read_long( uint32_t addr ) {
1.17 +int32_t arm_read_long( uint32_t addr ) {
1.18 + if( addr < 0x00200000 ) {
1.19 + return *(int32_t *)(arm_mem + addr);
1.20 + /* Main sound ram */
1.21 + } else if( addr >= 0x00800000 && addr <= 0x00803000 ) {
1.22 + /* Sound registers / scratch ram */
1.23 + } else {
1.24 + /* Undefined memory */
1.25 + ERROR( "Attempted long read to undefined page: %08X",
1.26 + addr );
1.27 + return 0;
1.28 + }
1.29 }
1.30
1.31 -uint32_t arm_mem_read_byte( uint32_t addr ) {
1.32 +int16_t arm_read_word( uint32_t addr ) {
1.33 + if( addr < 0x00200000 ) {
1.34 + return *(int16_t *)(arm_mem + addr);
1.35 + /* Main sound ram */
1.36 + } else {
1.37 + /* Undefined memory */
1.38 + ERROR( "Attempted word read to undefined page: %08X",
1.39 + addr );
1.40 + return 0;
1.41 + }
1.42 +
1.43 }
1.44
1.45 -uint32_t arm_mem_read_long_user( uint32_t addr ) {
1.46 +int8_t arm_read_byte( uint32_t addr ) {
1.47 + if( addr < 0x00200000 ) {
1.48 + return *(int8_t *)(arm_mem + addr);
1.49 + /* Main sound ram */
1.50 + } else {
1.51 + /* Undefined memory */
1.52 + ERROR( "Attempted byte read to undefined page: %08X",
1.53 + addr );
1.54 + return 0;
1.55 + }
1.56 }
1.57
1.58 -uint32_t arm_mem_read_byte_user( uint32_t addr ) {
1.59 +uint32_t arm_read_long_user( uint32_t addr ) {
1.60 +
1.61 +}
1.62 +
1.63 +uint32_t arm_read_byte_user( uint32_t addr ) {
1.64 +
1.65 +}
.