Voyager #03
19 октября 1998

Laboratory - Intro POORGUY! - Inside (original text with commentaries).

<b>Laboratory</b> - Intro POORGUY! - Inside (original text with commentaries).
(C) SIV BLADER / EXCESS TEAM
Music: 'CROON' / 13.10.98 (:-<>)/ KENOTRON



              "POORGUY" from the inside



PLOTTAB EQU # 7C00; Creep address labels

                   ; To draw a point
PLT EQU # 7C; byte plates



        ORG # 6000


        CALL MKTABPL; krieytim plate

                     ; To output points

        CALL MAKE_CLS; rasvorachivaem

                      , "Faster" for

                      ; Quick CLS


; * Begin of IM2_HANDLER PREPARATION *

        LD HL, # 7A00

        LD DE, # 7A01

        LD BC, # 100

        LD A, # 7B

        LD (HL), A

        LDIR


        DEC A

        LD I, A

        IM 2


        LD HL, # C9FB

        LD (# 7B7B), HL
; * End of IM2_HANDLER PREPARATION **


; * Begin of Tree Multu-Shifting **
; This part of the code does just that:
; From one array of dots that are the end; mi segments which, 
in turn, are ; Lines and cleverly depict a tree, we do

; Three arrays that predstvlyayut a tree; vya a coordinate 
change X. That is, when we you, in turn, are leading the 4 
wood, have the effect of motion; zhuschegosya tree on the 
background. 



        LD DE, TREE3_COOR

        PUSH DE

        XOR A

        LD B, 4
MAKE_TREES_L1

        PUSH BC

        LD HL, M0_COOR

        LD BC, 59

        LDIR


        DEC DE

        LD (DE), A

        INC DE


        POP BC

        DJNZ MAKE_TREES_L1

        OUT (# FE), A


        POP HL; # 7000



        LD E, 0

        LD B, 4
MAKE_TREES_L2

        PUSH BC

MAKE_TREES_C3

        LD A, (HL)

        AND A; 0

        JR Z, MAKE_TREES_C1

        CP # FF

        JR Z, MAKE_TREES_C31

        LD A, (HL)

        SUB E

        LD (HL), A

        INC HL

MAKE_TREES_C31

        INC HL

        JR MAKE_TREES_C3

MAKE_TREES_C1

        LD A, E

        ADD A, 40

        LD E, A


        INC HL


        POP BC

        DJNZ MAKE_TREES_L2
; * End of Tree Multu-Shifting **


, Net 1 screen

        LD A, # 17

        CALL ONOF

        CALL CLS

        CALL CLS_ATTR

With pure 0 Screen

        LD A, # 15 + # 8

        CALL ONOF

        CALL CLS

        CALL CLS_ATTR


        CALL CHUNK_VISUAL; STE is

                          ; Itself intra
EXIT
And in general - out under the laws of the first part of
; Marlezonskogo Ballet organizers fantopa ... :)



        DI


        LD A, # 10

        LD BC, # 7FFD

        OUT (C), A


        LD A, # 3F

        LD I, A

        IM 1


        LD HL, # 2758

        EXX

        EI

        RET


, A pointer to the current scene
CURENT_SCENE DW SCENE_ARRAY1


; Data file on the stage and
; Eksplanation look inside the file ...



      INCLUDE "SCENEDAT"

CHUNK_VISUAL

      LD HL, (CURENT_SCENE)

      LD A, (HL); if the contents of the address

                 , Pointed to

      AND A; on the current scene = 0, then

                 , STE is not a description of the scene,

                 , And the marker end => exit

      RET Z; from the procedure.



      LD B, A; otherwise - is the number of

                 ; Repeats scenes



      INC HL; proceed to the next

                 ; Element describing the scene,

                 ; To count collections of segments

                 ; In the scene


C_V_L1

      PUSH BC

      PUSH HL


      LD B, (HL); took the number of sets

                ; Segments - flow times

                ; Will spin cycle



      INC HL; proceed to the next

                 ; Element describing the scene,

                 ; To a pointer to the first

                 , A set of line segments in the scene


C_V_L2

      PUSH BC


      LD E, (HL); in DE - ukuzatel on

      INC HL; set of segments in

      LD D, (HL); scene



      INC HL; Go to index

              ; To the next set

              ; Segments in the scene



      PUSH HL; save it for

              ; Further exploits:)



      PUSH DE; LD IX, DE for yuzaniya

      POP IX; IX in the parameters below
              , The following procedure



      CALL DRAW_SCENE; procedure indicated
                      ; Exponent on a set of
                      ; Sharply in IX stroit

                      , This set of segments



      POP HL; cycle drawing

      POP BC; all sets in from
      DJNZ C_V_L2; segments in the scene


