Gury Posted December 7, 2009 Share Posted December 7, 2009 (edited) Hello Atarians, In this topic I will present some ways of clearing the screens. Most of the included listings can be modified for any graphics or text mode. Program examples are written in Atari BASIC, with DATA lines incorporating machine language routines. These routines can be examined in link references below. The material is taken from Moj Mikro magazine issue number 2/1989 and the author of the listings is Zlatko Bleha. All listings can be found here. Before using please unzip file in directory of your choice. This file is ATR image file, which can be used with any Atari emulator and its disk drive capability for example. It is formatted as a single density disk, with Atari DOS 2.75 installed. To load and run the programs you must have BASIC turned on (XL/XE), or Atari BASIC cartridge plugged (400/800/1200XL). Listing: Clear screen 1 This is one of the easiest effective ways of clearing the whole screen. Every byte in video RAM shifts right. After one such cycle of the shift the high bit of every byte in the video RAM is reset (cleared). Repeating this process 8 times we will clear whole byte. Considering that process is done on all bytes in video RAM, the whole screen will be cleared. The program can be modified to shift data left. An example is using graphics mode 8. Load instructions: LOAD "D:M8902261.BAS RUN Listing: Clear screen 2 This demonstration shows another way of clearing the screen by moving alternating lines to the edge of opposite side. The implemented routine is little more complicated than the one from the first example, considering the process involved. Program consists of main loop and three subroutines LDIR, LDDR and ADD40, which task is to move screen rows to left or right side and increase the address of video RAM. This routine can be used in any graphics or text mode with changing of the parameter for the rows affected. The example here is using graphics mode 8. Load instructions: LOAD "D:M8902262.BAS RUN Following example uses the same routine for clearing the screen, but in text mode (graphics mode 0). Load instructions: LOAD "D:M8902263.BAS RUN Listing: Clear screen 3 In this demonstration the screen is disappearing line by line, beginning at the top of the screen (first line scrolls left, next to right, and so on). The example uses text mode (graphics mode 0) and opposed to the previous example, the routine uses delay instructions to slow down the process of clearing the screen, because without it, the effect could not be even noticed. The clearing process in graphics mode 0 is probably too fast, but it will run normally in graphics mode 8, for example. Try to experiment with this delay in different graphics modes for best results. Load instructions: LOAD "D:M8902264.BAS RUN Listing: Clear screen 4 Another demonstration, which simulates curtains on the stage. The whole screen scrolls from the center to the edges until the picture disappears. Load instructions: LOAD "D:M8902265.BAS RUN Listing: Clear screen 5 This example demonstrates clearing the screen in two stages. It works in the following manner: First line moves to the second line, zeroing the first line. Third line moves to the fourth line, and so on... After first stage, the picture on the screen will be repositioned. The second stage will clear the screen. This example uses graphics mode 8, which is recommended mode for the routine used. The process would be too fast in graphics modes with lower resolution, so you would have to put some delay instructions to slow it down. Load instructions: LOAD "D:M8902266.BAS RUN Here is the actual article from Moj Mikro with included assembly language routine listings: http://retrospec.sgn.net/users/tomcat/yu/magshow.php?auto=&page=26&all=MMH_89_02 http://retrospec.sgn.net/users/tomcat/yu/magshow.php?auto=&page=27&all=MMH_89_02 http://retrospec.sgn.net/users/tomcat/yu/magshow.php?auto=&page=28&all=MMH_89_02 Greetings, Gury moj_mikro_clear_screen.zip Edited December 7, 2009 by Gury Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.