Jump to content



Photo
- - - - -

Gxlib 1.0


  • Please log in to reply
14 replies to this topic

#1 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 21 October 2004 - 10:24 PM

I've recently worked on another 5 colors mode that uses only 3 buffers and that shows no flicker :D I have now written a whole lib providing useful functions to use it. Those functions are

void gxSetMode(bool enabled);
#define gxClearBuff gxFillW
void gxRefresh();
void gxDrawBmp(void far* bmp);

void gxPixel    (uint x, uint y, uchar coul);
void gxPixB     (uint x, uint y);
void gxPixW     (uint x, uint y);
void gxPixLG    (uint x, uint y);
void gxPixMG    (uint x, uint y);
void gxPixDG    (uint x, uint y);
void gxPixInv   (uint x,uint y);
uchar gxPixTest (uint x,uint y);

void gxVLine    (uint x, uint ymin, uint ymax, uchar coul);
void gxVLineB   (uint x, uint ymin, uint ymax);
void gxVLineW   (uint x, uint ymin, uint ymax);
void gxVLineLG  (uint x, uint ymin, uint ymax);
void gxVLineMG  (uint x, uint ymin, uint ymax);
void gxVLineDG  (uint x, uint ymin, uint ymax);
void gxVLineInv (uint x, uint ymin, uint ymax);

void gxHLine    (uint xmin, uint xmax, uint y, uchar coul);
void gxHLineB   (uint xmin, uint xmax, uint y);
void gxHLineW   (uint xmin, uint xmax, uint y);
void gxHLineLG  (uint xmin, uint xmax, uint y);
void gxHLineMG  (uint xmin, uint xmax, uint y);
void gxHLineDG  (uint xmin, uint xmax, uint y);
void gxHLineInv (uint xmin, uint xmax, uint y);

void gxFill     (uchar coul);
void gxFillW    ();
void gxFillLG   ();
void gxFillMG   ();
void gxFillDG   ();
void gxFillB    ();
void gxInverse  ();

void gxSprite      (int x, int y, void far* spr, uchar mode);
void gxSpr_M_C     (int x, int y, void far* spr);
void gxSpr_noM_C   (int x, int y, void far* spr);
void gxSpr_M_noC   (int x, int y, void far* spr);
void gxSpr_noM_noC (int x, int y, void far* spr);

It is available on the file sharing:
http://www.casiocalc...urces#gxlib-1-0

There is a small example to show how the colors appear on screen, and a detailed readme to explain how to use the lib. :)

The sprites can be coded with a new version of Sprite Maker, but i didn't correct all the little bugs now :unsure: But i think it will be clear in a couple of days ;)

Please give me your comments :lol:

#2 4nic8

4nic8

    Casio Freak

  • Members
  • PipPipPipPip
  • 182 posts
  • Location:Warsaw, Poland

  • Calculators:
    Casio AFX 2.0 ROM 1.01, TI-89 (ASM 2.08 HW 2.00)

Posted 21 October 2004 - 10:30 PM

Example rocks!!! I'll just go to test the lib!!!!!!

#3 4nic8

4nic8

    Casio Freak

  • Members
  • PipPipPipPip
  • 182 posts
  • Location:Warsaw, Poland

  • Calculators:
    Casio AFX 2.0 ROM 1.01, TI-89 (ASM 2.08 HW 2.00)

Posted 22 October 2004 - 01:29 PM

Has Sprite Maker 2.3 already been released?

Please upload it to FS as soon as possible ;)

#4 4nic8

4nic8

    Casio Freak

  • Members
  • PipPipPipPip
  • 182 posts
  • Location:Warsaw, Poland

  • Calculators:
    Casio AFX 2.0 ROM 1.01, TI-89 (ASM 2.08 HW 2.00)

Posted 24 October 2004 - 12:19 AM

Here is a little sample of what that lib can:
Posted Image
http://www.ee.pw.edu...nowj/dp/mis.exe

#5 Deimos

Deimos

    Casio Freak

  • Members
  • PipPipPipPip
  • 107 posts
  • Location:Poland
  • Interests:3d modelling, paper models, BASIC programming-AFX (just beginning)

  • Calculators:
    AFX 2.0+

Posted 24 October 2004 - 01:25 AM

It's great! And no flickering at all. I can't wait for game using this lib. Will You make Sonic use 5 colors, Orwell?

#6 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 24 October 2004 - 01:27 AM

hehe, funny demo :D

#7 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 24 October 2004 - 08:49 AM

Here is a little sample of what that lib can:
Posted Image
http://www.ee.pw.edu...nowj/dp/mis.exe

<{POST_SNAPBACK}>

:blink: It seems like there are only 3 colors on this file... I think you took the screenshots with the emulator, and unfortunately this "gx mode" isnt supported!!! Thus you cannot show that because thats not the same as we can see on screen :o

It's great! And no flickering at all. I can't wait for game using this lib. Will You make Sonic use 5 colors, Orwell?

