Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - blue_bear_94

Pages: 1 [2] 3
16
When I try to use stdlib.h functions (regardless of whether I #include <stdlib.h> or not), I get linker errors like these:
Code: [Select]
bullets.o: In function '_freeList':
bullets.c:(.text+0x384): undefined reference to '_free'
bullets.o: In function '_createNode':
bullets.c:(.text+0x39c): undefined reference to '_malloc'

Same for math.h functions. I also have the fxcglib installed. Are these functions not implemented yet?

Thanks in advance!

17
Web Programming and Design / Free Web Hosting Service?
« on: February 24, 2013, 09:17:34 am »
Hello, I just found out from Netham that the hosting service I was using contained malicious ads. I'm searching for another service; do you have any suggestions?

1) The service should provide a decent amount of account and forum functionality.
2) The service should not be malicious.
3) The service should be free.

I was thinking about using Zymic, though.

18
Other Calculators / Join the protest!
« on: February 22, 2013, 05:31:07 pm »
As you know, TI is keeping us from using any of their stuff (including the OSes!) on emulators not from TI. (http://ourl.ca/18393)
I'm planning to protest against this injustice at my school. You can do the same.
What do you think?

19
Other Calculators / Forty-eight hours of programming!
« on: February 21, 2013, 08:22:07 pm »
Next week, I have school off (except for Monday). So while my little brother isn't home, I'll be programming from Feb. 27, 12:00 EST to Mar. 1, 1:00 EST with a one-hour break. If anyone has that period off and would like to program as well, then I'd like to hear about it.
So, I would appreciate a few fresh ideas for programming. Please note that I will (probably) be writing everything in C for the 68k series.

20
Miscellaneous / Club Design 1
« on: December 28, 2012, 10:12:42 pm »
I am holding a "Club Design 1" course on the UCCP website (http://uccp.ucoz.com/), but you do not need to be a member of the UCCP in order to apply.
Basically, this course covers aspects of creating clubs, not just pertaining to the student in school, but in general.
Anyone who would like to apply should post here.

21
Calculator C / [68k] Function not working as expected
« on: December 25, 2012, 06:08:25 pm »
Whenever I call enableUndo for this program (from a menu), I get light gray vertical lines as on the image attached. I think I did everything right, so here is the excerpt I am having trouble with:
Code: [Select]
typedef struct {
void* prevl,*prevd;
char canUndo:1,isUndone:1;
} UndoInfo;
void* allocBUB(void)
{
void* buffer=NULL;
if (!(buffer=calloc(LCD_SIZE,1)))
{
dlgError(DMA_ERROR,MEMALLOC_FAIL);
return NULL;
}
return buffer;
}
int allocGBUB(void** lbuff,void** dbuff)
{
if (!(*lbuff=allocBUB()))
{
return 0;
}
if (!(*dbuff=allocBUB()))
{
free(*lbuff);
return 0;
}
return 1;
}
void enableUndo(UndoInfo* p) {
GrayOff();
SetIntVec(AUTO_INT_1,I1);
SetIntVec(AUTO_INT_5,I5);
//*v: this may be the cause of the gray bars
p->canUndo=allocGBUB((void**)p,(void**)((char*)p+4));
SetIntVec(AUTO_INT_1,DUMMY_HANDLER);
SetIntVec(AUTO_INT_5,DUMMY_HANDLER);
GrayOn();
}
I would appreciate any assistance given!

22
Minecraft Discussion / 12w49a bug... possible exploits?
« on: December 07, 2012, 05:08:21 pm »
Today a new snapshot was released, and...
Quote from: Changlog
You can enchant all items and blocks with an enchanted book

So? You can put any (obtainable) enchantment on any item using an enchanted book. Do you want to put Knockback on your Cookie? Then do so. What are some possible exploits for this? I have some ideas:
  • Swords and armor with Unbreaking
  • Books with enchantments such as Feather Falling or Respiration
  • Prank item with random enchantment

23
Calculator C / [68k] Incorrect Cursor Drawing
« on: November 30, 2012, 04:13:53 pm »
I decided to start using the latest GCC4TI release, but my graphic editing program now has a cursor glitch! (screenshot attached, along with how it's supposed to look)
My source code is also attached.
My code to draw the cursor is as follows:
Code: [Select]
void drawCursor(unsigned int x,unsigned int y) //Draws the cursor
{
unsigned char cursorl[8] = {
~0x80,~0xC0,~0xA0,~0x90,~0xB8,~0xE0,~0x90,~0x08
};
unsigned char cursord[8] = {
~0x80,~0xC0,~0xE0,~0xF0,~0xF8,~0xE0,~0x90,~0x08
};
unsigned char cursorm[8] = {
~0x7F,~0x3F,~0x1F,~0x0F,~0x07,~0x1F,~0x6F,~0xF7
};

Sprite8(x,y,8,cursorm,GrayGetPlane(LIGHT_PLANE),SPRT_AND);
Sprite8(x,y,8,cursorm,GrayGetPlane(DARK_PLANE),SPRT_AND);
Sprite8(x,y,8,cursorl,GrayGetPlane(LIGHT_PLANE),SPRT_OR);
Sprite8(x,y,8,cursord,GrayGetPlane(DARK_PLANE),SPRT_OR);
}

This code worked as intended on TIGCC 0.96 Beta 8, but shows the wrong cursor on GCC4TI 0.96 Beta 10. Any help would be appreciated!

24
Calculator C / [68k] GCC4TI makes .z89 file?!!
« on: August 28, 2012, 06:12:44 pm »
I was writing a program but for some reason GCC4TI (0.96 Beta 10) now making files with reversed extensions (.z89, .z9x, .zv2). The glitch is with only this specific project.

25
Calculator C / [68k] Flood Fill
« on: July 29, 2012, 09:12:42 pm »
I was trying to implement flood filling with the right-hand algorithm (http://en.wikipedia.org/wiki/Flood_fill#Fixed_memory_method_.28right-hand_fill_method.29), but it don't seem to work. Here's the code specific to the flood filling:

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
//FillPt(cur,rcol);
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,GetGPix(x,y),col)
Is there anything I did wrong? (The full source is attached.) Thanks for helping me.

26
Computer Usage and Setup Help / Screen contents cut off
« on: July 11, 2012, 10:24:57 am »
Right now the contents on my screen is cut off to the right. I am using 2048x1152, the recommended resolution for the monitor, and I don't know how to fix it. Any ideas?

27
Other Calc-Related Projects and Ideas / Calc Design
« on: July 09, 2012, 03:58:50 pm »
Over the last 2 nights I came up with a new calculator design.
1. The original keyboard layout and some specs. Notice the similarity to the TI-Nspire. Only with more programming capabilities.
2. Partial list of programming commands. HomeDisp is for the homescreen.
3. Improved keyboard layout. Note that the arrow keys should be larger.
4. Some "screenshots."
Questions? Comments?
Edit: I can't upload the images here; I'll post the links to them soon.
Edit 2: The links are:
1

2

3

4

28
TI 68K / Kraphyko, Decthyth, and the Illusiat 12 port
« 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.

29
Calculator C / [68k] Reducing size of main executable
« on: June 21, 2012, 11:08:13 am »
As you know, assembly programs on the 68k are limited to 24 KB for AMS 2.05 and up. I am programming a large game, and aside from storing maps and enemy data externally, I need a way to reduce the size of the main program. It's already about 5K right now, and without much in it. I considered putting certain functions in an external file, but I asked: 1. How would functions with arguments be called? and 2. How would I determine the offset for certain functions? I am also considering putting the main game content in chapters and in separate files, but I have no idea how to use global variables from the main program. Any ideas? Thanks in advance!

30
ASM / A question
« on: June 13, 2012, 11:36:55 am »
Is it possible to use a parser hook to allow running archived programs without manually unarchiving it by making a copy of it in the RAM and deleting it after execution?

Pages: 1 [2] 3