;
; Cosmic Bros
;
; I don't usually comment my sources... didnt expect to release this
; so the code is 'a bit' messy and unoptimized.
;

        ideal

frmsize=72*48/2           ; frame size (1728 bytes)  resolution 72x48x16

macro   setframerate n
        mov     ax, seg mainvolume
        mov     es, ax
        mov     [es:framespersec], n
        mov     [es:framecounter], 1
endm

macro   setfx n
        mov     [cs:anieffect], n
endm

macro   setpalette n
        push    cs
        pop     ds
        mov     [cs:palnyt], offset paletit+n*64*3
        call    palettekehiin
endm

macro   demo_sequence                   ; useless macro
        setfx 0
        setpalette 0
        setframerate 3

        playfade 1415, 7, 1, forward, fadeon
        playfade 1415, 7, 1, forward, fadeoff
        showplane plane1, 3
        setpalette 17
        setframerate 12

        setfx 1
        playfade sikio, 25, 1, forward, fadeon
        playvideo (sikio+25), 41, 1, forward
        playfade (sikio+66), 21, 1, forward, fadeoff
        setfx 0

        showplane plane2, 3
        setframerate 10
        setpalette 7
        playvideo alku, 57, 1, forward
        setpalette 1
        playvideo (alku+58), 40, 1, forward

        setframerate 15
        setpalette 5
        playvideo flight1, 18, 3, forward

        setpalette 9
        playvideo savu, 54, 1, forward
        setpalette 0
        playvideo snowbrd2, 60, 1, forward

        setpalette 13
        playvideo savu, 54, 1, forward
        setpalette 0
        playvideo (snowbrd2+60), 60, 1, forward

        setpalette 5
        playvideo savu, 54, 1, forward
        setpalette 0
        setframerate 12
        playvideo (snowbrd2+120), 55, 1, forward

        setframerate 19
        setpalette 14
        playvideo camel, 68, 1, forward
        setframerate 5
        setpalette 7
        playvideo (camel+39), 28, 1, reverse

        setframerate 8
        setpalette 11
        playvideo seal3, 91, 1, forward

        setframerate 20
        setpalette 8
        playvideo salama, 19, 1, forward
        setframerate 22
        setpalette 3
        playvideo (salama+10), 19, 1, forward
        setframerate 26
        setpalette 0
        playvideo salama, 19, 1, forward
        setframerate 27
        setpalette 5
        playvideo (salama+10), 19, 1, reverse
        setframerate 30
        setpalette 7
        playvideo salama, 29, 1, forward

        setpalette 0
        setframerate 4
        setfx 1
        playvideo maa, 7, 2, forward

        setfx 0
        setpalette 0
        setframerate 10
        playvideo fingers, 40, 1, forward
        playvideo fingers, 40, 1, reverse

        setpalette 8
        setframerate 15
        playvideo seal1, 64, 1, forward
        setpalette 11
        playvideo seal2, 80, 1, forward
        setpalette 8
        playvideo (seal1+17), 160, 1, forward

        setframerate 8
        setpalette 0
        playvideo snowbrd1, 47, 1, forward

        setframerate 10
        setpalette 10
        playvideo walk_jugi, 20, 1, forward
        setpalette 0
        setframerate 20
        playvideo salama, 20, 1, forward
        setpalette 10
        setframerate 10
        playvideo walk_jugi, 20, 1, forward
        setpalette 6
        setframerate 30
        playvideo (alku+66), 30, 1, reverse
        setpalette 10
        setframerate 10
        playvideo walk_jugi, 20, 1, forward
        setpalette 17
        setframerate 40
        setfx 1
        playvideo (sikio+30), 30, 1, forward
        setfx 0
        setpalette 10
        setframerate 10
        playvideo walk_jugi, 20, 1, forward
        setframerate 25
        setpalette 16
        playvideo rotate, 20, 1, forward
        setpalette 10
        setframerate 10
        playvideo walk_jugi, 20, 1, forward
        setframerate 50
        setpalette 11
        playvideo (seal2+20), 25, 1, reverse

        setframerate 37
        setpalette 14
        playvideo camel, 30, 1, forward
        setframerate 10
        setpalette 6
        playvideo (camel+20), 48, 1, reverse

        setframerate 12
        setpalette 17
        playvideo (seal1+70), 113, 1, forward

        setframerate 15
        setpalette 10
        playvideo snowbrd2, 125, 1, reverse

        setframerate 12
        setpalette 17
        playvideo (seal1+0), 150, 1, forward

        setfx 1
        setpalette 4
        playvideo salama, 28, 1, forward
        setfx 0
        setpalette 3
        setframerate 11
        playvideo snowbrd1, 47, 1, forward
        setframerate 14
        setpalette 14
        playvideo rotate, 55, 1, forward
        setframerate 10
        setpalette 10
        playvideo haudat, 40, 1, reverse

        setframerate 12
        setpalette 11
        playvideo seal2, 120, 1, FORWARD
        setframerate 11
        setpalette 5
        playvideo seal1, 213, 1, reverse

        setfx 1
        setframerate 15
        setpalette 10
        playvideo flight1, 18, 3, forward
        setfx 0

        setpalette 1
        playvideo savu, 54, 1, forward
        setpalette 12
        setfx 1
        playvideo snowbrd2, 60, 1, forward
        setfx 0

        setpalette 14
        playvideo savu, 54, 1, forward
        setpalette 13
        setfx 1
        playvideo (snowbrd2+60), 60, 1, forward
        setfx 0

        setpalette 5
        playvideo savu, 54, 1, forward
        setpalette 17
        setfx 1
        playvideo (snowbrd2+120), 55, 1, forward
        setfx 0

        setfx 1
        setframerate 19
        setpalette 1
        playvideo camel, 68, 1, forward
        setframerate  9; 5
        setpalette 16
        playvideo (walk_jugi), 51, 1, reverse

        setframerate 8
        setpalette 0
        setfx 0
        playvideo seal3, 91, 1, forward

        setframerate 24
        setpalette 1
        setfx 1
        playvideo salama, 19, 1, forward
        setfx 0
        setframerate 25
        setpalette 17
        playvideo (salama+10), 19, 1, forward
        setframerate 26
        setpalette 16
        setfx 1
        playvideo salama, 19, 1, forward
        setfx 0
        setframerate 28
        setpalette 12
        playvideo (salama+10), 19, 1, reverse
        setframerate 30
        setpalette 9
        playvideo salama, 29, 1, forward

        setpalette 3
        setframerate 6
        playvideo maa, 7, 2, forward

        setpalette 1
        setframerate 20
        playvideo seal2, 60, 1, forward

        setframerate 24
        setpalette 1
        playvideo sikio, 87, 1, reverse
        setframerate 11
        setpalette 14
        playvideo fingers, 80, 1, forward
        setframerate 13
        setpalette 11
        playvideo haudat, 70, 1, forward
        playvideo fchauta, 118, 1, forward
        playfade (fchauta+111), 8, 4, forward, fadeoff

        mov     ax, 13h
        int     10h
        call    vsync

        setframerate 5
        setpalette 13
        playfade (fingers+50), 20, 1, forward, fadeon
        playfade (fingers+70), 10, 1, forward, fadeoff