; Once painted all the sets of segments in
; Stage, doing literally the following:
C_V_CH1

      LD A, # 17; check for ne
      XOR% 00001010; switchover ak
      LD (C_V_CH1 +1), A; tive and visible
                      ; My video page.



      CALL ONOF; own business

      HALT; were drawn scene

      CALL CLS; visible and stripping
                ; It another videob
                ; Region under the next frame


;***** Begin of procedure **********************
; Output in the lower right corner of the sprite
; Simulating curved corner bymagi.
;******************************************


; Wywod ugolka :-)

      LD HL, CORNER_SPR

      LD DE, # D4A0 + # 20-3

      LD B, 20
WYWOD_UGOLKA_L1

      PUSH BC

      PUSH DE


      LD BC, 3

      LDIR


      POP DE

      CALL INCD

      POP BC

      DJNZ WYWOD_UGOLKA_L1
;***** End of procedure ***********************
; Output in the lower right corner of the sprite
; Simulating curved corner bymagi.
;******************************************



      POP HL; repeat the current scene

      POP BC; to complete exhaustion

      DJNZ C_V_L1; Register B



      LD A, (HL)

      ADD A, A; x2, swap the decree
      LD C, A; Tel current scene

      LD B, 0; to the next stage.



      ADD HL, BC

      INC HL

      LD (CURENT_SCENE), HL


      JP CHUNK_VISUAL; MAIN LOOP


DRAW_SCENE
; In IX-coors data x1, y1, x2, y2 etc ...
; # 00 - exit
; # FF - skip point
, Despite its name, this procedure by drawing; em not the whole 
scene, but only one set of line segments. ;

; At the entrance - IX: a pointer to a set of coordinates.
;
And the coordinates are stored in this format:
; X1, y1, x2, y2, ... xN, yN, # FF, ... xM, yM, # 00
, Where # 00 - mark the end of the set of coordinates
; # FF - skip-marker, Essence of which will be
; Explain.
; So how do we draw the line segments on the following
; Algortmu: t1-t2, t2-t3, t3-t4 ..., may arise; needs draw 
after cut t (n-1), t (n) is not ; Interval t (n), t (n +1), and 
t (n +1), t (n +2) (ie, break in, Liling), then when we met 
skipmarkera pereskaki; Vai a pair ( x, y) coordinates. ; Well, 
now on the procedure itself - in general, it is ri; vanities 
segments (lines) that form the image ; On the screen. "Lively," 
the same image is achieved ; By the fact that the same 
coordinates every time ; To redraw the image change by + / - 1

; Pixel - the image at the same time pleased "potryasyva; is."



    LD D, (IX +00)

    LD E, (IX +01)

; In DE-x1, y1



    CALL RND; in A - RND (0 .. 255)

    CP 1985

    JR NC, D_S_C_11

    DEC E

    JR DRAW_SCENE_C4

D_S_C_11

    CP 165

   ; NOP E

    JR C, DRAW_SCENE_C4

    INC E

DRAW_SCENE_C4



    CALL RND

    CP 1985

    JR NC, D_S_C_12

    DEC D

    JR DRAW_SCENE_C5

