Author Topic: [Axiom] LCDKit  (Read 14276 times)

0 Members and 2 Guests are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
[Axiom] LCDKit
« on: March 28, 2011, 12:29:41 am »
For the past week or so, I worked on an Axiom that includes a lot of commands for interfacing with the LCD driver. I think I've finished adding just about everything I wanted to and hopefully it has no bugs, so I'll release it. Here are its features:

  • Turn the LCD on or off    ? This one's cool
  • Get the on/off status of the LCD
  • Set the contrast (I just realized as I'm writing this that Axe could already do this, but this command is safer)
  • Get the contrast set by the OS (useful for setting the screen contrast back to normal)    ? Pretty useful
  • Set the screen's z-address (internally shifts the rows of the screen up/down)    ? This one's really cool
  • Apply screen flipping effects (on newer calculators with compatible drivers)
  • Read and write individual bytes/words to and from LCD memory
  • Copy a stream of bytes to or from LCD memory


That's a lot of information to throw at you about what it can do. To give you some ideas of how you could use some of these commands, here would be some useful applications of this Axiom:

  • Turn the screen off for a teacher key or to save power in a waiting state
  • Make contrast effects based around the active (OS-defined) contrast value and then return the contrast to the proper value when done
  • Use z-addressing to apply an earthquake effect without having to worry about shifting the buffer image (or make crazy tunnel games)


Anyway, without further ado I will attach a zip file containing the LCDKit Axiom, its source code (sorry if it's tabbed oddly, I designed it in wabbitcode), a readme, and a command list. The Axiom appvar is fairly small for a library with 31 routines, weighing in at 651 bytes. Note that Axe will NOT add the whole thing to your program, only the routines that you actually use, so don't worry about any unnecessary code bloating.



Changelog
  • 1.0.1 (Mar 28 2011):   Fixed a bug that slipped by, breaking the ?imag() commands
  • 1.0.0 (Mar 28 2011):   Initial release


MAKE SURE YOU DOWNLOAD THE LATEST VERSION, CURRENTLY: LCDKit_1.0.1.zip
« Last Edit: March 28, 2011, 02:09:50 pm by Runer112 »

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: [Axiom] LCDKit
« Reply #1 on: March 28, 2011, 12:33:53 am »
This is awesome! Writing directly to the buffer is something I was definitely looking for a few days ago!
There's something about Tuesday...


Pushpins 'n' stuff...


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: [Axiom] LCDKit
« Reply #2 on: March 28, 2011, 12:49:03 am »
Oh wow, that's epic. Nice job Runer112. :D

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [Axiom] LCDKit
« Reply #3 on: March 28, 2011, 01:11:23 am »
Fixed a bug I hadn't noticed due to changing a shared routine without realizing it would break a routine that used it. Writing bytes/words directly to the LCD should now work.


EDIT: Just noticed a dumb mistake in commands.txt. Oh well, it's only a naming mistake and isn't too important. It'll make it into the next release, which will probably be soon due to another unexpected bug.
« Last Edit: March 28, 2011, 01:15:12 am by Runer112 »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: [Axiom] LCDKit
« Reply #4 on: March 28, 2011, 04:20:26 am »
Awesome, the first real Axiom I've seen! :)

On a related note, I remember you were asking somewhere if the 32 routines was a technical limitation: kind of.  I have 160/256 unique subroutine identifiers reserved for axioms which leaves me 96 built in subroutines (I am currently using 52).  I decided to split it up such that there would be 5 Axioms maximum with 32 routines for each one.  I could change it to 4 Axioms with 40 routines per Axiom, I'm not sure what a good mix would be.  What are your thoughts?
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [Axiom] LCDKit
« Reply #5 on: March 28, 2011, 11:47:00 am »
Hmm... if RAM limits you to only assigning 256 subroutines, then I guess the current limit is okay.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: [Axiom] LCDKit
« Reply #6 on: March 28, 2011, 04:01:23 pm »
Wow, this looks great!  Nice job, Runer! ;D

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: [Axiom] LCDKit
« Reply #7 on: April 03, 2011, 02:23:02 pm »
Looks useful!

Also, Quigibo, what's the chance of having a header in each axiom, that specifies the number of subs used, and allows you to have it based on the number of routines, not the number of axioms?

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: [Axiom] LCDKit
« Reply #8 on: April 28, 2011, 07:28:38 pm »
I can't send it to my calc; my computer says it's an invalid file type.
Nevermind. I was being illiterate. :(
How do I flip the LCD?
What's z addressing?
« Last Edit: April 28, 2011, 07:36:54 pm by Freyaday »
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [Axiom] LCDKit
« Reply #9 on: April 28, 2011, 08:31:48 pm »
To flip the LCD:

R►Pr()            Turns horizontal and vertical flipping off; only works on newer calculators
P►Rx()            Turns horizontal flipping on and vertical flipping off; only works on newer calculators
P►Ry()            Turns horizontal flipping off and vertical flipping on; only works on newer calculators
R►Pθ()            Turns horizontal and vertical flipping on (rotate screen 180 degrees); only works on newer calculators

LCD flipping is only supported on fairly new calculators. Older calculators' LCD drivers did not have this flipping feature.


Z-addressing changes how LCD RAM is mapped to the screen. The z-address can be a number from 0 to 63, and is normally set to 0. This means that normally, row 0 of a buffer image would be displayed at row 0 on the screen. However, the output on the screen can be shifted vertically by changing the z-address. The value of the z-address determines which row in the buffer image would be displayed at row 0 on the screen. For instance, if you set a z-address value of 8, the screen would effectively be shifted up 8 pixels because row 8 of the buffer image would be mapped to row 0 of the screen. Rows 8-63 would be shifted up 8 pixels and rows 0-7 would appear at the bottom of the screen, having wrapped around from the top. Z-addressing could be used for something like an earthquake effect by changing the z-address between 1 and 63, which would shift the screen 1 pixel up and 1 pixel down, respectively.

To set the z-address (this token is found under VARS > Statistics... > TEST):

→z                  Sets the z-address
« Last Edit: April 28, 2011, 09:09:00 pm by Runer112 »

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: [Axiom] LCDKit
« Reply #10 on: April 28, 2011, 09:06:52 pm »
z isn't under EQ, it's under TEST. Just saying.... ¯\(O.o)/¯
« Last Edit: April 28, 2011, 09:07:25 pm by Freyaday »
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [Axiom] LCDKit
« Reply #11 on: April 28, 2011, 09:09:25 pm »
So it is...
* Runer112 slaps head

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: [Axiom] LCDKit
« Reply #12 on: April 28, 2011, 09:10:31 pm »
It's giving me a BAD SYMBOL error! Should I send the z to its room?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [Axiom] LCDKit
« Reply #13 on: April 28, 2011, 09:13:12 pm »
It works fine for me. Is the Axiom on your calculator, and does your program contain #Axiom(LCDKIT)?

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: [Axiom] LCDKit
« Reply #14 on: April 28, 2011, 09:34:43 pm »
Yes, and yes. Does your Axiom support z+1->z anyway?
So I just use P►Ry() and the screen flips upside down?
« Last Edit: April 28, 2011, 09:36:05 pm by Freyaday »
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!