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.


Messages - blue_bear_94

Pages: 1 ... 56 57 [58] 59 60 ... 68
856
Calculator C / Re: [68k] Storing a value into n?
« on: June 03, 2012, 04:07:24 pm »
Indeed, you're right, http://debrouxl.github.com/gcc4ti/htretval.html indicates that RETURN_VALUE can take an argument :)
I didn't remember about that capability, or even using it, but since I once compiled and ran all GCC4TI examples (finding and fixing several bugs inherited from TIGCC in the process), I did use it...

So I'm not sure at all why blue_bear_94's original code doesn't work...
Well, since the modified code works, I'm going to use it. But I have another problem.
Code: [Select]
// C Source File
// Created 6/3/2012; 2:16:41 PM
// Decthyth General 68k Libraries
#include <tigcclib.h>
//#define RETURN_VALUE n
void DlgError(const char* msg)
{
DlgMessage("Error",msg,BT_CANCEL,BT_NONE);
}
void WriteToNInt(long n)
{
push_longint(n);
VarStore(SYMSTR("n"),STOF_ESI,0,top_estack);
}
void WriteToNFloat(float n)
{
push_Float(n);
VarStore(SYMSTR("n"),STOF_ESI,0,top_estack);
}
short show_picvar (SYM_STR SymName, short x, short y, short Attr)
{
  SYM_ENTRY *sym_entry = SymFindPtr (SymName, 0);
  if (!sym_entry) return FALSE;
  if (peek (HToESI (sym_entry->handle)) != PIC_TAG) return FALSE;
  BitmapPut (x, y, HeapDeref (sym_entry->handle) + 2, ScrRect, Attr);
  return TRUE;
}
// Main Function
/*
NOTE: When I say that a function returns a value,
I mean that the value is stored to n.
*/
void _main(void)
{
int mode;
unsigned char a;
ESI argptr=top_estack;
a=GetArgType(argptr);
if (a!=POSINT_TAG)
{
DlgError("First arg must be + int");
return;
}
mode=GetIntArg(argptr);
switch (mode)
{
case 0:
WriteToNFloat(0.11);
break;
case 1:
SYM_STR name;
int x,y,attr;
a=GetArgType(argptr);
if (a!=STR_TAG)
{
DlgError("Arg 2 must be string");
return;
}
name=GetSymstrArg(argptr);
a=GetArgType(argptr);
if (a!=POSINT_TAG)
{
DlgError("Arg 3 must be + int");
return;
}
x=GetIntArg(argptr);
a=GetArgType(argptr);
if (a!=POSINT_TAG)
{
DlgError("Arg 4 must be + int");
return;
}
y=GetIntArg(argptr);
a=GetArgType(argptr);
if (a!=POSINT_TAG)
{
DlgError("Arg 5 must be + int");
return;
}
attr=GetIntArg(argptr);
//*A_REVERSE, *A_NORMAL, *A_XOR, *A_SHADED, *A_REPLACE, *A_OR, *A_AND, A_THICK1, A_SHADE_V, A_SHADE_H, A_SHADE_NS, A_SHADE_PS
if (attr>=7)
{
DlgError("Wrong attribute");
return;
}
if (!show_picvar(name,x,y,attr))
{
DlgError("Pic does not exist");
}

}
}
produces an error "Expected expression before SYM_STR".
Edit: Fixed. However, I am trying to see if a list has any true entries; here is my code. What do you suggest?
Code: [Select]
case 19:
a=GetArgType(argptr);
if (a!=LIST_TAG)
{
DlgError("Arg 2 must be list");
return;
}
temp3=argptr;
do
{
temp3=next_expression_index(temp3);
} while (!(*temp3==TRUE_TAG||*temp3==LIST_END_TAG||*temp3==END_TAG));
WriteToNBool(*temp3==TRUE_TAG);
WriteToNBool is a function to write a Boolean value to n:
Code: [Select]
void WriteToNBool(int n)
{
push_quantum(0x2B+!!n);
VarStore(SYMSTR("n"),STOF_ESI,0,top_estack);
}

