home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / mag_discs / volume_1 / issue_02 / minidump5 < prev    next >
Text File  |  1987-10-18  |  2KB  |  74 lines

  1.  
  2. ├O.⌠ > MiniDump5 : A self-contained function.
  3. ├P#▌ ñminidump(margin%,threshold%)
  4. ├Z⌠ The BASIC version.
  5. ├d:
  6. ├n:
  7. ├x9τ margin%>79 ä threshold%>255 î =ú :⌠ Bad parameters.
  8. Â:
  9. Ì:
  10. ├ûEΩ left%,bottom%,right%,top%,xorigin%,yorigin%,xconvert%,yconvert%
  11. ├á=Ω line%,x%,points%,pixel%,printcode%,strike%,colour%,vdu%
  12. ê
  13. ▐ vdu% 39
  14. ├┤:
  15. ├╛:
  16. ├╚!(vdu%+ 0)=  4
  17. ├╥!(vdu%+ 4)=  5
  18. ├▄!(vdu%+ 8)=128
  19. ├µ!(vdu%+12)=129
  20. ├≡!(vdu%+16)=130
  21. ├·!(vdu%+20)=131
  22. ─!(vdu%+24)=136
  23. ─!(vdu%+28)=137
  24. ─!(vdu%+32)=-1
  25. ─"&╚Ö "OS_ReadVduVariables",vdu%,vdu%
  26. ─,xconvert%=!(vdu%+ 0)
  27. ─6yconvert%=!(vdu%+ 4)
  28. ─@left%    =!(vdu%+ 8)
  29. ─Jbottom%  =!(vdu%+12)
  30. ─Tright%   =!(vdu%+16)
  31. ─^top%     =!(vdu%+20)
  32. ─hxorigin% =!(vdu%+24)
  33. ─ryorigin% =!(vdu%+28)
  34. ─|:
  35. ─å:
  36. ─ÉHleft%  =      (left%<<xconvert%)-xorigin%    :⌠ These are the screen
  37. ─ÜGright% = ((right%+1)<<xconvert%)-xorigin%-1  :⌠ co-ordinates of the
  38. ─ñHbottom%=    (bottom%<<yconvert%)-yorigin%    :⌠ the graphics window.
  39. ─«3top%   =   ((top%+1)<<yconvert%)-yorigin%-1  :⌠
  40. ─╕:
  41. ─┬:
  42. ─╠Ipoints%=(right%-left%+1)ü4  :⌠ The number of printed points per line.
  43. ─╓:
  44. ─α:
  45. ─Ω%⌠ *FX 3,10 sends to printer only.
  46. ─⌠ *FX 3,10
  47. ─■/∩ 27,64          :⌠ Initialise the printer.
  48. ┼=∩ 27,65,8        :⌠ 8/72" line spacing = 8 dots per line.
  49. ┼/∩ 27,108,margin% :⌠ Left margin is margin%.
  50. ┼:
  51. ┼&:
  52. ┼0 π line%=top% ╕ bottom% ê -32
  53. ┼:9∩ 27,42,5,points%â&100,points%ü&100:⌠ Printer mode 5.
  54. ┼Dπ x%=left% ╕ right% ê 4
  55. ┼NCprintcode%=0       :⌠ Initialise the value sent to the printer.
  56. ┼X9π pixel%=7 ╕ 0 ê -1 :⌠ Assemble 'colour' of 8 pixels.
  57. ┼bDcolour%=░x%,line%-28+(pixel%<<2))       :⌠ If colour% is greater
  58. ┼lHprintcode%+=(-(colour%>threshold%))<<pixel%  :⌠ than threshold% then
  59. ┼v=φ pixel%                                  :⌠ print a dot.
  60. ┼ÇF∩ printcode%    :⌠ One printhead strike prints a column of 8 dots.
  61. ┼èφ x%
  62. ┼ö5∩ 10,13         :⌠ Line feed and carriage return.
  63. ┼₧ φ line%
  64. Ũ:
  65. ┼▓:
  66. ┼╝!∩ 12            :⌠ Form feed.
  67. ┼╞)∩ 27,64         :⌠ Reset the printer.
  68. ┼╨:
  69. ┼┌1⌠ *FX 3,0 restores output to the screen only.
  70. ┼Σ *FX 3,0
  71. ┼ε:
  72. ┼°=╣
  73. ╞:
  74.