Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 12:17:24 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Near flickerless grayscale without crystal timers -  (Read 340 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Hot_Dog
If you can't find a cat, look for its tail.
Support Staff
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 21:08:05
Date Registered: 28 December, 2009, 18:47:54
Location: Midland, Washington
Posts: 2940


Topic starter
Total Post Ratings: +428

View Profile
« on: 25 April, 2012, 20:22:19 »
0

Thepenguin77's perfect grayscale used crystal timers for flickerless grayscale because data could be copied to the screen at a consistent rate.  Is there a technique to make things nearly flickerless without using the crystal timers?  Like is there a technique using interrupts?
Logged

There are people who can speak two languages, and they are called bilingual.  There are people who speak three languages and are therefore trilingual.  Then there are people who speak one language, and these people are called Americans.

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 07:31:30
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50214


Total Post Ratings: +2613

View Profile WWW
« Reply #1 on: 25 April, 2012, 20:31:25 »
0

I'M sure Jim e managed to do it, same for Duck back in the days. However, the problem is that it looked bad on 15 MHz calculators and one technique required the user to manually calibrate the grayscale by choosing between 4 presets before running his program.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Art_of_camelot
The matrix has you.. ಠ_ಠ
Support Staff
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 11:15:31
Date Registered: 30 August, 2008, 04:55:55
Location: Dr. Light's Laboratory
Posts: 4391


Total Post Ratings: +149

View Profile WWW
« Reply #2 on: 25 April, 2012, 20:59:43 »
0

DJ_O is correct. Jim E and Ducks package both did it, and both use interrupts. Jim's is more up to date and is largely based on Duck's work. Tr1plea also has quite a lot of experience with grayscale using interrupts, many consider him a guru as well. As he's still around I think I'd ask him. Smiley Although the grayscale did look worse on the 15mhz models, it was still acceptable IMHO. You could actually write separate routines for each model. Jim E's and duck's only utilized 6Mhz.
Logged

Projects:
TBA! Coming to an 83+ near you!

NerdTests.com says I'm a Cool Nerd King.  Click here to take the Nerd Test, get nerdy images and jokes, and write on the nerd forum!


Geekboy1011
The Oneironaut
Support Staff
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 07:50:48
Date Registered: 11 June, 2009, 01:27:44
Location: Buried in cherry flavored source code
Posts: 1500


Total Post Ratings: +88

View Profile
« Reply #3 on: 25 April, 2012, 22:31:21 »
0

Its really just adjusting the interupts so it looks good. The issue with it tho is unlike the timers you only get rough timeslices which make it occasionally not perfect
Logged

Yumé - The Eternal Dreams(tsukasaZX's project): music making working on second piece
PROJECT:TiX - planning stages almost done few more things to think about then i start coding so coding should commence tommorow or the NULL of NULL yay
Project/Mod Cadan: CD  -   My (first?!?) mod of the cadan engine for a not so demoified version of the game : HOLD :Is here
Beta testing: -  Correlation: Wordwrap abuse IF Adventure style
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Yesterday at 18:56:03
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1484


Total Post Ratings: +778

View Profile
« Reply #4 on: 26 April, 2012, 00:35:34 »
0

I was so excited when I saw this topic. But it was a question...

Anyways, I've thought about this, but I've never actually done it. Here's how I think you'd go about it.
1. Set interrupts to the fastest speed that is consistent (For this, I'd go with timer two at 1120Hz)
2. Determine how many t-states take place between interrupts.

Then we get into the actual code. The goal of your interrupt system would be to ignore what the calculator interrupt system is doing and to make your own interrupts that run at 60Hz. The way you'd go about it is this:
1. Find the number of t-states it takes to get the interrupt frequency you want (this is a constant actually and doesn't need to be exact, we'll call 83+'s 6MHz, so 6MHz/60 = 100,000.
2. int(100,000 / (t-states per interrupt)) will get you the number of interrupt cycles to wait. So when these interrupts occur, just quickly return.
3. After those interrupts have expired, take the remaining t-states (100,000 - (cycles waited)*(t-states per interrupt)) and wait that long (in the interrupt).
4. After you've waited, start an LCD copy

5. Then you'd just repeat this process, keeping in mind that next time, you aren't starting cleanly on the beginning of an interrupt.

So an example, let's say that you find your calculator to run with 5,360 t-states per interrupt. To achieve the goal of 100,000, you'd need to wait 18 interrupt cycles and then 3,520 t-states in the 18th interrupt. At this point you'd fire the LCD copy.

Now it gets more involved when you calculate the next virtual interrupt, you have to remember that the interrupt system didn't wait for you, this means that the first interrupt is going to happen in 1,840 t-states. So with that information, you are going to need to dispatch 19 interrupts waiting 1,680 t-states in the 19th.

Then you'd just repeat this simple process over and over. To adjust the frequency, just take that goal 100,000 and adjust it to whatever you want. Higher goals will lower the frequency and lower goals will raise the frequency.




« Last Edit: 26 April, 2012, 00:37:53 by thepenguin77 » Logged

zStart v1.3.011 4-29-2013  zStart fully works on 83+BE's (except custom font)
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
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.176 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.