Omnimaga

Omnimaga => Completed => Our Projects => Nspire I/O => Topic started by: Juju on July 18, 2012, 02:10:50 pm

Title: PrizmIO
Post by: Juju on July 18, 2012, 02:10:50 pm
This is PrizmIO, a port of NspireIO (http://ourl.ca/9468) for the Casio Prizm. You can now easily output text with printf in your apps!

Right now only char output (with 16 different colors!) and very limited input (\n) works (the rest is commented out), I intend the library to be as much compatible as the Nspire version (same function prototypes, so you can write code that compiles on both Nspire and Prizm).

Download the code on http://github.com/juju2143/prizmio
Title: Re: PrizmIO
Post by: DJ Omnimaga on July 18, 2012, 09:27:41 pm
Oh that looks nice. By the way is it mostly a command prompt or also a text routine? Your post seems to tell me it's also a text display routine to use in other apps
Title: Re: PrizmIO
Post by: Juju on July 18, 2012, 09:34:40 pm
It's a library you can use in your app to ease text input/output, nFrotz uses this, among others. It's like you're writing a computer program that uses cmd.exe.

Also original NspireIO topic: http://ourl.ca/9468
Title: Re: PrizmIO
Post by: Deep Toaster on July 20, 2012, 12:58:10 am
Nice project!

Easy portability between Nspire and Prizm code does sound like an awesome idea. Hope it really happens someday...
Title: Re: PrizmIO
Post by: Eiyeron on July 20, 2012, 09:48:42 am
YAY! Roguelike planned! (or not)
Title: Re: PrizmIO
Post by: compu on July 20, 2012, 10:38:55 am
Nice work ;)
Title: Re: PrizmIO
Post by: Eiyeron on July 20, 2012, 10:54:23 am
I just compiled just now, i'm giving you the binairies for the lazy guys.
Just put the .h in the include folder and the .lib file in the lib folder! :p

Compiled with Prizm-SDK 0.3
Title: Re: PrizmIO
Post by: Juju on July 20, 2012, 11:08:30 am
Thanks, nice work on your side too because all I did is to replace the SetPixel and getch routine, the rest (at least all that is related to display/keyboard) depends on them. (That and solving many weird compilation problems -_-)

And thanks Eiyeron for posting the binaries, keep in mind several functions are all stubs (reg_* and uart_*, getch only supports EXE) in this version. I think it's pretty enough to make lots of wonderful stuff. ^_^
Title: Re: PrizmIO
Post by: shmibs on July 20, 2012, 01:38:31 pm
ooh, fancy =D/me is going to be checking this out.
Title: Re: PrizmIO
Post by: Juju on July 27, 2012, 01:21:34 am
UPDATE: Input should work (some keys might be missing though, I should add more keys, tell me what you think) and instead of drawing the screen manually with Bdisp_something it's drawn pixel-by-pixel now (drawing the screen fully is rather slow but it might be more effective for redrawing single characters, but again, tell me what you think, I think I'll need lots of input on this.)

By now, the basic display input/output should work enough for making potable applications, it's just that initializing the console is slow, therefore this library is now released as beta. (Not tested this commit yet as I have some problems with my Prizm on this computer.)

EDIT: Now that I tested it, wtf the keys aren't even at the right place. ???
Title: Re: PrizmIO
Post by: Juju on July 28, 2012, 05:18:34 pm
UPDATE: Keyboard works fine now. Shift and Alpha works as expected, OPTN switches between lower and uppercase, feel free to suggest me a more complete keymap.
Title: Re: PrizmIO
Post by: DJ Omnimaga on July 28, 2012, 06:33:39 pm
Nice to see this still updated. By the way, was the green text thing in TCAP earlier PrizmIO with new fonts?
Title: Re: PrizmIO
Post by: Juju on July 28, 2012, 06:48:33 pm
Don't think so. It still uses the same font. Tinychat cam quality is pretty blurry.

