Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Runer112 on March 28, 2011, 12:29:41 am

Title: [Axiom] LCDKit
Post by: Runer112 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:



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:



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

MAKE SURE YOU DOWNLOAD THE LATEST VERSION, CURRENTLY: LCDKit_1.0.1.zip
Title: Re: [Axiom] LCDKit
Post by: ZippyDee 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!
Title: Re: [Axiom] LCDKit
Post by: DJ Omnimaga on March 28, 2011, 12:49:03 am
Oh wow, that's epic. Nice job Runer112. :D
Title: Re: [Axiom] LCDKit
Post by: Runer112 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.
Title: Re: [Axiom] LCDKit
Post by: Quigibo 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?
Title: Re: [Axiom] LCDKit
Post by: Runer112 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.
Title: Re: [Axiom] LCDKit
Post by: ztrumpet on March 28, 2011, 04:01:23 pm
Wow, this looks great!  Nice job, Runer! ;D
Title: Re: [Axiom] LCDKit
Post by: willrandship 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?
Title: Re: [Axiom] LCDKit
Post by: Freyaday 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?
Title: Re: [Axiom] LCDKit
Post by: Runer112 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
Title: Re: [Axiom] LCDKit
Post by: Freyaday on April 28, 2011, 09:06:52 pm
z isn't under EQ, it's under TEST. Just saying.... ¯\(O.o)/¯
Title: Re: [Axiom] LCDKit
Post by: Runer112 on April 28, 2011, 09:09:25 pm
So it is.../me slaps head
Title: Re: [Axiom] LCDKit
Post by: Freyaday on April 28, 2011, 09:10:31 pm
It's giving me a BAD SYMBOL error! Should I send the z to its room?
Title: Re: [Axiom] LCDKit
Post by: Runer112 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)?
Title: Re: [Axiom] LCDKit
Post by: Freyaday 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?
Title: Re: [Axiom] LCDKit
Post by: Runer112 on April 28, 2011, 09:43:55 pm
Unfortunately there's no way to read the current z-address setting, so no. You might want to keep track of the z-address in your own variable.
Title: Re: [Axiom] LCDKit
Post by: Freyaday on April 28, 2011, 09:51:37 pm
Yeah, I'm doing that now. :P