Author Topic: fx-9860G: C Addin & CASIO Basic programs works together  (Read 15747 times)

0 Members and 1 Guest are viewing this topic.

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
fx-9860G: C Addin & CASIO Basic programs works together
« on: April 04, 2011, 04:15:14 am »
Hello,
I played a little with my fx-9860G and I have found very interesting feature. I am not sure if it was discussed somewhere, please sorry for that case.

The main idea is, that C/asm addin and CASIO basic script can run concurrently and work together.

I put more detailed description & example on my page - see "TSR - Terminate and Stay Resident for fx-9860G" on my page (http://martin.poupe.org/casio/).

Martin

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #1 on: April 13, 2011, 03:34:53 am »
Hmm interesting. I don't think I read about this anywhere else yet before. I'll have to check your page to get more info.

Is it very tricky to allow this for an average user? I wonder if it could potentially be possible from a BASIC program to copy a file from the storage memory over the RAM and delete it manually afterward... this would allow massive RPGs, for example.
« Last Edit: April 13, 2011, 03:36:13 am by DJ_O »

Offline m1ac4

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 106
  • Rating: +8/-0
    • View Profile
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #2 on: April 13, 2011, 07:35:51 am »
Could this idea be applied to the Prizm too?  You said that the language might be able to be extended by this method.  It would be possible to create create/modify commands to draw objects to VRAM and create another command that would update the screen, allowing really fast screen updates to make fancy Prizm Basic games possible.

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #3 on: April 13, 2011, 11:26:21 am »
DJ_O: I think usage is tricky, but easy for average user (programmer in Basic). We need to specify (and agree on) list of functions and interface (how to communicate), which the TSR will support. As a quick draft one can imagine:
variable A - code of routine to call
0 = nothing
1: get TSR version
...
127: load cas program from flash, name in Str1, filename in Str2
128: delete cas file, name in Str1
Then Basic user would do following:
1. set parameters:
"Game"->Str 1:"\\fls0\Game.g1r"->Str 2
2. specify function:
127->A
3. wait for execute (TSR will reset A to signal execution)
While A:WhileEnd
4. check result (?)
If B:Then "ERROR":Stop":IfEnd
5. use the program
Prog "Game"
6. delete it
"Game"->Str 1:128->A
7. wait for execute ...
While A:WhileEnd
8. check result (?)
If B:Then "ERROR":Stop":IfEnd

One can also imagine really asynchronous processing, we may have function, which will periodically check variables X and Y
and display user defined image (figure) here. You may create e.g. Arkanoid game with nice ball without drawing ball at all (OK you need to draw it once and store it to TSR by another command)

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #4 on: April 13, 2011, 11:29:43 am »
m1ac4: I think yes, we need to know some syscall  - at least Alpha_GetData(),Alpha_SetData(),App_PRGM() ,SetTimer(),KillTimer() and all functionality you want to use from Basic. I hope that App_PRGM()  on cg behaves the same way as on fx9860.


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #5 on: April 17, 2011, 09:45:16 pm »
Interesting. It might take me a while to dechiper if I ever went into that kind of stuff, since I haven't programmed in a long while.

Also how did you make the screenshots at http://martin.poupe.org/casio/tsr/menu.png ? I never got able to transfer any add-in to any emulator I've tried...
« Last Edit: April 17, 2011, 09:46:16 pm by DJ_O »

Offline MPoupe

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 168
  • Rating: +30/-1
  • The coder of yesterday
    • View Profile
    • My web site about Casio calculator
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #6 on: April 18, 2011, 05:33:49 am »
Also how did you make the screenshots at http://martin.poupe.org/casio/tsr/menu.png ? I never got able to transfer any add-in to any emulator I've tried...
This screenshot is from the official Casio SDK.

Offline Horrowind

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +6/-0
    • View Profile
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #7 on: April 18, 2011, 11:04:15 am »
well, where is a trick to run any addin in the emulator of the sdk, you can add the addin in the SD-card memory folder and copy it while running another addin from SD-card to flash memory (via System-Menu). Then it can be easily executed in the Main-Memory.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #8 on: April 24, 2011, 03:22:40 pm »
Ah ok thanks guys, I was using the Casio FX-9860G manager. I'll have to try this out later.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #9 on: August 26, 2011, 03:57:45 pm »
The Fx manager + can do addins also:

http://www.casiocalc.org/?showtopic=5673



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline PierrotLL

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +2/-0
    • View Profile
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #10 on: December 15, 2011, 09:02:17 am »
Hey MPoupe, I just unexpectedly found the sources of this program in a corner of my hard drive, and it amused me because it use exactly the same idea than one of my programs ^_^
http://www.youtube.com/watch?v=_JrwaOIsCc0

Offline bsl

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 157
  • Rating: +14/-0
    • View Profile
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #11 on: December 15, 2011, 12:22:37 pm »
I have a version of this working on the Prizm .
It already does syscalls, and I have not released it yet.
I will get back to this at some point.
I need to make a good demo out of it.

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #12 on: December 15, 2011, 12:29:24 pm »
I don't quite understand the significance of MPoupe's addin. I think this may have to do with the fact that I do not program in C.

DJ_O: I think usage is tricky, but easy for average user (programmer in Basic). We need to specify (and agree on) list of functions and interface (how to communicate), which the TSR will support. As a quick draft one can imagine:
variable A - code of routine to call
0 = nothing
1: get TSR version
...
127: load cas program from flash, name in Str1, filename in Str2
128: delete cas file, name in Str1
Then Basic user would do following:
1. set parameters:
"Game"->Str 1:"\\fls0\Game.g1r"->Str 2
2. specify function:
127->A
3. wait for execute (TSR will reset A to signal execution)
While A:WhileEnd
4. check result (?)
If B:Then "ERROR":Stop":IfEnd
5. use the program
Prog "Game"
6. delete it
"Game"->Str 1:128->A
7. wait for execute ...
While A:WhileEnd
8. check result (?)
If B:Then "ERROR":Stop":IfEnd

One can also imagine really asynchronous processing, we may have function, which will periodically check variables X and Y
and display user defined image (figure) here. You may create e.g. Arkanoid game with nice ball without drawing ball at all (OK you need to draw it once and store it to TSR by another command)


And whats this? Does this mean that we can use syscalls in BASIC now?

I'm kinda confused.... Could someone explain how this is significant?

Sorry if i'm not being clear, or am sounding rude, but I'm just trying to understand... :P



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0

Offline sjasogun1

  • LV3 Member (Next: 100)
  • ***
  • Posts: 88
  • Rating: +8/-1
    • View Profile
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #13 on: December 19, 2011, 08:04:12 am »
The significance of this is that this enables one to actually write new commands you can use in a simple BASIC program. Watch the video Pierrott posted for example. This is one of the best CASIO utilities I've come across.

To both Pierrott and MPoupe, keep up the good work!
Veni, vidi, cecidi
(I came, I saw, I fell down dead)
MSPAFORUMS: http://www.mspaforums.com/
HOMESTUCK: http://www.mspaintadventures.com/?s=6&p=001901

Offline flyingfisch

  • I'm 1337 now!
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1620
  • Rating: +94/-17
  • Testing, testing, 1...2...3...4...5...6...7...8..9
    • View Profile
    • Top Page Website Design
Re: fx-9860G: C Addin & CASIO Basic programs works together
« Reply #14 on: December 19, 2011, 09:57:04 am »
OH, ok. So this means that we could actually use syscalls in BASIC progs? cool!



Quote from: my dad
"welcome to the world of computers, where everything seems to be based on random number generators"



The Game V. 2.0