857
Calculator C / Re: [68k] Storing a value into n?
« on: June 03, 2012, 03:34:34 pm »
Fixed. I edited the code to
Code: [Select]
// C Source File
// Created 6/3/2012; 2:16:41 PM
// Decthyth General 68k Libraries
#include <tigcclib.h>
//#define RETURN_VALUE n
void DlgError(const char* msg)
{
DlgMessage("Error",msg,BT_CANCEL,BT_NONE);
}
void WriteToNInt(long n)
{
push_longint(n);
VarStore(SYMSTR("n"),STOF_ESI,0,top_estack);
}
void WriteToNFloat(float n)
{
push_Float(n);
VarStore(SYMSTR("n"),STOF_ESI,0,top_estack);
}
// Main Function
/*
NOTE: When I say that a function returns a value,
I mean that the value is stored to n.
*/
void _main(void)
{
int mode;
unsigned char a;
ESI argptr=top_estack;
a=GetArgType(argptr);
if (a!=POSINT_TAG)
{
DlgError("First arg must be + int");
return;
}
mode=GetIntArg(argptr);
switch (mode)
{
case 0:
WriteToNFloat(0.1);
break;
}
}
(again, thanks!)

858
Calculator C / [68k] Storing a value into n?
« on: June 03, 2012, 03:20:13 pm »
I have trouble with a library in the works. The code I am using is below:
Code: [Select]
// C Source File
// Created 6/3/2012; 2:16:41 PM
// Decthyth General 68k Libraries
#include <tigcclib.h>
#define RETURN_VALUE n
void DlgError(const char* msg)
{
DlgMessage("Error",msg,BT_CANCEL,BT_NONE);
}
void WriteToNInt(long n)
{
push_longint(n);
}
void WriteToNFloat(float n)
{
push_Float(n);
}
// Main Function
/*
NOTE: When I say that a function returns a value,
I mean that the value is stored to n.
*/
void _main(void)
{
int mode;
unsigned char a;
ESI argptr=top_estack;
a=GetArgType(argptr);
if (a!=POSINT_TAG)
{
DlgError("First arg must be + int");
return;
}
mode=GetIntArg(argptr);
switch (mode)
{
case 0:
WriteToNFloat(0.1);
}
}
When I compile this example and put in dcth(0):n, it just returns n (no value stored). Do you know what's wrong? Thanks in advance!

859
Web Programming and Design / Re: Web Hosting
« on: June 03, 2012, 01:33:23 pm »
Personally, I use uCoz.

860
News / Re: First Nspire OS 3.2 demo on a calculator
« on: June 01, 2012, 05:19:11 pm »
Look at the TI-89 too. The world needs more 68k programmers.

861
TI Z80 / Re: Super Awesome RTS Project
« on: June 01, 2012, 11:02:57 am »
It has to do with gameplay. It means that it has too much advantage.

862
TI Z80 / Re: Super Awesome RTS Project
« on: June 01, 2012, 10:49:03 am »
Wait, I don't get it. What does OP stand for?

It means overpowered.

863
Gaming Discussion / Re: Battlefield 3
« on: June 01, 2012, 10:30:26 am »
It's online? Well, I haven't heard of it and I surely won't be allowed to play it.

864
Gaming Discussion / Re: l33t item in diablo 3
« on: June 01, 2012, 10:26:41 am »
And also, what did you buy, not being able to afford that 1337 bow?

865
Miscellaneous / Re: How cheap is your keyboard?
« on: May 31, 2012, 07:43:23 pm »
HE QUIK BROWN FO JUPS OER HE LA DOG

EDIT: exactly the same as runer... <_<  although I have a thinkpad laptop

I had the exact same results too!

866
Introduce Yourself! / Re: Introduce my self xd
« on: May 31, 2012, 07:37:54 pm »
Peanuts?
!peanuts
Do you have any other calcs?

867
News / Re: First Nspire OS 3.2 demo on a calculator
« on: May 31, 2012, 07:36:52 pm »
[sarcasm]Hopefully by OS 3.3 they should have native assembly capability up and running.[/sarcasm]

868
Miscellaneous / Re: singatures
« on: May 31, 2012, 02:15:46 pm »
jsj975 released a patch called 8xpfix. Try using that.

869
Miscellaneous / Re: How cheap is your keyboard?
« on: May 31, 2012, 09:14:21 am »
HE QUIK BROWN FO JUPS OER HE LA DOG

870
TI Z80 / Re: [INDEV] Pixelscape: online sprite and tilemap editor
« on: May 30, 2012, 06:39:46 pm »
Also, you should support conversion to a 68k C array.

Pages: 1 ... 56 57 [58] 59 60 ... 68