ZX Review #3-4
22 июля 1997 |
|
Forum - A. Gura. Code programmer.
(C) Andrew Gura (EAGLE SOFT), Kurgan. One article I read REVIEW proposal wording in which was proposed to create a code for demomeykerov. I think it needs a code of programmer at all and I think that my code will be an example to all programmers and adopted as a basis. Switching pages of RAM Switch the page better on port # 7FFD, rather than half # FD. This way you can avoid many problems of compatibility of programs with other computers. Take a notorious example INSULT MEGADEMO. This program comes on PROFI, PENTANGON 128, but does not want to work on SCORPION'e, and this angered many SPECCYUSER'ov (I think the owners SCORPION'ov I understand). PORT # 7FFD Z Y X X X X-RAM, the page number from 0 to 7, is connected with the address # C000; Y-switching of the screen, Y = 0 - # 4000, Y = 1 - # C000 (page); Z-switching ROMs, Z = 0 - ZX128, Z = 1 - ZX48; Turn to port to switch pages easier to read as follows: 140. LD BC, # 7FFD LD A, N +16; N-number of the page OUT (C), A 2 At the time of changing the contents port interrupts must forbid. MANAGEMENT KEMPSTON need to poll for Port # 1F, rather than # DF, as done on the ZX-NEXT. But on the Port # DF (for those who do not know) is interrogated FULER joystick. PORT # 1F F U D L R F-FIRE-fire; U-UP-up; D-DOWN-down; L-LEFT-left; R-RIGHT-right. Appeal to the port is by mnemonic IN. SINCLAIR 1 or 1 INTERFACE here has the following keys: 1-LEFT; two-RIGHT; three-DOWN; 4-UP; 5-FIRE. SINCLAIR INTERFACE 2 or 2: 6-LEFT; 7-RIGHT; 8-DOWN; 9-UP; 0-FIRE. CURSOR: 5 + CS-LEFT; 6 + CS-DOWN; 7 + CS-UP; 8 + CS-RIGHT, and CS are not obligatory, and its absence, even comfortable, but not in all cases. KEYBOARD: here it is better to stick sleduyushego standard: O-LEFT; P-RIGHT; Q-UP; A-DOWN; M-FIRE. Poll is on port # FE. PORT # FE Y X X X X X The survey produced the following as follows: 142. LD A, N; N-number poluryada IN A, (# FE) 2 POLURYADY March 1 ... 5 6 ... 0 4 2 Q. .. T Y. .. P 5 1 A. .. G H. .. ENT 6 0 CS ... V B. .. SPC 7 0 - # FE 1 - # FD 2 - # FB 3 - # F7 4 - # EF 5 - # DF 6 - # BF 7 - # 7F Poluryada port address can be calculated by the formula 255-2 №, where n - number poluryada. Booting from CD When you boot from a disk is strictly forbidden to contact non-standard entry points TRDOS and use the method of programming the SH, as all leads to an inoperable programs at boot from the HDD, though it looks very impressive. Again, take for example INSULT MEGADEMO: I say with confidence that this program will not boot from the hard drive. You also can not bind to a specific program loaders version of TR-DOS - it also leads to incompatibility and dissatisfaction. One would like to take your computer with the old version of TR-DOS and throw it out the window. Perhaps so did the fans of racing, when they tried to get LOTUS version of the Laptev, because they have version 5.03, but the game is only on the 5.04. When loading is undesirable that a ship on the disk (so no longer notice the owner PC). TIMING AND INTERRUPT In all the programs when you use the interrupt IM2 need to create the address table, consisting of 257 identical bytes (where do these bytes, I think, you know). Why? - You ask, "It's waste of memory! ". An No! - I can tell. It is believed that with the data bus comes # FF, but all Western programmers use a table. Undesirable to send a vector interrupt number, which contribute to the Treatment of address to Rom, namely the number of 0-63, although screen and the area of system variables is not worth touching. All effects on the screen is better synchronized with respect to screen. For example, again take INSULT. In the first part scrolling when the TURBOrezhime twitches. In the second part, everything happens so fast that it does not have time to read running line, and the music plays faster. "PORT attribute Never use your programs port attributes # FF, since it is an imaginary port. For example, take the game TOP GUN. OTHER GOODIES The games definitely need to pause for a certain key is pressed and shipping situation at any time of the game, each situation must have its specific name. Who has the additions to my code, write to the editor ZX REVIEW. ********************************
Other articles:
Similar articles:
В этот день... 23 November