We're looking at 12 by 12 matrices. memory is a problem. I need at least need 4 of them.
So i compressed the x range into nybbles to halve the eeprom requirement.
The tables are eprom based, and are mapped to GPR individually as required.User editable so no computed gotos in code space.
Gotta do it with FSR/INDF in GPR space with writes back to eeprom after editing.
The way i look at it is i need to figure a way to address the x,y coords and display/update the individual memory locations.
We're looking at 12 by 12 matrices. memory is a problem. I need at least need 4 of them.
So i compressed the x range into nybbles to halve the eeprom requirement.
The tables are eprom based, and are mapped to GPR individually as required.User editable so no computed gotos in code space.
Gotta do it with FSR/INDF in GPR space with writes back to eeprom after editing.
The way i look at it is i need to figure a way to address the x,y coords and display/update the individual memory locations.
where X = 0..11, Y = 0..11, and ArrayIndex = 0..71 (the "byte" index into the array)
the result of X & 1 (bit test X,0) determines which nybble to use.
the formula assumes you're storing arrays in EEPROM in Array[Y][X] format;
Code:
de 0x21,0x22,0x44,0x33,0x21,0x30 ; Y = 0, X = 0..11 (nybbles)
de 0x31,0x33,0x31,0x22,0x24,0x22 ; Y = 1, X = 0..11 (nybbles)
......
de 0x44,0x31,0x33,0x31,0x41,0x12 ; Y = 11, X = 0..11 (nybbles)
Example Index routine;
Code:
;
; get EEPROM array 'byte' index, 0..71
;
clrc ;
rlf y,W ; wreg = Y * 2
movwf index ; index = Y * 2
addwf index,F ; index = Y * 4 (C=0)
addwf index,F ; index = Y * 6 (C=0)
rrf x,W ; wreg = (X / 2)
addwf index,F ; index = (Y * 6) + (X / 2)