From 9bb1d0ec0b4c84f1bd815359b2eae6b55e569a1f Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Sun, 22 Dec 2019 14:29:12 -0800 Subject: [PATCH] Implement ACXLoader.GetDataInt --- hll/ACXLoader.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/hll/ACXLoader.c b/hll/ACXLoader.c index abdf9fd..88f4a9a 100644 --- a/hll/ACXLoader.c +++ b/hll/ACXLoader.c @@ -98,7 +98,20 @@ hll_defun(GetNumofColumn, args) } //bool GetDataInt(int nLine, int nColumn, ref int pnData) -hll_unimplemented(ACXLoader, GetDataInt); +hll_defun(GetDataInt, args) +{ + int line = args[0].i; + int col = args[1].i; + + if (line < 0 || line >= acx.nr_lines || col < 0 || col >= acx.nr_columns) + hll_return(false); + + uint8_t *data = acx.data + (line * acx.nr_columns * 4) + (col * 4); + *args[2].iref = LittleEndian_getDW(data, 0); + + hll_return(true); +} + //bool GetDataString(int nLine, int nColumn, ref string pIData) hll_unimplemented(ACXLoader, GetDataString);