|
Post by rayman on Jan 28, 2018 12:34:24 GMT -8
i would like to load asset from an 32kbyte external fram (i2c interface) someone's done this before and would share his code ? you couldn't put this directly into gd-lib ? that would be perfect for small bitmaps which are used e. g. for buttons bool readBitmapFromSd2Fram(file, toAdr) { ... } bool loadAssetFromFram(fromAdr) { ... }
|
|
|
Post by jamesbowman on Jan 29, 2018 7:28:15 GMT -8
Asset loading is really just sending the GD2 file into the EVE command stream. In other words .gd2 asset files are just raw EVE commands.
So if you put the N-byte .gd2 file in the FRAM then the code to copy it from FRAM to the EVE can be:
for (int i = 0; i < N; i += 4) { uint32_t w = read_32_bits_from_fram(); GD.cmd32(w); }
|
|
|
Post by rayman on Jan 30, 2018 12:23:27 GMT -8
that unfortunately overtaxes my abilities ;( i have 3 assets in my assets.h and i can load and handle this without problems 1. include in my main.cpp 2. call LOAD_ASSETS() ... LOAD_ASSETS_1() ... 3. works fine i don't have a plan for how i'm supposed to go about it 1. write a simple loader sketch for load assets-files from sd-card to fram/eeprom 2. write functions LOAD_ASSETS_FRAM(i2c_id, ..., ...); advantages: * sd-card free for other things (~GD_STORAGE) * the surface on the display works even if the sd-card is defective * speed ? disadvantages; * must first be loaded in fram/eeprom * need fram/eeprom with adequate size * ... ft81x (gd3) have 1mb for assets and images
|
|