Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI 68K => Topic started by: blue_bear_94 on June 22, 2012, 12:58:17 pm

Title: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on June 22, 2012, 12:58:17 pm
I didn't quite feel like making 3 topics for each of my simultaneous projects, so here is one for all 3.

First: Kraphyko. This is a grayscale graphic program with a lot of tools. It's still in the alpha stage and has no saving/loading features, but I am planning to add more features. (Note: the latter screenshot of Kraphyko shows 0.1; the current version is 0.2)

Second: Decthyth. A library to add what TI-Basic is missing. The graphical commands are incomplete and I plan on adding to it. Text drawing and key reading are complete. However, you should NOT use the File I/O commands, since fclose has a glitch. I'm looking for a workaround.

Third: The Illusiat 12 port. Original game by DJ_O.

All attachments are below.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: DJ Omnimaga on June 22, 2012, 11:31:44 pm
Will Illusiat 12 use a similar map layout as the original?
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: Stefan Bauwens on June 23, 2012, 05:49:42 am
Good luck with all your projects. :)
Sounds interesting.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: Sorunome on June 23, 2012, 06:13:50 am
Keep going with the projects!
I'm pretty interested in the basic lib xD
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on June 23, 2012, 10:32:39 am
Will Illusiat 12 use a similar map layout as the original?

Yes.

