From 6503ff2351ccc4bc62a6d066f303f43ecfd063aa Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 27 Apr 2010 11:33:53 +0000 Subject: [PATCH] Use an extra bit for the pointers in the logbook entries. Due to the larger memory capacity, the Oceanic OC1 needs an additional bit to be able to address memory pages above 64K. --- src/oceanic_common.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/oceanic_common.c b/src/oceanic_common.c index 09dac64..dc4bdf8 100644 --- a/src/oceanic_common.c +++ b/src/oceanic_common.c @@ -63,7 +63,10 @@ get_profile_first (const unsigned char data[], const oceanic_common_layout_t *la value = array_uint16_le (data + 4); } - return (value & 0x0FFF) * PAGESIZE; + if (layout->memsize > 0x10000) + return (value & 0x1FFF) * PAGESIZE; + else + return (value & 0x0FFF) * PAGESIZE; } @@ -78,7 +81,10 @@ get_profile_last (const unsigned char data[], const oceanic_common_layout_t *lay value = array_uint16_le (data + 6); } - return (value & 0x0FFF) * PAGESIZE; + if (layout->memsize > 0x10000) + return (value & 0x1FFF) * PAGESIZE; + else + return (value & 0x0FFF) * PAGESIZE; }