Author Topic: 16-Level Grayscale  (Read 39436 times)

0 Members and 2 Guests are viewing this topic.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: 16-Level Grayscale
« Reply #45 on: July 09, 2010, 06:28:40 pm »
What's the best pattern for 8 level grayscale. I realize it is in 7ths.

Currently I'm using:
Code: [Select]
10101100
00010010
01000000
Where bit 1 bleeds into 0. So line 2 is actually 00010011.

I'm trying different orders, but I get a pretty nasty waterfall effect.
« Last Edit: July 09, 2010, 06:39:11 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

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: 16-Level Grayscale
« Reply #46 on: July 09, 2010, 07:40:48 pm »
I wonder, would grayscale look better if we updated the screen by rows instead of columns?
Not on the regular 83+ for sure, due to this.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: 16-Level Grayscale
« Reply #47 on: July 09, 2010, 07:55:09 pm »
Well, I'm talking about the order that the bytes of pixel data are sent to the LCD ram. Usually (in most asm games) it is done like this:

| ↓ | ↓ | ↓ | ↓ |
| ↓ | ↓ | ↓ | ↓ |
| ↓ | ↓ | ↓ | ↓ |
| ↓ | ↓ | ↓ | ↓ |


I am suggesting that perhaps it should go like this, to better match how the screen updates itself:
| → | → | → | → |
| → | → | → | → |
| → | → | → | → |
| → | → | → | → |
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Madskillz

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 488
  • Rating: +32/-2
    • View Profile
Re: 16-Level Grayscale
« Reply #48 on: July 09, 2010, 07:59:27 pm »
hmm...I would be curious to see how that works as well. You would think it would look better because the lcd starts from the bottom left to right and continues the pattern of moving left to right.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: 16-Level Grayscale
« Reply #49 on: July 09, 2010, 08:56:03 pm »
Results are in. Grayscale looks better when you update by rows instead of columns. When you update by column, there is a diagonal glitch that is always scrolling on the screen. But when you update by row, it goes off screen and stays off for about 3/4 of it's cycle.

The lcd definitely updates from top to bottom. When I updated from bottom to top, I noticed that there were two glitch lines instead of one, when I switched to updating top down. There was only one glitch line that went off screen for a few seconds.

But I must say my 8 level viewer looks really nice. Here is the program with some test pics so you can see how it looks. It's easiest to see what I am talking about in gradient.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: 16-Level Grayscale
« Reply #50 on: July 09, 2010, 09:01:49 pm »
Nice finds, I'll have to keep that in mind. Can't wait to try out the viewer! :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

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: 16-Level Grayscale
« Reply #51 on: July 09, 2010, 09:26:14 pm »
Nice stuff, but lol at test zzzz :P

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: 16-Level Grayscale
« Reply #52 on: July 09, 2010, 09:31:03 pm »
thepenguin: can we have a program to calibrate to our LCD? Because the grey displays flashing patterns on mine. Otherwise, awesome. ;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: 16-Level Grayscale
« Reply #53 on: July 09, 2010, 09:50:02 pm »
Mmmm.. That's harder than it sounds. I assume you have never needed alcdfix before then?

Before I incorporate it into the program we need to find your refresh rate.

Run this program. Keep pressing - until the image slows down and stops, or at least comes close. If you found the right spot, it will be one image and it won't repeat itself. You will also know you found it because it will slowly work it's way down to where it stops, it won't just stop all at once.

Once you found it, press / and it will tell you a number. Mine is 153. So yours should be around there. If you happen to find one in the 70s, skip it because it is double the refresh rate.

Then run spedTest because I have to know your cpu speed. Refresh runs too fast for the crystal timers.

zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

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: 16-Level Grayscale
« Reply #54 on: July 09, 2010, 10:02:04 pm »
Old grayscale games on ticalc.org had an intro screen asking you to choose an interrupt frequency speed. Some frequencies showed better quality but slower speed and others lower quality and higher speed. It depended of the calc, though. It was one of the very first 4 level gray routine, though, and not the most optimized stuff, since it was the first time.
« Last Edit: July 09, 2010, 10:02:56 pm by DJ Omnimaga »

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: 16-Level Grayscale
« Reply #55 on: July 10, 2010, 09:59:04 am »
For REFRESH I got 139, and SPEDTEST gives me ~15877000 Hz for cpu speed, and 219 FPS for LCD speed.
Edit: 450th post!
« Last Edit: July 10, 2010, 10:00:00 am by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: 16-Level Grayscale
« Reply #56 on: July 10, 2010, 01:41:56 pm »
No surprise there, you have a good lcd and it updates the screen faster. 65.8 fps actually. I don't know why I had you find those numbers that way, there is a much better way. (I had a long time to think while caddying today.)

I have to do a few things and I will have a nice program that tells you your screen type, and the fps you need. From that I can make a table of different lcd types so that my grayscale games will be boss. :)

One of those things I have to do is to calculate the frequency of the crystal timers on 40h because I don't think what's on wiki ti is correct.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: 16-Level Grayscale
« Reply #57 on: July 10, 2010, 01:49:31 pm »
Cool, if you (and we, if you share your methods ;D) can make 8-level greyscale games that are almost completely flickerless, that will be awesome :D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: 16-Level Grayscale
« Reply #58 on: July 10, 2010, 03:47:19 pm »
Alright, here is the program that will tell me all I need to know. The more people that run this one, the better people will be able to make grayscale games in the future. You will also experience flickerless grayscale! with an occasional glitch line.

Just run gray4, press plus and minus to adjust the delay, and when you finally get the scrolling line to stop, (or come close), you will have the info that I need. So press second and tell me what you got.

And to avoid any secrecy, the Driver number is what I sent to port $29 to fix the lcd, (alcdfix), and Refresh is the value I am sending to port $32 with port $30 set to $40 (10922.667 hz). I am hoping that the different values sent to $29 will be enough to tell the different drivers apart so that the specific delay for each one can be used.

Oh, and wiki ti was perfectly correct.

Edit:
    I use 178 for mine. Doing a little bit of proportions, you should need about 163. Also, my delay is 44, yours is probably in the teens.
« Last Edit: July 10, 2010, 03:56:01 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: 16-Level Grayscale
« Reply #59 on: July 10, 2010, 04:16:55 pm »
12 and 162.
The problem is, if I move my eyes up the screen at just the right rate, I can see lots of moving lines... If I double the refresh rate, though, to ~70, that problem is alleviated.
Edit: No, to exactly 70. At both settings, however, the glitch lines move at an annoyingly low speed. Otherwise, cool! :)
« Last Edit: July 10, 2010, 04:20:28 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.