From 53f0136cab5b79f4be307fde46e2940578bba54c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Tue, 21 Feb 2017 11:11:21 +0100 Subject: [PATCH] Add cleanup function for RAM device. Also cosmetics. --- src/device_ram.c | 9 ++++++++- src/device_ram.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/device_ram.c b/src/device_ram.c index 1a15338..c94add2 100644 --- a/src/device_ram.c +++ b/src/device_ram.c @@ -8,6 +8,9 @@ #define RAM_SIZE 0xDFFF /* should be configurable */ +uint8_t device_ram_read_1(void *, uint16_t); +void device_ram_write_1(void *, uint16_t, uint8_t); + uint8_t device_ram_read_1(void *vd, uint16_t offset) { @@ -53,5 +56,9 @@ device_ram_init() return d; } -/* TODO: device_ram_finish */ +void +device_ram_finish(device_t *d) +{ + free(d->aux); +} diff --git a/src/device_ram.h b/src/device_ram.h index 5ebb54d..b2fdea6 100644 --- a/src/device_ram.h +++ b/src/device_ram.h @@ -4,5 +4,6 @@ #include "device.h" device_t * device_ram_init(); +void device_ram_finish(device_t *); #endif /* _DEVICE_RAM_H_ */