Author Topic: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale  (Read 29756 times)

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
[AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« on: August 30, 2013, 11:13:32 pm »
The latest version is attached at the bottom of this post.


GrayLib v1.0


== BASICS ==

What is GrayLib? GrayLib is an Axe library, designed for Axe 1.2.1, to provide nearly perfect grayscale and tons of useful related functions to Axe programmers with extensive customizability.


== FEATURES ==

  • Tunable crystal timer-based grayscale for non-83+ calculators. Nearly perfect!
  • Tunable slower hardware-timer based grayscale as a fallback for 83+ calculators. Still looks very good!
  • Supports either 3-level or 4-level grayscale.
  • A buffered approach to avoid any frame mixing when rendering new frames.
  • Automatic setting loading and saving from/to an archived variable.
  • Includes a default contrast and grayscale timing tuner which can automatically start on the first run.
  • Masked sprite drawing for both 3- and 4-level grayscale. (Axe's built-in Pt-Mask() command can only draw to a set buffer pair, which is no good for a buffered approach)
  • Text routines to print integers, tokens, strings, and characters in any foreground/background grayscale color combination.
  • Support for hooks in the grayscale update interrupt, which can optionally replace the default grayscale update command.
  • Support for using getKey like normal, despite the OS interrupt not running.


== EXAMPLE PROGRAMS ==

To get a basic idea for how to use GrayLib, I have created a few example programs. One is a very basic wrapper for the default tuner, one is a screensaver-style bouncing text program, and one is a fairly complicated recreation of the movement engine from the first-generation Pokemon games, set in Pallet Town. Every example program comes in two forms: a smaller version, which contains just the code, and a larger "Commented" version. The commented versions contain detailed comments explaining exactly how each piece of the code works, and can be good resources for both learning how to use GrayLib and simply learning Axe coding approaches and tricks.

Spoiler For Animated screenshots!:
83+
84+
GRAYTUNE
GRAYTUNE
GRAYTEXT
GRAYTEXT
GRAYPKMN
GRAYPKMN

They look less flickery on real calculators, although more blurry.


== LEARNING TO USE GRAYLIB ==

GrayLib itself also comes in a small version and a commented version. The small version is good to store on your calculator if you don't need a reference on your calculator about how to use the library. Whether or not you want to store the commented version on your calculator, THE COMMENTED VERSION IS CRUCIAL TO LEARNING THE MYRIAD OPTIONS AND COMMANDS IN GRAYLIB.


== FEEDBACK ==

If you have any questions, comments, concerns, feature requests, or bug reports, make a post here and I (or somebody else who knows the library) will try to reply as soon as possible!


== CHANGELOG ==

1.0 (August 31, 2013)
  • Initial release.
« Last Edit: May 13, 2017, 05:03:59 pm by Runer112 »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #1 on: August 31, 2013, 02:22:00 am »
Pretty awesome, nice job!
* Sorunome expects more grescale axe games now :P

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #2 on: September 01, 2013, 05:31:47 am »
Wait so it's written in Axe ? O.O I thought it was an Axiom. Awesome job Runer !

Offline nikitouzz

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 215
  • Rating: +22/-1
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #3 on: September 01, 2013, 05:40:46 am »
awesome runer :D
mes records personels :

2x2x2 : 2.18 secondes / 2x2x2 une main : 21.15 secondes / 2x2x2 yeux bandés : 47.59
3x3x3 : 5.97 secondes / 3x3x3 une main : 49.86 secondes
4x4x4 : 1.49 minutes / 4x4x4 une main : 6.50 minutes
5x5x5 : 4.10 minutes / 5x5x5 une main : 18.02 minutes
6x6x6 : 8.10 minutes
7x7x7 : 16.03 minutes
9x9x9 : 58.26 minutes

megaminx : 5.59 minutes / pyraminx : 7.91 secondes / square-one : 1.07 minutes

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #4 on: September 01, 2013, 07:49:49 am »
Looks great Runer! :D

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #5 on: September 01, 2013, 10:38:27 am »
Wait so it's written in Axe ? O.O I thought it was an Axiom. Awesome job Runer !

Axioms unfortunately don't offer the customizability that can be achieved by using constants as options, which is why I chose to go with a regular Axe library. Almost all of the code is actually Axe and not assembly anyways. :)

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #6 on: September 01, 2013, 10:41:46 am »
Wait, what? O.O
That makes it even more awesome O.O

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #7 on: September 01, 2013, 12:41:20 pm »
Wait so it's written in Axe ? O.O I thought it was an Axiom. Awesome job Runer !

Axioms unfortunately don't offer the customizability that can be achieved by using constants as options, which is why I chose to go with a regular Axe library. Almost all of the code is actually Axe and not assembly anyways. :)

Hmm... interesting. I guess you would be able to make it quite optimized though, due to how familiar you are with the source. :P

Offline XiiDraco

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 513
  • Rating: +32/-5
  • Forget the numbers, just call me, Recreation.
    • View Profile
    • Black-Lark Games
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #8 on: September 02, 2013, 01:02:41 am »
This looks awesome! Now if I only knew how to use it...

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #9 on: September 02, 2013, 03:01:46 am »
This looks awesome! Now if I only knew how to use it...

Well, try perusing the commented version of GrayLib with some computer 8xp viewer and check out the option constants and functions, which should all have comments explaining what they do. Also, check out the examples I provided, which should show a few examples of how a program interfaces with the library. If you have questions after that, I can answer them here. :)
« Last Edit: September 02, 2013, 03:02:34 am by Runer112 »

Offline pimathbrainiac

  • Occasionally I make projects
  • Members
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1731
  • Rating: +136/-23
  • dagaem
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #10 on: September 02, 2013, 12:39:30 pm »
I thanketh thee very much. Also: thanks for putting up with my badgering, I'm sorry about that.
I am Bach.

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: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #11 on: September 02, 2013, 04:18:59 pm »
Wow pretty nice! It's impressive too that you managed to get such quality grayscale in Axe and 4 level too.

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: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #12 on: September 10, 2013, 05:21:06 am »
That is beautiful. Any chance for an 8-level (or higher) version?

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #13 on: September 10, 2013, 07:50:35 am »
pimath made one here: http://ourl.ca/19535

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #14 on: September 10, 2013, 09:33:15 am »
Okay, I made him crash forever. I tried to set the darkest contrast setting I vould get, aaaand, GTune() now crash my calc! :D