D_S_C_12

    CP 165

   ; NOP D

    JR C, DRAW_SCENE_C5

    INC D

DRAW_SCENE_C5



    LD H, (IX +02)

    LD L, (IX +03)


    LD A, H; check for # 00

    AND A

    RET Z


    INC A; check for # FF

    JR NZ, DRAW_SCENE_C1

    INC IX


    JR DRAW_SCENE_C2

DRAW_SCENE_C1



    CALL RND

    CP 1985

    JR NC, D_S_C_112

    DEC L

    JR DRAW_SCENE_C42

D_S_C_112

    CP 165

   ; NOP L

    JR C, DRAW_SCENE_C42

    INC L

DRAW_SCENE_C42



    CALL RND

    CP 1985

    JR NC, D_S_C_122

    DEC H

    JR DRAW_SCENE_C52

D_S_C_122

    CP 165

   ; NOP H

    JR C, DRAW_SCENE_C52

    INC H

DRAW_SCENE_C52



    CALL LINE

DRAW_SCENE_C2



    INC IX

    INC IX

    JR DRAW_SCENE

And the coordinates of points in general
GIRL_FS_COOR


* Skipped *

Had to be removed - it was too much space.

    Full listing - APPENDIX

* Skipped *


;----- DRAW-LINE ------------------------; HL - X1, Y1 (or Y1, 
X1:) ; DE - X2, Y2 (or Y2, X2:)



LINE LD (CORDL), HL

      PUSH HL


      CALL PLOT


      POP HL

      LD BC, # 101

      LD A, D

      SUB H

      JP NC, LC1

      LD B, # FF

      NEG
LC1 LD D, A

      LD A, E

      SUB L

      JP NC, LC2

      LD C, # FF

      NEG
LC2 LD E, A

      LD A, D

      CP E

      JP NC, LC3

      LD L, D

      LD (SIGN), BC

      XOR A

      LD B, A

      JP LC4
LC3 OR D

      RET Z

      LD L, E

      LD E, D

      LD (SIGN), BC

      LD C, 0
LC4 LD H, E

      LD A, E

      RRA
LCR ADD A, L

      JP C, LC5

      CP H

      JP C, LC6
LC5 SUB H

      LD D, A

      EXX
SIGN_OFFSET

      LD DE, 0

      JP LC7
LC6 LD D, A

      PUSH BC

      EXX

      POP DE
CORDL_OFFSET
LC7 LD HL, 0

      LD A, E

      ADD A, L

      LD E, A

      LD A, D

      INC A

      ADD A, H

      JP C, LC8

      RET Z
LC9 DEC A

      LD D, A

      LD (CORDL), DE


      CALL PLOT


      EXX

      LD A, D

      DEC E

      JP NZ, LCR

      RET
LC8 JP Z, LC9

      RET
; Self modifain kode, however:)
SIGN EQU SIGN_OFFSET +1
CORDL EQU CORDL_OFFSET +1

; Draw a point
PLOT LD C, H

        LD H, PLT

        LD B, (HL)

        INC H

        LD A, (HL)

        INC H

        LD L, C

        OR (HL)

        LD C, A

        INC H

        LD A, (BC)

        OR (HL)

        LD (BC), A

        RET

, The creation of panels to draw a point


MKTABPL LD HL, PLOTTAB; MAKE PLOTTAB
SCRPLT LD A, # C0

        LD E, 3
MK03 LD C, 8
MK02 LD B, 8
MK01 LD (HL), A

        INC L

        INC A

        DJNZ MK01

        SUB 8

        DEC C

        JP NZ, MK02

        ADD A, 8

        DEC E

        JP NZ, MK03

        LD L, 0

        INC H

        LD E, # 20

        CALL MK06

        LD E, 1

        CALL MK06

        LD A, # 80

        LD B, 0
MK07 LD (HL), A

        INC HL

        RRCA

        DJNZ MK07

        RET
MK06 XOR A

        LD C, # 1920
