As I'm new to the kernel world, I'm looking for some doc about the libraries graphlib, userlib etc....
Is there some relevant doc existing ? Or there are only the header files ?
graphlib::choosescreen equ graphlib@000D ;-------------------------------------------------------------- ; graphlib::choosescreen is a word sized variable. ; ; If it is null, the adress of the screen for every graphlib ; function will be LCD_MEM ; Else, the adress of the bitplane you want graphlib to use on ; will be stored in a1 ; ; This allows you, for example, to use all graphlib functions ; with grayscale ! ;--------------------------------------------------------------
drawSomeThing(prameters..., void * screen) { graphlib_choose = 1; set "a1" = screen; ..... graphlib_line(.....); ..... graphlib_line(.....); ..... graphlib_fill(....); }
drawSomeThing(prameters..., void * screen) { graphlib_choose = 1 ..... set "a1" = screen;graphlib_line(.....); ..... set "a1" = screen;graphlib_line(.....); ..... set "a1" = screen;graphlib_fill(....); }
xdef graphlib_put_sprite_custom graphlib_put_sprite_custom: jmp graphlib__0001
#define USE_CUSTOM_GRAPHLIB \ #undef graphlib__0000 // fill \ #undef graphlib__0017 // line \ void graphlib__0000(unsigned short x asm("d0"), unsigned short y asm("d1"), unsigned short width asm("d2"), unsigned short height asm("d3"), unsigned short color asm("d4"),void *dest asm("%a1")); \ void graphlib__0017(unsigned short x1 asm("d0"), unsigned short y1 asm("d1"), unsigned short x2 asm("d2"), unsigned short y2 asm("d3"), void *screen asm("a0"),void *dest asm("%a1")); #define END_USE_CUSTOM_GRAPHLIB \ #undef graphlib__0000 // fill \ #undef graphlib__0017 // line \ void graphlib__0000(unsigned short x asm("d0"), unsigned short y asm("d1"), unsigned short width asm("d2"), unsigned short height asm("d3"), unsigned short color asm("d4")); \ void graphlib__0017(unsigned short x1 asm("d0"), unsigned short y1 asm("d1"), unsigned short x2 asm("d2"), unsigned short y2 asm("d3"), void *screen asm("a0"));
drawSomeThing(prameters..., void * screen) { graphlib_choose = 1; USE_CUSTOM_GRAPHLIB; ..... graphlib_line(.....); ..... graphlib_line(.....); ..... graphlib_fill(....); END_USE_CUSTOM_GRAPHLIB; }
test.c:33: error: conflicting types for `graphlib__0000' graphlib.h:4: error: previous declaration of `graphlib__0000' test.c:33: warning: extern declaration of `graphlib__0000' doesn't match global one test.c:42: error: conflicting types for `graphlib__0000' test.c:33: error: previous declaration of `graphlib__0000'
#undef graphlib_fill #define graphlib_fill(x1,x2,y1,y2,color,screen) asm("move.l screen,%a1");graphlib__0000(x1,x2,y1,y2,color);
Sasume :
But I thought about another way to use graphlib functions with an additional parameter :
In your .h file :#define USE_CUSTOM_GRAPHLIB \ #undef graphlib__0000 // fill \ #undef graphlib__0017 // line \ blablabla
scrStudy.c: In function `h_scrStudy': scrStudy.c:458: error: syntax error before "__pshort"
Parms2D(Parse2DExpr(top_estack,FALSE), &width, &down, &up); //get the dimensions
#define USE_KERNEL #include "kernel.h" int _library; int _version09;
#define USE_KERNEL #include <tigcclib.h> int _library; int _version09; #include "graphlib.h"
hibOu :
Yes, I would need this parameter, but this will bring incompatibilities with other programs ? no ?