home *** CD-ROM | disk | FTP | other *** search
/ Der Mediaplex Sampler - Die 6 von Plex / 6_v_plex.zip / 6_v_plex / DISK3 / DFUE_100 / FAMITXT.ZIP / FAIRLIGH.TXT < prev    next >
Text File  |  1994-02-07  |  21KB  |  759 lines

  1.                         This fine text file came from...
  2.  
  3.               /\____     __/\____           /\ _______/\__/\________
  4.              / __  //\   \_\/___ \  /\      \// _____/ /_/ /__  _  /
  5.          ___/ /__\//  \  /\  __/ / / / ___/\_/ /_   / /_/ /  / / \/ 
  6.          \_/ /__/ / /\ \/ / / __/ / /  \_/ // /_ \ / /_  /  / /     
  7.          _/ /    / /  \ \/__\ \__/ /_/\ / // /_/ / \/ / /  / /      
  8.          \_/[SP] \/   /\_____\ \_\____/ \/ \__  /    / /   \/       
  9.                       \/      \/            _/ /     \/             
  10.                                             \_/                
  11.                                                                S.H.Q
  12.                           Far Out Multi Node System
  13.                                               
  14.         Node1 +46-46-133489   Node2 +46-46-133482   Node3 +46-46-133424
  15.                                 
  16.     If you want to read this then download it!  No free loaders here!!
  17.                                     
  18. ╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖╖
  19. -------->      a SMaSHiNG 100% SUPER NiNTENDo oNLY SYSTEM        <----------
  20.    ___/\____/\____    /\______    /\       /\_____/\__________  /\  /\
  21.    \____   / __   \  /   __   \  /  \ /\  /     _    ______   \/  \/  \
  22.     / _/ _/  _/\/\ \/   / /\   \/   // / /   /\//   /   / /\   \ _ \   \
  23.    /  \  \_     \ \    /  \/       /_\ \/   /  /   /   /  \/   /  \    /
  24.    \  /\  /______\ \  /\______/\___  /\____/   \  /\  /\__________/\  /
  25.     \/  \/          \/             \/           \/  \/              \/
  26. ---------> +46-431-51557 ----- SYSoP: SY-KLoNE - CoSYSoP: HiTMaN <-----------
  27.  
  28. ; Corsair presents an example of how to drive the hardware - basically I used this intro
  29.  
  30. ; cos everyone knows how it looks and thus it seemed a good bit of code to do..
  31.  
  32. ; the comments outside the hardware stuff are a bit sparse - i'm not teaching you how
  33.  
  34. ; Fairlight write code , just their use of hardware!!
  35.  
  36. ;
  37.  
  38. ; questions as usual leave on GRAVEYARD, Treasure Island or Oasis..
  39.  
  40. ;
  41.  
  42.  
  43.  
  44.  
  45.  
  46. Start Of Intro From Fairlight
  47.  
  48. ------------------------------------------------
  49.  
  50. 00E000 78                     SEI            ; disable irq ints  
  51.  
  52. 00E001 A9 8F                  LDA #$8F            ;
  53.  
  54. 00E003 8D 00 21               STA Screen_Fader        ; turn screen on at full brightness
  55.  
  56. 00E006 9C 00 42               STZ $4200            ;
  57.  
  58. 00E009 9C 0C 42               STZ Start_DMA_Hi        ; disable all 8 DMA channels
  59.  
  60. 00E00C 9C 0B 42               STZ Start_DMA_Lo        ;
  61.  
  62. 00E00F 18                     CLC             ;
  63.  
  64. 00E010 FB                     XCE             ; place in native (16 bit) mode
  65.  
  66. 00E011 C2 30                  REP #$30            ; set x,y,a all to 16 bit
  67.  
  68. 00E013 A9 00 00               LDA #$0000        ; 
  69.  
  70. 00E016 5B                     TCD             ; set direct register to bank zero
  71.  
  72. 00E017 64 07                  STZ $07            ; clear memory loc. 7
  73.  
  74. 00E019 A9 20 00               LDA #$0020        ;
  75.  
  76. 00E01C 85 0B                  STA $0B            ; set $0b.w = $0020
  77.  
  78. 00E01E E2 20                  SEP #$20            ; set accum. to 8 bit
  79.  
  80. 00E020 A9 80                  LDA #$80            ;
  81.  
  82. 00E022 8D 15 21               STA Video_Port_Control    ; initialise Video Port Controller
  83.  
  84. 00E025 A2 00 10               LDX #$1000        ;
  85.  
  86. 00E028 8E 16 21               STX Video_Port_Address    ; Point Vram Pointer To $1000
  87.  
  88.  
  89.  
  90. 00E02B A9 5B                  LDA #$5B                ;
  91.  
  92. 00E02D 85 0D                  STA $0D                 ; Copies $5bx8 bytes of char
  93.  
  94. 00E02F A2 00 00               LDX #$0000              ; data into Video Ram via the port
  95.  
  96. outer_loop:                        ; thus giving 2
  97.  
  98. 00E032 A0 08 00               LDY #$0008              ;
  99.  
  100. inner_loop:                        ;
  101.  
  102. 00E035 BD D3 E2               LDA CHAR_SET,X          ; .: Character set for intro
  103.  
  104. 00E038 8D 18 21               STA Video_Port_Lo        ;    and FLT logo.
  105.  
  106. 00E03B 9C 19 21               STZ Video_Port_Hi        ;
  107.  
  108. 00E03E E8                     INX                     ;
  109.  
  110. 00E03F 88                     DEY                     ;
  111.  
  112. 00E040 D0 F3                  BNE inner_loop           ;
  113.  
  114. 00E042 C6 0D                  DEC $0D                 ;
  115.  
  116. 00E044 D0 EC                  BNE outer_loop           ;
  117.  
  118.  
  119.  
  120. 00E046 9C 05 21               STZ $2105            ; clear Video Reg. unknown
  121.  
  122. 00E049 A9 04                  LDA #$04                ; set Playfield 0 To $400 and 32x32 chars
  123.  
  124. 00E04B 8D 07 21               STA Playfield_0_Addr    ; 
  125.  
  126. 00E04E A9 08                  LDA #$08                ; set Playfield 1 to $800 and 32x32 chars
  127.  
  128. 00E050 8D 08 21               STA Playfield_1_Addr    ;
  129.  
  130. 00E053 A9 11                  LDA #$11                ; Set Playfield 0+1 Tile Addr To $100
  131.  
  132. 00E055 8D 0B 21               STA Tile01_Vram_Addr    ;
  133.  
  134.  
  135.  
  136. 00E058 A2 07 00               LDX #$0007              ;
  137.  
  138. 00E05B 9E 0D 21               STZ Plane_0_Scroll_X,X    ; Clear All The Scroll Pointers
  139.  
  140. 00E05E 9E 0D 21               STZ Plane_0_Scroll_X,X     ;
  141.  
  142. 00E061 CA                     DEX             ;
  143.  
  144. 00E062 10 F7                  BPL $00E05B        ;
  145.  
  146.  
  147.  
  148. 00E064 A2 07 00               LDX #$0007        ;
  149.  
  150. 00E067 9E 23 21               STZ $2123,X        ; Clear Video Registers $2123-$212a
  151.  
  152. 00E06A CA                     DEX             ;
  153.  
  154. 00E06B 10 FA                  BPL $00E067        ;
  155.  
  156.  
  157.  
  158. 00E06D A9 03                  LDA #$03            ;
  159.  
  160. 00E06F 8D 2C 21               STA Playfield_Enable    ; Enable playfields 0 & 1
  161.  
  162. 00E072 A2 04 00               LDX #$0004        ;
  163.  
  164. 00E075 9E 2D 21               STZ $212D,X        ; Clear Video Registers $212d-$2130
  165.  
  166. 00E078 CA                     DEX             ;
  167.  
  168. 00E079 10 FA                  BPL $00E075        ;
  169.  
  170.  
  171.  
  172. 00E07B 9C 33 21               STZ Interlace_Flags    ; Disable Interlace Mode
  173.  
  174. 00E07E A9 04                  LDA #$04            ;
  175.  
  176. 00E080 9C 16 21               STZ Video_Port_Address    ; Set Video Port Address to $400
  177.  
  178. 00E083 8D 17 21               STA Video_Port_Address+1    ;
  179.  
  180. 00E086 A9 80                  LDA #$80            ;
  181.  
  182. 00E088 8D 15 21               STA Video_Port_Controller    ; Initialise Video Controller
  183.  
  184.  
  185.  
  186. 00E08B A2 00 08               LDX #$0800        ;
  187.  
  188. 00E08E 9C 19 21               STZ Video_Port_Data+1    ; Clear $800 bytes of Vram from $400 upwards
  189.  
  190. 00E091 CA                     DEX                     ;
  191.  
  192. 00E092 D0 FA                  BNE $00E08E        ;
  193.  
  194.  
  195.  
  196. 00E094 A2 AB E5               LDX #$E5AB              ; Display Text From $e5ab on..
  197.  
  198. 00E097 20 3E E2               JSR DO_TEXT             ; 
  199.  
  200. 00E09A A9 08                  LDA #$08            ;
  201.  
  202. 00E09C 9C 16 21               STZ Video_Port_Address    ; Set Video Port Address to $800 
  203.  
  204. 00E09F 8D 17 21               STA Video_Port_Address+1    ; 
  205.  
  206. 00E0A2 9C 15 21               STZ Video_Port_Controller    ; Clear Video Port Controller
  207.  
  208.  
  209.  
  210. 00E0A5 A2 00 00               LDX #$0000        ;
  211.  
  212. 00E0A8 BD 91 E6               LDA $E691,X             ; Copy $a0 bytes down into Vram location
  213.  
  214. 00E0AB 8D 18 21               STA Video_Port_Data    ; $800 onwards
  215.  
  216. 00E0AE E8                     INX             ; 
  217.  
  218. 00E0AF E0 A0 00               CPX #$00A0        ;
  219.  
  220. 00E0B2 D0 F4              BNE $E0A8            ;
  221.  
  222.  
  223.  
  224. 00E0B4 A9 20              LDA #$20            ;
  225.  
  226. 00E0B6 8D 18 21               STA Video_Port_Data    ; Fill One Screen Worth of VRAM with 
  227.  
  228. 00E0B9 E8                     INX             ; spaces
  229.  
  230. 00E0BA E0 00 04               CPX #$400            ;
  231.  
  232. 00E0BD D0 F7              BNE $E0B6            ;
  233.  
  234.  
  235.  
  236. 00E0BF A9 A8              LDA #$A8            ;
  237.  
  238. 00E0C1 8D 00 0C               STA $0C00            ; $c00 = $a8
  239.  
  240. 00E0C4 8D 00 0D               STA $0D00            ; $d00 = $a8
  241.  
  242.  
  243.  
  244. 00E0C7 A9 21                  LDA #$21            ;
  245.  
  246. 00E0C9 A2 00 00               LDX #$0000        ; set $c01-$c028 = $21
  247.  
  248. 00E0CC 9D 01 0C               STA $0C01,X        ;
  249.  
  250. 00E0CF E8                     INX             ; ie set up the color pointer table
  251.  
  252. 00E0D0 E0 28 00               CPX #$0028        ;
  253.  
  254. 00E0D3 D0 F7              BNE $E0CC            ;
  255.  
  256.  
  257.  
  258. 00E0D5 A9 F8              LDA #$F8            ;
  259.  
  260. 00E0D6 F8                     SED             ; set decimal flag on
  261.  
  262. 00E0D7 9D 01 0C               STA $0C01,X        ;
  263.  
  264. 00E0DA A9 01                  LDA #$01            ; set more low memory
  265.  
  266. 00E0DC 9D 02 0C               STA $0C02,X        ;
  267.  
  268. 00E0DF E8                     INX             ;
  269.  
  270. 00E0E0 E0 A0 00               CPX #$00A0        ; and further color palette set-up
  271.  
  272. 00E0E3 D0 F7              BNE $E0DC            ;
  273.  
  274.  
  275.  
  276. 00E0E5 9e 02 0C              STZ $C02,X        ;
  277.  
  278. 00E0E8 A9 0B                  LDA #$0B            ;
  279.  
  280. 00E0EA A2 00 00               LDX #$0000        ; set even more low memory 
  281.  
  282. 00E0ED 9D 01 0D               STA $0D01,X        ; - seems to set it to $b and then clear it??
  283.  
  284. 00E0F0 E8                     INX             ;
  285.  
  286. 00E0F1 9E 01 0D               STZ $0D01,X        ;
  287.  
  288. 00E0F4 1A                     INC A            ; pallete data set up
  289.  
  290. 00E0F5 E8                     INX             ;
  291.  
  292. 00E0F6 E0 28 00               CPX #$0028        ;
  293.  
  294. 00E0F9 D0 F2              BNE $E0ED            ;
  295.  
  296.  
  297.  
  298. 00E0FB 9D 01 0D              STA $0D01,X               ;   
  299.  
  300. 00E0FE E8                     INX             ;
  301.  
  302. 00E0FF 9E 01 0D               STZ $0D01,X        ;
  303.  
  304. 00E102 3A                     DEC A            ; and more 'irelevant' low mem stuff
  305.  
  306. 00E103 E8                     INX             ;
  307.  
  308. 00E104 E0 50                  CPX #$0050        ; more palette data set-up
  309.  
  310. 00E107 D0 F2                  BNE $E0FB            ;
  311.  
  312.  
  313.  
  314. 00E109 A9 F8              LDA #$F8            ;
  315.  
  316. 00E10B 9D 01 0D               STA $0D01,X        ;
  317.  
  318. 00E10E A9 FF                  LDA #$FF            ; and more 'irelevant' low mem stuff
  319.  
  320. 00E110 9D 02 0D               STA $0D02,X        ;
  321.  
  322. 00E113 E8                     INX             ; more palette data set-up
  323.  
  324. 00E114 E0 40 01               CPX #$0140        ;
  325.  
  326. 00E117 D0 F7              BNE $E109            ;
  327.  
  328. 00E119 9E 02 0D              STZ $D02,X        ;
  329.  
  330.  
  331.  
  332. 00E11C 9C 0C 42               STZ DMA_Enable        ; Disable all DMA channels
  333.  
  334. 00E11F 9C 10 43               STZ DMA_Control_1        ;
  335.  
  336. 00E122 A9 02                  LDA #$02               ; set up control regs for channel 1+2
  337.  
  338. 00E124 8D 20 43               STA DMA_Control_2        ;
  339.  
  340. 00E127 A9 21                  LDA #$21               ; Select pallete pointer + color for
  341.  
  342. 00E129 8D 11 43               STA DMA_Destination_1    ; DMA dump destination
  343.  
  344. 00E12C 1A                     INC A                  ;
  345.  
  346. 00E12D 8D 21 43               STA DMA_Destination_2    ;
  347.  
  348. 00E130 A2 00 0C               LDX #$0C00             ;
  349.  
  350. 00E133 8E 12 43               STX DMA_Source_Addr_1    ; Palette numbers from $0c00 
  351.  
  352. 00E136 A2 00 0D               LDX #$0D00             ;
  353.  
  354. 00E139 8E 22 43               STX DMA_Source_Addr_2    ; Palette data from $0d00
  355.  
  356. 00E13C 9C 14 43               STZ DMA_Source_Bank_1    ;
  357.  
  358. 00E13F 9C 24 43               STZ DMA_Source_Bank_2    ;
  359.  
  360. 00E142 A9 06                  LDA #$06            ; turn on DMA channels 1+2
  361.  
  362. 00E144 8D 0C 42               STA DMA_Enable        ;
  363.  
  364.  
  365.  
  366. 00E147 A9 0F                  LDA #$0F            ; turn off screen
  367.  
  368. 00E149 8D 00 21               STA Screen_Fader        ;
  369.  
  370. 00E14C A9 01                  LDA #$01            ;
  371.  
  372. 00E14E 8D 00 42               STA $4200            ; errmm
  373.  
  374. 00E151 20 C1 E1               JSR Pad_Poll_Hi        ; Wait for poll hi
  375.  
  376. 00E154 9C 21 21               STZ Palette_Color_Pointer ; 
  377.  
  378. 00E157 9C 22 21               STZ Palette_Color_Data    ; set background to black
  379.  
  380. 00E15A 9C 22 21               STZ Palette_Color_Data    ;
  381.  
  382. 00E15D 4C 97 E1               JMP $00E197
  383.  
  384. ------------------------------------------------
  385.  
  386. 00E160 20 C1 E1               JSR Pad_Poll_Hi        ; wait for poll hi
  387.  
  388. 00E163 20 13 E2               JSR PROC_B
  389.  
  390.  
  391.  
  392. 00E166 AD 12 42               LDA Pad_Poll        ; Wait until a button has been
  393.  
  394. 00E169 4A                     LSR A            ; pressed
  395.  
  396. 00E16A B0 FA                  BCS $00E166        ;
  397.  
  398.  
  399.  
  400. 00E16C 20 CD E1               JSR PROC_A        ;
  401.  
  402. 00E16F A9 F0                  LDA #$F0            ;
  403.  
  404. 00E171 25 0A                  AND $0A            ;
  405.  
  406. 00E173 F0 46                  BEQ $00E1BB        ;
  407.  
  408. 00E175 5C 00 80 00            JMP GAME            ; and run the game..
  409.  
  410. ------------------------------------------------
  411.  
  412. 00E179 A9 01                  LDA #$01            ;
  413.  
  414. 00E17B A2 01 00               LDX #$0001        ;
  415.  
  416. 00E17E 20 C1 E1               JSR Pad_Poll_Hi        ;
  417.  
  418. 00E181 8D 06 21               STA Pixelation        ;
  419.  
  420. 00E184 20 C7 E1               JSR Pad_Poll_Lo        ;
  421.  
  422. 00E187 CA                     DEX             ;
  423.  
  424. 00E188 10 F4                  BPL $00E17E        ;
  425.  
  426. 00E18A 18                     CLC             ;
  427.  
  428. 00E18B 69 10                  ADC #$10            ;
  429.  
  430. 00E18D C9 01                  CMP #$01            ;
  431.  
  432. 00E18F D0 EA                  BNE $00E17B        ;
  433.  
  434.  
  435.  
  436. 00E191 20 40 E2               JSR $00E240        ;
  437.  
  438. 00E194 20 C7 E1               JSR Pad_Poll_Lo        ;
  439.  
  440.  
  441.  
  442. 00E197 20 C1 E1               JSR Pad_Poll_Hi        ; wait for b7 pad_poll to go hi.
  443.  
  444. 00E19A 20 13 E2               JSR PROC_B        ;
  445.  
  446.  
  447.  
  448. 00E19D A9 F1                  LDA #$F1               ;
  449.  
  450. 00E19F A2 01 00               LDX #$0001        ; 'Reverse Pixelate' the text into vision
  451.  
  452. 00E1A2 20 C1 E1               JSR Pad_Poll_Hi       ;
  453.  
  454. 00E1A5 8D 06 21               STA Pixelation        ;
  455.  
  456. 00E1A8 20 C7 E1               JSR Pad_Poll_Lo        ;
  457.  
  458. 00E1AB CA                     DEX                    ;
  459.  
  460. 00E1AC 10 F4                  BPL $00E1A2            ;
  461.  
  462. 00E1AE 38                     SEC                    ;
  463.  
  464. 00E1AF E9 10                  SBC #$10               ;
  465.  
  466. 00E1B1 C9 F1                  CMP #$F1               ;
  467.  
  468. 00E1B3 D0 EA                  BNE $00E19F            ;
  469.  
  470.  
  471.  
  472. 00E1B5 20 C1 E1               JSR Pad_Poll_Hi        ;
  473.  
  474. 00E1B8 9C 06 21               STZ Pixelation         ; set pixels to normal.
  475.  
  476. 00E1BB 20 C7 E1               JSR Pad_Poll_Lo        ;
  477.  
  478. 00E1BE 4C 60 E1               JMP $00E160        ; and jump into the main loop
  479.  
  480. ------------------------------------------------
  481.  
  482. 00E1C1 2C 12 42 Pad_Poll_Hi   BIT Pad_Poll        ; wait until bit 7 of pad_ready goes hi
  483.  
  484. 00E1C4 10 FB                  BPL Pad_Poll_Hi        ;
  485.  
  486. 00E1C6 60                     RTS            ;
  487.  
  488. ------------------------------------------------
  489.  
  490. 00E1C7 2C 12 42 Pad_Poll_Lo   BIT Pad_Poll        ;
  491.  
  492. 00E1CA 30 FB                  BMI Pad_Poll_Lo           ; wait until bit 7 of pad_ready goes lo
  493.  
  494. 00E1CC 60                     RTS             ;
  495.  
  496. ------------------------------------------------
  497.  
  498. 00E1CD C2 20    PROC_A        REP #$20            ; 16 bit accum.
  499.  
  500. 00E1CF A2 00 00               LDX #$0000        ;
  501.  
  502.  
  503.  
  504. 00E1D2 A9 FF 7F               LDA #$7FFF        ;
  505.  
  506. 00E1D5 E4 0B                  CPX $0B            ;
  507.  
  508. 00E1D7 F0 07                  BEQ $00E1E0        ; set up table of $7fff in memory
  509.  
  510. 00E1D9 9D B0 0D               STA $0DB0,X        ;
  511.  
  512. 00E1DC E8                     INX             ;
  513.  
  514. 00E1DD E8                     INX             ;
  515.  
  516. 00E1DE 80 F5                  BRA $00E1D5        ;
  517.  
  518. 00E1E0 A0 00 00               LDY #$0000        ; and then follow the table with 5 zeros
  519.  
  520. 00E1E3 B9 C3 E2               LDA $E2C3,Y           ;
  521.  
  522.  
  523.  
  524. 00E1E6 9D B0 0D               STA $0DB0,X        ;
  525.  
  526. 00E1E9 C8                     INY             ;
  527.  
  528. 00E1EA C8                     INY             ;
  529.  
  530. 00E1EB E8                     INX             ;
  531.  
  532. 00E1EC E8                     INX             ;
  533.  
  534. 00E1ED C0 10 00               CPY #$0010        ;
  535.  
  536. 00E1F0 D0 F1                  BNE $00E1E3        ;
  537.  
  538.  
  539.  
  540. 00E1F2 A9 FF 7F               LDA #$7FFF        ; and if x<>$90 then add more $7fff's
  541.  
  542. 00E1F5 E0 90 00               CPX #$0090        ;
  543.  
  544. 00E1F8 F0 07                  BEQ $00E201        ;
  545.  
  546. 00E1FA 9D B0 0D               STA $0DB0,X        ;
  547.  
  548. 00E1FD E8                     INX             ;
  549.  
  550. 00E1FE E8                     INX             ;
  551.  
  552. 00E1FF 80 F4                  BRA $00E1F5        ;
  553.  
  554. ------------------------------------------------
  555.  
  556. 00E201 A6 07                  LDX $07            ; preserve old pad data
  557.  
  558. 00E203 AD 18 42               LDA Pad_0_Data_Lo        ; get new data
  559.  
  560. 00E206 85 07                  STA $07            ; and store it as the old
  561.  
  562. 00E208 8A                     TXA             ; wop it in accum.
  563.  
  564. 00E209 49 FF FF               EOR #$FFFF        ; not the old data
  565.  
  566. 00E20C 25 07                  AND $07            ; and then use as a mask on new data
  567.  
  568. 00E20E 85 09                  STA $09            ; and then store in 9
  569.  
  570. 00E210 E2 20                  SEP #$20            ; and back to 8 bit accum..
  571.  
  572. 00E212 60                     RTS             ; and back..
  573.  
  574. ------------------------------------------------
  575.  
  576. 00E213 9C 15 21 PROC_B        STZ Video_Port_Control    ; Reset Video Port
  577.  
  578. 00E216 A9 04                  LDA #$04              ;
  579.  
  580. 00E218 9C 16 21               STZ Video_Port_Addr    ; set video ram pointer to $400
  581.  
  582. 00E21B 8D 17 21               STA Video_Port_Addr_Hi    ;
  583.  
  584. 00E21E 9C 19 21               STZ Video_Port_Data_Hi    ;
  585.  
  586. 00E221 9C 00 43               STZ DMA_Control_0        ; reset dma controller #0
  587.  
  588. 00E224 A9 18                  LDA #$18            ;
  589.  
  590. 00E226 8D 01 43               STA DMA_Destination_0    ; point dma #0 to vram
  591.  
  592. 00E229 A2 00 04               LDX #$0400        ;
  593.  
  594. 00E22C 8E 02 43               STX DMA_Source_Addr_0    ; copy from address $400 to vram
  595.  
  596. 00E22F 9C 04 43               STZ DMA_Source_Bank_0    ;
  597.  
  598. 00E232 A2 00 04               LDX #$0400        ; copy $400 bytes into vram
  599.  
  600. 00E235 8E 05 43               STX DMA_Size_0        ;
  601.  
  602. 00E238 A9 01                  LDA #$01            ; and enable dma #0
  603.  
  604. 00E23A 8D 0B 42               STA DMA_Enable        ;
  605.  
  606. 00E23D 60                     RTS 
  607.  
  608. ------------------------------------------------
  609.  
  610. 00E23E 86 00    DO_TEXT       STX $00                  ; store text location
  611.  
  612. 00E240 A2 00 04               LDX #$0400               ; set pointer to text
  613.  
  614. 00E243 86 02                  STX $02                  ; store text location again
  615.  
  616. 00E245 64 06                  STZ $06            ; clear 6
  617.  
  618. 00E247 A2 00 00               LDX #$0000        ; 
  619.  
  620. 00E24A B2 00                  LDA ($00)            ; get next char
  621.  
  622. 00E24C 30 55                  BMI $00E2A3              ; if bit 7 set then off we go..
  623.  
  624. 00E24E C9 20                  CMP #$20            ; is it a space
  625.  
  626. 00E250 90 11                  BCC $00E263              ; branch if less than a space..
  627.  
  628. 00E252 92 02                  STA ($02)                ; store char
  629.  
  630. 00E254 E8                     INX             ;
  631.  
  632. 00E255 E6 00                  INC $00                  ; next char
  633.  
  634. 00E257 D0 02                  BNE $00E25B        ;
  635.  
  636. 00E259 E6 01                  INC $01            ;
  637.  
  638. 00E25B E6 02                  INC $02                  ; next dest spot
  639.  
  640. 00E25D D0 EB                  BNE $00E24A        ;
  641.  
  642. 00E25F E6 03                  INC $03            ; 
  643.  
  644. 00E261 80 E7                  BRA $00E24A        ;
  645.  
  646. ------------------------------------------------
  647.  
  648. 00E263 E6 00                  INC $00                  ; increment counter 
  649.  
  650. 00E265 D0 02                  BNE $00E269              ; if not end of 255 boundary skip
  651.  
  652. 00E267 E6 01                  INC $01            ; increment hi byte of pointer
  653.  
  654. 00E269 48                     PHA             ;
  655.  
  656. 00E26A A9 20                  LDA #$20            ;
  657.  
  658. 00E26C E0 20                  CPX #$0020        ; 
  659.  
  660. 00E26F F0 0B                  BEQ $E27C            ;
  661.  
  662. 00E271 92 02                  STA ($02)            ; basically these routines strip
  663.  
  664. 00E273 E8                     INX             ; chars unnecessary and prepare the
  665.  
  666. 00E274 E6 02                  INC $02            ; text for output..
  667.  
  668. 00E276 D0 F4                  BNE $00E26C        ;
  669.  
  670. 00E278 E6 03                  INC $03            ; these lines increment the 16 bit pointer
  671.  
  672. 00E27A 80 F0                  BRA $00E26C        ; as 2 8 bit pointers
  673.  
  674. ------------------------------------------------
  675.  
  676. 00E27C 68                     PLA             ;
  677.  
  678. 00E27D A2 00 00               LDX #$0000        ;
  679.  
  680. 00E280 E6 06                  INC $06            ;
  681.  
  682. 00E282 C5 06                  CMP $06            ;
  683.  
  684. 00E284 D0 E3                  BNE $00E269        ;
  685.  
  686. 00E286 B2 00                  LDA ($00)            ;
  687.  
  688. 00E288 E6 00                  INC $00            ;
  689.  
  690. 00E28A D0 02                  BNE $00E28E        ;
  691.  
  692. 00E28C E6 01                  INC $01            ;
  693.  
  694. 00E28E 85 0D                  STA $0D            ;
  695.  
  696. 00E290 64 0E                  STZ $0E            ;
  697.  
  698. 00E292 A9 20                  LDA #$20            ;
  699.  
  700. 00E294 E4 0D                  CPX $0D            ;
  701.  
  702. 00E296 F0 B2                  BEQ $00E24A        ;
  703.  
  704. 00E298 92 02                  STA ($02)            ;
  705.  
  706. 00E29A E8                     INX             ;
  707.  
  708. 00E29B E6 02                  INC $02            ;
  709.  
  710. 00E29D D0 02                  BNE $00E2A1        ; and again increment pointer as 2 8 bit
  711.  
  712. 00E29F E6 03                  INC $03            ;
  713.  
  714. 00E2A1 80 F1                  BRA $00E294        ;
  715.  
  716. ------------------------------------------------
  717.  
  718. 00E2A3 A5 06                  LDA $06            ;
  719.  
  720. 00E2A5 C9 20                  CMP #$20            ;
  721.  
  722. 00E2A7 F0 19                  BEQ $00E2C2        ;
  723.  
  724. 00E2A9 A9 20                  LDA #$20            ;
  725.  
  726. 00E2AB E0 20                  CPX #$0020        ;
  727.  
  728. 00E2AE F0 0B                  BEQ $E2BB            ;
  729.  
  730. 00E2B0 92 02                  STA ($02)            ;
  731.  
  732. 00E2B2 E8                     INX             ;
  733.  
  734. 00E2B3 E6 02                  INC $02            ;
  735.  
  736. 00E2B5 D0 F4                  BNE $00E2AB        ;
  737.  
  738. 00E2B7 E6 03                  INC $03            ;
  739.  
  740. 00E2B9 80 F0                  BRA $00E2AB        ;
  741.  
  742. ------------------------------------------------
  743.  
  744. 00E2BB A2 00 00               LDX #$0000        ;
  745.  
  746. 00E2BE E6 06                  INC $06            ;
  747.  
  748. 00E2C0 80 E1                  BRA $00E2A3        ;
  749.  
  750. 00E2C2 60                     RTS             ;
  751.  
  752. ------------------------------------------------
  753.  
  754.  
  755.  
  756. The End..
  757.  
  758.