endm

; ----- these are the frame numbers of different video sequences

fingers       = 0       ; 80    <- these are approx. lengths, but
flight1       = 81      ; 18       because we dont always play
salama        = 100     ; 29       every sequence to the end, i
snowbrd1      = 129     ; 47       didnt define them as constants
rotate        = 176     ; 55
savu          = 232     ; 54
snowbrd2      = 286     ; 175
walk_jugi     = 462     ; 51
seal1         = 514     ; 213
seal2         = 728     ; 120
seal3         = 848     ; 91
camel         = 938     ; 68
fchauta       = 1008    ; 118
haudat        = 1129    ; 100
sikio         = 1229    ; 87
alku          = 1317    ; 98
maa           = 1415    ; 8

forward=1
reverse=-1
fadeon=offset do_fade_on
fadeoff=offset do_fade_off

; video routines are defined as macros... stupid thing to do
; (takes a lot memory) but we aint short of base memory...

macro   playvideo start, frames, looppaus, direction
local @@homodus
        mov     [cs:fadejoulu], offset rettu
        push    cs
        pop     ds

        mov     [cs:alphaloop], looppaus
        mov     eax, [cs:xmsaddress]
        add     eax, start*frmsize
if direction eq reverse
        add     eax, frames*frmsize
endif
        mov     [cs:anistart], eax
        mov     [cs:aniframes], frames
        mov     [cs:aniframesize], direction*frmsize