And thank you!
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on June 28, 2012, 10:43:42 am
I updated Kraphyko. It can save or load in a special format now. It can also save to (but not load from) a TI-OS picture. (This is 0.5 Alpha; don't be confused by the filename.)

edit: DJ_O: are you working on the info I need? Thanks!
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on July 09, 2012, 03:02:49 pm
I seem to be having trouble on using a flood fill algorithm for Kraphyko. I am using the right-hand algorithm and here is my code:
Code: [Select]
typedef struct {
int x,y,dir;
} pt;
enum {LEFT,UP,RIGHT,DOWN};
#define DEF_DIR DOWN
#define PT_NULL (pt){-20,-20,0}
#define pteq(pt1,pt2) (pt1.x==pt2.x)&&(pt1.y==pt2.y)&&(pt1.dir==pt2.dir)
#define pteqc(pt1,pt2) (pt1.x==pt2.x)&&(pt1.y==pt2.y)
#define ptcolor(Pt) (Pt.x>=0&&Pt.x<whole_scn->xy.x1&&Pt.y>=0&&Pt.y<whole_scn->xy.y1)?GetGPix(Pt.x,Pt.y):mf
#define nextdir(Dir) (Dir+1)%4
#define prevdir(Dir) (Dir+3)%4
#define oppdir(Dir) (Dir+2)%4
int mf=3;
void FillPt(pt Pt,int col)
{
int w=whole_scn->xy.x1;
int h=whole_scn->xy.y1;
if (Pt.x>=0&&Pt.x<w&&Pt.y>=0&&Pt.y<h)
DrawGPix(Pt.x,Pt.y,col,GA_DRAW);
}
pt ptDir(pt Pt,int Dir)
{
switch (Dir)
{
case LEFT:
Pt.x--;
break;
case RIGHT:
Pt.x++;
break;
case UP:
Pt.y--;
break;
case DOWN:
Pt.y++;
break;
}
return Pt;
}
#define ptdir ptDir
pt inFront(pt Pt)
{
return ptDir(Pt,Pt.dir);
}
void FloodFill(short x,short y,short tcol, short rcol)
{
mf=rcol;
pt cur={x,y,DEF_DIR};
pt mark=PT_NULL;
pt mark2=PT_NULL;
//save marks
pt md=PT_NULL;
pt md2=PT_NULL;
int backtrack=0;
int findloop=0;
int count=0;
int temp;
//while front pixel is empty.........move forward
while (ptcolor(inFront(cur))==tcol) cur=inFront(cur);
goto START;
MAIN://MAIN LOOP!
cur=inFront(cur);//move forward
//if right pixel is empty
if (ptcolor(ptDir(cur,nextdir(cur.dir)))==tcol)
{
//if backtrack is true and findloop is false
//and either front pixel or left pixel is empty
//set findloop to true
if (backtrack && !findloop && ((ptcolor(inFront(cur))==tcol)||(ptcolor(ptDir(cur,prevdir(cur.dir)))==tcol))) findloop=1;
//turn right
cur.dir=nextdir(cur.dir);
PAINT:
//move forward
cur=inFront(cur);
}
START:
//set count to # of nondiagonally adjacent pixels filled
count=(ptcolor(inFront(cur))!=tcol)+(ptcolor(ptDir(cur,prevdir(cur.dir)))!=tcol)+(ptcolor(ptDir(cur,nextdir(cur.dir)))!=tcol)+(ptcolor(ptDir(cur,oppdir(cur.dir)))!=tcol);
if (count!=4)
{
do {
cur.dir=nextdir(cur.dir);//turn right
} while(ptcolor(inFront(cur))==tcol);//front pixel is empty
do {
cur.dir=prevdir(cur.dir);//turn left
} while(ptcolor(inFront(cur))!=tcol);//front pixel is filled
}
switch (count)
{
case 1:
if (backtrack) findloop=1;
else if (findloop)
{
//if mark is null........restore mark
if (pteq(mark,PT_NULL)) mark=md;
}
else if ((ptcolor(ptdir(inFront(cur),prevdir(cur.dir)))==tcol)&&(ptcolor(ptdir(ptdir(cur,oppdir(cur.dir)),prevdir(cur.dir)))==tcol))
{//front left pixel and back left pixel are both empty
md=mark;//save mark
mark=PT_NULL;//clear mark
cur.dir=prevdir(cur.dir);//turn left
FillPt(cur,rcol);//fill cur
goto PAINT;
}
break;
case 2:
//if back pixel is filled
if (ptcolor(ptdir(cur,oppdir(cur.dir)))!=tcol)
{
//if front left pixel is not filled
if (ptcolor(ptdir(inFront(cur),prevdir(cur.dir)))==tcol)
{
//save mark
md=mark;
//clear mark
mark=PT_NULL;
//turn around
cur.dir=oppdir(cur.dir);
//fill cur
FillPt(cur,rcol);
goto PAINT;
}
}
else if (pteq(mark,PT_NULL))//mark is not set
{
mark=cur;//set mark to cur
md2=mark2;
mark2=PT_NULL;//clear mark2
findloop=0;
backtrack=0;
}
else
{
if (pteq(mark2,PT_NULL))//if mark2 is not set
{
if (pteqc(cur,mark))//if cur is at mark
{
if (cur.dir==mark.dir)//if cur-dir==mark-dir
{
md=mark;
mark=PT_NULL;//clear mark
cur.dir=oppdir(mark.dir);//turn around
goto PAINT;
}
else
{
backtrack=1;
findloop=0;
cur.dir=mark.dir;
}
}
else if (findloop)
{
mark2=cur;//set mark2 to cur, set mark2-dir to cur-dir
}
}
else
{
if (pteqc(cur,mark))//if cur is at mark
{
cur=mark2;//set cur to mark2, set cur-dir to mark2-dir
md=mark;
md2=mark2;
mark=PT_NULL;
mark2=PT_NULL;//clear mark and mark2
backtrack=0;
cur.dir=oppdir(cur.dir);//turn around
FillPt(cur,rcol);//fill cur
goto PAINT;
}
else if (pteqc(cur,mark2))//if cur is at mark2
{
temp=mark.dir;//set mark to cur
mark=cur;
mark.dir=temp;
cur.dir=mark2.dir;//set cur-dir and mark-dir to
mark.dir=mark2.dir;//mark2-dir
md2=mark2;
mark2=PT_NULL;//clear mark2
}
}
}
break;
case 3:
md=mark;
mark=PT_NULL;//clear mark
cur.dir=prevdir(cur.dir);//fill cur
FillPt(cur,rcol);
goto PAINT;
break;
case 4:
FillPt(cur,rcol);//fill cur
return;//done
break;
}
goto MAIN;
}
#define Fill(x,y,col) FloodFill(x,y,GetPix(x,y),col);
Thanks for any help!
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on August 04, 2012, 12:43:12 pm
Update: Due to the lack of support, I will probably not finish the Illusiat 12 port. What I have done is attached.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: Yeong on August 04, 2012, 07:50:08 pm
Update: Due to the lack of support, I will probably not finish the Illusiat 12 port. What I have done is attached.
I understand. Porting DJ_O's RPG is actually painful XP
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: DJ Omnimaga on August 05, 2012, 02:36:45 am
I unfortunately no longer do calc-related stuff nor anything involving project help, which is partly due to lack of time and interest.  Also I don't even remember most of the game mechanic, anyway (it dates back in 2002). In fact I got stuck while playing once. O.O
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on August 24, 2012, 04:06:42 pm
Here is a new update to Kraphyko.
Edit: New features are a title screen, changing dimensions, and fill bucket. Try this on TIEmu and report any bugs or memory leaks; thanks for testing!
Edit 2: I am currently on adding a help feature.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on November 30, 2012, 05:05:09 pm
Another update to Kraphyko!

I have been having problems with the cursor drawing routine, and 0.7 was not released, so I now have the bug fixed and have added keyboard shortcuts. Have fun! Note that you need to run khelp first, then kraphyko.
(This took only 15 minutes, so I'll accept suggestions on what else to add.)

EDIT: Herp derp, I forgot the documentation!
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on February 09, 2013, 10:44:22 am
Test Version 0.8_04 is out!
You do not have to update to this version, but this includes undo/redo and clipboard functionality.
I don't think I can implement the polygon-filling code until I optimize the remainder of the program.
Anyway, enjoy!
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on February 22, 2013, 08:31:00 pm
Yay! Another test version.
Unfortunately, due to TI's EULA, this will be the last until that stupid emulator clause is lifted.
I would have provided the C source, but what use is it without being able to use TI's OS on TIEmu?
By the way, I provided one easy installation program for your disposal.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: christop on February 27, 2013, 10:26:40 pm
Yay! Another test version.
Unfortunately, due to TI's EULA, this will be the last until that stupid emulator clause is lifted.
I would have provided the C source, but what use is it without being able to use TI's OS on TIEmu?
By the way, I provided one easy installation program for your disposal.
Even though I think the emulator clause (and, well, the whole EULA) is bunk, you could still run PedroM on TiEmu.

We shouldn't let TI and one silly little clause scare us enough to stop working on our calculator projects. You never agreed to the EULA for TI-OS in the first place, right? So you are not bound to the terms and conditions anyway, and you are free to use the TI-OS software in an emulator.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: DJ Omnimaga on February 28, 2013, 12:18:44 am
Well said. I think you should use emulators anyway since there's nothing TI can do
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on February 28, 2013, 08:34:09 am

Even though I think the emulator clause (and, well, the whole EULA) is bunk, you could still run PedroM on TiEmu.

We shouldn't let TI and one silly little clause scare us enough to stop working on our calculator projects. You never agreed to the EULA for TI-OS in the first place, right? So you are not bound to the terms and conditions anyway, and you are free to use the TI-OS software in an emulator.

I did agree to the EULA, because I downloaded OS 3.10.

Here is what TI said on its download page:
Quote from: TI
By downloading the application you indicate your agreement with the terms and conditions of the License.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: Sorunome on February 28, 2013, 07:35:47 pm
But you only agreed that for the new download, so if you still happen to have the old OS lying around you never agreed it for that one then, right? ;)
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on February 28, 2013, 08:28:29 pm
I downloaded it near April or May. So sure, I never agreed that I wouldn't use 3.10 on the emulator.
Title: Re: Kraphyko, Decthyth, and the Illusiat 12 port
Post by: blue_bear_94 on May 04, 2013, 08:21:15 pm
So, even if I don't need to worry about getting caught, I can optimize the program no farther, nor can I stash data externally. I will not be able to finish polygon support, and 0.8_05 will be the final version released. If anyone wishes to look at the C source, I will credit him or her if he or she helps me.