home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / snip0693.zip / 132COLS.PRG next >
Text File  |  1992-09-05  |  5KB  |  144 lines

  1. ════════════════════════════════════════════════════════════════════════════════
  2.  Area:    CLIPPER
  3.  Date:    13 Aug 92  23:04:00  Public           
  4.  From:    Terry Carmen             
  5.  To:      All                      
  6.  Subject: 132 columns                                                 
  7. ────────────────────────────────────────────────────────────────────────────────
  8. I've been persuing the quest for a 132 column display in Clipper on and off for
  9. the past few weeks.
  10.  
  11. With the help of codeview, turbo debugger, some helpful folks on the Compu$erve
  12. Clipper forum, and a few miscellaineous tools, and some sneaky debugging, I've
  13. finally got it working!
  14.  
  15. Since there may be others here who would like to do neat things like view a 132
  16. column report on the screen, in one piece, I'm posting all the sordid details
  17. here 8-)
  18.  
  19. I was originally going to post it on the C$ Clipper forum also, but there is
  20. apparently a problem there. My original thread discussed how I identified and
  21. accessed some Clipper internals, and the thread mysterously disappeared the day
  22. after I started it. Go figure. It must be those bugs again 8-)
  23.  
  24. The messages are still on C$erve, but there doesn't seem to be any way to access
  25. the thread. If anybody wants to poke around, the starting message number was
  26. 245941
  27.  
  28. In any event, here's the code:
  29.  
  30. Note that mode 85 only works on VGAs. If you want to see what modes your
  31. particular adapter supports, check it's documentation, or Ralf Brown's interrupt
  32. list, under int 10h, ah=0.
  33.  
  34. Also note that selecting a mode that isn't supported by your adapter / display
  35. may cause damage to either or both, sunspots, bad karma, your girlfriend
  36. leaving, bad breath, or any other awful things. This works great for me, but all
  37. I guarantee is that if you use it, and it breaks in two, you can keep both
  38. halves.
  39.  
  40. Let me know how it works out for you!
  41.  
  42. If you don't see "*********************end of code**************" at
  43. the bottom of the message, something truncated it.
  44.  
  45.  
  46. ********************Clipper Code**********************
  47. procedure tiny             // sets up 25x132 columns on my VGA card
  48.  
  49.     videomode(85)
  50.     setmode()              // this apparently causes Clipper to
  51.                            // re-sync it's internal settings with reality
  52. return
  53.  
  54. procedure normal
  55.  
  56.  
  57.     videomode(3)              // 25x80
  58.     setmode(25,80)            // for some reason we have to
  59.     setmode(25,80)            // reinit Clipper twice to reset properly
  60.                               // setmode() just locks up the computer,
  61.                               // and a single setmode(25,80) get us
  62.                               // a 40 column display for some reason
  63. return
  64.  
  65. **************************************************
  66. ************ASM Code (TASM or MASM)***************
  67.  
  68. public  videomode
  69.  
  70. extrn   __retl:far
  71. extrn   __parni:far
  72. extrn   __parinfo:far
  73.  
  74.              CL_NUMERIC    equ 2
  75.  
  76. _prog   segment 'CODE'
  77.              assume  cs:_prog
  78.  
  79. videomode    proc    far
  80.              push bp
  81.              mov bp, sp
  82.  
  83.              ; save the regs, because the video BIOS changes
  84.              ; some of them and I'm paranoid about returning
  85.              ; changed registgers to Clipper
  86.  
  87.              push ds
  88.              push es
  89.              push si
  90.              push di
  91.              push dx
  92.              push cx
  93.              push bx
  94.              push ax
  95.  
  96.             mov ax, 0
  97.             push ax
  98.             call __parinfo
  99.             add sp, 2
  100.             cmp al, 1                 ; 1 param?
  101.             jne @@badexit
  102.  
  103.             mov ax, 1
  104.             push ax
  105.             call __parinfo
  106.             add sp, 2
  107.             cmp al, CL_NUMERIC         ; is it numeric?
  108.             jne @@badexit
  109.  
  110.             mov ax, 1
  111.             push ax
  112.             call __parni                ; get the first paramater
  113.             add sp, 2                   ; leaves video mode in ax
  114.             int 10h                     ; call the video BIOS
  115.  
  116.             ; we assume the mode change worked, since the return
  117.             ; value is adapter dependant
  118.  
  119.              mov ax, 1                  ; return .T.
  120.              jmp short @@bye
  121.  
  122. @@badexit:   mov ax, 0
  123.  
  124. @@bye:       push ax
  125.              call __retl
  126.              add sp, 2
  127.  
  128.              pop ax
  129.              pop bx
  130.              pop cx
  131.              pop dx
  132.              pop di
  133.              pop si
  134.              pop es
  135.              pop ds
  136.              pop bp
  137.              ret
  138.  
  139. videomode    endp
  140. _prog        ends
  141.              end
  142.  
  143. ********************end of code************************
  144.