home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / WM_SRC.ZIP / WM.ASM < prev    next >
Assembly Source File  |  1995-10-13  |  61KB  |  2,145 lines

  1.  
  2.  
  3.  
  4.         Dosseg
  5.         model   large
  6.         .386p
  7.  
  8. ;------------------
  9. ;        MESSAGES=1     ; Comment out this line to remove message output.
  10. ;------------------
  11.  
  12.         Assume  ss:stack1,cs:code16,ds:data1
  13.  
  14. ;code16  segment para    use16
  15. ;code16    ends
  16.  
  17. data1   segment para    use16
  18.  
  19. ;--------------
  20. ; Generic data.
  21. ;--------------
  22.  
  23. IFDEF MESSAGES
  24. Header          db      10,13," ·W·I·N·T·E·R·M·U·T·E· 1.0 ",10,13
  25.                 db            "───────────────────────────",10,13,"$"
  26. V86             db      " ■ System is running in Protected Mode.",10,13,"$"
  27. EMM             db      " ■ An EMM manager has been detected.",10,13,"$"
  28. Err_            db      " ■ Error:"
  29. No_w            db      " Re-boot computer in real mode...",10,13,"$"
  30. ENDIF
  31.  
  32. ChangeMode      dw      0
  33. Seg_            dw      0
  34. Tst             db      0
  35. EMMName         DB      "EMMXXXX0",0
  36. Status          DB      0       ; 0=Real Mode, 0FFH=Real Mode Switched
  37.  
  38. ;-----------
  39. ; XMS Stuff.
  40. ;-----------
  41.  
  42. ;IFDEF MESSAGES
  43. XMS_OK  DB      " ■ XMS Manager present.",10,13,"$"
  44. NO_XMS  DB      " ■ XMS Manager not found.",10,13,"$"
  45. A20     DB      " ■ A20 Gate is not enabled!",10,13,"$"
  46. BLOCK   DB      " ■ Largest free block: $"
  47. BSIZE   DB      "0000 Kb.",10,13,"$"
  48. ALL_ERR DB      " ■ Couldn't allocate memory.",10,13,"$"
  49. L_ERR   DB      " ■ Couldn't lock memory.",10,13,"$"
  50. L_OK    DB      " ■ Memory allocated and locked at: ","$"
  51. BASE1   DB      "0000$"
  52. BASE2   DB      "0000h",10,13,"$"
  53. ;ENDIF
  54.  
  55. MSIZE   DW      0
  56. HANDLE  DW      0
  57. XMS_PTR DW      0,0
  58. MEM_ADD DW      0,0
  59. Values  DB      "0123456789ABCDEF"
  60.  
  61. ;----------------------
  62. ; RAW environment data.
  63. ;----------------------
  64.  
  65. RAW_ME  DB      " ■ RAW environment with $"
  66. RAW_M   DB      "0000h Kbs.",10,13,"$"
  67. RAW_CHECK       DB      0
  68.  
  69. ;----------------
  70. ; Soundcard data.
  71. ;----------------
  72.  
  73. SBlast  DB      " ■ SoundBlaster found at address "
  74. SB_Base DB      "000h, Irq "
  75. Irq_    DB      "0, DMA "
  76. DMA_    DB      "0.",10,13,"$"
  77. GUS     DB      " ■ Gravis UltraSound found at address "
  78. GUSBase DB      "000h, "
  79. GUSMEM  DB      "0000Kb of DRAM available.",10,13,"$"
  80. NO_MUS  DB      " ■ ULTRASND/BLASTER environment variable not found."
  81.         DB      10,13,"$"
  82.  
  83. Card    DB      0       ; 0=Nothing, 1=SB, 2=GUS
  84. IRQ     DB      0       ; IRQ vector (if needed)
  85. DMA     DB      0       ; DMA channel
  86. BASEADD DW      0       ; Base address of soundcard
  87. DRAM    DW      0       ; GUS DRAM
  88.  
  89. ;----------------------
  90. ; Flat Real Mode Table.
  91. ;----------------------
  92.  
  93. GDT     dw 4 dup (0)
  94. GDT_code16=8
  95.         dw      0FFFFh,0,9A00H,0        ; 16 bit code segment
  96.  
  97. GDT_code32=16
  98.         dw      0FFFFH,0,9A00H,0CFH     ; 32 bit code segment
  99.  
  100. GDT_data16=24
  101.         dw      0FFFFH,0,9200H,0        ; 64k data segment
  102.  
  103. GDT_data32=32
  104.         dw      0FFFFH,0,9200H,8FH      ; 4 Gig. data segment
  105.  
  106. ptr_GDT LABEL   FWORD
  107.         dw      40-1                    ; GDT size-1
  108.         dd      offset data1:GDT
  109.         dw      0
  110.  
  111. ;---------
  112. save_NMI        db      0
  113. ;--------
  114.  
  115. Music_call      dw      PLAYER,PLAYER
  116.  
  117. data1   ends
  118.  
  119. PLAYER segment para use16
  120.  
  121.         DB      100H    DUP     (90H)
  122.         include ULTRASND.DRV
  123.  
  124. PLAYER  ENDS
  125.  
  126. Mod_seg segment para    use16
  127.  
  128. include reverie.dat
  129. Mod_seg ends
  130.  
  131. data2   segment para    public  use16
  132.  
  133. Buffer  db      64000   dup     (0)
  134.  
  135. public Tabl
  136. public Integer
  137. public Fract
  138. public Pointer
  139. public StartPoint
  140. public Y
  141. public Size_
  142. public Reduce
  143. public Buffer
  144.  
  145. Tabl   LABEL   WORD
  146.         include stretch.tab
  147.  
  148. Integer DW      0
  149. Fract   DW      0
  150. Pointer DW      0
  151. StartPoint      DW      0
  152. Y       DW      0
  153. Size_   DW      0
  154. Reduce  DW      248
  155.  
  156. data2   ends
  157.  
  158.  
  159. logo1   segment para    use16
  160.  
  161. logo    db      "LOGO1"
  162.         db       64000 dup (0)
  163. Pal     db      "PAL1"
  164.         db      768     dup     (0)
  165.  
  166. logo1 ends
  167.  
  168.  
  169. data3   segment para    public  use16
  170.  
  171. Buffer1 db      "MUÑECO"
  172.         db      64000   dup     (0)
  173.  
  174. data3   ends
  175.  
  176.  
  177. data4   segment para    use16
  178.  
  179. circles db      "cir"
  180.         db      64000   dup     (0)
  181. cirpal  db      "cirpal"
  182.         db      (768-6) dup     (0)
  183.  
  184.  
  185. ZDelta   DW      0
  186. Delta2  DW      0
  187. data4   ends
  188.  
  189. stack1  segment para    use16 stack 'STACK'
  190.  
  191.         db      800h    dup     (?)
  192.  
  193. stack1  ends
  194.  
  195. code16  segment para    use16
  196.  
  197. start:
  198.  
  199. ;---------------
  200. ; Get Soundcard.
  201. ;---------------
  202.  
  203.         call    pre_code
  204.         call    GET_SOUND
  205.  
  206. ;----------------------------------
  207. ; All Interrupt stuff is done here.
  208. ;----------------------------------
  209.  
  210. ;        call    pre_code
  211.  
  212. ;------------------------------
  213. ; Check if running in PM or V86
  214. ;------------------------------
  215.  
  216.         mov     ax,data1
  217.         mov     ds,ax
  218.         IFDEF MESSAGES
  219.         mov     dx,offset Header
  220.         mov     ax,0900h
  221.         int     21h
  222.         ENDIF
  223.         smsw    ax
  224.         test    al,1
  225.         jnz     Is_V86
  226.  
  227.         xor     al,al
  228.         mov     ds:[Status],al
  229.         jmp     @@1
  230. Is_V86: nop
  231.         IFDEF MESSAGES
  232.         lea     dx,V86
  233.         mov     ax,0900h
  234.         int     21h
  235.         ENDIF
  236.         mov     al,0FFh
  237.         mov     ds:[Status],al
  238.  
  239. ;-----------------------------------
  240. ; Check Out for EMM386/QEMM/386^MAX.
  241. ;-----------------------------------
  242.  
  243.         mov     ax,3D00H
  244.         mov     dx,offset EMMName
  245.         int     21h
  246.  
  247.         jnc      @2
  248.  
  249. ;----------------------------------------
  250. ; No EMM386 but in Protected Mode. Abort.
  251. ;----------------------------------------
  252.  
  253.         IFDEF MESSAGES
  254.         lea     dx,No_w
  255.         mov     ax,0900h
  256.         int     21h
  257.         ENDIF
  258.         jmp     @end
  259.  
  260. @2:     mov     bx,ax
  261.         mov     ax,3E00h
  262.         int     21h
  263.         IFDEF MESSAGES
  264.         lea     dx,EMM
  265.         mov     ax,0900h
  266.         int     21h
  267.         ENDIF
  268.  
  269. ;------------------
  270. ; Call XMS manager.
  271. ;------------------
  272.  
  273.         call    XMS_Manager
  274.  
  275.         IFDEF MESSAGES
  276.         call    Sound_Info
  277.         ENDIF
  278.  
  279. ;---------------------
  280. ; Fake Windows Startup
  281. ;---------------------
  282.  
  283.         mov     ax,1605H
  284.         xor     bx,bx
  285.         xor     cx,cx
  286.         xor     dx,dx
  287.         xor     si,si
  288.         mov     ds,bx
  289.         mov     es,bx
  290.         mov     di,30AH         ; Fake windows version 3.10
  291.         int     2Fh
  292.  
  293. ;-----------------------
  294. ; Test for permission...
  295. ;-----------------------
  296. ; DS:SI should point to a Mode Switch routine.
  297. ; CX _MUST_ be =0
  298.  
  299.         cmp     cx,0
  300.         jne     @E1
  301.  
  302.         mov     ax,ds
  303.         add     ax,si
  304.         cmp     ax,0
  305.         jne     @rm1
  306.  
  307. ;-----------------------------------------------
  308. ; If DS:SI= 00:00 then abort. Fake Windows Exit.
  309. ;-----------------------------------------------
  310.  
  311. @E1:
  312.         mov     ax,1606H
  313.         xor     bx,bx
  314.         xor     dx,dx
  315.         int     2FH
  316.  
  317.         sti
  318.         mov     ax,data1
  319.         mov     ds,ax
  320.         IFDEF MESSAGES
  321.         lea     dx,Err_
  322.         mov     ax,0900h
  323.         int     21h
  324.         ENDIF
  325.  
  326.         call    UNLOCK_MEM
  327.  
  328.         mov     ax,4c00h
  329.         int     21h
  330.  
  331. ;---------------------------------
  332. ; Store pointer to switch routine.
  333. ;---------------------------------
  334.  
  335. @rm1:   mov     ax,data1
  336.         mov     es,ax
  337.         mov     bp,offset ChangeMode
  338.         mov     es:[bp],si
  339.         mov     ax,ds
  340.         mov     es:[bp+2],ax
  341.  
  342. ;----------------------------------------------------
  343. ; Enter Real Mode. (Remember= No interrupts allowed!)
  344. ;----------------------------------------------------
  345.  
  346.         cli
  347.         xor     ax,ax
  348.         call    dword   ptr     es:[ChangeMode]
  349.  
  350. ;----------------------
  351. ; Enter Flat Real Mode.
  352. ;----------------------
  353.  
  354.         call    Init_FRM
  355.  
  356. ;--------------------------
  357. ; Real mode code call here
  358. ;--------------------------
  359.  
  360.         call    rmode_code
  361.  
  362.  
  363. ;-------------------------------
  364. ; Switch back to Protected Mode.
  365. ;-------------------------------
  366.  
  367.  
  368.         mov     ax,data1
  369.         mov     es,ax
  370.         mov     ax,1
  371.         call    dword   ptr     es:[ChangeMode]
  372.  
  373. ;----------------------
  374. ; Simulate Windows exit
  375. ;----------------------
  376.  
  377.         mov     ax,1606H
  378.         xor     dx,dx
  379.         int     2FH
  380.         sti
  381.         
  382.         call    UNLOCK_MEM
  383.  
  384.         jmp     @end
  385.  
  386. ;------------------------------------------------
  387. ; Computer was already in Real Mode. (Enable FRM)
  388. ;------------------------------------------------
  389.  
  390. @@1:
  391.        call    XMS_Manager
  392.  
  393.        IFDEF MESSAGES
  394.        call    Sound_Info
  395.        ENDIF
  396.  
  397.        call    Init_FRM
  398.  
  399.        call    rmode_code
  400.  
  401.        mov      ax,data1
  402.        mov      ds,ax
  403.        mov      al,ds:[RAW_CHECK]
  404.        cmp      al,0FFh
  405.        je       @end
  406.  
  407.        call    UNLOCK_MEM
  408.  
  409. @end:
  410.  
  411.         mov     ax,4c00h
  412.         int     21h
  413.  
  414. ;---------------------------------------
  415. ; Flat Real Mode Initialization routine.
  416. ;---------------------------------------
  417.  
  418. Init_FRM:
  419.         mov     ax,data1
  420.         mov     es,ax
  421.         mov     ax,code16
  422.         movzx   eax,ax
  423.         shl     eax,4           ; Physical address in EAX
  424.         mov     word    ptr     es:GDT[GDT_code16+2],ax
  425.         ror     eax,16
  426.         mov     byte    ptr     es:GDT[GDT_code16+4],al
  427.  
  428.         mov     ax,data1        ; Segment that contains GDT
  429.         movzx   eax,ax
  430.         shl     eax,4
  431.         add     dword   ptr     es:ptr_GDT+2,eax ; Physical address of GDT
  432.  
  433.         lgdt    fword   ptr     es:ptr_GDT
  434.  
  435.         cli
  436.  
  437. ; Clear NMI
  438.  
  439.         mov     ax,data1
  440.         mov     ds,ax
  441.         in      al,70h
  442.         mov     ds:[save_NMI],al
  443.         mov     al,80h
  444.         out     70h,al
  445.  
  446.         mov     eax,cr0
  447.         or      al,1
  448.         mov     cr0,eax
  449.  
  450. ;---
  451.         db      0EAH    ; FAR JUMP
  452.         dw      offset  pmode
  453.         dw      GDT_code16
  454.  
  455. pmode:  mov     ax,GDT_data32
  456.         mov     ds,ax
  457.         mov     es,ax
  458.         mov     fs,ax
  459.         mov     gs,ax
  460.  
  461.         mov     eax,cr0
  462.         and     al,0feh
  463.         mov     cr0,eax
  464.  
  465.         db      0eah
  466.         dw      offset  rmode
  467.         dw      code16
  468.  
  469. rmode:  sti
  470.         mov     ax,data1
  471.         mov     ds,ax
  472.         mov     al,ds:[save_NMI]
  473.         out     70h,al
  474.         RET
  475.  
  476. ;-------------------
  477. ; Interrupt handler.
  478. ;-------------------
  479.  
  480. Interrupt:
  481.         pushad
  482.         push    ds
  483.         push    es
  484.         mov     ax,data1
  485.         mov     ds,ax
  486.         mov     al,ds:[Status]
  487.         or      al,al
  488.         jz      realthing
  489.         
  490.         mov     ax,1
  491.         cli
  492.         call    dword   ptr     ds:[ChangeMode] ; Enter V86 mode.
  493.  
  494.         mov     ax,1606H        ; Exit Windows.
  495.         xor     bx,bx
  496.         xor     dx,dx
  497.         int     2FH
  498.  
  499. realthing:
  500.         sti
  501.         pop     es
  502.         pop     ds
  503.         popad
  504.         ror     eax,16
  505.         mov     cs:[selfmod],al
  506.         jmp     $+2
  507.         rol     eax,16
  508.         DB      0CDh
  509. selfmod DB      00h             ; Self-modifying code!!!
  510.         cli
  511.         push    ax
  512.         push    ds
  513.         mov     ax,data1
  514.         mov     ds,ax
  515.         mov     al,ds:[Status]
  516.         or      al,al
  517.         jz      real_too
  518.         push    es
  519.         push    fs
  520.         push    gs
  521.         
  522.         mov     ax,1605H
  523.         xor     bx,bx
  524.         xor     cx,cx
  525.         xor     dx,dx
  526.         xor     si,si
  527.         mov     ds,bx
  528.         mov     es,bx
  529.         mov     di,30AH         ; Fake windows version 3.10
  530.         int     2Fh
  531.         
  532.         cli
  533.         xor     ax,ax
  534.         call    dword   ptr     ds:[ChangeMode]
  535.         call    Init_FRM
  536.         pop     gs
  537.         pop     fs
  538.         pop     es
  539.  
  540. real_too:
  541.         pop     ds
  542.         pop     ax
  543.         RET
  544.  
  545. ;-----------------------
  546. ; Register Dump routine.
  547. ;-----------------------
  548.  
  549. ; IN: AX=Number DS:DI=Pointer to string.
  550. ; OUT: Nothing
  551. ; Destroys: AX,BX,CX,DX,SI,DI
  552.  
  553. WRITER:
  554.         Push    di
  555.         Mov     bx,ax
  556.         Mov     si,offset Values
  557.         Mov     dx,si
  558.         Shr     ax,12
  559.         Add     si,ax
  560.         Mov     cl,ds:[si]
  561.         Mov     ds:[di],cl
  562.         Mov     ax,bx
  563.         And     ah,0fh
  564.         Shr     ax,8
  565.         Mov     si,dx
  566.         Add     si,ax
  567.         Inc     di
  568.         Mov     cl,ds:[si]
  569.         Mov     ds:[di],cl
  570.         Mov     ax,bx
  571.         Xor     ah,ah
  572.         Shr     al,4
  573.         Mov     si,dx
  574.         Add     si,ax
  575.         Inc     di
  576.         Mov     cl,ds:[si]
  577.         Mov     ds:[di],cl
  578.         Mov     al,bl
  579.         And     al,0fh
  580.         Mov     si,dx
  581.         Add     si,ax
  582.         Inc     di
  583.         Mov     cl,ds:[si]
  584.         Mov     ds:[di],cl
  585.         Pop     dx
  586.         Mov     ah,9
  587.         Int     21h
  588.         Ret
  589.  
  590. ;---------------------
  591. ; XMS Manager routine.
  592. ;---------------------
  593.  
  594. XMS_Manager:
  595.  
  596.         mov     ax,4300h        ; Check install.
  597.         int     2fh
  598.         cmp     al,80h
  599.         jnz     NOXMS
  600.  
  601.  
  602.         IFDEF MESSAGES
  603.         mov     dx,offset XMS_OK
  604.         mov     ax,0900h
  605.         int     21h
  606.         ENDIF
  607.         jmp     GET_PTR
  608.  
  609. NOXMS:  nop
  610.         IFDEF MESSAGES
  611.         mov     dx,offset NO_XMS
  612.         mov     ax,0900h
  613.         int     21h
  614.         ENDIF
  615.         jmp     RAW_SYSTEM
  616.  
  617. GET_PTR:
  618.         mov     ax,4310h        ; Get API address.
  619.         int     2fh
  620.         mov     word    ptr     ds:[XMS_PTR],bx
  621.         mov     word    ptr     ds:[XMS_PTR+2],es
  622.  
  623. ; Check A20 gate.
  624.  
  625.         mov     ax,0700h
  626.         call    dword   ptr     ds:[XMS_PTR]
  627.         cmp     ax,0
  628.         je      NO_A20
  629.         cmp     bl,80h
  630.         je      NO_A20
  631.         jmp     QUERY
  632.  
  633. NO_A20: nop
  634.         mov     ax,0300h
  635.         call    dword   ptr     ds:[XMS_PTR]
  636.         cmp     ax,0
  637.         je      A20_ERROR
  638.         cmp     bl,80h
  639.         je      A20_ERROR
  640.         jmp     QUERY
  641.  
  642. A20_ERROR:
  643.         IFDEF MESSAGES
  644.         mov     dx,offset A20
  645.         mov     ax,0900h
  646.         int     21h
  647.         ENDIF
  648.         jmp     FINNISH
  649.  
  650. QUERY:  mov     ax,0800h        ; Query free extended block.
  651.         call    dword   ptr     ds:[XMS_PTR]
  652.         cmp     bl,80h
  653.         je      NO_QUERY
  654.         mov     ds:[MSIZE],ax
  655.         IFDEF MESSAGES
  656.         mov     dx,offset BLOCK
  657.         mov     ax,0900h
  658.         int     21h
  659.         mov     ax,ds:[MSIZE]
  660.         mov     di,offset BSIZE
  661.         Call    Writer
  662.         ENDIF
  663.         jmp     ALLOC
  664. NO_QUERY:
  665.         jmp     FINNISH
  666.  
  667. ALLOC:  mov     ax,0900h        ; Allocate block.
  668.         mov     dx,ds:[MSIZE]
  669.         call    dword   ptr     ds:[XMS_PTR]
  670.         cmp     ax,0
  671.         je      FAIL
  672.         cmp     bl,80h
  673.         je      FAIL
  674.         mov     ds:[HANDLE],dx
  675.         jmp     LOCK_MEM
  676.  
  677. FAIL:   nop
  678.         IFDEF MESSAGES
  679.         mov     dx,offset ALL_ERR
  680.         mov     ax,0900h
  681.         int     21h
  682.         ENDIF
  683.         jmp     FINNISH
  684.  
  685. LOCK_MEM:
  686.         mov     dx,ds:[HANDLE]  ; Lock memory.
  687.         mov     ax,0C00h
  688.         call    dword   ptr     ds:[XMS_PTR]
  689.         cmp     ax,0
  690.         je      FAIL2
  691.         mov     word ptr ds:[MEM_ADD+2],dx        ; 32bit address.
  692.         mov     word ptr ds:[MEM_ADD],bx
  693.  
  694.         IFDEF MESSAGES
  695.         mov     dx,offset L_OK
  696.         mov     ax,0900h
  697.         int     21h
  698.         mov     ax,word ptr     ds:[MEM_ADD+2]
  699.         mov     di,offset BASE1
  700.         call    Writer
  701.         mov     ax,word ptr     ds:[MEM_ADD]
  702.         mov     di,offset BASE2
  703.         call    Writer
  704.         ENDIF
  705.  
  706.         jmp     FINNISH         ; UNLOCK_MEM
  707.  
  708. FAIL2:  nop
  709.         IFDEF MESSAGES
  710.         mov     dx,offset L_ERR
  711.         mov     ax,0900h
  712.         int     21h
  713.         ENDIF
  714.  
  715.         jmp     DE_ALLOC
  716.  
  717. UNLOCK_MEM:
  718.         mov     ax,0D00h
  719.         mov     dx,ds:[HANDLE]
  720.         call    dword   ptr     ds:[XMS_PTR]
  721.         cmp     ax,0
  722.         je      FAIL3
  723.         jmp     DE_ALLOC
  724.  
  725. FAIL3:  jmp     FINNISH
  726.  
  727. DE_ALLOC:
  728.         mov     ax,0A00h
  729.         mov     dx,ds:[HANDLE]
  730.         call    dword   ptr     ds:[XMS_PTR]
  731.         cmp     ax,0
  732.         je      FAIL4
  733.         jmp     FINNISH
  734.  
  735. FAIL4:  ;jmp     FINNISH
  736.  
  737.  
  738. FINNISH:
  739.         RET
  740.  
  741. RAW_SYSTEM:
  742.  
  743.         mov     ax,data1
  744.         mov     ds,ax
  745.         mov     al,ds:[Status]
  746.         cmp     al,0FFh
  747.         jne     RAW1
  748.         mov     ax,4c00h
  749.         int     21h
  750.  
  751. RAW1:   mov     ds:[RAW_CHECK],0FFh
  752.         call    ENABLEA20
  753.         cmp     ax,4
  754.         jne     RAW2
  755.         mov     ax,data1
  756.         mov     ds,ax
  757.         mov     dx,offset A20
  758.         mov     ax,0900h
  759.         int     21h
  760.         mov     ax,4c00h
  761.         int     21h
  762.  
  763. RAW2:   mov     ax,data1
  764.         mov     ds,ax
  765.         mov     ax,8800h
  766.         int     15h
  767.         mov     ds:[MSIZE],ax
  768.         mov     eax,100000h
  769.         mov     dword ptr ds:[MEM_ADD],eax
  770.         mov     ax,0900h
  771.         mov     dx,offset RAW_ME
  772.         int     21h
  773.         mov     ax,ds:[MSIZE]
  774.         mov     di,offset RAW_M
  775.         call    Writer
  776.         RET
  777.  
  778. ;-----------------------------
  779. ; Soundcard detection routine.
  780. ;-----------------------------
  781.  
  782. GET_SOUND:
  783.  
  784.         mov     di,2Ch          ; Environment segment is stored at PSP
  785.         mov     ax,ds
  786.         mov     fs,ax
  787.         mov     ax,ds:[di]      ; offset $2C, so [DS:2C] for both .COM
  788.         mov     es,ax           ; and .EXE
  789.         xor     di,di
  790.         mov     cx,2048
  791.         mov     ax,data1
  792.         mov     ds,ax
  793.  
  794. GUS1:   mov     al,es:[di]
  795.         cmp     al,"U"
  796.         jne     GUS2
  797.         mov     al,es:[di+1]
  798.         cmp     al,"L"
  799.         jne     GUS2
  800.         mov     al,es:[di+2]
  801.         cmp     al,"T"
  802.         jne     GUS2
  803.         mov     al,es:[di+3]
  804.         cmp     al,"R"
  805.         jne     GUS2
  806.         mov     al,es:[di+4]
  807.         cmp     al,"A"
  808.         jne     GUS2
  809.         mov     al,es:[di+5]
  810.         cmp     al,"S"
  811.         jne     GUS2
  812.         mov     al,es:[di+6]
  813.         cmp     al,"N"
  814.         jne     GUS2
  815.         mov     al,es:[di+7]
  816.         cmp     al,"D"
  817.         jne     GUS2
  818.         mov     al,es:[di+8]
  819.         cmp     al,"="
  820.         jne     GUS2
  821.  
  822.         jmp     GUS3
  823.  
  824. GUS2:   inc     di
  825.         dec     cx
  826.         jnz     GUS1
  827.  
  828.         jmp     NO_GUS
  829.  
  830. GUS3:   add     di,8
  831. GUS4:   inc     di
  832.         mov     al,es:[di]
  833.         cmp     al," "
  834.         je      GUS4
  835.         mov     al,es:[di]
  836.         mov     si,offset GUSBase
  837.         mov     ds:[si],al
  838.         mov     al,es:[di+1]
  839.         mov     ds:[si+1],al
  840.         mov     al,es:[di+2]
  841.         mov     ds:[si+2],al
  842.  
  843.         mov     al,es:[di+1]
  844.         xor     ah,ah
  845.         sub     al,30h
  846.         shl     ax,4
  847.         mov     bx,200h
  848.         add     bx,ax
  849.         mov     ds:[BASEADD],bx
  850.         mov     byte    ptr     ds:[Card],2
  851.  
  852.         mov     di,offset GUSMEM
  853.         mov     cl,4
  854.         xor     si,si
  855.         call    CHECK_DRAM
  856.         cmp     al,0CCH
  857.         je      GUS5
  858.         mov     ax,256
  859.         mov     ds:[DRAM],ax
  860.         mov     eax,"6520"
  861.         mov     dword   ptr     ds:[di],eax
  862.         ret
  863.  
  864. GUS5:   mov     cl,8
  865.         xor     si,si
  866.         call    CHECK_DRAM
  867.         cmp     al,0CCh
  868.         je      GUS6
  869.         mov     ax,512
  870.         mov     ds:[DRAM],ax
  871.         mov     eax,"2150"
  872.         mov     dword   ptr     ds:[di],eax
  873.         ret
  874.  
  875. GUS6:   mov     cl,0Ch
  876.         xor     si,si
  877.         call    CHECK_DRAM
  878.         cmp     al,0CCh
  879.         je      GUS7
  880.         mov     ax,768
  881.         mov     ds:[DRAM],ax
  882.         mov     eax,"8670"
  883.         mov     dword   ptr     ds:[di],eax
  884.         ret
  885.  
  886. GUS7:   mov     ax,1024
  887.         mov     ds:[DRAM],ax
  888.         mov     eax,"4201"
  889.         mov     dword   ptr     ds:[di],eax
  890.         ret
  891.  
  892.  
  893. ;-----------------------------------
  894. ; Check GUS DRAM (IN: ADDRESS CL:SI)
  895. ;-----------------------------------
  896.  
  897. CHECK_DRAM:
  898.         mov     dx,ds:[BASEADD] ; Test GUS DRAM
  899.         add     dx,103h
  900.         mov     al,43h
  901.         out     dx,al
  902.         mov     ax,si
  903.         inc     dx      ; 104h
  904.         out     dx,ax
  905.         mov     al,44h
  906.         dec     dx      ; 103h
  907.         out     dx,al
  908.         add     dx,2    ; 105h
  909.         mov     al,cl
  910.         out     dx,al
  911.         add     dx,2    ; 107h
  912.         mov     al,0CCh
  913.         out     dx,al
  914.  
  915.         mov     dx,ds:[BASEADD]
  916.         add     dx,103h
  917.         mov     al,43h
  918.         out     dx,al
  919.         mov     ax,si
  920.         inc     dx      ; 104h
  921.         out     dx,ax
  922.         mov     al,44h
  923.         dec     dx      ; 103h
  924.         out     dx,al
  925.         add     dx,2    ; 105h
  926.         mov     al,cl
  927.         out     dx,al
  928.         add     dx,2    ; 107h
  929.         in      al,dx
  930.         RET
  931.  
  932. NO_GUS:
  933.         mov     di,2Ch          ; Environment segment is stored at PSP
  934.         mov     ax,fs:[di]      ; offset $2C, so [DS:2C] for both .COM
  935.         mov     es,ax           ; and .EXE
  936.         xor     di,di
  937.         mov     cx,2048
  938.  
  939. SOUND1:
  940.         mov     al,es:[di]
  941.         cmp     al,"B"
  942.         jne     SOUND2
  943.         mov     al,es:[di+1]
  944.         cmp     al,"L"
  945.         jne     SOUND2
  946.         mov     al,es:[di+2]
  947.         cmp     al,"A"
  948.         jne     SOUND2
  949.         mov     al,es:[di+3]
  950.         cmp     al,"S"
  951.         jne     SOUND2
  952.         mov     al,es:[di+4]
  953.         cmp     al,"T"
  954.         jne     SOUND2
  955.         mov     al,es:[di+5]
  956.         cmp     al,"E"
  957.         jne     SOUND2
  958.         mov     al,es:[di+6]
  959.         cmp     al,"R"
  960.         jne     SOUND2
  961.         mov     al,es:[di+7]
  962.         cmp     al,"="
  963.         jne     SOUND2
  964.  
  965.         mov     ax,data1
  966.         mov     ds,ax
  967.         jmp     SOUND3
  968.  
  969. SOUND2:
  970.         inc     di
  971.         dec     cx
  972.         jnz     SOUND1
  973.  
  974.         jmp     NO_Sound
  975.  
  976. SOUND3:
  977.         add     di,7
  978. SOUND4:
  979.         inc     di
  980.         mov     al,es:[di]
  981.         cmp     al,"A"
  982.         jne     SOUND4
  983.  
  984.         mov     si,offset SB_Base
  985.         inc     di
  986.         mov     al,es:[di]
  987.         mov     ds:[si],al
  988.         inc     si
  989.         inc     di
  990.         mov     al,es:[di]
  991.         mov     ds:[si],al
  992.         inc     si
  993.         inc     di
  994.         mov     al,es:[di]
  995.         mov     ds:[si],al
  996.  
  997. SOUND5:
  998.         inc     di
  999.         mov     al,es:[di]
  1000.         cmp     al,"I"
  1001.         jne     SOUND5
  1002.  
  1003.         inc     di
  1004.         mov     si,offset Irq_
  1005.         mov     al,es:[di]
  1006.         mov     ds:[si],al
  1007.  
  1008. SOUND6:
  1009.         inc     di
  1010.         mov     al,es:[di]
  1011.         cmp     al,"D"
  1012.         jne     SOUND6
  1013.  
  1014.         inc     di
  1015.         mov     si,offset DMA_
  1016.         mov     al,es:[di]
  1017.         mov     ds:[si],al
  1018.  
  1019.         mov     di,offset Card
  1020.         mov     byte ptr ds:[di],1
  1021.         mov     si,offset SB_Base
  1022.         inc     si
  1023.         mov     al,ds:[si]
  1024.         sub     al,30h
  1025.         mov     bx,200h
  1026.         xor     ah,ah
  1027.         shl     ax,4
  1028.         add     bx,ax
  1029.         mov     si,offset BASEADD
  1030.         mov     ds:[si],bx
  1031.         mov     si,offset Irq_
  1032.         mov     al,ds:[si]
  1033.         sub     al,30h
  1034.         mov     si,offset IRQ
  1035.         mov     ds:[si],al
  1036.         mov     si,offset DMA_
  1037.         mov     al,ds:[si]
  1038.         sub     al,30h
  1039.         mov     si,offset DMA
  1040.         mov     ds:[si],al
  1041.  
  1042.         RET
  1043.  
  1044. NO_Sound:
  1045.         mov     ax,data1
  1046.         mov     ds,ax
  1047.  
  1048.         RET
  1049.  
  1050. ;---------------------
  1051. ; Dump soundcard info.
  1052. ;---------------------
  1053.  
  1054. Sound_Info:
  1055.  
  1056.         mov     al,ds:[Card]
  1057.         cmp     al,0
  1058.         jne     SB_GUS
  1059.         mov     dx,offset NO_MUS
  1060.         mov     ax,0900h
  1061.         int     21h
  1062.         ret
  1063. SB_GUS: cmp     al,1
  1064.         jne     IS_GUS
  1065.         mov     dx,offset SBLAST
  1066.         mov     ax,0900h
  1067.         int     21h
  1068.         ret
  1069. IS_GUS: cmp     al,2
  1070.         jne     JOKE
  1071.         mov     dx,offset GUS
  1072.         mov     ax,0900h
  1073.         int     21h
  1074.         ret
  1075. JOKE:   ret
  1076.  
  1077. ;-------------------------------
  1078. ; RAW environment routines
  1079. ; A20 line code by Thomas Pytel.
  1080. ;-------------------------------
  1081. ENABLEA20:                              ; hardware enable gate A20
  1082.         pushf
  1083.         push fs gs
  1084.         cli
  1085.  
  1086.         xor ax,ax                       ; set A20 test segments 0 and 0ffffh
  1087.         mov fs,ax
  1088.         dec ax
  1089.         mov gs,ax
  1090.  
  1091.         call enablea20test              ; is A20 already enabled?
  1092.         jz short @@enablea20done        ; if yes, done
  1093.  
  1094.         in al,92h                       ; PS/2 A20 enable
  1095.         or al,2
  1096.         jmp short $+2
  1097.         jmp short $+2
  1098.         jmp short $+2
  1099.         out 92h,al
  1100.  
  1101.         call enablea20test              ; is A20 enabled?
  1102.         jz short @@enablea20done        ; if yes, done
  1103.  
  1104.         call enablea20kbwait            ; AT A20 enable
  1105.         jnz short @@enablea20f0
  1106.  
  1107.         mov al,0d1h
  1108.         out 64h,al
  1109.  
  1110.         call enablea20kbwait
  1111.         jnz short @@enablea20f0
  1112.  
  1113.         mov al,0dfh
  1114.         out 60h,al
  1115.  
  1116.         call enablea20kbwait
  1117.  
  1118. @@enablea20f0:                          ; wait for A20 to enable
  1119.         mov cx,800h                     ; do 800h tries
  1120.  
  1121. @@enablea20l0:
  1122.         call enablea20test              ; is A20 enabled?
  1123.         jz @@enablea20done              ; if yes, done
  1124.  
  1125.         in al,40h                       ; get current tick counter
  1126.         jmp short $+2
  1127.         jmp short $+2
  1128.         jmp short $+2
  1129.         in al,40h
  1130.         mov ah,al
  1131.  
  1132. @@enablea20l1:                          ; wait a single tick
  1133.         in al,40h
  1134.         jmp short $+2
  1135.         jmp short $+2
  1136.         jmp short $+2
  1137.         in al,40h
  1138.         cmp al,ah
  1139.         je @@enablea20l1
  1140.  
  1141.         loop @@enablea20l0              ; loop for another try
  1142.  
  1143. ;        mov bp,sp                       ; error, A20 did not enable
  1144.         mov ax,4                        ; error code 4
  1145. ;        mov word ptr [bp+6],offset init_done  ; set init_done return address
  1146.  
  1147. @@enablea20done:
  1148.         pop gs fs
  1149.         popf
  1150.         ret
  1151.  
  1152. ;-----------------------------------------------------------------------------
  1153. enablea20kbwait:                        ; wait for safe to write to 8042
  1154.         xor cx,cx
  1155. @@enablea20kbwaitl0:
  1156.         jmp short $+2
  1157.         jmp short $+2
  1158.         jmp short $+2
  1159.         in al,64h                       ; read 8042 status
  1160.         test al,2                       ; buffer full?
  1161.         loopnz @@enablea20kbwaitl0      ; if yes, loop
  1162.         ret
  1163.  
  1164. ;-----------------------------------------------------------------------------
  1165. enablea20test:                          ; test for enabled A20
  1166.         mov al,fs:[0]                   ; get byte from 0:0
  1167.         mov ah,al                       ; preserve old byte
  1168.         not al                          ; modify byte
  1169.         xchg al,gs:[10h]                ; put modified byte to 0ffffh:10h
  1170.         cmp ah,fs:[0]                   ; set zero if byte at 0:0 not modified
  1171.         mov gs:[10h],al                 ; put back old byte at 0ffffh:10h
  1172.         ret                             ; return, zero if A20 enabled
  1173.  
  1174. ;--------------------
  1175. ; Put your code here.
  1176. ;--------------------
  1177.  
  1178. rmode_code:
  1179.  
  1180.         jmp     st1
  1181.         INCLUDE PLAYER.INC      ;RUTINA DE LLAMADA AL PLAYER!!
  1182. st1:
  1183.  
  1184.         mov     bp,1
  1185.         call    PLAYER_FUNCTION ; Init
  1186.         jnc     init_ok
  1187.         RET
  1188.  
  1189. init_ok:
  1190.         mov     cx,Mod_seg
  1191.         mov     bp,2
  1192.         call    Player_function ; Load Mod
  1193.  
  1194.         mov     bp,3
  1195.         call    Player_function ; Play
  1196.  
  1197. ;---
  1198.  
  1199. check1:
  1200.         mov     bp,13
  1201.         call    Player_function ; Get Patt pos
  1202.         cmp     al,1
  1203.         jne     check1
  1204.  
  1205. ;---
  1206.  
  1207.         mov     ax,logo1
  1208.         mov     es,ax
  1209.         mov     ax,0A000h
  1210.         mov     fs,ax
  1211.  
  1212.         mov     ax,data2
  1213.         mov     ds,ax
  1214.  
  1215.     assume    ds:data2,es:nothing,fs:nothing,gs:nothing,ss:nothing
  1216.  
  1217. ;        xor     eax,eax
  1218. ;        xor     ebx,ebx
  1219.  
  1220. stretcher:
  1221.  
  1222.         mov     bp,offset Tabl
  1223.         add     bp,ds:[Pointer]
  1224.  
  1225.         xor     dx,dx
  1226.         xor     ax,ax
  1227.         mov     al,ds:[bp]
  1228.         shr     ax,1
  1229.         mov     bx,160
  1230.         sub     bx,ax
  1231.         mov     ds:[StartPoint],bx
  1232.  
  1233.         mov     ax,320
  1234.         xor     bx,bx
  1235.         mov     bl,ds:[bp]
  1236.         mov     ds:[Size_],bx
  1237.  
  1238.         div    bx
  1239.         mov    ds:[Integer],ax
  1240.         mov    ax,0
  1241.         div    bx
  1242.         mov    ds:[Fract],ax
  1243.                                       
  1244.  
  1245.         mov     si,offset logo
  1246.         mov     ax,ds:[Y]
  1247.         add     si,ax
  1248.         mov     di,offset Buffer
  1249.         add     di,ax
  1250.         add     di,ds:[StartPoint]
  1251.         xor     ax,ax
  1252.  
  1253.         mov     dx,ds:[Size_]
  1254.  
  1255. copy:
  1256.         push    dx
  1257.         mov     bx,ds:[Integer]
  1258.         mov     cx,ds:[Fract]
  1259.         add     ax,cx
  1260.         adc     si,bx
  1261.         inc     di
  1262.  
  1263.         mov     dh,es:[si]
  1264.         mov     ds:[di],dh
  1265.  
  1266.         pop     dx
  1267.         dec     dx
  1268.         jnz     copy
  1269.  
  1270.         add     ds:[Y],320
  1271.         cmp     ds:[Y],64000
  1272.         jb     go_on
  1273.  
  1274.        mov  dx,03dah
  1275. @retrace:
  1276.        in   al,dx
  1277.        test al,8
  1278.        je   @retrace
  1279. @retrac2:
  1280.        in   al,dx
  1281.        test al,8
  1282.        jne  @retrac2                    ; Wait for vertical retrace
  1283.  
  1284.         xor     ax,ax
  1285.         mov     ds:[Y],ax
  1286.  
  1287.         mov     si,offset Buffer
  1288.         xor     di,di
  1289.         mov     cx,16000
  1290.  
  1291. blitt:
  1292.         mov     eax,ds:[si]
  1293.         mov     fs:[di],eax
  1294.         add     si,4
  1295.         add     di,4
  1296.         dec     cx
  1297.         jnz     blitt
  1298.  
  1299.         mov     cx,16000
  1300.         mov     si,offset Buffer
  1301.         xor     eax,eax
  1302. @clear: mov     ds:[si],eax
  1303.         add     si,4
  1304.         dec     cx
  1305.         jnz     @clear
  1306.  
  1307. ; Compress...
  1308.  
  1309.         dec     ds:[Reduce]
  1310.         jz      end_of_thing
  1311.  
  1312.         mov     cl,70
  1313.         mov     si,offset Tabl
  1314. do_it:
  1315.         mov     al,ds:[si]
  1316.         cmp     al,1
  1317.         jbe     no_comp
  1318.         dec     al
  1319.         mov     ds:[si],al
  1320. no_comp:
  1321.         inc     si
  1322.         dec     cl
  1323.         jnz     do_it
  1324.  
  1325. go_on:
  1326.         inc     ds:[Pointer]
  1327.         cmp     ds:[Pointer],70
  1328.         je     restart
  1329.         in      al,60h
  1330.         cmp     al,1
  1331.         je      end_of_thing
  1332.         jmp     stretcher
  1333.  
  1334. restart:
  1335.         xor     ax,ax
  1336.         mov     ds:[Pointer],ax
  1337.         jmp     stretcher
  1338.  
  1339. end_of_thing:
  1340. ;---
  1341.  
  1342.  
  1343.         mov     ax,0013h
  1344.         int     10h
  1345.  
  1346. check2:
  1347.         mov     bp,13
  1348.         call    Player_function ; Get Patt pos
  1349.         cmp     al,2
  1350.         jne     check2
  1351.  
  1352.         jmp     plas_1
  1353.  
  1354.         Palplas LABEL   BYTE
  1355.                 i=0
  1356.                 REPT    63
  1357.                 db      i,0,0
  1358.                 i=i+1
  1359.                 ENDM
  1360.                 db      63,0,0
  1361.                 i=0
  1362.                 REPT    63
  1363.                 db      0,i,0
  1364.                 i=i+1
  1365.                 ENDM
  1366.                 db      0,63,0
  1367.                 i=0
  1368.                 REPT    63
  1369.                 db      0,0,i
  1370.                 i=i+1
  1371.                 ENDM
  1372.                 db      0,0,63
  1373.  
  1374.  
  1375. Sines   LABEL   BYTE
  1376.         include plasma.inc
  1377. Delta   DW      0
  1378.  
  1379. plas_1:
  1380.         include modex.inc
  1381.  
  1382.         mov     ax,cs
  1383.         mov     ds,ax
  1384.         mov     dx,3c8h
  1385.         xor     al,al
  1386.         out     dx,al
  1387.         mov     si,offset Palplas
  1388.         mov     cx,64*3*3
  1389.         inc     dx
  1390.         rep     outsb
  1391.  
  1392.         mov     ax,data3
  1393.         mov     ds,ax
  1394.         mov     di,offset Buffer
  1395.         mov     ax,cs
  1396.         mov     fs,ax
  1397.         mov     bp,offset Sines
  1398.         mov     si,bp
  1399.         mov     ax,0A000h
  1400.         mov     es,ax
  1401.  
  1402. Do_Plasma:
  1403.         mov     si,offset Sines
  1404.         add     si,cs:[Delta]
  1405.         mov     di,offset buffer
  1406.  
  1407. ;----------------------
  1408. ; Red plasma.
  1409. ; Col = sin(x)+sin(y)/2
  1410. ;----------------------
  1411.         xor     cx,cx   ; X
  1412.         xor     dx,dx   ; Y
  1413. Red_Plasma:
  1414.         add     si,cx
  1415.         mov     bl,fs:[si]      ; Sin(x)
  1416.         sub     si,cx
  1417.         add     si,dx
  1418.         mov     bh,fs:[si]      ; Sin(y)
  1419.         sub     si,dx
  1420.         add     bl,bh
  1421.         shr     bl,1
  1422.         mov     byte    ptr     ds:[di],bl     ; PutPixel
  1423.  
  1424.         inc     di
  1425.         inc     cx
  1426.         cmp     cx,319
  1427.         jb      Red_Plasma
  1428.         xor     cx,cx
  1429.         add     di,641
  1430.         inc     dx
  1431.         cmp     dx,66   ;132
  1432.         jge     Red_Done
  1433.         jmp     Red_Plasma
  1434.  
  1435. Red_Done:
  1436.  
  1437. ;-----------------
  1438. ; Green plasma.
  1439. ; Colour = sin (x)
  1440. ;-----------------
  1441.  
  1442.         xor     cx,cx   ; X
  1443.         xor     dx,dx   ; Y
  1444.         mov     di,offset buffer
  1445.         add     di,320
  1446.  
  1447. Green_Plasma:
  1448.         add     si,cx
  1449.         add     si,cs:[Delta]
  1450.         mov     bl,fs:[si]      ; Sin(x)
  1451.         sub     si,cx
  1452.         add     si,dx
  1453.         mov     bh,fs:[si]
  1454.         sub     si,dx
  1455.         sub     si,cs:[Delta]
  1456.         add     bh,64
  1457.         add     bl,64
  1458.         add     bl,bh
  1459.         shr     bl,1
  1460.         mov     byte    ptr     ds:[di],bl     ; PutPixel
  1461.  
  1462.         inc     di
  1463.         inc     cx
  1464.         cmp     cx,319
  1465.         jb      Green_Plasma
  1466.         xor     cx,cx
  1467.         add     di,641
  1468.         inc     dx
  1469.         cmp     dx,66   ; 132
  1470.         jge     Green_Done
  1471.         jmp     Green_Plasma
  1472.  
  1473. Green_Done:
  1474.  
  1475. ;-----------------
  1476. ; Blue plasma.
  1477. ; Colour = sin (y)
  1478. ;-----------------
  1479.  
  1480.         xor     cx,cx   ; X
  1481.         xor     dx,dx   ; Y
  1482.         mov     di,offset buffer
  1483.         add     di,640
  1484.         mov     si,offset Sines
  1485.  
  1486. Blue_Plasma:
  1487.         add     si,dx
  1488.         mov     bl,fs:[si]      ; Sin(x)
  1489.         sub     si,dx
  1490.         add     bl,128
  1491.         mov     byte    ptr     ds:[di],bl     ; PutPixel
  1492.  
  1493.         inc     di
  1494.         inc     cx
  1495.         cmp     cx,319
  1496.         jb      Blue_Plasma
  1497.         xor     cx,cx
  1498.         add     di,641
  1499.         inc     dx
  1500.         inc     dx
  1501.         cmp     dx,132  ;264
  1502.         jge     Blue_Done
  1503.         jmp     Blue_Plasma
  1504.  
  1505. Blue_Done:
  1506.  
  1507. ;-----------------------------
  1508. ; Blitt Buffer to planar Vmem.
  1509. ;-----------------------------
  1510.  
  1511.        mov  dx,03dah
  1512. @r1trace:
  1513.        in   al,dx
  1514.        test al,8
  1515.        je   @r1trace
  1516. @r1trac2:
  1517.        in   al,dx
  1518.        test al,8
  1519.        jne  @r1trac2                    ; Wait for vertical retrace
  1520.  
  1521. ;------------
  1522.  
  1523.         mov     si,offset buffer
  1524.         mov     di,8000    ;8000
  1525.         mov     ah,00000001b    ; Plane 0
  1526.         mov     al,02
  1527.         mov     dx,3c4h
  1528.         out     dx,ax
  1529.         mov     cx,16000
  1530.  
  1531. copy0:
  1532.         mov     al,ds:[si]
  1533.         mov     es:[di],al
  1534.         inc     di
  1535.         add     si,4
  1536.         dec     cx
  1537.         jne     copy0
  1538.  
  1539.  
  1540.         mov     ax,0A000h
  1541.         mov     es,ax
  1542.  
  1543.         mov     si,offset buffer
  1544.         add     si,1
  1545.         mov     di,8000    ;8000
  1546.         mov     ah,00000010b    ; Plane 1
  1547.         mov     al,02
  1548.         mov     dx,3c4h
  1549.         out     dx,ax
  1550.         mov     cx,16000
  1551.  
  1552. copy1:
  1553.         mov     al,ds:[si]
  1554.         mov     es:[di],al
  1555.         inc     di
  1556.         add     si,4
  1557.         dec     cx
  1558.         jne     copy1
  1559.  
  1560.         mov     si,offset buffer
  1561.         add     si,2
  1562.         mov     di,8000    ;8000
  1563.         mov     ah,00000100b    ; Plane 2
  1564.         mov     al,02
  1565.         mov     dx,3c4h
  1566.         out     dx,ax
  1567.         mov     cx,16000
  1568.  
  1569. copy2:
  1570.         mov     al,ds:[si]
  1571.         mov     es:[di],al
  1572.         inc     di
  1573.         add     si,4
  1574.         dec     cx
  1575.         jne     copy2
  1576.  
  1577.         mov     si,offset buffer
  1578.         add     si,3
  1579.         mov     di,8000    ;8000
  1580.         mov     ah,00001000b    ; Plane 3
  1581.         mov     al,02
  1582.         mov     dx,3c4h
  1583.         out     dx,ax
  1584.         mov     cx,16000
  1585.  
  1586. copy3:
  1587.         mov     al,ds:[si]
  1588.         mov     es:[di],al
  1589.         inc     di
  1590.         add     si,4
  1591.         dec     cx
  1592.         jne     copy3
  1593.  
  1594.         inc     cs:[Delta]
  1595.         cmp     cs:[Delta],445
  1596.         jb      Still
  1597.         xor     ax,ax
  1598.         mov     cs:[Delta],ax
  1599.  
  1600. Still:
  1601.         mov     bp,13
  1602.         call    Player_function ; Get Patt pos
  1603.         cmp     al,4
  1604.         je      Fin
  1605.         jmp     Do_Plasma
  1606.  
  1607. Fin:
  1608. ;---
  1609.  
  1610.         mov     ax,0013h
  1611.         int     10h
  1612.         mov     ax,0A000h
  1613.         mov     es,ax
  1614.         xor     eax,eax
  1615.         mov     cx,16000
  1616.         rep     stosd
  1617.  
  1618.         mov     ax,data4
  1619.         mov     ds,ax
  1620.  
  1621.         mov     si,offset cirpal
  1622.         xor     ax,ax
  1623.         mov     dx,3c8h
  1624.         out     dx,al
  1625.         inc     dx
  1626.         mov     cx,768
  1627.         rep     outsb
  1628.  
  1629. ;---
  1630.  
  1631. Main1:
  1632.         mov     bp,offset data4:circles
  1633.         add     bp,ds:[ZDelta]
  1634.         mov     si,offset data4:circles
  1635.         add     si,ds:[Delta2]
  1636.         xor     di,di
  1637.         mov     cx,16000
  1638. Circle:
  1639.         mov     eax,ds:[si]
  1640.         add     eax,ds:[bp]
  1641.         mov     es:[di],eax
  1642.         add     si,4
  1643.         cmp     si,offset data4:circles+64000
  1644.         jb      @10
  1645.         mov     si,offset data4:circles
  1646. @10:
  1647.         add     di,4
  1648.         add     bp,4
  1649.         cmp     bp,offset data4:circles+64000
  1650.         jb      @21
  1651.         mov     bp,offset data4:circles
  1652. ;        add     bp,fs:[ZDelta]
  1653. @21:
  1654.         cmp     si,offset data4:circles+64000
  1655.         jb      @3
  1656.         mov     si,offset data4:circles
  1657. @3:
  1658.         dec     cx
  1659.         jnz     Circle
  1660.  
  1661.  
  1662.        mov  dx,03dah
  1663. @vetrace:
  1664.        in   al,dx
  1665.        test al,8
  1666.        je   @vetrace
  1667. @vetrac2:
  1668.        in   al,dx
  1669.        test al,8
  1670.        jne  @vetrac2                    ; Wait for vertical retrace
  1671.  
  1672. ;        xor     si,si
  1673. ;        xor     di,di
  1674. ;        mov     cx,16000
  1675. ;        rep     movsd
  1676.  
  1677.         add     ds:[ZDelta],640  ;320
  1678.         cmp     ds:[ZDelta],64000
  1679.         jb      @1
  1680.         xor     ax,ax
  1681.         mov     ds:[ZDelta],ax
  1682.  
  1683. @1:     inc     ds:[Delta2]
  1684.         inc     ds:[Delta2]
  1685.         cmp     ds:[Delta2],64000
  1686.         jb      @5
  1687.         xor     ax,ax
  1688.         mov     ds:[Delta2],ax
  1689.  
  1690. @5:
  1691.  
  1692.         mov     bp,13
  1693.         call    Player_function ; Get Patt pos
  1694.         cmp     al,6
  1695.         je      fin4
  1696.  
  1697.         jmp     Main1
  1698.  
  1699. fin4:
  1700.  
  1701. ;----
  1702.  
  1703.         mov     ax,0003h
  1704.         int     10h
  1705.         mov     ax,cs
  1706.         mov     ds,ax
  1707.         mov     si,offset ANSI
  1708.         mov     ax,0B800h
  1709.         mov     es,ax
  1710.         xor     di,di
  1711.         mov     cx,1000
  1712.         rep     movsd
  1713.  
  1714.         mov     bp,10
  1715.         call    Player_function
  1716.  
  1717.         mov     ah,al
  1718.  
  1719. fade_vol:
  1720.         mov     al,ah
  1721.         mov     bp,11
  1722.         call    Player_function
  1723.  
  1724.         mov     dx,3dah
  1725. espera: in      al,dx
  1726.         test    al,8
  1727.         jnz     espera
  1728. esp2:   in      al,dx
  1729.         test    al,8
  1730.         jz      esp2
  1731.  
  1732.         dec     ah
  1733.         jnz     fade_vol
  1734.  
  1735.         mov     bp,4
  1736.         call    Player_function
  1737.         mov     bp,5
  1738.         call    Player_function
  1739.  
  1740.         RET
  1741.  
  1742.  
  1743. ;     10 GET_VOLUME              \ AL=MASTER_VOLUME
  1744. ;     11 SET_VOLUME              / BL=MUSIC_VOL, BH=FX_VOL
  1745.  
  1746. ;     13 GET_SONGPOSITION        \ AL=0..127 POSITION IN PATTERN ORDER
  1747. ;                                al=pattern bx=row
  1748.  
  1749.         ret
  1750.  
  1751. pre_code:
  1752.  
  1753.         mov     bx,20030     ;320000/16
  1754.     mov    ah,4ah
  1755.     int    21h
  1756.  
  1757.         push    ds
  1758.         push    es
  1759.  
  1760.         mov     ax,0013h
  1761.         int     10h
  1762.  
  1763.         mov     ax,logo1
  1764.         mov     ds,ax
  1765.         mov     ax,0A000h
  1766.         mov     es,ax
  1767.  
  1768.         mov     dx,3c8h
  1769.         xor     al,al
  1770.         out     dx,al
  1771.         mov     si,offset Pal
  1772.         mov     cx,768
  1773.         inc     dx
  1774.         rep     outsb
  1775.  
  1776.         mov     si,offset logo
  1777.         mov     di,offset Buffer
  1778.         mov     ax,logo1
  1779.         mov     es,ax
  1780.         mov     cx,16000
  1781.         rep     movsd
  1782.  
  1783.         mov     si,offset logo
  1784.         xor     di,di
  1785.         mov     ax,0A000h
  1786.         mov     es,ax
  1787.         mov     cx,16000
  1788.         rep     movsd
  1789.  
  1790.         pop     es
  1791.         pop     ds
  1792.  
  1793.         ret
  1794.  
  1795.  
  1796. comment $
  1797.  
  1798. ;=============================================================================
  1799. INIT_MUSIC PROC NEAR
  1800.     CALL    ALLOC_MUSIC        ;ALLOCATE MEMORY FOR PLAYER
  1801.     CALL    LOAD_PLAYER        ;LOAD THE RIGHT PLAYER
  1802.     MOV    MUSIC_FILE,0
  1803.     RET
  1804. INIT_MUSIC ENDP
  1805. ;=============================================================================
  1806. START_MUSIC PROC NEAR
  1807.     CMP    PLAYER,0        ;IS A PLAYER IN THE MEMORY?
  1808.     JE    SHORT GMUA1
  1809.     MOV    MUSIC_FILE,AX        ;LOAD MUSIC
  1810.     MOV    DX,OFFSET MOD_NAME
  1811.     MOV    BP,2
  1812.     CALL    PLAYER_FUNCTION
  1813.     JC    SHORT GMUA2
  1814.     CALL    MUSIC_SETTINGS        ;SET PLAYING PARMS
  1815.     CALL    LOAD_SAMPLES        ;LOAD SAMPLES
  1816.     MOV    BP,3            ;START MUSIC
  1817.     CALL    PLAYER_FUNCTION
  1818.     JNC    SHORT GMUA1
  1819. GMUA2:    CALL    STOP_MUSIC        ;DISABLE ALL MUSIC AFTER ERROR
  1820.     MOV    PLAYER,0
  1821.     CALL    FREE_MUSIC
  1822. GMUA1:    RET
  1823. START_MUSIC ENDP
  1824. ;=============================================================================
  1825. STOP_MUSIC PROC NEAR
  1826.     CMP    MUSIC_FILE,0
  1827.     JE    SHORT GMUC1
  1828.     MOV    BP,4            ;STOP MUSIC
  1829.     CALL    PLAYER_FUNCTION
  1830.     MOV    BP,8            ;REMOVE SAMPLES
  1831.     CALL    PLAYER_FUNCTION
  1832.     MOV    BP,5            ;REMOVE MUSIC
  1833.     CALL    PLAYER_FUNCTION
  1834. GMUC1:    MOV    MUSIC_FILE,0
  1835.     RET
  1836. STOP_MUSIC ENDP
  1837. ;=============================================================================
  1838. CLOSE_MUSIC PROC NEAR
  1839.     CALL    DEALLOC_MUSIC        ;REMOVE PLAYER
  1840.     RET
  1841. CLOSE_MUSIC ENDP
  1842. ;=============================================================================
  1843. PLAYER_FUNCTION PROC NEAR
  1844.     PUSHA
  1845.     PUSH    DS
  1846.     SHL    BP,2
  1847.     ADD    BP,0100H
  1848.     PUSH    CS
  1849.     PUSH    PLAYER_RETURN
  1850.     PUSH    SEG PLAYER
  1851.     PUSH    BP
  1852.     RETF
  1853. PLAYER_RETURN:
  1854.     POP    DS
  1855.     POPA
  1856.     RET
  1857. PLAYER_FUNCTION
  1858. ;=============================================================================
  1859.  
  1860. ;The functions of the players are translated to a number in BP:
  1861.  
  1862. ;BP =  1 CONFIG_INIT               IF CARRY RETURNED IS 1 THEN ERROR
  1863.         !!!siempre!!!
  1864.  
  1865.  
  1866. ;      2 LOAD_MOD  DS:DX IS POINTER TO FILENAME
  1867. ;                cx=segmento del modulo
  1868.  
  1869.  
  1870. ;      3 PLAY_MUSIC                IF CARRY RETURNED IS 1 THEN ERROR
  1871.  
  1872. ;      4 STOP_MUSIC
  1873.  ;     5 END_MUSIC
  1874.  
  1875.  
  1876.  
  1877. ;     10 GET_VOLUME              \ AL=MASTER_VOLUME
  1878. ;     11 SET_VOLUME              / BL=MUSIC_VOL, BH=FX_VOL
  1879.  
  1880. ;     13 GET_SONGPOSITION        \ AL=0..127 POSITION IN PATTERN ORDER
  1881. ;                                al=pattern bx=row
  1882.  
  1883. $
  1884.  
  1885. ; TheDraw Assembler Screen Image.  Date: 10/13/95
  1886.  
  1887. ANSI    LABEL   BYTE
  1888.  
  1889.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1890.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1891.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1892.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1893.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1894.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1895.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1896.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1897.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1898.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1899.         DB      '┌',7,'╦',7,'═',7,'═',15,'═',15,'╦',15,'┐',15,' ',15,'┌'
  1900.         DB      7,'╦',7,'═',7,'═',15,'═',15,'╦',15,'┐',15,' ',15,'┌',7
  1901.         DB      '╦',7,'═',7,'═',15,'═',15,'╦',15,'┐',15,' ',15,'┌',7,'╦'
  1902.         DB      7,'═',7,'╦',15,'═',15,'╦',15,'┐',15,' ',15,'┌',7,'╦',7
  1903.         DB      ' ',15,' ',15,' ',15,'╦',15,'┐',15,' ',15,' ',15,' ',15
  1904.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1905.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1906.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1907.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1908.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,'│',3,'╠',3
  1909.         DB      '═',3,'═',11,'═',11,'╩',11,'┘',11,' ',15,'├',3,'╬',3,'═'
  1910.         DB      3,'═',11,'═',11,'╬',11,'┤',11,' ',15,'│',3,'╠',3,'═',3
  1911.         DB      '═',11,'╦',11,'╩',11,'┘',11,' ',15,' ',15,' ',15,' ',15
  1912.         DB      '║',11,' ',15,' ',15,' ',15,' ',15,'└',3,'╩',3,'═',3,'═'
  1913.         DB      11,'═',11,'╣',11,'│',11,' ',15,' ',15,' ',15,' ',15,' '
  1914.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1915.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1916.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1917.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1918.         DB      15,' ',15,' ',15,' ',15,' ',15,'└',1,'╩',1,' ',15,' '
  1919.         DB      15,' ',15,' ',15,' ',15,' ',15,'└',1,'╩',1,' ',15,' '
  1920.         DB      15,' ',15,'╩',9,'┘',9,' ',15,'└',1,'╩',1,' ',15,' ',15
  1921.         DB      '╚',9,'═',9,'┘',9,' ',15,' ',15,' ',15,' ',15,'╩',9,' '
  1922.         DB      15,' ',15,' ',15,' ',15,'└',1,'╩',1,'═',1,'═',9,'═',9
  1923.         DB      '╩',9,'┘',9,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1924.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1925.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1926.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1927.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1928.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1929.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1930.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1931.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1932.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1933.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1934.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1935.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1936.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1937.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1938.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1939.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1940.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1941.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1942.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1943.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1944.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1945.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1946.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1947.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1948.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1949.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1950.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,'┌',7,'╦',7
  1951.         DB      '═',7,'═',15,'═',15,'╦',15,'┐',15,' ',15,'┌',7,'╦',7,'═'
  1952.         DB      7,'═',15,'═',15,'╦',15,'┐',15,' ',15,'┌',7,'╦',7,'═',7
  1953.         DB      '═',15,'╦',15,'─',15,'┐',15,' ',15,'┌',7,'╦',7,'═',7,'═'
  1954.         DB      15,'═',15,'╦',15,'┐',15,' ',15,' ',15,' ',15,' ',15,' '
  1955.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1956.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1957.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1958.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1959.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1960.         DB      15,' ',15,' ',15,' ',15,' ',15,'│',3,'║',3,' ',15,' '
  1961.         DB      15,' ',15,' ',15,' ',15,' ',15,'│',3,'║',3,' ',15,' '
  1962.         DB      15,' ',15,'║',11,'│',11,' ',15,'│',3,'║',3,' ',15,' '
  1963.         DB      15,'╚',11,'╦',11,'┤',11,' ',15,'├',3,'╬',3,'═',3,'═',11
  1964.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1965.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1966.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1967.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1968.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1969.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1970.         DB      ' ',15,' ',15,' ',15,' ',15,'└',1,'╩',1,'═',1,'═',9,'═'
  1971.         DB      9,'╩',9,'┘',9,' ',15,'└',1,'╩',1,'═',1,'═',9,'═',9,'╩'
  1972.         DB      9,'┘',9,' ',15,'└',1,'╩',1,'═',1,'═',9,'═',9,'╩',9,'┘'
  1973.         DB      9,' ',15,'└',1,'╩',1,'═',1,'═',9,'═',9,'╩',9,'┘',9,' '
  1974.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1975.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1976.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1977.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1978.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1979.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1980.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1981.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1982.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1983.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1984.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1985.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1986.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1987.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1988.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1989.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1990.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1991.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  1992.         DB      15,' ',15,' ',15,' ',15,' ',15,'┌',7,'╦',7,'═',7,'═',15
  1993.         DB      '═',15,'╦',15,'┐',15,' ',15,'┌',7,'╦',7,' ',15,' ',15
  1994.         DB      ' ',15,'╦',15,'┐',15,' ',15,'┌',7,'╦',7,' ',15,' ',15
  1995.         DB      ' ',15,' ',15,' ',15,' ',15,'┌',7,'╦',7,'═',7,'═',15,'═'
  1996.         DB      15,'╦',15,'┐',15,' ',15,'┌',7,'╦',7,'═',7,'═',15,'═',15
  1997.         DB      '╦',15,'┐',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1998.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  1999.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  2000.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  2001.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  2002.         DB      ' ',15,' ',15,' ',15,'│',3,'╠',3,'═',3,'═',11,'╦',11,'╩'
  2003.         DB      11,'┘',11,' ',15,'│',3,'║',3,' ',15,' ',15,' ',15,'║'
  2004.         DB      11,'│',11,' ',15,'│',3,'║',3,' ',15,' ',15,' ',15,' '
  2005.         DB      15,' ',15,' ',15,'├',3,'╬',3,'═',3,'═',11,' ',15,' ',15
  2006.         DB      ' ',15,' ',15,'└',3,'╩',3,'═',3,'═',11,'═',11,'╦',11,'┐'
  2007.         DB      11,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2008.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2009.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2010.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2011.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2012.         DB      15,' ',15,'└',1,'╩',1,' ',15,' ',15,'╚',9,'═',9,'┘',9
  2013.         DB      ' ',15,'└',1,'╩',1,'═',1,'═',9,'═',9,'╩',9,'┘',9,' ',15
  2014.         DB      '└',1,'╩',1,'═',1,'═',9,'═',9,'╩',9,'┘',9,' ',15,'└',1
  2015.         DB      '╩',1,'═',1,'═',9,'═',9,'╩',9,'┘',9,' ',15,'└',1,'╩',1
  2016.         DB      '═',1,'═',9,'═',9,'╩',9,'┘',9,' ',15,' ',15,' ',15,' '
  2017.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2018.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2019.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2020.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2021.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2022.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2023.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2024.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2025.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2026.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2027.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2028.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2029.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2030.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2031.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2032.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2033.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2034.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2035.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2036.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2037.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2038.         DB      15,'·',15,' ',15,'G',15,' ',15,'·',15,' ',15,'O',15,' '
  2039.         DB      15,'·',15,' ',15,'R',15,' ',15,'·',15,' ',15,'E',15,' '
  2040.         DB      15,'·',15,' ',15,'·',15,' ',15,'D',15,' ',15,'·',15,' '
  2041.         DB      15,'E',15,' ',15,'·',15,' ',15,'S',15,' ',15,'·',15,' '
  2042.         DB      15,'I',15,' ',15,'·',15,' ',15,'G',15,' ',15,'·',15,' '
  2043.         DB      15,'N',15,' ',15,'·',15,' ',15,' ',15,39,15,' ',15,'·'
  2044.         DB      15,' ',15,'9',15,' ',15,'·',15,' ',15,'5',15,' ',15,'·'
  2045.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2046.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2047.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2048.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2049.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2050.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2051.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2052.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2053.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2054.         DB      15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═',15,'═'
  2055.         DB      15,'═',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2056.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2057.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2058.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2059.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2060.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2061.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2062.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2063.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2064.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2065.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2066.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2067.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2068.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2069.         DB      15,' ',15,' ',15,'C',15,'o',15,'d',15,'e',15,' ',15,'.'
  2070.         DB      15,'.',15,'.',15,'.',15,'.',15,'.',15,'.',15,'.',15,'.'
  2071.         DB      15,'.',15,'.',15,'.',15,'.',15,'.',15,' ',15,'F',15,'l'
  2072.         DB      15,'y',15,'n',15,'n',15,'/',15,'G',15,'o',15,'r',15,'e'
  2073.         DB      15,' ',15,'D',15,'e',15,'s',15,'i',15,'g',15,'n',15,' '
  2074.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2075.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2076.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2077.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2078.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2079.         DB      15,' ',15,' ',15,'G',15,'f',15,'x',15,' ',15,'+',15,' '
  2080.         DB      15,'T',15,'u',15,'n',15,'e',15,' ',15,'.',15,'.',15,'.'
  2081.         DB      15,'.',15,'.',15,'.',15,'.',15,'.',15,' ',15,'S',15,'a'
  2082.         DB      15,'c',15,'e',15,'2',15,'/',15,'G',15,'o',15,'r',15,'e'
  2083.         DB      15,' ',15,'D',15,'e',15,'s',15,'i',15,'g',15,'n',15,' '
  2084.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2085.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2086.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2087.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2088.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2089.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2090.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2091.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2092.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2093.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2094.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2095.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2096.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,'T',15,'h'
  2097.         DB      15,'a',15,'n',15,'k',15,'s',15,' ',15,'g',15,'o',15,' '
  2098.         DB      15,'t',15,'o',15,':',15,' ',15,' ',15,' ',15,' ',15,' '
  2099.         DB      15,' ',15,' ',15,'C',15,'r',15,'a',15,'n',15,'k',15,'y'
  2100.         DB      15,' ',15,'&',15,' ',15,'A',15,'s',15,'t',15,'a',15,'r'
  2101.         DB      15,'o',15,'t',15,'h',15,' ',15,'o',15,'f',15,' ',15,'T'
  2102.         DB      15,'.',15,'L',15,'.',15,'O',15,'.',15,'T',15,'.',15,'B'
  2103.         DB      15,'.',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2104.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2105.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2106.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2107.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2108.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2109.         DB      15,' ',15,' ',15,'S',15,'h',15,'a',15,'d',15,'e',15,' '
  2110.         DB      15,'&',15,' ',15,'F',15,'o',15,'x',15,' ',15,'o',15,'f'
  2111.         DB      15,' ',15,'A',15,'l',15,'i',15,'e',15,'n',15,' ',15,' '
  2112.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2113.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2114.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2115.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2116.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2117.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2118.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2119.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2120.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2121.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2122.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2123.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2124.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2125.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2126.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2127.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2128.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2129.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2130.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2131.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2132.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2133.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2134.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2135.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  2136.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  2137.  
  2138.  
  2139. progen    label    byte
  2140.  
  2141. code16  ends
  2142.  
  2143. end     start
  2144.  
  2145.