Author: wmb Date: 2009-04-18 21:11:32 +0200 (Sat, 18 Apr 2009) New Revision: 1150
Modified: cpu/x86/pc/biosload/c32vesa.fth cpu/x86/pc/biosload/callvbe.fth Log: VESA BIOS support - added a word to display the VESA mode list
Modified: cpu/x86/pc/biosload/c32vesa.fth =================================================================== --- cpu/x86/pc/biosload/c32vesa.fth 2009-04-18 19:10:08 UTC (rev 1149) +++ cpu/x86/pc/biosload/c32vesa.fth 2009-04-18 19:11:32 UTC (rev 1150) @@ -96,7 +96,7 @@ d# 12 # sp add [then]
-[ifndef] notdef-modemap +[ifdef] notdef-modemap \ Registers: \ edx: pointer to register array for calling the gateway function \ ebp: address of gateway function
Modified: cpu/x86/pc/biosload/callvbe.fth =================================================================== --- cpu/x86/pc/biosload/callvbe.fth 2009-04-18 19:10:08 UTC (rev 1149) +++ cpu/x86/pc/biosload/callvbe.fth 2009-04-18 19:11:32 UTC (rev 1150) @@ -70,7 +70,23 @@ h# 4f00 vbe-call h# 200 +c32-regs ( adr ) ; -: .vesa-modes ( -- ) +: vesa-mode-info ( mode# -- adr ) + 'c32-cx l! ( ) + h# 200 +c32-regs c32-es:di! ( ) + h# 4f01 vbe-call ( ) + h# 200 +c32-regs ( adr ) +; +: .vesa-mode-info ( mode# -- ) + push-hex dup 3 u.r space + vesa-mode-info >r ( r: adr ) + decimal + r@ h# 12 + w@ (.) type + ." x" r@ h# 14 + w@ (.) type + ." x" r@ h# 19 + c@ (.) type cr + r> drop + pop-base +; +: .vesa-mode-list ( -- ) vbe-info ( adr ) dup l@ h# 41534556 <> if ( adr ) ." VBE info call failed" cr @@ -80,12 +96,26 @@ d# 14 + seg:off@ ( 'mode-list ) begin dup w@ dup h# ffff <> while . wa1+ repeat cr 2drop ; -: vesa-mode-info ( mode# -- adr ) - 'c32-cx l! ( ) - h# 200 +c32-regs c32-es:di! ( ) - h# 4f01 vbe-call ( ) - h# 200 +c32-regs ( adr ) + +: #vesa-modes ( 'mode-list -- n ) + 0 begin over w@ dup h# ffff <> while ( 'mode-list n mode# ) + drop swap wa1+ swap 1+ ( 'mode-list n' ) + repeat ( 'mode-list n mode# ) + drop nip ( n ) ; +: .vesa-modes ( -- ) + vbe-info ( adr ) + dup l@ h# 41534556 <> if ( adr ) + ." VBE info call failed" cr + drop exit + then ( adr ) + dup 6 + seg:off@ .cstr cr ( adr ) + d# 14 + seg:off@ ( 'mode-list ) + dup #vesa-modes 1+ ( 'mode-list #modes ) + /w* dup alloc-mem ( 'mode-list modes-len adr ) + dup >r swap move r> ( adr ) + begin dup w@ dup h# ffff <> while .vesa-mode-info wa1+ repeat cr 2drop +;
[ifdef] Commentary 00.w mode attributes @@ -137,3 +167,6 @@ [then]
: current-vesa-mode ( -- mode# ) h# 4f03 vbe-call 'c32-bx l@ ; +: set-vesa-mode ( mode# -- ) 'c32-bx w! h# 4f02 vbe-call ; +: set-linear-mode ( mode# -- ) h# 4000 or set-vesa-mode ; +: vesa-lfb-adr ( mode# -- padr ) h# 4000 or vesa-mode-info h# 28 + l@ ;