@@homodus:
        call    viewalpha
        dec     [cs:alphaloop]
        jnz     @@homodus
endm

; playvideo with palette fade
macro   playfade start, frames, looppaus, direction, fadet
local @@homodus
        mov     [cs:fadejoulu], fadet
        mov     [cs:fadetus], 0
        mov     [cs:alphaloop], looppaus
        mov     eax, [cs:xmsaddress]
        add     eax, start*frmsize
if direction eq reverse
        add     eax, frames*frmsize
endif
        mov     [cs:anistart], eax
        mov     [cs:aniframes], frames
        mov     [cs:aniframesize], direction*frmsize
@@homodus:
        call    viewalpha
        dec     [cs:alphaloop]
        jnz     @@homodus
endm

; shows logos in the beginning
macro   showplane segu, fariseus
local @@4, @@venaus, @@2, @@puisheti
        cmp     [cs:exitmode], 0
        jnz     @@puisheti
        mov     ax, seg mainvolume
        mov     fs, ax
        mov     [fs:Frames], 0
        xor     bx, bx
        call    vsync
        mov     ax, 12h                         ; init 640*480*16
        int     10h

        mov     ax, 0102h                       ; set plane 1
        mov     dx, 3c4h
        out     dx, ax
        call    vsync
        mov     dx, 3c8h
        mov     al, 1
        out     dx, al
        inc     dx
        xor     al, al
        out     dx, al
        out     dx, al
        out     dx, al

        mov     ax, segu
        mov     ds, ax
        mov     ax, 0a000h
        mov     es, ax
        xor     si, si
        xor     di, di
        mov     cx, 80*480/4
        rep     movsd                           ; copy plane to screen

        mov     cl, 63
@@4:
        rept fariseus
        call    vsync
        endm

        mov     dx, 3c8h                        ; fade in
        mov     al, 1
        out     dx, al
        inc     dx
        mov     al, 63
        sub     al, cl
        out     dx, al
        out     dx, al
        out     dx, al
        sub     cl, 2
        jnc     @@4

        mov     cx, 70*1                        ; wait
@@venaus:
        call    vsync
        dec     cx
        jnz     @@venaus

        mov     cl, 63                          ; fade out
@@2:
        rept fariseus
        call    vsync
        endm
        mov     dx, 3c8h
        mov     al, 1
        out     dx, al
        inc     dx
        mov     al, cl
        out     dx, al
        out     dx, al
        out     dx, al
        sub     cl, 2
        jnc     @@2

;        mov     ax, [fs:framespersec]
;        shl     ax, 1
;        cmp     [fs:Frames], ax
;        ja      @@venaus
        call    vsync
        mov     ax, 13h                         ; back to 320*200*256
        int     10h
        call    vsync
        push    cs
        pop     ds
        mov     si, [cs:palnyt]                 ; restore palette
        call    palettekehiin
@@puisheti:
endm

        jumps
        model small

; external definitions for GUSPLAY
Extrn   MainVolume:Word,ChanOn:Word,PatternRow:Word,RealRow:Word,OrderLen:Byte
Extrn   PlayingPattern:Word,RealPPattern:Word,Time:DWord,SampChans:Byte,Syncro:Word
extrn   framespersec:word, framecounter:word, frames:word
Extrn   Bar:Byte,NumChans:Word,BasePort:Word,ErrorCode:Word
Extrn   LoadMod:Far,ClearMem:Far,StartPlaying:Far,StopPlaying:Far,Init:Far
Extrn   InitDevice:Far

extrn   flatman:Far                     ; flatman memory "management" :)
extrn   scrolli:Far                     ; text mode greetings scroller

        stack 100h                      ; plenty of space so lets waste it

segment _code para 'code'
        assume  cs:_code
        jumps
        p386

oldint9 dd 0

macro   checkesc
        in      al, 60h
        cmp     al, 1
        jz      @@forced_end
endm

proc    begin
        mov     ax,4A00h
        mov     bx,220000/16+1          ; needs 220k base memory...
        int     21h
        jc      Stop

        mov     ax, 0
        mov     bx, 2450                ; and 2.5 MB of XMS
        call    flatman
        mov     [cs:xmsaddress], eax

        push    cs
        pop     ds
        mov     dx, offset texti        ; ask gus port
        mov     ah, 9
        int     21h
