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

0 Members and 1 Guest are viewing this topic.

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 #30 on: November 27, 2013, 02:44:42 pm »
Dig in the zip file, there is three examples source files.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #31 on: November 27, 2013, 02:47:15 pm »
Oh I see O.O that's awesome ! +1 for full 4-lvl grayscale tilemapping engine !
« Last Edit: November 27, 2013, 02:47:35 pm by Matrefeytontias »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #32 on: November 27, 2013, 02:49:17 pm »
Oh I see O.O that's awesome ! +1 for full 4-lvl grayscale tilemapping engine !
Well, I made one too. But it's dead as of now.

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 #33 on: November 27, 2013, 03:14:30 pm »
Yeah, as long as Runer wants to do something  in Axe, you can't do better...

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #34 on: November 27, 2013, 03:40:39 pm »
Yeah, as long as Runer wants to do something  in Axe, you can't do better...
I... guess so ? XD

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 #35 on: April 25, 2014, 06:35:07 pm »
How does one write text with the small font to the screen using GrayLib?
EDIT: Is it just me or is archive/unarchive broken with GrayLib on?

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

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #36 on: April 26, 2014, 08:00:41 am »
How does one write text with the small font to the screen using GrayLib?

Assuming that you actually mean writing text to the buffers (since direct writing to the screen with the interrupt running would be promptly overwritten), you want to use included gray text printing commands. Set the °GIT (GrayLib Include Text) constant to nonzero (preferably 1) to include the string printing core routines, GStr(), GStrG(), GChar() and GCharG(), and optionally set °GIDEC (GrayLib Include DEC) to include the GDec() and GDecG() routines and/or set °GITOK (GrayLib Include TOK) to include the GTok() and GTokG() routines. Each routine expects the value of the appropriate type to be printed in r1 (or simply given if the routine is a G...G() routine) and the color code to be in r2. One slight deviation to this rule is that the token printing commands expect a pointer to the token to be printed.

Because color codes were a structure entirely of my own design, I should probably explain them a bit. The commented version does mention that a color code is of the form 0b0000FFTT, where FF is the fill color and TT is the text color. To clarify that a bit, that means that fill color is a value from 0-3 that represents the desired background color (since text printing clears the area behind it), text color is also a value from 0-3, and the two should be combined into one number of the form fill_color*4+text_color. And to be super clear, the values 0-3 represent increasingly dark colors. When using 3-level grayscale, 0 is white, 1 is gray, and both 2 and 3 are black. When using 4-level grayscale, 0 is white, 1 is light gray, 2 is dark gray, and 3 is black.

EDIT: Is it just me or is archive/unarchive broken with GrayLib on?

It's possible, I'm not really sure how well those commands handle a third-party interrupt running when they're called. It may just be necessary to temporarily disable grayscale when performing them. Simply using FnOff followed by FnOn may work well enough, but if not, use the full-blown GOff() followed by GOn().

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 #37 on: April 27, 2014, 08:29:22 am »
Thanks!
Also, I had to use GOff() and GOn(), with FnOff and FnOn it still froze my calc.

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 #38 on: April 29, 2014, 12:28:09 pm »
Didn't you mention that Graylib used L4 which is used by Archive/Unarchive commands ?

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 #39 on: April 29, 2014, 12:29:26 pm »
L4 minus something IIRC, but I made GrayLib use other RAM areas anyways.

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 #40 on: April 29, 2014, 12:36:22 pm »
Well... :blah:

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #41 on: April 29, 2014, 01:06:06 pm »
Didn't you mention that Graylib used L4 which is used by Archive/Unarchive commands ?

It's mentioned in the comment for the related constant flag that determines whether or not GrayLib should automatically assign buffer storage locations.

Online 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 #42 on: May 08, 2014, 01:22:54 pm »
Some minor issue I noticed with Graylib when setting up grayscale frequency in Reuben Quest: If the frequency is set too low on the 84+, the calc keys becomes unresponsive and you have to remove a battery.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [AXE LIBRARY] GrayLib: (nearly) perfect grayscale
« Reply #43 on: May 08, 2014, 01:28:52 pm »
It's normal because the CPU is almost 100%'d byt the interrupt. There should be a limit to prevent from getting too low or high.

Online 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 #44 on: May 08, 2014, 01:50:38 pm »
Yeah that's what I thought actually. Unfortunately, however, for some calcs this might actually be the best-looking grayscale setting, so removing that particular setting might hurt quality for some people. Maybe there could be something like a timer based on CPU usage where if you didn't press any key for a certain amount of time it exits automatically?