Changeset 3476
- Timestamp:
- Dec 6, 2012 11:11:22 PM (6 months ago)
- File:
-
- 1 edited
-
dev/edid.fth (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dev/edid.fth
r3475 r3476 255 255 end-string-array 256 256 257 false value 1080p-support? 257 258 false value 1080p-native? 259 false value 720p-native? 258 260 : .cea-video ( offset size -- ) 259 false to 1080p-native?261 false to 720p-native? false to 1080p-native? false to 1080p-support? 260 262 ." CEA/HDMI Modes: " 261 263 bounds ?do … … 263 265 dup h# 80 and if ( code ) 264 266 ." *" h# 7f and ( index ) 267 dup d# 4 = if true to 720p-native? then 265 268 dup d# 16 = if true to 1080p-native? then 266 269 then ( index ) 267 short-names count type space ( ) 270 dup d# 16 = if true to 1080p-support? then 271 short-names count type space ( ) 268 272 loop 269 273 cr … … 343 347 ; 344 348 : dump-edid ( adr len -- ) 345 drop to the-edid 349 0= if drop exit then ( adr ) 350 to the-edid 346 351 the-edid " "(00ffffffffffff00)" comp if 347 352 ." Not an EDID" cr … … 353 358 .extensions 354 359 ; 355 : .hdmi ( -- ) 360 \ Wait for an HDMI monitor to be connected 361 : wait-hdmi ( -- ) 356 362 " hdmi-present?" $call-screen 0= if 357 363 ." Connect an HDMI monitor ..." … … 359 365 cr 360 366 then 367 ; 368 : get-hdmi-edid ( -- adr len ) 361 369 " /hdmi-ddc" open-dev dup if ( ih ) 362 370 " edid$" 2 pick $call-method ( ih adr len ) 363 371 rot close-dev ( adr len ) 364 dump-edid 372 else 373 " " 365 374 then 375 ; 376 : choose-hdmi-resolution ( -- ) 366 377 ." Turning on monitor at " 367 1080p-native? if ." 1080p" 1080p else ." 720p" 720p then cr 378 1080p-native? if ." 1080p" 1080p else \ First choice 379 720p-native? if ." 720p" 720p else \ Second choice 380 1080p-support? if ." 1080p" 1080p else \ No native, use 1080p if supported 381 ." 720p" 720p ." (guess)" \ Fallback 382 then then then 383 cr 384 ; 385 : .hdmi ( -- ) 386 wait-hdmi 387 get-hdmi-edid dump-edid 388 choose-hdmi-resolution 368 389 ; 369 390
Note: See TracChangeset
for help on using the changeset viewer.
