#include "ram.h" #include r16_int* ram = NULL; void InitRam() { ram = (r16_int*)malloc(sizeof(r16_int) * UINT16_MAX); } r16_int GetValue(r16_int address) { #ifdef RAM_DO_NULL_CHECK if (ram == NULL) { InitRam(); } #endif return ram[address.u]; } void SetValue(r16_int address, r16_int value) { #ifdef RAM_DO_NULL_CHECK if (ram == NULL) { InitRam(); } #endif ram[address.u] = value; }