venaa:
        mov     ah, 07h
        int     21h
        cmp     al, 3                   ; ^c, go away
        jz      puis
        cmp     al, 13                  ; enter, 220 is ok
        jz      continue
        cmp     al, 27                  ; esc, go away
        jz      puis
        sub     al, '0'                 ; a number maybe...?
        jz      venaa
        cmp     al, 6                   ; noooot, ask a again :)
        ja      venaa

        mov     ah, 2
        mov     dl, al
        add     dl, '0'
        int     21h                     ; show number picked
        and     ax, 0fh
        shl     ax, 4
        add     ax, 200h
        mov     bx, seg mainvolume
        mov     ds, bx
        mov     [baseport], ax          ; set gus port properly
        jmp     continue
puis:
        jmp     Stop
continue:
        push    cs
        pop     ds
        mov     dx, offset loading      ; 'loading...'
        mov     ah, 9
        int     21h

        call    loadraw                 ; let's do some loading (2.5 MB :)
        call    InitDevice              ; init gusplay
        call    Init

        push    cs
        pop     ds
        mov     dx, offset modulename
        call    LoadMod                 ; load 'COSMIC.MOD'

        cli
        xor     ax, ax
        mov     es, ax
        mov     ax, [es:9*4]
        mov     [word ptr cs:oldint9], ax
        mov     ax, [es:9*4+2]
        mov     [WORD PTR cs:oldint9+2], ax
        mov     ax, OFFSET cs:intti9
        mov     [es:9*4], ax
        mov     [es:9*4+2], cs          ; stealing the keyboard interrupt
        sti

        mov     ax, 13h                 ; init 320*200*256
        int     10h

        push    cs
        pop     ds
        call    StartPlaying            ; lets rock

        demo_sequence                   ; put our demo macro here
;        mov     ah, 1
;        int     16h
        call    scrolli                 ; let's scroll

@@forced_end:                           ; keyboard int throws us here...
        cli
        xor     ax, ax
        mov     es, ax
        mov     ax, [word ptr cs:oldint9]
        mov     dx, [word ptr cs:oldint9+2]
        mov     [es:9*4], ax
        mov     [es:9*4+2], dx          ; restore kbd int
        sti

        call    StopPlaying             ; stop rock
        call    ClearMem                ; flush rock
Stop:
        mov     ax, 3
        int     10h
        push    cs
        pop     ds
        mov     dx, offset loppujorina
        mov     ah, 9                   ; hahaha very funny
        int     21h
        mov     ax, 1
        call    flatman                 ; release xms
        mov     ah, 4ch                 ; exit dos
        int     21h
endp    begin


alphaloop dw 0
vrambuf         dw 0, hajoitus
xmsaddress      dd 0
screenie        dd 0
frame           dw 0
handle          dw 0
exitmode        db 0
modulename      db 'cosmic.mod',0
filename        db 'cosmic.dat',0
readbuf         db 4096 dup (0)
flic            dd 0
anistart        dd 0
aniframesize    dd frmsize
aniframes       dw 0
anieffect       db 0
disframe        dw 666
loading         db 0dh,0ah,0ah,'Loading... this will take some time...!',8,'$'

proc    palettekehiin                   ; palette setup
        push    cs
        pop     ds
        mov     dx, 3c8h
        xor     al, al
        out     dx, al
        inc     dx
        mov     si, [cs:palnyt]
        mov     cx, 64*3
        outsb                           ; rep outsb sucks
        loop    $-1
        ret
endp

proc    loadraw                         ; load datas
        push    0
        pop     es

        mov     ax, 3d00h               ; open file
        mov     dx, offset filename
        int     21h
        mov     [cs:handle], ax

        mov     edi, [cs:xmsaddress]
@@r1:
        push    cs
        pop     ds
        mov     ah, 3fh
        mov     bx, [cs:handle]
        mov     cx, 4096
        mov     dx, offset readbuf
        int     21h                     ; read 4k to buffer
        jc      puis
        or      ax, ax
        jz      fileread

        push    0
        pop     ds
        xor     eax, eax
        xor     esi, esi
        mov     si, cs
        shl     esi, 4
        mov     ax, offset readbuf
        add     esi, eax

        mov     cx, 4096/4
        rep     movs [dword ptr es:edi], [dword ds:esi]
        jmp     @@r1
