ZX Format #04
14 июня 1996 |
|
Programmers - IMMORTAL # 2 (immortality in the games).
IMMORTAL # 2 (C) Rzhavelschik. ________________________________ Instead of preface. To continue this column originally was not in my plans but recently I stumbled upon interesting phrase in the ON-LINE, and namely: "... read the above and realized that hardly when I can explain something that is not hacker ... "(for the accuracy of quotations I can not vouch, but the meaning of this). After that, I reread your Op ... Hmmm, some of the gaps available. To start finish. In the first Part I forgot to mention one a little nastiness, which is the name "binary - decimal representation of numbers. "What lies behind this catchy term? Here's what: sometimes, for convenience of calculation, or for certain number of other purposes set out in special type with the command DAA (# 27). In this representation nibbles contain the code decimal digits 0 to 9. So way in bytes can be placed numbers up to # 99. Chasto program constructed so that it works with "Kvazidesyatichnoy" counting system. This means that the contents register should be considered as a decimal, ie, # 35 # 35 = 99 = 99 and etc. In short, if in the beginning of the game given time, 60 seconds, then the search should not # 3e # 3c # 32 (LD a, 60 ...), and # 3e # 60 # 32 is LD a, # 60!. Very popular this distorted in the programs with the clock (in basically - in the race). Example: Wec le Mons at the start of the counter shows a 66.0. Search LD A, 66 No results found. Applying the concept of binary - decimal representation (BCD) are looking for LD A, # 66 ... Bummer - there is no such letter in this word. It follows pad, which exhibited a second with tenths through register-pair. It should be noted that since standard command processing dvubaytnyh numbers here do not apply to standard intel'ovsky location of the "long" numbers in Memory is often sacrificed and bytes can stand there in a staggered order. Found in the final result, the procedure set the time looked like this: LD HL, # 1066 LD (addr), HL Well, perhaps this can be complete an introductory course anatomy programs for novice hackers. Finally I can only say that the most complex structure is usually have tekstovushki (if they codes) and a wide adventyury and most indigestible - compiled with BASIC. ________________ And now, in fact, that for which I have started a continuation This articles. I believe that many, inspired by the prospect of an easy life, famously broke all my (and others') game, and went into the taste and, broken in the dust all of which failed to reach, rested in debugerom a rhetorical question: Where will be put? But on this occasion "... I have a library of". " Perhaps you have already tried a way to select INFINIT'a with ADM'a (not so easy, eh?) by shadow businesses scorpoin'a (Khm. .. convenient course, but all same as that ...) or have made the large selection of games genre "right now I'll show you all. " A further issue is dedicated to - where we put. However, I must say that I like is not going to rewrite the booklet "Caches ZX", and do not intend to write a book "How to make intro. "Intra I do not dabble in (almost). I hope not insult you in the best feelings, If we show how to make a choice immortality of BASIC. For sure Have you ever seen a tape versions of this version: loader stop pressing BREAK; from the row containing the REM and POKE's, REM and the loader is removed starts again. In disk Version LOAD'er not very tormoznesh, because of this you can insert the following lines: 30 PRINT "inf.lives? (Y / N)" 40 LET K $ = inkey $: IF K $ = "y" OR K $ - "Y" THEN POKE addr, n: GOTO 60 50 GOTO 40 Remember? Well. Never so do not do - it's ungrammatical and cumbersome. More correct to ask this insidious problem of the codes and read the answer from the codes the same. This is especially true for the 128-x toys, code loader, in you want to change the contents of multiple memory pages. Here is a sample code menus for this case: LD BC, # 000E - L5D83 LD DE, L5D9B) XOR A) printing CALL # 203C) LD BC, # 0010) Menu LD A, # 00) LD DE, L5DAA) CALL # 203C - JR L5DBB DEFB # 80 DEFB # 16, # 0A, # 0A L5D9B DEFM "1.INF.LIVES" DEFB # FF DEFB # 16, # 0C, # 0A L5DAA DEFM "2.NORMAL GAME" DEFB # FF LD BC, # F7FE - L5DBB IN A, (C)) BIT 0, A) Survey JR Z, L5DC9) BIT 1, A) keys RET Z) JR L5DBB - LD BC, # 7FFD L5DC9 LD A, # 14 DI OUT (C), A XOR A LD (# C7CA), A LD A, # 16 DI LD BC, # 7FFD OUT (C), A XOR A LD (# C472), A RET LD A, # 02 CALL # 1601 JR L5D83 Comment: procedure # 203C prints a message to at DE, a length of BC's current stream, which is installed procedure # 1601 (A contains the thread number). The main screen - stream 2, the service - 1. Please attention to the procedure for L5DC9, this is the "obessmerchivanie. This fragment is called CALL'om after downloading the program, and RET is launching games (incidentally, this fragment is taken from my version ARMYMOVE1 '& amp2 in one bottle). # As you can see, nothing complicated in the so no menus, and in Basic it is not implemented, since there Switched pages of RAM. Naturally, there may Other variants of this procedure, especially part of the print menu. I can imagine how rasfyrkalis counting After reading to themselves as professionals CALL # 203C. Typically, for purposes thereof, use something like this: LD HL, addr LD A, (HL) <-LOOP OR A RET Z RST # 10 INC HL JR LOOP Both options are understood and control codes used BASIC variables. If you the worst possible moment dumped a terrible attack of laziness, we can try to build the BASIC and codes to simplify the print job and poll keys. Present to your attention now masterpiece lazy: 0 REM (code loader) 15 PRINT AT PI * PI, PI * PI; "INF. LIVES (Y / N) ": PAUSE NOT PI: IF INKEY $ = "y" THEN POKE VAL "23908", VAL "182" 20 BORDER NOT PI: CLEAR VAL "2449 9 ": RANDOMIZE USR VAL" 23872 " In the codes of 23,907 stood # 3e # 35, and after - LD (addr), A. You Of course, remember that # 35 <-> DEC (HL), and 182 <-> OR (HL). If you answer "Y" DEC has changed in the OR, and after downloading the codes were put in toys. By the way, with all the splendor of BASIC, this phenomenon represents monoloader. According to the principle of its action this programm directly adjacent to such beloved by many hackers INTRO. Usually INTRO loaded and work out before loading the main program by changing a few bytes in the loader. Since it has a solid volume (scrolling text, music, etc.) then you have had a good opportunity to make fun of the user, hinting that if he will guess the riddle and click on klaviatute response (the word of the 11 letters), then maybe get immortality. For completeness, we consider the course primerchik: LD BC, # 7FFE - LOOP IN A, (C)) poll BIT 0, A) space JR NZ, L61ED - DI IM 1 CALL # 6B2E LD HL, # 4000 LD DE, # 4001 LD BC, # 1AFF LDIR RET NOP L61ED LD A, # FD IN A, (# FE) BIT 4, A -> "G" JR NZ, L621E LD A, # BF IN A, (# FE) BIT 1, A -> "L" JR NZ, L621E LD A, # FB IN A, (# FE) BIT 2, A -> "E" JR NZ, L621E LD A, # 7F IN A, (# FE) BIT 3, A -> "N" JR NZ, L621E LD A, # 22 LD (# 5D73), A LD B, # 27 OR # F8 L6217 OUT (# FE), A INC A DJNZ L6217 JR LOOP L621E That thing works like this: if pressed "space", then continues Loading - if not, is a poll keyboard. When pressed the first key password, the program checks whether the next is pressed. If not pressed the first letter, then exits the program at the polling loop. When pressed all the letters of the password, the boot loader changed bytes and intra having fun blinked border, enters the loop. In the running line, closer to an end, says that if the user knows the name of the vocalist DEICIDE, it can it immediately to confirm and get over its cultural level of eternal life. One subtlety: nothing, producing clearly visible effect consistent with such applets can not be put as each correct keystroke increases the run time cycle, leading to a slowdown in the series standing loop operations (for example, will jump animation). This will reveal the code brute force. Marquee and music in this example are in cycle interruption. At a certain skill such protsedurku can cram and the game itself, although perhaps it have a bad taste (the more so in many games and so have corporate CHEAT MODE). Well, now, seems to really end. I hope that Read'll send you the benefit of and you're not going to die from boredom.
Other articles:
Similar articles:
В этот день... 21 November