<div dir="ltr"><div dir="ltr">Hi Arno,<div><div class="gmail_quote"><div dir="auto"><br></div><div dir="auto">thanks a lot for the detailed explanation! I wasn’t aware that the cg3 can use other clock frequencies besides the ones for which it has oscillators (which is just the two 1152x900 modes.) This will be fun to play with!</div><div dir="auto"><br></div><div dir="auto">In case you’re interested, I’ve included the full cg3 fcode exactly as contained in the classic obp v2.12r53 at 0x1128c+0x0c5c below. This let’s you modify it, retokenize and produce a modified prom for the classic should anyone wish to do so (and as long as you don’t increase the size of the resulting binary!)</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Malte</div><div dir="auto"><br></div><div dir="auto">\ fd 03 4ffa 00000c5c<br>fcode-version1<br>hex<br><br>offset16<br><br>" cgthree" xdrstring " name" attribute " display" device-type<br><br>headers<br><br>: copyright ( 0800 )<br> " Copyright (c) 1992 by Sun Microsystems, Inc. "<br>;<br><br>: sccsid ( 0801 )<br> " @(#)s4cg3.fth 1.11 93/03/12"<br>;<br><br>-1 value my-sbus-addr ( 0802 )<br>-1 value clk-adr ( 0803 )<br>-1 value dac-adr ( 0804 )<br>-1 value /frame ( 0805 )<br>0 value display-width ( 0806 )<br>0 value display-height ( 0807 )<br>0 value romentry ( 0808 )<br>0 value clksel ( 0809 )<br>100000 is /frame<br><br>: s4dac-map ( 080a )<br> my-sbus-addr 400000 + 20 map-sbus is dac-adr my-sbus-addr 1000 + 20<br> map-sbus is clk-adr<br>;<br><br>: s4frame-map ( 080b )<br> my-sbus-addr 800000 + /frame map-sbus is frame-buffer-adr<br>;<br><br>: s4video-map ( 080c )<br> s4dac-map s4frame-map<br>;<br><br>: s4dac-unmap ( 080d )<br> dac-adr 20 free-virtual -1 is dac-adr clk-adr 20 free-virtual -1 is<br> dac-adr<br>;<br><br>: s4frame-unmap ( 080e )<br> frame-buffer-adr /frame free-virtual -1 is frame-buffer-adr<br>;<br><br>: s4video-unmap ( 080f )<br> s4frame-unmap s4dac-unmap<br>;<br><br>: status@ ( 0810 )<br> dac-adr 11 + c@<br>;<br><br>: monitor-type@ ( 0811 )<br> status@ 4 >> 7 and<br>;<br><br>: setclk ( 0812 )<br> clk-adr c!<br>;<br><br>: clksetting ( 0813 )<br> romentry setclk<br>;<br><br>: setreg ( 0814 )<br> dac-adr + c!<br>;<br><br>: video-off ( 0815 )<br> 20 clksel or 10 setreg<br>;<br><br>: video-on ( 0816 )<br> 60 clksel or 10 setreg<br>;<br><br>-1 value toggle-colors? ( 0817 )<br><br>: setcolor ( 0818 )<br> 0 setreg swap rot 4 setreg 4 setreg 4 setreg<br>;<br><br>: s4video-blink-screen ( 0819 )<br> video-off 20 ms video-on<br>;<br><br>: s4video-remove ( 081a )<br> video-off s4video-unmap<br>;<br><br>: diag-type ( 081b )<br> diagnostic-mode?<br> if<br> type cr<br> else<br> 2drop<br> then<br>;<br><br>: frame-test ( 081c )<br> s4frame-map frame-buffer-adr /frame memory-test-suite s4frame-unmap<br>;<br><br>: s4video-selftest ( 081d )<br> " Testing Sbus framebuffer" diag-type 0 display-status ffffffff mask !<br> 0 group-code ! version 20000 <<br> if<br> frame-buffer-adr 0= frame-buffer-adr -1 = or<br> if<br> frame-test<br> else<br> " A framebuffer is in use -- no test" diag-type 0<br> then<br> else<br> frame-buffer-adr frame-test swap is frame-buffer-adr<br> then<br>;<br><br>ff000000 value foregnd ( 081e )<br>ffffff value backgnd ( 081f )<br><br>: init-fore/background ( 0820 )<br> backgnd lbsplit setcolor foregnd lbsplit setcolor<br>;<br><br>: init-colors ( 0821 )<br> 64 41 b4 1 setcolor ff h# 0 h# 0 2 setcolor ff ff h# 0 3 setcolor h# 0<br> ff h# 0 4 setcolor h# 0 ff ff 5 setcolor h# 0 h# 0 ff 6 setcolor ff<br> h# 0 ff 7 setcolor ff ff ff fe setcolor<br>;<br><br>: init-color-map ( 0822 )<br> init-fore/background init-colors<br>;<br><br>: init-dac ( 0823 )<br> 4 0 setreg ff 8 setreg 5 0 setreg 0 8 setreg 6 0 setreg 70 8 setreg 7 0<br> setreg 0 8 setreg<br>;<br><br>: oldsetcolor ( 0824 )<br> setcolor<br>;<br><br>: setcolor ( 0825 )<br> dup ff =<br> if<br> 2over 2over bljoin is foregnd<br> then<br> dup 0=<br> if<br> 2over 2over bljoin is backgnd<br> then<br> oldsetcolor<br>;<br><br>external<br><br>: r1024x768x60 ( 0826 )<br> " 08,02,37,37,03,155,21,04,39,167,0,7,60,1024,768" " 1024-768-60"<br> xdrstring " params" attribute<br>;<br><br>: r1024x768x70 ( 0827 )<br> " 08,02,37,37,03,153,21,04,37,165,0,12,70,1024,768" " 1024-768-70"<br> xdrstring " params" attribute<br>;<br><br>: r1024x768x77 ( 0828 )<br> " 06,02,36,36,03,160,21,05,41,169,0,17,77,1024,768" " 1024-768-77"<br> xdrstring " params" attribute<br>;<br><br>: r1152x900x66 ( 0829 )<br> " 05,01,36,168,03,174,22,06,46,190,0,21,66,1152,900" " 1152x900-66"<br> xdrstring " params" attribute<br>;<br><br>: r1152x900x76 ( 082a )<br> " 10,02,43,175,03,179,12,04,43,187,0,26,76,1152,900" " 1152x900-76"<br> xdrstring " params" attribute<br>;<br><br>: svga60 ( 082b )<br> r1024x768x60<br>;<br><br>: svga70 ( 082c )<br> r1024x768x70<br>;<br><br>: svga77 ( 082d )<br> r1024x768x77<br>;<br><br>headers<br><br>: sense-code ( 082e )<br> monitor-type@<br> case<br> 7 of r1152x900x66 endof<br> 6 of r1152x900x76 endof<br> 5 of r1024x768x60 endof<br> 4 of r1152x900x76 endof<br> 3 of r1152x900x66 endof<br> 0 of r1024x768x77 endof<br> drop r1152x900x66 0<br> endcase<br>;<br><br>variable dpl ( 082f )<br><br>: compare-strings ( 0830 )<br> rot tuck <<br> if<br> drop 2drop 0<br> else<br> comp 0=<br> then<br>;<br><br>: long? ( 0831 )<br> dpl @ 1 + 0<><br>;<br><br>: convert ( 0832 )<br> begin<br> 1 + dup >r c@ a digit<br> while<br> >r a * r> + long?<br> if<br> 1 dpl +!<br> then<br> r><br> repeat<br> drop r><br>;<br><br>: number? ( 0833 )<br> >r 0 r@ dup 1 + c@ 2d = dup >r - -1 dpl !<br> begin<br> convert dup c@ 2e =<br> while<br> 0 dpl !<br> repeat<br> r><br> if<br> swap negate swap<br> then<br> r> count + =<br>;<br><br>: number ( 0834 )<br> number? drop<br>;<br><br>: /string ( 0835 )<br> over min >r swap r@ + swap r> -<br>;<br><br>: +string ( 0836 )<br> 1 +<br>;<br><br>: -string ( 0837 )<br> swap 1 + swap 1 -<br>;<br><br>: left-parse-string ( 0838 )<br> >r over 0 2swap<br> begin<br> dup<br> while<br> over c@ r@ =<br> if<br> r> drop -string 2swap exit<br> then<br> 2swap +string 2swap -string<br> repeat<br> 2swap r> drop<br>;<br><br>: left-parse-string' ( 0839 )<br> left-parse-string 2 pick 0=<br> if<br> 2swap<br> then<br>;<br><br>: cindex ( 083a )<br> 0 swap 2swap bounds<br> ?do<br> dup i c@ =<br> if<br> nip i -1 rot leave<br> then<br> loop<br> drop<br>;<br><br>: right-parse-string ( 083b )<br> >r 2dup + 0<br> begin<br> 2 pick<br> while<br> over 1 - c@ r@ =<br> if<br> r> drop rot 1 - -rot exit<br> then<br> 2swap 1 - 2swap swap 1 - swap 1 +<br> repeat<br> r> drop<br>;<br><br>100 alloc-mem constant tmp-monitor-string ( 083c )<br>100 alloc-mem constant tmp-pack-string ( 083d )<br>variable tmp-monitor-len ( 083e )<br><br>external<br><br>: monitor-string ( 083f )<br> tmp-monitor-string tmp-monitor-len @<br>;<br><br>headers<br><br>: parse-line ( 0840 )<br> f 0<br> do<br> 2c left-parse-string tmp-pack-string pack dup number swap drop -rot<br> dup 0=<br> if<br> leave<br> then<br> loop<br> 2drop<br>;<br><br>: cal-tim ( 0841 )<br> is display-height is display-width xdrint " vfreq" attribute dup is<br> romentry xdrint " romentry" attribute dup is clksel xdrint<br> " oscillator" attribute 1e 14<br> do<br> i setreg<br> loop<br> ff 1e setreg h# 1 1f setreg<br>;<br><br>external<br><br>: update-string ( 0842 )<br> 2dup tmp-monitor-string swap move dup tmp-monitor-len !<br>;<br><br>headers<br><br>: set-fbconfiguration ( 0843 )<br> update-string parse-line cal-tim<br>;<br><br>external<br><br>: set-resolution ( 0844 )<br> $find<br> if<br> execute<br> then<br> set-fbconfiguration 8 dup xdrint " depth" attribute display-width * 8 /<br> xdrint " linebytes" attribute display-width xdrint " width" attribute<br> display-height xdrint " height" attribute<br>;<br><br>headers<br><br>: cg3-display-init ( 0845 )<br> clksetting 200 ms init-dac init-color-map<br>;<br><br>: cg3-toggle-cursor ( 0846 )<br> fb8-toggle-cursor toggle-colors?<br> if<br> init-fore/background<br> then<br>;<br><br>external<br><br>: reinstall-console ( 0847 )<br> display-width display-height over char-width / over char-height /<br> fb8-install<br>;<br><br>headers<br><br>: cg3-install ( 0848 )<br> default-font set-font s4video-map my-args dup 0<><br> if<br> set-resolution<br> else<br> 2drop tmp-monitor-len @ 0=<br> if<br> sense-code set-resolution<br> else<br> monitor-string set-resolution<br> then<br> then<br> video-off c xdrint " cursorshift" attribute frame-buffer-adr xdrint<br> " address" attribute reinstall-console<br> ['] s4video-blink-screen is blink-screen<br> ['] video-on is reset-screen cg3-display-init<br> ['] cg3-toggle-cursor is toggle-cursor<br>;<br><br>: cg3-probe ( 0849 )<br> my-address is my-sbus-addr my-sbus-addr my-space 1000000 reg 5 0 intr<br> s4video-map monitor-type@ xdrint " monitor-sense" attribute sense-code<br> set-resolution video-off cg3-display-init s4video-unmap<br> ['] cg3-install is-install<br> ['] s4video-remove is-remove<br> ['] s4video-selftest is-selftest<br>;<br><br>cg3-probe<br><br>end0</div><div dir="auto"><br></div></div></div>
</div></div>