Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 02:54:03 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 ... 8   Go Down
  Print  
Author Topic: Getting started in Casio-Basic? You can ask here. -  (Read 8104 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« on: 18 January, 2011, 21:58:58 »
0

This is a thread where you can put your Casio-Basic related questions.
Me and the other Casio guys will try to answer these.
« Last Edit: 18 January, 2011, 22:01:44 by cfxm » Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #1 on: 18 January, 2011, 22:12:49 »
0

-One question I have is can we omit quotes at the end of Locate? In TI-BASIC you can do things such as Output(1,1,"HELLO WORLD instead of Output(1,1,"HELLO WORLD") as long as the next code is on a different line, but I was wondering if it was the same on Casio? That usually saved us some bytes of RAM.

-Also are there any assembly tools that allow us to run programs directly from the Storage memory or even just a program that works in a parser hook way and allows you to move/copy back and forth programs from the RAM to storage? That isn't really BASIC-related, although some 83+ BASIC games uses such programs to get around the 24 kilobytes of RAM limit.

-Also how would we recall a picture from a program on the Prizm? I tried RecallPict 1 (after storing a pic with StorePict 1) and it does nothing... Huh?

On an unrelated note, somebody started writing a guide to help people porting TI-BASIC programs to Casio BASIC or vice-versa a while ago. I can't find the topic right now but I'll try to find it later.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #2 on: 18 January, 2011, 22:39:11 »
0

Quote
-One question I have is can we omit quotes at the end of Locate? In TI-BASIC you can do things such as Output(1,1,"HELLO WORLD instead of Output(1,1,"HELLO WORLD") as long as the next code is on a different line, but I was wondering if it was the same on Casio? That usually saved us some bytes of RAM.
"Locate" and "Text" seem to allow this, but it's bad practice and does not seem to work with the ":" command either. Actually, I have never used this. The few bytes you save get lost by using special characters.

Quote
-Also are there any assembly tools that allow us to run programs directly from the Storage memory
Maybe this is what you are looking for?
http://casiokingdom.org/modules.php?name=Downloads&d_op=viewdownloaddetails&cid=16&lid=542&ttitle=FX9860G_LOADER_2.00#dldetails

Quote
-Also how would we recall a picture from a program on the Prizm? I tried RecallPict 1 (after storing a pic with StorePict 1) and it does nothing... Huh?
You could try clearing the screen first using "cls" and you should disable any background image with "BG-None". Unfortunately, there is no way to test if a picture exists - causing a memory error sometimes.
« Last Edit: 18 January, 2011, 22:39:38 by cfxm » Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #3 on: 18 January, 2011, 23:07:46 »
0

Quote
-One question I have is can we omit quotes at the end of Locate? In TI-BASIC you can do things such as Output(1,1,"HELLO WORLD instead of Output(1,1,"HELLO WORLD") as long as the next code is on a different line, but I was wondering if it was the same on Casio? That usually saved us some bytes of RAM.
"Locate" and "Text" seem to allow this, but it's bad practice and does not seem to work with the ":" command either. Actually, I have never used this. The few bytes you save get lost by using special characters.
Ah ok, I guess it is different between both brand of calcs. On TI, we try to save every possible byte by using such optimization. It is even considered a good practice among us. The only time it should be avoided is with For() when it only contains an IF instruction that is often False, due to a TI-OS glitch. Does special characters actually take more space than the regular ones? I remember something similar on TI with lowercase letters.

Quote
-Also are there any assembly tools that allow us to run programs directly from the Storage memory
Maybe this is what you are looking for?
http://casiokingdom.org/modules.php?name=Downloads&d_op=viewdownloaddetails&cid=16&lid=542&ttitle=FX9860G_LOADER_2.00#dldetails
Does this allow copying individual programs to the RAM? Being forced to copy entire packages might not be something I want, especially when each program is 15 KB large.

Quote
-Also how would we recall a picture from a program on the Prizm? I tried RecallPict 1 (after storing a pic with StorePict 1) and it does nothing... Huh?
You could try clearing the screen first using "cls" and you should disable any background image with "BG-None". Unfortunately, there is no way to test if a picture exists - causing a memory error sometimes.
Nope, no luck. Here's my code (Casio Prizm OS 01.01.0200):


1
2
3
4
5
6
Cls
Vertical -3
StoPict 1
Cls
BG-None
RclPict 1
Basically I wanted to clear the screen, display a line at -3, Store the screen content in picture 1, clear the screen again, then re-display the picture 1 content again. Not an useful program, but it was for testing purpose since I'm experimenting with the language.
« Last Edit: 18 January, 2011, 23:17:03 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #4 on: 18 January, 2011, 23:35:18 »
0

Quote
Does special characters actually take more space than the regular ones?
As long as they're non-ASCII.

Quote
Does this allow copying individual programs to the RAM? Being forced to copy entire packages might not be something I want, especially when each program is 15 KB large.
As far as I know, this copies any program within a *.g1m/*.g2m file into the user RAM.
You may ask Simon to obtain the source code.

Quote
Nope, no luck. Here's my code (Casio Prizm OS 01.01.0200):


1
2
3
4
5
6
Cls
Vertical -3
StoPict 1
Cls
BG-None
RclPict 1
And if you go to RUN|MAT and enter "Cls:RclPict 1"? This will display the coordinate system with an additional vertical line on my fx-9750GII.
Inside RUN|MAT you can press [Shift]+[F3] and reset the view window with [F1] - just in case the vertical line is not within the display area...
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #5 on: 18 January, 2011, 23:45:52 »
0

Yeah in RUN|MAT it works fine, just not in PRGM.

However I noticed it seems to work if I set the pic as a background. I guess a background could do the job maybe, although that doesn't allow dual-layer ASCII graphics it seems Big frown (see animated screen capture for what I mean about dual-layer ASCII graphics).

Thanks a lot by the way!


* duallayerexample2.gif (105.92 KB, 192x128 - viewed 448 times.)
« Last Edit: 18 January, 2011, 23:46:14 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #6 on: 18 January, 2011, 23:53:02 »
0

Maybe this is because the program execution stops after RclPict 1?
Try putting it into a loop or append the small triangle command after RclPict to pause the interpreter (until you press [EXE]).
« Last Edit: 18 January, 2011, 23:54:48 by cfxm » Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #7 on: 18 January, 2011, 23:59:51 »
0

Actually I noticed something even worse: Cls doesn't do anything shocked

(Btw I tried with the triangle thing and also For 1->Z to 999:Next)

Could this just be my OS? I think you or someone else who has access to OS 1.02 should try on it to see. I hope Casio won't wait a year or two before releasing 1.02. X.x
« Last Edit: 19 January, 2011, 00:00:33 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #8 on: 19 January, 2011, 00:30:41 »
0

Have a look at this:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Program: INIT
Cls
BG-None
AxesOff
Horizontal -1
Horizontal 1
StoPict 1
Cls
Vertical -1
Vertical 1
StoPict 2

// Program: TEST
Prog "INIT"
While 1
Cls:RclPict 1_ // '_' is the small triangle
Cls:RclPict 2_
WhileEnd

Quote
Actually I noticed something even worse: Cls doesn't do anything
Indeed, when "Cls" is followed by a loop, the screen won't be cleared immediately.

PS: I don't own a Prizm yet.
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #9 on: 19 January, 2011, 00:38:44 »
0

I see. Well, I tried replacing _ with For 1->A To 999:Next and the pics wouldn't show up. I guess RecallPict only works as soon as the program is paused. Thanks for the help!
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #10 on: 19 January, 2011, 00:44:07 »
0

You could use the famous PxlOff 1,1 trick to force a screen refresh. ;-)
Actually, lots of those refresh issues were fixed with the fx-9860G series; however, a few are still there...
Logged
z80man
Casio Traitor
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 04 September, 2012, 19:42:33
Date Registered: 26 December, 2010, 10:02:50
Location: City 17
Posts: 966


Total Post Ratings: +83

View Profile
« Reply #11 on: 19 January, 2011, 00:46:35 »
0

O yeah I forgot to say earlier. Unlike TI-BASIC pixel coordinates don't start at 0, but instead 1. Also the client area is 187x379.
Logged


List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #12 on: 19 January, 2011, 00:55:21 »
0

Ah, right, although on the Prizm PxlOff is so friggin slow (3 pixels per second rate) so that would slow down the game quite a lot. X.x

EDIT: Why does PxlOn 1,1 works, but not PxlOn X,Y? We can't even use variables as arguments? I get a message saying the arguments must be an integer, even though they're integers

For 1->X To 96
For 1->Y To 64
Pxl-On X,Y
Next
Next
« Last Edit: 19 January, 2011, 01:05:52 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #13 on: 19 January, 2011, 01:15:06 »
0

X and Y are used internally when drawing things - so you should not use them.
The same is true for r and theta when doing polar stuff.
« Last Edit: 19 January, 2011, 01:23:49 by cfxm » Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 18:13:08
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50196


Total Post Ratings: +2611

View Profile WWW
« Reply #14 on: 19 January, 2011, 01:17:56 »
0

oh, right. I'll try with other variables, then. Thanks.

EDIT: Ok that works. Is there any way to speed up drawing or something? I find it hard to believe a 6 MHz calc with a 8 bits CPU can fill 5985 pixels by the time a 29 MHz 32 bits CPU one can't even fill 300 shocked


* pxlonspd.gif (2830.15 KB, 160x120 - viewed 461 times.)
« Last Edit: 19 January, 2011, 01:31:28 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: [1] 2 3 ... 8   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.267 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.