X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fmemory.c;h=bd33cacfd93d5867eb386347820bbf0b0a377343;hb=a6ccc722bd181ba4a762a29a7c95742ae5e5ccfb;hp=c5b2acf51c7384776af89fe6b60ad346e27bebcd;hpb=1eb382f72510d50b3636fb88c4bfaf17183672b6;p=emu8051.git diff --git a/src/common/memory.c b/src/common/memory.c index c5b2acf..bd33cac 100644 --- a/src/common/memory.c +++ b/src/common/memory.c @@ -75,6 +75,12 @@ memory_init(void) } } +u_int8_t * +memory_getbuf(enum mem_id_t id, unsigned long address) +{ + return &mem_infos[id].buf[address]; +} + void memory_clear(enum mem_id_t id) { @@ -84,7 +90,7 @@ memory_clear(enum mem_id_t id) void memory_write8(enum mem_id_t id, unsigned long address, u_int8_t value) { - if (address >= mem_infos[id].max_size) { + if (address >= (unsigned long) mem_infos[id].max_size) { printf("Error writing to memory ID: %d\n", id); printf(" Address (%lu) greater than maximum memory size\n", address); @@ -110,7 +116,7 @@ memory_sfr_write_dptr(u_int16_t value) u_int8_t memory_read8(enum mem_id_t id, unsigned long address) { - if (address >= mem_infos[id].max_size) { + if (address >= (unsigned long) mem_infos[id].max_size) { printf("Error reading from memory ID: %d\n", id); printf(" Address (%lu) greater than maximum memory size\n", address);