From 4c319f40ab2bd95d084bc15744c6342e6a04c7d5 Mon Sep 17 00:00:00 2001 From: Duncan Date: Fri, 16 May 2014 05:00:43 -0700 Subject: [PATCH] Updated G1 Elements Layout (markdown) --- G1-Elements-Layout.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/G1-Elements-Layout.md b/G1-Elements-Layout.md index 9ed9a00..a17fcd8 100644 --- a/G1-Elements-Layout.md +++ b/G1-Elements-Layout.md @@ -1 +1,14 @@ -# G1 Elements \ No newline at end of file +A G1 element is typically a sprite. It is basically an image. +It appears as though the G1 elements bits pointer has the following layout. + +The first y dwords are offsets to the corresponding y line. You use this to jump to the correct line if you do not require info from the first line. + +`[line 0 offset][line 1 offset] ...` + +`[dword][dword] ...` + +When you have jumped to the correct line there are 2 words that inform you of the number of bytes in the next data section and the gap length after it. To draw the correct image you have to do each section and remember to jump over each gap on the drawing surface. The next line will start immediately at the end of the previous line. If there are no bytes in the gap then the line has ended. + +`line0:[no. bytes in data 1][gap length 1][data 1 of no. bytes length][no. bytes in gap 2]...line1:...` + +`[word][word][bytes*no.bytes][word]...` \ No newline at end of file