Might post binaries tonight. :P
Title: Re: PrizmIO
Post by: DJ Omnimaga on July 28, 2012, 06:55:17 pm
Ah ok, maybe it was some sort of terminal on your computer then?
Title: Re: PrizmIO
Post by: Juju on July 28, 2012, 07:43:42 pm
Yeah, that was my terminal with the PrizmIO code in it.
Title: Re: PrizmIO
Post by: DJ Omnimaga on July 29, 2012, 03:34:39 am
As I said after seeing your program running live on your calc, I must say good job so far. You need to do something about how long it takes to load the entire screen with text when it needs to be updated completely, though. D:
Title: Re: PrizmIO
Post by: Juju on July 29, 2012, 01:47:54 pm
Latest commit fixes this :D
Title: Re: PrizmIO
Post by: Eiyeron on July 30, 2012, 04:39:01 pm
Do you have two modes? Auto-refresh and Manual?
Title: Re: PrizmIO
Post by: Juju on July 30, 2012, 07:35:02 pm
Yes, some of the functions draw directly to the screen using syscalls and have variants that only draws to the VRAM. (Like SetPixel and SetPixelVRAM, the former uses the Bdisp_SetPixel_DD syscall (so it gets drawn directly to screen) and the latter does not, merely dumping the pixel in VRAM.) Others, like DrawConsole, use the VRAM variants then uses Bdisp_PutDisp_DD at the end.
Title: Re: PrizmIO
Post by: Eiyeron on July 30, 2012, 07:51:53 pm
I'll give you a little tip: don't forget to make functions easy to use and cler0ar ;)
Title: Re: PrizmIO
Post by: Juju on July 30, 2012, 07:54:13 pm
They are :) (since I didn't changed the prototypes.)

There's also documentation and easy to understand demos.
Title: Re: PrizmIO
Post by: DJ Omnimaga on July 30, 2012, 08:11:33 pm
Are the demos the stuff I saw the other day or are there more?
Title: Re: PrizmIO
Post by: Juju on July 30, 2012, 08:21:37 pm
Pretty much all you saw the other day were the demos.

Also, binaries. Demo included. I think I can call this 0.1. :D

https://github.com/downloads/juju2143/prizmio/prizmio-0.1.zip
Title: Re: PrizmIO
Post by: DJ Omnimaga on August 01, 2012, 03:48:43 pm
Oh cool, I'll download this when I have a chance. Glad there are binaries too. :P
Title: Re: PrizmIO
Post by: Juju on August 17, 2012, 09:28:43 pm
UPDATE:
Title: Re: PrizmIO
Post by: DJ Omnimaga on August 18, 2012, 12:55:02 am
That is great :D. Is it only for characters or can you actually display little squares like that too?

Else, does your program support background color for text?
Title: Re: PrizmIO
Post by: Juju on August 18, 2012, 01:01:12 am
Those squares are made with spaces with a background color. Of course, those colors are also available as text colors.

Next, VT100 escape codes.
Title: Re: PrizmIO
Post by: DJ Omnimaga on August 20, 2012, 11:22:25 pm
Ok thanks for the info. If your program was ever used for something like a MUD RPG I assume graphics could be made from those squares, right? I remember some old Telnet RPGs had ASCII art representing rooms.
Title: Re: PrizmIO
Post by: Juju on August 20, 2012, 11:44:17 pm
The sky is the limit, DJ. :P
Title: Re: PrizmIO
Post by: Eiyeron on August 24, 2012, 03:25:20 pm
(Yeah, more roguelike features!)
Title: Re: PrizmIO
Post by: Juju on August 24, 2012, 05:53:37 pm
Also, support of VT100 will also be useful for easy cursor movement commands so it'll be easier to port a rogue game.
Title: Re: PrizmIO
Post by: MPoupe on August 27, 2012, 05:46:24 am
Those squares are made with spaces with a background color. Of course, those colors are also available as text colors.

Next, VT100 escape codes.
Hi, I released new version of fxTerm - VT100 terminal emulator for Casio fx cg with source code. Download on my page (http://martin.poupe.org/casio/)
Reuse what you want for your PrizmIO :-)
Title: Re: PrizmIO
Post by: Juju on August 27, 2012, 08:05:55 am
Hey thanks, it'll be pretty helpful.
Title: Re: PrizmIO
Post by: Juju on October 03, 2012, 01:01:40 pm
UPDATE

New commit: updated from upstream. So cursors, stdio replacement and stuff like that.


EDIT: Yes there's errors, didn't tested yet.
Title: Re: PrizmIO
Post by: Juju on October 09, 2012, 10:34:14 pm
UPDATE

PrizmIO is now officially deprecated, merged and superseded by Nspire I/O (http://ourl.ca/9468). New versions will now be found on nspforge (http://nspforge.unsads.com/p/nspireio). Also rewrote the keyboard routines, might not work correctly yet.
Title: Re: Re: PrizmIO
Post by: DJ Omnimaga on October 11, 2012, 07:02:06 pm
At first I was scared you were dropping this project lol, glad that isn't the case and that it's continuing forward with NspireIO.
Title: Re: PrizmIO
Post by: Spenceboy98 on December 31, 2012, 05:14:35 pm
I'm having trouble with this. Whenever I try to compile, it says, "unknown type name 'BOOL'"
Title: Re: PrizmIO
Post by: Lionel Debroux on January 01, 2013, 02:43:09 am
Are you using the latest version of nspireio ?
Title: Re: PrizmIO
Post by: epic7 on January 01, 2013, 12:43:46 pm
Booleans never worked for me, with or without nspireio
Title: Re: PrizmIO
Post by: Spenceboy98 on January 01, 2013, 05:19:28 pm
Are you using the latest version of nspireio ?

Yes
Title: Re: PrizmIO
Post by: compu on January 01, 2013, 05:27:58 pm
Could you post the complete build log?
Title: Re: PrizmIO
Post by: Spenceboy98 on January 01, 2013, 05:36:31 pm
Here:

Code: [Select]
../..//bin/sh3eb-elf-gcc.exe -c -m3 -mb -O3 -mhitachi -Wall -nostdlib  -I../..//
include -lfxcg -lnspireio -lgcc -L../..//lib -std=c99 main.c -o main.o
In file included from ../..//include/nspireio.h:34:0,
                 from main.c:4:
../..//include/nspireio-platform.h:63:1: error: unknown type name 'BOOL'
In file included from main.c:4:0:
../..//include/nspireio.h:71:2: error: unknown type name 'BOOL'
../..//include/nspireio.h:72:2: error: unknown type name 'BOOL'
../..//include/nspireio.h:76:2: error: unknown type name 'BOOL'
../..//include/nspireio.h:77:2: error: unknown type name 'BOOL'
In file included from main.c:4:0:
../..//include/nspireio.h:233:1: error: unknown type name 'BOOL'
../..//include/nspireio.h:245:1: error: unknown type name 'BOOL'
../..//include/nspireio.h:352:1: error: unknown type name 'BOOL'
../..//include/nspireio.h:404:40: error: unknown type name 'BOOL'
../..//include/nspireio.h:410:49: error: unknown type name 'BOOL'
../..//include/nspireio.h:378:17: warning: inline function 'nio_time_get' declar
ed but never defined [enabled by default]
../..//include/nspireio.h:378:17: warning: inline function 'nio_time_get' declar
ed but never defined [enabled by default]
make: *** [main.o] Error 1
Title: Re: PrizmIO
Post by: compu on January 01, 2013, 05:55:55 pm
It looks like something in your Makefile is wrong. Try adding -DPRIZM to the gcc flags or have a look at one of the demo Makefiles.
If that doesn't solve the problem you'll have to ask Juju, he maintains the Prizm stuff ;)
Title: Re: PrizmIO
Post by: DJ Omnimaga on January 01, 2013, 08:18:02 pm
By the way, if that is what LuaZM 0.1 or so used, you should fix ALPHA/2nd so it operates like the calc by default, because I never got able to switch back to uppercase once <.<
Title: Re: PrizmIO
Post by: Juju on January 02, 2013, 02:24:02 pm
Hmmm... Probably some file that wasn't defined correctly.

You have to add -DPRIZM somewhere in the CFLAGS or in the gcc command line of your makefile so it knows it have to include the Prizm-specific stuff, which includes a definition of BOOL.
Title: Re: PrizmIO
Post by: Spenceboy98 on January 02, 2013, 03:33:00 pm
Now it says:
Code: [Select]
../..//bin/sh3eb-elf-gcc.exe  main.o -m3 -mb -O3 -mhitachi -Wall -nostdlib  -I..
/..//include -lfxcg -lgcc -L../..//lib -std=c99 -DPRIZM -T../common/prizm.ld -Wl
,-static -o Test.bin
main.o: In function `_main':
main.c:(.text.startup+0x18): undefined reference to `_puts'
main.c:(.text.startup+0x20): undefined reference to `_getchar'
collect2: ld returned 1 exit status
make: *** [Test.bin] Error 1