home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / BKISSSRC.ZIP / SLIDETXT.ASM < prev    next >
Assembly Source File  |  1994-02-13  |  3KB  |  126 lines

  1. ideal
  2. locals
  3. jumps
  4. model huge
  5. stack 100h
  6. p386
  7.  
  8. TextMode = 0
  9.  
  10.  
  11. segment     MyData
  12. ScrollText  db "jl enterprises",0
  13.             db "presents",0
  14.             db "its second",0
  15.             db "demo ever!",0
  16.             dw -1
  17. ScrollPtr   dw offset ScrollText
  18. MyPalette   db 0,0,0,   8,8,8,   16,16,16,   24,24,24,   32,32,32
  19.             db 40,40,40,   48,48,48,   56,56,56,   63,63,63
  20.             db 247 dup (0,0,0)
  21. extrn       FontData:byte           ;this should be a valid JLF font
  22. ends        MyData
  23.  
  24. segment     MyCode
  25.             assume cs:MyCode, ds:MyData
  26. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  27. include     "drawstrx.inc"
  28. include     "modex.inc"
  29. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  30. proc        Start
  31.             ;set up all of the segments
  32.             cld
  33.             mov ax,MyData
  34.             mov ds,ax
  35.  
  36.             ;switch over to graphics mode
  37.             @SetModeX M320x200x256,320*4
  38.             ScrWidth = 320
  39.             ScrHeight = 200
  40.             PageSize = ScrWidth/4*ScrHeight
  41.  
  42.             ;load in the palette
  43.             mov si,offset MyPalette
  44.             mov ax,0
  45.             mov cx,256
  46.             @WritePalette
  47.  
  48. @@MainLoop: ;reset the starting offset
  49.             mov bx,0
  50.             @Set_Start_Offset
  51.  
  52.             ;clear our text buffer
  53.             mov ah,1111b
  54.             @Set_Write_Plane
  55.             mov es,[VGASeg]
  56.             mov di,0
  57.             mov cx,(PageSize/2)*4
  58.             xor ax,ax
  59.             cld
  60.             rep stosw
  61.  
  62.             ;if we've reached the end of the text, do something
  63.             mov si,[ScrollPtr]
  64.             cmp [word si],-1
  65.             jnz @@GotText
  66.             jmp @@AllDone
  67.  
  68.             ;render the text
  69. @@GotText:  push 0
  70.             push 80 320+0
  71.             push (seg ScrollText) [ScrollPtr]
  72.             push (seg FontData) (offset FontData)
  73.             call _Draw_String
  74.             add sp,14
  75.  
  76.             ;seek to the next line of text
  77.             mov si,[ScrollPtr]
  78. @@FindEnd:  lodsb
  79.             or al,al
  80.             jnz @@FindEnd
  81.             mov [ScrollPtr],si
  82.  
  83.             ;slide the text by really quickly
  84.             mov bx,0
  85. @@Slide:    @FullVertWait
  86.             @Set_Start_Offset
  87.             add bx,4
  88.             cmp bx,(320*2)/4
  89.             jb @@Slide
  90.  
  91.             ;display the text so that it's readable
  92.             mov bx,(320/4)
  93.             @Set_Start_Offset
  94.  
  95.             ;pause for a bit
  96.             mov cx,45
  97. @@Pause:    @FullVertWait
  98.             loop @@Pause
  99.  
  100.             ;get the text off the screen
  101.             mov bx,0
  102.             @Set_Start_Offset
  103.  
  104.             ;pause some more
  105.             mov cx,30
  106. @@Pause2:   @FullVertWait
  107.             loop @@Pause2
  108.  
  109.             ;get stdio.  If something's been pressed, quit
  110.             mov ah,6
  111.             mov dl,0FFh
  112.             int 21h
  113.             jz @@MainLoop
  114.  
  115. @@AllDone:  ;change back to text mode and quit
  116.             if TextMode ne 0
  117.                 mov ax,0003h
  118.                 int 10h
  119.             endif
  120.             mov ax,4C00h
  121.             int 21h
  122. endp        Start
  123. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  124. ends        MyCode
  125.             end     Start
  126.