Jump to content



Photo
- - - - -

new discovery !


  • Please log in to reply
5 replies to this topic

#1 Swifter

Swifter

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 04 August 2003 - 03:15 PM

I've just found out the where the curent contrast is kept in stock.
It's in the octet which the adress is 0x40:0xE5.
Here's two functions :

// This function return the current level
// of the contrast 
// Function extract from DB-Lib.h by Swifter.
unsigned char get_contrast() 
{ 
  asm{ 
       mov ax,0x40 
       mov es,ax 
       mov al,es:0xE5 
       sub al,0x12 
       shr al,0x1 
     } 
  return _AL; 
} 


// Initialize the contrast
// But stay on your guards : indeed, it could appears some compatibility troubles.
// Between the g100 and the g100+
// This function is faster than the old one cause it calls the 7Ch interruption just one time.
// Function extract from DB-Lib.h by Swifter.
void contrast(unsigned char niv) 
{ 
  asm{ 
       mov ax,0x40       
       mov es,ax         
       mov al,niv        
       shl al,0x1        
       add ax,0x2210    
       mov es:0xE5,al    
       xor bl,bl         
       int 0x7C          
     }                  
}

that's all ;p

#2 Andy.Davies

Andy.Davies

    Forum Ghost

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1547 posts
  • Gender:Male
  • Location:Dorset, England
  • Interests:Age: 18
    Studying: MEng in cybernetics at Reading uni
    Interests: Progaming (VB, VB.Net, C#, Casio Basic)
    Computers UBBD (Using, Building, Breaking & Destroying)
    Gaming (FPS, RTS, RPG)
    Electronics
    Rock Music (Preferably Loud)
    Riley's (Pool & Snooker Bar)
    Driving (Preferably fast)
    Aikedo (Martial Art)

  • Calculators:
    Algebra FX 2.0 ROM 1.01, FX9750G

Posted 04 August 2003 - 03:56 PM

i take it that is for an Algebra FX?

#3 Roeoender

Roeoender

    UCF ASM/C Programming Only Winner

  • [Legends]
  • PipPipPipPip
  • 273 posts
  • Gender:Male
  • Location:Gdynia, Poland
  • Interests:Technical University student (informatics)
    Interests:
    Sport climbing
    Orieenting (100km walk in 23h31min)
    C/Asm on calculators

    Dislike cars

  • Calculators:
    CASIO AFX 2.0 ROM 1.01, 10 countable fingers

Posted 04 August 2003 - 04:50 PM

Hello,
this is a good information, because previous grayscale games
used interrupt which only could increase/decrease contrast.
I hope that now new grayscale games will handle contrast in the
"elegant way":
remember old contrast value,
increase contrast level for the grayscale mode
return to B&W mode
restore contrast level.

BTW#1: it is good that people from france publish thier
findings here on the universal forum - we really don't understand franch or altavista's translations :D.

BTW#2: in your DB-Lib disp_bmp function was made by me not superna as it is stated in .h file, he probably just used my code (from my bmp2c demo program). This is not really important, but... :D

Roeoender.

#4 C@siomax

C@siomax

    Casio Freak

  • Members
  • PipPipPipPip
  • 229 posts
  • Location:Grenoble, FRANCE

  • Calculators:
    Graph 100 v1.0 and Graph 100+ v1.03

Posted 04 August 2003 - 04:58 PM

ha, you decided to show your routines here, that's good ;)

#5 Swifter

Swifter

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 05 August 2003 - 06:08 AM

ok...
I'll change that in the new version of DB-Lib

#6 superna

superna

    Casio Addict

  • Members
  • PipPipPip
  • 88 posts

Posted 05 August 2003 - 05:09 PM

yea sorry roenender, he took disp_bmp from casio2.h and i modified it to make it accept video pages "in the good way" lol
sure your function is the best used in the casio afx2(+) world !!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users