1 ;;=======================================================================;;
\r
3 ;; Scrolling Routines -- main program ;;
\r
5 ;; All other INC files are included here. The main routines for the ;;
\r
6 ;; frame-by-frame execution loop are also here. Finally I tried to keep ;;
\r
7 ;; global variables stored in this file as well. ;;
\r
9 ;;=======================================================================;;
\r
15 extrn ZTimerOn:far, ZTimerOff:far, ZTimerReport:far
\r
17 INCLUDE constant.inc
\r
20 DW_TABLE MACRO inc,num
\r
23 WHILE (count LT num)
\r
26 number = number + inc
\r
38 MultBufWidth label WORD
\r
40 MultVirtWidth label WORD
\r
41 DW_TABLE (VIRTUAL_WIDTH/4),200
\r
49 ;INCLUDE sprite.inc NOT FOR NOW
\r
52 ;; Various segments that need to be filled in later...
\r
54 segVideo dw 0A000h ; videoram segment
\r
55 segText dw 0B800h ; text segment
\r
56 segMap dw -1 ; Map info segment
\r
57 segTiles dw -1 ; Tile bitmap segment
\r
58 segBuffer dw -1 ; Local 320x200 buffer segment
\r
59 segCode dw -1 ; Code segment
\r
60 segPSP dw -1 ; PSP segment
\r
61 segPalette dw -1 ; Palette segment
\r
62 segTextPal dw -1 ; Saved text palette
\r
67 ;; This routine is called for each frame.
\r
68 ;; Right now it just scrolls, but later all sprite animation would
\r
72 call Scroll ; Scrolls the screen
\r
73 ; call AnimateSprites ; prepares sprites on drawpage
\r
74 jmp FlipPage ; shows drawpage...
\r
78 ;; Each frame -- call the frame motion code, then check for keyhit.
\r
81 next_frame: call OneFrame
\r
83 JKEYP kESC,all_done ; ESC -> quit, always
\r
85 mov al,bDoTransition
\r
88 transition: FLASH_OFF 16,segPalette
\r
92 mov nMap,ax ; Flip maps
\r
95 call update_full ;<<<<
\r
97 FLASH_ON 16,segPalette
\r
102 ;; Beginning code -- Leaves text mode (saving the text screen) via
\r
103 ;; a fade. It loads the map data and draws one
\r
104 ;; frame before it fades on.
\r
105 Beginning PROC near
\r
107 PAL_SAVE segTextPal
\r
108 FADE_OFF 1,segTextPal
\r
110 MODEX_START ; 320x200 Mode X graphics mode
\r
113 call LoadData ; This call will change...
\r
115 call update_full ;<<<<
\r
117 FADE_ON 1,segPalette
\r
121 ;; Ending code -- restore to text mode via a flash
\r
123 FLASH_OFF 8,segPalette
\r
125 FLASH_ON 8,segTextPal
\r