MK05 LD B, 8
MK04 LD (HL), A

        INC HL

        DJNZ MK04

        ADD A, E

        DEC C

        JP NZ, MK05

        RET

; A special port in the Spectrum for
; Switching pages
; In Reg. A - cipher sranichki
ONOF LD BC, # 7FFD

        OUT (C), A

        RET

; Char RND (void)
; A - out - psevdo_rnd value.
RND LD BC, 0

        LD A, B

        ADD A, # 77

        LD B, A

        RLC C

        ADD A, C

        LD C, A

        LD (RND +1), BC

        RET

, Net attributes ...
CLS_ATTR

        LD HL, # D800

        LD DE, # D801

        LD BC, # 2FF

        LD (HL), # 38

        LDIR

        RET

; How to create a "fastera for
; Quick cleaning screen
MAKE_CLS_ARRAY1

        DI

        LD HL, 0

        LD (# 8C0C), SP

        LD SP, # D800

MAKE_CLS

        LD HL, MAKE_CLS_ARRAY1

        LD DE, # 8000

        LD BC, 11

        LDIR


        EX DE, HL


        LD E, L

        LD D, H

        INC E


        LD BC, # BFF

        LD (HL), # E5

        LDIR


        EX DE, HL

        LD (HL), # 31


        LD HL, # C9FB

        LD (# 8C0E), HL

        RET

; *** FAMOUS SUBROTINE ****
, Well its all they know and have tried
INCD INC D

        LD A, D

        AND 7

        RET NZ

        LD A, E

        ADD A, 32

        LD E, A

        RET C

        LD A, D

        SUB 8

        LD D, A

        RET

; File a sprite with the right-bottom corner of the screen
CORNER_SPR INSERT "corner_s.C"

; Define CLS equ # 8000
CLS EQU # 8000

END; address of the end of an intro
L EQU END-# 6000; intro length in bytes
FREE; address free intro area

    - Why?

    - I do not know!



A, D

        AND 7

        RET NZ

        LD A, E

        ADD A, 32

        LD E, A

        RET C

        LD A, D

        SUB 8

        LD D, A

        RET

; File a sprite with the right-bottom corner of the screen
CORNER_SPR INSERT "corner_s.C"

; Define CLS equ # 8000
CLS EQU # 8000

END; address of the end of an intro
L EQU END-# 6000; intro length in bytes
FREE; address free intro area

    - Why?

    - I do not know!






Other articles:

Inform - The plans of the magazine.

Authors - The authors of the journal and editorial contacts.

Inform - Guide magazine.

Locman - On the game SubSunk.

Locman - Game Description DARK SIDE.

loafer - Complete walkthrough MIRROR.

Kaleidoscope - On the game Star Dust roads.

Kaleidoscope - On the second virtual computer art festival Art Comp-99.

Kaleidoscope - The presentation of text utilities - Text Utility V2.8i.

Skeleton - Description of the sound card DMA SOUND.

Skeleton - an undocumented feature of the processor Z80.

History - Life After Willie. Softografiya Matthew Smith.

History - On fidoshnom slang.

Laboratory - Intro POORGUY! - Inside (original text with commentaries).

Laboratory - ZX-SPECTRUM and operating systems.

Laboratory - Procedures from MicroSoft.

Laboratory - The algorithm output decimal numbers on the screen from the register of DE & HL.

Laboratory - The algorithm of division and multiplication of large numbers.

PROFI CLUB - Studying CP / M (compatibility, processors, terminals).

Humor - Ladder - advice to competent user.

Humor - Verse "OA programmers.

Mail - Letters from readers in the magazine.

Advertising - Advertisements and announcements ...

ZXTraders - Deystvyyuschie distributors software ZX Spectrum in Russia and Ukraine


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Report - a secret report from Hidden part ASCII 2001.
Story - Tragedy onlaynizma.
Desktop - JPEG / GIF laboratory 1.1: a program for viewing images in a format JPEG / GIF.

В этот день...   21 November