fileread:

        mov     ah, 3eh
        mov     bx, [cs:handle]
        int     21h                     ; close file
        ret
endp


proc    viewalpha                               ; plays video sequence
        mov     ax, seg mainvolume
        mov     es, ax
        mov     [word es:frames], 0
        mov     [word es:disframe], -1

        cmp     [cs:exitmode], 0
        jnz     ani_end
        push    0
        pop     ds
ani_repeat:
        mov     esi, [cs:anistart]
        mov     cx, [cs:aniframes]
ani_next:
        cmp     [cs:exitmode], 1
        je      ani_end

        push    cx
        push    esi
        call    updatepalette
        pop     esi
        pop     cx

        mov     ax, seg mainvolume
        mov     es, ax
        xor     eax, eax
        mov     ax, [es:frames]         ; get frame number from gusplay
        cmp     ax, [cs:disframe]
        jz      ani_next
        mov     [cs:disframe], ax

        push    cx
        push    esi
        mul     [cs:aniframesize]
        mov     esi, [cs:anistart]
        add     esi, eax
        call    ani_showframe
        pop     esi
        pop     cx

        mov     ax, seg mainvolume
        mov     es, ax
        mov     ax, [es:frames]
        cmp     ax, [cs:aniframes]
        jb      ani_next
ani_end:
        ret
endp

fadetus db 0
fadedir db 0
fadejoulu dw offset do_fade_on
palnyt  dw 0

proc    do_fade_on
        cmp     [cs:fadetus], 127
        ja      rettu
        mov     dx, 3c8h
        xor     al, al
        out     dx, al
        inc     dx
        mov     cx, 64*3
        mov     bl, [cs:fadetus]
@@zup:
        mov     al, [cs:si]
        shl     al, 1
        mul     bl
        mov     al, ah
        out     dx, al
        inc     si
        dec     cx
        jnz     @@zup
        inc     [cs:fadetus]
rettu:
        ret
endp

proc    do_fade_off                             ; fade off
        cmp     [cs:fadetus], 127
        ja      rettu2
        mov     dx, 3c8h
        xor     al, al
        out     dx, al
        inc     dx
        mov     cx, 64*3
        mov     bl, 127
        sub     bl, [cs:fadetus]
@@zup:
        mov     al, [cs:si]
        shl     al, 1
        mul     bl
        mov     al, ah
        out     dx, al
        inc     si
        dec     cx
        jnz     @@zup
        inc     [cs:fadetus]
rettu2:
        ret
endp

proc    vsync                                   ; retrace wait
        cmp     [cs:exitmode], 0
        jnz     bomb
        mov     dx, 3dah
        in      al, dx
        test    al, 8
        jz      $-3
        in      al, dx
        test    al, 8
        jnz     $-3
bomb:
        ret
endp

proc    updatepalette                           ; palette setting routine
        call    vsync
        push    cs
        pop     ds
        mov     si, [cs:palnyt]
        call    [cs:fadejoulu]
        ret
endp

copyframe:                              ; copies frame to screen
        cld
        cmp     [cs:anieffect], 1       ; normal or mirror copy?
        jz      copyframesymm

        mov     dx, 3d4h
        mov     ax, 0309h
        out     dx, ax                  ; double pixels in Y direction

        lds     si, [dword cs:vrambuf]
        push    0a000h
        pop     es
        mov     di, 5*320+18            ; starting offset
        mov     cx, 90*80
        rep     movsd

        xor     eax, eax
        mov     cx, 5*80
        rep     stosd

        push    0
        pop     ds
        ret

copyframesymm:
        mov     dx, 3d4h
        mov     ax, 0109h
        out     dx, ax                  ; 1*1 pixels
        lds     si, [dword cs:vrambuf]

        push    0a000h
        pop     es
        mov     di, 5*320+18           ; starting offset
        xor     eax, eax
        mov     cx, 5*80
        rep     stosd
        mov     bx, 90
copyframesymm1:
        mov     cx, 80                  ; straight copy
        rep     movsd

        mov     bp, si                  ; mirror copy
        sub     di, 32+4
        mov     cx, 80
@@symmy:
        sub     bp, 4
        mov     eax, [ds:bp]
        xchg    al, ah                  ; \
        rol     eax, 16                 ;  } bswap   eax
        xchg    al, ah                  ; /

        stosd
        dec     cx
        jnz     @@symmy
        add     di, 32+4
