Grayscale
#1
Posted 10 June 2003 - 01:34 PM
Does anyone can tell me how to do it (special calc abilities or simple screen page-flipping)?
#2
Posted 10 June 2003 - 04:31 PM
To see how to do this I recommed you the "La Graph100 second edition" (in french) simply
search for it with google.
If i remember right killer wanted to translate it. Didn't he :-).
#3
Posted 10 June 2003 - 04:44 PM
Yes it is done by page flipping, but flipping is done by the hardware - you simply write a special value to port 02h to set LCD to this mode (there are several modes - they differ with pixel layout order in the memory) - there are problems because AFX with ROM ver 1.01 has smoother greyscale mode that doesn't work as nice on other ROMs.
And yes - KILLER83Z promised that with his beautiful and fluent knowledge of french he WILL certenly translate it.
Roeoender.
#4
Posted 10 June 2003 - 05:33 PM
I agree, that french language is beautiful and very attractive to everybody. (It's amazing, that they seem not to take care about common users)
What is the special value a have to set? I don't want to wait for KILLER83Z
#5
Posted 10 June 2003 - 06:57 PM
Greetings to ROEOENDER!!! (Yay, an opportunity to spell the name I learned)
#6
Posted 11 June 2003 - 06:36 AM
there are many fonctions and exemples to do grayscale
( but comment are in french... )
#7
Posted 14 June 2003 - 09:53 AM
Now I can make my big project
Is it normal, that when I want to shut the calc (shutcalc()) in 0xdb mode and then turn it on, evrything goes crazy and I have to reset it?
#8
Posted 14 June 2003 - 10:26 AM
when you turn on your calc, the mode is always in c3 mode.
so, after shutcalc() you must use "mode(0xdb);"...
for exemple, if you want shut the calc with F6, it's ->
if (testkey(6,10)) { shutcalc(); mode(0xdb); }
#9
Posted 14 June 2003 - 02:08 PM
#include <DB-lib.h> main(){ int x=0; mode(0xdb); clear3(SEG1); contrast(15);pxl(1,x,1,SEG1); pxl(1,x+1,1,SEG1); pxl(1,x+2,2,SEG1); pxl(1,x+3,3,SEG1); return 0; }The 4 pixels are displayed correctly but it has some odd graphic errors, it looks like the seg1 wouldn't be empty and if I press exe the graphical errors change a bit until I press the exe third time and after that there's a image of penguin (propably on seg5 or 6)
How to make it display only the 4 pixels I want to see?
#10
Posted 14 June 2003 - 04:03 PM
white : 0
black : 1
grey : 2
invert pixel : 3
I think you use wrong value... and the x coord is in first
#include <DB-lib.h> main(){ int x=0; clear3(SEG1); db_on(); pxl(x,1,0,SEG1); pxl(x+1,1,0,SEG1); pxl(x+2,1,1,SEG1); pxl(x+3,1,2,SEG1); waitkey(0x7F,0x7FF); db_off(); return 0; }
try that
#11
Posted 15 June 2003 - 07:06 AM
But this technique don't work on all rom and that have a stroboscop effect
#12
Posted 15 June 2003 - 03:30 PM
I draw all the graphics to SEG2 and then move that to SEG1 (to display a frame immediatly) and then I clear SEG2 and start drawing second frame, for some reason this makes the black pixels look just like the grey pixels. Should I draw to 2 segs and then change the current segment instead of copying em?
#13
Posted 16 June 2003 - 12:10 AM
#14
Posted 16 June 2003 - 06:29 AM
SEG2 is "useless" but it must stay cleared...
if you want draw a picture with grey ->
unsigned char pic1[1024]={ ..,..,..,.., }; unsigned char pic2[1024]={ ..,..,..,.., }; main() { clear3(SEG1); db_on(); desactint9(); drawpict(pic1, SEG1); drawpict(pic2,SEG3); emptykey(); waitkey(0x7F,0x7FF); emptykey(); clear3(SEG1); db_off(); actint9(); }
On pic1, grey is black and on pic2 grey is white...
#15
Posted 16 June 2003 - 11:23 AM
I tried to use SEG6 instead of SEG4. It works and doesn't make direct complications, but it still throws whole sprite out of the screen instead of e.g. one line. It shouldn't be like that.
It's strange, because the example of d16clip I have works perfectly.
(I have AFX PLUS, ROM 1.03)
#16
Posted 17 June 2003 - 11:44 AM
send me your code and your program...
-> swifter68 AT hotmail.com
#17
Posted 17 June 2003 - 01:11 PM
BTW: I made two similar programs for making 8x8 and 16x16 sprites for your db-lib.
Download here
Maybe you find them useful.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users