#include "emul_mem.h" #include <stdio.h> static char mem[EMUL_MEMSIZE]; int emul_mem_get(int address) { int word = 0; word |= mem[address+0] << 0; return word; } void emul_mem_set(int address, int byte) { mem[address+0] = (char)((byte >> 0 ) & 0x000F); } int emul_mem_get_word(int address) { int word = 0; word |= (0x00FF&mem[address+0]) << 0; word |= (0x00FF&mem[address+1]) << 8; word |= (0x00FF&mem[address+2]) << 16; word |= (0x00FF&mem[address+3]) << 24; return word; } void emul_mem_set_word(int address, int word) { mem[address+0] = (char)((word >> 0 ) & 0x00FF); mem[address+1] = (char)((word >> 8 ) & 0x00FF); mem[address+2] = (char)((word >> 16) & 0x00FF); mem[address+3] = (char)((word >> 24) & 0x00FF); }