ZX Forum #04
19 ноября 1997 |
|
Technology sprites - Part 2: The hunt for sprites (search and pulling).
HUNTING Let us go with you hunting, and hunting it is ... It was just that this is our hunting unusual: we will hunt you for sprites. What do we need? It's very simple. Get the scoop on their old times drive and locate the 1.2 software that you moved from the tape, or you know exactly what they not protected by our craftsmen. Define "virgin" (unless that MAGIC'om poporchenuyu) program is simple - it likely will not boot when jumping lines with greetings or labels such as "CRACKET BY ...". Other programs we do not fit, as they are compressed, protected, and we simply do not find them. Now it is necessary to arm. I for example, took a not very new, but I tested and distributed Inforkomom Program File dump editor. This very useful program, and through her we can easily find sprites in your programs. If you have do not have it, then look for on the drive any other, capable of browsing and searching in programs sprites. For those who have who generally do not have any programs that I offer my own. You should assemble it in the area memory, which definitely will not be overwritten're viewing unit (Best of 3 third of the screen, as She deliberately did not use the program). Then you should download the program block and run the viewer. After starting the program you will see the following keys: 1 - Switch modes - character / sprite. Q - Reduces the address of view 1 byte. A - Increases the address of view 1. O - Reduces the size of the maps the emogo windows in length by 1. P - Increases the size of the map isplay window at 1. SPACE - Exit to BASIC. Q + SHIFT - Reduces the address space Despite the 256. A + SHIFT - Increases address viewing on the 256. Initially, the address set A font ROM and the mode view symbols. You will be able find with this program sprites almost all formats. Program size is very small. You can also improve its discretion by increasing the number of keys. The program is written to the assembler TASM, but its just a remake for other assemblers. 140. ORG # 61A8; Address assemble. UNPHASE; Replacement ENT, but TASM'a. PHASE 20480; This team assembles everything that we find ; Reduces her, the address that follows the ; It, in our case in the 3 third of the screen, but ; Code puts the address of ORG. EI; Enabling interrupts. XOR A; Making a Border black. OUT (# FE), A INC A; The variable FLAG output mode sprites ; On the screen - 1 Print characters 0 - valid Thou. LD (FLAG), A LD A, # 20; In LEN fills the current window size in width ; Well. LD (LEN), A LD HL, # 3D00; now variable VRAM memory address , From which we print on screen ; Wounds. LD (VRAM), HL CALL SETSP; Draw on the screen the contents of memory. KEY XOR A; In a variable key pressed enters 0. LD (# 5C08), A LD BC, # 0000 pause before pressing any key. CALL # 1F3D LD A, (# 5C08); Read the contents of the variable. CP # 31; if you press "1" - there is a switching ; Output modes sprites. JR Z, SETFLAG CP # 71, if you press "q" (small) - reduces 'S address to the viewer 1. JR Z, UP1 CP # 61; if you press "a" (small) - Increases 'S address to the viewer 1. JR Z, DOWN1 CP # 51, if you press "Q" (large) - Reduces the hell ; Res viewing at # 0100. JR Z, UP256 CP # 41, if you press "A" (large) - Increases 'S address to the viewer # 0100. JR Z, DOWN256 CP # 20; Pressing the space bar exits ; Program. RET Z CP # 6F; if you press "o" (small) - reduces , The size of the window. JR Z, DECR CP # 70, if you press "p" (tiny) - increase , The window size. JR Z, INCR JR KEY; If reaped another transition to a survey of the keys. SETFLAG LD A, (FLAG); invert flag. XOR # 01 LD (FLAG), A JR KEY-3 UP1 LD HL, (VRAM); following procedures increase / ; Address view. DEC HL LD (VRAM), HL JR KEY-3 DOWN1 LD HL, (VRAM) INC HL JR UP1 +4 UP256 LD HL, (VRAM) LD DE, # 0100 AND A SBC HL, DE JR UP1 +4 DOWN256 LD HL, (VRAM) LD DE, # 0100 ADD HL, DE JR UP1 +4 DECR LD A, (LEN); following procedures increase / , The size of the window. CP # 01 JR Z, KEY DEC A LD (LEN), A JR KEY-3 INCR LD A, (LEN) CP # 20 JR Z, KEY INC A LD (LEN), A JR KEY-3 SETSP CALL CLS; Call window cleaning. LD A, (FLAG) DEC A JR Z, CHR; If 1, print characters, otherwise - sprites. LD HL, # 4000; address of the beginning screen. LD DE, (VRAM); memory address. LD B, # 80, window size in the height of 128 pixels (16 * 8). SPR1 PUSH HL LD A, (LEN); Writes in the C window size in length. LD C, A; then print the sprite. SPR2 LD A, (DE) LD (HL), A INC DE INC HL DEC C JR NZ, SPR2 POP HL CALL DOWN DJNZ SPR1 RET DOWN INC H; Go to the next pixel line ; Below. LD A, H AND # 07 RET NZ LD A, L ADD A, # 20 LD L, A RET C LD A, H SUB # 08 LD H, A RET CHR LD HL, # 4000; Address 1 third of the screen. LD DE, (VRAM); In DE puts the address in memory. CALL CHRSET; Fill in the first third. LD HL, # 4800; address the second third. CALL CHRSET; fill it. RET CHRSET LD B, # 08; This procedure fills a third of the screen Sim ; Oxen. CHR1 PUSH HL LD A, (LEN) LD C, A CHR2 PUSH BC PUSH HL LD B, # 08 CHR3 LD A, (DE) LD (HL), A INC H INC DE DJNZ CHR3 POP HL POP BC INC HL DEC C JR NZ, CHR2 POP HL PUSH DE LD DE, # 0020 ADD HL, DE POP DE DJNZ CHR1 RET CLS LD HL, # 5800, First paint the entire screen color ; INK 0, PAPER 0. PUSH HL LD DE, # 5801 LD BC, # 02FF LD (HL), # 00 LDIR POP HL; then makes the visible part of the screen to ; Thoraya falls out the window. LD B, # 10 CLS1 PUSH HL LD A, (LEN) LD C, A CLS2 LD (HL), # 0F INC HL DEC C JR NZ, CLS2 POP HL LD DE, # 20 ADD HL, DE DJNZ CLS1 RET FLAG NOP; variable that stores the index formula ; Mat printing. VRAM DEFW # 0000 variable that stores the memory address LEN NOP; variable that stores the window size in ; Length. 2 Well, the weapon is chosen, and we begin the hunt. What we need to find? Sprites. Increasing or decreasing address view and resizing the window, locate the Playing pictures, pre-translated in the viewer view sprites. To view I took a few programs from the collection: 3D BATMAN (OCEAN), ELEFANT1 (CODE MASTERS), JACK THE NIPPER-2, KRAKOUT. Let's see, what I had in them find. The first three sprite I found in a search mode, sprites, and sprite from the program was KRAKOUT found in the character display mode. Actually, on this our hunt is over and we gradually move to the next chapter, which explained to us what we found.
Other articles:
Similar articles:
В этот день... 21 November