hey look at this u can use more lines n stuffby goerge (no login)use arrow keys to scroll through the text which can be larger then 25 coloums DEFINT A-Z DECLARE SUB vprint (text$) DECLARE SUB vcolor (f, b) DECLARE SUB vlocate (y, x) DIM SHARED vx, vy, vc vx = 0 vy = 0 vc = 7 SCREEN 0 CLS vprint "The VGA hardware has the ability treat the display as a window which can pan and" vprint "/or scroll across an image larger than the screen, which is used by some windowi" vprint "ng systems to provide a virtual scrolling desktop, and by some games and assembl" vprint "y demos to provide scrolling. Some image viewers use this to allow viewing of im" vprint "ages larger than the screen. This capability is not limited to graphics mode; so" vprint "me terminal programs use this capability to provide a scroll-back buffer, and so" vprint "me editors use tare you reading this shit?vide an editing screen wider than 80 c" vprint "olumns. This feature can be implemented by brute force by simply copying the por" vprint "tion of the image to be displayed to the screen. Doing this, however takes signi" vprint "ficant processor horsepower. For example, scrolling a 256 color 320x200 display " vprint "at 30 frames per second by brute force requires a data transfer rate of 1.92 meg" vprint "abytes/second. However, using the hardware capability of the VGA the same operat" vprint "ion would require a data transfer rate of only 120 bytes/second. Obviously there" vprint " is an advantage to using the VGA hardware. However, there are some limitations-" vprint "-one being that the entire screen must scroll (or the top portion of the screen " vprint "if split-screen mode is used.) and the other being that the maximum size of the " vprint "virtual image is limited to the amount of video memory accessible, although it i" vprint "s possible to redraw portions of the display memory to display larger virtual im" vprint "ages. In text mode, windowing allows panning at the character resolution. In gra" vprint "phics mode, windowing allows panning at 8-bit resolution and scrolling at scan-l" vprint "ine resolution. For more precise control, see Smooth Panning and Scrolling below" vprint ". Because the VGA BIOS and most programming environment's graphics libraries do " vprint "not support windowing, you must modify or write your own routines to write to th" vprint "e display for functions such as writing text or graphics. This section assumes t" vprint "hat you have the ability to work with the custom resolutions possible when windo" vprint "wing is used. In order to understand virtual resolutions it is necessary to unde" vprint "rstand how the VGA's Start Address High Register, Start Address Low Register, an" vprint "d Offset field work. Because display memory in the VGA is accessed by a 32-bit b" vprint "us, a 16-bit address is sufficient to uniquely identify any location in the VGA'" vprint "s 256K address space. The Start Address High Register and Start Address Low Regi" vprint "ster provide such an address. This address is used to specify eithocation of the" vprint " first character in text mode or the position of the first byte of pixels in gra" vprint "phics mode. At the end of the vertical retrace, the current line start address i" vprint "s loaded with this value. This causes one scan line of pixels or characters to b" vprint "e output starting at this address. At the beginning of the next scan-line (or ch" vprint "aracter row in text mode) the value of the Offset Register multiplied by the cur" vprint "rent memory address size * 2 is added to the current line start address. The Dou" vprint "ble-Word Addressing field and the Word/Byte field specify the current memory add" vprint "ress size. If the value of the Double-Word Addressing field is 1, then the curre" vprint "nt memory address size is four (double-word). Otherwise, the Word/Byte field spe" vprint "cifies the current memory address size. If the value of the Word/Byte field is 0" vprint " then the current memory address size is 2 (word) otherwise, the current memory " vprint "address size is 1 (byte).Normally in graphics modes, the offset register is prog" vprint "rammed to represent (after multiplication) the number of bytes in a scan line. T" vprint "his means that (unless a CGA/MDA emulation mode is in effect) scan lines will be" vprint " arranged sequentially in memory with no space in between, allowing for the most" vprint " compact representation in display memory. However, this does not have to be the" vprint " case--in fact, by increasing the value of the offset register we can leave ext" vprint "ra space between lines. This is what provides for virtual widths. By programmin" vprint "g the offset register to the value of the equation: " vprint "y demos to provide scrolling. Some image viewers use this to allow viewing of im" vprint "ages larger than the screen. This capability is not limited to graphics mode; so" vprint "me terminal programs use this capability to provide a scroll-back buffer, and so" vprint "me editors use tare you reading this shit?vide an editing screen wider than 80 c" vprint "olumns. This feature can be implemented by brute force by simply copying the por" vprint "tion of the image to be displayed to the screen. Doing this, however takes signi" vprint "ficant processor horsepower. For example, scrolling a 256 color 320x200 display " vprint "at 30 frames per second by brute force requires a data transfer rate of 1.92 meg" vprint "y demos to provide scrolling. Some image viewers use this to allow viewing of im" vprint "ages larger than the screen. This capability is not limited to graphics mode; so" vprint "me terminal programs use this capability to provide a scroll-back buffer, and so" vprint "me editors use tare you reading this shit?vide an editing screen wider than 80 c" vprint "olumns. This feature can be implemented by brute force by simply copying the por" vprint "tion of the image to be displayed to the screen. Doing this, however takes signi" vprint "ficant processor horsepower. For example, scrolling a 256 color 320x200 display " vprint "at 30 frames per second by brute force requires a data transfer rate of 1.92 meg" vcolor 12, 1 vprint "look at me hahaha" vcolor 0, 2 vlocate 5, 5 vprint "WOW look at this haha" s = 0 DO DO a$ = INKEY$ LOOP UNTIL a$ <> "" s = s - 80 * (a$ = CHR$(0) + "P") + 80 * (a$ = CHR$(0) + "H") IF s < 0 THEN s = 0 IF s > 14399 THEN s = 14399 OUT &H3D4, &HC OUT &H3D5, s \ 256 OUT &H3D4, &HD OUT &H3D5, s LOOP UNTIL INP(&H60) = 1 SYSTEM SUB vcolor (f, b) vc = b * 16 + (f AND 7) END SUB SUB vlocate (y, x) vx = x - 1 vy = y - 1 END SUB SUB vprint (text$) DEF SEG = &HB800 o& = vy * 160& + vx * 2 FOR i = 1 TO LEN(text$) POKE o& + i + i - 2, ASC(MID$(text$, i, 1)) POKE o& + i + i - 1, vc NEXT vy = vy + 1 vx = 0 END SUB |
| Response Title | Author and Date |
| Re: hey look at this u can use more lines n stuff | geogre on Dec 4 |
| QB64 runs that program fine! | on Dec 5 |
| it doesn't run it | george on Dec 5 |
| Yeah, but perhaps that can be fixed | on Dec 5 |
| also dosbox dont clear the screen on other pages so the stuff left over might stay i notic | george on Dec 5 |