Faultless #09
24 мая 1998 |
|
ASM4KOFF - Run the compiled melodies. Loader at ACME. Using on-screen file ArtStudio (display). Maximum speed on the conclusion of sprites. As quickly as possible output points. Fastest up the stack.
Subject: Assembler for coffee. Author: Rezonal / Ufo group --------------------------------------- This article will discuss: 1. Answers to questions from Sergei Parfenov St. Petersburg. a) run out of tunes compiled under their programs; b) on the ACME loaders; c) using the screen file Art Studio; d) the solution of certain problems. 2. Maximum speed of conclusion of sprites. 3. Theoretically, the fastest ACT proper output point. 4. Using the stack as the most rapid rogo way to copy from one area to another. Running compiled tunes. I do not know what the problem would have occurred to the Sergei, so as accurately describe precisely those actions which must perform in order to use Mouzon of program. Unfortunately, I found PT version 2.0, I use PT 2.1. 1) After downloading the PT, select compile. 2) On the issue include player-hole. <Yes>. 3) Suppose, for example, choose the address 50000. 4) Appears plaque: INIT: 50,000 PLAY: 50006 DELAY: 52607 LEN: 6561 5) recorded the first two numbers. 6) In Basic'e testing: a) load the compiled file; b) write in (nerve please click 41st key) Basic'e: 10 RAND USR 15619: REM: LOAD "..." CO DE 20 RAND USR pervoe_chislo (50000) 30 RAND USR vtoroe_chislo (50006) 40 GOTO 30 That's for sure. If Mouzon played, the more Apply the TASM. And write: ORG 25000; For example CALL pervoe_chislo (50000) loop CALL vtoroe_chislo (50006) LD A, # 7F IN A, (254) RRCA JR C, loop; If SPACE is not pressed JP pervoe_chislo (stop Mouzon) Just before you start be sure to get yourself Mouzon ;-). Hopefully it will work. Spouts at ACME. First, it's simple: 1) Run TASM; 2) We leave in BASIC, and write the first row Coy: 1 REM ****************************** Characters "*" need to put as much how many bytes are in your boot. For a start - a little more (say 64 bytes) 3) Go back to the TASM 4) and write: ORG 23872 db 1,5 db kolichestvo_sektorov_fayla ; C = 5 ; B = dlina_fayla_v_sektorah LD DE, (23796) LD HL, adres_zagruzki_fayla CALL 15635 JP adres_zapuska_fayla 5) Compile, go to BASIC 6) We write in BASIC: 2 CLEAR stack: RAND USR 23872 7) Take a blank disk and insert at the disco waters. 8) SAVE "ProgramName" LINE 1 9) Click RESET. 10) Copy the already not very clean drive code file. 11) Write down the amount of BASIC and CODE parts program. 12) In some monitor at TR0, SEC0 offset by # 0D burghers number, which we last just remember. 13) Click RESET. 14) Copy BASIC-file from disk. 15) Fuh, work is done. P.S. A long way, but what can you do ... Using on-screen file ArtStd. Using images ArtStudio too obvious Hb is simple: 1) Run TASM 2) write: ORG 25000 LD HL, adres_kartinki LD DE, 16384 LD bc, 6912 LDIR RET 3) Not forgetting, of course, go into BASIC and typing RAND USR 15619: REM: LOAD "scr n "CODE adres_kartinki Solving certain problems. A quote from a letter by Sergei Parfenov: "And I did not get the compatibility, For example, running a string created in assembler, with melody, created in kakomlibo muses. editor. I have ever played music, or go running line. " About this problem I have only one consideration (this problem is the same once I am concerned): almost all Players Mouzon change the case IX. A you are in the program may register IX used under the address of the current output symbol. So try this: ... main PUSH IX CALL muzon POP IX CALL scroll LD A, # 7F IN A, (254) RRCA JR C, main ... Unfortunately, I have never used Editors Sprite Editor and Sprite Land. I prefer only Art Studio. Even to edit sprites it is not worse mentioned above. So read the next chapter. Max. the rate of withdrawal of sprites First you need to specify the format of the sprite. Suppose, for example, Sprite in our X * Y familiarity. Then write to BASIC'e prog Rummy converting conventional Art-Studio-file 6912 bytes in the sprite. 10 RAND USR 15619: REM: LOAD "scrn" CODE 16384 20 LET ADR = 50000 30 FOR J = 0 TO Y-1 40 FOR I = 0 TO X-1 50 FOR K = 0 TO 7 60 POKE ADR, PEEK (16384 + I + J * 32 + K * 256) 70 LET ADR = ADR +1 80 NEXT K: NEXT I: NEXT J 90 PRINT "SAVE TO FILE XXX CODE", ADR, "," ADR-50000 After running the program should be written write file with the addresses of 50000 and a length ADR-50000. Now in TASM'e: Downloading TASM, go to BASIC and load a sprite, for example, under the address 50000. ORG 25000 LD HL, 50000 LD A, y L2 PUSH DE EX AF, AF ' LD C, x L1 PUSH HL PUSH DE LD B, 8 LP LD A, (HL) LD (DE), A INC HL INC D DJNZ LP POP DE POP HL INC E DEC C JR NZ, L1 POP DE LD A, E ADD A, 32 LD E, A EX AF, AF ' DEC A JR NZ, L2 Program skorochena to the limit, to You can easily understand how it works. Its shortcomings: the sprite will be displayed correctly when it crosses the 1 / 3 part of the screen. Input parameters: DE must register indicate the starting point of a sprite. And now the maximum speed. For the case of withdrawal of a sprite of a variable address of the sprite in a variable area of the screen the following considerations: 1. If the width of the sprite is a multiple of 2 pixels (16 points), the fastest way O sprite following (excerpt): Conclusion podsprayta 16 * 8 points Repeat from the beginning of 4 times HL = adres_sprayta HL = адрес_вывода_спрайта_в_экр_обл Tee LD A, (HL) LD (DE), A INC HL INC E LD A, (HL) LD (DE), A INC HL INC D LD A, (HL) LD (DE), A INC HL DEC E LD A, (HL) LD (DE), A INC D ; End 2. Note: Try to figure out Why is used in the example command no INC DE, and INC E. 3. If you want to make a conclusion sprite to within 1 pixel, rather than to 8, then without a buffer you can not do: the point is that in all demos and almost all games buffer is used for sprites, which is equal 8 (or usually more) dimensions sprite without a buffer. In the buffer is 8 sprites shifted by 0,1,2,3 .. 7 pixels. As quickly as possible output points. This problem has interested me for a long time. I spent a lot of time to resolve it. However, to prove to you that the next the procedure is perfectly fast, I, Unfortunately, I can not, because a bummer. Thus, IDEAL FAST METHOD FOR THE POINT OF WITHDRAWAL ;! LD H, TBL8880 LD D, (HL); senior video address INC H LD A, (HL); junior video address INC H LD L, C ADD A, (HL); X / 8 INC H LD E, A LD A, (DE) OR (HL) LD (DE), A ;! Only 69 cycles! Before entering into this procedure to load the register L Y-coordinate, and in Register C X-coordinate. In this TBL8880 - is the most significant byte address labels (for example, if the table located at 25600, then TBL8880 = = 25600/256 = 100), which is necessary to build immediately after the start of the program, ie, milli-dekranching. Here is its text: LD DE, 256 * TBL8880 XOR A lp PUSH AF LD C, 0 CALL 8880 EX DE, HL LD (HL), D INC H LD (HL), E DEC H INC L EX DE, HL POP AF INC A CP 192 JR NZ, lp LD DE, 256 * TBL8880 +512 XOR A l3 LD B, 8 l2 LD (DE), a INC DE DJNZ l2 INC A CP 1932 JR NZ, l3 RET Fastest stack up Suppose, for example, we want to copy 16 bytes from one region to another. Then the fastest way is (in my opinion, the ideal, but I do not sure) to use the stack: LD (TMP), SP LD SP, FROM POP HL POP DE POP BC POP AF EXX EX AF, AF ' POP HL POP DE POP BC POP AF LD SP, TO +16 PUSH AF PUSH BC PUSH DE PUSH HL EX AF, AF ' EXX PUSH AF PUSH BC PUSH DE PUSH HL LD SP, (TMP) Here we use the register SP, so before you run the program you want to disable call interrupt (DI), and before going to the BASIC do not forget this: LD HL, 10072 EXX EI All for today, I wait for new issues and I hope they will be of interest to consider a wide range of readers. P.S. The programs may be some inaccuracies, to put it simply, perhaps that run them, they will be wrong work. And why? Yes, because rewrite it from. ASM file in lyricist not very much fun. I believe that in examples are given here, you must penetrate, rather than typing them blindly on your computer. In general, while, guys, see you again!
Other articles:
Similar articles:
В этот день... 21 November