;        add     bp, 320
        dec     bx
        jnz     copyframesymm1

        push    0
        pop     ds
        ret
;
; this routine scales tiny frames to full screen and interpolates the
; pixels between... interpolation could/should be done with tables
; but i was to lazy... :)
;
ani_showframe:
;        VGA_border 63
        lds     di, [dword cs:vrambuf]
        push    0
        pop     es
        mov     ch, 46
ani_showframe1:
        mov     cl, 36
ani_showframe2:                         ; horizontal blur
        mov     ax, [es:esi]
        mov     bh, ah
        mov     ah, al
        and     al, 0fh
        shr     ah, 4
        shl     ax, 2
        mov     dx, ax
        add     al, ah
        shr     al, 1   ; al = interpoloitu #2
        mov     ah, dh
        add     ah, al
        shr     ah, 1   ; ah = interpoloitu #3
        mov     bl, al
        shl     eax, 16
        mov     al, dl  ; al = interpoloitu #0
        mov     ah, bl
        add     ah, al
        shr     ah, 1   ; ah = interpoloitu #1
        mov     [ds:di], eax
        mov     ah, bh
        mov     al, dh
        and     ah, 0fh
        shl     ah, 2
        mov     dx, ax
        add     al, ah
        shr     al, 1   ; al = interpoloitu #2
        mov     ah, dh
        add     ah, al
        shr     ah, 1   ; ah = interpoloitu #3
        mov     bl, al
        shl     eax, 16
        mov     al, dl  ; al = interpoloitu #0
        mov     ah, bl
        add     ah, al
        shr     ah, 1   ; ah = interpoloitu #1
        mov     [ds:di+4], eax
        add     esi, 1
        add     di, 8
        dec     cl
        jnz     ani_showframe2
        add     di, 4*8
        add     di, 320
        dec     ch
        jnz     ani_showframe1

;        VGA_border 125

        xor     si, si
        mov     edi, 3f3f3f3fh
        mov     ch, 49
verinter1:
        mov     cl, 10
verinter2:
        i=0
        rept 8                          ; this mega proc smooth picture
        mov     eax, [ds:si+i*4]        ; vertically...
        add     eax, [ds:si+320*2+i*4]
        shr     eax, 1
        and     eax, edi
        mov     [ds:si+320*1+i*4], eax
        i=i+1
        endm
        add     si, i*4
        dec     cl
        jnz     verinter2
        add     si, 320
        dec     ch
        jnz     verinter1

        mov     cx, 98
        mov     si, 304-19
        xor     eax, eax
@@bug:
        mov     [ds:si], eax
        add     si, 320
        dec     cx
        jnz     @@bug

        call    vsync                   ; let's sync it a little
        call    copyframe               ; copy buffer to screen
        ret

proc intti9 far                 ; lousy keyboard handler....
        push    ds ax
        mov     al,20h
        out     20h,al
        in      al, 60h
;        and     al, 7fh
        cmp     al, 1           ; escape hit ?
        jnz     @@ei_esc
;        or      al, 80h
;        out     60h, al
        mov     [cs:exitmode], 1        ; done with the demo
@@ei_esc:
        pop     ax ds
        iret
ENDP

texti:
db 25 dup (10)
db '                     The Message from The Cosmic Brothers',13,10,10
db 'Please select your Gravis UltraSound port address:',13,10
db '  If you do not have GUS installed, please select some free address.',13,10
db '     <ESCAPE>. IMMEDIATE EXIT',13,10
db '            1. 210h',13,10
db '            2. 220h',13,10
db '            3. 230h',13,10
db '            4. 240h',13,10
db '            5. 250h',13,10
db '            6. 260h',13,10,10
db 'Your selection [enter=220h] : 220h',8,8,8 ; ,13,10
db '$'

label paletit                   ; all the different palettes
        include 'pal.inc'

loppujorina:                    ; buzz off message
db 'Remember to vote this demo to all possible charts in every diskmag!',0dh,0ah
db '$'

ends    _code

segment plane1
        db 'planemsg1'                  ; complex production
        db 80*480 dup (0)
ends

segment plane2
        db 'planemsg2'                  ; message from ...
        db 80*480 dup (0)
ends

segment hajoitus
        db 64400 dup (0)                ; virtual screen buffer
ends

end     begin                           ; begin is the starting procedure...