<{POST_SNAPBACK}>

Actually I wanted to try sonic with more colors and then I started to search different possibilities, because naturally the more colors you use, the more it gets slow ;) So my purpose was to use less buffers than the "original" 5 colors mode (that uses 4 buffers)

I also tried to use D3 mode like Marco, but I didnt find any way to suppress the flicker on my screen... Thus I finally worked in DB mode with 3 buffers, and with a certain ponderation (1-2-1) for the datas I could generate 5 "intensity levels", thus 5 colors. And because I had different combinations for each gray (for example I can use 110 and 011 to display dark gray) on screen, I was able to suppress the flicker by alternating the 2 combination for each pixel ^_^

But now, I think I won't use this mode for Sonic because I don't want the framerate to get too low (under 20 fps)... But I hope this technic will be used for another games :)

#8 Janek37

Janek37

    Newbie

  • Members
  • Pip
  • 15 posts
  • Location:Warsaw, Poland

  • Calculators:
    ALGEBRA FX 2.0 ROM 1.01; HP 49G; TI-89 SE

Posted 26 December 2004 - 03:26 PM

Hi!
I tried to write a simple card game "SET" (more explanations www.setgame.com), but it didn't work... I'll add sources to the sharing (I compiled with TURBO C++ 3.00 and libg100). I replaced all casio routines with PC ones, and it works. Could anybody tell me why it happens? Demos of gxlib work fine.

#9 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 26 December 2004 - 09:39 PM

Well in your code it seems like you don't call gxClearBuff() after each gxRefresh()... So the buffer frame is not cleared before drawing operations :o
What kind of problem do you exactly have?

PS: 4nic8 is Polish too, he says that you may contact him with Gadu-Gadu (nr 5001552); maybe he will be able to help you with gxlib ;)

#10 Janek37

Janek37

    Newbie

  • Members
  • Pip
  • 15 posts
  • Location:Warsaw, Poland

  • Calculators:
    ALGEBRA FX 2.0 ROM 1.01; HP 49G; TI-89 SE

Posted 28 December 2004 - 05:50 PM

I don't use gxClearBuff(), 'cause I use previously drawn board - I think, that gxRefresh() doesn't damage buffers (?)
The problem was that program crashed immediately after start :(

#11 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 28 December 2004 - 09:19 PM

Well i've compiled your prog and it seems to work correctly ;)

I've uploaded it here with some minor modifications (i have only replaced the functions of your "calc.h"): http://orwell01.free.fr/set.rar

#12 Janek37

Janek37

    Newbie

  • Members
  • Pip
  • 15 posts
  • Location:Warsaw, Poland

  • Calculators:
    ALGEBRA FX 2.0 ROM 1.01; HP 49G; TI-89 SE

Posted 29 December 2004 - 06:40 PM

Hi!
How do you compile AFX programs? My TURBO C++ 3.0 returns some stupid errors :profanity: Your exe works OK, but I found some bugs and cannot recompile :angry: Anyway, thank you for help! This is my first asm/c program and I don't have practice...

#13 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 29 December 2004 - 08:09 PM

I use Digital Mars to compile my progs, but i guess the errors come from my "C++ -like" syntax. You can use TCC as a C++ compiler by adding the '-P' option in the command line. Perhaps you will have to change the syntax a little bit... :rolleyes:

#14 4nic8

4nic8

    Casio Freak

  • Members
  • PipPipPipPip
  • 182 posts
  • Location:Warsaw, Poland

  • Calculators:
    Casio AFX 2.0 ROM 1.01, TI-89 (ASM 2.08 HW 2.00)

Posted 29 December 2004 - 10:21 PM

use a Makefile:
CC = tcc
INCLUDE = e:\prog\c\tc3\include
LIBS = e:\prog\c\tc3\lib
FLAGS = -2 -d -mt -r -v- -y- -O -G -I$(INCLUDE) -L$(LIBS)

setcasio: setcasio.obj gxlib10.obj
	$(CC) $(FLAGS) setcasio.obj gxlib10.obj
setcasio.obj: setcasio.c
	$(CC) -c $(FLAGS) setcasio.c
gxlib10.obj: gxlib10.c gxlib10.h
	$(CC) -c $(FLAGS) gxlib10.c

set INCLUDE and LIBS correctly to your directories and type "make" in a DOS console to compile setcasio.

I've packed all the stuff for you here: http://www.casiopowe...ic/set-make.zip

B)

[Polish] Witamy w gronie os?b programujÄ…cych na AFX ;) [/Polish]

#15 Janek37

Janek37

    Newbie

  • Members
  • Pip
  • 15 posts
  • Location:Warsaw, Poland

  • Calculators:
    ALGEBRA FX 2.0 ROM 1.01; HP 49G; TI-89 SE

Posted 30 December 2004 - 06:19 PM

Thank you very much! :P
Now everything works fine :lol:
I'll upload new version to sharing...




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users