Jump to content



Photo
- - - - -

Making Switchable Add-ins


  • Please log in to reply
23 replies to this topic

#1 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 30 April 2004 - 02:47 AM

How do you make an AFX add-in capable of going back right where you left it after pressing MENU like all the built in ones? I am using Turbo C.

#2 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 30 April 2004 - 04:43 AM

I'm not sur? but I think it is not possible.

#3 X-thunder28

X-thunder28

    Casio Freak

  • Members
  • PipPipPipPip
  • 192 posts

  • Calculators:
    2 Graph100 (rom 1.02 and rom 1.03 (+) )

Posted 30 April 2004 - 09:22 AM

It' s possible (take a look on scorch for exemple)!

All you have to do is to use Getch() for input... with all disadvantages that include!

#4 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 06 May 2004 - 01:09 AM

On a similar note, being that I am using getch in Turbo C how do I tell the difference between two keys that return the same key code? For example DEL and the multiply key or ALPHA and 8. If it cant be done with getch, is there a way to do it so that the MENU key still brings you to the menu? TIA

#5 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 06 May 2004 - 04:05 PM

As I remember, some keys return 2 values: the value (char)0 and another (char) value. That's why some keys seem to return the same thing... So you have to test if getch returns 0 and then test getch again.

#6 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 11 May 2004 - 08:39 PM

Can you display inverted letters with the standard console font? I mean letters that have a black background and white lettering.

#7 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 12 May 2004 - 04:40 AM

Yes you can. One of the functions (either 0h or 0Eh) of Int 10h
you can output characters with needs a special parameter and
prints things inverse then.

I'm at school so I don't know the values exactly. I'll look after it when I'm
at home.

#8 [neo]f4kill

[neo]f4kill

    Casio Addict

  • Members
  • PipPipPip
  • 60 posts
  • Location:Montauban, France
  • Interests:programming

  • Calculators:
    G65, G100+, ClassPad 300

Posted 12 May 2004 - 01:22 PM

         mov ah,0eh
          mov al,41h
          int 10h
this prints the letter 'A' as you want

in C you can do this :
void print(char caracter)
{
          asm{
                    mov ah,0eh
                    mov al,caracter
                    int 10h
          }
}

(not tested made quickly!)

#9 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 15 May 2004 - 09:52 PM

Thank you all for you help. Maybe I should have named the topic C questions. Unfortunatly, the freely available version of Turbo C on Borland's site does not allow in-line. Can the same thing here be done in C or does anyone know if the professional version of Turbo C is available somewhere? Also, is the beginning of the video memory static and if not, how can I find it?

#10 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 16 May 2004 - 06:22 AM

Goto 2072productions.com and download the CDK (casio Development Kit)
that was assembled by the french I think. It contains an older version of TC that
is no longer distributed by borland and can compile 80286 specific code.
(this is important for the calc!) and emulate FPU.

You can also use the C functions (printf and so on) but I'd recommend to rewrite
them at least partly because this will give you some additional speed and
a lower filesize.

#11 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 16 May 2004 - 08:34 PM

To answer my own question, you can use the int86 function from dos.h to do the same thing that asm does. So what about the start of video memory and how can I read BASIC files in RAM?

#12 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 16 May 2004 - 11:20 PM

The start of the video memory can be found at 0x4E:0x0 usually it's 0x1A20:0x0

To read the Basic files you need my library called "Memzones", that you can download at http://www.2072produ...prog_source.php

#13 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 26 May 2004 - 02:30 AM

I am trying to get inverted text to work with this little example, but it doesn't work like I expect.

#include <stdio.h>
#include <dos.h>
#include <conio.h>

void dchar(const char c)
{
	union REGS inr,outr;
	inr.h.ah=0xE;
	inr.h.al=c;
	int86(0x10,&inr,&outr);
}
void dp(const char*s)
{
	int i;
	for (i=0;s[i];i++)
	{
  dchar(s[i]);
	}
}
int main()
{
	clrscr();
	gotoxy(1,1);
	dp("This is dark");
	gotoxy(1,2);
	dp("This is not dark");
	getch();
	return 0;
}

The first line printed is inverted but the second is not. If I just print the first line without the second, it is not inverted. If I change main to just do clrscr then dchar, it doesn't print an invertedcharacter, If I put a gotoxy between clrscr and the dchar, it works fine. It did some other weird things I can explain, but hopefully you have figured out what is wrong by now.

#14 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 26 May 2004 - 04:57 AM

This might be due to the fact that the calcs Bios interrupts (also int 10h)
are not 100% compatible to PCs BIOS interrupts.

You should rewrite the routines like gotoxy in pure ASM to ensure that they
only do what is possible on the calc.

#15 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 27 May 2004 - 03:48 AM

Thanks for the advice huhn_m. gotoxy works exactly how I want it to for everything else, but it obviously has a problem with what I am trying to do. I dont know asm so I cant rewrite the function. Can someone please give me an example of inverted text in C with no asm?

#16 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 27 May 2004 - 03:55 PM

As I remember of my experience with DOS text console, you need to invert the text before each write, that's the same for colours etc...

#17 betoe

betoe

    UCF Spanish Translator

  • [Legends]
  • PipPipPipPipPipPipPip
  • 846 posts
  • Gender:Male
  • Location:Guadalajara/Mazatlan, Mexico.
  • Interests:Electronics, SW development, automotive. Swim->bike->run

  • Calculators:
    Algebra FX2.0 (R.I.P.), Classpad 300

Posted 27 May 2004 - 08:45 PM

I think you can find a "gotoxy" or "locate" macro on internet. I used a macro for this the last semester for the subject "Microprocessors 2", that was 8086 programmation.

Unfortunately i search that macros but i dont find them in my HDD. So start searching sites with MACROS on the net, or wait for other post.

#18 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 30 May 2004 - 06:53 PM

2072: I dont understand. Do you see something I am doing wrong in my example?

#19 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 31 May 2004 - 01:41 AM

in fact no, I didnt read your code correctly... it should work.

Did you try the following syntax to make asm with your compiler?

void print(char caracter)
{
asm  mov ah,0eh;
asm  mov al,caracter;
asm  int 10h;
}


#20 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 01 June 2004 - 12:19 AM

Yes, I did try the asm block but as I explained in an earlier post, asm blocks don't work in Turbo C if you don't have the professional version. That is why I am trying to do it in C. Thanks so far.

#21 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 01 June 2004 - 04:26 PM

ASM blocks don't work but writing "asm" before each instruction (like I did in my previous post) may work, it does with TC2.0.

You can use Digital Mars, a free compiler to make your program on the AFX.

#22 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 07 June 2004 - 05:30 AM

I don't have my transfer cable with me so I can't test to see if the asm works but I at least got it to compile after switching from TC 2.0 to TC++ 3.0. Thanks for your help. Is it possible to access the fn memories or the A-Z and theta variables? Thanks again.

#23 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 07 June 2004 - 10:33 PM

It's written in the readme file of the memzone library.

#24 AlephMobius

AlephMobius

    Casio Freak

  • Members
  • PipPipPipPip
  • 189 posts

  • Calculators:
    AFX 2.0+, TI-89, EL-9300C

Posted 09 June 2004 - 05:21 PM

#include <stdio.h>

void dprint(const char*msg)
{
  int i;char rb;
  for (i=0;msg[i];i++)
  {
    rb=msg[i];
    asm mov ah,0eh;
    asm mov al,rb;
    asm int 10h;
  }
}

int main()
{
  dprint("Hello World");
  getch();
}

I did everything like y'all said but it still does not work! Any other suggestions?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users