shiftdot515

bootmenu.of

Apr 12th, 2020
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 KB | None | 0 0
  1. \ openfirmware forth boot menu
  2. \ boot bootmenu.of
  3.  
  4. input-device input
  5. output-device output
  6.  
  7. \ stolen from quit
  8. stdout @ 0= if
  9. false to _normal-boot install-console
  10. then
  11. true to use-console? false to ignore-output? stdout-dump sign-on state
  12. off abort"-str off clearlocals false to xoff? false to xoff-filter?
  13.  
  14. decimal
  15.  
  16. : waitkey0
  17. 0 swap ( -- 0 secs )
  18. ?do
  19. (cr 2 spaces i .
  20. get-msecs ( -- starttime )
  21. begin
  22. key? ( -- starttime keyresult )
  23. dup 0<> ( -- starttime keyresult flag )
  24. if
  25. swap drop leave ( starttime keyresult -- keyresult )
  26. else
  27. drop ( starttime keyresult -- starttime )
  28. then
  29. dup ( starttime -- starttime starttime )
  30. get-msecs ( -- starttime starttime currenttime )
  31. swap ( -- starttime currenttime startime )
  32. - 1000 ( -- starttime current-start 1000 )
  33. > ( -- starttime flag )
  34. until
  35. drop ( starttime -- )
  36. -1 +loop
  37. 0
  38. ;
  39.  
  40. : waitkey1
  41. 0 swap ( -- 0 secs )
  42. ?do
  43. (cr 2 spaces i .
  44. get-msecs ( -- starttime )
  45. begin
  46. dup ( -- starttime starttime )
  47. get-msecs ( -- starttime starttime currenttime )
  48. swap ( -- starttime currenttime startime )
  49. - 1000 ( -- starttime current-start 1000 )
  50. > ( -- starttime flag )
  51. until
  52. drop ( starttime -- )
  53. key? ( -- keyresult )
  54. dup 0<> ( -- keyresult flag )
  55. if
  56. leave ( keyresult -- keyresult )
  57. else
  58. drop ( keyresult -- )
  59. then
  60. -1 +loop ( -- )
  61. 0 ( -- 0 )
  62. ;
  63.  
  64.  
  65.  
  66. : waitkey?
  67. 0 swap ( -- 0 secs )
  68. ?do
  69. (cr 2 spaces i .
  70. get-msecs ( -- starttime )
  71. begin
  72. dup ( -- starttime starttime )
  73. get-msecs ( -- starttime starttime currenttime )
  74. swap ( -- starttime currenttime startime )
  75. - 1000 ( -- starttime current-start 1000 )
  76. > ( -- starttime flag0 )
  77. key? ( -- starttime flag0 keyresult )
  78. dup ( -- starttime flag0 keyresult keyresult )
  79. 0<> ( -- starttime flag0 keyresult flag1 )
  80. rot ( -- starttime keyresult flag1 flag0 )
  81. or ( -- starttime keyresult flag )
  82. until ( starttime keyresult -- starttime keyresult )
  83. nip ( starttime keyresult -- keyresult )
  84. ?leave
  85. -1 +loop
  86.  
  87. ;
  88.  
  89.  
  90.  
  91.  
  92. blink-screen
  93. invert-screen
  94. erase-screen
  95. 12 emit
  96. \ menutop
  97. cr cr cr 10 spaces
  98. 15 0 do 176 emit loop .( Boot Menu ) 15 0 do 176 emit loop cr
  99. \ menutop
  100. 10 spaces .( [q]uit ) cr
  101. 10 spaces .( /[n]etbsd ) cr
  102. 10 spaces .( /netbsd.[o]ld ) cr
  103. 10 spaces .( [m]ac-boot ) cr
  104. 10 spaces .( [t]elnet ) cr
  105. 10 spaces .( [s]hut-down ) cr
  106. 10 spaces .( [R]eset OF ) cr
  107. \ menu bottom
  108. 10 spaces 41 0 do 176 emit loop cr
  109. begin key
  110. dup ascii q = if abort then
  111. dup ascii n = if s" boot hd:,\ofwboot.xcf hd:9,/netbsd" eval then
  112. dup ascii o = if s" boot hd:,\ofwboot.xcf hd:9,/netbsd.old" eval then
  113. dup ascii m = if mac-boot then
  114. dup ascii t = if s" enet:telnet,192.168.199.188 " io quit then
  115. dup ascii s = if shut-down then
  116. dup ascii r = if
  117. \ setenv default-router-ip 192.168.199.177
  118. \ setenv boot-command boot hd:,\bootmenu.of
  119. \ ^^^ nowork
  120. s" setenv default-router-ip 192.168.199.177" eval
  121. s" setenv boot-command boot hd:,\bootmenu.of" eval
  122. clear
  123. reset-all
  124. then
  125. drop again
  126.  
  127.  
  128.  
  129. \ oooue snowdie you're lame aren't you.
  130. \ that's right he wont be to see this bc he'll be behind a wall
  131. \ can I see the other one please, cut to the flashGorden with the cool evil bitch
  132. \ meanwhile we can enjoy both stories
  133.  
  134. \ anwyway it still works with the scraps
Add Comment
Please, Sign In to add comment